wireguard-apple/wireguard-go-bridge/wireguard.h

22 lines
599 B
C
Raw Normal View History

2018-06-09 01:14:34 +00:00
/* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2018 WireGuard LLC. All Rights Reserved.
2018-06-09 01:14:34 +00:00
*/
#ifndef WIREGUARD_H
#define WIREGUARD_H
#include <sys/types.h>
2018-10-26 22:57:58 +00:00
#include <stdint.h>
2018-06-09 01:14:34 +00:00
typedef struct { const char *p; size_t n; } gostring_t;
typedef void(*logger_fn_t)(int level, const char *msg);
2018-06-09 01:14:34 +00:00
extern void wgSetLogger(logger_fn_t logger_fn);
extern int wgTurnOn(gostring_t ifname, gostring_t settings, int32_t tun_fd);
2018-06-09 01:14:34 +00:00
extern void wgTurnOff(int handle);
2018-12-11 23:45:50 +00:00
extern int64_t wgSetConfig(int handle, gostring_t settings);
extern uint16_t wgGetListenPort(int handle);
2018-08-27 20:32:47 +00:00
extern char *wgVersion();
2018-06-09 01:14:34 +00:00
#endif