mp->ip6_prefix.len,
(ip6_address_t *) & mp->ip6_src.prefix,
mp->ip6_src.len, mp->ea_bits_len, mp->psid_offset,
mp->ip6_prefix.len,
(ip6_address_t *) & mp->ip6_src.prefix,
mp->ip6_src.len, mp->ea_bits_len, mp->psid_offset,
- mp->psid_length, &index, ntohs (mp->mtu), flags);
+ mp->psid_length, &index, ntohs (mp->mtu), flags,
+ vl_api_from_api_string_c (&mp->tag));
clib_memcpy(&rmp->ip6_prefix.prefix, &d->ip6_prefix, sizeof(rmp->ip6_prefix.prefix));
clib_memcpy(&rmp->ip4_prefix.prefix, &d->ip4_prefix, sizeof(rmp->ip4_prefix.prefix));
clib_memcpy(&rmp->ip6_src.prefix, &d->ip6_src, sizeof(rmp->ip6_src.prefix));
clib_memcpy(&rmp->ip6_prefix.prefix, &d->ip6_prefix, sizeof(rmp->ip6_prefix.prefix));
clib_memcpy(&rmp->ip4_prefix.prefix, &d->ip4_prefix, sizeof(rmp->ip4_prefix.prefix));
clib_memcpy(&rmp->ip6_src.prefix, &d->ip6_src, sizeof(rmp->ip6_src.prefix));
+ map_main_t *mm = &map_main;
+
+ if (pool_is_free_index (mm->vnet_main->interface_main.sw_interfaces,
+ sw_if_index))
+ return VNET_API_ERROR_INVALID_SW_IF_INDEX;
+
+ is_enable = ! !is_enable;
+
+ if (is_translation)
+ {
+ if (clib_bitmap_get (mm->bm_trans_enabled_by_sw_if, sw_if_index)
+ == is_enable)
+ return 0;
+ }
+ else
+ {
+ if (clib_bitmap_get (mm->bm_encap_enabled_by_sw_if, sw_if_index)
+ == is_enable)
+ return 0;
+ }
+
if (is_translation == false)
{
vnet_feature_enable_disable ("ip4-unicast", "ip4-map", sw_if_index,
is_enable ? 1 : 0, 0, 0);
vnet_feature_enable_disable ("ip6-unicast", "ip6-map", sw_if_index,
is_enable ? 1 : 0, 0, 0);
if (is_translation == false)
{
vnet_feature_enable_disable ("ip4-unicast", "ip4-map", sw_if_index,
is_enable ? 1 : 0, 0, 0);
vnet_feature_enable_disable ("ip6-unicast", "ip6-map", sw_if_index,
is_enable ? 1 : 0, 0, 0);
is_enable ? 1 : 0, 0, 0);
vnet_feature_enable_disable ("ip6-unicast", "ip6-map-t", sw_if_index,
is_enable ? 1 : 0, 0, 0);
is_enable ? 1 : 0, 0, 0);
vnet_feature_enable_disable ("ip6-unicast", "ip6-map-t", sw_if_index,
is_enable ? 1 : 0, 0, 0);