QoS recording and marking
[vpp.git] / src / vnet / ip / lookup.c
index 95039bd..3bbf2ab 100644 (file)
@@ -230,6 +230,8 @@ ip_lookup_init (ip_lookup_main_t * lm, u32 is_ip6)
       }
 
     lm->local_next_by_ip_protocol[IP_PROTOCOL_UDP] = IP_LOCAL_NEXT_UDP_LOOKUP;
+    lm->local_next_by_ip_protocol[IP_PROTOCOL_VPP_FRAGMENTATION] =
+      IP_LOCAL_NEXT_REASSEMBLY;
     lm->local_next_by_ip_protocol[is_ip6 ? IP_PROTOCOL_ICMP6 :
                                  IP_PROTOCOL_ICMP] = IP_LOCAL_NEXT_ICMP;
     lm->builtin_protocol_by_ip_protocol[IP_PROTOCOL_UDP] =
@@ -252,47 +254,6 @@ format_ip_flow_hash_config (u8 * s, va_list * args)
   return s;
 }
 
-u8 *
-format_ip_lookup_next (u8 * s, va_list * args)
-{
-  /* int promotion of ip_lookup_next_t */
-  ip_lookup_next_t n = va_arg (*args, int);
-  char *t = 0;
-
-  switch (n)
-    {
-    default:
-      s = format (s, "unknown %d", n);
-      return s;
-
-    case IP_LOOKUP_NEXT_DROP:
-      t = "drop";
-      break;
-    case IP_LOOKUP_NEXT_PUNT:
-      t = "punt";
-      break;
-    case IP_LOOKUP_NEXT_ARP:
-      t = "arp";
-      break;
-    case IP_LOOKUP_NEXT_MIDCHAIN:
-      t = "midchain";
-      break;
-    case IP_LOOKUP_NEXT_GLEAN:
-      t = "glean";
-      break;
-    case IP_LOOKUP_NEXT_MCAST:
-      t = "mcast";
-      break;
-    case IP_LOOKUP_NEXT_REWRITE:
-      break;
-    }
-
-  if (t)
-    vec_add (s, t, strlen (t));
-
-  return s;
-}
-
 u8 *
 format_ip_adjacency_packet_data (u8 * s, va_list * args)
 {
@@ -361,7 +322,7 @@ const ip46_address_t zero_addr = {
             0, 0},
 };
 
-clib_error_t *
+static clib_error_t *
 vnet_ip_route_cmd (vlib_main_t * vm,
                   unformat_input_t * main_input, vlib_cli_command_t * cmd)
 {
@@ -1398,12 +1359,16 @@ ip_container_cmd (vlib_main_t * vm,
       else if (unformat (line_input, "del"))
        is_del = 1;
       else
-       return (clib_error_return (0, "unknown input '%U'",
-                                  format_unformat_error, line_input));
+       {
+         unformat_free (line_input);
+         return (clib_error_return (0, "unknown input '%U'",
+                                    format_unformat_error, line_input));
+       }
     }
 
   if (~0 == sw_if_index || !addr_set)
     {
+      unformat_free (line_input);
       vlib_cli_output (vm, "interface and address must be set");
       return 0;
     }
@@ -1456,12 +1421,16 @@ show_ip_container_cmd_fn (vlib_main_t * vm, unformat_input_t * main_input,
                         unformat_vnet_sw_interface, vnm, &sw_if_index))
        ;
       else
-       return (clib_error_return (0, "unknown input '%U'",
-                                  format_unformat_error, line_input));
+       {
+         unformat_free (line_input);
+         return (clib_error_return (0, "unknown input '%U'",
+                                    format_unformat_error, line_input));
+       }
     }
 
   if (~0 == sw_if_index)
     {
+      unformat_free (line_input);
       vlib_cli_output (vm, "no interface");
       return (clib_error_return (0, "no interface"));
     }