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-08-27 20:32:47 +00:00
|
|
|
typedef ssize_t(*read_write_fn_t)(void *ctx, unsigned char *buf, size_t len);
|
2018-06-09 01:14:34 +00:00
|
|
|
typedef void(*logger_fn_t)(int level, const char *tag, const char *msg);
|
|
|
|
extern void wgSetLogger(logger_fn_t logger_fn);
|
2018-10-26 22:57:58 +00:00
|
|
|
extern int wgTurnOn(gostring_t ifname, gostring_t settings, uint16_t mtu, read_write_fn_t read_fn, read_write_fn_t write_fn, void *ctx);
|
2018-06-09 01:14:34 +00:00
|
|
|
extern void wgTurnOff(int handle);
|
2018-08-27 20:32:47 +00:00
|
|
|
extern char *wgVersion();
|
2018-06-09 01:14:34 +00:00
|
|
|
|
|
|
|
#endif
|