VPP-226 - adding UDP TCP to port-range
[vpp.git] / vpp / vpp-api / custom_dump.c
index a2eb1f2..bf02ac4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *------------------------------------------------------------------
  * custom_dump.c - pretty-print API messages for replay
- * 
+ *
  * Copyright (c) 2014 Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
- * limitations under the License. 
+ * limitations under the License.
  *------------------------------------------------------------------
  */
 
@@ -27,6 +27,9 @@
 #include <vnet/l2/l2_input.h>
 #include <vnet/sr/sr_packet.h>
 #include <vnet/vxlan-gpe/vxlan_gpe.h>
+#include <vnet/classify/policer_classify.h>
+#include <vnet/policer/xlate.h>
+#include <vnet/policer/policer.h>
 #include <vlib/vlib.h>
 #include <vlib/unix/unix.h>
 #include <vlibapi/api.h>
 #include <vpp-api/vpe_msg_enum.h>
 
 #define vl_typedefs             /* define message structures */
-#include <vpp-api/vpe_all_api_h.h> 
+#include <vpp-api/vpe_all_api_h.h>
 #undef vl_typedefs
 
 #define vl_endianfun             /* define message structures */
-#include <vpp-api/vpe_all_api_h.h> 
+#include <vpp-api/vpe_all_api_h.h>
 #undef vl_endianfun
 
 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
@@ -84,7 +87,7 @@ static void *vl_api_sw_interface_set_flags_t_print
 {
     u8 * s;
     s = format (0, "SCRIPT: sw_interface_set_flags ");
-    
+
     s = format (s, "sw_if_index %d ", ntohl(mp->sw_if_index));
 
     if (mp->admin_up_down)
@@ -96,7 +99,7 @@ static void *vl_api_sw_interface_set_flags_t_print
         s = format (s, "link-up");
     else
         s = format (s, "link-down");
-        
+
     FINISH;
 }
 
@@ -110,17 +113,17 @@ static void *vl_api_sw_interface_add_del_address_t_print
     s = format (s, "sw_if_index %d ", ntohl(mp->sw_if_index));
 
     if (mp->is_ipv6)
-        s = format (s, "%U/%d ", format_ip6_address, 
+        s = format (s, "%U/%d ", format_ip6_address,
                     (ip6_address_t *) mp->address, mp->address_length);
     else
-        s = format (s, "%U/%d ", format_ip4_address, 
+        s = format (s, "%U/%d ", format_ip4_address,
                     (ip4_address_t *) mp->address, mp->address_length);
-    
+
     if (mp->is_add == 0)
         s = format (s, "del ");
     if (mp->del_all)
         s = format (s, "del-all ");
-    
+
     FINISH;
 }
 
@@ -171,7 +174,7 @@ static void *vl_api_sw_interface_set_l2_xconnect_t_print
     if (mp->enable) {
         s = format (s, "tx_sw_if_index %d ", ntohl(mp->tx_sw_if_index));
     } else s = format (s, "delete ");
-    
+
     FINISH;
 }
 
@@ -185,10 +188,10 @@ static void *vl_api_sw_interface_set_l2_bridge_t_print
     s = format (s, "sw_if_index %d ", ntohl(mp->rx_sw_if_index));
 
     if (mp->enable) {
-        s = format (s, "bd_id %d shg %d %senable ", ntohl(mp->bd_id), 
+        s = format (s, "bd_id %d shg %d %senable ", ntohl(mp->bd_id),
                     mp->shg, ((mp->bvi)?"bvi ":" "));
     } else s = format (s, "disable ");
-    
+
     FINISH;
 }
 
@@ -203,7 +206,7 @@ static void * vl_api_bridge_domain_add_del_t_print
 
     if (mp->is_add) {
         s = format (s, "flood %d uu-flood %d forward %d learn %d arp-term %d",
-                    mp->flood, mp->uu_flood, mp->forward, mp->learn, 
+                    mp->flood, mp->uu_flood, mp->forward, mp->learn,
                    mp->arp_term);
     } else s = format (s, "del ");
 
@@ -220,7 +223,7 @@ static void *vl_api_bridge_domain_dump_t_print
 
     if (bd_id != ~0)
         s = format (s, "bd_id %d ", bd_id);
