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>
53 #include <vnet/bonding/node.h>
55 #define vl_typedefs /* define message structures */
56 #include <vpp/api/vpe_all_api_h.h>
59 #define vl_endianfun /* define message structures */
60 #include <vpp/api/vpe_all_api_h.h>
63 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
67 vl_print (handle, (char *)s); \
72 static void *vl_api_create_loopback_t_print
73 (vl_api_create_loopback_t * mp, void *handle)
77 s = format (0, "SCRIPT: create_loopback ");
78 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
83 static void *vl_api_create_loopback_instance_t_print
84 (vl_api_create_loopback_instance_t * mp, void *handle)
88 s = format (0, "SCRIPT: create_loopback ");
89 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
90 s = format (s, "instance %d ", ntohl (mp->user_instance));
95 static void *vl_api_delete_loopback_t_print
96 (vl_api_delete_loopback_t * mp, void *handle)
100 s = format (0, "SCRIPT: delete_loopback ");
101 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
106 static void *vl_api_sw_interface_set_flags_t_print
107 (vl_api_sw_interface_set_flags_t * mp, void *handle)
110 s = format (0, "SCRIPT: sw_interface_set_flags ");
112 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
114 if (mp->admin_up_down)
115 s = format (s, "admin-up ");
117 s = format (s, "admin-down ");
122 static void *vl_api_sw_interface_set_rx_placement_t_print
123 (vl_api_sw_interface_set_rx_placement_t * mp, void *handle)
126 s = format (0, "SCRIPT: sw_interface_set_rx_placement ");
128 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
130 s = format (s, "queue %d ", ntohl (mp->queue_id));
132 s = format (s, "main ");
134 s = format (s, "worker %d ", ntohl (mp->worker_id));
139 static void *vl_api_sw_interface_rx_placement_dump_t_print
140 (vl_api_sw_interface_rx_placement_dump_t * mp, void *handle)
143 u32 sw_if_index = ntohl (mp->sw_if_index);
145 s = format (0, "SCRIPT: sw_interface_rx_placement_dump ");
147 if (sw_if_index != ~0)
148 s = format (s, "sw_if_index %d ", sw_if_index);
153 static void *vl_api_sw_interface_event_t_print
154 (vl_api_sw_interface_event_t * mp, void *handle)
157 s = format (0, "SCRIPT: sw_interface_event ");
159 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
161 if (mp->admin_up_down)
162 s = format (s, "admin-up ");
164 s = format (s, "admin-down ");
166 if (mp->link_up_down)
167 s = format (s, "link-up");
169 s = format (s, "link-down");
172 s = format (s, " deleted");
177 static void *vl_api_sw_interface_add_del_address_t_print
178 (vl_api_sw_interface_add_del_address_t * mp, void *handle)
182 s = format (0, "SCRIPT: sw_interface_add_del_address ");
184 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
187 s = format (s, "%U/%d ", format_ip6_address,
188 (ip6_address_t *) mp->address, mp->address_length);
190 s = format (s, "%U/%d ", format_ip4_address,
191 (ip4_address_t *) mp->address, mp->address_length);
194 s = format (s, "del ");
196 s = format (s, "del-all ");
201 static void *vl_api_sw_interface_set_table_t_print
202 (vl_api_sw_interface_set_table_t * mp, void *handle)
206 s = format (0, "SCRIPT: sw_interface_set_table ");
208 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
211 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
214 s = format (s, "ipv6 ");
219 static void *vl_api_sw_interface_set_mpls_enable_t_print
220 (vl_api_sw_interface_set_mpls_enable_t * mp, void *handle)
224 s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
226 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
229 s = format (s, "disable");
234 static void *vl_api_sw_interface_set_vpath_t_print
235 (vl_api_sw_interface_set_vpath_t * mp, void *handle)
239 s = format (0, "SCRIPT: sw_interface_set_vpath ");
241 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
244 s = format (s, "enable ");
246 s = format (s, "disable ");
251 static void *vl_api_sw_interface_set_vxlan_bypass_t_print
252 (vl_api_sw_interface_set_vxlan_bypass_t * mp, void *handle)
256 s = format (0, "SCRIPT: sw_interface_set_vxlan_bypass ");
258 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
261 s = format (s, "ip6 ");
264 s = format (s, "enable ");
266 s = format (s, "disable ");
271 static void *vl_api_sw_interface_set_geneve_bypass_t_print
272 (vl_api_sw_interface_set_geneve_bypass_t * mp, void *handle)
276 s = format (0, "SCRIPT: sw_interface_set_geneve_bypass ");
278 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
281 s = format (s, "ip6 ");
284 s = format (s, "enable ");
286 s = format (s, "disable ");
291 static void *vl_api_sw_interface_set_l2_xconnect_t_print
292 (vl_api_sw_interface_set_l2_xconnect_t * mp, void *handle)
296 s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
298 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
302 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
305 s = format (s, "delete ");
310 static void *vl_api_sw_interface_set_l2_bridge_t_print
311 (vl_api_sw_interface_set_l2_bridge_t * mp, void *handle)
315 s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
317 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
321 s = format (s, "bd_id %d shg %d ", ntohl (mp->bd_id), mp->shg);
322 if (L2_API_PORT_TYPE_BVI == ntohl (mp->port_type))
323 s = format (s, "bvi ");
324 if (L2_API_PORT_TYPE_UU_FWD == ntohl (mp->port_type))
325 s = format (s, "uu-fwd ");
326 s = format (s, "enable");
329 s = format (s, "disable ");
334 static void *vl_api_bridge_domain_add_del_t_print
335 (vl_api_bridge_domain_add_del_t * mp, void *handle)
339 s = format (0, "SCRIPT: bridge_domain_add_del ");
341 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
346 s = format (s, "bd_tag %s ", mp->bd_tag);
347 s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood);
348 s = format (s, "forward %d learn %d ", mp->forward, mp->learn);
349 s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age);
352 s = format (s, "del ");
357 static void *vl_api_bridge_domain_set_mac_age_t_print
358 (vl_api_bridge_domain_set_mac_age_t * mp, void *handle)
362 s = format (0, "SCRIPT: bridge_domain_set_mac_age ");
364 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
366 s = format (s, "mac-age %d", mp->mac_age);
371 static void *vl_api_bridge_domain_dump_t_print
372 (vl_api_bridge_domain_dump_t * mp, void *handle)
375 u32 bd_id = ntohl (mp->bd_id);
377 s = format (0, "SCRIPT: bridge_domain_dump ");
380 s = format (s, "bd_id %d ", bd_id);
385 static void *vl_api_l2fib_flush_all_t_print
386 (vl_api_l2fib_flush_all_t * mp, void *handle)
390 s = format (0, "SCRIPT: l2fib_flush_all ");
396 static void *vl_api_l2fib_flush_bd_t_print
397 (vl_api_l2fib_flush_bd_t * mp, void *handle)
400 u32 bd_id = ntohl (mp->bd_id);
402 s = format (0, "SCRIPT: l2fib_flush_bd ");
403 s = format (s, "bd_id %d ", bd_id);
408 static void *vl_api_l2fib_flush_int_t_print
409 (vl_api_l2fib_flush_int_t * mp, void *handle)
412 u32 sw_if_index = ntohl (mp->sw_if_index);
414 s = format (0, "SCRIPT: l2fib_flush_int ");
415 s = format (s, "sw_if_index %d ", sw_if_index);
420 static void *vl_api_l2fib_add_del_t_print
421 (vl_api_l2fib_add_del_t * mp, void *handle)
425 s = format (0, "SCRIPT: l2fib_add_del ");
427 s = format (s, "mac %U ", format_ethernet_address, mp->mac);
429 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
434 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
436 s = format (s, "%s", "static ");
438 s = format (s, "%s", "filter ");
440 s = format (s, "%s", "bvi ");
444 s = format (s, "del ");
451 vl_api_l2_flags_t_print (vl_api_l2_flags_t * mp, void *handle)
454 u32 flags = ntohl (mp->feature_bitmap);
456 s = format (0, "SCRIPT: l2_flags ");
458 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
460 if (flags & L2_LEARN)
461 s = format (s, "learn ");
463 s = format (s, "forward ");
464 if (flags & L2_FLOOD)
465 s = format (s, "flood ");
466 if (flags & L2_UU_FLOOD)
467 s = format (s, "uu-flood ");
468 if (flags & L2_ARP_TERM)
469 s = format (s, "arp-term ");
472 s = format (s, "clear ");
477 static void *vl_api_bridge_flags_t_print
478 (vl_api_bridge_flags_t * mp, void *handle)
481 u32 flags = ntohl (mp->flags);
483 s = format (0, "SCRIPT: bridge_flags ");
485 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
487 if (flags & BRIDGE_API_FLAG_LEARN)
488 s = format (s, "learn ");
489 if (flags & BRIDGE_API_FLAG_FWD)
490 s = format (s, "forward ");
491 if (flags & BRIDGE_API_FLAG_FLOOD)
492 s = format (s, "flood ");
493 if (flags & BRIDGE_API_FLAG_UU_FLOOD)
494 s = format (s, "uu-flood ");
495 if (flags & BRIDGE_API_FLAG_ARP_TERM)
496 s = format (s, "arp-term ");
499 s = format (s, "clear ");
504 static void *vl_api_bd_ip_mac_add_del_t_print
505 (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
509 s = format (0, "SCRIPT: bd_ip_mac_add_del ");
510 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
512 s = format (s, "%U ", format_vl_api_address, &mp->ip);
513 s = format (s, "%U ", format_vl_api_mac_address, &mp->mac);
515 s = format (s, "del ");
520 static void *vl_api_bd_ip_mac_flush_t_print
521 (vl_api_bd_ip_mac_flush_t * mp, void *handle)
525 s = format (0, "SCRIPT: bd_ip_mac_flush ");
526 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
531 static void *vl_api_bd_ip_mac_dump_t_print
532 (vl_api_bd_ip_mac_dump_t * mp, void *handle)
536 s = format (0, "SCRIPT: bd_ip_mac_dump ");
541 static void *vl_api_tap_create_v2_t_print
542 (vl_api_tap_create_v2_t * mp, void *handle)
547 clib_memset (null_mac, 0, sizeof (null_mac));
549 s = format (0, "SCRIPT: tap_create_v2 ");
550 s = format (s, "id %u ", ntohl (mp->id));
551 if (memcmp (mp->mac_address, null_mac, 6))
552 s = format (s, "mac-address %U ",
553 format_ethernet_address, mp->mac_address);
554 if (memcmp (mp->host_mac_addr, null_mac, 6))
555 s = format (s, "host-mac-addr %U ",
556 format_ethernet_address, mp->host_mac_addr);
557 if (mp->host_if_name_set)
558 s = format (s, "host-if-name %s ", mp->host_if_name);
559 if (mp->host_namespace_set)
560 s = format (s, "host-ns %s ", mp->host_namespace);
561 if (mp->host_bridge_set)
562 s = format (s, "host-bridge %s ", mp->host_bridge);
563 if (mp->host_ip4_addr_set)
564 s = format (s, "host-ip4-addr %U/%d ", format_ip4_address,
565 mp->host_ip4_addr, mp->host_ip4_prefix_len);
566 if (mp->host_ip6_addr_set)
567 s = format (s, "host-ip6-addr %U/%d ", format_ip6_address,
568 mp->host_ip6_addr, mp->host_ip6_prefix_len);
569 if (mp->host_ip4_gw_set)
570 s = format (s, "host-ip4-gw %U ", format_ip4_address, mp->host_ip4_addr);
571 if (mp->host_ip6_gw_set)
572 s = format (s, "host-ip6-gw %U ", format_ip6_address, mp->host_ip6_addr);
574 s = format (s, "tx-ring-size %u ", ntohs (mp->tx_ring_sz));
576 s = format (s, "rx-ring-size %u ", ntohs (mp->rx_ring_sz));
580 static void *vl_api_tap_delete_v2_t_print
581 (vl_api_tap_delete_v2_t * mp, void *handle)
585 s = format (0, "SCRIPT: tap_delete_v2 ");
586 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
591 static void *vl_api_sw_interface_tap_v2_dump_t_print
592 (vl_api_sw_interface_tap_v2_dump_t * mp, void *handle)
596 s = format (0, "SCRIPT: sw_interface_tap_v2_dump ");
601 static void *vl_api_virtio_pci_create_t_print
602 (vl_api_virtio_pci_create_t * mp, void *handle)
607 clib_memset (null_mac, 0, sizeof (null_mac));
609 s = format (0, "SCRIPT: virtio_pci_create ");
610 s = format (s, "pci_addr %U ", format_vlib_pci_addr, ntohl (mp->pci_addr));
611 if (memcmp (mp->mac_address, null_mac, 6))
612 s = format (s, "mac-address %U ",
613 format_ethernet_address, mp->mac_address);
615 s = format (s, "features 0x%llx ", clib_net_to_host_u64 (mp->features));
617 s = format (s, "gso-enabled");
621 static void *vl_api_virtio_pci_delete_t_print
622 (vl_api_virtio_pci_delete_t * mp, void *handle)
626 s = format (0, "SCRIPT: virtio_pci_delete ");
627 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
632 static void *vl_api_sw_interface_virtio_pci_dump_t_print
633 (vl_api_sw_interface_virtio_pci_dump_t * mp, void *handle)
637 s = format (0, "SCRIPT: sw_interface_virtio_pci_dump ");
642 static void *vl_api_bond_create_t_print
643 (vl_api_bond_create_t * mp, void *handle)
648 clib_memset (null_mac, 0, sizeof (null_mac));
650 s = format (0, "SCRIPT: bond_create ");
651 if (memcmp (mp->mac_address, null_mac, 6))
652 s = format (s, "mac-address %U ",
653 format_ethernet_address, mp->mac_address);
655 s = format (s, "mode %U ", format_bond_mode, mp->mode);
657 s = format (s, "lb %U ", format_bond_load_balance, mp->lb);
659 s = format (s, "id %u ", ntohl (mp->id));
663 static void *vl_api_bond_delete_t_print
664 (vl_api_bond_delete_t * mp, void *handle)
668 s = format (0, "SCRIPT: bond_delete ");
669 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
674 static void *vl_api_bond_enslave_t_print
675 (vl_api_bond_enslave_t * mp, void *handle)
679 s = format (0, "SCRIPT: bond_enslave ");
680 s = format (s, "bond_sw_if_index %u ", mp->bond_sw_if_index);
681 s = format (s, "sw_if_index %u ", mp->sw_if_index);
683 s = format (s, "passive ");
684 if (mp->is_long_timeout)
685 s = format (s, "long-timeout ");
690 static void *vl_api_bond_detach_slave_t_print
691 (vl_api_bond_detach_slave_t * mp, void *handle)
695 s = format (0, "SCRIPT: bond_detach_slave ");
696 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
701 static void *vl_api_sw_interface_bond_dump_t_print
702 (vl_api_sw_interface_bond_dump_t * mp, void *handle)
706 s = format (0, "SCRIPT: sw_interface_bond_dump ");
711 static void *vl_api_sw_interface_slave_dump_t_print
712 (vl_api_sw_interface_slave_dump_t * mp, void *handle)
716 s = format (0, "SCRIPT: sw_interface_slave_dump ");
717 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
722 static void *vl_api_ip_add_del_route_t_print
723 (vl_api_ip_add_del_route_t * mp, void *handle)
727 s = format (0, "SCRIPT: ip_add_del_route ");
729 s = format (s, "del ");
732 s = format (s, "%U/%d ", format_ip6_address, mp->dst_address,
733 mp->dst_address_length);
735 s = format (s, "%U/%d ", format_ip4_address, mp->dst_address,
736 mp->dst_address_length);
738 if (mp->table_id != 0)
739 s = format (s, "vrf %d ", ntohl (mp->table_id));
742 s = format (s, "local ");
743 else if (mp->is_drop)
744 s = format (s, "drop ");
745 else if (mp->is_classify)
746 s = format (s, "classify %d", ntohl (mp->classify_table_index));
747 else if (mp->next_hop_via_label != htonl (MPLS_LABEL_INVALID))
748 s = format (s, "via via_label %d ", ntohl (mp->next_hop_via_label));
752 s = format (s, "via %U ", format_ip6_address, mp->next_hop_address);
754 s = format (s, "via %U ", format_ip4_address, mp->next_hop_address);
755 if (mp->next_hop_sw_if_index != ~0)
756 s = format (s, "sw_if_index %d ", ntohl (mp->next_hop_sw_if_index));
760 if (mp->next_hop_weight != 1)
761 s = format (s, "weight %d ", (u32) mp->next_hop_weight);
763 if (mp->is_multipath)
764 s = format (s, "multipath ");
766 if (mp->next_hop_table_id)
767 s = format (s, "lookup-in-vrf %d ", ntohl (mp->next_hop_table_id));
769 if (mp->next_hop_n_out_labels)
772 for (i = 0; i < mp->next_hop_n_out_labels; i++)
774 s = format (s, "out-label %d ",
775 ntohl (mp->next_hop_out_label_stack[i].label));
782 static void *vl_api_mpls_route_add_del_t_print
783 (vl_api_mpls_route_add_del_t * mp, void *handle)
787 s = format (0, "SCRIPT: mpls_route_add_del ");
790 s = format (s, "add ");
792 s = format (s, "del ");
794 s = format (s, "%d ", ntohl (mp->mr_label));
797 s = format (s, "eos ");
799 s = format (s, "non-eos ");
802 if (mp->mr_next_hop_proto == DPO_PROTO_IP4)
804 ip4_address_t ip4_null = {.as_u32 = 0, };
805 if (memcmp (mp->mr_next_hop, &ip4_null, sizeof (ip4_null)))
806 s = format (s, "via %U ", format_ip4_address, mp->mr_next_hop);
808 s = format (s, "via lookup-in-ip4-table %d ",
809 ntohl (mp->mr_next_hop_table_id));
811 else if (mp->mr_next_hop_proto == DPO_PROTO_IP6)
813 ip6_address_t ip6_null = { {0}
815 if (memcmp (mp->mr_next_hop, &ip6_null, sizeof (ip6_null)))
816 s = format (s, "via %U ", format_ip6_address, mp->mr_next_hop);
818 s = format (s, "via lookup-in-ip6-table %d ",
819 ntohl (mp->mr_next_hop_table_id));
821 else if (mp->mr_next_hop_proto == DPO_PROTO_ETHERNET)
823 s = format (s, "via l2-input-on ");
825 else if (mp->mr_next_hop_proto == DPO_PROTO_MPLS)
827 if (mp->mr_next_hop_via_label != htonl (MPLS_LABEL_INVALID))
829 format (s, "via via-label %d ", ntohl (mp->mr_next_hop_via_label));
831 s = format (s, "via next-hop-table %d ",
832 ntohl (mp->mr_next_hop_table_id));
834 if (mp->mr_next_hop_sw_if_index != ~0)
835 s = format (s, "sw_if_index %d ", ntohl (mp->mr_next_hop_sw_if_index));
837 if (mp->mr_next_hop_weight != 1)
838 s = format (s, "weight %d ", (u32) mp->mr_next_hop_weight);
840 if (mp->mr_is_multipath)
841 s = format (s, "multipath ");
843 if (mp->mr_is_classify)
844 s = format (s, "classify %d", ntohl (mp->mr_classify_table_index));
846 if (mp->mr_next_hop_n_out_labels)
849 for (i = 0; i < mp->mr_next_hop_n_out_labels; i++)
851 s = format (s, "out-label %d ",
852 ntohl (mp->mr_next_hop_out_label_stack[i].label));
859 static void *vl_api_ip_table_add_del_t_print
860 (vl_api_ip_table_add_del_t * mp, void *handle)
864 s = format (0, "SCRIPT: ip_table_add_del ");
866 s = format (s, "add ");
868 s = format (s, "del ");
870 s = format (s, "ip6 ");
871 s = format (s, "table %d ", ntohl (mp->table_id));
876 static void *vl_api_mpls_table_add_del_t_print
877 (vl_api_mpls_table_add_del_t * mp, void *handle)
881 s = format (0, "SCRIPT: mpls_table_add_del ");
883 s = format (s, "add ");
885 s = format (s, "del ");
886 s = format (s, "table %d ", ntohl (mp->mt_table_id));
891 static void *vl_api_proxy_arp_add_del_t_print
892 (vl_api_proxy_arp_add_del_t * mp, void *handle)
896 s = format (0, "SCRIPT: proxy_arp_add_del ");
898 s = format (s, "%U - %U ",
899 format_vl_api_ip4_address, mp->proxy.low,
900 format_vl_api_ip4_address, mp->proxy.hi);
902 s = format (s, "table %d ", ntohl (mp->proxy.table_id));
905 s = format (s, "del ");
910 static void *vl_api_proxy_arp_intfc_enable_disable_t_print
911 (vl_api_proxy_arp_intfc_enable_disable_t * mp, void *handle)
915 s = format (0, "SCRIPT: proxy_arp_intfc_enable_disable ");
917 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
919 s = format (s, "enable %d ", mp->enable_disable);
924 static void *vl_api_mpls_tunnel_add_del_t_print
925 (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
929 s = format (0, "SCRIPT: mpls_tunnel_add_del ");
931 if (mp->mt_is_add == 0)
932 s = format (s, "del sw_if_index %d ", ntohl (mp->mt_sw_if_index));
934 mpls_label_t label = ntohl (mp->mt_next_hop_via_label);
935 if (label != MPLS_LABEL_INVALID)
936 s = format (s, "via-label %d ", label);
937 else if (mp->mt_next_hop_proto_is_ip4)
938 s = format (s, "via %U ", format_ip4_address, mp->mt_next_hop);
940 s = format (s, "via %U ", format_ip6_address, mp->mt_next_hop);
942 if (mp->mt_next_hop_sw_if_index != ~0)
943 s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index));
944 else if (mp->mt_next_hop_table_id)
945 s = format (s, "next-hop-table %d ", ntohl (mp->mt_next_hop_table_id));
948 s = format (s, "l2-only ");
950 if (mp->mt_next_hop_n_out_labels)
953 for (i = 0; i < mp->mt_next_hop_n_out_labels; i++)
955 s = format (s, "out-label %d ",
956 ntohl (mp->mt_next_hop_out_label_stack[i].label));
963 static void *vl_api_sr_mpls_policy_add_t_print
964 (vl_api_sr_mpls_policy_add_t * mp, void *handle)
968 s = format (0, "SCRIPT: sr_mpls_policy_add ");
970 s = format (s, "bsid %d ", ntohl (mp->bsid));
972 if (mp->weight != htonl ((u32) 1))
973 s = format (s, "%d ", ntohl (mp->weight));
976 s = format (s, "spray ");
981 for (i = 0; i < mp->n_segments; i++)
982 s = format (s, "next %d ", ntohl (mp->segments[i]));
988 static void *vl_api_sr_mpls_policy_del_t_print
989 (vl_api_sr_mpls_policy_del_t * mp, void *handle)
993 s = format (0, "SCRIPT: sr_mpls_policy_del ");
995 s = format (s, "bsid %d ", ntohl (mp->bsid));
1000 static void *vl_api_sw_interface_set_unnumbered_t_print
1001 (vl_api_sw_interface_set_unnumbered_t * mp, void *handle)
1005 s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
1007 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1009 s = format (s, "unnum_if_index %d ", ntohl (mp->unnumbered_sw_if_index));
1011 if (mp->is_add == 0)
1012 s = format (s, "del ");
1017 static void *vl_api_ip_neighbor_add_del_t_print
1018 (vl_api_ip_neighbor_add_del_t * mp, void *handle)
1022 s = format (0, "SCRIPT: ip_neighbor_add_del ");
1024 s = format (s, "sw_if_index %d ", ntohl (mp->neighbor.sw_if_index));
1026 if (IP_API_NEIGHBOR_FLAG_STATIC & ntohl (mp->neighbor.flags))
1027 s = format (s, "is_static ");
1029 if (IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY & ntohl (mp->neighbor.flags))
1030 s = format (s, "is_no_fib_entry ");
1032 s = format (s, "mac %U ", format_vl_api_mac_address,
1033 &mp->neighbor.mac_address);
1035 s = format (s, "dst %U ", format_vl_api_address, &mp->neighbor.ip_address);
1037 if (mp->is_add == 0)
1038 s = format (s, "del ");
1044 static void *vl_api_create_vlan_subif_t_print
1045 (vl_api_create_vlan_subif_t * mp, void *handle)
1049 s = format (0, "SCRIPT: create_vlan_subif ");
1051 if (mp->sw_if_index)
1052 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1055 s = format (s, "vlan_id %d ", ntohl (mp->vlan_id));
1060 #define foreach_create_subif_bit \
1067 _(outer_vlan_id_any) \
1068 _(inner_vlan_id_any)
1070 static void *vl_api_create_subif_t_print
1071 (vl_api_create_subif_t * mp, void *handle)
1075 s = format (0, "SCRIPT: create_subif ");
1077 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1079 s = format (s, "sub_id %d ", ntohl (mp->sub_id));
1081 if (mp->outer_vlan_id)
1082 s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
1084 if (mp->inner_vlan_id)
1085 s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
1087 #define _(a) if (mp->a) s = format (s, "%s ", #a);
1088 foreach_create_subif_bit;
1094 static void *vl_api_delete_subif_t_print
1095 (vl_api_delete_subif_t * mp, void *handle)
1099 s = format (0, "SCRIPT: delete_subif ");
1100 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1106 vl_api_reset_fib_t_print (vl_api_reset_fib_t * mp, void *handle)
1110 s = format (0, "SCRIPT: reset_fib ");
1113 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
1115 if (mp->is_ipv6 != 0)
1116 s = format (s, "ipv6 ");
1121 static void *vl_api_dhcp_proxy_config_t_print
1122 (vl_api_dhcp_proxy_config_t * mp, void *handle)
1126 s = format (0, "SCRIPT: dhcp_proxy_config_2 ");
1128 s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
1129 s = format (s, "server_vrf_id %d ", ntohl (mp->server_vrf_id));
1133 s = format (s, "svr %U ", format_ip6_address,
1134 (ip6_address_t *) mp->dhcp_server);
1135 s = format (s, "src %U ", format_ip6_address,
1136 (ip6_address_t *) mp->dhcp_src_address);
1140 s = format (s, "svr %U ", format_ip4_address,
1141 (ip4_address_t *) mp->dhcp_server);
1142 s = format (s, "src %U ", format_ip4_address,
1143 (ip4_address_t *) mp->dhcp_src_address);
1145 if (mp->is_add == 0)
1146 s = format (s, "del ");
1151 static void *vl_api_dhcp_proxy_set_vss_t_print
1152 (vl_api_dhcp_proxy_set_vss_t * mp, void *handle)
1156 s = format (0, "SCRIPT: dhcp_proxy_set_vss ");
1158 s = format (s, "tbl_id %d ", ntohl (mp->tbl_id));
1160 if (mp->vss_type == VSS_TYPE_VPN_ID)
1162 s = format (s, "fib_id %d ", ntohl (mp->vpn_index));
1163 s = format (s, "oui %d ", ntohl (mp->oui));
1165 else if (mp->vss_type == VSS_TYPE_ASCII)
1166 s = format (s, "vpn_ascii_id %s", mp->vpn_ascii_id);
1168 if (mp->is_ipv6 != 0)
1169 s = format (s, "ipv6 ");
1171 if (mp->is_add == 0)
1172 s = format (s, "del ");
1177 static void *vl_api_dhcp_client_config_t_print
1178 (vl_api_dhcp_client_config_t * mp, void *handle)
1182 s = format (0, "SCRIPT: dhcp_client_config ");
1184 s = format (s, "sw_if_index %d ", ntohl (mp->client.sw_if_index));
1186 s = format (s, "hostname %s ", mp->client.hostname);
1188 s = format (s, "want_dhcp_event %d ", mp->client.want_dhcp_event);
1190 s = format (s, "pid %d ", ntohl (mp->client.pid));
1192 if (mp->is_add == 0)
1193 s = format (s, "del ");
1199 static void *vl_api_set_ip_flow_hash_t_print
1200 (vl_api_set_ip_flow_hash_t * mp, void *handle)
1204 s = format (0, "SCRIPT: set_ip_flow_hash ");
1206 s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
1209 s = format (s, "src ");
1212 s = format (s, "dst ");
1215 s = format (s, "sport ");
1218 s = format (s, "dport ");
1221 s = format (s, "proto ");
1224 s = format (s, "reverse ");
1226 if (mp->is_ipv6 != 0)
1227 s = format (s, "ipv6 ");
1232 static void *vl_api_sw_interface_ip6nd_ra_prefix_t_print
1233 (vl_api_sw_interface_ip6nd_ra_prefix_t * mp, void *handle)
1237 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_prefix ");
1239 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1241 s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
1243 s = format (s, "val_life %d ", ntohl (mp->val_lifetime));
1245 s = format (s, "pref_life %d ", ntohl (mp->pref_lifetime));
1247 if (mp->use_default)
1248 s = format (s, "def ");
1250 if (mp->no_advertise)
1251 s = format (s, "noadv ");
1254 s = format (s, "offl ");
1256 if (mp->no_autoconfig)
1257 s = format (s, "noauto ");
1260 s = format (s, "nolink ");
1263 s = format (s, "isno ");
1268 static void *vl_api_sw_interface_ip6nd_ra_config_t_print
1269 (vl_api_sw_interface_ip6nd_ra_config_t * mp, void *handle)
1273 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_config ");
1275 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1277 s = format (s, "maxint %d ", ntohl (mp->max_interval));
1279 s = format (s, "minint %d ", ntohl (mp->min_interval));
1281 s = format (s, "life %d ", ntohl (mp->lifetime));
1283 s = format (s, "count %d ", ntohl (mp->initial_count));
1285 s = format (s, "interval %d ", ntohl (mp->initial_interval));
1288 s = format (s, "suppress ");
1291 s = format (s, "managed ");
1294 s = format (s, "other ");
1297 s = format (s, "ll ");
1299 if (mp->send_unicast)
1300 s = format (s, "send ");
1303 s = format (s, "cease ");
1306 s = format (s, "isno ");
1308 if (mp->default_router)
1309 s = format (s, "def ");
1314 static void *vl_api_set_arp_neighbor_limit_t_print
1315 (vl_api_set_arp_neighbor_limit_t * mp, void *handle)
1319 s = format (0, "SCRIPT: set_arp_neighbor_limit ");
1321 s = format (s, "arp_nbr_limit %d ", ntohl (mp->arp_neighbor_limit));
1323 if (mp->is_ipv6 != 0)
1324 s = format (s, "ipv6 ");
1329 static void *vl_api_l2_patch_add_del_t_print
1330 (vl_api_l2_patch_add_del_t * mp, void *handle)
1334 s = format (0, "SCRIPT: l2_patch_add_del ");
1336 s = format (s, "rx_sw_if_index %d ", ntohl (mp->rx_sw_if_index));
1338 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
1340 if (mp->is_add == 0)
1341 s = format (s, "del ");
1346 static void *vl_api_sr_localsid_add_del_t_print
1347 (vl_api_sr_localsid_add_del_t * mp, void *handle)
1349 vnet_main_t *vnm = vnet_get_main ();
1352 s = format (0, "SCRIPT: sr_localsid_add_del ");
1354 switch (mp->behavior)
1356 case SR_BEHAVIOR_END:
1357 s = format (s, "Address: %U\nBehavior: End",
1358 format_ip6_address, (ip6_address_t *) mp->localsid.addr);
1359 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1364 "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1365 "\nIface: %U\nNext hop: %U", format_ip6_address,
1366 (ip6_address_t *) mp->localsid.addr,
1367 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1368 format_ip6_address, (ip6_address_t *) mp->nh_addr6);
1369 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1371 case SR_BEHAVIOR_DX4:
1374 "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1375 "\nIface: %U\nNext hop: %U", format_ip6_address,
1376 (ip6_address_t *) mp->localsid.addr,
1377 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1378 format_ip4_address, (ip4_address_t *) mp->nh_addr4);
1380 case SR_BEHAVIOR_DX6:
1383 "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1384 "\nIface: %UNext 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_ip6_address, (ip6_address_t *) mp->nh_addr6);
1389 case SR_BEHAVIOR_DX2:
1392 "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1393 "\nIface: %U", format_ip6_address,
1394 (ip6_address_t *) mp->localsid.addr,
1395 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index));
1397 case SR_BEHAVIOR_DT6:
1400 "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1401 "\nTable: %u", format_ip6_address,
1402 (ip6_address_t *) mp->localsid.addr, ntohl (mp->fib_table));
1404 case SR_BEHAVIOR_DT4:
1407 "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1408 "\nTable: %u", format_ip6_address,
1409 (ip6_address_t *) mp->localsid.addr, ntohl (mp->fib_table));
1412 if (mp->behavior >= SR_BEHAVIOR_LAST)
1414 s = format (s, "Address: %U\n Behavior: %u",
1415 format_ip6_address, (ip6_address_t *) mp->localsid.addr,
1419 //Should never get here...
1420 s = format (s, "Internal error");
1426 static void *vl_api_sr_steering_add_del_t_print
1427 (vl_api_sr_steering_add_del_t * mp, void *handle)
1431 s = format (0, "SCRIPT: sr_steering_add_del ");
1433 s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1435 switch (mp->traffic_type)
1438 s = format (s, "Traffic type: L2 iface: %u", ntohl (mp->sw_if_index));
1441 s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1442 (ip4_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1445 s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1446 (ip6_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1449 s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1452 s = format (s, "BindingSID: %U", format_ip6_address,
1453 (ip6_address_t *) mp->bsid_addr);
1455 s = format (s, "SR Policy Index: %u", ntohl (mp->sr_policy_index));
1457 s = format (s, "FIB_table: %u", ntohl (mp->table_id));
1462 static void *vl_api_sr_policy_add_t_print
1463 (vl_api_sr_policy_add_t * mp, void *handle)
1467 ip6_address_t *segments = 0, *seg;
1468 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1471 for (i = 0; i < mp->sids.num_sids; i++)
1473 vec_add2 (segments, seg, 1);
1474 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1478 s = format (0, "SCRIPT: sr_policy_add ");
1480 s = format (s, "BSID: %U", format_ip6_address,
1481 (ip6_address_t *) mp->bsid_addr);
1485 (mp->is_encap ? "Behavior: Encapsulation" :
1486 "Behavior: SRH insertion"));
1488 s = format (s, "FIB_table: %u", ntohl (mp->fib_table));
1490 s = format (s, (mp->type ? "Type: Default" : "Type: Spray"));
1492 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1494 s = format (s, "{");
1495 vec_foreach (seg, segments)
1497 s = format (s, "%U, ", format_ip6_address, seg);
1499 s = format (s, "\b\b } ");
1504 static void *vl_api_sr_policy_mod_t_print
1505 (vl_api_sr_policy_mod_t * mp, void *handle)
1509 ip6_address_t *segments = 0, *seg;
1510 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1513 for (i = 0; i < mp->sids.num_sids; i++)
1515 vec_add2 (segments, seg, 1);
1516 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1520 s = format (0, "SCRIPT: sr_policy_mod ");
1522 s = format (s, "BSID: %U", format_ip6_address,
1523 (ip6_address_t *) mp->bsid_addr);
1525 s = format (s, "SR Policy index: %u", ntohl (mp->sr_policy_index));
1527 s = format (s, "Operation: %u", mp->operation);
1529 s = format (s, "SID list index: %u", ntohl (mp->sl_index));
1531 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1533 s = format (s, "{");
1534 vec_foreach (seg, segments)
1536 s = format (s, "%U, ", format_ip6_address, seg);
1538 s = format (s, "\b\b } ");
1543 static void *vl_api_sr_policy_del_t_print
1544 (vl_api_sr_policy_del_t * mp, void *handle)
1548 s = format (0, "SCRIPT: sr_policy_del ");
1549 s = format (s, "To be delivered. Good luck.");
1553 static void *vl_api_classify_add_del_table_t_print
1554 (vl_api_classify_add_del_table_t * mp, void *handle)
1559 s = format (0, "SCRIPT: classify_add_del_table ");
1561 if (mp->is_add == 0)
1563 s = format (s, "table %d ", ntohl (mp->table_index));
1564 s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1568 s = format (s, "nbuckets %d ", ntohl (mp->nbuckets));
1569 s = format (s, "memory_size %d ", ntohl (mp->memory_size));
1570 s = format (s, "skip %d ", ntohl (mp->skip_n_vectors));
1571 s = format (s, "match %d ", ntohl (mp->match_n_vectors));
1572 s = format (s, "next-table %d ", ntohl (mp->next_table_index));
1573 s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
1574 s = format (s, "current-data-flag %d ", ntohl (mp->current_data_flag));
1575 if (mp->current_data_flag)
1576 s = format (s, "current-data-offset %d ",
1577 ntohl (mp->current_data_offset));
1578 s = format (s, "mask hex ");
1579 for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
1580 s = format (s, "%02x", mp->mask[i]);
1587 static void *vl_api_classify_add_del_session_t_print
1588 (vl_api_classify_add_del_session_t * mp, void *handle)
1593 s = format (0, "SCRIPT: classify_add_del_session ");
1595 s = format (s, "table_index %d ", ntohl (mp->table_index));
1596 s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
1597 s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
1598 s = format (s, "advance %d ", ntohl (mp->advance));
1599 s = format (s, "action %d ", mp->action);
1601 s = format (s, "metadata %d ", ntohl (mp->metadata));
1602 if (mp->is_add == 0)
1603 s = format (s, "del ");
1605 s = format (s, "match hex ");
1606 for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1608 if (mp->match[i] != 0)
1615 for (i = 0; i < limit; i++)
1616 s = format (s, "%02x", mp->match[i]);
1621 static void *vl_api_classify_set_interface_ip_table_t_print
1622 (vl_api_classify_set_interface_ip_table_t * mp, void *handle)
1626 s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1629 s = format (s, "ipv6 ");
1631 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1632 s = format (s, "table %d ", ntohl (mp->table_index));
1637 static void *vl_api_classify_set_interface_l2_tables_t_print
1638 (vl_api_classify_set_interface_l2_tables_t * mp, void *handle)
1642 s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1644 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1645 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1646 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1647 s = format (s, "other-table %d ", ntohl (mp->other_table_index));
1648 s = format (s, "is-input %d ", mp->is_input);
1653 static void *vl_api_add_node_next_t_print
1654 (vl_api_add_node_next_t * mp, void *handle)
1658 s = format (0, "SCRIPT: add_node_next ");
1660 s = format (0, "node %s next %s ", mp->node_name, mp->next_name);
1665 static void *vl_api_l2tpv3_create_tunnel_t_print
1666 (vl_api_l2tpv3_create_tunnel_t * mp, void *handle)
1670 s = format (0, "SCRIPT: l2tpv3_create_tunnel ");
1672 s = format (s, "client_address %U our_address %U ",
1673 format_ip6_address, (ip6_address_t *) (mp->client_address),
1674 format_ip6_address, (ip6_address_t *) (mp->our_address));
1675 s = format (s, "local_session_id %d ", ntohl (mp->local_session_id));
1676 s = format (s, "remote_session_id %d ", ntohl (mp->remote_session_id));
1677 s = format (s, "local_cookie %lld ",
1678 clib_net_to_host_u64 (mp->local_cookie));
1679 s = format (s, "remote_cookie %lld ",
1680 clib_net_to_host_u64 (mp->remote_cookie));
1681 if (mp->l2_sublayer_present)
1682 s = format (s, "l2-sublayer-present ");
1687 static void *vl_api_l2tpv3_set_tunnel_cookies_t_print
1688 (vl_api_l2tpv3_set_tunnel_cookies_t * mp, void *handle)
1692 s = format (0, "SCRIPT: l2tpv3_set_tunnel_cookies ");
1694 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1696 s = format (s, "new_local_cookie %llu ",
1697 clib_net_to_host_u64 (mp->new_local_cookie));
1699 s = format (s, "new_remote_cookie %llu ",
1700 clib_net_to_host_u64 (mp->new_remote_cookie));
1705 static void *vl_api_l2tpv3_interface_enable_disable_t_print
1706 (vl_api_l2tpv3_interface_enable_disable_t * mp, void *handle)
1710 s = format (0, "SCRIPT: l2tpv3_interface_enable_disable ");
1712 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1714 if (mp->enable_disable == 0)
1715 s = format (s, "del ");
1720 static void *vl_api_l2tpv3_set_lookup_key_t_print
1721 (vl_api_l2tpv3_set_lookup_key_t * mp, void *handle)
1724 char *str = "unknown";
1726 s = format (0, "SCRIPT: l2tpv3_set_lookup_key ");
1730 case L2T_LOOKUP_SRC_ADDRESS:
1731 str = "lookup_v6_src";
1733 case L2T_LOOKUP_DST_ADDRESS:
1734 str = "lookup_v6_dst";
1736 case L2T_LOOKUP_SESSION_ID:
1737 str = "lookup_session_id";
1743 s = format (s, "%s ", str);
1748 static void *vl_api_sw_if_l2tpv3_tunnel_dump_t_print
1749 (vl_api_sw_if_l2tpv3_tunnel_dump_t * mp, void *handle)
1753 s = format (0, "SCRIPT: sw_if_l2tpv3_tunnel_dump ");
1758 static void *vl_api_vxlan_add_del_tunnel_t_print
1759 (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1762 s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1764 ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
1765 ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
1767 u8 is_grp = ip46_address_is_multicast (&dst);
1768 char *dst_name = is_grp ? "group" : "dst";
1770 s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1771 s = format (s, "%s %U ", dst_name, format_ip46_address,
1772 &dst, IP46_TYPE_ANY);
1775 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1777 if (mp->encap_vrf_id)
1778 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1780 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1782 s = format (s, "vni %d ", ntohl (mp->vni));
1784 s = format (s, "instance %d ", ntohl (mp->instance));
1786 if (mp->is_add == 0)
1787 s = format (s, "del ");
1792 static void *vl_api_vxlan_offload_rx_t_print
1793 (vl_api_vxlan_offload_rx_t * mp, void *handle)
1796 s = format (0, "SCRIPT: vxlan_offload_rx ");
1798 s = format (s, "hw hw_if_index %d ", ntohl (mp->hw_if_index));
1799 s = format (s, "rx sw_if_index %d ", ntohl (mp->sw_if_index));
1801 s = format (s, "del ");
1806 static void *vl_api_vxlan_tunnel_dump_t_print
1807 (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1811 s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1813 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1818 static void *vl_api_vxlan_gbp_tunnel_add_del_t_print
1819 (vl_api_vxlan_gbp_tunnel_add_del_t * mp, void *handle)
1822 s = format (0, "SCRIPT: vxlan_gbp_tunnel_add_del ");
1825 s = format (s, "add ");
1827 s = format (s, "del ");
1829 s = format (s, "instance %d ", ntohl (mp->tunnel.instance));
1830 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1831 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1833 format (s, "mcast_sw_if_index %d ", ntohl (mp->tunnel.mcast_sw_if_index));
1834 s = format (s, "encap_table_id %d ", ntohl (mp->tunnel.encap_table_id));
1835 s = format (s, "vni %d ", ntohl (mp->tunnel.vni));
1836 s = format (s, "sw_if_index %d ", ntohl (mp->tunnel.sw_if_index));
1841 static void *vl_api_vxlan_gbp_tunnel_dump_t_print
1842 (vl_api_vxlan_gbp_tunnel_dump_t * mp, void *handle)
1846 s = format (0, "SCRIPT: vxlan_gbp_tunnel_dump ");
1848 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1853 static void *vl_api_sw_interface_set_vxlan_gbp_bypass_t_print
1854 (vl_api_sw_interface_set_vxlan_gbp_bypass_t * mp, void *handle)
1858 s = format (0, "SCRIPT: sw_interface_set_vxlan_gbp_bypass ");
1860 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1861 s = format (s, "%s ", (mp->is_ipv6 != 0) ? "ipv6" : "ipv4");
1862 s = format (s, "%s ", (mp->enable != 0) ? "enable" : "disable");
1867 static void *vl_api_geneve_add_del_tunnel_t_print
1868 (vl_api_geneve_add_del_tunnel_t * mp, void *handle)
1871 s = format (0, "SCRIPT: geneve_add_del_tunnel ");
1873 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local_address);
1874 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote_address);
1876 u8 is_grp = ip46_address_is_multicast (&remote);
1877 char *remote_name = is_grp ? "group" : "dst";
1879 s = format (s, "src %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1880 s = format (s, "%s %U ", remote_name, format_ip46_address,
1881 &remote, IP46_TYPE_ANY);
1884 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1886 if (mp->encap_vrf_id)
1887 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1889 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1891 s = format (s, "vni %d ", ntohl (mp->vni));
1893 if (mp->is_add == 0)
1894 s = format (s, "del ");
1899 static void *vl_api_geneve_tunnel_dump_t_print
1900 (vl_api_geneve_tunnel_dump_t * mp, void *handle)
1904 s = format (0, "SCRIPT: geneve_tunnel_dump ");
1906 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1911 static void *vl_api_gre_tunnel_add_del_t_print
1912 (vl_api_gre_tunnel_add_del_t * mp, void *handle)
1916 s = format (0, "SCRIPT: gre_tunnel_add_del ");
1918 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1919 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1921 s = format (s, "instance %d ", ntohl (mp->tunnel.instance));
1923 if (mp->tunnel.type == GRE_TUNNEL_TYPE_TEB)
1924 s = format (s, "teb ");
1926 if (mp->tunnel.type == GRE_TUNNEL_TYPE_ERSPAN)
1927 s = format (s, "erspan %d ", ntohs (mp->tunnel.session_id));
1929 if (mp->tunnel.outer_fib_id)
1930 s = format (s, "outer-fib-id %d ", ntohl (mp->tunnel.outer_fib_id));
1932 if (mp->is_add == 0)
1933 s = format (s, "del ");
1938 static void *vl_api_gre_tunnel_dump_t_print
1939 (vl_api_gre_tunnel_dump_t * mp, void *handle)
1943 s = format (0, "SCRIPT: gre_tunnel_dump ");
1945 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1950 static void *vl_api_l2_fib_clear_table_t_print
1951 (vl_api_l2_fib_clear_table_t * mp, void *handle)
1955 s = format (0, "SCRIPT: l2_fib_clear_table ");
1960 static void *vl_api_l2_interface_efp_filter_t_print
1961 (vl_api_l2_interface_efp_filter_t * mp, void *handle)
1965 s = format (0, "SCRIPT: l2_interface_efp_filter ");
1967 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1968 if (mp->enable_disable)
1969 s = format (s, "enable ");
1971 s = format (s, "disable ");
1976 static void *vl_api_l2_interface_vlan_tag_rewrite_t_print
1977 (vl_api_l2_interface_vlan_tag_rewrite_t * mp, void *handle)
1981 s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
1983 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1984 s = format (s, "vtr_op %d ", ntohl (mp->vtr_op));
1985 s = format (s, "push_dot1q %d ", ntohl (mp->push_dot1q));
1986 s = format (s, "tag1 %d ", ntohl (mp->tag1));
1987 s = format (s, "tag2 %d ", ntohl (mp->tag2));
1992 static void *vl_api_create_vhost_user_if_t_print
1993 (vl_api_create_vhost_user_if_t * mp, void *handle)
1997 s = format (0, "SCRIPT: create_vhost_user_if ");
1999 s = format (s, "socket %s ", mp->sock_filename);
2001 s = format (s, "server ");
2003 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
2004 if (mp->disable_mrg_rxbuf)
2005 s = format (s, "disable_mrg_rxbuf ");
2006 if (mp->disable_indirect_desc)
2007 s = format (s, "disable_indirect_desc ");
2009 s = format (s, "tag %s", mp->tag);
2014 static void *vl_api_modify_vhost_user_if_t_print
2015 (vl_api_modify_vhost_user_if_t * mp, void *handle)
2019 s = format (0, "SCRIPT: modify_vhost_user_if ");
2021 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2022 s = format (s, "socket %s ", mp->sock_filename);
2024 s = format (s, "server ");
2026 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
2031 static void *vl_api_delete_vhost_user_if_t_print
2032 (vl_api_delete_vhost_user_if_t * mp, void *handle)
2036 s = format (0, "SCRIPT: delete_vhost_user_if ");
2037 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2042 static void *vl_api_sw_interface_vhost_user_dump_t_print
2043 (vl_api_sw_interface_vhost_user_dump_t * mp, void *handle)
2047 s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
2052 static void *vl_api_sw_interface_dump_t_print
2053 (vl_api_sw_interface_dump_t * mp, void *handle)
2057 s = format (0, "SCRIPT: sw_interface_dump ");
2059 if (mp->name_filter_valid)
2060 s = format (s, "name_filter %s ", mp->name_filter);
2062 s = format (s, "all ");
2067 static void *vl_api_l2_fib_table_dump_t_print
2068 (vl_api_l2_fib_table_dump_t * mp, void *handle)
2072 s = format (0, "SCRIPT: l2_fib_table_dump ");
2074 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
2079 static void *vl_api_control_ping_t_print
2080 (vl_api_control_ping_t * mp, void *handle)
2084 s = format (0, "SCRIPT: control_ping ");
2089 static void *vl_api_want_interface_events_t_print
2090 (vl_api_want_interface_events_t * mp, void *handle)
2094 s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
2095 ntohl (mp->pid), ntohl (mp->enable_disable));
2101 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
2105 s = format (0, "SCRIPT: cli ");
2110 static void *vl_api_cli_inband_t_print
2111 (vl_api_cli_inband_t * mp, void *handle)
2115 u32 length = vl_api_string_len (&mp->cmd);
2117 vec_validate (cmd, length);
2118 clib_memcpy (cmd, vl_api_from_api_string (&mp->cmd), length);
2120 s = format (0, "SCRIPT: exec %v ", cmd);
2126 static void *vl_api_memclnt_create_t_print
2127 (vl_api_memclnt_create_t * mp, void *handle)
2131 s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
2136 static void *vl_api_sockclnt_create_t_print
2137 (vl_api_sockclnt_create_t * mp, void *handle)
2141 s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name);
2146 static void *vl_api_show_version_t_print
2147 (vl_api_show_version_t * mp, void *handle)
2151 s = format (0, "SCRIPT: show_version ");
2156 static void *vl_api_show_threads_t_print
2157 (vl_api_show_threads_t * mp, void *handle)
2161 s = format (0, "SCRIPT: show_threads ");
2166 static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
2167 (vl_api_vxlan_gpe_add_del_tunnel_t * mp, void *handle)
2171 s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
2173 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local);
2174 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote);
2176 u8 is_grp = ip46_address_is_multicast (&remote);
2177 char *remote_name = is_grp ? "group" : "remote";
2179 s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
2180 s = format (s, "%s %U ", remote_name, format_ip46_address,
2181 &remote, IP46_TYPE_ANY);
2184 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
2185 s = format (s, "protocol %d ", ntohl (mp->protocol));
2187 s = format (s, "vni %d ", ntohl (mp->vni));
2189 if (mp->is_add == 0)
2190 s = format (s, "del ");
2192 if (mp->encap_vrf_id)
2193 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
2195 if (mp->decap_vrf_id)
2196 s = format (s, "decap-vrf-id %d ", ntohl (mp->decap_vrf_id));
2201 static void *vl_api_vxlan_gpe_tunnel_dump_t_print
2202 (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
2206 s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
2208 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2213 static void *vl_api_interface_name_renumber_t_print
2214 (vl_api_interface_name_renumber_t * mp, void *handle)
2218 s = format (0, "SCRIPT: interface_renumber ");
2220 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2222 s = format (s, "new_show_dev_instance %d ",
2223 ntohl (mp->new_show_dev_instance));
2228 static void *vl_api_ip_probe_neighbor_t_print
2229 (vl_api_ip_probe_neighbor_t * mp, void *handle)
2233 s = format (0, "SCRIPT: ip_probe_neighbor ");
2234 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2235 s = format (s, "address %U ", format_vl_api_address, &mp->dst);
2240 static void *vl_api_ip_scan_neighbor_enable_disable_t_print
2241 (vl_api_ip_scan_neighbor_enable_disable_t * mp, void *handle)
2245 s = format (0, "SCRIPT: ip_scan_neighbor_enable_disable ");
2249 case IP_SCAN_V4_NEIGHBORS:
2250 s = format (s, "ip4 ");
2252 case IP_SCAN_V6_NEIGHBORS:
2253 s = format (s, "ip6 ");
2255 case IP_SCAN_V46_NEIGHBORS:
2256 s = format (s, "both ");
2259 s = format (s, "disable ");
2262 s = format (s, "interval %d ", mp->scan_interval);
2263 s = format (s, "max-time %d ", mp->max_proc_time);
2264 s = format (s, "max-update %d ", mp->max_update);
2265 s = format (s, "delay %d ", mp->scan_int_delay);
2266 s = format (s, "stale %d ", mp->stale_threshold);
2271 static void *vl_api_want_ip4_arp_events_t_print
2272 (vl_api_want_ip4_arp_events_t * mp, void *handle)
2276 s = format (0, "SCRIPT: want_ip4_arp_events ");
2277 s = format (s, "pid %d address %U ", ntohl (mp->pid),
2278 format_ip4_address, mp->ip);
2279 if (mp->enable_disable == 0)
2280 s = format (s, "del ");
2285 static void *vl_api_want_ip6_nd_events_t_print
2286 (vl_api_want_ip6_nd_events_t * mp, void *handle)
2290 s = format (0, "SCRIPT: want_ip6_nd_events ");
2291 s = format (s, "pid %d address %U ", ntohl (mp->pid),
2292 format_vl_api_ip6_address, mp->ip);
2293 if (mp->enable_disable == 0)
2294 s = format (s, "del ");
2299 static void *vl_api_want_l2_macs_events_t_print
2300 (vl_api_want_l2_macs_events_t * mp, void *handle)
2304 s = format (0, "SCRIPT: want_l2_macs_events ");
2305 s = format (s, "learn-limit %d ", ntohl (mp->learn_limit));
2306 s = format (s, "scan-delay %d ", (u32) mp->scan_delay);
2307 s = format (s, "max-entries %d ", (u32) mp->max_macs_in_event * 10);
2308 if (mp->enable_disable == 0)
2309 s = format (s, "disable");
2314 static void *vl_api_input_acl_set_interface_t_print
2315 (vl_api_input_acl_set_interface_t * mp, void *handle)
2319 s = format (0, "SCRIPT: input_acl_set_interface ");
2321 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2322 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2323 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2324 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2326 if (mp->is_add == 0)
2327 s = format (s, "del ");
2332 static void *vl_api_output_acl_set_interface_t_print
2333 (vl_api_output_acl_set_interface_t * mp, void *handle)
2337 s = format (0, "SCRIPT: output_acl_set_interface ");
2339 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2340 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2341 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2342 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2344 if (mp->is_add == 0)
2345 s = format (s, "del ");
2350 static void *vl_api_ip_address_dump_t_print
2351 (vl_api_ip_address_dump_t * mp, void *handle)
2355 s = format (0, "SCRIPT: ip6_address_dump ");
2356 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2357 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2363 vl_api_ip_dump_t_print (vl_api_ip_dump_t * mp, void *handle)
2367 s = format (0, "SCRIPT: ip_dump ");
2368 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2373 static void *vl_api_cop_interface_enable_disable_t_print
2374 (vl_api_cop_interface_enable_disable_t * mp, void *handle)
2378 s = format (0, "SCRIPT: cop_interface_enable_disable ");
2379 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2380 if (mp->enable_disable)
2381 s = format (s, "enable ");
2383 s = format (s, "disable ");
2388 static void *vl_api_cop_whitelist_enable_disable_t_print
2389 (vl_api_cop_whitelist_enable_disable_t * mp, void *handle)
2393 s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
2394 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2395 s = format (s, "fib-id %d ", ntohl (mp->fib_id));
2397 s = format (s, "ip4 ");
2399 s = format (s, "ip6 ");
2400 if (mp->default_cop)
2401 s = format (s, "default ");
2406 static void *vl_api_af_packet_create_t_print
2407 (vl_api_af_packet_create_t * mp, void *handle)
2411 s = format (0, "SCRIPT: af_packet_create ");
2412 s = format (s, "host_if_name %s ", mp->host_if_name);
2413 if (mp->use_random_hw_addr)
2414 s = format (s, "hw_addr random ");
2416 s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
2421 static void *vl_api_af_packet_delete_t_print
2422 (vl_api_af_packet_delete_t * mp, void *handle)
2426 s = format (0, "SCRIPT: af_packet_delete ");
2427 s = format (s, "host_if_name %s ", mp->host_if_name);
2432 static void *vl_api_af_packet_dump_t_print
2433 (vl_api_af_packet_dump_t * mp, void *handle)
2437 s = format (0, "SCRIPT: af_packet_dump ");
2443 format_policer_action (u8 * s, va_list * va)
2445 u32 action = va_arg (*va, u32);
2446 u32 dscp = va_arg (*va, u32);
2449 if (action == SSE2_QOS_ACTION_DROP)
2450 s = format (s, "drop");
2451 else if (action == SSE2_QOS_ACTION_TRANSMIT)
2452 s = format (s, "transmit");
2453 else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
2455 s = format (s, "mark-and-transmit ");
2458 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
2464 s = format (s, "%s", t);
2469 static void *vl_api_policer_add_del_t_print
2470 (vl_api_policer_add_del_t * mp, void *handle)
2474 s = format (0, "SCRIPT: policer_add_del ");
2475 s = format (s, "name %s ", mp->name);
2476 s = format (s, "cir %d ", mp->cir);
2477 s = format (s, "eir %d ", mp->eir);
2478 s = format (s, "cb %d ", mp->cb);
2479 s = format (s, "eb %d ", mp->eb);
2481 switch (mp->rate_type)
2483 case SSE2_QOS_RATE_KBPS:
2484 s = format (s, "rate_type kbps ");
2486 case SSE2_QOS_RATE_PPS:
2487 s = format (s, "rate_type pps ");
2493 switch (mp->round_type)
2495 case SSE2_QOS_ROUND_TO_CLOSEST:
2496 s = format (s, "round_type closest ");
2498 case SSE2_QOS_ROUND_TO_UP:
2499 s = format (s, "round_type up ");
2501 case SSE2_QOS_ROUND_TO_DOWN:
2502 s = format (s, "round_type down ");
2510 case SSE2_QOS_POLICER_TYPE_1R2C:
2511 s = format (s, "type 1r2c ");
2513 case SSE2_QOS_POLICER_TYPE_1R3C_RFC_2697:
2514 s = format (s, "type 1r3c ");
2516 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_2698:
2517 s = format (s, "type 2r3c-2698 ");
2519 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_4115:
2520 s = format (s, "type 2r3c-4115 ");
2522 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1:
2523 s = format (s, "type 2r3c-mef5cf1 ");
2529 s = format (s, "conform_action %U ", format_policer_action,
2530 mp->conform_action_type, mp->conform_dscp);
2531 s = format (s, "exceed_action %U ", format_policer_action,
2532 mp->exceed_action_type, mp->exceed_dscp);
2533 s = format (s, "violate_action %U ", format_policer_action,
2534 mp->violate_action_type, mp->violate_dscp);
2536 if (mp->color_aware)
2537 s = format (s, "color-aware ");
2538 if (mp->is_add == 0)
2539 s = format (s, "del ");
2544 static void *vl_api_policer_dump_t_print
2545 (vl_api_policer_dump_t * mp, void *handle)
2549 s = format (0, "SCRIPT: policer_dump ");
2550 if (mp->match_name_valid)
2551 s = format (s, "name %s ", mp->match_name);
2556 static void *vl_api_policer_classify_set_interface_t_print
2557 (vl_api_policer_classify_set_interface_t * mp, void *handle)
2561 s = format (0, "SCRIPT: policer_classify_set_interface ");
2562 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2563 if (mp->ip4_table_index != ~0)
2564 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2565 if (mp->ip6_table_index != ~0)
2566 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2567 if (mp->l2_table_index != ~0)
2568 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2569 if (mp->is_add == 0)
2570 s = format (s, "del ");
2575 static void *vl_api_policer_classify_dump_t_print
2576 (vl_api_policer_classify_dump_t * mp, void *handle)
2580 s = format (0, "SCRIPT: policer_classify_dump ");
2583 case POLICER_CLASSIFY_TABLE_IP4:
2584 s = format (s, "type ip4 ");
2586 case POLICER_CLASSIFY_TABLE_IP6:
2587 s = format (s, "type ip6 ");
2589 case POLICER_CLASSIFY_TABLE_L2:
2590 s = format (s, "type l2 ");
2599 static void *vl_api_sw_interface_clear_stats_t_print
2600 (vl_api_sw_interface_clear_stats_t * mp, void *handle)
2604 s = format (0, "SCRIPT: sw_interface_clear_stats ");
2605 if (mp->sw_if_index != ~0)
2606 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2611 static void *vl_api_mpls_tunnel_dump_t_print
2612 (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2616 s = format (0, "SCRIPT: mpls_tunnel_dump ");
2618 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2623 static void *vl_api_mpls_fib_dump_t_print
2624 (vl_api_mpls_fib_dump_t * mp, void *handle)
2628 s = format (0, "SCRIPT: mpls_fib_decap_dump ");
2633 static void *vl_api_ip_fib_dump_t_print
2634 (vl_api_ip_fib_dump_t * mp, void *handle)
2638 s = format (0, "SCRIPT: ip_fib_dump ");
2643 static void *vl_api_ip6_fib_dump_t_print
2644 (vl_api_ip6_fib_dump_t * mp, void *handle)
2648 s = format (0, "SCRIPT: ip6_fib_dump ");
2653 static void *vl_api_classify_table_ids_t_print
2654 (vl_api_classify_table_ids_t * mp, void *handle)
2658 s = format (0, "SCRIPT: classify_table_ids ");
2663 static void *vl_api_classify_table_by_interface_t_print
2664 (vl_api_classify_table_by_interface_t * mp, void *handle)
2668 s = format (0, "SCRIPT: classify_table_by_interface ");
2669 if (mp->sw_if_index != ~0)
2670 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2675 static void *vl_api_classify_table_info_t_print
2676 (vl_api_classify_table_info_t * mp, void *handle)
2680 s = format (0, "SCRIPT: classify_table_info ");
2681 if (mp->table_id != ~0)
2682 s = format (s, "table_id %d ", ntohl (mp->table_id));
2687 static void *vl_api_classify_session_dump_t_print
2688 (vl_api_classify_session_dump_t * mp, void *handle)
2692 s = format (0, "SCRIPT: classify_session_dump ");
2693 if (mp->table_id != ~0)
2694 s = format (s, "table_id %d ", ntohl (mp->table_id));
2699 static void *vl_api_set_ipfix_exporter_t_print
2700 (vl_api_set_ipfix_exporter_t * mp, void *handle)
2704 s = format (0, "SCRIPT: set_ipfix_exporter ");
2706 s = format (s, "collector-address %U ", format_ip4_address,
2707 (ip4_address_t *) mp->collector_address);
2708 s = format (s, "collector-port %d ", ntohs (mp->collector_port));
2709 s = format (s, "src-address %U ", format_ip4_address,
2710 (ip4_address_t *) mp->src_address);
2711 s = format (s, "vrf-id %d ", ntohl (mp->vrf_id));
2712 s = format (s, "path-mtu %d ", ntohl (mp->path_mtu));
2713 s = format (s, "template-interval %d ", ntohl (mp->template_interval));
2714 s = format (s, "udp-checksum %d ", mp->udp_checksum);
2719 static void *vl_api_ipfix_exporter_dump_t_print
2720 (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2724 s = format (0, "SCRIPT: ipfix_exporter_dump ");
2729 static void *vl_api_set_ipfix_classify_stream_t_print
2730 (vl_api_set_ipfix_classify_stream_t * mp, void *handle)
2734 s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2736 s = format (s, "domain-id %d ", ntohl (mp->domain_id));
2737 s = format (s, "src-port %d ", ntohs (mp->src_port));
2742 static void *vl_api_ipfix_classify_stream_dump_t_print
2743 (vl_api_ipfix_classify_stream_dump_t * mp, void *handle)
2747 s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2752 static void *vl_api_ipfix_classify_table_add_del_t_print
2753 (vl_api_ipfix_classify_table_add_del_t * mp, void *handle)
2757 s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2759 s = format (s, "table-id %d ", ntohl (mp->table_id));
2760 s = format (s, "ip-version %d ", mp->ip_version);
2761 s = format (s, "transport-protocol %d ", mp->transport_protocol);
2766 static void *vl_api_ipfix_classify_table_dump_t_print
2767 (vl_api_ipfix_classify_table_dump_t * mp, void *handle)
2771 s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2776 static void *vl_api_sw_interface_span_enable_disable_t_print
2777 (vl_api_sw_interface_span_enable_disable_t * mp, void *handle)
2781 s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2782 s = format (s, "src_sw_if_index %u ", ntohl (mp->sw_if_index_from));
2783 s = format (s, "dst_sw_if_index %u ", ntohl (mp->sw_if_index_to));
2786 s = format (s, "l2 ");
2791 s = format (s, "disable ");
2794 s = format (s, "rx ");
2797 s = format (s, "tx ");
2801 s = format (s, "both ");
2809 vl_api_sw_interface_span_dump_t_print (vl_api_sw_interface_span_dump_t * mp,
2814 s = format (0, "SCRIPT: sw_interface_span_dump ");
2817 s = format (s, "l2 ");
2822 static void *vl_api_get_next_index_t_print
2823 (vl_api_get_next_index_t * mp, void *handle)
2827 s = format (0, "SCRIPT: get_next_index ");
2828 s = format (s, "node-name %s ", mp->node_name);
2829 s = format (s, "next-node-name %s ", mp->next_name);
2834 static void *vl_api_pg_create_interface_t_print
2835 (vl_api_pg_create_interface_t * mp, void *handle)
2839 s = format (0, "SCRIPT: pg_create_interface ");
2840 s = format (0, "if_id %d", ntohl (mp->interface_id));
2845 static void *vl_api_pg_capture_t_print
2846 (vl_api_pg_capture_t * mp, void *handle)
2850 s = format (0, "SCRIPT: pg_capture ");
2851 s = format (0, "if_id %d ", ntohl (mp->interface_id));
2852 s = format (0, "pcap %s", mp->pcap_file_name);
2853 if (mp->count != ~0)
2854 s = format (s, "count %d ", ntohl (mp->count));
2855 if (!mp->is_enabled)
2856 s = format (s, "disable");
2861 static void *vl_api_pg_enable_disable_t_print
2862 (vl_api_pg_enable_disable_t * mp, void *handle)
2866 s = format (0, "SCRIPT: pg_enable_disable ");
2867 if (ntohl (mp->stream_name_length) > 0)
2868 s = format (s, "stream %s", mp->stream_name);
2869 if (!mp->is_enabled)
2870 s = format (s, "disable");
2875 static void *vl_api_ip_source_and_port_range_check_add_del_t_print
2876 (vl_api_ip_source_and_port_range_check_add_del_t * mp, void *handle)
2881 s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2882 s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
2884 for (i = 0; i < mp->number_of_ranges; i++)
2886 s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2889 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
2891 if (mp->is_add == 0)
2892 s = format (s, "del ");
2897 static void *vl_api_ip_source_and_port_range_check_interface_add_del_t_print
2898 (vl_api_ip_source_and_port_range_check_interface_add_del_t * mp,
2903 s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2905 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2907 if (mp->tcp_out_vrf_id != ~0)
2908 s = format (s, "tcp-out-vrf %d ", ntohl (mp->tcp_out_vrf_id));
2910 if (mp->udp_out_vrf_id != ~0)
2911 s = format (s, "udp-out-vrf %d ", ntohl (mp->udp_out_vrf_id));
2913 if (mp->tcp_in_vrf_id != ~0)
2914 s = format (s, "tcp-in-vrf %d ", ntohl (mp->tcp_in_vrf_id));
2916 if (mp->udp_in_vrf_id != ~0)
2917 s = format (s, "udp-in-vrf %d ", ntohl (mp->udp_in_vrf_id));
2919 if (mp->is_add == 0)
2920 s = format (s, "del ");
2925 static void *vl_api_lisp_enable_disable_t_print
2926 (vl_api_lisp_enable_disable_t * mp, void *handle)
2930 s = format (0, "SCRIPT: lisp_enable_disable %s",
2931 mp->is_en ? "enable" : "disable");
2936 static void *vl_api_gpe_add_del_iface_t_print
2937 (vl_api_gpe_add_del_iface_t * mp, void *handle)
2941 s = format (0, "SCRIPT: gpe_add_del_iface ");
2943 s = format (s, "%s ", mp->is_add ? "up" : "down");
2944 s = format (s, "vni %d ", mp->vni);
2945 s = format (s, "%s %d ", mp->is_l2 ? "bd_id" : "table_id", mp->dp_table);
2950 static void *vl_api_lisp_pitr_set_locator_set_t_print
2951 (vl_api_lisp_pitr_set_locator_set_t * mp, void *handle)
2955 s = format (0, "SCRIPT: lisp_pitr_set_locator_set ");
2958 s = format (s, "locator-set %s ", mp->ls_name);
2960 s = format (s, "del");
2966 format_lisp_flat_eid (u8 * s, va_list * args)
2968 u32 type = va_arg (*args, u32);
2969 u8 *eid = va_arg (*args, u8 *);
2970 u32 eid_len = va_arg (*args, u32);
2975 return format (s, "%U/%d", format_ip4_address, eid, eid_len);
2977 return format (s, "%U/%d", format_ip6_address, eid, eid_len);
2979 return format (s, "%U", format_ethernet_address, eid);
2984 static void *vl_api_lisp_add_del_remote_mapping_t_print
2985 (vl_api_lisp_add_del_remote_mapping_t * mp, void *handle)
2990 s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
2993 s = format (s, "del-all ");
2995 s = format (s, "%s ", mp->is_add ? "add" : "del");
2996 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2998 s = format (s, "eid %U ", format_lisp_flat_eid,
2999 mp->eid_type, mp->eid, mp->eid_len);
3003 s = format (s, "seid %U ", format_lisp_flat_eid,
3004 mp->eid_type, mp->seid, mp->seid_len);
3006 rloc_num = clib_net_to_host_u32 (mp->rloc_num);
3009 s = format (s, "action %d", mp->action);
3014 static void *vl_api_lisp_add_del_adjacency_t_print
3015 (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
3019 s = format (0, "SCRIPT: lisp_add_del_adjacency ");
3021 s = format (s, "%s ", mp->is_add ? "add" : "del");
3022 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3023 s = format (s, "reid %U leid %U ",
3024 format_lisp_flat_eid, mp->eid_type, mp->reid, mp->reid_len,
3025 format_lisp_flat_eid, mp->eid_type, mp->leid, mp->leid_len);
3030 static void *vl_api_lisp_add_del_map_request_itr_rlocs_t_print
3031 (vl_api_lisp_add_del_map_request_itr_rlocs_t * mp, void *handle)
3035 s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
3038 s = format (s, "%s", mp->locator_set_name);
3040 s = format (s, "del");
3045 static void *vl_api_lisp_eid_table_add_del_map_t_print
3046 (vl_api_lisp_eid_table_add_del_map_t * mp, void *handle)
3050 s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
3053 s = format (s, "del ");
3055 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3056 s = format (s, "%s %d ",
3057 mp->is_l2 ? "bd_index" : "vrf",
3058 clib_net_to_host_u32 (mp->dp_table));
3062 static void *vl_api_lisp_add_del_local_eid_t_print
3063 (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
3067 s = format (0, "SCRIPT: lisp_add_del_local_eid ");
3070 s = format (s, "del ");
3072 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3073 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
3075 s = format (s, "locator-set %s ", mp->locator_set_name);
3078 u32 key_id = mp->key_id;
3079 s = format (s, "key-id %U", format_hmac_key_id, key_id);
3080 s = format (s, "secret-key %s", mp->key);
3085 static void *vl_api_gpe_add_del_fwd_entry_t_print
3086 (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle)
3090 s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO");
3095 static void *vl_api_lisp_add_del_map_resolver_t_print
3096 (vl_api_lisp_add_del_map_resolver_t * mp, void *handle)
3100 s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
3103 s = format (s, "del ");
3106 s = format (s, "%U ", format_ip6_address, mp->ip_address);
3108 s = format (s, "%U ", format_ip4_address, mp->ip_address);
3113 static void *vl_api_gpe_enable_disable_t_print
3114 (vl_api_gpe_enable_disable_t * mp, void *handle)
3118 s = format (0, "SCRIPT: gpe_enable_disable ");
3120 s = format (s, "%s ", mp->is_en ? "enable" : "disable");
3125 static void *vl_api_lisp_add_del_locator_set_t_print
3126 (vl_api_lisp_add_del_locator_set_t * mp, void *handle)
3130 s = format (0, "SCRIPT: lisp_add_del_locator_set ");
3133 s = format (s, "del ");
3135 s = format (s, "locator-set %s ", mp->locator_set_name);
3140 static void *vl_api_lisp_add_del_locator_t_print
3141 (vl_api_lisp_add_del_locator_t * mp, void *handle)
3145 s = format (0, "SCRIPT: lisp_add_del_locator ");
3148 s = format (s, "del ");
3150 s = format (s, "locator-set %s ", mp->locator_set_name);
3151 s = format (s, "sw_if_index %d ", mp->sw_if_index);
3152 s = format (s, "p %d w %d ", mp->priority, mp->weight);
3157 static void *vl_api_lisp_locator_set_dump_t_print
3158 (vl_api_lisp_locator_set_dump_t * mp, void *handle)
3162 s = format (0, "SCRIPT: lisp_locator_set_dump ");
3163 if (mp->filter == 1)
3164 s = format (s, "local");
3165 else if (mp->filter == 2)
3166 s = format (s, "remote");
3171 static void *vl_api_lisp_locator_dump_t_print
3172 (vl_api_lisp_locator_dump_t * mp, void *handle)
3176 s = format (0, "SCRIPT: lisp_locator_dump ");
3177 if (mp->is_index_set)
3178 s = format (s, "ls_index %d", clib_net_to_host_u32 (mp->ls_index));
3180 s = format (s, "ls_name %s", mp->ls_name);
3185 static void *vl_api_lisp_map_request_mode_t_print
3186 (vl_api_lisp_map_request_mode_t * mp, void *handle)
3190 s = format (0, "SCRIPT: lisp_map_request_mode ");
3195 s = format (s, "dst-only");
3198 s = format (s, "src-dst");
3206 static void *vl_api_lisp_eid_table_dump_t_print
3207 (vl_api_lisp_eid_table_dump_t * mp, void *handle)
3211 s = format (0, "SCRIPT: lisp_eid_table_dump ");
3215 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3216 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type,
3217 mp->eid, mp->prefix_length);
3221 s = format (s, "local ");
3224 s = format (s, "remote ");
3231 static void *vl_api_lisp_rloc_probe_enable_disable_t_print
3232 (vl_api_lisp_rloc_probe_enable_disable_t * mp, void *handle)
3236 s = format (0, "SCRIPT: lisp_rloc_probe_enable_disable ");
3238 s = format (s, "enable");
3240 s = format (s, "disable");
3245 static void *vl_api_lisp_map_register_enable_disable_t_print
3246 (vl_api_lisp_map_register_enable_disable_t * mp, void *handle)
3250 s = format (0, "SCRIPT: lisp_map_register_enable_disable ");
3252 s = format (s, "enable");
3254 s = format (s, "disable");
3259 static void *vl_api_lisp_adjacencies_get_t_print
3260 (vl_api_lisp_adjacencies_get_t * mp, void *handle)
3264 s = format (0, "SCRIPT: lisp_adjacencies_get ");
3265 s = format (s, "vni %d", clib_net_to_host_u32 (mp->vni));
3270 static void *vl_api_lisp_eid_table_map_dump_t_print
3271 (vl_api_lisp_eid_table_map_dump_t * mp, void *handle)
3275 s = format (0, "SCRIPT: lisp_eid_table_map_dump ");
3278 s = format (s, "l2");
3280 s = format (s, "l3");
3285 static void *vl_api_ipsec_tunnel_if_add_del_t_print
3286 (vl_api_ipsec_tunnel_if_add_del_t * mp, void *handle)
3290 s = format (0, "SCRIPT: ipsec_tunnel_if_add_del ");
3293 s = format (s, "esn");
3294 if (mp->anti_replay)
3295 s = format (s, "anti-replay");
3297 s = format (s, "udp-encap");
3299 s = format (s, "local-ip %U ", format_vl_api_address, &mp->remote_ip);
3301 s = format (s, "remote-ip %U ", format_vl_api_address, &mp->local_ip);
3302 s = format (s, "tx-table-id %d ", ntohl (mp->tx_table_id));
3304 s = format (s, "local-spi %d ", ntohl (mp->local_spi));
3306 s = format (s, "remote-spi %d ", ntohl (mp->remote_spi));
3308 s = format (s, "local-crypto-key-len %d ", mp->local_crypto_key_len);
3309 s = format (s, "local-crypto-key %U ", format_hex_bytes,
3310 mp->local_crypto_key, mp->local_crypto_key_len, 0);
3311 s = format (s, "remote-crypto-key-len %d ", mp->remote_crypto_key_len);
3312 s = format (s, "remote-crypto-key %U ", format_hex_bytes,
3313 mp->remote_crypto_key, mp->remote_crypto_key_len, 0);
3314 s = format (s, "local-integ-key-len %d ", mp->local_integ_key_len);
3315 s = format (s, "local-integ-key %U ", format_hex_bytes,
3316 mp->local_integ_key, mp->local_integ_key_len, 0);
3317 s = format (s, "remote-integ-key-len %d ", mp->remote_integ_key_len);
3318 s = format (s, "remote-integ-key %U ", format_hex_bytes,
3319 mp->remote_integ_key, mp->remote_integ_key_len, 0);
3321 if (mp->is_add == 0)
3322 s = format (s, "del ");
3327 static void *vl_api_ipsec_gre_tunnel_add_del_t_print
3328 (vl_api_ipsec_gre_tunnel_add_del_t * mp, void *handle)
3332 s = format (0, "SCRIPT: ipsec_gre_tunnel_add_del ");
3334 s = format (s, "dst %U ", format_vl_api_ip4_address, mp->tunnel.dst);
3336 s = format (s, "src %U ", format_vl_api_ip4_address, mp->tunnel.src);
3338 s = format (s, "local_sa %d ", ntohl (mp->tunnel.local_sa_id));
3340 s = format (s, "remote_sa %d ", ntohl (mp->tunnel.remote_sa_id));
3342 if (mp->is_add == 0)
3343 s = format (s, "del ");
3348 static void *vl_api_ipsec_gre_tunnel_dump_t_print
3349 (vl_api_ipsec_gre_tunnel_dump_t * mp, void *handle)
3353 s = format (0, "SCRIPT: ipsec_gre_tunnel_dump ");
3355 if (mp->sw_if_index != ~0)
3356 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3361 static void *vl_api_l2_interface_pbb_tag_rewrite_t_print
3362 (vl_api_l2_interface_pbb_tag_rewrite_t * mp, void *handle)
3365 u32 vtr_op = ntohl (mp->vtr_op);
3367 s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
3369 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3370 s = format (s, "vtr_op %d ", vtr_op);
3371 if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
3373 if (vtr_op == L2_VTR_TRANSLATE_2_2)
3374 s = format (s, "%d ", ntohs (mp->outer_tag));
3375 s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
3376 s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
3377 s = format (s, "sid %d ", ntohl (mp->i_sid));
3378 s = format (s, "vlanid %d ", ntohs (mp->b_vlanid));
3383 static void *vl_api_flow_classify_set_interface_t_print
3384 (vl_api_flow_classify_set_interface_t * mp, void *handle)
3388 s = format (0, "SCRIPT: flow_classify_set_interface ");
3389 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3390 if (mp->ip4_table_index != ~0)
3391 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
3392 if (mp->ip6_table_index != ~0)
3393 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
3394 if (mp->is_add == 0)
3395 s = format (s, "del ");
3401 vl_api_set_punt_t_print (vl_api_set_punt_t * mp, void *handle)
3405 s = format (0, "SCRIPT: punt ");
3407 switch (clib_net_to_host_u32 (mp->punt.type))
3409 case PUNT_API_TYPE_L4:
3410 s = format (s, "%U", format_vl_api_address_family, mp->punt.punt.l4.af);
3412 s = format (s, "protocol %d ", mp->punt.punt.l4.protocol);
3414 if (mp->punt.punt.l4.port != (u16) ~ 0)
3415 s = format (s, "port %d ", ntohs (mp->punt.punt.l4.port));
3420 s = format (s, "del ");
3425 static void *vl_api_flow_classify_dump_t_print
3426 (vl_api_flow_classify_dump_t * mp, void *handle)
3430 s = format (0, "SCRIPT: flow_classify_dump ");
3433 case FLOW_CLASSIFY_TABLE_IP4:
3434 s = format (s, "type ip4 ");
3436 case FLOW_CLASSIFY_TABLE_IP6:
3437 s = format (s, "type ip6 ");
3446 static void *vl_api_get_first_msg_id_t_print
3447 (vl_api_get_first_msg_id_t * mp, void *handle)
3451 s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
3456 static void *vl_api_ioam_enable_t_print
3457 (vl_api_ioam_enable_t * mp, void *handle)
3461 s = format (0, "SCRIPT: ioam_enable ");
3463 if (mp->trace_enable)
3464 s = format (s, "trace enabled");
3467 s = format (s, "POT enabled");
3470 s = format (s, "Seqno enabled");
3473 s = format (s, "Analyse enabled");
3478 static void *vl_api_ioam_disable_t_print
3479 (vl_api_ioam_disable_t * mp, void *handle)
3483 s = format (0, "SCRIPT: ioam_disable ");
3484 s = format (s, "trace disabled");
3485 s = format (s, "POT disabled");
3486 s = format (s, "Seqno disabled");
3487 s = format (s, "Analyse disabled");
3492 static void *vl_api_feature_enable_disable_t_print
3493 (vl_api_feature_enable_disable_t * mp, void *handle)
3497 s = format (0, "SCRIPT: feature_enable_disable ");
3498 s = format (s, "arc_name %s ", mp->arc_name);
3499 s = format (s, "feature_name %s ", mp->feature_name);
3500 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3502 s = format (s, "disable");
3507 static void *vl_api_sw_interface_tag_add_del_t_print
3508 (vl_api_sw_interface_tag_add_del_t * mp, void *handle)
3512 s = format (0, "SCRIPT: sw_interface_tag_add_del ");
3513 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3515 s = format (s, "tag %s ", mp->tag);
3517 s = format (s, "del ");
3522 static void *vl_api_hw_interface_set_mtu_t_print
3523 (vl_api_hw_interface_set_mtu_t * mp, void *handle)
3527 s = format (0, "SCRIPT: sw_interface_set_mtu ");
3528 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3529 s = format (s, "tag %d ", ntohs (mp->mtu));
3534 static void *vl_api_p2p_ethernet_add_t_print
3535 (vl_api_p2p_ethernet_add_t * mp, void *handle)
3539 s = format (0, "SCRIPT: p2p_ethernet_add ");
3540 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3541 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3546 static void *vl_api_p2p_ethernet_del_t_print
3547 (vl_api_p2p_ethernet_del_t * mp, void *handle)
3551 s = format (0, "SCRIPT: p2p_ethernet_del ");
3552 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3553 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3558 static void *vl_api_tcp_configure_src_addresses_t_print
3559 (vl_api_tcp_configure_src_addresses_t * mp, void *handle)
3563 s = format (0, "SCRIPT: tcp_configure_src_addresses ");
3565 s = format (s, "%U - %U ",
3566 format_ip6_address, (ip6_address_t *) mp->first_address,
3567 format_ip6_address, (ip6_address_t *) mp->last_address);
3569 s = format (s, "%U - %U ",
3570 format_ip4_address, (ip4_address_t *) mp->first_address,
3571 format_ip4_address, (ip4_address_t *) mp->last_address);
3574 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
3579 static void *vl_api_app_namespace_add_del_t_print
3580 (vl_api_app_namespace_add_del_t * mp, void *handle)
3583 u8 len = clib_min (mp->namespace_id_len,
3584 ARRAY_LEN (mp->namespace_id) - 1);
3585 mp->namespace_id[len] = 0;
3586 s = format (0, "SCRIPT: app_namespace_add_del ");
3587 s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d "
3588 "ipv6_fib_id %d", (char *) mp->namespace_id, mp->secret,
3589 clib_net_to_host_u32 (mp->sw_if_index),
3590 clib_net_to_host_u32 (mp->ip4_fib_id),
3591 clib_net_to_host_u32 (mp->ip6_fib_id));
3595 static void *vl_api_lldp_config_t_print
3596 (vl_api_lldp_config_t * mp, void *handle)
3600 s = format (0, "SCRIPT: lldp_config ");
3601 s = format (s, "system_name %s ", mp->system_name);
3602 s = format (s, "tx_hold %d ", ntohl (mp->tx_hold));
3603 s = format (s, "tx_interval %d ", ntohl (mp->tx_interval));
3607 static void *vl_api_dns_enable_disable_t_print
3608 (vl_api_dns_enable_disable_t * mp, void *handle)
3612 s = format (0, "SCRIPT: dns_enable_disable ");
3613 s = format (s, "%s ", mp->enable ? "enable" : "disable");
3618 static void *vl_api_sw_interface_set_lldp_t_print
3619 (vl_api_sw_interface_set_lldp_t * mp, void *handle)
3624 clib_memset (null_data, 0, sizeof (null_data));
3626 s = format (0, "SCRIPT: sw_interface_set_lldp ");
3627 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3629 if (memcmp (mp->port_desc, null_data, sizeof (mp->port_desc)))
3630 s = format (s, "port_desc %s ", mp->port_desc);
3632 if (memcmp (mp->mgmt_ip4, null_data, sizeof (mp->mgmt_ip4)))
3633 s = format (s, "mgmt_ip4 %U ", format_ip4_address, mp->mgmt_ip4);
3635 if (memcmp (mp->mgmt_ip6, null_data, sizeof (mp->mgmt_ip6)))
3636 s = format (s, "mgmt_ip6 %U ", format_ip6_address, mp->mgmt_ip6);
3638 if (memcmp (mp->mgmt_oid, null_data, sizeof (mp->mgmt_oid)))
3639 s = format (s, "mgmt_oid %s ", mp->mgmt_oid);
3641 if (mp->enable == 0)
3642 s = format (s, "disable ");
3647 static void *vl_api_dns_name_server_add_del_t_print
3648 (vl_api_dns_name_server_add_del_t * mp, void *handle)
3652 s = format (0, "SCRIPT: dns_name_server_add_del ");
3654 s = format (s, "%U ", format_ip6_address,
3655 (ip6_address_t *) mp->server_address);
3657 s = format (s, "%U ", format_ip4_address,
3658 (ip4_address_t *) mp->server_address);
3660 if (mp->is_add == 0)
3661 s = format (s, "del ");
3666 static void *vl_api_dns_resolve_name_t_print
3667 (vl_api_dns_resolve_name_t * mp, void *handle)
3671 s = format (0, "SCRIPT: dns_resolve_name ");
3672 s = format (s, "%s ", mp->name);
3676 static void *vl_api_dns_resolve_ip_t_print
3677 (vl_api_dns_resolve_ip_t * mp, void *handle)
3681 s = format (0, "SCRIPT: dns_resolve_ip ");
3683 s = format (s, "%U ", format_ip6_address, mp->address);
3685 s = format (s, "%U ", format_ip4_address, mp->address);
3689 static void *vl_api_session_rule_add_del_t_print
3690 (vl_api_session_rule_add_del_t * mp, void *handle)
3693 char *proto = mp->transport_proto == 0 ? "tcp" : "udp";
3694 s = format (0, "SCRIPT: session_rule_add_del ");
3695 mp->tag[sizeof (mp->tag) - 1] = 0;
3697 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3698 mp->appns_index, mp->scope, proto, format_ip4_address,
3699 (ip4_address_t *) mp->lcl_ip, mp->lcl_plen,
3700 format_ip4_address, (ip4_address_t *) mp->rmt_ip,
3701 mp->rmt_plen, mp->action_index, mp->tag);
3703 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3704 mp->appns_index, mp->scope, proto, format_ip6_address,
3705 (ip6_address_t *) mp->lcl_ip, mp->lcl_plen,
3706 format_ip6_address, (ip6_address_t *) mp->rmt_ip,
3707 mp->rmt_plen, mp->action_index, mp->tag);
3711 static void *vl_api_ip_container_proxy_add_del_t_print
3712 (vl_api_ip_container_proxy_add_del_t * mp, void *handle)
3715 s = format (0, "SCRIPT: ip_container_proxy_add_del ");
3716 s = format (s, "is_add %d prefix %U sw_if_index %d",
3717 mp->is_add, format_vl_api_prefix, mp->sw_if_index);
3722 static void *vl_api_qos_record_enable_disable_t_print
3723 (vl_api_qos_record_enable_disable_t * mp, void *handle)
3727 s = format (0, "SCRIPT: qos_record_enable_disable ");
3728 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3729 s = format (s, "input_source %U ", format_qos_source,
3730 ntohl (mp->input_source));
3733 s = format (s, "disable ");
3738 #define foreach_custom_print_no_arg_function \
3739 _(lisp_eid_table_vni_dump) \
3740 _(lisp_map_resolver_dump) \
3741 _(lisp_map_server_dump) \
3742 _(show_lisp_rloc_probe_state) \
3743 _(show_lisp_map_register_state) \
3744 _(show_lisp_map_request_mode)
3747 static void * vl_api_ ## f ## _t_print \
3748 (vl_api_ ## f ## _t * mp, void * handle) \
3751 s = format (0, "SCRIPT: " #f ); \
3754 foreach_custom_print_no_arg_function
3756 #define foreach_custom_print_function \
3757 _(CREATE_LOOPBACK, create_loopback) \
3758 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
3759 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
3760 _(SW_INTERFACE_EVENT, sw_interface_event) \
3761 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
3762 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
3763 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
3764 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
3765 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
3766 _(SW_INTERFACE_SET_GENEVE_BYPASS, sw_interface_set_geneve_bypass) \
3767 _(BOND_CREATE, bond_create) \
3768 _(BOND_DELETE, bond_delete) \
3769 _(BOND_ENSLAVE, bond_enslave) \
3770 _(BOND_DETACH_SLAVE, bond_detach_slave) \
3771 _(TAP_CREATE_V2, tap_create_v2) \
3772 _(TAP_DELETE_V2, tap_delete_v2) \
3773 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) \
3774 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \
3775 _(IP_TABLE_ADD_DEL, ip_table_add_del) \
3776 _(MPLS_ROUTE_ADD_DEL, mpls_route_add_del) \
3777 _(MPLS_TABLE_ADD_DEL, mpls_table_add_del) \
3778 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
3779 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
3780 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3781 _(SR_MPLS_POLICY_ADD, sr_mpls_policy_add) \
3782 _(SR_MPLS_POLICY_DEL, sr_mpls_policy_del) \
3783 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3784 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
3785 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3786 _(CREATE_SUBIF, create_subif) \
3787 _(RESET_FIB, reset_fib) \
3788 _(DHCP_PROXY_CONFIG, dhcp_proxy_config) \
3789 _(DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss) \
3790 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3791 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \
3792 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \
3793 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
3794 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3795 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3796 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3797 _(SR_POLICY_ADD, sr_policy_add) \
3798 _(SR_POLICY_MOD, sr_policy_mod) \
3799 _(SR_POLICY_DEL, sr_policy_del) \
3800 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3801 _(L2FIB_ADD_DEL, l2fib_add_del) \
3802 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3803 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3804 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3805 _(L2_FLAGS, l2_flags) \
3806 _(BRIDGE_FLAGS, bridge_flags) \
3807 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3808 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3809 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3810 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3811 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3812 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3813 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3814 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3815 _(ADD_NODE_NEXT, add_node_next) \
3816 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \
3817 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \
3818 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \
3819 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \
3820 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
3821 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
3822 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3823 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3824 _(VXLAN_OFFLOAD_RX, vxlan_offload_rx) \
3825 _(GENEVE_ADD_DEL_TUNNEL, geneve_add_del_tunnel) \
3826 _(GENEVE_TUNNEL_DUMP, geneve_tunnel_dump) \
3827 _(GRE_TUNNEL_ADD_DEL, gre_tunnel_add_del) \
3828 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3829 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3830 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3831 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3832 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3833 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3834 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3835 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3836 _(CONTROL_PING, control_ping) \
3837 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3839 _(CLI_INBAND, cli_inband) \
3840 _(MEMCLNT_CREATE, memclnt_create) \
3841 _(SOCKCLNT_CREATE, sockclnt_create) \
3842 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3843 _(SHOW_VERSION, show_version) \
3844 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3845 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3846 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3847 _(VXLAN_GBP_TUNNEL_ADD_DEL, vxlan_gbp_tunnel_add_del) \
3848 _(VXLAN_GBP_TUNNEL_DUMP, vxlan_gbp_tunnel_dump) \
3849 _(SW_INTERFACE_SET_VXLAN_GBP_BYPASS, sw_interface_set_vxlan_gbp_bypass) \
3850 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3851 _(IP_PROBE_NEIGHBOR, ip_probe_neighbor) \
3852 _(IP_SCAN_NEIGHBOR_ENABLE_DISABLE, ip_scan_neighbor_enable_disable) \
3853 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
3854 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \
3855 _(WANT_L2_MACS_EVENTS, want_l2_macs_events) \
3856 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3857 _(IP_ADDRESS_DUMP, ip_address_dump) \
3858 _(IP_DUMP, ip_dump) \
3859 _(DELETE_LOOPBACK, delete_loopback) \
3860 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3861 _(BD_IP_MAC_FLUSH, bd_ip_mac_flush) \
3862 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3863 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3864 _(AF_PACKET_CREATE, af_packet_create) \
3865 _(AF_PACKET_DELETE, af_packet_delete) \
3866 _(AF_PACKET_DUMP, af_packet_dump) \
3867 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3868 _(MPLS_FIB_DUMP, mpls_fib_dump) \
3869 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3870 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3871 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3872 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3873 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3874 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3875 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3876 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3877 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3878 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3879 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3880 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3881 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3882 _(GET_NEXT_INDEX, get_next_index) \
3883 _(PG_CREATE_INTERFACE,pg_create_interface) \
3884 _(PG_CAPTURE, pg_capture) \
3885 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3886 _(POLICER_ADD_DEL, policer_add_del) \
3887 _(POLICER_DUMP, policer_dump) \
3888 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3889 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3890 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3891 ip_source_and_port_range_check_add_del) \
3892 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3893 ip_source_and_port_range_check_interface_add_del) \
3894 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
3895 _(GPE_ENABLE_DISABLE, gpe_enable_disable) \
3896 _(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \
3897 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
3898 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \
3899 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \
3900 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
3901 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
3902 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
3903 lisp_add_del_map_request_itr_rlocs) \
3904 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
3905 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
3906 _(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \
3907 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
3908 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
3909 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
3910 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
3911 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
3912 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \
3913 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
3914 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \
3915 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
3916 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \
3917 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \
3918 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \
3919 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \
3920 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \
3921 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \
3922 _(IPSEC_TUNNEL_IF_ADD_DEL, ipsec_tunnel_if_add_del) \
3923 _(IPSEC_GRE_TUNNEL_ADD_DEL, ipsec_gre_tunnel_add_del) \
3924 _(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \
3925 _(DELETE_SUBIF, delete_subif) \
3926 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3927 _(SET_PUNT, set_punt) \
3928 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3929 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3930 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3931 _(IOAM_ENABLE, ioam_enable) \
3932 _(IOAM_DISABLE, ioam_disable) \
3933 _(IP_FIB_DUMP, ip_fib_dump) \
3934 _(IP6_FIB_DUMP, ip6_fib_dump) \
3935 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3936 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3937 _(HW_INTERFACE_SET_MTU, hw_interface_set_mtu) \
3938 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3939 _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
3940 _(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
3941 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
3942 _(LLDP_CONFIG, lldp_config) \
3943 _(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \
3944 _(DNS_ENABLE_DISABLE, dns_enable_disable) \
3945 _(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \
3946 _(DNS_RESOLVE_NAME, dns_resolve_name) \
3947 _(DNS_RESOLVE_IP, dns_resolve_ip) \
3948 _(SESSION_RULE_ADD_DEL, session_rule_add_del) \
3949 _(OUTPUT_ACL_SET_INTERFACE, output_acl_set_interface) \
3950 _(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable)
3952 vl_msg_api_custom_dump_configure (api_main_t * am)
3954 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3955 = (void *) vl_api_##f##_t_print;
3956 foreach_custom_print_function;
3961 * fd.io coding-style-patch-verification: ON
3963 * Local Variables: eval: (c-set-style "gnu") End: