2 * ------------------------------------------------------------------
3 * custom_dump.c - pretty-print API messages for replay
5 * Copyright (c) 2014-2016 Cisco and/or its affiliates. Licensed under the
6 * Apache License, Version 2.0 (the "License"); you may not use this file
7 * except in compliance with the License. You may obtain a copy of the
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 * License for the specific language governing permissions and limitations
17 * ------------------------------------------------------------------
20 #include <vnet/vnet.h>
21 #include <vnet/ip/ip.h>
22 #include <vnet/unix/tuntap.h>
23 #include <vnet/mpls/mpls.h>
24 #include <vnet/dhcp/dhcp_proxy.h>
25 #include <vnet/l2tp/l2tp.h>
26 #include <vnet/l2/l2_input.h>
27 #include <vnet/srv6/sr.h>
28 #include <vnet/srmpls/sr_mpls.h>
29 #include <vnet/vxlan-gpe/vxlan_gpe.h>
30 #include <vnet/geneve/geneve.h>
31 #include <vnet/classify/policer_classify.h>
32 #include <vnet/policer/xlate.h>
33 #include <vnet/policer/policer.h>
34 #include <vnet/classify/flow_classify.h>
35 #include <vlib/vlib.h>
36 #include <vlib/unix/unix.h>
37 #include <vlibapi/api.h>
38 #include <vlibmemory/api.h>
39 #include <vnet/lisp-cp/lisp_types.h>
41 #include <vpp/stats/stats.h>
42 #include <vpp/oam/oam.h>
44 #include <vnet/ethernet/ethernet.h>
45 #include <vnet/l2/l2_vtr.h>
47 #include <vpp/api/vpe_msg_enum.h>
49 #define vl_typedefs /* define message structures */
50 #include <vpp/api/vpe_all_api_h.h>
53 #define vl_endianfun /* define message structures */
54 #include <vpp/api/vpe_all_api_h.h>
57 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
61 vl_print (handle, (char *)s); \
66 static void *vl_api_create_loopback_t_print
67 (vl_api_create_loopback_t * mp, void *handle)
71 s = format (0, "SCRIPT: create_loopback ");
72 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
77 static void *vl_api_create_loopback_instance_t_print
78 (vl_api_create_loopback_instance_t * mp, void *handle)
82 s = format (0, "SCRIPT: create_loopback ");
83 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
84 s = format (s, "instance %d ", ntohl (mp->user_instance));
89 static void *vl_api_delete_loopback_t_print
90 (vl_api_delete_loopback_t * mp, void *handle)
94 s = format (0, "SCRIPT: delete_loopback ");
95 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
100 static void *vl_api_sw_interface_set_flags_t_print
101 (vl_api_sw_interface_set_flags_t * mp, void *handle)
104 s = format (0, "SCRIPT: sw_interface_set_flags ");
106 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
108 if (mp->admin_up_down)
109 s = format (s, "admin-up ");
111 s = format (s, "admin-down ");
116 static void *vl_api_sw_interface_event_t_print
117 (vl_api_sw_interface_event_t * mp, void *handle)
120 s = format (0, "SCRIPT: sw_interface_event ");
122 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
124 if (mp->admin_up_down)
125 s = format (s, "admin-up ");
127 s = format (s, "admin-down ");
129 if (mp->link_up_down)
130 s = format (s, "link-up");
132 s = format (s, "link-down");
135 s = format (s, " deleted");
140 static void *vl_api_sw_interface_add_del_address_t_print
141 (vl_api_sw_interface_add_del_address_t * mp, void *handle)
145 s = format (0, "SCRIPT: sw_interface_add_del_address ");
147 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
150 s = format (s, "%U/%d ", format_ip6_address,
151 (ip6_address_t *) mp->address, mp->address_length);
153 s = format (s, "%U/%d ", format_ip4_address,
154 (ip4_address_t *) mp->address, mp->address_length);
157 s = format (s, "del ");
159 s = format (s, "del-all ");
164 static void *vl_api_sw_interface_set_table_t_print
165 (vl_api_sw_interface_set_table_t * mp, void *handle)
169 s = format (0, "SCRIPT: sw_interface_set_table ");
171 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
174 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
177 s = format (s, "ipv6 ");
182 static void *vl_api_sw_interface_set_mpls_enable_t_print
183 (vl_api_sw_interface_set_mpls_enable_t * mp, void *handle)
187 s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
189 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
192 s = format (s, "disable");
197 static void *vl_api_sw_interface_set_vpath_t_print
198 (vl_api_sw_interface_set_vpath_t * mp, void *handle)
202 s = format (0, "SCRIPT: sw_interface_set_vpath ");
204 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
207 s = format (s, "enable ");
209 s = format (s, "disable ");
214 static void *vl_api_sw_interface_set_vxlan_bypass_t_print
215 (vl_api_sw_interface_set_vxlan_bypass_t * mp, void *handle)
219 s = format (0, "SCRIPT: sw_interface_set_vxlan_bypass ");
221 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
224 s = format (s, "ip6 ");
227 s = format (s, "enable ");
229 s = format (s, "disable ");
234 static void *vl_api_sw_interface_set_geneve_bypass_t_print
235 (vl_api_sw_interface_set_geneve_bypass_t * mp, void *handle)
239 s = format (0, "SCRIPT: sw_interface_set_geneve_bypass ");
241 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
244 s = format (s, "ip6 ");
247 s = format (s, "enable ");
249 s = format (s, "disable ");
254 static void *vl_api_sw_interface_set_l2_xconnect_t_print
255 (vl_api_sw_interface_set_l2_xconnect_t * mp, void *handle)
259 s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
261 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
265 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
268 s = format (s, "delete ");
273 static void *vl_api_sw_interface_set_l2_bridge_t_print
274 (vl_api_sw_interface_set_l2_bridge_t * mp, void *handle)
278 s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
280 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
284 s = format (s, "bd_id %d shg %d %senable ", ntohl (mp->bd_id),
285 mp->shg, ((mp->bvi) ? "bvi " : " "));
288 s = format (s, "disable ");
293 static void *vl_api_bridge_domain_add_del_t_print
294 (vl_api_bridge_domain_add_del_t * mp, void *handle)
298 s = format (0, "SCRIPT: bridge_domain_add_del ");
300 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
305 s = format (s, "bd_tag %s ", mp->bd_tag);
306 s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood);
307 s = format (s, "forward %d learn %d ", mp->forward, mp->learn);
308 s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age);
311 s = format (s, "del ");
316 static void *vl_api_bridge_domain_set_mac_age_t_print
317 (vl_api_bridge_domain_set_mac_age_t * mp, void *handle)
321 s = format (0, "SCRIPT: bridge_domain_set_mac_age ");
323 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
325 s = format (s, "mac-age %d", mp->mac_age);
330 static void *vl_api_bridge_domain_dump_t_print
331 (vl_api_bridge_domain_dump_t * mp, void *handle)
334 u32 bd_id = ntohl (mp->bd_id);
336 s = format (0, "SCRIPT: bridge_domain_dump ");
339 s = format (s, "bd_id %d ", bd_id);
344 static void *vl_api_l2fib_flush_all_t_print
345 (vl_api_l2fib_flush_all_t * mp, void *handle)
349 s = format (0, "SCRIPT: l2fib_flush_all ");
355 static void *vl_api_l2fib_flush_bd_t_print
356 (vl_api_l2fib_flush_bd_t * mp, void *handle)
359 u32 bd_id = ntohl (mp->bd_id);
361 s = format (0, "SCRIPT: l2fib_flush_bd ");
362 s = format (s, "bd_id %d ", bd_id);
367 static void *vl_api_l2fib_flush_int_t_print
368 (vl_api_l2fib_flush_int_t * mp, void *handle)
371 u32 sw_if_index = ntohl (mp->sw_if_index);
373 s = format (0, "SCRIPT: l2fib_flush_int ");
374 s = format (s, "sw_if_index %d ", sw_if_index);
379 static void *vl_api_l2fib_add_del_t_print
380 (vl_api_l2fib_add_del_t * mp, void *handle)
384 s = format (0, "SCRIPT: l2fib_add_del ");
386 s = format (s, "mac %U ", format_ethernet_address, mp->mac);
388 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
393 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
395 s = format (s, "%s", "static ");
397 s = format (s, "%s", "filter ");
399 s = format (s, "%s", "bvi ");
403 s = format (s, "del ");
410 vl_api_l2_flags_t_print (vl_api_l2_flags_t * mp, void *handle)
413 u32 flags = ntohl (mp->feature_bitmap);
415 s = format (0, "SCRIPT: l2_flags ");
417 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
419 if (flags & L2_LEARN)
420 s = format (s, "learn ");
422 s = format (s, "forward ");
423 if (flags & L2_FLOOD)
424 s = format (s, "flood ");
425 if (flags & L2_UU_FLOOD)
426 s = format (s, "uu-flood ");
427 if (flags & L2_ARP_TERM)
428 s = format (s, "arp-term ");
431 s = format (s, "clear ");
436 static void *vl_api_bridge_flags_t_print
437 (vl_api_bridge_flags_t * mp, void *handle)
440 u32 flags = ntohl (mp->feature_bitmap);
442 s = format (0, "SCRIPT: bridge_flags ");
444 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
446 if (flags & L2_LEARN)
447 s = format (s, "learn ");
449 s = format (s, "forward ");
450 if (flags & L2_FLOOD)
451 s = format (s, "flood ");
452 if (flags & L2_UU_FLOOD)
453 s = format (s, "uu-flood ");
454 if (flags & L2_ARP_TERM)
455 s = format (s, "arp-term ");
458 s = format (s, "clear ");
463 static void *vl_api_bd_ip_mac_add_del_t_print
464 (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
468 s = format (0, "SCRIPT: bd_ip_mac_add_del ");
469 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
472 s = format (s, "%U ", format_ip6_address,
473 (ip6_address_t *) mp->ip_address);
475 s = format (s, "%U ", format_ip4_address,
476 (ip4_address_t *) mp->ip_address);
478 s = format (s, "%U ", format_ethernet_address, mp->mac_address);
480 s = format (s, "del ");
485 static void *vl_api_tap_connect_t_print
486 (vl_api_tap_connect_t * mp, void *handle)
491 memset (null_mac, 0, sizeof (null_mac));
493 s = format (0, "SCRIPT: tap_connect ");
494 s = format (s, "tapname %s ", mp->tap_name);
495 if (mp->use_random_mac)
496 s = format (s, "random-mac ");
498 s = format (s, "tag %s ", mp->tag);
499 if (memcmp (mp->mac_address, null_mac, 6))
500 s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
501 if (mp->ip4_address_set)
502 s = format (s, "address %U/%d ", format_ip4_address, mp->ip4_address,
504 if (mp->ip6_address_set)
505 s = format (s, "address %U/%d ", format_ip6_address, mp->ip6_address,
510 static void *vl_api_tap_modify_t_print
511 (vl_api_tap_modify_t * mp, void *handle)
516 memset (null_mac, 0, sizeof (null_mac));
518 s = format (0, "SCRIPT: tap_modify ");
519 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
520 s = format (s, "tapname %s ", mp->tap_name);
521 if (mp->use_random_mac)
522 s = format (s, "random-mac ");
524 if (memcmp (mp->mac_address, null_mac, 6))
525 s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
530 static void *vl_api_tap_delete_t_print
531 (vl_api_tap_delete_t * mp, void *handle)
535 s = format (0, "SCRIPT: tap_delete ");
536 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
541 static void *vl_api_sw_interface_tap_dump_t_print
542 (vl_api_sw_interface_tap_dump_t * mp, void *handle)
546 s = format (0, "SCRIPT: sw_interface_tap_dump ");
551 static void *vl_api_tap_create_v2_t_print
552 (vl_api_tap_create_v2_t * mp, void *handle)
557 memset (null_mac, 0, sizeof (null_mac));
559 s = format (0, "SCRIPT: tap_create_v2 ");
560 s = format (s, "id %s ", mp->id);
561 if (memcmp (mp->mac_address, null_mac, 6))
562 s = format (s, "mac-address %U ",
563 format_ethernet_address, mp->mac_address);
564 if (memcmp (mp->host_mac_addr, null_mac, 6))
565 s = format (s, "host-mac-addr %U ",
566 format_ethernet_address, mp->host_mac_addr);
567 if (mp->host_if_name_set)
568 s = format (s, "host-if-name %s ", mp->host_if_name);
569 if (mp->host_namespace_set)
570 s = format (s, "host-ns %s ", mp->host_namespace);
571 if (mp->host_bridge_set)
572 s = format (s, "host-bridge %s ", mp->host_bridge);
573 if (mp->host_ip4_addr_set)
574 s = format (s, "host-ip4-addr %U/%d ", format_ip4_address,
575 mp->host_ip4_addr, mp->host_ip4_prefix_len);
576 if (mp->host_ip6_addr_set)
577 s = format (s, "host-ip6-addr %U/%d ", format_ip6_address,
578 mp->host_ip6_addr, mp->host_ip6_prefix_len);
579 if (mp->host_ip4_gw_set)
580 s = format (s, "host-ip4-gw %U ", format_ip4_address, mp->host_ip4_addr);
581 if (mp->host_ip6_gw_set)
582 s = format (s, "host-ip6-gw %U ", format_ip6_address, mp->host_ip6_addr);
584 s = format (s, "tx-ring-size %d ", mp->tx_ring_sz);
586 s = format (s, "rx-ring-size %d ", mp->rx_ring_sz);
590 static void *vl_api_tap_delete_v2_t_print
591 (vl_api_tap_delete_v2_t * mp, void *handle)
595 s = format (0, "SCRIPT: tap_delete_v2 ");
596 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
601 static void *vl_api_sw_interface_tap_v2_dump_t_print
602 (vl_api_sw_interface_tap_v2_dump_t * mp, void *handle)
606 s = format (0, "SCRIPT: sw_interface_tap_v2_dump ");
611 static void *vl_api_ip_add_del_route_t_print
612 (vl_api_ip_add_del_route_t * mp, void *handle)
616 s = format (0, "SCRIPT: ip_add_del_route ");
618 s = format (s, "del ");
620 if (mp->next_hop_sw_if_index)
621 s = format (s, "sw_if_index %d ", ntohl (mp->next_hop_sw_if_index));
624 s = format (s, "%U/%d ", format_ip6_address, mp->dst_address,
625 mp->dst_address_length);
627 s = format (s, "%U/%d ", format_ip4_address, mp->dst_address,
628 mp->dst_address_length);
630 s = format (s, "local ");
631 else if (mp->is_drop)
632 s = format (s, "drop ");
633 else if (mp->is_classify)
634 s = format (s, "classify %d", ntohl (mp->classify_table_index));
638 s = format (s, "via %U ", format_ip6_address, mp->next_hop_address);
640 s = format (s, "via %U ", format_ip4_address, mp->next_hop_address);
643 if (mp->table_id != 0)
644 s = format (s, "vrf %d ", ntohl (mp->table_id));
646 if (mp->next_hop_weight != 1)
647 s = format (s, "weight %d ", mp->next_hop_weight);
649 if (mp->is_multipath)
650 s = format (s, "multipath ");
652 if (mp->is_multipath)
653 s = format (s, "multipath ");
655 if (mp->next_hop_table_id)
656 s = format (s, "lookup-in-vrf %d ", ntohl (mp->next_hop_table_id));
661 static void *vl_api_proxy_arp_add_del_t_print
662 (vl_api_proxy_arp_add_del_t * mp, void *handle)
666 s = format (0, "SCRIPT: proxy_arp_add_del ");
668 s = format (s, "%U - %U ", format_ip4_address, mp->low_address,
669 format_ip4_address, mp->hi_address);
672 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
675 s = format (s, "del ");
680 static void *vl_api_proxy_arp_intfc_enable_disable_t_print
681 (vl_api_proxy_arp_intfc_enable_disable_t * mp, void *handle)
685 s = format (0, "SCRIPT: proxy_arp_intfc_enable_disable ");
687 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
689 s = format (s, "enable %d ", mp->enable_disable);
694 static void *vl_api_mpls_tunnel_add_del_t_print
695 (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
699 s = format (0, "SCRIPT: mpls_tunnel_add_del ");
701 if (mp->mt_next_hop_sw_if_index)
702 s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index));
704 if (mp->mt_next_hop_proto_is_ip4)
705 s = format (s, "%U ", format_ip4_address, mp->mt_next_hop);
707 s = format (s, "%U ", format_ip6_address, mp->mt_next_hop);
710 s = format (s, "l2-only ");
712 if (mp->mt_is_add == 0)
713 s = format (s, "del ");
718 static void *vl_api_sw_interface_set_unnumbered_t_print
719 (vl_api_sw_interface_set_unnumbered_t * mp, void *handle)
723 s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
725 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
727 s = format (s, "unnum_if_index %d ", ntohl (mp->unnumbered_sw_if_index));
730 s = format (s, "del ");
735 static void *vl_api_ip_neighbor_add_del_t_print
736 (vl_api_ip_neighbor_add_del_t * mp, void *handle)
741 memset (null_mac, 0, sizeof (null_mac));
743 s = format (0, "SCRIPT: ip_neighbor_add_del ");
745 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
748 s = format (s, "is_static ");
750 if (mp->is_no_adj_fib)
751 s = format (s, "is_no_fib_entry ");
753 if (memcmp (mp->mac_address, null_mac, 6))
754 s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
758 format (s, "dst %U ", format_ip6_address,
759 (ip6_address_t *) mp->dst_address);
762 format (s, "dst %U ", format_ip4_address,
763 (ip4_address_t *) mp->dst_address);
766 s = format (s, "del ");
771 static void *vl_api_create_vlan_subif_t_print
772 (vl_api_create_vlan_subif_t * mp, void *handle)
776 s = format (0, "SCRIPT: create_vlan_subif ");
779 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
782 s = format (s, "vlan_id %d ", ntohl (mp->vlan_id));
787 #define foreach_create_subif_bit \
794 _(outer_vlan_id_any) \
797 static void *vl_api_create_subif_t_print
798 (vl_api_create_subif_t * mp, void *handle)
802 s = format (0, "SCRIPT: create_subif ");
804 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
806 s = format (s, "sub_id %d ", ntohl (mp->sub_id));
808 if (mp->outer_vlan_id)
809 s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
811 if (mp->inner_vlan_id)
812 s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
814 #define _(a) if (mp->a) s = format (s, "%s ", #a);
815 foreach_create_subif_bit;
821 static void *vl_api_delete_subif_t_print
822 (vl_api_delete_subif_t * mp, void *handle)
826 s = format (0, "SCRIPT: delete_subif ");
827 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
832 static void *vl_api_oam_add_del_t_print
833 (vl_api_oam_add_del_t * mp, void *handle)
837 s = format (0, "SCRIPT: oam_add_del ");
840 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
842 s = format (s, "src %U ", format_ip4_address, mp->src_address);
844 s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
847 s = format (s, "del ");
853 vl_api_reset_fib_t_print (vl_api_reset_fib_t * mp, void *handle)
857 s = format (0, "SCRIPT: reset_fib ");
860 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
862 if (mp->is_ipv6 != 0)
863 s = format (s, "ipv6 ");
868 static void *vl_api_dhcp_proxy_config_t_print
869 (vl_api_dhcp_proxy_config_t * mp, void *handle)
873 s = format (0, "SCRIPT: dhcp_proxy_config_2 ");
875 s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
876 s = format (s, "server_vrf_id %d ", ntohl (mp->server_vrf_id));
880 s = format (s, "svr %U ", format_ip6_address,
881 (ip6_address_t *) mp->dhcp_server);
882 s = format (s, "src %U ", format_ip6_address,
883 (ip6_address_t *) mp->dhcp_src_address);
887 s = format (s, "svr %U ", format_ip4_address,
888 (ip4_address_t *) mp->dhcp_server);
889 s = format (s, "src %U ", format_ip4_address,
890 (ip4_address_t *) mp->dhcp_src_address);
893 s = format (s, "del ");
898 static void *vl_api_dhcp_proxy_set_vss_t_print
899 (vl_api_dhcp_proxy_set_vss_t * mp, void *handle)
903 s = format (0, "SCRIPT: dhcp_proxy_set_vss ");
905 s = format (s, "tbl_id %d ", ntohl (mp->tbl_id));
907 if (mp->vss_type == VSS_TYPE_VPN_ID)
909 s = format (s, "fib_id %d ", ntohl (mp->vpn_index));
910 s = format (s, "oui %d ", ntohl (mp->oui));
912 else if (mp->vss_type == VSS_TYPE_ASCII)
913 s = format (s, "vpn_ascii_id %s", mp->vpn_ascii_id);
915 if (mp->is_ipv6 != 0)
916 s = format (s, "ipv6 ");
919 s = format (s, "del ");
924 static void *vl_api_dhcp_client_config_t_print
925 (vl_api_dhcp_client_config_t * mp, void *handle)
929 s = format (0, "SCRIPT: dhcp_client_config ");
931 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
933 s = format (s, "hostname %s ", mp->hostname);
935 s = format (s, "want_dhcp_event %d ", mp->want_dhcp_event);
937 s = format (s, "pid %d ", ntohl (mp->pid));
940 s = format (s, "del ");
946 static void *vl_api_set_ip_flow_hash_t_print
947 (vl_api_set_ip_flow_hash_t * mp, void *handle)
951 s = format (0, "SCRIPT: set_ip_flow_hash ");
953 s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
956 s = format (s, "src ");
959 s = format (s, "dst ");
962 s = format (s, "sport ");
965 s = format (s, "dport ");
968 s = format (s, "proto ");
971 s = format (s, "reverse ");
973 if (mp->is_ipv6 != 0)
974 s = format (s, "ipv6 ");
979 static void *vl_api_sw_interface_ip6_set_link_local_address_t_print
980 (vl_api_sw_interface_ip6_set_link_local_address_t * mp, void *handle)
984 s = format (0, "SCRIPT: sw_interface_ip6_set_link_local_address ");
986 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
988 s = format (s, "%U ", format_ip6_address, mp->address);
993 static void *vl_api_sw_interface_ip6nd_ra_prefix_t_print
994 (vl_api_sw_interface_ip6nd_ra_prefix_t * mp, void *handle)
998 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_prefix ");
1000 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1002 s = format (s, "%U/%d ", format_ip6_address, mp->address,
1003 mp->address_length);
1005 s = format (s, "val_life %d ", ntohl (mp->val_lifetime));
1007 s = format (s, "pref_life %d ", ntohl (mp->pref_lifetime));
1009 if (mp->use_default)
1010 s = format (s, "def ");
1012 if (mp->no_advertise)
1013 s = format (s, "noadv ");
1016 s = format (s, "offl ");
1018 if (mp->no_autoconfig)
1019 s = format (s, "noauto ");
1022 s = format (s, "nolink ");
1025 s = format (s, "isno ");
1030 static void *vl_api_sw_interface_ip6nd_ra_config_t_print
1031 (vl_api_sw_interface_ip6nd_ra_config_t * mp, void *handle)
1035 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_config ");
1037 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1039 s = format (s, "maxint %d ", ntohl (mp->max_interval));
1041 s = format (s, "minint %d ", ntohl (mp->min_interval));
1043 s = format (s, "life %d ", ntohl (mp->lifetime));
1045 s = format (s, "count %d ", ntohl (mp->initial_count));
1047 s = format (s, "interval %d ", ntohl (mp->initial_interval));
1050 s = format (s, "suppress ");
1053 s = format (s, "managed ");
1056 s = format (s, "other ");
1059 s = format (s, "ll ");
1061 if (mp->send_unicast)
1062 s = format (s, "send ");
1065 s = format (s, "cease ");
1068 s = format (s, "isno ");
1070 if (mp->default_router)
1071 s = format (s, "def ");
1076 static void *vl_api_set_arp_neighbor_limit_t_print
1077 (vl_api_set_arp_neighbor_limit_t * mp, void *handle)
1081 s = format (0, "SCRIPT: set_arp_neighbor_limit ");
1083 s = format (s, "arp_nbr_limit %d ", ntohl (mp->arp_neighbor_limit));
1085 if (mp->is_ipv6 != 0)
1086 s = format (s, "ipv6 ");
1091 static void *vl_api_l2_patch_add_del_t_print
1092 (vl_api_l2_patch_add_del_t * mp, void *handle)
1096 s = format (0, "SCRIPT: l2_patch_add_del ");
1098 s = format (s, "rx_sw_if_index %d ", ntohl (mp->rx_sw_if_index));
1100 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
1102 if (mp->is_add == 0)
1103 s = format (s, "del ");
1108 static void *vl_api_sr_localsid_add_del_t_print
1109 (vl_api_sr_localsid_add_del_t * mp, void *handle)
1111 vnet_main_t *vnm = vnet_get_main ();
1114 s = format (0, "SCRIPT: sr_localsid_add_del ");
1116 switch (mp->behavior)
1118 case SR_BEHAVIOR_END:
1119 s = format (s, "Address: %U\nBehavior: End",
1120 format_ip6_address, (ip6_address_t *) mp->localsid_addr);
1121 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1126 "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1127 "\nIface: %U\nNext hop: %U", format_ip6_address,
1128 (ip6_address_t *) mp->localsid_addr,
1129 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1130 format_ip6_address, (ip6_address_t *) mp->nh_addr);
1131 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1133 case SR_BEHAVIOR_DX4:
1136 "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1137 "\nIface: %U\nNext hop: %U", format_ip6_address,
1138 (ip6_address_t *) mp->localsid_addr,
1139 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1140 format_ip4_address, (ip4_address_t *) mp->nh_addr);
1142 case SR_BEHAVIOR_DX6:
1145 "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1146 "\nIface: %UNext hop: %U", format_ip6_address,
1147 (ip6_address_t *) mp->localsid_addr,
1148 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1149 format_ip6_address, (ip6_address_t *) mp->nh_addr);
1151 case SR_BEHAVIOR_DX2:
1154 "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1155 "\nIface: %U", format_ip6_address,
1156 (ip6_address_t *) mp->localsid_addr,
1157 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index));
1159 case SR_BEHAVIOR_DT6:
1162 "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1163 "\nTable: %u", format_ip6_address,
1164 (ip6_address_t *) mp->localsid_addr, ntohl (mp->fib_table));
1166 case SR_BEHAVIOR_DT4:
1169 "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1170 "\nTable: %u", format_ip6_address,
1171 (ip6_address_t *) mp->localsid_addr, ntohl (mp->fib_table));
1174 if (mp->behavior >= SR_BEHAVIOR_LAST)
1176 s = format (s, "Address: %U\n Behavior: %u",
1177 format_ip6_address, (ip6_address_t *) mp->localsid_addr,
1181 //Should never get here...
1182 s = format (s, "Internal error");
1188 static void *vl_api_sr_steering_add_del_t_print
1189 (vl_api_sr_steering_add_del_t * mp, void *handle)
1193 s = format (0, "SCRIPT: sr_steering_add_del ");
1195 s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1197 switch (mp->traffic_type)
1200 s = format (s, "Traffic type: L2 iface: %u", ntohl (mp->sw_if_index));
1203 s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1204 (ip4_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1207 s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1208 (ip6_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1211 s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1214 s = format (s, "BindingSID: %U", format_ip6_address,
1215 (ip6_address_t *) mp->bsid_addr);
1217 s = format (s, "SR Policy Index: %u", ntohl (mp->sr_policy_index));
1219 s = format (s, "FIB_table: %u", ntohl (mp->table_id));
1224 static void *vl_api_sr_policy_add_t_print
1225 (vl_api_sr_policy_add_t * mp, void *handle)
1229 ip6_address_t *segments = 0, *seg;
1230 ip6_address_t *this_address = (ip6_address_t *) mp->segments;
1233 for (i = 0; i < mp->n_segments; i++)
1235 vec_add2 (segments, seg, 1);
1236 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1240 s = format (0, "SCRIPT: sr_policy_add ");
1242 s = format (s, "BSID: %U", format_ip6_address,
1243 (ip6_address_t *) mp->bsid_addr);
1247 (mp->is_encap ? "Behavior: Encapsulation" :
1248 "Behavior: SRH insertion"));
1250 s = format (s, "FIB_table: %u", ntohl (mp->fib_table));
1252 s = format (s, (mp->type ? "Type: Default" : "Type: Spray"));
1254 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1256 s = format (s, "{");
1257 vec_foreach (seg, segments)
1259 s = format (s, "%U, ", format_ip6_address, seg);
1261 s = format (s, "\b\b } ");
1266 static void *vl_api_sr_policy_mod_t_print
1267 (vl_api_sr_policy_mod_t * mp, void *handle)
1271 ip6_address_t *segments = 0, *seg;
1272 ip6_address_t *this_address = (ip6_address_t *) mp->segments;
1275 for (i = 0; i < mp->n_segments; i++)
1277 vec_add2 (segments, seg, 1);
1278 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1282 s = format (0, "SCRIPT: sr_policy_mod ");
1284 s = format (s, "BSID: %U", format_ip6_address,
1285 (ip6_address_t *) mp->bsid_addr);
1287 s = format (s, "SR Policy index: %u", ntohl (mp->sr_policy_index));
1289 s = format (s, "Operation: %u", mp->operation);
1291 s = format (s, "SID list index: %u", ntohl (mp->sl_index));
1293 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1295 s = format (s, "{");
1296 vec_foreach (seg, segments)
1298 s = format (s, "%U, ", format_ip6_address, seg);
1300 s = format (s, "\b\b } ");
1305 static void *vl_api_sr_policy_del_t_print
1306 (vl_api_sr_policy_del_t * mp, void *handle)
1310 s = format (0, "SCRIPT: sr_policy_del ");
1311 s = format (s, "To be delivered. Good luck.");
1315 static void *vl_api_classify_add_del_table_t_print
1316 (vl_api_classify_add_del_table_t * mp, void *handle)
1321 s = format (0, "SCRIPT: classify_add_del_table ");
1323 if (mp->is_add == 0)
1325 s = format (s, "table %d ", ntohl (mp->table_index));
1326 s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1330 s = format (s, "nbuckets %d ", ntohl (mp->nbuckets));
1331 s = format (s, "memory_size %d ", ntohl (mp->memory_size));
1332 s = format (s, "skip %d ", ntohl (mp->skip_n_vectors));
1333 s = format (s, "match %d ", ntohl (mp->match_n_vectors));
1334 s = format (s, "next-table %d ", ntohl (mp->next_table_index));
1335 s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
1336 s = format (s, "current-data-flag %d ", ntohl (mp->current_data_flag));
1337 if (mp->current_data_flag)
1338 s = format (s, "current-data-offset %d ",
1339 ntohl (mp->current_data_offset));
1340 s = format (s, "mask hex ");
1341 for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
1342 s = format (s, "%02x", mp->mask[i]);
1349 static void *vl_api_classify_add_del_session_t_print
1350 (vl_api_classify_add_del_session_t * mp, void *handle)
1355 s = format (0, "SCRIPT: classify_add_del_session ");
1357 s = format (s, "table_index %d ", ntohl (mp->table_index));
1358 s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
1359 s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
1360 s = format (s, "advance %d ", ntohl (mp->advance));
1361 s = format (s, "action %d ", mp->action);
1363 s = format (s, "metadata %d ", ntohl (mp->metadata));
1364 if (mp->is_add == 0)
1365 s = format (s, "del ");
1367 s = format (s, "match hex ");
1368 for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1370 if (mp->match[i] != 0)
1377 for (i = 0; i < limit; i++)
1378 s = format (s, "%02x", mp->match[i]);
1383 static void *vl_api_classify_set_interface_ip_table_t_print
1384 (vl_api_classify_set_interface_ip_table_t * mp, void *handle)
1388 s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1391 s = format (s, "ipv6 ");
1393 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1394 s = format (s, "table %d ", ntohl (mp->table_index));
1399 static void *vl_api_classify_set_interface_l2_tables_t_print
1400 (vl_api_classify_set_interface_l2_tables_t * mp, void *handle)
1404 s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1406 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1407 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1408 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1409 s = format (s, "other-table %d ", ntohl (mp->other_table_index));
1410 s = format (s, "is-input %d ", mp->is_input);
1415 static void *vl_api_add_node_next_t_print
1416 (vl_api_add_node_next_t * mp, void *handle)
1420 s = format (0, "SCRIPT: add_node_next ");
1422 s = format (0, "node %s next %s ", mp->node_name, mp->next_name);
1427 static void *vl_api_l2tpv3_create_tunnel_t_print
1428 (vl_api_l2tpv3_create_tunnel_t * mp, void *handle)
1432 s = format (0, "SCRIPT: l2tpv3_create_tunnel ");
1434 s = format (s, "client_address %U our_address %U ",
1435 format_ip6_address, (ip6_address_t *) (mp->client_address),
1436 format_ip6_address, (ip6_address_t *) (mp->our_address));
1437 s = format (s, "local_session_id %d ", ntohl (mp->local_session_id));
1438 s = format (s, "remote_session_id %d ", ntohl (mp->remote_session_id));
1439 s = format (s, "local_cookie %lld ",
1440 clib_net_to_host_u64 (mp->local_cookie));
1441 s = format (s, "remote_cookie %lld ",
1442 clib_net_to_host_u64 (mp->remote_cookie));
1443 if (mp->l2_sublayer_present)
1444 s = format (s, "l2-sublayer-present ");
1449 static void *vl_api_l2tpv3_set_tunnel_cookies_t_print
1450 (vl_api_l2tpv3_set_tunnel_cookies_t * mp, void *handle)
1454 s = format (0, "SCRIPT: l2tpv3_set_tunnel_cookies ");
1456 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1458 s = format (s, "new_local_cookie %llu ",
1459 clib_net_to_host_u64 (mp->new_local_cookie));
1461 s = format (s, "new_remote_cookie %llu ",
1462 clib_net_to_host_u64 (mp->new_remote_cookie));
1467 static void *vl_api_l2tpv3_interface_enable_disable_t_print
1468 (vl_api_l2tpv3_interface_enable_disable_t * mp, void *handle)
1472 s = format (0, "SCRIPT: l2tpv3_interface_enable_disable ");
1474 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1476 if (mp->enable_disable == 0)
1477 s = format (s, "del ");
1482 static void *vl_api_l2tpv3_set_lookup_key_t_print
1483 (vl_api_l2tpv3_set_lookup_key_t * mp, void *handle)
1486 char *str = "unknown";
1488 s = format (0, "SCRIPT: l2tpv3_set_lookup_key ");
1492 case L2T_LOOKUP_SRC_ADDRESS:
1493 str = "lookup_v6_src";
1495 case L2T_LOOKUP_DST_ADDRESS:
1496 str = "lookup_v6_dst";
1498 case L2T_LOOKUP_SESSION_ID:
1499 str = "lookup_session_id";
1505 s = format (s, "%s ", str);
1510 static void *vl_api_sw_if_l2tpv3_tunnel_dump_t_print
1511 (vl_api_sw_if_l2tpv3_tunnel_dump_t * mp, void *handle)
1515 s = format (0, "SCRIPT: sw_if_l2tpv3_tunnel_dump ");
1520 static void *vl_api_vxlan_add_del_tunnel_t_print
1521 (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1524 s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1526 ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
1527 ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
1529 u8 is_grp = ip46_address_is_multicast (&dst);
1530 char *dst_name = is_grp ? "group" : "dst";
1532 s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1533 s = format (s, "%s %U ", dst_name, format_ip46_address,
1534 &dst, IP46_TYPE_ANY);
1537 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1539 if (mp->encap_vrf_id)
1540 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1542 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1544 s = format (s, "vni %d ", ntohl (mp->vni));
1546 s = format (s, "instance %d ", ntohl (mp->instance));
1548 if (mp->is_add == 0)
1549 s = format (s, "del ");
1554 static void *vl_api_vxlan_tunnel_dump_t_print
1555 (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1559 s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1561 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1566 static void *vl_api_geneve_add_del_tunnel_t_print
1567 (vl_api_geneve_add_del_tunnel_t * mp, void *handle)
1570 s = format (0, "SCRIPT: geneve_add_del_tunnel ");
1572 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local_address);
1573 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote_address);
1575 u8 is_grp = ip46_address_is_multicast (&remote);
1576 char *remote_name = is_grp ? "group" : "dst";
1578 s = format (s, "src %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1579 s = format (s, "%s %U ", remote_name, format_ip46_address,
1580 &remote, IP46_TYPE_ANY);
1583 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1585 if (mp->encap_vrf_id)
1586 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1588 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1590 s = format (s, "vni %d ", ntohl (mp->vni));
1592 if (mp->is_add == 0)
1593 s = format (s, "del ");
1598 static void *vl_api_geneve_tunnel_dump_t_print
1599 (vl_api_geneve_tunnel_dump_t * mp, void *handle)
1603 s = format (0, "SCRIPT: geneve_tunnel_dump ");
1605 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1610 static void *vl_api_gre_add_del_tunnel_t_print
1611 (vl_api_gre_add_del_tunnel_t * mp, void *handle)
1615 s = format (0, "SCRIPT: gre_add_del_tunnel ");
1617 s = format (s, "dst %U ", format_ip46_address,
1618 (ip46_address_t *) & (mp->dst_address),
1619 mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
1621 s = format (s, "src %U ", format_ip46_address,
1622 (ip46_address_t *) & (mp->src_address),
1623 mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
1626 s = format (s, "teb ");
1628 if (mp->outer_fib_id)
1629 s = format (s, "outer-fib-id %d ", ntohl (mp->outer_fib_id));
1631 if (mp->is_add == 0)
1632 s = format (s, "del ");
1637 static void *vl_api_gre_tunnel_dump_t_print
1638 (vl_api_gre_tunnel_dump_t * mp, void *handle)
1642 s = format (0, "SCRIPT: gre_tunnel_dump ");
1644 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1649 static void *vl_api_l2_fib_clear_table_t_print
1650 (vl_api_l2_fib_clear_table_t * mp, void *handle)
1654 s = format (0, "SCRIPT: l2_fib_clear_table ");
1659 static void *vl_api_l2_interface_efp_filter_t_print
1660 (vl_api_l2_interface_efp_filter_t * mp, void *handle)
1664 s = format (0, "SCRIPT: l2_interface_efp_filter ");
1666 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1667 if (mp->enable_disable)
1668 s = format (s, "enable ");
1670 s = format (s, "disable ");
1675 static void *vl_api_l2_interface_vlan_tag_rewrite_t_print
1676 (vl_api_l2_interface_vlan_tag_rewrite_t * mp, void *handle)
1680 s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
1682 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1683 s = format (s, "vtr_op %d ", ntohl (mp->vtr_op));
1684 s = format (s, "push_dot1q %d ", ntohl (mp->push_dot1q));
1685 s = format (s, "tag1 %d ", ntohl (mp->tag1));
1686 s = format (s, "tag2 %d ", ntohl (mp->tag2));
1691 static void *vl_api_create_vhost_user_if_t_print
1692 (vl_api_create_vhost_user_if_t * mp, void *handle)
1696 s = format (0, "SCRIPT: create_vhost_user_if ");
1698 s = format (s, "socket %s ", mp->sock_filename);
1700 s = format (s, "server ");
1702 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
1704 s = format (s, "tag %s", mp->tag);
1709 static void *vl_api_modify_vhost_user_if_t_print
1710 (vl_api_modify_vhost_user_if_t * mp, void *handle)
1714 s = format (0, "SCRIPT: modify_vhost_user_if ");
1716 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1717 s = format (s, "socket %s ", mp->sock_filename);
1719 s = format (s, "server ");
1721 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
1726 static void *vl_api_delete_vhost_user_if_t_print
1727 (vl_api_delete_vhost_user_if_t * mp, void *handle)
1731 s = format (0, "SCRIPT: delete_vhost_user_if ");
1732 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1737 static void *vl_api_sw_interface_vhost_user_dump_t_print
1738 (vl_api_sw_interface_vhost_user_dump_t * mp, void *handle)
1742 s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
1747 static void *vl_api_sw_interface_dump_t_print
1748 (vl_api_sw_interface_dump_t * mp, void *handle)
1752 s = format (0, "SCRIPT: sw_interface_dump ");
1754 if (mp->name_filter_valid)
1755 s = format (s, "name_filter %s ", mp->name_filter);
1757 s = format (s, "all ");
1762 static void *vl_api_l2_fib_table_dump_t_print
1763 (vl_api_l2_fib_table_dump_t * mp, void *handle)
1767 s = format (0, "SCRIPT: l2_fib_table_dump ");
1769 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
1774 static void *vl_api_control_ping_t_print
1775 (vl_api_control_ping_t * mp, void *handle)
1779 s = format (0, "SCRIPT: control_ping ");
1784 static void *vl_api_want_interface_events_t_print
1785 (vl_api_want_interface_events_t * mp, void *handle)
1789 s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
1790 ntohl (mp->pid), ntohl (mp->enable_disable));
1796 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
1800 s = format (0, "SCRIPT: cli ");
1805 static void *vl_api_cli_inband_t_print
1806 (vl_api_cli_inband_t * mp, void *handle)
1810 s = format (0, "SCRIPT: cli_inband ");
1815 static void *vl_api_memclnt_create_t_print
1816 (vl_api_memclnt_create_t * mp, void *handle)
1820 s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
1825 static void *vl_api_sockclnt_create_t_print
1826 (vl_api_sockclnt_create_t * mp, void *handle)
1830 s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name);
1835 static void *vl_api_show_version_t_print
1836 (vl_api_show_version_t * mp, void *handle)
1840 s = format (0, "SCRIPT: show_version ");
1845 static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
1846 (vl_api_vxlan_gpe_add_del_tunnel_t * mp, void *handle)
1850 s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
1852 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local);
1853 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote);
1855 u8 is_grp = ip46_address_is_multicast (&remote);
1856 char *remote_name = is_grp ? "group" : "remote";
1858 s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1859 s = format (s, "%s %U ", remote_name, format_ip46_address,
1860 &remote, IP46_TYPE_ANY);
1863 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1864 s = format (s, "protocol %d ", ntohl (mp->protocol));
1866 s = format (s, "vni %d ", ntohl (mp->vni));
1868 if (mp->is_add == 0)
1869 s = format (s, "del ");
1871 if (mp->encap_vrf_id)
1872 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1874 if (mp->decap_vrf_id)
1875 s = format (s, "decap-vrf-id %d ", ntohl (mp->decap_vrf_id));
1880 static void *vl_api_vxlan_gpe_tunnel_dump_t_print
1881 (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
1885 s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
1887 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1892 static void *vl_api_interface_name_renumber_t_print
1893 (vl_api_interface_name_renumber_t * mp, void *handle)
1897 s = format (0, "SCRIPT: interface_renumber ");
1899 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1901 s = format (s, "new_show_dev_instance %d ",
1902 ntohl (mp->new_show_dev_instance));
1907 static void *vl_api_want_ip4_arp_events_t_print
1908 (vl_api_want_ip4_arp_events_t * mp, void *handle)
1912 s = format (0, "SCRIPT: want_ip4_arp_events ");
1913 s = format (s, "pid %d address %U ", ntohl (mp->pid),
1914 format_ip4_address, &mp->address);
1915 if (mp->enable_disable == 0)
1916 s = format (s, "del ");
1921 static void *vl_api_want_ip6_nd_events_t_print
1922 (vl_api_want_ip6_nd_events_t * mp, void *handle)
1926 s = format (0, "SCRIPT: want_ip6_nd_events ");
1927 s = format (s, "pid %d address %U ", ntohl (mp->pid),
1928 format_ip6_address, mp->address);
1929 if (mp->enable_disable == 0)
1930 s = format (s, "del ");
1935 static void *vl_api_want_l2_macs_events_t_print
1936 (vl_api_want_l2_macs_events_t * mp, void *handle)
1940 s = format (0, "SCRIPT: want_l2_macs_events ");
1941 s = format (s, "learn-limit %d ", ntohl (mp->learn_limit));
1942 s = format (s, "scan-delay %d ", (u32) mp->scan_delay);
1943 s = format (s, "max-entries %d ", (u32) mp->max_macs_in_event * 10);
1944 if (mp->enable_disable == 0)
1945 s = format (s, "disable");
1950 static void *vl_api_input_acl_set_interface_t_print
1951 (vl_api_input_acl_set_interface_t * mp, void *handle)
1955 s = format (0, "SCRIPT: input_acl_set_interface ");
1957 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1958 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1959 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1960 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
1962 if (mp->is_add == 0)
1963 s = format (s, "del ");
1968 static void *vl_api_output_acl_set_interface_t_print
1969 (vl_api_output_acl_set_interface_t * mp, void *handle)
1973 s = format (0, "SCRIPT: output_acl_set_interface ");
1975 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1976 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1977 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1978 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
1980 if (mp->is_add == 0)
1981 s = format (s, "del ");
1986 static void *vl_api_ip_address_dump_t_print
1987 (vl_api_ip_address_dump_t * mp, void *handle)
1991 s = format (0, "SCRIPT: ip6_address_dump ");
1992 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1993 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1999 vl_api_ip_dump_t_print (vl_api_ip_dump_t * mp, void *handle)
2003 s = format (0, "SCRIPT: ip_dump ");
2004 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2009 static void *vl_api_cop_interface_enable_disable_t_print
2010 (vl_api_cop_interface_enable_disable_t * mp, void *handle)
2014 s = format (0, "SCRIPT: cop_interface_enable_disable ");
2015 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2016 if (mp->enable_disable)
2017 s = format (s, "enable ");
2019 s = format (s, "disable ");
2024 static void *vl_api_cop_whitelist_enable_disable_t_print
2025 (vl_api_cop_whitelist_enable_disable_t * mp, void *handle)
2029 s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
2030 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2031 s = format (s, "fib-id %d ", ntohl (mp->fib_id));
2033 s = format (s, "ip4 ");
2035 s = format (s, "ip6 ");
2036 if (mp->default_cop)
2037 s = format (s, "default ");
2042 static void *vl_api_af_packet_create_t_print
2043 (vl_api_af_packet_create_t * mp, void *handle)
2047 s = format (0, "SCRIPT: af_packet_create ");
2048 s = format (s, "host_if_name %s ", mp->host_if_name);
2049 if (mp->use_random_hw_addr)
2050 s = format (s, "hw_addr random ");
2052 s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
2057 static void *vl_api_af_packet_delete_t_print
2058 (vl_api_af_packet_delete_t * mp, void *handle)
2062 s = format (0, "SCRIPT: af_packet_delete ");
2063 s = format (s, "host_if_name %s ", mp->host_if_name);
2069 format_policer_action (u8 * s, va_list * va)
2071 u32 action = va_arg (*va, u32);
2072 u32 dscp = va_arg (*va, u32);
2075 if (action == SSE2_QOS_ACTION_DROP)
2076 s = format (s, "drop");
2077 else if (action == SSE2_QOS_ACTION_TRANSMIT)
2078 s = format (s, "transmit");
2079 else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
2081 s = format (s, "mark-and-transmit ");
2084 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
2090 s = format (s, "%s", t);
2095 static void *vl_api_policer_add_del_t_print
2096 (vl_api_policer_add_del_t * mp, void *handle)
2100 s = format (0, "SCRIPT: policer_add_del ");
2101 s = format (s, "name %s ", mp->name);
2102 s = format (s, "cir %d ", mp->cir);
2103 s = format (s, "eir %d ", mp->eir);
2104 s = format (s, "cb %d ", mp->cb);
2105 s = format (s, "eb %d ", mp->eb);
2107 switch (mp->rate_type)
2109 case SSE2_QOS_RATE_KBPS:
2110 s = format (s, "rate_type kbps ");
2112 case SSE2_QOS_RATE_PPS:
2113 s = format (s, "rate_type pps ");
2119 switch (mp->round_type)
2121 case SSE2_QOS_ROUND_TO_CLOSEST:
2122 s = format (s, "round_type closest ");
2124 case SSE2_QOS_ROUND_TO_UP:
2125 s = format (s, "round_type up ");
2127 case SSE2_QOS_ROUND_TO_DOWN:
2128 s = format (s, "round_type down ");
2136 case SSE2_QOS_POLICER_TYPE_1R2C:
2137 s = format (s, "type 1r2c ");
2139 case SSE2_QOS_POLICER_TYPE_1R3C_RFC_2697:
2140 s = format (s, "type 1r3c ");
2142 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_2698:
2143 s = format (s, "type 2r3c-2698 ");
2145 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_4115:
2146 s = format (s, "type 2r3c-4115 ");
2148 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1:
2149 s = format (s, "type 2r3c-mef5cf1 ");
2155 s = format (s, "conform_action %U ", format_policer_action,
2156 mp->conform_action_type, mp->conform_dscp);
2157 s = format (s, "exceed_action %U ", format_policer_action,
2158 mp->exceed_action_type, mp->exceed_dscp);
2159 s = format (s, "violate_action %U ", format_policer_action,
2160 mp->violate_action_type, mp->violate_dscp);
2162 if (mp->color_aware)
2163 s = format (s, "color-aware ");
2164 if (mp->is_add == 0)
2165 s = format (s, "del ");
2170 static void *vl_api_policer_dump_t_print
2171 (vl_api_policer_dump_t * mp, void *handle)
2175 s = format (0, "SCRIPT: policer_dump ");
2176 if (mp->match_name_valid)
2177 s = format (s, "name %s ", mp->match_name);
2182 static void *vl_api_policer_classify_set_interface_t_print
2183 (vl_api_policer_classify_set_interface_t * mp, void *handle)
2187 s = format (0, "SCRIPT: policer_classify_set_interface ");
2188 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2189 if (mp->ip4_table_index != ~0)
2190 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2191 if (mp->ip6_table_index != ~0)
2192 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2193 if (mp->l2_table_index != ~0)
2194 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2195 if (mp->is_add == 0)
2196 s = format (s, "del ");
2201 static void *vl_api_policer_classify_dump_t_print
2202 (vl_api_policer_classify_dump_t * mp, void *handle)
2206 s = format (0, "SCRIPT: policer_classify_dump ");
2209 case POLICER_CLASSIFY_TABLE_IP4:
2210 s = format (s, "type ip4 ");
2212 case POLICER_CLASSIFY_TABLE_IP6:
2213 s = format (s, "type ip6 ");
2215 case POLICER_CLASSIFY_TABLE_L2:
2216 s = format (s, "type l2 ");
2225 static void *vl_api_sw_interface_clear_stats_t_print
2226 (vl_api_sw_interface_clear_stats_t * mp, void *handle)
2230 s = format (0, "SCRIPT: sw_interface_clear_stats ");
2231 if (mp->sw_if_index != ~0)
2232 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2237 static void *vl_api_mpls_tunnel_dump_t_print
2238 (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2242 s = format (0, "SCRIPT: mpls_tunnel_dump ");
2244 s = format (s, "tunnel_index %d ", ntohl (mp->tunnel_index));
2249 static void *vl_api_mpls_fib_dump_t_print
2250 (vl_api_mpls_fib_dump_t * mp, void *handle)
2254 s = format (0, "SCRIPT: mpls_fib_decap_dump ");
2259 static void *vl_api_ip_fib_dump_t_print
2260 (vl_api_ip_fib_dump_t * mp, void *handle)
2264 s = format (0, "SCRIPT: ip_fib_dump ");
2269 static void *vl_api_ip6_fib_dump_t_print
2270 (vl_api_ip6_fib_dump_t * mp, void *handle)
2274 s = format (0, "SCRIPT: ip6_fib_dump ");
2279 static void *vl_api_classify_table_ids_t_print
2280 (vl_api_classify_table_ids_t * mp, void *handle)
2284 s = format (0, "SCRIPT: classify_table_ids ");
2289 static void *vl_api_classify_table_by_interface_t_print
2290 (vl_api_classify_table_by_interface_t * mp, void *handle)
2294 s = format (0, "SCRIPT: classify_table_by_interface ");
2295 if (mp->sw_if_index != ~0)
2296 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2301 static void *vl_api_classify_table_info_t_print
2302 (vl_api_classify_table_info_t * mp, void *handle)
2306 s = format (0, "SCRIPT: classify_table_info ");
2307 if (mp->table_id != ~0)
2308 s = format (s, "table_id %d ", ntohl (mp->table_id));
2313 static void *vl_api_classify_session_dump_t_print
2314 (vl_api_classify_session_dump_t * mp, void *handle)
2318 s = format (0, "SCRIPT: classify_session_dump ");
2319 if (mp->table_id != ~0)
2320 s = format (s, "table_id %d ", ntohl (mp->table_id));
2325 static void *vl_api_set_ipfix_exporter_t_print
2326 (vl_api_set_ipfix_exporter_t * mp, void *handle)
2330 s = format (0, "SCRIPT: set_ipfix_exporter ");
2332 s = format (s, "collector-address %U ", format_ip4_address,
2333 (ip4_address_t *) mp->collector_address);
2334 s = format (s, "collector-port %d ", ntohs (mp->collector_port));
2335 s = format (s, "src-address %U ", format_ip4_address,
2336 (ip4_address_t *) mp->src_address);
2337 s = format (s, "vrf-id %d ", ntohl (mp->vrf_id));
2338 s = format (s, "path-mtu %d ", ntohl (mp->path_mtu));
2339 s = format (s, "template-interval %d ", ntohl (mp->template_interval));
2340 s = format (s, "udp-checksum %d ", mp->udp_checksum);
2345 static void *vl_api_ipfix_exporter_dump_t_print
2346 (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2350 s = format (0, "SCRIPT: ipfix_exporter_dump ");
2355 static void *vl_api_set_ipfix_classify_stream_t_print
2356 (vl_api_set_ipfix_classify_stream_t * mp, void *handle)
2360 s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2362 s = format (s, "domain-id %d ", ntohl (mp->domain_id));
2363 s = format (s, "src-port %d ", ntohs (mp->src_port));
2368 static void *vl_api_ipfix_classify_stream_dump_t_print
2369 (vl_api_ipfix_classify_stream_dump_t * mp, void *handle)
2373 s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2378 static void *vl_api_ipfix_classify_table_add_del_t_print
2379 (vl_api_ipfix_classify_table_add_del_t * mp, void *handle)
2383 s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2385 s = format (s, "table-id %d ", ntohl (mp->table_id));
2386 s = format (s, "ip-version %d ", mp->ip_version);
2387 s = format (s, "transport-protocol %d ", mp->transport_protocol);
2392 static void *vl_api_ipfix_classify_table_dump_t_print
2393 (vl_api_ipfix_classify_table_dump_t * mp, void *handle)
2397 s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2402 static void *vl_api_sw_interface_span_enable_disable_t_print
2403 (vl_api_sw_interface_span_enable_disable_t * mp, void *handle)
2407 s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2408 s = format (s, "src_sw_if_index %u ", ntohl (mp->sw_if_index_from));
2409 s = format (s, "dst_sw_if_index %u ", ntohl (mp->sw_if_index_to));
2412 s = format (s, "l2 ");
2417 s = format (s, "disable ");
2420 s = format (s, "rx ");
2423 s = format (s, "tx ");
2427 s = format (s, "both ");
2435 vl_api_sw_interface_span_dump_t_print (vl_api_sw_interface_span_dump_t * mp,
2440 s = format (0, "SCRIPT: sw_interface_span_dump ");
2443 s = format (s, "l2 ");
2448 static void *vl_api_get_next_index_t_print
2449 (vl_api_get_next_index_t * mp, void *handle)
2453 s = format (0, "SCRIPT: get_next_index ");
2454 s = format (s, "node-name %s ", mp->node_name);
2455 s = format (s, "next-node-name %s ", mp->next_name);
2460 static void *vl_api_pg_create_interface_t_print
2461 (vl_api_pg_create_interface_t * mp, void *handle)
2465 s = format (0, "SCRIPT: pg_create_interface ");
2466 s = format (0, "if_id %d", ntohl (mp->interface_id));
2471 static void *vl_api_pg_capture_t_print
2472 (vl_api_pg_capture_t * mp, void *handle)
2476 s = format (0, "SCRIPT: pg_capture ");
2477 s = format (0, "if_id %d ", ntohl (mp->interface_id));
2478 s = format (0, "pcap %s", mp->pcap_file_name);
2479 if (mp->count != ~0)
2480 s = format (s, "count %d ", ntohl (mp->count));
2481 if (!mp->is_enabled)
2482 s = format (s, "disable");
2487 static void *vl_api_pg_enable_disable_t_print
2488 (vl_api_pg_enable_disable_t * mp, void *handle)
2492 s = format (0, "SCRIPT: pg_enable_disable ");
2493 if (ntohl (mp->stream_name_length) > 0)
2494 s = format (s, "stream %s", mp->stream_name);
2495 if (!mp->is_enabled)
2496 s = format (s, "disable");
2501 static void *vl_api_ip_source_and_port_range_check_add_del_t_print
2502 (vl_api_ip_source_and_port_range_check_add_del_t * mp, void *handle)
2507 s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2509 s = format (s, "%U/%d ", format_ip6_address, mp->address,
2512 s = format (s, "%U/%d ", format_ip4_address, mp->address,
2515 for (i = 0; i < mp->number_of_ranges; i++)
2517 s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2520 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
2522 if (mp->is_add == 0)
2523 s = format (s, "del ");
2528 static void *vl_api_ip_source_and_port_range_check_interface_add_del_t_print
2529 (vl_api_ip_source_and_port_range_check_interface_add_del_t * mp,
2534 s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2536 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2538 if (mp->tcp_out_vrf_id != ~0)
2539 s = format (s, "tcp-out-vrf %d ", ntohl (mp->tcp_out_vrf_id));
2541 if (mp->udp_out_vrf_id != ~0)
2542 s = format (s, "udp-out-vrf %d ", ntohl (mp->udp_out_vrf_id));
2544 if (mp->tcp_in_vrf_id != ~0)
2545 s = format (s, "tcp-in-vrf %d ", ntohl (mp->tcp_in_vrf_id));
2547 if (mp->udp_in_vrf_id != ~0)
2548 s = format (s, "udp-in-vrf %d ", ntohl (mp->udp_in_vrf_id));
2550 if (mp->is_add == 0)
2551 s = format (s, "del ");
2556 static void *vl_api_lisp_enable_disable_t_print
2557 (vl_api_lisp_enable_disable_t * mp, void *handle)
2561 s = format (0, "SCRIPT: lisp_enable_disable %s",
2562 mp->is_en ? "enable" : "disable");
2567 static void *vl_api_gpe_add_del_iface_t_print
2568 (vl_api_gpe_add_del_iface_t * mp, void *handle)
2572 s = format (0, "SCRIPT: gpe_add_del_iface ");
2574 s = format (s, "%s ", mp->is_add ? "up" : "down");
2575 s = format (s, "vni %d ", mp->vni);
2576 s = format (s, "%s %d ", mp->is_l2 ? "bd_id" : "table_id", mp->dp_table);
2581 static void *vl_api_lisp_pitr_set_locator_set_t_print
2582 (vl_api_lisp_pitr_set_locator_set_t * mp, void *handle)
2586 s = format (0, "SCRIPT: lisp_pitr_set_locator_set ");
2589 s = format (s, "locator-set %s ", mp->ls_name);
2591 s = format (s, "del");
2597 format_lisp_flat_eid (u8 * s, va_list * args)
2599 u32 type = va_arg (*args, u32);
2600 u8 *eid = va_arg (*args, u8 *);
2601 u32 eid_len = va_arg (*args, u32);
2606 return format (s, "%U/%d", format_ip4_address, eid, eid_len);
2608 return format (s, "%U/%d", format_ip6_address, eid, eid_len);
2610 return format (s, "%U", format_ethernet_address, eid);
2615 static void *vl_api_lisp_add_del_remote_mapping_t_print
2616 (vl_api_lisp_add_del_remote_mapping_t * mp, void *handle)
2621 s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
2624 s = format (s, "del-all ");
2626 s = format (s, "%s ", mp->is_add ? "add" : "del");
2627 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2629 s = format (s, "eid %U ", format_lisp_flat_eid,
2630 mp->eid_type, mp->eid, mp->eid_len);
2634 s = format (s, "seid %U ", format_lisp_flat_eid,
2635 mp->eid_type, mp->seid, mp->seid_len);
2637 rloc_num = clib_net_to_host_u32 (mp->rloc_num);
2640 s = format (s, "action %d", mp->action);
2645 static void *vl_api_lisp_add_del_adjacency_t_print
2646 (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
2650 s = format (0, "SCRIPT: lisp_add_del_adjacency ");
2652 s = format (s, "%s ", mp->is_add ? "add" : "del");
2653 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2654 s = format (s, "reid %U leid %U ",
2655 format_lisp_flat_eid, mp->eid_type, mp->reid, mp->reid_len,
2656 format_lisp_flat_eid, mp->eid_type, mp->leid, mp->leid_len);
2661 static void *vl_api_lisp_add_del_map_request_itr_rlocs_t_print
2662 (vl_api_lisp_add_del_map_request_itr_rlocs_t * mp, void *handle)
2666 s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
2669 s = format (s, "%s", mp->locator_set_name);
2671 s = format (s, "del");
2676 static void *vl_api_lisp_eid_table_add_del_map_t_print
2677 (vl_api_lisp_eid_table_add_del_map_t * mp, void *handle)
2681 s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
2684 s = format (s, "del ");
2686 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2687 s = format (s, "%s %d ",
2688 mp->is_l2 ? "bd_index" : "vrf",
2689 clib_net_to_host_u32 (mp->dp_table));
2693 static void *vl_api_lisp_add_del_local_eid_t_print
2694 (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
2698 s = format (0, "SCRIPT: lisp_add_del_local_eid ");
2701 s = format (s, "del ");
2703 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2704 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
2706 s = format (s, "locator-set %s ", mp->locator_set_name);
2709 u32 key_id = mp->key_id;
2710 s = format (s, "key-id %U", format_hmac_key_id, key_id);
2711 s = format (s, "secret-key %s", mp->key);
2716 static void *vl_api_gpe_add_del_fwd_entry_t_print
2717 (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle)
2721 s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO");
2726 static void *vl_api_lisp_add_del_map_resolver_t_print
2727 (vl_api_lisp_add_del_map_resolver_t * mp, void *handle)
2731 s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
2734 s = format (s, "del ");
2737 s = format (s, "%U ", format_ip6_address, mp->ip_address);
2739 s = format (s, "%U ", format_ip4_address, mp->ip_address);
2744 static void *vl_api_gpe_enable_disable_t_print
2745 (vl_api_gpe_enable_disable_t * mp, void *handle)
2749 s = format (0, "SCRIPT: gpe_enable_disable ");
2751 s = format (s, "%s ", mp->is_en ? "enable" : "disable");
2756 static void *vl_api_lisp_add_del_locator_set_t_print
2757 (vl_api_lisp_add_del_locator_set_t * mp, void *handle)
2761 s = format (0, "SCRIPT: lisp_add_del_locator_set ");
2764 s = format (s, "del ");
2766 s = format (s, "locator-set %s ", mp->locator_set_name);
2771 static void *vl_api_lisp_add_del_locator_t_print
2772 (vl_api_lisp_add_del_locator_t * mp, void *handle)
2776 s = format (0, "SCRIPT: lisp_add_del_locator ");
2779 s = format (s, "del ");
2781 s = format (s, "locator-set %s ", mp->locator_set_name);
2782 s = format (s, "sw_if_index %d ", mp->sw_if_index);
2783 s = format (s, "p %d w %d ", mp->priority, mp->weight);
2788 static void *vl_api_lisp_locator_set_dump_t_print
2789 (vl_api_lisp_locator_set_dump_t * mp, void *handle)
2793 s = format (0, "SCRIPT: lisp_locator_set_dump ");
2794 if (mp->filter == 1)
2795 s = format (s, "local");
2796 else if (mp->filter == 2)
2797 s = format (s, "remote");
2802 static void *vl_api_lisp_locator_dump_t_print
2803 (vl_api_lisp_locator_dump_t * mp, void *handle)
2807 s = format (0, "SCRIPT: lisp_locator_dump ");
2808 if (mp->is_index_set)
2809 s = format (s, "ls_index %d", clib_net_to_host_u32 (mp->ls_index));
2811 s = format (s, "ls_name %s", mp->ls_name);
2816 static void *vl_api_lisp_map_request_mode_t_print
2817 (vl_api_lisp_map_request_mode_t * mp, void *handle)
2821 s = format (0, "SCRIPT: lisp_map_request_mode ");
2826 s = format (s, "dst-only");
2829 s = format (s, "src-dst");
2837 static void *vl_api_lisp_eid_table_dump_t_print
2838 (vl_api_lisp_eid_table_dump_t * mp, void *handle)
2842 s = format (0, "SCRIPT: lisp_eid_table_dump ");
2846 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2847 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type,
2848 mp->eid, mp->prefix_length);
2852 s = format (s, "local ");
2855 s = format (s, "remote ");
2862 static void *vl_api_lisp_rloc_probe_enable_disable_t_print
2863 (vl_api_lisp_rloc_probe_enable_disable_t * mp, void *handle)
2867 s = format (0, "SCRIPT: lisp_rloc_probe_enable_disable ");
2869 s = format (s, "enable");
2871 s = format (s, "disable");
2876 static void *vl_api_lisp_map_register_enable_disable_t_print
2877 (vl_api_lisp_map_register_enable_disable_t * mp, void *handle)
2881 s = format (0, "SCRIPT: lisp_map_register_enable_disable ");
2883 s = format (s, "enable");
2885 s = format (s, "disable");
2890 static void *vl_api_lisp_adjacencies_get_t_print
2891 (vl_api_lisp_adjacencies_get_t * mp, void *handle)
2895 s = format (0, "SCRIPT: lisp_adjacencies_get ");
2896 s = format (s, "vni %d", clib_net_to_host_u32 (mp->vni));
2901 static void *vl_api_lisp_eid_table_map_dump_t_print
2902 (vl_api_lisp_eid_table_map_dump_t * mp, void *handle)
2906 s = format (0, "SCRIPT: lisp_eid_table_map_dump ");
2909 s = format (s, "l2");
2911 s = format (s, "l3");
2916 static void *vl_api_ipsec_gre_add_del_tunnel_t_print
2917 (vl_api_ipsec_gre_add_del_tunnel_t * mp, void *handle)
2921 s = format (0, "SCRIPT: ipsec_gre_add_del_tunnel ");
2923 s = format (s, "dst %U ", format_ip4_address,
2924 (ip4_address_t *) & (mp->dst_address));
2926 s = format (s, "src %U ", format_ip4_address,
2927 (ip4_address_t *) & (mp->src_address));
2929 s = format (s, "local_sa %d ", ntohl (mp->local_sa_id));
2931 s = format (s, "remote_sa %d ", ntohl (mp->remote_sa_id));
2933 if (mp->is_add == 0)
2934 s = format (s, "del ");
2939 static void *vl_api_ipsec_gre_tunnel_dump_t_print
2940 (vl_api_ipsec_gre_tunnel_dump_t * mp, void *handle)
2944 s = format (0, "SCRIPT: ipsec_gre_tunnel_dump ");
2946 if (mp->sw_if_index != ~0)
2947 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2952 static void *vl_api_l2_interface_pbb_tag_rewrite_t_print
2953 (vl_api_l2_interface_pbb_tag_rewrite_t * mp, void *handle)
2956 u32 vtr_op = ntohl (mp->vtr_op);
2958 s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
2960 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2961 s = format (s, "vtr_op %d ", vtr_op);
2962 if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
2964 if (vtr_op == L2_VTR_TRANSLATE_2_2)
2965 s = format (s, "%d ", ntohs (mp->outer_tag));
2966 s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
2967 s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
2968 s = format (s, "sid %d ", ntohl (mp->i_sid));
2969 s = format (s, "vlanid %d ", ntohs (mp->b_vlanid));
2974 static void *vl_api_flow_classify_set_interface_t_print
2975 (vl_api_flow_classify_set_interface_t * mp, void *handle)
2979 s = format (0, "SCRIPT: flow_classify_set_interface ");
2980 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2981 if (mp->ip4_table_index != ~0)
2982 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2983 if (mp->ip6_table_index != ~0)
2984 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2985 if (mp->is_add == 0)
2986 s = format (s, "del ");
2992 vl_api_punt_t_print (vl_api_punt_t * mp, void *handle)
2996 s = format (0, "SCRIPT: punt ");
2998 if (mp->ipv != (u8) ~ 0)
2999 s = format (s, "ip %d ", mp->ipv);
3001 s = format (s, "protocol %d ", mp->l4_protocol);
3003 if (mp->l4_port != (u16) ~ 0)
3004 s = format (s, "port %d ", ntohs (mp->l4_port));
3007 s = format (s, "del ");
3012 static void *vl_api_flow_classify_dump_t_print
3013 (vl_api_flow_classify_dump_t * mp, void *handle)
3017 s = format (0, "SCRIPT: flow_classify_dump ");
3020 case FLOW_CLASSIFY_TABLE_IP4:
3021 s = format (s, "type ip4 ");
3023 case FLOW_CLASSIFY_TABLE_IP6:
3024 s = format (s, "type ip6 ");
3033 static void *vl_api_get_first_msg_id_t_print
3034 (vl_api_get_first_msg_id_t * mp, void *handle)
3038 s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
3043 static void *vl_api_ioam_enable_t_print
3044 (vl_api_ioam_enable_t * mp, void *handle)
3048 s = format (0, "SCRIPT: ioam_enable ");
3050 if (mp->trace_enable)
3051 s = format (s, "trace enabled");
3054 s = format (s, "POT enabled");
3057 s = format (s, "Seqno enabled");
3060 s = format (s, "Analyse enabled");
3065 static void *vl_api_ioam_disable_t_print
3066 (vl_api_ioam_disable_t * mp, void *handle)
3070 s = format (0, "SCRIPT: ioam_disable ");
3071 s = format (s, "trace disabled");
3072 s = format (s, "POT disabled");
3073 s = format (s, "Seqno disabled");
3074 s = format (s, "Analyse disabled");
3079 static void *vl_api_feature_enable_disable_t_print
3080 (vl_api_feature_enable_disable_t * mp, void *handle)
3084 s = format (0, "SCRIPT: feature_enable_disable ");
3085 s = format (s, "arc_name %s ", mp->arc_name);
3086 s = format (s, "feature_name %s ", mp->feature_name);
3087 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3089 s = format (s, "disable");
3094 static void *vl_api_sw_interface_tag_add_del_t_print
3095 (vl_api_sw_interface_tag_add_del_t * mp, void *handle)
3099 s = format (0, "SCRIPT: sw_interface_tag_add_del ");
3100 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3102 s = format (s, "tag %s ", mp->tag);
3104 s = format (s, "del ");
3109 static void *vl_api_sw_interface_set_mtu_t_print
3110 (vl_api_sw_interface_set_mtu_t * mp, void *handle)
3114 s = format (0, "SCRIPT: sw_interface_set_mtu ");
3115 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3116 s = format (s, "tag %d ", ntohs (mp->mtu));
3121 static void *vl_api_p2p_ethernet_add_t_print
3122 (vl_api_p2p_ethernet_add_t * mp, void *handle)
3126 s = format (0, "SCRIPT: p2p_ethernet_add ");
3127 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3128 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3133 static void *vl_api_p2p_ethernet_del_t_print
3134 (vl_api_p2p_ethernet_del_t * mp, void *handle)
3138 s = format (0, "SCRIPT: p2p_ethernet_del ");
3139 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3140 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3145 static void *vl_api_tcp_configure_src_addresses_t_print
3146 (vl_api_tcp_configure_src_addresses_t * mp, void *handle)
3150 s = format (0, "SCRIPT: tcp_configure_src_addresses ");
3152 s = format (s, "%U - %U ",
3153 format_ip6_address, (ip6_address_t *) mp->first_address,
3154 format_ip6_address, (ip6_address_t *) mp->last_address);
3156 s = format (s, "%U - %U ",
3157 format_ip4_address, (ip4_address_t *) mp->first_address,
3158 format_ip4_address, (ip4_address_t *) mp->last_address);
3161 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
3166 static void *vl_api_app_namespace_add_del_t_print
3167 (vl_api_app_namespace_add_del_t * mp, void *handle)
3170 u8 len = clib_min (mp->namespace_id_len,
3171 ARRAY_LEN (mp->namespace_id) - 1);
3172 mp->namespace_id[len] = 0;
3173 s = format (0, "SCRIPT: app_namespace_add_del ");
3174 s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d "
3175 "ipv6_fib_id %d", (char *) mp->namespace_id, mp->secret,
3176 clib_net_to_host_u32 (mp->sw_if_index),
3177 clib_net_to_host_u32 (mp->ip4_fib_id),
3178 clib_net_to_host_u32 (mp->ip6_fib_id));
3182 static void *vl_api_lldp_config_t_print
3183 (vl_api_lldp_config_t * mp, void *handle)
3187 s = format (0, "SCRIPT: lldp_config ");
3188 s = format (s, "system_name %s ", mp->system_name);
3189 s = format (s, "tx_hold %d ", ntohl (mp->tx_hold));
3190 s = format (s, "tx_interval %d ", ntohl (mp->tx_interval));
3194 static void *vl_api_dns_enable_disable_t_print
3195 (vl_api_dns_enable_disable_t * mp, void *handle)
3199 s = format (0, "SCRIPT: dns_enable_disable ");
3200 s = format (s, "%s ", mp->enable ? "enable" : "disable");
3205 static void *vl_api_sw_interface_set_lldp_t_print
3206 (vl_api_sw_interface_set_lldp_t * mp, void *handle)
3211 memset (null_data, 0, sizeof (null_data));
3213 s = format (0, "SCRIPT: sw_interface_set_lldp ");
3214 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3216 if (memcmp (mp->port_desc, null_data, sizeof (mp->port_desc)))
3217 s = format (s, "port_desc %s ", mp->port_desc);
3219 if (memcmp (mp->mgmt_ip4, null_data, sizeof (mp->mgmt_ip4)))
3220 s = format (s, "mgmt_ip4 %U ", format_ip4_address, mp->mgmt_ip4);
3222 if (memcmp (mp->mgmt_ip6, null_data, sizeof (mp->mgmt_ip6)))
3223 s = format (s, "mgmt_ip6 %U ", format_ip6_address, mp->mgmt_ip6);
3225 if (memcmp (mp->mgmt_oid, null_data, sizeof (mp->mgmt_oid)))
3226 s = format (s, "mgmt_oid %s ", mp->mgmt_oid);
3228 if (mp->enable == 0)
3229 s = format (s, "disable ");
3234 static void *vl_api_dns_name_server_add_del_t_print
3235 (vl_api_dns_name_server_add_del_t * mp, void *handle)
3239 s = format (0, "SCRIPT: dns_name_server_add_del ");
3241 s = format (s, "%U ", format_ip6_address,
3242 (ip6_address_t *) mp->server_address);
3244 s = format (s, "%U ", format_ip4_address,
3245 (ip4_address_t *) mp->server_address);
3247 if (mp->is_add == 0)
3248 s = format (s, "del ");
3253 static void *vl_api_dns_resolve_name_t_print
3254 (vl_api_dns_resolve_name_t * mp, void *handle)
3258 s = format (0, "SCRIPT: dns_resolve_name ");
3259 s = format (s, "%s ", mp->name);
3263 static void *vl_api_dns_resolve_ip_t_print
3264 (vl_api_dns_resolve_ip_t * mp, void *handle)
3268 s = format (0, "SCRIPT: dns_resolve_ip ");
3270 s = format (s, "%U ", format_ip6_address, mp->address);
3272 s = format (s, "%U ", format_ip4_address, mp->address);
3276 static void *vl_api_session_rule_add_del_t_print
3277 (vl_api_session_rule_add_del_t * mp, void *handle)
3280 char *proto = mp->transport_proto == 0 ? "tcp" : "udp";
3281 s = format (0, "SCRIPT: session_rule_add_del ");
3282 mp->tag[sizeof (mp->tag) - 1] = 0;
3284 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3285 mp->appns_index, mp->scope, proto, format_ip4_address,
3286 (ip4_address_t *) mp->lcl_ip, mp->lcl_plen,
3287 format_ip4_address, (ip4_address_t *) mp->rmt_ip,
3288 mp->rmt_plen, mp->action_index, mp->tag);
3290 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3291 mp->appns_index, mp->scope, proto, format_ip6_address,
3292 (ip6_address_t *) mp->lcl_ip, mp->lcl_plen,
3293 format_ip6_address, (ip6_address_t *) mp->rmt_ip,
3294 mp->rmt_plen, mp->action_index, mp->tag);
3298 static void *vl_api_ip_container_proxy_add_del_t_print
3299 (vl_api_ip_container_proxy_add_del_t * mp, void *handle)
3302 s = format (0, "SCRIPT: ip_container_proxy_add_del ");
3304 s = format (s, "is_add %d address %U/%d sw_if_index %d",
3305 mp->is_add, format_ip4_address,
3306 (ip4_address_t *) mp->ip, mp->plen, mp->sw_if_index);
3308 s = format (s, "is_add %d address %U/%d sw_if_index %d",
3309 mp->is_add, format_ip6_address,
3310 (ip6_address_t *) mp->ip, mp->plen, mp->sw_if_index);
3315 #define foreach_custom_print_no_arg_function \
3316 _(lisp_eid_table_vni_dump) \
3317 _(lisp_map_resolver_dump) \
3318 _(lisp_map_server_dump) \
3319 _(show_lisp_rloc_probe_state) \
3320 _(show_lisp_map_register_state) \
3321 _(show_lisp_map_request_mode)
3324 static void * vl_api_ ## f ## _t_print \
3325 (vl_api_ ## f ## _t * mp, void * handle) \
3328 s = format (0, "SCRIPT: " #f ); \
3331 foreach_custom_print_no_arg_function
3333 #define foreach_custom_print_function \
3334 _(CREATE_LOOPBACK, create_loopback) \
3335 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
3336 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
3337 _(SW_INTERFACE_EVENT, sw_interface_event) \
3338 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
3339 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
3340 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
3341 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
3342 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
3343 _(SW_INTERFACE_SET_GENEVE_BYPASS, sw_interface_set_geneve_bypass) \
3344 _(TAP_CONNECT, tap_connect) \
3345 _(TAP_MODIFY, tap_modify) \
3346 _(TAP_DELETE, tap_delete) \
3347 _(SW_INTERFACE_TAP_DUMP, sw_interface_tap_dump) \
3348 _(TAP_CREATE_V2, tap_create_v2) \
3349 _(TAP_DELETE_V2, tap_delete_v2) \
3350 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) \
3351 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \
3352 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
3353 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
3354 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3355 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3356 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
3357 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3358 _(CREATE_SUBIF, create_subif) \
3359 _(OAM_ADD_DEL, oam_add_del) \
3360 _(RESET_FIB, reset_fib) \
3361 _(DHCP_PROXY_CONFIG, dhcp_proxy_config) \
3362 _(DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss) \
3363 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3364 _(SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS, \
3365 sw_interface_ip6_set_link_local_address) \
3366 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \
3367 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \
3368 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
3369 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3370 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3371 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3372 _(SR_POLICY_ADD, sr_policy_add) \
3373 _(SR_POLICY_MOD, sr_policy_mod) \
3374 _(SR_POLICY_DEL, sr_policy_del) \
3375 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3376 _(L2FIB_ADD_DEL, l2fib_add_del) \
3377 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3378 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3379 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3380 _(L2_FLAGS, l2_flags) \
3381 _(BRIDGE_FLAGS, bridge_flags) \
3382 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3383 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3384 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3385 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3386 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3387 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3388 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3389 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3390 _(ADD_NODE_NEXT, add_node_next) \
3391 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \
3392 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \
3393 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \
3394 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \
3395 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
3396 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
3397 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3398 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3399 _(GENEVE_ADD_DEL_TUNNEL, geneve_add_del_tunnel) \
3400 _(GENEVE_TUNNEL_DUMP, geneve_tunnel_dump) \
3401 _(GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel) \
3402 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3403 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3404 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3405 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3406 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3407 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3408 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3409 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3410 _(CONTROL_PING, control_ping) \
3411 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3413 _(CLI_INBAND, cli_inband) \
3414 _(MEMCLNT_CREATE, memclnt_create) \
3415 _(SOCKCLNT_CREATE, sockclnt_create) \
3416 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3417 _(SHOW_VERSION, show_version) \
3418 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3419 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3420 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3421 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3422 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
3423 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \
3424 _(WANT_L2_MACS_EVENTS, want_l2_macs_events) \
3425 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3426 _(IP_ADDRESS_DUMP, ip_address_dump) \
3427 _(IP_DUMP, ip_dump) \
3428 _(DELETE_LOOPBACK, delete_loopback) \
3429 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3430 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3431 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3432 _(AF_PACKET_CREATE, af_packet_create) \
3433 _(AF_PACKET_DELETE, af_packet_delete) \
3434 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3435 _(MPLS_FIB_DUMP, mpls_fib_dump) \
3436 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3437 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3438 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3439 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3440 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3441 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3442 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3443 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3444 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3445 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3446 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3447 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3448 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3449 _(GET_NEXT_INDEX, get_next_index) \
3450 _(PG_CREATE_INTERFACE,pg_create_interface) \
3451 _(PG_CAPTURE, pg_capture) \
3452 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3453 _(POLICER_ADD_DEL, policer_add_del) \
3454 _(POLICER_DUMP, policer_dump) \
3455 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3456 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3457 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3458 ip_source_and_port_range_check_add_del) \
3459 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3460 ip_source_and_port_range_check_interface_add_del) \
3461 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
3462 _(GPE_ENABLE_DISABLE, gpe_enable_disable) \
3463 _(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \
3464 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
3465 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \
3466 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \
3467 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
3468 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
3469 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
3470 lisp_add_del_map_request_itr_rlocs) \
3471 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
3472 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
3473 _(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \
3474 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
3475 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
3476 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
3477 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
3478 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
3479 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \
3480 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
3481 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \
3482 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
3483 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \
3484 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \
3485 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \
3486 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \
3487 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \
3488 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \
3489 _(IPSEC_GRE_ADD_DEL_TUNNEL, ipsec_gre_add_del_tunnel) \
3490 _(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \
3491 _(DELETE_SUBIF, delete_subif) \
3492 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3494 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3495 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3496 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3497 _(IOAM_ENABLE, ioam_enable) \
3498 _(IOAM_DISABLE, ioam_disable) \
3499 _(IP_FIB_DUMP, ip_fib_dump) \
3500 _(IP6_FIB_DUMP, ip6_fib_dump) \
3501 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3502 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3503 _(SW_INTERFACE_SET_MTU, sw_interface_set_mtu) \
3504 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3505 _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
3506 _(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
3507 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
3508 _(LLDP_CONFIG, lldp_config) \
3509 _(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \
3510 _(DNS_ENABLE_DISABLE, dns_enable_disable) \
3511 _(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \
3512 _(DNS_RESOLVE_NAME, dns_resolve_name) \
3513 _(DNS_RESOLVE_IP, dns_resolve_ip) \
3514 _(SESSION_RULE_ADD_DEL, session_rule_add_del) \
3515 _(OUTPUT_ACL_SET_INTERFACE, output_acl_set_interface)
3517 vl_msg_api_custom_dump_configure (api_main_t * am)
3519 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3520 = (void *) vl_api_##f##_t_print;
3521 foreach_custom_print_function;
3526 * fd.io coding-style-patch-verification: ON
3528 * Local Variables: eval: (c-set-style "gnu") End: