-static clib_error_t *
-set_ipsec_sa_key_command_fn (vlib_main_t * vm,
- unformat_input_t * input,
- vlib_cli_command_t * cmd)
-{
- unformat_input_t _line_input, *line_input = &_line_input;
- clib_error_t *error = NULL;
- ipsec_key_t ck, ik;
- u32 id;
-
- if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
-
- while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
- {
- if (unformat (line_input, "%u", &id))
- ;
- else
- if (unformat (line_input, "crypto-key %U", unformat_ipsec_key, &ck))
- ;
- else if (unformat (line_input, "integ-key %U", unformat_ipsec_key, &ik))
- ;
- else
- {
- error = clib_error_return (0, "parse error: '%U'",
- format_unformat_error, line_input);
- goto done;
- }
- }
-
- ipsec_set_sa_key (id, &ck, &ik);
-
-done:
- unformat_free (line_input);
-
- return error;
-}
-
-/* *INDENT-OFF* */
-VLIB_CLI_COMMAND (set_ipsec_sa_key_command, static) = {
- .path = "set ipsec sa",
- .short_help = "set ipsec sa <id> crypto-key <key> integ-key <key>",
- .function = set_ipsec_sa_key_command_fn,
-};
-/* *INDENT-ON* */
-