-    
+
     FINISH;
 }
 
@@ -244,7 +247,7 @@ static void *vl_api_l2fib_add_del_t_print
     } else {
        s = format (s, "del ");
     }
-    
+
     FINISH;
 }
 
@@ -262,7 +265,7 @@ static void *vl_api_l2_flags_t_print
     if (flags & L2INPUT_FEAT_ ## a) s = format (s, #a " ");
     foreach_l2input_feat;
 #undef _
-    
+
     FINISH;
 }
 
@@ -283,7 +286,7 @@ static void *vl_api_bridge_flags_t_print
     if (flags & L2_ARP_TERM) s = format (s, "arp-term ");
 
     if (mp->is_set == 0) s = format (s, "clear ");
-    
+
     FINISH;
 }
 
@@ -295,15 +298,15 @@ static void *vl_api_bd_ip_mac_add_del_t_print
     s = format (0, "SCRIPT: bd_ip_mac_add_del ");
     s = format (s, "bd_id %d ", ntohl(mp->bd_id));
 
-    if (mp->is_ipv6) 
-        s = format (s, "%U ", format_ip6_address, 
+    if (mp->is_ipv6)
+        s = format (s, "%U ", format_ip6_address,
                     (ip6_address_t *) mp->ip_address);
-    else s = format (s, "%U ", format_ip4_address, 
+    else s = format (s, "%U ", format_ip4_address,
                     (ip4_address_t *) mp->ip_address);
 
     s = format (s, "%U ", format_ethernet_address, mp->mac_address);
     if (mp->is_add == 0) s = format (s, "del ");
-    
+
     FINISH;
 }
 
@@ -322,7 +325,7 @@ static void *vl_api_tap_connect_t_print
 
     if (memcmp (mp->mac_address, null_mac, 6))
         s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
-    
+
     FINISH;
 }
 
@@ -342,7 +345,7 @@ static void *vl_api_tap_modify_t_print
 
     if (memcmp (mp->mac_address, null_mac, 6))
         s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
-    
+
     FINISH;
 }
 
@@ -403,11 +406,11 @@ static void *vl_api_ip_add_del_route_t_print
 
     if (mp->vrf_id != 0)
         s = format (s, "vrf %d ", ntohl(mp->vrf_id));
-    
+
     if (mp->create_vrf_if_needed)
         s = format (s, "create-vrf ");
 
-    if (mp->resolve_attempts != 0)                
+    if (mp->resolve_attempts != 0)
         s = format (s, "resolve-attempts %d ", ntohl(mp->resolve_attempts));
 
     if (mp->next_hop_weight != 1)
@@ -418,7 +421,7 @@ static void *vl_api_ip_add_del_route_t_print
 
     if (mp->is_multipath)
         s = format (s, "multipath ");
-            
+
     if (mp->is_multipath)
         s = format (s, "multipath ");
 
@@ -497,7 +500,7 @@ static void *vl_api_mpls_add_del_encap_t_print
 
     s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
 
-    for (i = 0; i < mp->nlabels; i++) 
+    for (i = 0; i < mp->nlabels; i++)
         s = format (s, "label %d ", ntohl(mp->labels[i]));
 
     if (mp->is_add == 0)
@@ -517,9 +520,9 @@ static void *vl_api_mpls_gre_add_del_tunnel_t_print
 
     s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
 
