FD.io VPP  v17.07.01-10-g3be13f0
Vector Packet Processing
custom_dump.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * custom_dump.c - pretty-print API messages for replay
4  *
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:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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  *------------------------------------------------------------------
18  */
19 
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>
30 #include <vnet/policer/xlate.h>
31 #include <vnet/policer/policer.h>
33 #include <vlib/vlib.h>
34 #include <vlib/unix/unix.h>
35 #include <vlibapi/api.h>
36 #include <vlibmemory/api.h>
38 
39 #include <vpp/stats/stats.h>
40 #include <vpp/oam/oam.h>
41 
42 #include <vnet/ethernet/ethernet.h>
43 #include <vnet/l2/l2_vtr.h>
44 
45 #include <vpp/api/vpe_msg_enum.h>
46 
47 #define vl_typedefs /* define message structures */
48 #include <vpp/api/vpe_all_api_h.h>
49 #undef vl_typedefs
50 
51 #define vl_endianfun /* define message structures */
52 #include <vpp/api/vpe_all_api_h.h>
53 #undef vl_endianfun
54 
55 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
56 
57 #define FINISH \
58  vec_add1 (s, 0); \
59  vl_print (handle, (char *)s); \
60  vec_free (s); \
61  return handle;
62 
63 
65  (vl_api_create_loopback_t * mp, void *handle)
66 {
67  u8 *s;
68 
69  s = format (0, "SCRIPT: create_loopback ");
70  s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
71 
72  FINISH;
73 }
74 
76  (vl_api_create_loopback_instance_t * mp, void *handle)
77 {
78  u8 *s;
79 
80  s = format (0, "SCRIPT: create_loopback ");
81  s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
82  s = format (s, "instance %d ", ntohl (mp->user_instance));
83 
84  FINISH;
85 }
86 
88  (vl_api_delete_loopback_t * mp, void *handle)
89 {
90  u8 *s;
91 
92  s = format (0, "SCRIPT: delete_loopback ");
93  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
94 
95  FINISH;
96 }
97 
99  (vl_api_sw_interface_set_flags_t * mp, void *handle)
100 {
101  u8 *s;
102  s = format (0, "SCRIPT: sw_interface_set_flags ");
103 
104  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
105 
106  if (mp->admin_up_down)
107  s = format (s, "admin-up ");
108  else
109  s = format (s, "admin-down ");
110 
111  if (mp->link_up_down)
112  s = format (s, "link-up");
113  else
114  s = format (s, "link-down");
115 
116  FINISH;
117 }
118 
121 {
122  u8 *s;
123 
124  s = format (0, "SCRIPT: sw_interface_add_del_address ");
125 
126  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
127 
128  if (mp->is_ipv6)
129  s = format (s, "%U/%d ", format_ip6_address,
130  (ip6_address_t *) mp->address, mp->address_length);
131  else
132  s = format (s, "%U/%d ", format_ip4_address,
133  (ip4_address_t *) mp->address, mp->address_length);
134 
135  if (mp->is_add == 0)
136  s = format (s, "del ");
137  if (mp->del_all)
138  s = format (s, "del-all ");
139 
140  FINISH;
141 }
142 
144  (vl_api_sw_interface_set_table_t * mp, void *handle)
145 {
146  u8 *s;
147 
148  s = format (0, "SCRIPT: sw_interface_set_table ");
149 
150  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
151 
152  if (mp->vrf_id)
153  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
154 
155  if (mp->is_ipv6)
156  s = format (s, "ipv6 ");
157 
158  FINISH;
159 }
160 
163 {
164  u8 *s;
165 
166  s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
167 
168  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
169 
170  if (mp->enable == 0)
171  s = format (s, "disable");
172 
173  FINISH;
174 }
175 
177  (vl_api_sw_interface_set_vpath_t * mp, void *handle)
178 {
179  u8 *s;
180 
181  s = format (0, "SCRIPT: sw_interface_set_vpath ");
182 
183  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
184 
185  if (mp->enable)
186  s = format (s, "enable ");
187  else
188  s = format (s, "disable ");
189 
190  FINISH;
191 }
192 
195 {
196  u8 *s;
197 
198  s = format (0, "SCRIPT: sw_interface_set_vxlan_bypass ");
199 
200  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
201 
202  if (mp->is_ipv6)
203  s = format (s, "ip6 ");
204 
205  if (mp->enable)
206  s = format (s, "enable ");
207  else
208  s = format (s, "disable ");
209 
210  FINISH;
211 }
212 
215 {
216  u8 *s;
217 
218  s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
219 
220  s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
221 
222  if (mp->enable)
223  {
224  s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
225  }
226  else
227  s = format (s, "delete ");
228 
229  FINISH;
230 }
231 
234 {
235  u8 *s;
236 
237  s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
238 
239  s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
240 
241  if (mp->enable)
242  {
243  s = format (s, "bd_id %d shg %d %senable ", ntohl (mp->bd_id),
244  mp->shg, ((mp->bvi) ? "bvi " : " "));
245  }
246  else
247  s = format (s, "disable ");
248 
249  FINISH;
250 }
251 
253  (vl_api_bridge_domain_add_del_t * mp, void *handle)
254 {
255  u8 *s;
256 
257  s = format (0, "SCRIPT: bridge_domain_add_del ");
258 
259  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
260 
261  if (mp->is_add)
262  {
263  s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood);
264  s = format (s, "forward %d learn %d ", mp->forward, mp->learn);
265  s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age);
266  }
267  else
268  s = format (s, "del ");
269 
270  FINISH;
271 }
272 
275 {
276  u8 *s;
277 
278  s = format (0, "SCRIPT: bridge_domain_set_mac_age ");
279 
280  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
281 
282  s = format (s, "mac-age %d", mp->mac_age);
283 
284  FINISH;
285 }
286 
288  (vl_api_bridge_domain_dump_t * mp, void *handle)
289 {
290  u8 *s;
291  u32 bd_id = ntohl (mp->bd_id);
292 
293  s = format (0, "SCRIPT: bridge_domain_dump ");
294 
295  if (bd_id != ~0)
296  s = format (s, "bd_id %d ", bd_id);
297 
298  FINISH;
299 }
300 
302  (vl_api_l2fib_flush_all_t * mp, void *handle)
303 {
304  u8 *s;
305 
306  s = format (0, "SCRIPT: l2fib_flush_all ");
307 
308  FINISH;
309 }
310 
311 
313  (vl_api_l2fib_flush_bd_t * mp, void *handle)
314 {
315  u8 *s;
316  u32 bd_id = ntohl (mp->bd_id);
317 
318  s = format (0, "SCRIPT: l2fib_flush_bd ");
319  s = format (s, "bd_id %d ", bd_id);
320 
321  FINISH;
322 }
323 
325  (vl_api_l2fib_flush_int_t * mp, void *handle)
326 {
327  u8 *s;
328  u32 sw_if_index = ntohl (mp->sw_if_index);
329 
330  s = format (0, "SCRIPT: l2fib_flush_int ");
331  s = format (s, "sw_if_index %d ", sw_if_index);
332 
333  FINISH;
334 }
335 
336 static void *vl_api_l2fib_add_del_t_print
337  (vl_api_l2fib_add_del_t * mp, void *handle)
338 {
339  u8 *s;
340 
341  s = format (0, "SCRIPT: l2fib_add_del ");
342 
343  s = format (s, "mac %U ", format_ethernet_address, &mp->mac);
344 
345  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
346 
347 
348  if (mp->is_add)
349  {
350  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
351  if (mp->static_mac)
352  s = format (s, "%s", "static ");
353  if (mp->filter_mac)
354  s = format (s, "%s", "filter ");
355  if (mp->bvi_mac)
356  s = format (s, "%s", "bvi ");
357  }
358  else
359  {
360  s = format (s, "del ");
361  }
362 
363  FINISH;
364 }
365 
366 static void *
368 {
369  u8 *s;
370  u32 flags = ntohl (mp->feature_bitmap);
371 
372  s = format (0, "SCRIPT: l2_flags ");
373 
374  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
375 
376 #define _(a,b) \
377  if (flags & L2INPUT_FEAT_ ## a) s = format (s, #a " ");
379 #undef _
380 
381  FINISH;
382 }
383 
384 static void *vl_api_bridge_flags_t_print
385  (vl_api_bridge_flags_t * mp, void *handle)
386 {
387  u8 *s;
388  u32 flags = ntohl (mp->feature_bitmap);
389 
390  s = format (0, "SCRIPT: bridge_flags ");
391 
392  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
393 
394  if (flags & L2_LEARN)
395  s = format (s, "learn ");
396  if (flags & L2_FWD)
397  s = format (s, "forward ");
398  if (flags & L2_FLOOD)
399  s = format (s, "flood ");
400  if (flags & L2_UU_FLOOD)
401  s = format (s, "uu-flood ");
402  if (flags & L2_ARP_TERM)
403  s = format (s, "arp-term ");
404 
405  if (mp->is_set == 0)
406  s = format (s, "clear ");
407 
408  FINISH;
409 }
410 
412  (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
413 {
414  u8 *s;
415 
416  s = format (0, "SCRIPT: bd_ip_mac_add_del ");
417  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
418 
419  if (mp->is_ipv6)
420  s = format (s, "%U ", format_ip6_address,
421  (ip6_address_t *) mp->ip_address);
422  else
423  s = format (s, "%U ", format_ip4_address,
424  (ip4_address_t *) mp->ip_address);
425 
426  s = format (s, "%U ", format_ethernet_address, mp->mac_address);
427  if (mp->is_add == 0)
428  s = format (s, "del ");
429 
430  FINISH;
431 }
432 
433 static void *vl_api_tap_connect_t_print
434  (vl_api_tap_connect_t * mp, void *handle)
435 {
436  u8 *s;
437  u8 null_mac[6];
438 
439  memset (null_mac, 0, sizeof (null_mac));
440 
441  s = format (0, "SCRIPT: tap_connect ");
442  s = format (s, "tapname %s ", mp->tap_name);
443  if (mp->use_random_mac)
444  s = format (s, "random-mac ");
445  if (mp->tag[0])
446  s = format (s, "tag %s ", mp->tag);
447  if (memcmp (mp->mac_address, null_mac, 6))
448  s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
449  if (mp->ip4_address_set)
450  s = format (s, "address %U/%d ", format_ip4_address, mp->ip4_address,
451  mp->ip4_mask_width);
452  if (mp->ip6_address_set)
453  s = format (s, "address %U/%d ", format_ip6_address, mp->ip6_address,
454  mp->ip6_mask_width);
455  FINISH;
456 }
457 
458 static void *vl_api_tap_modify_t_print
459  (vl_api_tap_modify_t * mp, void *handle)
460 {
461  u8 *s;
462  u8 null_mac[6];
463 
464  memset (null_mac, 0, sizeof (null_mac));
465 
466  s = format (0, "SCRIPT: tap_modify ");
467  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
468  s = format (s, "tapname %s ", mp->tap_name);
469  if (mp->use_random_mac)
470  s = format (s, "random-mac ");
471 
472  if (memcmp (mp->mac_address, null_mac, 6))
473  s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
474 
475  FINISH;
476 }
477 
478 static void *vl_api_tap_delete_t_print
479  (vl_api_tap_delete_t * mp, void *handle)
480 {
481  u8 *s;
482 
483  s = format (0, "SCRIPT: tap_delete ");
484  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
485 
486  FINISH;
487 }
488 
490  (vl_api_sw_interface_tap_dump_t * mp, void *handle)
491 {
492  u8 *s;
493 
494  s = format (0, "SCRIPT: sw_interface_tap_dump ");
495 
496  FINISH;
497 }
498 
499 
501  (vl_api_ip_add_del_route_t * mp, void *handle)
502 {
503  u8 *s;
504 
505  s = format (0, "SCRIPT: ip_add_del_route ");
506  if (mp->is_add == 0)
507  s = format (s, "del ");
508 
509  if (mp->next_hop_sw_if_index)
510  s = format (s, "sw_if_index %d ", ntohl (mp->next_hop_sw_if_index));
511 
512  if (mp->is_ipv6)
513  s = format (s, "%U/%d ", format_ip6_address, mp->dst_address,
514  mp->dst_address_length);
515  else
516  s = format (s, "%U/%d ", format_ip4_address, mp->dst_address,
517  mp->dst_address_length);
518  if (mp->is_local)
519  s = format (s, "local ");
520  else if (mp->is_drop)
521  s = format (s, "drop ");
522  else if (mp->is_classify)
523  s = format (s, "classify %d", ntohl (mp->classify_table_index));
524  else
525  {
526  if (mp->is_ipv6)
527  s = format (s, "via %U ", format_ip6_address, mp->next_hop_address);
528  else
529  s = format (s, "via %U ", format_ip4_address, mp->next_hop_address);
530  }
531 
532  if (mp->table_id != 0)
533  s = format (s, "vrf %d ", ntohl (mp->table_id));
534 
535  if (mp->create_vrf_if_needed)
536  s = format (s, "create-vrf ");
537 
538  if (mp->next_hop_weight != 1)
539  s = format (s, "weight %d ", mp->next_hop_weight);
540 
541  if (mp->not_last)
542  s = format (s, "not-last ");
543 
544  if (mp->is_multipath)
545  s = format (s, "multipath ");
546 
547  if (mp->is_multipath)
548  s = format (s, "multipath ");
549 
550  if (mp->next_hop_table_id)
551  s = format (s, "lookup-in-vrf %d ", ntohl (mp->next_hop_table_id));
552 
553  FINISH;
554 }
555 
557  (vl_api_proxy_arp_add_del_t * mp, void *handle)
558 {
559  u8 *s;
560 
561  s = format (0, "SCRIPT: proxy_arp_add_del ");
562 
563  s = format (s, "%U - %U ", format_ip4_address, mp->low_address,
565 
566  if (mp->vrf_id)
567  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
568 
569  if (mp->is_add == 0)
570  s = format (s, "del ");
571 
572  FINISH;
573 }
574 
577 {
578  u8 *s;
579 
580  s = format (0, "SCRIPT: proxy_arp_intfc_enable_disable ");
581 
582  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
583 
584  s = format (s, "enable %d ", mp->enable_disable);
585 
586  FINISH;
587 }
588 
590  (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
591 {
592  u8 *s;
593 
594  s = format (0, "SCRIPT: mpls_tunnel_add_del ");
595 
596  if (mp->mt_next_hop_sw_if_index)
597  s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index));
598 
599  if (mp->mt_next_hop_proto_is_ip4)
600  s = format (s, "%U ", format_ip4_address, mp->mt_next_hop);
601  else
602  s = format (s, "%U ", format_ip6_address, mp->mt_next_hop);
603 
604  if (mp->mt_l2_only)
605  s = format (s, "l2-only ");
606 
607  if (mp->mt_is_add == 0)
608  s = format (s, "del ");
609 
610  FINISH;
611 }
612 
615 {
616  u8 *s;
617 
618  s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
619 
620  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
621 
622  s = format (s, "unnum_if_index %d ", ntohl (mp->unnumbered_sw_if_index));
623 
624  if (mp->is_add == 0)
625  s = format (s, "del ");
626 
627  FINISH;
628 }
629 
631  (vl_api_ip_neighbor_add_del_t * mp, void *handle)
632 {
633  u8 *s;
634  u8 null_mac[6];
635 
636  memset (null_mac, 0, sizeof (null_mac));
637 
638  s = format (0, "SCRIPT: ip_neighbor_add_del ");
639 
640  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
641 
642  if (mp->is_static)
643  s = format (s, "is_static ");
644 
645  if (mp->is_no_adj_fib)
646  s = format (s, "is_no_fib_entry ");
647 
648  if (memcmp (mp->mac_address, null_mac, 6))
649  s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
650 
651  if (mp->is_ipv6)
652  s =
653  format (s, "dst %U ", format_ip6_address,
654  (ip6_address_t *) mp->dst_address);
655  else
656  s =
657  format (s, "dst %U ", format_ip4_address,
658  (ip4_address_t *) mp->dst_address);
659 
660  if (mp->is_add == 0)
661  s = format (s, "del ");
662 
663  FINISH;
664 }
665 
666 static void *
668 {
669  u8 *s;
670 
671  s = format (0, "SCRIPT: reset_vrf ");
672 
673  if (mp->vrf_id)
674  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
675 
676  if (mp->is_ipv6 != 0)
677  s = format (s, "ipv6 ");
678 
679  FINISH;
680 }
681 
683  (vl_api_create_vlan_subif_t * mp, void *handle)
684 {
685  u8 *s;
686 
687  s = format (0, "SCRIPT: create_vlan_subif ");
688 
689  if (mp->sw_if_index)
690  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
691 
692  if (mp->vlan_id)
693  s = format (s, "vlan_id %d ", ntohl (mp->vlan_id));
694 
695  FINISH;
696 }
697 
698 #define foreach_create_subif_bit \
699 _(no_tags) \
700 _(one_tag) \
701 _(two_tags) \
702 _(dot1ad) \
703 _(exact_match) \
704 _(default_sub) \
705 _(outer_vlan_id_any) \
706 _(inner_vlan_id_any)
707 
708 static void *vl_api_create_subif_t_print
709  (vl_api_create_subif_t * mp, void *handle)
710 {
711  u8 *s;
712 
713  s = format (0, "SCRIPT: create_subif ");
714 
715  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
716 
717  s = format (s, "sub_id %d ", ntohl (mp->sub_id));
718 
719  if (mp->outer_vlan_id)
720  s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
721 
722  if (mp->inner_vlan_id)
723  s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
724 
725 #define _(a) if (mp->a) s = format (s, "%s ", #a);
727 #undef _
728 
729  FINISH;
730 }
731 
732 static void *vl_api_delete_subif_t_print
733  (vl_api_delete_subif_t * mp, void *handle)
734 {
735  u8 *s;
736 
737  s = format (0, "SCRIPT: delete_subif ");
738  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
739 
740  FINISH;
741 }
742 
743 static void *vl_api_oam_add_del_t_print
744  (vl_api_oam_add_del_t * mp, void *handle)
745 {
746  u8 *s;
747 
748  s = format (0, "SCRIPT: oam_add_del ");
749 
750  if (mp->vrf_id)
751  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
752 
753  s = format (s, "src %U ", format_ip4_address, mp->src_address);
754 
755  s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
756 
757  if (mp->is_add == 0)
758  s = format (s, "del ");
759 
760  FINISH;
761 }
762 
763 static void *
765 {
766  u8 *s;
767 
768  s = format (0, "SCRIPT: reset_fib ");
769 
770  if (mp->vrf_id)
771  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
772 
773  if (mp->is_ipv6 != 0)
774  s = format (s, "ipv6 ");
775 
776  FINISH;
777 }
778 
780  (vl_api_dhcp_proxy_config_t * mp, void *handle)
781 {
782  u8 *s;
783 
784  s = format (0, "SCRIPT: dhcp_proxy_config_2 ");
785 
786  s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
787  s = format (s, "server_vrf_id %d ", ntohl (mp->server_vrf_id));
788 
789  if (mp->is_ipv6)
790  {
791  s = format (s, "svr %U ", format_ip6_address,
792  (ip6_address_t *) mp->dhcp_server);
793  s = format (s, "src %U ", format_ip6_address,
795  }
796  else
797  {
798  s = format (s, "svr %U ", format_ip4_address,
799  (ip4_address_t *) mp->dhcp_server);
800  s = format (s, "src %U ", format_ip4_address,
802  }
803  if (mp->is_add == 0)
804  s = format (s, "del ");
805 
806  FINISH;
807 }
808 
810  (vl_api_dhcp_proxy_set_vss_t * mp, void *handle)
811 {
812  u8 *s;
813 
814  s = format (0, "SCRIPT: dhcp_proxy_set_vss ");
815 
816  s = format (s, "tbl_id %d ", ntohl (mp->tbl_id));
817 
818  s = format (s, "fib_id %d ", ntohl (mp->fib_id));
819 
820  s = format (s, "oui %d ", ntohl (mp->oui));
821 
822  if (mp->is_ipv6 != 0)
823  s = format (s, "ipv6 ");
824 
825  if (mp->is_add == 0)
826  s = format (s, "del ");
827 
828  FINISH;
829 }
830 
832  (vl_api_dhcp_client_config_t * mp, void *handle)
833 {
834  u8 *s;
835 
836  s = format (0, "SCRIPT: dhcp_client_config ");
837 
838  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
839 
840  s = format (s, "hostname %s ", mp->hostname);
841 
842  s = format (s, "want_dhcp_event %d ", mp->want_dhcp_event);
843 
844  s = format (s, "pid %d ", ntohl (mp->pid));
845 
846  if (mp->is_add == 0)
847  s = format (s, "del ");
848 
849  FINISH;
850 }
851 
852 
854  (vl_api_set_ip_flow_hash_t * mp, void *handle)
855 {
856  u8 *s;
857 
858  s = format (0, "SCRIPT: set_ip_flow_hash ");
859 
860  s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
861 
862  if (mp->src)
863  s = format (s, "src ");
864 
865  if (mp->dst)
866  s = format (s, "dst ");
867 
868  if (mp->sport)
869  s = format (s, "sport ");
870 
871  if (mp->dport)
872  s = format (s, "dport ");
873 
874  if (mp->proto)
875  s = format (s, "proto ");
876 
877  if (mp->reverse)
878  s = format (s, "reverse ");
879 
880  if (mp->is_ipv6 != 0)
881  s = format (s, "ipv6 ");
882 
883  FINISH;
884 }
885 
888 {
889  u8 *s;
890 
891  s = format (0, "SCRIPT: sw_interface_ip6_set_link_local_address ");
892 
893  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
894 
895  s = format (s, "%U ", format_ip6_address, mp->address);
896 
897  FINISH;
898 }
899 
902 {
903  u8 *s;
904 
905  s = format (0, "SCRIPT: sw_interface_ip6nd_ra_prefix ");
906 
907  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
908 
909  s = format (s, "%U/%d ", format_ip6_address, mp->address,
910  mp->address_length);
911 
912  s = format (s, "val_life %d ", ntohl (mp->val_lifetime));
913 
914  s = format (s, "pref_life %d ", ntohl (mp->pref_lifetime));
915 
916  if (mp->use_default)
917  s = format (s, "def ");
918 
919  if (mp->no_advertise)
920  s = format (s, "noadv ");
921 
922  if (mp->off_link)
923  s = format (s, "offl ");
924 
925  if (mp->no_autoconfig)
926  s = format (s, "noauto ");
927 
928  if (mp->no_onlink)
929  s = format (s, "nolink ");
930 
931  if (mp->is_no)
932  s = format (s, "isno ");
933 
934  FINISH;
935 }
936 
939 {
940  u8 *s;
941 
942  s = format (0, "SCRIPT: sw_interface_ip6nd_ra_config ");
943 
944  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
945 
946  s = format (s, "maxint %d ", ntohl (mp->max_interval));
947 
948  s = format (s, "minint %d ", ntohl (mp->min_interval));
949 
950  s = format (s, "life %d ", ntohl (mp->lifetime));
951 
952  s = format (s, "count %d ", ntohl (mp->initial_count));
953 
954  s = format (s, "interval %d ", ntohl (mp->initial_interval));
955 
956  if (mp->suppress)
957  s = format (s, "suppress ");
958 
959  if (mp->managed)
960  s = format (s, "managed ");
961 
962  if (mp->other)
963  s = format (s, "other ");
964 
965  if (mp->ll_option)
966  s = format (s, "ll ");
967 
968  if (mp->send_unicast)
969  s = format (s, "send ");
970 
971  if (mp->cease)
972  s = format (s, "cease ");
973 
974  if (mp->is_no)
975  s = format (s, "isno ");
976 
977  if (mp->default_router)
978  s = format (s, "def ");
979 
980  FINISH;
981 }
982 
984  (vl_api_set_arp_neighbor_limit_t * mp, void *handle)
985 {
986  u8 *s;
987 
988  s = format (0, "SCRIPT: set_arp_neighbor_limit ");
989 
990  s = format (s, "arp_nbr_limit %d ", ntohl (mp->arp_neighbor_limit));
991 
992  if (mp->is_ipv6 != 0)
993  s = format (s, "ipv6 ");
994 
995  FINISH;
996 }
997 
999  (vl_api_l2_patch_add_del_t * mp, void *handle)
1000 {
1001  u8 *s;
1002 
1003  s = format (0, "SCRIPT: l2_patch_add_del ");
1004 
1005  s = format (s, "rx_sw_if_index %d ", ntohl (mp->rx_sw_if_index));
1006 
1007  s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
1008 
1009  if (mp->is_add == 0)
1010  s = format (s, "del ");
1011 
1012  FINISH;
1013 }
1014 
1016  (vl_api_sr_localsid_add_del_t * mp, void *handle)
1017 {
1018  vnet_main_t *vnm = vnet_get_main ();
1019  u8 *s;
1020 
1021  s = format (0, "SCRIPT: sr_localsid_add_del ");
1022 
1023  switch (mp->behavior)
1024  {
1025  case SR_BEHAVIOR_END:
1026  s = format (s, "Address: %U\nBehavior: End",
1028  s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1029  break;
1030  case SR_BEHAVIOR_X:
1031  s =
1032  format (s,
1033  "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1034  "\nIface: %U\nNext hop: %U", format_ip6_address,
1035  (ip6_address_t *) mp->localsid_addr,
1036  format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1038  s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1039  break;
1040  case SR_BEHAVIOR_DX4:
1041  s =
1042  format (s,
1043  "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1044  "\nIface: %U\nNext hop: %U", format_ip6_address,
1045  (ip6_address_t *) mp->localsid_addr,
1046  format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1048  break;
1049  case SR_BEHAVIOR_DX6:
1050  s =
1051  format (s,
1052  "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1053  "\nIface: %UNext hop: %U", format_ip6_address,
1054  (ip6_address_t *) mp->localsid_addr,
1055  format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1057  break;
1058  case SR_BEHAVIOR_DX2:
1059  s =
1060  format (s,
1061  "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1062  "\nIface: %U", format_ip6_address,
1063  (ip6_address_t *) mp->localsid_addr,
1064  format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index));
1065  break;
1066  case SR_BEHAVIOR_DT6:
1067  s =
1068  format (s,
1069  "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1070  "\nTable: %u", format_ip6_address,
1071  (ip6_address_t *) mp->localsid_addr, ntohl (mp->fib_table));
1072  break;
1073  case SR_BEHAVIOR_DT4:
1074  s =
1075  format (s,
1076  "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1077  "\nTable: %u", format_ip6_address,
1078  (ip6_address_t *) mp->localsid_addr, ntohl (mp->fib_table));
1079  break;
1080  default:
1081  if (mp->behavior >= SR_BEHAVIOR_LAST)
1082  {
1083  s = format (s, "Address: %U\n Behavior: %u",
1085  mp->behavior);
1086  }
1087  else
1088  //Should never get here...
1089  s = format (s, "Internal error");
1090  break;
1091  }
1092  FINISH;
1093 }
1094 
1096  (vl_api_sr_steering_add_del_t * mp, void *handle)
1097 {
1098  u8 *s;
1099 
1100  s = format (0, "SCRIPT: sr_steering_add_del ");
1101 
1102  s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1103 
1104  switch (mp->traffic_type)
1105  {
1106  case SR_STEER_L2:
1107  s = format (s, "Traffic type: L2 iface: %u", ntohl (mp->sw_if_index));
1108  break;
1109  case SR_STEER_IPV4:
1110  s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1111  (ip4_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1112  break;
1113  case SR_STEER_IPV6:
1114  s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1115  (ip6_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1116  break;
1117  default:
1118  s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1119  break;
1120  }
1121  s = format (s, "BindingSID: %U", format_ip6_address,
1122  (ip6_address_t *) mp->bsid_addr);
1123 
1124  s = format (s, "SR Policy Index: %u", ntohl (mp->sr_policy_index));
1125 
1126  s = format (s, "FIB_table: %u", ntohl (mp->table_id));
1127 
1128  FINISH;
1129 }
1130 
1131 static void *vl_api_sr_policy_add_t_print
1132  (vl_api_sr_policy_add_t * mp, void *handle)
1133 {
1134  u8 *s;
1135 
1136  ip6_address_t *segments = 0, *seg;
1137  ip6_address_t *this_address = (ip6_address_t *) mp->segments;
1138 
1139  int i;
1140  for (i = 0; i < mp->n_segments; i++)
1141  {
1142  vec_add2 (segments, seg, 1);
1143  clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1144  this_address++;
1145  }
1146 
1147  s = format (0, "SCRIPT: sr_policy_add ");
1148 
1149  s = format (s, "BSID: %U", format_ip6_address,
1150  (ip6_address_t *) mp->bsid_addr);
1151 
1152  s =
1153  format (s,
1154  (mp->is_encap ? "Behavior: Encapsulation" :
1155  "Behavior: SRH insertion"));
1156 
1157  s = format (s, "FIB_table: %u", ntohl (mp->fib_table));
1158 
1159  s = format (s, (mp->type ? "Type: Default" : "Type: Spray"));
1160 
1161  s = format (s, "SID list weight: %u", ntohl (mp->weight));
1162 
1163  s = format (s, "{");
1164  vec_foreach (seg, segments)
1165  {
1166  s = format (s, "%U, ", format_ip6_address, seg);
1167  }
1168  s = format (s, "\b\b } ");
1169 
1170  FINISH;
1171 }
1172 
1173 static void *vl_api_sr_policy_mod_t_print
1174  (vl_api_sr_policy_mod_t * mp, void *handle)
1175 {
1176  u8 *s;
1177  u32 weight;
1178 
1179  ip6_address_t *segments = 0, *seg;
1180  ip6_address_t *this_address = (ip6_address_t *) mp->segments;
1181 
1182  int i;
1183  for (i = 0; i < mp->n_segments; i++)
1184  {
1185  vec_add2 (segments, seg, 1);
1186  clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1187  this_address++;
1188  }
1189 
1190  s = format (0, "SCRIPT: sr_policy_mod ");
1191 
1192  s = format (s, "BSID: %U", format_ip6_address,
1193  (ip6_address_t *) mp->bsid_addr);
1194 
1195  s = format (s, "SR Policy index: %u", ntohl (mp->sr_policy_index));
1196 
1197  s = format (s, "Operation: %u", mp->operation);
1198 
1199  s = format (s, "SID list index: %u", ntohl (mp->sl_index));
1200 
1201  s = format (s, "SID list weight: %u", ntohl (mp->weight));
1202 
1203  s = format (s, "{");
1204  vec_foreach (seg, segments)
1205  {
1206  s = format (s, "%U, ", format_ip6_address, seg);
1207  }
1208  s = format (s, "\b\b } ");
1209 
1210  FINISH;
1211 }
1212 
1213 static void *vl_api_sr_policy_del_t_print
1214  (vl_api_sr_policy_del_t * mp, void *handle)
1215 {
1216  u8 *s;
1217 
1218  s = format (0, "SCRIPT: sr_policy_del ");
1219  u8 bsid_addr[16];
1220  u32 sr_policy_index;
1221  s = format (s, "To be delivered. Good luck.");
1222  FINISH;
1223 }
1224 
1226  (vl_api_classify_add_del_table_t * mp, void *handle)
1227 {
1228  u8 *s;
1229  int i;
1230 
1231  s = format (0, "SCRIPT: classify_add_del_table ");
1232 
1233  if (mp->is_add == 0)
1234  {
1235  s = format (s, "table %d ", ntohl (mp->table_index));
1236  s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1237  }
1238  else
1239  {
1240  s = format (s, "nbuckets %d ", ntohl (mp->nbuckets));
1241  s = format (s, "memory_size %d ", ntohl (mp->memory_size));
1242  s = format (s, "skip %d ", ntohl (mp->skip_n_vectors));
1243  s = format (s, "match %d ", ntohl (mp->match_n_vectors));
1244  s = format (s, "next-table %d ", ntohl (mp->next_table_index));
1245  s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
1246  s = format (s, "current-data-flag %d ", ntohl (mp->current_data_flag));
1247  if (mp->current_data_flag)
1248  s = format (s, "current-data-offset %d ",
1249  ntohl (mp->current_data_offset));
1250  s = format (s, "mask hex ");
1251  for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
1252  s = format (s, "%02x", mp->mask[i]);
1253  vec_add1 (s, ' ');
1254  }
1255 
1256  FINISH;
1257 }
1258 
1261 {
1262  u8 *s;
1263  int i, limit = 0;
1264 
1265  s = format (0, "SCRIPT: classify_add_del_session ");
1266 
1267  s = format (s, "table_index %d ", ntohl (mp->table_index));
1268  s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
1269  s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
1270  s = format (s, "advance %d ", ntohl (mp->advance));
1271  s = format (s, "action %d ", mp->action);
1272  if (mp->action)
1273  s = format (s, "metadata %d ", ntohl (mp->metadata));
1274  if (mp->is_add == 0)
1275  s = format (s, "del ");
1276 
1277  s = format (s, "match hex ");
1278  for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1279  {
1280  if (mp->match[i] != 0)
1281  {
1282  limit = i + 1;
1283  break;
1284  }
1285  }
1286 
1287  for (i = 0; i < limit; i++)
1288  s = format (s, "%02x", mp->match[i]);
1289 
1290  FINISH;
1291 }
1292 
1295 {
1296  u8 *s;
1297 
1298  s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1299 
1300  if (mp->is_ipv6)
1301  s = format (s, "ipv6 ");
1302 
1303  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1304  s = format (s, "table %d ", ntohl (mp->table_index));
1305 
1306  FINISH;
1307 }
1308 
1311 {
1312  u8 *s;
1313 
1314  s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1315 
1316  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1317  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1318  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1319  s = format (s, "other-table %d ", ntohl (mp->other_table_index));
1320  s = format (s, "is-input %d ", mp->is_input);
1321 
1322  FINISH;
1323 }
1324 
1325 static void *vl_api_add_node_next_t_print
1326  (vl_api_add_node_next_t * mp, void *handle)
1327 {
1328  u8 *s;
1329 
1330  s = format (0, "SCRIPT: add_node_next ");
1331 
1332  s = format (0, "node %s next %s ", mp->node_name, mp->next_name);
1333 
1334  FINISH;
1335 }
1336 
1338  (vl_api_l2tpv3_create_tunnel_t * mp, void *handle)
1339 {
1340  u8 *s;
1341 
1342  s = format (0, "SCRIPT: l2tpv3_create_tunnel ");
1343 
1344  s = format (s, "client_address %U our_address %U ",
1347  s = format (s, "local_session_id %d ", ntohl (mp->local_session_id));
1348  s = format (s, "remote_session_id %d ", ntohl (mp->remote_session_id));
1349  s = format (s, "local_cookie %lld ",
1350  clib_net_to_host_u64 (mp->local_cookie));
1351  s = format (s, "remote_cookie %lld ",
1352  clib_net_to_host_u64 (mp->remote_cookie));
1353  if (mp->l2_sublayer_present)
1354  s = format (s, "l2-sublayer-present ");
1355 
1356  FINISH;
1357 }
1358 
1361 {
1362  u8 *s;
1363 
1364  s = format (0, "SCRIPT: l2tpv3_set_tunnel_cookies ");
1365 
1366  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1367 
1368  s = format (s, "new_local_cookie %llu ",
1369  clib_net_to_host_u64 (mp->new_local_cookie));
1370 
1371  s = format (s, "new_remote_cookie %llu ",
1372  clib_net_to_host_u64 (mp->new_remote_cookie));
1373 
1374  FINISH;
1375 }
1376 
1379 {
1380  u8 *s;
1381 
1382  s = format (0, "SCRIPT: l2tpv3_interface_enable_disable ");
1383 
1384  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1385 
1386  if (mp->enable_disable == 0)
1387  s = format (s, "del ");
1388 
1389  FINISH;
1390 }
1391 
1393  (vl_api_l2tpv3_set_lookup_key_t * mp, void *handle)
1394 {
1395  u8 *s;
1396  char *str = "unknown";
1397 
1398  s = format (0, "SCRIPT: l2tpv3_set_lookup_key ");
1399 
1400  switch (mp->key)
1401  {
1403  str = "lookup_v6_src";
1404  break;
1406  str = "lookup_v6_dst";
1407  break;
1408  case L2T_LOOKUP_SESSION_ID:
1409  str = "lookup_session_id";
1410  break;
1411  default:
1412  break;
1413  }
1414 
1415  s = format (s, "%s ", str);
1416 
1417  FINISH;
1418 }
1419 
1422 {
1423  u8 *s;
1424 
1425  s = format (0, "SCRIPT: sw_if_l2tpv3_tunnel_dump ");
1426 
1427  FINISH;
1428 }
1429 
1431  (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1432 {
1433  u8 *s;
1434  s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1435 
1436  ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
1437  ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
1438 
1439  u8 is_grp = ip46_address_is_multicast (&dst);
1440  char *dst_name = is_grp ? "group" : "dst";
1441 
1442  s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1443  s = format (s, "%s %U ", dst_name, format_ip46_address,
1444  &dst, IP46_TYPE_ANY);
1445 
1446  if (is_grp)
1447  s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1448 
1449  if (mp->encap_vrf_id)
1450  s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1451 
1452  s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1453 
1454  s = format (s, "vni %d ", ntohl (mp->vni));
1455 
1456  if (mp->is_add == 0)
1457  s = format (s, "del ");
1458 
1459  FINISH;
1460 }
1461 
1463  (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1464 {
1465  u8 *s;
1466 
1467  s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1468 
1469  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1470 
1471  FINISH;
1472 }
1473 
1475  (vl_api_gre_add_del_tunnel_t * mp, void *handle)
1476 {
1477  u8 *s;
1478 
1479  s = format (0, "SCRIPT: gre_add_del_tunnel ");
1480 
1481  s = format (s, "dst %U ", format_ip46_address,
1482  (ip46_address_t *) & (mp->dst_address),
1484 
1485  s = format (s, "src %U ", format_ip46_address,
1486  (ip46_address_t *) & (mp->src_address),
1487  mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
1488 
1489  if (mp->teb)
1490  s = format (s, "teb ");
1491 
1492  if (mp->outer_fib_id)
1493  s = format (s, "outer-fib-id %d ", ntohl (mp->outer_fib_id));
1494 
1495  if (mp->is_add == 0)
1496  s = format (s, "del ");
1497 
1498  FINISH;
1499 }
1500 
1501 static void *vl_api_gre_tunnel_dump_t_print
1502  (vl_api_gre_tunnel_dump_t * mp, void *handle)
1503 {
1504  u8 *s;
1505 
1506  s = format (0, "SCRIPT: gre_tunnel_dump ");
1507 
1508  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1509 
1510  FINISH;
1511 }
1512 
1514  (vl_api_l2_fib_clear_table_t * mp, void *handle)
1515 {
1516  u8 *s;
1517 
1518  s = format (0, "SCRIPT: l2_fib_clear_table ");
1519 
1520  FINISH;
1521 }
1522 
1525 {
1526  u8 *s;
1527 
1528  s = format (0, "SCRIPT: l2_interface_efp_filter ");
1529 
1530  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1531  if (mp->enable_disable)
1532  s = format (s, "enable ");
1533  else
1534  s = format (s, "disable ");
1535 
1536  FINISH;
1537 }
1538 
1541 {
1542  u8 *s;
1543 
1544  s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
1545 
1546  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1547  s = format (s, "vtr_op %d ", ntohl (mp->vtr_op));
1548  s = format (s, "push_dot1q %d ", ntohl (mp->push_dot1q));
1549  s = format (s, "tag1 %d ", ntohl (mp->tag1));
1550  s = format (s, "tag2 %d ", ntohl (mp->tag2));
1551 
1552  FINISH;
1553 }
1554 
1556  (vl_api_create_vhost_user_if_t * mp, void *handle)
1557 {
1558  u8 *s;
1559 
1560  s = format (0, "SCRIPT: create_vhost_user_if ");
1561 
1562  s = format (s, "socket %s ", mp->sock_filename);
1563  if (mp->is_server)
1564  s = format (s, "server ");
1565  if (mp->renumber)
1566  s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
1567  if (mp->tag[0])
1568  s = format (s, "tag %s", mp->tag);
1569 
1570  FINISH;
1571 }
1572 
1574  (vl_api_modify_vhost_user_if_t * mp, void *handle)
1575 {
1576  u8 *s;
1577 
1578  s = format (0, "SCRIPT: modify_vhost_user_if ");
1579 
1580  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1581  s = format (s, "socket %s ", mp->sock_filename);
1582  if (mp->is_server)
1583  s = format (s, "server ");
1584  if (mp->renumber)
1585  s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
1586 
1587  FINISH;
1588 }
1589 
1591  (vl_api_delete_vhost_user_if_t * mp, void *handle)
1592 {
1593  u8 *s;
1594 
1595  s = format (0, "SCRIPT: delete_vhost_user_if ");
1596  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1597 
1598  FINISH;
1599 }
1600 
1603 {
1604  u8 *s;
1605 
1606  s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
1607 
1608  FINISH;
1609 }
1610 
1612  (vl_api_sw_interface_dump_t * mp, void *handle)
1613 {
1614  u8 *s;
1615 
1616  s = format (0, "SCRIPT: sw_interface_dump ");
1617 
1618  if (mp->name_filter_valid)
1619  s = format (s, "name_filter %s ", mp->name_filter);
1620  else
1621  s = format (s, "all ");
1622 
1623  FINISH;
1624 }
1625 
1627  (vl_api_l2_fib_table_dump_t * mp, void *handle)
1628 {
1629  u8 *s;
1630 
1631  s = format (0, "SCRIPT: l2_fib_table_dump ");
1632 
1633  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
1634 
1635  FINISH;
1636 }
1637 
1638 static void *vl_api_control_ping_t_print
1639  (vl_api_control_ping_t * mp, void *handle)
1640 {
1641  u8 *s;
1642 
1643  s = format (0, "SCRIPT: control_ping ");
1644 
1645  FINISH;
1646 }
1647 
1649  (vl_api_want_interface_events_t * mp, void *handle)
1650 {
1651  u8 *s;
1652 
1653  s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
1654  ntohl (mp->pid), ntohl (mp->enable_disable));
1655 
1656  FINISH;
1657 }
1658 
1659 static void *
1660 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
1661 {
1662  u8 *s;
1663 
1664  s = format (0, "SCRIPT: cli ");
1665 
1666  FINISH;
1667 }
1668 
1669 static void *vl_api_cli_inband_t_print
1670  (vl_api_cli_inband_t * mp, void *handle)
1671 {
1672  u8 *s;
1673 
1674  s = format (0, "SCRIPT: cli_inband ");
1675 
1676  FINISH;
1677 }
1678 
1679 static void *vl_api_memclnt_create_t_print
1680  (vl_api_memclnt_create_t * mp, void *handle)
1681 {
1682  u8 *s;
1683 
1684  s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
1685 
1686  FINISH;
1687 }
1688 
1689 static void *vl_api_show_version_t_print
1690  (vl_api_show_version_t * mp, void *handle)
1691 {
1692  u8 *s;
1693 
1694  s = format (0, "SCRIPT: show_version ");
1695 
1696  FINISH;
1697 }
1698 
1701 {
1702  u8 *s;
1703 
1704  s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
1705 
1706  ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local);
1707  ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote);
1708 
1709  u8 is_grp = ip46_address_is_multicast (&remote);
1710  char *remote_name = is_grp ? "group" : "remote";
1711 
1712  s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1713  s = format (s, "%s %U ", remote_name, format_ip46_address,
1714  &remote, IP46_TYPE_ANY);
1715 
1716  if (is_grp)
1717  s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1718  s = format (s, "protocol %d ", ntohl (mp->protocol));
1719 
1720  s = format (s, "vni %d ", ntohl (mp->vni));
1721 
1722  if (mp->is_add == 0)
1723  s = format (s, "del ");
1724 
1725  if (mp->encap_vrf_id)
1726  s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1727 
1728  if (mp->decap_vrf_id)
1729  s = format (s, "decap-vrf-id %d ", ntohl (mp->decap_vrf_id));
1730 
1731  FINISH;
1732 }
1733 
1735  (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
1736 {
1737  u8 *s;
1738 
1739  s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
1740 
1741  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1742 
1743  FINISH;
1744 }
1745 
1748 {
1749  u8 *s;
1750 
1751  s = format (0, "SCRIPT: interface_renumber ");
1752 
1753  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1754 
1755  s = format (s, "new_show_dev_instance %d ",
1756  ntohl (mp->new_show_dev_instance));
1757 
1758  FINISH;
1759 }
1760 
1762  (vl_api_want_ip4_arp_events_t * mp, void *handle)
1763 {
1764  u8 *s;
1765 
1766  s = format (0, "SCRIPT: want_ip4_arp_events ");
1767  s = format (s, "pid %d address %U ", ntohl (mp->pid),
1768  format_ip4_address, &mp->address);
1769  if (mp->enable_disable == 0)
1770  s = format (s, "del ");
1771 
1772  FINISH;
1773 }
1774 
1776  (vl_api_want_ip6_nd_events_t * mp, void *handle)
1777 {
1778  u8 *s;
1779 
1780  s = format (0, "SCRIPT: want_ip6_nd_events ");
1781  s = format (s, "pid %d address %U ", ntohl (mp->pid),
1783  if (mp->enable_disable == 0)
1784  s = format (s, "del ");
1785 
1786  FINISH;
1787 }
1788 
1791 {
1792  u8 *s;
1793 
1794  s = format (0, "SCRIPT: input_acl_set_interface ");
1795 
1796  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1797  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1798  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1799  s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
1800 
1801  if (mp->is_add == 0)
1802  s = format (s, "del ");
1803 
1804  FINISH;
1805 }
1806 
1807 static void *vl_api_ip_address_dump_t_print
1808  (vl_api_ip_address_dump_t * mp, void *handle)
1809 {
1810  u8 *s;
1811 
1812  s = format (0, "SCRIPT: ip6_address_dump ");
1813  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1814  s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1815 
1816  FINISH;
1817 }
1818 
1819 static void *
1821 {
1822  u8 *s;
1823 
1824  s = format (0, "SCRIPT: ip_dump ");
1825  s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1826 
1827  FINISH;
1828 }
1829 
1832 {
1833  u8 *s;
1834 
1835  s = format (0, "SCRIPT: cop_interface_enable_disable ");
1836  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1837  if (mp->enable_disable)
1838  s = format (s, "enable ");
1839  else
1840  s = format (s, "disable ");
1841 
1842  FINISH;
1843 }
1844 
1847 {
1848  u8 *s;
1849 
1850  s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
1851  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1852  s = format (s, "fib-id %d ", ntohl (mp->fib_id));
1853  if (mp->ip4)
1854  s = format (s, "ip4 ");
1855  if (mp->ip6)
1856  s = format (s, "ip6 ");
1857  if (mp->default_cop)
1858  s = format (s, "default ");
1859 
1860  FINISH;
1861 }
1862 
1864  (vl_api_af_packet_create_t * mp, void *handle)
1865 {
1866  u8 *s;
1867 
1868  s = format (0, "SCRIPT: af_packet_create ");
1869  s = format (s, "host_if_name %s ", mp->host_if_name);
1870  if (mp->use_random_hw_addr)
1871  s = format (s, "hw_addr random ");
1872  else
1873  s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
1874 
1875  FINISH;
1876 }
1877 
1879  (vl_api_af_packet_delete_t * mp, void *handle)
1880 {
1881  u8 *s;
1882 
1883  s = format (0, "SCRIPT: af_packet_delete ");
1884  s = format (s, "host_if_name %s ", mp->host_if_name);
1885 
1886  FINISH;
1887 }
1888 
1889 static u8 *
1890 format_policer_action (u8 * s, va_list * va)
1891 {
1892  u32 action = va_arg (*va, u32);
1893  u32 dscp = va_arg (*va, u32);
1894  char *t = 0;
1895 
1896  if (action == SSE2_QOS_ACTION_DROP)
1897  s = format (s, "drop");
1898  else if (action == SSE2_QOS_ACTION_TRANSMIT)
1899  s = format (s, "transmit");
1900  else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
1901  {
1902  s = format (s, "mark-and-transmit ");
1903  switch (dscp)
1904  {
1905 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
1907 #undef _
1908  default:
1909  break;
1910  }
1911  s = format (s, "%s", t);
1912  }
1913 
1914  return s;
1915 }
1916 
1917 static void *vl_api_policer_add_del_t_print
1918  (vl_api_policer_add_del_t * mp, void *handle)
1919 {
1920  u8 *s;
1921 
1922  s = format (0, "SCRIPT: policer_add_del ");
1923  s = format (s, "name %s ", mp->name);
1924  s = format (s, "cir %d ", mp->cir);
1925  s = format (s, "eir %d ", mp->eir);
1926  s = format (s, "cb %d ", mp->cb);
1927  s = format (s, "eb %d ", mp->eb);
1928 
1929  switch (mp->rate_type)
1930  {
1931  case SSE2_QOS_RATE_KBPS:
1932  s = format (s, "rate_type kbps ");
1933  break;
1934  case SSE2_QOS_RATE_PPS:
1935  s = format (s, "rate_type pps ");
1936  break;
1937  default:
1938  break;
1939  }
1940 
1941  switch (mp->round_type)
1942  {
1944  s = format (s, "round_type closest ");
1945  break;
1946  case SSE2_QOS_ROUND_TO_UP:
1947  s = format (s, "round_type up ");
1948  break;
1950  s = format (s, "round_type down ");
1951  break;
1952  default:
1953  break;
1954  }
1955 
1956  switch (mp->type)
1957  {
1959  s = format (s, "type 1r2c ");
1960  break;
1962  s = format (s, "type 1r3c ");
1963  break;
1965  s = format (s, "type 2r3c-2698 ");
1966  break;
1968  s = format (s, "type 2r3c-4115 ");
1969  break;
1971  s = format (s, "type 2r3c-mef5cf1 ");
1972  break;
1973  default:
1974  break;
1975  }
1976 
1977  s = format (s, "conform_action %U ", format_policer_action,
1979  s = format (s, "exceed_action %U ", format_policer_action,
1980  mp->exceed_action_type, mp->exceed_dscp);
1981  s = format (s, "violate_action %U ", format_policer_action,
1983 
1984  if (mp->color_aware)
1985  s = format (s, "color-aware ");
1986  if (mp->is_add == 0)
1987  s = format (s, "del ");
1988 
1989  FINISH;
1990 }
1991 
1992 static void *vl_api_policer_dump_t_print
1993  (vl_api_policer_dump_t * mp, void *handle)
1994 {
1995  u8 *s;
1996 
1997  s = format (0, "SCRIPT: policer_dump ");
1998  if (mp->match_name_valid)
1999  s = format (s, "name %s ", mp->match_name);
2000 
2001  FINISH;
2002 }
2003 
2006 {
2007  u8 *s;
2008 
2009  s = format (0, "SCRIPT: policer_classify_set_interface ");
2010  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2011  if (mp->ip4_table_index != ~0)
2012  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2013  if (mp->ip6_table_index != ~0)
2014  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2015  if (mp->l2_table_index != ~0)
2016  s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2017  if (mp->is_add == 0)
2018  s = format (s, "del ");
2019 
2020  FINISH;
2021 }
2022 
2024  (vl_api_policer_classify_dump_t * mp, void *handle)
2025 {
2026  u8 *s;
2027 
2028  s = format (0, "SCRIPT: policer_classify_dump ");
2029  switch (mp->type)
2030  {
2032  s = format (s, "type ip4 ");
2033  break;
2035  s = format (s, "type ip6 ");
2036  break;
2038  s = format (s, "type l2 ");
2039  break;
2040  default:
2041  break;
2042  }
2043 
2044  FINISH;
2045 }
2046 
2049 {
2050  u8 *s;
2051 
2052  s = format (0, "SCRIPT: sw_interface_clear_stats ");
2053  if (mp->sw_if_index != ~0)
2054  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2055 
2056  FINISH;
2057 }
2058 
2060  (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2061 {
2062  u8 *s;
2063 
2064  s = format (0, "SCRIPT: mpls_tunnel_dump ");
2065 
2066  s = format (s, "tunnel_index %d ", ntohl (mp->tunnel_index));
2067 
2068  FINISH;
2069 }
2070 
2071 static void *vl_api_mpls_fib_dump_t_print
2072  (vl_api_mpls_fib_dump_t * mp, void *handle)
2073 {
2074  u8 *s;
2075 
2076  s = format (0, "SCRIPT: mpls_fib_decap_dump ");
2077 
2078  FINISH;
2079 }
2080 
2081 static void *vl_api_ip_fib_dump_t_print
2082  (vl_api_ip_fib_dump_t * mp, void *handle)
2083 {
2084  u8 *s;
2085 
2086  s = format (0, "SCRIPT: ip_fib_dump ");
2087 
2088  FINISH;
2089 }
2090 
2091 static void *vl_api_ip6_fib_dump_t_print
2092  (vl_api_ip6_fib_dump_t * mp, void *handle)
2093 {
2094  u8 *s;
2095 
2096  s = format (0, "SCRIPT: ip6_fib_dump ");
2097 
2098  FINISH;
2099 }
2100 
2102  (vl_api_classify_table_ids_t * mp, void *handle)
2103 {
2104  u8 *s;
2105 
2106  s = format (0, "SCRIPT: classify_table_ids ");
2107 
2108  FINISH;
2109 }
2110 
2113 {
2114  u8 *s;
2115 
2116  s = format (0, "SCRIPT: classify_table_by_interface ");
2117  if (mp->sw_if_index != ~0)
2118  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2119 
2120  FINISH;
2121 }
2122 
2124  (vl_api_classify_table_info_t * mp, void *handle)
2125 {
2126  u8 *s;
2127 
2128  s = format (0, "SCRIPT: classify_table_info ");
2129  if (mp->table_id != ~0)
2130  s = format (s, "table_id %d ", ntohl (mp->table_id));
2131 
2132  FINISH;
2133 }
2134 
2136  (vl_api_classify_session_dump_t * mp, void *handle)
2137 {
2138  u8 *s;
2139 
2140  s = format (0, "SCRIPT: classify_session_dump ");
2141  if (mp->table_id != ~0)
2142  s = format (s, "table_id %d ", ntohl (mp->table_id));
2143 
2144  FINISH;
2145 }
2146 
2148  (vl_api_set_ipfix_exporter_t * mp, void *handle)
2149 {
2150  u8 *s;
2151 
2152  s = format (0, "SCRIPT: set_ipfix_exporter ");
2153 
2154  s = format (s, "collector-address %U ", format_ip4_address,
2156  s = format (s, "collector-port %d ", ntohs (mp->collector_port));
2157  s = format (s, "src-address %U ", format_ip4_address,
2158  (ip4_address_t *) mp->src_address);
2159  s = format (s, "vrf-id %d ", ntohl (mp->vrf_id));
2160  s = format (s, "path-mtu %d ", ntohl (mp->path_mtu));
2161  s = format (s, "template-interval %d ", ntohl (mp->template_interval));
2162  s = format (s, "udp-checksum %d ", mp->udp_checksum);
2163 
2164  FINISH;
2165 }
2166 
2168  (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2169 {
2170  u8 *s;
2171 
2172  s = format (0, "SCRIPT: ipfix_exporter_dump ");
2173 
2174  FINISH;
2175 }
2176 
2179 {
2180  u8 *s;
2181 
2182  s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2183 
2184  s = format (s, "domain-id %d ", ntohl (mp->domain_id));
2185  s = format (s, "src-port %d ", ntohs (mp->src_port));
2186 
2187  FINISH;
2188 }
2189 
2192 {
2193  u8 *s;
2194 
2195  s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2196 
2197  FINISH;
2198 }
2199 
2202 {
2203  u8 *s;
2204 
2205  s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2206 
2207  s = format (s, "table-id %d ", ntohl (mp->table_id));
2208  s = format (s, "ip-version %d ", mp->ip_version);
2209  s = format (s, "transport-protocol %d ", mp->transport_protocol);
2210 
2211  FINISH;
2212 }
2213 
2216 {
2217  u8 *s;
2218 
2219  s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2220 
2221  FINISH;
2222 }
2223 
2226 {
2227  u8 *s;
2228 
2229  s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2230  s = format (s, "src_sw_if_index %u ", ntohl (mp->sw_if_index_from));
2231  s = format (s, "dst_sw_if_index %u ", ntohl (mp->sw_if_index_to));
2232 
2233  switch (mp->state)
2234  {
2235  case 0:
2236  s = format (s, "disable ");
2237  break;
2238  case 1:
2239  s = format (s, "rx ");
2240  break;
2241  case 2:
2242  s = format (s, "tx ");
2243  break;
2244  case 3:
2245  default:
2246  s = format (s, "both ");
2247  break;
2248  }
2249 
2250  FINISH;
2251 }
2252 
2253 static void *
2255  void *handle)
2256 {
2257  u8 *s;
2258 
2259  s = format (0, "SCRIPT: sw_interface_span_dump ");
2260 
2261  FINISH;
2262 }
2263 
2264 static void *vl_api_get_next_index_t_print
2265  (vl_api_get_next_index_t * mp, void *handle)
2266 {
2267  u8 *s;
2268 
2269  s = format (0, "SCRIPT: get_next_index ");
2270  s = format (s, "node-name %s ", mp->node_name);
2271  s = format (s, "next-node-name %s ", mp->next_name);
2272 
2273  FINISH;
2274 }
2275 
2277  (vl_api_pg_create_interface_t * mp, void *handle)
2278 {
2279  u8 *s;
2280 
2281  s = format (0, "SCRIPT: pg_create_interface ");
2282  s = format (0, "if_id %d", ntohl (mp->interface_id));
2283 
2284  FINISH;
2285 }
2286 
2287 static void *vl_api_pg_capture_t_print
2288  (vl_api_pg_capture_t * mp, void *handle)
2289 {
2290  u8 *s;
2291 
2292  s = format (0, "SCRIPT: pg_capture ");
2293  s = format (0, "if_id %d ", ntohl (mp->interface_id));
2294  s = format (0, "pcap %s", mp->pcap_file_name);
2295  if (mp->count != ~0)
2296  s = format (s, "count %d ", ntohl (mp->count));
2297  if (!mp->is_enabled)
2298  s = format (s, "disable");
2299 
2300  FINISH;
2301 }
2302 
2304  (vl_api_pg_enable_disable_t * mp, void *handle)
2305 {
2306  u8 *s;
2307 
2308  s = format (0, "SCRIPT: pg_enable_disable ");
2309  if (ntohl (mp->stream_name_length) > 0)
2310  s = format (s, "stream %s", mp->stream_name);
2311  if (!mp->is_enabled)
2312  s = format (s, "disable");
2313 
2314  FINISH;
2315 }
2316 
2319 {
2320  u8 *s;
2321  int i;
2322 
2323  s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2324  if (mp->is_ipv6)
2325  s = format (s, "%U/%d ", format_ip6_address, mp->address,
2326  mp->mask_length);
2327  else
2328  s = format (s, "%U/%d ", format_ip4_address, mp->address,
2329  mp->mask_length);
2330 
2331  for (i = 0; i < mp->number_of_ranges; i++)
2332  {
2333  s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2334  }
2335 
2336  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
2337 
2338  if (mp->is_add == 0)
2339  s = format (s, "del ");
2340 
2341  FINISH;
2342 }
2343 
2346  void *handle)
2347 {
2348  u8 *s;
2349 
2350  s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2351 
2352  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2353 
2354  if (mp->tcp_out_vrf_id != ~0)
2355  s = format (s, "tcp-out-vrf %d ", ntohl (mp->tcp_out_vrf_id));
2356 
2357  if (mp->udp_out_vrf_id != ~0)
2358  s = format (s, "udp-out-vrf %d ", ntohl (mp->udp_out_vrf_id));
2359 
2360  if (mp->tcp_in_vrf_id != ~0)
2361  s = format (s, "tcp-in-vrf %d ", ntohl (mp->tcp_in_vrf_id));
2362 
2363  if (mp->udp_in_vrf_id != ~0)
2364  s = format (s, "udp-in-vrf %d ", ntohl (mp->udp_in_vrf_id));
2365 
2366  if (mp->is_add == 0)
2367  s = format (s, "del ");
2368 
2369  FINISH;
2370 }
2371 
2373  (vl_api_lisp_enable_disable_t * mp, void *handle)
2374 {
2375  u8 *s;
2376 
2377  s = format (0, "SCRIPT: lisp_enable_disable %s",
2378  mp->is_en ? "enable" : "disable");
2379 
2380  FINISH;
2381 }
2382 
2384  (vl_api_gpe_add_del_iface_t * mp, void *handle)
2385 {
2386  u8 *s;
2387 
2388  s = format (0, "SCRIPT: gpe_add_del_iface ");
2389 
2390  s = format (s, "%s ", mp->is_add ? "up" : "down");
2391  s = format (s, "vni %d ", mp->vni);
2392  s = format (s, "%s %d ", mp->is_l2 ? "bd_id" : "table_id", mp->dp_table);
2393 
2394  FINISH;
2395 }
2396 
2399 {
2400  u8 *s;
2401 
2402  s = format (0, "SCRIPT: lisp_pitr_set_locator_set ");
2403 
2404  if (mp->is_add)
2405  s = format (s, "locator-set %s ", mp->ls_name);
2406  else
2407  s = format (s, "del");
2408 
2409  FINISH;
2410 }
2411 
2412 static u8 *
2413 format_lisp_flat_eid (u8 * s, va_list * args)
2414 {
2415  u32 type = va_arg (*args, u32);
2416  u8 *eid = va_arg (*args, u8 *);
2417  u32 eid_len = va_arg (*args, u32);
2418 
2419  switch (type)
2420  {
2421  case 0:
2422  return format (s, "%U/%d", format_ip4_address, eid, eid_len);
2423  case 1:
2424  return format (s, "%U/%d", format_ip6_address, eid, eid_len);
2425  case 3:
2426  return format (s, "%U", format_ethernet_address, eid);
2427  }
2428  return 0;
2429 }
2430 
2433 {
2434  u8 *s;
2435  u32 i, rloc_num = 0;
2436 
2437  s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
2438 
2439  if (mp->del_all)
2440  s = format (s, "del-all ");
2441 
2442  s = format (s, "%s ", mp->is_add ? "add" : "del");
2443  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2444 
2445  s = format (s, "eid %U ", format_lisp_flat_eid,
2446  mp->eid_type, mp->eid, mp->eid_len);
2447 
2448  if (mp->is_src_dst)
2449  {
2450  s = format (s, "seid %U ", format_lisp_flat_eid,
2451  mp->eid_type, mp->seid, mp->seid_len);
2452  }
2453 
2454  rloc_num = clib_net_to_host_u32 (mp->rloc_num);
2455 
2456  if (0 == rloc_num)
2457  s = format (s, "action %d", mp->action);
2458 
2459  FINISH;
2460 }
2461 
2463  (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
2464 {
2465  u8 *s;
2466 
2467  s = format (0, "SCRIPT: lisp_add_del_adjacency ");
2468 
2469  s = format (s, "%s ", mp->is_add ? "add" : "del");
2470  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2471  s = format (s, "reid %U leid %U ",
2472  format_lisp_flat_eid, mp->eid_type, mp->reid, mp->reid_len,
2473  format_lisp_flat_eid, mp->eid_type, mp->leid, mp->leid_len);
2474 
2475  FINISH;
2476 }
2477 
2480 {
2481  u8 *s;
2482 
2483  s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
2484 
2485  if (mp->is_add)
2486  s = format (s, "%s", mp->locator_set_name);
2487  else
2488  s = format (s, "del");
2489 
2490  FINISH;
2491 }
2492 
2495 {
2496  u8 *s;
2497 
2498  s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
2499 
2500  if (!mp->is_add)
2501  s = format (s, "del ");
2502 
2503  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2504  s = format (s, "%s %d ",
2505  mp->is_l2 ? "bd_index" : "vrf",
2506  clib_net_to_host_u32 (mp->dp_table));
2507  FINISH;
2508 }
2509 
2511  (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
2512 {
2513  u8 *s;
2514 
2515  s = format (0, "SCRIPT: lisp_add_del_local_eid ");
2516 
2517  if (!mp->is_add)
2518  s = format (s, "del ");
2519 
2520  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2521  s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
2522  mp->prefix_len);
2523  s = format (s, "locator-set %s ", mp->locator_set_name);
2524  if (*mp->key)
2525  {
2526  u32 key_id = mp->key_id;
2527  s = format (s, "key-id %U", format_hmac_key_id, key_id);
2528  s = format (s, "secret-key %s", mp->key);
2529  }
2530  FINISH;
2531 }
2532 
2534  (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle)
2535 {
2536  u8 *s;
2537 
2538  s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO");
2539 
2540  FINISH;
2541 }
2542 
2545 {
2546  u8 *s;
2547 
2548  s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
2549 
2550  if (!mp->is_add)
2551  s = format (s, "del ");
2552 
2553  if (mp->is_ipv6)
2554  s = format (s, "%U ", format_ip6_address, mp->ip_address);
2555  else
2556  s = format (s, "%U ", format_ip4_address, mp->ip_address);
2557 
2558  FINISH;
2559 }
2560 
2562  (vl_api_gpe_enable_disable_t * mp, void *handle)
2563 {
2564  u8 *s;
2565 
2566  s = format (0, "SCRIPT: gpe_enable_disable ");
2567 
2568  s = format (s, "%s ", mp->is_en ? "enable" : "disable");
2569 
2570  FINISH;
2571 }
2572 
2575 {
2576  u8 *s;
2577  u32 loc_num = 0, i;
2578 
2579  s = format (0, "SCRIPT: lisp_add_del_locator_set ");
2580 
2581  if (!mp->is_add)
2582  s = format (s, "del ");
2583 
2584  s = format (s, "locator-set %s ", mp->locator_set_name);
2585 
2586  loc_num = clib_net_to_host_u32 (mp->locator_num);
2587 
2588  FINISH;
2589 }
2590 
2592  (vl_api_lisp_add_del_locator_t * mp, void *handle)
2593 {
2594  u8 *s;
2595 
2596  s = format (0, "SCRIPT: lisp_add_del_locator ");
2597 
2598  if (!mp->is_add)
2599  s = format (s, "del ");
2600 
2601  s = format (s, "locator-set %s ", mp->locator_set_name);
2602  s = format (s, "sw_if_index %d ", mp->sw_if_index);
2603  s = format (s, "p %d w %d ", mp->priority, mp->weight);
2604 
2605  FINISH;
2606 }
2607 
2609  (vl_api_lisp_locator_set_dump_t * mp, void *handle)
2610 {
2611  u8 *s;
2612 
2613  s = format (0, "SCRIPT: lisp_locator_set_dump ");
2614  if (mp->filter == 1)
2615  s = format (s, "local");
2616  else if (mp->filter == 2)
2617  s = format (s, "remote");
2618 
2619  FINISH;
2620 }
2621 
2623  (vl_api_lisp_locator_dump_t * mp, void *handle)
2624 {
2625  u8 *s;
2626 
2627  s = format (0, "SCRIPT: lisp_locator_dump ");
2628  if (mp->is_index_set)
2629  s = format (s, "ls_index %d", clib_net_to_host_u32 (mp->ls_index));
2630  else
2631  s = format (s, "ls_name %s", mp->ls_name);
2632 
2633  FINISH;
2634 }
2635 
2637  (vl_api_lisp_map_request_mode_t * mp, void *handle)
2638 {
2639  u8 *s;
2640 
2641  s = format (0, "SCRIPT: lisp_map_request_mode ");
2642 
2643  switch (mp->mode)
2644  {
2645  case 0:
2646  s = format (s, "dst-only");
2647  break;
2648  case 1:
2649  s = format (s, "src-dst");
2650  default:
2651  break;
2652  }
2653 
2654  FINISH;
2655 }
2656 
2658  (vl_api_lisp_eid_table_dump_t * mp, void *handle)
2659 {
2660  u8 *s;
2661 
2662  s = format (0, "SCRIPT: lisp_eid_table_dump ");
2663 
2664  if (mp->eid_set)
2665  {
2666  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2667  s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type,
2668  mp->eid, mp->prefix_length);
2669  switch (mp->filter)
2670  {
2671  case 1:
2672  s = format (s, "local ");
2673  break;
2674  case 2:
2675  s = format (s, "remote ");
2676  break;
2677  }
2678  }
2679 
2680  FINISH;
2681 }
2682 
2685 {
2686  u8 *s;
2687 
2688  s = format (0, "SCRIPT: lisp_rloc_probe_enable_disable ");
2689  if (mp->is_enabled)
2690  s = format (s, "enable");
2691  else
2692  s = format (s, "disable");
2693 
2694  FINISH;
2695 }
2696 
2699 {
2700  u8 *s;
2701 
2702  s = format (0, "SCRIPT: lisp_map_register_enable_disable ");
2703  if (mp->is_enabled)
2704  s = format (s, "enable");
2705  else
2706  s = format (s, "disable");
2707 
2708  FINISH;
2709 }
2710 
2712  (vl_api_lisp_adjacencies_get_t * mp, void *handle)
2713 {
2714  u8 *s;
2715 
2716  s = format (0, "SCRIPT: lisp_adjacencies_get ");
2717  s = format (s, "vni %d", clib_net_to_host_u32 (mp->vni));
2718 
2719  FINISH;
2720 }
2721 
2724 {
2725  u8 *s;
2726 
2727  s = format (0, "SCRIPT: lisp_eid_table_map_dump ");
2728 
2729  if (mp->is_l2)
2730  s = format (s, "l2");
2731  else
2732  s = format (s, "l3");
2733 
2734  FINISH;
2735 }
2736 
2739 {
2740  u8 *s;
2741 
2742  s = format (0, "SCRIPT: ipsec_gre_add_del_tunnel ");
2743 
2744  s = format (s, "dst %U ", format_ip4_address,
2745  (ip4_address_t *) & (mp->dst_address));
2746 
2747  s = format (s, "src %U ", format_ip4_address,
2748  (ip4_address_t *) & (mp->src_address));
2749 
2750  s = format (s, "local_sa %d ", ntohl (mp->local_sa_id));
2751 
2752  s = format (s, "remote_sa %d ", ntohl (mp->remote_sa_id));
2753 
2754  if (mp->is_add == 0)
2755  s = format (s, "del ");
2756 
2757  FINISH;
2758 }
2759 
2761  (vl_api_ipsec_gre_tunnel_dump_t * mp, void *handle)
2762 {
2763  u8 *s;
2764 
2765  s = format (0, "SCRIPT: ipsec_gre_tunnel_dump ");
2766 
2767  if (mp->sw_if_index != ~0)
2768  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2769 
2770  FINISH;
2771 }
2772 
2775 {
2776  u8 *s;
2777  u32 vtr_op = ntohl (mp->vtr_op);
2778 
2779  s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
2780 
2781  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2782  s = format (s, "vtr_op %d ", vtr_op);
2783  if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
2784  {
2785  if (vtr_op == L2_VTR_TRANSLATE_2_2)
2786  s = format (s, "%d ", ntohs (mp->outer_tag));
2787  s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
2788  s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
2789  s = format (s, "sid %d ", ntohl (mp->i_sid));
2790  s = format (s, "vlanid %d ", ntohs (mp->b_vlanid));
2791  }
2792 
2793  FINISH;
2794 }
2795 
2798 {
2799  u8 *s;
2800 
2801  s = format (0, "SCRIPT: flow_classify_set_interface ");
2802  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2803  if (mp->ip4_table_index != ~0)
2804  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2805  if (mp->ip6_table_index != ~0)
2806  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2807  if (mp->is_add == 0)
2808  s = format (s, "del ");
2809 
2810  FINISH;
2811 }
2812 
2813 static void *
2815 {
2816  u8 *s;
2817 
2818  s = format (0, "SCRIPT: punt ");
2819 
2820  if (mp->ipv != (u8) ~ 0)
2821  s = format (s, "ip %d ", mp->ipv);
2822 
2823  s = format (s, "protocol %d ", mp->l4_protocol);
2824 
2825  if (mp->l4_port != (u16) ~ 0)
2826  s = format (s, "port %d ", ntohs (mp->l4_port));
2827 
2828  if (!mp->is_add)
2829  s = format (s, "del ");
2830 
2831  FINISH;
2832 }
2833 
2835  (vl_api_flow_classify_dump_t * mp, void *handle)
2836 {
2837  u8 *s;
2838 
2839  s = format (0, "SCRIPT: flow_classify_dump ");
2840  switch (mp->type)
2841  {
2843  s = format (s, "type ip4 ");
2844  break;
2846  s = format (s, "type ip6 ");
2847  break;
2848  default:
2849  break;
2850  }
2851 
2852  FINISH;
2853 }
2854 
2856  (vl_api_get_first_msg_id_t * mp, void *handle)
2857 {
2858  u8 *s;
2859 
2860  s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
2861 
2862  FINISH;
2863 }
2864 
2865 static void *vl_api_ioam_enable_t_print
2866  (vl_api_ioam_enable_t * mp, void *handle)
2867 {
2868  u8 *s;
2869 
2870  s = format (0, "SCRIPT: ioam_enable ");
2871 
2872  if (mp->trace_enable)
2873  s = format (s, "trace enabled");
2874 
2875  if (mp->pot_enable)
2876  s = format (s, "POT enabled");
2877 
2878  if (mp->seqno)
2879  s = format (s, "Seqno enabled");
2880 
2881  if (mp->analyse)
2882  s = format (s, "Analyse enabled");
2883 
2884  FINISH;
2885 }
2886 
2887 static void *vl_api_ioam_disable_t_print
2888  (vl_api_ioam_disable_t * mp, void *handle)
2889 {
2890  u8 *s;
2891 
2892  s = format (0, "SCRIPT: ioam_disable ");
2893  s = format (s, "trace disabled");
2894  s = format (s, "POT disabled");
2895  s = format (s, "Seqno disabled");
2896  s = format (s, "Analyse disabled");
2897 
2898  FINISH;
2899 }
2900 
2902  (vl_api_feature_enable_disable_t * mp, void *handle)
2903 {
2904  u8 *s;
2905 
2906  s = format (0, "SCRIPT: feature_enable_disable ");
2907  s = format (s, "arc_name %s ", mp->arc_name);
2908  s = format (s, "feature_name %s ", mp->feature_name);
2909  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2910  if (!mp->enable)
2911  s = format (s, "disable");
2912 
2913  FINISH;
2914 }
2915 
2918 {
2919  u8 *s;
2920 
2921  s = format (0, "SCRIPT: sw_interface_tag_add_del ");
2922  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2923  if (mp->is_add)
2924  s = format (s, "tag %s ", mp->tag);
2925  else
2926  s = format (s, "del ");
2927 
2928  FINISH;
2929 }
2930 
2932  (vl_api_sw_interface_set_mtu_t * mp, void *handle)
2933 {
2934  u8 *s;
2935 
2936  s = format (0, "SCRIPT: sw_interface_set_mtu ");
2937  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2938  s = format (s, "tag %d ", ntohs (mp->mtu));
2939 
2940  FINISH;
2941 }
2942 
2944  (vl_api_p2p_ethernet_add_t * mp, void *handle)
2945 {
2946  u8 *s;
2947 
2948  s = format (0, "SCRIPT: p2p_ethernet_add ");
2949  s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
2950  s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
2951 
2952  FINISH;
2953 }
2954 
2956  (vl_api_p2p_ethernet_del_t * mp, void *handle)
2957 {
2958  u8 *s;
2959 
2960  s = format (0, "SCRIPT: p2p_ethernet_del ");
2961  s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
2962  s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
2963 
2964  FINISH;
2965 }
2966 
2967 #define foreach_custom_print_no_arg_function \
2968 _(lisp_eid_table_vni_dump) \
2969 _(lisp_map_resolver_dump) \
2970 _(lisp_map_server_dump) \
2971 _(show_lisp_rloc_probe_state) \
2972 _(show_lisp_map_register_state) \
2973 _(show_lisp_map_request_mode)
2974 
2975 #define _(f) \
2976 static void * vl_api_ ## f ## _t_print \
2977  (vl_api_ ## f ## _t * mp, void * handle) \
2978 { \
2979  u8 * s; \
2980  s = format (0, "SCRIPT: " #f ); \
2981  FINISH; \
2982 }
2984 #undef _
2985 #define foreach_custom_print_function \
2986 _(CREATE_LOOPBACK, create_loopback) \
2987 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
2988 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
2989 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
2990 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
2991 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
2992 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
2993 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
2994 _(TAP_CONNECT, tap_connect) \
2995 _(TAP_MODIFY, tap_modify) \
2996 _(TAP_DELETE, tap_delete) \
2997 _(SW_INTERFACE_TAP_DUMP, sw_interface_tap_dump) \
2998 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \
2999 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
3000 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
3001 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3002 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3003 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
3004 _(RESET_VRF, reset_vrf) \
3005 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3006 _(CREATE_SUBIF, create_subif) \
3007 _(OAM_ADD_DEL, oam_add_del) \
3008 _(RESET_FIB, reset_fib) \
3009 _(DHCP_PROXY_CONFIG, dhcp_proxy_config) \
3010 _(DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss) \
3011 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3012 _(SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS, \
3013  sw_interface_ip6_set_link_local_address) \
3014 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \
3015 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \
3016 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
3017 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3018 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3019 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3020 _(SR_POLICY_ADD, sr_policy_add) \
3021 _(SR_POLICY_MOD, sr_policy_mod) \
3022 _(SR_POLICY_DEL, sr_policy_del) \
3023 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3024 _(L2FIB_ADD_DEL, l2fib_add_del) \
3025 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3026 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3027 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3028 _(L2_FLAGS, l2_flags) \
3029 _(BRIDGE_FLAGS, bridge_flags) \
3030 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3031 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3032 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3033 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3034 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3035 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3036 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3037 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3038 _(ADD_NODE_NEXT, add_node_next) \
3039 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \
3040 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \
3041 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \
3042 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \
3043 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
3044 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
3045 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3046 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3047 _(GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel) \
3048 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3049 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3050 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3051 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3052 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3053 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3054 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3055 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3056 _(CONTROL_PING, control_ping) \
3057 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3058 _(CLI, cli) \
3059 _(CLI_INBAND, cli_inband) \
3060 _(MEMCLNT_CREATE, memclnt_create) \
3061 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3062 _(SHOW_VERSION, show_version) \
3063 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3064 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3065 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3066 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3067 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
3068 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \
3069 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3070 _(IP_ADDRESS_DUMP, ip_address_dump) \
3071 _(IP_DUMP, ip_dump) \
3072 _(DELETE_LOOPBACK, delete_loopback) \
3073 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3074 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3075 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3076 _(AF_PACKET_CREATE, af_packet_create) \
3077 _(AF_PACKET_DELETE, af_packet_delete) \
3078 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3079 _(MPLS_FIB_DUMP, mpls_fib_dump) \
3080 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3081 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3082 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3083 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3084 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3085 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3086 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3087 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3088 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3089 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3090 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3091 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3092 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3093 _(GET_NEXT_INDEX, get_next_index) \
3094 _(PG_CREATE_INTERFACE,pg_create_interface) \
3095 _(PG_CAPTURE, pg_capture) \
3096 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3097 _(POLICER_ADD_DEL, policer_add_del) \
3098 _(POLICER_DUMP, policer_dump) \
3099 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3100 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3101 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3102  ip_source_and_port_range_check_add_del) \
3103 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3104  ip_source_and_port_range_check_interface_add_del) \
3105 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
3106 _(GPE_ENABLE_DISABLE, gpe_enable_disable) \
3107 _(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \
3108 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
3109 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \
3110 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \
3111 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
3112 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
3113 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
3114  lisp_add_del_map_request_itr_rlocs) \
3115 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
3116 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
3117 _(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \
3118 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
3119 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
3120 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
3121 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
3122 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
3123 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \
3124 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
3125 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \
3126 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
3127 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \
3128 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \
3129 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \
3130 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \
3131 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \
3132 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \
3133 _(IPSEC_GRE_ADD_DEL_TUNNEL, ipsec_gre_add_del_tunnel) \
3134 _(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \
3135 _(DELETE_SUBIF, delete_subif) \
3136 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3137 _(PUNT, punt) \
3138 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3139 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3140 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3141 _(IOAM_ENABLE, ioam_enable) \
3142 _(IOAM_DISABLE, ioam_disable) \
3143 _(IP_FIB_DUMP, ip_fib_dump) \
3144 _(IP6_FIB_DUMP, ip6_fib_dump) \
3145 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3146 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3147 _(SW_INTERFACE_SET_MTU, sw_interface_set_mtu) \
3148 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3149 _(P2P_ETHERNET_DEL, p2p_ethernet_del)
3150  void
3152 {
3153 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3154  = (void *) vl_api_##f##_t_print;
3156 #undef _
3157 }
3158 
3159 /*
3160  * fd.io coding-style-patch-verification: ON
3161  *
3162  * Local Variables:
3163  * eval: (c-set-style "gnu")
3164  * End:
3165  */
static void * vl_api_sw_interface_set_flags_t_print(vl_api_sw_interface_set_flags_t *mp, void *handle)
Definition: custom_dump.c:99
static void * vl_api_create_vhost_user_if_t_print(vl_api_create_vhost_user_if_t *mp, void *handle)
Definition: custom_dump.c:1556
static u8 * format_lisp_flat_eid(u8 *s, va_list *args)
Definition: custom_dump.c:2413
static void * vl_api_bridge_domain_add_del_t_print(vl_api_bridge_domain_add_del_t *mp, void *handle)
Definition: custom_dump.c:253
static void * vl_api_classify_set_interface_l2_tables_t_print(vl_api_classify_set_interface_l2_tables_t *mp, void *handle)
Definition: custom_dump.c:1310
static void * vl_api_lisp_add_del_adjacency_t_print(vl_api_lisp_add_del_adjacency_t *mp, void *handle)
Definition: custom_dump.c:2463
Get list of policers.
Definition: policer.api:77
DHCP Proxy set / unset vss request.
Definition: dhcp.api:48
Proxy ARP add / del request.
Definition: vpe.api:100
add or delete gpe_iface
Definition: lisp_gpe.api:87
static void * vl_api_sw_interface_set_mpls_enable_t_print(vl_api_sw_interface_set_mpls_enable_t *mp, void *handle)
Definition: custom_dump.c:162
Classify get table IDs request.
Definition: classify.api:159
Reset VRF (remove all routes etc) request.
Definition: vpe.api:131
static void * vl_api_mpls_fib_dump_t_print(vl_api_mpls_fib_dump_t *mp, void *handle)
Definition: custom_dump.c:2072
Add / del ipsec gre tunnel request.
Definition: ipsec_gre.api:25
static void * vl_api_lisp_pitr_set_locator_set_t_print(vl_api_lisp_pitr_set_locator_set_t *mp, void *handle)
Definition: custom_dump.c:2398
L2 FIB add entry request.
Definition: l2.api:123
cop: enable/disable whitelist filtration features on an interface Note: the supplied fib_id must matc...
Definition: cop.api:43
static void * vl_api_l2tpv3_set_tunnel_cookies_t_print(vl_api_l2tpv3_set_tunnel_cookies_t *mp, void *handle)
Definition: custom_dump.c:1360
static void * vl_api_sw_if_l2tpv3_tunnel_dump_t_print(vl_api_sw_if_l2tpv3_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1421
Register for ip6 nd resolution events.
Definition: vpe.api:738
u8 * format_hmac_key_id(u8 *s, va_list *args)
Definition: lisp_types.c:412
static void * vl_api_delete_subif_t_print(vl_api_delete_subif_t *mp, void *handle)
Definition: custom_dump.c:733
sll srl srl sll sra u16x4 i
Definition: vector_sse2.h:337
static void * vl_api_l2_patch_add_del_t_print(vl_api_l2_patch_add_del_t *mp, void *handle)
Definition: custom_dump.c:999
static void * vl_api_lisp_locator_set_dump_t_print(vl_api_lisp_locator_set_dump_t *mp, void *handle)
Definition: custom_dump.c:2609
static void * vl_api_lisp_map_request_mode_t_print(vl_api_lisp_map_request_mode_t *mp, void *handle)
Definition: custom_dump.c:2637
enable/disable LISP RLOC probing
Definition: lisp.api:231
static void * vl_api_delete_loopback_t_print(vl_api_delete_loopback_t *mp, void *handle)
Definition: custom_dump.c:88
static void * vl_api_reset_vrf_t_print(vl_api_reset_vrf_t *mp, void *handle)
Definition: custom_dump.c:667
Reset fib table request.
Definition: vpe.api:298
IPFIX classify tables dump request.
Definition: flow.api:125
#define foreach_create_subif_bit
Definition: custom_dump.c:698
static void * vl_api_sw_interface_ip6_set_link_local_address_t_print(vl_api_sw_interface_ip6_set_link_local_address_t *mp, void *handle)
Definition: custom_dump.c:887
static void * vl_api_reset_fib_t_print(vl_api_reset_fib_t *mp, void *handle)
Definition: custom_dump.c:764
Dump IP fib table.
Definition: ip.api:25
#define SR_BEHAVIOR_END
Definition: sr.h:37
static uword ip46_address_is_multicast(ip46_address_t *a)
Definition: ip6_packet.h:151
static void * vl_api_lisp_add_del_locator_t_print(vl_api_lisp_add_del_locator_t *mp, void *handle)
Definition: custom_dump.c:2592
static void * vl_api_cli_inband_t_print(vl_api_cli_inband_t *mp, void *handle)
Definition: custom_dump.c:1670
vnet_main_t * vnet_get_main(void)
Definition: misc.c:46
static void * vl_api_ioam_enable_t_print(vl_api_ioam_enable_t *mp, void *handle)
Definition: custom_dump.c:2866
static void * vl_api_lisp_adjacencies_get_t_print(vl_api_lisp_adjacencies_get_t *mp, void *handle)
Definition: custom_dump.c:2712
Set/unset policer classify interface.
Definition: classify.api:120
static void * vl_api_sw_interface_tag_add_del_t_print(vl_api_sw_interface_tag_add_del_t *mp, void *handle)
Definition: custom_dump.c:2917
configure or disable LISP PITR node
Definition: lisp.api:155
Set flags on the interface.
Definition: interface.api:9
Control ping from client to api server request.
Definition: vpe.api:374
u8 as_u8[16]
Definition: ip6_packet.h:48
static void * vl_api_flow_classify_set_interface_t_print(vl_api_flow_classify_set_interface_t *mp, void *handle)
Definition: custom_dump.c:2797
static void * vl_api_interface_name_renumber_t_print(vl_api_interface_name_renumber_t *mp, void *handle)
Definition: custom_dump.c:1747
static void * vl_api_add_node_next_t_print(vl_api_add_node_next_t *mp, void *handle)
Definition: custom_dump.c:1326
static void * vl_api_l2_fib_clear_table_t_print(vl_api_l2_fib_clear_table_t *mp, void *handle)
Definition: custom_dump.c:1514
static void * vl_api_sr_steering_add_del_t_print(vl_api_sr_steering_add_del_t *mp, void *handle)
Definition: custom_dump.c:1096
iOAM disable
Definition: vpe.api:834
#define L2_FLOOD
Definition: l2_bd.h:127
Set max allowed ARP or ip6 neighbor entries request.
Definition: vpe.api:438
static void * vl_api_lisp_eid_table_add_del_map_t_print(vl_api_lisp_eid_table_add_del_map_t *mp, void *handle)
Definition: custom_dump.c:2494
Interface set vxlan-bypass request.
Definition: vxlan.api:64
static void * vl_api_tap_modify_t_print(vl_api_tap_modify_t *mp, void *handle)
Definition: custom_dump.c:459
static void * vl_api_input_acl_set_interface_t_print(vl_api_input_acl_set_interface_t *mp, void *handle)
Definition: custom_dump.c:1790
#define L2_FWD
Definition: l2_bd.h:126
VXLAN GPE definitions.
static void * vl_api_control_ping_t_print(vl_api_control_ping_t *mp, void *handle)
Definition: custom_dump.c:1639
static void * vl_api_ip_add_del_route_t_print(vl_api_ip_add_del_route_t *mp, void *handle)
Definition: custom_dump.c:501
u8 tap_name[64]
Definition: tap.api:73
static void * vl_api_mpls_tunnel_add_del_t_print(vl_api_mpls_tunnel_add_del_t *mp, void *handle)
Definition: custom_dump.c:590
static void * vl_api_lisp_add_del_locator_set_t_print(vl_api_lisp_add_del_locator_set_t *mp, void *handle)
Definition: custom_dump.c:2574
Classify add / del session request.
Definition: classify.api:95
IPFIX exporter dump request.
Definition: flow.api:44
u8 bsid_addr[16]
Definition: sr.api:81
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:522
u8 bsid_addr[16]
Definition: sr.api:56
static void * vl_api_bridge_domain_dump_t_print(vl_api_bridge_domain_dump_t *mp, void *handle)
Definition: custom_dump.c:288
static void * vl_api_lisp_eid_table_map_dump_t_print(vl_api_lisp_eid_table_map_dump_t *mp, void *handle)
Definition: custom_dump.c:2723
L2 bridge domain set mac age.
Definition: l2.api:169
static void * vl_api_l2_interface_vlan_tag_rewrite_t_print(vl_api_l2_interface_vlan_tag_rewrite_t *mp, void *handle)
Definition: custom_dump.c:1540
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
Definition: vec.h:561
Dump tap interfaces request.
Definition: tap.api:104
static void * vl_api_flow_classify_dump_t_print(vl_api_flow_classify_dump_t *mp, void *handle)
Definition: custom_dump.c:2835
format_function_t format_ip46_address
Definition: format.h:61
static void * vl_api_want_interface_events_t_print(vl_api_want_interface_events_t *mp, void *handle)
Definition: custom_dump.c:1649
static void * vl_api_sw_interface_clear_stats_t_print(vl_api_sw_interface_clear_stats_t *mp, void *handle)
Definition: custom_dump.c:2048
static void * vl_api_gre_add_del_tunnel_t_print(vl_api_gre_add_del_tunnel_t *mp, void *handle)
Definition: custom_dump.c:1475
Request for lisp_eid_table_map_details.
Definition: lisp.api:609
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
Add/Delete classification table request.
Definition: classify.api:40
IPv6 router advertisement config request.
Definition: ip.api:196
L2 bridge domain request operational state details.
Definition: l2.api:208
Dump MPLS fib table.
Definition: mpls.api:195
static void * vl_api_tap_delete_t_print(vl_api_tap_delete_t *mp, void *handle)
Definition: custom_dump.c:479
Enable / disable packet generator request.
Definition: vpe.api:915
static void * vl_api_ipsec_gre_tunnel_dump_t_print(vl_api_ipsec_gre_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:2761
static void * vl_api_classify_add_del_table_t_print(vl_api_classify_add_del_table_t *mp, void *handle)
Definition: custom_dump.c:1226
static void * vl_api_dhcp_proxy_set_vss_t_print(vl_api_dhcp_proxy_set_vss_t *mp, void *handle)
Definition: custom_dump.c:810
vhost-user interface create request
Definition: vhost_user.api:24
Dump IP6 fib table.
Definition: ip.api:75
static void * vl_api_vxlan_gpe_add_del_tunnel_t_print(vl_api_vxlan_gpe_add_del_tunnel_t *mp, void *handle)
Definition: custom_dump.c:1700
static void * vl_api_bridge_flags_t_print(vl_api_bridge_flags_t *mp, void *handle)
Definition: custom_dump.c:385
format_function_t format_vnet_sw_if_index_name
static void * vl_api_l2tpv3_interface_enable_disable_t_print(vl_api_l2tpv3_interface_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:1378
static void * vl_api_proxy_arp_intfc_enable_disable_t_print(vl_api_proxy_arp_intfc_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:576
static void * vl_api_sw_interface_set_l2_xconnect_t_print(vl_api_sw_interface_set_l2_xconnect_t *mp, void *handle)
Definition: custom_dump.c:214
#define SR_BEHAVIOR_DX4
Definition: sr.h:43
static void * vl_api_proxy_arp_add_del_t_print(vl_api_proxy_arp_add_del_t *mp, void *handle)
Definition: custom_dump.c:557
static void * vl_api_ip_dump_t_print(vl_api_ip_dump_t *mp, void *handle)
Definition: custom_dump.c:1820
static void * vl_api_l2fib_add_del_t_print(vl_api_l2fib_add_del_t *mp, void *handle)
Definition: custom_dump.c:337
Process a vpe parser cli string request.
Definition: vpe.api:399
static void * vl_api_l2_flags_t_print(vl_api_l2_flags_t *mp, void *handle)
Definition: custom_dump.c:367
static void * vl_api_create_vlan_subif_t_print(vl_api_create_vlan_subif_t *mp, void *handle)
Definition: custom_dump.c:683
#define SR_BEHAVIOR_DT4
Definition: sr.h:45
static void * vl_api_l2fib_flush_bd_t_print(vl_api_l2fib_flush_bd_t *mp, void *handle)
Definition: custom_dump.c:313
static void * vl_api_lisp_enable_disable_t_print(vl_api_lisp_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2373
static void * vl_api_oam_add_del_t_print(vl_api_oam_add_del_t *mp, void *handle)
Definition: custom_dump.c:744
static void * vl_api_sr_policy_add_t_print(vl_api_sr_policy_add_t *mp, void *handle)
Definition: custom_dump.c:1132
Dump ipsec gre tunnel table.
Definition: ipsec_gre.api:51
add or delete LISP adjacency adjacency
Definition: lisp.api:363
u8 pcap_file_name[pcap_name_length]
Definition: vpe.api:906
static void * vl_api_p2p_ethernet_del_t_print(vl_api_p2p_ethernet_del_t *mp, void *handle)
Definition: custom_dump.c:2956
PacketGenerator capture packets on given interface request.
Definition: vpe.api:898
u8 mac_address[6]
Definition: tap.api:74
static void * vl_api_vxlan_gpe_tunnel_dump_t_print(vl_api_vxlan_gpe_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1735
format_function_t format_ip4_address
Definition: format.h:79
static void * vl_api_ipfix_classify_stream_dump_t_print(vl_api_ipfix_classify_stream_dump_t *mp, void *handle)
Definition: custom_dump.c:2191
static void * vl_api_ip_fib_dump_t_print(vl_api_ip_fib_dump_t *mp, void *handle)
Definition: custom_dump.c:2082
static void * vl_api_lisp_rloc_probe_enable_disable_t_print(vl_api_lisp_rloc_probe_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2684
u8 * format_ethernet_address(u8 *s, va_list *args)
Definition: format.c:44
Proxy ARP add / del request.
Definition: vpe.api:116
Clear interface statistics.
Definition: interface.api:268
static void * vl_api_memclnt_create_t_print(vl_api_memclnt_create_t *mp, void *handle)
Definition: custom_dump.c:1680
static void * vl_api_l2tpv3_set_lookup_key_t_print(vl_api_l2tpv3_set_lookup_key_t *mp, void *handle)
Definition: custom_dump.c:1393
static void * vl_api_dhcp_proxy_config_t_print(vl_api_dhcp_proxy_config_t *mp, void *handle)
Definition: custom_dump.c:780
Classify sessions dump request.
Definition: classify.api:252
static u8 * format_policer_action(u8 *s, va_list *va)
Definition: custom_dump.c:1890
Set interface source and L4 port-range request.
Definition: vpe.api:958
unsigned long long u32x4
Definition: ixge.c:28
static void * vl_api_get_next_index_t_print(vl_api_get_next_index_t *mp, void *handle)
Definition: custom_dump.c:2265
u32 feature_bitmap
Definition: l2.api:149
u8 ip6_address[16]
Definition: tap.api:42
static void * vl_api_ip_address_dump_t_print(vl_api_ip_address_dump_t *mp, void *handle)
Definition: custom_dump.c:1808
#define L2_UU_FLOOD
Definition: l2_bd.h:128
static void * vl_api_policer_dump_t_print(vl_api_policer_dump_t *mp, void *handle)
Definition: custom_dump.c:1993
u8 tap_name[64]
Definition: tap.api:34
L2 FIB flush bridge domain entries.
Definition: l2.api:94
add or delete map request itr rlocs
Definition: lisp.api:382
static void * vl_api_cli_t_print(vl_api_cli_t *mp, void *handle)
Definition: custom_dump.c:1660
Delete host-interface.
Definition: af_packet.api:49
Set/unset input ACL interface.
Definition: vpe.api:778
static void * vl_api_set_ipfix_classify_stream_t_print(vl_api_set_ipfix_classify_stream_t *mp, void *handle)
Definition: custom_dump.c:2178
static void * vl_api_lisp_eid_table_dump_t_print(vl_api_lisp_eid_table_dump_t *mp, void *handle)
Definition: custom_dump.c:2658
static void * vl_api_sw_interface_set_table_t_print(vl_api_sw_interface_set_table_t *mp, void *handle)
Definition: custom_dump.c:144
Initialize a new tap interface with the given paramters.
Definition: tap.api:29
static void * vl_api_sr_localsid_add_del_t_print(vl_api_sr_localsid_add_del_t *mp, void *handle)
Definition: custom_dump.c:1016
static void * vl_api_l2fib_flush_int_t_print(vl_api_l2fib_flush_int_t *mp, void *handle)
Definition: custom_dump.c:325
Dump mpls eth tunnel table.
Definition: mpls.api:90
static void * vl_api_want_ip6_nd_events_t_print(vl_api_want_ip6_nd_events_t *mp, void *handle)
Definition: custom_dump.c:1776
static void * vl_api_sw_interface_set_unnumbered_t_print(vl_api_sw_interface_set_unnumbered_t *mp, void *handle)
Definition: custom_dump.c:614
static void * vl_api_ip_source_and_port_range_check_add_del_t_print(vl_api_ip_source_and_port_range_check_add_del_t *mp, void *handle)
Definition: custom_dump.c:2318
Dump l2 fib (aka bridge domain) table.
Definition: l2.api:62
Configure IP source and L4 port-range check.
Definition: vpe.api:937
Delete tap interface.
Definition: tap.api:96
Set L2 flags request !!! TODO - need more info, feature bits in l2_input.h.
Definition: l2.api:143
static void * vl_api_gpe_add_del_fwd_entry_t_print(vl_api_gpe_add_del_fwd_entry_t *mp, void *handle)
Definition: custom_dump.c:2534
L2 FIB flush all entries.
Definition: l2.api:83
L2 fib clear table request, clear all mac entries in the l2 fib.
Definition: l2.api:73
Enable/Disable span to mirror traffic from one interface to another.
Definition: span.api:24
static void * vl_api_pg_create_interface_t_print(vl_api_pg_create_interface_t *mp, void *handle)
Definition: custom_dump.c:2277
static void * vl_api_sw_interface_set_vpath_t_print(vl_api_sw_interface_set_vpath_t *mp, void *handle)
Definition: custom_dump.c:177
Set interface MTU.
Definition: interface.api:26
set LISP map-request mode.
Definition: lisp.api:279
#define SR_BEHAVIOR_LAST
Definition: sr.h:46
static void * vl_api_sw_interface_span_dump_t_print(vl_api_sw_interface_span_dump_t *mp, void *handle)
Definition: custom_dump.c:2254
#define SR_BEHAVIOR_DX2
Definition: sr.h:41
Request for LISP adjacencies.
Definition: lisp.api:586
Set/unset l2 classification tables for an interface request.
Definition: vpe.api:556
Set bridge domain ip to mac entry request.
Definition: vpe.api:521
static void * vl_api_l2fib_flush_all_t_print(vl_api_l2fib_flush_all_t *mp, void *handle)
Definition: custom_dump.c:302
u8 stream_name[stream_name_length]
Definition: vpe.api:921
add or delete lisp eid-table
Definition: lisp.api:91
static void * vl_api_gre_tunnel_dump_t_print(vl_api_gre_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1502
static void * vl_api_classify_add_del_session_t_print(vl_api_classify_add_del_session_t *mp, void *handle)
Definition: custom_dump.c:1260
static void * vl_api_ip6_fib_dump_t_print(vl_api_ip6_fib_dump_t *mp, void *handle)
Definition: custom_dump.c:2092
static void * vl_api_p2p_ethernet_add_t_print(vl_api_p2p_ethernet_add_t *mp, void *handle)
Definition: custom_dump.c:2944
u8 l4_protocol
Definition: vpe.api:994
static void * vl_api_ip_neighbor_add_del_t_print(vl_api_ip_neighbor_add_del_t *mp, void *handle)
Definition: custom_dump.c:631
static void * vl_api_cop_whitelist_enable_disable_t_print(vl_api_cop_whitelist_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:1846
Get list of flow classify interfaces and tables.
Definition: classify.api:305
static void * vl_api_af_packet_delete_t_print(vl_api_af_packet_delete_t *mp, void *handle)
Definition: custom_dump.c:1879
static void * vl_api_pg_enable_disable_t_print(vl_api_pg_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2304
Set or delete one or all ip addresses on a specified interface.
Definition: interface.api:157
Enable or Disable MPLS on and interface.
Definition: vpe.api:84
#define SR_BEHAVIOR_DT6
Definition: sr.h:44
IOAM enable : Enable in-band OAM.
Definition: vpe.api:817
static void * vl_api_af_packet_create_t_print(vl_api_af_packet_create_t *mp, void *handle)
Definition: custom_dump.c:1864
Call from VLIB_INIT_FUNCTION to set the Linux kernel inject node name.
Classify table info.
Definition: classify.api:213
static void * vl_api_modify_vhost_user_if_t_print(vl_api_modify_vhost_user_if_t *mp, void *handle)
Definition: custom_dump.c:1574
static void * vl_api_classify_table_by_interface_t_print(vl_api_classify_table_by_interface_t *mp, void *handle)
Definition: custom_dump.c:2112
static void * vl_api_show_version_t_print(vl_api_show_version_t *mp, void *handle)
Definition: custom_dump.c:1690
static void * vl_api_set_ip_flow_hash_t_print(vl_api_set_ip_flow_hash_t *mp, void *handle)
Definition: custom_dump.c:854
IPFIX classify stream configure request.
Definition: flow.api:78
static void * vl_api_lisp_locator_dump_t_print(vl_api_lisp_locator_dump_t *mp, void *handle)
Definition: custom_dump.c:2623
u8 mac_address[6]
Definition: tap.api:35
PacketGenerator create interface request.
Definition: vpe.api:872
static void * vl_api_lisp_add_del_map_resolver_t_print(vl_api_lisp_add_del_map_resolver_t *mp, void *handle)
Definition: custom_dump.c:2544
Set the ip flow hash config for a fib request.
Definition: ip.api:165
static void * vl_api_create_loopback_t_print(vl_api_create_loopback_t *mp, void *handle)
Definition: custom_dump.c:65
enable or disable LISP feature
Definition: lisp.api:142
format_function_t format_ip6_address
Definition: format.h:95
Create host-interface.
Definition: af_packet.api:23
static void * vl_api_policer_add_del_t_print(vl_api_policer_add_del_t *mp, void *handle)
Definition: custom_dump.c:1918
#define SR_BEHAVIOR_X
Definition: sr.h:38
static void * vl_api_gpe_enable_disable_t_print(vl_api_gpe_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2562
cop: enable/disable junk filtration features on an interface
Definition: cop.api:23
static void * vl_api_cop_interface_enable_disable_t_print(vl_api_cop_interface_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:1831
Set/unset the classification table for an interface request.
Definition: vpe.api:539
static void * vl_api_l2_interface_pbb_tag_rewrite_t_print(vl_api_l2_interface_pbb_tag_rewrite_t *mp, void *handle)
Definition: custom_dump.c:2774
static void * vl_api_policer_classify_dump_t_print(vl_api_policer_classify_dump_t *mp, void *handle)
Definition: custom_dump.c:2024
static void * vl_api_lisp_map_register_enable_disable_t_print(vl_api_lisp_map_register_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2698
SPAN dump request.
Definition: span.api:36
#define clib_memcpy(a, b, c)
Definition: string.h:69
#define FINISH
Definition: custom_dump.c:57
static void * vl_api_set_ipfix_exporter_t_print(vl_api_set_ipfix_exporter_t *mp, void *handle)
Definition: custom_dump.c:2148
Feature path enable/disable request.
Definition: vpe.api:1004
static void * vl_api_ip_source_and_port_range_check_interface_add_del_t_print(vl_api_ip_source_and_port_range_check_interface_add_del_t *mp, void *handle)
Definition: custom_dump.c:2345
IPv6 SR steering add/del.
Definition: sr.api:117
add or delete map-resolver
Definition: lisp.api:128
static void * vl_api_ipsec_gre_add_del_tunnel_t_print(vl_api_ipsec_gre_add_del_tunnel_t *mp, void *handle)
Definition: custom_dump.c:2738
Set/unset flow classify interface.
Definition: classify.api:291
static void * vl_api_sr_policy_del_t_print(vl_api_sr_policy_del_t *mp, void *handle)
Definition: custom_dump.c:1214
static void * vl_api_lisp_add_del_local_eid_t_print(vl_api_lisp_add_del_local_eid_t *mp, void *handle)
Definition: custom_dump.c:2511
Delete sub interface request.
Definition: vpe.api:975
void vl_msg_api_custom_dump_configure(api_main_t *am)
Definition: custom_dump.c:3151
Request for map lisp locator status.
Definition: lisp.api:419
Delete loopback interface request.
Definition: vpe.api:363
vhost-user interface modify request
Definition: vhost_user.api:56
Register for interface events.
Definition: interface.api:40
Set L2 XConnect between two interfaces request.
Definition: vpe.api:483
static void * vl_api_ipfix_classify_table_add_del_t_print(vl_api_ipfix_classify_table_add_del_t *mp, void *handle)
Definition: custom_dump.c:2201
static ip46_address_t to_ip46(u32 is_ipv6, u8 *buf)
Definition: ip6_packet.h:86
IP neighbor add / del request.
Definition: ip.api:139
static void * vl_api_ioam_disable_t_print(vl_api_ioam_disable_t *mp, void *handle)
Definition: custom_dump.c:2888
static void * vl_api_create_subif_t_print(vl_api_create_subif_t *mp, void *handle)
Definition: custom_dump.c:709
unsigned int u32
Definition: types.h:88
#define foreach_l2input_feat
Definition: l2_input.h:106
Request for eid table summary status.
Definition: lisp.api:538
static void * vl_api_dhcp_client_config_t_print(vl_api_dhcp_client_config_t *mp, void *handle)
Definition: custom_dump.c:832
enable/disable LISP map-register
Definition: lisp.api:243
Request for locator_set summary status.
Definition: lisp.api:467
Get list of policer classify interfaces and tables.
Definition: classify.api:136
Reply for lisp_add_del_map_request_itr_rlocs.
Definition: lisp.api:402
static void * vl_api_vxlan_add_del_tunnel_t_print(vl_api_vxlan_add_del_tunnel_t *mp, void *handle)
Definition: custom_dump.c:1431
MPLS tunnel Add / del route.
Definition: mpls.api:57
IPv6 router advertisement prefix config request.
Definition: ip.api:245
static void * vl_api_create_loopback_instance_t_print(vl_api_create_loopback_instance_t *mp, void *handle)
Definition: custom_dump.c:76
u16 l4_port
Definition: vpe.api:995
IPv6 SR policy deletion.
Definition: sr.api:97
Set the next node for a given node request.
Definition: vpe.api:598
Query relative index via node names.
Definition: vpe.api:847
static void * vl_api_classify_session_dump_t_print(vl_api_classify_session_dump_t *mp, void *handle)
Definition: custom_dump.c:2136
show version
Definition: vpe.api:663
add or delete locator_set
Definition: lisp.api:31
static void * vl_api_get_first_msg_id_t_print(vl_api_get_first_msg_id_t *mp, void *handle)
Definition: custom_dump.c:2856
static void * vl_api_gpe_add_del_iface_t_print(vl_api_gpe_add_del_iface_t *mp, void *handle)
Definition: custom_dump.c:2384
#define foreach_custom_print_function
Definition: custom_dump.c:2985
OAM add / del target request.
Definition: vpe.api:282
static void * vl_api_lisp_add_del_map_request_itr_rlocs_t_print(vl_api_lisp_add_del_map_request_itr_rlocs_t *mp, void *handle)
Definition: custom_dump.c:2479
static void * vl_api_sw_interface_add_del_address_t_print(vl_api_sw_interface_add_del_address_t *mp, void *handle)
Definition: custom_dump.c:120
static void * vl_api_sr_policy_mod_t_print(vl_api_sr_policy_mod_t *mp, void *handle)
Definition: custom_dump.c:1174
Classify table ids by interface index request.
Definition: classify.api:183
static void * vl_api_set_arp_neighbor_limit_t_print(vl_api_set_arp_neighbor_limit_t *mp, void *handle)
Definition: custom_dump.c:984
static void * vl_api_want_ip4_arp_events_t_print(vl_api_want_ip4_arp_events_t *mp, void *handle)
Definition: custom_dump.c:1762
IPv6 SR policy add.
Definition: sr.api:52
static void * vl_api_tap_connect_t_print(vl_api_tap_connect_t *mp, void *handle)
Definition: custom_dump.c:434
static void * vl_api_bridge_domain_set_mac_age_t_print(vl_api_bridge_domain_set_mac_age_t *mp, void *handle)
Definition: custom_dump.c:274
Add / del route request.
Definition: ip.api:355
static void * vl_api_classify_set_interface_ip_table_t_print(vl_api_classify_set_interface_ip_table_t *mp, void *handle)
Definition: custom_dump.c:1294
static void * vl_api_classify_table_ids_t_print(vl_api_classify_table_ids_t *mp, void *handle)
Definition: custom_dump.c:2102
Interface bridge mode request.
Definition: vpe.api:501
#define SR_STEER_L2
Definition: sr.h:48
static void * vl_api_sw_interface_set_mtu_t_print(vl_api_sw_interface_set_mtu_t *mp, void *handle)
Definition: custom_dump.c:2932
unsigned short u16
Definition: types.h:57
static void * vl_api_l2_interface_efp_filter_t_print(vl_api_l2_interface_efp_filter_t *mp, void *handle)
Definition: custom_dump.c:1524
Create loopback interface instance request.
Definition: vpe.api:337
static void * vl_api_bd_ip_mac_add_del_t_print(vl_api_bd_ip_mac_add_del_t *mp, void *handle)
Definition: custom_dump.c:412
L2 FIB flush interface entries.
Definition: l2.api:106
#define SR_STEER_IPV6
Definition: sr.h:43
static void * vl_api_pg_capture_t_print(vl_api_pg_capture_t *mp, void *handle)
Definition: custom_dump.c:2288
unsigned char u8
Definition: types.h:56
add or delete GPE tunnel
Definition: lisp_gpe.api:46
static void * vl_api_delete_vhost_user_if_t_print(vl_api_delete_vhost_user_if_t *mp, void *handle)
Definition: custom_dump.c:1591
#define L2_ARP_TERM
Definition: l2_bd.h:129
add or delete locator for locator_set
Definition: lisp.api:62
Configure IPFIX exporter process request.
Definition: flow.api:27
static void * vl_api_lisp_add_del_remote_mapping_t_print(vl_api_lisp_add_del_remote_mapping_t *mp, void *handle)
Definition: custom_dump.c:2432
L2 interface ethernet flow point filtering enable/disable request.
Definition: vpe.api:624
static void * vl_api_sw_interface_set_l2_bridge_t_print(vl_api_sw_interface_set_l2_bridge_t *mp, void *handle)
Definition: custom_dump.c:233
static void * vl_api_sw_interface_set_vxlan_bypass_t_print(vl_api_sw_interface_set_vxlan_bypass_t *mp, void *handle)
Definition: custom_dump.c:194
static void * vl_api_ipfix_classify_table_dump_t_print(vl_api_ipfix_classify_table_dump_t *mp, void *handle)
Definition: custom_dump.c:2215
Create loopback interface request.
Definition: vpe.api:311
Set unnumbered interface add / del request.
Definition: interface.api:254
add or delete remote static mapping
Definition: lisp.api:333
L2 interface vlan tag rewrite configure request.
Definition: l2.api:290
Create a new subinterface with the given vlan id.
Definition: vpe.api:58
L2 interface patch add / del request.
Definition: vpe.api:453
Interface set vpath request.
Definition: vpe.api:468
static void * vl_api_ipfix_exporter_dump_t_print(vl_api_ipfix_exporter_dump_t *mp, void *handle)
Definition: custom_dump.c:2168
u8 ip4_address[4]
Definition: tap.api:39
static void * vl_api_sw_interface_tap_dump_t_print(vl_api_sw_interface_tap_dump_t *mp, void *handle)
Definition: custom_dump.c:490
Modify a tap interface with the given paramters.
Definition: tap.api:67
Add/del policer.
Definition: policer.api:36
static void * vl_api_mpls_tunnel_dump_t_print(vl_api_mpls_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:2060
L2 interface pbb tag rewrite configure request.
Definition: l2.api:313
static void * vl_api_l2_fib_table_dump_t_print(vl_api_l2_fib_table_dump_t *mp, void *handle)
Definition: custom_dump.c:1627
IPv6 SR policy modification.
Definition: sr.api:77
Register for ip4 arp resolution events.
Definition: vpe.api:702
#define SR_BEHAVIOR_DX6
Definition: sr.h:42
static void * vl_api_sw_interface_dump_t_print(vl_api_sw_interface_dump_t *mp, void *handle)
Definition: custom_dump.c:1612
u32 sw_if_index
Definition: l2.api:147
#define vec_foreach(var, vec)
Vector iterator.
Set bridge flags (such as L2_LEARN, L2_FWD, L2_FLOOD, L2_UU_FLOOD, or L2_ARP_TERM) request...
Definition: l2.api:260
static void * vl_api_punt_t_print(vl_api_punt_t *mp, void *handle)
Definition: custom_dump.c:2814
IPFIX classify stream dump request.
Definition: flow.api:89
vhost-user interface delete request
Definition: vhost_user.api:71
static void * vl_api_sw_interface_ip6nd_ra_config_t_print(vl_api_sw_interface_ip6nd_ra_config_t *mp, void *handle)
Definition: custom_dump.c:938
u32 flags
Definition: vhost-user.h:76
static void * vl_api_l2tpv3_create_tunnel_t_print(vl_api_l2tpv3_create_tunnel_t *mp, void *handle)
Definition: custom_dump.c:1338
Set / clear software interface tag.
Definition: interface.api:282
l2tpv3 tunnel interface create request
Definition: l2tp.api:28
IPv6 SR LocalSID add/del request.
Definition: sr.api:28
static void * vl_api_sw_interface_span_enable_disable_t_print(vl_api_sw_interface_span_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2225
#define foreach_custom_print_no_arg_function
Definition: custom_dump.c:2967
#define L2_LEARN
Definition: l2_bd.h:125
Associate the specified interface with a fib table.
Definition: interface.api:176
static void * vl_api_feature_enable_disable_t_print(vl_api_feature_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2902
DHCP Client config add / del request.
Definition: dhcp.api:69
Punt traffic to the host.
Definition: vpe.api:989
IPFIX add or delete classifier table request.
Definition: flow.api:112
static void * vl_api_sw_interface_ip6nd_ra_prefix_t_print(vl_api_sw_interface_ip6nd_ra_prefix_t *mp, void *handle)
Definition: custom_dump.c:901
enable or disable gpe protocol
Definition: lisp_gpe.api:75
static void * vl_api_policer_classify_set_interface_t_print(vl_api_policer_classify_set_interface_t *mp, void *handle)
Definition: custom_dump.c:2005
static void * vl_api_vxlan_tunnel_dump_t_print(vl_api_vxlan_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1463
DHCP Proxy config add / del request.
Definition: dhcp.api:27
#define SR_STEER_IPV4
Definition: sr.h:42
static void * vl_api_sw_interface_vhost_user_dump_t_print(vl_api_sw_interface_vhost_user_dump_t *mp, void *handle)
Definition: custom_dump.c:1602
static void * vl_api_classify_table_info_t_print(vl_api_classify_table_info_t *mp, void *handle)
Definition: custom_dump.c:2124
Segment Routing data structures definitions.
L2 bridge domain add or delete request.
Definition: l2.api:189