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/ip/ip_neighbor.h>
23 #include <vnet/ip/ip_types_api.h>
24 #include <vnet/unix/tuntap.h>
25 #include <vnet/mpls/mpls.h>
26 #include <vnet/dhcp/dhcp_proxy.h>
27 #include <vnet/l2tp/l2tp.h>
28 #include <vnet/l2/l2_input.h>
29 #include <vnet/srv6/sr.h>
30 #include <vnet/srmpls/sr_mpls.h>
31 #include <vnet/gre/gre.h>
32 #include <vnet/vxlan-gpe/vxlan_gpe.h>
33 #include <vnet/geneve/geneve.h>
34 #include <vnet/classify/policer_classify.h>
35 #include <vnet/policer/xlate.h>
36 #include <vnet/policer/policer.h>
37 #include <vnet/classify/flow_classify.h>
38 #include <vlib/vlib.h>
39 #include <vlib/pci/pci.h>
40 #include <vlib/unix/unix.h>
41 #include <vlibapi/api.h>
42 #include <vlibmemory/api.h>
43 #include <vnet/lisp-cp/lisp_types.h>
44 #include <vnet/qos/qos_types.h>
46 #include <vnet/ethernet/ethernet.h>
47 #include <vnet/ethernet/ethernet_types_api.h>
48 #include <vnet/l2/l2_vtr.h>
50 #include <vpp/api/vpe_msg_enum.h>
51 #include <vpp/api/types.h>
52 #include <vlibapi/api_types_inlines.h>
54 #include <vnet/bonding/node.h>
56 #define vl_typedefs /* define message structures */
57 #include <vpp/api/vpe_all_api_h.h>
60 #define vl_endianfun /* define message structures */
61 #include <vpp/api/vpe_all_api_h.h>
64 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
68 vl_print (handle, (char *)s); \
73 static void *vl_api_create_loopback_t_print
74 (vl_api_create_loopback_t * mp, void *handle)
78 s = format (0, "SCRIPT: create_loopback ");
79 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
84 static void *vl_api_create_loopback_instance_t_print
85 (vl_api_create_loopback_instance_t * mp, void *handle)
89 s = format (0, "SCRIPT: create_loopback ");
90 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
91 s = format (s, "instance %d ", ntohl (mp->user_instance));
96 static void *vl_api_delete_loopback_t_print
97 (vl_api_delete_loopback_t * mp, void *handle)
101 s = format (0, "SCRIPT: delete_loopback ");
102 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
107 static void *vl_api_sw_interface_set_flags_t_print
108 (vl_api_sw_interface_set_flags_t * mp, void *handle)
111 s = format (0, "SCRIPT: sw_interface_set_flags ");
113 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
115 if (mp->admin_up_down)
116 s = format (s, "admin-up ");
118 s = format (s, "admin-down ");
124 static void *vl_api_sw_interface_set_rx_placement_t_print
125 (vl_api_sw_interface_set_rx_placement_t * mp, void *handle)
128 s = format (0, "SCRIPT: sw_interface_set_rx_placement ");
130 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
132 s = format (s, "queue %d ", ntohl (mp->queue_id));
134 s = format (s, "main ");
136 s = format (s, "worker %d ", ntohl (mp->worker_id));
142 static void *vl_api_sw_interface_rx_placement_dump_t_print
143 (vl_api_sw_interface_rx_placement_dump_t * mp, void *handle)
146 u32 sw_if_index = ntohl (mp->sw_if_index);
148 s = format (0, "SCRIPT: sw_interface_rx_placement_dump ");
150 if (sw_if_index != ~0)
151 s = format (s, "sw_if_index %d ", sw_if_index);
156 static void *vl_api_sw_interface_event_t_print
157 (vl_api_sw_interface_event_t * mp, void *handle)
160 s = format (0, "SCRIPT: sw_interface_event ");
162 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
164 if (mp->admin_up_down)
165 s = format (s, "admin-up ");
167 s = format (s, "admin-down ");
169 if (mp->link_up_down)
170 s = format (s, "link-up");
172 s = format (s, "link-down");
175 s = format (s, " deleted");
180 static void *vl_api_sw_interface_add_del_address_t_print
181 (vl_api_sw_interface_add_del_address_t * mp, void *handle)
185 s = format (0, "SCRIPT: sw_interface_add_del_address ");
187 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
190 s = format (s, "%U/%d ", format_ip6_address,
191 (ip6_address_t *) mp->address, mp->address_length);
193 s = format (s, "%U/%d ", format_ip4_address,
194 (ip4_address_t *) mp->address, mp->address_length);
197 s = format (s, "del ");
199 s = format (s, "del-all ");
204 static void *vl_api_sw_interface_set_table_t_print
205 (vl_api_sw_interface_set_table_t * mp, void *handle)
209 s = format (0, "SCRIPT: sw_interface_set_table ");
211 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
214 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
217 s = format (s, "ipv6 ");
222 static void *vl_api_sw_interface_set_mpls_enable_t_print
223 (vl_api_sw_interface_set_mpls_enable_t * mp, void *handle)
227 s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
229 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
232 s = format (s, "disable");
237 static void *vl_api_sw_interface_set_vpath_t_print
238 (vl_api_sw_interface_set_vpath_t * mp, void *handle)
242 s = format (0, "SCRIPT: sw_interface_set_vpath ");
244 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
247 s = format (s, "enable ");
249 s = format (s, "disable ");
254 static void *vl_api_sw_interface_set_vxlan_bypass_t_print
255 (vl_api_sw_interface_set_vxlan_bypass_t * mp, void *handle)
259 s = format (0, "SCRIPT: sw_interface_set_vxlan_bypass ");
261 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
264 s = format (s, "ip6 ");
267 s = format (s, "enable ");
269 s = format (s, "disable ");
274 static void *vl_api_sw_interface_set_geneve_bypass_t_print
275 (vl_api_sw_interface_set_geneve_bypass_t * mp, void *handle)
279 s = format (0, "SCRIPT: sw_interface_set_geneve_bypass ");
281 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
284 s = format (s, "ip6 ");
287 s = format (s, "enable ");
289 s = format (s, "disable ");
294 static void *vl_api_sw_interface_set_l2_xconnect_t_print
295 (vl_api_sw_interface_set_l2_xconnect_t * mp, void *handle)
299 s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
301 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
305 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
308 s = format (s, "delete ");
313 static void *vl_api_sw_interface_set_l2_bridge_t_print
314 (vl_api_sw_interface_set_l2_bridge_t * mp, void *handle)
318 s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
320 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
324 s = format (s, "bd_id %d shg %d ", ntohl (mp->bd_id), mp->shg);
325 if (L2_API_PORT_TYPE_BVI == ntohl (mp->port_type))
326 s = format (s, "bvi ");
327 if (L2_API_PORT_TYPE_UU_FWD == ntohl (mp->port_type))
328 s = format (s, "uu-fwd ");
329 s = format (s, "enable");
332 s = format (s, "disable ");
337 static void *vl_api_bridge_domain_add_del_t_print
338 (vl_api_bridge_domain_add_del_t * mp, void *handle)
342 s = format (0, "SCRIPT: bridge_domain_add_del ");
344 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
349 s = format (s, "bd_tag %s ", mp->bd_tag);
350 s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood);
351 s = format (s, "forward %d learn %d ", mp->forward, mp->learn);
352 s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age);
355 s = format (s, "del ");
360 static void *vl_api_bridge_domain_set_mac_age_t_print
361 (vl_api_bridge_domain_set_mac_age_t * mp, void *handle)
365 s = format (0, "SCRIPT: bridge_domain_set_mac_age ");
367 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
369 s = format (s, "mac-age %d", mp->mac_age);
374 static void *vl_api_bridge_domain_dump_t_print
375 (vl_api_bridge_domain_dump_t * mp, void *handle)
378 u32 bd_id = ntohl (mp->bd_id);
380 s = format (0, "SCRIPT: bridge_domain_dump ");
383 s = format (s, "bd_id %d ", bd_id);
388 static void *vl_api_l2fib_flush_all_t_print
389 (vl_api_l2fib_flush_all_t * mp, void *handle)
393 s = format (0, "SCRIPT: l2fib_flush_all ");
399 static void *vl_api_l2fib_flush_bd_t_print
400 (vl_api_l2fib_flush_bd_t * mp, void *handle)
403 u32 bd_id = ntohl (mp->bd_id);
405 s = format (0, "SCRIPT: l2fib_flush_bd ");
406 s = format (s, "bd_id %d ", bd_id);
411 static void *vl_api_l2fib_flush_int_t_print
412 (vl_api_l2fib_flush_int_t * mp, void *handle)
415 u32 sw_if_index = ntohl (mp->sw_if_index);
417 s = format (0, "SCRIPT: l2fib_flush_int ");
418 s = format (s, "sw_if_index %d ", sw_if_index);
423 static void *vl_api_l2fib_add_del_t_print
424 (vl_api_l2fib_add_del_t * mp, void *handle)
428 s = format (0, "SCRIPT: l2fib_add_del ");
430 s = format (s, "mac %U ", format_ethernet_address, mp->mac);
432 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
437 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
439 s = format (s, "%s", "static ");
441 s = format (s, "%s", "filter ");
443 s = format (s, "%s", "bvi ");
447 s = format (s, "del ");
454 vl_api_l2_flags_t_print (vl_api_l2_flags_t * mp, void *handle)
457 u32 flags = ntohl (mp->feature_bitmap);
459 s = format (0, "SCRIPT: l2_flags ");
461 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
463 if (flags & L2_LEARN)
464 s = format (s, "learn ");
466 s = format (s, "forward ");
467 if (flags & L2_FLOOD)
468 s = format (s, "flood ");
469 if (flags & L2_UU_FLOOD)
470 s = format (s, "uu-flood ");
471 if (flags & L2_ARP_TERM)
472 s = format (s, "arp-term ");
475 s = format (s, "clear ");
480 static void *vl_api_bridge_flags_t_print
481 (vl_api_bridge_flags_t * mp, void *handle)
484 u32 flags = ntohl (mp->flags);
486 s = format (0, "SCRIPT: bridge_flags ");
488 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
490 if (flags & BRIDGE_API_FLAG_LEARN)
491 s = format (s, "learn ");
492 if (flags & BRIDGE_API_FLAG_FWD)
493 s = format (s, "forward ");
494 if (flags & BRIDGE_API_FLAG_FLOOD)
495 s = format (s, "flood ");
496 if (flags & BRIDGE_API_FLAG_UU_FLOOD)
497 s = format (s, "uu-flood ");
498 if (flags & BRIDGE_API_FLAG_ARP_TERM)
499 s = format (s, "arp-term ");
502 s = format (s, "clear ");
507 static void *vl_api_bd_ip_mac_add_del_t_print
508 (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
512 s = format (0, "SCRIPT: bd_ip_mac_add_del ");
513 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
515 s = format (s, "%U ", format_vl_api_address, &mp->ip);
516 s = format (s, "%U ", format_vl_api_mac_address, &mp->mac);
518 s = format (s, "del ");
523 static void *vl_api_bd_ip_mac_flush_t_print
524 (vl_api_bd_ip_mac_flush_t * mp, void *handle)
528 s = format (0, "SCRIPT: bd_ip_mac_flush ");
529 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
535 static void *vl_api_bd_ip_mac_dump_t_print
536 (vl_api_bd_ip_mac_dump_t * mp, void *handle)
540 s = format (0, "SCRIPT: bd_ip_mac_dump ");
545 static void *vl_api_tap_create_v2_t_print
546 (vl_api_tap_create_v2_t * mp, void *handle)
551 clib_memset (null_mac, 0, sizeof (null_mac));
553 s = format (0, "SCRIPT: tap_create_v2 ");
554 s = format (s, "id %u ", ntohl (mp->id));
555 if (memcmp (mp->mac_address, null_mac, 6))
556 s = format (s, "mac-address %U ",
557 format_ethernet_address, mp->mac_address);
558 if (memcmp (mp->host_mac_addr, null_mac, 6))
559 s = format (s, "host-mac-addr %U ",
560 format_ethernet_address, mp->host_mac_addr);
561 if (mp->host_if_name_set)
562 s = format (s, "host-if-name %s ", mp->host_if_name);
563 if (mp->host_namespace_set)
564 s = format (s, "host-ns %s ", mp->host_namespace);
565 if (mp->host_bridge_set)
566 s = format (s, "host-bridge %s ", mp->host_bridge);
567 if (mp->host_ip4_addr_set)
568 s = format (s, "host-ip4-addr %U/%d ", format_ip4_address,
569 mp->host_ip4_addr, mp->host_ip4_prefix_len);
570 if (mp->host_ip6_addr_set)
571 s = format (s, "host-ip6-addr %U/%d ", format_ip6_address,
572 mp->host_ip6_addr, mp->host_ip6_prefix_len);
573 if (mp->host_ip4_gw_set)
574 s = format (s, "host-ip4-gw %U ", format_ip4_address, mp->host_ip4_addr);
575 if (mp->host_ip6_gw_set)
576 s = format (s, "host-ip6-gw %U ", format_ip6_address, mp->host_ip6_addr);
578 s = format (s, "tx-ring-size %u ", ntohs (mp->tx_ring_sz));
580 s = format (s, "rx-ring-size %u ", ntohs (mp->rx_ring_sz));
584 static void *vl_api_tap_delete_v2_t_print
585 (vl_api_tap_delete_v2_t * mp, void *handle)
589 s = format (0, "SCRIPT: tap_delete_v2 ");
590 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
595 static void *vl_api_sw_interface_tap_v2_dump_t_print
596 (vl_api_sw_interface_tap_v2_dump_t * mp, void *handle)
600 s = format (0, "SCRIPT: sw_interface_tap_v2_dump ");
606 static void *vl_api_virtio_pci_create_t_print
607 (vl_api_virtio_pci_create_t * mp, void *handle)
612 clib_memset (null_mac, 0, sizeof (null_mac));
614 s = format (0, "SCRIPT: virtio_pci_create ");
615 s = format (s, "pci_addr %U ", format_vlib_pci_addr, ntohl (mp->pci_addr));
616 if (memcmp (mp->mac_address, null_mac, 6))
617 s = format (s, "mac-address %U ",
618 format_ethernet_address, mp->mac_address);
620 s = format (s, "features 0x%llx ", clib_net_to_host_u64 (mp->features));
622 s = format (s, "gso-enabled");
627 static void *vl_api_virtio_pci_delete_t_print
628 (vl_api_virtio_pci_delete_t * mp, void *handle)
632 s = format (0, "SCRIPT: virtio_pci_delete ");
633 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
639 static void *vl_api_sw_interface_virtio_pci_dump_t_print
640 (vl_api_sw_interface_virtio_pci_dump_t * mp, void *handle)
644 s = format (0, "SCRIPT: sw_interface_virtio_pci_dump ");
649 static void *vl_api_bond_create_t_print
650 (vl_api_bond_create_t * mp, void *handle)
655 clib_memset (null_mac, 0, sizeof (null_mac));
657 s = format (0, "SCRIPT: bond_create ");
658 if (memcmp (mp->mac_address, null_mac, 6))
659 s = format (s, "mac-address %U ",
660 format_ethernet_address, mp->mac_address);
662 s = format (s, "mode %U ", format_bond_mode, mp->mode);
664 s = format (s, "lb %U ", format_bond_load_balance, mp->lb);
666 s = format (s, "id %u ", ntohl (mp->id));
670 static void *vl_api_bond_delete_t_print
671 (vl_api_bond_delete_t * mp, void *handle)
675 s = format (0, "SCRIPT: bond_delete ");
676 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
681 static void *vl_api_bond_enslave_t_print
682 (vl_api_bond_enslave_t * mp, void *handle)
686 s = format (0, "SCRIPT: bond_enslave ");
687 s = format (s, "bond_sw_if_index %u ", mp->bond_sw_if_index);
688 s = format (s, "sw_if_index %u ", mp->sw_if_index);
690 s = format (s, "passive ");
691 if (mp->is_long_timeout)
692 s = format (s, "long-timeout ");
697 static void *vl_api_bond_detach_slave_t_print
698 (vl_api_bond_detach_slave_t * mp, void *handle)
702 s = format (0, "SCRIPT: bond_detach_slave ");
703 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
709 static void *vl_api_sw_interface_bond_dump_t_print
710 (vl_api_sw_interface_bond_dump_t * mp, void *handle)
714 s = format (0, "SCRIPT: sw_interface_bond_dump ");
720 static void *vl_api_sw_interface_slave_dump_t_print
721 (vl_api_sw_interface_slave_dump_t * mp, void *handle)
725 s = format (0, "SCRIPT: sw_interface_slave_dump ");
726 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
731 static void *vl_api_ip_add_del_route_t_print
732 (vl_api_ip_add_del_route_t * mp, void *handle)
736 s = format (0, "SCRIPT: ip_add_del_route ");
738 s = format (s, "del ");
741 s = format (s, "%U/%d ", format_ip6_address, mp->dst_address,
742 mp->dst_address_length);
744 s = format (s, "%U/%d ", format_ip4_address, mp->dst_address,
745 mp->dst_address_length);
747 if (mp->table_id != 0)
748 s = format (s, "vrf %d ", ntohl (mp->table_id));
751 s = format (s, "local ");
752 else if (mp->is_drop)
753 s = format (s, "drop ");
754 else if (mp->is_classify)
755 s = format (s, "classify %d", ntohl (mp->classify_table_index));
756 else if (mp->next_hop_via_label != htonl (MPLS_LABEL_INVALID))
757 s = format (s, "via via_label %d ", ntohl (mp->next_hop_via_label));
761 s = format (s, "via %U ", format_ip6_address, mp->next_hop_address);
763 s = format (s, "via %U ", format_ip4_address, mp->next_hop_address);
764 if (mp->next_hop_sw_if_index != ~0)
765 s = format (s, "sw_if_index %d ", ntohl (mp->next_hop_sw_if_index));
769 if (mp->next_hop_weight != 1)
770 s = format (s, "weight %d ", (u32) mp->next_hop_weight);
772 if (mp->is_multipath)
773 s = format (s, "multipath ");
775 if (mp->next_hop_table_id)
776 s = format (s, "lookup-in-vrf %d ", ntohl (mp->next_hop_table_id));
778 if (mp->next_hop_n_out_labels)
781 for (i = 0; i < mp->next_hop_n_out_labels; i++)
783 s = format (s, "out-label %d ",
784 ntohl (mp->next_hop_out_label_stack[i].label));
791 static void *vl_api_mpls_route_add_del_t_print
792 (vl_api_mpls_route_add_del_t * mp, void *handle)
796 s = format (0, "SCRIPT: mpls_route_add_del ");
799 s = format (s, "add ");
801 s = format (s, "del ");
803 s = format (s, "%d ", ntohl (mp->mr_label));
806 s = format (s, "eos ");
808 s = format (s, "non-eos ");
811 if (mp->mr_next_hop_proto == DPO_PROTO_IP4)
813 ip4_address_t ip4_null = {.as_u32 = 0, };
814 if (memcmp (mp->mr_next_hop, &ip4_null, sizeof (ip4_null)))
815 s = format (s, "via %U ", format_ip4_address, mp->mr_next_hop);
817 s = format (s, "via lookup-in-ip4-table %d ",
818 ntohl (mp->mr_next_hop_table_id));
820 else if (mp->mr_next_hop_proto == DPO_PROTO_IP6)
822 ip6_address_t ip6_null = { {0}
824 if (memcmp (mp->mr_next_hop, &ip6_null, sizeof (ip6_null)))
825 s = format (s, "via %U ", format_ip6_address, mp->mr_next_hop);
827 s = format (s, "via lookup-in-ip6-table %d ",
828 ntohl (mp->mr_next_hop_table_id));
830 else if (mp->mr_next_hop_proto == DPO_PROTO_ETHERNET)
832 s = format (s, "via l2-input-on ");
834 else if (mp->mr_next_hop_proto == DPO_PROTO_MPLS)
836 if (mp->mr_next_hop_via_label != htonl (MPLS_LABEL_INVALID))
838 format (s, "via via-label %d ", ntohl (mp->mr_next_hop_via_label));
840 s = format (s, "via next-hop-table %d ",
841 ntohl (mp->mr_next_hop_table_id));
843 if (mp->mr_next_hop_sw_if_index != ~0)
844 s = format (s, "sw_if_index %d ", ntohl (mp->mr_next_hop_sw_if_index));
846 if (mp->mr_next_hop_weight != 1)
847 s = format (s, "weight %d ", (u32) mp->mr_next_hop_weight);
849 if (mp->mr_is_multipath)
850 s = format (s, "multipath ");
852 if (mp->mr_is_classify)
853 s = format (s, "classify %d", ntohl (mp->mr_classify_table_index));
855 if (mp->mr_next_hop_n_out_labels)
858 for (i = 0; i < mp->mr_next_hop_n_out_labels; i++)
860 s = format (s, "out-label %d ",
861 ntohl (mp->mr_next_hop_out_label_stack[i].label));
868 static void *vl_api_ip_table_add_del_t_print
869 (vl_api_ip_table_add_del_t * mp, void *handle)
873 s = format (0, "SCRIPT: ip_table_add_del ");
875 s = format (s, "add ");
877 s = format (s, "del ");
879 s = format (s, "ip6 ");
880 s = format (s, "table %d ", ntohl (mp->table_id));
885 static void *vl_api_mpls_table_add_del_t_print
886 (vl_api_mpls_table_add_del_t * mp, void *handle)
890 s = format (0, "SCRIPT: mpls_table_add_del ");
892 s = format (s, "add ");
894 s = format (s, "del ");
895 s = format (s, "table %d ", ntohl (mp->mt_table_id));
900 static void *vl_api_proxy_arp_add_del_t_print
901 (vl_api_proxy_arp_add_del_t * mp, void *handle)
905 s = format (0, "SCRIPT: proxy_arp_add_del ");
907 s = format (s, "%U - %U ",
908 format_vl_api_ip4_address, mp->proxy.low,
909 format_vl_api_ip4_address, mp->proxy.hi);
911 s = format (s, "table %d ", ntohl (mp->proxy.table_id));
914 s = format (s, "del ");
919 static void *vl_api_proxy_arp_intfc_enable_disable_t_print
920 (vl_api_proxy_arp_intfc_enable_disable_t * mp, void *handle)
924 s = format (0, "SCRIPT: proxy_arp_intfc_enable_disable ");
926 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
928 s = format (s, "enable %d ", mp->enable_disable);
933 static void *vl_api_mpls_tunnel_add_del_t_print
934 (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
938 s = format (0, "SCRIPT: mpls_tunnel_add_del ");
940 if (mp->mt_is_add == 0)
941 s = format (s, "del sw_if_index %d ", ntohl (mp->mt_sw_if_index));
943 mpls_label_t label = ntohl (mp->mt_next_hop_via_label);
944 if (label != MPLS_LABEL_INVALID)
945 s = format (s, "via-label %d ", label);
946 else if (mp->mt_next_hop_proto_is_ip4)
947 s = format (s, "via %U ", format_ip4_address, mp->mt_next_hop);
949 s = format (s, "via %U ", format_ip6_address, mp->mt_next_hop);
951 if (mp->mt_next_hop_sw_if_index != ~0)
952 s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index));
953 else if (mp->mt_next_hop_table_id)
954 s = format (s, "next-hop-table %d ", ntohl (mp->mt_next_hop_table_id));
957 s = format (s, "l2-only ");
959 if (mp->mt_next_hop_n_out_labels)
962 for (i = 0; i < mp->mt_next_hop_n_out_labels; i++)
964 s = format (s, "out-label %d ",
965 ntohl (mp->mt_next_hop_out_label_stack[i].label));
972 static void *vl_api_sr_mpls_policy_add_t_print
973 (vl_api_sr_mpls_policy_add_t * mp, void *handle)
977 s = format (0, "SCRIPT: sr_mpls_policy_add ");
979 s = format (s, "bsid %d ", ntohl (mp->bsid));
981 if (mp->weight != htonl ((u32) 1))
982 s = format (s, "%d ", ntohl (mp->weight));
985 s = format (s, "spray ");
990 for (i = 0; i < mp->n_segments; i++)
991 s = format (s, "next %d ", ntohl (mp->segments[i]));
997 static void *vl_api_sr_mpls_policy_del_t_print
998 (vl_api_sr_mpls_policy_del_t * mp, void *handle)
1002 s = format (0, "SCRIPT: sr_mpls_policy_del ");
1004 s = format (s, "bsid %d ", ntohl (mp->bsid));
1009 static void *vl_api_sw_interface_set_unnumbered_t_print
1010 (vl_api_sw_interface_set_unnumbered_t * mp, void *handle)
1014 s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
1016 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1018 s = format (s, "unnum_if_index %d ", ntohl (mp->unnumbered_sw_if_index));
1020 if (mp->is_add == 0)
1021 s = format (s, "del ");
1026 static void *vl_api_ip_neighbor_add_del_t_print
1027 (vl_api_ip_neighbor_add_del_t * mp, void *handle)
1031 s = format (0, "SCRIPT: ip_neighbor_add_del ");
1033 s = format (s, "sw_if_index %d ", ntohl (mp->neighbor.sw_if_index));
1035 if (IP_API_NEIGHBOR_FLAG_STATIC & ntohl (mp->neighbor.flags))
1036 s = format (s, "is_static ");
1038 if (IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY & ntohl (mp->neighbor.flags))
1039 s = format (s, "is_no_fib_entry ");
1041 s = format (s, "mac %U ", format_vl_api_mac_address,
1042 &mp->neighbor.mac_address);
1044 s = format (s, "dst %U ", format_vl_api_address, &mp->neighbor.ip_address);
1046 if (mp->is_add == 0)
1047 s = format (s, "del ");
1053 static void *vl_api_create_vlan_subif_t_print
1054 (vl_api_create_vlan_subif_t * mp, void *handle)
1058 s = format (0, "SCRIPT: create_vlan_subif ");
1060 if (mp->sw_if_index)
1061 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1064 s = format (s, "vlan_id %d ", ntohl (mp->vlan_id));
1069 #define foreach_create_subif_bit \
1076 _(outer_vlan_id_any) \
1077 _(inner_vlan_id_any)
1079 static void *vl_api_create_subif_t_print
1080 (vl_api_create_subif_t * mp, void *handle)
1084 s = format (0, "SCRIPT: create_subif ");
1086 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1088 s = format (s, "sub_id %d ", ntohl (mp->sub_id));
1090 if (mp->outer_vlan_id)
1091 s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
1093 if (mp->inner_vlan_id)
1094 s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
1096 #define _(a) if (mp->a) s = format (s, "%s ", #a);
1097 foreach_create_subif_bit;
1103 static void *vl_api_delete_subif_t_print
1104 (vl_api_delete_subif_t * mp, void *handle)
1108 s = format (0, "SCRIPT: delete_subif ");
1109 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1115 vl_api_reset_fib_t_print (vl_api_reset_fib_t * mp, void *handle)
1119 s = format (0, "SCRIPT: reset_fib ");
1122 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
1124 if (mp->is_ipv6 != 0)
1125 s = format (s, "ipv6 ");
1130 static void *vl_api_dhcp_proxy_config_t_print
1131 (vl_api_dhcp_proxy_config_t * mp, void *handle)
1135 s = format (0, "SCRIPT: dhcp_proxy_config_2 ");
1137 s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
1138 s = format (s, "server_vrf_id %d ", ntohl (mp->server_vrf_id));
1142 s = format (s, "svr %U ", format_ip6_address,
1143 (ip6_address_t *) mp->dhcp_server);
1144 s = format (s, "src %U ", format_ip6_address,
1145 (ip6_address_t *) mp->dhcp_src_address);
1149 s = format (s, "svr %U ", format_ip4_address,
1150 (ip4_address_t *) mp->dhcp_server);
1151 s = format (s, "src %U ", format_ip4_address,
1152 (ip4_address_t *) mp->dhcp_src_address);
1154 if (mp->is_add == 0)
1155 s = format (s, "del ");
1160 static void *vl_api_dhcp_proxy_set_vss_t_print
1161 (vl_api_dhcp_proxy_set_vss_t * mp, void *handle)
1165 s = format (0, "SCRIPT: dhcp_proxy_set_vss ");
1167 s = format (s, "tbl_id %d ", ntohl (mp->tbl_id));
1169 if (mp->vss_type == VSS_TYPE_VPN_ID)
1171 s = format (s, "fib_id %d ", ntohl (mp->vpn_index));
1172 s = format (s, "oui %d ", ntohl (mp->oui));
1174 else if (mp->vss_type == VSS_TYPE_ASCII)
1175 s = format (s, "vpn_ascii_id %s", mp->vpn_ascii_id);
1177 if (mp->is_ipv6 != 0)
1178 s = format (s, "ipv6 ");
1180 if (mp->is_add == 0)
1181 s = format (s, "del ");
1186 static void *vl_api_dhcp_client_config_t_print
1187 (vl_api_dhcp_client_config_t * mp, void *handle)
1191 s = format (0, "SCRIPT: dhcp_client_config ");
1193 s = format (s, "sw_if_index %d ", ntohl (mp->client.sw_if_index));
1195 s = format (s, "hostname %s ", mp->client.hostname);
1197 s = format (s, "want_dhcp_event %d ", mp->client.want_dhcp_event);
1199 s = format (s, "pid %d ", ntohl (mp->client.pid));
1201 if (mp->is_add == 0)
1202 s = format (s, "del ");
1208 static void *vl_api_set_ip_flow_hash_t_print
1209 (vl_api_set_ip_flow_hash_t * mp, void *handle)
1213 s = format (0, "SCRIPT: set_ip_flow_hash ");
1215 s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
1218 s = format (s, "src ");
1221 s = format (s, "dst ");
1224 s = format (s, "sport ");
1227 s = format (s, "dport ");
1230 s = format (s, "proto ");
1233 s = format (s, "reverse ");
1235 if (mp->is_ipv6 != 0)
1236 s = format (s, "ipv6 ");
1241 static void *vl_api_sw_interface_ip6nd_ra_prefix_t_print
1242 (vl_api_sw_interface_ip6nd_ra_prefix_t * mp, void *handle)
1246 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_prefix ");
1248 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1250 s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
1252 s = format (s, "val_life %d ", ntohl (mp->val_lifetime));
1254 s = format (s, "pref_life %d ", ntohl (mp->pref_lifetime));
1256 if (mp->use_default)
1257 s = format (s, "def ");
1259 if (mp->no_advertise)
1260 s = format (s, "noadv ");
1263 s = format (s, "offl ");
1265 if (mp->no_autoconfig)
1266 s = format (s, "noauto ");
1269 s = format (s, "nolink ");
1272 s = format (s, "isno ");
1277 static void *vl_api_sw_interface_ip6nd_ra_config_t_print
1278 (vl_api_sw_interface_ip6nd_ra_config_t * mp, void *handle)
1282 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_config ");
1284 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1286 s = format (s, "maxint %d ", ntohl (mp->max_interval));
1288 s = format (s, "minint %d ", ntohl (mp->min_interval));
1290 s = format (s, "life %d ", ntohl (mp->lifetime));
1292 s = format (s, "count %d ", ntohl (mp->initial_count));
1294 s = format (s, "interval %d ", ntohl (mp->initial_interval));
1297 s = format (s, "suppress ");
1300 s = format (s, "managed ");
1303 s = format (s, "other ");
1306 s = format (s, "ll ");
1308 if (mp->send_unicast)
1309 s = format (s, "send ");
1312 s = format (s, "cease ");
1315 s = format (s, "isno ");
1317 if (mp->default_router)
1318 s = format (s, "def ");
1323 static void *vl_api_set_arp_neighbor_limit_t_print
1324 (vl_api_set_arp_neighbor_limit_t * mp, void *handle)
1328 s = format (0, "SCRIPT: set_arp_neighbor_limit ");
1330 s = format (s, "arp_nbr_limit %d ", ntohl (mp->arp_neighbor_limit));
1332 if (mp->is_ipv6 != 0)
1333 s = format (s, "ipv6 ");
1338 static void *vl_api_l2_patch_add_del_t_print
1339 (vl_api_l2_patch_add_del_t * mp, void *handle)
1343 s = format (0, "SCRIPT: l2_patch_add_del ");
1345 s = format (s, "rx_sw_if_index %d ", ntohl (mp->rx_sw_if_index));
1347 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
1349 if (mp->is_add == 0)
1350 s = format (s, "del ");
1355 static void *vl_api_sr_localsid_add_del_t_print
1356 (vl_api_sr_localsid_add_del_t * mp, void *handle)
1358 vnet_main_t *vnm = vnet_get_main ();
1361 s = format (0, "SCRIPT: sr_localsid_add_del ");
1363 switch (mp->behavior)
1365 case SR_BEHAVIOR_END:
1366 s = format (s, "Address: %U\nBehavior: End",
1367 format_ip6_address, (ip6_address_t *) mp->localsid.addr);
1368 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1373 "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1374 "\nIface: %U\nNext hop: %U", format_ip6_address,
1375 (ip6_address_t *) mp->localsid.addr,
1376 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1377 format_ip6_address, (ip6_address_t *) mp->nh_addr6);
1378 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1380 case SR_BEHAVIOR_DX4:
1383 "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1384 "\nIface: %U\nNext hop: %U", format_ip6_address,
1385 (ip6_address_t *) mp->localsid.addr,
1386 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1387 format_ip4_address, (ip4_address_t *) mp->nh_addr4);
1389 case SR_BEHAVIOR_DX6:
1392 "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1393 "\nIface: %UNext hop: %U", format_ip6_address,
1394 (ip6_address_t *) mp->localsid.addr,
1395 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1396 format_ip6_address, (ip6_address_t *) mp->nh_addr6);
1398 case SR_BEHAVIOR_DX2:
1401 "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1402 "\nIface: %U", format_ip6_address,
1403 (ip6_address_t *) mp->localsid.addr,
1404 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index));
1406 case SR_BEHAVIOR_DT6:
1409 "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1410 "\nTable: %u", format_ip6_address,
1411 (ip6_address_t *) mp->localsid.addr, ntohl (mp->fib_table));
1413 case SR_BEHAVIOR_DT4:
1416 "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1417 "\nTable: %u", format_ip6_address,
1418 (ip6_address_t *) mp->localsid.addr, ntohl (mp->fib_table));
1421 if (mp->behavior >= SR_BEHAVIOR_LAST)
1423 s = format (s, "Address: %U\n Behavior: %u",
1424 format_ip6_address, (ip6_address_t *) mp->localsid.addr,
1428 //Should never get here...
1429 s = format (s, "Internal error");
1435 static void *vl_api_sr_steering_add_del_t_print
1436 (vl_api_sr_steering_add_del_t * mp, void *handle)
1440 s = format (0, "SCRIPT: sr_steering_add_del ");
1442 s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1444 switch (mp->traffic_type)
1447 s = format (s, "Traffic type: L2 iface: %u", ntohl (mp->sw_if_index));
1450 s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1451 (ip4_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1454 s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1455 (ip6_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1458 s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1461 s = format (s, "BindingSID: %U", format_ip6_address,
1462 (ip6_address_t *) mp->bsid_addr);
1464 s = format (s, "SR Policy Index: %u", ntohl (mp->sr_policy_index));
1466 s = format (s, "FIB_table: %u", ntohl (mp->table_id));
1471 static void *vl_api_sr_policy_add_t_print
1472 (vl_api_sr_policy_add_t * mp, void *handle)
1476 ip6_address_t *segments = 0, *seg;
1477 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1480 for (i = 0; i < mp->sids.num_sids; i++)
1482 vec_add2 (segments, seg, 1);
1483 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1487 s = format (0, "SCRIPT: sr_policy_add ");
1489 s = format (s, "BSID: %U", format_ip6_address,
1490 (ip6_address_t *) mp->bsid_addr);
1494 (mp->is_encap ? "Behavior: Encapsulation" :
1495 "Behavior: SRH insertion"));
1497 s = format (s, "FIB_table: %u", ntohl (mp->fib_table));
1499 s = format (s, (mp->type ? "Type: Default" : "Type: Spray"));
1501 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1503 s = format (s, "{");
1504 vec_foreach (seg, segments)
1506 s = format (s, "%U, ", format_ip6_address, seg);
1508 s = format (s, "\b\b } ");
1513 static void *vl_api_sr_policy_mod_t_print
1514 (vl_api_sr_policy_mod_t * mp, void *handle)
1518 ip6_address_t *segments = 0, *seg;
1519 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1522 for (i = 0; i < mp->sids.num_sids; i++)
1524 vec_add2 (segments, seg, 1);
1525 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1529 s = format (0, "SCRIPT: sr_policy_mod ");
1531 s = format (s, "BSID: %U", format_ip6_address,
1532 (ip6_address_t *) mp->bsid_addr);
1534 s = format (s, "SR Policy index: %u", ntohl (mp->sr_policy_index));
1536 s = format (s, "Operation: %u", mp->operation);
1538 s = format (s, "SID list index: %u", ntohl (mp->sl_index));
1540 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1542 s = format (s, "{");
1543 vec_foreach (seg, segments)
1545 s = format (s, "%U, ", format_ip6_address, seg);
1547 s = format (s, "\b\b } ");
1552 static void *vl_api_sr_policy_del_t_print
1553 (vl_api_sr_policy_del_t * mp, void *handle)
1557 s = format (0, "SCRIPT: sr_policy_del ");
1558 s = format (s, "To be delivered. Good luck.");
1562 static void *vl_api_classify_add_del_table_t_print
1563 (vl_api_classify_add_del_table_t * mp, void *handle)
1568 s = format (0, "SCRIPT: classify_add_del_table ");
1570 if (mp->is_add == 0)
1572 s = format (s, "table %d ", ntohl (mp->table_index));
1573 s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1577 s = format (s, "nbuckets %d ", ntohl (mp->nbuckets));
1578 s = format (s, "memory_size %d ", ntohl (mp->memory_size));
1579 s = format (s, "skip %d ", ntohl (mp->skip_n_vectors));
1580 s = format (s, "match %d ", ntohl (mp->match_n_vectors));
1581 s = format (s, "next-table %d ", ntohl (mp->next_table_index));
1582 s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
1583 s = format (s, "current-data-flag %d ", ntohl (mp->current_data_flag));
1584 if (mp->current_data_flag)
1585 s = format (s, "current-data-offset %d ",
1586 ntohl (mp->current_data_offset));
1587 s = format (s, "mask hex ");
1588 for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
1589 s = format (s, "%02x", mp->mask[i]);
1596 static void *vl_api_classify_add_del_session_t_print
1597 (vl_api_classify_add_del_session_t * mp, void *handle)
1602 s = format (0, "SCRIPT: classify_add_del_session ");
1604 s = format (s, "table_index %d ", ntohl (mp->table_index));
1605 s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
1606 s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
1607 s = format (s, "advance %d ", ntohl (mp->advance));
1608 s = format (s, "action %d ", mp->action);
1610 s = format (s, "metadata %d ", ntohl (mp->metadata));
1611 if (mp->is_add == 0)
1612 s = format (s, "del ");
1614 s = format (s, "match hex ");
1615 for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1617 if (mp->match[i] != 0)
1624 for (i = 0; i < limit; i++)
1625 s = format (s, "%02x", mp->match[i]);
1630 static void *vl_api_classify_set_interface_ip_table_t_print
1631 (vl_api_classify_set_interface_ip_table_t * mp, void *handle)
1635 s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1638 s = format (s, "ipv6 ");
1640 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1641 s = format (s, "table %d ", ntohl (mp->table_index));
1646 static void *vl_api_classify_set_interface_l2_tables_t_print
1647 (vl_api_classify_set_interface_l2_tables_t * mp, void *handle)
1651 s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1653 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1654 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1655 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1656 s = format (s, "other-table %d ", ntohl (mp->other_table_index));
1657 s = format (s, "is-input %d ", mp->is_input);
1662 static void *vl_api_add_node_next_t_print
1663 (vl_api_add_node_next_t * mp, void *handle)
1667 s = format (0, "SCRIPT: add_node_next ");
1669 s = format (0, "node %s next %s ", mp->node_name, mp->next_name);
1674 static void *vl_api_l2tpv3_create_tunnel_t_print
1675 (vl_api_l2tpv3_create_tunnel_t * mp, void *handle)
1679 s = format (0, "SCRIPT: l2tpv3_create_tunnel ");
1681 s = format (s, "client_address %U our_address %U ",
1682 format_ip6_address, (ip6_address_t *) (mp->client_address),
1683 format_ip6_address, (ip6_address_t *) (mp->our_address));
1684 s = format (s, "local_session_id %d ", ntohl (mp->local_session_id));
1685 s = format (s, "remote_session_id %d ", ntohl (mp->remote_session_id));
1686 s = format (s, "local_cookie %lld ",
1687 clib_net_to_host_u64 (mp->local_cookie));
1688 s = format (s, "remote_cookie %lld ",
1689 clib_net_to_host_u64 (mp->remote_cookie));
1690 if (mp->l2_sublayer_present)
1691 s = format (s, "l2-sublayer-present ");
1696 static void *vl_api_l2tpv3_set_tunnel_cookies_t_print
1697 (vl_api_l2tpv3_set_tunnel_cookies_t * mp, void *handle)
1701 s = format (0, "SCRIPT: l2tpv3_set_tunnel_cookies ");
1703 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1705 s = format (s, "new_local_cookie %llu ",
1706 clib_net_to_host_u64 (mp->new_local_cookie));
1708 s = format (s, "new_remote_cookie %llu ",
1709 clib_net_to_host_u64 (mp->new_remote_cookie));
1714 static void *vl_api_l2tpv3_interface_enable_disable_t_print
1715 (vl_api_l2tpv3_interface_enable_disable_t * mp, void *handle)
1719 s = format (0, "SCRIPT: l2tpv3_interface_enable_disable ");
1721 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1723 if (mp->enable_disable == 0)
1724 s = format (s, "del ");
1729 static void *vl_api_l2tpv3_set_lookup_key_t_print
1730 (vl_api_l2tpv3_set_lookup_key_t * mp, void *handle)
1733 char *str = "unknown";
1735 s = format (0, "SCRIPT: l2tpv3_set_lookup_key ");
1739 case L2T_LOOKUP_SRC_ADDRESS:
1740 str = "lookup_v6_src";
1742 case L2T_LOOKUP_DST_ADDRESS:
1743 str = "lookup_v6_dst";
1745 case L2T_LOOKUP_SESSION_ID:
1746 str = "lookup_session_id";
1752 s = format (s, "%s ", str);
1757 static void *vl_api_sw_if_l2tpv3_tunnel_dump_t_print
1758 (vl_api_sw_if_l2tpv3_tunnel_dump_t * mp, void *handle)
1762 s = format (0, "SCRIPT: sw_if_l2tpv3_tunnel_dump ");
1767 static void *vl_api_vxlan_add_del_tunnel_t_print
1768 (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1771 s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1773 ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
1774 ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
1776 u8 is_grp = ip46_address_is_multicast (&dst);
1777 char *dst_name = is_grp ? "group" : "dst";
1779 s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1780 s = format (s, "%s %U ", dst_name, format_ip46_address,
1781 &dst, IP46_TYPE_ANY);
1784 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1786 if (mp->encap_vrf_id)
1787 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1789 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1791 s = format (s, "vni %d ", ntohl (mp->vni));
1793 s = format (s, "instance %d ", ntohl (mp->instance));
1795 if (mp->is_add == 0)
1796 s = format (s, "del ");
1801 static void *vl_api_vxlan_offload_rx_t_print
1802 (vl_api_vxlan_offload_rx_t * mp, void *handle)
1805 s = format (0, "SCRIPT: vxlan_offload_rx ");
1807 s = format (s, "hw hw_if_index %d ", ntohl (mp->hw_if_index));
1808 s = format (s, "rx sw_if_index %d ", ntohl (mp->sw_if_index));
1810 s = format (s, "del ");
1815 static void *vl_api_vxlan_tunnel_dump_t_print
1816 (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1820 s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1822 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1827 static void *vl_api_vxlan_gbp_tunnel_add_del_t_print
1828 (vl_api_vxlan_gbp_tunnel_add_del_t * mp, void *handle)
1831 s = format (0, "SCRIPT: vxlan_gbp_tunnel_add_del ");
1834 s = format (s, "add ");
1836 s = format (s, "del ");
1838 s = format (s, "instance %d ", ntohl (mp->tunnel.instance));
1839 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1840 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1842 format (s, "mcast_sw_if_index %d ", ntohl (mp->tunnel.mcast_sw_if_index));
1843 s = format (s, "encap_table_id %d ", ntohl (mp->tunnel.encap_table_id));
1844 s = format (s, "vni %d ", ntohl (mp->tunnel.vni));
1845 s = format (s, "sw_if_index %d ", ntohl (mp->tunnel.sw_if_index));
1850 static void *vl_api_vxlan_gbp_tunnel_dump_t_print
1851 (vl_api_vxlan_gbp_tunnel_dump_t * mp, void *handle)
1855 s = format (0, "SCRIPT: vxlan_gbp_tunnel_dump ");
1857 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1862 static void *vl_api_sw_interface_set_vxlan_gbp_bypass_t_print
1863 (vl_api_sw_interface_set_vxlan_gbp_bypass_t * mp, void *handle)
1867 s = format (0, "SCRIPT: sw_interface_set_vxlan_gbp_bypass ");
1869 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1870 s = format (s, "%s ", (mp->is_ipv6 != 0) ? "ipv6" : "ipv4");
1871 s = format (s, "%s ", (mp->enable != 0) ? "enable" : "disable");
1876 static void *vl_api_geneve_add_del_tunnel_t_print
1877 (vl_api_geneve_add_del_tunnel_t * mp, void *handle)
1880 s = format (0, "SCRIPT: geneve_add_del_tunnel ");
1882 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local_address);
1883 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote_address);
1885 u8 is_grp = ip46_address_is_multicast (&remote);
1886 char *remote_name = is_grp ? "group" : "dst";
1888 s = format (s, "src %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1889 s = format (s, "%s %U ", remote_name, format_ip46_address,
1890 &remote, IP46_TYPE_ANY);
1893 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1895 if (mp->encap_vrf_id)
1896 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1898 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1900 s = format (s, "vni %d ", ntohl (mp->vni));
1902 if (mp->is_add == 0)
1903 s = format (s, "del ");
1908 static void *vl_api_geneve_tunnel_dump_t_print
1909 (vl_api_geneve_tunnel_dump_t * mp, void *handle)
1913 s = format (0, "SCRIPT: geneve_tunnel_dump ");
1915 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1920 static void *vl_api_gre_tunnel_add_del_t_print
1921 (vl_api_gre_tunnel_add_del_t * mp, void *handle)
1925 s = format (0, "SCRIPT: gre_tunnel_add_del ");
1927 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1928 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1930 s = format (s, "instance %d ", ntohl (mp->tunnel.instance));
1932 if (mp->tunnel.type == GRE_API_TUNNEL_TYPE_TEB)
1933 s = format (s, "teb ");
1935 if (mp->tunnel.type == GRE_API_TUNNEL_TYPE_ERSPAN)
1936 s = format (s, "erspan %d ", ntohs (mp->tunnel.session_id));
1938 if (mp->tunnel.outer_fib_id)
1939 s = format (s, "outer-fib-id %d ", ntohl (mp->tunnel.outer_fib_id));
1941 if (mp->is_add == 0)
1942 s = format (s, "del ");
1947 static void *vl_api_gre_tunnel_dump_t_print
1948 (vl_api_gre_tunnel_dump_t * mp, void *handle)
1952 s = format (0, "SCRIPT: gre_tunnel_dump ");
1954 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1959 static void *vl_api_l2_fib_clear_table_t_print
1960 (vl_api_l2_fib_clear_table_t * mp, void *handle)
1964 s = format (0, "SCRIPT: l2_fib_clear_table ");
1969 static void *vl_api_l2_interface_efp_filter_t_print
1970 (vl_api_l2_interface_efp_filter_t * mp, void *handle)
1974 s = format (0, "SCRIPT: l2_interface_efp_filter ");
1976 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1977 if (mp->enable_disable)
1978 s = format (s, "enable ");
1980 s = format (s, "disable ");
1985 static void *vl_api_l2_interface_vlan_tag_rewrite_t_print
1986 (vl_api_l2_interface_vlan_tag_rewrite_t * mp, void *handle)
1990 s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
1992 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1993 s = format (s, "vtr_op %d ", ntohl (mp->vtr_op));
1994 s = format (s, "push_dot1q %d ", ntohl (mp->push_dot1q));
1995 s = format (s, "tag1 %d ", ntohl (mp->tag1));
1996 s = format (s, "tag2 %d ", ntohl (mp->tag2));
2001 static void *vl_api_create_vhost_user_if_t_print
2002 (vl_api_create_vhost_user_if_t * mp, void *handle)
2006 s = format (0, "SCRIPT: create_vhost_user_if ");
2008 s = format (s, "socket %s ", mp->sock_filename);
2010 s = format (s, "server ");
2012 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
2013 if (mp->disable_mrg_rxbuf)
2014 s = format (s, "disable_mrg_rxbuf ");
2015 if (mp->disable_indirect_desc)
2016 s = format (s, "disable_indirect_desc ");
2018 s = format (s, "tag %s", mp->tag);
2023 static void *vl_api_modify_vhost_user_if_t_print
2024 (vl_api_modify_vhost_user_if_t * mp, void *handle)
2028 s = format (0, "SCRIPT: modify_vhost_user_if ");
2030 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2031 s = format (s, "socket %s ", mp->sock_filename);
2033 s = format (s, "server ");
2035 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
2040 static void *vl_api_delete_vhost_user_if_t_print
2041 (vl_api_delete_vhost_user_if_t * mp, void *handle)
2045 s = format (0, "SCRIPT: delete_vhost_user_if ");
2046 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2051 static void *vl_api_sw_interface_vhost_user_dump_t_print
2052 (vl_api_sw_interface_vhost_user_dump_t * mp, void *handle)
2056 s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
2061 static void *vl_api_sw_interface_dump_t_print
2062 (vl_api_sw_interface_dump_t * mp, void *handle)
2066 s = format (0, "SCRIPT: sw_interface_dump ");
2068 if (mp->name_filter_valid)
2069 s = format (s, "name_filter %s ", mp->name_filter);
2071 s = format (s, "all ");
2076 static void *vl_api_l2_fib_table_dump_t_print
2077 (vl_api_l2_fib_table_dump_t * mp, void *handle)
2081 s = format (0, "SCRIPT: l2_fib_table_dump ");
2083 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
2088 static void *vl_api_control_ping_t_print
2089 (vl_api_control_ping_t * mp, void *handle)
2093 s = format (0, "SCRIPT: control_ping ");
2098 static void *vl_api_want_interface_events_t_print
2099 (vl_api_want_interface_events_t * mp, void *handle)
2103 s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
2104 ntohl (mp->pid), ntohl (mp->enable_disable));
2110 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
2114 s = format (0, "SCRIPT: cli ");
2119 static void *vl_api_cli_inband_t_print
2120 (vl_api_cli_inband_t * mp, void *handle)
2124 u32 length = vl_api_string_len (&mp->cmd);
2126 vec_validate (cmd, length);
2127 clib_memcpy (cmd, vl_api_from_api_string (&mp->cmd), length);
2129 s = format (0, "SCRIPT: exec %v ", cmd);
2135 static void *vl_api_memclnt_create_t_print
2136 (vl_api_memclnt_create_t * mp, void *handle)
2140 s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
2145 static void *vl_api_sockclnt_create_t_print
2146 (vl_api_sockclnt_create_t * mp, void *handle)
2150 s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name);
2155 static void *vl_api_show_version_t_print
2156 (vl_api_show_version_t * mp, void *handle)
2160 s = format (0, "SCRIPT: show_version ");
2166 static void *vl_api_show_threads_t_print
2167 (vl_api_show_threads_t * mp, void *handle)
2171 s = format (0, "SCRIPT: show_threads ");
2176 static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
2177 (vl_api_vxlan_gpe_add_del_tunnel_t * mp, void *handle)
2181 s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
2183 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local);
2184 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote);
2186 u8 is_grp = ip46_address_is_multicast (&remote);
2187 char *remote_name = is_grp ? "group" : "remote";
2189 s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
2190 s = format (s, "%s %U ", remote_name, format_ip46_address,
2191 &remote, IP46_TYPE_ANY);
2194 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
2195 s = format (s, "protocol %d ", ntohl (mp->protocol));
2197 s = format (s, "vni %d ", ntohl (mp->vni));
2199 if (mp->is_add == 0)
2200 s = format (s, "del ");
2202 if (mp->encap_vrf_id)
2203 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
2205 if (mp->decap_vrf_id)
2206 s = format (s, "decap-vrf-id %d ", ntohl (mp->decap_vrf_id));
2211 static void *vl_api_vxlan_gpe_tunnel_dump_t_print
2212 (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
2216 s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
2218 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2223 static void *vl_api_interface_name_renumber_t_print
2224 (vl_api_interface_name_renumber_t * mp, void *handle)
2228 s = format (0, "SCRIPT: interface_renumber ");
2230 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2232 s = format (s, "new_show_dev_instance %d ",
2233 ntohl (mp->new_show_dev_instance));
2238 static void *vl_api_ip_probe_neighbor_t_print
2239 (vl_api_ip_probe_neighbor_t * mp, void *handle)
2243 s = format (0, "SCRIPT: ip_probe_neighbor ");
2244 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2245 s = format (s, "address %U ", format_vl_api_address, &mp->dst);
2250 static void *vl_api_ip_scan_neighbor_enable_disable_t_print
2251 (vl_api_ip_scan_neighbor_enable_disable_t * mp, void *handle)
2255 s = format (0, "SCRIPT: ip_scan_neighbor_enable_disable ");
2259 case IP_SCAN_V4_NEIGHBORS:
2260 s = format (s, "ip4 ");
2262 case IP_SCAN_V6_NEIGHBORS:
2263 s = format (s, "ip6 ");
2265 case IP_SCAN_V46_NEIGHBORS:
2266 s = format (s, "both ");
2269 s = format (s, "disable ");
2272 s = format (s, "interval %d ", mp->scan_interval);
2273 s = format (s, "max-time %d ", mp->max_proc_time);
2274 s = format (s, "max-update %d ", mp->max_update);
2275 s = format (s, "delay %d ", mp->scan_int_delay);
2276 s = format (s, "stale %d ", mp->stale_threshold);
2281 static void *vl_api_want_ip4_arp_events_t_print
2282 (vl_api_want_ip4_arp_events_t * mp, void *handle)
2286 s = format (0, "SCRIPT: want_ip4_arp_events ");
2287 s = format (s, "pid %d address %U ", ntohl (mp->pid),
2288 format_ip4_address, mp->ip);
2289 if (mp->enable_disable == 0)
2290 s = format (s, "del ");
2295 static void *vl_api_want_ip6_nd_events_t_print
2296 (vl_api_want_ip6_nd_events_t * mp, void *handle)
2300 s = format (0, "SCRIPT: want_ip6_nd_events ");
2301 s = format (s, "pid %d address %U ", ntohl (mp->pid),
2302 format_vl_api_ip6_address, mp->ip);
2303 if (mp->enable_disable == 0)
2304 s = format (s, "del ");
2309 static void *vl_api_want_l2_macs_events_t_print
2310 (vl_api_want_l2_macs_events_t * mp, void *handle)
2314 s = format (0, "SCRIPT: want_l2_macs_events ");
2315 s = format (s, "learn-limit %d ", ntohl (mp->learn_limit));
2316 s = format (s, "scan-delay %d ", (u32) mp->scan_delay);
2317 s = format (s, "max-entries %d ", (u32) mp->max_macs_in_event * 10);
2318 if (mp->enable_disable == 0)
2319 s = format (s, "disable");
2324 static void *vl_api_input_acl_set_interface_t_print
2325 (vl_api_input_acl_set_interface_t * mp, void *handle)
2329 s = format (0, "SCRIPT: input_acl_set_interface ");
2331 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2332 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2333 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2334 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2336 if (mp->is_add == 0)
2337 s = format (s, "del ");
2342 static void *vl_api_output_acl_set_interface_t_print
2343 (vl_api_output_acl_set_interface_t * mp, void *handle)
2347 s = format (0, "SCRIPT: output_acl_set_interface ");
2349 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2350 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2351 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2352 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2354 if (mp->is_add == 0)
2355 s = format (s, "del ");
2360 static void *vl_api_ip_address_dump_t_print
2361 (vl_api_ip_address_dump_t * mp, void *handle)
2365 s = format (0, "SCRIPT: ip6_address_dump ");
2366 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2367 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2373 vl_api_ip_dump_t_print (vl_api_ip_dump_t * mp, void *handle)
2377 s = format (0, "SCRIPT: ip_dump ");
2378 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2383 static void *vl_api_cop_interface_enable_disable_t_print
2384 (vl_api_cop_interface_enable_disable_t * mp, void *handle)
2388 s = format (0, "SCRIPT: cop_interface_enable_disable ");
2389 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2390 if (mp->enable_disable)
2391 s = format (s, "enable ");
2393 s = format (s, "disable ");
2398 static void *vl_api_cop_whitelist_enable_disable_t_print
2399 (vl_api_cop_whitelist_enable_disable_t * mp, void *handle)
2403 s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
2404 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2405 s = format (s, "fib-id %d ", ntohl (mp->fib_id));
2407 s = format (s, "ip4 ");
2409 s = format (s, "ip6 ");
2410 if (mp->default_cop)
2411 s = format (s, "default ");
2416 static void *vl_api_af_packet_create_t_print
2417 (vl_api_af_packet_create_t * mp, void *handle)
2421 s = format (0, "SCRIPT: af_packet_create ");
2422 s = format (s, "host_if_name %s ", mp->host_if_name);
2423 if (mp->use_random_hw_addr)
2424 s = format (s, "hw_addr random ");
2426 s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
2431 static void *vl_api_af_packet_delete_t_print
2432 (vl_api_af_packet_delete_t * mp, void *handle)
2436 s = format (0, "SCRIPT: af_packet_delete ");
2437 s = format (s, "host_if_name %s ", mp->host_if_name);
2442 static void *vl_api_af_packet_dump_t_print
2443 (vl_api_af_packet_dump_t * mp, void *handle)
2447 s = format (0, "SCRIPT: af_packet_dump ");
2453 format_policer_action (u8 * s, va_list * va)
2455 u32 action = va_arg (*va, u32);
2456 u32 dscp = va_arg (*va, u32);
2459 if (action == SSE2_QOS_ACTION_DROP)
2460 s = format (s, "drop");
2461 else if (action == SSE2_QOS_ACTION_TRANSMIT)
2462 s = format (s, "transmit");
2463 else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
2465 s = format (s, "mark-and-transmit ");
2468 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
2474 s = format (s, "%s", t);
2479 static void *vl_api_policer_add_del_t_print
2480 (vl_api_policer_add_del_t * mp, void *handle)
2484 s = format (0, "SCRIPT: policer_add_del ");
2485 s = format (s, "name %s ", mp->name);
2486 s = format (s, "cir %d ", mp->cir);
2487 s = format (s, "eir %d ", mp->eir);
2488 s = format (s, "cb %d ", mp->cb);
2489 s = format (s, "eb %d ", mp->eb);
2491 switch (mp->rate_type)
2493 case SSE2_QOS_RATE_KBPS:
2494 s = format (s, "rate_type kbps ");
2496 case SSE2_QOS_RATE_PPS:
2497 s = format (s, "rate_type pps ");
2503 switch (mp->round_type)
2505 case SSE2_QOS_ROUND_TO_CLOSEST:
2506 s = format (s, "round_type closest ");
2508 case SSE2_QOS_ROUND_TO_UP:
2509 s = format (s, "round_type up ");
2511 case SSE2_QOS_ROUND_TO_DOWN:
2512 s = format (s, "round_type down ");
2520 case SSE2_QOS_POLICER_TYPE_1R2C:
2521 s = format (s, "type 1r2c ");
2523 case SSE2_QOS_POLICER_TYPE_1R3C_RFC_2697:
2524 s = format (s, "type 1r3c ");
2526 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_2698:
2527 s = format (s, "type 2r3c-2698 ");
2529 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_4115:
2530 s = format (s, "type 2r3c-4115 ");
2532 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1:
2533 s = format (s, "type 2r3c-mef5cf1 ");
2539 s = format (s, "conform_action %U ", format_policer_action,
2540 mp->conform_action_type, mp->conform_dscp);
2541 s = format (s, "exceed_action %U ", format_policer_action,
2542 mp->exceed_action_type, mp->exceed_dscp);
2543 s = format (s, "violate_action %U ", format_policer_action,
2544 mp->violate_action_type, mp->violate_dscp);
2546 if (mp->color_aware)
2547 s = format (s, "color-aware ");
2548 if (mp->is_add == 0)
2549 s = format (s, "del ");
2554 static void *vl_api_policer_dump_t_print
2555 (vl_api_policer_dump_t * mp, void *handle)
2559 s = format (0, "SCRIPT: policer_dump ");
2560 if (mp->match_name_valid)
2561 s = format (s, "name %s ", mp->match_name);
2566 static void *vl_api_policer_classify_set_interface_t_print
2567 (vl_api_policer_classify_set_interface_t * mp, void *handle)
2571 s = format (0, "SCRIPT: policer_classify_set_interface ");
2572 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2573 if (mp->ip4_table_index != ~0)
2574 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2575 if (mp->ip6_table_index != ~0)
2576 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2577 if (mp->l2_table_index != ~0)
2578 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2579 if (mp->is_add == 0)
2580 s = format (s, "del ");
2585 static void *vl_api_policer_classify_dump_t_print
2586 (vl_api_policer_classify_dump_t * mp, void *handle)
2590 s = format (0, "SCRIPT: policer_classify_dump ");
2593 case POLICER_CLASSIFY_TABLE_IP4:
2594 s = format (s, "type ip4 ");
2596 case POLICER_CLASSIFY_TABLE_IP6:
2597 s = format (s, "type ip6 ");
2599 case POLICER_CLASSIFY_TABLE_L2:
2600 s = format (s, "type l2 ");
2609 static void *vl_api_sw_interface_clear_stats_t_print
2610 (vl_api_sw_interface_clear_stats_t * mp, void *handle)
2614 s = format (0, "SCRIPT: sw_interface_clear_stats ");
2615 if (mp->sw_if_index != ~0)
2616 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2621 static void *vl_api_mpls_tunnel_dump_t_print
2622 (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2626 s = format (0, "SCRIPT: mpls_tunnel_dump ");
2628 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2633 static void *vl_api_mpls_fib_dump_t_print
2634 (vl_api_mpls_fib_dump_t * mp, void *handle)
2638 s = format (0, "SCRIPT: mpls_fib_decap_dump ");
2643 static void *vl_api_ip_fib_dump_t_print
2644 (vl_api_ip_fib_dump_t * mp, void *handle)
2648 s = format (0, "SCRIPT: ip_fib_dump ");
2653 static void *vl_api_ip6_fib_dump_t_print
2654 (vl_api_ip6_fib_dump_t * mp, void *handle)
2658 s = format (0, "SCRIPT: ip6_fib_dump ");
2663 static void *vl_api_classify_table_ids_t_print
2664 (vl_api_classify_table_ids_t * mp, void *handle)
2668 s = format (0, "SCRIPT: classify_table_ids ");
2673 static void *vl_api_classify_table_by_interface_t_print
2674 (vl_api_classify_table_by_interface_t * mp, void *handle)
2678 s = format (0, "SCRIPT: classify_table_by_interface ");
2679 if (mp->sw_if_index != ~0)
2680 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2685 static void *vl_api_classify_table_info_t_print
2686 (vl_api_classify_table_info_t * mp, void *handle)
2690 s = format (0, "SCRIPT: classify_table_info ");
2691 if (mp->table_id != ~0)
2692 s = format (s, "table_id %d ", ntohl (mp->table_id));
2697 static void *vl_api_classify_session_dump_t_print
2698 (vl_api_classify_session_dump_t * mp, void *handle)
2702 s = format (0, "SCRIPT: classify_session_dump ");
2703 if (mp->table_id != ~0)
2704 s = format (s, "table_id %d ", ntohl (mp->table_id));
2709 static void *vl_api_set_ipfix_exporter_t_print
2710 (vl_api_set_ipfix_exporter_t * mp, void *handle)
2714 s = format (0, "SCRIPT: set_ipfix_exporter ");
2716 s = format (s, "collector-address %U ", format_ip4_address,
2717 (ip4_address_t *) mp->collector_address);
2718 s = format (s, "collector-port %d ", ntohs (mp->collector_port));
2719 s = format (s, "src-address %U ", format_ip4_address,
2720 (ip4_address_t *) mp->src_address);
2721 s = format (s, "vrf-id %d ", ntohl (mp->vrf_id));
2722 s = format (s, "path-mtu %d ", ntohl (mp->path_mtu));
2723 s = format (s, "template-interval %d ", ntohl (mp->template_interval));
2724 s = format (s, "udp-checksum %d ", mp->udp_checksum);
2729 static void *vl_api_ipfix_exporter_dump_t_print
2730 (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2734 s = format (0, "SCRIPT: ipfix_exporter_dump ");
2739 static void *vl_api_set_ipfix_classify_stream_t_print
2740 (vl_api_set_ipfix_classify_stream_t * mp, void *handle)
2744 s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2746 s = format (s, "domain-id %d ", ntohl (mp->domain_id));
2747 s = format (s, "src-port %d ", ntohs (mp->src_port));
2752 static void *vl_api_ipfix_classify_stream_dump_t_print
2753 (vl_api_ipfix_classify_stream_dump_t * mp, void *handle)
2757 s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2762 static void *vl_api_ipfix_classify_table_add_del_t_print
2763 (vl_api_ipfix_classify_table_add_del_t * mp, void *handle)
2767 s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2769 s = format (s, "table-id %d ", ntohl (mp->table_id));
2770 s = format (s, "ip-version %d ", mp->ip_version);
2771 s = format (s, "transport-protocol %d ", mp->transport_protocol);
2776 static void *vl_api_ipfix_classify_table_dump_t_print
2777 (vl_api_ipfix_classify_table_dump_t * mp, void *handle)
2781 s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2786 static void *vl_api_sw_interface_span_enable_disable_t_print
2787 (vl_api_sw_interface_span_enable_disable_t * mp, void *handle)
2791 s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2792 s = format (s, "src_sw_if_index %u ", ntohl (mp->sw_if_index_from));
2793 s = format (s, "dst_sw_if_index %u ", ntohl (mp->sw_if_index_to));
2796 s = format (s, "l2 ");
2801 s = format (s, "disable ");
2804 s = format (s, "rx ");
2807 s = format (s, "tx ");
2811 s = format (s, "both ");
2819 vl_api_sw_interface_span_dump_t_print (vl_api_sw_interface_span_dump_t * mp,
2824 s = format (0, "SCRIPT: sw_interface_span_dump ");
2827 s = format (s, "l2 ");
2832 static void *vl_api_get_next_index_t_print
2833 (vl_api_get_next_index_t * mp, void *handle)
2837 s = format (0, "SCRIPT: get_next_index ");
2838 s = format (s, "node-name %s ", mp->node_name);
2839 s = format (s, "next-node-name %s ", mp->next_name);
2844 static void *vl_api_pg_create_interface_t_print
2845 (vl_api_pg_create_interface_t * mp, void *handle)
2849 s = format (0, "SCRIPT: pg_create_interface ");
2850 s = format (0, "if_id %d", ntohl (mp->interface_id));
2855 static void *vl_api_pg_capture_t_print
2856 (vl_api_pg_capture_t * mp, void *handle)
2860 s = format (0, "SCRIPT: pg_capture ");
2861 s = format (0, "if_id %d ", ntohl (mp->interface_id));
2862 s = format (0, "pcap %s", mp->pcap_file_name);
2863 if (mp->count != ~0)
2864 s = format (s, "count %d ", ntohl (mp->count));
2865 if (!mp->is_enabled)
2866 s = format (s, "disable");
2871 static void *vl_api_pg_enable_disable_t_print
2872 (vl_api_pg_enable_disable_t * mp, void *handle)
2876 s = format (0, "SCRIPT: pg_enable_disable ");
2877 if (ntohl (mp->stream_name_length) > 0)
2878 s = format (s, "stream %s", mp->stream_name);
2879 if (!mp->is_enabled)
2880 s = format (s, "disable");
2885 static void *vl_api_ip_source_and_port_range_check_add_del_t_print
2886 (vl_api_ip_source_and_port_range_check_add_del_t * mp, void *handle)
2891 s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2892 s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
2894 for (i = 0; i < mp->number_of_ranges; i++)
2896 s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2899 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
2901 if (mp->is_add == 0)
2902 s = format (s, "del ");
2907 static void *vl_api_ip_source_and_port_range_check_interface_add_del_t_print
2908 (vl_api_ip_source_and_port_range_check_interface_add_del_t * mp,
2913 s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2915 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2917 if (mp->tcp_out_vrf_id != ~0)
2918 s = format (s, "tcp-out-vrf %d ", ntohl (mp->tcp_out_vrf_id));
2920 if (mp->udp_out_vrf_id != ~0)
2921 s = format (s, "udp-out-vrf %d ", ntohl (mp->udp_out_vrf_id));
2923 if (mp->tcp_in_vrf_id != ~0)
2924 s = format (s, "tcp-in-vrf %d ", ntohl (mp->tcp_in_vrf_id));
2926 if (mp->udp_in_vrf_id != ~0)
2927 s = format (s, "udp-in-vrf %d ", ntohl (mp->udp_in_vrf_id));
2929 if (mp->is_add == 0)
2930 s = format (s, "del ");
2935 static void *vl_api_lisp_enable_disable_t_print
2936 (vl_api_lisp_enable_disable_t * mp, void *handle)
2940 s = format (0, "SCRIPT: lisp_enable_disable %s",
2941 mp->is_en ? "enable" : "disable");
2946 static void *vl_api_gpe_add_del_iface_t_print
2947 (vl_api_gpe_add_del_iface_t * mp, void *handle)
2951 s = format (0, "SCRIPT: gpe_add_del_iface ");
2953 s = format (s, "%s ", mp->is_add ? "up" : "down");
2954 s = format (s, "vni %d ", mp->vni);
2955 s = format (s, "%s %d ", mp->is_l2 ? "bd_id" : "table_id", mp->dp_table);
2960 static void *vl_api_lisp_pitr_set_locator_set_t_print
2961 (vl_api_lisp_pitr_set_locator_set_t * mp, void *handle)
2965 s = format (0, "SCRIPT: lisp_pitr_set_locator_set ");
2968 s = format (s, "locator-set %s ", mp->ls_name);
2970 s = format (s, "del");
2976 format_lisp_flat_eid (u8 * s, va_list * args)
2978 u32 type = va_arg (*args, u32);
2979 u8 *eid = va_arg (*args, u8 *);
2980 u32 eid_len = va_arg (*args, u32);
2985 return format (s, "%U/%d", format_ip4_address, eid, eid_len);
2987 return format (s, "%U/%d", format_ip6_address, eid, eid_len);
2989 return format (s, "%U", format_ethernet_address, eid);
2994 static void *vl_api_lisp_add_del_remote_mapping_t_print
2995 (vl_api_lisp_add_del_remote_mapping_t * mp, void *handle)
3000 s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
3003 s = format (s, "del-all ");
3005 s = format (s, "%s ", mp->is_add ? "add" : "del");
3006 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3008 s = format (s, "eid %U ", format_lisp_flat_eid,
3009 mp->eid_type, mp->eid, mp->eid_len);
3013 s = format (s, "seid %U ", format_lisp_flat_eid,
3014 mp->eid_type, mp->seid, mp->seid_len);
3016 rloc_num = clib_net_to_host_u32 (mp->rloc_num);
3019 s = format (s, "action %d", mp->action);
3024 static void *vl_api_lisp_add_del_adjacency_t_print
3025 (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
3029 s = format (0, "SCRIPT: lisp_add_del_adjacency ");
3031 s = format (s, "%s ", mp->is_add ? "add" : "del");
3032 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3033 s = format (s, "reid %U leid %U ",
3034 format_lisp_flat_eid, mp->eid_type, mp->reid, mp->reid_len,
3035 format_lisp_flat_eid, mp->eid_type, mp->leid, mp->leid_len);
3040 static void *vl_api_lisp_add_del_map_request_itr_rlocs_t_print
3041 (vl_api_lisp_add_del_map_request_itr_rlocs_t * mp, void *handle)
3045 s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
3048 s = format (s, "%s", mp->locator_set_name);
3050 s = format (s, "del");
3055 static void *vl_api_lisp_eid_table_add_del_map_t_print
3056 (vl_api_lisp_eid_table_add_del_map_t * mp, void *handle)
3060 s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
3063 s = format (s, "del ");
3065 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3066 s = format (s, "%s %d ",
3067 mp->is_l2 ? "bd_index" : "vrf",
3068 clib_net_to_host_u32 (mp->dp_table));
3072 static void *vl_api_lisp_add_del_local_eid_t_print
3073 (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
3077 s = format (0, "SCRIPT: lisp_add_del_local_eid ");
3080 s = format (s, "del ");
3082 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3083 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
3085 s = format (s, "locator-set %s ", mp->locator_set_name);
3088 u32 key_id = mp->key_id;
3089 s = format (s, "key-id %U", format_hmac_key_id, key_id);
3090 s = format (s, "secret-key %s", mp->key);
3095 static void *vl_api_gpe_add_del_fwd_entry_t_print
3096 (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle)
3100 s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO");
3105 static void *vl_api_lisp_add_del_map_resolver_t_print
3106 (vl_api_lisp_add_del_map_resolver_t * mp, void *handle)
3110 s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
3113 s = format (s, "del ");
3116 s = format (s, "%U ", format_ip6_address, mp->ip_address);
3118 s = format (s, "%U ", format_ip4_address, mp->ip_address);
3123 static void *vl_api_gpe_enable_disable_t_print
3124 (vl_api_gpe_enable_disable_t * mp, void *handle)
3128 s = format (0, "SCRIPT: gpe_enable_disable ");
3130 s = format (s, "%s ", mp->is_en ? "enable" : "disable");
3135 static void *vl_api_lisp_add_del_locator_set_t_print
3136 (vl_api_lisp_add_del_locator_set_t * mp, void *handle)
3140 s = format (0, "SCRIPT: lisp_add_del_locator_set ");
3143 s = format (s, "del ");
3145 s = format (s, "locator-set %s ", mp->locator_set_name);
3150 static void *vl_api_lisp_add_del_locator_t_print
3151 (vl_api_lisp_add_del_locator_t * mp, void *handle)
3155 s = format (0, "SCRIPT: lisp_add_del_locator ");
3158 s = format (s, "del ");
3160 s = format (s, "locator-set %s ", mp->locator_set_name);
3161 s = format (s, "sw_if_index %d ", mp->sw_if_index);
3162 s = format (s, "p %d w %d ", mp->priority, mp->weight);
3167 static void *vl_api_lisp_locator_set_dump_t_print
3168 (vl_api_lisp_locator_set_dump_t * mp, void *handle)
3172 s = format (0, "SCRIPT: lisp_locator_set_dump ");
3173 if (mp->filter == 1)
3174 s = format (s, "local");
3175 else if (mp->filter == 2)
3176 s = format (s, "remote");
3181 static void *vl_api_lisp_locator_dump_t_print
3182 (vl_api_lisp_locator_dump_t * mp, void *handle)
3186 s = format (0, "SCRIPT: lisp_locator_dump ");
3187 if (mp->is_index_set)
3188 s = format (s, "ls_index %d", clib_net_to_host_u32 (mp->ls_index));
3190 s = format (s, "ls_name %s", mp->ls_name);
3195 static void *vl_api_lisp_map_request_mode_t_print
3196 (vl_api_lisp_map_request_mode_t * mp, void *handle)
3200 s = format (0, "SCRIPT: lisp_map_request_mode ");
3205 s = format (s, "dst-only");
3208 s = format (s, "src-dst");
3216 static void *vl_api_lisp_eid_table_dump_t_print
3217 (vl_api_lisp_eid_table_dump_t * mp, void *handle)
3221 s = format (0, "SCRIPT: lisp_eid_table_dump ");
3225 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3226 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type,
3227 mp->eid, mp->prefix_length);
3231 s = format (s, "local ");
3234 s = format (s, "remote ");
3241 static void *vl_api_lisp_rloc_probe_enable_disable_t_print
3242 (vl_api_lisp_rloc_probe_enable_disable_t * mp, void *handle)
3246 s = format (0, "SCRIPT: lisp_rloc_probe_enable_disable ");
3248 s = format (s, "enable");
3250 s = format (s, "disable");
3255 static void *vl_api_lisp_map_register_enable_disable_t_print
3256 (vl_api_lisp_map_register_enable_disable_t * mp, void *handle)
3260 s = format (0, "SCRIPT: lisp_map_register_enable_disable ");
3262 s = format (s, "enable");
3264 s = format (s, "disable");
3269 static void *vl_api_lisp_adjacencies_get_t_print
3270 (vl_api_lisp_adjacencies_get_t * mp, void *handle)
3274 s = format (0, "SCRIPT: lisp_adjacencies_get ");
3275 s = format (s, "vni %d", clib_net_to_host_u32 (mp->vni));
3280 static void *vl_api_lisp_eid_table_map_dump_t_print
3281 (vl_api_lisp_eid_table_map_dump_t * mp, void *handle)
3285 s = format (0, "SCRIPT: lisp_eid_table_map_dump ");
3288 s = format (s, "l2");
3290 s = format (s, "l3");
3295 static void *vl_api_ipsec_tunnel_if_add_del_t_print
3296 (vl_api_ipsec_tunnel_if_add_del_t * mp, void *handle)
3300 s = format (0, "SCRIPT: ipsec_tunnel_if_add_del ");
3303 s = format (s, "esn");
3304 if (mp->anti_replay)
3305 s = format (s, "anti-replay");
3307 s = format (s, "udp-encap");
3309 s = format (s, "local-ip %U ", format_vl_api_address, &mp->remote_ip);
3311 s = format (s, "remote-ip %U ", format_vl_api_address, &mp->local_ip);
3312 s = format (s, "tx-table-id %d ", ntohl (mp->tx_table_id));
3314 s = format (s, "local-spi %d ", ntohl (mp->local_spi));
3316 s = format (s, "remote-spi %d ", ntohl (mp->remote_spi));
3318 s = format (s, "local-crypto-key-len %d ", mp->local_crypto_key_len);
3319 s = format (s, "local-crypto-key %U ", format_hex_bytes,
3320 mp->local_crypto_key, mp->local_crypto_key_len, 0);
3321 s = format (s, "remote-crypto-key-len %d ", mp->remote_crypto_key_len);
3322 s = format (s, "remote-crypto-key %U ", format_hex_bytes,
3323 mp->remote_crypto_key, mp->remote_crypto_key_len, 0);
3324 s = format (s, "local-integ-key-len %d ", mp->local_integ_key_len);
3325 s = format (s, "local-integ-key %U ", format_hex_bytes,
3326 mp->local_integ_key, mp->local_integ_key_len, 0);
3327 s = format (s, "remote-integ-key-len %d ", mp->remote_integ_key_len);
3328 s = format (s, "remote-integ-key %U ", format_hex_bytes,
3329 mp->remote_integ_key, mp->remote_integ_key_len, 0);
3331 if (mp->is_add == 0)
3332 s = format (s, "del ");
3337 static void *vl_api_ipsec_gre_tunnel_add_del_t_print
3338 (vl_api_ipsec_gre_tunnel_add_del_t * mp, void *handle)
3342 s = format (0, "SCRIPT: ipsec_gre_tunnel_add_del ");
3344 s = format (s, "dst %U ", format_vl_api_ip4_address, mp->tunnel.dst);
3346 s = format (s, "src %U ", format_vl_api_ip4_address, mp->tunnel.src);
3348 s = format (s, "local_sa %d ", ntohl (mp->tunnel.local_sa_id));
3350 s = format (s, "remote_sa %d ", ntohl (mp->tunnel.remote_sa_id));
3352 if (mp->is_add == 0)
3353 s = format (s, "del ");
3358 static void *vl_api_ipsec_gre_tunnel_dump_t_print
3359 (vl_api_ipsec_gre_tunnel_dump_t * mp, void *handle)
3363 s = format (0, "SCRIPT: ipsec_gre_tunnel_dump ");
3365 if (mp->sw_if_index != ~0)
3366 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3371 static void *vl_api_l2_interface_pbb_tag_rewrite_t_print
3372 (vl_api_l2_interface_pbb_tag_rewrite_t * mp, void *handle)
3375 u32 vtr_op = ntohl (mp->vtr_op);
3377 s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
3379 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3380 s = format (s, "vtr_op %d ", vtr_op);
3381 if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
3383 if (vtr_op == L2_VTR_TRANSLATE_2_2)
3384 s = format (s, "%d ", ntohs (mp->outer_tag));
3385 s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
3386 s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
3387 s = format (s, "sid %d ", ntohl (mp->i_sid));
3388 s = format (s, "vlanid %d ", ntohs (mp->b_vlanid));
3393 static void *vl_api_flow_classify_set_interface_t_print
3394 (vl_api_flow_classify_set_interface_t * mp, void *handle)
3398 s = format (0, "SCRIPT: flow_classify_set_interface ");
3399 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3400 if (mp->ip4_table_index != ~0)
3401 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
3402 if (mp->ip6_table_index != ~0)
3403 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
3404 if (mp->is_add == 0)
3405 s = format (s, "del ");
3411 vl_api_set_punt_t_print (vl_api_set_punt_t * mp, void *handle)
3415 s = format (0, "SCRIPT: punt ");
3417 switch (clib_net_to_host_u32 (mp->punt.type))
3419 case PUNT_API_TYPE_L4:
3420 s = format (s, "%U", format_vl_api_address_family, mp->punt.punt.l4.af);
3422 s = format (s, "protocol %d ", mp->punt.punt.l4.protocol);
3424 if (mp->punt.punt.l4.port != (u16) ~ 0)
3425 s = format (s, "port %d ", ntohs (mp->punt.punt.l4.port));
3430 s = format (s, "del ");
3435 static void *vl_api_flow_classify_dump_t_print
3436 (vl_api_flow_classify_dump_t * mp, void *handle)
3440 s = format (0, "SCRIPT: flow_classify_dump ");
3443 case FLOW_CLASSIFY_TABLE_IP4:
3444 s = format (s, "type ip4 ");
3446 case FLOW_CLASSIFY_TABLE_IP6:
3447 s = format (s, "type ip6 ");
3456 static void *vl_api_get_first_msg_id_t_print
3457 (vl_api_get_first_msg_id_t * mp, void *handle)
3461 s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
3466 static void *vl_api_ioam_enable_t_print
3467 (vl_api_ioam_enable_t * mp, void *handle)
3471 s = format (0, "SCRIPT: ioam_enable ");
3473 if (mp->trace_enable)
3474 s = format (s, "trace enabled");
3477 s = format (s, "POT enabled");
3480 s = format (s, "Seqno enabled");
3483 s = format (s, "Analyse enabled");
3488 static void *vl_api_ioam_disable_t_print
3489 (vl_api_ioam_disable_t * mp, void *handle)
3493 s = format (0, "SCRIPT: ioam_disable ");
3494 s = format (s, "trace disabled");
3495 s = format (s, "POT disabled");
3496 s = format (s, "Seqno disabled");
3497 s = format (s, "Analyse disabled");
3502 static void *vl_api_feature_enable_disable_t_print
3503 (vl_api_feature_enable_disable_t * mp, void *handle)
3507 s = format (0, "SCRIPT: feature_enable_disable ");
3508 s = format (s, "arc_name %s ", mp->arc_name);
3509 s = format (s, "feature_name %s ", mp->feature_name);
3510 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3512 s = format (s, "disable");
3517 static void *vl_api_sw_interface_tag_add_del_t_print
3518 (vl_api_sw_interface_tag_add_del_t * mp, void *handle)
3522 s = format (0, "SCRIPT: sw_interface_tag_add_del ");
3523 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3525 s = format (s, "tag %s ", mp->tag);
3527 s = format (s, "del ");
3532 static void *vl_api_hw_interface_set_mtu_t_print
3533 (vl_api_hw_interface_set_mtu_t * mp, void *handle)
3537 s = format (0, "SCRIPT: sw_interface_set_mtu ");
3538 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3539 s = format (s, "tag %d ", ntohs (mp->mtu));
3544 static void *vl_api_p2p_ethernet_add_t_print
3545 (vl_api_p2p_ethernet_add_t * mp, void *handle)
3549 s = format (0, "SCRIPT: p2p_ethernet_add ");
3550 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3551 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3556 static void *vl_api_p2p_ethernet_del_t_print
3557 (vl_api_p2p_ethernet_del_t * mp, void *handle)
3561 s = format (0, "SCRIPT: p2p_ethernet_del ");
3562 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3563 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3568 static void *vl_api_tcp_configure_src_addresses_t_print
3569 (vl_api_tcp_configure_src_addresses_t * mp, void *handle)
3573 s = format (0, "SCRIPT: tcp_configure_src_addresses ");
3575 s = format (s, "%U - %U ",
3576 format_ip6_address, (ip6_address_t *) mp->first_address,
3577 format_ip6_address, (ip6_address_t *) mp->last_address);
3579 s = format (s, "%U - %U ",
3580 format_ip4_address, (ip4_address_t *) mp->first_address,
3581 format_ip4_address, (ip4_address_t *) mp->last_address);
3584 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
3589 static void *vl_api_app_namespace_add_del_t_print
3590 (vl_api_app_namespace_add_del_t * mp, void *handle)
3593 u8 len = clib_min (mp->namespace_id_len,
3594 ARRAY_LEN (mp->namespace_id) - 1);
3595 mp->namespace_id[len] = 0;
3596 s = format (0, "SCRIPT: app_namespace_add_del ");
3597 s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d "
3598 "ipv6_fib_id %d", (char *) mp->namespace_id, mp->secret,
3599 clib_net_to_host_u32 (mp->sw_if_index),
3600 clib_net_to_host_u32 (mp->ip4_fib_id),
3601 clib_net_to_host_u32 (mp->ip6_fib_id));
3605 static void *vl_api_lldp_config_t_print
3606 (vl_api_lldp_config_t * mp, void *handle)
3610 s = format (0, "SCRIPT: lldp_config ");
3611 s = format (s, "system_name %s ", mp->system_name);
3612 s = format (s, "tx_hold %d ", ntohl (mp->tx_hold));
3613 s = format (s, "tx_interval %d ", ntohl (mp->tx_interval));
3617 static void *vl_api_dns_enable_disable_t_print
3618 (vl_api_dns_enable_disable_t * mp, void *handle)
3622 s = format (0, "SCRIPT: dns_enable_disable ");
3623 s = format (s, "%s ", mp->enable ? "enable" : "disable");
3628 static void *vl_api_sw_interface_set_lldp_t_print
3629 (vl_api_sw_interface_set_lldp_t * mp, void *handle)
3634 clib_memset (null_data, 0, sizeof (null_data));
3636 s = format (0, "SCRIPT: sw_interface_set_lldp ");
3637 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3639 if (memcmp (mp->port_desc, null_data, sizeof (mp->port_desc)))
3640 s = format (s, "port_desc %s ", mp->port_desc);
3642 if (memcmp (mp->mgmt_ip4, null_data, sizeof (mp->mgmt_ip4)))
3643 s = format (s, "mgmt_ip4 %U ", format_ip4_address, mp->mgmt_ip4);
3645 if (memcmp (mp->mgmt_ip6, null_data, sizeof (mp->mgmt_ip6)))
3646 s = format (s, "mgmt_ip6 %U ", format_ip6_address, mp->mgmt_ip6);
3648 if (memcmp (mp->mgmt_oid, null_data, sizeof (mp->mgmt_oid)))
3649 s = format (s, "mgmt_oid %s ", mp->mgmt_oid);
3651 if (mp->enable == 0)
3652 s = format (s, "disable ");
3657 static void *vl_api_dns_name_server_add_del_t_print
3658 (vl_api_dns_name_server_add_del_t * mp, void *handle)
3662 s = format (0, "SCRIPT: dns_name_server_add_del ");
3664 s = format (s, "%U ", format_ip6_address,
3665 (ip6_address_t *) mp->server_address);
3667 s = format (s, "%U ", format_ip4_address,
3668 (ip4_address_t *) mp->server_address);
3670 if (mp->is_add == 0)
3671 s = format (s, "del ");
3676 static void *vl_api_dns_resolve_name_t_print
3677 (vl_api_dns_resolve_name_t * mp, void *handle)
3681 s = format (0, "SCRIPT: dns_resolve_name ");
3682 s = format (s, "%s ", mp->name);
3686 static void *vl_api_dns_resolve_ip_t_print
3687 (vl_api_dns_resolve_ip_t * mp, void *handle)
3691 s = format (0, "SCRIPT: dns_resolve_ip ");
3693 s = format (s, "%U ", format_ip6_address, mp->address);
3695 s = format (s, "%U ", format_ip4_address, mp->address);
3699 static void *vl_api_session_rule_add_del_t_print
3700 (vl_api_session_rule_add_del_t * mp, void *handle)
3703 char *proto = mp->transport_proto == 0 ? "tcp" : "udp";
3704 s = format (0, "SCRIPT: session_rule_add_del ");
3705 mp->tag[sizeof (mp->tag) - 1] = 0;
3707 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3708 mp->appns_index, mp->scope, proto, format_ip4_address,
3709 (ip4_address_t *) mp->lcl_ip, mp->lcl_plen,
3710 format_ip4_address, (ip4_address_t *) mp->rmt_ip,
3711 mp->rmt_plen, mp->action_index, mp->tag);
3713 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3714 mp->appns_index, mp->scope, proto, format_ip6_address,
3715 (ip6_address_t *) mp->lcl_ip, mp->lcl_plen,
3716 format_ip6_address, (ip6_address_t *) mp->rmt_ip,
3717 mp->rmt_plen, mp->action_index, mp->tag);
3722 static void *vl_api_ip_container_proxy_add_del_t_print
3723 (vl_api_ip_container_proxy_add_del_t * mp, void *handle)
3726 s = format (0, "SCRIPT: ip_container_proxy_add_del ");
3727 s = format (s, "is_add %d prefix %U sw_if_index %d",
3728 mp->is_add, format_vl_api_prefix, mp->sw_if_index);
3733 static void *vl_api_qos_record_enable_disable_t_print
3734 (vl_api_qos_record_enable_disable_t * mp, void *handle)
3738 s = format (0, "SCRIPT: qos_record_enable_disable ");
3739 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3740 s = format (s, "input_source %U ", format_qos_source,
3741 ntohl (mp->input_source));
3744 s = format (s, "disable ");
3749 #define foreach_custom_print_no_arg_function \
3750 _(lisp_eid_table_vni_dump) \
3751 _(lisp_map_resolver_dump) \
3752 _(lisp_map_server_dump) \
3753 _(show_lisp_rloc_probe_state) \
3754 _(show_lisp_map_register_state) \
3755 _(show_lisp_map_request_mode)
3758 static void * vl_api_ ## f ## _t_print \
3759 (vl_api_ ## f ## _t * mp, void * handle) \
3762 s = format (0, "SCRIPT: " #f ); \
3765 foreach_custom_print_no_arg_function
3767 #define foreach_custom_print_function \
3768 _(CREATE_LOOPBACK, create_loopback) \
3769 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
3770 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
3771 _(SW_INTERFACE_EVENT, sw_interface_event) \
3772 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
3773 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
3774 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
3775 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
3776 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
3777 _(SW_INTERFACE_SET_GENEVE_BYPASS, sw_interface_set_geneve_bypass) \
3778 _(BOND_CREATE, bond_create) \
3779 _(BOND_DELETE, bond_delete) \
3780 _(BOND_ENSLAVE, bond_enslave) \
3781 _(BOND_DETACH_SLAVE, bond_detach_slave) \
3782 _(TAP_CREATE_V2, tap_create_v2) \
3783 _(TAP_DELETE_V2, tap_delete_v2) \
3784 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) \
3785 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \
3786 _(IP_TABLE_ADD_DEL, ip_table_add_del) \
3787 _(MPLS_ROUTE_ADD_DEL, mpls_route_add_del) \
3788 _(MPLS_TABLE_ADD_DEL, mpls_table_add_del) \
3789 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
3790 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
3791 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3792 _(SR_MPLS_POLICY_ADD, sr_mpls_policy_add) \
3793 _(SR_MPLS_POLICY_DEL, sr_mpls_policy_del) \
3794 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3795 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
3796 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3797 _(CREATE_SUBIF, create_subif) \
3798 _(RESET_FIB, reset_fib) \
3799 _(DHCP_PROXY_CONFIG, dhcp_proxy_config) \
3800 _(DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss) \
3801 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3802 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \
3803 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \
3804 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
3805 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3806 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3807 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3808 _(SR_POLICY_ADD, sr_policy_add) \
3809 _(SR_POLICY_MOD, sr_policy_mod) \
3810 _(SR_POLICY_DEL, sr_policy_del) \
3811 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3812 _(L2FIB_ADD_DEL, l2fib_add_del) \
3813 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3814 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3815 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3816 _(L2_FLAGS, l2_flags) \
3817 _(BRIDGE_FLAGS, bridge_flags) \
3818 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3819 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3820 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3821 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3822 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3823 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3824 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3825 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3826 _(ADD_NODE_NEXT, add_node_next) \
3827 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \
3828 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \
3829 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \
3830 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \
3831 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
3832 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
3833 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3834 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3835 _(VXLAN_OFFLOAD_RX, vxlan_offload_rx) \
3836 _(GENEVE_ADD_DEL_TUNNEL, geneve_add_del_tunnel) \
3837 _(GENEVE_TUNNEL_DUMP, geneve_tunnel_dump) \
3838 _(GRE_TUNNEL_ADD_DEL, gre_tunnel_add_del) \
3839 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3840 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3841 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3842 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3843 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3844 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3845 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3846 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3847 _(CONTROL_PING, control_ping) \
3848 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3850 _(CLI_INBAND, cli_inband) \
3851 _(MEMCLNT_CREATE, memclnt_create) \
3852 _(SOCKCLNT_CREATE, sockclnt_create) \
3853 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3854 _(SHOW_VERSION, show_version) \
3855 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3856 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3857 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3858 _(VXLAN_GBP_TUNNEL_ADD_DEL, vxlan_gbp_tunnel_add_del) \
3859 _(VXLAN_GBP_TUNNEL_DUMP, vxlan_gbp_tunnel_dump) \
3860 _(SW_INTERFACE_SET_VXLAN_GBP_BYPASS, sw_interface_set_vxlan_gbp_bypass) \
3861 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3862 _(IP_PROBE_NEIGHBOR, ip_probe_neighbor) \
3863 _(IP_SCAN_NEIGHBOR_ENABLE_DISABLE, ip_scan_neighbor_enable_disable) \
3864 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
3865 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \
3866 _(WANT_L2_MACS_EVENTS, want_l2_macs_events) \
3867 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3868 _(IP_ADDRESS_DUMP, ip_address_dump) \
3869 _(IP_DUMP, ip_dump) \
3870 _(DELETE_LOOPBACK, delete_loopback) \
3871 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3872 _(BD_IP_MAC_FLUSH, bd_ip_mac_flush) \
3873 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3874 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3875 _(AF_PACKET_CREATE, af_packet_create) \
3876 _(AF_PACKET_DELETE, af_packet_delete) \
3877 _(AF_PACKET_DUMP, af_packet_dump) \
3878 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3879 _(MPLS_FIB_DUMP, mpls_fib_dump) \
3880 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3881 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3882 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3883 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3884 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3885 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3886 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3887 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3888 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3889 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3890 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3891 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3892 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3893 _(GET_NEXT_INDEX, get_next_index) \
3894 _(PG_CREATE_INTERFACE,pg_create_interface) \
3895 _(PG_CAPTURE, pg_capture) \
3896 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3897 _(POLICER_ADD_DEL, policer_add_del) \
3898 _(POLICER_DUMP, policer_dump) \
3899 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3900 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3901 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3902 ip_source_and_port_range_check_add_del) \
3903 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3904 ip_source_and_port_range_check_interface_add_del) \
3905 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
3906 _(GPE_ENABLE_DISABLE, gpe_enable_disable) \
3907 _(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \
3908 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
3909 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \
3910 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \
3911 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
3912 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
3913 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
3914 lisp_add_del_map_request_itr_rlocs) \
3915 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
3916 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
3917 _(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \
3918 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
3919 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
3920 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
3921 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
3922 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
3923 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \
3924 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
3925 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \
3926 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
3927 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \
3928 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \
3929 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \
3930 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \
3931 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \
3932 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \
3933 _(IPSEC_TUNNEL_IF_ADD_DEL, ipsec_tunnel_if_add_del) \
3934 _(IPSEC_GRE_TUNNEL_ADD_DEL, ipsec_gre_tunnel_add_del) \
3935 _(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \
3936 _(DELETE_SUBIF, delete_subif) \
3937 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3938 _(SET_PUNT, set_punt) \
3939 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3940 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3941 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3942 _(IOAM_ENABLE, ioam_enable) \
3943 _(IOAM_DISABLE, ioam_disable) \
3944 _(IP_FIB_DUMP, ip_fib_dump) \
3945 _(IP6_FIB_DUMP, ip6_fib_dump) \
3946 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3947 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3948 _(HW_INTERFACE_SET_MTU, hw_interface_set_mtu) \
3949 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3950 _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
3951 _(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
3952 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
3953 _(LLDP_CONFIG, lldp_config) \
3954 _(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \
3955 _(DNS_ENABLE_DISABLE, dns_enable_disable) \
3956 _(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \
3957 _(DNS_RESOLVE_NAME, dns_resolve_name) \
3958 _(DNS_RESOLVE_IP, dns_resolve_ip) \
3959 _(SESSION_RULE_ADD_DEL, session_rule_add_del) \
3960 _(OUTPUT_ACL_SET_INTERFACE, output_acl_set_interface) \
3961 _(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable)
3963 vl_msg_api_custom_dump_configure (api_main_t * am)
3965 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3966 = (void *) vl_api_##f##_t_print;
3967 foreach_custom_print_function;
3972 * fd.io coding-style-patch-verification: ON
3974 * Local Variables: eval: (c-set-style "gnu") End: