summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2019-02-28 00:44:40 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2019-02-28 00:44:40 +0100
commit7b42938143dc02a085a5a63c7d4aa310a6695895 (patch)
tree5537a8a7165530c1ad0a8092d4e76e22b263d383 /nest
parent7c36eb3e8bd7d06f65dc7319d42b6abe782c5b89 (diff)
Wireguard: Initial commitold/wireguard-initial
Diffstat (limited to 'nest')
-rw-r--r--nest/proto.c3
-rw-r--r--nest/protocol.h4
-rw-r--r--nest/route.h11
3 files changed, 17 insertions, 1 deletions
diff --git a/nest/proto.c b/nest/proto.c
index d4a333d0..ccde5d9d 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -1382,6 +1382,9 @@ protos_build(void)
#ifdef CONFIG_PERF
proto_build(&proto_perf);
#endif
+#ifdef CONFIG_WIREGUARD
+ proto_build(&proto_wireguard);
+#endif
proto_pool = rp_new(&root_pool, "Protocols");
proto_shutdown_timer = tm_new(proto_pool);
diff --git a/nest/protocol.h b/nest/protocol.h
index 6c04071b..1fdfb380 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -53,6 +53,7 @@ enum protocol_class {
PROTOCOL_RIP,
PROTOCOL_RPKI,
PROTOCOL_STATIC,
+ PROTOCOL_WG,
PROTOCOL__MAX
};
@@ -102,7 +103,8 @@ void protos_dump_all(void);
extern struct protocol
proto_device, proto_radv, proto_rip, proto_static, proto_mrt,
proto_ospf, proto_perf,
- proto_pipe, proto_bgp, proto_bfd, proto_babel, proto_rpki;
+ proto_pipe, proto_bgp, proto_bfd, proto_babel, proto_rpki,
+ proto_wireguard;
/*
* Routing Protocol Instance
diff --git a/nest/route.h b/nest/route.h
index 8dfbb376..ad89e4b2 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -13,6 +13,10 @@
#include "lib/resource.h"
#include "lib/net.h"
+#ifdef CONFIG_WIREGUARD
+# include "sysdep/linux/wireguard.h"
+#endif /* CONFIG_WIREGUARD */
+
struct ea_list;
struct protocol;
struct proto;
@@ -203,6 +207,13 @@ struct hostentry {
byte dest; /* Chosen route destination type (RTD_...) */
byte nexthop_linkable; /* Nexthop list is completely non-device */
u32 igp_metric; /* Chosen route IGP metric */
+#ifdef CONFIG_WIREGUARD
+ union {
+ struct {
+ wg_key pub_key;
+ } wg;
+ } u;
+#endif
};
typedef struct rte {