X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fikev2%2Fikev2_test.c;h=b63778ed103d87d69b44472f638eddd53ef6fd4a;hb=af2cc6425;hp=d9f5e2256b6ba86ca388471a0c622f7bf7b964ac;hpb=d7fc12f07313f9147159f2562f6fcc928af7a963;p=vpp.git diff --git a/src/plugins/ikev2/ikev2_test.c b/src/plugins/ikev2/ikev2_test.c index d9f5e2256b6..b63778ed103 100644 --- a/src/plugins/ikev2/ikev2_test.c +++ b/src/plugins/ikev2/ikev2_test.c @@ -1017,7 +1017,7 @@ static int api_ikev2_profile_set_udp_encap (vat_main_t * vam) { unformat_input_t *i = vam->input; - vl_api_ikev2_set_responder_t *mp; + vl_api_ikev2_profile_set_udp_encap_t *mp; int ret; u8 *name = 0; @@ -1060,6 +1060,53 @@ api_ikev2_set_tunnel_interface (vat_main_t * vam) return (0); } +static int +api_ikev2_set_responder_hostname (vat_main_t *vam) +{ + unformat_input_t *i = vam->input; + vl_api_ikev2_set_responder_hostname_t *mp; + int ret; + u8 *name = 0, *hn = 0; + + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) + { + if (unformat (i, "%U hostname %v", unformat_token, valid_chars, &name, + &hn)) + { + vec_add1 (name, 0); + vec_add1 (hn, 0); + } + else + { + errmsg ("parse error '%U'", format_unformat_error, i); + return -99; + } + } + + if (!vec_len (name)) + { + errmsg ("profile name must be specified"); + return -99; + } + + if (vec_len (name) > 64) + { + errmsg ("profile name too long"); + return -99; + } + + M (IKEV2_SET_RESPONDER_HOSTNAME, mp); + + clib_memcpy (mp->name, name, vec_len (name)); + clib_memcpy (mp->hostname, hn, vec_len (hn)); + vec_free (name); + vec_free (hn); + + S (mp); + W (ret); + return ret; +} + static int api_ikev2_set_responder (vat_main_t * vam) {