- /* MAP data-plane object */
- if (d->flags & MAP_DOMAIN_TRANSLATION)
- map_t_dpo_create (DPO_PROTO_IP4, *map_domain_index, &dpo_v4);
- else
- map_dpo_create (DPO_PROTO_IP4, *map_domain_index, &dpo_v4);
-
- /* Create ip4 route */
- u8 ip4_pfx_len;
- ip4_address_t ip4_pfx;
- if (mm->is_ce)
- {
- ip4_pfx_len = 0;
- ip4_pfx.as_u32 = 0;
- }
- else
- {
- ip4_pfx_len = d->ip4_prefix_len;
- ip4_pfx = d->ip4_prefix;
- }
- fib_prefix_t pfx = {
- .fp_proto = FIB_PROTOCOL_IP4,
- .fp_len = ip4_pfx_len,
- .fp_addr = {
- .ip4 = ip4_pfx,
- }
- ,
- };
- fib_table_entry_special_dpo_add (0, &pfx,
- FIB_SOURCE_MAP,
- FIB_ENTRY_FLAG_EXCLUSIVE, &dpo_v4);
- dpo_reset (&dpo_v4);
-
- /*
- * construct a DPO to use the v6 domain
- */
- if (d->flags & MAP_DOMAIN_TRANSLATION)
- map_t_dpo_create (DPO_PROTO_IP6, *map_domain_index, &dpo_v6);
- else
- map_dpo_create (DPO_PROTO_IP6, *map_domain_index, &dpo_v6);
-
- /*
- * Multiple MAP domains may share same source IPv6 TEP. Which is just dandy.
- * We are not tracking the sharing. So a v4 lookup to find the correct
- * domain post decap/trnaslate is always done
- *
- * Create ip6 route. This is a reference counted add. If the prefix
- * already exists and is MAP sourced, it is now MAP source n+1 times
- * and will need to be removed n+1 times.
- */
- u8 ip6_pfx_len;
- ip6_address_t ip6_pfx;
- if (mm->is_ce)
- {
- ip6_pfx_len = d->ip6_prefix_len;
- ip6_pfx = d->ip6_prefix;
- }
- else
- {
- ip6_pfx_len = d->ip6_src_len;
- ip6_pfx = d->ip6_src;
- }
- fib_prefix_t pfx6 = {
- .fp_proto = FIB_PROTOCOL_IP6,
- .fp_len = ip6_pfx_len,
- .fp_addr.ip6 = ip6_pfx,
- };