diff --git a/WireGuardNetworkExtension/WireGuardGoWrapper.h b/WireGuardNetworkExtension/WireGuardGoWrapper.h index b9038b4..b6858d3 100644 --- a/WireGuardNetworkExtension/WireGuardGoWrapper.h +++ b/WireGuardNetworkExtension/WireGuardGoWrapper.h @@ -16,4 +16,6 @@ - (BOOL) turnOnWithInterfaceName: (NSString *)interfaceName settingsString: (NSString *)settingsString; - (void) turnOff; ++ (NSString *)versionWireGuardGo; + @end diff --git a/WireGuardNetworkExtension/WireGuardGoWrapper.m b/WireGuardNetworkExtension/WireGuardGoWrapper.m index cb07c1b..556827c 100644 --- a/WireGuardNetworkExtension/WireGuardGoWrapper.m +++ b/WireGuardNetworkExtension/WireGuardGoWrapper.m @@ -44,6 +44,7 @@ static void do_log(int level, const char *tag, const char *msg); - (BOOL) turnOnWithInterfaceName: (NSString *)interfaceName settingsString: (NSString *)settingsString { + os_log([WireGuardGoWrapper log], "WireGuard Go Version %{public}s", wgVersion()); wgSetLogger(do_log); @@ -61,6 +62,10 @@ static void do_log(int level, const char *tag, const char *msg); wgTurnOff(self.handle); } ++ (NSString *)versionWireGuardGo { + return [NSString stringWithUTF8String:wgVersion()]; +} + + (os_log_t)log { static os_log_t subLog = nil; static dispatch_once_t onceToken;