vlib_combined_counter_main_t *cm;
static vnet_main_t **my_vnet_mains;
int i, j, n_counters;
-
int rv = 0;
+ if (mp->sw_if_index != ~0)
+ VALIDATE_SW_IF_INDEX(mp);
+
vec_reset_length (my_vnet_mains);
for (i = 0; i < vec_len (vnet_mains); i++)
}
}
+ BAD_SW_IF_INDEX_LABEL;
+
REPLY_MACRO (VL_API_SW_INTERFACE_CLEAR_STATS_REPLY);
}
u32 context, u8 filter)
{
vl_api_lisp_eid_table_details_t *rmp = NULL;
- lisp_cp_main_t *lcm = vnet_lisp_cp_get_main ();
- locator_set_t *ls = NULL;
gid_address_t *gid = NULL;
u8 *mac = 0;
ip_prefix_t *ip_prefix = NULL;
- ls = pool_elt_at_index (lcm->locator_set_pool, mapit->locator_set_index);
-
switch (filter)
{
- case 0:
- break;
- case 1:
- if (!ls->local)
- {
- return;
- }
- break;
- case 2:
- if (ls->local)
- {
- return;
- }
+ case 0: /* all mappings */
break;
+
+ case 1: /* local only */
+ if (!mapit->local)
+ return;
+
+ case 2: /* remote only */
+ if (mapit->local)
+ return;
+
default:
- clib_warning ("Filter error, unknown filter: %d\n", filter);
+ clib_warning ("Filter error, unknown filter: %d", filter);
return;
}
memset (rmp, 0, sizeof (*rmp));
rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_DETAILS);
rmp->locator_set_index = mapit->locator_set_index;
- rmp->is_local = ls->local;
+ rmp->is_local = mapit->local;
rmp->ttl = mapit->ttl;
rmp->authoritative = mapit->authoritative;
return;
mapit = pool_elt_at_index (lcm->mapping_pool, mi);
- send_lisp_eid_table_details (mapit, q, mp->context, mp->filter);
+ send_lisp_eid_table_details (mapit, q, mp->context,
+ 0 /* ignore filter */);
}
else
{
return;
}
- if (~0 == lcm->pitr_map_index)
+ if (!lcm->lisp_pitr)
{
tmp_str = format (0, "N/A");
}
vl_api_ipfix_details_t *rmp;
q = vl_api_client_index_to_input_queue (mp->client_index);
+ if (!q)
+ return;
rmp = vl_msg_api_alloc (sizeof (*rmp));
memset (rmp, 0, sizeof (*rmp));
}
// Validate mask_length
- if (mask_length < 0 ||
- (is_ipv6 && mask_length > 128) || (!is_ipv6 && mask_length > 32))
+ if ((is_ipv6 && mask_length > 128) || (!is_ipv6 && mask_length > 32))
{
rv = VNET_API_ERROR_ADDRESS_LENGTH_MISMATCH;
goto reply;