summaryrefslogtreecommitdiffstats
path: root/vpp-api-test/vat
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2016-07-10 20:09:32 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-07-11 23:02:43 +0000
commit71893ac8b765dd997452fc58aedb6e0bd7b79a25 (patch)
tree5cbc8afaeec4333e556cfb0b93543181c699b961 /vpp-api-test/vat
parentefc33309594bc1e13dd30534b7658191c2abbca7 (diff)
Simplify API to add LISP adjacencies
The API to add an adjacency requires that two things be provided 1) a local and a remote eid 2) the whole remote mapping for the remote eid. Since the API to add remote mappings can be used for 2), 1) in combination with this API are enough to add an adjacency. Change-Id: Ibe7474924bc3f28b6aed19cefa78fdb812de5eac Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'vpp-api-test/vat')
-rw-r--r--vpp-api-test/vat/api_format.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index dd428966..a911e8a0 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -10790,15 +10790,13 @@ api_lisp_add_del_adjacency (vat_main_t * vam)
vl_api_lisp_add_del_adjacency_t *mp;
f64 timeout = ~0;
u32 vni = 0;
- ip4_address_t seid4, deid4, rloc4;
- ip6_address_t seid6, deid6, rloc6;
+ ip4_address_t seid4, deid4;
+ ip6_address_t seid6, deid6;
u8 deid_mac[6] = {0};
u8 seid_mac[6] = {0};
u8 deid_type, seid_type;
u32 seid_len = 0, deid_len = 0, len;
u8 is_add = 1;
- u32 action = ~0, p, w;
- rloc_t * rlocs = 0, rloc, * curr_rloc = 0;
seid_type = deid_type = (u8)~0;
@@ -10832,25 +10830,6 @@ api_lisp_add_del_adjacency (vat_main_t * vam)
seid_type = 2; /* mac */
} else if (unformat(input, "vni %d", &vni)) {
;
- } else if (unformat(input, "p %d w %d", &p, &w)) {
- if (!curr_rloc) {
- errmsg ("No RLOC configured for setting priority/weight!");
- return -99;
- }
- curr_rloc->priority = p;
- curr_rloc->weight = w;
- } else if (unformat(input, "rloc %U", unformat_ip4_address, &rloc4)) {
- rloc.is_ip4 = 1;
- clib_memcpy (&rloc.addr, &rloc4, sizeof (rloc4));
- vec_add1 (rlocs, rloc);
- curr_rloc = &rlocs[vec_len (rlocs) - 1];
- } else if (unformat(input, "rloc %U", unformat_ip6_address, &rloc6)) {
- rloc.is_ip4 = 0;
- clib_memcpy (&rloc.addr, &rloc6, sizeof (rloc6));
- vec_add1 (rlocs, rloc);
- curr_rloc = &rlocs[vec_len (rlocs) - 1];
- } else if (unformat(input, "action %d", &action)) {
- ;
} else {
errmsg ("parse error '%U'", format_unformat_error, input);
return -99;
@@ -10867,17 +10846,10 @@ api_lisp_add_del_adjacency (vat_main_t * vam)
return -99;
}
- if (is_add && (~0 == action)
- && 0 == vec_len (rlocs)) {
- errmsg ("no action set for negative map-reply!");
- return -99;
- }
-
M(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency);
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_type = deid_type;
@@ -10899,10 +10871,6 @@ api_lisp_add_del_adjacency (vat_main_t * vam)
return 0;
}
- mp->rloc_num = vec_len (rlocs);
- clib_memcpy (mp->rlocs, rlocs, (sizeof (rloc_t) * vec_len (rlocs)));
- vec_free (rlocs);
-
/* send it... */
S;