MAP: Add API support for setting parameters.
[vpp.git] / src / plugins / map / map.c
index 63d6e1a..8156ec8 100644 (file)
@@ -55,7 +55,7 @@ map_main_t map_main;
 /*
  * This code supports MAP-T:
  *
- * With DMR prefix length equal to 96.
+ * With a DMR prefix length of 64 or 96 (RFC6052).
  *
  */
 
@@ -81,15 +81,9 @@ map_create_domain (ip4_address_t * ip4_prefix,
   /* Sanity check on the src prefix length */
   if (flags & MAP_DOMAIN_TRANSLATION)
     {
-      if (ip6_src_len != 96)
+      if (ip6_src_len != 96 && ip6_src_len != 64)
        {
-         clib_warning ("MAP-T only supports ip6_src_len = 96 for now.");
-         return -1;
-       }
-      if ((flags & MAP_DOMAIN_RFC6052) && ip6_prefix_len != 96)
-       {
-         clib_warning ("RFC6052 translation only supports ip6_prefix_len = "
-                       "96 for now");
+         clib_warning ("MAP-T only supports prefix lengths of 64 and 96.");
          return -1;
        }
     }
@@ -107,8 +101,7 @@ map_create_domain (ip4_address_t * ip4_prefix,
   /* How many, and which bits to grab from the IPv4 DA */
   if (ip4_prefix_len + ea_bits_len < 32)
     {
-      if (!(flags & MAP_DOMAIN_TRANSLATION))
-       flags |= MAP_DOMAIN_PREFIX;
+      flags |= MAP_DOMAIN_PREFIX;
       suffix_shift = 32 - ip4_prefix_len - ea_bits_len;
       suffix_len = ea_bits_len;
     }
@@ -128,15 +121,9 @@ map_create_domain (ip4_address_t * ip4_prefix,
       return -1;
     }
 
-  if (mm->is_ce && !(flags & MAP_DOMAIN_TRANSLATION))
-    {
-      clib_warning ("MAP-E CE is not supported yet");
-      return -1;
-    }
-
   /* Get domain index */
   pool_get_aligned (mm->domains, d, CLIB_CACHE_LINE_BYTES);
-  memset (d, 0, sizeof (*d));
+  clib_memset (d, 0, sizeof (*d));
   *map_domain_index = d - mm->domains;
 
   /* Init domain struct */
@@ -165,23 +152,11 @@ map_create_domain (ip4_address_t * ip4_prefix,
     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_len = d->ip4_prefix_len,
     .fp_addr = {
-               .ip4 = ip4_pfx,
+               .ip4 = d->ip4_prefix,
                }
     ,
   };
@@ -207,22 +182,10 @@ map_create_domain (ip4_address_t * ip4_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,
+    .fp_len = d->ip6_src_len,
+    .fp_addr.ip6 = d->ip6_src,
   };
 
   fib_table_entry_special_dpo_add (0, &pfx6,
@@ -322,7 +285,7 @@ map_add_del_psid (u32 map_domain_index, u16 psid, ip6_address_t * tep,
       d->rules = clib_mem_alloc_aligned (l, CLIB_CACHE_LINE_BYTES);
       if (!d->rules)
        return -1;
-      memset (d->rules, 0, l);
+      clib_memset (d->rules, 0, l);
     }
 
   if (psid >= (0x1 << d->psid_length))
@@ -338,7 +301,7 @@ map_add_del_psid (u32 map_domain_index, u16 psid, ip6_address_t * tep,
     }
   else
     {
-      memset (&d->rules[psid], 0, sizeof (ip6_address_t));
+      clib_memset (&d->rules[psid], 0, sizeof (ip6_address_t));
     }
   return 0;
 }
@@ -477,7 +440,7 @@ map_fib_unresolve (map_main_pre_resolved_t * pr,
   pr->sibling = FIB_NODE_INDEX_INVALID;
 }
 
-static void
+void
 map_pre_resolve (ip4_address_t * ip4, ip6_address_t * ip6, int is_del)
 {
   if (ip6 && (ip6->as_u64[0] != 0 || ip6->as_u64[1] != 0))
@@ -513,8 +476,11 @@ map_security_check_command_fn (vlib_main_t * vm,
                               vlib_cli_command_t * cmd)
 {
   unformat_input_t _line_input, *line_input = &_line_input;
-  map_main_t *mm = &map_main;
   clib_error_t *error = NULL;
+  bool enable = false;
+  bool check_frag = false;
+  bool saw_enable = false;
+  bool saw_frag = false;
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
@@ -522,10 +488,26 @@ map_security_check_command_fn (vlib_main_t * vm,
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
-      if (unformat (line_input, "off"))
-       mm->sec_check = false;
-      else if (unformat (line_input, "on"))
-       mm->sec_check = true;
+      if (unformat (line_input, "enable"))
+       {
+         enable = false;
+         saw_enable = true;
+       }
+      else if (unformat (line_input, "disable"))
+       {
+         enable = true;
+         saw_enable = true;
+       }
+      else if (unformat (line_input, "fragments on"))
+       {
+         check_frag = true;
+         saw_frag = true;
+       }
+      else if (unformat (line_input, "fragments off"))
+       {
+         check_frag = false;
+         saw_frag = true;
+       }
       else
        {
          error = clib_error_return (0, "unknown input `%U'",
@@ -534,45 +516,28 @@ map_security_check_command_fn (vlib_main_t * vm,
        }
     }
 
-done:
-  unformat_free (line_input);
-
-  return error;
-}
-
-static clib_error_t *
-map_security_check_frag_command_fn (vlib_main_t * vm,
-                                   unformat_input_t * input,
-                                   vlib_cli_command_t * cmd)
-{
-  unformat_input_t _line_input, *line_input = &_line_input;
-  map_main_t *mm = &map_main;
-  clib_error_t *error = NULL;
-
-  /* Get a line of input. */
-  if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+  if (!saw_enable)
+    {
+      error = clib_error_return (0,
+                                "Must specify enable 'enable' or 'disable'");
+      goto done;
+    }
 
-  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+  if (!saw_frag)
     {
-      if (unformat (line_input, "off"))
-       mm->sec_check_frag = false;
-      else if (unformat (line_input, "on"))
-       mm->sec_check_frag = true;
-      else
-       {
-         error = clib_error_return (0, "unknown input `%U'",
-                                    format_unformat_error, line_input);
-         goto done;
-       }
+      error = clib_error_return (0, "Must specify fragments 'on' or 'off'");
+      goto done;
     }
 
+  map_param_set_security_check (enable, check_frag);
+
 done:
   unformat_free (line_input);
 
   return error;
 }
 
+
 static clib_error_t *
 map_add_domain_command_fn (vlib_main_t * vm,
                           unformat_input_t * input, vlib_cli_command_t * cmd)
@@ -751,8 +716,8 @@ map_pre_resolve_command_fn (vlib_main_t * vm,
   clib_error_t *error = NULL;
   int is_del = 0;
 
-  memset (&ip4nh, 0, sizeof (ip4nh));
-  memset (&ip6nh, 0, sizeof (ip6nh));
+  clib_memset (&ip4nh, 0, sizeof (ip4nh));
+  clib_memset (&ip6nh, 0, sizeof (ip6nh));
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
@@ -791,6 +756,7 @@ map_icmp_relay_source_address_command_fn (vlib_main_t * vm,
 {
   unformat_input_t _line_input, *line_input = &_line_input;
   ip4_address_t icmp_src_address;
+  ip4_address_t *p_icmp_addr = 0;
   map_main_t *mm = &map_main;
   clib_error_t *error = NULL;
 
@@ -804,7 +770,10 @@ map_icmp_relay_source_address_command_fn (vlib_main_t * vm,
     {
       if (unformat
          (line_input, "%U", unformat_ip4_address, &icmp_src_address))
-       mm->icmp4_src_address = icmp_src_address;
+       {
+         mm->icmp4_src_address = icmp_src_address;
+         p_icmp_addr = &icmp_src_address;
+       }
       else
        {
          error = clib_error_return (0, "unknown input `%U'",
@@ -813,6 +782,8 @@ map_icmp_relay_source_address_command_fn (vlib_main_t * vm,
        }
     }
 
+  map_param_set_icmp (p_icmp_addr);
+
 done:
   unformat_free (line_input);
 
@@ -825,9 +796,9 @@ map_icmp_unreachables_command_fn (vlib_main_t * vm,
                                  vlib_cli_command_t * cmd)
 {
   unformat_input_t _line_input, *line_input = &_line_input;
-  map_main_t *mm = &map_main;
   int num_m_args = 0;
   clib_error_t *error = NULL;
+  bool enabled = false;
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
@@ -837,9 +808,9 @@ map_icmp_unreachables_command_fn (vlib_main_t * vm,
     {
       num_m_args++;
       if (unformat (line_input, "on"))
-       mm->icmp6_enabled = true;
+       enabled = true;
       else if (unformat (line_input, "off"))
-       mm->icmp6_enabled = false;
+       enabled = false;
       else
        {
          error = clib_error_return (0, "unknown input `%U'",
@@ -852,19 +823,26 @@ map_icmp_unreachables_command_fn (vlib_main_t * vm,
   if (num_m_args != 1)
     error = clib_error_return (0, "mandatory argument(s) missing");
 
+
+  map_param_set_icmp6 (enabled);
+
 done:
   unformat_free (line_input);
 
   return error;
 }
 
+
 static clib_error_t *
 map_fragment_command_fn (vlib_main_t * vm,
                         unformat_input_t * input, vlib_cli_command_t * cmd)
 {
   unformat_input_t _line_input, *line_input = &_line_input;
-  map_main_t *mm = &map_main;
   clib_error_t *error = NULL;
+  bool frag_inner = false;
+  bool frag_ignore_df = false;
+  bool saw_in_out = false;
+  bool saw_df = false;
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
@@ -873,9 +851,25 @@ map_fragment_command_fn (vlib_main_t * vm,
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
       if (unformat (line_input, "inner"))
-       mm->frag_inner = true;
+       {
+         frag_inner = true;
+         saw_in_out = true;
+       }
       else if (unformat (line_input, "outer"))
-       mm->frag_inner = false;
+       {
+         frag_inner = false;
+         saw_in_out = true;
+       }
+      else if (unformat (line_input, "ignore-df"))
+       {
+         frag_ignore_df = true;
+         saw_df = true;
+       }
+      else if (unformat (line_input, "honor-df"))
+       {
+         frag_ignore_df = false;
+         saw_df = true;
+       }
       else
        {
          error = clib_error_return (0, "unknown input `%U'",
@@ -884,39 +878,20 @@ map_fragment_command_fn (vlib_main_t * vm,
        }
     }
 
-done:
-  unformat_free (line_input);
-
-  return error;
-}
-
-static clib_error_t *
-map_fragment_df_command_fn (vlib_main_t * vm,
-                           unformat_input_t * input,
-                           vlib_cli_command_t * cmd)
-{
-  unformat_input_t _line_input, *line_input = &_line_input;
-  map_main_t *mm = &map_main;
-  clib_error_t *error = NULL;
-
-  /* Get a line of input. */
-  if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
+  if (!saw_in_out)
+    {
+      error = clib_error_return (0, "Must specify 'inner' or 'outer'");
+      goto done;
+    }
 
-  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+  if (!saw_df)
     {
-      if (unformat (line_input, "on"))
-       mm->frag_ignore_df = true;
-      else if (unformat (line_input, "off"))
-       mm->frag_ignore_df = false;
-      else
-       {
-         error = clib_error_return (0, "unknown input `%U'",
-                                    format_unformat_error, line_input);
-         goto done;
-       }
+      error = clib_error_return (0, "Must specify 'ignore-df' or 'honor-df'");
+      goto done;
     }
 
+  map_param_set_fragmentation (frag_inner, frag_ignore_df);
+
 done:
   unformat_free (line_input);
 
@@ -929,11 +904,10 @@ map_traffic_class_command_fn (vlib_main_t * vm,
                              vlib_cli_command_t * cmd)
 {
   unformat_input_t _line_input, *line_input = &_line_input;
-  map_main_t *mm = &map_main;
   u32 tc = 0;
   clib_error_t *error = NULL;
+  bool tc_copy = false;
 
-  mm->tc_copy = false;
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
@@ -942,9 +916,9 @@ map_traffic_class_command_fn (vlib_main_t * vm,
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
       if (unformat (line_input, "copy"))
-       mm->tc_copy = true;
+       tc_copy = true;
       else if (unformat (line_input, "%x", &tc))
-       mm->tc = tc & 0xff;
+       tc = tc & 0xff;
       else
        {
          error = clib_error_return (0, "unknown input `%U'",
@@ -953,6 +927,8 @@ map_traffic_class_command_fn (vlib_main_t * vm,
        }
     }
 
+  map_param_set_traffic_class (tc_copy, tc);
+
 done:
   unformat_free (line_input);
 
@@ -980,12 +956,12 @@ format_map_domain (u8 * s, va_list * args)
   ip6_address_t ip6_prefix;
 
   if (d->rules)
-    memset (&ip6_prefix, 0, sizeof (ip6_prefix));
+    clib_memset (&ip6_prefix, 0, sizeof (ip6_prefix));
   else
     ip6_prefix = d->ip6_prefix;
 
   s = format (s,
-             "[%d] ip4-pfx %U/%d ip6-pfx %U/%d ip6-src %U/%d ea_bits_len %d "
+             "[%d] ip4-pfx %U/%d ip6-pfx %U/%d ip6-src %U/%d ea-bits-len %d "
              "psid-offset %d psid-len %d mtu %d %s",
              d - mm->domains,
              format_ip4_address, &d->ip4_prefix, d->ip4_prefix_len,
@@ -1216,8 +1192,8 @@ show_map_stats_command_fn (vlib_main_t * vm, unformat_input_t * input,
   int which, i;
   vlib_counter_t v;
 
-  memset (total_pkts, 0, sizeof (total_pkts));
-  memset (total_bytes, 0, sizeof (total_bytes));
+  clib_memset (total_pkts, 0, sizeof (total_pkts));
+  clib_memset (total_bytes, 0, sizeof (total_bytes));
 
   map_domain_counter_lock (mm);
   vec_foreach (cm, mm->domain_counters)
@@ -1319,110 +1295,34 @@ map_params_reass_command_fn (vlib_main_t * vm, unformat_input_t * input,
                                  MAP_IP6_REASS_CONF_BUFFERS_MAX);
     }
 
-  if (ip4)
+  int rv;
+  u32 reass = 0, packets = 0;
+  rv = map_param_set_reassembly (!ip4, lifetime, pool_size, buffers, ht_ratio,
+                                &reass, &packets);
+
+  switch (rv)
     {
-      u32 reass = 0, packets = 0;
-      if (pool_size != ~0)
-       {
-         if (map_ip4_reass_conf_pool_size (pool_size, &reass, &packets))
-           {
-             vlib_cli_output (vm, "Could not set ip4-reass pool-size");
-           }
-         else
-           {
-             vlib_cli_output (vm,
-                              "Setting ip4-reass pool-size (destroyed-reassembly=%u , dropped-fragments=%u)",
-                              reass, packets);
-           }
-       }
-      if (ht_ratio != (MAP_IP4_REASS_CONF_HT_RATIO_MAX + 1))
-       {
-         if (map_ip4_reass_conf_ht_ratio (ht_ratio, &reass, &packets))
-           {
-             vlib_cli_output (vm, "Could not set ip4-reass ht-log2len");
-           }
-         else
-           {
-             vlib_cli_output (vm,
-                              "Setting ip4-reass ht-log2len (destroyed-reassembly=%u , dropped-fragments=%u)",
-                              reass, packets);
-           }
-       }
-      if (lifetime != ~0)
-       {
-         if (map_ip4_reass_conf_lifetime (lifetime))
-           vlib_cli_output (vm, "Could not set ip4-reass lifetime");
-         else
-           vlib_cli_output (vm, "Setting ip4-reass lifetime");
-       }
-      if (buffers != ~(0ull))
-       {
-         if (map_ip4_reass_conf_buffers (buffers))
-           vlib_cli_output (vm, "Could not set ip4-reass buffers");
-         else
-           vlib_cli_output (vm, "Setting ip4-reass buffers");
-       }
+    case 0:
+      vlib_cli_output (vm,
+                      "Note: destroyed-reassembly=%u , dropped-fragments=%u",
+                      reass, packets);
+      break;
 
-      if (map_main.ip4_reass_conf_buffers >
-         map_main.ip4_reass_conf_pool_size *
-         MAP_IP4_REASS_MAX_FRAGMENTS_PER_REASSEMBLY)
-       {
-         vlib_cli_output (vm,
-                          "Note: 'ip4-reass buffers' > pool-size * max-fragments-per-reassembly.");
-       }
-    }
+    case MAP_ERR_BAD_POOL_SIZE:
+      return clib_error_return (0, "Could not set reass pool-size");
 
-  if (ip6)
-    {
-      u32 reass = 0, packets = 0;
-      if (pool_size != ~0)
-       {
-         if (map_ip6_reass_conf_pool_size (pool_size, &reass, &packets))
-           {
-             vlib_cli_output (vm, "Could not set ip6-reass pool-size");
-           }
-         else
-           {
-             vlib_cli_output (vm,
-                              "Setting ip6-reass pool-size (destroyed-reassembly=%u , dropped-fragments=%u)",
-                              reass, packets);
-           }
-       }
-      if (ht_ratio != (MAP_IP4_REASS_CONF_HT_RATIO_MAX + 1))
-       {
-         if (map_ip6_reass_conf_ht_ratio (ht_ratio, &reass, &packets))
-           {
-             vlib_cli_output (vm, "Could not set ip6-reass ht-log2len");
-           }
-         else
-           {
-             vlib_cli_output (vm,
-                              "Setting ip6-reass ht-log2len (destroyed-reassembly=%u , dropped-fragments=%u)",
-                              reass, packets);
-           }
-       }
-      if (lifetime != ~0)
-       {
-         if (map_ip6_reass_conf_lifetime (lifetime))
-           vlib_cli_output (vm, "Could not set ip6-reass lifetime");
-         else
-           vlib_cli_output (vm, "Setting ip6-reass lifetime");
-       }
-      if (buffers != ~(0ull))
-       {
-         if (map_ip6_reass_conf_buffers (buffers))
-           vlib_cli_output (vm, "Could not set ip6-reass buffers");
-         else
-           vlib_cli_output (vm, "Setting ip6-reass buffers");
-       }
+    case MAP_ERR_BAD_HT_RATIO:
+      return clib_error_return (0, "Could not set reass ht-log2len");
 
-      if (map_main.ip6_reass_conf_buffers >
-         map_main.ip6_reass_conf_pool_size *
-         MAP_IP6_REASS_MAX_FRAGMENTS_PER_REASSEMBLY)
-       {
-         vlib_cli_output (vm,
-                          "Note: 'ip6-reass buffers' > pool-size * max-fragments-per-reassembly.");
-       }
+    case MAP_ERR_BAD_LIFETIME:
+      return clib_error_return (0, "Could not set ip6-reass lifetime");
+
+    case MAP_ERR_BAD_BUFFERS:
+      return clib_error_return (0, "Could not set ip6-reass buffers");
+
+    case MAP_ERR_BAD_BUFFERS_TOO_LARGE:
+      return clib_error_return (0,
+                               "Note: 'ip6-reass buffers' > pool-size * max-fragments-per-reassembly.");
     }
 
   return 0;
@@ -1813,7 +1713,7 @@ map_ip6_reass_add_fragment (map_ip6_reass_t * r, u32 pi,
       if (!prev_f)
        return -1;
 
-      clib_memcpy (prev_f->next_data, data_start, copied_len);
+      clib_memcpy_fast (prev_f->next_data, data_start, copied_len);
       prev_f->next_data_len = copied_len;
       prev_f->next_data_offset = data_offset;
     }
@@ -1823,7 +1723,7 @@ map_ip6_reass_add_fragment (map_ip6_reass_t * r, u32 pi,
        return -1;
 
       if (r->ip4_header.ip_version_and_header_length == 0)
-       clib_memcpy (&r->ip4_header, data_start, sizeof (ip4_header_t));
+       clib_memcpy_fast (&r->ip4_header, data_start, sizeof (ip4_header_t));
     }
 
   if (data_len > 20)
@@ -2069,6 +1969,7 @@ VLIB_CLI_COMMAND(map_pre_resolve_command, static) = {
 
 /*?
  * Enable or disable the MAP-E inbound security check
+ * Specifiy if the inbound security check should be done on fragments
  *
  * @cliexpar
  * @cliexstart{map params security-check}
@@ -2076,14 +1977,20 @@ VLIB_CLI_COMMAND(map_pre_resolve_command, static) = {
  * By default, a decapsulated packet's IPv4 source address will be
  * verified against the outer header's IPv6 source address. Disabling
  * this feature will allow IPv4 source address spoofing.
+ *
+ * Typically the inbound on-decapsulation security check is only done
+ * on the first packet. The packet that contains the L4
+ * information. While a security check on every fragment is possible,
+ * it has a cost. State must be created on the first fragment.
  * @cliexend
  ?*/
 VLIB_CLI_COMMAND(map_security_check_command, static) = {
   .path = "map params security-check",
-  .short_help = "map params security-check on|off",
+  .short_help = "map params security-check enable|disable fragments on|off",
   .function = map_security_check_command_fn,
 };
 
+
 /*?
  * Specifiy the IPv4 source address used for relayed ICMP error messages
  *
@@ -2122,19 +2029,6 @@ VLIB_CLI_COMMAND(map_icmp_unreachables_command, static) = {
  *
  * @cliexpar
  * @cliexstart{map params fragment}
- * @cliexend
- ?*/
-VLIB_CLI_COMMAND(map_fragment_command, static) = {
-  .path = "map params fragment",
-  .short_help = "map params fragment inner|outer",
-  .function = map_fragment_command_fn,
-};
-
-/*?
- * Ignore the IPv4 Don't fragment bit
- *
- * @cliexpar
- * @cliexstart{map params fragment ignore-df}
  *
  * Allows fragmentation of the IPv4 packet even if the DF bit is
  * set. The choice between inner or outer fragmentation of tunnel
@@ -2143,29 +2037,12 @@ VLIB_CLI_COMMAND(map_fragment_command, static) = {
  * endpoint.
  * @cliexend
  ?*/
-VLIB_CLI_COMMAND(map_fragment_df_command, static) = {
-  .path = "map params fragment ignore-df",
-  .short_help = "map params fragment ignore-df on|off",
-  .function = map_fragment_df_command_fn,
+VLIB_CLI_COMMAND(map_fragment_command, static) = {
+  .path = "map params fragment",
+  .short_help = "map params fragment inner|outer ignore-df|honor-df",
+  .function = map_fragment_command_fn,
 };
 
-/*?
- * Specifiy if the inbound security check should be done on fragments
- *
- * @cliexpar
- * @cliexstart{map params security-check fragments}
- *
- * Typically the inbound on-decapsulation security check is only done
- * on the first packet. The packet that contains the L4
- * information. While a security check on every fragment is possible,
- * it has a cost. State must be created on the first fragment.
- * @cliexend
- ?*/
-VLIB_CLI_COMMAND(map_security_check_frag_command, static) = {
-  .path = "map params security-check fragments",
-  .short_help = "map params security-check fragments on|off",
-  .function = map_security_check_frag_command_fn,
-};
 
 /*?
  * Add MAP domain
@@ -2178,7 +2055,7 @@ VLIB_CLI_COMMAND(map_add_domain_command, static) = {
   .path = "map add domain",
   .short_help = "map add domain ip4-pfx <ip4-pfx> ip6-pfx <ip6-pfx> "
       "ip6-src <ip6-pfx> ea-bits-len <n> psid-offset <n> psid-len <n> "
-      "[map-t] [map-ce] [mtu <mtu>]",
+      "[map-t] [mtu <mtu>]",
   .function = map_add_domain_command_fn,
 };
 
@@ -2254,28 +2131,6 @@ VLIB_PLUGIN_REGISTER() = {
 
 /* *INDENT-ON* */
 
-static clib_error_t *
-map_config (vlib_main_t * vm, unformat_input_t * input)
-{
-  map_main_t *mm = &map_main;
-  u8 is_ce = false;
-
-  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
-    {
-      if (unformat (input, "customer edge"))
-       is_ce = true;
-      else
-       return clib_error_return (0, "unknown input '%U'",
-                                 format_unformat_error, input);
-    }
-
-  mm->is_ce = is_ce;
-
-  return 0;
-}
-
-VLIB_CONFIG_FUNCTION (map_config, "map");
-
 /*
  * map_init
  */
@@ -2307,15 +2162,13 @@ map_init (vlib_main_t * vm)
   /* ICMP6 Type 1, Code 5 for security check failure */
   mm->icmp6_enabled = false;
 
-  mm->is_ce = false;
-
   /* Inner or outer fragmentation */
   mm->frag_inner = false;
   mm->frag_ignore_df = false;
 
   vec_validate (mm->domain_counters, MAP_N_DOMAIN_COUNTER - 1);
-  mm->domain_counters[MAP_DOMAIN_COUNTER_RX].name = "rx";
-  mm->domain_counters[MAP_DOMAIN_COUNTER_TX].name = "tx";
+  mm->domain_counters[MAP_DOMAIN_COUNTER_RX].name = "/map/rx";
+  mm->domain_counters[MAP_DOMAIN_COUNTER_TX].name = "/map/tx";
 
   vlib_validate_simple_counter (&mm->icmp_relayed, 0);
   vlib_zero_simple_counter (&mm->icmp_relayed, 0);