2 *------------------------------------------------------------------
3 * custom_dump.c - pretty-print API messages for replay
5 * Copyright (c) 2014-2016 Cisco and/or its affiliates.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at:
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,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *------------------------------------------------------------------
20 #include <vnet/vnet.h>
21 #include <vnet/ip/ip.h>
22 #include <vnet/unix/tuntap.h>
23 #include <vnet/mpls/mpls.h>
24 #include <vnet/dhcp/dhcp_proxy.h>
25 #include <vnet/l2tp/l2tp.h>
26 #include <vnet/l2/l2_input.h>
27 #include <vnet/srv6/sr.h>
28 #include <vnet/vxlan-gpe/vxlan_gpe.h>
29 #include <vnet/geneve/geneve.h>
30 #include <vnet/classify/policer_classify.h>
31 #include <vnet/policer/xlate.h>
32 #include <vnet/policer/policer.h>
33 #include <vnet/classify/flow_classify.h>
34 #include <vlib/vlib.h>
35 #include <vlib/unix/unix.h>
36 #include <vlibapi/api.h>
37 #include <vlibmemory/api.h>
38 #include <vnet/lisp-cp/lisp_types.h>
40 #include <vpp/stats/stats.h>
41 #include <vpp/oam/oam.h>
43 #include <vnet/ethernet/ethernet.h>
44 #include <vnet/l2/l2_vtr.h>
46 #include <vpp/api/vpe_msg_enum.h>
48 #define vl_typedefs /* define message structures */
49 #include <vpp/api/vpe_all_api_h.h>
52 #define vl_endianfun /* define message structures */
53 #include <vpp/api/vpe_all_api_h.h>
56 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
60 vl_print (handle, (char *)s); \
65 static void *vl_api_create_loopback_t_print
66 (vl_api_create_loopback_t * mp, void *handle)
70 s = format (0, "SCRIPT: create_loopback ");
71 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
76 static void *vl_api_create_loopback_instance_t_print
77 (vl_api_create_loopback_instance_t * mp, void *handle)
81 s = format (0, "SCRIPT: create_loopback ");
82 s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
83 s = format (s, "instance %d ", ntohl (mp->user_instance));
88 static void *vl_api_delete_loopback_t_print
89 (vl_api_delete_loopback_t * mp, void *handle)
93 s = format (0, "SCRIPT: delete_loopback ");
94 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
99 static void *vl_api_sw_interface_set_flags_t_print
100 (vl_api_sw_interface_set_flags_t * mp, void *handle)
103 s = format (0, "SCRIPT: sw_interface_set_flags ");
105 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
107 if (mp->admin_up_down)
108 s = format (s, "admin-up ");
110 s = format (s, "admin-down ");
115 static void *vl_api_sw_interface_event_t_print
116 (vl_api_sw_interface_event_t * mp, void *handle)
119 s = format (0, "SCRIPT: sw_interface_event ");
121 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
123 if (mp->admin_up_down)
124 s = format (s, "admin-up ");
126 s = format (s, "admin-down ");
128 if (mp->link_up_down)
129 s = format (s, "link-up");
131 s = format (s, "link-down");
134 s = format (s, " deleted");
139 static void *vl_api_sw_interface_add_del_address_t_print
140 (vl_api_sw_interface_add_del_address_t * mp, void *handle)
144 s = format (0, "SCRIPT: sw_interface_add_del_address ");
146 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
149 s = format (s, "%U/%d ", format_ip6_address,
150 (ip6_address_t *) mp->address, mp->address_length);
152 s = format (s, "%U/%d ", format_ip4_address,
153 (ip4_address_t *) mp->address, mp->address_length);
156 s = format (s, "del ");
158 s = format (s, "del-all ");
163 static void *vl_api_sw_interface_set_table_t_print
164 (vl_api_sw_interface_set_table_t * mp, void *handle)
168 s = format (0, "SCRIPT: sw_interface_set_table ");
170 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
173 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
176 s = format (s, "ipv6 ");
181 static void *vl_api_sw_interface_set_mpls_enable_t_print
182 (vl_api_sw_interface_set_mpls_enable_t * mp, void *handle)
186 s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
188 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
191 s = format (s, "disable");
196 static void *vl_api_sw_interface_set_vpath_t_print
197 (vl_api_sw_interface_set_vpath_t * mp, void *handle)
201 s = format (0, "SCRIPT: sw_interface_set_vpath ");
203 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
206 s = format (s, "enable ");
208 s = format (s, "disable ");
213 static void *vl_api_sw_interface_set_vxlan_bypass_t_print
214 (vl_api_sw_interface_set_vxlan_bypass_t * mp, void *handle)
218 s = format (0, "SCRIPT: sw_interface_set_vxlan_bypass ");
220 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
223 s = format (s, "ip6 ");
226 s = format (s, "enable ");
228 s = format (s, "disable ");
233 static void *vl_api_sw_interface_set_geneve_bypass_t_print
234 (vl_api_sw_interface_set_geneve_bypass_t * mp, void *handle)
238 s = format (0, "SCRIPT: sw_interface_set_geneve_bypass ");
240 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
243 s = format (s, "ip6 ");
246 s = format (s, "enable ");
248 s = format (s, "disable ");
253 static void *vl_api_sw_interface_set_l2_xconnect_t_print
254 (vl_api_sw_interface_set_l2_xconnect_t * mp, void *handle)
258 s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
260 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
264 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
267 s = format (s, "delete ");
272 static void *vl_api_sw_interface_set_l2_bridge_t_print
273 (vl_api_sw_interface_set_l2_bridge_t * mp, void *handle)
277 s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
279 s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
283 s = format (s, "bd_id %d shg %d %senable ", ntohl (mp->bd_id),
284 mp->shg, ((mp->bvi) ? "bvi " : " "));
287 s = format (s, "disable ");
292 static void *vl_api_bridge_domain_add_del_t_print
293 (vl_api_bridge_domain_add_del_t * mp, void *handle)
297 s = format (0, "SCRIPT: bridge_domain_add_del ");
299 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
304 s = format (s, "bd_tag %s ", mp->bd_tag);
305 s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood);
306 s = format (s, "forward %d learn %d ", mp->forward, mp->learn);
307 s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age);
310 s = format (s, "del ");
315 static void *vl_api_bridge_domain_set_mac_age_t_print
316 (vl_api_bridge_domain_set_mac_age_t * mp, void *handle)
320 s = format (0, "SCRIPT: bridge_domain_set_mac_age ");
322 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
324 s = format (s, "mac-age %d", mp->mac_age);
329 static void *vl_api_bridge_domain_dump_t_print
330 (vl_api_bridge_domain_dump_t * mp, void *handle)
333 u32 bd_id = ntohl (mp->bd_id);
335 s = format (0, "SCRIPT: bridge_domain_dump ");
338 s = format (s, "bd_id %d ", bd_id);
343 static void *vl_api_l2fib_flush_all_t_print
344 (vl_api_l2fib_flush_all_t * mp, void *handle)
348 s = format (0, "SCRIPT: l2fib_flush_all ");
354 static void *vl_api_l2fib_flush_bd_t_print
355 (vl_api_l2fib_flush_bd_t * mp, void *handle)
358 u32 bd_id = ntohl (mp->bd_id);
360 s = format (0, "SCRIPT: l2fib_flush_bd ");
361 s = format (s, "bd_id %d ", bd_id);
366 static void *vl_api_l2fib_flush_int_t_print
367 (vl_api_l2fib_flush_int_t * mp, void *handle)
370 u32 sw_if_index = ntohl (mp->sw_if_index);
372 s = format (0, "SCRIPT: l2fib_flush_int ");
373 s = format (s, "sw_if_index %d ", sw_if_index);
378 static void *vl_api_l2fib_add_del_t_print
379 (vl_api_l2fib_add_del_t * mp, void *handle)
383 s = format (0, "SCRIPT: l2fib_add_del ");
385 s = format (s, "mac %U ", format_ethernet_address, mp->mac);
387 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
392 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
394 s = format (s, "%s", "static ");
396 s = format (s, "%s", "filter ");
398 s = format (s, "%s", "bvi ");
402 s = format (s, "del ");
409 vl_api_l2_flags_t_print (vl_api_l2_flags_t * mp, void *handle)
412 u32 flags = ntohl (mp->feature_bitmap);
414 s = format (0, "SCRIPT: l2_flags ");
416 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
418 if (flags & L2_LEARN)
419 s = format (s, "learn ");
421 s = format (s, "forward ");
422 if (flags & L2_FLOOD)
423 s = format (s, "flood ");
424 if (flags & L2_UU_FLOOD)
425 s = format (s, "uu-flood ");
426 if (flags & L2_ARP_TERM)
427 s = format (s, "arp-term ");
430 s = format (s, "clear ");
435 static void *vl_api_bridge_flags_t_print
436 (vl_api_bridge_flags_t * mp, void *handle)
439 u32 flags = ntohl (mp->feature_bitmap);
441 s = format (0, "SCRIPT: bridge_flags ");
443 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
445 if (flags & L2_LEARN)
446 s = format (s, "learn ");
448 s = format (s, "forward ");
449 if (flags & L2_FLOOD)
450 s = format (s, "flood ");
451 if (flags & L2_UU_FLOOD)
452 s = format (s, "uu-flood ");
453 if (flags & L2_ARP_TERM)
454 s = format (s, "arp-term ");
457 s = format (s, "clear ");
462 static void *vl_api_bd_ip_mac_add_del_t_print
463 (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
467 s = format (0, "SCRIPT: bd_ip_mac_add_del ");
468 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
471 s = format (s, "%U ", format_ip6_address,
472 (ip6_address_t *) mp->ip_address);
474 s = format (s, "%U ", format_ip4_address,
475 (ip4_address_t *) mp->ip_address);
477 s = format (s, "%U ", format_ethernet_address, mp->mac_address);
479 s = format (s, "del ");
484 static void *vl_api_tap_connect_t_print
485 (vl_api_tap_connect_t * mp, void *handle)
490 memset (null_mac, 0, sizeof (null_mac));
492 s = format (0, "SCRIPT: tap_connect ");
493 s = format (s, "tapname %s ", mp->tap_name);
494 if (mp->use_random_mac)
495 s = format (s, "random-mac ");
497 s = format (s, "tag %s ", mp->tag);
498 if (memcmp (mp->mac_address, null_mac, 6))
499 s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
500 if (mp->ip4_address_set)
501 s = format (s, "address %U/%d ", format_ip4_address, mp->ip4_address,
503 if (mp->ip6_address_set)
504 s = format (s, "address %U/%d ", format_ip6_address, mp->ip6_address,
509 static void *vl_api_tap_modify_t_print
510 (vl_api_tap_modify_t * mp, void *handle)
515 memset (null_mac, 0, sizeof (null_mac));
517 s = format (0, "SCRIPT: tap_modify ");
518 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
519 s = format (s, "tapname %s ", mp->tap_name);
520 if (mp->use_random_mac)
521 s = format (s, "random-mac ");
523 if (memcmp (mp->mac_address, null_mac, 6))
524 s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
529 static void *vl_api_tap_delete_t_print
530 (vl_api_tap_delete_t * mp, void *handle)
534 s = format (0, "SCRIPT: tap_delete ");
535 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
540 static void *vl_api_sw_interface_tap_dump_t_print
541 (vl_api_sw_interface_tap_dump_t * mp, void *handle)
545 s = format (0, "SCRIPT: sw_interface_tap_dump ");
551 static void *vl_api_ip_add_del_route_t_print
552 (vl_api_ip_add_del_route_t * mp, void *handle)
556 s = format (0, "SCRIPT: ip_add_del_route ");
558 s = format (s, "del ");
560 if (mp->next_hop_sw_if_index)
561 s = format (s, "sw_if_index %d ", ntohl (mp->next_hop_sw_if_index));
564 s = format (s, "%U/%d ", format_ip6_address, mp->dst_address,
565 mp->dst_address_length);
567 s = format (s, "%U/%d ", format_ip4_address, mp->dst_address,
568 mp->dst_address_length);
570 s = format (s, "local ");
571 else if (mp->is_drop)
572 s = format (s, "drop ");
573 else if (mp->is_classify)
574 s = format (s, "classify %d", ntohl (mp->classify_table_index));
578 s = format (s, "via %U ", format_ip6_address, mp->next_hop_address);
580 s = format (s, "via %U ", format_ip4_address, mp->next_hop_address);
583 if (mp->table_id != 0)
584 s = format (s, "vrf %d ", ntohl (mp->table_id));
586 if (mp->next_hop_weight != 1)
587 s = format (s, "weight %d ", mp->next_hop_weight);
589 if (mp->is_multipath)
590 s = format (s, "multipath ");
592 if (mp->is_multipath)
593 s = format (s, "multipath ");
595 if (mp->next_hop_table_id)
596 s = format (s, "lookup-in-vrf %d ", ntohl (mp->next_hop_table_id));
601 static void *vl_api_proxy_arp_add_del_t_print
602 (vl_api_proxy_arp_add_del_t * mp, void *handle)
606 s = format (0, "SCRIPT: proxy_arp_add_del ");
608 s = format (s, "%U - %U ", format_ip4_address, mp->low_address,
609 format_ip4_address, mp->hi_address);
612 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
615 s = format (s, "del ");
620 static void *vl_api_proxy_arp_intfc_enable_disable_t_print
621 (vl_api_proxy_arp_intfc_enable_disable_t * mp, void *handle)
625 s = format (0, "SCRIPT: proxy_arp_intfc_enable_disable ");
627 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
629 s = format (s, "enable %d ", mp->enable_disable);
634 static void *vl_api_mpls_tunnel_add_del_t_print
635 (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
639 s = format (0, "SCRIPT: mpls_tunnel_add_del ");
641 if (mp->mt_next_hop_sw_if_index)
642 s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index));
644 if (mp->mt_next_hop_proto_is_ip4)
645 s = format (s, "%U ", format_ip4_address, mp->mt_next_hop);
647 s = format (s, "%U ", format_ip6_address, mp->mt_next_hop);
650 s = format (s, "l2-only ");
652 if (mp->mt_is_add == 0)
653 s = format (s, "del ");
658 static void *vl_api_sw_interface_set_unnumbered_t_print
659 (vl_api_sw_interface_set_unnumbered_t * mp, void *handle)
663 s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
665 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
667 s = format (s, "unnum_if_index %d ", ntohl (mp->unnumbered_sw_if_index));
670 s = format (s, "del ");
675 static void *vl_api_ip_neighbor_add_del_t_print
676 (vl_api_ip_neighbor_add_del_t * mp, void *handle)
681 memset (null_mac, 0, sizeof (null_mac));
683 s = format (0, "SCRIPT: ip_neighbor_add_del ");
685 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
688 s = format (s, "is_static ");
690 if (mp->is_no_adj_fib)
691 s = format (s, "is_no_fib_entry ");
693 if (memcmp (mp->mac_address, null_mac, 6))
694 s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
698 format (s, "dst %U ", format_ip6_address,
699 (ip6_address_t *) mp->dst_address);
702 format (s, "dst %U ", format_ip4_address,
703 (ip4_address_t *) mp->dst_address);
706 s = format (s, "del ");
712 vl_api_reset_vrf_t_print (vl_api_reset_vrf_t * mp, void *handle)
716 s = format (0, "SCRIPT: reset_vrf ");
719 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
721 if (mp->is_ipv6 != 0)
722 s = format (s, "ipv6 ");
727 static void *vl_api_create_vlan_subif_t_print
728 (vl_api_create_vlan_subif_t * mp, void *handle)
732 s = format (0, "SCRIPT: create_vlan_subif ");
735 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
738 s = format (s, "vlan_id %d ", ntohl (mp->vlan_id));
743 #define foreach_create_subif_bit \
750 _(outer_vlan_id_any) \
753 static void *vl_api_create_subif_t_print
754 (vl_api_create_subif_t * mp, void *handle)
758 s = format (0, "SCRIPT: create_subif ");
760 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
762 s = format (s, "sub_id %d ", ntohl (mp->sub_id));
764 if (mp->outer_vlan_id)
765 s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
767 if (mp->inner_vlan_id)
768 s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
770 #define _(a) if (mp->a) s = format (s, "%s ", #a);
771 foreach_create_subif_bit;
777 static void *vl_api_delete_subif_t_print
778 (vl_api_delete_subif_t * mp, void *handle)
782 s = format (0, "SCRIPT: delete_subif ");
783 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
788 static void *vl_api_oam_add_del_t_print
789 (vl_api_oam_add_del_t * mp, void *handle)
793 s = format (0, "SCRIPT: oam_add_del ");
796 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
798 s = format (s, "src %U ", format_ip4_address, mp->src_address);
800 s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
803 s = format (s, "del ");
809 vl_api_reset_fib_t_print (vl_api_reset_fib_t * mp, void *handle)
813 s = format (0, "SCRIPT: reset_fib ");
816 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
818 if (mp->is_ipv6 != 0)
819 s = format (s, "ipv6 ");
824 static void *vl_api_dhcp_proxy_config_t_print
825 (vl_api_dhcp_proxy_config_t * mp, void *handle)
829 s = format (0, "SCRIPT: dhcp_proxy_config_2 ");
831 s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
832 s = format (s, "server_vrf_id %d ", ntohl (mp->server_vrf_id));
836 s = format (s, "svr %U ", format_ip6_address,
837 (ip6_address_t *) mp->dhcp_server);
838 s = format (s, "src %U ", format_ip6_address,
839 (ip6_address_t *) mp->dhcp_src_address);
843 s = format (s, "svr %U ", format_ip4_address,
844 (ip4_address_t *) mp->dhcp_server);
845 s = format (s, "src %U ", format_ip4_address,
846 (ip4_address_t *) mp->dhcp_src_address);
849 s = format (s, "del ");
854 static void *vl_api_dhcp_proxy_set_vss_t_print
855 (vl_api_dhcp_proxy_set_vss_t * mp, void *handle)
859 s = format (0, "SCRIPT: dhcp_proxy_set_vss ");
861 s = format (s, "tbl_id %d ", ntohl (mp->tbl_id));
863 s = format (s, "fib_id %d ", ntohl (mp->fib_id));
865 s = format (s, "oui %d ", ntohl (mp->oui));
867 if (mp->is_ipv6 != 0)
868 s = format (s, "ipv6 ");
871 s = format (s, "del ");
876 static void *vl_api_dhcp_client_config_t_print
877 (vl_api_dhcp_client_config_t * mp, void *handle)
881 s = format (0, "SCRIPT: dhcp_client_config ");
883 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
885 s = format (s, "hostname %s ", mp->hostname);
887 s = format (s, "want_dhcp_event %d ", mp->want_dhcp_event);
889 s = format (s, "pid %d ", ntohl (mp->pid));
892 s = format (s, "del ");
898 static void *vl_api_set_ip_flow_hash_t_print
899 (vl_api_set_ip_flow_hash_t * mp, void *handle)
903 s = format (0, "SCRIPT: set_ip_flow_hash ");
905 s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
908 s = format (s, "src ");
911 s = format (s, "dst ");
914 s = format (s, "sport ");
917 s = format (s, "dport ");
920 s = format (s, "proto ");
923 s = format (s, "reverse ");
925 if (mp->is_ipv6 != 0)
926 s = format (s, "ipv6 ");
931 static void *vl_api_sw_interface_ip6_set_link_local_address_t_print
932 (vl_api_sw_interface_ip6_set_link_local_address_t * mp, void *handle)
936 s = format (0, "SCRIPT: sw_interface_ip6_set_link_local_address ");
938 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
940 s = format (s, "%U ", format_ip6_address, mp->address);
945 static void *vl_api_sw_interface_ip6nd_ra_prefix_t_print
946 (vl_api_sw_interface_ip6nd_ra_prefix_t * mp, void *handle)
950 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_prefix ");
952 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
954 s = format (s, "%U/%d ", format_ip6_address, mp->address,
957 s = format (s, "val_life %d ", ntohl (mp->val_lifetime));
959 s = format (s, "pref_life %d ", ntohl (mp->pref_lifetime));
962 s = format (s, "def ");
964 if (mp->no_advertise)
965 s = format (s, "noadv ");
968 s = format (s, "offl ");
970 if (mp->no_autoconfig)
971 s = format (s, "noauto ");
974 s = format (s, "nolink ");
977 s = format (s, "isno ");
982 static void *vl_api_sw_interface_ip6nd_ra_config_t_print
983 (vl_api_sw_interface_ip6nd_ra_config_t * mp, void *handle)
987 s = format (0, "SCRIPT: sw_interface_ip6nd_ra_config ");
989 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
991 s = format (s, "maxint %d ", ntohl (mp->max_interval));
993 s = format (s, "minint %d ", ntohl (mp->min_interval));
995 s = format (s, "life %d ", ntohl (mp->lifetime));
997 s = format (s, "count %d ", ntohl (mp->initial_count));
999 s = format (s, "interval %d ", ntohl (mp->initial_interval));
1002 s = format (s, "suppress ");
1005 s = format (s, "managed ");
1008 s = format (s, "other ");
1011 s = format (s, "ll ");
1013 if (mp->send_unicast)
1014 s = format (s, "send ");
1017 s = format (s, "cease ");
1020 s = format (s, "isno ");
1022 if (mp->default_router)
1023 s = format (s, "def ");
1028 static void *vl_api_set_arp_neighbor_limit_t_print
1029 (vl_api_set_arp_neighbor_limit_t * mp, void *handle)
1033 s = format (0, "SCRIPT: set_arp_neighbor_limit ");
1035 s = format (s, "arp_nbr_limit %d ", ntohl (mp->arp_neighbor_limit));
1037 if (mp->is_ipv6 != 0)
1038 s = format (s, "ipv6 ");
1043 static void *vl_api_l2_patch_add_del_t_print
1044 (vl_api_l2_patch_add_del_t * mp, void *handle)
1048 s = format (0, "SCRIPT: l2_patch_add_del ");
1050 s = format (s, "rx_sw_if_index %d ", ntohl (mp->rx_sw_if_index));
1052 s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
1054 if (mp->is_add == 0)
1055 s = format (s, "del ");
1060 static void *vl_api_sr_localsid_add_del_t_print
1061 (vl_api_sr_localsid_add_del_t * mp, void *handle)
1063 vnet_main_t *vnm = vnet_get_main ();
1066 s = format (0, "SCRIPT: sr_localsid_add_del ");
1068 switch (mp->behavior)
1070 case SR_BEHAVIOR_END:
1071 s = format (s, "Address: %U\nBehavior: End",
1072 format_ip6_address, (ip6_address_t *) mp->localsid_addr);
1073 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1078 "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1079 "\nIface: %U\nNext hop: %U", format_ip6_address,
1080 (ip6_address_t *) mp->localsid_addr,
1081 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1082 format_ip6_address, (ip6_address_t *) mp->nh_addr);
1083 s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1085 case SR_BEHAVIOR_DX4:
1088 "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1089 "\nIface: %U\nNext hop: %U", format_ip6_address,
1090 (ip6_address_t *) mp->localsid_addr,
1091 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1092 format_ip4_address, (ip4_address_t *) mp->nh_addr);
1094 case SR_BEHAVIOR_DX6:
1097 "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1098 "\nIface: %UNext hop: %U", format_ip6_address,
1099 (ip6_address_t *) mp->localsid_addr,
1100 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1101 format_ip6_address, (ip6_address_t *) mp->nh_addr);
1103 case SR_BEHAVIOR_DX2:
1106 "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1107 "\nIface: %U", format_ip6_address,
1108 (ip6_address_t *) mp->localsid_addr,
1109 format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index));
1111 case SR_BEHAVIOR_DT6:
1114 "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1115 "\nTable: %u", format_ip6_address,
1116 (ip6_address_t *) mp->localsid_addr, ntohl (mp->fib_table));
1118 case SR_BEHAVIOR_DT4:
1121 "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1122 "\nTable: %u", format_ip6_address,
1123 (ip6_address_t *) mp->localsid_addr, ntohl (mp->fib_table));
1126 if (mp->behavior >= SR_BEHAVIOR_LAST)
1128 s = format (s, "Address: %U\n Behavior: %u",
1129 format_ip6_address, (ip6_address_t *) mp->localsid_addr,
1133 //Should never get here...
1134 s = format (s, "Internal error");
1140 static void *vl_api_sr_steering_add_del_t_print
1141 (vl_api_sr_steering_add_del_t * mp, void *handle)
1145 s = format (0, "SCRIPT: sr_steering_add_del ");
1147 s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1149 switch (mp->traffic_type)
1152 s = format (s, "Traffic type: L2 iface: %u", ntohl (mp->sw_if_index));
1155 s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1156 (ip4_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1159 s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1160 (ip6_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1163 s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1166 s = format (s, "BindingSID: %U", format_ip6_address,
1167 (ip6_address_t *) mp->bsid_addr);
1169 s = format (s, "SR Policy Index: %u", ntohl (mp->sr_policy_index));
1171 s = format (s, "FIB_table: %u", ntohl (mp->table_id));
1176 static void *vl_api_sr_policy_add_t_print
1177 (vl_api_sr_policy_add_t * mp, void *handle)
1181 ip6_address_t *segments = 0, *seg;
1182 ip6_address_t *this_address = (ip6_address_t *) mp->segments;
1185 for (i = 0; i < mp->n_segments; i++)
1187 vec_add2 (segments, seg, 1);
1188 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1192 s = format (0, "SCRIPT: sr_policy_add ");
1194 s = format (s, "BSID: %U", format_ip6_address,
1195 (ip6_address_t *) mp->bsid_addr);
1199 (mp->is_encap ? "Behavior: Encapsulation" :
1200 "Behavior: SRH insertion"));
1202 s = format (s, "FIB_table: %u", ntohl (mp->fib_table));
1204 s = format (s, (mp->type ? "Type: Default" : "Type: Spray"));
1206 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1208 s = format (s, "{");
1209 vec_foreach (seg, segments)
1211 s = format (s, "%U, ", format_ip6_address, seg);
1213 s = format (s, "\b\b } ");
1218 static void *vl_api_sr_policy_mod_t_print
1219 (vl_api_sr_policy_mod_t * mp, void *handle)
1223 ip6_address_t *segments = 0, *seg;
1224 ip6_address_t *this_address = (ip6_address_t *) mp->segments;
1227 for (i = 0; i < mp->n_segments; i++)
1229 vec_add2 (segments, seg, 1);
1230 clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1234 s = format (0, "SCRIPT: sr_policy_mod ");
1236 s = format (s, "BSID: %U", format_ip6_address,
1237 (ip6_address_t *) mp->bsid_addr);
1239 s = format (s, "SR Policy index: %u", ntohl (mp->sr_policy_index));
1241 s = format (s, "Operation: %u", mp->operation);
1243 s = format (s, "SID list index: %u", ntohl (mp->sl_index));
1245 s = format (s, "SID list weight: %u", ntohl (mp->weight));
1247 s = format (s, "{");
1248 vec_foreach (seg, segments)
1250 s = format (s, "%U, ", format_ip6_address, seg);
1252 s = format (s, "\b\b } ");
1257 static void *vl_api_sr_policy_del_t_print
1258 (vl_api_sr_policy_del_t * mp, void *handle)
1262 s = format (0, "SCRIPT: sr_policy_del ");
1263 s = format (s, "To be delivered. Good luck.");
1267 static void *vl_api_classify_add_del_table_t_print
1268 (vl_api_classify_add_del_table_t * mp, void *handle)
1273 s = format (0, "SCRIPT: classify_add_del_table ");
1275 if (mp->is_add == 0)
1277 s = format (s, "table %d ", ntohl (mp->table_index));
1278 s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1282 s = format (s, "nbuckets %d ", ntohl (mp->nbuckets));
1283 s = format (s, "memory_size %d ", ntohl (mp->memory_size));
1284 s = format (s, "skip %d ", ntohl (mp->skip_n_vectors));
1285 s = format (s, "match %d ", ntohl (mp->match_n_vectors));
1286 s = format (s, "next-table %d ", ntohl (mp->next_table_index));
1287 s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
1288 s = format (s, "current-data-flag %d ", ntohl (mp->current_data_flag));
1289 if (mp->current_data_flag)
1290 s = format (s, "current-data-offset %d ",
1291 ntohl (mp->current_data_offset));
1292 s = format (s, "mask hex ");
1293 for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
1294 s = format (s, "%02x", mp->mask[i]);
1301 static void *vl_api_classify_add_del_session_t_print
1302 (vl_api_classify_add_del_session_t * mp, void *handle)
1307 s = format (0, "SCRIPT: classify_add_del_session ");
1309 s = format (s, "table_index %d ", ntohl (mp->table_index));
1310 s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
1311 s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
1312 s = format (s, "advance %d ", ntohl (mp->advance));
1313 s = format (s, "action %d ", mp->action);
1315 s = format (s, "metadata %d ", ntohl (mp->metadata));
1316 if (mp->is_add == 0)
1317 s = format (s, "del ");
1319 s = format (s, "match hex ");
1320 for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1322 if (mp->match[i] != 0)
1329 for (i = 0; i < limit; i++)
1330 s = format (s, "%02x", mp->match[i]);
1335 static void *vl_api_classify_set_interface_ip_table_t_print
1336 (vl_api_classify_set_interface_ip_table_t * mp, void *handle)
1340 s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1343 s = format (s, "ipv6 ");
1345 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1346 s = format (s, "table %d ", ntohl (mp->table_index));
1351 static void *vl_api_classify_set_interface_l2_tables_t_print
1352 (vl_api_classify_set_interface_l2_tables_t * mp, void *handle)
1356 s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1358 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1359 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1360 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1361 s = format (s, "other-table %d ", ntohl (mp->other_table_index));
1362 s = format (s, "is-input %d ", mp->is_input);
1367 static void *vl_api_add_node_next_t_print
1368 (vl_api_add_node_next_t * mp, void *handle)
1372 s = format (0, "SCRIPT: add_node_next ");
1374 s = format (0, "node %s next %s ", mp->node_name, mp->next_name);
1379 static void *vl_api_l2tpv3_create_tunnel_t_print
1380 (vl_api_l2tpv3_create_tunnel_t * mp, void *handle)
1384 s = format (0, "SCRIPT: l2tpv3_create_tunnel ");
1386 s = format (s, "client_address %U our_address %U ",
1387 format_ip6_address, (ip6_address_t *) (mp->client_address),
1388 format_ip6_address, (ip6_address_t *) (mp->our_address));
1389 s = format (s, "local_session_id %d ", ntohl (mp->local_session_id));
1390 s = format (s, "remote_session_id %d ", ntohl (mp->remote_session_id));
1391 s = format (s, "local_cookie %lld ",
1392 clib_net_to_host_u64 (mp->local_cookie));
1393 s = format (s, "remote_cookie %lld ",
1394 clib_net_to_host_u64 (mp->remote_cookie));
1395 if (mp->l2_sublayer_present)
1396 s = format (s, "l2-sublayer-present ");
1401 static void *vl_api_l2tpv3_set_tunnel_cookies_t_print
1402 (vl_api_l2tpv3_set_tunnel_cookies_t * mp, void *handle)
1406 s = format (0, "SCRIPT: l2tpv3_set_tunnel_cookies ");
1408 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1410 s = format (s, "new_local_cookie %llu ",
1411 clib_net_to_host_u64 (mp->new_local_cookie));
1413 s = format (s, "new_remote_cookie %llu ",
1414 clib_net_to_host_u64 (mp->new_remote_cookie));
1419 static void *vl_api_l2tpv3_interface_enable_disable_t_print
1420 (vl_api_l2tpv3_interface_enable_disable_t * mp, void *handle)
1424 s = format (0, "SCRIPT: l2tpv3_interface_enable_disable ");
1426 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1428 if (mp->enable_disable == 0)
1429 s = format (s, "del ");
1434 static void *vl_api_l2tpv3_set_lookup_key_t_print
1435 (vl_api_l2tpv3_set_lookup_key_t * mp, void *handle)
1438 char *str = "unknown";
1440 s = format (0, "SCRIPT: l2tpv3_set_lookup_key ");
1444 case L2T_LOOKUP_SRC_ADDRESS:
1445 str = "lookup_v6_src";
1447 case L2T_LOOKUP_DST_ADDRESS:
1448 str = "lookup_v6_dst";
1450 case L2T_LOOKUP_SESSION_ID:
1451 str = "lookup_session_id";
1457 s = format (s, "%s ", str);
1462 static void *vl_api_sw_if_l2tpv3_tunnel_dump_t_print
1463 (vl_api_sw_if_l2tpv3_tunnel_dump_t * mp, void *handle)
1467 s = format (0, "SCRIPT: sw_if_l2tpv3_tunnel_dump ");
1472 static void *vl_api_vxlan_add_del_tunnel_t_print
1473 (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1476 s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1478 ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
1479 ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
1481 u8 is_grp = ip46_address_is_multicast (&dst);
1482 char *dst_name = is_grp ? "group" : "dst";
1484 s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1485 s = format (s, "%s %U ", dst_name, format_ip46_address,
1486 &dst, IP46_TYPE_ANY);
1489 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1491 if (mp->encap_vrf_id)
1492 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1494 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1496 s = format (s, "vni %d ", ntohl (mp->vni));
1498 if (mp->is_add == 0)
1499 s = format (s, "del ");
1504 static void *vl_api_vxlan_tunnel_dump_t_print
1505 (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1509 s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1511 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1516 static void *vl_api_geneve_add_del_tunnel_t_print
1517 (vl_api_geneve_add_del_tunnel_t * mp, void *handle)
1520 s = format (0, "SCRIPT: geneve_add_del_tunnel ");
1522 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local_address);
1523 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote_address);
1525 u8 is_grp = ip46_address_is_multicast (&remote);
1526 char *remote_name = is_grp ? "group" : "dst";
1528 s = format (s, "src %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1529 s = format (s, "%s %U ", remote_name, format_ip46_address,
1530 &remote, IP46_TYPE_ANY);
1533 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1535 if (mp->encap_vrf_id)
1536 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1538 s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1540 s = format (s, "vni %d ", ntohl (mp->vni));
1542 if (mp->is_add == 0)
1543 s = format (s, "del ");
1548 static void *vl_api_geneve_tunnel_dump_t_print
1549 (vl_api_geneve_tunnel_dump_t * mp, void *handle)
1553 s = format (0, "SCRIPT: geneve_tunnel_dump ");
1555 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1560 static void *vl_api_gre_add_del_tunnel_t_print
1561 (vl_api_gre_add_del_tunnel_t * mp, void *handle)
1565 s = format (0, "SCRIPT: gre_add_del_tunnel ");
1567 s = format (s, "dst %U ", format_ip46_address,
1568 (ip46_address_t *) & (mp->dst_address),
1569 mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
1571 s = format (s, "src %U ", format_ip46_address,
1572 (ip46_address_t *) & (mp->src_address),
1573 mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
1576 s = format (s, "teb ");
1578 if (mp->outer_fib_id)
1579 s = format (s, "outer-fib-id %d ", ntohl (mp->outer_fib_id));
1581 if (mp->is_add == 0)
1582 s = format (s, "del ");
1587 static void *vl_api_gre_tunnel_dump_t_print
1588 (vl_api_gre_tunnel_dump_t * mp, void *handle)
1592 s = format (0, "SCRIPT: gre_tunnel_dump ");
1594 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1599 static void *vl_api_l2_fib_clear_table_t_print
1600 (vl_api_l2_fib_clear_table_t * mp, void *handle)
1604 s = format (0, "SCRIPT: l2_fib_clear_table ");
1609 static void *vl_api_l2_interface_efp_filter_t_print
1610 (vl_api_l2_interface_efp_filter_t * mp, void *handle)
1614 s = format (0, "SCRIPT: l2_interface_efp_filter ");
1616 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1617 if (mp->enable_disable)
1618 s = format (s, "enable ");
1620 s = format (s, "disable ");
1625 static void *vl_api_l2_interface_vlan_tag_rewrite_t_print
1626 (vl_api_l2_interface_vlan_tag_rewrite_t * mp, void *handle)
1630 s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
1632 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1633 s = format (s, "vtr_op %d ", ntohl (mp->vtr_op));
1634 s = format (s, "push_dot1q %d ", ntohl (mp->push_dot1q));
1635 s = format (s, "tag1 %d ", ntohl (mp->tag1));
1636 s = format (s, "tag2 %d ", ntohl (mp->tag2));
1641 static void *vl_api_create_vhost_user_if_t_print
1642 (vl_api_create_vhost_user_if_t * mp, void *handle)
1646 s = format (0, "SCRIPT: create_vhost_user_if ");
1648 s = format (s, "socket %s ", mp->sock_filename);
1650 s = format (s, "server ");
1652 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
1654 s = format (s, "tag %s", mp->tag);
1659 static void *vl_api_modify_vhost_user_if_t_print
1660 (vl_api_modify_vhost_user_if_t * mp, void *handle)
1664 s = format (0, "SCRIPT: modify_vhost_user_if ");
1666 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1667 s = format (s, "socket %s ", mp->sock_filename);
1669 s = format (s, "server ");
1671 s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
1676 static void *vl_api_delete_vhost_user_if_t_print
1677 (vl_api_delete_vhost_user_if_t * mp, void *handle)
1681 s = format (0, "SCRIPT: delete_vhost_user_if ");
1682 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1687 static void *vl_api_sw_interface_vhost_user_dump_t_print
1688 (vl_api_sw_interface_vhost_user_dump_t * mp, void *handle)
1692 s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
1697 static void *vl_api_sw_interface_dump_t_print
1698 (vl_api_sw_interface_dump_t * mp, void *handle)
1702 s = format (0, "SCRIPT: sw_interface_dump ");
1704 if (mp->name_filter_valid)
1705 s = format (s, "name_filter %s ", mp->name_filter);
1707 s = format (s, "all ");
1712 static void *vl_api_l2_fib_table_dump_t_print
1713 (vl_api_l2_fib_table_dump_t * mp, void *handle)
1717 s = format (0, "SCRIPT: l2_fib_table_dump ");
1719 s = format (s, "bd_id %d ", ntohl (mp->bd_id));
1724 static void *vl_api_control_ping_t_print
1725 (vl_api_control_ping_t * mp, void *handle)
1729 s = format (0, "SCRIPT: control_ping ");
1734 static void *vl_api_want_interface_events_t_print
1735 (vl_api_want_interface_events_t * mp, void *handle)
1739 s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
1740 ntohl (mp->pid), ntohl (mp->enable_disable));
1746 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
1750 s = format (0, "SCRIPT: cli ");
1755 static void *vl_api_cli_inband_t_print
1756 (vl_api_cli_inband_t * mp, void *handle)
1760 s = format (0, "SCRIPT: cli_inband ");
1765 static void *vl_api_memclnt_create_t_print
1766 (vl_api_memclnt_create_t * mp, void *handle)
1770 s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
1775 static void *vl_api_sockclnt_create_t_print
1776 (vl_api_sockclnt_create_t * mp, void *handle)
1780 s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name);
1785 static void *vl_api_show_version_t_print
1786 (vl_api_show_version_t * mp, void *handle)
1790 s = format (0, "SCRIPT: show_version ");
1795 static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
1796 (vl_api_vxlan_gpe_add_del_tunnel_t * mp, void *handle)
1800 s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
1802 ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local);
1803 ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote);
1805 u8 is_grp = ip46_address_is_multicast (&remote);
1806 char *remote_name = is_grp ? "group" : "remote";
1808 s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1809 s = format (s, "%s %U ", remote_name, format_ip46_address,
1810 &remote, IP46_TYPE_ANY);
1813 s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1814 s = format (s, "protocol %d ", ntohl (mp->protocol));
1816 s = format (s, "vni %d ", ntohl (mp->vni));
1818 if (mp->is_add == 0)
1819 s = format (s, "del ");
1821 if (mp->encap_vrf_id)
1822 s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1824 if (mp->decap_vrf_id)
1825 s = format (s, "decap-vrf-id %d ", ntohl (mp->decap_vrf_id));
1830 static void *vl_api_vxlan_gpe_tunnel_dump_t_print
1831 (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
1835 s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
1837 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1842 static void *vl_api_interface_name_renumber_t_print
1843 (vl_api_interface_name_renumber_t * mp, void *handle)
1847 s = format (0, "SCRIPT: interface_renumber ");
1849 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1851 s = format (s, "new_show_dev_instance %d ",
1852 ntohl (mp->new_show_dev_instance));
1857 static void *vl_api_want_ip4_arp_events_t_print
1858 (vl_api_want_ip4_arp_events_t * mp, void *handle)
1862 s = format (0, "SCRIPT: want_ip4_arp_events ");
1863 s = format (s, "pid %d address %U ", ntohl (mp->pid),
1864 format_ip4_address, &mp->address);
1865 if (mp->enable_disable == 0)
1866 s = format (s, "del ");
1871 static void *vl_api_want_ip6_nd_events_t_print
1872 (vl_api_want_ip6_nd_events_t * mp, void *handle)
1876 s = format (0, "SCRIPT: want_ip6_nd_events ");
1877 s = format (s, "pid %d address %U ", ntohl (mp->pid),
1878 format_ip6_address, mp->address);
1879 if (mp->enable_disable == 0)
1880 s = format (s, "del ");
1885 static void *vl_api_want_l2_macs_events_t_print
1886 (vl_api_want_l2_macs_events_t * mp, void *handle)
1890 s = format (0, "SCRIPT: want_l2_macs_events ");
1891 s = format (s, "learn-limit %d ", ntohl (mp->learn_limit));
1892 s = format (s, "scan-delay %d ", (u32) mp->scan_delay);
1893 s = format (s, "max-entries %d ", (u32) mp->max_macs_in_event * 10);
1894 if (mp->enable_disable == 0)
1895 s = format (s, "disable");
1900 static void *vl_api_input_acl_set_interface_t_print
1901 (vl_api_input_acl_set_interface_t * mp, void *handle)
1905 s = format (0, "SCRIPT: input_acl_set_interface ");
1907 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1908 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1909 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1910 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
1912 if (mp->is_add == 0)
1913 s = format (s, "del ");
1918 static void *vl_api_ip_address_dump_t_print
1919 (vl_api_ip_address_dump_t * mp, void *handle)
1923 s = format (0, "SCRIPT: ip6_address_dump ");
1924 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1925 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1931 vl_api_ip_dump_t_print (vl_api_ip_dump_t * mp, void *handle)
1935 s = format (0, "SCRIPT: ip_dump ");
1936 s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1941 static void *vl_api_cop_interface_enable_disable_t_print
1942 (vl_api_cop_interface_enable_disable_t * mp, void *handle)
1946 s = format (0, "SCRIPT: cop_interface_enable_disable ");
1947 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1948 if (mp->enable_disable)
1949 s = format (s, "enable ");
1951 s = format (s, "disable ");
1956 static void *vl_api_cop_whitelist_enable_disable_t_print
1957 (vl_api_cop_whitelist_enable_disable_t * mp, void *handle)
1961 s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
1962 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1963 s = format (s, "fib-id %d ", ntohl (mp->fib_id));
1965 s = format (s, "ip4 ");
1967 s = format (s, "ip6 ");
1968 if (mp->default_cop)
1969 s = format (s, "default ");
1974 static void *vl_api_af_packet_create_t_print
1975 (vl_api_af_packet_create_t * mp, void *handle)
1979 s = format (0, "SCRIPT: af_packet_create ");
1980 s = format (s, "host_if_name %s ", mp->host_if_name);
1981 if (mp->use_random_hw_addr)
1982 s = format (s, "hw_addr random ");
1984 s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
1989 static void *vl_api_af_packet_delete_t_print
1990 (vl_api_af_packet_delete_t * mp, void *handle)
1994 s = format (0, "SCRIPT: af_packet_delete ");
1995 s = format (s, "host_if_name %s ", mp->host_if_name);
2001 format_policer_action (u8 * s, va_list * va)
2003 u32 action = va_arg (*va, u32);
2004 u32 dscp = va_arg (*va, u32);
2007 if (action == SSE2_QOS_ACTION_DROP)
2008 s = format (s, "drop");
2009 else if (action == SSE2_QOS_ACTION_TRANSMIT)
2010 s = format (s, "transmit");
2011 else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
2013 s = format (s, "mark-and-transmit ");
2016 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
2022 s = format (s, "%s", t);
2028 static void *vl_api_policer_add_del_t_print
2029 (vl_api_policer_add_del_t * mp, void *handle)
2033 s = format (0, "SCRIPT: policer_add_del ");
2034 s = format (s, "name %s ", mp->name);
2035 s = format (s, "cir %d ", mp->cir);
2036 s = format (s, "eir %d ", mp->eir);
2037 s = format (s, "cb %d ", mp->cb);
2038 s = format (s, "eb %d ", mp->eb);
2040 switch (mp->rate_type)
2042 case SSE2_QOS_RATE_KBPS:
2043 s = format (s, "rate_type kbps ");
2045 case SSE2_QOS_RATE_PPS:
2046 s = format (s, "rate_type pps ");
2052 switch (mp->round_type)
2054 case SSE2_QOS_ROUND_TO_CLOSEST:
2055 s = format (s, "round_type closest ");
2057 case SSE2_QOS_ROUND_TO_UP:
2058 s = format (s, "round_type up ");
2060 case SSE2_QOS_ROUND_TO_DOWN:
2061 s = format (s, "round_type down ");
2069 case SSE2_QOS_POLICER_TYPE_1R2C:
2070 s = format (s, "type 1r2c ");
2072 case SSE2_QOS_POLICER_TYPE_1R3C_RFC_2697:
2073 s = format (s, "type 1r3c ");
2075 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_2698:
2076 s = format (s, "type 2r3c-2698 ");
2078 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_4115:
2079 s = format (s, "type 2r3c-4115 ");
2081 case SSE2_QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1:
2082 s = format (s, "type 2r3c-mef5cf1 ");
2088 s = format (s, "conform_action %U ", format_policer_action,
2089 mp->conform_action_type, mp->conform_dscp);
2090 s = format (s, "exceed_action %U ", format_policer_action,
2091 mp->exceed_action_type, mp->exceed_dscp);
2092 s = format (s, "violate_action %U ", format_policer_action,
2093 mp->violate_action_type, mp->violate_dscp);
2095 if (mp->color_aware)
2096 s = format (s, "color-aware ");
2097 if (mp->is_add == 0)
2098 s = format (s, "del ");
2103 static void *vl_api_policer_dump_t_print
2104 (vl_api_policer_dump_t * mp, void *handle)
2108 s = format (0, "SCRIPT: policer_dump ");
2109 if (mp->match_name_valid)
2110 s = format (s, "name %s ", mp->match_name);
2115 static void *vl_api_policer_classify_set_interface_t_print
2116 (vl_api_policer_classify_set_interface_t * mp, void *handle)
2120 s = format (0, "SCRIPT: policer_classify_set_interface ");
2121 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2122 if (mp->ip4_table_index != ~0)
2123 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2124 if (mp->ip6_table_index != ~0)
2125 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2126 if (mp->l2_table_index != ~0)
2127 s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2128 if (mp->is_add == 0)
2129 s = format (s, "del ");
2134 static void *vl_api_policer_classify_dump_t_print
2135 (vl_api_policer_classify_dump_t * mp, void *handle)
2139 s = format (0, "SCRIPT: policer_classify_dump ");
2142 case POLICER_CLASSIFY_TABLE_IP4:
2143 s = format (s, "type ip4 ");
2145 case POLICER_CLASSIFY_TABLE_IP6:
2146 s = format (s, "type ip6 ");
2148 case POLICER_CLASSIFY_TABLE_L2:
2149 s = format (s, "type l2 ");
2158 static void *vl_api_sw_interface_clear_stats_t_print
2159 (vl_api_sw_interface_clear_stats_t * mp, void *handle)
2163 s = format (0, "SCRIPT: sw_interface_clear_stats ");
2164 if (mp->sw_if_index != ~0)
2165 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2170 static void *vl_api_mpls_tunnel_dump_t_print
2171 (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2175 s = format (0, "SCRIPT: mpls_tunnel_dump ");
2177 s = format (s, "tunnel_index %d ", ntohl (mp->tunnel_index));
2182 static void *vl_api_mpls_fib_dump_t_print
2183 (vl_api_mpls_fib_dump_t * mp, void *handle)
2187 s = format (0, "SCRIPT: mpls_fib_decap_dump ");
2192 static void *vl_api_ip_fib_dump_t_print
2193 (vl_api_ip_fib_dump_t * mp, void *handle)
2197 s = format (0, "SCRIPT: ip_fib_dump ");
2202 static void *vl_api_ip6_fib_dump_t_print
2203 (vl_api_ip6_fib_dump_t * mp, void *handle)
2207 s = format (0, "SCRIPT: ip6_fib_dump ");
2212 static void *vl_api_classify_table_ids_t_print
2213 (vl_api_classify_table_ids_t * mp, void *handle)
2217 s = format (0, "SCRIPT: classify_table_ids ");
2222 static void *vl_api_classify_table_by_interface_t_print
2223 (vl_api_classify_table_by_interface_t * mp, void *handle)
2227 s = format (0, "SCRIPT: classify_table_by_interface ");
2228 if (mp->sw_if_index != ~0)
2229 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2234 static void *vl_api_classify_table_info_t_print
2235 (vl_api_classify_table_info_t * mp, void *handle)
2239 s = format (0, "SCRIPT: classify_table_info ");
2240 if (mp->table_id != ~0)
2241 s = format (s, "table_id %d ", ntohl (mp->table_id));
2246 static void *vl_api_classify_session_dump_t_print
2247 (vl_api_classify_session_dump_t * mp, void *handle)
2251 s = format (0, "SCRIPT: classify_session_dump ");
2252 if (mp->table_id != ~0)
2253 s = format (s, "table_id %d ", ntohl (mp->table_id));
2258 static void *vl_api_set_ipfix_exporter_t_print
2259 (vl_api_set_ipfix_exporter_t * mp, void *handle)
2263 s = format (0, "SCRIPT: set_ipfix_exporter ");
2265 s = format (s, "collector-address %U ", format_ip4_address,
2266 (ip4_address_t *) mp->collector_address);
2267 s = format (s, "collector-port %d ", ntohs (mp->collector_port));
2268 s = format (s, "src-address %U ", format_ip4_address,
2269 (ip4_address_t *) mp->src_address);
2270 s = format (s, "vrf-id %d ", ntohl (mp->vrf_id));
2271 s = format (s, "path-mtu %d ", ntohl (mp->path_mtu));
2272 s = format (s, "template-interval %d ", ntohl (mp->template_interval));
2273 s = format (s, "udp-checksum %d ", mp->udp_checksum);
2278 static void *vl_api_ipfix_exporter_dump_t_print
2279 (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2283 s = format (0, "SCRIPT: ipfix_exporter_dump ");
2288 static void *vl_api_set_ipfix_classify_stream_t_print
2289 (vl_api_set_ipfix_classify_stream_t * mp, void *handle)
2293 s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2295 s = format (s, "domain-id %d ", ntohl (mp->domain_id));
2296 s = format (s, "src-port %d ", ntohs (mp->src_port));
2301 static void *vl_api_ipfix_classify_stream_dump_t_print
2302 (vl_api_ipfix_classify_stream_dump_t * mp, void *handle)
2306 s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2311 static void *vl_api_ipfix_classify_table_add_del_t_print
2312 (vl_api_ipfix_classify_table_add_del_t * mp, void *handle)
2316 s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2318 s = format (s, "table-id %d ", ntohl (mp->table_id));
2319 s = format (s, "ip-version %d ", mp->ip_version);
2320 s = format (s, "transport-protocol %d ", mp->transport_protocol);
2325 static void *vl_api_ipfix_classify_table_dump_t_print
2326 (vl_api_ipfix_classify_table_dump_t * mp, void *handle)
2330 s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2335 static void *vl_api_sw_interface_span_enable_disable_t_print
2336 (vl_api_sw_interface_span_enable_disable_t * mp, void *handle)
2340 s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2341 s = format (s, "src_sw_if_index %u ", ntohl (mp->sw_if_index_from));
2342 s = format (s, "dst_sw_if_index %u ", ntohl (mp->sw_if_index_to));
2345 s = format (s, "l2 ");
2350 s = format (s, "disable ");
2353 s = format (s, "rx ");
2356 s = format (s, "tx ");
2360 s = format (s, "both ");
2368 vl_api_sw_interface_span_dump_t_print (vl_api_sw_interface_span_dump_t * mp,
2373 s = format (0, "SCRIPT: sw_interface_span_dump ");
2376 s = format (s, "l2 ");
2381 static void *vl_api_get_next_index_t_print
2382 (vl_api_get_next_index_t * mp, void *handle)
2386 s = format (0, "SCRIPT: get_next_index ");
2387 s = format (s, "node-name %s ", mp->node_name);
2388 s = format (s, "next-node-name %s ", mp->next_name);
2393 static void *vl_api_pg_create_interface_t_print
2394 (vl_api_pg_create_interface_t * mp, void *handle)
2398 s = format (0, "SCRIPT: pg_create_interface ");
2399 s = format (0, "if_id %d", ntohl (mp->interface_id));
2404 static void *vl_api_pg_capture_t_print
2405 (vl_api_pg_capture_t * mp, void *handle)
2409 s = format (0, "SCRIPT: pg_capture ");
2410 s = format (0, "if_id %d ", ntohl (mp->interface_id));
2411 s = format (0, "pcap %s", mp->pcap_file_name);
2412 if (mp->count != ~0)
2413 s = format (s, "count %d ", ntohl (mp->count));
2414 if (!mp->is_enabled)
2415 s = format (s, "disable");
2420 static void *vl_api_pg_enable_disable_t_print
2421 (vl_api_pg_enable_disable_t * mp, void *handle)
2425 s = format (0, "SCRIPT: pg_enable_disable ");
2426 if (ntohl (mp->stream_name_length) > 0)
2427 s = format (s, "stream %s", mp->stream_name);
2428 if (!mp->is_enabled)
2429 s = format (s, "disable");
2434 static void *vl_api_ip_source_and_port_range_check_add_del_t_print
2435 (vl_api_ip_source_and_port_range_check_add_del_t * mp, void *handle)
2440 s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2442 s = format (s, "%U/%d ", format_ip6_address, mp->address,
2445 s = format (s, "%U/%d ", format_ip4_address, mp->address,
2448 for (i = 0; i < mp->number_of_ranges; i++)
2450 s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2453 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
2455 if (mp->is_add == 0)
2456 s = format (s, "del ");
2461 static void *vl_api_ip_source_and_port_range_check_interface_add_del_t_print
2462 (vl_api_ip_source_and_port_range_check_interface_add_del_t * mp,
2467 s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2469 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2471 if (mp->tcp_out_vrf_id != ~0)
2472 s = format (s, "tcp-out-vrf %d ", ntohl (mp->tcp_out_vrf_id));
2474 if (mp->udp_out_vrf_id != ~0)
2475 s = format (s, "udp-out-vrf %d ", ntohl (mp->udp_out_vrf_id));
2477 if (mp->tcp_in_vrf_id != ~0)
2478 s = format (s, "tcp-in-vrf %d ", ntohl (mp->tcp_in_vrf_id));
2480 if (mp->udp_in_vrf_id != ~0)
2481 s = format (s, "udp-in-vrf %d ", ntohl (mp->udp_in_vrf_id));
2483 if (mp->is_add == 0)
2484 s = format (s, "del ");
2489 static void *vl_api_lisp_enable_disable_t_print
2490 (vl_api_lisp_enable_disable_t * mp, void *handle)
2494 s = format (0, "SCRIPT: lisp_enable_disable %s",
2495 mp->is_en ? "enable" : "disable");
2500 static void *vl_api_gpe_add_del_iface_t_print
2501 (vl_api_gpe_add_del_iface_t * mp, void *handle)
2505 s = format (0, "SCRIPT: gpe_add_del_iface ");
2507 s = format (s, "%s ", mp->is_add ? "up" : "down");
2508 s = format (s, "vni %d ", mp->vni);
2509 s = format (s, "%s %d ", mp->is_l2 ? "bd_id" : "table_id", mp->dp_table);
2514 static void *vl_api_lisp_pitr_set_locator_set_t_print
2515 (vl_api_lisp_pitr_set_locator_set_t * mp, void *handle)
2519 s = format (0, "SCRIPT: lisp_pitr_set_locator_set ");
2522 s = format (s, "locator-set %s ", mp->ls_name);
2524 s = format (s, "del");
2530 format_lisp_flat_eid (u8 * s, va_list * args)
2532 u32 type = va_arg (*args, u32);
2533 u8 *eid = va_arg (*args, u8 *);
2534 u32 eid_len = va_arg (*args, u32);
2539 return format (s, "%U/%d", format_ip4_address, eid, eid_len);
2541 return format (s, "%U/%d", format_ip6_address, eid, eid_len);
2543 return format (s, "%U", format_ethernet_address, eid);
2548 static void *vl_api_lisp_add_del_remote_mapping_t_print
2549 (vl_api_lisp_add_del_remote_mapping_t * mp, void *handle)
2554 s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
2557 s = format (s, "del-all ");
2559 s = format (s, "%s ", mp->is_add ? "add" : "del");
2560 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2562 s = format (s, "eid %U ", format_lisp_flat_eid,
2563 mp->eid_type, mp->eid, mp->eid_len);
2567 s = format (s, "seid %U ", format_lisp_flat_eid,
2568 mp->eid_type, mp->seid, mp->seid_len);
2571 rloc_num = clib_net_to_host_u32 (mp->rloc_num);
2574 s = format (s, "action %d", mp->action);
2579 static void *vl_api_lisp_add_del_adjacency_t_print
2580 (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
2584 s = format (0, "SCRIPT: lisp_add_del_adjacency ");
2586 s = format (s, "%s ", mp->is_add ? "add" : "del");
2587 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2588 s = format (s, "reid %U leid %U ",
2589 format_lisp_flat_eid, mp->eid_type, mp->reid, mp->reid_len,
2590 format_lisp_flat_eid, mp->eid_type, mp->leid, mp->leid_len);
2595 static void *vl_api_lisp_add_del_map_request_itr_rlocs_t_print
2596 (vl_api_lisp_add_del_map_request_itr_rlocs_t * mp, void *handle)
2600 s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
2603 s = format (s, "%s", mp->locator_set_name);
2605 s = format (s, "del");
2610 static void *vl_api_lisp_eid_table_add_del_map_t_print
2611 (vl_api_lisp_eid_table_add_del_map_t * mp, void *handle)
2615 s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
2618 s = format (s, "del ");
2620 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2621 s = format (s, "%s %d ",
2622 mp->is_l2 ? "bd_index" : "vrf",
2623 clib_net_to_host_u32 (mp->dp_table));
2627 static void *vl_api_lisp_add_del_local_eid_t_print
2628 (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
2632 s = format (0, "SCRIPT: lisp_add_del_local_eid ");
2635 s = format (s, "del ");
2637 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2638 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
2640 s = format (s, "locator-set %s ", mp->locator_set_name);
2643 u32 key_id = mp->key_id;
2644 s = format (s, "key-id %U", format_hmac_key_id, key_id);
2645 s = format (s, "secret-key %s", mp->key);
2650 static void *vl_api_gpe_add_del_fwd_entry_t_print
2651 (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle)
2655 s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO");
2660 static void *vl_api_lisp_add_del_map_resolver_t_print
2661 (vl_api_lisp_add_del_map_resolver_t * mp, void *handle)
2665 s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
2668 s = format (s, "del ");
2671 s = format (s, "%U ", format_ip6_address, mp->ip_address);
2673 s = format (s, "%U ", format_ip4_address, mp->ip_address);
2678 static void *vl_api_gpe_enable_disable_t_print
2679 (vl_api_gpe_enable_disable_t * mp, void *handle)
2683 s = format (0, "SCRIPT: gpe_enable_disable ");
2685 s = format (s, "%s ", mp->is_en ? "enable" : "disable");
2690 static void *vl_api_lisp_add_del_locator_set_t_print
2691 (vl_api_lisp_add_del_locator_set_t * mp, void *handle)
2695 s = format (0, "SCRIPT: lisp_add_del_locator_set ");
2698 s = format (s, "del ");
2700 s = format (s, "locator-set %s ", mp->locator_set_name);
2705 static void *vl_api_lisp_add_del_locator_t_print
2706 (vl_api_lisp_add_del_locator_t * mp, void *handle)
2710 s = format (0, "SCRIPT: lisp_add_del_locator ");
2713 s = format (s, "del ");
2715 s = format (s, "locator-set %s ", mp->locator_set_name);
2716 s = format (s, "sw_if_index %d ", mp->sw_if_index);
2717 s = format (s, "p %d w %d ", mp->priority, mp->weight);
2722 static void *vl_api_lisp_locator_set_dump_t_print
2723 (vl_api_lisp_locator_set_dump_t * mp, void *handle)
2727 s = format (0, "SCRIPT: lisp_locator_set_dump ");
2728 if (mp->filter == 1)
2729 s = format (s, "local");
2730 else if (mp->filter == 2)
2731 s = format (s, "remote");
2736 static void *vl_api_lisp_locator_dump_t_print
2737 (vl_api_lisp_locator_dump_t * mp, void *handle)
2741 s = format (0, "SCRIPT: lisp_locator_dump ");
2742 if (mp->is_index_set)
2743 s = format (s, "ls_index %d", clib_net_to_host_u32 (mp->ls_index));
2745 s = format (s, "ls_name %s", mp->ls_name);
2750 static void *vl_api_lisp_map_request_mode_t_print
2751 (vl_api_lisp_map_request_mode_t * mp, void *handle)
2755 s = format (0, "SCRIPT: lisp_map_request_mode ");
2760 s = format (s, "dst-only");
2763 s = format (s, "src-dst");
2771 static void *vl_api_lisp_eid_table_dump_t_print
2772 (vl_api_lisp_eid_table_dump_t * mp, void *handle)
2776 s = format (0, "SCRIPT: lisp_eid_table_dump ");
2780 s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2781 s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type,
2782 mp->eid, mp->prefix_length);
2786 s = format (s, "local ");
2789 s = format (s, "remote ");
2797 static void *vl_api_lisp_rloc_probe_enable_disable_t_print
2798 (vl_api_lisp_rloc_probe_enable_disable_t * mp, void *handle)
2802 s = format (0, "SCRIPT: lisp_rloc_probe_enable_disable ");
2804 s = format (s, "enable");
2806 s = format (s, "disable");
2811 static void *vl_api_lisp_map_register_enable_disable_t_print
2812 (vl_api_lisp_map_register_enable_disable_t * mp, void *handle)
2816 s = format (0, "SCRIPT: lisp_map_register_enable_disable ");
2818 s = format (s, "enable");
2820 s = format (s, "disable");
2825 static void *vl_api_lisp_adjacencies_get_t_print
2826 (vl_api_lisp_adjacencies_get_t * mp, void *handle)
2830 s = format (0, "SCRIPT: lisp_adjacencies_get ");
2831 s = format (s, "vni %d", clib_net_to_host_u32 (mp->vni));
2836 static void *vl_api_lisp_eid_table_map_dump_t_print
2837 (vl_api_lisp_eid_table_map_dump_t * mp, void *handle)
2841 s = format (0, "SCRIPT: lisp_eid_table_map_dump ");
2844 s = format (s, "l2");
2846 s = format (s, "l3");
2851 static void *vl_api_ipsec_gre_add_del_tunnel_t_print
2852 (vl_api_ipsec_gre_add_del_tunnel_t * mp, void *handle)
2856 s = format (0, "SCRIPT: ipsec_gre_add_del_tunnel ");
2858 s = format (s, "dst %U ", format_ip4_address,
2859 (ip4_address_t *) & (mp->dst_address));
2861 s = format (s, "src %U ", format_ip4_address,
2862 (ip4_address_t *) & (mp->src_address));
2864 s = format (s, "local_sa %d ", ntohl (mp->local_sa_id));
2866 s = format (s, "remote_sa %d ", ntohl (mp->remote_sa_id));
2868 if (mp->is_add == 0)
2869 s = format (s, "del ");
2874 static void *vl_api_ipsec_gre_tunnel_dump_t_print
2875 (vl_api_ipsec_gre_tunnel_dump_t * mp, void *handle)
2879 s = format (0, "SCRIPT: ipsec_gre_tunnel_dump ");
2881 if (mp->sw_if_index != ~0)
2882 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2887 static void *vl_api_l2_interface_pbb_tag_rewrite_t_print
2888 (vl_api_l2_interface_pbb_tag_rewrite_t * mp, void *handle)
2891 u32 vtr_op = ntohl (mp->vtr_op);
2893 s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
2895 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2896 s = format (s, "vtr_op %d ", vtr_op);
2897 if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
2899 if (vtr_op == L2_VTR_TRANSLATE_2_2)
2900 s = format (s, "%d ", ntohs (mp->outer_tag));
2901 s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
2902 s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
2903 s = format (s, "sid %d ", ntohl (mp->i_sid));
2904 s = format (s, "vlanid %d ", ntohs (mp->b_vlanid));
2910 static void *vl_api_flow_classify_set_interface_t_print
2911 (vl_api_flow_classify_set_interface_t * mp, void *handle)
2915 s = format (0, "SCRIPT: flow_classify_set_interface ");
2916 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2917 if (mp->ip4_table_index != ~0)
2918 s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2919 if (mp->ip6_table_index != ~0)
2920 s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2921 if (mp->is_add == 0)
2922 s = format (s, "del ");
2928 vl_api_punt_t_print (vl_api_punt_t * mp, void *handle)
2932 s = format (0, "SCRIPT: punt ");
2934 if (mp->ipv != (u8) ~ 0)
2935 s = format (s, "ip %d ", mp->ipv);
2937 s = format (s, "protocol %d ", mp->l4_protocol);
2939 if (mp->l4_port != (u16) ~ 0)
2940 s = format (s, "port %d ", ntohs (mp->l4_port));
2943 s = format (s, "del ");
2948 static void *vl_api_flow_classify_dump_t_print
2949 (vl_api_flow_classify_dump_t * mp, void *handle)
2953 s = format (0, "SCRIPT: flow_classify_dump ");
2956 case FLOW_CLASSIFY_TABLE_IP4:
2957 s = format (s, "type ip4 ");
2959 case FLOW_CLASSIFY_TABLE_IP6:
2960 s = format (s, "type ip6 ");
2969 static void *vl_api_get_first_msg_id_t_print
2970 (vl_api_get_first_msg_id_t * mp, void *handle)
2974 s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
2979 static void *vl_api_ioam_enable_t_print
2980 (vl_api_ioam_enable_t * mp, void *handle)
2984 s = format (0, "SCRIPT: ioam_enable ");
2986 if (mp->trace_enable)
2987 s = format (s, "trace enabled");
2990 s = format (s, "POT enabled");
2993 s = format (s, "Seqno enabled");
2996 s = format (s, "Analyse enabled");
3001 static void *vl_api_ioam_disable_t_print
3002 (vl_api_ioam_disable_t * mp, void *handle)
3006 s = format (0, "SCRIPT: ioam_disable ");
3007 s = format (s, "trace disabled");
3008 s = format (s, "POT disabled");
3009 s = format (s, "Seqno disabled");
3010 s = format (s, "Analyse disabled");
3015 static void *vl_api_feature_enable_disable_t_print
3016 (vl_api_feature_enable_disable_t * mp, void *handle)
3020 s = format (0, "SCRIPT: feature_enable_disable ");
3021 s = format (s, "arc_name %s ", mp->arc_name);
3022 s = format (s, "feature_name %s ", mp->feature_name);
3023 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3025 s = format (s, "disable");
3030 static void *vl_api_sw_interface_tag_add_del_t_print
3031 (vl_api_sw_interface_tag_add_del_t * mp, void *handle)
3035 s = format (0, "SCRIPT: sw_interface_tag_add_del ");
3036 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3038 s = format (s, "tag %s ", mp->tag);
3040 s = format (s, "del ");
3045 static void *vl_api_sw_interface_set_mtu_t_print
3046 (vl_api_sw_interface_set_mtu_t * mp, void *handle)
3050 s = format (0, "SCRIPT: sw_interface_set_mtu ");
3051 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3052 s = format (s, "tag %d ", ntohs (mp->mtu));
3057 static void *vl_api_p2p_ethernet_add_t_print
3058 (vl_api_p2p_ethernet_add_t * mp, void *handle)
3062 s = format (0, "SCRIPT: p2p_ethernet_add ");
3063 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3064 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3069 static void *vl_api_p2p_ethernet_del_t_print
3070 (vl_api_p2p_ethernet_del_t * mp, void *handle)
3074 s = format (0, "SCRIPT: p2p_ethernet_del ");
3075 s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3076 s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3081 static void *vl_api_tcp_configure_src_addresses_t_print
3082 (vl_api_tcp_configure_src_addresses_t * mp, void *handle)
3086 s = format (0, "SCRIPT: tcp_configure_src_addresses ");
3088 s = format (s, "%U - %U ",
3089 format_ip6_address, (ip6_address_t *) mp->first_address,
3090 format_ip6_address, (ip6_address_t *) mp->last_address);
3092 s = format (s, "%U - %U ",
3093 format_ip4_address, (ip4_address_t *) mp->first_address,
3094 format_ip4_address, (ip4_address_t *) mp->last_address);
3097 s = format (s, "vrf %d ", ntohl (mp->vrf_id));
3102 static void *vl_api_app_namespace_add_del_t_print
3103 (vl_api_app_namespace_add_del_t * mp, void *handle)
3106 u8 len = clib_min (mp->namespace_id_len,
3107 ARRAY_LEN (mp->namespace_id) - 1);
3108 mp->namespace_id[len] = 0;
3109 s = format (0, "SCRIPT: app_namespace_add_del ");
3110 s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d "
3111 "ipv6_fib_id %d", (char *) mp->namespace_id, mp->secret,
3112 clib_net_to_host_u32 (mp->sw_if_index),
3113 clib_net_to_host_u32 (mp->ip4_fib_id),
3114 clib_net_to_host_u32 (mp->ip6_fib_id));
3118 static void *vl_api_lldp_config_t_print
3119 (vl_api_lldp_config_t * mp, void *handle)
3123 s = format (0, "SCRIPT: lldp_config ");
3124 s = format (s, "system_name %s ", mp->system_name);
3125 s = format (s, "tx_hold %d ", ntohl (mp->tx_hold));
3126 s = format (s, "tx_interval %d ", ntohl (mp->tx_interval));
3130 static void *vl_api_dns_enable_disable_t_print
3131 (vl_api_dns_enable_disable_t * mp, void *handle)
3135 s = format (0, "SCRIPT: dns_enable_disable ");
3136 s = format (s, "%s ", mp->enable ? "enable" : "disable");
3141 static void *vl_api_sw_interface_set_lldp_t_print
3142 (vl_api_sw_interface_set_lldp_t * mp, void *handle)
3147 memset (null_data, 0, sizeof (null_data));
3149 s = format (0, "SCRIPT: sw_interface_set_lldp ");
3150 s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3152 if (memcmp (mp->port_desc, null_data, sizeof (mp->port_desc)))
3153 s = format (s, "port_desc %s ", mp->port_desc);
3155 if (memcmp (mp->mgmt_ip4, null_data, sizeof (mp->mgmt_ip4)))
3156 s = format (s, "mgmt_ip4 %U ", format_ip4_address, mp->mgmt_ip4);
3158 if (memcmp (mp->mgmt_ip6, null_data, sizeof (mp->mgmt_ip6)))
3159 s = format (s, "mgmt_ip6 %U ", format_ip6_address, mp->mgmt_ip6);
3161 if (memcmp (mp->mgmt_oid, null_data, sizeof (mp->mgmt_oid)))
3162 s = format (s, "mgmt_oid %s ", mp->mgmt_oid);
3164 if (mp->enable == 0)
3165 s = format (s, "disable ");
3170 static void *vl_api_dns_name_server_add_del_t_print
3171 (vl_api_dns_name_server_add_del_t * mp, void *handle)
3175 s = format (0, "SCRIPT: dns_name_server_add_del ");
3177 s = format (s, "%U ", format_ip6_address,
3178 (ip6_address_t *) mp->server_address);
3180 s = format (s, "%U ", format_ip4_address,
3181 (ip4_address_t *) mp->server_address);
3183 if (mp->is_add == 0)
3184 s = format (s, "del ");
3189 static void *vl_api_dns_resolve_name_t_print
3190 (vl_api_dns_resolve_name_t * mp, void *handle)
3194 s = format (0, "SCRIPT: dns_resolve_name ");
3195 s = format (s, "%s ", mp->name);
3199 static void *vl_api_dns_resolve_ip_t_print
3200 (vl_api_dns_resolve_ip_t * mp, void *handle)
3204 s = format (0, "SCRIPT: dns_resolve_ip ");
3206 s = format (s, "%U ", format_ip6_address, mp->address);
3208 s = format (s, "%U ", format_ip4_address, mp->address);
3212 static void *vl_api_session_rule_add_del_t_print
3213 (vl_api_session_rule_add_del_t * mp, void *handle)
3216 char *proto = mp->transport_proto == 0 ? "tcp" : "udp";
3217 s = format (0, "SCRIPT: session_rule_add_del ");
3219 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u",
3220 mp->appns_index, mp->scope, proto, format_ip4_address,
3221 (ip4_address_t *) mp->lcl_ip, mp->lcl_plen,
3222 format_ip4_address, (ip4_address_t *) mp->rmt_ip,
3223 mp->rmt_plen, mp->action_index);
3225 s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u",
3226 mp->appns_index, mp->scope, proto, format_ip6_address,
3227 (ip6_address_t *) mp->lcl_ip, mp->lcl_plen,
3228 format_ip6_address, (ip6_address_t *) mp->rmt_ip,
3229 mp->rmt_plen, mp->action_index);
3233 #define foreach_custom_print_no_arg_function \
3234 _(lisp_eid_table_vni_dump) \
3235 _(lisp_map_resolver_dump) \
3236 _(lisp_map_server_dump) \
3237 _(show_lisp_rloc_probe_state) \
3238 _(show_lisp_map_register_state) \
3239 _(show_lisp_map_request_mode)
3242 static void * vl_api_ ## f ## _t_print \
3243 (vl_api_ ## f ## _t * mp, void * handle) \
3246 s = format (0, "SCRIPT: " #f ); \
3249 foreach_custom_print_no_arg_function
3251 #define foreach_custom_print_function \
3252 _(CREATE_LOOPBACK, create_loopback) \
3253 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
3254 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
3255 _(SW_INTERFACE_EVENT, sw_interface_event) \
3256 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
3257 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
3258 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
3259 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
3260 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
3261 _(SW_INTERFACE_SET_GENEVE_BYPASS, sw_interface_set_geneve_bypass) \
3262 _(TAP_CONNECT, tap_connect) \
3263 _(TAP_MODIFY, tap_modify) \
3264 _(TAP_DELETE, tap_delete) \
3265 _(SW_INTERFACE_TAP_DUMP, sw_interface_tap_dump) \
3266 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \
3267 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
3268 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
3269 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3270 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3271 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
3272 _(RESET_VRF, reset_vrf) \
3273 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3274 _(CREATE_SUBIF, create_subif) \
3275 _(OAM_ADD_DEL, oam_add_del) \
3276 _(RESET_FIB, reset_fib) \
3277 _(DHCP_PROXY_CONFIG, dhcp_proxy_config) \
3278 _(DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss) \
3279 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3280 _(SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS, \
3281 sw_interface_ip6_set_link_local_address) \
3282 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \
3283 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \
3284 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
3285 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3286 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3287 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3288 _(SR_POLICY_ADD, sr_policy_add) \
3289 _(SR_POLICY_MOD, sr_policy_mod) \
3290 _(SR_POLICY_DEL, sr_policy_del) \
3291 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3292 _(L2FIB_ADD_DEL, l2fib_add_del) \
3293 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3294 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3295 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3296 _(L2_FLAGS, l2_flags) \
3297 _(BRIDGE_FLAGS, bridge_flags) \
3298 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3299 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3300 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3301 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3302 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3303 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3304 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3305 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3306 _(ADD_NODE_NEXT, add_node_next) \
3307 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \
3308 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \
3309 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \
3310 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \
3311 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
3312 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
3313 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3314 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3315 _(GENEVE_ADD_DEL_TUNNEL, geneve_add_del_tunnel) \
3316 _(GENEVE_TUNNEL_DUMP, geneve_tunnel_dump) \
3317 _(GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel) \
3318 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3319 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3320 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3321 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3322 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3323 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3324 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3325 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3326 _(CONTROL_PING, control_ping) \
3327 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3329 _(CLI_INBAND, cli_inband) \
3330 _(MEMCLNT_CREATE, memclnt_create) \
3331 _(SOCKCLNT_CREATE, sockclnt_create) \
3332 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3333 _(SHOW_VERSION, show_version) \
3334 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3335 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3336 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3337 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3338 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
3339 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \
3340 _(WANT_L2_MACS_EVENTS, want_l2_macs_events) \
3341 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3342 _(IP_ADDRESS_DUMP, ip_address_dump) \
3343 _(IP_DUMP, ip_dump) \
3344 _(DELETE_LOOPBACK, delete_loopback) \
3345 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3346 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3347 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3348 _(AF_PACKET_CREATE, af_packet_create) \
3349 _(AF_PACKET_DELETE, af_packet_delete) \
3350 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3351 _(MPLS_FIB_DUMP, mpls_fib_dump) \
3352 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3353 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3354 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3355 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3356 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3357 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3358 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3359 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3360 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3361 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3362 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3363 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3364 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3365 _(GET_NEXT_INDEX, get_next_index) \
3366 _(PG_CREATE_INTERFACE,pg_create_interface) \
3367 _(PG_CAPTURE, pg_capture) \
3368 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3369 _(POLICER_ADD_DEL, policer_add_del) \
3370 _(POLICER_DUMP, policer_dump) \
3371 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3372 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3373 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3374 ip_source_and_port_range_check_add_del) \
3375 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3376 ip_source_and_port_range_check_interface_add_del) \
3377 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
3378 _(GPE_ENABLE_DISABLE, gpe_enable_disable) \
3379 _(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \
3380 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
3381 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \
3382 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \
3383 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
3384 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
3385 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
3386 lisp_add_del_map_request_itr_rlocs) \
3387 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
3388 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
3389 _(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \
3390 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
3391 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
3392 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
3393 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
3394 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
3395 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \
3396 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
3397 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \
3398 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
3399 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \
3400 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \
3401 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \
3402 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \
3403 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \
3404 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \
3405 _(IPSEC_GRE_ADD_DEL_TUNNEL, ipsec_gre_add_del_tunnel) \
3406 _(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \
3407 _(DELETE_SUBIF, delete_subif) \
3408 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3410 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3411 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3412 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3413 _(IOAM_ENABLE, ioam_enable) \
3414 _(IOAM_DISABLE, ioam_disable) \
3415 _(IP_FIB_DUMP, ip_fib_dump) \
3416 _(IP6_FIB_DUMP, ip6_fib_dump) \
3417 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3418 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3419 _(SW_INTERFACE_SET_MTU, sw_interface_set_mtu) \
3420 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3421 _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
3422 _(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
3423 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
3424 _(LLDP_CONFIG, lldp_config) \
3425 _(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \
3426 _(DNS_ENABLE_DISABLE, dns_enable_disable) \
3427 _(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \
3428 _(DNS_RESOLVE_NAME, dns_resolve_name) \
3429 _(DNS_RESOLVE_IP, dns_resolve_ip) \
3430 _(SESSION_RULE_ADD_DEL, session_rule_add_del)
3432 vl_msg_api_custom_dump_configure (api_main_t * am)
3434 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3435 = (void *) vl_api_##f##_t_print;
3436 foreach_custom_print_function;
3441 * fd.io coding-style-patch-verification: ON
3444 * eval: (c-set-style "gnu")