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-neighbor/ip_neighbor.h>
23 #include <vnet/ip/ip_types_api.h>
24 #include <vnet/fib/fib_api.h>
25 #include <vnet/unix/tuntap.h>
26 #include <vnet/mpls/mpls.h>
27 #include <vnet/l2/l2_input.h>
28 #include <vnet/srv6/sr.h>
29 #include <vnet/srmpls/sr_mpls.h>
30 #include <vnet/gre/gre.h>
31 #include <vnet/vxlan-gpe/vxlan_gpe.h>
32 #include <vnet/classify/policer_classify.h>
33 #include <vnet/policer/xlate.h>
34 #include <vnet/policer/policer.h>
35 #include <vnet/classify/flow_classify.h>
36 #include <vlib/vlib.h>
37 #include <vlib/pci/pci.h>
38 #include <vlib/unix/unix.h>
39 #include <vlibapi/api.h>
40 #include <vlibmemory/api.h>
41 #include <vnet/qos/qos_types.h>
43 #include <vnet/ethernet/ethernet.h>
44 #include <vnet/ethernet/ethernet_types_api.h>
45 #include <vnet/l2/l2_vtr.h>
47 #include <vpp/api/vpe_msg_enum.h>
48 #include <vpp/api/types.h>
50 #include <vnet/bonding/node.h>
52 #include <vnet/format_fns.h>
54 #define vl_typedefs /* define message structures */
55 #include <vpp/api/vpe_all_api_h.h>
58 #define vl_endianfun /* define message structures */
59 #include <vpp/api/vpe_all_api_h.h>
62 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
66 vl_print (handle, (char *)s); \
71 static void *vl_api_create_loopback_t_print
72 (vl_api_create_loopback_t * mp, void *handle)
76 s = format (0, "SCRIPT: create_loopback ");
77 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
82 static void *vl_api_create_loopback_instance_t_print
83 (vl_api_create_loopback_instance_t * mp, void *handle)
87 s = format (0, "SCRIPT: create_loopback ");
88 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
89 s = format (s, "instance %d ", mp->user_instance);
94 static void *vl_api_delete_loopback_t_print
95 (vl_api_delete_loopback_t * mp, void *handle)
99 s = format (0, "SCRIPT: delete_loopback ");
100 s = format (s, "sw_if_index %d ", mp->sw_if_index);
105 static void *vl_api_sw_interface_set_flags_t_print
106 (vl_api_sw_interface_set_flags_t * mp, void *handle)
109 s = format (0, "SCRIPT: sw_interface_set_flags ");
111 s = format (s, "sw_if_index %d ", mp->sw_if_index);
113 if ((mp->flags) & IF_STATUS_API_FLAG_ADMIN_UP)
114 s = format (s, "admin-up ");
116 s = format (s, "admin-down ");
122 static void *vl_api_sw_interface_set_rx_placement_t_print
123 (vl_api_sw_interface_set_rx_placement_t * mp, void *handle)
126 s = format (0, "SCRIPT: sw_interface_set_rx_placement ");
128 s = format (s, "sw_if_index %d ", mp->sw_if_index);
130 s = format (s, "queue %d ", mp->queue_id);
132 s = format (s, "main ");
134 s = format (s, "worker %d ", mp->worker_id);
139 static void *vl_api_sw_interface_rx_placement_dump_t_print
140 (vl_api_sw_interface_rx_placement_dump_t * mp, void *handle)
143 u32 sw_if_index = (mp->sw_if_index);
145 s = format (0, "SCRIPT: sw_interface_rx_placement_dump ");
147 if (sw_if_index != ~0)
148 s = format (s, "sw_if_index %d ", sw_if_index);
153 static void *vl_api_sw_interface_event_t_print
154 (vl_api_sw_interface_event_t * mp, void *handle)
157 s = format (0, "SCRIPT: sw_interface_event ");
159 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
161 if ((mp->flags) & IF_STATUS_API_FLAG_ADMIN_UP)
162 s = format (s, "admin-up ");
164 s = format (s, "admin-down ");
166 if ((mp->flags) & IF_STATUS_API_FLAG_LINK_UP)
167 s = format (s, "link-up");
169 s = format (s, "link-down");
172 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 ");
184 s = format (s, "sw_if_index %d ", mp->sw_if_index);
185 s = format (s, "%U ", format_vl_api_prefix_t, &mp->prefix);
187 s = format (s, "del ");
189 s = format (s, "del-all ");
194 static void *vl_api_sw_interface_set_table_t_print
195 (vl_api_sw_interface_set_table_t * mp, void *handle)
199 s = format (0, "SCRIPT: sw_interface_set_table ");
201 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
204 s = format (s, "vrf %d ", (mp->vrf_id));
207 s = format (s, "ipv6 ");
212 static void *vl_api_sw_interface_set_mpls_enable_t_print
213 (vl_api_sw_interface_set_mpls_enable_t * mp, void *handle)
217 s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
219 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
222 s = format (s, "disable");
227 static void *vl_api_sw_interface_set_vpath_t_print
228 (vl_api_sw_interface_set_vpath_t * mp, void *handle)
232 s = format (0, "SCRIPT: sw_interface_set_vpath ");
234 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
237 s = format (s, "enable ");
239 s = format (s, "disable ");
244 static void *vl_api_sw_interface_set_vxlan_bypass_t_print
245 (vl_api_sw_interface_set_vxlan_bypass_t * mp, void *handle)
249 s = format (0, "SCRIPT: sw_interface_set_vxlan_bypass ");
251 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
254 s = format (s, "ip6 ");
257 s = format (s, "enable ");
259 s = format (s, "disable ");
264 static void *vl_api_sw_interface_set_l2_xconnect_t_print
265 (vl_api_sw_interface_set_l2_xconnect_t * mp, void *handle)
269 s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
271 s = format (s, "sw_if_index %d ", (mp->rx_sw_if_index));
275 s = format (s, "tx_sw_if_index %d ", (mp->tx_sw_if_index));
278 s = format (s, "delete ");
283 static void *vl_api_sw_interface_set_l2_bridge_t_print
284 (vl_api_sw_interface_set_l2_bridge_t * mp, void *handle)
288 s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
290 s = format (s, "sw_if_index %d ", (mp->rx_sw_if_index));
294 s = format (s, "bd_id %d shg %d ", (mp->bd_id), mp->shg);
295 if (L2_API_PORT_TYPE_BVI == (mp->port_type))
296 s = format (s, "bvi ");
297 if (L2_API_PORT_TYPE_UU_FWD == (mp->port_type))
298 s = format (s, "uu-fwd ");
299 s = format (s, "enable");
302 s = format (s, "disable ");
307 static void *vl_api_bridge_domain_add_del_t_print
308 (vl_api_bridge_domain_add_del_t * mp, void *handle)
312 s = format (0, "SCRIPT: bridge_domain_add_del ");
314 s = format (s, "bd_id %d ", (mp->bd_id));
319 s = format (s, "bd_tag %s ", mp->bd_tag);
320 s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood);
321 s = format (s, "forward %d learn %d ", mp->forward, mp->learn);
322 s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age);
325 s = format (s, "del ");
330 static void *vl_api_bridge_domain_set_mac_age_t_print
331 (vl_api_bridge_domain_set_mac_age_t * mp, void *handle)
335 s = format (0, "SCRIPT: bridge_domain_set_mac_age ");
337 s = format (s, "bd_id %d ", (mp->bd_id));
339 s = format (s, "mac-age %d", mp->mac_age);
344 static void *vl_api_bridge_domain_dump_t_print
345 (vl_api_bridge_domain_dump_t * mp, void *handle)
348 u32 bd_id = (mp->bd_id);
350 s = format (0, "SCRIPT: bridge_domain_dump ");
353 s = format (s, "bd_id %d ", bd_id);
358 static void *vl_api_l2fib_flush_all_t_print
359 (vl_api_l2fib_flush_all_t * mp, void *handle)
363 s = format (0, "SCRIPT: l2fib_flush_all ");
369 static void *vl_api_l2fib_flush_bd_t_print
370 (vl_api_l2fib_flush_bd_t * mp, void *handle)
373 u32 bd_id = (mp->bd_id);
375 s = format (0, "SCRIPT: l2fib_flush_bd ");
376 s = format (s, "bd_id %d ", bd_id);
381 static void *vl_api_l2fib_flush_int_t_print
382 (vl_api_l2fib_flush_int_t * mp, void *handle)
385 u32 sw_if_index = (mp->sw_if_index);
387 s = format (0, "SCRIPT: l2fib_flush_int ");
388 s = format (s, "sw_if_index %d ", sw_if_index);
393 static void *vl_api_l2fib_add_del_t_print
394 (vl_api_l2fib_add_del_t * mp, void *handle)
398 s = format (0, "SCRIPT: l2fib_add_del ");
400 s = format (s, "mac %U ", format_ethernet_address, mp->mac);
402 s = format (s, "bd_id %d ", (mp->bd_id));
407 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
409 s = format (s, "%s", "static ");
411 s = format (s, "%s", "filter ");
413 s = format (s, "%s", "bvi ");
417 s = format (s, "del ");
424 vl_api_l2_flags_t_print (vl_api_l2_flags_t * mp, void *handle)
427 u32 flags = (mp->feature_bitmap);
429 s = format (0, "SCRIPT: l2_flags ");
431 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
433 if (flags & L2_LEARN)
434 s = format (s, "learn ");
436 s = format (s, "forward ");
437 if (flags & L2_FLOOD)
438 s = format (s, "flood ");
439 if (flags & L2_UU_FLOOD)
440 s = format (s, "uu-flood ");
441 if (flags & L2_ARP_TERM)
442 s = format (s, "arp-term ");
445 s = format (s, "clear ");
450 static void *vl_api_bridge_flags_t_print
451 (vl_api_bridge_flags_t * mp, void *handle)
454 u32 flags = (mp->flags);
456 s = format (0, "SCRIPT: bridge_flags ");
458 s = format (s, "bd_id %d ", (mp->bd_id));
460 if (flags & BRIDGE_API_FLAG_LEARN)
461 s = format (s, "learn ");
462 if (flags & BRIDGE_API_FLAG_FWD)
463 s = format (s, "forward ");
464 if (flags & BRIDGE_API_FLAG_FLOOD)
465 s = format (s, "flood ");
466 if (flags & BRIDGE_API_FLAG_UU_FLOOD)
467 s = format (s, "uu-flood ");
468 if (flags & BRIDGE_API_FLAG_ARP_TERM)
469 s = format (s, "arp-term ");
472 s = format (s, "clear ");
477 static void *vl_api_bd_ip_mac_add_del_t_print
478 (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
482 s = format (0, "SCRIPT: bd_ip_mac_add_del ");
483 s = format (s, "bd_id %d ", (mp->entry.bd_id));
485 s = format (s, "%U ", format_vl_api_address, &mp->entry.ip);
486 s = format (s, "%U ", format_vl_api_mac_address, &mp->entry.mac);
488 s = format (s, "del ");
493 static void *vl_api_bd_ip_mac_flush_t_print
494 (vl_api_bd_ip_mac_flush_t * mp, void *handle)
498 s = format (0, "SCRIPT: bd_ip_mac_flush ");
499 s = format (s, "bd_id %d ", (mp->bd_id));
505 static void *vl_api_bd_ip_mac_dump_t_print
506 (vl_api_bd_ip_mac_dump_t * mp, void *handle)
510 s = format (0, "SCRIPT: bd_ip_mac_dump ");
515 static void *vl_api_tap_create_v2_t_print
516 (vl_api_tap_create_v2_t * mp, void *handle)
521 clib_memset (null_mac, 0, sizeof (null_mac));
523 s = format (0, "SCRIPT: tap_create_v2 ");
524 s = format (s, "id %u ", (mp->id));
525 if (memcmp (mp->mac_address, null_mac, 6))
526 s = format (s, "mac-address %U ",
527 format_ethernet_address, mp->mac_address);
528 if (memcmp (mp->host_mac_addr, null_mac, 6))
529 s = format (s, "host-mac-addr %U ",
530 format_ethernet_address, mp->host_mac_addr);
531 if (mp->host_if_name_set)
532 s = format (s, "host-if-name %s ", mp->host_if_name);
533 if (mp->host_namespace_set)
534 s = format (s, "host-ns %s ", mp->host_namespace);
535 if (mp->host_bridge_set)
536 s = format (s, "host-bridge %s ", mp->host_bridge);
537 if (mp->host_ip4_prefix_set)
538 s = format (s, "host-ip4-addr %U/%d ", format_ip4_address,
539 mp->host_ip4_prefix.address, mp->host_ip4_prefix.len);
540 if (mp->host_ip6_prefix_set)
541 s = format (s, "host-ip6-addr %U/%d ", format_ip6_address,
542 mp->host_ip6_prefix.address, mp->host_ip6_prefix.len);
543 if (mp->host_ip4_gw_set)
545 format (s, "host-ip4-gw %U ", format_ip4_address,
546 mp->host_ip4_prefix.address);
547 if (mp->host_ip6_gw_set)
549 format (s, "host-ip6-gw %U ", format_ip6_address,
550 mp->host_ip6_prefix.address);
551 if (mp->num_rx_queues)
552 s = format (s, "num_rx_queues %u ", mp->num_rx_queues);
554 s = format (s, "tx-ring-size %u ", (mp->tx_ring_sz));
556 s = format (s, "rx-ring-size %u ", (mp->rx_ring_sz));
557 if (mp->host_mtu_set)
558 s = format (s, "host-mtu-size %u ", (mp->host_mtu_size));
559 if ((mp->tap_flags) & TAP_API_FLAG_GSO)
560 s = format (s, "gso-enabled ");
561 if ((mp->tap_flags) & TAP_API_FLAG_CSUM_OFFLOAD)
562 s = format (s, "csum-offload-enabled ");
563 if ((mp->tap_flags) & TAP_API_FLAG_PERSIST)
564 s = format (s, "persist ");
565 if ((mp->tap_flags) & TAP_API_FLAG_ATTACH)
566 s = format (s, "attach ");
567 if ((mp->tap_flags) & TAP_API_FLAG_TUN)
568 s = format (s, "tun ");
569 if ((mp->tap_flags) & TAP_API_FLAG_GRO_COALESCE)
570 s = format (s, "gro-coalesce-enabled ");
571 if ((mp->tap_flags) & TAP_API_FLAG_PACKED)
572 s = format (s, "packed ");
573 if ((mp->tap_flags) & TAP_API_FLAG_IN_ORDER)
574 s = format (s, "in-order ");
578 static void *vl_api_tap_delete_v2_t_print
579 (vl_api_tap_delete_v2_t * mp, void *handle)
583 s = format (0, "SCRIPT: tap_delete_v2 ");
584 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
589 static void *vl_api_sw_interface_tap_v2_dump_t_print
590 (vl_api_sw_interface_tap_v2_dump_t * mp, void *handle)
594 s = format (0, "SCRIPT: sw_interface_tap_v2_dump ");
600 static void *vl_api_virtio_pci_create_t_print
601 (vl_api_virtio_pci_create_t * mp, void *handle)
606 clib_memset (null_mac, 0, sizeof (null_mac));
608 s = format (0, "SCRIPT: virtio_pci_create ");
609 s = format (s, "pci_addr %U ", format_vlib_pci_addr, (mp->pci_addr));
610 if (memcmp (mp->mac_address, null_mac, 6))
611 s = format (s, "mac-address %U ",
612 format_ethernet_address, mp->mac_address);
614 s = format (s, "features 0x%llx ", clib_net_to_host_u64 (mp->features));
616 s = format (s, "gso-enabled ");
617 if (mp->checksum_offload_enabled)
618 s = format (s, "checksum_offload_enabled");
623 static void *vl_api_virtio_pci_create_v2_t_print
624 (vl_api_virtio_pci_create_v2_t * mp, void *handle)
629 clib_memset (null_mac, 0, sizeof (null_mac));
631 s = format (0, "SCRIPT: virtio_pci_create_v2 ");
632 s = format (s, "pci_addr %U ", format_vlib_pci_addr, (mp->pci_addr));
633 if (memcmp (mp->mac_address, null_mac, 6))
634 s = format (s, "mac-address %U ",
635 format_ethernet_address, mp->mac_address);
637 s = format (s, "features 0x%llx ", clib_net_to_host_u64 (mp->features));
638 if (mp->virtio_flags & VIRTIO_API_FLAG_GSO)
639 s = format (s, "gso-enabled ");
640 if (mp->virtio_flags & VIRTIO_API_FLAG_CSUM_OFFLOAD)
641 s = format (s, "checksum_offload_enabled ");
642 if ((mp->virtio_flags) & VIRTIO_API_FLAG_GRO_COALESCE)
643 s = format (s, "gro-coalesce-enabled ");
644 if ((mp->virtio_flags) & VIRTIO_API_FLAG_PACKED)
645 s = format (s, "packed ");
646 if ((mp->virtio_flags) & VIRTIO_API_FLAG_IN_ORDER)
647 s = format (s, "in-order ");
648 if ((mp->virtio_flags) & VIRTIO_API_FLAG_BUFFERING)
649 s = format (s, "buffering ");
654 static void *vl_api_virtio_pci_delete_t_print
655 (vl_api_virtio_pci_delete_t * mp, void *handle)
659 s = format (0, "SCRIPT: virtio_pci_delete ");
660 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
666 static void *vl_api_sw_interface_virtio_pci_dump_t_print
667 (vl_api_sw_interface_virtio_pci_dump_t * mp, void *handle)
671 s = format (0, "SCRIPT: sw_interface_virtio_pci_dump ");
676 static void *vl_api_bond_create_t_print
677 (vl_api_bond_create_t * mp, void *handle)
682 clib_memset (null_mac, 0, sizeof (null_mac));
684 s = format (0, "SCRIPT: bond_create ");
685 if (memcmp (mp->mac_address, null_mac, 6))
686 s = format (s, "mac-address %U ",
687 format_ethernet_address, mp->mac_address);
689 s = format (s, "mode %U ", format_bond_mode, ntohl (mp->mode));
691 s = format (s, "lb %U ", format_bond_load_balance, ntohl (mp->lb));
693 s = format (s, "numa-only is set in lacp mode");
695 s = format (s, "id %u ", (mp->id));
699 static void *vl_api_bond_create2_t_print
700 (vl_api_bond_create2_t * mp, void *handle)
705 clib_memset (null_mac, 0, sizeof (null_mac));
707 s = format (0, "SCRIPT: bond_create2 ");
708 if (memcmp (mp->mac_address, null_mac, 6))
709 s = format (s, "mac-address %U ",
710 format_ethernet_address, mp->mac_address);
712 s = format (s, "mode %U ", format_bond_mode, ntohl (mp->mode));
714 s = format (s, "lb %U ", format_bond_load_balance, ntohl (mp->lb));
716 s = format (s, "numa-only ");
718 s = format (s, "gso ");
720 s = format (s, "id %u ", (mp->id));
724 static void *vl_api_bond_delete_t_print
725 (vl_api_bond_delete_t * mp, void *handle)
729 s = format (0, "SCRIPT: bond_delete ");
730 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
735 static void *vl_api_bond_add_member_t_print
736 (vl_api_bond_add_member_t * mp, void *handle)
740 s = format (0, "SCRIPT: bond_add_member ");
741 s = format (s, "bond_sw_if_index %u ", (mp->bond_sw_if_index));
742 s = format (s, "sw_if_index %u ", (mp->sw_if_index));
744 s = format (s, "passive ");
745 if (mp->is_long_timeout)
746 s = format (s, "long-timeout ");
751 static void *vl_api_sw_interface_set_bond_weight_t_print
752 (vl_api_sw_interface_set_bond_weight_t * mp, void *handle)
756 s = format (0, "SCRIPT: sw_interface_set_bond_weight ");
757 s = format (s, "sw_if_index %u ", ntohl (mp->sw_if_index));
758 s = format (s, "weight %u ", ntohl (mp->weight));
763 static void *vl_api_bond_detach_member_t_print
764 (vl_api_bond_detach_member_t * mp, void *handle)
768 s = format (0, "SCRIPT: bond_detach_member ");
769 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
774 static void *vl_api_sw_bond_interface_dump_t_print
775 (vl_api_sw_bond_interface_dump_t * mp, void *handle)
779 s = format (0, "SCRIPT: sw_bond_interface_dump ");
780 if (mp->sw_if_index != ~0)
781 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
786 static void *vl_api_sw_member_interface_dump_t_print
787 (vl_api_sw_member_interface_dump_t * mp, void *handle)
791 s = format (0, "SCRIPT: sw_member_interface_dump ");
792 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
797 static void *vl_api_ip_route_add_del_t_print
798 (vl_api_ip_route_add_del_t * mp, void *handle)
802 s = format (0, "SCRIPT: ip_route_add_del ");
804 s = format (s, "del ");
806 s = format (s, "%U", format_vl_api_prefix, &mp->route.prefix);
808 for (p = 0; p < mp->route.n_paths; p++)
809 s = format (s, " [%U]", format_vl_api_fib_path, &mp->route.paths[p]);
814 static void *vl_api_mpls_route_add_del_t_print
815 (vl_api_mpls_route_add_del_t * mp, void *handle)
819 s = format (0, "SCRIPT: mpls_route_add_del ");
822 s = format (s, "add ");
824 s = format (s, "del ");
826 s = format (s, "table %d ", (mp->mr_route.mr_table_id));
827 s = format (s, "%d ", (mp->mr_route.mr_label));
829 if (mp->mr_route.mr_eos)
830 s = format (s, "eos ");
832 s = format (s, "non-eos ");
834 if (mp->mr_route.mr_is_multicast)
835 s = format (s, "multicast ");
837 for (p = 0; p < mp->mr_route.mr_n_paths; p++)
839 format (s, " [%U]", format_vl_api_fib_path, &mp->mr_route.mr_paths[p]);
845 static void *vl_api_ip_table_add_del_t_print
846 (vl_api_ip_table_add_del_t * mp, void *handle)
850 s = format (0, "SCRIPT: ip_table_add_del ");
852 s = format (s, "add ");
854 s = format (s, "del ");
855 if (mp->table.is_ip6)
856 s = format (s, "ip6 ");
857 s = format (s, "table %d ", (mp->table.table_id));
858 s = format (s, "%s ", mp->table.name);
863 static void *vl_api_mpls_table_add_del_t_print
864 (vl_api_mpls_table_add_del_t * mp, void *handle)
868 s = format (0, "SCRIPT: mpls_table_add_del ");
870 s = format (s, "add ");
872 s = format (s, "del ");
873 s = format (s, "table %d ", (mp->mt_table.mt_table_id));
878 static void *vl_api_mpls_tunnel_add_del_t_print
879 (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
883 s = format (0, "SCRIPT: mpls_tunnel_add_del ");
885 if (mp->mt_is_add == 0)
886 s = format (s, "del sw_if_index %d ", (mp->mt_tunnel.mt_sw_if_index));
888 s = format (s, "sw_if_index %d ", (mp->mt_tunnel.mt_sw_if_index));
891 if (mp->mt_tunnel.mt_l2_only)
892 s = format (s, "l2-only ");
893 if (mp->mt_tunnel.mt_is_multicast)
894 s = format (s, "multicast ");
895 if (mp->mt_tunnel.mt_tunnel_index)
896 s = format (s, "tunnel-index ");
898 for (p = 0; p < mp->mt_tunnel.mt_n_paths; p++)
899 s = format (s, " [%U]", format_vl_api_fib_path,
900 &mp->mt_tunnel.mt_paths[p]);
905 static void *vl_api_sr_mpls_policy_add_t_print
906 (vl_api_sr_mpls_policy_add_t * mp, void *handle)
910 s = format (0, "SCRIPT: sr_mpls_policy_add ");
912 s = format (s, "bsid %d ", (mp->bsid));
914 if (mp->weight != htonl ((u32) 1))
915 s = format (s, "%d ", (mp->weight));
918 s = format (s, "spray ");
923 for (i = 0; i < mp->n_segments; i++)
924 s = format (s, "next %d ", (mp->segments[i]));
930 static void *vl_api_sr_mpls_policy_del_t_print
931 (vl_api_sr_mpls_policy_del_t * mp, void *handle)
935 s = format (0, "SCRIPT: sr_mpls_policy_del ");
937 s = format (s, "bsid %d ", (mp->bsid));
942 static void *vl_api_sw_interface_set_unnumbered_t_print
943 (vl_api_sw_interface_set_unnumbered_t * mp, void *handle)
947 s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
949 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
951 s = format (s, "unnum_if_index %d ", (mp->unnumbered_sw_if_index));
954 s = format (s, "del ");
959 static void *vl_api_create_vlan_subif_t_print
960 (vl_api_create_vlan_subif_t * mp, void *handle)
964 s = format (0, "SCRIPT: create_vlan_subif ");
967 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
970 s = format (s, "vlan_id %d ", (mp->vlan_id));
975 #define foreach_create_subif_flag \
980 _(4, "exact_match") \
981 _(5, "default_sub") \
982 _(6, "outer_vlan_id_any") \
983 _(7, "inner_vlan_id_any")
985 static void *vl_api_create_subif_t_print
986 (vl_api_create_subif_t * mp, void *handle)
990 s = format (0, "SCRIPT: create_subif ");
992 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
994 s = format (s, "sub_id %d ", (mp->sub_id));
996 if (mp->outer_vlan_id)
997 s = format (s, "outer_vlan_id %d ", (mp->outer_vlan_id));
999 if (mp->inner_vlan_id)
1000 s = format (s, "inner_vlan_id %d ", (mp->inner_vlan_id));
1002 #define _(a,b) if (mp->sub_if_flags & (1 << a)) s = format (s, "%s ", b);
1003 foreach_create_subif_flag;
1009 static void *vl_api_delete_subif_t_print
1010 (vl_api_delete_subif_t * mp, void *handle)
1014 s = format (0, "SCRIPT: delete_subif ");
1015 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1021 vl_api_ip_table_replace_begin_t_print (vl_api_ip_table_replace_begin_t * mp,
1026 s = format (0, "SCRIPT: ip_table_replace_begin ");
1028 s = format (s, "v%s-table %d ",
1029 mp->table.is_ip6 ? "6" : "4", (mp->table.table_id));
1035 vl_api_ip_table_flush_t_print (vl_api_ip_table_flush_t * mp, void *handle)
1039 s = format (0, "SCRIPT: ip_table_flush ");
1041 s = format (s, "v%s-table %d ",
1042 mp->table.is_ip6 ? "6" : "4", (mp->table.table_id));
1048 vl_api_ip_table_replace_end_t_print (vl_api_ip_table_replace_end_t * mp,
1053 s = format (0, "SCRIPT: ip_table_replace_end ");
1055 s = format (s, "v%s-table %d ",
1056 mp->table.is_ip6 ? "6" : "4", (mp->table.table_id));
1061 static void *vl_api_set_ip_flow_hash_t_print
1062 (vl_api_set_ip_flow_hash_t * mp, void *handle)
1066 s = format (0, "SCRIPT: set_ip_flow_hash ");
1068 s = format (s, "vrf_id %d ", (mp->vrf_id));
1071 s = format (s, "src ");
1074 s = format (s, "dst ");
1077 s = format (s, "sport ");
1080 s = format (s, "dport ");
1083 s = format (s, "proto ");
1086 s = format (s, "reverse ");
1088 if (mp->is_ipv6 != 0)
1089 s = format (s, "ipv6 ");
1095 static void *vl_api_l2_patch_add_del_t_print
1096 (vl_api_l2_patch_add_del_t * mp, void *handle)
1100 s = format (0, "SCRIPT: l2_patch_add_del ");
1102 s = format (s, "rx_sw_if_index %d ", (mp->rx_sw_if_index));
1104 s = format (s, "tx_sw_if_index %d ", (mp->tx_sw_if_index));
1106 if (mp->is_add == 0)
1107 s = format (s, "del ");
1112 static void *vl_api_sr_localsid_add_del_t_print
1113 (vl_api_sr_localsid_add_del_t * mp, void *handle)
1115 vnet_main_t *vnm = vnet_get_main ();
1118 s = format (0, "SCRIPT: sr_localsid_add_del ");
1120 switch (mp->behavior)
1122 case SR_BEHAVIOR_END:
1123 s = format (s, "Address: %U\nBehavior: End",
1124 format_ip6_address, (ip6_address_t *) mp->localsid);
1125 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1130 "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1131 "\nIface: %U\nNext hop: %U", format_ip6_address,
1132 (ip6_address_t *) mp->localsid,
1133 format_vnet_sw_if_index_name, vnm, (mp->sw_if_index),
1134 format_ip6_address, (ip6_address_t *) mp->nh_addr.un.ip6);
1135 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1137 case SR_BEHAVIOR_DX4:
1140 "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1141 "\nIface: %U\nNext hop: %U", format_ip6_address,
1142 (ip6_address_t *) mp->localsid,
1143 format_vnet_sw_if_index_name, vnm, (mp->sw_if_index),
1144 format_ip4_address, (ip4_address_t *) mp->nh_addr.un.ip4);
1146 case SR_BEHAVIOR_DX6:
1149 "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1150 "\nIface: %UNext hop: %U", format_ip6_address,
1151 (ip6_address_t *) mp->localsid,
1152 format_vnet_sw_if_index_name, vnm, (mp->sw_if_index),
1153 format_ip6_address, (ip6_address_t *) mp->nh_addr.un.ip6);
1155 case SR_BEHAVIOR_DX2:
1158 "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1159 "\nIface: %U", format_ip6_address,
1160 (ip6_address_t *) mp->localsid,
1161 format_vnet_sw_if_index_name, vnm, (mp->sw_if_index));
1163 case SR_BEHAVIOR_DT6:
1166 "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1167 "\nTable: %u", format_ip6_address,
1168 (ip6_address_t *) mp->localsid, (mp->fib_table));
1170 case SR_BEHAVIOR_DT4:
1173 "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1174 "\nTable: %u", format_ip6_address,
1175 (ip6_address_t *) mp->localsid, (mp->fib_table));
1178 if (mp->behavior >= SR_BEHAVIOR_LAST)
1180 s = format (s, "Address: %U\n Behavior: %u",
1181 format_ip6_address, (ip6_address_t *) mp->localsid,
1185 //Should never get here...
1186 s = format (s, "Internal error");
1192 static void *vl_api_sr_steering_add_del_t_print
1193 (vl_api_sr_steering_add_del_t * mp, void *handle)
1197 s = format (0, "SCRIPT: sr_steering_add_del ");
1199 s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1201 switch (mp->traffic_type)
1204 s = format (s, "Traffic type: L2 iface: %u", (mp->sw_if_index));
1207 s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1208 (ip4_address_t *) mp->prefix.address.un.ip4,
1212 s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1213 (ip6_address_t *) mp->prefix.address.un.ip6,
1217 s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1220 s = format (s, "BindingSID: %U", format_ip6_address,
1221 (ip6_address_t *) mp->bsid_addr);
1223 s = format (s, "SR Policy Index: %u", (mp->sr_policy_index));
1225 s = format (s, "FIB_table: %u", (mp->table_id));
1230 static void *vl_api_sr_policy_add_t_print
1231 (vl_api_sr_policy_add_t * mp, void *handle)
1235 ip6_address_t *segments = 0, *seg;
1236 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1239 for (i = 0; i < mp->sids.num_sids; i++)
1241 vec_add2 (segments, seg, 1);
1242 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1246 s = format (0, "SCRIPT: sr_policy_add ");
1248 s = format (s, "BSID: %U", format_ip6_address,
1249 (ip6_address_t *) mp->bsid_addr);
1253 (mp->is_encap ? "Behavior: Encapsulation" :
1254 "Behavior: SRH insertion"));
1256 s = format (s, "FIB_table: %u", (mp->fib_table));
1258 s = format (s, (mp->is_spray ? "Type: Default" : "Type: Spray"));
1260 s = format (s, "SID list weight: %u", (mp->weight));
1262 s = format (s, "{");
1263 vec_foreach (seg, segments)
1265 s = format (s, "%U, ", format_ip6_address, seg);
1267 s = format (s, "\b\b } ");
1272 static void *vl_api_sr_policy_mod_t_print
1273 (vl_api_sr_policy_mod_t * mp, void *handle)
1277 ip6_address_t *segments = 0, *seg;
1278 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1281 for (i = 0; i < mp->sids.num_sids; i++)
1283 vec_add2 (segments, seg, 1);
1284 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1288 s = format (0, "SCRIPT: sr_policy_mod ");
1290 s = format (s, "BSID: %U", format_ip6_address,
1291 (ip6_address_t *) mp->bsid_addr);
1293 s = format (s, "SR Policy index: %u", (mp->sr_policy_index));
1295 s = format (s, "Operation: %u", mp->operation);
1297 s = format (s, "SID list index: %u", (mp->sl_index));
1299 s = format (s, "SID list weight: %u", (mp->weight));
1301 s = format (s, "{");
1302 vec_foreach (seg, segments)
1304 s = format (s, "%U, ", format_ip6_address, seg);
1306 s = format (s, "\b\b } ");
1311 static void *vl_api_sr_policy_del_t_print
1312 (vl_api_sr_policy_del_t * mp, void *handle)
1316 s = format (0, "SCRIPT: sr_policy_del ");
1317 s = format (s, "To be delivered. Good luck.");
1321 static void *vl_api_classify_add_del_table_t_print
1322 (vl_api_classify_add_del_table_t * mp, void *handle)
1327 s = format (0, "SCRIPT: classify_add_del_table ");
1329 if (mp->is_add == 0)
1331 s = format (s, "table %d ", (mp->table_index));
1332 s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1336 s = format (s, "nbuckets %d ", (mp->nbuckets));
1337 s = format (s, "memory_size %d ", (mp->memory_size));
1338 s = format (s, "skip %d ", (mp->skip_n_vectors));
1339 s = format (s, "match %d ", (mp->match_n_vectors));
1340 s = format (s, "next-table %d ", (mp->next_table_index));
1341 s = format (s, "miss-next %d ", (mp->miss_next_index));
1342 s = format (s, "current-data-flag %d ", (mp->current_data_flag));
1343 if (mp->current_data_flag)
1344 s = format (s, "current-data-offset %d ", (mp->current_data_offset));
1345 s = format (s, "mask hex ");
1346 for (i = 0; i < (mp->match_n_vectors) * sizeof (u32x4); i++)
1347 s = format (s, "%02x", mp->mask[i]);
1354 static void *vl_api_classify_add_del_session_t_print
1355 (vl_api_classify_add_del_session_t * mp, void *handle)
1360 s = format (0, "SCRIPT: classify_add_del_session ");
1362 s = format (s, "table_index %d ", (mp->table_index));
1363 s = format (s, "hit_next_index %d ", (mp->hit_next_index));
1364 s = format (s, "opaque_index %d ", (mp->opaque_index));
1365 s = format (s, "advance %d ", (mp->advance));
1366 s = format (s, "action %d ", mp->action);
1368 s = format (s, "metadata %d ", (mp->metadata));
1369 if (mp->is_add == 0)
1370 s = format (s, "del ");
1372 s = format (s, "match hex ");
1373 for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1375 if (mp->match[i] != 0)
1382 for (i = 0; i < limit; i++)
1383 s = format (s, "%02x", mp->match[i]);
1388 static void *vl_api_classify_set_interface_ip_table_t_print
1389 (vl_api_classify_set_interface_ip_table_t * mp, void *handle)
1393 s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1396 s = format (s, "ipv6 ");
1398 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1399 s = format (s, "table %d ", (mp->table_index));
1404 static void *vl_api_classify_set_interface_l2_tables_t_print
1405 (vl_api_classify_set_interface_l2_tables_t * mp, void *handle)
1409 s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1411 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1412 s = format (s, "ip4-table %d ", (mp->ip4_table_index));
1413 s = format (s, "ip6-table %d ", (mp->ip6_table_index));
1414 s = format (s, "other-table %d ", (mp->other_table_index));
1415 s = format (s, "is-input %d ", mp->is_input);
1420 static void *vl_api_add_node_next_t_print
1421 (vl_api_add_node_next_t * mp, void *handle)
1425 s = format (0, "SCRIPT: add_node_next ");
1427 s = format (s, "node %s next %s ", mp->node_name, mp->next_name);
1432 static void *vl_api_vxlan_add_del_tunnel_t_print
1433 (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1436 s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1438 ip46_address_t src =
1439 to_ip46 (mp->src_address.af, (u8 *) & mp->src_address.un);
1440 ip46_address_t dst =
1441 to_ip46 (mp->dst_address.af, (u8 *) & mp->dst_address.un);
1443 u8 is_grp = ip46_address_is_multicast (&dst);
1444 char *dst_name = is_grp ? "group" : "dst";
1446 s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1447 s = format (s, "%s %U ", dst_name, format_ip46_address,
1448 &dst, IP46_TYPE_ANY);
1451 s = format (s, "mcast_sw_if_index %d ", (mp->mcast_sw_if_index));
1453 if (mp->encap_vrf_id)
1454 s = format (s, "encap-vrf-id %d ", (mp->encap_vrf_id));
1456 s = format (s, "decap-next %d ", (mp->decap_next_index));
1458 s = format (s, "vni %d ", (mp->vni));
1460 s = format (s, "instance %d ", (mp->instance));
1462 if (mp->is_add == 0)
1463 s = format (s, "del ");
1468 static void *vl_api_vxlan_offload_rx_t_print
1469 (vl_api_vxlan_offload_rx_t * mp, void *handle)
1472 s = format (0, "SCRIPT: vxlan_offload_rx ");
1474 s = format (s, "hw hw_if_index %d ", (mp->hw_if_index));
1475 s = format (s, "rx sw_if_index %d ", (mp->sw_if_index));
1477 s = format (s, "del ");
1482 static void *vl_api_vxlan_tunnel_dump_t_print
1483 (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1487 s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1489 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1494 static void *vl_api_vxlan_gbp_tunnel_add_del_t_print
1495 (vl_api_vxlan_gbp_tunnel_add_del_t * mp, void *handle)
1498 s = format (0, "SCRIPT: vxlan_gbp_tunnel_add_del ");
1501 s = format (s, "add ");
1503 s = format (s, "del ");
1505 s = format (s, "instance %d ", (mp->tunnel.instance));
1506 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1507 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1508 s = format (s, "mcast_sw_if_index %d ", (mp->tunnel.mcast_sw_if_index));
1509 s = format (s, "encap_table_id %d ", (mp->tunnel.encap_table_id));
1510 s = format (s, "vni %d ", (mp->tunnel.vni));
1511 s = format (s, "sw_if_index %d ", (mp->tunnel.sw_if_index));
1516 static void *vl_api_vxlan_gbp_tunnel_dump_t_print
1517 (vl_api_vxlan_gbp_tunnel_dump_t * mp, void *handle)
1521 s = format (0, "SCRIPT: vxlan_gbp_tunnel_dump ");
1523 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1528 static void *vl_api_sw_interface_set_vxlan_gbp_bypass_t_print
1529 (vl_api_sw_interface_set_vxlan_gbp_bypass_t * mp, void *handle)
1533 s = format (0, "SCRIPT: sw_interface_set_vxlan_gbp_bypass ");
1535 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1536 s = format (s, "%s ", (mp->is_ipv6 != 0) ? "ipv6" : "ipv4");
1537 s = format (s, "%s ", (mp->enable != 0) ? "enable" : "disable");
1542 static void *vl_api_gre_tunnel_add_del_t_print
1543 (vl_api_gre_tunnel_add_del_t * mp, void *handle)
1547 s = format (0, "SCRIPT: gre_tunnel_add_del ");
1549 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1550 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1552 s = format (s, "instance %d ", (mp->tunnel.instance));
1554 if (mp->tunnel.type == GRE_API_TUNNEL_TYPE_TEB)
1555 s = format (s, "teb ");
1557 if (mp->tunnel.type == GRE_API_TUNNEL_TYPE_ERSPAN)
1558 s = format (s, "erspan %d ", (mp->tunnel.session_id));
1560 if (mp->tunnel.outer_table_id)
1561 s = format (s, "outer-table-id %d ", mp->tunnel.outer_table_id);
1563 if (mp->is_add == 0)
1564 s = format (s, "del ");
1569 static void *vl_api_gre_tunnel_dump_t_print
1570 (vl_api_gre_tunnel_dump_t * mp, void *handle)
1574 s = format (0, "SCRIPT: gre_tunnel_dump ");
1576 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1581 static void *vl_api_l2_fib_clear_table_t_print
1582 (vl_api_l2_fib_clear_table_t * mp, void *handle)
1586 s = format (0, "SCRIPT: l2_fib_clear_table ");
1591 static void *vl_api_l2_interface_efp_filter_t_print
1592 (vl_api_l2_interface_efp_filter_t * mp, void *handle)
1596 s = format (0, "SCRIPT: l2_interface_efp_filter ");
1598 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1599 if (mp->enable_disable)
1600 s = format (s, "enable ");
1602 s = format (s, "disable ");
1607 static void *vl_api_l2_interface_vlan_tag_rewrite_t_print
1608 (vl_api_l2_interface_vlan_tag_rewrite_t * mp, void *handle)
1612 s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
1614 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1615 s = format (s, "vtr_op %d ", (mp->vtr_op));
1616 s = format (s, "push_dot1q %d ", (mp->push_dot1q));
1617 s = format (s, "tag1 %d ", (mp->tag1));
1618 s = format (s, "tag2 %d ", (mp->tag2));
1623 static void *vl_api_create_vhost_user_if_t_print
1624 (vl_api_create_vhost_user_if_t * mp, void *handle)
1628 s = format (0, "SCRIPT: create_vhost_user_if ");
1630 s = format (s, "socket %s ", mp->sock_filename);
1632 s = format (s, "server ");
1634 s = format (s, "renumber %d ", (mp->custom_dev_instance));
1635 if (mp->disable_mrg_rxbuf)
1636 s = format (s, "disable_mrg_rxbuf ");
1637 if (mp->disable_indirect_desc)
1638 s = format (s, "disable_indirect_desc ");
1640 s = format (s, "tag %s ", mp->tag);
1642 s = format (s, "gso ");
1643 if (mp->enable_packed)
1644 s = format (s, "packed");
1649 static void *vl_api_modify_vhost_user_if_t_print
1650 (vl_api_modify_vhost_user_if_t * mp, void *handle)
1654 s = format (0, "SCRIPT: modify_vhost_user_if ");
1656 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1657 s = format (s, "socket %s ", mp->sock_filename);
1659 s = format (s, "server ");
1661 s = format (s, "renumber %d ", (mp->custom_dev_instance));
1663 s = format (s, "gso ");
1664 if (mp->enable_packed)
1665 s = format (s, "packed");
1670 static void *vl_api_delete_vhost_user_if_t_print
1671 (vl_api_delete_vhost_user_if_t * mp, void *handle)
1675 s = format (0, "SCRIPT: delete_vhost_user_if ");
1676 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1681 static void *vl_api_sw_interface_vhost_user_dump_t_print
1682 (vl_api_sw_interface_vhost_user_dump_t * mp, void *handle)
1686 s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
1687 if (mp->sw_if_index != ~0)
1688 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1693 static void *vl_api_sw_interface_dump_t_print
1694 (vl_api_sw_interface_dump_t * mp, void *handle)
1698 s = format (0, "SCRIPT: sw_interface_dump ");
1700 if (mp->name_filter_valid)
1702 u8 *v = vl_api_from_api_to_new_vec (mp, &mp->name_filter);
1703 s = format (s, "name_filter %v ", v);
1707 s = format (s, "all ");
1712 static void *vl_api_l2_fib_table_dump_t_print
1713 (vl_api_l2_fib_table_dump_t * mp, void *handle)
1717 s = format (0, "SCRIPT: l2_fib_table_dump ");
1719 s = format (s, "bd_id %d ", (mp->bd_id));
1724 static void *vl_api_control_ping_t_print
1725 (vl_api_control_ping_t * mp, void *handle)
1729 s = format (0, "SCRIPT: control_ping ");
1734 static void *vl_api_want_interface_events_t_print
1735 (vl_api_want_interface_events_t * mp, void *handle)
1739 s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
1740 (mp->pid), ntohl (mp->enable_disable));
1746 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
1750 s = format (0, "SCRIPT: cli ");
1755 static void *vl_api_cli_inband_t_print
1756 (vl_api_cli_inband_t * mp, void *handle)
1761 cmd = vl_api_from_api_to_new_vec (mp, &mp->cmd);
1763 s = format (0, "SCRIPT: exec %v ", cmd);
1769 static void *vl_api_memclnt_create_t_print
1770 (vl_api_memclnt_create_t * mp, void *handle)
1774 s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
1779 static void *vl_api_sockclnt_create_t_print
1780 (vl_api_sockclnt_create_t * mp, void *handle)
1784 s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name);
1789 static void *vl_api_show_version_t_print
1790 (vl_api_show_version_t * mp, void *handle)
1794 s = format (0, "SCRIPT: show_version ");
1800 static void *vl_api_show_threads_t_print
1801 (vl_api_show_threads_t * mp, void *handle)
1805 s = format (0, "SCRIPT: show_threads ");
1810 static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
1811 (vl_api_vxlan_gpe_add_del_tunnel_t * mp, void *handle)
1815 s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
1817 ip46_address_t local, remote;
1819 ip_address_decode (&mp->local, &local);
1820 ip_address_decode (&mp->remote, &remote);
1822 u8 is_grp = ip46_address_is_multicast (&remote);
1823 char *remote_name = is_grp ? "group" : "remote";
1825 s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1826 s = format (s, "%s %U ", remote_name, format_ip46_address,
1827 &remote, IP46_TYPE_ANY);
1830 s = format (s, "mcast_sw_if_index %d ", (mp->mcast_sw_if_index));
1831 s = format (s, "protocol %d ", (mp->protocol));
1833 s = format (s, "vni %d ", (mp->vni));
1835 if (mp->is_add == 0)
1836 s = format (s, "del ");
1838 if (mp->encap_vrf_id)
1839 s = format (s, "encap-vrf-id %d ", (mp->encap_vrf_id));
1841 if (mp->decap_vrf_id)
1842 s = format (s, "decap-vrf-id %d ", (mp->decap_vrf_id));
1847 static void *vl_api_vxlan_gpe_tunnel_dump_t_print
1848 (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
1852 s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
1854 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1859 static void *vl_api_interface_name_renumber_t_print
1860 (vl_api_interface_name_renumber_t * mp, void *handle)
1864 s = format (0, "SCRIPT: interface_renumber ");
1866 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1868 s = format (s, "new_show_dev_instance %d ", (mp->new_show_dev_instance));
1873 static void *vl_api_want_l2_macs_events_t_print
1874 (vl_api_want_l2_macs_events_t * mp, void *handle)
1878 s = format (0, "SCRIPT: want_l2_macs_events ");
1879 s = format (s, "learn-limit %d ", (mp->learn_limit));
1880 s = format (s, "scan-delay %d ", (u32) mp->scan_delay);
1881 s = format (s, "max-entries %d ", (u32) mp->max_macs_in_event * 10);
1882 if (mp->enable_disable == 0)
1883 s = format (s, "disable");
1888 static void *vl_api_input_acl_set_interface_t_print
1889 (vl_api_input_acl_set_interface_t * mp, void *handle)
1893 s = format (0, "SCRIPT: input_acl_set_interface ");
1895 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1896 s = format (s, "ip4-table %d ", (mp->ip4_table_index));
1897 s = format (s, "ip6-table %d ", (mp->ip6_table_index));
1898 s = format (s, "l2-table %d ", (mp->l2_table_index));
1900 if (mp->is_add == 0)
1901 s = format (s, "del ");
1906 static void *vl_api_output_acl_set_interface_t_print
1907 (vl_api_output_acl_set_interface_t * mp, void *handle)
1911 s = format (0, "SCRIPT: output_acl_set_interface ");
1913 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1914 s = format (s, "ip4-table %d ", (mp->ip4_table_index));
1915 s = format (s, "ip6-table %d ", (mp->ip6_table_index));
1916 s = format (s, "l2-table %d ", (mp->l2_table_index));
1918 if (mp->is_add == 0)
1919 s = format (s, "del ");
1924 static void *vl_api_ip_address_dump_t_print
1925 (vl_api_ip_address_dump_t * mp, void *handle)
1929 s = format (0, "SCRIPT: ip6_address_dump ");
1930 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1931 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1937 vl_api_ip_dump_t_print (vl_api_ip_dump_t * mp, void *handle)
1941 s = format (0, "SCRIPT: ip_dump ");
1942 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1947 static void *vl_api_cop_interface_enable_disable_t_print
1948 (vl_api_cop_interface_enable_disable_t * mp, void *handle)
1952 s = format (0, "SCRIPT: cop_interface_enable_disable ");
1953 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1954 if (mp->enable_disable)
1955 s = format (s, "enable ");
1957 s = format (s, "disable ");
1962 static void *vl_api_cop_whitelist_enable_disable_t_print
1963 (vl_api_cop_whitelist_enable_disable_t * mp, void *handle)
1967 s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
1968 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1969 s = format (s, "fib-id %d ", (mp->fib_id));
1971 s = format (s, "ip4 ");
1973 s = format (s, "ip6 ");
1974 if (mp->default_cop)
1975 s = format (s, "default ");
1980 static void *vl_api_af_packet_create_t_print
1981 (vl_api_af_packet_create_t * mp, void *handle)
1985 s = format (0, "SCRIPT: af_packet_create ");
1986 s = format (s, "host_if_name %s ", mp->host_if_name);
1987 if (mp->use_random_hw_addr)
1988 s = format (s, "hw_addr random ");
1990 s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
1995 static void *vl_api_af_packet_delete_t_print
1996 (vl_api_af_packet_delete_t * mp, void *handle)
2000 s = format (0, "SCRIPT: af_packet_delete ");
2001 s = format (s, "host_if_name %s ", mp->host_if_name);
2006 static void *vl_api_af_packet_dump_t_print
2007 (vl_api_af_packet_dump_t * mp, void *handle)
2011 s = format (0, "SCRIPT: af_packet_dump ");
2017 format_policer_action (u8 * s, va_list * va)
2019 u32 action = va_arg (*va, u32);
2020 u32 dscp = va_arg (*va, u32);
2023 if (action == SSE2_QOS_ACTION_DROP)
2024 s = format (s, "drop");
2025 else if (action == SSE2_QOS_ACTION_TRANSMIT)
2026 s = format (s, "transmit");
2027 else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
2029 s = format (s, "mark-and-transmit ");
2032 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
2038 s = format (s, "%s", t);
2043 static void *vl_api_policer_add_del_t_print
2044 (vl_api_policer_add_del_t * mp, void *handle)
2048 s = format (0, "SCRIPT: policer_add_del ");
2049 s = format (s, "name %s ", mp->name);
2050 s = format (s, "cir %d ", mp->cir);
2051 s = format (s, "eir %d ", mp->eir);
2052 s = format (s, "cb %d ", mp->cb);
2053 s = format (s, "eb %d ", mp->eb);
2055 switch (mp->rate_type)
2057 case SSE2_QOS_RATE_KBPS:
2058 s = format (s, "rate_type kbps ");
2060 case SSE2_QOS_RATE_PPS:
2061 s = format (s, "rate_type pps ");
2067 switch (mp->round_type)
2069 case SSE2_QOS_ROUND_TO_CLOSEST:
2070 s = format (s, "round_type closest ");
2072 case SSE2_QOS_ROUND_TO_UP:
2073 s = format (s, "round_type up ");
2075 case SSE2_QOS_ROUND_TO_DOWN:
2076 s = format (s, "round_type down ");
2084 case SSE2_QOS_POLICER_TYPE_1R2C:
2085 s = format (s, "type 1r2c ");
2087 case SSE2_QOS_POLICER_TYPE_1R3C_RFC_2697:
2088 s = format (s, "type 1r3c ");
2090 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_2698:
2091 s = format (s, "type 2r3c-2698 ");
2093 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_4115:
2094 s = format (s, "type 2r3c-4115 ");
2096 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1:
2097 s = format (s, "type 2r3c-mef5cf1 ");
2103 s = format (s, "conform_action %U ", format_policer_action,
2104 mp->conform_action.type, mp->conform_action.dscp);
2105 s = format (s, "exceed_action %U ", format_policer_action,
2106 mp->exceed_action.type, mp->exceed_action.dscp);
2107 s = format (s, "violate_action %U ", format_policer_action,
2108 mp->violate_action.type, mp->violate_action.dscp);
2110 if (mp->color_aware)
2111 s = format (s, "color-aware ");
2112 if (mp->is_add == 0)
2113 s = format (s, "del ");
2118 static void *vl_api_policer_dump_t_print
2119 (vl_api_policer_dump_t * mp, void *handle)
2123 s = format (0, "SCRIPT: policer_dump ");
2124 if (mp->match_name_valid)
2125 s = format (s, "name %s ", mp->match_name);
2130 static void *vl_api_policer_classify_set_interface_t_print
2131 (vl_api_policer_classify_set_interface_t * mp, void *handle)
2135 s = format (0, "SCRIPT: policer_classify_set_interface ");
2136 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2137 if (mp->ip4_table_index != ~0)
2138 s = format (s, "ip4-table %d ", (mp->ip4_table_index));
2139 if (mp->ip6_table_index != ~0)
2140 s = format (s, "ip6-table %d ", (mp->ip6_table_index));
2141 if (mp->l2_table_index != ~0)
2142 s = format (s, "l2-table %d ", (mp->l2_table_index));
2143 if (mp->is_add == 0)
2144 s = format (s, "del ");
2149 static void *vl_api_policer_classify_dump_t_print
2150 (vl_api_policer_classify_dump_t * mp, void *handle)
2154 s = format (0, "SCRIPT: policer_classify_dump ");
2157 case POLICER_CLASSIFY_API_TABLE_IP4:
2158 s = format (s, "type ip4 ");
2160 case POLICER_CLASSIFY_API_TABLE_IP6:
2161 s = format (s, "type ip6 ");
2163 case POLICER_CLASSIFY_API_TABLE_L2:
2164 s = format (s, "type l2 ");
2173 static void *vl_api_sw_interface_clear_stats_t_print
2174 (vl_api_sw_interface_clear_stats_t * mp, void *handle)
2178 s = format (0, "SCRIPT: sw_interface_clear_stats ");
2179 if (mp->sw_if_index != ~0)
2180 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2185 static void *vl_api_mpls_tunnel_dump_t_print
2186 (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2190 s = format (0, "SCRIPT: mpls_tunnel_dump ");
2191 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2196 static void *vl_api_mpls_table_dump_t_print
2197 (vl_api_mpls_table_dump_t * mp, void *handle)
2201 s = format (0, "SCRIPT: mpls_table_decap_dump ");
2206 static void *vl_api_mpls_route_dump_t_print
2207 (vl_api_mpls_route_dump_t * mp, void *handle)
2211 s = format (0, "SCRIPT: mpls_route_decap_dump ");
2216 static void *vl_api_ip_table_dump_t_print
2217 (vl_api_ip_table_dump_t * mp, void *handle)
2221 s = format (0, "SCRIPT: ip_table_dump ");
2226 static void *vl_api_ip_route_dump_t_print
2227 (vl_api_ip_route_dump_t * mp, void *handle)
2231 s = format (0, "SCRIPT: ip_route_dump ");
2236 static void *vl_api_classify_table_ids_t_print
2237 (vl_api_classify_table_ids_t * mp, void *handle)
2241 s = format (0, "SCRIPT: classify_table_ids ");
2246 static void *vl_api_classify_table_by_interface_t_print
2247 (vl_api_classify_table_by_interface_t * mp, void *handle)
2251 s = format (0, "SCRIPT: classify_table_by_interface ");
2252 if (mp->sw_if_index != ~0)
2253 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2258 static void *vl_api_classify_table_info_t_print
2259 (vl_api_classify_table_info_t * mp, void *handle)
2263 s = format (0, "SCRIPT: classify_table_info ");
2264 if (mp->table_id != ~0)
2265 s = format (s, "table_id %d ", (mp->table_id));
2270 static void *vl_api_classify_session_dump_t_print
2271 (vl_api_classify_session_dump_t * mp, void *handle)
2275 s = format (0, "SCRIPT: classify_session_dump ");
2276 if (mp->table_id != ~0)
2277 s = format (s, "table_id %d ", (mp->table_id));
2282 static void *vl_api_set_ipfix_exporter_t_print
2283 (vl_api_set_ipfix_exporter_t * mp, void *handle)
2287 s = format (0, "SCRIPT: set_ipfix_exporter ");
2289 s = format (s, "collector-address %U ", format_ip4_address,
2290 (ip4_address_t *) mp->collector_address.un.ip4);
2291 s = format (s, "collector-port %d ", (mp->collector_port));
2292 s = format (s, "src-address %U ", format_ip4_address,
2293 (ip4_address_t *) mp->src_address.un.ip4);
2294 s = format (s, "vrf-id %d ", (mp->vrf_id));
2295 s = format (s, "path-mtu %d ", (mp->path_mtu));
2296 s = format (s, "template-interval %d ", (mp->template_interval));
2297 s = format (s, "udp-checksum %d ", mp->udp_checksum);
2302 static void *vl_api_ipfix_exporter_dump_t_print
2303 (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2307 s = format (0, "SCRIPT: ipfix_exporter_dump ");
2312 static void *vl_api_set_ipfix_classify_stream_t_print
2313 (vl_api_set_ipfix_classify_stream_t * mp, void *handle)
2317 s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2319 s = format (s, "domain-id %d ", (mp->domain_id));
2320 s = format (s, "src-port %d ", (mp->src_port));
2325 static void *vl_api_ipfix_classify_stream_dump_t_print
2326 (vl_api_ipfix_classify_stream_dump_t * mp, void *handle)
2330 s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2335 static void *vl_api_ipfix_classify_table_add_del_t_print
2336 (vl_api_ipfix_classify_table_add_del_t * mp, void *handle)
2340 s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2342 s = format (s, "table-id %d ", (mp->table_id));
2343 s = format (s, "ip-version %d ", mp->ip_version);
2344 s = format (s, "transport-protocol %d ", mp->transport_protocol);
2349 static void *vl_api_ipfix_classify_table_dump_t_print
2350 (vl_api_ipfix_classify_table_dump_t * mp, void *handle)
2354 s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2359 static void *vl_api_sw_interface_span_enable_disable_t_print
2360 (vl_api_sw_interface_span_enable_disable_t * mp, void *handle)
2364 s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2365 s = format (s, "src_sw_if_index %u ", (mp->sw_if_index_from));
2366 s = format (s, "dst_sw_if_index %u ", (mp->sw_if_index_to));
2369 s = format (s, "l2 ");
2374 s = format (s, "disable ");
2377 s = format (s, "rx ");
2380 s = format (s, "tx ");
2384 s = format (s, "both ");
2392 vl_api_sw_interface_span_dump_t_print (vl_api_sw_interface_span_dump_t * mp,
2397 s = format (0, "SCRIPT: sw_interface_span_dump ");
2400 s = format (s, "l2 ");
2405 static void *vl_api_get_next_index_t_print
2406 (vl_api_get_next_index_t * mp, void *handle)
2410 s = format (0, "SCRIPT: get_next_index ");
2411 s = format (s, "node-name %s ", mp->node_name);
2412 s = format (s, "next-node-name %s ", mp->next_name);
2417 static void *vl_api_pg_create_interface_t_print
2418 (vl_api_pg_create_interface_t * mp, void *handle)
2422 s = format (0, "SCRIPT: pg_create_interface ");
2423 s = format (s, "if_id %d ", (mp->interface_id));
2424 s = format (s, "gso-enabled %u ", mp->gso_enabled);
2425 s = format (s, "gso-size %u", (mp->gso_size));
2430 static void *vl_api_pg_capture_t_print
2431 (vl_api_pg_capture_t * mp, void *handle)
2435 s = format (0, "SCRIPT: pg_capture ");
2436 s = format (s, "if_id %d ", (mp->interface_id));
2437 s = format (s, "pcap %s", mp->pcap_file_name);
2438 if (mp->count != ~0)
2439 s = format (s, "count %d ", (mp->count));
2440 if (!mp->is_enabled)
2441 s = format (s, "disable");
2446 static void *vl_api_pg_enable_disable_t_print
2447 (vl_api_pg_enable_disable_t * mp, void *handle)
2451 s = format (0, "SCRIPT: pg_enable_disable ");
2452 if (vl_api_string_len (&mp->stream_name) > 0)
2454 format (s, "stream %s",
2455 vl_api_from_api_to_new_c_string (&mp->stream_name));
2456 if (!mp->is_enabled)
2457 s = format (s, "disable");
2462 static void *vl_api_pg_interface_enable_disable_coalesce_t_print
2463 (vl_api_pg_interface_enable_disable_coalesce_t * mp, void *handle)
2467 s = format (0, "SCRIPT: pg_interface_enable_disable_coalesce ");
2468 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2469 if (!mp->coalesce_enabled)
2470 s = format (s, "disable");
2472 s = format (s, "enable");
2477 static void *vl_api_ip_source_and_port_range_check_add_del_t_print
2478 (vl_api_ip_source_and_port_range_check_add_del_t * mp, void *handle)
2483 s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2484 s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
2486 for (i = 0; i < mp->number_of_ranges; i++)
2488 s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2491 s = format (s, "vrf %d ", (mp->vrf_id));
2493 if (mp->is_add == 0)
2494 s = format (s, "del ");
2499 static void *vl_api_ip_source_and_port_range_check_interface_add_del_t_print
2500 (vl_api_ip_source_and_port_range_check_interface_add_del_t * mp,
2505 s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2507 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2509 if (mp->tcp_out_vrf_id != ~0)
2510 s = format (s, "tcp-out-vrf %d ", (mp->tcp_out_vrf_id));
2512 if (mp->udp_out_vrf_id != ~0)
2513 s = format (s, "udp-out-vrf %d ", (mp->udp_out_vrf_id));
2515 if (mp->tcp_in_vrf_id != ~0)
2516 s = format (s, "tcp-in-vrf %d ", (mp->tcp_in_vrf_id));
2518 if (mp->udp_in_vrf_id != ~0)
2519 s = format (s, "udp-in-vrf %d ", (mp->udp_in_vrf_id));
2521 if (mp->is_add == 0)
2522 s = format (s, "del ");
2527 static void *vl_api_ipsec_tunnel_if_add_del_t_print
2528 (vl_api_ipsec_tunnel_if_add_del_t * mp, void *handle)
2532 s = format (0, "SCRIPT: ipsec_tunnel_if_add_del ");
2535 s = format (s, "esn");
2536 if (mp->anti_replay)
2537 s = format (s, "anti-replay");
2539 s = format (s, "udp-encap");
2541 s = format (s, "local-ip %U ", format_vl_api_address, &mp->remote_ip);
2543 s = format (s, "remote-ip %U ", format_vl_api_address, &mp->local_ip);
2544 s = format (s, "tx-table-id %d ", (mp->tx_table_id));
2546 s = format (s, "local-spi %d ", (mp->local_spi));
2548 s = format (s, "remote-spi %d ", (mp->remote_spi));
2550 s = format (s, "local-crypto-key-len %d ", mp->local_crypto_key_len);
2551 s = format (s, "local-crypto-key %U ", format_hex_bytes,
2552 mp->local_crypto_key, mp->local_crypto_key_len, 0);
2553 s = format (s, "remote-crypto-key-len %d ", mp->remote_crypto_key_len);
2554 s = format (s, "remote-crypto-key %U ", format_hex_bytes,
2555 mp->remote_crypto_key, mp->remote_crypto_key_len, 0);
2556 s = format (s, "local-integ-key-len %d ", mp->local_integ_key_len);
2557 s = format (s, "local-integ-key %U ", format_hex_bytes,
2558 mp->local_integ_key, mp->local_integ_key_len, 0);
2559 s = format (s, "remote-integ-key-len %d ", mp->remote_integ_key_len);
2560 s = format (s, "remote-integ-key %U ", format_hex_bytes,
2561 mp->remote_integ_key, mp->remote_integ_key_len, 0);
2563 if (mp->is_add == 0)
2564 s = format (s, "del ");
2570 /* format_nsh_address_vat (u8 * s, va_list * args) */
2572 /* nsh_t *a = va_arg (*args, nsh_t *); */
2573 /* return format (s, "SPI:%d SI:%d", clib_net_to_host_u32 (a->spi), a->si); */
2576 static const char *policy_strs[] = {
2583 static const char *algo_strs[] = {
2599 static const char *integ_strs[] = {
2609 static void *vl_api_ipsec_spd_entry_add_del_t_print
2610 (vl_api_ipsec_spd_entry_add_del_t * mp, void *handle)
2614 vl_api_ipsec_spd_entry_t *ep;
2615 int policy_host_byte_order;
2617 ep = (vl_api_ipsec_spd_entry_t *) & mp->entry;
2619 s = format (0, "SCRIPT: ipsec_spd_entry ");
2620 s = format (s, "is_add %d spd_id %u priority %d is_outbound %d sa_id %u\n",
2622 (ep->spd_id), ntohl (ep->priority), ep->is_outbound,
2625 policy_host_byte_order = (ep->policy);
2627 if (policy_host_byte_order < ARRAY_LEN (policy_strs))
2628 str = policy_strs[policy_host_byte_order];
2632 s = format (s, " policy: %s protocol %d\n", str, ep->protocol);
2634 s = format (s, " remote_address_start %U remote_address_stop %U\n",
2635 format_vl_api_address,
2636 &ep->remote_address_start,
2637 format_vl_api_address, &ep->remote_address_stop);
2639 s = format (s, " local_address_start %U local_address_stop %U\n",
2640 format_vl_api_address,
2641 &ep->local_address_start,
2642 format_vl_api_address, &ep->local_address_stop);
2644 s = format (s, " remote_port_start %d remote_port_stop %d\n",
2645 (ep->remote_port_start), ntohs (ep->remote_port_stop));
2647 s = format (s, " local_port_start %d local_port_stop %d ",
2648 (ep->local_port_start), ntohs (ep->local_port_stop));
2653 static void *vl_api_ipsec_interface_add_del_spd_t_print
2654 (vl_api_ipsec_interface_add_del_spd_t * mp, void *handle)
2658 s = format (0, "SCRIPT: ipsec_interface_add_del_spd ");
2659 s = format (s, "is_add %d sw_if_index %d spd_id %u ",
2660 mp->is_add, (mp->sw_if_index), ntohl (mp->spd_id));
2664 static void *vl_api_ipsec_spd_add_del_t_print
2665 (vl_api_ipsec_spd_add_del_t * mp, void *handle)
2669 s = format (0, "SCRIPT: ipsec_spd_add_del ");
2670 s = format (s, "spd_id %u is_add %d ", (mp->spd_id), mp->is_add);
2674 static void *vl_api_ipsec_sad_entry_add_del_t_print
2675 (vl_api_ipsec_sad_entry_add_del_t * mp, void *handle)
2679 vl_api_ipsec_sad_entry_t *ep;
2680 const char *protocol_str, *algo_str, *integ_str;
2682 protocol_str = "BOGUS protocol!";
2683 algo_str = "BOGUS crypto_algorithm!";
2684 integ_str = "BOGUS integrity_algorithm!";
2686 ep = (vl_api_ipsec_sad_entry_t *) & mp->entry;
2688 s = format (0, "SCRIPT: ipsec_sad_entry_add_del is_add %d ", mp->is_add);
2690 tmp = (ep->protocol);
2691 if (tmp == IPSEC_API_PROTO_ESP)
2692 protocol_str = "ESP";
2693 else if (tmp == IPSEC_API_PROTO_AH)
2694 protocol_str = "AH";
2696 tmp = (ep->crypto_algorithm);
2697 if (tmp < ARRAY_LEN (algo_strs))
2698 algo_str = algo_strs[tmp];
2700 tmp = (ep->integrity_algorithm);
2701 if (tmp < ARRAY_LEN (integ_strs))
2702 integ_str = integ_strs[tmp];
2704 s = format (s, "proto %s crypto alg %s integ alg %s\n",
2705 protocol_str, algo_str, integ_str);
2706 s = format (s, " crypto_key len %d value %U\n",
2707 ep->crypto_key.length, format_hex_bytes, ep->crypto_key.data,
2708 (int) (ep->crypto_key.length));
2709 s = format (s, " integ_key len %d value %U\n",
2710 ep->integrity_key.length, format_hex_bytes,
2711 ep->integrity_key.data, (int) (ep->integrity_key.length));
2712 s = format (s, " flags 0x%x ", (ep->flags));
2714 s = format (s, "tunnel_src %U tunnel_dst %U\n",
2715 format_vl_api_address,
2716 &ep->tunnel_src, format_vl_api_address, &ep->tunnel_dst);
2717 s = format (s, " tx_table_id %u salt %u ",
2718 (ep->tx_table_id), ntohl (ep->salt));
2723 static void *vl_api_l2_interface_pbb_tag_rewrite_t_print
2724 (vl_api_l2_interface_pbb_tag_rewrite_t * mp, void *handle)
2727 u32 vtr_op = (mp->vtr_op);
2729 s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
2731 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2732 s = format (s, "vtr_op %d ", vtr_op);
2733 if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
2735 if (vtr_op == L2_VTR_TRANSLATE_2_2)
2736 s = format (s, "%d ", (mp->outer_tag));
2737 s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
2738 s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
2739 s = format (s, "sid %d ", (mp->i_sid));
2740 s = format (s, "vlanid %d ", (mp->b_vlanid));
2745 static void *vl_api_flow_classify_set_interface_t_print
2746 (vl_api_flow_classify_set_interface_t * mp, void *handle)
2750 s = format (0, "SCRIPT: flow_classify_set_interface ");
2751 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2752 if (mp->ip4_table_index != ~0)
2753 s = format (s, "ip4-table %d ", (mp->ip4_table_index));
2754 if (mp->ip6_table_index != ~0)
2755 s = format (s, "ip6-table %d ", (mp->ip6_table_index));
2756 if (mp->is_add == 0)
2757 s = format (s, "del ");
2763 vl_api_set_punt_t_print (vl_api_set_punt_t * mp, void *handle)
2767 s = format (0, "SCRIPT: punt ");
2769 switch (mp->punt.type)
2771 case PUNT_API_TYPE_L4:
2772 s = format (s, "%U", format_vl_api_address_family, mp->punt.punt.l4.af);
2774 s = format (s, "protocol %d ", mp->punt.punt.l4.protocol);
2776 if (mp->punt.punt.l4.port != (u16) ~ 0)
2777 s = format (s, "port %d ", (mp->punt.punt.l4.port));
2785 s = format (s, "del ");
2790 static void *vl_api_flow_classify_dump_t_print
2791 (vl_api_flow_classify_dump_t * mp, void *handle)
2795 s = format (0, "SCRIPT: flow_classify_dump ");
2798 case FLOW_CLASSIFY_API_TABLE_IP4:
2799 s = format (s, "type ip4 ");
2801 case FLOW_CLASSIFY_API_TABLE_IP6:
2802 s = format (s, "type ip6 ");
2811 static void *vl_api_get_first_msg_id_t_print
2812 (vl_api_get_first_msg_id_t * mp, void *handle)
2816 s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
2821 static void *vl_api_ioam_enable_t_print
2822 (vl_api_ioam_enable_t * mp, void *handle)
2826 s = format (0, "SCRIPT: ioam_enable ");
2828 if (mp->trace_enable)
2829 s = format (s, "trace enabled");
2832 s = format (s, "POT enabled");
2835 s = format (s, "Seqno enabled");
2838 s = format (s, "Analyse enabled");
2843 static void *vl_api_ioam_disable_t_print
2844 (vl_api_ioam_disable_t * mp, void *handle)
2848 s = format (0, "SCRIPT: ioam_disable ");
2849 s = format (s, "trace disabled");
2850 s = format (s, "POT disabled");
2851 s = format (s, "Seqno disabled");
2852 s = format (s, "Analyse disabled");
2857 static void *vl_api_feature_enable_disable_t_print
2858 (vl_api_feature_enable_disable_t * mp, void *handle)
2862 s = format (0, "SCRIPT: feature_enable_disable ");
2863 s = format (s, "arc_name %s ", mp->arc_name);
2864 s = format (s, "feature_name %s ", mp->feature_name);
2865 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2867 s = format (s, "disable");
2872 static void *vl_api_feature_gso_enable_disable_t_print
2873 (vl_api_feature_gso_enable_disable_t * mp, void *handle)
2877 s = format (0, "SCRIPT: feature_gso_enable_disable ");
2878 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2879 if (mp->enable_disable)
2880 s = format (s, "enable");
2881 if (!mp->enable_disable)
2882 s = format (s, "disable");
2887 static void *vl_api_sw_interface_tag_add_del_t_print
2888 (vl_api_sw_interface_tag_add_del_t * mp, void *handle)
2892 s = format (0, "SCRIPT: sw_interface_tag_add_del ");
2893 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2895 s = format (s, "tag %s ", mp->tag);
2897 s = format (s, "del ");
2902 static void *vl_api_hw_interface_set_mtu_t_print
2903 (vl_api_hw_interface_set_mtu_t * mp, void *handle)
2907 s = format (0, "SCRIPT: sw_interface_set_mtu ");
2908 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2909 s = format (s, "tag %d ", (mp->mtu));
2914 static void *vl_api_p2p_ethernet_add_t_print
2915 (vl_api_p2p_ethernet_add_t * mp, void *handle)
2919 s = format (0, "SCRIPT: p2p_ethernet_add ");
2920 s = format (s, "sw_if_index %d ", (mp->parent_if_index));
2921 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
2926 static void *vl_api_p2p_ethernet_del_t_print
2927 (vl_api_p2p_ethernet_del_t * mp, void *handle)
2931 s = format (0, "SCRIPT: p2p_ethernet_del ");
2932 s = format (s, "sw_if_index %d ", (mp->parent_if_index));
2933 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
2938 static void *vl_api_tcp_configure_src_addresses_t_print
2939 (vl_api_tcp_configure_src_addresses_t * mp, void *handle)
2943 s = format (0, "SCRIPT: tcp_configure_src_addresses ");
2944 s = format (s, "%U - %U ",
2945 format_vl_api_address, &mp->first_address,
2946 format_vl_api_address, &mp->last_address);
2949 s = format (s, "vrf %d ", (mp->vrf_id));
2954 static void *vl_api_app_namespace_add_del_t_print
2955 (vl_api_app_namespace_add_del_t * mp, void *handle)
2959 s = format (0, "SCRIPT: app_namespace_add_del ");
2960 s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d "
2962 vl_api_from_api_to_new_c_string (&mp->namespace_id),
2963 mp->secret, (mp->sw_if_index), (mp->ip4_fib_id),
2968 static void *vl_api_session_rule_add_del_t_print
2969 (vl_api_session_rule_add_del_t * mp, void *handle)
2972 fib_prefix_t lcl, rmt;
2973 char *proto = mp->transport_proto == 0 ? "tcp" : "udp";
2974 s = format (0, "SCRIPT: session_rule_add_del ");
2975 mp->tag[sizeof (mp->tag) - 1] = 0;
2976 ip_prefix_decode (&mp->lcl, &lcl);
2977 ip_prefix_decode (&mp->rmt, &rmt);
2979 if (lcl.fp_proto == FIB_PROTOCOL_IP4)
2980 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
2981 mp->appns_index, mp->scope, proto, format_ip4_address,
2982 &lcl.fp_addr.ip4, lcl.fp_len,
2983 format_ip4_address, &rmt.fp_addr.ip4,
2984 rmt.fp_len, mp->action_index, mp->tag);
2986 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
2987 mp->appns_index, mp->scope, proto, format_ip6_address,
2988 &lcl.fp_addr.ip6, lcl.fp_len,
2989 format_ip6_address, &rmt.fp_addr.ip6,
2990 rmt.fp_len, mp->action_index, mp->tag);
2995 static void *vl_api_ip_container_proxy_add_del_t_print
2996 (vl_api_ip_container_proxy_add_del_t * mp, void *handle)
2999 s = format (0, "SCRIPT: ip_container_proxy_add_del ");
3000 s = format (s, "is_add %d prefix %U sw_if_index %d",
3001 mp->is_add, format_vl_api_prefix, mp->sw_if_index);
3006 static void *vl_api_qos_record_enable_disable_t_print
3007 (vl_api_qos_record_enable_disable_t * mp, void *handle)
3011 s = format (0, "SCRIPT: qos_record_enable_disable ");
3012 s = format (s, "sw_if_index %d ", (mp->record.sw_if_index));
3013 s = format (s, "input_source %U ", format_qos_source,
3014 mp->record.input_source);
3017 s = format (s, "disable ");
3022 #define foreach_no_print_function \
3023 _(memclnt_keepalive_reply)
3026 static void * vl_api_ ## f ## _t_print \
3027 (vl_api_ ## f ## _t * mp, void * handle) \
3031 foreach_no_print_function;
3034 #define foreach_custom_print_function \
3035 _(CREATE_LOOPBACK, create_loopback) \
3036 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
3037 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
3038 _(SW_INTERFACE_EVENT, sw_interface_event) \
3039 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
3040 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
3041 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
3042 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
3043 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
3044 _(BOND_CREATE, bond_create) \
3045 _(BOND_CREATE2, bond_create2) \
3046 _(BOND_DELETE, bond_delete) \
3047 _(BOND_ADD_MEMBER, bond_add_member) \
3048 _(BOND_DETACH_MEMBER, bond_detach_member) \
3049 _(SW_INTERFACE_SET_BOND_WEIGHT, sw_interface_set_bond_weight) \
3050 _(SW_MEMBER_INTERFACE_DUMP, sw_member_interface_dump) \
3051 _(SW_BOND_INTERFACE_DUMP, sw_bond_interface_dump) \
3052 _(SW_INTERFACE_RX_PLACEMENT_DUMP, sw_interface_rx_placement_dump) \
3053 _(TAP_CREATE_V2, tap_create_v2) \
3054 _(TAP_DELETE_V2, tap_delete_v2) \
3055 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) \
3056 _(IP_TABLE_ADD_DEL, ip_table_add_del) \
3057 _(MPLS_ROUTE_ADD_DEL, mpls_route_add_del) \
3058 _(MPLS_TABLE_ADD_DEL, mpls_table_add_del) \
3059 _(IP_ROUTE_ADD_DEL, ip_route_add_del) \
3060 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3061 _(SR_MPLS_POLICY_ADD, sr_mpls_policy_add) \
3062 _(SR_MPLS_POLICY_DEL, sr_mpls_policy_del) \
3063 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3064 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3065 _(CREATE_SUBIF, create_subif) \
3066 _(IP_TABLE_REPLACE_BEGIN, ip_table_replace_begin) \
3067 _(IP_TABLE_FLUSH, ip_table_flush) \
3068 _(IP_TABLE_REPLACE_END, ip_table_replace_end) \
3069 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3070 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3071 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3072 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3073 _(SR_POLICY_ADD, sr_policy_add) \
3074 _(SR_POLICY_MOD, sr_policy_mod) \
3075 _(SR_POLICY_DEL, sr_policy_del) \
3076 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3077 _(L2FIB_ADD_DEL, l2fib_add_del) \
3078 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3079 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3080 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3081 _(L2_FLAGS, l2_flags) \
3082 _(BRIDGE_FLAGS, bridge_flags) \
3083 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3084 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3085 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3086 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3087 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3088 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3089 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3090 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3091 _(ADD_NODE_NEXT, add_node_next) \
3092 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3093 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3094 _(VXLAN_OFFLOAD_RX, vxlan_offload_rx) \
3095 _(GRE_TUNNEL_ADD_DEL, gre_tunnel_add_del) \
3096 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3097 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3098 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3099 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3100 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3101 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3102 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3103 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3104 _(CONTROL_PING, control_ping) \
3105 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3107 _(CLI_INBAND, cli_inband) \
3108 _(MEMCLNT_CREATE, memclnt_create) \
3109 _(SOCKCLNT_CREATE, sockclnt_create) \
3110 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3111 _(SHOW_VERSION, show_version) \
3112 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3113 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3114 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3115 _(VXLAN_GBP_TUNNEL_ADD_DEL, vxlan_gbp_tunnel_add_del) \
3116 _(VXLAN_GBP_TUNNEL_DUMP, vxlan_gbp_tunnel_dump) \
3117 _(SW_INTERFACE_SET_VXLAN_GBP_BYPASS, sw_interface_set_vxlan_gbp_bypass) \
3118 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3119 _(WANT_L2_MACS_EVENTS, want_l2_macs_events) \
3120 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3121 _(IP_ADDRESS_DUMP, ip_address_dump) \
3122 _(IP_DUMP, ip_dump) \
3123 _(DELETE_LOOPBACK, delete_loopback) \
3124 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3125 _(BD_IP_MAC_FLUSH, bd_ip_mac_flush) \
3126 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3127 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3128 _(AF_PACKET_CREATE, af_packet_create) \
3129 _(AF_PACKET_DELETE, af_packet_delete) \
3130 _(AF_PACKET_DUMP, af_packet_dump) \
3131 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3132 _(MPLS_TABLE_DUMP, mpls_table_dump) \
3133 _(MPLS_ROUTE_DUMP, mpls_route_dump) \
3134 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3135 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3136 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3137 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3138 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3139 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3140 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3141 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3142 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3143 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3144 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3145 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3146 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3147 _(GET_NEXT_INDEX, get_next_index) \
3148 _(PG_CREATE_INTERFACE,pg_create_interface) \
3149 _(PG_CAPTURE, pg_capture) \
3150 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3151 _(PG_INTERFACE_ENABLE_DISABLE_COALESCE, pg_interface_enable_disable_coalesce) \
3152 _(POLICER_ADD_DEL, policer_add_del) \
3153 _(POLICER_DUMP, policer_dump) \
3154 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3155 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3156 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3157 ip_source_and_port_range_check_add_del) \
3158 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3159 ip_source_and_port_range_check_interface_add_del) \
3160 _(IPSEC_INTERFACE_ADD_DEL_SPD, ipsec_interface_add_del_spd) \
3161 _(IPSEC_SAD_ENTRY_ADD_DEL, ipsec_sad_entry_add_del) \
3162 _(IPSEC_SPD_ADD_DEL, ipsec_spd_add_del) \
3163 _(IPSEC_SPD_ENTRY_ADD_DEL, ipsec_spd_entry_add_del) \
3164 _(IPSEC_TUNNEL_IF_ADD_DEL, ipsec_tunnel_if_add_del) \
3165 _(DELETE_SUBIF, delete_subif) \
3166 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3167 _(SET_PUNT, set_punt) \
3168 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3169 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3170 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3171 _(IOAM_ENABLE, ioam_enable) \
3172 _(IOAM_DISABLE, ioam_disable) \
3173 _(IP_TABLE_DUMP, ip_table_dump) \
3174 _(IP_ROUTE_DUMP, ip_route_dump) \
3175 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3176 _(FEATURE_GSO_ENABLE_DISABLE, feature_gso_enable_disable) \
3177 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3178 _(HW_INTERFACE_SET_MTU, hw_interface_set_mtu) \
3179 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3180 _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
3181 _(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
3182 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
3183 _(SESSION_RULE_ADD_DEL, session_rule_add_del) \
3184 _(OUTPUT_ACL_SET_INTERFACE, output_acl_set_interface) \
3185 _(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable) \
3186 _(MEMCLNT_KEEPALIVE_REPLY, memclnt_keepalive_reply)
3189 vl_msg_api_custom_dump_configure (api_main_t * am)
3191 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3192 = (void *) vl_api_##f##_t_print;
3193 foreach_custom_print_function;
3198 * fd.io coding-style-patch-verification: ON
3201 * eval: (c-set-style "gnu")