summaryrefslogtreecommitdiffstats
path: root/vpp-api-test/vat
diff options
context:
space:
mode:
authorAndrej Kozemcak <akozemca@cisco.com>2016-07-22 12:54:12 +0200
committerFlorin Coras <florin.coras@gmail.com>2016-07-28 10:52:34 +0000
commit438109d576bd47a2095f2889b708306d37067d50 (patch)
treea9f4f2e2afe9904a913b9b00f32a76bcacf78dd0 /vpp-api-test/vat
parentd983118bf6a5c5f09941946083e654f994b579fb (diff)
LISP - Bug fix, can`t remove static remote mapping
Fix bug, can`t remove static remote mapping, small update in LISP remote mapping API. Change-Id: Ide32485a1a0d2cf08829d544500fa2755214b8cc Signed-off-by: Andrej Kozemcak <akozemca@cisco.com>
Diffstat (limited to 'vpp-api-test/vat')
-rw-r--r--vpp-api-test/vat/api_format.c72
1 files changed, 35 insertions, 37 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index b9ee377e305..0b6cf7fd1b6 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -11280,17 +11280,18 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam)
vl_api_lisp_add_del_remote_mapping_t *mp;
f64 timeout = ~0;
u32 vni = 0;
- ip4_address_t seid4, deid4, rloc4;
- ip6_address_t seid6, deid6, rloc6;
- u8 deid_mac[6] = {0};
+ //TODO: seid need remove
+ ip4_address_t seid4, eid4, rloc4;
+ ip6_address_t seid6, eid6, rloc6;
+ u8 eid_mac[6] = {0};
u8 seid_mac[6] = {0};
- u8 deid_type, seid_type;
- u32 seid_len = 0, deid_len = 0, len;
+ u8 eid_type;
+ u32 eid_len = 0, len;
u8 is_add = 1, del_all = 0;
u32 action = ~0, p, w;
rloc_t * rlocs = 0, rloc, * curr_rloc = 0;
- seid_type = deid_type = (u8)~0;
+ eid_type = (u8)~0;
/* Parse args required to build the message */
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) {
@@ -11301,27 +11302,33 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam)
} else if (unformat(input, "add")) {
is_add = 1;
} else if (unformat(input, "deid %U/%d", unformat_ip4_address,
- &deid4, &len)) {
- deid_type = 0; /* ipv4 */
- deid_len = len;
+ &eid4, &len)) {
+ eid_type = 0; /* ipv4 */
+ if (32 < len) {
+ clib_warning ("Deid prefix length to big, %d!", len);
+ return -99;
+ }
+ eid_len = len;
} else if (unformat(input, "deid %U/%d", unformat_ip6_address,
- &deid6, &len)) {
- deid_type = 1; /* ipv6 */
- deid_len = len;
+ &eid6, &len)) {
+ eid_type = 1; /* ipv6 */
+ if (128 < len) {
+ clib_warning ("Deid prefix length to big, %d!", len);
+ return -99;
+ }
+ eid_len = len;
} else if (unformat(input, "deid %U", unformat_ethernet_address,
- deid_mac)) {
- deid_type = 2; /* mac */
+ eid_mac)) {
+ eid_type = 2; /* mac */
+ //TODO: Need remove, but first must be remove from CSIT test
} else if (unformat(input, "seid %U/%d", unformat_ip4_address,
&seid4, &len)) {
- seid_type = 0; /* ipv4 */
- seid_len = len;
} else if (unformat(input, "seid %U/%d", unformat_ip6_address,
&seid6, &len)) {
- seid_type = 1; /* ipv6 */
- seid_len = len;
+ ;
} else if (unformat(input, "seid %U", unformat_ethernet_address,
seid_mac)) {
- seid_type = 2; /* mac */
+ ;
} else if (unformat(input, "vni %d", &vni)) {
;
} else if (unformat(input, "p %d w %d", &p, &w)) {
@@ -11349,16 +11356,11 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam)
}
}
- if ((u8)~0 == deid_type) {
+ if ((u8)~0 == eid_type) {
errmsg ("missing params!");
return -99;
}
- if (seid_type != deid_type) {
- errmsg ("source and destination EIDs are of different types!");
- return -99;
- }
-
if (is_add && (~0 == action)
&& 0 == vec_len (rlocs)) {
errmsg ("no action set for negative map-reply!");
@@ -11368,24 +11370,20 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam)
M(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping);
mp->is_add = is_add;
mp->vni = htonl (vni);
- mp->seid_len = seid_len;
mp->action = (u8) action;
- mp->deid_len = deid_len;
+ mp->eid_len = eid_len;
mp->del_all = del_all;
- mp->eid_type = deid_type;
+ mp->eid_type = eid_type;
switch (mp->eid_type) {
case 0:
- clib_memcpy (mp->seid, &seid4, sizeof (seid4));
- clib_memcpy (mp->deid, &deid4, sizeof (deid4));
+ clib_memcpy (mp->eid, &eid4, sizeof (eid4));
break;
case 1:
- clib_memcpy (mp->seid, &seid6, sizeof (seid6));
- clib_memcpy (mp->deid, &deid6, sizeof (deid6));
+ clib_memcpy (mp->eid, &eid6, sizeof (eid6));
break;
case 2:
- clib_memcpy (mp->seid, seid_mac, 6);
- clib_memcpy (mp->deid, deid_mac, 6);
+ clib_memcpy (mp->eid, eid_mac, 6);
break;
default:
errmsg ("unknown EID type %d!", mp->eid_type);
@@ -13591,10 +13589,10 @@ _(lisp_add_del_map_resolver, "<ip4|6-addr> [del]") \
_(lisp_gpe_enable_disable, "enable|disable") \
_(lisp_enable_disable, "enable|disable") \
_(lisp_gpe_add_del_iface, "up|down") \
-_(lisp_add_del_remote_mapping, "add|del vni <vni> deid <dest-eid> seid" \
- " <src-eid> rloc <locator> p <prio> " \
+_(lisp_add_del_remote_mapping, "add|del vni <vni> deid <dest-eid> " \
+ "rloc <locator> p <prio> " \
"w <weight> [rloc <loc> ... ] " \
- "action <action>") \
+ "action <action> [del-all]") \
_(lisp_add_del_adjacency, "add|del vni <vni> deid <dest-eid> seid " \
"<src-eid> rloc <locator> p <prio> w <weight>"\
"[rloc <loc> ... ] action <action>") \