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 ");
123 static void *vl_api_sw_interface_set_rx_placement_t_print
124 (vl_api_sw_interface_set_rx_placement_t * mp, void *handle)
127 s = format (0, "SCRIPT: sw_interface_set_rx_placement ");
129 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
131 s = format (s, "queue %d ", ntohl (mp->queue_id));
133 s = format (s, "main ");
135 s = format (s, "worker %d ", ntohl (mp->worker_id));
141 static void *vl_api_sw_interface_rx_placement_dump_t_print
142 (vl_api_sw_interface_rx_placement_dump_t * mp, void *handle)
145 u32 sw_if_index = ntohl (mp->sw_if_index);
147 s = format (0, "SCRIPT: sw_interface_rx_placement_dump ");
149 if (sw_if_index != ~0)
150 s = format (s, "sw_if_index %d ", sw_if_index);
155 static void *vl_api_sw_interface_event_t_print
156 (vl_api_sw_interface_event_t * mp, void *handle)
159 s = format (0, "SCRIPT: sw_interface_event ");
161 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
163 if (mp->admin_up_down)
164 s = format (s, "admin-up ");
166 s = format (s, "admin-down ");
168 if (mp->link_up_down)
169 s = format (s, "link-up");
171 s = format (s, "link-down");
174 s = format (s, " deleted");
179 static void *vl_api_sw_interface_add_del_address_t_print
180 (vl_api_sw_interface_add_del_address_t * mp, void *handle)
184 s = format (0, "SCRIPT: sw_interface_add_del_address ");
186 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
189 s = format (s, "%U/%d ", format_ip6_address,
190 (ip6_address_t *) mp->address, mp->address_length);
192 s = format (s, "%U/%d ", format_ip4_address,
193 (ip4_address_t *) mp->address, mp->address_length);
196 s = format (s, "del ");
198 s = format (s, "del-all ");
203 static void *vl_api_sw_interface_set_table_t_print
204 (vl_api_sw_interface_set_table_t * mp, void *handle)
208 s = format (0, "SCRIPT: sw_interface_set_table ");
210 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
213 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
216 s = format (s, "ipv6 ");
221 static void *vl_api_sw_interface_set_mpls_enable_t_print
222 (vl_api_sw_interface_set_mpls_enable_t * mp, void *handle)
226 s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
228 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
231 s = format (s, "disable");
236 static void *vl_api_sw_interface_set_vpath_t_print
237 (vl_api_sw_interface_set_vpath_t * mp, void *handle)
241 s = format (0, "SCRIPT: sw_interface_set_vpath ");
243 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
246 s = format (s, "enable ");
248 s = format (s, "disable ");
253 static void *vl_api_sw_interface_set_vxlan_bypass_t_print
254 (vl_api_sw_interface_set_vxlan_bypass_t * mp, void *handle)
258 s = format (0, "SCRIPT: sw_interface_set_vxlan_bypass ");
260 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
263 s = format (s, "ip6 ");
266 s = format (s, "enable ");
268 s = format (s, "disable ");
273 static void *vl_api_sw_interface_set_geneve_bypass_t_print
274 (vl_api_sw_interface_set_geneve_bypass_t * mp, void *handle)
278 s = format (0, "SCRIPT: sw_interface_set_geneve_bypass ");
280 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
283 s = format (s, "ip6 ");
286 s = format (s, "enable ");
288 s = format (s, "disable ");
293 static void *vl_api_sw_interface_set_l2_xconnect_t_print
294 (vl_api_sw_interface_set_l2_xconnect_t * mp, void *handle)
298 s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
300 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
304 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
307 s = format (s, "delete ");
312 static void *vl_api_sw_interface_set_l2_bridge_t_print
313 (vl_api_sw_interface_set_l2_bridge_t * mp, void *handle)
317 s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
319 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
323 s = format (s, "bd_id %d shg %d ", ntohl (mp->bd_id), mp->shg);
324 if (L2_API_PORT_TYPE_BVI == ntohl (mp->port_type))
325 s = format (s, "bvi ");
326 if (L2_API_PORT_TYPE_UU_FWD == ntohl (mp->port_type))
327 s = format (s, "uu-fwd ");
328 s = format (s, "enable");
331 s = format (s, "disable ");
336 static void *vl_api_bridge_domain_add_del_t_print
337 (vl_api_bridge_domain_add_del_t * mp, void *handle)
341 s = format (0, "SCRIPT: bridge_domain_add_del ");
343 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
348 s = format (s, "bd_tag %s ", mp->bd_tag);
349 s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood);
350 s = format (s, "forward %d learn %d ", mp->forward, mp->learn);
351 s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age);
354 s = format (s, "del ");
359 static void *vl_api_bridge_domain_set_mac_age_t_print
360 (vl_api_bridge_domain_set_mac_age_t * mp, void *handle)
364 s = format (0, "SCRIPT: bridge_domain_set_mac_age ");
366 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
368 s = format (s, "mac-age %d", mp->mac_age);
373 static void *vl_api_bridge_domain_dump_t_print
374 (vl_api_bridge_domain_dump_t * mp, void *handle)
377 u32 bd_id = ntohl (mp->bd_id);
379 s = format (0, "SCRIPT: bridge_domain_dump ");
382 s = format (s, "bd_id %d ", bd_id);
387 static void *vl_api_l2fib_flush_all_t_print
388 (vl_api_l2fib_flush_all_t * mp, void *handle)
392 s = format (0, "SCRIPT: l2fib_flush_all ");
398 static void *vl_api_l2fib_flush_bd_t_print
399 (vl_api_l2fib_flush_bd_t * mp, void *handle)
402 u32 bd_id = ntohl (mp->bd_id);
404 s = format (0, "SCRIPT: l2fib_flush_bd ");
405 s = format (s, "bd_id %d ", bd_id);
410 static void *vl_api_l2fib_flush_int_t_print
411 (vl_api_l2fib_flush_int_t * mp, void *handle)
414 u32 sw_if_index = ntohl (mp->sw_if_index);
416 s = format (0, "SCRIPT: l2fib_flush_int ");
417 s = format (s, "sw_if_index %d ", sw_if_index);
422 static void *vl_api_l2fib_add_del_t_print
423 (vl_api_l2fib_add_del_t * mp, void *handle)
427 s = format (0, "SCRIPT: l2fib_add_del ");
429 s = format (s, "mac %U ", format_ethernet_address, mp->mac);
431 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
436 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
438 s = format (s, "%s", "static ");
440 s = format (s, "%s", "filter ");
442 s = format (s, "%s", "bvi ");
446 s = format (s, "del ");
453 vl_api_l2_flags_t_print (vl_api_l2_flags_t * mp, void *handle)
456 u32 flags = ntohl (mp->feature_bitmap);
458 s = format (0, "SCRIPT: l2_flags ");
460 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
462 if (flags & L2_LEARN)
463 s = format (s, "learn ");
465 s = format (s, "forward ");
466 if (flags & L2_FLOOD)
467 s = format (s, "flood ");
468 if (flags & L2_UU_FLOOD)
469 s = format (s, "uu-flood ");
470 if (flags & L2_ARP_TERM)
471 s = format (s, "arp-term ");
474 s = format (s, "clear ");
479 static void *vl_api_bridge_flags_t_print
480 (vl_api_bridge_flags_t * mp, void *handle)
483 u32 flags = ntohl (mp->flags);
485 s = format (0, "SCRIPT: bridge_flags ");
487 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
489 if (flags & BRIDGE_API_FLAG_LEARN)
490 s = format (s, "learn ");
491 if (flags & BRIDGE_API_FLAG_FWD)
492 s = format (s, "forward ");
493 if (flags & BRIDGE_API_FLAG_FLOOD)
494 s = format (s, "flood ");
495 if (flags & BRIDGE_API_FLAG_UU_FLOOD)
496 s = format (s, "uu-flood ");
497 if (flags & BRIDGE_API_FLAG_ARP_TERM)
498 s = format (s, "arp-term ");
501 s = format (s, "clear ");
506 static void *vl_api_bd_ip_mac_add_del_t_print
507 (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
511 s = format (0, "SCRIPT: bd_ip_mac_add_del ");
512 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
514 s = format (s, "%U ", format_vl_api_address, &mp->ip);
515 s = format (s, "%U ", format_vl_api_mac_address, &mp->mac);
517 s = format (s, "del ");
522 static void *vl_api_bd_ip_mac_flush_t_print
523 (vl_api_bd_ip_mac_flush_t * mp, void *handle)
527 s = format (0, "SCRIPT: bd_ip_mac_flush ");
528 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
534 static void *vl_api_bd_ip_mac_dump_t_print
535 (vl_api_bd_ip_mac_dump_t * mp, void *handle)
539 s = format (0, "SCRIPT: bd_ip_mac_dump ");
544 static void *vl_api_tap_create_v2_t_print
545 (vl_api_tap_create_v2_t * mp, void *handle)
550 clib_memset (null_mac, 0, sizeof (null_mac));
552 s = format (0, "SCRIPT: tap_create_v2 ");
553 s = format (s, "id %u ", ntohl (mp->id));
554 if (memcmp (mp->mac_address, null_mac, 6))
555 s = format (s, "mac-address %U ",
556 format_ethernet_address, mp->mac_address);
557 if (memcmp (mp->host_mac_addr, null_mac, 6))
558 s = format (s, "host-mac-addr %U ",
559 format_ethernet_address, mp->host_mac_addr);
560 if (mp->host_if_name_set)
561 s = format (s, "host-if-name %s ", mp->host_if_name);
562 if (mp->host_namespace_set)
563 s = format (s, "host-ns %s ", mp->host_namespace);
564 if (mp->host_bridge_set)
565 s = format (s, "host-bridge %s ", mp->host_bridge);
566 if (mp->host_ip4_addr_set)
567 s = format (s, "host-ip4-addr %U/%d ", format_ip4_address,
568 mp->host_ip4_addr, mp->host_ip4_prefix_len);
569 if (mp->host_ip6_addr_set)
570 s = format (s, "host-ip6-addr %U/%d ", format_ip6_address,
571 mp->host_ip6_addr, mp->host_ip6_prefix_len);
572 if (mp->host_ip4_gw_set)
573 s = format (s, "host-ip4-gw %U ", format_ip4_address, mp->host_ip4_addr);
574 if (mp->host_ip6_gw_set)
575 s = format (s, "host-ip6-gw %U ", format_ip6_address, mp->host_ip6_addr);
577 s = format (s, "tx-ring-size %u ", ntohs (mp->tx_ring_sz));
579 s = format (s, "rx-ring-size %u ", ntohs (mp->rx_ring_sz));
583 static void *vl_api_tap_delete_v2_t_print
584 (vl_api_tap_delete_v2_t * mp, void *handle)
588 s = format (0, "SCRIPT: tap_delete_v2 ");
589 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
594 static void *vl_api_sw_interface_tap_v2_dump_t_print
595 (vl_api_sw_interface_tap_v2_dump_t * mp, void *handle)
599 s = format (0, "SCRIPT: sw_interface_tap_v2_dump ");
605 static void *vl_api_virtio_pci_create_t_print
606 (vl_api_virtio_pci_create_t * mp, void *handle)
611 clib_memset (null_mac, 0, sizeof (null_mac));
613 s = format (0, "SCRIPT: virtio_pci_create ");
614 s = format (s, "pci_addr %U ", format_vlib_pci_addr, ntohl (mp->pci_addr));
615 if (memcmp (mp->mac_address, null_mac, 6))
616 s = format (s, "mac-address %U ",
617 format_ethernet_address, mp->mac_address);
619 s = format (s, "features 0x%llx ", clib_net_to_host_u64 (mp->features));
621 s = format (s, "gso-enabled");
626 static void *vl_api_virtio_pci_delete_t_print
627 (vl_api_virtio_pci_delete_t * mp, void *handle)
631 s = format (0, "SCRIPT: virtio_pci_delete ");
632 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
638 static void *vl_api_sw_interface_virtio_pci_dump_t_print
639 (vl_api_sw_interface_virtio_pci_dump_t * mp, void *handle)
643 s = format (0, "SCRIPT: sw_interface_virtio_pci_dump ");
648 static void *vl_api_bond_create_t_print
649 (vl_api_bond_create_t * mp, void *handle)
654 clib_memset (null_mac, 0, sizeof (null_mac));
656 s = format (0, "SCRIPT: bond_create ");
657 if (memcmp (mp->mac_address, null_mac, 6))
658 s = format (s, "mac-address %U ",
659 format_ethernet_address, mp->mac_address);
661 s = format (s, "mode %U ", format_bond_mode, mp->mode);
663 s = format (s, "lb %U ", format_bond_load_balance, mp->lb);
665 s = format (s, "id %u ", ntohl (mp->id));
669 static void *vl_api_bond_delete_t_print
670 (vl_api_bond_delete_t * mp, void *handle)
674 s = format (0, "SCRIPT: bond_delete ");
675 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
680 static void *vl_api_bond_enslave_t_print
681 (vl_api_bond_enslave_t * mp, void *handle)
685 s = format (0, "SCRIPT: bond_enslave ");
686 s = format (s, "bond_sw_if_index %u ", mp->bond_sw_if_index);
687 s = format (s, "sw_if_index %u ", mp->sw_if_index);
689 s = format (s, "passive ");
690 if (mp->is_long_timeout)
691 s = format (s, "long-timeout ");
696 static void *vl_api_bond_detach_slave_t_print
697 (vl_api_bond_detach_slave_t * mp, void *handle)
701 s = format (0, "SCRIPT: bond_detach_slave ");
702 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
708 static void *vl_api_sw_interface_bond_dump_t_print
709 (vl_api_sw_interface_bond_dump_t * mp, void *handle)
713 s = format (0, "SCRIPT: sw_interface_bond_dump ");
719 static void *vl_api_sw_interface_slave_dump_t_print
720 (vl_api_sw_interface_slave_dump_t * mp, void *handle)
724 s = format (0, "SCRIPT: sw_interface_slave_dump ");
725 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
730 static void *vl_api_ip_add_del_route_t_print
731 (vl_api_ip_add_del_route_t * mp, void *handle)
735 s = format (0, "SCRIPT: ip_add_del_route ");
737 s = format (s, "del ");
740 s = format (s, "%U/%d ", format_ip6_address, mp->dst_address,
741 mp->dst_address_length);
743 s = format (s, "%U/%d ", format_ip4_address, mp->dst_address,
744 mp->dst_address_length);
746 if (mp->table_id != 0)
747 s = format (s, "vrf %d ", ntohl (mp->table_id));
750 s = format (s, "local ");
751 else if (mp->is_drop)
752 s = format (s, "drop ");
753 else if (mp->is_classify)
754 s = format (s, "classify %d", ntohl (mp->classify_table_index));
755 else if (mp->next_hop_via_label != htonl (MPLS_LABEL_INVALID))
756 s = format (s, "via via_label %d ", ntohl (mp->next_hop_via_label));
760 s = format (s, "via %U ", format_ip6_address, mp->next_hop_address);
762 s = format (s, "via %U ", format_ip4_address, mp->next_hop_address);
763 if (mp->next_hop_sw_if_index != ~0)
764 s = format (s, "sw_if_index %d ", ntohl (mp->next_hop_sw_if_index));
768 if (mp->next_hop_weight != 1)
769 s = format (s, "weight %d ", (u32) mp->next_hop_weight);
771 if (mp->is_multipath)
772 s = format (s, "multipath ");
774 if (mp->next_hop_table_id)
775 s = format (s, "lookup-in-vrf %d ", ntohl (mp->next_hop_table_id));
777 if (mp->next_hop_n_out_labels)
780 for (i = 0; i < mp->next_hop_n_out_labels; i++)
782 s = format (s, "out-label %d ",
783 ntohl (mp->next_hop_out_label_stack[i].label));
790 static void *vl_api_mpls_route_add_del_t_print
791 (vl_api_mpls_route_add_del_t * mp, void *handle)
795 s = format (0, "SCRIPT: mpls_route_add_del ");
798 s = format (s, "add ");
800 s = format (s, "del ");
802 s = format (s, "%d ", ntohl (mp->mr_label));
805 s = format (s, "eos ");
807 s = format (s, "non-eos ");
810 if (mp->mr_next_hop_proto == DPO_PROTO_IP4)
812 ip4_address_t ip4_null = {.as_u32 = 0, };
813 if (memcmp (mp->mr_next_hop, &ip4_null, sizeof (ip4_null)))
814 s = format (s, "via %U ", format_ip4_address, mp->mr_next_hop);
816 s = format (s, "via lookup-in-ip4-table %d ",
817 ntohl (mp->mr_next_hop_table_id));
819 else if (mp->mr_next_hop_proto == DPO_PROTO_IP6)
821 ip6_address_t ip6_null = { {0}
823 if (memcmp (mp->mr_next_hop, &ip6_null, sizeof (ip6_null)))
824 s = format (s, "via %U ", format_ip6_address, mp->mr_next_hop);
826 s = format (s, "via lookup-in-ip6-table %d ",
827 ntohl (mp->mr_next_hop_table_id));
829 else if (mp->mr_next_hop_proto == DPO_PROTO_ETHERNET)
831 s = format (s, "via l2-input-on ");
833 else if (mp->mr_next_hop_proto == DPO_PROTO_MPLS)
835 if (mp->mr_next_hop_via_label != htonl (MPLS_LABEL_INVALID))
837 format (s, "via via-label %d ", ntohl (mp->mr_next_hop_via_label));
839 s = format (s, "via next-hop-table %d ",
840 ntohl (mp->mr_next_hop_table_id));
842 if (mp->mr_next_hop_sw_if_index != ~0)
843 s = format (s, "sw_if_index %d ", ntohl (mp->mr_next_hop_sw_if_index));
845 if (mp->mr_next_hop_weight != 1)
846 s = format (s, "weight %d ", (u32) mp->mr_next_hop_weight);
848 if (mp->mr_is_multipath)
849 s = format (s, "multipath ");
851 if (mp->mr_is_classify)
852 s = format (s, "classify %d", ntohl (mp->mr_classify_table_index));
854 if (mp->mr_next_hop_n_out_labels)
857 for (i = 0; i < mp->mr_next_hop_n_out_labels; i++)
859 s = format (s, "out-label %d ",
860 ntohl (mp->mr_next_hop_out_label_stack[i].label));
867 static void *vl_api_ip_table_add_del_t_print
868 (vl_api_ip_table_add_del_t * mp, void *handle)
872 s = format (0, "SCRIPT: ip_table_add_del ");
874 s = format (s, "add ");
876 s = format (s, "del ");
878 s = format (s, "ip6 ");
879 s = format (s, "table %d ", ntohl (mp->table_id));
884 static void *vl_api_mpls_table_add_del_t_print
885 (vl_api_mpls_table_add_del_t * mp, void *handle)
889 s = format (0, "SCRIPT: mpls_table_add_del ");
891 s = format (s, "add ");
893 s = format (s, "del ");
894 s = format (s, "table %d ", ntohl (mp->mt_table_id));
899 static void *vl_api_proxy_arp_add_del_t_print
900 (vl_api_proxy_arp_add_del_t * mp, void *handle)
904 s = format (0, "SCRIPT: proxy_arp_add_del ");
906 s = format (s, "%U - %U ",
907 format_vl_api_ip4_address, mp->proxy.low,
908 format_vl_api_ip4_address, mp->proxy.hi);
910 s = format (s, "table %d ", ntohl (mp->proxy.table_id));
913 s = format (s, "del ");
918 static void *vl_api_proxy_arp_intfc_enable_disable_t_print
919 (vl_api_proxy_arp_intfc_enable_disable_t * mp, void *handle)
923 s = format (0, "SCRIPT: proxy_arp_intfc_enable_disable ");
925 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
927 s = format (s, "enable %d ", mp->enable_disable);
932 static void *vl_api_mpls_tunnel_add_del_t_print
933 (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
937 s = format (0, "SCRIPT: mpls_tunnel_add_del ");
939 if (mp->mt_is_add == 0)
940 s = format (s, "del sw_if_index %d ", ntohl (mp->mt_sw_if_index));
942 mpls_label_t label = ntohl (mp->mt_next_hop_via_label);
943 if (label != MPLS_LABEL_INVALID)
944 s = format (s, "via-label %d ", label);
945 else if (mp->mt_next_hop_proto_is_ip4)
946 s = format (s, "via %U ", format_ip4_address, mp->mt_next_hop);
948 s = format (s, "via %U ", format_ip6_address, mp->mt_next_hop);
950 if (mp->mt_next_hop_sw_if_index != ~0)
951 s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index));
952 else if (mp->mt_next_hop_table_id)
953 s = format (s, "next-hop-table %d ", ntohl (mp->mt_next_hop_table_id));
956 s = format (s, "l2-only ");
958 if (mp->mt_next_hop_n_out_labels)
961 for (i = 0; i < mp->mt_next_hop_n_out_labels; i++)
963 s = format (s, "out-label %d ",
964 ntohl (mp->mt_next_hop_out_label_stack[i].label));
971 static void *vl_api_sr_mpls_policy_add_t_print
972 (vl_api_sr_mpls_policy_add_t * mp, void *handle)
976 s = format (0, "SCRIPT: sr_mpls_policy_add ");
978 s = format (s, "bsid %d ", ntohl (mp->bsid));
980 if (mp->weight != htonl ((u32) 1))
981 s = format (s, "%d ", ntohl (mp->weight));
984 s = format (s, "spray ");
989 for (i = 0; i < mp->n_segments; i++)
990 s = format (s, "next %d ", ntohl (mp->segments[i]));
996 static void *vl_api_sr_mpls_policy_del_t_print
997 (vl_api_sr_mpls_policy_del_t * mp, void *handle)
1001 s = format (0, "SCRIPT: sr_mpls_policy_del ");
1003 s = format (s, "bsid %d ", ntohl (mp->bsid));
1008 static void *vl_api_sw_interface_set_unnumbered_t_print
1009 (vl_api_sw_interface_set_unnumbered_t * mp, void *handle)
1013 s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
1015 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1017 s = format (s, "unnum_if_index %d ", ntohl (mp->unnumbered_sw_if_index));
1019 if (mp->is_add == 0)
1020 s = format (s, "del ");
1025 static void *vl_api_ip_neighbor_add_del_t_print
1026 (vl_api_ip_neighbor_add_del_t * mp, void *handle)
1030 s = format (0, "SCRIPT: ip_neighbor_add_del ");
1032 s = format (s, "sw_if_index %d ", ntohl (mp->neighbor.sw_if_index));
1034 if (IP_API_NEIGHBOR_FLAG_STATIC & ntohl (mp->neighbor.flags))
1035 s = format (s, "is_static ");
1037 if (IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY & ntohl (mp->neighbor.flags))
1038 s = format (s, "is_no_fib_entry ");
1040 s = format (s, "mac %U ", format_vl_api_mac_address,
1041 &mp->neighbor.mac_address);
1043 s = format (s, "dst %U ", format_vl_api_address, &mp->neighbor.ip_address);
1045 if (mp->is_add == 0)
1046 s = format (s, "del ");
1052 static void *vl_api_create_vlan_subif_t_print
1053 (vl_api_create_vlan_subif_t * mp, void *handle)
1057 s = format (0, "SCRIPT: create_vlan_subif ");
1059 if (mp->sw_if_index)
1060 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1063 s = format (s, "vlan_id %d ", ntohl (mp->vlan_id));
1068 #define foreach_create_subif_bit \
1075 _(outer_vlan_id_any) \
1076 _(inner_vlan_id_any)
1078 static void *vl_api_create_subif_t_print
1079 (vl_api_create_subif_t * mp, void *handle)
1083 s = format (0, "SCRIPT: create_subif ");
1085 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1087 s = format (s, "sub_id %d ", ntohl (mp->sub_id));
1089 if (mp->outer_vlan_id)
1090 s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
1092 if (mp->inner_vlan_id)
1093 s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
1095 #define _(a) if (mp->a) s = format (s, "%s ", #a);
1096 foreach_create_subif_bit;
1102 static void *vl_api_delete_subif_t_print
1103 (vl_api_delete_subif_t * mp, void *handle)
1107 s = format (0, "SCRIPT: delete_subif ");
1108 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1114 vl_api_reset_fib_t_print (vl_api_reset_fib_t * mp, void *handle)
1118 s = format (0, "SCRIPT: reset_fib ");
1121 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
1123 if (mp->is_ipv6 != 0)
1124 s = format (s, "ipv6 ");
1129 static void *vl_api_dhcp_proxy_config_t_print
1130 (vl_api_dhcp_proxy_config_t * mp, void *handle)
1134 s = format (0, "SCRIPT: dhcp_proxy_config_2 ");
1136 s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
1137 s = format (s, "server_vrf_id %d ", ntohl (mp->server_vrf_id));
1141 s = format (s, "svr %U ", format_ip6_address,
1142 (ip6_address_t *) mp->dhcp_server);
1143 s = format (s, "src %U ", format_ip6_address,
1144 (ip6_address_t *) mp->dhcp_src_address);
1148 s = format (s, "svr %U ", format_ip4_address,
1149 (ip4_address_t *) mp->dhcp_server);
1150 s = format (s, "src %U ", format_ip4_address,
1151 (ip4_address_t *) mp->dhcp_src_address);
1153 if (mp->is_add == 0)
1154 s = format (s, "del ");
1159 static void *vl_api_dhcp_proxy_set_vss_t_print
1160 (vl_api_dhcp_proxy_set_vss_t * mp, void *handle)
1164 s = format (0, "SCRIPT: dhcp_proxy_set_vss ");
1166 s = format (s, "tbl_id %d ", ntohl (mp->tbl_id));
1168 if (mp->vss_type == VSS_TYPE_VPN_ID)
1170 s = format (s, "fib_id %d ", ntohl (mp->vpn_index));
1171 s = format (s, "oui %d ", ntohl (mp->oui));
1173 else if (mp->vss_type == VSS_TYPE_ASCII)
1174 s = format (s, "vpn_ascii_id %s", mp->vpn_ascii_id);
1176 if (mp->is_ipv6 != 0)
1177 s = format (s, "ipv6 ");
1179 if (mp->is_add == 0)
1180 s = format (s, "del ");
1185 static void *vl_api_dhcp_client_config_t_print
1186 (vl_api_dhcp_client_config_t * mp, void *handle)
1190 s = format (0, "SCRIPT: dhcp_client_config ");
1192 s = format (s, "sw_if_index %d ", ntohl (mp->client.sw_if_index));
1194 s = format (s, "hostname %s ", mp->client.hostname);
1196 s = format (s, "want_dhcp_event %d ", mp->client.want_dhcp_event);
1198 s = format (s, "pid %d ", ntohl (mp->client.pid));
1200 if (mp->is_add == 0)
1201 s = format (s, "del ");
1207 static void *vl_api_set_ip_flow_hash_t_print
1208 (vl_api_set_ip_flow_hash_t * mp, void *handle)
1212 s = format (0, "SCRIPT: set_ip_flow_hash ");
1214 s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
1217 s = format (s, "src ");
1220 s = format (s, "dst ");
1223 s = format (s, "sport ");
1226 s = format (s, "dport ");
1229 s = format (s, "proto ");
1232 s = format (s, "reverse ");
1234 if (mp->is_ipv6 != 0)
1235 s = format (s, "ipv6 ");
1240 static void *vl_api_sw_interface_ip6nd_ra_prefix_t_print
1241 (vl_api_sw_interface_ip6nd_ra_prefix_t * mp, void *handle)
1245 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_prefix ");
1247 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1249 s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
1251 s = format (s, "val_life %d ", ntohl (mp->val_lifetime));
1253 s = format (s, "pref_life %d ", ntohl (mp->pref_lifetime));
1255 if (mp->use_default)
1256 s = format (s, "def ");
1258 if (mp->no_advertise)
1259 s = format (s, "noadv ");
1262 s = format (s, "offl ");
1264 if (mp->no_autoconfig)
1265 s = format (s, "noauto ");
1268 s = format (s, "nolink ");
1271 s = format (s, "isno ");
1276 static void *vl_api_sw_interface_ip6nd_ra_config_t_print
1277 (vl_api_sw_interface_ip6nd_ra_config_t * mp, void *handle)
1281 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_config ");
1283 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1285 s = format (s, "maxint %d ", ntohl (mp->max_interval));
1287 s = format (s, "minint %d ", ntohl (mp->min_interval));
1289 s = format (s, "life %d ", ntohl (mp->lifetime));
1291 s = format (s, "count %d ", ntohl (mp->initial_count));
1293 s = format (s, "interval %d ", ntohl (mp->initial_interval));
1296 s = format (s, "suppress ");
1299 s = format (s, "managed ");
1302 s = format (s, "other ");
1305 s = format (s, "ll ");
1307 if (mp->send_unicast)
1308 s = format (s, "send ");
1311 s = format (s, "cease ");
1314 s = format (s, "isno ");
1316 if (mp->default_router)
1317 s = format (s, "def ");
1322 static void *vl_api_set_arp_neighbor_limit_t_print
1323 (vl_api_set_arp_neighbor_limit_t * mp, void *handle)
1327 s = format (0, "SCRIPT: set_arp_neighbor_limit ");
1329 s = format (s, "arp_nbr_limit %d ", ntohl (mp->arp_neighbor_limit));
1331 if (mp->is_ipv6 != 0)
1332 s = format (s, "ipv6 ");
1337 static void *vl_api_l2_patch_add_del_t_print
1338 (vl_api_l2_patch_add_del_t * mp, void *handle)
1342 s = format (0, "SCRIPT: l2_patch_add_del ");
1344 s = format (s, "rx_sw_if_index %d ", ntohl (mp->rx_sw_if_index));
1346 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
1348 if (mp->is_add == 0)
1349 s = format (s, "del ");
1354 static void *vl_api_sr_localsid_add_del_t_print
1355 (vl_api_sr_localsid_add_del_t * mp, void *handle)
1357 vnet_main_t *vnm = vnet_get_main ();
1360 s = format (0, "SCRIPT: sr_localsid_add_del ");
1362 switch (mp->behavior)
1364 case SR_BEHAVIOR_END:
1365 s = format (s, "Address: %U\nBehavior: End",
1366 format_ip6_address, (ip6_address_t *) mp->localsid.addr);
1367 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1372 "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1373 "\nIface: %U\nNext hop: %U", format_ip6_address,
1374 (ip6_address_t *) mp->localsid.addr,
1375 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1376 format_ip6_address, (ip6_address_t *) mp->nh_addr6);
1377 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1379 case SR_BEHAVIOR_DX4:
1382 "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1383 "\nIface: %U\nNext hop: %U", format_ip6_address,
1384 (ip6_address_t *) mp->localsid.addr,
1385 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1386 format_ip4_address, (ip4_address_t *) mp->nh_addr4);
1388 case SR_BEHAVIOR_DX6:
1391 "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1392 "\nIface: %UNext hop: %U", format_ip6_address,
1393 (ip6_address_t *) mp->localsid.addr,
1394 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1395 format_ip6_address, (ip6_address_t *) mp->nh_addr6);
1397 case SR_BEHAVIOR_DX2:
1400 "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1401 "\nIface: %U", format_ip6_address,
1402 (ip6_address_t *) mp->localsid.addr,
1403 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index));
1405 case SR_BEHAVIOR_DT6:
1408 "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1409 "\nTable: %u", format_ip6_address,
1410 (ip6_address_t *) mp->localsid.addr, ntohl (mp->fib_table));
1412 case SR_BEHAVIOR_DT4:
1415 "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1416 "\nTable: %u", format_ip6_address,
1417 (ip6_address_t *) mp->localsid.addr, ntohl (mp->fib_table));
1420 if (mp->behavior >= SR_BEHAVIOR_LAST)
1422 s = format (s, "Address: %U\n Behavior: %u",
1423 format_ip6_address, (ip6_address_t *) mp->localsid.addr,
1427 //Should never get here...
1428 s = format (s, "Internal error");
1434 static void *vl_api_sr_steering_add_del_t_print
1435 (vl_api_sr_steering_add_del_t * mp, void *handle)
1439 s = format (0, "SCRIPT: sr_steering_add_del ");
1441 s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1443 switch (mp->traffic_type)
1446 s = format (s, "Traffic type: L2 iface: %u", ntohl (mp->sw_if_index));
1449 s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1450 (ip4_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1453 s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1454 (ip6_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1457 s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1460 s = format (s, "BindingSID: %U", format_ip6_address,
1461 (ip6_address_t *) mp->bsid_addr);
1463 s = format (s, "SR Policy Index: %u", ntohl (mp->sr_policy_index));
1465 s = format (s, "FIB_table: %u", ntohl (mp->table_id));
1470 static void *vl_api_sr_policy_add_t_print
1471 (vl_api_sr_policy_add_t * mp, void *handle)
1475 ip6_address_t *segments = 0, *seg;
1476 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1479 for (i = 0; i < mp->sids.num_sids; i++)
1481 vec_add2 (segments, seg, 1);
1482 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1486 s = format (0, "SCRIPT: sr_policy_add ");
1488 s = format (s, "BSID: %U", format_ip6_address,
1489 (ip6_address_t *) mp->bsid_addr);
1493 (mp->is_encap ? "Behavior: Encapsulation" :
1494 "Behavior: SRH insertion"));
1496 s = format (s, "FIB_table: %u", ntohl (mp->fib_table));
1498 s = format (s, (mp->type ? "Type: Default" : "Type: Spray"));
1500 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1502 s = format (s, "{");
1503 vec_foreach (seg, segments)
1505 s = format (s, "%U, ", format_ip6_address, seg);
1507 s = format (s, "\b\b } ");
1512 static void *vl_api_sr_policy_mod_t_print
1513 (vl_api_sr_policy_mod_t * mp, void *handle)
1517 ip6_address_t *segments = 0, *seg;
1518 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1521 for (i = 0; i < mp->sids.num_sids; i++)
1523 vec_add2 (segments, seg, 1);
1524 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1528 s = format (0, "SCRIPT: sr_policy_mod ");
1530 s = format (s, "BSID: %U", format_ip6_address,
1531 (ip6_address_t *) mp->bsid_addr);
1533 s = format (s, "SR Policy index: %u", ntohl (mp->sr_policy_index));
1535 s = format (s, "Operation: %u", mp->operation);
1537 s = format (s, "SID list index: %u", ntohl (mp->sl_index));
1539 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1541 s = format (s, "{");
1542 vec_foreach (seg, segments)
1544 s = format (s, "%U, ", format_ip6_address, seg);
1546 s = format (s, "\b\b } ");
1551 static void *vl_api_sr_policy_del_t_print
1552 (vl_api_sr_policy_del_t * mp, void *handle)
1556 s = format (0, "SCRIPT: sr_policy_del ");
1557 s = format (s, "To be delivered. Good luck.");
1561 static void *vl_api_classify_add_del_table_t_print
1562 (vl_api_classify_add_del_table_t * mp, void *handle)
1567 s = format (0, "SCRIPT: classify_add_del_table ");
1569 if (mp->is_add == 0)
1571 s = format (s, "table %d ", ntohl (mp->table_index));
1572 s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1576 s = format (s, "nbuckets %d ", ntohl (mp->nbuckets));
1577 s = format (s, "memory_size %d ", ntohl (mp->memory_size));
1578 s = format (s, "skip %d ", ntohl (mp->skip_n_vectors));
1579 s = format (s, "match %d ", ntohl (mp->match_n_vectors));
1580 s = format (s, "next-table %d ", ntohl (mp->next_table_index));
1581 s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
1582 s = format (s, "current-data-flag %d ", ntohl (mp->current_data_flag));
1583 if (mp->current_data_flag)
1584 s = format (s, "current-data-offset %d ",
1585 ntohl (mp->current_data_offset));
1586 s = format (s, "mask hex ");
1587 for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
1588 s = format (s, "%02x", mp->mask[i]);
1595 static void *vl_api_classify_add_del_session_t_print
1596 (vl_api_classify_add_del_session_t * mp, void *handle)
1601 s = format (0, "SCRIPT: classify_add_del_session ");
1603 s = format (s, "table_index %d ", ntohl (mp->table_index));
1604 s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
1605 s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
1606 s = format (s, "advance %d ", ntohl (mp->advance));
1607 s = format (s, "action %d ", mp->action);
1609 s = format (s, "metadata %d ", ntohl (mp->metadata));
1610 if (mp->is_add == 0)
1611 s = format (s, "del ");
1613 s = format (s, "match hex ");
1614 for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1616 if (mp->match[i] != 0)
1623 for (i = 0; i < limit; i++)
1624 s = format (s, "%02x", mp->match[i]);
1629 static void *vl_api_classify_set_interface_ip_table_t_print
1630 (vl_api_classify_set_interface_ip_table_t * mp, void *handle)
1634 s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1637 s = format (s, "ipv6 ");
1639 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1640 s = format (s, "table %d ", ntohl (mp->table_index));
1645 static void *vl_api_classify_set_interface_l2_tables_t_print
1646 (vl_api_classify_set_interface_l2_tables_t * mp, void *handle)
1650 s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1652 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1653 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1654 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1655 s = format (s, "other-table %d ", ntohl (mp->other_table_index));
1656 s = format (s, "is-input %d ", mp->is_input);
1661 static void *vl_api_add_node_next_t_print
1662 (vl_api_add_node_next_t * mp, void *handle)
1666 s = format (0, "SCRIPT: add_node_next ");
1668 s = format (0, "node %s next %s ", mp->node_name, mp->next_name);
1673 static void *vl_api_l2tpv3_create_tunnel_t_print
1674 (vl_api_l2tpv3_create_tunnel_t * mp, void *handle)
1678 s = format (0, "SCRIPT: l2tpv3_create_tunnel ");
1680 s = format (s, "client_address %U our_address %U ",
1681 format_ip6_address, (ip6_address_t *) (mp->client_address),
1682 format_ip6_address, (ip6_address_t *) (mp->our_address));
1683 s = format (s, "local_session_id %d ", ntohl (mp->local_session_id));
1684 s = format (s, "remote_session_id %d ", ntohl (mp->remote_session_id));
1685 s = format (s, "local_cookie %lld ",
1686 clib_net_to_host_u64 (mp->local_cookie));
1687 s = format (s, "remote_cookie %lld ",
1688 clib_net_to_host_u64 (mp->remote_cookie));
1689 if (mp->l2_sublayer_present)
1690 s = format (s, "l2-sublayer-present ");
1695 static void *vl_api_l2tpv3_set_tunnel_cookies_t_print
1696 (vl_api_l2tpv3_set_tunnel_cookies_t * mp, void *handle)
1700 s = format (0, "SCRIPT: l2tpv3_set_tunnel_cookies ");
1702 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1704 s = format (s, "new_local_cookie %llu ",
1705 clib_net_to_host_u64 (mp->new_local_cookie));
1707 s = format (s, "new_remote_cookie %llu ",
1708 clib_net_to_host_u64 (mp->new_remote_cookie));
1713 static void *vl_api_l2tpv3_interface_enable_disable_t_print
1714 (vl_api_l2tpv3_interface_enable_disable_t * mp, void *handle)
1718 s = format (0, "SCRIPT: l2tpv3_interface_enable_disable ");
1720 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1722 if (mp->enable_disable == 0)
1723 s = format (s, "del ");
1728 static void *vl_api_l2tpv3_set_lookup_key_t_print
1729 (vl_api_l2tpv3_set_lookup_key_t * mp, void *handle)
1732 char *str = "unknown";
1734 s = format (0, "SCRIPT: l2tpv3_set_lookup_key ");
1738 case L2T_LOOKUP_SRC_ADDRESS:
1739 str = "lookup_v6_src";
1741 case L2T_LOOKUP_DST_ADDRESS:
1742 str = "lookup_v6_dst";
1744 case L2T_LOOKUP_SESSION_ID:
1745 str = "lookup_session_id";
1751 s = format (s, "%s ", str);
1756 static void *vl_api_sw_if_l2tpv3_tunnel_dump_t_print
1757 (vl_api_sw_if_l2tpv3_tunnel_dump_t * mp, void *handle)
1761 s = format (0, "SCRIPT: sw_if_l2tpv3_tunnel_dump ");
1766 static void *vl_api_vxlan_add_del_tunnel_t_print
1767 (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1770 s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1772 ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
1773 ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
1775 u8 is_grp = ip46_address_is_multicast (&dst);
1776 char *dst_name = is_grp ? "group" : "dst";
1778 s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1779 s = format (s, "%s %U ", dst_name, format_ip46_address,
1780 &dst, IP46_TYPE_ANY);
1783 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1785 if (mp->encap_vrf_id)
1786 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1788 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1790 s = format (s, "vni %d ", ntohl (mp->vni));
1792 s = format (s, "instance %d ", ntohl (mp->instance));
1794 if (mp->is_add == 0)
1795 s = format (s, "del ");
1800 static void *vl_api_vxlan_offload_rx_t_print
1801 (vl_api_vxlan_offload_rx_t * mp, void *handle)
1804 s = format (0, "SCRIPT: vxlan_offload_rx ");
1806 s = format (s, "hw hw_if_index %d ", ntohl (mp->hw_if_index));
1807 s = format (s, "rx sw_if_index %d ", ntohl (mp->sw_if_index));
1809 s = format (s, "del ");
1814 static void *vl_api_vxlan_tunnel_dump_t_print
1815 (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1819 s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1821 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1826 static void *vl_api_vxlan_gbp_tunnel_add_del_t_print
1827 (vl_api_vxlan_gbp_tunnel_add_del_t * mp, void *handle)
1830 s = format (0, "SCRIPT: vxlan_gbp_tunnel_add_del ");
1833 s = format (s, "add ");
1835 s = format (s, "del ");
1837 s = format (s, "instance %d ", ntohl (mp->tunnel.instance));
1838 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1839 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1841 format (s, "mcast_sw_if_index %d ", ntohl (mp->tunnel.mcast_sw_if_index));
1842 s = format (s, "encap_table_id %d ", ntohl (mp->tunnel.encap_table_id));
1843 s = format (s, "vni %d ", ntohl (mp->tunnel.vni));
1844 s = format (s, "sw_if_index %d ", ntohl (mp->tunnel.sw_if_index));
1849 static void *vl_api_vxlan_gbp_tunnel_dump_t_print
1850 (vl_api_vxlan_gbp_tunnel_dump_t * mp, void *handle)
1854 s = format (0, "SCRIPT: vxlan_gbp_tunnel_dump ");
1856 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1861 static void *vl_api_sw_interface_set_vxlan_gbp_bypass_t_print
1862 (vl_api_sw_interface_set_vxlan_gbp_bypass_t * mp, void *handle)
1866 s = format (0, "SCRIPT: sw_interface_set_vxlan_gbp_bypass ");
1868 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1869 s = format (s, "%s ", (mp->is_ipv6 != 0) ? "ipv6" : "ipv4");
1870 s = format (s, "%s ", (mp->enable != 0) ? "enable" : "disable");
1875 static void *vl_api_geneve_add_del_tunnel_t_print
1876 (vl_api_geneve_add_del_tunnel_t * mp, void *handle)
1879 s = format (0, "SCRIPT: geneve_add_del_tunnel ");
1881 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local_address);
1882 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote_address);
1884 u8 is_grp = ip46_address_is_multicast (&remote);
1885 char *remote_name = is_grp ? "group" : "dst";
1887 s = format (s, "src %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1888 s = format (s, "%s %U ", remote_name, format_ip46_address,
1889 &remote, IP46_TYPE_ANY);
1892 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1894 if (mp->encap_vrf_id)
1895 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1897 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1899 s = format (s, "vni %d ", ntohl (mp->vni));
1901 if (mp->is_add == 0)
1902 s = format (s, "del ");
1907 static void *vl_api_geneve_tunnel_dump_t_print
1908 (vl_api_geneve_tunnel_dump_t * mp, void *handle)
1912 s = format (0, "SCRIPT: geneve_tunnel_dump ");
1914 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1919 static void *vl_api_gre_tunnel_add_del_t_print
1920 (vl_api_gre_tunnel_add_del_t * mp, void *handle)
1924 s = format (0, "SCRIPT: gre_tunnel_add_del ");
1926 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1927 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1929 s = format (s, "instance %d ", ntohl (mp->tunnel.instance));
1931 if (mp->tunnel.type == GRE_API_TUNNEL_TYPE_TEB)
1932 s = format (s, "teb ");
1934 if (mp->tunnel.type == GRE_API_TUNNEL_TYPE_ERSPAN)
1935 s = format (s, "erspan %d ", ntohs (mp->tunnel.session_id));
1937 if (mp->tunnel.outer_fib_id)
1938 s = format (s, "outer-fib-id %d ", ntohl (mp->tunnel.outer_fib_id));
1940 if (mp->is_add == 0)
1941 s = format (s, "del ");
1946 static void *vl_api_gre_tunnel_dump_t_print
1947 (vl_api_gre_tunnel_dump_t * mp, void *handle)
1951 s = format (0, "SCRIPT: gre_tunnel_dump ");
1953 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1958 static void *vl_api_l2_fib_clear_table_t_print
1959 (vl_api_l2_fib_clear_table_t * mp, void *handle)
1963 s = format (0, "SCRIPT: l2_fib_clear_table ");
1968 static void *vl_api_l2_interface_efp_filter_t_print
1969 (vl_api_l2_interface_efp_filter_t * mp, void *handle)
1973 s = format (0, "SCRIPT: l2_interface_efp_filter ");
1975 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1976 if (mp->enable_disable)
1977 s = format (s, "enable ");
1979 s = format (s, "disable ");
1984 static void *vl_api_l2_interface_vlan_tag_rewrite_t_print
1985 (vl_api_l2_interface_vlan_tag_rewrite_t * mp, void *handle)
1989 s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
1991 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1992 s = format (s, "vtr_op %d ", ntohl (mp->vtr_op));
1993 s = format (s, "push_dot1q %d ", ntohl (mp->push_dot1q));
1994 s = format (s, "tag1 %d ", ntohl (mp->tag1));
1995 s = format (s, "tag2 %d ", ntohl (mp->tag2));
2000 static void *vl_api_create_vhost_user_if_t_print
2001 (vl_api_create_vhost_user_if_t * mp, void *handle)
2005 s = format (0, "SCRIPT: create_vhost_user_if ");
2007 s = format (s, "socket %s ", mp->sock_filename);
2009 s = format (s, "server ");
2011 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
2012 if (mp->disable_mrg_rxbuf)
2013 s = format (s, "disable_mrg_rxbuf ");
2014 if (mp->disable_indirect_desc)
2015 s = format (s, "disable_indirect_desc ");
2017 s = format (s, "tag %s", mp->tag);
2022 static void *vl_api_modify_vhost_user_if_t_print
2023 (vl_api_modify_vhost_user_if_t * mp, void *handle)
2027 s = format (0, "SCRIPT: modify_vhost_user_if ");
2029 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2030 s = format (s, "socket %s ", mp->sock_filename);
2032 s = format (s, "server ");
2034 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
2039 static void *vl_api_delete_vhost_user_if_t_print
2040 (vl_api_delete_vhost_user_if_t * mp, void *handle)
2044 s = format (0, "SCRIPT: delete_vhost_user_if ");
2045 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2050 static void *vl_api_sw_interface_vhost_user_dump_t_print
2051 (vl_api_sw_interface_vhost_user_dump_t * mp, void *handle)
2055 s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
2060 static void *vl_api_sw_interface_dump_t_print
2061 (vl_api_sw_interface_dump_t * mp, void *handle)
2065 s = format (0, "SCRIPT: sw_interface_dump ");
2067 if (mp->name_filter_valid)
2068 s = format (s, "name_filter %s ", mp->name_filter);
2070 s = format (s, "all ");
2075 static void *vl_api_l2_fib_table_dump_t_print
2076 (vl_api_l2_fib_table_dump_t * mp, void *handle)
2080 s = format (0, "SCRIPT: l2_fib_table_dump ");
2082 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
2087 static void *vl_api_control_ping_t_print
2088 (vl_api_control_ping_t * mp, void *handle)
2092 s = format (0, "SCRIPT: control_ping ");
2097 static void *vl_api_want_interface_events_t_print
2098 (vl_api_want_interface_events_t * mp, void *handle)
2102 s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
2103 ntohl (mp->pid), ntohl (mp->enable_disable));
2109 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
2113 s = format (0, "SCRIPT: cli ");
2118 static void *vl_api_cli_inband_t_print
2119 (vl_api_cli_inband_t * mp, void *handle)
2123 u32 length = vl_api_string_len (&mp->cmd);
2125 vec_validate (cmd, length);
2126 clib_memcpy (cmd, vl_api_from_api_string (&mp->cmd), length);
2128 s = format (0, "SCRIPT: exec %v ", cmd);
2134 static void *vl_api_memclnt_create_t_print
2135 (vl_api_memclnt_create_t * mp, void *handle)
2139 s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
2144 static void *vl_api_sockclnt_create_t_print
2145 (vl_api_sockclnt_create_t * mp, void *handle)
2149 s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name);
2154 static void *vl_api_show_version_t_print
2155 (vl_api_show_version_t * mp, void *handle)
2159 s = format (0, "SCRIPT: show_version ");
2165 static void *vl_api_show_threads_t_print
2166 (vl_api_show_threads_t * mp, void *handle)
2170 s = format (0, "SCRIPT: show_threads ");
2175 static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
2176 (vl_api_vxlan_gpe_add_del_tunnel_t * mp, void *handle)
2180 s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
2182 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local);
2183 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote);
2185 u8 is_grp = ip46_address_is_multicast (&remote);
2186 char *remote_name = is_grp ? "group" : "remote";
2188 s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
2189 s = format (s, "%s %U ", remote_name, format_ip46_address,
2190 &remote, IP46_TYPE_ANY);
2193 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
2194 s = format (s, "protocol %d ", ntohl (mp->protocol));
2196 s = format (s, "vni %d ", ntohl (mp->vni));
2198 if (mp->is_add == 0)
2199 s = format (s, "del ");
2201 if (mp->encap_vrf_id)
2202 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
2204 if (mp->decap_vrf_id)
2205 s = format (s, "decap-vrf-id %d ", ntohl (mp->decap_vrf_id));
2210 static void *vl_api_vxlan_gpe_tunnel_dump_t_print
2211 (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
2215 s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
2217 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2222 static void *vl_api_interface_name_renumber_t_print
2223 (vl_api_interface_name_renumber_t * mp, void *handle)
2227 s = format (0, "SCRIPT: interface_renumber ");
2229 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2231 s = format (s, "new_show_dev_instance %d ",
2232 ntohl (mp->new_show_dev_instance));
2237 static void *vl_api_ip_probe_neighbor_t_print
2238 (vl_api_ip_probe_neighbor_t * mp, void *handle)
2242 s = format (0, "SCRIPT: ip_probe_neighbor ");
2243 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2244 s = format (s, "address %U ", format_vl_api_address, &mp->dst);
2249 static void *vl_api_ip_scan_neighbor_enable_disable_t_print
2250 (vl_api_ip_scan_neighbor_enable_disable_t * mp, void *handle)
2254 s = format (0, "SCRIPT: ip_scan_neighbor_enable_disable ");
2258 case IP_SCAN_V4_NEIGHBORS:
2259 s = format (s, "ip4 ");
2261 case IP_SCAN_V6_NEIGHBORS:
2262 s = format (s, "ip6 ");
2264 case IP_SCAN_V46_NEIGHBORS:
2265 s = format (s, "both ");
2268 s = format (s, "disable ");
2271 s = format (s, "interval %d ", mp->scan_interval);
2272 s = format (s, "max-time %d ", mp->max_proc_time);
2273 s = format (s, "max-update %d ", mp->max_update);
2274 s = format (s, "delay %d ", mp->scan_int_delay);
2275 s = format (s, "stale %d ", mp->stale_threshold);
2280 static void *vl_api_want_ip4_arp_events_t_print
2281 (vl_api_want_ip4_arp_events_t * mp, void *handle)
2285 s = format (0, "SCRIPT: want_ip4_arp_events ");
2286 s = format (s, "pid %d address %U ", ntohl (mp->pid),
2287 format_ip4_address, mp->ip);
2288 if (mp->enable_disable == 0)
2289 s = format (s, "del ");
2294 static void *vl_api_want_ip6_nd_events_t_print
2295 (vl_api_want_ip6_nd_events_t * mp, void *handle)
2299 s = format (0, "SCRIPT: want_ip6_nd_events ");
2300 s = format (s, "pid %d address %U ", ntohl (mp->pid),
2301 format_vl_api_ip6_address, mp->ip);
2302 if (mp->enable_disable == 0)
2303 s = format (s, "del ");
2308 static void *vl_api_want_l2_macs_events_t_print
2309 (vl_api_want_l2_macs_events_t * mp, void *handle)
2313 s = format (0, "SCRIPT: want_l2_macs_events ");
2314 s = format (s, "learn-limit %d ", ntohl (mp->learn_limit));
2315 s = format (s, "scan-delay %d ", (u32) mp->scan_delay);
2316 s = format (s, "max-entries %d ", (u32) mp->max_macs_in_event * 10);
2317 if (mp->enable_disable == 0)
2318 s = format (s, "disable");
2323 static void *vl_api_input_acl_set_interface_t_print
2324 (vl_api_input_acl_set_interface_t * mp, void *handle)
2328 s = format (0, "SCRIPT: input_acl_set_interface ");
2330 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2331 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2332 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2333 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2335 if (mp->is_add == 0)
2336 s = format (s, "del ");
2341 static void *vl_api_output_acl_set_interface_t_print
2342 (vl_api_output_acl_set_interface_t * mp, void *handle)
2346 s = format (0, "SCRIPT: output_acl_set_interface ");
2348 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2349 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2350 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2351 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2353 if (mp->is_add == 0)
2354 s = format (s, "del ");
2359 static void *vl_api_ip_address_dump_t_print
2360 (vl_api_ip_address_dump_t * mp, void *handle)
2364 s = format (0, "SCRIPT: ip6_address_dump ");
2365 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2366 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2372 vl_api_ip_dump_t_print (vl_api_ip_dump_t * mp, void *handle)
2376 s = format (0, "SCRIPT: ip_dump ");
2377 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2382 static void *vl_api_cop_interface_enable_disable_t_print
2383 (vl_api_cop_interface_enable_disable_t * mp, void *handle)
2387 s = format (0, "SCRIPT: cop_interface_enable_disable ");
2388 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2389 if (mp->enable_disable)
2390 s = format (s, "enable ");
2392 s = format (s, "disable ");
2397 static void *vl_api_cop_whitelist_enable_disable_t_print
2398 (vl_api_cop_whitelist_enable_disable_t * mp, void *handle)
2402 s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
2403 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2404 s = format (s, "fib-id %d ", ntohl (mp->fib_id));
2406 s = format (s, "ip4 ");
2408 s = format (s, "ip6 ");
2409 if (mp->default_cop)
2410 s = format (s, "default ");
2415 static void *vl_api_af_packet_create_t_print
2416 (vl_api_af_packet_create_t * mp, void *handle)
2420 s = format (0, "SCRIPT: af_packet_create ");
2421 s = format (s, "host_if_name %s ", mp->host_if_name);
2422 if (mp->use_random_hw_addr)
2423 s = format (s, "hw_addr random ");
2425 s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
2430 static void *vl_api_af_packet_delete_t_print
2431 (vl_api_af_packet_delete_t * mp, void *handle)
2435 s = format (0, "SCRIPT: af_packet_delete ");
2436 s = format (s, "host_if_name %s ", mp->host_if_name);
2441 static void *vl_api_af_packet_dump_t_print
2442 (vl_api_af_packet_dump_t * mp, void *handle)
2446 s = format (0, "SCRIPT: af_packet_dump ");
2452 format_policer_action (u8 * s, va_list * va)
2454 u32 action = va_arg (*va, u32);
2455 u32 dscp = va_arg (*va, u32);
2458 if (action == SSE2_QOS_ACTION_DROP)
2459 s = format (s, "drop");
2460 else if (action == SSE2_QOS_ACTION_TRANSMIT)
2461 s = format (s, "transmit");
2462 else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
2464 s = format (s, "mark-and-transmit ");
2467 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
2473 s = format (s, "%s", t);
2478 static void *vl_api_policer_add_del_t_print
2479 (vl_api_policer_add_del_t * mp, void *handle)
2483 s = format (0, "SCRIPT: policer_add_del ");
2484 s = format (s, "name %s ", mp->name);
2485 s = format (s, "cir %d ", mp->cir);
2486 s = format (s, "eir %d ", mp->eir);
2487 s = format (s, "cb %d ", mp->cb);
2488 s = format (s, "eb %d ", mp->eb);
2490 switch (mp->rate_type)
2492 case SSE2_QOS_RATE_KBPS:
2493 s = format (s, "rate_type kbps ");
2495 case SSE2_QOS_RATE_PPS:
2496 s = format (s, "rate_type pps ");
2502 switch (mp->round_type)
2504 case SSE2_QOS_ROUND_TO_CLOSEST:
2505 s = format (s, "round_type closest ");
2507 case SSE2_QOS_ROUND_TO_UP:
2508 s = format (s, "round_type up ");
2510 case SSE2_QOS_ROUND_TO_DOWN:
2511 s = format (s, "round_type down ");
2519 case SSE2_QOS_POLICER_TYPE_1R2C:
2520 s = format (s, "type 1r2c ");
2522 case SSE2_QOS_POLICER_TYPE_1R3C_RFC_2697:
2523 s = format (s, "type 1r3c ");
2525 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_2698:
2526 s = format (s, "type 2r3c-2698 ");
2528 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_4115:
2529 s = format (s, "type 2r3c-4115 ");
2531 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1:
2532 s = format (s, "type 2r3c-mef5cf1 ");
2538 s = format (s, "conform_action %U ", format_policer_action,
2539 mp->conform_action_type, mp->conform_dscp);
2540 s = format (s, "exceed_action %U ", format_policer_action,
2541 mp->exceed_action_type, mp->exceed_dscp);
2542 s = format (s, "violate_action %U ", format_policer_action,
2543 mp->violate_action_type, mp->violate_dscp);
2545 if (mp->color_aware)
2546 s = format (s, "color-aware ");
2547 if (mp->is_add == 0)
2548 s = format (s, "del ");
2553 static void *vl_api_policer_dump_t_print
2554 (vl_api_policer_dump_t * mp, void *handle)
2558 s = format (0, "SCRIPT: policer_dump ");
2559 if (mp->match_name_valid)
2560 s = format (s, "name %s ", mp->match_name);
2565 static void *vl_api_policer_classify_set_interface_t_print
2566 (vl_api_policer_classify_set_interface_t * mp, void *handle)
2570 s = format (0, "SCRIPT: policer_classify_set_interface ");
2571 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2572 if (mp->ip4_table_index != ~0)
2573 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2574 if (mp->ip6_table_index != ~0)
2575 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2576 if (mp->l2_table_index != ~0)
2577 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2578 if (mp->is_add == 0)
2579 s = format (s, "del ");
2584 static void *vl_api_policer_classify_dump_t_print
2585 (vl_api_policer_classify_dump_t * mp, void *handle)
2589 s = format (0, "SCRIPT: policer_classify_dump ");
2592 case POLICER_CLASSIFY_TABLE_IP4:
2593 s = format (s, "type ip4 ");
2595 case POLICER_CLASSIFY_TABLE_IP6:
2596 s = format (s, "type ip6 ");
2598 case POLICER_CLASSIFY_TABLE_L2:
2599 s = format (s, "type l2 ");
2608 static void *vl_api_sw_interface_clear_stats_t_print
2609 (vl_api_sw_interface_clear_stats_t * mp, void *handle)
2613 s = format (0, "SCRIPT: sw_interface_clear_stats ");
2614 if (mp->sw_if_index != ~0)
2615 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2620 static void *vl_api_mpls_tunnel_dump_t_print
2621 (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2625 s = format (0, "SCRIPT: mpls_tunnel_dump ");
2627 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2632 static void *vl_api_mpls_fib_dump_t_print
2633 (vl_api_mpls_fib_dump_t * mp, void *handle)
2637 s = format (0, "SCRIPT: mpls_fib_decap_dump ");
2642 static void *vl_api_ip_fib_dump_t_print
2643 (vl_api_ip_fib_dump_t * mp, void *handle)
2647 s = format (0, "SCRIPT: ip_fib_dump ");
2652 static void *vl_api_ip6_fib_dump_t_print
2653 (vl_api_ip6_fib_dump_t * mp, void *handle)
2657 s = format (0, "SCRIPT: ip6_fib_dump ");
2662 static void *vl_api_classify_table_ids_t_print
2663 (vl_api_classify_table_ids_t * mp, void *handle)
2667 s = format (0, "SCRIPT: classify_table_ids ");
2672 static void *vl_api_classify_table_by_interface_t_print
2673 (vl_api_classify_table_by_interface_t * mp, void *handle)
2677 s = format (0, "SCRIPT: classify_table_by_interface ");
2678 if (mp->sw_if_index != ~0)
2679 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2684 static void *vl_api_classify_table_info_t_print
2685 (vl_api_classify_table_info_t * mp, void *handle)
2689 s = format (0, "SCRIPT: classify_table_info ");
2690 if (mp->table_id != ~0)
2691 s = format (s, "table_id %d ", ntohl (mp->table_id));
2696 static void *vl_api_classify_session_dump_t_print
2697 (vl_api_classify_session_dump_t * mp, void *handle)
2701 s = format (0, "SCRIPT: classify_session_dump ");
2702 if (mp->table_id != ~0)
2703 s = format (s, "table_id %d ", ntohl (mp->table_id));
2708 static void *vl_api_set_ipfix_exporter_t_print
2709 (vl_api_set_ipfix_exporter_t * mp, void *handle)
2713 s = format (0, "SCRIPT: set_ipfix_exporter ");
2715 s = format (s, "collector-address %U ", format_ip4_address,
2716 (ip4_address_t *) mp->collector_address);
2717 s = format (s, "collector-port %d ", ntohs (mp->collector_port));
2718 s = format (s, "src-address %U ", format_ip4_address,
2719 (ip4_address_t *) mp->src_address);
2720 s = format (s, "vrf-id %d ", ntohl (mp->vrf_id));
2721 s = format (s, "path-mtu %d ", ntohl (mp->path_mtu));
2722 s = format (s, "template-interval %d ", ntohl (mp->template_interval));
2723 s = format (s, "udp-checksum %d ", mp->udp_checksum);
2728 static void *vl_api_ipfix_exporter_dump_t_print
2729 (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2733 s = format (0, "SCRIPT: ipfix_exporter_dump ");
2738 static void *vl_api_set_ipfix_classify_stream_t_print
2739 (vl_api_set_ipfix_classify_stream_t * mp, void *handle)
2743 s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2745 s = format (s, "domain-id %d ", ntohl (mp->domain_id));
2746 s = format (s, "src-port %d ", ntohs (mp->src_port));
2751 static void *vl_api_ipfix_classify_stream_dump_t_print
2752 (vl_api_ipfix_classify_stream_dump_t * mp, void *handle)
2756 s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2761 static void *vl_api_ipfix_classify_table_add_del_t_print
2762 (vl_api_ipfix_classify_table_add_del_t * mp, void *handle)
2766 s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2768 s = format (s, "table-id %d ", ntohl (mp->table_id));
2769 s = format (s, "ip-version %d ", mp->ip_version);
2770 s = format (s, "transport-protocol %d ", mp->transport_protocol);
2775 static void *vl_api_ipfix_classify_table_dump_t_print
2776 (vl_api_ipfix_classify_table_dump_t * mp, void *handle)
2780 s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2785 static void *vl_api_sw_interface_span_enable_disable_t_print
2786 (vl_api_sw_interface_span_enable_disable_t * mp, void *handle)
2790 s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2791 s = format (s, "src_sw_if_index %u ", ntohl (mp->sw_if_index_from));
2792 s = format (s, "dst_sw_if_index %u ", ntohl (mp->sw_if_index_to));
2795 s = format (s, "l2 ");
2800 s = format (s, "disable ");
2803 s = format (s, "rx ");
2806 s = format (s, "tx ");
2810 s = format (s, "both ");
2818 vl_api_sw_interface_span_dump_t_print (vl_api_sw_interface_span_dump_t * mp,
2823 s = format (0, "SCRIPT: sw_interface_span_dump ");
2826 s = format (s, "l2 ");
2831 static void *vl_api_get_next_index_t_print
2832 (vl_api_get_next_index_t * mp, void *handle)
2836 s = format (0, "SCRIPT: get_next_index ");
2837 s = format (s, "node-name %s ", mp->node_name);
2838 s = format (s, "next-node-name %s ", mp->next_name);
2843 static void *vl_api_pg_create_interface_t_print
2844 (vl_api_pg_create_interface_t * mp, void *handle)
2848 s = format (0, "SCRIPT: pg_create_interface ");
2849 s = format (0, "if_id %d", ntohl (mp->interface_id));
2854 static void *vl_api_pg_capture_t_print
2855 (vl_api_pg_capture_t * mp, void *handle)
2859 s = format (0, "SCRIPT: pg_capture ");
2860 s = format (0, "if_id %d ", ntohl (mp->interface_id));
2861 s = format (0, "pcap %s", mp->pcap_file_name);
2862 if (mp->count != ~0)
2863 s = format (s, "count %d ", ntohl (mp->count));
2864 if (!mp->is_enabled)
2865 s = format (s, "disable");
2870 static void *vl_api_pg_enable_disable_t_print
2871 (vl_api_pg_enable_disable_t * mp, void *handle)
2875 s = format (0, "SCRIPT: pg_enable_disable ");
2876 if (ntohl (mp->stream_name_length) > 0)
2877 s = format (s, "stream %s", mp->stream_name);
2878 if (!mp->is_enabled)
2879 s = format (s, "disable");
2884 static void *vl_api_ip_source_and_port_range_check_add_del_t_print
2885 (vl_api_ip_source_and_port_range_check_add_del_t * mp, void *handle)
2890 s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2891 s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
2893 for (i = 0; i < mp->number_of_ranges; i++)
2895 s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2898 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
2900 if (mp->is_add == 0)
2901 s = format (s, "del ");
2906 static void *vl_api_ip_source_and_port_range_check_interface_add_del_t_print
2907 (vl_api_ip_source_and_port_range_check_interface_add_del_t * mp,
2912 s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2914 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2916 if (mp->tcp_out_vrf_id != ~0)
2917 s = format (s, "tcp-out-vrf %d ", ntohl (mp->tcp_out_vrf_id));
2919 if (mp->udp_out_vrf_id != ~0)
2920 s = format (s, "udp-out-vrf %d ", ntohl (mp->udp_out_vrf_id));
2922 if (mp->tcp_in_vrf_id != ~0)
2923 s = format (s, "tcp-in-vrf %d ", ntohl (mp->tcp_in_vrf_id));
2925 if (mp->udp_in_vrf_id != ~0)
2926 s = format (s, "udp-in-vrf %d ", ntohl (mp->udp_in_vrf_id));
2928 if (mp->is_add == 0)
2929 s = format (s, "del ");
2934 static void *vl_api_lisp_enable_disable_t_print
2935 (vl_api_lisp_enable_disable_t * mp, void *handle)
2939 s = format (0, "SCRIPT: lisp_enable_disable %s",
2940 mp->is_en ? "enable" : "disable");
2945 static void *vl_api_gpe_add_del_iface_t_print
2946 (vl_api_gpe_add_del_iface_t * mp, void *handle)
2950 s = format (0, "SCRIPT: gpe_add_del_iface ");
2952 s = format (s, "%s ", mp->is_add ? "up" : "down");
2953 s = format (s, "vni %d ", mp->vni);
2954 s = format (s, "%s %d ", mp->is_l2 ? "bd_id" : "table_id", mp->dp_table);
2959 static void *vl_api_lisp_pitr_set_locator_set_t_print
2960 (vl_api_lisp_pitr_set_locator_set_t * mp, void *handle)
2964 s = format (0, "SCRIPT: lisp_pitr_set_locator_set ");
2967 s = format (s, "locator-set %s ", mp->ls_name);
2969 s = format (s, "del");
2975 format_lisp_flat_eid (u8 * s, va_list * args)
2977 u32 type = va_arg (*args, u32);
2978 u8 *eid = va_arg (*args, u8 *);
2979 u32 eid_len = va_arg (*args, u32);
2984 return format (s, "%U/%d", format_ip4_address, eid, eid_len);
2986 return format (s, "%U/%d", format_ip6_address, eid, eid_len);
2988 return format (s, "%U", format_ethernet_address, eid);
2993 static void *vl_api_lisp_add_del_remote_mapping_t_print
2994 (vl_api_lisp_add_del_remote_mapping_t * mp, void *handle)
2999 s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
3002 s = format (s, "del-all ");
3004 s = format (s, "%s ", mp->is_add ? "add" : "del");
3005 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3007 s = format (s, "eid %U ", format_lisp_flat_eid,
3008 mp->eid_type, mp->eid, mp->eid_len);
3012 s = format (s, "seid %U ", format_lisp_flat_eid,
3013 mp->eid_type, mp->seid, mp->seid_len);
3015 rloc_num = clib_net_to_host_u32 (mp->rloc_num);
3018 s = format (s, "action %d", mp->action);
3023 static void *vl_api_lisp_add_del_adjacency_t_print
3024 (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
3028 s = format (0, "SCRIPT: lisp_add_del_adjacency ");
3030 s = format (s, "%s ", mp->is_add ? "add" : "del");
3031 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3032 s = format (s, "reid %U leid %U ",
3033 format_lisp_flat_eid, mp->eid_type, mp->reid, mp->reid_len,
3034 format_lisp_flat_eid, mp->eid_type, mp->leid, mp->leid_len);
3039 static void *vl_api_lisp_add_del_map_request_itr_rlocs_t_print
3040 (vl_api_lisp_add_del_map_request_itr_rlocs_t * mp, void *handle)
3044 s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
3047 s = format (s, "%s", mp->locator_set_name);
3049 s = format (s, "del");
3054 static void *vl_api_lisp_eid_table_add_del_map_t_print
3055 (vl_api_lisp_eid_table_add_del_map_t * mp, void *handle)
3059 s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
3062 s = format (s, "del ");
3064 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3065 s = format (s, "%s %d ",
3066 mp->is_l2 ? "bd_index" : "vrf",
3067 clib_net_to_host_u32 (mp->dp_table));
3071 static void *vl_api_lisp_add_del_local_eid_t_print
3072 (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
3076 s = format (0, "SCRIPT: lisp_add_del_local_eid ");
3079 s = format (s, "del ");
3081 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3082 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
3084 s = format (s, "locator-set %s ", mp->locator_set_name);
3087 u32 key_id = mp->key_id;
3088 s = format (s, "key-id %U", format_hmac_key_id, key_id);
3089 s = format (s, "secret-key %s", mp->key);
3094 static void *vl_api_gpe_add_del_fwd_entry_t_print
3095 (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle)
3099 s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO");
3104 static void *vl_api_lisp_add_del_map_resolver_t_print
3105 (vl_api_lisp_add_del_map_resolver_t * mp, void *handle)
3109 s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
3112 s = format (s, "del ");
3115 s = format (s, "%U ", format_ip6_address, mp->ip_address);
3117 s = format (s, "%U ", format_ip4_address, mp->ip_address);
3122 static void *vl_api_gpe_enable_disable_t_print
3123 (vl_api_gpe_enable_disable_t * mp, void *handle)
3127 s = format (0, "SCRIPT: gpe_enable_disable ");
3129 s = format (s, "%s ", mp->is_en ? "enable" : "disable");
3134 static void *vl_api_lisp_add_del_locator_set_t_print
3135 (vl_api_lisp_add_del_locator_set_t * mp, void *handle)
3139 s = format (0, "SCRIPT: lisp_add_del_locator_set ");
3142 s = format (s, "del ");
3144 s = format (s, "locator-set %s ", mp->locator_set_name);
3149 static void *vl_api_lisp_add_del_locator_t_print
3150 (vl_api_lisp_add_del_locator_t * mp, void *handle)
3154 s = format (0, "SCRIPT: lisp_add_del_locator ");
3157 s = format (s, "del ");
3159 s = format (s, "locator-set %s ", mp->locator_set_name);
3160 s = format (s, "sw_if_index %d ", mp->sw_if_index);
3161 s = format (s, "p %d w %d ", mp->priority, mp->weight);
3166 static void *vl_api_lisp_locator_set_dump_t_print
3167 (vl_api_lisp_locator_set_dump_t * mp, void *handle)
3171 s = format (0, "SCRIPT: lisp_locator_set_dump ");
3172 if (mp->filter == 1)
3173 s = format (s, "local");
3174 else if (mp->filter == 2)
3175 s = format (s, "remote");
3180 static void *vl_api_lisp_locator_dump_t_print
3181 (vl_api_lisp_locator_dump_t * mp, void *handle)
3185 s = format (0, "SCRIPT: lisp_locator_dump ");
3186 if (mp->is_index_set)
3187 s = format (s, "ls_index %d", clib_net_to_host_u32 (mp->ls_index));
3189 s = format (s, "ls_name %s", mp->ls_name);
3194 static void *vl_api_lisp_map_request_mode_t_print
3195 (vl_api_lisp_map_request_mode_t * mp, void *handle)
3199 s = format (0, "SCRIPT: lisp_map_request_mode ");
3204 s = format (s, "dst-only");
3207 s = format (s, "src-dst");
3215 static void *vl_api_lisp_eid_table_dump_t_print
3216 (vl_api_lisp_eid_table_dump_t * mp, void *handle)
3220 s = format (0, "SCRIPT: lisp_eid_table_dump ");
3224 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3225 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type,
3226 mp->eid, mp->prefix_length);
3230 s = format (s, "local ");
3233 s = format (s, "remote ");
3240 static void *vl_api_lisp_rloc_probe_enable_disable_t_print
3241 (vl_api_lisp_rloc_probe_enable_disable_t * mp, void *handle)
3245 s = format (0, "SCRIPT: lisp_rloc_probe_enable_disable ");
3247 s = format (s, "enable");
3249 s = format (s, "disable");
3254 static void *vl_api_lisp_map_register_enable_disable_t_print
3255 (vl_api_lisp_map_register_enable_disable_t * mp, void *handle)
3259 s = format (0, "SCRIPT: lisp_map_register_enable_disable ");
3261 s = format (s, "enable");
3263 s = format (s, "disable");
3268 static void *vl_api_lisp_adjacencies_get_t_print
3269 (vl_api_lisp_adjacencies_get_t * mp, void *handle)
3273 s = format (0, "SCRIPT: lisp_adjacencies_get ");
3274 s = format (s, "vni %d", clib_net_to_host_u32 (mp->vni));
3279 static void *vl_api_lisp_eid_table_map_dump_t_print
3280 (vl_api_lisp_eid_table_map_dump_t * mp, void *handle)
3284 s = format (0, "SCRIPT: lisp_eid_table_map_dump ");
3287 s = format (s, "l2");
3289 s = format (s, "l3");
3294 static void *vl_api_ipsec_tunnel_if_add_del_t_print
3295 (vl_api_ipsec_tunnel_if_add_del_t * mp, void *handle)
3299 s = format (0, "SCRIPT: ipsec_tunnel_if_add_del ");
3302 s = format (s, "esn");
3303 if (mp->anti_replay)
3304 s = format (s, "anti-replay");
3306 s = format (s, "udp-encap");
3308 s = format (s, "local-ip %U ", format_vl_api_address, &mp->remote_ip);
3310 s = format (s, "remote-ip %U ", format_vl_api_address, &mp->local_ip);
3311 s = format (s, "tx-table-id %d ", ntohl (mp->tx_table_id));
3313 s = format (s, "local-spi %d ", ntohl (mp->local_spi));
3315 s = format (s, "remote-spi %d ", ntohl (mp->remote_spi));
3317 s = format (s, "local-crypto-key-len %d ", mp->local_crypto_key_len);
3318 s = format (s, "local-crypto-key %U ", format_hex_bytes,
3319 mp->local_crypto_key, mp->local_crypto_key_len, 0);
3320 s = format (s, "remote-crypto-key-len %d ", mp->remote_crypto_key_len);
3321 s = format (s, "remote-crypto-key %U ", format_hex_bytes,
3322 mp->remote_crypto_key, mp->remote_crypto_key_len, 0);
3323 s = format (s, "local-integ-key-len %d ", mp->local_integ_key_len);
3324 s = format (s, "local-integ-key %U ", format_hex_bytes,
3325 mp->local_integ_key, mp->local_integ_key_len, 0);
3326 s = format (s, "remote-integ-key-len %d ", mp->remote_integ_key_len);
3327 s = format (s, "remote-integ-key %U ", format_hex_bytes,
3328 mp->remote_integ_key, mp->remote_integ_key_len, 0);
3330 if (mp->is_add == 0)
3331 s = format (s, "del ");
3336 static void *vl_api_ipsec_gre_tunnel_add_del_t_print
3337 (vl_api_ipsec_gre_tunnel_add_del_t * mp, void *handle)
3341 s = format (0, "SCRIPT: ipsec_gre_tunnel_add_del ");
3343 s = format (s, "dst %U ", format_vl_api_ip4_address, mp->tunnel.dst);
3345 s = format (s, "src %U ", format_vl_api_ip4_address, mp->tunnel.src);
3347 s = format (s, "local_sa %d ", ntohl (mp->tunnel.local_sa_id));
3349 s = format (s, "remote_sa %d ", ntohl (mp->tunnel.remote_sa_id));
3351 if (mp->is_add == 0)
3352 s = format (s, "del ");
3357 static void *vl_api_ipsec_gre_tunnel_dump_t_print
3358 (vl_api_ipsec_gre_tunnel_dump_t * mp, void *handle)
3362 s = format (0, "SCRIPT: ipsec_gre_tunnel_dump ");
3364 if (mp->sw_if_index != ~0)
3365 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3370 static void *vl_api_l2_interface_pbb_tag_rewrite_t_print
3371 (vl_api_l2_interface_pbb_tag_rewrite_t * mp, void *handle)
3374 u32 vtr_op = ntohl (mp->vtr_op);
3376 s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
3378 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3379 s = format (s, "vtr_op %d ", vtr_op);
3380 if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
3382 if (vtr_op == L2_VTR_TRANSLATE_2_2)
3383 s = format (s, "%d ", ntohs (mp->outer_tag));
3384 s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
3385 s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
3386 s = format (s, "sid %d ", ntohl (mp->i_sid));
3387 s = format (s, "vlanid %d ", ntohs (mp->b_vlanid));
3392 static void *vl_api_flow_classify_set_interface_t_print
3393 (vl_api_flow_classify_set_interface_t * mp, void *handle)
3397 s = format (0, "SCRIPT: flow_classify_set_interface ");
3398 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3399 if (mp->ip4_table_index != ~0)
3400 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
3401 if (mp->ip6_table_index != ~0)
3402 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
3403 if (mp->is_add == 0)
3404 s = format (s, "del ");
3410 vl_api_set_punt_t_print (vl_api_set_punt_t * mp, void *handle)
3414 s = format (0, "SCRIPT: punt ");
3416 switch (clib_net_to_host_u32 (mp->punt.type))
3418 case PUNT_API_TYPE_L4:
3419 s = format (s, "%U", format_vl_api_address_family, mp->punt.punt.l4.af);
3421 s = format (s, "protocol %d ", mp->punt.punt.l4.protocol);
3423 if (mp->punt.punt.l4.port != (u16) ~ 0)
3424 s = format (s, "port %d ", ntohs (mp->punt.punt.l4.port));
3429 s = format (s, "del ");
3434 static void *vl_api_flow_classify_dump_t_print
3435 (vl_api_flow_classify_dump_t * mp, void *handle)
3439 s = format (0, "SCRIPT: flow_classify_dump ");
3442 case FLOW_CLASSIFY_TABLE_IP4:
3443 s = format (s, "type ip4 ");
3445 case FLOW_CLASSIFY_TABLE_IP6:
3446 s = format (s, "type ip6 ");
3455 static void *vl_api_get_first_msg_id_t_print
3456 (vl_api_get_first_msg_id_t * mp, void *handle)
3460 s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
3465 static void *vl_api_ioam_enable_t_print
3466 (vl_api_ioam_enable_t * mp, void *handle)
3470 s = format (0, "SCRIPT: ioam_enable ");
3472 if (mp->trace_enable)
3473 s = format (s, "trace enabled");
3476 s = format (s, "POT enabled");
3479 s = format (s, "Seqno enabled");
3482 s = format (s, "Analyse enabled");
3487 static void *vl_api_ioam_disable_t_print
3488 (vl_api_ioam_disable_t * mp, void *handle)
3492 s = format (0, "SCRIPT: ioam_disable ");
3493 s = format (s, "trace disabled");
3494 s = format (s, "POT disabled");
3495 s = format (s, "Seqno disabled");
3496 s = format (s, "Analyse disabled");
3501 static void *vl_api_feature_enable_disable_t_print
3502 (vl_api_feature_enable_disable_t * mp, void *handle)
3506 s = format (0, "SCRIPT: feature_enable_disable ");
3507 s = format (s, "arc_name %s ", mp->arc_name);
3508 s = format (s, "feature_name %s ", mp->feature_name);
3509 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3511 s = format (s, "disable");
3516 static void *vl_api_sw_interface_tag_add_del_t_print
3517 (vl_api_sw_interface_tag_add_del_t * mp, void *handle)
3521 s = format (0, "SCRIPT: sw_interface_tag_add_del ");
3522 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3524 s = format (s, "tag %s ", mp->tag);
3526 s = format (s, "del ");
3531 static void *vl_api_hw_interface_set_mtu_t_print
3532 (vl_api_hw_interface_set_mtu_t * mp, void *handle)
3536 s = format (0, "SCRIPT: sw_interface_set_mtu ");
3537 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3538 s = format (s, "tag %d ", ntohs (mp->mtu));
3543 static void *vl_api_p2p_ethernet_add_t_print
3544 (vl_api_p2p_ethernet_add_t * mp, void *handle)
3548 s = format (0, "SCRIPT: p2p_ethernet_add ");
3549 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3550 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3555 static void *vl_api_p2p_ethernet_del_t_print
3556 (vl_api_p2p_ethernet_del_t * mp, void *handle)
3560 s = format (0, "SCRIPT: p2p_ethernet_del ");
3561 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3562 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3567 static void *vl_api_tcp_configure_src_addresses_t_print
3568 (vl_api_tcp_configure_src_addresses_t * mp, void *handle)
3572 s = format (0, "SCRIPT: tcp_configure_src_addresses ");
3574 s = format (s, "%U - %U ",
3575 format_ip6_address, (ip6_address_t *) mp->first_address,
3576 format_ip6_address, (ip6_address_t *) mp->last_address);
3578 s = format (s, "%U - %U ",
3579 format_ip4_address, (ip4_address_t *) mp->first_address,
3580 format_ip4_address, (ip4_address_t *) mp->last_address);
3583 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
3588 static void *vl_api_app_namespace_add_del_t_print
3589 (vl_api_app_namespace_add_del_t * mp, void *handle)
3592 u8 len = clib_min (mp->namespace_id_len,
3593 ARRAY_LEN (mp->namespace_id) - 1);
3594 mp->namespace_id[len] = 0;
3595 s = format (0, "SCRIPT: app_namespace_add_del ");
3596 s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d "
3597 "ipv6_fib_id %d", (char *) mp->namespace_id, mp->secret,
3598 clib_net_to_host_u32 (mp->sw_if_index),
3599 clib_net_to_host_u32 (mp->ip4_fib_id),
3600 clib_net_to_host_u32 (mp->ip6_fib_id));
3604 static void *vl_api_lldp_config_t_print
3605 (vl_api_lldp_config_t * mp, void *handle)
3609 s = format (0, "SCRIPT: lldp_config ");
3610 s = format (s, "system_name %s ", mp->system_name);
3611 s = format (s, "tx_hold %d ", ntohl (mp->tx_hold));
3612 s = format (s, "tx_interval %d ", ntohl (mp->tx_interval));
3616 static void *vl_api_dns_enable_disable_t_print
3617 (vl_api_dns_enable_disable_t * mp, void *handle)
3621 s = format (0, "SCRIPT: dns_enable_disable ");
3622 s = format (s, "%s ", mp->enable ? "enable" : "disable");
3627 static void *vl_api_sw_interface_set_lldp_t_print
3628 (vl_api_sw_interface_set_lldp_t * mp, void *handle)
3633 clib_memset (null_data, 0, sizeof (null_data));
3635 s = format (0, "SCRIPT: sw_interface_set_lldp ");
3636 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3638 if (memcmp (mp->port_desc, null_data, sizeof (mp->port_desc)))
3639 s = format (s, "port_desc %s ", mp->port_desc);
3641 if (memcmp (mp->mgmt_ip4, null_data, sizeof (mp->mgmt_ip4)))
3642 s = format (s, "mgmt_ip4 %U ", format_ip4_address, mp->mgmt_ip4);
3644 if (memcmp (mp->mgmt_ip6, null_data, sizeof (mp->mgmt_ip6)))
3645 s = format (s, "mgmt_ip6 %U ", format_ip6_address, mp->mgmt_ip6);
3647 if (memcmp (mp->mgmt_oid, null_data, sizeof (mp->mgmt_oid)))
3648 s = format (s, "mgmt_oid %s ", mp->mgmt_oid);
3650 if (mp->enable == 0)
3651 s = format (s, "disable ");
3656 static void *vl_api_dns_name_server_add_del_t_print
3657 (vl_api_dns_name_server_add_del_t * mp, void *handle)
3661 s = format (0, "SCRIPT: dns_name_server_add_del ");
3663 s = format (s, "%U ", format_ip6_address,
3664 (ip6_address_t *) mp->server_address);
3666 s = format (s, "%U ", format_ip4_address,
3667 (ip4_address_t *) mp->server_address);
3669 if (mp->is_add == 0)
3670 s = format (s, "del ");
3675 static void *vl_api_dns_resolve_name_t_print
3676 (vl_api_dns_resolve_name_t * mp, void *handle)
3680 s = format (0, "SCRIPT: dns_resolve_name ");
3681 s = format (s, "%s ", mp->name);
3685 static void *vl_api_dns_resolve_ip_t_print
3686 (vl_api_dns_resolve_ip_t * mp, void *handle)
3690 s = format (0, "SCRIPT: dns_resolve_ip ");
3692 s = format (s, "%U ", format_ip6_address, mp->address);
3694 s = format (s, "%U ", format_ip4_address, mp->address);
3698 static void *vl_api_session_rule_add_del_t_print
3699 (vl_api_session_rule_add_del_t * mp, void *handle)
3702 char *proto = mp->transport_proto == 0 ? "tcp" : "udp";
3703 s = format (0, "SCRIPT: session_rule_add_del ");
3704 mp->tag[sizeof (mp->tag) - 1] = 0;
3706 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3707 mp->appns_index, mp->scope, proto, format_ip4_address,
3708 (ip4_address_t *) mp->lcl_ip, mp->lcl_plen,
3709 format_ip4_address, (ip4_address_t *) mp->rmt_ip,
3710 mp->rmt_plen, mp->action_index, mp->tag);
3712 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3713 mp->appns_index, mp->scope, proto, format_ip6_address,
3714 (ip6_address_t *) mp->lcl_ip, mp->lcl_plen,
3715 format_ip6_address, (ip6_address_t *) mp->rmt_ip,
3716 mp->rmt_plen, mp->action_index, mp->tag);
3721 static void *vl_api_ip_container_proxy_add_del_t_print
3722 (vl_api_ip_container_proxy_add_del_t * mp, void *handle)
3725 s = format (0, "SCRIPT: ip_container_proxy_add_del ");
3726 s = format (s, "is_add %d prefix %U sw_if_index %d",
3727 mp->is_add, format_vl_api_prefix, mp->sw_if_index);
3732 static void *vl_api_qos_record_enable_disable_t_print
3733 (vl_api_qos_record_enable_disable_t * mp, void *handle)
3737 s = format (0, "SCRIPT: qos_record_enable_disable ");
3738 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3739 s = format (s, "input_source %U ", format_qos_source,
3740 ntohl (mp->input_source));
3743 s = format (s, "disable ");
3748 #define foreach_custom_print_no_arg_function \
3749 _(lisp_eid_table_vni_dump) \
3750 _(lisp_map_resolver_dump) \
3751 _(lisp_map_server_dump) \
3752 _(show_lisp_rloc_probe_state) \
3753 _(show_lisp_map_register_state) \
3754 _(show_lisp_map_request_mode)
3757 static void * vl_api_ ## f ## _t_print \
3758 (vl_api_ ## f ## _t * mp, void * handle) \
3761 s = format (0, "SCRIPT: " #f ); \
3764 foreach_custom_print_no_arg_function
3766 #define foreach_custom_print_function \
3767 _(CREATE_LOOPBACK, create_loopback) \
3768 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
3769 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
3770 _(SW_INTERFACE_EVENT, sw_interface_event) \
3771 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
3772 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
3773 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
3774 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
3775 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
3776 _(SW_INTERFACE_SET_GENEVE_BYPASS, sw_interface_set_geneve_bypass) \
3777 _(BOND_CREATE, bond_create) \
3778 _(BOND_DELETE, bond_delete) \
3779 _(BOND_ENSLAVE, bond_enslave) \
3780 _(BOND_DETACH_SLAVE, bond_detach_slave) \
3781 _(TAP_CREATE_V2, tap_create_v2) \
3782 _(TAP_DELETE_V2, tap_delete_v2) \
3783 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) \
3784 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \
3785 _(IP_TABLE_ADD_DEL, ip_table_add_del) \
3786 _(MPLS_ROUTE_ADD_DEL, mpls_route_add_del) \
3787 _(MPLS_TABLE_ADD_DEL, mpls_table_add_del) \
3788 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
3789 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
3790 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3791 _(SR_MPLS_POLICY_ADD, sr_mpls_policy_add) \
3792 _(SR_MPLS_POLICY_DEL, sr_mpls_policy_del) \
3793 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3794 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
3795 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3796 _(CREATE_SUBIF, create_subif) \
3797 _(RESET_FIB, reset_fib) \
3798 _(DHCP_PROXY_CONFIG, dhcp_proxy_config) \
3799 _(DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss) \
3800 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3801 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \
3802 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \
3803 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
3804 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3805 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3806 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3807 _(SR_POLICY_ADD, sr_policy_add) \
3808 _(SR_POLICY_MOD, sr_policy_mod) \
3809 _(SR_POLICY_DEL, sr_policy_del) \
3810 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3811 _(L2FIB_ADD_DEL, l2fib_add_del) \
3812 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3813 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3814 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3815 _(L2_FLAGS, l2_flags) \
3816 _(BRIDGE_FLAGS, bridge_flags) \
3817 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3818 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3819 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3820 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3821 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3822 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3823 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3824 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3825 _(ADD_NODE_NEXT, add_node_next) \
3826 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \
3827 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \
3828 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \
3829 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \
3830 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
3831 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
3832 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3833 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3834 _(VXLAN_OFFLOAD_RX, vxlan_offload_rx) \
3835 _(GENEVE_ADD_DEL_TUNNEL, geneve_add_del_tunnel) \
3836 _(GENEVE_TUNNEL_DUMP, geneve_tunnel_dump) \
3837 _(GRE_TUNNEL_ADD_DEL, gre_tunnel_add_del) \
3838 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3839 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3840 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3841 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3842 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3843 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3844 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3845 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3846 _(CONTROL_PING, control_ping) \
3847 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3849 _(CLI_INBAND, cli_inband) \
3850 _(MEMCLNT_CREATE, memclnt_create) \
3851 _(SOCKCLNT_CREATE, sockclnt_create) \
3852 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3853 _(SHOW_VERSION, show_version) \
3854 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3855 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3856 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3857 _(VXLAN_GBP_TUNNEL_ADD_DEL, vxlan_gbp_tunnel_add_del) \
3858 _(VXLAN_GBP_TUNNEL_DUMP, vxlan_gbp_tunnel_dump) \
3859 _(SW_INTERFACE_SET_VXLAN_GBP_BYPASS, sw_interface_set_vxlan_gbp_bypass) \
3860 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3861 _(IP_PROBE_NEIGHBOR, ip_probe_neighbor) \
3862 _(IP_SCAN_NEIGHBOR_ENABLE_DISABLE, ip_scan_neighbor_enable_disable) \
3863 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
3864 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \
3865 _(WANT_L2_MACS_EVENTS, want_l2_macs_events) \
3866 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3867 _(IP_ADDRESS_DUMP, ip_address_dump) \
3868 _(IP_DUMP, ip_dump) \
3869 _(DELETE_LOOPBACK, delete_loopback) \
3870 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3871 _(BD_IP_MAC_FLUSH, bd_ip_mac_flush) \
3872 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3873 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3874 _(AF_PACKET_CREATE, af_packet_create) \
3875 _(AF_PACKET_DELETE, af_packet_delete) \
3876 _(AF_PACKET_DUMP, af_packet_dump) \
3877 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3878 _(MPLS_FIB_DUMP, mpls_fib_dump) \
3879 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3880 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3881 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3882 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3883 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3884 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3885 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3886 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3887 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3888 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3889 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3890 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3891 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3892 _(GET_NEXT_INDEX, get_next_index) \
3893 _(PG_CREATE_INTERFACE,pg_create_interface) \
3894 _(PG_CAPTURE, pg_capture) \
3895 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3896 _(POLICER_ADD_DEL, policer_add_del) \
3897 _(POLICER_DUMP, policer_dump) \
3898 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3899 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3900 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3901 ip_source_and_port_range_check_add_del) \
3902 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3903 ip_source_and_port_range_check_interface_add_del) \
3904 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
3905 _(GPE_ENABLE_DISABLE, gpe_enable_disable) \
3906 _(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \
3907 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
3908 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \
3909 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \
3910 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
3911 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
3912 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
3913 lisp_add_del_map_request_itr_rlocs) \
3914 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
3915 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
3916 _(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \
3917 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
3918 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
3919 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
3920 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
3921 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
3922 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \
3923 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
3924 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \
3925 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
3926 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \
3927 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \
3928 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \
3929 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \
3930 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \
3931 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \
3932 _(IPSEC_TUNNEL_IF_ADD_DEL, ipsec_tunnel_if_add_del) \
3933 _(IPSEC_GRE_TUNNEL_ADD_DEL, ipsec_gre_tunnel_add_del) \
3934 _(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \
3935 _(DELETE_SUBIF, delete_subif) \
3936 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3937 _(SET_PUNT, set_punt) \
3938 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3939 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3940 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3941 _(IOAM_ENABLE, ioam_enable) \
3942 _(IOAM_DISABLE, ioam_disable) \
3943 _(IP_FIB_DUMP, ip_fib_dump) \
3944 _(IP6_FIB_DUMP, ip6_fib_dump) \
3945 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3946 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3947 _(HW_INTERFACE_SET_MTU, hw_interface_set_mtu) \
3948 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3949 _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
3950 _(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
3951 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
3952 _(LLDP_CONFIG, lldp_config) \
3953 _(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \
3954 _(DNS_ENABLE_DISABLE, dns_enable_disable) \
3955 _(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \
3956 _(DNS_RESOLVE_NAME, dns_resolve_name) \
3957 _(DNS_RESOLVE_IP, dns_resolve_ip) \
3958 _(SESSION_RULE_ADD_DEL, session_rule_add_del) \
3959 _(OUTPUT_ACL_SET_INTERFACE, output_acl_set_interface) \
3960 _(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable)
3962 vl_msg_api_custom_dump_configure (api_main_t * am)
3964 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3965 = (void *) vl_api_##f##_t_print;
3966 foreach_custom_print_function;
3971 * fd.io coding-style-patch-verification: ON
3973 * Local Variables: eval: (c-set-style "gnu") End: