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 ");
652 static void *vl_api_virtio_pci_delete_t_print
653 (vl_api_virtio_pci_delete_t * mp, void *handle)
657 s = format (0, "SCRIPT: virtio_pci_delete ");
658 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
664 static void *vl_api_sw_interface_virtio_pci_dump_t_print
665 (vl_api_sw_interface_virtio_pci_dump_t * mp, void *handle)
669 s = format (0, "SCRIPT: sw_interface_virtio_pci_dump ");
674 static void *vl_api_bond_create_t_print
675 (vl_api_bond_create_t * mp, void *handle)
680 clib_memset (null_mac, 0, sizeof (null_mac));
682 s = format (0, "SCRIPT: bond_create ");
683 if (memcmp (mp->mac_address, null_mac, 6))
684 s = format (s, "mac-address %U ",
685 format_ethernet_address, mp->mac_address);
687 s = format (s, "mode %U ", format_bond_mode, ntohl (mp->mode));
689 s = format (s, "lb %U ", format_bond_load_balance, ntohl (mp->lb));
691 s = format (s, "numa-only is set in lacp mode");
693 s = format (s, "id %u ", (mp->id));
697 static void *vl_api_bond_create2_t_print
698 (vl_api_bond_create2_t * mp, void *handle)
703 clib_memset (null_mac, 0, sizeof (null_mac));
705 s = format (0, "SCRIPT: bond_create2 ");
706 if (memcmp (mp->mac_address, null_mac, 6))
707 s = format (s, "mac-address %U ",
708 format_ethernet_address, mp->mac_address);
710 s = format (s, "mode %U ", format_bond_mode, ntohl (mp->mode));
712 s = format (s, "lb %U ", format_bond_load_balance, ntohl (mp->lb));
714 s = format (s, "numa-only ");
716 s = format (s, "gso ");
718 s = format (s, "id %u ", (mp->id));
722 static void *vl_api_bond_delete_t_print
723 (vl_api_bond_delete_t * mp, void *handle)
727 s = format (0, "SCRIPT: bond_delete ");
728 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
733 static void *vl_api_bond_add_member_t_print
734 (vl_api_bond_add_member_t * mp, void *handle)
738 s = format (0, "SCRIPT: bond_add_member ");
739 s = format (s, "bond_sw_if_index %u ", (mp->bond_sw_if_index));
740 s = format (s, "sw_if_index %u ", (mp->sw_if_index));
742 s = format (s, "passive ");
743 if (mp->is_long_timeout)
744 s = format (s, "long-timeout ");
749 static void *vl_api_sw_interface_set_bond_weight_t_print
750 (vl_api_sw_interface_set_bond_weight_t * mp, void *handle)
754 s = format (0, "SCRIPT: sw_interface_set_bond_weight ");
755 s = format (s, "sw_if_index %u ", ntohl (mp->sw_if_index));
756 s = format (s, "weight %u ", ntohl (mp->weight));
761 static void *vl_api_bond_detach_member_t_print
762 (vl_api_bond_detach_member_t * mp, void *handle)
766 s = format (0, "SCRIPT: bond_detach_member ");
767 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
772 static void *vl_api_sw_bond_interface_dump_t_print
773 (vl_api_sw_bond_interface_dump_t * mp, void *handle)
777 s = format (0, "SCRIPT: sw_bond_interface_dump ");
778 if (mp->sw_if_index != ~0)
779 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
784 static void *vl_api_sw_member_interface_dump_t_print
785 (vl_api_sw_member_interface_dump_t * mp, void *handle)
789 s = format (0, "SCRIPT: sw_member_interface_dump ");
790 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
795 static void *vl_api_ip_route_add_del_t_print
796 (vl_api_ip_route_add_del_t * mp, void *handle)
800 s = format (0, "SCRIPT: ip_route_add_del ");
802 s = format (s, "del ");
804 s = format (s, "%U", format_vl_api_prefix, &mp->route.prefix);
806 for (p = 0; p < mp->route.n_paths; p++)
807 s = format (s, " [%U]", format_vl_api_fib_path, &mp->route.paths[p]);
812 static void *vl_api_mpls_route_add_del_t_print
813 (vl_api_mpls_route_add_del_t * mp, void *handle)
817 s = format (0, "SCRIPT: mpls_route_add_del ");
820 s = format (s, "add ");
822 s = format (s, "del ");
824 s = format (s, "table %d ", (mp->mr_route.mr_table_id));
825 s = format (s, "%d ", (mp->mr_route.mr_label));
827 if (mp->mr_route.mr_eos)
828 s = format (s, "eos ");
830 s = format (s, "non-eos ");
832 if (mp->mr_route.mr_is_multicast)
833 s = format (s, "multicast ");
835 for (p = 0; p < mp->mr_route.mr_n_paths; p++)
837 format (s, " [%U]", format_vl_api_fib_path, &mp->mr_route.mr_paths[p]);
843 static void *vl_api_ip_table_add_del_t_print
844 (vl_api_ip_table_add_del_t * mp, void *handle)
848 s = format (0, "SCRIPT: ip_table_add_del ");
850 s = format (s, "add ");
852 s = format (s, "del ");
853 if (mp->table.is_ip6)
854 s = format (s, "ip6 ");
855 s = format (s, "table %d ", (mp->table.table_id));
856 s = format (s, "%s ", mp->table.name);
861 static void *vl_api_mpls_table_add_del_t_print
862 (vl_api_mpls_table_add_del_t * mp, void *handle)
866 s = format (0, "SCRIPT: mpls_table_add_del ");
868 s = format (s, "add ");
870 s = format (s, "del ");
871 s = format (s, "table %d ", (mp->mt_table.mt_table_id));
876 static void *vl_api_mpls_tunnel_add_del_t_print
877 (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
881 s = format (0, "SCRIPT: mpls_tunnel_add_del ");
883 if (mp->mt_is_add == 0)
884 s = format (s, "del sw_if_index %d ", (mp->mt_tunnel.mt_sw_if_index));
886 s = format (s, "sw_if_index %d ", (mp->mt_tunnel.mt_sw_if_index));
889 if (mp->mt_tunnel.mt_l2_only)
890 s = format (s, "l2-only ");
891 if (mp->mt_tunnel.mt_is_multicast)
892 s = format (s, "multicast ");
893 if (mp->mt_tunnel.mt_tunnel_index)
894 s = format (s, "tunnel-index ");
896 for (p = 0; p < mp->mt_tunnel.mt_n_paths; p++)
897 s = format (s, " [%U]", format_vl_api_fib_path,
898 &mp->mt_tunnel.mt_paths[p]);
903 static void *vl_api_sr_mpls_policy_add_t_print
904 (vl_api_sr_mpls_policy_add_t * mp, void *handle)
908 s = format (0, "SCRIPT: sr_mpls_policy_add ");
910 s = format (s, "bsid %d ", (mp->bsid));
912 if (mp->weight != htonl ((u32) 1))
913 s = format (s, "%d ", (mp->weight));
916 s = format (s, "spray ");
921 for (i = 0; i < mp->n_segments; i++)
922 s = format (s, "next %d ", (mp->segments[i]));
928 static void *vl_api_sr_mpls_policy_del_t_print
929 (vl_api_sr_mpls_policy_del_t * mp, void *handle)
933 s = format (0, "SCRIPT: sr_mpls_policy_del ");
935 s = format (s, "bsid %d ", (mp->bsid));
940 static void *vl_api_sw_interface_set_unnumbered_t_print
941 (vl_api_sw_interface_set_unnumbered_t * mp, void *handle)
945 s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
947 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
949 s = format (s, "unnum_if_index %d ", (mp->unnumbered_sw_if_index));
952 s = format (s, "del ");
957 static void *vl_api_create_vlan_subif_t_print
958 (vl_api_create_vlan_subif_t * mp, void *handle)
962 s = format (0, "SCRIPT: create_vlan_subif ");
965 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
968 s = format (s, "vlan_id %d ", (mp->vlan_id));
973 #define foreach_create_subif_flag \
978 _(4, "exact_match") \
979 _(5, "default_sub") \
980 _(6, "outer_vlan_id_any") \
981 _(7, "inner_vlan_id_any")
983 static void *vl_api_create_subif_t_print
984 (vl_api_create_subif_t * mp, void *handle)
988 s = format (0, "SCRIPT: create_subif ");
990 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
992 s = format (s, "sub_id %d ", (mp->sub_id));
994 if (mp->outer_vlan_id)
995 s = format (s, "outer_vlan_id %d ", (mp->outer_vlan_id));
997 if (mp->inner_vlan_id)
998 s = format (s, "inner_vlan_id %d ", (mp->inner_vlan_id));
1000 #define _(a,b) if (mp->sub_if_flags & (1 << a)) s = format (s, "%s ", b);
1001 foreach_create_subif_flag;
1007 static void *vl_api_delete_subif_t_print
1008 (vl_api_delete_subif_t * mp, void *handle)
1012 s = format (0, "SCRIPT: delete_subif ");
1013 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1019 vl_api_ip_table_replace_begin_t_print (vl_api_ip_table_replace_begin_t * mp,
1024 s = format (0, "SCRIPT: ip_table_replace_begin ");
1026 s = format (s, "v%s-table %d ",
1027 mp->table.is_ip6 ? "6" : "4", (mp->table.table_id));
1033 vl_api_ip_table_flush_t_print (vl_api_ip_table_flush_t * mp, void *handle)
1037 s = format (0, "SCRIPT: ip_table_flush ");
1039 s = format (s, "v%s-table %d ",
1040 mp->table.is_ip6 ? "6" : "4", (mp->table.table_id));
1046 vl_api_ip_table_replace_end_t_print (vl_api_ip_table_replace_end_t * mp,
1051 s = format (0, "SCRIPT: ip_table_replace_end ");
1053 s = format (s, "v%s-table %d ",
1054 mp->table.is_ip6 ? "6" : "4", (mp->table.table_id));
1059 static void *vl_api_set_ip_flow_hash_t_print
1060 (vl_api_set_ip_flow_hash_t * mp, void *handle)
1064 s = format (0, "SCRIPT: set_ip_flow_hash ");
1066 s = format (s, "vrf_id %d ", (mp->vrf_id));
1069 s = format (s, "src ");
1072 s = format (s, "dst ");
1075 s = format (s, "sport ");
1078 s = format (s, "dport ");
1081 s = format (s, "proto ");
1084 s = format (s, "reverse ");
1086 if (mp->is_ipv6 != 0)
1087 s = format (s, "ipv6 ");
1093 static void *vl_api_l2_patch_add_del_t_print
1094 (vl_api_l2_patch_add_del_t * mp, void *handle)
1098 s = format (0, "SCRIPT: l2_patch_add_del ");
1100 s = format (s, "rx_sw_if_index %d ", (mp->rx_sw_if_index));
1102 s = format (s, "tx_sw_if_index %d ", (mp->tx_sw_if_index));
1104 if (mp->is_add == 0)
1105 s = format (s, "del ");
1110 static void *vl_api_sr_localsid_add_del_t_print
1111 (vl_api_sr_localsid_add_del_t * mp, void *handle)
1113 vnet_main_t *vnm = vnet_get_main ();
1116 s = format (0, "SCRIPT: sr_localsid_add_del ");
1118 switch (mp->behavior)
1120 case SR_BEHAVIOR_END:
1121 s = format (s, "Address: %U\nBehavior: End",
1122 format_ip6_address, (ip6_address_t *) mp->localsid);
1123 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1128 "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1129 "\nIface: %U\nNext hop: %U", format_ip6_address,
1130 (ip6_address_t *) mp->localsid,
1131 format_vnet_sw_if_index_name, vnm, (mp->sw_if_index),
1132 format_ip6_address, (ip6_address_t *) mp->nh_addr.un.ip6);
1133 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1135 case SR_BEHAVIOR_DX4:
1138 "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1139 "\nIface: %U\nNext hop: %U", format_ip6_address,
1140 (ip6_address_t *) mp->localsid,
1141 format_vnet_sw_if_index_name, vnm, (mp->sw_if_index),
1142 format_ip4_address, (ip4_address_t *) mp->nh_addr.un.ip4);
1144 case SR_BEHAVIOR_DX6:
1147 "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1148 "\nIface: %UNext hop: %U", format_ip6_address,
1149 (ip6_address_t *) mp->localsid,
1150 format_vnet_sw_if_index_name, vnm, (mp->sw_if_index),
1151 format_ip6_address, (ip6_address_t *) mp->nh_addr.un.ip6);
1153 case SR_BEHAVIOR_DX2:
1156 "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1157 "\nIface: %U", format_ip6_address,
1158 (ip6_address_t *) mp->localsid,
1159 format_vnet_sw_if_index_name, vnm, (mp->sw_if_index));
1161 case SR_BEHAVIOR_DT6:
1164 "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1165 "\nTable: %u", format_ip6_address,
1166 (ip6_address_t *) mp->localsid, (mp->fib_table));
1168 case SR_BEHAVIOR_DT4:
1171 "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1172 "\nTable: %u", format_ip6_address,
1173 (ip6_address_t *) mp->localsid, (mp->fib_table));
1176 if (mp->behavior >= SR_BEHAVIOR_LAST)
1178 s = format (s, "Address: %U\n Behavior: %u",
1179 format_ip6_address, (ip6_address_t *) mp->localsid,
1183 //Should never get here...
1184 s = format (s, "Internal error");
1190 static void *vl_api_sr_steering_add_del_t_print
1191 (vl_api_sr_steering_add_del_t * mp, void *handle)
1195 s = format (0, "SCRIPT: sr_steering_add_del ");
1197 s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1199 switch (mp->traffic_type)
1202 s = format (s, "Traffic type: L2 iface: %u", (mp->sw_if_index));
1205 s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1206 (ip4_address_t *) mp->prefix.address.un.ip4,
1210 s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1211 (ip6_address_t *) mp->prefix.address.un.ip6,
1215 s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1218 s = format (s, "BindingSID: %U", format_ip6_address,
1219 (ip6_address_t *) mp->bsid_addr);
1221 s = format (s, "SR Policy Index: %u", (mp->sr_policy_index));
1223 s = format (s, "FIB_table: %u", (mp->table_id));
1228 static void *vl_api_sr_policy_add_t_print
1229 (vl_api_sr_policy_add_t * mp, void *handle)
1233 ip6_address_t *segments = 0, *seg;
1234 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1237 for (i = 0; i < mp->sids.num_sids; i++)
1239 vec_add2 (segments, seg, 1);
1240 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1244 s = format (0, "SCRIPT: sr_policy_add ");
1246 s = format (s, "BSID: %U", format_ip6_address,
1247 (ip6_address_t *) mp->bsid_addr);
1251 (mp->is_encap ? "Behavior: Encapsulation" :
1252 "Behavior: SRH insertion"));
1254 s = format (s, "FIB_table: %u", (mp->fib_table));
1256 s = format (s, (mp->is_spray ? "Type: Default" : "Type: Spray"));
1258 s = format (s, "SID list weight: %u", (mp->weight));
1260 s = format (s, "{");
1261 vec_foreach (seg, segments)
1263 s = format (s, "%U, ", format_ip6_address, seg);
1265 s = format (s, "\b\b } ");
1270 static void *vl_api_sr_policy_mod_t_print
1271 (vl_api_sr_policy_mod_t * mp, void *handle)
1275 ip6_address_t *segments = 0, *seg;
1276 ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1279 for (i = 0; i < mp->sids.num_sids; i++)
1281 vec_add2 (segments, seg, 1);
1282 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1286 s = format (0, "SCRIPT: sr_policy_mod ");
1288 s = format (s, "BSID: %U", format_ip6_address,
1289 (ip6_address_t *) mp->bsid_addr);
1291 s = format (s, "SR Policy index: %u", (mp->sr_policy_index));
1293 s = format (s, "Operation: %u", mp->operation);
1295 s = format (s, "SID list index: %u", (mp->sl_index));
1297 s = format (s, "SID list weight: %u", (mp->weight));
1299 s = format (s, "{");
1300 vec_foreach (seg, segments)
1302 s = format (s, "%U, ", format_ip6_address, seg);
1304 s = format (s, "\b\b } ");
1309 static void *vl_api_sr_policy_del_t_print
1310 (vl_api_sr_policy_del_t * mp, void *handle)
1314 s = format (0, "SCRIPT: sr_policy_del ");
1315 s = format (s, "To be delivered. Good luck.");
1319 static void *vl_api_classify_add_del_table_t_print
1320 (vl_api_classify_add_del_table_t * mp, void *handle)
1325 s = format (0, "SCRIPT: classify_add_del_table ");
1327 if (mp->is_add == 0)
1329 s = format (s, "table %d ", (mp->table_index));
1330 s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1334 s = format (s, "nbuckets %d ", (mp->nbuckets));
1335 s = format (s, "memory_size %d ", (mp->memory_size));
1336 s = format (s, "skip %d ", (mp->skip_n_vectors));
1337 s = format (s, "match %d ", (mp->match_n_vectors));
1338 s = format (s, "next-table %d ", (mp->next_table_index));
1339 s = format (s, "miss-next %d ", (mp->miss_next_index));
1340 s = format (s, "current-data-flag %d ", (mp->current_data_flag));
1341 if (mp->current_data_flag)
1342 s = format (s, "current-data-offset %d ", (mp->current_data_offset));
1343 s = format (s, "mask hex ");
1344 for (i = 0; i < (mp->match_n_vectors) * sizeof (u32x4); i++)
1345 s = format (s, "%02x", mp->mask[i]);
1352 static void *vl_api_classify_add_del_session_t_print
1353 (vl_api_classify_add_del_session_t * mp, void *handle)
1358 s = format (0, "SCRIPT: classify_add_del_session ");
1360 s = format (s, "table_index %d ", (mp->table_index));
1361 s = format (s, "hit_next_index %d ", (mp->hit_next_index));
1362 s = format (s, "opaque_index %d ", (mp->opaque_index));
1363 s = format (s, "advance %d ", (mp->advance));
1364 s = format (s, "action %d ", mp->action);
1366 s = format (s, "metadata %d ", (mp->metadata));
1367 if (mp->is_add == 0)
1368 s = format (s, "del ");
1370 s = format (s, "match hex ");
1371 for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1373 if (mp->match[i] != 0)
1380 for (i = 0; i < limit; i++)
1381 s = format (s, "%02x", mp->match[i]);
1386 static void *vl_api_classify_set_interface_ip_table_t_print
1387 (vl_api_classify_set_interface_ip_table_t * mp, void *handle)
1391 s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1394 s = format (s, "ipv6 ");
1396 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1397 s = format (s, "table %d ", (mp->table_index));
1402 static void *vl_api_classify_set_interface_l2_tables_t_print
1403 (vl_api_classify_set_interface_l2_tables_t * mp, void *handle)
1407 s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1409 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1410 s = format (s, "ip4-table %d ", (mp->ip4_table_index));
1411 s = format (s, "ip6-table %d ", (mp->ip6_table_index));
1412 s = format (s, "other-table %d ", (mp->other_table_index));
1413 s = format (s, "is-input %d ", mp->is_input);
1418 static void *vl_api_add_node_next_t_print
1419 (vl_api_add_node_next_t * mp, void *handle)
1423 s = format (0, "SCRIPT: add_node_next ");
1425 s = format (s, "node %s next %s ", mp->node_name, mp->next_name);
1430 static void *vl_api_vxlan_add_del_tunnel_t_print
1431 (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1434 s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1436 ip46_address_t src =
1437 to_ip46 (mp->src_address.af, (u8 *) & mp->src_address.un);
1438 ip46_address_t dst =
1439 to_ip46 (mp->dst_address.af, (u8 *) & mp->dst_address.un);
1441 u8 is_grp = ip46_address_is_multicast (&dst);
1442 char *dst_name = is_grp ? "group" : "dst";
1444 s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1445 s = format (s, "%s %U ", dst_name, format_ip46_address,
1446 &dst, IP46_TYPE_ANY);
1449 s = format (s, "mcast_sw_if_index %d ", (mp->mcast_sw_if_index));
1451 if (mp->encap_vrf_id)
1452 s = format (s, "encap-vrf-id %d ", (mp->encap_vrf_id));
1454 s = format (s, "decap-next %d ", (mp->decap_next_index));
1456 s = format (s, "vni %d ", (mp->vni));
1458 s = format (s, "instance %d ", (mp->instance));
1460 if (mp->is_add == 0)
1461 s = format (s, "del ");
1466 static void *vl_api_vxlan_offload_rx_t_print
1467 (vl_api_vxlan_offload_rx_t * mp, void *handle)
1470 s = format (0, "SCRIPT: vxlan_offload_rx ");
1472 s = format (s, "hw hw_if_index %d ", (mp->hw_if_index));
1473 s = format (s, "rx sw_if_index %d ", (mp->sw_if_index));
1475 s = format (s, "del ");
1480 static void *vl_api_vxlan_tunnel_dump_t_print
1481 (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1485 s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1487 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1492 static void *vl_api_vxlan_gbp_tunnel_add_del_t_print
1493 (vl_api_vxlan_gbp_tunnel_add_del_t * mp, void *handle)
1496 s = format (0, "SCRIPT: vxlan_gbp_tunnel_add_del ");
1499 s = format (s, "add ");
1501 s = format (s, "del ");
1503 s = format (s, "instance %d ", (mp->tunnel.instance));
1504 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1505 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1506 s = format (s, "mcast_sw_if_index %d ", (mp->tunnel.mcast_sw_if_index));
1507 s = format (s, "encap_table_id %d ", (mp->tunnel.encap_table_id));
1508 s = format (s, "vni %d ", (mp->tunnel.vni));
1509 s = format (s, "sw_if_index %d ", (mp->tunnel.sw_if_index));
1514 static void *vl_api_vxlan_gbp_tunnel_dump_t_print
1515 (vl_api_vxlan_gbp_tunnel_dump_t * mp, void *handle)
1519 s = format (0, "SCRIPT: vxlan_gbp_tunnel_dump ");
1521 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1526 static void *vl_api_sw_interface_set_vxlan_gbp_bypass_t_print
1527 (vl_api_sw_interface_set_vxlan_gbp_bypass_t * mp, void *handle)
1531 s = format (0, "SCRIPT: sw_interface_set_vxlan_gbp_bypass ");
1533 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1534 s = format (s, "%s ", (mp->is_ipv6 != 0) ? "ipv6" : "ipv4");
1535 s = format (s, "%s ", (mp->enable != 0) ? "enable" : "disable");
1540 static void *vl_api_gre_tunnel_add_del_t_print
1541 (vl_api_gre_tunnel_add_del_t * mp, void *handle)
1545 s = format (0, "SCRIPT: gre_tunnel_add_del ");
1547 s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1548 s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1550 s = format (s, "instance %d ", (mp->tunnel.instance));
1552 if (mp->tunnel.type == GRE_API_TUNNEL_TYPE_TEB)
1553 s = format (s, "teb ");
1555 if (mp->tunnel.type == GRE_API_TUNNEL_TYPE_ERSPAN)
1556 s = format (s, "erspan %d ", (mp->tunnel.session_id));
1558 if (mp->tunnel.outer_table_id)
1559 s = format (s, "outer-table-id %d ", mp->tunnel.outer_table_id);
1561 if (mp->is_add == 0)
1562 s = format (s, "del ");
1567 static void *vl_api_gre_tunnel_dump_t_print
1568 (vl_api_gre_tunnel_dump_t * mp, void *handle)
1572 s = format (0, "SCRIPT: gre_tunnel_dump ");
1574 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1579 static void *vl_api_l2_fib_clear_table_t_print
1580 (vl_api_l2_fib_clear_table_t * mp, void *handle)
1584 s = format (0, "SCRIPT: l2_fib_clear_table ");
1589 static void *vl_api_l2_interface_efp_filter_t_print
1590 (vl_api_l2_interface_efp_filter_t * mp, void *handle)
1594 s = format (0, "SCRIPT: l2_interface_efp_filter ");
1596 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1597 if (mp->enable_disable)
1598 s = format (s, "enable ");
1600 s = format (s, "disable ");
1605 static void *vl_api_l2_interface_vlan_tag_rewrite_t_print
1606 (vl_api_l2_interface_vlan_tag_rewrite_t * mp, void *handle)
1610 s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
1612 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1613 s = format (s, "vtr_op %d ", (mp->vtr_op));
1614 s = format (s, "push_dot1q %d ", (mp->push_dot1q));
1615 s = format (s, "tag1 %d ", (mp->tag1));
1616 s = format (s, "tag2 %d ", (mp->tag2));
1621 static void *vl_api_create_vhost_user_if_t_print
1622 (vl_api_create_vhost_user_if_t * mp, void *handle)
1626 s = format (0, "SCRIPT: create_vhost_user_if ");
1628 s = format (s, "socket %s ", mp->sock_filename);
1630 s = format (s, "server ");
1632 s = format (s, "renumber %d ", (mp->custom_dev_instance));
1633 if (mp->disable_mrg_rxbuf)
1634 s = format (s, "disable_mrg_rxbuf ");
1635 if (mp->disable_indirect_desc)
1636 s = format (s, "disable_indirect_desc ");
1638 s = format (s, "tag %s ", mp->tag);
1640 s = format (s, "gso ");
1641 if (mp->enable_packed)
1642 s = format (s, "packed");
1647 static void *vl_api_modify_vhost_user_if_t_print
1648 (vl_api_modify_vhost_user_if_t * mp, void *handle)
1652 s = format (0, "SCRIPT: modify_vhost_user_if ");
1654 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1655 s = format (s, "socket %s ", mp->sock_filename);
1657 s = format (s, "server ");
1659 s = format (s, "renumber %d ", (mp->custom_dev_instance));
1661 s = format (s, "gso ");
1662 if (mp->enable_packed)
1663 s = format (s, "packed");
1668 static void *vl_api_delete_vhost_user_if_t_print
1669 (vl_api_delete_vhost_user_if_t * mp, void *handle)
1673 s = format (0, "SCRIPT: delete_vhost_user_if ");
1674 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1679 static void *vl_api_sw_interface_vhost_user_dump_t_print
1680 (vl_api_sw_interface_vhost_user_dump_t * mp, void *handle)
1684 s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
1685 if (mp->sw_if_index != ~0)
1686 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1691 static void *vl_api_sw_interface_dump_t_print
1692 (vl_api_sw_interface_dump_t * mp, void *handle)
1696 s = format (0, "SCRIPT: sw_interface_dump ");
1698 if (mp->name_filter_valid)
1700 u8 *v = vl_api_from_api_to_new_vec (mp, &mp->name_filter);
1701 s = format (s, "name_filter %v ", v);
1705 s = format (s, "all ");
1710 static void *vl_api_l2_fib_table_dump_t_print
1711 (vl_api_l2_fib_table_dump_t * mp, void *handle)
1715 s = format (0, "SCRIPT: l2_fib_table_dump ");
1717 s = format (s, "bd_id %d ", (mp->bd_id));
1722 static void *vl_api_control_ping_t_print
1723 (vl_api_control_ping_t * mp, void *handle)
1727 s = format (0, "SCRIPT: control_ping ");
1732 static void *vl_api_want_interface_events_t_print
1733 (vl_api_want_interface_events_t * mp, void *handle)
1737 s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
1738 (mp->pid), ntohl (mp->enable_disable));
1744 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
1748 s = format (0, "SCRIPT: cli ");
1753 static void *vl_api_cli_inband_t_print
1754 (vl_api_cli_inband_t * mp, void *handle)
1759 cmd = vl_api_from_api_to_new_vec (mp, &mp->cmd);
1761 s = format (0, "SCRIPT: exec %v ", cmd);
1767 static void *vl_api_memclnt_create_t_print
1768 (vl_api_memclnt_create_t * mp, void *handle)
1772 s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
1777 static void *vl_api_sockclnt_create_t_print
1778 (vl_api_sockclnt_create_t * mp, void *handle)
1782 s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name);
1787 static void *vl_api_show_version_t_print
1788 (vl_api_show_version_t * mp, void *handle)
1792 s = format (0, "SCRIPT: show_version ");
1798 static void *vl_api_show_threads_t_print
1799 (vl_api_show_threads_t * mp, void *handle)
1803 s = format (0, "SCRIPT: show_threads ");
1808 static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
1809 (vl_api_vxlan_gpe_add_del_tunnel_t * mp, void *handle)
1813 s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
1815 ip46_address_t local, remote;
1817 ip_address_decode (&mp->local, &local);
1818 ip_address_decode (&mp->remote, &remote);
1820 u8 is_grp = ip46_address_is_multicast (&remote);
1821 char *remote_name = is_grp ? "group" : "remote";
1823 s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1824 s = format (s, "%s %U ", remote_name, format_ip46_address,
1825 &remote, IP46_TYPE_ANY);
1828 s = format (s, "mcast_sw_if_index %d ", (mp->mcast_sw_if_index));
1829 s = format (s, "protocol %d ", (mp->protocol));
1831 s = format (s, "vni %d ", (mp->vni));
1833 if (mp->is_add == 0)
1834 s = format (s, "del ");
1836 if (mp->encap_vrf_id)
1837 s = format (s, "encap-vrf-id %d ", (mp->encap_vrf_id));
1839 if (mp->decap_vrf_id)
1840 s = format (s, "decap-vrf-id %d ", (mp->decap_vrf_id));
1845 static void *vl_api_vxlan_gpe_tunnel_dump_t_print
1846 (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
1850 s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
1852 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1857 static void *vl_api_interface_name_renumber_t_print
1858 (vl_api_interface_name_renumber_t * mp, void *handle)
1862 s = format (0, "SCRIPT: interface_renumber ");
1864 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1866 s = format (s, "new_show_dev_instance %d ", (mp->new_show_dev_instance));
1871 static void *vl_api_want_l2_macs_events_t_print
1872 (vl_api_want_l2_macs_events_t * mp, void *handle)
1876 s = format (0, "SCRIPT: want_l2_macs_events ");
1877 s = format (s, "learn-limit %d ", (mp->learn_limit));
1878 s = format (s, "scan-delay %d ", (u32) mp->scan_delay);
1879 s = format (s, "max-entries %d ", (u32) mp->max_macs_in_event * 10);
1880 if (mp->enable_disable == 0)
1881 s = format (s, "disable");
1886 static void *vl_api_input_acl_set_interface_t_print
1887 (vl_api_input_acl_set_interface_t * mp, void *handle)
1891 s = format (0, "SCRIPT: input_acl_set_interface ");
1893 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1894 s = format (s, "ip4-table %d ", (mp->ip4_table_index));
1895 s = format (s, "ip6-table %d ", (mp->ip6_table_index));
1896 s = format (s, "l2-table %d ", (mp->l2_table_index));
1898 if (mp->is_add == 0)
1899 s = format (s, "del ");
1904 static void *vl_api_output_acl_set_interface_t_print
1905 (vl_api_output_acl_set_interface_t * mp, void *handle)
1909 s = format (0, "SCRIPT: output_acl_set_interface ");
1911 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1912 s = format (s, "ip4-table %d ", (mp->ip4_table_index));
1913 s = format (s, "ip6-table %d ", (mp->ip6_table_index));
1914 s = format (s, "l2-table %d ", (mp->l2_table_index));
1916 if (mp->is_add == 0)
1917 s = format (s, "del ");
1922 static void *vl_api_ip_address_dump_t_print
1923 (vl_api_ip_address_dump_t * mp, void *handle)
1927 s = format (0, "SCRIPT: ip6_address_dump ");
1928 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1929 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1935 vl_api_ip_dump_t_print (vl_api_ip_dump_t * mp, void *handle)
1939 s = format (0, "SCRIPT: ip_dump ");
1940 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1945 static void *vl_api_cop_interface_enable_disable_t_print
1946 (vl_api_cop_interface_enable_disable_t * mp, void *handle)
1950 s = format (0, "SCRIPT: cop_interface_enable_disable ");
1951 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1952 if (mp->enable_disable)
1953 s = format (s, "enable ");
1955 s = format (s, "disable ");
1960 static void *vl_api_cop_whitelist_enable_disable_t_print
1961 (vl_api_cop_whitelist_enable_disable_t * mp, void *handle)
1965 s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
1966 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
1967 s = format (s, "fib-id %d ", (mp->fib_id));
1969 s = format (s, "ip4 ");
1971 s = format (s, "ip6 ");
1972 if (mp->default_cop)
1973 s = format (s, "default ");
1978 static void *vl_api_af_packet_create_t_print
1979 (vl_api_af_packet_create_t * mp, void *handle)
1983 s = format (0, "SCRIPT: af_packet_create ");
1984 s = format (s, "host_if_name %s ", mp->host_if_name);
1985 if (mp->use_random_hw_addr)
1986 s = format (s, "hw_addr random ");
1988 s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
1993 static void *vl_api_af_packet_delete_t_print
1994 (vl_api_af_packet_delete_t * mp, void *handle)
1998 s = format (0, "SCRIPT: af_packet_delete ");
1999 s = format (s, "host_if_name %s ", mp->host_if_name);
2004 static void *vl_api_af_packet_dump_t_print
2005 (vl_api_af_packet_dump_t * mp, void *handle)
2009 s = format (0, "SCRIPT: af_packet_dump ");
2015 format_policer_action (u8 * s, va_list * va)
2017 u32 action = va_arg (*va, u32);
2018 u32 dscp = va_arg (*va, u32);
2021 if (action == SSE2_QOS_ACTION_DROP)
2022 s = format (s, "drop");
2023 else if (action == SSE2_QOS_ACTION_TRANSMIT)
2024 s = format (s, "transmit");
2025 else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
2027 s = format (s, "mark-and-transmit ");
2030 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
2036 s = format (s, "%s", t);
2041 static void *vl_api_policer_add_del_t_print
2042 (vl_api_policer_add_del_t * mp, void *handle)
2046 s = format (0, "SCRIPT: policer_add_del ");
2047 s = format (s, "name %s ", mp->name);
2048 s = format (s, "cir %d ", mp->cir);
2049 s = format (s, "eir %d ", mp->eir);
2050 s = format (s, "cb %d ", mp->cb);
2051 s = format (s, "eb %d ", mp->eb);
2053 switch (mp->rate_type)
2055 case SSE2_QOS_RATE_KBPS:
2056 s = format (s, "rate_type kbps ");
2058 case SSE2_QOS_RATE_PPS:
2059 s = format (s, "rate_type pps ");
2065 switch (mp->round_type)
2067 case SSE2_QOS_ROUND_TO_CLOSEST:
2068 s = format (s, "round_type closest ");
2070 case SSE2_QOS_ROUND_TO_UP:
2071 s = format (s, "round_type up ");
2073 case SSE2_QOS_ROUND_TO_DOWN:
2074 s = format (s, "round_type down ");
2082 case SSE2_QOS_POLICER_TYPE_1R2C:
2083 s = format (s, "type 1r2c ");
2085 case SSE2_QOS_POLICER_TYPE_1R3C_RFC_2697:
2086 s = format (s, "type 1r3c ");
2088 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_2698:
2089 s = format (s, "type 2r3c-2698 ");
2091 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_4115:
2092 s = format (s, "type 2r3c-4115 ");
2094 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1:
2095 s = format (s, "type 2r3c-mef5cf1 ");
2101 s = format (s, "conform_action %U ", format_policer_action,
2102 mp->conform_action.type, mp->conform_action.dscp);
2103 s = format (s, "exceed_action %U ", format_policer_action,
2104 mp->exceed_action.type, mp->exceed_action.dscp);
2105 s = format (s, "violate_action %U ", format_policer_action,
2106 mp->violate_action.type, mp->violate_action.dscp);
2108 if (mp->color_aware)
2109 s = format (s, "color-aware ");
2110 if (mp->is_add == 0)
2111 s = format (s, "del ");
2116 static void *vl_api_policer_dump_t_print
2117 (vl_api_policer_dump_t * mp, void *handle)
2121 s = format (0, "SCRIPT: policer_dump ");
2122 if (mp->match_name_valid)
2123 s = format (s, "name %s ", mp->match_name);
2128 static void *vl_api_policer_classify_set_interface_t_print
2129 (vl_api_policer_classify_set_interface_t * mp, void *handle)
2133 s = format (0, "SCRIPT: policer_classify_set_interface ");
2134 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2135 if (mp->ip4_table_index != ~0)
2136 s = format (s, "ip4-table %d ", (mp->ip4_table_index));
2137 if (mp->ip6_table_index != ~0)
2138 s = format (s, "ip6-table %d ", (mp->ip6_table_index));
2139 if (mp->l2_table_index != ~0)
2140 s = format (s, "l2-table %d ", (mp->l2_table_index));
2141 if (mp->is_add == 0)
2142 s = format (s, "del ");
2147 static void *vl_api_policer_classify_dump_t_print
2148 (vl_api_policer_classify_dump_t * mp, void *handle)
2152 s = format (0, "SCRIPT: policer_classify_dump ");
2155 case POLICER_CLASSIFY_API_TABLE_IP4:
2156 s = format (s, "type ip4 ");
2158 case POLICER_CLASSIFY_API_TABLE_IP6:
2159 s = format (s, "type ip6 ");
2161 case POLICER_CLASSIFY_API_TABLE_L2:
2162 s = format (s, "type l2 ");
2171 static void *vl_api_sw_interface_clear_stats_t_print
2172 (vl_api_sw_interface_clear_stats_t * mp, void *handle)
2176 s = format (0, "SCRIPT: sw_interface_clear_stats ");
2177 if (mp->sw_if_index != ~0)
2178 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2183 static void *vl_api_mpls_tunnel_dump_t_print
2184 (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2188 s = format (0, "SCRIPT: mpls_tunnel_dump ");
2189 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2194 static void *vl_api_mpls_table_dump_t_print
2195 (vl_api_mpls_table_dump_t * mp, void *handle)
2199 s = format (0, "SCRIPT: mpls_table_decap_dump ");
2204 static void *vl_api_mpls_route_dump_t_print
2205 (vl_api_mpls_route_dump_t * mp, void *handle)
2209 s = format (0, "SCRIPT: mpls_route_decap_dump ");
2214 static void *vl_api_ip_table_dump_t_print
2215 (vl_api_ip_table_dump_t * mp, void *handle)
2219 s = format (0, "SCRIPT: ip_table_dump ");
2224 static void *vl_api_ip_route_dump_t_print
2225 (vl_api_ip_route_dump_t * mp, void *handle)
2229 s = format (0, "SCRIPT: ip_route_dump ");
2234 static void *vl_api_classify_table_ids_t_print
2235 (vl_api_classify_table_ids_t * mp, void *handle)
2239 s = format (0, "SCRIPT: classify_table_ids ");
2244 static void *vl_api_classify_table_by_interface_t_print
2245 (vl_api_classify_table_by_interface_t * mp, void *handle)
2249 s = format (0, "SCRIPT: classify_table_by_interface ");
2250 if (mp->sw_if_index != ~0)
2251 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2256 static void *vl_api_classify_table_info_t_print
2257 (vl_api_classify_table_info_t * mp, void *handle)
2261 s = format (0, "SCRIPT: classify_table_info ");
2262 if (mp->table_id != ~0)
2263 s = format (s, "table_id %d ", (mp->table_id));
2268 static void *vl_api_classify_session_dump_t_print
2269 (vl_api_classify_session_dump_t * mp, void *handle)
2273 s = format (0, "SCRIPT: classify_session_dump ");
2274 if (mp->table_id != ~0)
2275 s = format (s, "table_id %d ", (mp->table_id));
2280 static void *vl_api_set_ipfix_exporter_t_print
2281 (vl_api_set_ipfix_exporter_t * mp, void *handle)
2285 s = format (0, "SCRIPT: set_ipfix_exporter ");
2287 s = format (s, "collector-address %U ", format_ip4_address,
2288 (ip4_address_t *) mp->collector_address.un.ip4);
2289 s = format (s, "collector-port %d ", (mp->collector_port));
2290 s = format (s, "src-address %U ", format_ip4_address,
2291 (ip4_address_t *) mp->src_address.un.ip4);
2292 s = format (s, "vrf-id %d ", (mp->vrf_id));
2293 s = format (s, "path-mtu %d ", (mp->path_mtu));
2294 s = format (s, "template-interval %d ", (mp->template_interval));
2295 s = format (s, "udp-checksum %d ", mp->udp_checksum);
2300 static void *vl_api_ipfix_exporter_dump_t_print
2301 (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2305 s = format (0, "SCRIPT: ipfix_exporter_dump ");
2310 static void *vl_api_set_ipfix_classify_stream_t_print
2311 (vl_api_set_ipfix_classify_stream_t * mp, void *handle)
2315 s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2317 s = format (s, "domain-id %d ", (mp->domain_id));
2318 s = format (s, "src-port %d ", (mp->src_port));
2323 static void *vl_api_ipfix_classify_stream_dump_t_print
2324 (vl_api_ipfix_classify_stream_dump_t * mp, void *handle)
2328 s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2333 static void *vl_api_ipfix_classify_table_add_del_t_print
2334 (vl_api_ipfix_classify_table_add_del_t * mp, void *handle)
2338 s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2340 s = format (s, "table-id %d ", (mp->table_id));
2341 s = format (s, "ip-version %d ", mp->ip_version);
2342 s = format (s, "transport-protocol %d ", mp->transport_protocol);
2347 static void *vl_api_ipfix_classify_table_dump_t_print
2348 (vl_api_ipfix_classify_table_dump_t * mp, void *handle)
2352 s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2357 static void *vl_api_sw_interface_span_enable_disable_t_print
2358 (vl_api_sw_interface_span_enable_disable_t * mp, void *handle)
2362 s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2363 s = format (s, "src_sw_if_index %u ", (mp->sw_if_index_from));
2364 s = format (s, "dst_sw_if_index %u ", (mp->sw_if_index_to));
2367 s = format (s, "l2 ");
2372 s = format (s, "disable ");
2375 s = format (s, "rx ");
2378 s = format (s, "tx ");
2382 s = format (s, "both ");
2390 vl_api_sw_interface_span_dump_t_print (vl_api_sw_interface_span_dump_t * mp,
2395 s = format (0, "SCRIPT: sw_interface_span_dump ");
2398 s = format (s, "l2 ");
2403 static void *vl_api_get_next_index_t_print
2404 (vl_api_get_next_index_t * mp, void *handle)
2408 s = format (0, "SCRIPT: get_next_index ");
2409 s = format (s, "node-name %s ", mp->node_name);
2410 s = format (s, "next-node-name %s ", mp->next_name);
2415 static void *vl_api_pg_create_interface_t_print
2416 (vl_api_pg_create_interface_t * mp, void *handle)
2420 s = format (0, "SCRIPT: pg_create_interface ");
2421 s = format (s, "if_id %d ", (mp->interface_id));
2422 s = format (s, "gso-enabled %u ", mp->gso_enabled);
2423 s = format (s, "gso-size %u", (mp->gso_size));
2428 static void *vl_api_pg_capture_t_print
2429 (vl_api_pg_capture_t * mp, void *handle)
2433 s = format (0, "SCRIPT: pg_capture ");
2434 s = format (s, "if_id %d ", (mp->interface_id));
2435 s = format (s, "pcap %s", mp->pcap_file_name);
2436 if (mp->count != ~0)
2437 s = format (s, "count %d ", (mp->count));
2438 if (!mp->is_enabled)
2439 s = format (s, "disable");
2444 static void *vl_api_pg_enable_disable_t_print
2445 (vl_api_pg_enable_disable_t * mp, void *handle)
2449 s = format (0, "SCRIPT: pg_enable_disable ");
2450 if (vl_api_string_len (&mp->stream_name) > 0)
2452 format (s, "stream %s",
2453 vl_api_from_api_to_new_c_string (&mp->stream_name));
2454 if (!mp->is_enabled)
2455 s = format (s, "disable");
2460 static void *vl_api_pg_interface_enable_disable_coalesce_t_print
2461 (vl_api_pg_interface_enable_disable_coalesce_t * mp, void *handle)
2465 s = format (0, "SCRIPT: pg_interface_enable_disable_coalesce ");
2466 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2467 if (!mp->coalesce_enabled)
2468 s = format (s, "disable");
2470 s = format (s, "enable");
2475 static void *vl_api_ip_source_and_port_range_check_add_del_t_print
2476 (vl_api_ip_source_and_port_range_check_add_del_t * mp, void *handle)
2481 s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2482 s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
2484 for (i = 0; i < mp->number_of_ranges; i++)
2486 s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2489 s = format (s, "vrf %d ", (mp->vrf_id));
2491 if (mp->is_add == 0)
2492 s = format (s, "del ");
2497 static void *vl_api_ip_source_and_port_range_check_interface_add_del_t_print
2498 (vl_api_ip_source_and_port_range_check_interface_add_del_t * mp,
2503 s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2505 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2507 if (mp->tcp_out_vrf_id != ~0)
2508 s = format (s, "tcp-out-vrf %d ", (mp->tcp_out_vrf_id));
2510 if (mp->udp_out_vrf_id != ~0)
2511 s = format (s, "udp-out-vrf %d ", (mp->udp_out_vrf_id));
2513 if (mp->tcp_in_vrf_id != ~0)
2514 s = format (s, "tcp-in-vrf %d ", (mp->tcp_in_vrf_id));
2516 if (mp->udp_in_vrf_id != ~0)
2517 s = format (s, "udp-in-vrf %d ", (mp->udp_in_vrf_id));
2519 if (mp->is_add == 0)
2520 s = format (s, "del ");
2525 static void *vl_api_ipsec_tunnel_if_add_del_t_print
2526 (vl_api_ipsec_tunnel_if_add_del_t * mp, void *handle)
2530 s = format (0, "SCRIPT: ipsec_tunnel_if_add_del ");
2533 s = format (s, "esn");
2534 if (mp->anti_replay)
2535 s = format (s, "anti-replay");
2537 s = format (s, "udp-encap");
2539 s = format (s, "local-ip %U ", format_vl_api_address, &mp->remote_ip);
2541 s = format (s, "remote-ip %U ", format_vl_api_address, &mp->local_ip);
2542 s = format (s, "tx-table-id %d ", (mp->tx_table_id));
2544 s = format (s, "local-spi %d ", (mp->local_spi));
2546 s = format (s, "remote-spi %d ", (mp->remote_spi));
2548 s = format (s, "local-crypto-key-len %d ", mp->local_crypto_key_len);
2549 s = format (s, "local-crypto-key %U ", format_hex_bytes,
2550 mp->local_crypto_key, mp->local_crypto_key_len, 0);
2551 s = format (s, "remote-crypto-key-len %d ", mp->remote_crypto_key_len);
2552 s = format (s, "remote-crypto-key %U ", format_hex_bytes,
2553 mp->remote_crypto_key, mp->remote_crypto_key_len, 0);
2554 s = format (s, "local-integ-key-len %d ", mp->local_integ_key_len);
2555 s = format (s, "local-integ-key %U ", format_hex_bytes,
2556 mp->local_integ_key, mp->local_integ_key_len, 0);
2557 s = format (s, "remote-integ-key-len %d ", mp->remote_integ_key_len);
2558 s = format (s, "remote-integ-key %U ", format_hex_bytes,
2559 mp->remote_integ_key, mp->remote_integ_key_len, 0);
2561 if (mp->is_add == 0)
2562 s = format (s, "del ");
2568 /* format_nsh_address_vat (u8 * s, va_list * args) */
2570 /* nsh_t *a = va_arg (*args, nsh_t *); */
2571 /* return format (s, "SPI:%d SI:%d", clib_net_to_host_u32 (a->spi), a->si); */
2574 static const char *policy_strs[] = {
2581 static const char *algo_strs[] = {
2597 static const char *integ_strs[] = {
2607 static void *vl_api_ipsec_spd_entry_add_del_t_print
2608 (vl_api_ipsec_spd_entry_add_del_t * mp, void *handle)
2612 vl_api_ipsec_spd_entry_t *ep;
2613 int policy_host_byte_order;
2615 ep = (vl_api_ipsec_spd_entry_t *) & mp->entry;
2617 s = format (0, "SCRIPT: ipsec_spd_entry ");
2618 s = format (s, "is_add %d spd_id %u priority %d is_outbound %d sa_id %u\n",
2620 (ep->spd_id), ntohl (ep->priority), ep->is_outbound,
2623 policy_host_byte_order = (ep->policy);
2625 if (policy_host_byte_order < ARRAY_LEN (policy_strs))
2626 str = policy_strs[policy_host_byte_order];
2630 s = format (s, " policy: %s protocol %d\n", str, ep->protocol);
2632 s = format (s, " remote_address_start %U remote_address_stop %U\n",
2633 format_vl_api_address,
2634 &ep->remote_address_start,
2635 format_vl_api_address, &ep->remote_address_stop);
2637 s = format (s, " local_address_start %U local_address_stop %U\n",
2638 format_vl_api_address,
2639 &ep->local_address_start,
2640 format_vl_api_address, &ep->local_address_stop);
2642 s = format (s, " remote_port_start %d remote_port_stop %d\n",
2643 (ep->remote_port_start), ntohs (ep->remote_port_stop));
2645 s = format (s, " local_port_start %d local_port_stop %d ",
2646 (ep->local_port_start), ntohs (ep->local_port_stop));
2651 static void *vl_api_ipsec_interface_add_del_spd_t_print
2652 (vl_api_ipsec_interface_add_del_spd_t * mp, void *handle)
2656 s = format (0, "SCRIPT: ipsec_interface_add_del_spd ");
2657 s = format (s, "is_add %d sw_if_index %d spd_id %u ",
2658 mp->is_add, (mp->sw_if_index), ntohl (mp->spd_id));
2662 static void *vl_api_ipsec_spd_add_del_t_print
2663 (vl_api_ipsec_spd_add_del_t * mp, void *handle)
2667 s = format (0, "SCRIPT: ipsec_spd_add_del ");
2668 s = format (s, "spd_id %u is_add %d ", (mp->spd_id), mp->is_add);
2672 static void *vl_api_ipsec_sad_entry_add_del_t_print
2673 (vl_api_ipsec_sad_entry_add_del_t * mp, void *handle)
2677 vl_api_ipsec_sad_entry_t *ep;
2678 const char *protocol_str, *algo_str, *integ_str;
2680 protocol_str = "BOGUS protocol!";
2681 algo_str = "BOGUS crypto_algorithm!";
2682 integ_str = "BOGUS integrity_algorithm!";
2684 ep = (vl_api_ipsec_sad_entry_t *) & mp->entry;
2686 s = format (0, "SCRIPT: ipsec_sad_entry_add_del is_add %d ", mp->is_add);
2688 tmp = (ep->protocol);
2689 if (tmp == IPSEC_API_PROTO_ESP)
2690 protocol_str = "ESP";
2691 else if (tmp == IPSEC_API_PROTO_AH)
2692 protocol_str = "AH";
2694 tmp = (ep->crypto_algorithm);
2695 if (tmp < ARRAY_LEN (algo_strs))
2696 algo_str = algo_strs[tmp];
2698 tmp = (ep->integrity_algorithm);
2699 if (tmp < ARRAY_LEN (integ_strs))
2700 integ_str = integ_strs[tmp];
2702 s = format (s, "proto %s crypto alg %s integ alg %s\n",
2703 protocol_str, algo_str, integ_str);
2704 s = format (s, " crypto_key len %d value %U\n",
2705 ep->crypto_key.length, format_hex_bytes, ep->crypto_key.data,
2706 (int) (ep->crypto_key.length));
2707 s = format (s, " integ_key len %d value %U\n",
2708 ep->integrity_key.length, format_hex_bytes,
2709 ep->integrity_key.data, (int) (ep->integrity_key.length));
2710 s = format (s, " flags 0x%x ", (ep->flags));
2712 s = format (s, "tunnel_src %U tunnel_dst %U\n",
2713 format_vl_api_address,
2714 &ep->tunnel_src, format_vl_api_address, &ep->tunnel_dst);
2715 s = format (s, " tx_table_id %u salt %u ",
2716 (ep->tx_table_id), ntohl (ep->salt));
2721 static void *vl_api_l2_interface_pbb_tag_rewrite_t_print
2722 (vl_api_l2_interface_pbb_tag_rewrite_t * mp, void *handle)
2725 u32 vtr_op = (mp->vtr_op);
2727 s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
2729 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2730 s = format (s, "vtr_op %d ", vtr_op);
2731 if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
2733 if (vtr_op == L2_VTR_TRANSLATE_2_2)
2734 s = format (s, "%d ", (mp->outer_tag));
2735 s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
2736 s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
2737 s = format (s, "sid %d ", (mp->i_sid));
2738 s = format (s, "vlanid %d ", (mp->b_vlanid));
2743 static void *vl_api_flow_classify_set_interface_t_print
2744 (vl_api_flow_classify_set_interface_t * mp, void *handle)
2748 s = format (0, "SCRIPT: flow_classify_set_interface ");
2749 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2750 if (mp->ip4_table_index != ~0)
2751 s = format (s, "ip4-table %d ", (mp->ip4_table_index));
2752 if (mp->ip6_table_index != ~0)
2753 s = format (s, "ip6-table %d ", (mp->ip6_table_index));
2754 if (mp->is_add == 0)
2755 s = format (s, "del ");
2761 vl_api_set_punt_t_print (vl_api_set_punt_t * mp, void *handle)
2765 s = format (0, "SCRIPT: punt ");
2767 switch (mp->punt.type)
2769 case PUNT_API_TYPE_L4:
2770 s = format (s, "%U", format_vl_api_address_family, mp->punt.punt.l4.af);
2772 s = format (s, "protocol %d ", mp->punt.punt.l4.protocol);
2774 if (mp->punt.punt.l4.port != (u16) ~ 0)
2775 s = format (s, "port %d ", (mp->punt.punt.l4.port));
2783 s = format (s, "del ");
2788 static void *vl_api_flow_classify_dump_t_print
2789 (vl_api_flow_classify_dump_t * mp, void *handle)
2793 s = format (0, "SCRIPT: flow_classify_dump ");
2796 case FLOW_CLASSIFY_API_TABLE_IP4:
2797 s = format (s, "type ip4 ");
2799 case FLOW_CLASSIFY_API_TABLE_IP6:
2800 s = format (s, "type ip6 ");
2809 static void *vl_api_get_first_msg_id_t_print
2810 (vl_api_get_first_msg_id_t * mp, void *handle)
2814 s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
2819 static void *vl_api_ioam_enable_t_print
2820 (vl_api_ioam_enable_t * mp, void *handle)
2824 s = format (0, "SCRIPT: ioam_enable ");
2826 if (mp->trace_enable)
2827 s = format (s, "trace enabled");
2830 s = format (s, "POT enabled");
2833 s = format (s, "Seqno enabled");
2836 s = format (s, "Analyse enabled");
2841 static void *vl_api_ioam_disable_t_print
2842 (vl_api_ioam_disable_t * mp, void *handle)
2846 s = format (0, "SCRIPT: ioam_disable ");
2847 s = format (s, "trace disabled");
2848 s = format (s, "POT disabled");
2849 s = format (s, "Seqno disabled");
2850 s = format (s, "Analyse disabled");
2855 static void *vl_api_feature_enable_disable_t_print
2856 (vl_api_feature_enable_disable_t * mp, void *handle)
2860 s = format (0, "SCRIPT: feature_enable_disable ");
2861 s = format (s, "arc_name %s ", mp->arc_name);
2862 s = format (s, "feature_name %s ", mp->feature_name);
2863 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2865 s = format (s, "disable");
2870 static void *vl_api_feature_gso_enable_disable_t_print
2871 (vl_api_feature_gso_enable_disable_t * mp, void *handle)
2875 s = format (0, "SCRIPT: feature_gso_enable_disable ");
2876 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2877 if (mp->enable_disable)
2878 s = format (s, "enable");
2879 if (!mp->enable_disable)
2880 s = format (s, "disable");
2885 static void *vl_api_sw_interface_tag_add_del_t_print
2886 (vl_api_sw_interface_tag_add_del_t * mp, void *handle)
2890 s = format (0, "SCRIPT: sw_interface_tag_add_del ");
2891 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2893 s = format (s, "tag %s ", mp->tag);
2895 s = format (s, "del ");
2900 static void *vl_api_hw_interface_set_mtu_t_print
2901 (vl_api_hw_interface_set_mtu_t * mp, void *handle)
2905 s = format (0, "SCRIPT: sw_interface_set_mtu ");
2906 s = format (s, "sw_if_index %d ", (mp->sw_if_index));
2907 s = format (s, "tag %d ", (mp->mtu));
2912 static void *vl_api_p2p_ethernet_add_t_print
2913 (vl_api_p2p_ethernet_add_t * mp, void *handle)
2917 s = format (0, "SCRIPT: p2p_ethernet_add ");
2918 s = format (s, "sw_if_index %d ", (mp->parent_if_index));
2919 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
2924 static void *vl_api_p2p_ethernet_del_t_print
2925 (vl_api_p2p_ethernet_del_t * mp, void *handle)
2929 s = format (0, "SCRIPT: p2p_ethernet_del ");
2930 s = format (s, "sw_if_index %d ", (mp->parent_if_index));
2931 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
2936 static void *vl_api_tcp_configure_src_addresses_t_print
2937 (vl_api_tcp_configure_src_addresses_t * mp, void *handle)
2941 s = format (0, "SCRIPT: tcp_configure_src_addresses ");
2942 s = format (s, "%U - %U ",
2943 format_vl_api_address, &mp->first_address,
2944 format_vl_api_address, &mp->last_address);
2947 s = format (s, "vrf %d ", (mp->vrf_id));
2952 static void *vl_api_app_namespace_add_del_t_print
2953 (vl_api_app_namespace_add_del_t * mp, void *handle)
2957 s = format (0, "SCRIPT: app_namespace_add_del ");
2958 s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d "
2960 vl_api_from_api_to_new_c_string (&mp->namespace_id),
2961 mp->secret, (mp->sw_if_index), (mp->ip4_fib_id),
2966 static void *vl_api_session_rule_add_del_t_print
2967 (vl_api_session_rule_add_del_t * mp, void *handle)
2970 fib_prefix_t lcl, rmt;
2971 char *proto = mp->transport_proto == 0 ? "tcp" : "udp";
2972 s = format (0, "SCRIPT: session_rule_add_del ");
2973 mp->tag[sizeof (mp->tag) - 1] = 0;
2974 ip_prefix_decode (&mp->lcl, &lcl);
2975 ip_prefix_decode (&mp->rmt, &rmt);
2977 if (lcl.fp_proto == FIB_PROTOCOL_IP4)
2978 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
2979 mp->appns_index, mp->scope, proto, format_ip4_address,
2980 &lcl.fp_addr.ip4, lcl.fp_len,
2981 format_ip4_address, &rmt.fp_addr.ip4,
2982 rmt.fp_len, mp->action_index, mp->tag);
2984 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
2985 mp->appns_index, mp->scope, proto, format_ip6_address,
2986 &lcl.fp_addr.ip6, lcl.fp_len,
2987 format_ip6_address, &rmt.fp_addr.ip6,
2988 rmt.fp_len, mp->action_index, mp->tag);
2993 static void *vl_api_ip_container_proxy_add_del_t_print
2994 (vl_api_ip_container_proxy_add_del_t * mp, void *handle)
2997 s = format (0, "SCRIPT: ip_container_proxy_add_del ");
2998 s = format (s, "is_add %d prefix %U sw_if_index %d",
2999 mp->is_add, format_vl_api_prefix, mp->sw_if_index);
3004 static void *vl_api_qos_record_enable_disable_t_print
3005 (vl_api_qos_record_enable_disable_t * mp, void *handle)
3009 s = format (0, "SCRIPT: qos_record_enable_disable ");
3010 s = format (s, "sw_if_index %d ", (mp->record.sw_if_index));
3011 s = format (s, "input_source %U ", format_qos_source,
3012 mp->record.input_source);
3015 s = format (s, "disable ");
3020 #define foreach_no_print_function \
3021 _(memclnt_keepalive_reply)
3024 static void * vl_api_ ## f ## _t_print \
3025 (vl_api_ ## f ## _t * mp, void * handle) \
3029 foreach_no_print_function;
3032 #define foreach_custom_print_function \
3033 _(CREATE_LOOPBACK, create_loopback) \
3034 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
3035 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
3036 _(SW_INTERFACE_EVENT, sw_interface_event) \
3037 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
3038 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
3039 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
3040 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
3041 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
3042 _(BOND_CREATE, bond_create) \
3043 _(BOND_CREATE2, bond_create2) \
3044 _(BOND_DELETE, bond_delete) \
3045 _(BOND_ADD_MEMBER, bond_add_member) \
3046 _(BOND_DETACH_MEMBER, bond_detach_member) \
3047 _(SW_INTERFACE_SET_BOND_WEIGHT, sw_interface_set_bond_weight) \
3048 _(SW_MEMBER_INTERFACE_DUMP, sw_member_interface_dump) \
3049 _(SW_BOND_INTERFACE_DUMP, sw_bond_interface_dump) \
3050 _(SW_INTERFACE_RX_PLACEMENT_DUMP, sw_interface_rx_placement_dump) \
3051 _(TAP_CREATE_V2, tap_create_v2) \
3052 _(TAP_DELETE_V2, tap_delete_v2) \
3053 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) \
3054 _(IP_TABLE_ADD_DEL, ip_table_add_del) \
3055 _(MPLS_ROUTE_ADD_DEL, mpls_route_add_del) \
3056 _(MPLS_TABLE_ADD_DEL, mpls_table_add_del) \
3057 _(IP_ROUTE_ADD_DEL, ip_route_add_del) \
3058 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3059 _(SR_MPLS_POLICY_ADD, sr_mpls_policy_add) \
3060 _(SR_MPLS_POLICY_DEL, sr_mpls_policy_del) \
3061 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3062 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3063 _(CREATE_SUBIF, create_subif) \
3064 _(IP_TABLE_REPLACE_BEGIN, ip_table_replace_begin) \
3065 _(IP_TABLE_FLUSH, ip_table_flush) \
3066 _(IP_TABLE_REPLACE_END, ip_table_replace_end) \
3067 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3068 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3069 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3070 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3071 _(SR_POLICY_ADD, sr_policy_add) \
3072 _(SR_POLICY_MOD, sr_policy_mod) \
3073 _(SR_POLICY_DEL, sr_policy_del) \
3074 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3075 _(L2FIB_ADD_DEL, l2fib_add_del) \
3076 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3077 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3078 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3079 _(L2_FLAGS, l2_flags) \
3080 _(BRIDGE_FLAGS, bridge_flags) \
3081 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3082 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3083 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3084 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3085 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3086 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3087 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3088 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3089 _(ADD_NODE_NEXT, add_node_next) \
3090 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3091 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3092 _(VXLAN_OFFLOAD_RX, vxlan_offload_rx) \
3093 _(GRE_TUNNEL_ADD_DEL, gre_tunnel_add_del) \
3094 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3095 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3096 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3097 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3098 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3099 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3100 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3101 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3102 _(CONTROL_PING, control_ping) \
3103 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3105 _(CLI_INBAND, cli_inband) \
3106 _(MEMCLNT_CREATE, memclnt_create) \
3107 _(SOCKCLNT_CREATE, sockclnt_create) \
3108 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3109 _(SHOW_VERSION, show_version) \
3110 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3111 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3112 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3113 _(VXLAN_GBP_TUNNEL_ADD_DEL, vxlan_gbp_tunnel_add_del) \
3114 _(VXLAN_GBP_TUNNEL_DUMP, vxlan_gbp_tunnel_dump) \
3115 _(SW_INTERFACE_SET_VXLAN_GBP_BYPASS, sw_interface_set_vxlan_gbp_bypass) \
3116 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3117 _(WANT_L2_MACS_EVENTS, want_l2_macs_events) \
3118 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3119 _(IP_ADDRESS_DUMP, ip_address_dump) \
3120 _(IP_DUMP, ip_dump) \
3121 _(DELETE_LOOPBACK, delete_loopback) \
3122 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3123 _(BD_IP_MAC_FLUSH, bd_ip_mac_flush) \
3124 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3125 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3126 _(AF_PACKET_CREATE, af_packet_create) \
3127 _(AF_PACKET_DELETE, af_packet_delete) \
3128 _(AF_PACKET_DUMP, af_packet_dump) \
3129 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3130 _(MPLS_TABLE_DUMP, mpls_table_dump) \
3131 _(MPLS_ROUTE_DUMP, mpls_route_dump) \
3132 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3133 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3134 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3135 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3136 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3137 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3138 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3139 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3140 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3141 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3142 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3143 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3144 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3145 _(GET_NEXT_INDEX, get_next_index) \
3146 _(PG_CREATE_INTERFACE,pg_create_interface) \
3147 _(PG_CAPTURE, pg_capture) \
3148 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3149 _(PG_INTERFACE_ENABLE_DISABLE_COALESCE, pg_interface_enable_disable_coalesce) \
3150 _(POLICER_ADD_DEL, policer_add_del) \
3151 _(POLICER_DUMP, policer_dump) \
3152 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3153 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3154 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3155 ip_source_and_port_range_check_add_del) \
3156 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3157 ip_source_and_port_range_check_interface_add_del) \
3158 _(IPSEC_INTERFACE_ADD_DEL_SPD, ipsec_interface_add_del_spd) \
3159 _(IPSEC_SAD_ENTRY_ADD_DEL, ipsec_sad_entry_add_del) \
3160 _(IPSEC_SPD_ADD_DEL, ipsec_spd_add_del) \
3161 _(IPSEC_SPD_ENTRY_ADD_DEL, ipsec_spd_entry_add_del) \
3162 _(IPSEC_TUNNEL_IF_ADD_DEL, ipsec_tunnel_if_add_del) \
3163 _(DELETE_SUBIF, delete_subif) \
3164 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3165 _(SET_PUNT, set_punt) \
3166 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3167 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3168 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3169 _(IOAM_ENABLE, ioam_enable) \
3170 _(IOAM_DISABLE, ioam_disable) \
3171 _(IP_TABLE_DUMP, ip_table_dump) \
3172 _(IP_ROUTE_DUMP, ip_route_dump) \
3173 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3174 _(FEATURE_GSO_ENABLE_DISABLE, feature_gso_enable_disable) \
3175 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3176 _(HW_INTERFACE_SET_MTU, hw_interface_set_mtu) \
3177 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3178 _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
3179 _(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
3180 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
3181 _(SESSION_RULE_ADD_DEL, session_rule_add_del) \
3182 _(OUTPUT_ACL_SET_INTERFACE, output_acl_set_interface) \
3183 _(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable) \
3184 _(MEMCLNT_KEEPALIVE_REPLY, memclnt_keepalive_reply)
3187 vl_msg_api_custom_dump_configure (api_main_t * am)
3189 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3190 = (void *) vl_api_##f##_t_print;
3191 foreach_custom_print_function;
3196 * fd.io coding-style-patch-verification: ON
3199 * eval: (c-set-style "gnu")