-    s = format (s, "adj %U/%d ", format_ip4_address, 
+    s = format (s, "adj %U/%d ", format_ip4_address,
                 (ip4_address_t *) mp->intfc_address, mp->intfc_address_length);
-    
+
     s = format (s, "inner-vrf_id %d ", ntohl(mp->inner_vrf_id));
 
     s = format (s, "outer-vrf_id %d ", ntohl(mp->outer_vrf_id));
@@ -543,10 +546,10 @@ static void *vl_api_mpls_ethernet_add_del_tunnel_t_print
     s = format (s, "tx_sw_if_index %d ", ntohl(mp->tx_sw_if_index));
 
     s = format (s, "dst %U", format_ethernet_address, mp->dst_mac_address);
-    
-    s = format (s, "adj %U/%d ", format_ip4_address, 
+
+    s = format (s, "adj %U/%d ", format_ip4_address,
                 (ip4_address_t *) mp->adj_address, mp->adj_address_length);
-    
+
     s = format (s, "vrf_id %d ", ntohl(mp->vrf_id));
 
     if (mp->l2_only)
@@ -564,11 +567,11 @@ static void *vl_api_mpls_ethernet_add_del_tunnel_2_t_print
     u8 * s;
 
     s = format (0, "SCRIPT: mpls_ethernet_add_del_tunnel_2 ");
-    
-    s = format (s, "adj %U/%d ", format_ip4_address, 
+
+    s = format (s, "adj %U/%d ", format_ip4_address,
                 (ip4_address_t *) mp->adj_address, mp->adj_address_length);
-    
-    s = format (s, "next-hop %U ", format_ip4_address, 
+
+    s = format (s, "next-hop %U ", format_ip4_address,
                 (ip4_address_t *) mp->next_hop_ip4_address_in_outer_vrf);
 
     s = format (s, "inner_vrf_id %d ", ntohl(mp->inner_vrf_id));
@@ -576,7 +579,7 @@ static void *vl_api_mpls_ethernet_add_del_tunnel_2_t_print
     s = format (s, "outer_vrf_id %d ", ntohl(mp->outer_vrf_id));
 
     s = format (s, "resolve-if-needed %d ", mp->resolve_if_needed);
-    
+
     s = format (s, "resolve-attempts %d ", ntohl(mp->resolve_attempts));
 
     if (mp->l2_only)
@@ -629,10 +632,10 @@ static void *vl_api_ip_neighbor_add_del_t_print
         s = format (s, "dst %U ", format_ip6_address, (ip6_address_t *) mp->dst_address);
     else
         s = format (s, "dst %U ", format_ip4_address, (ip4_address_t *) mp->dst_address);
-    
+
     if (mp->is_add == 0)
         s = format (s, "del ");
-    
+
     FINISH;
 }
 
@@ -692,7 +695,7 @@ static void *vl_api_create_subif_t_print
     if (mp->outer_vlan_id)
         s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
 
-    if (mp->outer_vlan_id)
+    if (mp->inner_vlan_id)
         s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
 
 #define _(a) if (mp->a) s = format (s, "%s ", #a);
@@ -719,7 +722,7 @@ static void *vl_api_oam_add_del_t_print
 
     if (mp->is_add == 0)
         s = format (s, "del ");
-    
+
     FINISH;
 }
 
@@ -749,12 +752,12 @@ static void *vl_api_dhcp_proxy_config_t_print
     s = format (s, "vrf_id %d ", ntohl(mp->vrf_id));
 
     if (mp->is_ipv6) {
-        s = format (s, "svr %U ", format_ip6_address, 
+        s = format (s, "svr %U ", format_ip6_address,
                     (ip6_address_t *) mp->dhcp_server);
         s = format (s, "src %U ", format_ip6_address,
                     (ip6_address_t *) mp->dhcp_src_address);
     } else {
-        s = format (s, "svr %U ", format_ip4_address, 
+        s = format (s, "svr %U ", format_ip4_address,
                     (ip4_address_t *) mp->dhcp_server);
         s = format (s, "src %U ", format_ip4_address,
                     (ip4_address_t *) mp->dhcp_src_address);
@@ -778,12 +781,12 @@ static void *vl_api_dhcp_proxy_config_2_t_print
     s = format (s, "server_vrf_id %d ", ntohl(mp->server_vrf_id));
 
     if (mp->is_ipv6) {
-        s = format (s, "svr %U ", format_ip6_address, 
+        s = format (s, "svr %U ", format_ip6_address,
                     (ip6_address_t *) mp->dhcp_server);
         s = format (s, "src %U ", format_ip6_address,
                     (ip6_address_t *) mp->dhcp_src_address);
     } else {
-        s = format (s, "svr %U ", format_ip4_address, 
+        s = format (s, "svr %U ", format_ip4_address,
                     (ip4_address_t *) mp->dhcp_server);
         s = format (s, "src %U ", format_ip4_address,
                     (ip4_address_t *) mp->dhcp_src_address);
@@ -999,7 +1002,7 @@ static void *vl_api_l2_patch_add_del_t_print
 
     if (mp->is_add == 0)
         s = format (s, "del ");
-    
+
     FINISH;
 }
 
@@ -1017,11 +1020,11 @@ static void *vl_api_sr_tunnel_add_del_t_print
     if (mp->name[0])
       s = format (s, "name %s ", mp->name);
 
-    s = format (s, "src %U dst %U/%d ", format_ip6_address, 
+    s = format (s, "src %U dst %U/%d ", format_ip6_address,
                 (ip6_address_t *) mp->src_address,
                 format_ip6_address,
                 (ip6_address_t *) mp->dst_address, mp->dst_mask_width);
-    
+
     this_address = (ip6_address_t *)mp->segs_and_tags;
     for (i = 0; i < mp->n_segments; i++) {
         s = format (s, "next %U ", format_ip6_address, this_address);
@@ -1031,7 +1034,7 @@ static void *vl_api_sr_tunnel_add_del_t_print
         s = format (s, "tag %U ", format_ip6_address, this_address);
         this_address++;
     }
-                
+
     flags_host_byte_order = clib_net_to_host_u16 (mp->flags_net_byte_order);
 
     if (flags_host_byte_order & IP6_SR_HEADER_FLAG_CLEANUP)
@@ -1042,7 +1045,7 @@ static void *vl_api_sr_tunnel_add_del_t_print
 
     for (i = 1; i <= 4; i++) {
         pl_flag = ip6_sr_policy_list_flags (flags_host_byte_order, i);
-        
+
         switch (pl_flag) {
         case IP6_SR_HEADER_FLAG_PL_ELT_NOT_PRESENT:
             continue;
@@ -1054,7 +1057,7 @@ static void *vl_api_sr_tunnel_add_del_t_print
         case IP6_SR_HEADER_FLAG_PL_ELT_EGRESS_PE:
             s = format (s, "EgPE %d ", i);
             break;
-            
+
         case IP6_SR_HEADER_FLAG_PL_ELT_ORIG_SRC_ADDR:
             s = format (s, "OrgSrc %d ", i);
             break;
@@ -1070,7 +1073,7 @@ static void *vl_api_sr_tunnel_add_del_t_print
 
     if (mp->is_add == 0)
         s = format (s, "del ");
-    
+
     FINISH;
 }
 
@@ -1160,7 +1163,7 @@ static void *vl_api_classify_add_del_table_t_print
             s = format (s, "%02x", mp->mask[i]);
         vec_add1 (s, ' ');
     }
-    
+
     FINISH;
 }
 
@@ -1178,7 +1181,7 @@ static void *vl_api_classify_add_del_session_t_print
     s = format (s, "advance %d ", ntohl (mp->advance));
     if (mp->is_add == 0)
         s = format (s, "del ");
-    
+
     s = format (s, "match hex ");
     for (i = 5 * sizeof(u32x4)-1; i > 0; i--) {
         if (mp->match[i] != 0) {
@@ -1189,7 +1192,7 @@ static void *vl_api_classify_add_del_session_t_print
 
     for (i = 0; i < limit; i++)
         s = format (s, "%02x", mp->match[i]);
-    
+
     FINISH;
 }
 
@@ -1200,9 +1203,9 @@ static void *vl_api_classify_set_interface_ip_table_t_print
 
     s = format (0, "SCRIPT: classify_set_interface_ip_table ");
 
-    if (mp->is_ipv6) 
+    if (mp->is_ipv6)
         s = format (s, "ipv6 ");
-        
+
     s = format (s, "sw_if_index %d ", ntohl(mp->sw_if_index));
     s = format (s, "table %d ", ntohl(mp->table_index));
 
@@ -1248,9 +1251,9 @@ static void *vl_api_l2tpv3_create_tunnel_t_print
                 format_ip6_address, (ip6_address_t *)(mp->our_address));
     s = format (s, "local_session_id %d ", ntohl(mp->local_session_id));
     s = format (s, "remote_session_id %d ", ntohl(mp->remote_session_id));
-    s = format (s, "local_cookie %lld ", 
+    s = format (s, "local_cookie %lld ",
                 clib_net_to_host_u64 (mp->local_cookie));
-    s = format (s, "remote_cookie %lld ", 
+    s = format (s, "remote_cookie %lld ",
                 clib_net_to_host_u64 (mp->remote_cookie));
     if (mp->l2_sublayer_present)
         s = format (s, "l2-sublayer-present ");
@@ -1258,7 +1261,7 @@ static void *vl_api_l2tpv3_create_tunnel_t_print
     FINISH;
 }
 
-static void *vl_api_l2tpv3_set_tunnel_cookies_t_print 
+static void *vl_api_l2tpv3_set_tunnel_cookies_t_print
 (vl_api_l2tpv3_set_tunnel_cookies_t * mp, void *handle)
 {
     u8 * s;
@@ -1267,10 +1270,10 @@ static void *vl_api_l2tpv3_set_tunnel_cookies_t_print
 
     s = format (s, "sw_if_index %d ", ntohl(mp->sw_if_index));
 
-    s = format (s, "new_local_cookie %llu ", 
+    s = format (s, "new_local_cookie %llu ",
                 clib_net_to_host_u64 (mp->new_local_cookie));
-    
-    s = format (s, "new_remote_cookie %llu ", 
+
+    s = format (s, "new_remote_cookie %llu ",
                 clib_net_to_host_u64 (mp->new_remote_cookie));
 
     FINISH;
@@ -1375,14 +1378,16 @@ static void * vl_api_gre_add_del_tunnel_t_print
 
     s = format (0, "SCRIPT: gre_add_del_tunnel ");
 
-    s = format (s, "dst %U ", format_ip4_address,
-                (ip4_address_t *)&(mp->dst_address));
+    s = format (s, "dst %U ", format_ip46_address,
+                (ip46_address_t *)&(mp->dst_address),
+               mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
 
-    s = format (s, "src %U ", format_ip4_address,
-                (ip4_address_t *)&(mp->src_address));
+    s = format (s, "src %U ", format_ip46_address,
+                (ip46_address_t *)&(mp->src_address),
+               mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
 
-    if (mp->outer_table_id)
-        s = format (s, "outer-fib-id %d ", ntohl(mp->outer_table_id));
+    if (mp->outer_fib_id)
+        s = format (s, "outer-fib-id %d ", ntohl(mp->outer_fib_id));
 
     if (mp->is_add == 0)
         s = format (s, "del ");
@@ -1596,7 +1601,7 @@ static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
 
     if (mp->encap_vrf_id)
         s = format (s, "encap-vrf-id %d ", ntohl(mp->encap_vrf_id));
-    
+
     if (mp->decap_vrf_id)
         s = format (s, "decap-vrf-id %d ", ntohl(mp->decap_vrf_id));
 
@@ -1615,7 +1620,7 @@ static void * vl_api_vxlan_gpe_tunnel_dump_t_print
     FINISH;
 }
 
-static void *vl_api_interface_name_renumber_t_print 
+static void *vl_api_interface_name_renumber_t_print
 (vl_api_interface_name_renumber_t * mp, void * handle)
 {
     u8 * s;
@@ -1624,9 +1629,9 @@ static void *vl_api_interface_name_renumber_t_print
 
     s = format (s, "sw_if_index %d ", ntohl(mp->sw_if_index));
 
-    s = format (s, "new_show_dev_instance %d ", 
+    s = format (s, "new_show_dev_instance %d ",
                 ntohl(mp->new_show_dev_instance));
-    
+
     FINISH;
 }
 
@@ -1634,9 +1639,9 @@ static void *vl_api_want_ip4_arp_events_t_print
 (vl_api_want_ip4_arp_events_t * mp, void * handle)
 {
     u8 * s;
+
     s = format (0, "SCRIPT: want_ip4_arp_events ");
-    s = format (s, "pid %d address %U ", mp->pid, 
+    s = format (s, "pid %d address %U ", mp->pid,
                 format_ip4_address, &mp->address);
     if (mp->enable_disable == 0)
         s = format (s, "del ");
@@ -1718,7 +1723,7 @@ static void * vl_api_cop_whitelist_enable_disable_t_print
     FINISH;
 }
 
-static void * vl_api_af_packet_create_t_print 
+static void * vl_api_af_packet_create_t_print
 (vl_api_af_packet_create_t * mp, void *handle)
 {
     u8 * s;
@@ -1733,7 +1738,7 @@ static void * vl_api_af_packet_create_t_print
     FINISH;
 }
 
-static void * vl_api_af_packet_delete_t_print 
+static void * vl_api_af_packet_delete_t_print
 (vl_api_af_packet_delete_t * mp, void *handle)
 {
     u8 * s;
@@ -1744,6 +1749,157 @@ static void * vl_api_af_packet_delete_t_print
     FINISH;
 }
 
+static u8 * format_policer_action (u8 * s, va_list * va)
+{
+    u32 action = va_arg (*va, u32);
+    u32 dscp = va_arg (*va, u32);
+    char * t = 0;
+
+    if (action == SSE2_QOS_ACTION_DROP)
+        s = format (s, "drop");
+    else if (action == SSE2_QOS_ACTION_TRANSMIT)
+        s = format (s, "transmit");
+    else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT) {
+        s = format (s, "mark-and-transmit ");
+        switch (dscp) {
+        #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
+            foreach_vnet_dscp
+        #undef _
+        default:
+            break;
+        }
+        s = format (s, "%s", t);
+    }
+
+    return s;
+}
+
+static void * vl_api_policer_add_del_t_print
+(vl_api_policer_add_del_t * mp, void *handle)
+{
+    u8 * s;
+
+    s = format (0, "SCRIPT: policer_add_del ");
+    s = format (s, "name %s ", mp->name);
+    s = format (s, "cir %d ", mp->cir);
+    s = format (s, "eir %d ", mp->eir);
+    s = format (s, "cb %d ", mp->cb);
+    s = format (s, "eb %d ", mp->eb);
+
+    switch (mp->rate_type) {
+    case SSE2_QOS_RATE_KBPS:
+        s = format (s, "rate_type kbps ");
+        break;
+    case SSE2_QOS_RATE_PPS:
+        s = format (s, "rate_type pps ");
+        break;
+    default:
+        break;
+    }
+
+    switch (mp->round_type) {
+    case SSE2_QOS_ROUND_TO_CLOSEST:
+        s = format (s, "round_type closest ");
+        break;
+    case SSE2_QOS_ROUND_TO_UP:
+        s = format (s, "round_type up ");
+        break;
+    case SSE2_QOS_ROUND_TO_DOWN:
+        s = format (s, "round_type down ");
+        break;
+    default:
+        break;
+    }
+
+    switch (mp->type) {
+    case SSE2_QOS_POLICER_TYPE_1R2C:
+        s = format (s, "type 1r2c ");
+        break;
+    case SSE2_QOS_POLICER_TYPE_1R3C_RFC_2697:
+        s = format (s, "type 1r3c ");
+        break;
+    case SSE2_QOS_POLICER_TYPE_2R3C_RFC_2698:
+        s = format (s, "type 2r3c-2698 ");
+        break;
+    case SSE2_QOS_POLICER_TYPE_2R3C_RFC_4115:
+        s = format (s, "type 2r3c-4115 ");
+        break;
+    case SSE2_QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1:
+        s = format (s, "type 2r3c-mef5cf1 ");
+        break;
+    default:
+         break;
+    }
+
+    s = format (s, "conform_action %U ", format_policer_action,
+                mp->conform_action_type, mp->conform_dscp);
+    s = format (s, "exceed_action %U ", format_policer_action,
+                mp->exceed_action_type, mp->exceed_dscp);
+    s = format (s, "violate_action %U ", format_policer_action,
+                mp->violate_action_type, mp->violate_dscp);
+
+    if (mp->color_aware)
+        s = format (s, "color-aware ");
+    if (mp->is_add == 0)
+        s = format (s, "del ");
+
+    FINISH;
+}
+
+static void * vl_api_policer_dump_t_print
+(vl_api_policer_dump_t * mp, void *handle)
+{
+    u8 * s;
+
+    s = format (0, "SCRIPT: policer_dump ");
+    if (mp->match_name_valid)
+        s = format (s, "name %s ", mp->match_name);
+
+    FINISH;
+}
+
+static void * vl_api_policer_classify_set_interface_t_print
+(vl_api_policer_classify_set_interface_t * mp, void *handle)
+{
+    u8 * s;
+
+    s = format (0, "SCRIPT: policer_classify_set_interface ");
+    s = format (s, "sw_if_index %d ", ntohl(mp->sw_if_index));
+    if (mp->ip4_table_index != ~0)
+        s = format (s, "ip4-table %d ", ntohl(mp->ip4_table_index));
+    if (mp->ip6_table_index != ~0)
+        s = format (s, "ip6-table %d ", ntohl(mp->ip6_table_index));
+    if (mp->l2_table_index != ~0)
+        s = format (s, "l2-table %d ", ntohl(mp->l2_table_index));
+    if (mp->is_add == 0)
+        s = format (s, "del ");
+
+    FINISH;
+}
+
+static void * vl_api_policer_classify_dump_t_print
+(vl_api_policer_classify_dump_t * mp, void *handle)
+{
+    u8 * s;
+
+    s = format (0, "SCRIPT: policer_classify_dump ");
+    switch (mp->type) {
+    case POLICER_CLASSIFY_TABLE_IP4:
+        s = format (s, "type ip4 ");
+        break;
+    case POLICER_CLASSIFY_TABLE_IP6:
+        s = format (s, "type ip6 ");
+        break;
+    case POLICER_CLASSIFY_TABLE_L2:
+        s = format (s, "type l2 ");
+        break;
+    default:
+        break;
+    }
+
+    FINISH;
+}
+
 static void *vl_api_sw_interface_clear_stats_t_print
 (vl_api_sw_interface_clear_stats_t * mp, void *handle)
 {
@@ -1846,6 +2002,141 @@ static void *vl_api_classify_session_dump_t_print
     FINISH;
 }
 
+static void *vl_api_ipfix_enable_t_print
+(vl_api_ipfix_enable_t * mp, void *handle)
+{
+    u8 * s;
+
+    s = format (0, "SCRIPT: ipfix_enable ");
+
+    s = format (s, "collector-address %U ", format_ip4_address,
+                (ip4_address_t *) mp->collector_address);
+    s = format (s, "collector-port %d ", ntohs(mp->collector_port));
+    s = format (s, "src-address %U ", format_ip4_address,
+                (ip4_address_t *) mp->src_address);
+    s = format (s, "vrf-id %d ", ntohl(mp->vrf_id));
+    s = format (s, "path-mtu %d ", ntohl(mp->path_mtu));
+    s = format (s, "template-interval %d ", ntohl(mp->template_interval));
+
+    FINISH;
+}
+
+static void *vl_api_ipfix_dump_t_print
+(vl_api_ipfix_dump_t * mp, void *handle)
+{
+    u8 * s;
+
+    s = format (0, "SCRIPT: ipfix_dump ");
+
+    FINISH;
+}
+
+static void *vl_api_get_next_index_t_print
+(vl_api_get_next_index_t * mp, void *handle)
+{
+    u8 * s;
+
+    s = format (0, "SCRIPT: get_next_index ");
+    s = format (s, "node-name %s ", mp->node_name);
+    s = format (s, "next-node-name %s ", mp->next_name);
+
+    FINISH;
+}
+
+static void *vl_api_pg_create_interface_t_print
+(vl_api_pg_create_interface_t * mp, void *handle)
+{
+    u8 * s;
+
+    s = format (0, "SCRIPT: pg_create_interface ");
+    s = format (0, "if_id %d", ntohl(mp->interface_id));
+
+    FINISH;
+}
+
+static void *vl_api_pg_capture_t_print
+(vl_api_pg_capture_t * mp, void *handle)
+{
+    u8 * s;
+
+    s = format (0, "SCRIPT: pg_capture ");
+    s = format (0, "if_id %d ", ntohl(mp->interface_id));
+    s = format (0, "pcap %s", mp->pcap_file_name);
+    if (mp->count != ~0)
+      s = format (s, "count %d ", ntohl(mp->count));
+    if (!mp->is_enabled)
+       s = format (s, "disable");
+
+    FINISH;
+}
+
+static void *vl_api_pg_enable_disable_t_print
+(vl_api_pg_enable_disable_t * mp, void *handle)
+{
+       u8 * s;
+
+    s = format (0, "SCRIPT: pg_enable_disable ");
+    if (ntohl(mp->stream_name_length) > 0)
+      s = format (s, "stream %s", mp->stream_name);
+    if (!mp->is_enabled)
+      s = format (s, "disable");
+
+    FINISH;
+}
+
+static void *vl_api_ip_source_and_port_range_check_add_del_t_print
+(vl_api_ip_source_and_port_range_check_add_del_t * mp, void *handle)
+{
+    u8 * s;
+    int i;
+
+    s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
+    if (mp->is_ipv6)
+        s = format (s, "%U/%d ", format_ip6_address, mp->address,
+                    mp->mask_length);
+    else
+        s = format (s, "%U/%d ", format_ip4_address, mp->address,
+                    mp->mask_length);
+
+    for (i = 0; i < mp->number_of_ranges; i++) {
+        s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
+    }
+
+    s = format (s, "vrf %d ", ntohl(mp->vrf_id));
+
+    if (mp->is_add == 0)
+        s = format (s, "del ");
+
+    FINISH;
+}
+
+static void *vl_api_ip_source_and_port_range_check_interface_add_del_t_print
+(vl_api_ip_source_and_port_range_check_interface_add_del_t * mp, void *handle)
+{
+    u8 * s;
+
+    s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
+
+    s = format (s, "sw_if_index %d ", ntohl(mp->sw_if_index));
+
+    if (mp->tcp_out_vrf_id != ~0)
+        s = format (s, "tcp-out-vrf %d ", ntohl(mp->tcp_out_vrf_id));
+
+    if (mp->udp_out_vrf_id != ~0)
+        s = format (s, "udp-out-vrf %d ", ntohl(mp->udp_out_vrf_id));
+
+    if (mp->tcp_in_vrf_id != ~0)
+        s = format (s, "tcp-in-vrf %d ", ntohl(mp->tcp_in_vrf_id));
+
+    if (mp->udp_in_vrf_id != ~0)
+        s = format (s, "udp-in-vrf %d ", ntohl(mp->udp_in_vrf_id));
+
+    if (mp->is_add == 0)
+        s = format (s, "del ");
+
+    FINISH;
+}
+
 #define foreach_custom_print_function                                   \
 _(CREATE_LOOPBACK, create_loopback)                                     \
 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags)                       \
@@ -1941,9 +2232,24 @@ _(MPLS_FIB_DECAP_DUMP, mpls_fib_decap_dump)                             \
 _(CLASSIFY_TABLE_IDS,classify_table_ids)                                \
 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface)             \
 _(CLASSIFY_TABLE_INFO,classify_table_info)                              \
-_(CLASSIFY_SESSION_DUMP,classify_session_dump)
-
-void vl_msg_api_custom_dump_configure (api_main_t *am) 
+_(CLASSIFY_SESSION_DUMP,classify_session_dump)                          \
+_(IPFIX_ENABLE,ipfix_enable)                                            \
+_(IPFIX_DUMP,ipfix_dump)                                                \
+_(GET_NEXT_INDEX, get_next_index)                                       \
+_(PG_CREATE_INTERFACE,pg_create_interface)                              \
+_(PG_CAPTURE, pg_capture)                                               \
+_(PG_ENABLE_DISABLE, pg_enable_disable)                                 \
+_(POLICER_ADD_DEL, policer_add_del)                                     \
+_(POLICER_DUMP, policer_dump)                                           \
+_(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface)       \
+_(POLICER_CLASSIFY_DUMP, policer_classify_dump)                         \
+_(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL,                               \
+  ip_source_and_port_range_check_add_del)                               \
+_(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL,                     \
+  ip_source_and_port_range_check_interface_add_del)
+
+
+void vl_msg_api_custom_dump_configure (api_main_t *am)
 {
 #define _(n,f) am->msg_print_handlers[VL_API_##n]       \
     = (void *) vl_api_##f##_t_print;