2 * ------------------------------------------------------------------
3 * custom_dump.c - pretty-print API messages for replay
5 * Copyright (c) 2014-2016 Cisco and/or its affiliates. Licensed under the
6 * Apache License, Version 2.0 (the "License"); you may not use this file
7 * except in compliance with the License. You may obtain a copy of the
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 * License for the specific language governing permissions and limitations
17 * ------------------------------------------------------------------
20 #include <vnet/vnet.h>
21 #include <vnet/ip/ip.h>
22 #include <vnet/ip/ip_neighbor.h>
23 #include <vnet/unix/tuntap.h>
24 #include <vnet/mpls/mpls.h>
25 #include <vnet/dhcp/dhcp_proxy.h>
26 #include <vnet/l2tp/l2tp.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/geneve/geneve.h>
33 #include <vnet/classify/policer_classify.h>
34 #include <vnet/policer/xlate.h>
35 #include <vnet/policer/policer.h>
36 #include <vnet/classify/flow_classify.h>
37 #include <vlib/vlib.h>
38 #include <vlib/unix/unix.h>
39 #include <vlibapi/api.h>
40 #include <vlibmemory/api.h>
41 #include <vnet/lisp-cp/lisp_types.h>
42 #include <vnet/qos/qos_types.h>
43 #include <vpp/stats/stats.h>
44 #include <vpp/oam/oam.h>
46 #include <vnet/ethernet/ethernet.h>
47 #include <vnet/l2/l2_vtr.h>
49 #include <vpp/api/vpe_msg_enum.h>
51 #include <vnet/bonding/node.h>
53 #define vl_typedefs /* define message structures */
54 #include <vpp/api/vpe_all_api_h.h>
57 #define vl_endianfun /* define message structures */
58 #include <vpp/api/vpe_all_api_h.h>
61 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
65 vl_print (handle, (char *)s); \
70 static void *vl_api_create_loopback_t_print
71 (vl_api_create_loopback_t * mp, void *handle)
75 s = format (0, "SCRIPT: create_loopback ");
76 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
81 static void *vl_api_create_loopback_instance_t_print
82 (vl_api_create_loopback_instance_t * mp, void *handle)
86 s = format (0, "SCRIPT: create_loopback ");
87 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
88 s = format (s, "instance %d ", ntohl (mp->user_instance));
93 static void *vl_api_delete_loopback_t_print
94 (vl_api_delete_loopback_t * mp, void *handle)
98 s = format (0, "SCRIPT: delete_loopback ");
99 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
104 static void *vl_api_sw_interface_set_flags_t_print
105 (vl_api_sw_interface_set_flags_t * mp, void *handle)
108 s = format (0, "SCRIPT: sw_interface_set_flags ");
110 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
112 if (mp->admin_up_down)
113 s = format (s, "admin-up ");
115 s = format (s, "admin-down ");
120 static void *vl_api_sw_interface_event_t_print
121 (vl_api_sw_interface_event_t * mp, void *handle)
124 s = format (0, "SCRIPT: sw_interface_event ");
126 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
128 if (mp->admin_up_down)
129 s = format (s, "admin-up ");
131 s = format (s, "admin-down ");
133 if (mp->link_up_down)
134 s = format (s, "link-up");
136 s = format (s, "link-down");
139 s = format (s, " deleted");
144 static void *vl_api_sw_interface_add_del_address_t_print
145 (vl_api_sw_interface_add_del_address_t * mp, void *handle)
149 s = format (0, "SCRIPT: sw_interface_add_del_address ");
151 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
154 s = format (s, "%U/%d ", format_ip6_address,
155 (ip6_address_t *) mp->address, mp->address_length);
157 s = format (s, "%U/%d ", format_ip4_address,
158 (ip4_address_t *) mp->address, mp->address_length);
161 s = format (s, "del ");
163 s = format (s, "del-all ");
168 static void *vl_api_sw_interface_set_table_t_print
169 (vl_api_sw_interface_set_table_t * mp, void *handle)
173 s = format (0, "SCRIPT: sw_interface_set_table ");
175 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
178 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
181 s = format (s, "ipv6 ");
186 static void *vl_api_sw_interface_set_mpls_enable_t_print
187 (vl_api_sw_interface_set_mpls_enable_t * mp, void *handle)
191 s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
193 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
196 s = format (s, "disable");
201 static void *vl_api_sw_interface_set_vpath_t_print
202 (vl_api_sw_interface_set_vpath_t * mp, void *handle)
206 s = format (0, "SCRIPT: sw_interface_set_vpath ");
208 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
211 s = format (s, "enable ");
213 s = format (s, "disable ");
218 static void *vl_api_sw_interface_set_vxlan_bypass_t_print
219 (vl_api_sw_interface_set_vxlan_bypass_t * mp, void *handle)
223 s = format (0, "SCRIPT: sw_interface_set_vxlan_bypass ");
225 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
228 s = format (s, "ip6 ");
231 s = format (s, "enable ");
233 s = format (s, "disable ");
238 static void *vl_api_sw_interface_set_geneve_bypass_t_print
239 (vl_api_sw_interface_set_geneve_bypass_t * mp, void *handle)
243 s = format (0, "SCRIPT: sw_interface_set_geneve_bypass ");
245 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
248 s = format (s, "ip6 ");
251 s = format (s, "enable ");
253 s = format (s, "disable ");
258 static void *vl_api_sw_interface_set_l2_xconnect_t_print
259 (vl_api_sw_interface_set_l2_xconnect_t * mp, void *handle)
263 s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
265 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
269 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
272 s = format (s, "delete ");
277 static void *vl_api_sw_interface_set_l2_bridge_t_print
278 (vl_api_sw_interface_set_l2_bridge_t * mp, void *handle)
282 s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
284 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
288 s = format (s, "bd_id %d shg %d %senable ", ntohl (mp->bd_id),
289 mp->shg, ((mp->bvi) ? "bvi " : " "));
292 s = format (s, "disable ");
297 static void *vl_api_bridge_domain_add_del_t_print
298 (vl_api_bridge_domain_add_del_t * mp, void *handle)
302 s = format (0, "SCRIPT: bridge_domain_add_del ");
304 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
309 s = format (s, "bd_tag %s ", mp->bd_tag);
310 s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood);
311 s = format (s, "forward %d learn %d ", mp->forward, mp->learn);
312 s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age);
315 s = format (s, "del ");
320 static void *vl_api_bridge_domain_set_mac_age_t_print
321 (vl_api_bridge_domain_set_mac_age_t * mp, void *handle)
325 s = format (0, "SCRIPT: bridge_domain_set_mac_age ");
327 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
329 s = format (s, "mac-age %d", mp->mac_age);
334 static void *vl_api_bridge_domain_dump_t_print
335 (vl_api_bridge_domain_dump_t * mp, void *handle)
338 u32 bd_id = ntohl (mp->bd_id);
340 s = format (0, "SCRIPT: bridge_domain_dump ");
343 s = format (s, "bd_id %d ", bd_id);
348 static void *vl_api_l2fib_flush_all_t_print
349 (vl_api_l2fib_flush_all_t * mp, void *handle)
353 s = format (0, "SCRIPT: l2fib_flush_all ");
359 static void *vl_api_l2fib_flush_bd_t_print
360 (vl_api_l2fib_flush_bd_t * mp, void *handle)
363 u32 bd_id = ntohl (mp->bd_id);
365 s = format (0, "SCRIPT: l2fib_flush_bd ");
366 s = format (s, "bd_id %d ", bd_id);
371 static void *vl_api_l2fib_flush_int_t_print
372 (vl_api_l2fib_flush_int_t * mp, void *handle)
375 u32 sw_if_index = ntohl (mp->sw_if_index);
377 s = format (0, "SCRIPT: l2fib_flush_int ");
378 s = format (s, "sw_if_index %d ", sw_if_index);
383 static void *vl_api_l2fib_add_del_t_print
384 (vl_api_l2fib_add_del_t * mp, void *handle)
388 s = format (0, "SCRIPT: l2fib_add_del ");
390 s = format (s, "mac %U ", format_ethernet_address, mp->mac);
392 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
397 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
399 s = format (s, "%s", "static ");
401 s = format (s, "%s", "filter ");
403 s = format (s, "%s", "bvi ");
407 s = format (s, "del ");
414 vl_api_l2_flags_t_print (vl_api_l2_flags_t * mp, void *handle)
417 u32 flags = ntohl (mp->feature_bitmap);
419 s = format (0, "SCRIPT: l2_flags ");
421 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
423 if (flags & L2_LEARN)
424 s = format (s, "learn ");
426 s = format (s, "forward ");
427 if (flags & L2_FLOOD)
428 s = format (s, "flood ");
429 if (flags & L2_UU_FLOOD)
430 s = format (s, "uu-flood ");
431 if (flags & L2_ARP_TERM)
432 s = format (s, "arp-term ");
435 s = format (s, "clear ");
440 static void *vl_api_bridge_flags_t_print
441 (vl_api_bridge_flags_t * mp, void *handle)
444 u32 flags = ntohl (mp->feature_bitmap);
446 s = format (0, "SCRIPT: bridge_flags ");
448 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
450 if (flags & L2_LEARN)
451 s = format (s, "learn ");
453 s = format (s, "forward ");
454 if (flags & L2_FLOOD)
455 s = format (s, "flood ");
456 if (flags & L2_UU_FLOOD)
457 s = format (s, "uu-flood ");
458 if (flags & L2_ARP_TERM)
459 s = format (s, "arp-term ");
462 s = format (s, "clear ");
467 static void *vl_api_bd_ip_mac_add_del_t_print
468 (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
472 s = format (0, "SCRIPT: bd_ip_mac_add_del ");
473 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
476 s = format (s, "%U ", format_ip6_address,
477 (ip6_address_t *) mp->ip_address);
479 s = format (s, "%U ", format_ip4_address,
480 (ip4_address_t *) mp->ip_address);
482 s = format (s, "%U ", format_ethernet_address, mp->mac_address);
484 s = format (s, "del ");
489 static void *vl_api_tap_connect_t_print
490 (vl_api_tap_connect_t * mp, void *handle)
495 memset (null_mac, 0, sizeof (null_mac));
497 s = format (0, "SCRIPT: tap_connect ");
498 s = format (s, "tapname %s ", mp->tap_name);
499 if (mp->use_random_mac)
500 s = format (s, "random-mac ");
502 s = format (s, "tag %s ", mp->tag);
503 if (memcmp (mp->mac_address, null_mac, 6))
504 s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
505 if (mp->ip4_address_set)
506 s = format (s, "address %U/%d ", format_ip4_address, mp->ip4_address,
508 if (mp->ip6_address_set)
509 s = format (s, "address %U/%d ", format_ip6_address, mp->ip6_address,
514 static void *vl_api_tap_modify_t_print
515 (vl_api_tap_modify_t * mp, void *handle)
520 memset (null_mac, 0, sizeof (null_mac));
522 s = format (0, "SCRIPT: tap_modify ");
523 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
524 s = format (s, "tapname %s ", mp->tap_name);
525 if (mp->use_random_mac)
526 s = format (s, "random-mac ");
528 if (memcmp (mp->mac_address, null_mac, 6))
529 s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
534 static void *vl_api_tap_delete_t_print
535 (vl_api_tap_delete_t * mp, void *handle)
539 s = format (0, "SCRIPT: tap_delete ");
540 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
545 static void *vl_api_sw_interface_tap_dump_t_print
546 (vl_api_sw_interface_tap_dump_t * mp, void *handle)
550 s = format (0, "SCRIPT: sw_interface_tap_dump ");
555 static void *vl_api_tap_create_v2_t_print
556 (vl_api_tap_create_v2_t * mp, void *handle)
561 memset (null_mac, 0, sizeof (null_mac));
563 s = format (0, "SCRIPT: tap_create_v2 ");
564 s = format (s, "id %u ", mp->id);
565 if (memcmp (mp->mac_address, null_mac, 6))
566 s = format (s, "mac-address %U ",
567 format_ethernet_address, mp->mac_address);
568 if (memcmp (mp->host_mac_addr, null_mac, 6))
569 s = format (s, "host-mac-addr %U ",
570 format_ethernet_address, mp->host_mac_addr);
571 if (mp->host_if_name_set)
572 s = format (s, "host-if-name %s ", mp->host_if_name);
573 if (mp->host_namespace_set)
574 s = format (s, "host-ns %s ", mp->host_namespace);
575 if (mp->host_bridge_set)
576 s = format (s, "host-bridge %s ", mp->host_bridge);
577 if (mp->host_ip4_addr_set)
578 s = format (s, "host-ip4-addr %U/%d ", format_ip4_address,
579 mp->host_ip4_addr, mp->host_ip4_prefix_len);
580 if (mp->host_ip6_addr_set)
581 s = format (s, "host-ip6-addr %U/%d ", format_ip6_address,
582 mp->host_ip6_addr, mp->host_ip6_prefix_len);
583 if (mp->host_ip4_gw_set)
584 s = format (s, "host-ip4-gw %U ", format_ip4_address, mp->host_ip4_addr);
585 if (mp->host_ip6_gw_set)
586 s = format (s, "host-ip6-gw %U ", format_ip6_address, mp->host_ip6_addr);
588 s = format (s, "tx-ring-size %d ", mp->tx_ring_sz);
590 s = format (s, "rx-ring-size %d ", mp->rx_ring_sz);
594 static void *vl_api_tap_delete_v2_t_print
595 (vl_api_tap_delete_v2_t * mp, void *handle)
599 s = format (0, "SCRIPT: tap_delete_v2 ");
600 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
605 static void *vl_api_sw_interface_tap_v2_dump_t_print
606 (vl_api_sw_interface_tap_v2_dump_t * mp, void *handle)
610 s = format (0, "SCRIPT: sw_interface_tap_v2_dump ");
615 static void *vl_api_bond_create_t_print
616 (vl_api_bond_create_t * mp, void *handle)
621 memset (null_mac, 0, sizeof (null_mac));
623 s = format (0, "SCRIPT: bond_create ");
624 if (memcmp (mp->mac_address, null_mac, 6))
625 s = format (s, "mac-address %U ",
626 format_ethernet_address, mp->mac_address);
628 s = format (s, "mode %U", format_bond_mode, mp->mode);
630 s = format (s, "lb %U", format_bond_load_balance, mp->lb);
634 static void *vl_api_bond_delete_t_print
635 (vl_api_bond_delete_t * mp, void *handle)
639 s = format (0, "SCRIPT: bond_delete ");
640 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
645 static void *vl_api_bond_enslave_t_print
646 (vl_api_bond_enslave_t * mp, void *handle)
650 s = format (0, "SCRIPT: bond_enslave ");
651 s = format (s, "bond_sw_if_index %u ", mp->bond_sw_if_index);
652 s = format (s, "sw_if_index %u ", mp->sw_if_index);
654 s = format (s, "passive ");
655 if (mp->is_long_timeout)
656 s = format (s, "long-timeout ");
661 static void *vl_api_bond_detach_slave_t_print
662 (vl_api_bond_detach_slave_t * mp, void *handle)
666 s = format (0, "SCRIPT: bond_detach_slave ");
667 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
672 static void *vl_api_sw_interface_bond_dump_t_print
673 (vl_api_sw_interface_bond_dump_t * mp, void *handle)
677 s = format (0, "SCRIPT: sw_interface_bond_dump ");
682 static void *vl_api_sw_interface_slave_dump_t_print
683 (vl_api_sw_interface_slave_dump_t * mp, void *handle)
687 s = format (0, "SCRIPT: sw_interface_slave_dump ");
688 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
693 static void *vl_api_ip_add_del_route_t_print
694 (vl_api_ip_add_del_route_t * mp, void *handle)
698 s = format (0, "SCRIPT: ip_add_del_route ");
700 s = format (s, "del ");
702 if (mp->next_hop_sw_if_index)
703 s = format (s, "sw_if_index %d ", ntohl (mp->next_hop_sw_if_index));
706 s = format (s, "%U/%d ", format_ip6_address, mp->dst_address,
707 mp->dst_address_length);
709 s = format (s, "%U/%d ", format_ip4_address, mp->dst_address,
710 mp->dst_address_length);
712 s = format (s, "local ");
713 else if (mp->is_drop)
714 s = format (s, "drop ");
715 else if (mp->is_classify)
716 s = format (s, "classify %d", ntohl (mp->classify_table_index));
720 s = format (s, "via %U ", format_ip6_address, mp->next_hop_address);
722 s = format (s, "via %U ", format_ip4_address, mp->next_hop_address);
725 if (mp->table_id != 0)
726 s = format (s, "vrf %d ", ntohl (mp->table_id));
728 if (mp->next_hop_weight != 1)
729 s = format (s, "weight %d ", mp->next_hop_weight);
731 if (mp->is_multipath)
732 s = format (s, "multipath ");
734 if (mp->is_multipath)
735 s = format (s, "multipath ");
737 if (mp->next_hop_table_id)
738 s = format (s, "lookup-in-vrf %d ", ntohl (mp->next_hop_table_id));
743 static void *vl_api_proxy_arp_add_del_t_print
744 (vl_api_proxy_arp_add_del_t * mp, void *handle)
748 s = format (0, "SCRIPT: proxy_arp_add_del ");
750 s = format (s, "%U - %U ",
751 format_ip4_address, mp->proxy.low_address,
752 format_ip4_address, mp->proxy.hi_address);
754 if (mp->proxy.vrf_id)
755 s = format (s, "vrf %d ", ntohl (mp->proxy.vrf_id));
758 s = format (s, "del ");
763 static void *vl_api_proxy_arp_intfc_enable_disable_t_print
764 (vl_api_proxy_arp_intfc_enable_disable_t * mp, void *handle)
768 s = format (0, "SCRIPT: proxy_arp_intfc_enable_disable ");
770 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
772 s = format (s, "enable %d ", mp->enable_disable);
777 static void *vl_api_mpls_tunnel_add_del_t_print
778 (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
782 s = format (0, "SCRIPT: mpls_tunnel_add_del ");
784 if (mp->mt_next_hop_sw_if_index)
785 s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index));
787 if (mp->mt_next_hop_proto_is_ip4)
788 s = format (s, "%U ", format_ip4_address, mp->mt_next_hop);
790 s = format (s, "%U ", format_ip6_address, mp->mt_next_hop);
793 s = format (s, "l2-only ");
795 if (mp->mt_is_add == 0)
796 s = format (s, "del ");
801 static void *vl_api_sw_interface_set_unnumbered_t_print
802 (vl_api_sw_interface_set_unnumbered_t * mp, void *handle)
806 s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
808 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
810 s = format (s, "unnum_if_index %d ", ntohl (mp->unnumbered_sw_if_index));
813 s = format (s, "del ");
818 static void *vl_api_ip_neighbor_add_del_t_print
819 (vl_api_ip_neighbor_add_del_t * mp, void *handle)
824 memset (null_mac, 0, sizeof (null_mac));
826 s = format (0, "SCRIPT: ip_neighbor_add_del ");
828 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
831 s = format (s, "is_static ");
833 if (mp->is_no_adj_fib)
834 s = format (s, "is_no_fib_entry ");
836 if (memcmp (mp->mac_address, null_mac, 6))
837 s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
841 format (s, "dst %U ", format_ip6_address,
842 (ip6_address_t *) mp->dst_address);
845 format (s, "dst %U ", format_ip4_address,
846 (ip4_address_t *) mp->dst_address);
849 s = format (s, "del ");
854 static void *vl_api_create_vlan_subif_t_print
855 (vl_api_create_vlan_subif_t * mp, void *handle)
859 s = format (0, "SCRIPT: create_vlan_subif ");
862 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
865 s = format (s, "vlan_id %d ", ntohl (mp->vlan_id));
870 #define foreach_create_subif_bit \
877 _(outer_vlan_id_any) \
880 static void *vl_api_create_subif_t_print
881 (vl_api_create_subif_t * mp, void *handle)
885 s = format (0, "SCRIPT: create_subif ");
887 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
889 s = format (s, "sub_id %d ", ntohl (mp->sub_id));
891 if (mp->outer_vlan_id)
892 s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
894 if (mp->inner_vlan_id)
895 s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
897 #define _(a) if (mp->a) s = format (s, "%s ", #a);
898 foreach_create_subif_bit;
904 static void *vl_api_delete_subif_t_print
905 (vl_api_delete_subif_t * mp, void *handle)
909 s = format (0, "SCRIPT: delete_subif ");
910 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
915 static void *vl_api_oam_add_del_t_print
916 (vl_api_oam_add_del_t * mp, void *handle)
920 s = format (0, "SCRIPT: oam_add_del ");
923 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
925 s = format (s, "src %U ", format_ip4_address, mp->src_address);
927 s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
930 s = format (s, "del ");
936 vl_api_reset_fib_t_print (vl_api_reset_fib_t * mp, void *handle)
940 s = format (0, "SCRIPT: reset_fib ");
943 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
945 if (mp->is_ipv6 != 0)
946 s = format (s, "ipv6 ");
951 static void *vl_api_dhcp_proxy_config_t_print
952 (vl_api_dhcp_proxy_config_t * mp, void *handle)
956 s = format (0, "SCRIPT: dhcp_proxy_config_2 ");
958 s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
959 s = format (s, "server_vrf_id %d ", ntohl (mp->server_vrf_id));
963 s = format (s, "svr %U ", format_ip6_address,
964 (ip6_address_t *) mp->dhcp_server);
965 s = format (s, "src %U ", format_ip6_address,
966 (ip6_address_t *) mp->dhcp_src_address);
970 s = format (s, "svr %U ", format_ip4_address,
971 (ip4_address_t *) mp->dhcp_server);
972 s = format (s, "src %U ", format_ip4_address,
973 (ip4_address_t *) mp->dhcp_src_address);
976 s = format (s, "del ");
981 static void *vl_api_dhcp_proxy_set_vss_t_print
982 (vl_api_dhcp_proxy_set_vss_t * mp, void *handle)
986 s = format (0, "SCRIPT: dhcp_proxy_set_vss ");
988 s = format (s, "tbl_id %d ", ntohl (mp->tbl_id));
990 if (mp->vss_type == VSS_TYPE_VPN_ID)
992 s = format (s, "fib_id %d ", ntohl (mp->vpn_index));
993 s = format (s, "oui %d ", ntohl (mp->oui));
995 else if (mp->vss_type == VSS_TYPE_ASCII)
996 s = format (s, "vpn_ascii_id %s", mp->vpn_ascii_id);
998 if (mp->is_ipv6 != 0)
999 s = format (s, "ipv6 ");
1001 if (mp->is_add == 0)
1002 s = format (s, "del ");
1007 static void *vl_api_dhcp_client_config_t_print
1008 (vl_api_dhcp_client_config_t * mp, void *handle)
1012 s = format (0, "SCRIPT: dhcp_client_config ");
1014 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1016 s = format (s, "hostname %s ", mp->hostname);
1018 s = format (s, "want_dhcp_event %d ", mp->want_dhcp_event);
1020 s = format (s, "pid %d ", ntohl (mp->pid));
1022 if (mp->is_add == 0)
1023 s = format (s, "del ");
1029 static void *vl_api_set_ip_flow_hash_t_print
1030 (vl_api_set_ip_flow_hash_t * mp, void *handle)
1034 s = format (0, "SCRIPT: set_ip_flow_hash ");
1036 s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
1039 s = format (s, "src ");
1042 s = format (s, "dst ");
1045 s = format (s, "sport ");
1048 s = format (s, "dport ");
1051 s = format (s, "proto ");
1054 s = format (s, "reverse ");
1056 if (mp->is_ipv6 != 0)
1057 s = format (s, "ipv6 ");
1062 static void *vl_api_sw_interface_ip6_set_link_local_address_t_print
1063 (vl_api_sw_interface_ip6_set_link_local_address_t * mp, void *handle)
1067 s = format (0, "SCRIPT: sw_interface_ip6_set_link_local_address ");
1069 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1071 s = format (s, "%U ", format_ip6_address, mp->address);
1076 static void *vl_api_sw_interface_ip6nd_ra_prefix_t_print
1077 (vl_api_sw_interface_ip6nd_ra_prefix_t * mp, void *handle)
1081 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_prefix ");
1083 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1085 s = format (s, "%U/%d ", format_ip6_address, mp->address,
1086 mp->address_length);
1088 s = format (s, "val_life %d ", ntohl (mp->val_lifetime));
1090 s = format (s, "pref_life %d ", ntohl (mp->pref_lifetime));
1092 if (mp->use_default)
1093 s = format (s, "def ");
1095 if (mp->no_advertise)
1096 s = format (s, "noadv ");
1099 s = format (s, "offl ");
1101 if (mp->no_autoconfig)
1102 s = format (s, "noauto ");
1105 s = format (s, "nolink ");
1108 s = format (s, "isno ");
1113 static void *vl_api_sw_interface_ip6nd_ra_config_t_print
1114 (vl_api_sw_interface_ip6nd_ra_config_t * mp, void *handle)
1118 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_config ");
1120 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1122 s = format (s, "maxint %d ", ntohl (mp->max_interval));
1124 s = format (s, "minint %d ", ntohl (mp->min_interval));
1126 s = format (s, "life %d ", ntohl (mp->lifetime));
1128 s = format (s, "count %d ", ntohl (mp->initial_count));
1130 s = format (s, "interval %d ", ntohl (mp->initial_interval));
1133 s = format (s, "suppress ");
1136 s = format (s, "managed ");
1139 s = format (s, "other ");
1142 s = format (s, "ll ");
1144 if (mp->send_unicast)
1145 s = format (s, "send ");
1148 s = format (s, "cease ");
1151 s = format (s, "isno ");
1153 if (mp->default_router)
1154 s = format (s, "def ");
1159 static void *vl_api_set_arp_neighbor_limit_t_print
1160 (vl_api_set_arp_neighbor_limit_t * mp, void *handle)
1164 s = format (0, "SCRIPT: set_arp_neighbor_limit ");
1166 s = format (s, "arp_nbr_limit %d ", ntohl (mp->arp_neighbor_limit));
1168 if (mp->is_ipv6 != 0)
1169 s = format (s, "ipv6 ");
1174 static void *vl_api_l2_patch_add_del_t_print
1175 (vl_api_l2_patch_add_del_t * mp, void *handle)
1179 s = format (0, "SCRIPT: l2_patch_add_del ");
1181 s = format (s, "rx_sw_if_index %d ", ntohl (mp->rx_sw_if_index));
1183 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
1185 if (mp->is_add == 0)
1186 s = format (s, "del ");
1191 static void *vl_api_sr_localsid_add_del_t_print
1192 (vl_api_sr_localsid_add_del_t * mp, void *handle)
1194 vnet_main_t *vnm = vnet_get_main ();
1197 s = format (0, "SCRIPT: sr_localsid_add_del ");
1199 switch (mp->behavior)
1201 case SR_BEHAVIOR_END:
1202 s = format (s, "Address: %U\nBehavior: End",
1203 format_ip6_address, (ip6_address_t *) mp->localsid_addr);
1204 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1209 "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1210 "\nIface: %U\nNext hop: %U", format_ip6_address,
1211 (ip6_address_t *) mp->localsid_addr,
1212 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1213 format_ip6_address, (ip6_address_t *) mp->nh_addr);
1214 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1216 case SR_BEHAVIOR_DX4:
1219 "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1220 "\nIface: %U\nNext hop: %U", format_ip6_address,
1221 (ip6_address_t *) mp->localsid_addr,
1222 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1223 format_ip4_address, (ip4_address_t *) mp->nh_addr);
1225 case SR_BEHAVIOR_DX6:
1228 "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1229 "\nIface: %UNext hop: %U", format_ip6_address,
1230 (ip6_address_t *) mp->localsid_addr,
1231 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1232 format_ip6_address, (ip6_address_t *) mp->nh_addr);
1234 case SR_BEHAVIOR_DX2:
1237 "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1238 "\nIface: %U", format_ip6_address,
1239 (ip6_address_t *) mp->localsid_addr,
1240 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index));
1242 case SR_BEHAVIOR_DT6:
1245 "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1246 "\nTable: %u", format_ip6_address,
1247 (ip6_address_t *) mp->localsid_addr, ntohl (mp->fib_table));
1249 case SR_BEHAVIOR_DT4:
1252 "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1253 "\nTable: %u", format_ip6_address,
1254 (ip6_address_t *) mp->localsid_addr, ntohl (mp->fib_table));
1257 if (mp->behavior >= SR_BEHAVIOR_LAST)
1259 s = format (s, "Address: %U\n Behavior: %u",
1260 format_ip6_address, (ip6_address_t *) mp->localsid_addr,
1264 //Should never get here...
1265 s = format (s, "Internal error");
1271 static void *vl_api_sr_steering_add_del_t_print
1272 (vl_api_sr_steering_add_del_t * mp, void *handle)
1276 s = format (0, "SCRIPT: sr_steering_add_del ");
1278 s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1280 switch (mp->traffic_type)
1283 s = format (s, "Traffic type: L2 iface: %u", ntohl (mp->sw_if_index));
1286 s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1287 (ip4_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1290 s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1291 (ip6_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1294 s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1297 s = format (s, "BindingSID: %U", format_ip6_address,
1298 (ip6_address_t *) mp->bsid_addr);
1300 s = format (s, "SR Policy Index: %u", ntohl (mp->sr_policy_index));
1302 s = format (s, "FIB_table: %u", ntohl (mp->table_id));
1307 static void *vl_api_sr_policy_add_t_print
1308 (vl_api_sr_policy_add_t * mp, void *handle)
1312 ip6_address_t *segments = 0, *seg;
1313 ip6_address_t *this_address = (ip6_address_t *) mp->segments;
1316 for (i = 0; i < mp->n_segments; i++)
1318 vec_add2 (segments, seg, 1);
1319 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1323 s = format (0, "SCRIPT: sr_policy_add ");
1325 s = format (s, "BSID: %U", format_ip6_address,
1326 (ip6_address_t *) mp->bsid_addr);
1330 (mp->is_encap ? "Behavior: Encapsulation" :
1331 "Behavior: SRH insertion"));
1333 s = format (s, "FIB_table: %u", ntohl (mp->fib_table));
1335 s = format (s, (mp->type ? "Type: Default" : "Type: Spray"));
1337 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1339 s = format (s, "{");
1340 vec_foreach (seg, segments)
1342 s = format (s, "%U, ", format_ip6_address, seg);
1344 s = format (s, "\b\b } ");
1349 static void *vl_api_sr_policy_mod_t_print
1350 (vl_api_sr_policy_mod_t * mp, void *handle)
1354 ip6_address_t *segments = 0, *seg;
1355 ip6_address_t *this_address = (ip6_address_t *) mp->segments;
1358 for (i = 0; i < mp->n_segments; i++)
1360 vec_add2 (segments, seg, 1);
1361 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1365 s = format (0, "SCRIPT: sr_policy_mod ");
1367 s = format (s, "BSID: %U", format_ip6_address,
1368 (ip6_address_t *) mp->bsid_addr);
1370 s = format (s, "SR Policy index: %u", ntohl (mp->sr_policy_index));
1372 s = format (s, "Operation: %u", mp->operation);
1374 s = format (s, "SID list index: %u", ntohl (mp->sl_index));
1376 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1378 s = format (s, "{");
1379 vec_foreach (seg, segments)
1381 s = format (s, "%U, ", format_ip6_address, seg);
1383 s = format (s, "\b\b } ");
1388 static void *vl_api_sr_policy_del_t_print
1389 (vl_api_sr_policy_del_t * mp, void *handle)
1393 s = format (0, "SCRIPT: sr_policy_del ");
1394 s = format (s, "To be delivered. Good luck.");
1398 static void *vl_api_classify_add_del_table_t_print
1399 (vl_api_classify_add_del_table_t * mp, void *handle)
1404 s = format (0, "SCRIPT: classify_add_del_table ");
1406 if (mp->is_add == 0)
1408 s = format (s, "table %d ", ntohl (mp->table_index));
1409 s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1413 s = format (s, "nbuckets %d ", ntohl (mp->nbuckets));
1414 s = format (s, "memory_size %d ", ntohl (mp->memory_size));
1415 s = format (s, "skip %d ", ntohl (mp->skip_n_vectors));
1416 s = format (s, "match %d ", ntohl (mp->match_n_vectors));
1417 s = format (s, "next-table %d ", ntohl (mp->next_table_index));
1418 s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
1419 s = format (s, "current-data-flag %d ", ntohl (mp->current_data_flag));
1420 if (mp->current_data_flag)
1421 s = format (s, "current-data-offset %d ",
1422 ntohl (mp->current_data_offset));
1423 s = format (s, "mask hex ");
1424 for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
1425 s = format (s, "%02x", mp->mask[i]);
1432 static void *vl_api_classify_add_del_session_t_print
1433 (vl_api_classify_add_del_session_t * mp, void *handle)
1438 s = format (0, "SCRIPT: classify_add_del_session ");
1440 s = format (s, "table_index %d ", ntohl (mp->table_index));
1441 s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
1442 s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
1443 s = format (s, "advance %d ", ntohl (mp->advance));
1444 s = format (s, "action %d ", mp->action);
1446 s = format (s, "metadata %d ", ntohl (mp->metadata));
1447 if (mp->is_add == 0)
1448 s = format (s, "del ");
1450 s = format (s, "match hex ");
1451 for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1453 if (mp->match[i] != 0)
1460 for (i = 0; i < limit; i++)
1461 s = format (s, "%02x", mp->match[i]);
1466 static void *vl_api_classify_set_interface_ip_table_t_print
1467 (vl_api_classify_set_interface_ip_table_t * mp, void *handle)
1471 s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1474 s = format (s, "ipv6 ");
1476 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1477 s = format (s, "table %d ", ntohl (mp->table_index));
1482 static void *vl_api_classify_set_interface_l2_tables_t_print
1483 (vl_api_classify_set_interface_l2_tables_t * mp, void *handle)
1487 s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1489 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1490 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1491 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1492 s = format (s, "other-table %d ", ntohl (mp->other_table_index));
1493 s = format (s, "is-input %d ", mp->is_input);
1498 static void *vl_api_add_node_next_t_print
1499 (vl_api_add_node_next_t * mp, void *handle)
1503 s = format (0, "SCRIPT: add_node_next ");
1505 s = format (0, "node %s next %s ", mp->node_name, mp->next_name);
1510 static void *vl_api_l2tpv3_create_tunnel_t_print
1511 (vl_api_l2tpv3_create_tunnel_t * mp, void *handle)
1515 s = format (0, "SCRIPT: l2tpv3_create_tunnel ");
1517 s = format (s, "client_address %U our_address %U ",
1518 format_ip6_address, (ip6_address_t *) (mp->client_address),
1519 format_ip6_address, (ip6_address_t *) (mp->our_address));
1520 s = format (s, "local_session_id %d ", ntohl (mp->local_session_id));
1521 s = format (s, "remote_session_id %d ", ntohl (mp->remote_session_id));
1522 s = format (s, "local_cookie %lld ",
1523 clib_net_to_host_u64 (mp->local_cookie));
1524 s = format (s, "remote_cookie %lld ",
1525 clib_net_to_host_u64 (mp->remote_cookie));
1526 if (mp->l2_sublayer_present)
1527 s = format (s, "l2-sublayer-present ");
1532 static void *vl_api_l2tpv3_set_tunnel_cookies_t_print
1533 (vl_api_l2tpv3_set_tunnel_cookies_t * mp, void *handle)
1537 s = format (0, "SCRIPT: l2tpv3_set_tunnel_cookies ");
1539 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1541 s = format (s, "new_local_cookie %llu ",
1542 clib_net_to_host_u64 (mp->new_local_cookie));
1544 s = format (s, "new_remote_cookie %llu ",
1545 clib_net_to_host_u64 (mp->new_remote_cookie));
1550 static void *vl_api_l2tpv3_interface_enable_disable_t_print
1551 (vl_api_l2tpv3_interface_enable_disable_t * mp, void *handle)
1555 s = format (0, "SCRIPT: l2tpv3_interface_enable_disable ");
1557 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1559 if (mp->enable_disable == 0)
1560 s = format (s, "del ");
1565 static void *vl_api_l2tpv3_set_lookup_key_t_print
1566 (vl_api_l2tpv3_set_lookup_key_t * mp, void *handle)
1569 char *str = "unknown";
1571 s = format (0, "SCRIPT: l2tpv3_set_lookup_key ");
1575 case L2T_LOOKUP_SRC_ADDRESS:
1576 str = "lookup_v6_src";
1578 case L2T_LOOKUP_DST_ADDRESS:
1579 str = "lookup_v6_dst";
1581 case L2T_LOOKUP_SESSION_ID:
1582 str = "lookup_session_id";
1588 s = format (s, "%s ", str);
1593 static void *vl_api_sw_if_l2tpv3_tunnel_dump_t_print
1594 (vl_api_sw_if_l2tpv3_tunnel_dump_t * mp, void *handle)
1598 s = format (0, "SCRIPT: sw_if_l2tpv3_tunnel_dump ");
1603 static void *vl_api_vxlan_add_del_tunnel_t_print
1604 (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1607 s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1609 ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
1610 ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
1612 u8 is_grp = ip46_address_is_multicast (&dst);
1613 char *dst_name = is_grp ? "group" : "dst";
1615 s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1616 s = format (s, "%s %U ", dst_name, format_ip46_address,
1617 &dst, IP46_TYPE_ANY);
1620 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1622 if (mp->encap_vrf_id)
1623 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1625 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1627 s = format (s, "vni %d ", ntohl (mp->vni));
1629 s = format (s, "instance %d ", ntohl (mp->instance));
1631 if (mp->is_add == 0)
1632 s = format (s, "del ");
1637 static void *vl_api_vxlan_tunnel_dump_t_print
1638 (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1642 s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1644 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1649 static void *vl_api_geneve_add_del_tunnel_t_print
1650 (vl_api_geneve_add_del_tunnel_t * mp, void *handle)
1653 s = format (0, "SCRIPT: geneve_add_del_tunnel ");
1655 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local_address);
1656 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote_address);
1658 u8 is_grp = ip46_address_is_multicast (&remote);
1659 char *remote_name = is_grp ? "group" : "dst";
1661 s = format (s, "src %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1662 s = format (s, "%s %U ", remote_name, format_ip46_address,
1663 &remote, IP46_TYPE_ANY);
1666 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1668 if (mp->encap_vrf_id)
1669 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1671 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1673 s = format (s, "vni %d ", ntohl (mp->vni));
1675 if (mp->is_add == 0)
1676 s = format (s, "del ");
1681 static void *vl_api_geneve_tunnel_dump_t_print
1682 (vl_api_geneve_tunnel_dump_t * mp, void *handle)
1686 s = format (0, "SCRIPT: geneve_tunnel_dump ");
1688 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1693 static void *vl_api_gre_add_del_tunnel_t_print
1694 (vl_api_gre_add_del_tunnel_t * mp, void *handle)
1698 s = format (0, "SCRIPT: gre_add_del_tunnel ");
1700 s = format (s, "dst %U ", format_ip46_address,
1701 (ip46_address_t *) & (mp->dst_address),
1702 mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
1704 s = format (s, "src %U ", format_ip46_address,
1705 (ip46_address_t *) & (mp->src_address),
1706 mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
1708 s = format (s, "instance %d ", ntohl (mp->instance));
1710 if (mp->tunnel_type == GRE_TUNNEL_TYPE_TEB)
1711 s = format (s, "teb ");
1713 if (mp->tunnel_type == GRE_TUNNEL_TYPE_ERSPAN)
1714 s = format (s, "erspan %d ", ntohs (mp->session_id));
1716 if (mp->outer_fib_id)
1717 s = format (s, "outer-fib-id %d ", ntohl (mp->outer_fib_id));
1719 if (mp->is_add == 0)
1720 s = format (s, "del ");
1725 static void *vl_api_gre_tunnel_dump_t_print
1726 (vl_api_gre_tunnel_dump_t * mp, void *handle)
1730 s = format (0, "SCRIPT: gre_tunnel_dump ");
1732 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1737 static void *vl_api_l2_fib_clear_table_t_print
1738 (vl_api_l2_fib_clear_table_t * mp, void *handle)
1742 s = format (0, "SCRIPT: l2_fib_clear_table ");
1747 static void *vl_api_l2_interface_efp_filter_t_print
1748 (vl_api_l2_interface_efp_filter_t * mp, void *handle)
1752 s = format (0, "SCRIPT: l2_interface_efp_filter ");
1754 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1755 if (mp->enable_disable)
1756 s = format (s, "enable ");
1758 s = format (s, "disable ");
1763 static void *vl_api_l2_interface_vlan_tag_rewrite_t_print
1764 (vl_api_l2_interface_vlan_tag_rewrite_t * mp, void *handle)
1768 s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
1770 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1771 s = format (s, "vtr_op %d ", ntohl (mp->vtr_op));
1772 s = format (s, "push_dot1q %d ", ntohl (mp->push_dot1q));
1773 s = format (s, "tag1 %d ", ntohl (mp->tag1));
1774 s = format (s, "tag2 %d ", ntohl (mp->tag2));
1779 static void *vl_api_create_vhost_user_if_t_print
1780 (vl_api_create_vhost_user_if_t * mp, void *handle)
1784 s = format (0, "SCRIPT: create_vhost_user_if ");
1786 s = format (s, "socket %s ", mp->sock_filename);
1788 s = format (s, "server ");
1790 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
1792 s = format (s, "tag %s", mp->tag);
1797 static void *vl_api_modify_vhost_user_if_t_print
1798 (vl_api_modify_vhost_user_if_t * mp, void *handle)
1802 s = format (0, "SCRIPT: modify_vhost_user_if ");
1804 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1805 s = format (s, "socket %s ", mp->sock_filename);
1807 s = format (s, "server ");
1809 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
1814 static void *vl_api_delete_vhost_user_if_t_print
1815 (vl_api_delete_vhost_user_if_t * mp, void *handle)
1819 s = format (0, "SCRIPT: delete_vhost_user_if ");
1820 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1825 static void *vl_api_sw_interface_vhost_user_dump_t_print
1826 (vl_api_sw_interface_vhost_user_dump_t * mp, void *handle)
1830 s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
1835 static void *vl_api_sw_interface_dump_t_print
1836 (vl_api_sw_interface_dump_t * mp, void *handle)
1840 s = format (0, "SCRIPT: sw_interface_dump ");
1842 if (mp->name_filter_valid)
1843 s = format (s, "name_filter %s ", mp->name_filter);
1845 s = format (s, "all ");
1850 static void *vl_api_l2_fib_table_dump_t_print
1851 (vl_api_l2_fib_table_dump_t * mp, void *handle)
1855 s = format (0, "SCRIPT: l2_fib_table_dump ");
1857 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
1862 static void *vl_api_control_ping_t_print
1863 (vl_api_control_ping_t * mp, void *handle)
1867 s = format (0, "SCRIPT: control_ping ");
1872 static void *vl_api_want_interface_events_t_print
1873 (vl_api_want_interface_events_t * mp, void *handle)
1877 s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
1878 ntohl (mp->pid), ntohl (mp->enable_disable));
1884 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
1888 s = format (0, "SCRIPT: cli ");
1893 static void *vl_api_cli_inband_t_print
1894 (vl_api_cli_inband_t * mp, void *handle)
1898 u32 length = ntohl (mp->length);
1900 vec_validate (cmd, length);
1901 clib_memcpy (cmd, mp->cmd, length);
1903 s = format (0, "SCRIPT: exec %v ", cmd);
1909 static void *vl_api_memclnt_create_t_print
1910 (vl_api_memclnt_create_t * mp, void *handle)
1914 s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
1919 static void *vl_api_sockclnt_create_t_print
1920 (vl_api_sockclnt_create_t * mp, void *handle)
1924 s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name);
1929 static void *vl_api_show_version_t_print
1930 (vl_api_show_version_t * mp, void *handle)
1934 s = format (0, "SCRIPT: show_version ");
1939 static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
1940 (vl_api_vxlan_gpe_add_del_tunnel_t * mp, void *handle)
1944 s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
1946 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local);
1947 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote);
1949 u8 is_grp = ip46_address_is_multicast (&remote);
1950 char *remote_name = is_grp ? "group" : "remote";
1952 s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1953 s = format (s, "%s %U ", remote_name, format_ip46_address,
1954 &remote, IP46_TYPE_ANY);
1957 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1958 s = format (s, "protocol %d ", ntohl (mp->protocol));
1960 s = format (s, "vni %d ", ntohl (mp->vni));
1962 if (mp->is_add == 0)
1963 s = format (s, "del ");
1965 if (mp->encap_vrf_id)
1966 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1968 if (mp->decap_vrf_id)
1969 s = format (s, "decap-vrf-id %d ", ntohl (mp->decap_vrf_id));
1974 static void *vl_api_vxlan_gpe_tunnel_dump_t_print
1975 (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
1979 s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
1981 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1986 static void *vl_api_interface_name_renumber_t_print
1987 (vl_api_interface_name_renumber_t * mp, void *handle)
1991 s = format (0, "SCRIPT: interface_renumber ");
1993 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1995 s = format (s, "new_show_dev_instance %d ",
1996 ntohl (mp->new_show_dev_instance));
2001 static void *vl_api_ip_probe_neighbor_t_print
2002 (vl_api_ip_probe_neighbor_t * mp, void *handle)
2006 s = format (0, "SCRIPT: ip_probe_neighbor ");
2007 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2009 s = format (s, "address %U ", format_ip6_address, &mp->dst_address);
2011 s = format (s, "address %U ", format_ip4_address, &mp->dst_address);
2016 static void *vl_api_ip_scan_neighbor_enable_disable_t_print
2017 (vl_api_ip_scan_neighbor_enable_disable_t * mp, void *handle)
2021 s = format (0, "SCRIPT: ip_scan_neighbor_enable_disable ");
2025 case IP_SCAN_V4_NEIGHBORS:
2026 s = format (s, "ip4 ");
2028 case IP_SCAN_V6_NEIGHBORS:
2029 s = format (s, "ip6 ");
2031 case IP_SCAN_V46_NEIGHBORS:
2032 s = format (s, "both ");
2035 s = format (s, "disable ");
2038 s = format (s, "interval %d ", mp->scan_interval);
2039 s = format (s, "max-time %d ", mp->max_proc_time);
2040 s = format (s, "max-update %d ", mp->max_update);
2041 s = format (s, "delay %d ", mp->scan_int_delay);
2042 s = format (s, "stale %d ", mp->stale_threshold);
2047 static void *vl_api_want_ip4_arp_events_t_print
2048 (vl_api_want_ip4_arp_events_t * mp, void *handle)
2052 s = format (0, "SCRIPT: want_ip4_arp_events ");
2053 s = format (s, "pid %d address %U ", ntohl (mp->pid),
2054 format_ip4_address, &mp->address);
2055 if (mp->enable_disable == 0)
2056 s = format (s, "del ");
2061 static void *vl_api_want_ip6_nd_events_t_print
2062 (vl_api_want_ip6_nd_events_t * mp, void *handle)
2066 s = format (0, "SCRIPT: want_ip6_nd_events ");
2067 s = format (s, "pid %d address %U ", ntohl (mp->pid),
2068 format_ip6_address, mp->address);
2069 if (mp->enable_disable == 0)
2070 s = format (s, "del ");
2075 static void *vl_api_want_l2_macs_events_t_print
2076 (vl_api_want_l2_macs_events_t * mp, void *handle)
2080 s = format (0, "SCRIPT: want_l2_macs_events ");
2081 s = format (s, "learn-limit %d ", ntohl (mp->learn_limit));
2082 s = format (s, "scan-delay %d ", (u32) mp->scan_delay);
2083 s = format (s, "max-entries %d ", (u32) mp->max_macs_in_event * 10);
2084 if (mp->enable_disable == 0)
2085 s = format (s, "disable");
2090 static void *vl_api_input_acl_set_interface_t_print
2091 (vl_api_input_acl_set_interface_t * mp, void *handle)
2095 s = format (0, "SCRIPT: input_acl_set_interface ");
2097 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2098 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2099 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2100 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2102 if (mp->is_add == 0)
2103 s = format (s, "del ");
2108 static void *vl_api_output_acl_set_interface_t_print
2109 (vl_api_output_acl_set_interface_t * mp, void *handle)
2113 s = format (0, "SCRIPT: output_acl_set_interface ");
2115 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2116 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2117 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2118 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2120 if (mp->is_add == 0)
2121 s = format (s, "del ");
2126 static void *vl_api_ip_address_dump_t_print
2127 (vl_api_ip_address_dump_t * mp, void *handle)
2131 s = format (0, "SCRIPT: ip6_address_dump ");
2132 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2133 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2139 vl_api_ip_dump_t_print (vl_api_ip_dump_t * mp, void *handle)
2143 s = format (0, "SCRIPT: ip_dump ");
2144 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2149 static void *vl_api_cop_interface_enable_disable_t_print
2150 (vl_api_cop_interface_enable_disable_t * mp, void *handle)
2154 s = format (0, "SCRIPT: cop_interface_enable_disable ");
2155 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2156 if (mp->enable_disable)
2157 s = format (s, "enable ");
2159 s = format (s, "disable ");
2164 static void *vl_api_cop_whitelist_enable_disable_t_print
2165 (vl_api_cop_whitelist_enable_disable_t * mp, void *handle)
2169 s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
2170 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2171 s = format (s, "fib-id %d ", ntohl (mp->fib_id));
2173 s = format (s, "ip4 ");
2175 s = format (s, "ip6 ");
2176 if (mp->default_cop)
2177 s = format (s, "default ");
2182 static void *vl_api_af_packet_create_t_print
2183 (vl_api_af_packet_create_t * mp, void *handle)
2187 s = format (0, "SCRIPT: af_packet_create ");
2188 s = format (s, "host_if_name %s ", mp->host_if_name);
2189 if (mp->use_random_hw_addr)
2190 s = format (s, "hw_addr random ");
2192 s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
2197 static void *vl_api_af_packet_delete_t_print
2198 (vl_api_af_packet_delete_t * mp, void *handle)
2202 s = format (0, "SCRIPT: af_packet_delete ");
2203 s = format (s, "host_if_name %s ", mp->host_if_name);
2209 format_policer_action (u8 * s, va_list * va)
2211 u32 action = va_arg (*va, u32);
2212 u32 dscp = va_arg (*va, u32);
2215 if (action == SSE2_QOS_ACTION_DROP)
2216 s = format (s, "drop");
2217 else if (action == SSE2_QOS_ACTION_TRANSMIT)
2218 s = format (s, "transmit");
2219 else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
2221 s = format (s, "mark-and-transmit ");
2224 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
2230 s = format (s, "%s", t);
2235 static void *vl_api_policer_add_del_t_print
2236 (vl_api_policer_add_del_t * mp, void *handle)
2240 s = format (0, "SCRIPT: policer_add_del ");
2241 s = format (s, "name %s ", mp->name);
2242 s = format (s, "cir %d ", mp->cir);
2243 s = format (s, "eir %d ", mp->eir);
2244 s = format (s, "cb %d ", mp->cb);
2245 s = format (s, "eb %d ", mp->eb);
2247 switch (mp->rate_type)
2249 case SSE2_QOS_RATE_KBPS:
2250 s = format (s, "rate_type kbps ");
2252 case SSE2_QOS_RATE_PPS:
2253 s = format (s, "rate_type pps ");
2259 switch (mp->round_type)
2261 case SSE2_QOS_ROUND_TO_CLOSEST:
2262 s = format (s, "round_type closest ");
2264 case SSE2_QOS_ROUND_TO_UP:
2265 s = format (s, "round_type up ");
2267 case SSE2_QOS_ROUND_TO_DOWN:
2268 s = format (s, "round_type down ");
2276 case SSE2_QOS_POLICER_TYPE_1R2C:
2277 s = format (s, "type 1r2c ");
2279 case SSE2_QOS_POLICER_TYPE_1R3C_RFC_2697:
2280 s = format (s, "type 1r3c ");
2282 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_2698:
2283 s = format (s, "type 2r3c-2698 ");
2285 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_4115:
2286 s = format (s, "type 2r3c-4115 ");
2288 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1:
2289 s = format (s, "type 2r3c-mef5cf1 ");
2295 s = format (s, "conform_action %U ", format_policer_action,
2296 mp->conform_action_type, mp->conform_dscp);
2297 s = format (s, "exceed_action %U ", format_policer_action,
2298 mp->exceed_action_type, mp->exceed_dscp);
2299 s = format (s, "violate_action %U ", format_policer_action,
2300 mp->violate_action_type, mp->violate_dscp);
2302 if (mp->color_aware)
2303 s = format (s, "color-aware ");
2304 if (mp->is_add == 0)
2305 s = format (s, "del ");
2310 static void *vl_api_policer_dump_t_print
2311 (vl_api_policer_dump_t * mp, void *handle)
2315 s = format (0, "SCRIPT: policer_dump ");
2316 if (mp->match_name_valid)
2317 s = format (s, "name %s ", mp->match_name);
2322 static void *vl_api_policer_classify_set_interface_t_print
2323 (vl_api_policer_classify_set_interface_t * mp, void *handle)
2327 s = format (0, "SCRIPT: policer_classify_set_interface ");
2328 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2329 if (mp->ip4_table_index != ~0)
2330 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2331 if (mp->ip6_table_index != ~0)
2332 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2333 if (mp->l2_table_index != ~0)
2334 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2335 if (mp->is_add == 0)
2336 s = format (s, "del ");
2341 static void *vl_api_policer_classify_dump_t_print
2342 (vl_api_policer_classify_dump_t * mp, void *handle)
2346 s = format (0, "SCRIPT: policer_classify_dump ");
2349 case POLICER_CLASSIFY_TABLE_IP4:
2350 s = format (s, "type ip4 ");
2352 case POLICER_CLASSIFY_TABLE_IP6:
2353 s = format (s, "type ip6 ");
2355 case POLICER_CLASSIFY_TABLE_L2:
2356 s = format (s, "type l2 ");
2365 static void *vl_api_sw_interface_clear_stats_t_print
2366 (vl_api_sw_interface_clear_stats_t * mp, void *handle)
2370 s = format (0, "SCRIPT: sw_interface_clear_stats ");
2371 if (mp->sw_if_index != ~0)
2372 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2377 static void *vl_api_mpls_tunnel_dump_t_print
2378 (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2382 s = format (0, "SCRIPT: mpls_tunnel_dump ");
2384 s = format (s, "tunnel_index %d ", ntohl (mp->tunnel_index));
2389 static void *vl_api_mpls_fib_dump_t_print
2390 (vl_api_mpls_fib_dump_t * mp, void *handle)
2394 s = format (0, "SCRIPT: mpls_fib_decap_dump ");
2399 static void *vl_api_ip_fib_dump_t_print
2400 (vl_api_ip_fib_dump_t * mp, void *handle)
2404 s = format (0, "SCRIPT: ip_fib_dump ");
2409 static void *vl_api_ip6_fib_dump_t_print
2410 (vl_api_ip6_fib_dump_t * mp, void *handle)
2414 s = format (0, "SCRIPT: ip6_fib_dump ");
2419 static void *vl_api_classify_table_ids_t_print
2420 (vl_api_classify_table_ids_t * mp, void *handle)
2424 s = format (0, "SCRIPT: classify_table_ids ");
2429 static void *vl_api_classify_table_by_interface_t_print
2430 (vl_api_classify_table_by_interface_t * mp, void *handle)
2434 s = format (0, "SCRIPT: classify_table_by_interface ");
2435 if (mp->sw_if_index != ~0)
2436 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2441 static void *vl_api_classify_table_info_t_print
2442 (vl_api_classify_table_info_t * mp, void *handle)
2446 s = format (0, "SCRIPT: classify_table_info ");
2447 if (mp->table_id != ~0)
2448 s = format (s, "table_id %d ", ntohl (mp->table_id));
2453 static void *vl_api_classify_session_dump_t_print
2454 (vl_api_classify_session_dump_t * mp, void *handle)
2458 s = format (0, "SCRIPT: classify_session_dump ");
2459 if (mp->table_id != ~0)
2460 s = format (s, "table_id %d ", ntohl (mp->table_id));
2465 static void *vl_api_set_ipfix_exporter_t_print
2466 (vl_api_set_ipfix_exporter_t * mp, void *handle)
2470 s = format (0, "SCRIPT: set_ipfix_exporter ");
2472 s = format (s, "collector-address %U ", format_ip4_address,
2473 (ip4_address_t *) mp->collector_address);
2474 s = format (s, "collector-port %d ", ntohs (mp->collector_port));
2475 s = format (s, "src-address %U ", format_ip4_address,
2476 (ip4_address_t *) mp->src_address);
2477 s = format (s, "vrf-id %d ", ntohl (mp->vrf_id));
2478 s = format (s, "path-mtu %d ", ntohl (mp->path_mtu));
2479 s = format (s, "template-interval %d ", ntohl (mp->template_interval));
2480 s = format (s, "udp-checksum %d ", mp->udp_checksum);
2485 static void *vl_api_ipfix_exporter_dump_t_print
2486 (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2490 s = format (0, "SCRIPT: ipfix_exporter_dump ");
2495 static void *vl_api_set_ipfix_classify_stream_t_print
2496 (vl_api_set_ipfix_classify_stream_t * mp, void *handle)
2500 s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2502 s = format (s, "domain-id %d ", ntohl (mp->domain_id));
2503 s = format (s, "src-port %d ", ntohs (mp->src_port));
2508 static void *vl_api_ipfix_classify_stream_dump_t_print
2509 (vl_api_ipfix_classify_stream_dump_t * mp, void *handle)
2513 s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2518 static void *vl_api_ipfix_classify_table_add_del_t_print
2519 (vl_api_ipfix_classify_table_add_del_t * mp, void *handle)
2523 s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2525 s = format (s, "table-id %d ", ntohl (mp->table_id));
2526 s = format (s, "ip-version %d ", mp->ip_version);
2527 s = format (s, "transport-protocol %d ", mp->transport_protocol);
2532 static void *vl_api_ipfix_classify_table_dump_t_print
2533 (vl_api_ipfix_classify_table_dump_t * mp, void *handle)
2537 s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2542 static void *vl_api_sw_interface_span_enable_disable_t_print
2543 (vl_api_sw_interface_span_enable_disable_t * mp, void *handle)
2547 s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2548 s = format (s, "src_sw_if_index %u ", ntohl (mp->sw_if_index_from));
2549 s = format (s, "dst_sw_if_index %u ", ntohl (mp->sw_if_index_to));
2552 s = format (s, "l2 ");
2557 s = format (s, "disable ");
2560 s = format (s, "rx ");
2563 s = format (s, "tx ");
2567 s = format (s, "both ");
2575 vl_api_sw_interface_span_dump_t_print (vl_api_sw_interface_span_dump_t * mp,
2580 s = format (0, "SCRIPT: sw_interface_span_dump ");
2583 s = format (s, "l2 ");
2588 static void *vl_api_get_next_index_t_print
2589 (vl_api_get_next_index_t * mp, void *handle)
2593 s = format (0, "SCRIPT: get_next_index ");
2594 s = format (s, "node-name %s ", mp->node_name);
2595 s = format (s, "next-node-name %s ", mp->next_name);
2600 static void *vl_api_pg_create_interface_t_print
2601 (vl_api_pg_create_interface_t * mp, void *handle)
2605 s = format (0, "SCRIPT: pg_create_interface ");
2606 s = format (0, "if_id %d", ntohl (mp->interface_id));
2611 static void *vl_api_pg_capture_t_print
2612 (vl_api_pg_capture_t * mp, void *handle)
2616 s = format (0, "SCRIPT: pg_capture ");
2617 s = format (0, "if_id %d ", ntohl (mp->interface_id));
2618 s = format (0, "pcap %s", mp->pcap_file_name);
2619 if (mp->count != ~0)
2620 s = format (s, "count %d ", ntohl (mp->count));
2621 if (!mp->is_enabled)
2622 s = format (s, "disable");
2627 static void *vl_api_pg_enable_disable_t_print
2628 (vl_api_pg_enable_disable_t * mp, void *handle)
2632 s = format (0, "SCRIPT: pg_enable_disable ");
2633 if (ntohl (mp->stream_name_length) > 0)
2634 s = format (s, "stream %s", mp->stream_name);
2635 if (!mp->is_enabled)
2636 s = format (s, "disable");
2641 static void *vl_api_ip_source_and_port_range_check_add_del_t_print
2642 (vl_api_ip_source_and_port_range_check_add_del_t * mp, void *handle)
2647 s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2649 s = format (s, "%U/%d ", format_ip6_address, mp->address,
2652 s = format (s, "%U/%d ", format_ip4_address, mp->address,
2655 for (i = 0; i < mp->number_of_ranges; i++)
2657 s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2660 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
2662 if (mp->is_add == 0)
2663 s = format (s, "del ");
2668 static void *vl_api_ip_source_and_port_range_check_interface_add_del_t_print
2669 (vl_api_ip_source_and_port_range_check_interface_add_del_t * mp,
2674 s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2676 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2678 if (mp->tcp_out_vrf_id != ~0)
2679 s = format (s, "tcp-out-vrf %d ", ntohl (mp->tcp_out_vrf_id));
2681 if (mp->udp_out_vrf_id != ~0)
2682 s = format (s, "udp-out-vrf %d ", ntohl (mp->udp_out_vrf_id));
2684 if (mp->tcp_in_vrf_id != ~0)
2685 s = format (s, "tcp-in-vrf %d ", ntohl (mp->tcp_in_vrf_id));
2687 if (mp->udp_in_vrf_id != ~0)
2688 s = format (s, "udp-in-vrf %d ", ntohl (mp->udp_in_vrf_id));
2690 if (mp->is_add == 0)
2691 s = format (s, "del ");
2696 static void *vl_api_lisp_enable_disable_t_print
2697 (vl_api_lisp_enable_disable_t * mp, void *handle)
2701 s = format (0, "SCRIPT: lisp_enable_disable %s",
2702 mp->is_en ? "enable" : "disable");
2707 static void *vl_api_gpe_add_del_iface_t_print
2708 (vl_api_gpe_add_del_iface_t * mp, void *handle)
2712 s = format (0, "SCRIPT: gpe_add_del_iface ");
2714 s = format (s, "%s ", mp->is_add ? "up" : "down");
2715 s = format (s, "vni %d ", mp->vni);
2716 s = format (s, "%s %d ", mp->is_l2 ? "bd_id" : "table_id", mp->dp_table);
2721 static void *vl_api_lisp_pitr_set_locator_set_t_print
2722 (vl_api_lisp_pitr_set_locator_set_t * mp, void *handle)
2726 s = format (0, "SCRIPT: lisp_pitr_set_locator_set ");
2729 s = format (s, "locator-set %s ", mp->ls_name);
2731 s = format (s, "del");
2737 format_lisp_flat_eid (u8 * s, va_list * args)
2739 u32 type = va_arg (*args, u32);
2740 u8 *eid = va_arg (*args, u8 *);
2741 u32 eid_len = va_arg (*args, u32);
2746 return format (s, "%U/%d", format_ip4_address, eid, eid_len);
2748 return format (s, "%U/%d", format_ip6_address, eid, eid_len);
2750 return format (s, "%U", format_ethernet_address, eid);
2755 static void *vl_api_lisp_add_del_remote_mapping_t_print
2756 (vl_api_lisp_add_del_remote_mapping_t * mp, void *handle)
2761 s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
2764 s = format (s, "del-all ");
2766 s = format (s, "%s ", mp->is_add ? "add" : "del");
2767 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2769 s = format (s, "eid %U ", format_lisp_flat_eid,
2770 mp->eid_type, mp->eid, mp->eid_len);
2774 s = format (s, "seid %U ", format_lisp_flat_eid,
2775 mp->eid_type, mp->seid, mp->seid_len);
2777 rloc_num = clib_net_to_host_u32 (mp->rloc_num);
2780 s = format (s, "action %d", mp->action);
2785 static void *vl_api_lisp_add_del_adjacency_t_print
2786 (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
2790 s = format (0, "SCRIPT: lisp_add_del_adjacency ");
2792 s = format (s, "%s ", mp->is_add ? "add" : "del");
2793 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2794 s = format (s, "reid %U leid %U ",
2795 format_lisp_flat_eid, mp->eid_type, mp->reid, mp->reid_len,
2796 format_lisp_flat_eid, mp->eid_type, mp->leid, mp->leid_len);
2801 static void *vl_api_lisp_add_del_map_request_itr_rlocs_t_print
2802 (vl_api_lisp_add_del_map_request_itr_rlocs_t * mp, void *handle)
2806 s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
2809 s = format (s, "%s", mp->locator_set_name);
2811 s = format (s, "del");
2816 static void *vl_api_lisp_eid_table_add_del_map_t_print
2817 (vl_api_lisp_eid_table_add_del_map_t * mp, void *handle)
2821 s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
2824 s = format (s, "del ");
2826 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2827 s = format (s, "%s %d ",
2828 mp->is_l2 ? "bd_index" : "vrf",
2829 clib_net_to_host_u32 (mp->dp_table));
2833 static void *vl_api_lisp_add_del_local_eid_t_print
2834 (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
2838 s = format (0, "SCRIPT: lisp_add_del_local_eid ");
2841 s = format (s, "del ");
2843 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2844 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
2846 s = format (s, "locator-set %s ", mp->locator_set_name);
2849 u32 key_id = mp->key_id;
2850 s = format (s, "key-id %U", format_hmac_key_id, key_id);
2851 s = format (s, "secret-key %s", mp->key);
2856 static void *vl_api_gpe_add_del_fwd_entry_t_print
2857 (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle)
2861 s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO");
2866 static void *vl_api_lisp_add_del_map_resolver_t_print
2867 (vl_api_lisp_add_del_map_resolver_t * mp, void *handle)
2871 s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
2874 s = format (s, "del ");
2877 s = format (s, "%U ", format_ip6_address, mp->ip_address);
2879 s = format (s, "%U ", format_ip4_address, mp->ip_address);
2884 static void *vl_api_gpe_enable_disable_t_print
2885 (vl_api_gpe_enable_disable_t * mp, void *handle)
2889 s = format (0, "SCRIPT: gpe_enable_disable ");
2891 s = format (s, "%s ", mp->is_en ? "enable" : "disable");
2896 static void *vl_api_lisp_add_del_locator_set_t_print
2897 (vl_api_lisp_add_del_locator_set_t * mp, void *handle)
2901 s = format (0, "SCRIPT: lisp_add_del_locator_set ");
2904 s = format (s, "del ");
2906 s = format (s, "locator-set %s ", mp->locator_set_name);
2911 static void *vl_api_lisp_add_del_locator_t_print
2912 (vl_api_lisp_add_del_locator_t * mp, void *handle)
2916 s = format (0, "SCRIPT: lisp_add_del_locator ");
2919 s = format (s, "del ");
2921 s = format (s, "locator-set %s ", mp->locator_set_name);
2922 s = format (s, "sw_if_index %d ", mp->sw_if_index);
2923 s = format (s, "p %d w %d ", mp->priority, mp->weight);
2928 static void *vl_api_lisp_locator_set_dump_t_print
2929 (vl_api_lisp_locator_set_dump_t * mp, void *handle)
2933 s = format (0, "SCRIPT: lisp_locator_set_dump ");
2934 if (mp->filter == 1)
2935 s = format (s, "local");
2936 else if (mp->filter == 2)
2937 s = format (s, "remote");
2942 static void *vl_api_lisp_locator_dump_t_print
2943 (vl_api_lisp_locator_dump_t * mp, void *handle)
2947 s = format (0, "SCRIPT: lisp_locator_dump ");
2948 if (mp->is_index_set)
2949 s = format (s, "ls_index %d", clib_net_to_host_u32 (mp->ls_index));
2951 s = format (s, "ls_name %s", mp->ls_name);
2956 static void *vl_api_lisp_map_request_mode_t_print
2957 (vl_api_lisp_map_request_mode_t * mp, void *handle)
2961 s = format (0, "SCRIPT: lisp_map_request_mode ");
2966 s = format (s, "dst-only");
2969 s = format (s, "src-dst");
2977 static void *vl_api_lisp_eid_table_dump_t_print
2978 (vl_api_lisp_eid_table_dump_t * mp, void *handle)
2982 s = format (0, "SCRIPT: lisp_eid_table_dump ");
2986 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2987 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type,
2988 mp->eid, mp->prefix_length);
2992 s = format (s, "local ");
2995 s = format (s, "remote ");
3002 static void *vl_api_lisp_rloc_probe_enable_disable_t_print
3003 (vl_api_lisp_rloc_probe_enable_disable_t * mp, void *handle)
3007 s = format (0, "SCRIPT: lisp_rloc_probe_enable_disable ");
3009 s = format (s, "enable");
3011 s = format (s, "disable");
3016 static void *vl_api_lisp_map_register_enable_disable_t_print
3017 (vl_api_lisp_map_register_enable_disable_t * mp, void *handle)
3021 s = format (0, "SCRIPT: lisp_map_register_enable_disable ");
3023 s = format (s, "enable");
3025 s = format (s, "disable");
3030 static void *vl_api_lisp_adjacencies_get_t_print
3031 (vl_api_lisp_adjacencies_get_t * mp, void *handle)
3035 s = format (0, "SCRIPT: lisp_adjacencies_get ");
3036 s = format (s, "vni %d", clib_net_to_host_u32 (mp->vni));
3041 static void *vl_api_lisp_eid_table_map_dump_t_print
3042 (vl_api_lisp_eid_table_map_dump_t * mp, void *handle)
3046 s = format (0, "SCRIPT: lisp_eid_table_map_dump ");
3049 s = format (s, "l2");
3051 s = format (s, "l3");
3056 static void *vl_api_ipsec_gre_add_del_tunnel_t_print
3057 (vl_api_ipsec_gre_add_del_tunnel_t * mp, void *handle)
3061 s = format (0, "SCRIPT: ipsec_gre_add_del_tunnel ");
3063 s = format (s, "dst %U ", format_ip4_address,
3064 (ip4_address_t *) & (mp->dst_address));
3066 s = format (s, "src %U ", format_ip4_address,
3067 (ip4_address_t *) & (mp->src_address));
3069 s = format (s, "local_sa %d ", ntohl (mp->local_sa_id));
3071 s = format (s, "remote_sa %d ", ntohl (mp->remote_sa_id));
3073 if (mp->is_add == 0)
3074 s = format (s, "del ");
3079 static void *vl_api_ipsec_gre_tunnel_dump_t_print
3080 (vl_api_ipsec_gre_tunnel_dump_t * mp, void *handle)
3084 s = format (0, "SCRIPT: ipsec_gre_tunnel_dump ");
3086 if (mp->sw_if_index != ~0)
3087 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3092 static void *vl_api_l2_interface_pbb_tag_rewrite_t_print
3093 (vl_api_l2_interface_pbb_tag_rewrite_t * mp, void *handle)
3096 u32 vtr_op = ntohl (mp->vtr_op);
3098 s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
3100 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3101 s = format (s, "vtr_op %d ", vtr_op);
3102 if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
3104 if (vtr_op == L2_VTR_TRANSLATE_2_2)
3105 s = format (s, "%d ", ntohs (mp->outer_tag));
3106 s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
3107 s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
3108 s = format (s, "sid %d ", ntohl (mp->i_sid));
3109 s = format (s, "vlanid %d ", ntohs (mp->b_vlanid));
3114 static void *vl_api_flow_classify_set_interface_t_print
3115 (vl_api_flow_classify_set_interface_t * mp, void *handle)
3119 s = format (0, "SCRIPT: flow_classify_set_interface ");
3120 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3121 if (mp->ip4_table_index != ~0)
3122 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
3123 if (mp->ip6_table_index != ~0)
3124 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
3125 if (mp->is_add == 0)
3126 s = format (s, "del ");
3132 vl_api_punt_t_print (vl_api_punt_t * mp, void *handle)
3136 s = format (0, "SCRIPT: punt ");
3138 if (mp->ipv != (u8) ~ 0)
3139 s = format (s, "ip %d ", mp->ipv);
3141 s = format (s, "protocol %d ", mp->l4_protocol);
3143 if (mp->l4_port != (u16) ~ 0)
3144 s = format (s, "port %d ", ntohs (mp->l4_port));
3147 s = format (s, "del ");
3152 static void *vl_api_flow_classify_dump_t_print
3153 (vl_api_flow_classify_dump_t * mp, void *handle)
3157 s = format (0, "SCRIPT: flow_classify_dump ");
3160 case FLOW_CLASSIFY_TABLE_IP4:
3161 s = format (s, "type ip4 ");
3163 case FLOW_CLASSIFY_TABLE_IP6:
3164 s = format (s, "type ip6 ");
3173 static void *vl_api_get_first_msg_id_t_print
3174 (vl_api_get_first_msg_id_t * mp, void *handle)
3178 s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
3183 static void *vl_api_ioam_enable_t_print
3184 (vl_api_ioam_enable_t * mp, void *handle)
3188 s = format (0, "SCRIPT: ioam_enable ");
3190 if (mp->trace_enable)
3191 s = format (s, "trace enabled");
3194 s = format (s, "POT enabled");
3197 s = format (s, "Seqno enabled");
3200 s = format (s, "Analyse enabled");
3205 static void *vl_api_ioam_disable_t_print
3206 (vl_api_ioam_disable_t * mp, void *handle)
3210 s = format (0, "SCRIPT: ioam_disable ");
3211 s = format (s, "trace disabled");
3212 s = format (s, "POT disabled");
3213 s = format (s, "Seqno disabled");
3214 s = format (s, "Analyse disabled");
3219 static void *vl_api_feature_enable_disable_t_print
3220 (vl_api_feature_enable_disable_t * mp, void *handle)
3224 s = format (0, "SCRIPT: feature_enable_disable ");
3225 s = format (s, "arc_name %s ", mp->arc_name);
3226 s = format (s, "feature_name %s ", mp->feature_name);
3227 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3229 s = format (s, "disable");
3234 static void *vl_api_sw_interface_tag_add_del_t_print
3235 (vl_api_sw_interface_tag_add_del_t * mp, void *handle)
3239 s = format (0, "SCRIPT: sw_interface_tag_add_del ");
3240 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3242 s = format (s, "tag %s ", mp->tag);
3244 s = format (s, "del ");
3249 static void *vl_api_sw_interface_set_mtu_t_print
3250 (vl_api_sw_interface_set_mtu_t * mp, void *handle)
3254 s = format (0, "SCRIPT: sw_interface_set_mtu ");
3255 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3256 s = format (s, "tag %d ", ntohs (mp->mtu));
3261 static void *vl_api_p2p_ethernet_add_t_print
3262 (vl_api_p2p_ethernet_add_t * mp, void *handle)
3266 s = format (0, "SCRIPT: p2p_ethernet_add ");
3267 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3268 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3273 static void *vl_api_p2p_ethernet_del_t_print
3274 (vl_api_p2p_ethernet_del_t * mp, void *handle)
3278 s = format (0, "SCRIPT: p2p_ethernet_del ");
3279 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3280 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3285 static void *vl_api_tcp_configure_src_addresses_t_print
3286 (vl_api_tcp_configure_src_addresses_t * mp, void *handle)
3290 s = format (0, "SCRIPT: tcp_configure_src_addresses ");
3292 s = format (s, "%U - %U ",
3293 format_ip6_address, (ip6_address_t *) mp->first_address,
3294 format_ip6_address, (ip6_address_t *) mp->last_address);
3296 s = format (s, "%U - %U ",
3297 format_ip4_address, (ip4_address_t *) mp->first_address,
3298 format_ip4_address, (ip4_address_t *) mp->last_address);
3301 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
3306 static void *vl_api_app_namespace_add_del_t_print
3307 (vl_api_app_namespace_add_del_t * mp, void *handle)
3310 u8 len = clib_min (mp->namespace_id_len,
3311 ARRAY_LEN (mp->namespace_id) - 1);
3312 mp->namespace_id[len] = 0;
3313 s = format (0, "SCRIPT: app_namespace_add_del ");
3314 s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d "
3315 "ipv6_fib_id %d", (char *) mp->namespace_id, mp->secret,
3316 clib_net_to_host_u32 (mp->sw_if_index),
3317 clib_net_to_host_u32 (mp->ip4_fib_id),
3318 clib_net_to_host_u32 (mp->ip6_fib_id));
3322 static void *vl_api_lldp_config_t_print
3323 (vl_api_lldp_config_t * mp, void *handle)
3327 s = format (0, "SCRIPT: lldp_config ");
3328 s = format (s, "system_name %s ", mp->system_name);
3329 s = format (s, "tx_hold %d ", ntohl (mp->tx_hold));
3330 s = format (s, "tx_interval %d ", ntohl (mp->tx_interval));
3334 static void *vl_api_dns_enable_disable_t_print
3335 (vl_api_dns_enable_disable_t * mp, void *handle)
3339 s = format (0, "SCRIPT: dns_enable_disable ");
3340 s = format (s, "%s ", mp->enable ? "enable" : "disable");
3345 static void *vl_api_sw_interface_set_lldp_t_print
3346 (vl_api_sw_interface_set_lldp_t * mp, void *handle)
3351 memset (null_data, 0, sizeof (null_data));
3353 s = format (0, "SCRIPT: sw_interface_set_lldp ");
3354 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3356 if (memcmp (mp->port_desc, null_data, sizeof (mp->port_desc)))
3357 s = format (s, "port_desc %s ", mp->port_desc);
3359 if (memcmp (mp->mgmt_ip4, null_data, sizeof (mp->mgmt_ip4)))
3360 s = format (s, "mgmt_ip4 %U ", format_ip4_address, mp->mgmt_ip4);
3362 if (memcmp (mp->mgmt_ip6, null_data, sizeof (mp->mgmt_ip6)))
3363 s = format (s, "mgmt_ip6 %U ", format_ip6_address, mp->mgmt_ip6);
3365 if (memcmp (mp->mgmt_oid, null_data, sizeof (mp->mgmt_oid)))
3366 s = format (s, "mgmt_oid %s ", mp->mgmt_oid);
3368 if (mp->enable == 0)
3369 s = format (s, "disable ");
3374 static void *vl_api_dns_name_server_add_del_t_print
3375 (vl_api_dns_name_server_add_del_t * mp, void *handle)
3379 s = format (0, "SCRIPT: dns_name_server_add_del ");
3381 s = format (s, "%U ", format_ip6_address,
3382 (ip6_address_t *) mp->server_address);
3384 s = format (s, "%U ", format_ip4_address,
3385 (ip4_address_t *) mp->server_address);
3387 if (mp->is_add == 0)
3388 s = format (s, "del ");
3393 static void *vl_api_dns_resolve_name_t_print
3394 (vl_api_dns_resolve_name_t * mp, void *handle)
3398 s = format (0, "SCRIPT: dns_resolve_name ");
3399 s = format (s, "%s ", mp->name);
3403 static void *vl_api_dns_resolve_ip_t_print
3404 (vl_api_dns_resolve_ip_t * mp, void *handle)
3408 s = format (0, "SCRIPT: dns_resolve_ip ");
3410 s = format (s, "%U ", format_ip6_address, mp->address);
3412 s = format (s, "%U ", format_ip4_address, mp->address);
3416 static void *vl_api_session_rule_add_del_t_print
3417 (vl_api_session_rule_add_del_t * mp, void *handle)
3420 char *proto = mp->transport_proto == 0 ? "tcp" : "udp";
3421 s = format (0, "SCRIPT: session_rule_add_del ");
3422 mp->tag[sizeof (mp->tag) - 1] = 0;
3424 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3425 mp->appns_index, mp->scope, proto, format_ip4_address,
3426 (ip4_address_t *) mp->lcl_ip, mp->lcl_plen,
3427 format_ip4_address, (ip4_address_t *) mp->rmt_ip,
3428 mp->rmt_plen, mp->action_index, mp->tag);
3430 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3431 mp->appns_index, mp->scope, proto, format_ip6_address,
3432 (ip6_address_t *) mp->lcl_ip, mp->lcl_plen,
3433 format_ip6_address, (ip6_address_t *) mp->rmt_ip,
3434 mp->rmt_plen, mp->action_index, mp->tag);
3438 static void *vl_api_ip_container_proxy_add_del_t_print
3439 (vl_api_ip_container_proxy_add_del_t * mp, void *handle)
3442 s = format (0, "SCRIPT: ip_container_proxy_add_del ");
3444 s = format (s, "is_add %d address %U/%d sw_if_index %d",
3445 mp->is_add, format_ip4_address,
3446 (ip4_address_t *) mp->ip, mp->plen, mp->sw_if_index);
3448 s = format (s, "is_add %d address %U/%d sw_if_index %d",
3449 mp->is_add, format_ip6_address,
3450 (ip6_address_t *) mp->ip, mp->plen, mp->sw_if_index);
3454 static void *vl_api_qos_record_enable_disable_t_print
3455 (vl_api_qos_record_enable_disable_t * mp, void *handle)
3459 s = format (0, "SCRIPT: qos_record_enable_disable ");
3460 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3461 s = format (s, "input_source %U ", format_qos_source, mp->input_source);
3464 s = format (s, "disable ");
3469 #define foreach_custom_print_no_arg_function \
3470 _(lisp_eid_table_vni_dump) \
3471 _(lisp_map_resolver_dump) \
3472 _(lisp_map_server_dump) \
3473 _(show_lisp_rloc_probe_state) \
3474 _(show_lisp_map_register_state) \
3475 _(show_lisp_map_request_mode)
3478 static void * vl_api_ ## f ## _t_print \
3479 (vl_api_ ## f ## _t * mp, void * handle) \
3482 s = format (0, "SCRIPT: " #f ); \
3485 foreach_custom_print_no_arg_function
3487 #define foreach_custom_print_function \
3488 _(CREATE_LOOPBACK, create_loopback) \
3489 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
3490 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
3491 _(SW_INTERFACE_EVENT, sw_interface_event) \
3492 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
3493 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
3494 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
3495 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
3496 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
3497 _(SW_INTERFACE_SET_GENEVE_BYPASS, sw_interface_set_geneve_bypass) \
3498 _(TAP_CONNECT, tap_connect) \
3499 _(TAP_MODIFY, tap_modify) \
3500 _(TAP_DELETE, tap_delete) \
3501 _(SW_INTERFACE_TAP_DUMP, sw_interface_tap_dump) \
3502 _(BOND_CREATE, bond_create) \
3503 _(BOND_DELETE, bond_delete) \
3504 _(BOND_ENSLAVE, bond_enslave) \
3505 _(BOND_DETACH_SLAVE, bond_detach_slave) \
3506 _(TAP_CREATE_V2, tap_create_v2) \
3507 _(TAP_DELETE_V2, tap_delete_v2) \
3508 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) \
3509 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \
3510 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
3511 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
3512 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3513 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3514 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
3515 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3516 _(CREATE_SUBIF, create_subif) \
3517 _(OAM_ADD_DEL, oam_add_del) \
3518 _(RESET_FIB, reset_fib) \
3519 _(DHCP_PROXY_CONFIG, dhcp_proxy_config) \
3520 _(DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss) \
3521 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3522 _(SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS, \
3523 sw_interface_ip6_set_link_local_address) \
3524 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \
3525 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \
3526 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
3527 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3528 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3529 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3530 _(SR_POLICY_ADD, sr_policy_add) \
3531 _(SR_POLICY_MOD, sr_policy_mod) \
3532 _(SR_POLICY_DEL, sr_policy_del) \
3533 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3534 _(L2FIB_ADD_DEL, l2fib_add_del) \
3535 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3536 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3537 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3538 _(L2_FLAGS, l2_flags) \
3539 _(BRIDGE_FLAGS, bridge_flags) \
3540 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3541 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3542 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3543 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3544 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3545 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3546 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3547 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3548 _(ADD_NODE_NEXT, add_node_next) \
3549 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \
3550 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \
3551 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \
3552 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \
3553 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
3554 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
3555 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3556 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3557 _(GENEVE_ADD_DEL_TUNNEL, geneve_add_del_tunnel) \
3558 _(GENEVE_TUNNEL_DUMP, geneve_tunnel_dump) \
3559 _(GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel) \
3560 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3561 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3562 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3563 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3564 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3565 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3566 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3567 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3568 _(CONTROL_PING, control_ping) \
3569 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3571 _(CLI_INBAND, cli_inband) \
3572 _(MEMCLNT_CREATE, memclnt_create) \
3573 _(SOCKCLNT_CREATE, sockclnt_create) \
3574 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3575 _(SHOW_VERSION, show_version) \
3576 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3577 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3578 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3579 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3580 _(IP_PROBE_NEIGHBOR, ip_probe_neighbor) \
3581 _(IP_SCAN_NEIGHBOR_ENABLE_DISABLE, ip_scan_neighbor_enable_disable) \
3582 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
3583 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \
3584 _(WANT_L2_MACS_EVENTS, want_l2_macs_events) \
3585 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3586 _(IP_ADDRESS_DUMP, ip_address_dump) \
3587 _(IP_DUMP, ip_dump) \
3588 _(DELETE_LOOPBACK, delete_loopback) \
3589 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3590 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3591 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3592 _(AF_PACKET_CREATE, af_packet_create) \
3593 _(AF_PACKET_DELETE, af_packet_delete) \
3594 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3595 _(MPLS_FIB_DUMP, mpls_fib_dump) \
3596 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3597 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3598 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3599 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3600 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3601 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3602 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3603 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3604 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3605 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3606 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3607 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3608 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3609 _(GET_NEXT_INDEX, get_next_index) \
3610 _(PG_CREATE_INTERFACE,pg_create_interface) \
3611 _(PG_CAPTURE, pg_capture) \
3612 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3613 _(POLICER_ADD_DEL, policer_add_del) \
3614 _(POLICER_DUMP, policer_dump) \
3615 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3616 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3617 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3618 ip_source_and_port_range_check_add_del) \
3619 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3620 ip_source_and_port_range_check_interface_add_del) \
3621 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
3622 _(GPE_ENABLE_DISABLE, gpe_enable_disable) \
3623 _(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \
3624 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
3625 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \
3626 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \
3627 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
3628 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
3629 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
3630 lisp_add_del_map_request_itr_rlocs) \
3631 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
3632 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
3633 _(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \
3634 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
3635 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
3636 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
3637 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
3638 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
3639 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \
3640 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
3641 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \
3642 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
3643 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \
3644 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \
3645 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \
3646 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \
3647 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \
3648 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \
3649 _(IPSEC_GRE_ADD_DEL_TUNNEL, ipsec_gre_add_del_tunnel) \
3650 _(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \
3651 _(DELETE_SUBIF, delete_subif) \
3652 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3654 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3655 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3656 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3657 _(IOAM_ENABLE, ioam_enable) \
3658 _(IOAM_DISABLE, ioam_disable) \
3659 _(IP_FIB_DUMP, ip_fib_dump) \
3660 _(IP6_FIB_DUMP, ip6_fib_dump) \
3661 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3662 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3663 _(SW_INTERFACE_SET_MTU, sw_interface_set_mtu) \
3664 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3665 _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
3666 _(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
3667 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
3668 _(LLDP_CONFIG, lldp_config) \
3669 _(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \
3670 _(DNS_ENABLE_DISABLE, dns_enable_disable) \
3671 _(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \
3672 _(DNS_RESOLVE_NAME, dns_resolve_name) \
3673 _(DNS_RESOLVE_IP, dns_resolve_ip) \
3674 _(SESSION_RULE_ADD_DEL, session_rule_add_del) \
3675 _(OUTPUT_ACL_SET_INTERFACE, output_acl_set_interface) \
3676 _(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable)
3678 vl_msg_api_custom_dump_configure (api_main_t * am)
3680 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3681 = (void *) vl_api_##f##_t_print;
3682 foreach_custom_print_function;
3687 * fd.io coding-style-patch-verification: ON
3689 * Local Variables: eval: (c-set-style "gnu") End: