diff options
-rw-r--r-- | proto/wireguard/wireguard.c | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/proto/wireguard/wireguard.c b/proto/wireguard/wireguard.c index 20a42b5a..bdc76590 100644 --- a/proto/wireguard/wireguard.c +++ b/proto/wireguard/wireguard.c @@ -986,14 +986,67 @@ struct peer_config *peer_new(struct wg_config *c) return pc; } + +static void +wg_channel_init(struct channel *CH, struct channel_config *CHC UNUSED) +{ + struct proto *P = CH->proto; + + /* Create new instance */ + log(L_TRACE "WG: wg_channel_init"); +} + +static int +wg_channel_reconfigure(struct channel *CH, struct channel_config *CHC UNUSED, + int *import_changed UNUSED, int *export_changed UNUSED) +{ + /* Try to reconfigure instance, returns success */ + log(L_TRACE "WG: wg_channel_reconfigure"); + return 1; +} + +static int +wg_channel_start(struct channel *CH) +{ + struct wg_channel *ch UNUSED = (struct wg_channel*)CH; + struct proto *P = CH->proto; + + /* Start the instance */ + log(L_TRACE "WG: wg_channel_start"); +#if 0 + fib_init(&ch->rtable, P->pool, ch->c.net_type, sizeof(struct wg_entry), + OFFSETOF(struct wg_entry, n), 0, wg_init_entry); +#endif + return 1; +} + +static void +wg_channel_shutdown(struct channel *CH) +{ + struct wg_channel *ch UNUSED = (struct wg_channel*)CH; + + /* Stop the instance */ + log(L_TRACE "WG: wg_channel_shutdown"); +} + +static void +wg_channel_cleanup(struct channel *CH) +{ + struct wg_channel *ch UNUSED = (struct wg_channel*)CH; + + /* Channel finished flush */ + log(L_TRACE "WG: wg_channel_cleanup"); +} + + struct channel_class channel_wg = { .channel_size = sizeof(struct wg_channel), .config_size = sizeof(struct wg_channel_config), - /* .init = wg_channel_init, */ - /* .start = wg_channel_start, */ - /* .shutdown = wg_channel_shutdown, */ - /* .cleanup = wg_channel_cleanup, */ - /* .reconfigure = wg_channel_reconfigure, */ + .init = wg_channel_init, + .start = wg_channel_start, + .shutdown = wg_channel_shutdown, + .cleanup = wg_channel_cleanup, + .reconfigure = wg_channel_reconfigure, }; struct protocol proto_wireguard = { |