Dump and expose WireGuard Go version info.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jeroen Leenarts 2018-08-05 08:05:59 +02:00
parent 2307bf25b5
commit 6cfab94713
2 changed files with 7 additions and 0 deletions

View File

@ -16,4 +16,6 @@
- (BOOL) turnOnWithInterfaceName: (NSString *)interfaceName settingsString: (NSString *)settingsString;
- (void) turnOff;
+ (NSString *)versionWireGuardGo;
@end

View File

@ -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;