int rv = 0;
if (mp->sw_if_index != ~0)
- VALIDATE_SW_IF_INDEX(mp);
+ VALIDATE_SW_IF_INDEX (mp);
vec_reset_length (my_vnet_mains);
switch (filter)
{
- case 0: /* all mappings */
+ case 0: /* all mappings */
break;
- case 1: /* local only */
+ case 1: /* local only */
if (!mapit->local)
- return;
+ return;
break;
- case 2: /* remote only */
+ case 2: /* remote only */
if (mapit->local)
- return;
+ return;
break;
default:
clib_warning ("Filter error, unknown filter: %d", filter);
mapit = pool_elt_at_index (lcm->mapping_pool, mi);
send_lisp_eid_table_details (mapit, q, mp->context,
- 0 /* ignore filter */);
+ 0 /* ignore filter */ );
}
else
{
vl_api_lisp_map_resolver_dump_t_handler (vl_api_lisp_map_resolver_dump_t * mp)
{
unix_shared_memory_queue_t *q = NULL;
- lisp_cp_main_t *lcm = vnet_lisp_cp_get_main ();
- ip_address_t *ip = NULL;
+ lisp_cp_main_t * lcm = vnet_lisp_cp_get_main ();
+ map_resolver_t * mr;
q = vl_api_client_index_to_input_queue (mp->client_index);
if (q == 0)
return;
}
- vec_foreach (ip, lcm->map_resolvers)
+ vec_foreach(mr, lcm->map_resolvers)
{
- send_lisp_map_resolver_details (ip, q, mp->context);
+ send_lisp_map_resolver_details(&mr->address, q, mp->context);
}
-
}
static void
e = pool_elt_at_index (mm->encaps, gt->encap_index);
nlabels = vec_len (e->labels);
- mp = vl_msg_api_alloc (sizeof (*mp) + nlabels * sizeof(u32));
+ mp = vl_msg_api_alloc (sizeof (*mp) + nlabels * sizeof (u32));
memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = ntohs (VL_API_MPLS_GRE_TUNNEL_DETAILS);
mp->context = context;
if (index != ~0)
{
if (!pool_is_free_index (mm->gre_tunnels, index))
- {
- gt = pool_elt_at_index (mm->gre_tunnels, index);
- send_mpls_gre_tunnel_entry (am, q, gt, gt - mm->gre_tunnels,
- mp->context);
- }
+ {
+ gt = pool_elt_at_index (mm->gre_tunnels, index);
+ send_mpls_gre_tunnel_entry (am, q, gt, gt - mm->gre_tunnels,
+ mp->context);
+ }
}
else
{
e = pool_elt_at_index (mm->encaps, et->encap_index);
nlabels = vec_len (e->labels);
- mp = vl_msg_api_alloc (sizeof (*mp) + nlabels*sizeof(u32));
+ mp = vl_msg_api_alloc (sizeof (*mp) + nlabels * sizeof (u32));
memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = ntohs (VL_API_MPLS_ETH_TUNNEL_DETAILS);
mp->context = context;
if (index != ~0)
{
- if (!pool_is_free_index(mm->eth_tunnels, index))
- {
- et = pool_elt_at_index (mm->eth_tunnels, index);
- send_mpls_eth_tunnel_entry (am, q, et, et - mm->eth_tunnels,
- mp->context);
- }
+ if (!pool_is_free_index (mm->eth_tunnels, index))
+ {
+ et = pool_elt_at_index (mm->eth_tunnels, index);
+ send_mpls_eth_tunnel_entry (am, q, et, et - mm->eth_tunnels,
+ mp->context);
+ }
}
else
{
e = pool_elt_at_index (mm->encaps, s->entry_index);
nlabels = vec_len (e->labels);
- mp = vl_msg_api_alloc (sizeof (*mp) + nlabels * sizeof(u32));
+ mp = vl_msg_api_alloc (sizeof (*mp) + nlabels * sizeof (u32));
memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = ntohs (VL_API_MPLS_FIB_ENCAP_DETAILS);
mp->context = context;
api_segment_config (vlib_main_t * vm, unformat_input_t * input)
{
u8 *chroot_path;
+ u64 baseva, size, pvt_heap_size;
int uid, gid, rv;
const int max_buf_size = 4096;
char *s, *buf;
struct passwd _pw, *pw;
struct group _grp, *grp;
clib_error_t *e;
- buf = vec_new(char,128);
+ buf = vec_new (char, 128);
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (input, "prefix %s", &chroot_path))
vl_set_memory_uid (uid);
else if (unformat (input, "gid %d", &gid))
vl_set_memory_gid (gid);
+ else if (unformat (input, "baseva %llx", &baseva))
+ vl_set_global_memory_baseva (baseva);
+ else if (unformat (input, "global-size %lldM", &size))
+ vl_set_global_memory_size (size * (1ULL << 20));
+ else if (unformat (input, "global-size %lldG", &size))
+ vl_set_global_memory_size (size * (1ULL << 30));
+ else if (unformat (input, "global-size %lld", &size))
+ vl_set_global_memory_size (size);
+ else if (unformat (input, "global-pvt-heap-size %lldM", &pvt_heap_size))
+ vl_set_global_pvt_heap_size (pvt_heap_size * (1ULL << 20));
+ else if (unformat (input, "global-pvt-heap-size size %lld",
+ &pvt_heap_size))
+ vl_set_global_pvt_heap_size (pvt_heap_size);
+ else if (unformat (input, "api-pvt-heap-size %lldM", &pvt_heap_size))
+ vl_set_api_pvt_heap_size (pvt_heap_size * (1ULL << 20));
+ else if (unformat (input, "api-pvt-heap-size size %lld",
+ &pvt_heap_size))
+ vl_set_api_pvt_heap_size (pvt_heap_size);
+ else if (unformat (input, "api-size %lldM", &size))
+ vl_set_api_memory_size (size * (1ULL << 20));
+ else if (unformat (input, "api-size %lldG", &size))
+ vl_set_api_memory_size (size * (1ULL << 30));
+ else if (unformat (input, "api-size %lld", &size))
+ vl_set_api_memory_size (size);
else if (unformat (input, "uid %s", &s))
{
/* lookup the username */
pw = NULL;
- while (((rv = getpwnam_r (s, &_pw, buf, vec_len (buf), &pw)) == ERANGE) && ( vec_len(buf) <= max_buf_size ))
- {
- vec_resize(buf,vec_len(buf)*2);
- }
+ while (((rv =
+ getpwnam_r (s, &_pw, buf, vec_len (buf), &pw)) == ERANGE)
+ && (vec_len (buf) <= max_buf_size))
+ {
+ vec_resize (buf, vec_len (buf) * 2);
+ }
if (rv < 0)
{
e = clib_error_return_code (0, rv,
CLIB_ERROR_FATAL,
"cannot fetch username %s", s);
vec_free (s);
- vec_free (buf);
+ vec_free (buf);
return e;
}
if (pw == NULL)
e =
clib_error_return_fatal (0, "username %s does not exist", s);
vec_free (s);
- vec_free (buf);
+ vec_free (buf);
return e;
}
vec_free (s);
{
/* lookup the group name */
grp = NULL;
- while ( ( (rv = getgrnam_r (s, &_grp, buf, vec_len(buf), &grp)) == ERANGE ) && ( vec_len(buf) <= max_buf_size ) )
- {
- vec_resize(buf,vec_len(buf)*2);
- }
+ while (((rv =
+ getgrnam_r (s, &_grp, buf, vec_len (buf), &grp)) == ERANGE)
+ && (vec_len (buf) <= max_buf_size))
+ {
+ vec_resize (buf, vec_len (buf) * 2);
+ }
if (rv != 0)
{
e = clib_error_return_code (0, rv,
CLIB_ERROR_FATAL,
"cannot fetch group %s", s);
vec_free (s);
- vec_free (buf);
+ vec_free (buf);
return e;
}
if (grp == NULL)
{
e = clib_error_return_fatal (0, "group %s does not exist", s);
vec_free (s);
- vec_free (buf);
+ vec_free (buf);
return e;
}
vec_free (s);
- vec_free (buf);
+ vec_free (buf);
vl_set_memory_gid (grp->gr_gid);
}
else