2018-06-09 01:14:34 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0
|
|
|
|
*
|
2018-09-06 05:42:23 +00:00
|
|
|
* 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;
|
2018-10-31 02:13:00 +00:00
|
|
|
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);
|
2018-12-21 21:05:47 +00:00
|
|
|
extern int wgTurnOn(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);
|
2018-12-25 21:38:32 +00:00
|
|
|
extern void wgBindInterfaceScope(int handle, int32_t ifscope);
|
2018-08-27 20:32:47 +00:00
|
|
|
extern char *wgVersion();
|
2018-06-09 01:14:34 +00:00
|
|
|
|
|
|
|
#endif
|