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>
45 #include <vpp/oam/oam.h>
47 #include <vnet/ethernet/ethernet.h>
48 #include <vnet/ethernet/ethernet_types_api.h>
49 #include <vnet/l2/l2_vtr.h>
51 #include <vpp/api/vpe_msg_enum.h>
52 #include <vpp/api/types.h>
54 #include <vnet/bonding/node.h>
56 #define vl_typedefs /* define message structures */
57 #include <vpp/api/vpe_all_api_h.h>
60 #define vl_endianfun /* define message structures */
61 #include <vpp/api/vpe_all_api_h.h>
64 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
68 vl_print (handle, (char *)s); \
73 static void *vl_api_create_loopback_t_print
74 (vl_api_create_loopback_t * mp, void *handle)
78 s = format (0, "SCRIPT: create_loopback ");
79 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
84 static void *vl_api_create_loopback_instance_t_print
85 (vl_api_create_loopback_instance_t * mp, void *handle)
89 s = format (0, "SCRIPT: create_loopback ");
90 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
91 s = format (s, "instance %d ", ntohl (mp->user_instance));
96 static void *vl_api_delete_loopback_t_print
97 (vl_api_delete_loopback_t * mp, void *handle)
101 s = format (0, "SCRIPT: delete_loopback ");
102 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
107 static void *vl_api_sw_interface_set_flags_t_print
108 (vl_api_sw_interface_set_flags_t * mp, void *handle)
111 s = format (0, "SCRIPT: sw_interface_set_flags ");
113 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
115 if (mp->admin_up_down)
116 s = format (s, "admin-up ");
118 s = format (s, "admin-down ");
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));
140 static void *vl_api_sw_interface_rx_placement_dump_t_print
141 (vl_api_sw_interface_rx_placement_dump_t * mp, void *handle)
144 u32 sw_if_index = ntohl (mp->sw_if_index);
146 s = format (0, "SCRIPT: sw_interface_rx_placement_dump ");
148 if (sw_if_index != ~0)
149 s = format (s, "sw_if_index %d ", sw_if_index);
154 static void *vl_api_sw_interface_event_t_print
155 (vl_api_sw_interface_event_t * mp, void *handle)
158 s = format (0, "SCRIPT: sw_interface_event ");
160 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
162 if (mp->admin_up_down)
163 s = format (s, "admin-up ");
165 s = format (s, "admin-down ");
167 if (mp->link_up_down)
168 s = format (s, "link-up");
170 s = format (s, "link-down");
173 s = format (s, " deleted");
178 static void *vl_api_sw_interface_add_del_address_t_print
179 (vl_api_sw_interface_add_del_address_t * mp, void *handle)
183 s = format (0, "SCRIPT: sw_interface_add_del_address ");
185 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
188 s = format (s, "%U/%d ", format_ip6_address,
189 (ip6_address_t *) mp->address, mp->address_length);
191 s = format (s, "%U/%d ", format_ip4_address,
192 (ip4_address_t *) mp->address, mp->address_length);
195 s = format (s, "del ");
197 s = format (s, "del-all ");
202 static void *vl_api_sw_interface_set_table_t_print
203 (vl_api_sw_interface_set_table_t * mp, void *handle)
207 s = format (0, "SCRIPT: sw_interface_set_table ");
209 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
212 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
215 s = format (s, "ipv6 ");
220 static void *vl_api_sw_interface_set_mpls_enable_t_print
221 (vl_api_sw_interface_set_mpls_enable_t * mp, void *handle)
225 s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
227 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
230 s = format (s, "disable");
235 static void *vl_api_sw_interface_set_vpath_t_print
236 (vl_api_sw_interface_set_vpath_t * mp, void *handle)
240 s = format (0, "SCRIPT: sw_interface_set_vpath ");
242 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
245 s = format (s, "enable ");
247 s = format (s, "disable ");
252 static void *vl_api_sw_interface_set_vxlan_bypass_t_print
253 (vl_api_sw_interface_set_vxlan_bypass_t * mp, void *handle)
257 s = format (0, "SCRIPT: sw_interface_set_vxlan_bypass ");
259 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
262 s = format (s, "ip6 ");
265 s = format (s, "enable ");
267 s = format (s, "disable ");
272 static void *vl_api_sw_interface_set_geneve_bypass_t_print
273 (vl_api_sw_interface_set_geneve_bypass_t * mp, void *handle)
277 s = format (0, "SCRIPT: sw_interface_set_geneve_bypass ");
279 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
282 s = format (s, "ip6 ");
285 s = format (s, "enable ");
287 s = format (s, "disable ");
292 static void *vl_api_sw_interface_set_l2_xconnect_t_print
293 (vl_api_sw_interface_set_l2_xconnect_t * mp, void *handle)
297 s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
299 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
303 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
306 s = format (s, "delete ");
311 static void *vl_api_sw_interface_set_l2_bridge_t_print
312 (vl_api_sw_interface_set_l2_bridge_t * mp, void *handle)
316 s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
318 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
322 s = format (s, "bd_id %d shg %d ", ntohl (mp->bd_id), mp->shg);
323 if (L2_API_PORT_TYPE_BVI == ntohl (mp->port_type))
324 s = format (s, "bvi ");
325 if (L2_API_PORT_TYPE_UU_FWD == ntohl (mp->port_type))
326 s = format (s, "uu-fwd ");
327 s = format (s, "enable");
330 s = format (s, "disable ");
335 static void *vl_api_bridge_domain_add_del_t_print
336 (vl_api_bridge_domain_add_del_t * mp, void *handle)
340 s = format (0, "SCRIPT: bridge_domain_add_del ");
342 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
347 s = format (s, "bd_tag %s ", mp->bd_tag);
348 s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood);
349 s = format (s, "forward %d learn %d ", mp->forward, mp->learn);
350 s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age);
353 s = format (s, "del ");
358 static void *vl_api_bridge_domain_set_mac_age_t_print
359 (vl_api_bridge_domain_set_mac_age_t * mp, void *handle)
363 s = format (0, "SCRIPT: bridge_domain_set_mac_age ");
365 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
367 s = format (s, "mac-age %d", mp->mac_age);
372 static void *vl_api_bridge_domain_dump_t_print
373 (vl_api_bridge_domain_dump_t * mp, void *handle)
376 u32 bd_id = ntohl (mp->bd_id);
378 s = format (0, "SCRIPT: bridge_domain_dump ");
381 s = format (s, "bd_id %d ", bd_id);
386 static void *vl_api_l2fib_flush_all_t_print
387 (vl_api_l2fib_flush_all_t * mp, void *handle)
391 s = format (0, "SCRIPT: l2fib_flush_all ");
397 static void *vl_api_l2fib_flush_bd_t_print
398 (vl_api_l2fib_flush_bd_t * mp, void *handle)
401 u32 bd_id = ntohl (mp->bd_id);
403 s = format (0, "SCRIPT: l2fib_flush_bd ");
404 s = format (s, "bd_id %d ", bd_id);
409 static void *vl_api_l2fib_flush_int_t_print
410 (vl_api_l2fib_flush_int_t * mp, void *handle)
413 u32 sw_if_index = ntohl (mp->sw_if_index);
415 s = format (0, "SCRIPT: l2fib_flush_int ");
416 s = format (s, "sw_if_index %d ", sw_if_index);
421 static void *vl_api_l2fib_add_del_t_print
422 (vl_api_l2fib_add_del_t * mp, void *handle)
426 s = format (0, "SCRIPT: l2fib_add_del ");
428 s = format (s, "mac %U ", format_ethernet_address, mp->mac);
430 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
435 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
437 s = format (s, "%s", "static ");
439 s = format (s, "%s", "filter ");
441 s = format (s, "%s", "bvi ");
445 s = format (s, "del ");
452 vl_api_l2_flags_t_print (vl_api_l2_flags_t * mp, void *handle)
455 u32 flags = ntohl (mp->feature_bitmap);
457 s = format (0, "SCRIPT: l2_flags ");
459 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
461 if (flags & L2_LEARN)
462 s = format (s, "learn ");
464 s = format (s, "forward ");
465 if (flags & L2_FLOOD)
466 s = format (s, "flood ");
467 if (flags & L2_UU_FLOOD)
468 s = format (s, "uu-flood ");
469 if (flags & L2_ARP_TERM)
470 s = format (s, "arp-term ");
473 s = format (s, "clear ");
478 static void *vl_api_bridge_flags_t_print
479 (vl_api_bridge_flags_t * mp, void *handle)
482 u32 flags = ntohl (mp->flags);
484 s = format (0, "SCRIPT: bridge_flags ");
486 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
488 if (flags & BRIDGE_API_FLAG_LEARN)
489 s = format (s, "learn ");
490 if (flags & BRIDGE_API_FLAG_FWD)
491 s = format (s, "forward ");
492 if (flags & BRIDGE_API_FLAG_FLOOD)
493 s = format (s, "flood ");
494 if (flags & BRIDGE_API_FLAG_UU_FLOOD)
495 s = format (s, "uu-flood ");
496 if (flags & BRIDGE_API_FLAG_ARP_TERM)
497 s = format (s, "arp-term ");
500 s = format (s, "clear ");
505 static void *vl_api_bd_ip_mac_add_del_t_print
506 (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
510 s = format (0, "SCRIPT: bd_ip_mac_add_del ");
511 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
513 s = format (s, "%U ", format_vl_api_address, &mp->ip);
514 s = format (s, "%U ", format_vl_api_mac_address, &mp->mac);
516 s = format (s, "del ");
521 static void *vl_api_bd_ip_mac_flush_t_print
522 (vl_api_bd_ip_mac_flush_t * mp, void *handle)
526 s = format (0, "SCRIPT: bd_ip_mac_flush ");
527 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
532 static void *vl_api_bd_ip_mac_dump_t_print
533 (vl_api_bd_ip_mac_dump_t * mp, void *handle)
537 s = format (0, "SCRIPT: bd_ip_mac_dump ");
542 static void *vl_api_tap_create_v2_t_print
543 (vl_api_tap_create_v2_t * mp, void *handle)
548 clib_memset (null_mac, 0, sizeof (null_mac));
550 s = format (0, "SCRIPT: tap_create_v2 ");
551 s = format (s, "id %u ", ntohl (mp->id));
552 if (memcmp (mp->mac_address, null_mac, 6))
553 s = format (s, "mac-address %U ",
554 format_ethernet_address, mp->mac_address);
555 if (memcmp (mp->host_mac_addr, null_mac, 6))
556 s = format (s, "host-mac-addr %U ",
557 format_ethernet_address, mp->host_mac_addr);
558 if (mp->host_if_name_set)
559 s = format (s, "host-if-name %s ", mp->host_if_name);
560 if (mp->host_namespace_set)
561 s = format (s, "host-ns %s ", mp->host_namespace);
562 if (mp->host_bridge_set)
563 s = format (s, "host-bridge %s ", mp->host_bridge);
564 if (mp->host_ip4_addr_set)
565 s = format (s, "host-ip4-addr %U/%d ", format_ip4_address,
566 mp->host_ip4_addr, mp->host_ip4_prefix_len);
567 if (mp->host_ip6_addr_set)
568 s = format (s, "host-ip6-addr %U/%d ", format_ip6_address,
569 mp->host_ip6_addr, mp->host_ip6_prefix_len);
570 if (mp->host_ip4_gw_set)
571 s = format (s, "host-ip4-gw %U ", format_ip4_address, mp->host_ip4_addr);
572 if (mp->host_ip6_gw_set)
573 s = format (s, "host-ip6-gw %U ", format_ip6_address, mp->host_ip6_addr);
575 s = format (s, "tx-ring-size %u ", ntohs (mp->tx_ring_sz));
577 s = format (s, "rx-ring-size %u ", ntohs (mp->rx_ring_sz));
581 static void *vl_api_tap_delete_v2_t_print
582 (vl_api_tap_delete_v2_t * mp, void *handle)
586 s = format (0, "SCRIPT: tap_delete_v2 ");
587 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
592 static void *vl_api_sw_interface_tap_v2_dump_t_print
593 (vl_api_sw_interface_tap_v2_dump_t * mp, void *handle)
597 s = format (0, "SCRIPT: sw_interface_tap_v2_dump ");
602 static void *vl_api_virtio_pci_create_t_print
603 (vl_api_virtio_pci_create_t * mp, void *handle)
608 clib_memset (null_mac, 0, sizeof (null_mac));
610 s = format (0, "SCRIPT: virtio_pci_create ");
611 s = format (s, "pci_addr %U ", format_vlib_pci_addr, ntohl (mp->pci_addr));
612 if (memcmp (mp->mac_address, null_mac, 6))
613 s = format (s, "mac-address %U ",
614 format_ethernet_address, mp->mac_address);
616 s = format (s, "features 0x%llx ", clib_net_to_host_u64 (mp->features));
620 static void *vl_api_virtio_pci_delete_t_print
621 (vl_api_virtio_pci_delete_t * mp, void *handle)
625 s = format (0, "SCRIPT: virtio_pci_delete ");
626 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
631 static void *vl_api_sw_interface_virtio_pci_dump_t_print
632 (vl_api_sw_interface_virtio_pci_dump_t * mp, void *handle)
636 s = format (0, "SCRIPT: sw_interface_virtio_pci_dump ");
641 static void *vl_api_bond_create_t_print
642 (vl_api_bond_create_t * mp, void *handle)
647 clib_memset (null_mac, 0, sizeof (null_mac));
649 s = format (0, "SCRIPT: bond_create ");
650 if (memcmp (mp->mac_address, null_mac, 6))
651 s = format (s, "mac-address %U ",
652 format_ethernet_address, mp->mac_address);
654 s = format (s, "mode %U ", format_bond_mode, mp->mode);
656 s = format (s, "lb %U ", format_bond_load_balance, mp->lb);
658 s = format (s, "id %u ", ntohl (mp->id));
662 static void *vl_api_bond_delete_t_print
663 (vl_api_bond_delete_t * mp, void *handle)
667 s = format (0, "SCRIPT: bond_delete ");
668 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
673 static void *vl_api_bond_enslave_t_print
674 (vl_api_bond_enslave_t * mp, void *handle)
678 s = format (0, "SCRIPT: bond_enslave ");
679 s = format (s, "bond_sw_if_index %u ", mp->bond_sw_if_index);
680 s = format (s, "sw_if_index %u ", mp->sw_if_index);
682 s = format (s, "passive ");
683 if (mp->is_long_timeout)
684 s = format (s, "long-timeout ");
689 static void *vl_api_bond_detach_slave_t_print
690 (vl_api_bond_detach_slave_t * mp, void *handle)
694 s = format (0, "SCRIPT: bond_detach_slave ");
695 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
700 static void *vl_api_sw_interface_bond_dump_t_print
701 (vl_api_sw_interface_bond_dump_t * mp, void *handle)
705 s = format (0, "SCRIPT: sw_interface_bond_dump ");
710 static void *vl_api_sw_interface_slave_dump_t_print
711 (vl_api_sw_interface_slave_dump_t * mp, void *handle)
715 s = format (0, "SCRIPT: sw_interface_slave_dump ");
716 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
721 static void *vl_api_ip_add_del_route_t_print
722 (vl_api_ip_add_del_route_t * mp, void *handle)
726 s = format (0, "SCRIPT: ip_add_del_route ");
728 s = format (s, "del ");
731 s = format (s, "%U/%d ", format_ip6_address, mp->dst_address,
732 mp->dst_address_length);
734 s = format (s, "%U/%d ", format_ip4_address, mp->dst_address,
735 mp->dst_address_length);
737 if (mp->table_id != 0)
738 s = format (s, "vrf %d ", ntohl (mp->table_id));
741 s = format (s, "local ");
742 else if (mp->is_drop)
743 s = format (s, "drop ");
744 else if (mp->is_classify)
745 s = format (s, "classify %d", ntohl (mp->classify_table_index));
746 else if (mp->next_hop_via_label != htonl (MPLS_LABEL_INVALID))
747 s = format (s, "via via_label %d ", ntohl (mp->next_hop_via_label));
751 s = format (s, "via %U ", format_ip6_address, mp->next_hop_address);
753 s = format (s, "via %U ", format_ip4_address, mp->next_hop_address);
754 if (mp->next_hop_sw_if_index != ~0)
755 s = format (s, "sw_if_index %d ", ntohl (mp->next_hop_sw_if_index));
759 if (mp->next_hop_weight != 1)
760 s = format (s, "weight %d ", (u32) mp->next_hop_weight);
762 if (mp->is_multipath)
763 s = format (s, "multipath ");
765 if (mp->next_hop_table_id)
766 s = format (s, "lookup-in-vrf %d ", ntohl (mp->next_hop_table_id));
768 if (mp->next_hop_n_out_labels)
771 for (i = 0; i < mp->next_hop_n_out_labels; i++)
773 s = format (s, "out-label %d ",
774 ntohl (mp->next_hop_out_label_stack[i].label));
781 static void *vl_api_mpls_route_add_del_t_print
782 (vl_api_mpls_route_add_del_t * mp, void *handle)
786 s = format (0, "SCRIPT: mpls_route_add_del ");
789 s = format (s, "add ");
791 s = format (s, "del ");
793 s = format (s, "%d ", ntohl (mp->mr_label));
796 s = format (s, "eos ");
798 s = format (s, "non-eos ");
801 if (mp->mr_next_hop_proto == DPO_PROTO_IP4)
803 ip4_address_t ip4_null = {.as_u32 = 0, };
804 if (memcmp (mp->mr_next_hop, &ip4_null, sizeof (ip4_null)))
805 s = format (s, "via %U ", format_ip4_address, mp->mr_next_hop);
807 s = format (s, "via lookup-in-ip4-table %d ",
808 ntohl (mp->mr_next_hop_table_id));
810 else if (mp->mr_next_hop_proto == DPO_PROTO_IP6)
812 ip6_address_t ip6_null = { {0}
814 if (memcmp (mp->mr_next_hop, &ip6_null, sizeof (ip6_null)))
815 s = format (s, "via %U ", format_ip6_address, mp->mr_next_hop);
817 s = format (s, "via lookup-in-ip6-table %d ",
818 ntohl (mp->mr_next_hop_table_id));
820 else if (mp->mr_next_hop_proto == DPO_PROTO_ETHERNET)
822 s = format (s, "via l2-input-on ");
824 else if (mp->mr_next_hop_proto == DPO_PROTO_MPLS)
826 if (mp->mr_next_hop_via_label != htonl (MPLS_LABEL_INVALID))
828 format (s, "via via-label %d ", ntohl (mp->mr_next_hop_via_label));
830 s = format (s, "via next-hop-table %d ",
831 ntohl (mp->mr_next_hop_table_id));
833 if (mp->mr_next_hop_sw_if_index != ~0)
834 s = format (s, "sw_if_index %d ", ntohl (mp->mr_next_hop_sw_if_index));
836 if (mp->mr_next_hop_weight != 1)
837 s = format (s, "weight %d ", (u32) mp->mr_next_hop_weight);
839 if (mp->mr_is_multipath)
840 s = format (s, "multipath ");
842 if (mp->mr_is_classify)
843 s = format (s, "classify %d", ntohl (mp->mr_classify_table_index));
845 if (mp->mr_next_hop_n_out_labels)
848 for (i = 0; i < mp->mr_next_hop_n_out_labels; i++)
850 s = format (s, "out-label %d ",
851 ntohl (mp->mr_next_hop_out_label_stack[i].label));
858 static void *vl_api_ip_table_add_del_t_print
859 (vl_api_ip_table_add_del_t * mp, void *handle)
863 s = format (0, "SCRIPT: ip_table_add_del ");
865 s = format (s, "add ");
867 s = format (s, "del ");
869 s = format (s, "ip6 ");
870 s = format (s, "table %d ", ntohl (mp->table_id));
875 static void *vl_api_mpls_table_add_del_t_print
876 (vl_api_mpls_table_add_del_t * mp, void *handle)
880 s = format (0, "SCRIPT: mpls_table_add_del ");
882 s = format (s, "add ");
884 s = format (s, "del ");
885 s = format (s, "table %d ", ntohl (mp->mt_table_id));
890 static void *vl_api_proxy_arp_add_del_t_print
891 (vl_api_proxy_arp_add_del_t * mp, void *handle)
895 s = format (0, "SCRIPT: proxy_arp_add_del ");
897 s = format (s, "%U - %U ",
898 format_vl_api_ip4_address, mp->proxy.low,
899 format_vl_api_ip4_address, mp->proxy.hi);
901 s = format (s, "table %d ", ntohl (mp->proxy.table_id));
904 s = format (s, "del ");
909 static void *vl_api_proxy_arp_intfc_enable_disable_t_print
910 (vl_api_proxy_arp_intfc_enable_disable_t * mp, void *handle)
914 s = format (0, "SCRIPT: proxy_arp_intfc_enable_disable ");
916 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
918 s = format (s, "enable %d ", mp->enable_disable);
923 static void *vl_api_mpls_tunnel_add_del_t_print
924 (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
928 s = format (0, "SCRIPT: mpls_tunnel_add_del ");
930 if (mp->mt_is_add == 0)
931 s = format (s, "del sw_if_index %d ", ntohl (mp->mt_sw_if_index));
933 mpls_label_t label = ntohl (mp->mt_next_hop_via_label);
934 if (label != MPLS_LABEL_INVALID)
935 s = format (s, "via-label %d ", label);
936 else if (mp->mt_next_hop_proto_is_ip4)
937 s = format (s, "via %U ", format_ip4_address, mp->mt_next_hop);
939 s = format (s, "via %U ", format_ip6_address, mp->mt_next_hop);
941 if (mp->mt_next_hop_sw_if_index != ~0)
942 s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index));
943 else if (mp->mt_next_hop_table_id)
944 s = format (s, "next-hop-table %d ", ntohl (mp->mt_next_hop_table_id));
947 s = format (s, "l2-only ");
949 if (mp->mt_next_hop_n_out_labels)
952 for (i = 0; i < mp->mt_next_hop_n_out_labels; i++)
954 s = format (s, "out-label %d ",
955 ntohl (mp->mt_next_hop_out_label_stack[i].label));
962 static void *vl_api_sr_mpls_policy_add_t_print
963 (vl_api_sr_mpls_policy_add_t * mp, void *handle)
967 s = format (0, "SCRIPT: sr_mpls_policy_add ");
969 s = format (s, "bsid %d ", ntohl (mp->bsid));
971 if (mp->weight != htonl ((u32) 1))
972 s = format (s, "%d ", ntohl (mp->weight));
975 s = format (s, "spray ");
980 for (i = 0; i < mp->n_segments; i++)
981 s = format (s, "next %d ", ntohl (mp->segments[i]));
987 static void *vl_api_sr_mpls_policy_del_t_print
988 (vl_api_sr_mpls_policy_del_t * mp, void *handle)
992 s = format (0, "SCRIPT: sr_mpls_policy_del ");
994 s = format (s, "bsid %d ", ntohl (mp->bsid));
999 static void *vl_api_sw_interface_set_unnumbered_t_print
1000 (vl_api_sw_interface_set_unnumbered_t * mp, void *handle)
1004 s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
1006 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1008 s = format (s, "unnum_if_index %d ", ntohl (mp->unnumbered_sw_if_index));
1010 if (mp->is_add == 0)
1011 s = format (s, "del ");
1016 static void *vl_api_ip_neighbor_add_del_t_print
1017 (vl_api_ip_neighbor_add_del_t * mp, void *handle)
1021 s = format (0, "SCRIPT: ip_neighbor_add_del ");
1023 s = format (s, "sw_if_index %d ", ntohl (mp->neighbor.sw_if_index));
1025 if (IP_API_NEIGHBOR_FLAG_STATIC & ntohl (mp->neighbor.flags))
1026 s = format (s, "is_static ");
1028 if (IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY & ntohl (mp->neighbor.flags))
1029 s = format (s, "is_no_fib_entry ");
1031 s = format (s, "mac %U ", format_vl_api_mac_address,
1032 &mp->neighbor.mac_address);
1034 s = format (s, "dst %U ", format_vl_api_address, &mp->neighbor.ip_address);
1036 if (mp->is_add == 0)
1037 s = format (s, "del ");
1043 static void *vl_api_create_vlan_subif_t_print
1044 (vl_api_create_vlan_subif_t * mp, void *handle)
1048 s = format (0, "SCRIPT: create_vlan_subif ");
1050 if (mp->sw_if_index)
1051 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1054 s = format (s, "vlan_id %d ", ntohl (mp->vlan_id));
1059 #define foreach_create_subif_bit \
1066 _(outer_vlan_id_any) \
1067 _(inner_vlan_id_any)
1069 static void *vl_api_create_subif_t_print
1070 (vl_api_create_subif_t * mp, void *handle)
1074 s = format (0, "SCRIPT: create_subif ");
1076 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1078 s = format (s, "sub_id %d ", ntohl (mp->sub_id));
1080 if (mp->outer_vlan_id)
1081 s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
1083 if (mp->inner_vlan_id)
1084 s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
1086 #define _(a) if (mp->a) s = format (s, "%s ", #a);
1087 foreach_create_subif_bit;
1093 static void *vl_api_delete_subif_t_print
1094 (vl_api_delete_subif_t * mp, void *handle)
1098 s = format (0, "SCRIPT: delete_subif ");
1099 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1104 static void *vl_api_oam_add_del_t_print
1105 (vl_api_oam_add_del_t * mp, void *handle)
1109 s = format (0, "SCRIPT: oam_add_del ");
1112 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
1114 s = format (s, "src %U ", format_ip4_address, mp->src_address);
1116 s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
1118 if (mp->is_add == 0)
1119 s = format (s, "del ");
1125 vl_api_reset_fib_t_print (vl_api_reset_fib_t * mp, void *handle)
1129 s = format (0, "SCRIPT: reset_fib ");
1132 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
1134 if (mp->is_ipv6 != 0)
1135 s = format (s, "ipv6 ");
1140 static void *vl_api_dhcp_proxy_config_t_print
1141 (vl_api_dhcp_proxy_config_t * mp, void *handle)
1145 s = format (0, "SCRIPT: dhcp_proxy_config_2 ");
1147 s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
1148 s = format (s, "server_vrf_id %d ", ntohl (mp->server_vrf_id));
1152 s = format (s, "svr %U ", format_ip6_address,
1153 (ip6_address_t *) mp->dhcp_server);
1154 s = format (s, "src %U ", format_ip6_address,
1155 (ip6_address_t *) mp->dhcp_src_address);
1159 s = format (s, "svr %U ", format_ip4_address,
1160 (ip4_address_t *) mp->dhcp_server);
1161 s = format (s, "src %U ", format_ip4_address,
1162 (ip4_address_t *) mp->dhcp_src_address);
1164 if (mp->is_add == 0)
1165 s = format (s, "del ");
1170 static void *vl_api_dhcp_proxy_set_vss_t_print
1171 (vl_api_dhcp_proxy_set_vss_t * mp, void *handle)
1175 s = format (0, "SCRIPT: dhcp_proxy_set_vss ");
1177 s = format (s, "tbl_id %d ", ntohl (mp->tbl_id));
1179 if (mp->vss_type == VSS_TYPE_VPN_ID)
1181 s = format (s, "fib_id %d ", ntohl (mp->vpn_index));
1182 s = format (s, "oui %d ", ntohl (mp->oui));
1184 else if (mp->vss_type == VSS_TYPE_ASCII)
1185 s = format (s, "vpn_ascii_id %s", mp->vpn_ascii_id);
1187 if (mp->is_ipv6 != 0)
1188 s = format (s, "ipv6 ");
1190 if (mp->is_add == 0)
1191 s = format (s, "del ");
1196 static void *vl_api_dhcp_client_config_t_print
1197 (vl_api_dhcp_client_config_t * mp, void *handle)
1201 s = format (0, "SCRIPT: dhcp_client_config ");
1203 s = format (s, "sw_if_index %d ", ntohl (mp->client.sw_if_index));
1205 s = format (s, "hostname %s ", mp->client.hostname);
1207 s = format (s, "want_dhcp_event %d ", mp->client.want_dhcp_event);
1209 s = format (s, "pid %d ", ntohl (mp->client.pid));
1211 if (mp->is_add == 0)
1212 s = format (s, "del ");
1218 static void *vl_api_set_ip_flow_hash_t_print
1219 (vl_api_set_ip_flow_hash_t * mp, void *handle)
1223 s = format (0, "SCRIPT: set_ip_flow_hash ");
1225 s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
1228 s = format (s, "src ");
1231 s = format (s, "dst ");
1234 s = format (s, "sport ");
1237 s = format (s, "dport ");
1240 s = format (s, "proto ");
1243 s = format (s, "reverse ");
1245 if (mp->is_ipv6 != 0)
1246 s = format (s, "ipv6 ");
1251 static void *vl_api_sw_interface_ip6nd_ra_prefix_t_print
1252 (vl_api_sw_interface_ip6nd_ra_prefix_t * mp, void *handle)
1256 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_prefix ");
1258 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1260 s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
1262 s = format (s, "val_life %d ", ntohl (mp->val_lifetime));
1264 s = format (s, "pref_life %d ", ntohl (mp->pref_lifetime));
1266 if (mp->use_default)
1267 s = format (s, "def ");
1269 if (mp->no_advertise)
1270 s = format (s, "noadv ");
1273 s = format (s, "offl ");
1275 if (mp->no_autoconfig)
1276 s = format (s, "noauto ");
1279 s = format (s, "nolink ");
1282 s = format (s, "isno ");
1287 static void *vl_api_sw_interface_ip6nd_ra_config_t_print
1288 (vl_api_sw_interface_ip6nd_ra_config_t * mp, void *handle)
1292 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_config ");
1294 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1296 s = format (s, "maxint %d ", ntohl (mp->max_interval));
1298 s = format (s, "minint %d ", ntohl (mp->min_interval));
1300 s = format (s, "life %d ", ntohl (mp->lifetime));
1302 s = format (s, "count %d ", ntohl (mp->initial_count));
1304 s = format (s, "interval %d ", ntohl (mp->initial_interval));
1307 s = format (s, "suppress ");
1310 s = format (s, "managed ");
1313 s = format (s, "other ");
1316 s = format (s, "ll ");
1318 if (mp->send_unicast)
1319 s = format (s, "send ");
1322 s = format (s, "cease ");
1325 s = format (s, "isno ");
1327 if (mp->default_router)
1328 s = format (s, "def ");
1333 static void *vl_api_set_arp_neighbor_limit_t_print
1334 (vl_api_set_arp_neighbor_limit_t * mp, void *handle)
1338 s = format (0, "SCRIPT: set_arp_neighbor_limit ");
1340 s = format (s, "arp_nbr_limit %d ", ntohl (mp->arp_neighbor_limit));
1342 if (mp->is_ipv6 != 0)
1343 s = format (s, "ipv6 ");
1348 static void *vl_api_l2_patch_add_del_t_print
1349 (vl_api_l2_patch_add_del_t * mp, void *handle)
1353 s = format (0, "SCRIPT: l2_patch_add_del ");
1355 s = format (s, "rx_sw_if_index %d ", ntohl (mp->rx_sw_if_index));
1357 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
1359 if (mp->is_add == 0)
1360 s = format (s, "del ");
1365 static void *vl_api_sr_localsid_add_del_t_print
1366 (vl_api_sr_localsid_add_del_t * mp, void *handle)
1368 vnet_main_t *vnm = vnet_get_main ();
1371 s = format (0, "SCRIPT: sr_localsid_add_del ");
1373 switch (mp->behavior)
1375 case SR_BEHAVIOR_END:
1376 s = format (s, "Address: %U\nBehavior: End",
1377 format_ip6_address, (ip6_address_t *) mp->localsid.addr);
1378 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1383 "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1384 "\nIface: %U\nNext hop: %U", format_ip6_address,
1385 (ip6_address_t *) mp->localsid.addr,
1386 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1387 format_ip6_address, (ip6_address_t *) mp->nh_addr6);
1388 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1390 case SR_BEHAVIOR_DX4:
1393 "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1394 "\nIface: %U\nNext hop: %U", format_ip6_address,
1395 (ip6_address_t *) mp->localsid.addr,
1396 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1397 format_ip4_address, (ip4_address_t *) mp->nh_addr4);
1399 case SR_BEHAVIOR_DX6:
1402 "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1403 "\nIface: %UNext hop: %U", format_ip6_address,
1404 (ip6_address_t *) mp->localsid.addr,
1405 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1406 format_ip6_address, (ip6_address_t *) mp->nh_addr6);
1408 case SR_BEHAVIOR_DX2:
1411 "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1412 "\nIface: %U", format_ip6_address,
1413 (ip6_address_t *) mp->localsid.addr,
1414 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index));
1416 case SR_BEHAVIOR_DT6:
1419 "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1420 "\nTable: %u", format_ip6_address,
1421 (ip6_address_t *) mp->localsid.addr, ntohl (mp->fib_table));
1423 case SR_BEHAVIOR_DT4:
1426 "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1427 "\nTable: %u", format_ip6_address,
1428 (ip6_address_t *) mp->localsid.addr, ntohl (mp->fib_table));
1431 if (mp->behavior >= SR_BEHAVIOR_LAST)
1433 s = format (s, "Address: %U\n Behavior: %u",
1434 format_ip6_address, (ip6_address_t *) mp->localsid.addr,
1438 //Should never get here...
1439 s = format (s, "Internal error");
1445 static void *vl_api_sr_steering_add_del_t_print
1446 (vl_api_sr_steering_add_del_t * mp, void *handle)
1450 s = format (0, "SCRIPT: sr_steering_add_del ");
1452 s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1454 switch (mp->traffic_type)
1457 s = format (s, "Traffic type: L2 iface: %u", ntohl (mp->sw_if_index));
1460 s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1461 (ip4_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1464 s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1465 (ip6_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1468 s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1471 s = format (s, "BindingSID: %U", format_ip6_address,
1472 (ip6_address_t *) mp->bsid_addr);
1474 s = format (s, "SR Policy Index: %u", ntohl (mp->sr_policy_index));
1476 s = format (s, "FIB_table: %u", ntohl (mp->table_id));
1481 static void *vl_api_sr_policy_add_t_print
1482 (vl_api_sr_policy_add_t * mp, void *handle)
1486 ip6_address_t *segments = 0, *seg;
1487 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1490 for (i = 0; i < mp->sids.num_sids; i++)
1492 vec_add2 (segments, seg, 1);
1493 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1497 s = format (0, "SCRIPT: sr_policy_add ");
1499 s = format (s, "BSID: %U", format_ip6_address,
1500 (ip6_address_t *) mp->bsid_addr);
1504 (mp->is_encap ? "Behavior: Encapsulation" :
1505 "Behavior: SRH insertion"));
1507 s = format (s, "FIB_table: %u", ntohl (mp->fib_table));
1509 s = format (s, (mp->type ? "Type: Default" : "Type: Spray"));
1511 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1513 s = format (s, "{");
1514 vec_foreach (seg, segments)
1516 s = format (s, "%U, ", format_ip6_address, seg);
1518 s = format (s, "\b\b } ");
1523 static void *vl_api_sr_policy_mod_t_print
1524 (vl_api_sr_policy_mod_t * mp, void *handle)
1528 ip6_address_t *segments = 0, *seg;
1529 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1532 for (i = 0; i < mp->sids.num_sids; i++)
1534 vec_add2 (segments, seg, 1);
1535 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1539 s = format (0, "SCRIPT: sr_policy_mod ");
1541 s = format (s, "BSID: %U", format_ip6_address,
1542 (ip6_address_t *) mp->bsid_addr);
1544 s = format (s, "SR Policy index: %u", ntohl (mp->sr_policy_index));
1546 s = format (s, "Operation: %u", mp->operation);
1548 s = format (s, "SID list index: %u", ntohl (mp->sl_index));
1550 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1552 s = format (s, "{");
1553 vec_foreach (seg, segments)
1555 s = format (s, "%U, ", format_ip6_address, seg);
1557 s = format (s, "\b\b } ");
1562 static void *vl_api_sr_policy_del_t_print
1563 (vl_api_sr_policy_del_t * mp, void *handle)
1567 s = format (0, "SCRIPT: sr_policy_del ");
1568 s = format (s, "To be delivered. Good luck.");
1572 static void *vl_api_classify_add_del_table_t_print
1573 (vl_api_classify_add_del_table_t * mp, void *handle)
1578 s = format (0, "SCRIPT: classify_add_del_table ");
1580 if (mp->is_add == 0)
1582 s = format (s, "table %d ", ntohl (mp->table_index));
1583 s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1587 s = format (s, "nbuckets %d ", ntohl (mp->nbuckets));
1588 s = format (s, "memory_size %d ", ntohl (mp->memory_size));
1589 s = format (s, "skip %d ", ntohl (mp->skip_n_vectors));
1590 s = format (s, "match %d ", ntohl (mp->match_n_vectors));
1591 s = format (s, "next-table %d ", ntohl (mp->next_table_index));
1592 s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
1593 s = format (s, "current-data-flag %d ", ntohl (mp->current_data_flag));
1594 if (mp->current_data_flag)
1595 s = format (s, "current-data-offset %d ",
1596 ntohl (mp->current_data_offset));
1597 s = format (s, "mask hex ");
1598 for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
1599 s = format (s, "%02x", mp->mask[i]);
1606 static void *vl_api_classify_add_del_session_t_print
1607 (vl_api_classify_add_del_session_t * mp, void *handle)
1612 s = format (0, "SCRIPT: classify_add_del_session ");
1614 s = format (s, "table_index %d ", ntohl (mp->table_index));
1615 s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
1616 s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
1617 s = format (s, "advance %d ", ntohl (mp->advance));
1618 s = format (s, "action %d ", mp->action);
1620 s = format (s, "metadata %d ", ntohl (mp->metadata));
1621 if (mp->is_add == 0)
1622 s = format (s, "del ");
1624 s = format (s, "match hex ");
1625 for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1627 if (mp->match[i] != 0)
1634 for (i = 0; i < limit; i++)
1635 s = format (s, "%02x", mp->match[i]);
1640 static void *vl_api_classify_set_interface_ip_table_t_print
1641 (vl_api_classify_set_interface_ip_table_t * mp, void *handle)
1645 s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1648 s = format (s, "ipv6 ");
1650 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1651 s = format (s, "table %d ", ntohl (mp->table_index));
1656 static void *vl_api_classify_set_interface_l2_tables_t_print
1657 (vl_api_classify_set_interface_l2_tables_t * mp, void *handle)
1661 s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1663 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1664 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1665 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1666 s = format (s, "other-table %d ", ntohl (mp->other_table_index));
1667 s = format (s, "is-input %d ", mp->is_input);
1672 static void *vl_api_add_node_next_t_print
1673 (vl_api_add_node_next_t * mp, void *handle)
1677 s = format (0, "SCRIPT: add_node_next ");
1679 s = format (0, "node %s next %s ", mp->node_name, mp->next_name);
1684 static void *vl_api_l2tpv3_create_tunnel_t_print
1685 (vl_api_l2tpv3_create_tunnel_t * mp, void *handle)
1689 s = format (0, "SCRIPT: l2tpv3_create_tunnel ");
1691 s = format (s, "client_address %U our_address %U ",
1692 format_ip6_address, (ip6_address_t *) (mp->client_address),
1693 format_ip6_address, (ip6_address_t *) (mp->our_address));
1694 s = format (s, "local_session_id %d ", ntohl (mp->local_session_id));
1695 s = format (s, "remote_session_id %d ", ntohl (mp->remote_session_id));
1696 s = format (s, "local_cookie %lld ",
1697 clib_net_to_host_u64 (mp->local_cookie));
1698 s = format (s, "remote_cookie %lld ",
1699 clib_net_to_host_u64 (mp->remote_cookie));
1700 if (mp->l2_sublayer_present)
1701 s = format (s, "l2-sublayer-present ");
1706 static void *vl_api_l2tpv3_set_tunnel_cookies_t_print
1707 (vl_api_l2tpv3_set_tunnel_cookies_t * mp, void *handle)
1711 s = format (0, "SCRIPT: l2tpv3_set_tunnel_cookies ");
1713 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1715 s = format (s, "new_local_cookie %llu ",
1716 clib_net_to_host_u64 (mp->new_local_cookie));
1718 s = format (s, "new_remote_cookie %llu ",
1719 clib_net_to_host_u64 (mp->new_remote_cookie));
1724 static void *vl_api_l2tpv3_interface_enable_disable_t_print
1725 (vl_api_l2tpv3_interface_enable_disable_t * mp, void *handle)
1729 s = format (0, "SCRIPT: l2tpv3_interface_enable_disable ");
1731 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1733 if (mp->enable_disable == 0)
1734 s = format (s, "del ");
1739 static void *vl_api_l2tpv3_set_lookup_key_t_print
1740 (vl_api_l2tpv3_set_lookup_key_t * mp, void *handle)
1743 char *str = "unknown";
1745 s = format (0, "SCRIPT: l2tpv3_set_lookup_key ");
1749 case L2T_LOOKUP_SRC_ADDRESS:
1750 str = "lookup_v6_src";
1752 case L2T_LOOKUP_DST_ADDRESS:
1753 str = "lookup_v6_dst";
1755 case L2T_LOOKUP_SESSION_ID:
1756 str = "lookup_session_id";
1762 s = format (s, "%s ", str);
1767 static void *vl_api_sw_if_l2tpv3_tunnel_dump_t_print
1768 (vl_api_sw_if_l2tpv3_tunnel_dump_t * mp, void *handle)
1772 s = format (0, "SCRIPT: sw_if_l2tpv3_tunnel_dump ");
1777 static void *vl_api_vxlan_add_del_tunnel_t_print
1778 (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1781 s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1783 ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
1784 ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
1786 u8 is_grp = ip46_address_is_multicast (&dst);
1787 char *dst_name = is_grp ? "group" : "dst";
1789 s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1790 s = format (s, "%s %U ", dst_name, format_ip46_address,
1791 &dst, IP46_TYPE_ANY);
1794 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1796 if (mp->encap_vrf_id)
1797 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1799 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1801 s = format (s, "vni %d ", ntohl (mp->vni));
1803 s = format (s, "instance %d ", ntohl (mp->instance));
1805 if (mp->is_add == 0)
1806 s = format (s, "del ");
1811 static void *vl_api_vxlan_offload_rx_t_print
1812 (vl_api_vxlan_offload_rx_t * mp, void *handle)
1815 s = format (0, "SCRIPT: vxlan_offload_rx ");
1817 s = format (s, "hw hw_if_index %d ", ntohl (mp->hw_if_index));
1818 s = format (s, "rx sw_if_index %d ", ntohl (mp->sw_if_index));
1820 s = format (s, "del ");
1825 static void *vl_api_vxlan_tunnel_dump_t_print
1826 (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1830 s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1832 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1837 static void *vl_api_vxlan_gbp_tunnel_add_del_t_print
1838 (vl_api_vxlan_gbp_tunnel_add_del_t * mp, void *handle)
1841 s = format (0, "SCRIPT: vxlan_gbp_tunnel_add_del ");
1844 s = format (s, "add ");
1846 s = format (s, "del ");
1848 s = format (s, "instance %d ", ntohl (mp->tunnel.instance));
1849 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1850 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1852 format (s, "mcast_sw_if_index %d ", ntohl (mp->tunnel.mcast_sw_if_index));
1853 s = format (s, "encap_table_id %d ", ntohl (mp->tunnel.encap_table_id));
1854 s = format (s, "vni %d ", ntohl (mp->tunnel.vni));
1855 s = format (s, "sw_if_index %d ", ntohl (mp->tunnel.sw_if_index));
1860 static void *vl_api_vxlan_gbp_tunnel_dump_t_print
1861 (vl_api_vxlan_gbp_tunnel_dump_t * mp, void *handle)
1865 s = format (0, "SCRIPT: vxlan_gbp_tunnel_dump ");
1867 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1872 static void *vl_api_sw_interface_set_vxlan_gbp_bypass_t_print
1873 (vl_api_sw_interface_set_vxlan_gbp_bypass_t * mp, void *handle)
1877 s = format (0, "SCRIPT: sw_interface_set_vxlan_gbp_bypass ");
1879 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1880 s = format (s, "%s ", (mp->is_ipv6 != 0) ? "ipv6" : "ipv4");
1881 s = format (s, "%s ", (mp->enable != 0) ? "enable" : "disable");
1886 static void *vl_api_geneve_add_del_tunnel_t_print
1887 (vl_api_geneve_add_del_tunnel_t * mp, void *handle)
1890 s = format (0, "SCRIPT: geneve_add_del_tunnel ");
1892 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local_address);
1893 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote_address);
1895 u8 is_grp = ip46_address_is_multicast (&remote);
1896 char *remote_name = is_grp ? "group" : "dst";
1898 s = format (s, "src %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1899 s = format (s, "%s %U ", remote_name, format_ip46_address,
1900 &remote, IP46_TYPE_ANY);
1903 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1905 if (mp->encap_vrf_id)
1906 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1908 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1910 s = format (s, "vni %d ", ntohl (mp->vni));
1912 if (mp->is_add == 0)
1913 s = format (s, "del ");
1918 static void *vl_api_geneve_tunnel_dump_t_print
1919 (vl_api_geneve_tunnel_dump_t * mp, void *handle)
1923 s = format (0, "SCRIPT: geneve_tunnel_dump ");
1925 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1930 static void *vl_api_gre_tunnel_add_del_t_print
1931 (vl_api_gre_tunnel_add_del_t * mp, void *handle)
1935 s = format (0, "SCRIPT: gre_tunnel_add_del ");
1937 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1938 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1940 s = format (s, "instance %d ", ntohl (mp->tunnel.instance));
1942 if (mp->tunnel.type == GRE_TUNNEL_TYPE_TEB)
1943 s = format (s, "teb ");
1945 if (mp->tunnel.type == GRE_TUNNEL_TYPE_ERSPAN)
1946 s = format (s, "erspan %d ", ntohs (mp->tunnel.session_id));
1948 if (mp->tunnel.outer_fib_id)
1949 s = format (s, "outer-fib-id %d ", ntohl (mp->tunnel.outer_fib_id));
1951 if (mp->is_add == 0)
1952 s = format (s, "del ");
1957 static void *vl_api_gre_tunnel_dump_t_print
1958 (vl_api_gre_tunnel_dump_t * mp, void *handle)
1962 s = format (0, "SCRIPT: gre_tunnel_dump ");
1964 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1969 static void *vl_api_l2_fib_clear_table_t_print
1970 (vl_api_l2_fib_clear_table_t * mp, void *handle)
1974 s = format (0, "SCRIPT: l2_fib_clear_table ");
1979 static void *vl_api_l2_interface_efp_filter_t_print
1980 (vl_api_l2_interface_efp_filter_t * mp, void *handle)
1984 s = format (0, "SCRIPT: l2_interface_efp_filter ");
1986 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1987 if (mp->enable_disable)
1988 s = format (s, "enable ");
1990 s = format (s, "disable ");
1995 static void *vl_api_l2_interface_vlan_tag_rewrite_t_print
1996 (vl_api_l2_interface_vlan_tag_rewrite_t * mp, void *handle)
2000 s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
2002 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2003 s = format (s, "vtr_op %d ", ntohl (mp->vtr_op));
2004 s = format (s, "push_dot1q %d ", ntohl (mp->push_dot1q));
2005 s = format (s, "tag1 %d ", ntohl (mp->tag1));
2006 s = format (s, "tag2 %d ", ntohl (mp->tag2));
2011 static void *vl_api_create_vhost_user_if_t_print
2012 (vl_api_create_vhost_user_if_t * mp, void *handle)
2016 s = format (0, "SCRIPT: create_vhost_user_if ");
2018 s = format (s, "socket %s ", mp->sock_filename);
2020 s = format (s, "server ");
2022 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
2023 if (mp->disable_mrg_rxbuf)
2024 s = format (s, "disable_mrg_rxbuf ");
2025 if (mp->disable_indirect_desc)
2026 s = format (s, "disable_indirect_desc ");
2028 s = format (s, "tag %s", mp->tag);
2033 static void *vl_api_modify_vhost_user_if_t_print
2034 (vl_api_modify_vhost_user_if_t * mp, void *handle)
2038 s = format (0, "SCRIPT: modify_vhost_user_if ");
2040 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2041 s = format (s, "socket %s ", mp->sock_filename);
2043 s = format (s, "server ");
2045 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
2050 static void *vl_api_delete_vhost_user_if_t_print
2051 (vl_api_delete_vhost_user_if_t * mp, void *handle)
2055 s = format (0, "SCRIPT: delete_vhost_user_if ");
2056 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2061 static void *vl_api_sw_interface_vhost_user_dump_t_print
2062 (vl_api_sw_interface_vhost_user_dump_t * mp, void *handle)
2066 s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
2071 static void *vl_api_sw_interface_dump_t_print
2072 (vl_api_sw_interface_dump_t * mp, void *handle)
2076 s = format (0, "SCRIPT: sw_interface_dump ");
2078 if (mp->name_filter_valid)
2079 s = format (s, "name_filter %s ", mp->name_filter);
2081 s = format (s, "all ");
2086 static void *vl_api_l2_fib_table_dump_t_print
2087 (vl_api_l2_fib_table_dump_t * mp, void *handle)
2091 s = format (0, "SCRIPT: l2_fib_table_dump ");
2093 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
2098 static void *vl_api_control_ping_t_print
2099 (vl_api_control_ping_t * mp, void *handle)
2103 s = format (0, "SCRIPT: control_ping ");
2108 static void *vl_api_want_interface_events_t_print
2109 (vl_api_want_interface_events_t * mp, void *handle)
2113 s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
2114 ntohl (mp->pid), ntohl (mp->enable_disable));
2120 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
2124 s = format (0, "SCRIPT: cli ");
2129 static void *vl_api_cli_inband_t_print
2130 (vl_api_cli_inband_t * mp, void *handle)
2134 u32 length = vl_api_string_len (&mp->cmd);
2136 vec_validate (cmd, length);
2137 clib_memcpy (cmd, vl_api_from_api_string (&mp->cmd), length);
2139 s = format (0, "SCRIPT: exec %v ", cmd);
2145 static void *vl_api_memclnt_create_t_print
2146 (vl_api_memclnt_create_t * mp, void *handle)
2150 s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
2155 static void *vl_api_sockclnt_create_t_print
2156 (vl_api_sockclnt_create_t * mp, void *handle)
2160 s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name);
2165 static void *vl_api_show_version_t_print
2166 (vl_api_show_version_t * mp, void *handle)
2170 s = format (0, "SCRIPT: show_version ");
2175 static void *vl_api_show_threads_t_print
2176 (vl_api_show_threads_t * mp, void *handle)
2180 s = format (0, "SCRIPT: show_threads ");
2185 static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
2186 (vl_api_vxlan_gpe_add_del_tunnel_t * mp, void *handle)
2190 s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
2192 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local);
2193 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote);
2195 u8 is_grp = ip46_address_is_multicast (&remote);
2196 char *remote_name = is_grp ? "group" : "remote";
2198 s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
2199 s = format (s, "%s %U ", remote_name, format_ip46_address,
2200 &remote, IP46_TYPE_ANY);
2203 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
2204 s = format (s, "protocol %d ", ntohl (mp->protocol));
2206 s = format (s, "vni %d ", ntohl (mp->vni));
2208 if (mp->is_add == 0)
2209 s = format (s, "del ");
2211 if (mp->encap_vrf_id)
2212 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
2214 if (mp->decap_vrf_id)
2215 s = format (s, "decap-vrf-id %d ", ntohl (mp->decap_vrf_id));
2220 static void *vl_api_vxlan_gpe_tunnel_dump_t_print
2221 (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
2225 s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
2227 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2232 static void *vl_api_interface_name_renumber_t_print
2233 (vl_api_interface_name_renumber_t * mp, void *handle)
2237 s = format (0, "SCRIPT: interface_renumber ");
2239 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2241 s = format (s, "new_show_dev_instance %d ",
2242 ntohl (mp->new_show_dev_instance));
2247 static void *vl_api_ip_probe_neighbor_t_print
2248 (vl_api_ip_probe_neighbor_t * mp, void *handle)
2252 s = format (0, "SCRIPT: ip_probe_neighbor ");
2253 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2254 s = format (s, "address %U ", format_vl_api_address, &mp->dst);
2259 static void *vl_api_ip_scan_neighbor_enable_disable_t_print
2260 (vl_api_ip_scan_neighbor_enable_disable_t * mp, void *handle)
2264 s = format (0, "SCRIPT: ip_scan_neighbor_enable_disable ");
2268 case IP_SCAN_V4_NEIGHBORS:
2269 s = format (s, "ip4 ");
2271 case IP_SCAN_V6_NEIGHBORS:
2272 s = format (s, "ip6 ");
2274 case IP_SCAN_V46_NEIGHBORS:
2275 s = format (s, "both ");
2278 s = format (s, "disable ");
2281 s = format (s, "interval %d ", mp->scan_interval);
2282 s = format (s, "max-time %d ", mp->max_proc_time);
2283 s = format (s, "max-update %d ", mp->max_update);
2284 s = format (s, "delay %d ", mp->scan_int_delay);
2285 s = format (s, "stale %d ", mp->stale_threshold);
2290 static void *vl_api_want_ip4_arp_events_t_print
2291 (vl_api_want_ip4_arp_events_t * mp, void *handle)
2295 s = format (0, "SCRIPT: want_ip4_arp_events ");
2296 s = format (s, "pid %d address %U ", ntohl (mp->pid),
2297 format_ip4_address, mp->ip);
2298 if (mp->enable_disable == 0)
2299 s = format (s, "del ");
2304 static void *vl_api_want_ip6_nd_events_t_print
2305 (vl_api_want_ip6_nd_events_t * mp, void *handle)
2309 s = format (0, "SCRIPT: want_ip6_nd_events ");
2310 s = format (s, "pid %d address %U ", ntohl (mp->pid),
2311 format_vl_api_ip6_address, mp->ip);
2312 if (mp->enable_disable == 0)
2313 s = format (s, "del ");
2318 static void *vl_api_want_l2_macs_events_t_print
2319 (vl_api_want_l2_macs_events_t * mp, void *handle)
2323 s = format (0, "SCRIPT: want_l2_macs_events ");
2324 s = format (s, "learn-limit %d ", ntohl (mp->learn_limit));
2325 s = format (s, "scan-delay %d ", (u32) mp->scan_delay);
2326 s = format (s, "max-entries %d ", (u32) mp->max_macs_in_event * 10);
2327 if (mp->enable_disable == 0)
2328 s = format (s, "disable");
2333 static void *vl_api_input_acl_set_interface_t_print
2334 (vl_api_input_acl_set_interface_t * mp, void *handle)
2338 s = format (0, "SCRIPT: input_acl_set_interface ");
2340 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2341 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2342 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2343 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2345 if (mp->is_add == 0)
2346 s = format (s, "del ");
2351 static void *vl_api_output_acl_set_interface_t_print
2352 (vl_api_output_acl_set_interface_t * mp, void *handle)
2356 s = format (0, "SCRIPT: output_acl_set_interface ");
2358 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2359 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2360 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2361 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2363 if (mp->is_add == 0)
2364 s = format (s, "del ");
2369 static void *vl_api_ip_address_dump_t_print
2370 (vl_api_ip_address_dump_t * mp, void *handle)
2374 s = format (0, "SCRIPT: ip6_address_dump ");
2375 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2376 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2382 vl_api_ip_dump_t_print (vl_api_ip_dump_t * mp, void *handle)
2386 s = format (0, "SCRIPT: ip_dump ");
2387 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2392 static void *vl_api_cop_interface_enable_disable_t_print
2393 (vl_api_cop_interface_enable_disable_t * mp, void *handle)
2397 s = format (0, "SCRIPT: cop_interface_enable_disable ");
2398 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2399 if (mp->enable_disable)
2400 s = format (s, "enable ");
2402 s = format (s, "disable ");
2407 static void *vl_api_cop_whitelist_enable_disable_t_print
2408 (vl_api_cop_whitelist_enable_disable_t * mp, void *handle)
2412 s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
2413 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2414 s = format (s, "fib-id %d ", ntohl (mp->fib_id));
2416 s = format (s, "ip4 ");
2418 s = format (s, "ip6 ");
2419 if (mp->default_cop)
2420 s = format (s, "default ");
2425 static void *vl_api_af_packet_create_t_print
2426 (vl_api_af_packet_create_t * mp, void *handle)
2430 s = format (0, "SCRIPT: af_packet_create ");
2431 s = format (s, "host_if_name %s ", mp->host_if_name);
2432 if (mp->use_random_hw_addr)
2433 s = format (s, "hw_addr random ");
2435 s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
2440 static void *vl_api_af_packet_delete_t_print
2441 (vl_api_af_packet_delete_t * mp, void *handle)
2445 s = format (0, "SCRIPT: af_packet_delete ");
2446 s = format (s, "host_if_name %s ", mp->host_if_name);
2451 static void *vl_api_af_packet_dump_t_print
2452 (vl_api_af_packet_dump_t * mp, void *handle)
2456 s = format (0, "SCRIPT: af_packet_dump ");
2462 format_policer_action (u8 * s, va_list * va)
2464 u32 action = va_arg (*va, u32);
2465 u32 dscp = va_arg (*va, u32);
2468 if (action == SSE2_QOS_ACTION_DROP)
2469 s = format (s, "drop");
2470 else if (action == SSE2_QOS_ACTION_TRANSMIT)
2471 s = format (s, "transmit");
2472 else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
2474 s = format (s, "mark-and-transmit ");
2477 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
2483 s = format (s, "%s", t);
2488 static void *vl_api_policer_add_del_t_print
2489 (vl_api_policer_add_del_t * mp, void *handle)
2493 s = format (0, "SCRIPT: policer_add_del ");
2494 s = format (s, "name %s ", mp->name);
2495 s = format (s, "cir %d ", mp->cir);
2496 s = format (s, "eir %d ", mp->eir);
2497 s = format (s, "cb %d ", mp->cb);
2498 s = format (s, "eb %d ", mp->eb);
2500 switch (mp->rate_type)
2502 case SSE2_QOS_RATE_KBPS:
2503 s = format (s, "rate_type kbps ");
2505 case SSE2_QOS_RATE_PPS:
2506 s = format (s, "rate_type pps ");
2512 switch (mp->round_type)
2514 case SSE2_QOS_ROUND_TO_CLOSEST:
2515 s = format (s, "round_type closest ");
2517 case SSE2_QOS_ROUND_TO_UP:
2518 s = format (s, "round_type up ");
2520 case SSE2_QOS_ROUND_TO_DOWN:
2521 s = format (s, "round_type down ");
2529 case SSE2_QOS_POLICER_TYPE_1R2C:
2530 s = format (s, "type 1r2c ");
2532 case SSE2_QOS_POLICER_TYPE_1R3C_RFC_2697:
2533 s = format (s, "type 1r3c ");
2535 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_2698:
2536 s = format (s, "type 2r3c-2698 ");
2538 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_4115:
2539 s = format (s, "type 2r3c-4115 ");
2541 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1:
2542 s = format (s, "type 2r3c-mef5cf1 ");
2548 s = format (s, "conform_action %U ", format_policer_action,
2549 mp->conform_action_type, mp->conform_dscp);
2550 s = format (s, "exceed_action %U ", format_policer_action,
2551 mp->exceed_action_type, mp->exceed_dscp);
2552 s = format (s, "violate_action %U ", format_policer_action,
2553 mp->violate_action_type, mp->violate_dscp);
2555 if (mp->color_aware)
2556 s = format (s, "color-aware ");
2557 if (mp->is_add == 0)
2558 s = format (s, "del ");
2563 static void *vl_api_policer_dump_t_print
2564 (vl_api_policer_dump_t * mp, void *handle)
2568 s = format (0, "SCRIPT: policer_dump ");
2569 if (mp->match_name_valid)
2570 s = format (s, "name %s ", mp->match_name);
2575 static void *vl_api_policer_classify_set_interface_t_print
2576 (vl_api_policer_classify_set_interface_t * mp, void *handle)
2580 s = format (0, "SCRIPT: policer_classify_set_interface ");
2581 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2582 if (mp->ip4_table_index != ~0)
2583 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2584 if (mp->ip6_table_index != ~0)
2585 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2586 if (mp->l2_table_index != ~0)
2587 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2588 if (mp->is_add == 0)
2589 s = format (s, "del ");
2594 static void *vl_api_policer_classify_dump_t_print
2595 (vl_api_policer_classify_dump_t * mp, void *handle)
2599 s = format (0, "SCRIPT: policer_classify_dump ");
2602 case POLICER_CLASSIFY_TABLE_IP4:
2603 s = format (s, "type ip4 ");
2605 case POLICER_CLASSIFY_TABLE_IP6:
2606 s = format (s, "type ip6 ");
2608 case POLICER_CLASSIFY_TABLE_L2:
2609 s = format (s, "type l2 ");
2618 static void *vl_api_sw_interface_clear_stats_t_print
2619 (vl_api_sw_interface_clear_stats_t * mp, void *handle)
2623 s = format (0, "SCRIPT: sw_interface_clear_stats ");
2624 if (mp->sw_if_index != ~0)
2625 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2630 static void *vl_api_mpls_tunnel_dump_t_print
2631 (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2635 s = format (0, "SCRIPT: mpls_tunnel_dump ");
2637 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2642 static void *vl_api_mpls_fib_dump_t_print
2643 (vl_api_mpls_fib_dump_t * mp, void *handle)
2647 s = format (0, "SCRIPT: mpls_fib_decap_dump ");
2652 static void *vl_api_ip_fib_dump_t_print
2653 (vl_api_ip_fib_dump_t * mp, void *handle)
2657 s = format (0, "SCRIPT: ip_fib_dump ");
2662 static void *vl_api_ip6_fib_dump_t_print
2663 (vl_api_ip6_fib_dump_t * mp, void *handle)
2667 s = format (0, "SCRIPT: ip6_fib_dump ");
2672 static void *vl_api_classify_table_ids_t_print
2673 (vl_api_classify_table_ids_t * mp, void *handle)
2677 s = format (0, "SCRIPT: classify_table_ids ");
2682 static void *vl_api_classify_table_by_interface_t_print
2683 (vl_api_classify_table_by_interface_t * mp, void *handle)
2687 s = format (0, "SCRIPT: classify_table_by_interface ");
2688 if (mp->sw_if_index != ~0)
2689 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2694 static void *vl_api_classify_table_info_t_print
2695 (vl_api_classify_table_info_t * mp, void *handle)
2699 s = format (0, "SCRIPT: classify_table_info ");
2700 if (mp->table_id != ~0)
2701 s = format (s, "table_id %d ", ntohl (mp->table_id));
2706 static void *vl_api_classify_session_dump_t_print
2707 (vl_api_classify_session_dump_t * mp, void *handle)
2711 s = format (0, "SCRIPT: classify_session_dump ");
2712 if (mp->table_id != ~0)
2713 s = format (s, "table_id %d ", ntohl (mp->table_id));
2718 static void *vl_api_set_ipfix_exporter_t_print
2719 (vl_api_set_ipfix_exporter_t * mp, void *handle)
2723 s = format (0, "SCRIPT: set_ipfix_exporter ");
2725 s = format (s, "collector-address %U ", format_ip4_address,
2726 (ip4_address_t *) mp->collector_address);
2727 s = format (s, "collector-port %d ", ntohs (mp->collector_port));
2728 s = format (s, "src-address %U ", format_ip4_address,
2729 (ip4_address_t *) mp->src_address);
2730 s = format (s, "vrf-id %d ", ntohl (mp->vrf_id));
2731 s = format (s, "path-mtu %d ", ntohl (mp->path_mtu));
2732 s = format (s, "template-interval %d ", ntohl (mp->template_interval));
2733 s = format (s, "udp-checksum %d ", mp->udp_checksum);
2738 static void *vl_api_ipfix_exporter_dump_t_print
2739 (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2743 s = format (0, "SCRIPT: ipfix_exporter_dump ");
2748 static void *vl_api_set_ipfix_classify_stream_t_print
2749 (vl_api_set_ipfix_classify_stream_t * mp, void *handle)
2753 s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2755 s = format (s, "domain-id %d ", ntohl (mp->domain_id));
2756 s = format (s, "src-port %d ", ntohs (mp->src_port));
2761 static void *vl_api_ipfix_classify_stream_dump_t_print
2762 (vl_api_ipfix_classify_stream_dump_t * mp, void *handle)
2766 s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2771 static void *vl_api_ipfix_classify_table_add_del_t_print
2772 (vl_api_ipfix_classify_table_add_del_t * mp, void *handle)
2776 s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2778 s = format (s, "table-id %d ", ntohl (mp->table_id));
2779 s = format (s, "ip-version %d ", mp->ip_version);
2780 s = format (s, "transport-protocol %d ", mp->transport_protocol);
2785 static void *vl_api_ipfix_classify_table_dump_t_print
2786 (vl_api_ipfix_classify_table_dump_t * mp, void *handle)
2790 s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2795 static void *vl_api_sw_interface_span_enable_disable_t_print
2796 (vl_api_sw_interface_span_enable_disable_t * mp, void *handle)
2800 s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2801 s = format (s, "src_sw_if_index %u ", ntohl (mp->sw_if_index_from));
2802 s = format (s, "dst_sw_if_index %u ", ntohl (mp->sw_if_index_to));
2805 s = format (s, "l2 ");
2810 s = format (s, "disable ");
2813 s = format (s, "rx ");
2816 s = format (s, "tx ");
2820 s = format (s, "both ");
2828 vl_api_sw_interface_span_dump_t_print (vl_api_sw_interface_span_dump_t * mp,
2833 s = format (0, "SCRIPT: sw_interface_span_dump ");
2836 s = format (s, "l2 ");
2841 static void *vl_api_get_next_index_t_print
2842 (vl_api_get_next_index_t * mp, void *handle)
2846 s = format (0, "SCRIPT: get_next_index ");
2847 s = format (s, "node-name %s ", mp->node_name);
2848 s = format (s, "next-node-name %s ", mp->next_name);
2853 static void *vl_api_pg_create_interface_t_print
2854 (vl_api_pg_create_interface_t * mp, void *handle)
2858 s = format (0, "SCRIPT: pg_create_interface ");
2859 s = format (0, "if_id %d", ntohl (mp->interface_id));
2864 static void *vl_api_pg_capture_t_print
2865 (vl_api_pg_capture_t * mp, void *handle)
2869 s = format (0, "SCRIPT: pg_capture ");
2870 s = format (0, "if_id %d ", ntohl (mp->interface_id));
2871 s = format (0, "pcap %s", mp->pcap_file_name);
2872 if (mp->count != ~0)
2873 s = format (s, "count %d ", ntohl (mp->count));
2874 if (!mp->is_enabled)
2875 s = format (s, "disable");
2880 static void *vl_api_pg_enable_disable_t_print
2881 (vl_api_pg_enable_disable_t * mp, void *handle)
2885 s = format (0, "SCRIPT: pg_enable_disable ");
2886 if (ntohl (mp->stream_name_length) > 0)
2887 s = format (s, "stream %s", mp->stream_name);
2888 if (!mp->is_enabled)
2889 s = format (s, "disable");
2894 static void *vl_api_ip_source_and_port_range_check_add_del_t_print
2895 (vl_api_ip_source_and_port_range_check_add_del_t * mp, void *handle)
2900 s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2901 s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
2903 for (i = 0; i < mp->number_of_ranges; i++)
2905 s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2908 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
2910 if (mp->is_add == 0)
2911 s = format (s, "del ");
2916 static void *vl_api_ip_source_and_port_range_check_interface_add_del_t_print
2917 (vl_api_ip_source_and_port_range_check_interface_add_del_t * mp,
2922 s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2924 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2926 if (mp->tcp_out_vrf_id != ~0)
2927 s = format (s, "tcp-out-vrf %d ", ntohl (mp->tcp_out_vrf_id));
2929 if (mp->udp_out_vrf_id != ~0)
2930 s = format (s, "udp-out-vrf %d ", ntohl (mp->udp_out_vrf_id));
2932 if (mp->tcp_in_vrf_id != ~0)
2933 s = format (s, "tcp-in-vrf %d ", ntohl (mp->tcp_in_vrf_id));
2935 if (mp->udp_in_vrf_id != ~0)
2936 s = format (s, "udp-in-vrf %d ", ntohl (mp->udp_in_vrf_id));
2938 if (mp->is_add == 0)
2939 s = format (s, "del ");
2944 static void *vl_api_lisp_enable_disable_t_print
2945 (vl_api_lisp_enable_disable_t * mp, void *handle)
2949 s = format (0, "SCRIPT: lisp_enable_disable %s",
2950 mp->is_en ? "enable" : "disable");
2955 static void *vl_api_gpe_add_del_iface_t_print
2956 (vl_api_gpe_add_del_iface_t * mp, void *handle)
2960 s = format (0, "SCRIPT: gpe_add_del_iface ");
2962 s = format (s, "%s ", mp->is_add ? "up" : "down");
2963 s = format (s, "vni %d ", mp->vni);
2964 s = format (s, "%s %d ", mp->is_l2 ? "bd_id" : "table_id", mp->dp_table);
2969 static void *vl_api_lisp_pitr_set_locator_set_t_print
2970 (vl_api_lisp_pitr_set_locator_set_t * mp, void *handle)
2974 s = format (0, "SCRIPT: lisp_pitr_set_locator_set ");
2977 s = format (s, "locator-set %s ", mp->ls_name);
2979 s = format (s, "del");
2985 format_lisp_flat_eid (u8 * s, va_list * args)
2987 u32 type = va_arg (*args, u32);
2988 u8 *eid = va_arg (*args, u8 *);
2989 u32 eid_len = va_arg (*args, u32);
2994 return format (s, "%U/%d", format_ip4_address, eid, eid_len);
2996 return format (s, "%U/%d", format_ip6_address, eid, eid_len);
2998 return format (s, "%U", format_ethernet_address, eid);
3003 static void *vl_api_lisp_add_del_remote_mapping_t_print
3004 (vl_api_lisp_add_del_remote_mapping_t * mp, void *handle)
3009 s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
3012 s = format (s, "del-all ");
3014 s = format (s, "%s ", mp->is_add ? "add" : "del");
3015 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3017 s = format (s, "eid %U ", format_lisp_flat_eid,
3018 mp->eid_type, mp->eid, mp->eid_len);
3022 s = format (s, "seid %U ", format_lisp_flat_eid,
3023 mp->eid_type, mp->seid, mp->seid_len);
3025 rloc_num = clib_net_to_host_u32 (mp->rloc_num);
3028 s = format (s, "action %d", mp->action);
3033 static void *vl_api_lisp_add_del_adjacency_t_print
3034 (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
3038 s = format (0, "SCRIPT: lisp_add_del_adjacency ");
3040 s = format (s, "%s ", mp->is_add ? "add" : "del");
3041 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3042 s = format (s, "reid %U leid %U ",
3043 format_lisp_flat_eid, mp->eid_type, mp->reid, mp->reid_len,
3044 format_lisp_flat_eid, mp->eid_type, mp->leid, mp->leid_len);
3049 static void *vl_api_lisp_add_del_map_request_itr_rlocs_t_print
3050 (vl_api_lisp_add_del_map_request_itr_rlocs_t * mp, void *handle)
3054 s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
3057 s = format (s, "%s", mp->locator_set_name);
3059 s = format (s, "del");
3064 static void *vl_api_lisp_eid_table_add_del_map_t_print
3065 (vl_api_lisp_eid_table_add_del_map_t * mp, void *handle)
3069 s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
3072 s = format (s, "del ");
3074 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3075 s = format (s, "%s %d ",
3076 mp->is_l2 ? "bd_index" : "vrf",
3077 clib_net_to_host_u32 (mp->dp_table));
3081 static void *vl_api_lisp_add_del_local_eid_t_print
3082 (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
3086 s = format (0, "SCRIPT: lisp_add_del_local_eid ");
3089 s = format (s, "del ");
3091 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3092 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
3094 s = format (s, "locator-set %s ", mp->locator_set_name);
3097 u32 key_id = mp->key_id;
3098 s = format (s, "key-id %U", format_hmac_key_id, key_id);
3099 s = format (s, "secret-key %s", mp->key);
3104 static void *vl_api_gpe_add_del_fwd_entry_t_print
3105 (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle)
3109 s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO");
3114 static void *vl_api_lisp_add_del_map_resolver_t_print
3115 (vl_api_lisp_add_del_map_resolver_t * mp, void *handle)
3119 s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
3122 s = format (s, "del ");
3125 s = format (s, "%U ", format_ip6_address, mp->ip_address);
3127 s = format (s, "%U ", format_ip4_address, mp->ip_address);
3132 static void *vl_api_gpe_enable_disable_t_print
3133 (vl_api_gpe_enable_disable_t * mp, void *handle)
3137 s = format (0, "SCRIPT: gpe_enable_disable ");
3139 s = format (s, "%s ", mp->is_en ? "enable" : "disable");
3144 static void *vl_api_lisp_add_del_locator_set_t_print
3145 (vl_api_lisp_add_del_locator_set_t * mp, void *handle)
3149 s = format (0, "SCRIPT: lisp_add_del_locator_set ");
3152 s = format (s, "del ");
3154 s = format (s, "locator-set %s ", mp->locator_set_name);
3159 static void *vl_api_lisp_add_del_locator_t_print
3160 (vl_api_lisp_add_del_locator_t * mp, void *handle)
3164 s = format (0, "SCRIPT: lisp_add_del_locator ");
3167 s = format (s, "del ");
3169 s = format (s, "locator-set %s ", mp->locator_set_name);
3170 s = format (s, "sw_if_index %d ", mp->sw_if_index);
3171 s = format (s, "p %d w %d ", mp->priority, mp->weight);
3176 static void *vl_api_lisp_locator_set_dump_t_print
3177 (vl_api_lisp_locator_set_dump_t * mp, void *handle)
3181 s = format (0, "SCRIPT: lisp_locator_set_dump ");
3182 if (mp->filter == 1)
3183 s = format (s, "local");
3184 else if (mp->filter == 2)
3185 s = format (s, "remote");
3190 static void *vl_api_lisp_locator_dump_t_print
3191 (vl_api_lisp_locator_dump_t * mp, void *handle)
3195 s = format (0, "SCRIPT: lisp_locator_dump ");
3196 if (mp->is_index_set)
3197 s = format (s, "ls_index %d", clib_net_to_host_u32 (mp->ls_index));
3199 s = format (s, "ls_name %s", mp->ls_name);
3204 static void *vl_api_lisp_map_request_mode_t_print
3205 (vl_api_lisp_map_request_mode_t * mp, void *handle)
3209 s = format (0, "SCRIPT: lisp_map_request_mode ");
3214 s = format (s, "dst-only");
3217 s = format (s, "src-dst");
3225 static void *vl_api_lisp_eid_table_dump_t_print
3226 (vl_api_lisp_eid_table_dump_t * mp, void *handle)
3230 s = format (0, "SCRIPT: lisp_eid_table_dump ");
3234 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3235 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type,
3236 mp->eid, mp->prefix_length);
3240 s = format (s, "local ");
3243 s = format (s, "remote ");
3250 static void *vl_api_lisp_rloc_probe_enable_disable_t_print
3251 (vl_api_lisp_rloc_probe_enable_disable_t * mp, void *handle)
3255 s = format (0, "SCRIPT: lisp_rloc_probe_enable_disable ");
3257 s = format (s, "enable");
3259 s = format (s, "disable");
3264 static void *vl_api_lisp_map_register_enable_disable_t_print
3265 (vl_api_lisp_map_register_enable_disable_t * mp, void *handle)
3269 s = format (0, "SCRIPT: lisp_map_register_enable_disable ");
3271 s = format (s, "enable");
3273 s = format (s, "disable");
3278 static void *vl_api_lisp_adjacencies_get_t_print
3279 (vl_api_lisp_adjacencies_get_t * mp, void *handle)
3283 s = format (0, "SCRIPT: lisp_adjacencies_get ");
3284 s = format (s, "vni %d", clib_net_to_host_u32 (mp->vni));
3289 static void *vl_api_lisp_eid_table_map_dump_t_print
3290 (vl_api_lisp_eid_table_map_dump_t * mp, void *handle)
3294 s = format (0, "SCRIPT: lisp_eid_table_map_dump ");
3297 s = format (s, "l2");
3299 s = format (s, "l3");
3304 static void *vl_api_ipsec_tunnel_if_add_del_t_print
3305 (vl_api_ipsec_tunnel_if_add_del_t * mp, void *handle)
3309 s = format (0, "SCRIPT: ipsec_tunnel_if_add_del ");
3312 s = format (s, "esn");
3313 if (mp->anti_replay)
3314 s = format (s, "anti-replay");
3316 s = format (s, "udp-encap");
3318 s = format (s, "local-ip %U ", format_vl_api_address, &mp->remote_ip);
3320 s = format (s, "remote-ip %U ", format_vl_api_address, &mp->local_ip);
3321 s = format (s, "tx-table-id %d ", ntohl (mp->tx_table_id));
3323 s = format (s, "local-spi %d ", ntohl (mp->local_spi));
3325 s = format (s, "remote-spi %d ", ntohl (mp->remote_spi));
3327 s = format (s, "local-crypto-key-len %d ", mp->local_crypto_key_len);
3328 s = format (s, "local-crypto-key %U ", format_hex_bytes,
3329 mp->local_crypto_key, mp->local_crypto_key_len, 0);
3330 s = format (s, "remote-crypto-key-len %d ", mp->remote_crypto_key_len);
3331 s = format (s, "remote-crypto-key %U ", format_hex_bytes,
3332 mp->remote_crypto_key, mp->remote_crypto_key_len, 0);
3333 s = format (s, "local-integ-key-len %d ", mp->local_integ_key_len);
3334 s = format (s, "local-integ-key %U ", format_hex_bytes,
3335 mp->local_integ_key, mp->local_integ_key_len, 0);
3336 s = format (s, "remote-integ-key-len %d ", mp->remote_integ_key_len);
3337 s = format (s, "remote-integ-key %U ", format_hex_bytes,
3338 mp->remote_integ_key, mp->remote_integ_key_len, 0);
3340 if (mp->is_add == 0)
3341 s = format (s, "del ");
3346 static void *vl_api_ipsec_gre_tunnel_add_del_t_print
3347 (vl_api_ipsec_gre_tunnel_add_del_t * mp, void *handle)
3351 s = format (0, "SCRIPT: ipsec_gre_tunnel_add_del ");
3353 s = format (s, "dst %U ", format_vl_api_ip4_address, mp->tunnel.dst);
3355 s = format (s, "src %U ", format_vl_api_ip4_address, mp->tunnel.src);
3357 s = format (s, "local_sa %d ", ntohl (mp->tunnel.local_sa_id));
3359 s = format (s, "remote_sa %d ", ntohl (mp->tunnel.remote_sa_id));
3361 if (mp->is_add == 0)
3362 s = format (s, "del ");
3367 static void *vl_api_ipsec_gre_tunnel_dump_t_print
3368 (vl_api_ipsec_gre_tunnel_dump_t * mp, void *handle)
3372 s = format (0, "SCRIPT: ipsec_gre_tunnel_dump ");
3374 if (mp->sw_if_index != ~0)
3375 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3380 static void *vl_api_l2_interface_pbb_tag_rewrite_t_print
3381 (vl_api_l2_interface_pbb_tag_rewrite_t * mp, void *handle)
3384 u32 vtr_op = ntohl (mp->vtr_op);
3386 s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
3388 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3389 s = format (s, "vtr_op %d ", vtr_op);
3390 if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
3392 if (vtr_op == L2_VTR_TRANSLATE_2_2)
3393 s = format (s, "%d ", ntohs (mp->outer_tag));
3394 s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
3395 s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
3396 s = format (s, "sid %d ", ntohl (mp->i_sid));
3397 s = format (s, "vlanid %d ", ntohs (mp->b_vlanid));
3402 static void *vl_api_flow_classify_set_interface_t_print
3403 (vl_api_flow_classify_set_interface_t * mp, void *handle)
3407 s = format (0, "SCRIPT: flow_classify_set_interface ");
3408 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3409 if (mp->ip4_table_index != ~0)
3410 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
3411 if (mp->ip6_table_index != ~0)
3412 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
3413 if (mp->is_add == 0)
3414 s = format (s, "del ");
3420 vl_api_set_punt_t_print (vl_api_set_punt_t * mp, void *handle)
3424 s = format (0, "SCRIPT: punt ");
3426 if (mp->punt.ipv != (u8) ~ 0)
3427 s = format (s, "ip %d ", mp->punt.ipv);
3429 s = format (s, "protocol %d ", mp->punt.l4_protocol);
3431 if (mp->punt.l4_port != (u16) ~ 0)
3432 s = format (s, "port %d ", ntohs (mp->punt.l4_port));
3435 s = format (s, "del ");
3440 static void *vl_api_flow_classify_dump_t_print
3441 (vl_api_flow_classify_dump_t * mp, void *handle)
3445 s = format (0, "SCRIPT: flow_classify_dump ");
3448 case FLOW_CLASSIFY_TABLE_IP4:
3449 s = format (s, "type ip4 ");
3451 case FLOW_CLASSIFY_TABLE_IP6:
3452 s = format (s, "type ip6 ");
3461 static void *vl_api_get_first_msg_id_t_print
3462 (vl_api_get_first_msg_id_t * mp, void *handle)
3466 s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
3471 static void *vl_api_ioam_enable_t_print
3472 (vl_api_ioam_enable_t * mp, void *handle)
3476 s = format (0, "SCRIPT: ioam_enable ");
3478 if (mp->trace_enable)
3479 s = format (s, "trace enabled");
3482 s = format (s, "POT enabled");
3485 s = format (s, "Seqno enabled");
3488 s = format (s, "Analyse enabled");
3493 static void *vl_api_ioam_disable_t_print
3494 (vl_api_ioam_disable_t * mp, void *handle)
3498 s = format (0, "SCRIPT: ioam_disable ");
3499 s = format (s, "trace disabled");
3500 s = format (s, "POT disabled");
3501 s = format (s, "Seqno disabled");
3502 s = format (s, "Analyse disabled");
3507 static void *vl_api_feature_enable_disable_t_print
3508 (vl_api_feature_enable_disable_t * mp, void *handle)
3512 s = format (0, "SCRIPT: feature_enable_disable ");
3513 s = format (s, "arc_name %s ", mp->arc_name);
3514 s = format (s, "feature_name %s ", mp->feature_name);
3515 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3517 s = format (s, "disable");
3522 static void *vl_api_sw_interface_tag_add_del_t_print
3523 (vl_api_sw_interface_tag_add_del_t * mp, void *handle)
3527 s = format (0, "SCRIPT: sw_interface_tag_add_del ");
3528 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3530 s = format (s, "tag %s ", mp->tag);
3532 s = format (s, "del ");
3537 static void *vl_api_hw_interface_set_mtu_t_print
3538 (vl_api_hw_interface_set_mtu_t * mp, void *handle)
3542 s = format (0, "SCRIPT: sw_interface_set_mtu ");
3543 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3544 s = format (s, "tag %d ", ntohs (mp->mtu));
3549 static void *vl_api_p2p_ethernet_add_t_print
3550 (vl_api_p2p_ethernet_add_t * mp, void *handle)
3554 s = format (0, "SCRIPT: p2p_ethernet_add ");
3555 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3556 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3561 static void *vl_api_p2p_ethernet_del_t_print
3562 (vl_api_p2p_ethernet_del_t * mp, void *handle)
3566 s = format (0, "SCRIPT: p2p_ethernet_del ");
3567 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3568 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3573 static void *vl_api_tcp_configure_src_addresses_t_print
3574 (vl_api_tcp_configure_src_addresses_t * mp, void *handle)
3578 s = format (0, "SCRIPT: tcp_configure_src_addresses ");
3580 s = format (s, "%U - %U ",
3581 format_ip6_address, (ip6_address_t *) mp->first_address,
3582 format_ip6_address, (ip6_address_t *) mp->last_address);
3584 s = format (s, "%U - %U ",
3585 format_ip4_address, (ip4_address_t *) mp->first_address,
3586 format_ip4_address, (ip4_address_t *) mp->last_address);
3589 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
3594 static void *vl_api_app_namespace_add_del_t_print
3595 (vl_api_app_namespace_add_del_t * mp, void *handle)
3598 u8 len = clib_min (mp->namespace_id_len,
3599 ARRAY_LEN (mp->namespace_id) - 1);
3600 mp->namespace_id[len] = 0;
3601 s = format (0, "SCRIPT: app_namespace_add_del ");
3602 s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d "
3603 "ipv6_fib_id %d", (char *) mp->namespace_id, mp->secret,
3604 clib_net_to_host_u32 (mp->sw_if_index),
3605 clib_net_to_host_u32 (mp->ip4_fib_id),
3606 clib_net_to_host_u32 (mp->ip6_fib_id));
3610 static void *vl_api_lldp_config_t_print
3611 (vl_api_lldp_config_t * mp, void *handle)
3615 s = format (0, "SCRIPT: lldp_config ");
3616 s = format (s, "system_name %s ", mp->system_name);
3617 s = format (s, "tx_hold %d ", ntohl (mp->tx_hold));
3618 s = format (s, "tx_interval %d ", ntohl (mp->tx_interval));
3622 static void *vl_api_dns_enable_disable_t_print
3623 (vl_api_dns_enable_disable_t * mp, void *handle)
3627 s = format (0, "SCRIPT: dns_enable_disable ");
3628 s = format (s, "%s ", mp->enable ? "enable" : "disable");
3633 static void *vl_api_sw_interface_set_lldp_t_print
3634 (vl_api_sw_interface_set_lldp_t * mp, void *handle)
3639 clib_memset (null_data, 0, sizeof (null_data));
3641 s = format (0, "SCRIPT: sw_interface_set_lldp ");
3642 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3644 if (memcmp (mp->port_desc, null_data, sizeof (mp->port_desc)))
3645 s = format (s, "port_desc %s ", mp->port_desc);
3647 if (memcmp (mp->mgmt_ip4, null_data, sizeof (mp->mgmt_ip4)))
3648 s = format (s, "mgmt_ip4 %U ", format_ip4_address, mp->mgmt_ip4);
3650 if (memcmp (mp->mgmt_ip6, null_data, sizeof (mp->mgmt_ip6)))
3651 s = format (s, "mgmt_ip6 %U ", format_ip6_address, mp->mgmt_ip6);
3653 if (memcmp (mp->mgmt_oid, null_data, sizeof (mp->mgmt_oid)))
3654 s = format (s, "mgmt_oid %s ", mp->mgmt_oid);
3656 if (mp->enable == 0)
3657 s = format (s, "disable ");
3662 static void *vl_api_dns_name_server_add_del_t_print
3663 (vl_api_dns_name_server_add_del_t * mp, void *handle)
3667 s = format (0, "SCRIPT: dns_name_server_add_del ");
3669 s = format (s, "%U ", format_ip6_address,
3670 (ip6_address_t *) mp->server_address);
3672 s = format (s, "%U ", format_ip4_address,
3673 (ip4_address_t *) mp->server_address);
3675 if (mp->is_add == 0)
3676 s = format (s, "del ");
3681 static void *vl_api_dns_resolve_name_t_print
3682 (vl_api_dns_resolve_name_t * mp, void *handle)
3686 s = format (0, "SCRIPT: dns_resolve_name ");
3687 s = format (s, "%s ", mp->name);
3691 static void *vl_api_dns_resolve_ip_t_print
3692 (vl_api_dns_resolve_ip_t * mp, void *handle)
3696 s = format (0, "SCRIPT: dns_resolve_ip ");
3698 s = format (s, "%U ", format_ip6_address, mp->address);
3700 s = format (s, "%U ", format_ip4_address, mp->address);
3704 static void *vl_api_session_rule_add_del_t_print
3705 (vl_api_session_rule_add_del_t * mp, void *handle)
3708 char *proto = mp->transport_proto == 0 ? "tcp" : "udp";
3709 s = format (0, "SCRIPT: session_rule_add_del ");
3710 mp->tag[sizeof (mp->tag) - 1] = 0;
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_ip4_address,
3714 (ip4_address_t *) mp->lcl_ip, mp->lcl_plen,
3715 format_ip4_address, (ip4_address_t *) mp->rmt_ip,
3716 mp->rmt_plen, mp->action_index, mp->tag);
3718 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3719 mp->appns_index, mp->scope, proto, format_ip6_address,
3720 (ip6_address_t *) mp->lcl_ip, mp->lcl_plen,
3721 format_ip6_address, (ip6_address_t *) mp->rmt_ip,
3722 mp->rmt_plen, mp->action_index, mp->tag);
3726 static void *vl_api_ip_container_proxy_add_del_t_print
3727 (vl_api_ip_container_proxy_add_del_t * mp, void *handle)
3730 s = format (0, "SCRIPT: ip_container_proxy_add_del ");
3731 s = format (s, "is_add %d prefix %U sw_if_index %d",
3732 mp->is_add, format_vl_api_prefix, mp->sw_if_index);
3737 static void *vl_api_qos_record_enable_disable_t_print
3738 (vl_api_qos_record_enable_disable_t * mp, void *handle)
3742 s = format (0, "SCRIPT: qos_record_enable_disable ");
3743 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3744 s = format (s, "input_source %U ", format_qos_source,
3745 ntohl (mp->input_source));
3748 s = format (s, "disable ");
3753 #define foreach_custom_print_no_arg_function \
3754 _(lisp_eid_table_vni_dump) \
3755 _(lisp_map_resolver_dump) \
3756 _(lisp_map_server_dump) \
3757 _(show_lisp_rloc_probe_state) \
3758 _(show_lisp_map_register_state) \
3759 _(show_lisp_map_request_mode)
3762 static void * vl_api_ ## f ## _t_print \
3763 (vl_api_ ## f ## _t * mp, void * handle) \
3766 s = format (0, "SCRIPT: " #f ); \
3769 foreach_custom_print_no_arg_function
3771 #define foreach_custom_print_function \
3772 _(CREATE_LOOPBACK, create_loopback) \
3773 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
3774 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
3775 _(SW_INTERFACE_EVENT, sw_interface_event) \
3776 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
3777 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
3778 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
3779 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
3780 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
3781 _(SW_INTERFACE_SET_GENEVE_BYPASS, sw_interface_set_geneve_bypass) \
3782 _(BOND_CREATE, bond_create) \
3783 _(BOND_DELETE, bond_delete) \
3784 _(BOND_ENSLAVE, bond_enslave) \
3785 _(BOND_DETACH_SLAVE, bond_detach_slave) \
3786 _(TAP_CREATE_V2, tap_create_v2) \
3787 _(TAP_DELETE_V2, tap_delete_v2) \
3788 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) \
3789 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \
3790 _(IP_TABLE_ADD_DEL, ip_table_add_del) \
3791 _(MPLS_ROUTE_ADD_DEL, mpls_route_add_del) \
3792 _(MPLS_TABLE_ADD_DEL, mpls_table_add_del) \
3793 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
3794 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
3795 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3796 _(SR_MPLS_POLICY_ADD, sr_mpls_policy_add) \
3797 _(SR_MPLS_POLICY_DEL, sr_mpls_policy_del) \
3798 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3799 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
3800 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3801 _(CREATE_SUBIF, create_subif) \
3802 _(OAM_ADD_DEL, oam_add_del) \
3803 _(RESET_FIB, reset_fib) \
3804 _(DHCP_PROXY_CONFIG, dhcp_proxy_config) \
3805 _(DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss) \
3806 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3807 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \
3808 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \
3809 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
3810 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3811 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3812 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3813 _(SR_POLICY_ADD, sr_policy_add) \
3814 _(SR_POLICY_MOD, sr_policy_mod) \
3815 _(SR_POLICY_DEL, sr_policy_del) \
3816 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3817 _(L2FIB_ADD_DEL, l2fib_add_del) \
3818 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3819 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3820 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3821 _(L2_FLAGS, l2_flags) \
3822 _(BRIDGE_FLAGS, bridge_flags) \
3823 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3824 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3825 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3826 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3827 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3828 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3829 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3830 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3831 _(ADD_NODE_NEXT, add_node_next) \
3832 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \
3833 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \
3834 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \
3835 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \
3836 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
3837 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
3838 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3839 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3840 _(VXLAN_OFFLOAD_RX, vxlan_offload_rx) \
3841 _(GENEVE_ADD_DEL_TUNNEL, geneve_add_del_tunnel) \
3842 _(GENEVE_TUNNEL_DUMP, geneve_tunnel_dump) \
3843 _(GRE_TUNNEL_ADD_DEL, gre_tunnel_add_del) \
3844 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3845 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3846 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3847 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3848 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3849 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3850 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3851 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3852 _(CONTROL_PING, control_ping) \
3853 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3855 _(CLI_INBAND, cli_inband) \
3856 _(MEMCLNT_CREATE, memclnt_create) \
3857 _(SOCKCLNT_CREATE, sockclnt_create) \
3858 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3859 _(SHOW_VERSION, show_version) \
3860 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3861 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3862 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3863 _(VXLAN_GBP_TUNNEL_ADD_DEL, vxlan_gbp_tunnel_add_del) \
3864 _(VXLAN_GBP_TUNNEL_DUMP, vxlan_gbp_tunnel_dump) \
3865 _(SW_INTERFACE_SET_VXLAN_GBP_BYPASS, sw_interface_set_vxlan_gbp_bypass) \
3866 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3867 _(IP_PROBE_NEIGHBOR, ip_probe_neighbor) \
3868 _(IP_SCAN_NEIGHBOR_ENABLE_DISABLE, ip_scan_neighbor_enable_disable) \
3869 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
3870 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \
3871 _(WANT_L2_MACS_EVENTS, want_l2_macs_events) \
3872 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3873 _(IP_ADDRESS_DUMP, ip_address_dump) \
3874 _(IP_DUMP, ip_dump) \
3875 _(DELETE_LOOPBACK, delete_loopback) \
3876 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3877 _(BD_IP_MAC_FLUSH, bd_ip_mac_flush) \
3878 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3879 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3880 _(AF_PACKET_CREATE, af_packet_create) \
3881 _(AF_PACKET_DELETE, af_packet_delete) \
3882 _(AF_PACKET_DUMP, af_packet_dump) \
3883 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3884 _(MPLS_FIB_DUMP, mpls_fib_dump) \
3885 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3886 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3887 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3888 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3889 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3890 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3891 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3892 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3893 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3894 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3895 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3896 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3897 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3898 _(GET_NEXT_INDEX, get_next_index) \
3899 _(PG_CREATE_INTERFACE,pg_create_interface) \
3900 _(PG_CAPTURE, pg_capture) \
3901 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3902 _(POLICER_ADD_DEL, policer_add_del) \
3903 _(POLICER_DUMP, policer_dump) \
3904 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3905 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3906 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3907 ip_source_and_port_range_check_add_del) \
3908 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3909 ip_source_and_port_range_check_interface_add_del) \
3910 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
3911 _(GPE_ENABLE_DISABLE, gpe_enable_disable) \
3912 _(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \
3913 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
3914 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \
3915 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \
3916 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
3917 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
3918 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
3919 lisp_add_del_map_request_itr_rlocs) \
3920 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
3921 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
3922 _(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \
3923 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
3924 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
3925 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
3926 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
3927 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
3928 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \
3929 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
3930 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \
3931 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
3932 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \
3933 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \
3934 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \
3935 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \
3936 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \
3937 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \
3938 _(IPSEC_TUNNEL_IF_ADD_DEL, ipsec_tunnel_if_add_del) \
3939 _(IPSEC_GRE_TUNNEL_ADD_DEL, ipsec_gre_tunnel_add_del) \
3940 _(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \
3941 _(DELETE_SUBIF, delete_subif) \
3942 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3943 _(SET_PUNT, set_punt) \
3944 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3945 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3946 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3947 _(IOAM_ENABLE, ioam_enable) \
3948 _(IOAM_DISABLE, ioam_disable) \
3949 _(IP_FIB_DUMP, ip_fib_dump) \
3950 _(IP6_FIB_DUMP, ip6_fib_dump) \
3951 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3952 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3953 _(HW_INTERFACE_SET_MTU, hw_interface_set_mtu) \
3954 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3955 _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
3956 _(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
3957 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
3958 _(LLDP_CONFIG, lldp_config) \
3959 _(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \
3960 _(DNS_ENABLE_DISABLE, dns_enable_disable) \
3961 _(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \
3962 _(DNS_RESOLVE_NAME, dns_resolve_name) \
3963 _(DNS_RESOLVE_IP, dns_resolve_ip) \
3964 _(SESSION_RULE_ADD_DEL, session_rule_add_del) \
3965 _(OUTPUT_ACL_SET_INTERFACE, output_acl_set_interface) \
3966 _(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable)
3968 vl_msg_api_custom_dump_configure (api_main_t * am)
3970 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3971 = (void *) vl_api_##f##_t_print;
3972 foreach_custom_print_function;
3977 * fd.io coding-style-patch-verification: ON
3979 * Local Variables: eval: (c-set-style "gnu") End: