diff options
Diffstat (limited to 'src/plugins/wireguard/wireguard_cli.c')
-rwxr-xr-x | src/plugins/wireguard/wireguard_cli.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/wireguard/wireguard_cli.c b/src/plugins/wireguard/wireguard_cli.c index 16794156d17..3b4bf56a3dc 100755 --- a/src/plugins/wireguard/wireguard_cli.c +++ b/src/plugins/wireguard/wireguard_cli.c @@ -23,6 +23,7 @@ static clib_error_t * wg_if_create_cli (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { + wg_main_t *wmp = &wg_main; unformat_input_t _line_input, *line_input = &_line_input; u8 private_key[NOISE_PUBLIC_KEY_LEN]; u32 instance, sw_if_index; @@ -37,6 +38,8 @@ wg_if_create_cli (vlib_main_t * vm, private_key_64 = 0; port = 0; + wg_feature_init (wmp); + if (unformat_user (input, unformat_line_input, line_input)) { while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -104,10 +107,13 @@ static clib_error_t * wg_if_delete_cli (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { + wg_main_t *wmp = &wg_main; vnet_main_t *vnm; u32 sw_if_index; int rv; + wg_feature_init (wmp); + vnm = vnet_get_main (); sw_if_index = ~0; @@ -151,6 +157,7 @@ wg_peer_add_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { vnet_main_t *vnm = vnet_get_main (); + wg_main_t *wmp = &wg_main; clib_error_t *error = NULL; unformat_input_t _line_input, *line_input = &_line_input; @@ -168,6 +175,8 @@ wg_peer_add_command_fn (vlib_main_t * vm, if (!unformat_user (input, unformat_line_input, line_input)) return 0; + wg_feature_init (wmp); + while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "public-key %s", &public_key_64)) @@ -259,6 +268,7 @@ static clib_error_t * wg_peer_remove_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { + wg_main_t *wmp = &wg_main; clib_error_t *error = NULL; u32 peer_index; int rv; @@ -267,6 +277,8 @@ wg_peer_remove_command_fn (vlib_main_t * vm, if (!unformat_user (input, unformat_line_input, line_input)) return 0; + wg_feature_init (wmp); + if (unformat (line_input, "%d", &peer_index)) ; else @@ -336,6 +348,10 @@ static clib_error_t * wg_show_if_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { + wg_main_t *wmp = &wg_main; + + wg_feature_init (wmp); + wg_if_walk (wg_if_show_one, vm); return NULL; |