From 7b42938143dc02a085a5a63c7d4aa310a6695895 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 28 Feb 2019 00:44:40 +0100 Subject: Wireguard: Initial commit --- nest/proto.c | 3 +++ nest/protocol.h | 4 +++- nest/route.h | 11 +++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'nest') 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 { -- cgit v1.2.3