blob: 30073869204913d04bddb79c1599fd81a5653b48 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#ifndef _BIRD_WIREGUARD_H
#define _BIRD_WIREGUARD_H
#include "nest/protocol.h"
#include "sysdep/linux/wireguard.h"
#ifdef LOCAL_DEBUG
#define WG_FORCE_DEBUG 1
#else
#define WG_FORCE_DEBUG 0
#endif
#define WG_TRACE(flags, msg, args...) do { if ((p->p.debug & flags) || WG_FORCE_DEBUG) \
log(L_TRACE "%s: " msg, p->p.name , ## args ); } while(0)
struct peer_config {
node n;
const char *public_key;
u16 listen_port;
ip_addr endpoint;
u16 remote_port;
struct net_addr allowedip;
};
struct wg_config {
struct proto_config c;
const char *ifname;
const char *socket_path;
const char *private_key;
u16 tunnel_type;
u16 listen_port;
list peers;
};
struct wg_proto {
struct proto p;
struct iface *iface;
wg_key private_key;
wg_device *dev;
};
struct wg_channel_config {
struct channel_config c;
};
struct wg_channel {
struct channel c;
struct fib rtable;
};
struct wg_entry {
bool is_tunnel_ep;
wg_key public_key;
struct fib_node n;
};
extern struct channel_class channel_wg;
struct peer_config *peer_new(struct wg_config *c);
#endif /* _BIRD_WIREGUARD_H */
|