From 9fa291f1a8c5d5f833d9ed754254eb947864dc87 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Wed, 11 Oct 2023 16:22:49 +0200 Subject: Exports + Server + Python: Expose dns_search_domains See: https://git.sr.ht/~fkooman/vpn-user-portal/commit/f22c736c28fafec19f44f0b70d2b372be93b0f8b Needed for Linux client --- exports/server.h | 3 ++- exports/servers.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'exports') diff --git a/exports/server.h b/exports/server.h index 4bc8a16..f2af70b 100644 --- a/exports/server.h +++ b/exports/server.h @@ -5,8 +5,9 @@ typedef struct serverProfile { const char* id; const char* display_name; - //const char* proto_list; int default_gateway; + const char** dns_search_domains; + size_t total_dns_search_domains; } serverProfile; // The struct for all server profiles diff --git a/exports/servers.go b/exports/servers.go index 73b8b6c..d96d73e 100644 --- a/exports/servers.go +++ b/exports/servers.go @@ -27,6 +27,9 @@ func getCPtrProfile(profile *server.Profile) *C.serverProfile { } else { cProfile.default_gateway = C.int(0) } + cProfile.total_dns_search_domains, cProfile.dns_search_domains = getCPtrListStrings( + profile.DNSSearchDomains, + ) return cProfile } @@ -71,6 +74,7 @@ func FreeProfiles(profiles *C.serverProfiles) { for i := C.size_t(0); i < profiles.total_profiles; i++ { C.free(unsafe.Pointer(profilesSlice[i].id)) C.free(unsafe.Pointer(profilesSlice[i].display_name)) + freeCListStrings(profilesSlice[i].dns_search_domains, profilesSlice[i].total_dns_search_domains) C.free(unsafe.Pointer(profilesSlice[i])) } // Free the inner profiles struct -- cgit v1.2.3