vl_api_map_add_domain_reply_t *rmp;
int rv = 0;
u32 index;
- u8 flags = mp->is_translation ? MAP_DOMAIN_TRANSLATION : 0;
+ u8 flags = 0;
+
+ if (mp->is_translation)
+ flags |= MAP_DOMAIN_TRANSLATION;
+
+ if (mp->is_rfc6052)
+ flags |= MAP_DOMAIN_RFC6052;
+
rv =
map_create_domain ((ip4_address_t *) & mp->ip4_prefix, mp->ip4_prefix_len,
(ip6_address_t *) & mp->ip6_prefix, mp->ip6_prefix_len,
vl_api_map_domain_details_t *rmp;
map_main_t *mm = &map_main;
map_domain_t *d;
- unix_shared_memory_queue_t *q;
+ vl_api_registration_t *reg;
if (pool_elts (mm->domains) == 0)
return;
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
- {
- return;
- }
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;
/* *INDENT-OFF* */
pool_foreach(d, mm->domains,
rmp->is_translation = (d->flags & MAP_DOMAIN_TRANSLATION);
rmp->context = mp->context;
- vl_msg_api_send_shmem (q, (u8 *)&rmp);
+ vl_api_send_msg (reg, (u8 *)&rmp);
}));
/* *INDENT-ON* */
}
static void
vl_api_map_rule_dump_t_handler (vl_api_map_rule_dump_t * mp)
{
- unix_shared_memory_queue_t *q;
+ vl_api_registration_t *reg;
u16 i;
ip6_address_t dst;
vl_api_map_rule_details_t *rmp;
return;
}
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
- {
- return;
- }
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;
for (i = 0; i < (0x1 << d->psid_length); i++)
{
rmp->psid = htons (i);
clib_memcpy (rmp->ip6_dst, &dst, sizeof (rmp->ip6_dst));
rmp->context = mp->context;
- vl_msg_api_send_shmem (q, (u8 *) & rmp);
+ vl_api_send_msg (reg, (u8 *) rmp);
}
}
u64 total_pkts[VLIB_N_RX_TX];
u64 total_bytes[VLIB_N_RX_TX];
map_main_t *mm = &map_main;
- unix_shared_memory_queue_t *q =
- vl_api_client_index_to_input_queue (mp->client_index);
+ vl_api_registration_t *reg;
- if (!q)
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
return;
rmp = vl_msg_api_alloc (sizeof (*rmp));
rmp->context = mp->context;
rmp->retval = 0;
+ if (pool_elts (mm->domains) == 0)
+ {
+ rmp->retval = -1;
+ goto out;
+ }
+
memset (total_pkts, 0, sizeof (total_pkts));
memset (total_bytes, 0, sizeof (total_bytes));
clib_host_to_net_u64 (map_error_counter_get
(ip4_map_node.index, MAP_ERROR_DECAP_SEC_CHECK));
- vl_msg_api_send_shmem (q, (u8 *) & rmp);
+out:
+ vl_api_send_msg (reg, (u8 *) rmp);
}
/*