X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fikev2%2Fikev2_cli.c;h=a48828d349904c4caca93ec43c9f8d68e6c7e12a;hb=282872127bbeee6ae59ab3f885c09bad601ee0cc;hp=8801793be0b0e5cf537346656c48206687c03b53;hpb=7c44d78ef2e7bf0c8714be4184511ed8f23ff239;p=vpp.git diff --git a/src/plugins/ikev2/ikev2_cli.c b/src/plugins/ikev2/ikev2_cli.c index 8801793be0b..a48828d3499 100644 --- a/src/plugins/ikev2/ikev2_cli.c +++ b/src/plugins/ikev2/ikev2_cli.c @@ -184,6 +184,7 @@ ikev2_profile_add_del_command_fn (vlib_main_t * vm, ip4_address_t ip4; ip4_address_t end_addr; u32 responder_sw_if_index = (u32) ~ 0; + u32 tun_sw_if_index = (u32) ~ 0; ip4_address_t responder_ip4; ikev2_transform_encr_type_t crypto_alg; ikev2_transform_integ_type_t integ_alg; @@ -326,6 +327,13 @@ ikev2_profile_add_del_command_fn (vlib_main_t * vm, responder_ip4); goto done; } + else if (unformat (line_input, "set %U tunnel %U", + unformat_token, valid_chars, &name, + unformat_vnet_sw_interface, vnm, &tun_sw_if_index)) + { + r = ikev2_set_profile_tunnel_interface (vm, name, tun_sw_if_index); + goto done; + } else if (unformat (line_input, @@ -384,6 +392,7 @@ VLIB_CLI_COMMAND (ikev2_profile_add_del_command, static) = { "ikev2 profile set auth [rsa-sig|shared-key-mic] [cert-file|string|hex]" " \n" "ikev2 profile set id \n" + "ikev2 profile set tunnel \n" "ikev2 profile set traffic-selector ip-range " " - port-range - " "protocol \n" @@ -465,6 +474,9 @@ show_ikev2_profile_command_fn (vlib_main_t * vm, format_ip4_address, &p->rem_ts.end_addr, p->rem_ts.start_port, p->rem_ts.end_port, p->rem_ts.protocol_id); + if (~0 != p->tun_itf) + vlib_cli_output(vm, " protected tunnel %U", + format_vnet_sw_if_index_name, vnet_get_main(), p->tun_itf); })); /* *INDENT-ON* */ @@ -584,14 +596,46 @@ VLIB_CLI_COMMAND (ikev2_initiate_command, static) = { }; /* *INDENT-ON* */ +void +ikev2_cli_reference (void) +{ +} -clib_error_t * -ikev2_cli_init (vlib_main_t * vm) +static clib_error_t * +ikev2_set_log_level_command_fn (vlib_main_t * vm, + unformat_input_t * input, + vlib_cli_command_t * cmd) { - return 0; + unformat_input_t _line_input, *line_input = &_line_input; + u8 log_level = IKEV2_LOG_NONE; + clib_error_t *error = 0; + + /* Get a line of input. */ + if (!unformat_user (input, unformat_line_input, line_input)) + return 0; + + if (!unformat (line_input, "%d", &log_level)) + { + error = clib_error_return (0, "unknown input '%U'", + format_unformat_error, line_input); + goto done; + } + int rc = ikev2_set_log_level (log_level); + if (rc < 0) + error = clib_error_return (0, "setting log level failed!"); + +done: + unformat_free (line_input); + return error; } -VLIB_INIT_FUNCTION (ikev2_cli_init); +/* *INDENT-OFF* */ +VLIB_CLI_COMMAND (ikev2_set_log_level_command, static) = { + .path = "ikev2 set logging level", + .function = ikev2_set_log_level_command_fn, + .short_help = "ikev2 set logging level <0-5>", +}; +/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON