_(LISP_LOCAL_EID_TABLE_DUMP, lisp_local_eid_table_dump) \
_(LISP_GPE_TUNNEL_DUMP, lisp_gpe_tunnel_dump) \
_(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
+_(LISP_GPE_ENABLE_DISABLE_STATUS_DUMP, \
+ lisp_gpe_enable_disable_status_dump) \
_(SR_MULTICAST_MAP_ADD_DEL, sr_multicast_map_add_del)
#define QUOTE_(x) #x
static void send_bridge_domain_details (unix_shared_memory_queue_t *q,
l2_bridge_domain_t * bd_config,
- u32 n_sw_ifs)
+ u32 n_sw_ifs,
+ u32 context)
{
vl_api_bridge_domain_details_t * mp;
mp->arp_term = bd_feature_arp_term (bd_config);
mp->bvi_sw_if_index = ntohl (bd_config->bvi_sw_if_index);
mp->n_sw_ifs = ntohl (n_sw_ifs);
+ mp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&mp);
}
static void send_bd_sw_if_details (l2input_main_t * l2im,
unix_shared_memory_queue_t *q,
- l2_flood_member_t * member, u32 bd_id)
+ l2_flood_member_t * member, u32 bd_id,
+ u32 context)
{
vl_api_bridge_domain_sw_if_details_t * mp;
l2_input_config_t * input_cfg;
mp->sw_if_index = ntohl (member->sw_if_index);
input_cfg = vec_elt_at_index (l2im->configs, member->sw_if_index);
mp->shg = input_cfg->shg;
+ mp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&mp);
}
l2_flood_member_t * m;
n_sw_ifs = vec_len (bd_config->members);
- send_bridge_domain_details (q, bd_config, n_sw_ifs);
+ send_bridge_domain_details (q, bd_config, n_sw_ifs, mp->context);
vec_foreach (m, bd_config->members) {
- send_bd_sw_if_details (l2im, q, m, bd_config->bd_id);
+ send_bd_sw_if_details (l2im, q, m, bd_config->bd_id, mp->context);
}
}
}
unix_shared_memory_queue_t * q,
u8 * ip,
u16 prefix_length,
- u8 is_ipv6)
+ u8 is_ipv6,
+ u32 context)
{
vl_api_ip_address_details_t * mp;
*tp = ntohl(*(u32*)ip);
}
mp->prefix_length = prefix_length;
+ mp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&mp);
}
({
r6 = ip_interface_address_get_address (lm6, ia);
u16 prefix_length = ia->address_length;
- send_ip_address_details(am, q, (u8*)r6, prefix_length, 1);
+ send_ip_address_details(am, q, (u8*)r6, prefix_length, 1, mp->context);
}));
} else {
foreach_ip_interface_address (lm4, ia, sw_if_index,
({
r4 = ip_interface_address_get_address (lm4, ia);
u16 prefix_length = ia->address_length;
- send_ip_address_details(am, q, (u8*)r4, prefix_length, 0);
+ send_ip_address_details(am, q, (u8*)r4, prefix_length, 0, mp->context);
}));
}
}
static void send_ip_details (vpe_api_main_t * am,
unix_shared_memory_queue_t *q,
- u32 sw_if_index)
+ u32 sw_if_index,
+ u32 context)
{
vl_api_ip_details_t * mp;
mp->_vl_msg_id = ntohs(VL_API_IP_DETAILS);
mp->sw_if_index = ntohl(sw_if_index);
+ mp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&mp);
}
static void send_sw_interface_tap_details (vpe_api_main_t * am,
unix_shared_memory_queue_t *q,
- tapcli_interface_details_t *tap_if)
+ tapcli_interface_details_t *tap_if,
+ u32 context)
{
vl_api_sw_interface_tap_details_t * mp;
mp = vl_msg_api_alloc (sizeof (*mp));
mp->sw_if_index = ntohl(tap_if->sw_if_index);
strncpy((char *)mp->dev_name,
(char *)tap_if->dev_name, ARRAY_LEN(mp->dev_name)-1);
+ mp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&mp);
}
return;
vec_foreach(tap_if, tapifs) {
- send_sw_interface_tap_details(am, q, tap_if);
+ send_sw_interface_tap_details(am, q, tap_if, mp->context);
}
vec_free(tapifs);
continue;
}
sw_if_index = si->sw_if_index;
- send_ip_details(am, q, sw_if_index);
+ send_ip_details(am, q, sw_if_index, mp->context);
}
}
}
}
static void send_vxlan_tunnel_details
-(vxlan_tunnel_t * t, unix_shared_memory_queue_t * q)
+(vxlan_tunnel_t * t, unix_shared_memory_queue_t * q, u32 context)
{
vl_api_vxlan_tunnel_details_t * rmp;
ip4_main_t * im4 = &ip4_main;
rmp->decap_next_index = htonl(t->decap_next_index);
rmp->sw_if_index = htonl(t->sw_if_index);
rmp->is_ipv6 = is_ipv6;
+ rmp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&rmp);
}
if (~0 == sw_if_index) {
pool_foreach (t, vxm->tunnels,
({
- send_vxlan_tunnel_details(t, q);
+ send_vxlan_tunnel_details(t, q, mp->context);
}));
} else {
if ((sw_if_index >= vec_len(vxm->tunnel_index_by_sw_if_index)) ||
return;
}
t = &vxm->tunnels[vxm->tunnel_index_by_sw_if_index[sw_if_index]];
- send_vxlan_tunnel_details(t, q);
+ send_vxlan_tunnel_details(t, q, mp->context);
}
}
}
static void send_gre_tunnel_details
-(gre_tunnel_t * t, unix_shared_memory_queue_t * q)
+(gre_tunnel_t * t, unix_shared_memory_queue_t * q, u32 context)
{
vl_api_gre_tunnel_details_t * rmp;
ip4_main_t * im = &ip4_main;
rmp->dst_address = t->tunnel_dst.data_u32;
rmp->outer_table_id = htonl(im->fibs[t->outer_fib_index].table_id);
rmp->sw_if_index = htonl(t->sw_if_index);
+ rmp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&rmp);
}
if (~0 == sw_if_index) {
pool_foreach (t, gm->tunnels,
({
- send_gre_tunnel_details(t, q);
+ send_gre_tunnel_details(t, q, mp->context);
}));
} else {
if ((sw_if_index >= vec_len(gm->tunnel_index_by_sw_if_index)) ||
return;
}
t = &gm->tunnels[gm->tunnel_index_by_sw_if_index[sw_if_index]];
- send_gre_tunnel_details(t, q);
+ send_gre_tunnel_details(t, q, mp->context);
}
}
decap_next_index = ntohl(mp->decap_next_index);
/* Interpret decap_vrf_id as an opaque if sending to other-than-ip4-input */
- if (decap_next_index == NSH_INPUT_NEXT_IP4_INPUT) {
+ if (decap_next_index == NSH_GRE_INPUT_NEXT_IP4_INPUT) {
p = hash_get (im->fib_index_by_table_id, ntohl(mp->decap_vrf_id));
if (! p) {
rv = VNET_API_ERROR_NO_SUCH_INNER_FIB;
a->encap_fib_index = encap_fib_index;
a->decap_fib_index = decap_fib_index;
a->decap_next_index = decap_next_index;
- a->ver_o_c = mp->ver_o_c;
- a->length = mp->length;
- a->md_type = mp->md_type;
- a->next_protocol = mp->next_protocol;
- a->spi_si = ntohl(mp->spi_si);
- a->c1 = ntohl(mp->c1);
- a->c2 = ntohl(mp->c2);
- a->c3 = ntohl(mp->c3);
- a->c4 = ntohl(mp->c4);
+ a->nsh_hdr.ver_o_c = mp->ver_o_c;
+ a->nsh_hdr.length = mp->length;
+ a->nsh_hdr.md_type = mp->md_type;
+ a->nsh_hdr.next_protocol = mp->next_protocol;
+ a->nsh_hdr.spi_si = ntohl(mp->spi_si);
+ a->nsh_hdr.c1 = ntohl(mp->c1);
+ a->nsh_hdr.c2 = ntohl(mp->c2);
+ a->nsh_hdr.c3 = ntohl(mp->c3);
+ a->nsh_hdr.c4 = ntohl(mp->c4);
for (i = 0; i < mp->tlv_len_in_words; i++)
vec_add1 (tlvs, ntohl(mp->tlvs[i]));
- a->tlvs = tlvs;
+ a->nsh_hdr.tlvs = tlvs;
rv = vnet_nsh_gre_add_del_tunnel (a, &sw_if_index);
decap_next_index = ntohl(mp->decap_next_index);
/* Interpret decap_vrf_id as an opaque if sending to other-than-ip4-input */
- if (decap_next_index == NSH_INPUT_NEXT_IP4_INPUT) {
+ if (decap_next_index == NSH_GRE_INPUT_NEXT_IP4_INPUT) {
p = hash_get (im->fib_index_by_table_id, ntohl(mp->decap_vrf_id));
if (! p) {
rv = VNET_API_ERROR_NO_SUCH_INNER_FIB;
a->decap_fib_index = decap_fib_index;
a->decap_next_index = decap_next_index;
a->vni = ntohl(mp->vni);
- a->ver_o_c = mp->ver_o_c;
- a->length = mp->length;
- a->md_type = mp->md_type;
- a->next_protocol = mp->next_protocol;
- a->spi_si = ntohl(mp->spi_si);
- a->c1 = ntohl(mp->c1);
- a->c2 = ntohl(mp->c2);
- a->c3 = ntohl(mp->c3);
- a->c4 = ntohl(mp->c4);
+ a->nsh_hdr.ver_o_c = mp->ver_o_c;
+ a->nsh_hdr.length = mp->length;
+ a->nsh_hdr.md_type = mp->md_type;
+ a->nsh_hdr.next_protocol = mp->next_protocol;
+ a->nsh_hdr.spi_si = ntohl(mp->spi_si);
+ a->nsh_hdr.c1 = ntohl(mp->c1);
+ a->nsh_hdr.c2 = ntohl(mp->c2);
+ a->nsh_hdr.c3 = ntohl(mp->c3);
+ a->nsh_hdr.c4 = ntohl(mp->c4);
for (i = 0; i < mp->tlv_len_in_words; i++)
vec_add1 (tlvs, ntohl(mp->tlvs[i]));
- a->tlvs = tlvs;
+ a->nsh_hdr.tlvs = tlvs;
rv = vnet_nsh_vxlan_gpe_add_del_tunnel (a, &sw_if_index);
decap_next_index = ntohl(mp->decap_next_index);
/* Interpret decap_vrf_id as an opaque if sending to other-than-ip4-input */
- if (decap_next_index == NSH_INPUT_NEXT_IP4_INPUT) {
+ if (decap_next_index == NSH_GRE_INPUT_NEXT_IP4_INPUT) {
p = hash_get (im->fib_index_by_table_id, ntohl(mp->decap_vrf_id));
if (! p) {
rv = VNET_API_ERROR_NO_SUCH_INNER_FIB;
static void
send_lisp_locator_set_details (lisp_cp_main_t *lcm,
locator_set_t *lsit,
- unix_shared_memory_queue_t *q)
+ unix_shared_memory_queue_t *q,
+ u32 context)
{
vl_api_lisp_locator_set_details_t *rmp;
locator_t *loc = NULL;
rmp->sw_if_index = htonl(loc->sw_if_index);
rmp->priority = loc->priority;
rmp->weight = loc->weight;
+ rmp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&rmp);
}
pool_foreach (lsit, lcm->locator_set_pool,
({
- send_lisp_locator_set_details(lcm, lsit, q);
+ send_lisp_locator_set_details(lcm, lsit, q, mp->context);
}));
}
static void
send_lisp_local_eid_table_details (mapping_t *mapit,
- unix_shared_memory_queue_t *q)
+ unix_shared_memory_queue_t *q,
+ u32 context)
{
vl_api_lisp_local_eid_table_details_t *rmp = NULL;
lisp_cp_main_t * lcm = vnet_lisp_cp_get_main();
ASSERT(0);
}
rmp->eid_prefix_len = ip_prefix_len(ip_prefix);
+ rmp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&rmp);
}
pool_foreach (mapit, lcm->mapping_pool,
({
- send_lisp_local_eid_table_details(mapit, q);
+ send_lisp_local_eid_table_details(mapit, q, mp->context);
}));
}
static void
send_lisp_gpe_tunnel_details (lisp_gpe_tunnel_t *tunnel,
- unix_shared_memory_queue_t *q)
+ unix_shared_memory_queue_t *q,
+ u32 context)
{
vl_api_lisp_gpe_tunnel_details_t *rmp;
lisp_gpe_main_t * lgm = &lisp_gpe_main;
rmp->ver_res = tunnel->ver_res;
rmp->res = tunnel->res;
rmp->iid = htonl(tunnel->vni);
+ rmp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&rmp);
}
pool_foreach(tunnel, lgm->tunnels,
({
- send_lisp_gpe_tunnel_details(tunnel, q);
+ send_lisp_gpe_tunnel_details(tunnel, q, mp->context);
}));
}
static void
send_lisp_map_resolver_details (ip_address_t *ip,
- unix_shared_memory_queue_t *q)
+ unix_shared_memory_queue_t *q,
+ u32 context)
{
vl_api_lisp_map_resolver_details_t *rmp = NULL;
default:
ASSERT(0);
}
+ rmp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&rmp);
}
}
vec_foreach(ip, lcm->map_resolvers) {
- send_lisp_map_resolver_details(ip, q);
+ send_lisp_map_resolver_details(ip, q, mp->context);
+ }
+
+}
+
+static void
+send_lisp_gpe_enable_disable_details (unix_shared_memory_queue_t *q,
+ u32 context)
+{
+ vl_api_lisp_gpe_enable_disable_status_details_t *rmp = NULL;
+ u8 is_en;
+
+ rmp = vl_msg_api_alloc (sizeof (*rmp));
+ memset (rmp, 0, sizeof (*rmp));
+ rmp->_vl_msg_id = ntohs(VL_API_LISP_GPE_ENABLE_DISABLE_STATUS_DETAILS);
+
+ is_en = vnet_lisp_gpe_enable_disable_status();
+ rmp->is_en = is_en;
+ rmp->context = context;
+
+ vl_msg_api_send_shmem (q, (u8 *)&rmp);
+}
+
+static void
+vl_api_lisp_gpe_enable_disable_status_dump_t_handler
+(vl_api_lisp_gpe_enable_disable_status_dump_t *mp)
+{
+ unix_shared_memory_queue_t * q = NULL;
+
+ q = vl_api_client_index_to_input_queue (mp->client_index);
+ if (q == 0) {
+ return;
}
+ send_lisp_gpe_enable_disable_details(q, mp->context);
}
static void