FD.io VPP  v16.09
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 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-gre/mpls.h>
24 #include <vnet/dhcp/proxy.h>
25 #include <vnet/dhcpv6/proxy.h>
26 #include <vnet/l2tp/l2tp.h>
27 #include <vnet/l2/l2_input.h>
28 #include <vnet/sr/sr_packet.h>
31 #include <vnet/policer/xlate.h>
32 #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>
37 
38 #include <stats/stats.h>
39 #include <oam/oam.h>
40 
41 #include <vnet/ethernet/ethernet.h>
42 #include <vnet/l2/l2_vtr.h>
43 
44 #include <vpp-api/vpe_msg_enum.h>
45 
46 #define vl_typedefs /* define message structures */
47 #include <vpp-api/vpe_all_api_h.h>
48 #undef vl_typedefs
49 
50 #define vl_endianfun /* define message structures */
51 #include <vpp-api/vpe_all_api_h.h>
52 #undef vl_endianfun
53 
54 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
55 
56 #define FINISH \
57  vec_add1 (s, 0); \
58  vl_print (handle, (char *)s); \
59  vec_free (s); \
60  return handle;
61 
62 
64  (vl_api_create_loopback_t * mp, void *handle)
65 {
66  u8 *s;
67 
68  s = format (0, "SCRIPT: create_loopback ");
69  s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
70 
71  FINISH;
72 }
73 
75  (vl_api_delete_loopback_t * mp, void *handle)
76 {
77  u8 *s;
78 
79  s = format (0, "SCRIPT: delete_loopback ");
80  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
81 
82  FINISH;
83 }
84 
86  (vl_api_sw_interface_set_flags_t * mp, void *handle)
87 {
88  u8 *s;
89  s = format (0, "SCRIPT: sw_interface_set_flags ");
90 
91  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
92 
93  if (mp->admin_up_down)
94  s = format (s, "admin-up ");
95  else
96  s = format (s, "admin-down ");
97 
98  if (mp->link_up_down)
99  s = format (s, "link-up");
100  else
101  s = format (s, "link-down");
102 
103  FINISH;
104 }
105 
108 {
109  u8 *s;
110 
111  s = format (0, "SCRIPT: sw_interface_add_del_address ");
112 
113  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
114 
115  if (mp->is_ipv6)
116  s = format (s, "%U/%d ", format_ip6_address,
117  (ip6_address_t *) mp->address, mp->address_length);
118  else
119  s = format (s, "%U/%d ", format_ip4_address,
120  (ip4_address_t *) mp->address, mp->address_length);
121 
122  if (mp->is_add == 0)
123  s = format (s, "del ");
124  if (mp->del_all)
125  s = format (s, "del-all ");
126 
127  FINISH;
128 }
129 
131  (vl_api_sw_interface_set_table_t * mp, void *handle)
132 {
133  u8 *s;
134 
135  s = format (0, "SCRIPT: sw_interface_set_table ");
136 
137  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
138 
139  if (mp->vrf_id)
140  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
141 
142  if (mp->is_ipv6)
143  s = format (s, "ipv6 ");
144 
145  FINISH;
146 }
147 
149  (vl_api_sw_interface_set_vpath_t * mp, void *handle)
150 {
151  u8 *s;
152 
153  s = format (0, "SCRIPT: sw_interface_set_vpath ");
154 
155  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
156 
157  if (mp->enable)
158  s = format (s, "vPath enable ");
159  else
160  s = format (s, "vPath disable ");
161 
162  FINISH;
163 }
164 
167 {
168  u8 *s;
169 
170  s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
171 
172  s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
173 
174  if (mp->enable)
175  {
176  s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
177  }
178  else
179  s = format (s, "delete ");
180 
181  FINISH;
182 }
183 
186 {
187  u8 *s;
188 
189  s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
190 
191  s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
192 
193  if (mp->enable)
194  {
195  s = format (s, "bd_id %d shg %d %senable ", ntohl (mp->bd_id),
196  mp->shg, ((mp->bvi) ? "bvi " : " "));
197  }
198  else
199  s = format (s, "disable ");
200 
201  FINISH;
202 }
203 
205  (vl_api_bridge_domain_add_del_t * mp, void *handle)
206 {
207  u8 *s;
208 
209  s = format (0, "SCRIPT: bridge_domain_add_del ");
210 
211  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
212 
213  if (mp->is_add)
214  {
215  s = format (s, "flood %d uu-flood %d forward %d learn %d arp-term %d",
216  mp->flood, mp->uu_flood, mp->forward, mp->learn,
217  mp->arp_term);
218  }
219  else
220  s = format (s, "del ");
221 
222  FINISH;
223 }
224 
226  (vl_api_bridge_domain_dump_t * mp, void *handle)
227 {
228  u8 *s;
229  u32 bd_id = ntohl (mp->bd_id);
230 
231  s = format (0, "SCRIPT: bridge_domain_dump ");
232 
233  if (bd_id != ~0)
234  s = format (s, "bd_id %d ", bd_id);
235 
236  FINISH;
237 }
238 
239 static void *vl_api_l2fib_add_del_t_print
240  (vl_api_l2fib_add_del_t * mp, void *handle)
241 {
242  u8 *s;
243 
244  s = format (0, "SCRIPT: l2fib_add_del ");
245 
246  s = format (s, "mac %U ", format_ethernet_address, &mp->mac);
247 
248  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
249 
250 
251  if (mp->is_add)
252  {
253  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
254  if (mp->static_mac)
255  s = format (s, "%s", "static ");
256  if (mp->filter_mac)
257  s = format (s, "%s", "filter ");
258  if (mp->bvi_mac)
259  s = format (s, "%s", "bvi ");
260  }
261  else
262  {
263  s = format (s, "del ");
264  }
265 
266  FINISH;
267 }
268 
269 static void *
271 {
272  u8 *s;
273  u32 flags = ntohl (mp->feature_bitmap);
274 
275  s = format (0, "SCRIPT: l2_flags ");
276 
277  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
278 
279 #define _(a,b) \
280  if (flags & L2INPUT_FEAT_ ## a) s = format (s, #a " ");
282 #undef _
283 
284  FINISH;
285 }
286 
287 static void *vl_api_bridge_flags_t_print
288  (vl_api_bridge_flags_t * mp, void *handle)
289 {
290  u8 *s;
291  u32 flags = ntohl (mp->feature_bitmap);
292 
293  s = format (0, "SCRIPT: bridge_flags ");
294 
295  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
296 
297  if (flags & L2_LEARN)
298  s = format (s, "learn ");
299  if (flags & L2_FWD)
300  s = format (s, "forward ");
301  if (flags & L2_FLOOD)
302  s = format (s, "flood ");
303  if (flags & L2_UU_FLOOD)
304  s = format (s, "uu-flood ");
305  if (flags & L2_ARP_TERM)
306  s = format (s, "arp-term ");
307 
308  if (mp->is_set == 0)
309  s = format (s, "clear ");
310 
311  FINISH;
312 }
313 
315  (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
316 {
317  u8 *s;
318 
319  s = format (0, "SCRIPT: bd_ip_mac_add_del ");
320  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
321 
322  if (mp->is_ipv6)
323  s = format (s, "%U ", format_ip6_address,
324  (ip6_address_t *) mp->ip_address);
325  else
326  s = format (s, "%U ", format_ip4_address,
327  (ip4_address_t *) mp->ip_address);
328 
329  s = format (s, "%U ", format_ethernet_address, mp->mac_address);
330  if (mp->is_add == 0)
331  s = format (s, "del ");
332 
333  FINISH;
334 }
335 
336 static void *vl_api_tap_connect_t_print
337  (vl_api_tap_connect_t * mp, void *handle)
338 {
339  u8 *s;
340  u8 null_mac[6];
341 
342  memset (null_mac, 0, sizeof (null_mac));
343 
344  s = format (0, "SCRIPT: tap_connect ");
345  s = format (s, "tapname %s ", mp->tap_name);
346  if (mp->use_random_mac)
347  s = format (s, "random-mac ");
348 
349  if (memcmp (mp->mac_address, null_mac, 6))
350  s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
351 
352  FINISH;
353 }
354 
355 static void *vl_api_tap_modify_t_print
356  (vl_api_tap_modify_t * mp, void *handle)
357 {
358  u8 *s;
359  u8 null_mac[6];
360 
361  memset (null_mac, 0, sizeof (null_mac));
362 
363  s = format (0, "SCRIPT: tap_modify ");
364  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
365  s = format (s, "tapname %s ", mp->tap_name);
366  if (mp->use_random_mac)
367  s = format (s, "random-mac ");
368 
369  if (memcmp (mp->mac_address, null_mac, 6))
370  s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
371 
372  FINISH;
373 }
374 
375 static void *vl_api_tap_delete_t_print
376  (vl_api_tap_delete_t * mp, void *handle)
377 {
378  u8 *s;
379 
380  s = format (0, "SCRIPT: tap_delete ");
381  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
382 
383  FINISH;
384 }
385 
387  (vl_api_sw_interface_tap_dump_t * mp, void *handle)
388 {
389  u8 *s;
390 
391  s = format (0, "SCRIPT: sw_interface_tap_dump ");
392 
393  FINISH;
394 }
395 
396 
398  (vl_api_ip_add_del_route_t * mp, void *handle)
399 {
400  u8 *s;
401 
402  s = format (0, "SCRIPT: ip_add_del_route ");
403  if (mp->is_add == 0)
404  s = format (s, "del ");
405 
406  if (mp->next_hop_sw_if_index)
407  s = format (s, "sw_if_index %d ", ntohl (mp->next_hop_sw_if_index));
408 
409  if (mp->is_ipv6)
410  s = format (s, "%U/%d ", format_ip6_address, mp->dst_address,
411  mp->dst_address_length);
412  else
413  s = format (s, "%U/%d ", format_ip4_address, mp->dst_address,
414  mp->dst_address_length);
415  if (mp->is_local)
416  s = format (s, "local ");
417  else if (mp->is_drop)
418  s = format (s, "drop ");
419  else if (mp->is_classify)
420  s = format (s, "classify %d", ntohl (mp->classify_table_index));
421  else
422  {
423  if (mp->is_ipv6)
424  s = format (s, "via %U ", format_ip6_address, mp->next_hop_address);
425  else
426  s = format (s, "via %U ", format_ip4_address, mp->next_hop_address);
427  }
428 
429  if (mp->vrf_id != 0)
430  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
431 
432  if (mp->create_vrf_if_needed)
433  s = format (s, "create-vrf ");
434 
435  if (mp->resolve_attempts != 0)
436  s = format (s, "resolve-attempts %d ", ntohl (mp->resolve_attempts));
437 
438  if (mp->next_hop_weight != 1)
439  s = format (s, "weight %d ", mp->next_hop_weight);
440 
441  if (mp->not_last)
442  s = format (s, "not-last ");
443 
444  if (mp->is_multipath)
445  s = format (s, "multipath ");
446 
447  if (mp->is_multipath)
448  s = format (s, "multipath ");
449 
450  if (mp->lookup_in_vrf)
451  s = format (s, "lookup-in-vrf %d ", ntohl (mp->lookup_in_vrf));
452 
453  FINISH;
454 }
455 
457  (vl_api_proxy_arp_add_del_t * mp, void *handle)
458 {
459  u8 *s;
460 
461  s = format (0, "SCRIPT: proxy_arp_add_del ");
462 
463  s = format (s, "%U - %U ", format_ip4_address, mp->low_address,
465 
466  if (mp->vrf_id)
467  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
468 
469  if (mp->is_add == 0)
470  s = format (s, "del ");
471 
472  FINISH;
473 }
474 
477 {
478  u8 *s;
479 
480  s = format (0, "SCRIPT: proxy_arp_intfc_enable_disable ");
481 
482  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
483 
484  s = format (s, "enable %d ", mp->enable_disable);
485 
486  FINISH;
487 }
488 
490  (vl_api_mpls_add_del_decap_t * mp, void *handle)
491 {
492  u8 *s;
493 
494  s = format (0, "SCRIPT: mpls_add_del_decap ");
495 
496  s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
497 
498  s = format (s, "tx_vrf_id %d ", ntohl (mp->tx_vrf_id));
499 
500  s = format (s, "label %d ", ntohl (mp->label));
501 
502  s = format (s, "next-index %d ", ntohl (mp->next_index));
503 
504  if (mp->s_bit == 0)
505  s = format (s, "s-bit-clear ");
506 
507  if (mp->is_add == 0)
508  s = format (s, "del ");
509 
510  FINISH;
511 }
512 
514  (vl_api_mpls_add_del_encap_t * mp, void *handle)
515 {
516  u8 *s;
517  int i;
518 
519  s = format (0, "SCRIPT: mpls_add_del_encap ");
520 
521  s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
522 
523  s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
524 
525  for (i = 0; i < mp->nlabels; i++)
526  s = format (s, "label %d ", ntohl (mp->labels[i]));
527 
528  if (mp->is_add == 0)
529  s = format (s, "del ");
530 
531  FINISH;
532 }
533 
535  (vl_api_mpls_gre_add_del_tunnel_t * mp, void *handle)
536 {
537  u8 *s;
538 
539  s = format (0, "SCRIPT: mpls_gre_add_del_tunnel ");
540 
541  s = format (s, "src %U ", format_ip4_address, mp->src_address);
542 
543  s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
544 
545  s = format (s, "adj %U/%d ", format_ip4_address,
547 
548  s = format (s, "inner-vrf_id %d ", ntohl (mp->inner_vrf_id));
549 
550  s = format (s, "outer-vrf_id %d ", ntohl (mp->outer_vrf_id));
551 
552  if (mp->is_add == 0)
553  s = format (s, "del ");
554 
555  if (mp->l2_only)
556  s = format (s, "l2-only ");
557 
558  FINISH;
559 }
560 
563 {
564  u8 *s;
565 
566  s = format (0, "SCRIPT: mpls_ethernet_add_del_tunnel ");
567 
568  s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
569 
570  s = format (s, "dst %U", format_ethernet_address, mp->dst_mac_address);
571 
572  s = format (s, "adj %U/%d ", format_ip4_address,
574 
575  s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
576 
577  if (mp->l2_only)
578  s = format (s, "l2-only ");
579 
580  if (mp->is_add == 0)
581  s = format (s, "del ");
582 
583  FINISH;
584 }
585 
588 {
589  u8 *s;
590 
591  s = format (0, "SCRIPT: mpls_ethernet_add_del_tunnel_2 ");
592 
593  s = format (s, "adj %U/%d ", format_ip4_address,
595 
596  s = format (s, "next-hop %U ", format_ip4_address,
598 
599  s = format (s, "inner_vrf_id %d ", ntohl (mp->inner_vrf_id));
600 
601  s = format (s, "outer_vrf_id %d ", ntohl (mp->outer_vrf_id));
602 
603  s = format (s, "resolve-if-needed %d ", mp->resolve_if_needed);
604 
605  s = format (s, "resolve-attempts %d ", ntohl (mp->resolve_attempts));
606 
607  if (mp->l2_only)
608  s = format (s, "l2-only ");
609 
610  if (mp->is_add == 0)
611  s = format (s, "del ");
612 
613  FINISH;
614 }
615 
618 {
619  u8 *s;
620 
621  s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
622 
623  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
624 
625  s = format (s, "unnum_if_index %d ", ntohl (mp->unnumbered_sw_if_index));
626 
627  if (mp->is_add == 0)
628  s = format (s, "del ");
629 
630  FINISH;
631 }
632 
634  (vl_api_ip_neighbor_add_del_t * mp, void *handle)
635 {
636  u8 *s;
637  u8 null_mac[6];
638 
639  memset (null_mac, 0, sizeof (null_mac));
640 
641  s = format (0, "SCRIPT: ip_neighbor_add_del ");
642 
643  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
644 
645  if (mp->is_static)
646  s = format (s, "is_static ");
647 
648  s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
649 
650  if (memcmp (mp->mac_address, null_mac, 6))
651  s = format (s, "mac %U ", format_ethernet_address, mp->mac_address);
652 
653  if (mp->is_ipv6)
654  s =
655  format (s, "dst %U ", format_ip6_address,
656  (ip6_address_t *) mp->dst_address);
657  else
658  s =
659  format (s, "dst %U ", format_ip4_address,
660  (ip4_address_t *) mp->dst_address);
661 
662  if (mp->is_add == 0)
663  s = format (s, "del ");
664 
665  FINISH;
666 }
667 
668 static void *
670 {
671  u8 *s;
672 
673  s = format (0, "SCRIPT: reset_vrf ");
674 
675  if (mp->vrf_id)
676  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
677 
678  if (mp->is_ipv6 != 0)
679  s = format (s, "ipv6 ");
680 
681  FINISH;
682 }
683 
685  (vl_api_create_vlan_subif_t * mp, void *handle)
686 {
687  u8 *s;
688 
689  s = format (0, "SCRIPT: create_vlan_subif ");
690 
691  if (mp->sw_if_index)
692  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
693 
694  if (mp->vlan_id)
695  s = format (s, "vlan_id %d ", ntohl (mp->vlan_id));
696 
697  FINISH;
698 }
699 
700 #define foreach_create_subif_bit \
701 _(no_tags) \
702 _(one_tag) \
703 _(two_tags) \
704 _(dot1ad) \
705 _(exact_match) \
706 _(default_sub) \
707 _(outer_vlan_id_any) \
708 _(inner_vlan_id_any)
709 
710 static void *vl_api_create_subif_t_print
711  (vl_api_create_subif_t * mp, void *handle)
712 {
713  u8 *s;
714 
715  s = format (0, "SCRIPT: create_subif ");
716 
717  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
718 
719  s = format (s, "sub_id %d ", ntohl (mp->sub_id));
720 
721  if (mp->outer_vlan_id)
722  s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
723 
724  if (mp->inner_vlan_id)
725  s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
726 
727 #define _(a) if (mp->a) s = format (s, "%s ", #a);
729 #undef _
730 
731 
732  FINISH;
733 }
734 
735 static void *vl_api_oam_add_del_t_print
736  (vl_api_oam_add_del_t * mp, void *handle)
737 {
738  u8 *s;
739 
740  s = format (0, "SCRIPT: oam_add_del ");
741 
742  if (mp->vrf_id)
743  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
744 
745  s = format (s, "src %U ", format_ip4_address, mp->src_address);
746 
747  s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
748 
749  if (mp->is_add == 0)
750  s = format (s, "del ");
751 
752  FINISH;
753 }
754 
755 static void *
757 {
758  u8 *s;
759 
760  s = format (0, "SCRIPT: reset_fib ");
761 
762  if (mp->vrf_id)
763  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
764 
765  if (mp->is_ipv6 != 0)
766  s = format (s, "ipv6 ");
767 
768  FINISH;
769 }
770 
772  (vl_api_dhcp_proxy_config_t * mp, void *handle)
773 {
774  u8 *s;
775 
776  s = format (0, "SCRIPT: dhcp_proxy_config ");
777 
778  s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
779 
780  if (mp->is_ipv6)
781  {
782  s = format (s, "svr %U ", format_ip6_address,
783  (ip6_address_t *) mp->dhcp_server);
784  s = format (s, "src %U ", format_ip6_address,
786  }
787  else
788  {
789  s = format (s, "svr %U ", format_ip4_address,
790  (ip4_address_t *) mp->dhcp_server);
791  s = format (s, "src %U ", format_ip4_address,
793  }
794  if (mp->is_add == 0)
795  s = format (s, "del ");
796 
797  s = format (s, "insert-cid %d ", mp->insert_circuit_id);
798 
799  FINISH;
800 }
801 
803  (vl_api_dhcp_proxy_config_2_t * mp, void *handle)
804 {
805  u8 *s;
806 
807  s = format (0, "SCRIPT: dhcp_proxy_config_2 ");
808 
809  s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
810  s = format (s, "server_vrf_id %d ", ntohl (mp->server_vrf_id));
811 
812  if (mp->is_ipv6)
813  {
814  s = format (s, "svr %U ", format_ip6_address,
815  (ip6_address_t *) mp->dhcp_server);
816  s = format (s, "src %U ", format_ip6_address,
818  }
819  else
820  {
821  s = format (s, "svr %U ", format_ip4_address,
822  (ip4_address_t *) mp->dhcp_server);
823  s = format (s, "src %U ", format_ip4_address,
825  }
826  if (mp->is_add == 0)
827  s = format (s, "del ");
828 
829  s = format (s, "insert-cid %d ", mp->insert_circuit_id);
830 
831  FINISH;
832 }
833 
835  (vl_api_dhcp_proxy_set_vss_t * mp, void *handle)
836 {
837  u8 *s;
838 
839  s = format (0, "SCRIPT: dhcp_proxy_set_vss ");
840 
841  s = format (s, "tbl_id %d ", ntohl (mp->tbl_id));
842 
843  s = format (s, "fib_id %d ", ntohl (mp->fib_id));
844 
845  s = format (s, "oui %d ", ntohl (mp->oui));
846 
847  if (mp->is_ipv6 != 0)
848  s = format (s, "ipv6 ");
849 
850  if (mp->is_add == 0)
851  s = format (s, "del ");
852 
853  FINISH;
854 }
855 
857  (vl_api_dhcp_client_config_t * mp, void *handle)
858 {
859  u8 *s;
860 
861  s = format (0, "SCRIPT: dhcp_client_config ");
862 
863  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
864 
865  s = format (s, "hostname %s ", mp->hostname);
866 
867  s = format (s, "want_dhcp_event %d ", mp->want_dhcp_event);
868 
869  s = format (s, "pid %d ", mp->pid);
870 
871  if (mp->is_add == 0)
872  s = format (s, "del ");
873 
874  FINISH;
875 }
876 
877 
879  (vl_api_set_ip_flow_hash_t * mp, void *handle)
880 {
881  u8 *s;
882 
883  s = format (0, "SCRIPT: set_ip_flow_hash ");
884 
885  s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
886 
887  if (mp->src)
888  s = format (s, "src ");
889 
890  if (mp->dst)
891  s = format (s, "dst ");
892 
893  if (mp->sport)
894  s = format (s, "sport ");
895 
896  if (mp->dport)
897  s = format (s, "dport ");
898 
899  if (mp->proto)
900  s = format (s, "proto ");
901 
902  if (mp->reverse)
903  s = format (s, "reverse ");
904 
905  if (mp->is_ipv6 != 0)
906  s = format (s, "ipv6 ");
907 
908  FINISH;
909 }
910 
913 {
914  u8 *s;
915 
916  s = format (0, "SCRIPT: sw_interface_ip6_set_link_local_address ");
917 
918  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
919 
920  s = format (s, "%U/%d ", format_ip6_address, mp->address,
921  mp->address_length);
922 
923  FINISH;
924 }
925 
928 {
929  u8 *s;
930 
931  s = format (0, "SCRIPT: sw_interface_ip6nd_ra_prefix ");
932 
933  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
934 
935  s = format (s, "%U/%d ", format_ip6_address, mp->address,
936  mp->address_length);
937 
938  s = format (s, "val_life %d ", ntohl (mp->val_lifetime));
939 
940  s = format (s, "pref_life %d ", ntohl (mp->pref_lifetime));
941 
942  if (mp->use_default)
943  s = format (s, "def ");
944 
945  if (mp->no_advertise)
946  s = format (s, "noadv ");
947 
948  if (mp->off_link)
949  s = format (s, "offl ");
950 
951  if (mp->no_autoconfig)
952  s = format (s, "noauto ");
953 
954  if (mp->no_onlink)
955  s = format (s, "nolink ");
956 
957  if (mp->is_no)
958  s = format (s, "isno ");
959 
960  FINISH;
961 }
962 
965 {
966  u8 *s;
967 
968  s = format (0, "SCRIPT: sw_interface_ip6nd_ra_config ");
969 
970  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
971 
972  s = format (s, "maxint %d ", ntohl (mp->max_interval));
973 
974  s = format (s, "minint %d ", ntohl (mp->min_interval));
975 
976  s = format (s, "life %d ", ntohl (mp->lifetime));
977 
978  s = format (s, "count %d ", ntohl (mp->initial_count));
979 
980  s = format (s, "interval %d ", ntohl (mp->initial_interval));
981 
982  if (mp->suppress)
983  s = format (s, "suppress ");
984 
985  if (mp->managed)
986  s = format (s, "managed ");
987 
988  if (mp->other)
989  s = format (s, "other ");
990 
991  if (mp->ll_option)
992  s = format (s, "ll ");
993 
994  if (mp->send_unicast)
995  s = format (s, "send ");
996 
997  if (mp->cease)
998  s = format (s, "cease ");
999 
1000  if (mp->is_no)
1001  s = format (s, "isno ");
1002 
1003  if (mp->default_router)
1004  s = format (s, "def ");
1005 
1006  FINISH;
1007 }
1008 
1010  (vl_api_set_arp_neighbor_limit_t * mp, void *handle)
1011 {
1012  u8 *s;
1013 
1014  s = format (0, "SCRIPT: set_arp_neighbor_limit ");
1015 
1016  s = format (s, "arp_nbr_limit %d ", ntohl (mp->arp_neighbor_limit));
1017 
1018  if (mp->is_ipv6 != 0)
1019  s = format (s, "ipv6 ");
1020 
1021  FINISH;
1022 }
1023 
1025  (vl_api_l2_patch_add_del_t * mp, void *handle)
1026 {
1027  u8 *s;
1028 
1029  s = format (0, "SCRIPT: l2_patch_add_del ");
1030 
1031  s = format (s, "rx_sw_if_index %d ", ntohl (mp->rx_sw_if_index));
1032 
1033  s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
1034 
1035  if (mp->is_add == 0)
1036  s = format (s, "del ");
1037 
1038  FINISH;
1039 }
1040 
1042  (vl_api_sr_tunnel_add_del_t * mp, void *handle)
1043 {
1044  u8 *s;
1045  ip6_address_t *this_address;
1046  int i;
1047  u16 flags_host_byte_order;
1048  u8 pl_flag;
1049 
1050  s = format (0, "SCRIPT: sr_tunnel_add_del ");
1051 
1052  if (mp->name[0])
1053  s = format (s, "name %s ", mp->name);
1054 
1055  s = format (s, "src %U dst %U/%d ", format_ip6_address,
1056  (ip6_address_t *) mp->src_address,
1059 
1060  this_address = (ip6_address_t *) mp->segs_and_tags;
1061  for (i = 0; i < mp->n_segments; i++)
1062  {
1063  s = format (s, "next %U ", format_ip6_address, this_address);
1064  this_address++;
1065  }
1066  for (i = 0; i < mp->n_tags; i++)
1067  {
1068  s = format (s, "tag %U ", format_ip6_address, this_address);
1069  this_address++;
1070  }
1071 
1072  flags_host_byte_order = clib_net_to_host_u16 (mp->flags_net_byte_order);
1073 
1074  if (flags_host_byte_order & IP6_SR_HEADER_FLAG_CLEANUP)
1075  s = format (s, " clean ");
1076 
1077  if (flags_host_byte_order & IP6_SR_HEADER_FLAG_PROTECTED)
1078  s = format (s, "protected ");
1079 
1080  for (i = 1; i <= 4; i++)
1081  {
1082  pl_flag = ip6_sr_policy_list_flags (flags_host_byte_order, i);
1083 
1084  switch (pl_flag)
1085  {
1087  continue;
1088 
1090  s = format (s, "InPE %d ", i);
1091  break;
1092 
1094  s = format (s, "EgPE %d ", i);
1095  break;
1096 
1098  s = format (s, "OrgSrc %d ", i);
1099  break;
1100 
1101  default:
1102  clib_warning ("BUG: pl elt %d value %d", i, pl_flag);
1103  break;
1104  }
1105  }
1106 
1107  if (mp->policy_name[0])
1108  s = format (s, "policy_name %s ", mp->policy_name);
1109 
1110  if (mp->is_add == 0)
1111  s = format (s, "del ");
1112 
1113  FINISH;
1114 }
1115 
1117  (vl_api_sr_policy_add_del_t * mp, void *handle)
1118 {
1119  u8 *s;
1120  int i;
1121 
1122  s = format (0, "SCRIPT: sr_policy_add_del ");
1123 
1124  if (mp->name[0])
1125  s = format (s, "name %s ", mp->name);
1126 
1127 
1128  if (mp->tunnel_names[0])
1129  {
1130  // start deserializing tunnel_names
1131  int num_tunnels = mp->tunnel_names[0]; //number of tunnels
1132  u8 *deser_tun_names = mp->tunnel_names;
1133  deser_tun_names += 1; //moving along
1134 
1135  u8 *tun_name = 0;
1136  int tun_name_len = 0;
1137 
1138  for (i = 0; i < num_tunnels; i++)
1139  {
1140  tun_name_len = *deser_tun_names;
1141  deser_tun_names += 1;
1142  vec_resize (tun_name, tun_name_len);
1143  memcpy (tun_name, deser_tun_names, tun_name_len);
1144  s = format (s, "tunnel %s ", tun_name);
1145  deser_tun_names += tun_name_len;
1146  tun_name = 0;
1147  }
1148  }
1149 
1150  if (mp->is_add == 0)
1151  s = format (s, "del ");
1152 
1153  FINISH;
1154 }
1155 
1158 {
1159 
1160  u8 *s = 0;
1161  /* int i; */
1162 
1163  s = format (0, "SCRIPT: sr_multicast_map_add_del ");
1164 
1165  if (mp->multicast_address[0])
1166  s = format (s, "address %U ", format_ip6_address, &mp->multicast_address);
1167 
1168  if (mp->policy_name[0])
1169  s = format (s, "sr-policy %s ", &mp->policy_name);
1170 
1171 
1172  if (mp->is_add == 0)
1173  s = format (s, "del ");
1174 
1175  FINISH;
1176 }
1177 
1178 
1180  (vl_api_classify_add_del_table_t * mp, void *handle)
1181 {
1182  u8 *s;
1183  int i;
1184 
1185  s = format (0, "SCRIPT: classify_add_del_table ");
1186 
1187  if (mp->is_add == 0)
1188  {
1189  s = format (s, "table %d ", ntohl (mp->table_index));
1190  s = format (s, "del ");
1191  }
1192  else
1193  {
1194  s = format (s, "nbuckets %d ", ntohl (mp->nbuckets));
1195  s = format (s, "memory_size %d ", ntohl (mp->memory_size));
1196  s = format (s, "skip %d ", ntohl (mp->skip_n_vectors));
1197  s = format (s, "match %d ", ntohl (mp->match_n_vectors));
1198  s = format (s, "next-table %d ", ntohl (mp->next_table_index));
1199  s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
1200  s = format (s, "mask hex ");
1201  for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
1202  s = format (s, "%02x", mp->mask[i]);
1203  vec_add1 (s, ' ');
1204  }
1205 
1206  FINISH;
1207 }
1208 
1211 {
1212  u8 *s;
1213  int i, limit = 0;
1214 
1215  s = format (0, "SCRIPT: classify_add_del_session ");
1216 
1217  s = format (s, "table_index %d ", ntohl (mp->table_index));
1218  s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
1219  s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
1220  s = format (s, "advance %d ", ntohl (mp->advance));
1221  if (mp->is_add == 0)
1222  s = format (s, "del ");
1223 
1224  s = format (s, "match hex ");
1225  for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1226  {
1227  if (mp->match[i] != 0)
1228  {
1229  limit = i + 1;
1230  break;
1231  }
1232  }
1233 
1234  for (i = 0; i < limit; i++)
1235  s = format (s, "%02x", mp->match[i]);
1236 
1237  FINISH;
1238 }
1239 
1242 {
1243  u8 *s;
1244 
1245  s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1246 
1247  if (mp->is_ipv6)
1248  s = format (s, "ipv6 ");
1249 
1250  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1251  s = format (s, "table %d ", ntohl (mp->table_index));
1252 
1253  FINISH;
1254 }
1255 
1258 {
1259  u8 *s;
1260 
1261  s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1262 
1263  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1264  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1265  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1266  s = format (s, "other-table %d ", ntohl (mp->other_table_index));
1267 
1268  FINISH;
1269 }
1270 
1271 static void *vl_api_add_node_next_t_print
1272  (vl_api_add_node_next_t * mp, void *handle)
1273 {
1274  u8 *s;
1275 
1276  s = format (0, "SCRIPT: add_node_next ");
1277 
1278  s = format (0, "node %s next %s ", mp->node_name, mp->next_name);
1279 
1280  FINISH;
1281 }
1282 
1284  (vl_api_l2tpv3_create_tunnel_t * mp, void *handle)
1285 {
1286  u8 *s;
1287 
1288  s = format (0, "SCRIPT: l2tpv3_create_tunnel ");
1289 
1290  s = format (s, "client_address %U our_address %U ",
1293  s = format (s, "local_session_id %d ", ntohl (mp->local_session_id));
1294  s = format (s, "remote_session_id %d ", ntohl (mp->remote_session_id));
1295  s = format (s, "local_cookie %lld ",
1296  clib_net_to_host_u64 (mp->local_cookie));
1297  s = format (s, "remote_cookie %lld ",
1298  clib_net_to_host_u64 (mp->remote_cookie));
1299  if (mp->l2_sublayer_present)
1300  s = format (s, "l2-sublayer-present ");
1301 
1302  FINISH;
1303 }
1304 
1307 {
1308  u8 *s;
1309 
1310  s = format (0, "SCRIPT: l2tpv3_set_tunnel_cookies ");
1311 
1312  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1313 
1314  s = format (s, "new_local_cookie %llu ",
1315  clib_net_to_host_u64 (mp->new_local_cookie));
1316 
1317  s = format (s, "new_remote_cookie %llu ",
1318  clib_net_to_host_u64 (mp->new_remote_cookie));
1319 
1320  FINISH;
1321 }
1322 
1325 {
1326  u8 *s;
1327 
1328  s = format (0, "SCRIPT: l2tpv3_interface_enable_disable ");
1329 
1330  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1331 
1332  if (mp->enable_disable == 0)
1333  s = format (s, "del ");
1334 
1335  FINISH;
1336 }
1337 
1339  (vl_api_l2tpv3_set_lookup_key_t * mp, void *handle)
1340 {
1341  u8 *s;
1342  char *str = "unknown";
1343 
1344  s = format (0, "SCRIPT: l2tpv3_set_lookup_key ");
1345 
1346  switch (mp->key)
1347  {
1349  str = "lookup_v6_src";
1350  break;
1352  str = "lookup_v6_dst";
1353  break;
1354  case L2T_LOOKUP_SESSION_ID:
1355  str = "lookup_session_id";
1356  break;
1357  default:
1358  break;
1359  }
1360 
1361  s = format (s, "%s ", str);
1362 
1363  FINISH;
1364 }
1365 
1368 {
1369  u8 *s;
1370 
1371  s = format (0, "SCRIPT: sw_if_l2tpv3_tunnel_dump ");
1372 
1373  FINISH;
1374 }
1375 
1377  (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1378 {
1379  u8 *s;
1380 
1381  s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1382 
1383  if (mp->is_ipv6)
1384  {
1385  s = format (s, "src %U ", format_ip6_address,
1386  (ip6_address_t *) mp->src_address);
1387  s = format (s, "dst %U ", format_ip6_address,
1388  (ip6_address_t *) mp->dst_address);
1389  }
1390  else
1391  {
1392  s = format (s, "src %U ", format_ip4_address,
1393  (ip4_address_t *) mp->src_address);
1394  s = format (s, "dst %U ", format_ip4_address,
1395  (ip4_address_t *) mp->dst_address);
1396  }
1397 
1398  if (mp->encap_vrf_id)
1399  s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1400 
1401  s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1402 
1403  s = format (s, "vni %d ", ntohl (mp->vni));
1404 
1405  if (mp->is_add == 0)
1406  s = format (s, "del ");
1407 
1408  FINISH;
1409 }
1410 
1412  (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1413 {
1414  u8 *s;
1415 
1416  s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1417 
1418  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1419 
1420  FINISH;
1421 }
1422 
1424  (vl_api_gre_add_del_tunnel_t * mp, void *handle)
1425 {
1426  u8 *s;
1427 
1428  s = format (0, "SCRIPT: gre_add_del_tunnel ");
1429 
1430  s = format (s, "dst %U ", format_ip46_address,
1431  (ip46_address_t *) & (mp->dst_address),
1433 
1434  s = format (s, "src %U ", format_ip46_address,
1435  (ip46_address_t *) & (mp->src_address),
1436  mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
1437 
1438  if (mp->outer_fib_id)
1439  s = format (s, "outer-fib-id %d ", ntohl (mp->outer_fib_id));
1440 
1441  if (mp->is_add == 0)
1442  s = format (s, "del ");
1443 
1444  FINISH;
1445 }
1446 
1447 static void *vl_api_gre_tunnel_dump_t_print
1448  (vl_api_gre_tunnel_dump_t * mp, void *handle)
1449 {
1450  u8 *s;
1451 
1452  s = format (0, "SCRIPT: gre_tunnel_dump ");
1453 
1454  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1455 
1456  FINISH;
1457 }
1458 
1460  (vl_api_l2_fib_clear_table_t * mp, void *handle)
1461 {
1462  u8 *s;
1463 
1464  s = format (0, "SCRIPT: l2_fib_clear_table ");
1465 
1466  FINISH;
1467 }
1468 
1471 {
1472  u8 *s;
1473 
1474  s = format (0, "SCRIPT: l2_interface_efp_filter ");
1475 
1476  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1477  if (mp->enable_disable)
1478  s = format (s, "enable ");
1479  else
1480  s = format (s, "disable ");
1481 
1482  FINISH;
1483 }
1484 
1487 {
1488  u8 *s;
1489 
1490  s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
1491 
1492  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1493  s = format (s, "vtr_op %d ", ntohl (mp->vtr_op));
1494  s = format (s, "push_dot1q %d ", ntohl (mp->push_dot1q));
1495  s = format (s, "tag1 %d ", ntohl (mp->tag1));
1496  s = format (s, "tag2 %d ", ntohl (mp->tag2));
1497 
1498  FINISH;
1499 }
1500 
1502  (vl_api_create_vhost_user_if_t * mp, void *handle)
1503 {
1504  u8 *s;
1505 
1506  s = format (0, "SCRIPT: create_vhost_user_if ");
1507 
1508  s = format (s, "socket %s ", mp->sock_filename);
1509  if (mp->is_server)
1510  s = format (s, "server ");
1511  if (mp->renumber)
1512  s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
1513 
1514  FINISH;
1515 }
1516 
1518  (vl_api_modify_vhost_user_if_t * mp, void *handle)
1519 {
1520  u8 *s;
1521 
1522  s = format (0, "SCRIPT: modify_vhost_user_if ");
1523 
1524  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1525  s = format (s, "socket %s ", mp->sock_filename);
1526  if (mp->is_server)
1527  s = format (s, "server ");
1528  if (mp->renumber)
1529  s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
1530 
1531  FINISH;
1532 }
1533 
1535  (vl_api_delete_vhost_user_if_t * mp, void *handle)
1536 {
1537  u8 *s;
1538 
1539  s = format (0, "SCRIPT: delete_vhost_user_if ");
1540  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1541 
1542  FINISH;
1543 }
1544 
1547 {
1548  u8 *s;
1549 
1550  s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
1551 
1552  FINISH;
1553 }
1554 
1556  (vl_api_sw_interface_dump_t * mp, void *handle)
1557 {
1558  u8 *s;
1559 
1560  s = format (0, "SCRIPT: sw_interface_dump ");
1561 
1562  if (mp->name_filter_valid)
1563  s = format (s, "name_filter %s ", mp->name_filter);
1564  else
1565  s = format (s, "all ");
1566 
1567  FINISH;
1568 }
1569 
1571  (vl_api_l2_fib_table_dump_t * mp, void *handle)
1572 {
1573  u8 *s;
1574 
1575  s = format (0, "SCRIPT: l2_fib_table_dump ");
1576 
1577  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
1578 
1579  FINISH;
1580 }
1581 
1582 static void *vl_api_control_ping_t_print
1583  (vl_api_control_ping_t * mp, void *handle)
1584 {
1585  u8 *s;
1586 
1587  s = format (0, "SCRIPT: control_ping ");
1588 
1589  FINISH;
1590 }
1591 
1593  (vl_api_want_interface_events_t * mp, void *handle)
1594 {
1595  u8 *s;
1596 
1597  s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
1598  ntohl (mp->pid), ntohl (mp->enable_disable));
1599 
1600  FINISH;
1601 }
1602 
1603 static void *vl_api_cli_request_t_print
1604  (vl_api_cli_request_t * mp, void *handle)
1605 {
1606  u8 *s;
1607 
1608  s = format (0, "SCRIPT: cli_request ");
1609 
1610  FINISH;
1611 }
1612 
1613 static void *vl_api_memclnt_create_t_print
1614  (vl_api_memclnt_create_t * mp, void *handle)
1615 {
1616  u8 *s;
1617 
1618  s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
1619 
1620  FINISH;
1621 }
1622 
1623 static void *vl_api_show_version_t_print
1624  (vl_api_show_version_t * mp, void *handle)
1625 {
1626  u8 *s;
1627 
1628  s = format (0, "SCRIPT: show_version ");
1629 
1630  FINISH;
1631 }
1632 
1635 {
1636  u8 *s;
1637 
1638  s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
1639 
1640  s = format (s, "local %U ", format_ip46_address, &mp->local, mp->is_ipv6);
1641 
1642  s = format (s, "remote %U ", format_ip46_address, &mp->remote, mp->is_ipv6);
1643 
1644  s = format (s, "protocol %d ", ntohl (mp->protocol));
1645 
1646  s = format (s, "vni %d ", ntohl (mp->vni));
1647 
1648  if (mp->is_add == 0)
1649  s = format (s, "del ");
1650 
1651  if (mp->encap_vrf_id)
1652  s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1653 
1654  if (mp->decap_vrf_id)
1655  s = format (s, "decap-vrf-id %d ", ntohl (mp->decap_vrf_id));
1656 
1657  FINISH;
1658 }
1659 
1661  (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
1662 {
1663  u8 *s;
1664 
1665  s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
1666 
1667  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1668 
1669  FINISH;
1670 }
1671 
1674 {
1675  u8 *s;
1676 
1677  s = format (0, "SCRIPT: interface_renumber ");
1678 
1679  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1680 
1681  s = format (s, "new_show_dev_instance %d ",
1682  ntohl (mp->new_show_dev_instance));
1683 
1684  FINISH;
1685 }
1686 
1688  (vl_api_want_ip4_arp_events_t * mp, void *handle)
1689 {
1690  u8 *s;
1691 
1692  s = format (0, "SCRIPT: want_ip4_arp_events ");
1693  s = format (s, "pid %d address %U ", mp->pid,
1694  format_ip4_address, &mp->address);
1695  if (mp->enable_disable == 0)
1696  s = format (s, "del ");
1697 
1698  FINISH;
1699 }
1700 
1703 {
1704  u8 *s;
1705 
1706  s = format (0, "SCRIPT: input_acl_set_interface ");
1707 
1708  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1709  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1710  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1711  s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
1712 
1713  if (mp->is_add == 0)
1714  s = format (s, "del ");
1715 
1716  FINISH;
1717 }
1718 
1719 static void *vl_api_ip_address_dump_t_print
1720  (vl_api_ip_address_dump_t * mp, void *handle)
1721 {
1722  u8 *s;
1723 
1724  s = format (0, "SCRIPT: ip6_address_dump ");
1725  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1726  s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1727 
1728  FINISH;
1729 }
1730 
1731 static void *
1733 {
1734  u8 *s;
1735 
1736  s = format (0, "SCRIPT: ip_dump ");
1737  s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
1738 
1739  FINISH;
1740 }
1741 
1744 {
1745  u8 *s;
1746 
1747  s = format (0, "SCRIPT: cop_interface_enable_disable ");
1748  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1749  if (mp->enable_disable)
1750  s = format (s, "enable ");
1751  else
1752  s = format (s, "disable ");
1753 
1754  FINISH;
1755 }
1756 
1759 {
1760  u8 *s;
1761 
1762  s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
1763  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1764  s = format (s, "fib-id %d ", ntohl (mp->fib_id));
1765  if (mp->ip4)
1766  s = format (s, "ip4 ");
1767  if (mp->ip6)
1768  s = format (s, "ip6 ");
1769  if (mp->default_cop)
1770  s = format (s, "default ");
1771 
1772  FINISH;
1773 }
1774 
1776  (vl_api_af_packet_create_t * mp, void *handle)
1777 {
1778  u8 *s;
1779 
1780  s = format (0, "SCRIPT: af_packet_create ");
1781  s = format (s, "host_if_name %s ", mp->host_if_name);
1782  if (mp->use_random_hw_addr)
1783  s = format (s, "hw_addr random ");
1784  else
1785  s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
1786 
1787  FINISH;
1788 }
1789 
1791  (vl_api_af_packet_delete_t * mp, void *handle)
1792 {
1793  u8 *s;
1794 
1795  s = format (0, "SCRIPT: af_packet_delete ");
1796  s = format (s, "host_if_name %s ", mp->host_if_name);
1797 
1798  FINISH;
1799 }
1800 
1801 static u8 *
1802 format_policer_action (u8 * s, va_list * va)
1803 {
1804  u32 action = va_arg (*va, u32);
1805  u32 dscp = va_arg (*va, u32);
1806  char *t = 0;
1807 
1808  if (action == SSE2_QOS_ACTION_DROP)
1809  s = format (s, "drop");
1810  else if (action == SSE2_QOS_ACTION_TRANSMIT)
1811  s = format (s, "transmit");
1812  else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
1813  {
1814  s = format (s, "mark-and-transmit ");
1815  switch (dscp)
1816  {
1817 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
1819 #undef _
1820  default:
1821  break;
1822  }
1823  s = format (s, "%s", t);
1824  }
1825 
1826  return s;
1827 }
1828 
1829 static void *vl_api_policer_add_del_t_print
1830  (vl_api_policer_add_del_t * mp, void *handle)
1831 {
1832  u8 *s;
1833 
1834  s = format (0, "SCRIPT: policer_add_del ");
1835  s = format (s, "name %s ", mp->name);
1836  s = format (s, "cir %d ", mp->cir);
1837  s = format (s, "eir %d ", mp->eir);
1838  s = format (s, "cb %d ", mp->cb);
1839  s = format (s, "eb %d ", mp->eb);
1840 
1841  switch (mp->rate_type)
1842  {
1843  case SSE2_QOS_RATE_KBPS:
1844  s = format (s, "rate_type kbps ");
1845  break;
1846  case SSE2_QOS_RATE_PPS:
1847  s = format (s, "rate_type pps ");
1848  break;
1849  default:
1850  break;
1851  }
1852 
1853  switch (mp->round_type)
1854  {
1856  s = format (s, "round_type closest ");
1857  break;
1858  case SSE2_QOS_ROUND_TO_UP:
1859  s = format (s, "round_type up ");
1860  break;
1862  s = format (s, "round_type down ");
1863  break;
1864  default:
1865  break;
1866  }
1867 
1868  switch (mp->type)
1869  {
1871  s = format (s, "type 1r2c ");
1872  break;
1874  s = format (s, "type 1r3c ");
1875  break;
1877  s = format (s, "type 2r3c-2698 ");
1878  break;
1880  s = format (s, "type 2r3c-4115 ");
1881  break;
1883  s = format (s, "type 2r3c-mef5cf1 ");
1884  break;
1885  default:
1886  break;
1887  }
1888 
1889  s = format (s, "conform_action %U ", format_policer_action,
1891  s = format (s, "exceed_action %U ", format_policer_action,
1892  mp->exceed_action_type, mp->exceed_dscp);
1893  s = format (s, "violate_action %U ", format_policer_action,
1895 
1896  if (mp->color_aware)
1897  s = format (s, "color-aware ");
1898  if (mp->is_add == 0)
1899  s = format (s, "del ");
1900 
1901  FINISH;
1902 }
1903 
1904 static void *vl_api_policer_dump_t_print
1905  (vl_api_policer_dump_t * mp, void *handle)
1906 {
1907  u8 *s;
1908 
1909  s = format (0, "SCRIPT: policer_dump ");
1910  if (mp->match_name_valid)
1911  s = format (s, "name %s ", mp->match_name);
1912 
1913  FINISH;
1914 }
1915 
1918 {
1919  u8 *s;
1920 
1921  s = format (0, "SCRIPT: policer_classify_set_interface ");
1922  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1923  if (mp->ip4_table_index != ~0)
1924  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1925  if (mp->ip6_table_index != ~0)
1926  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1927  if (mp->l2_table_index != ~0)
1928  s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
1929  if (mp->is_add == 0)
1930  s = format (s, "del ");
1931 
1932  FINISH;
1933 }
1934 
1936  (vl_api_policer_classify_dump_t * mp, void *handle)
1937 {
1938  u8 *s;
1939 
1940  s = format (0, "SCRIPT: policer_classify_dump ");
1941  switch (mp->type)
1942  {
1944  s = format (s, "type ip4 ");
1945  break;
1947  s = format (s, "type ip6 ");
1948  break;
1950  s = format (s, "type l2 ");
1951  break;
1952  default:
1953  break;
1954  }
1955 
1956  FINISH;
1957 }
1958 
1961 {
1962  u8 *s;
1963 
1964  s = format (0, "SCRIPT: sw_interface_clear_stats ");
1965  if (mp->sw_if_index != ~0)
1966  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1967 
1968  FINISH;
1969 }
1970 
1972  (vl_api_mpls_gre_tunnel_dump_t * mp, void *handle)
1973 {
1974  u8 *s;
1975 
1976  s = format (0, "SCRIPT: mpls_gre_tunnel_dump ");
1977 
1978  s = format (s, "tunnel_index %d ", ntohl (mp->tunnel_index));
1979 
1980  FINISH;
1981 }
1982 
1984  (vl_api_mpls_eth_tunnel_dump_t * mp, void *handle)
1985 {
1986  u8 *s;
1987 
1988  s = format (0, "SCRIPT: mpls_eth_tunnel_dump ");
1989 
1990  s = format (s, "tunnel_index %d ", ntohl (mp->tunnel_index));
1991 
1992  FINISH;
1993 }
1994 
1996  (vl_api_mpls_fib_encap_dump_t * mp, void *handle)
1997 {
1998  u8 *s;
1999 
2000  s = format (0, "SCRIPT: mpls_fib_encap_dump ");
2001 
2002  FINISH;
2003 }
2004 
2006  (vl_api_mpls_fib_decap_dump_t * mp, void *handle)
2007 {
2008  u8 *s;
2009 
2010  s = format (0, "SCRIPT: mpls_fib_decap_dump ");
2011 
2012  FINISH;
2013 }
2014 
2016  (vl_api_classify_table_ids_t * mp, void *handle)
2017 {
2018  u8 *s;
2019 
2020  s = format (0, "SCRIPT: classify_table_ids ");
2021 
2022  FINISH;
2023 }
2024 
2027 {
2028  u8 *s;
2029 
2030  s = format (0, "SCRIPT: classify_table_by_interface ");
2031  if (mp->sw_if_index != ~0)
2032  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2033 
2034  FINISH;
2035 }
2036 
2038  (vl_api_classify_table_info_t * mp, void *handle)
2039 {
2040  u8 *s;
2041 
2042  s = format (0, "SCRIPT: classify_table_info ");
2043  if (mp->table_id != ~0)
2044  s = format (s, "table_id %d ", ntohl (mp->table_id));
2045 
2046  FINISH;
2047 }
2048 
2050  (vl_api_classify_session_dump_t * mp, void *handle)
2051 {
2052  u8 *s;
2053 
2054  s = format (0, "SCRIPT: classify_session_dump ");
2055  if (mp->table_id != ~0)
2056  s = format (s, "table_id %d ", ntohl (mp->table_id));
2057 
2058  FINISH;
2059 }
2060 
2061 static void *vl_api_ipfix_enable_t_print
2062  (vl_api_ipfix_enable_t * mp, void *handle)
2063 {
2064  u8 *s;
2065 
2066  s = format (0, "SCRIPT: ipfix_enable ");
2067 
2068  s = format (s, "collector-address %U ", format_ip4_address,
2070  s = format (s, "collector-port %d ", ntohs (mp->collector_port));
2071  s = format (s, "src-address %U ", format_ip4_address,
2072  (ip4_address_t *) mp->src_address);
2073  s = format (s, "vrf-id %d ", ntohl (mp->vrf_id));
2074  s = format (s, "path-mtu %d ", ntohl (mp->path_mtu));
2075  s = format (s, "template-interval %d ", ntohl (mp->template_interval));
2076 
2077  FINISH;
2078 }
2079 
2080 static void *vl_api_ipfix_dump_t_print
2081  (vl_api_ipfix_dump_t * mp, void *handle)
2082 {
2083  u8 *s;
2084 
2085  s = format (0, "SCRIPT: ipfix_dump ");
2086 
2087  FINISH;
2088 }
2089 
2090 static void *vl_api_get_next_index_t_print
2091  (vl_api_get_next_index_t * mp, void *handle)
2092 {
2093  u8 *s;
2094 
2095  s = format (0, "SCRIPT: get_next_index ");
2096  s = format (s, "node-name %s ", mp->node_name);
2097  s = format (s, "next-node-name %s ", mp->next_name);
2098 
2099  FINISH;
2100 }
2101 
2103  (vl_api_pg_create_interface_t * mp, void *handle)
2104 {
2105  u8 *s;
2106 
2107  s = format (0, "SCRIPT: pg_create_interface ");
2108  s = format (0, "if_id %d", ntohl (mp->interface_id));
2109 
2110  FINISH;
2111 }
2112 
2113 static void *vl_api_pg_capture_t_print
2114  (vl_api_pg_capture_t * mp, void *handle)
2115 {
2116  u8 *s;
2117 
2118  s = format (0, "SCRIPT: pg_capture ");
2119  s = format (0, "if_id %d ", ntohl (mp->interface_id));
2120  s = format (0, "pcap %s", mp->pcap_file_name);
2121  if (mp->count != ~0)
2122  s = format (s, "count %d ", ntohl (mp->count));
2123  if (!mp->is_enabled)
2124  s = format (s, "disable");
2125 
2126  FINISH;
2127 }
2128 
2130  (vl_api_pg_enable_disable_t * mp, void *handle)
2131 {
2132  u8 *s;
2133 
2134  s = format (0, "SCRIPT: pg_enable_disable ");
2135  if (ntohl (mp->stream_name_length) > 0)
2136  s = format (s, "stream %s", mp->stream_name);
2137  if (!mp->is_enabled)
2138  s = format (s, "disable");
2139 
2140  FINISH;
2141 }
2142 
2145 {
2146  u8 *s;
2147  int i;
2148 
2149  s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2150  if (mp->is_ipv6)
2151  s = format (s, "%U/%d ", format_ip6_address, mp->address,
2152  mp->mask_length);
2153  else
2154  s = format (s, "%U/%d ", format_ip4_address, mp->address,
2155  mp->mask_length);
2156 
2157  for (i = 0; i < mp->number_of_ranges; i++)
2158  {
2159  s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2160  }
2161 
2162  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
2163 
2164  if (mp->is_add == 0)
2165  s = format (s, "del ");
2166 
2167  FINISH;
2168 }
2169 
2172  void *handle)
2173 {
2174  u8 *s;
2175 
2176  s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2177 
2178  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2179 
2180  if (mp->tcp_out_vrf_id != ~0)
2181  s = format (s, "tcp-out-vrf %d ", ntohl (mp->tcp_out_vrf_id));
2182 
2183  if (mp->udp_out_vrf_id != ~0)
2184  s = format (s, "udp-out-vrf %d ", ntohl (mp->udp_out_vrf_id));
2185 
2186  if (mp->tcp_in_vrf_id != ~0)
2187  s = format (s, "tcp-in-vrf %d ", ntohl (mp->tcp_in_vrf_id));
2188 
2189  if (mp->udp_in_vrf_id != ~0)
2190  s = format (s, "udp-in-vrf %d ", ntohl (mp->udp_in_vrf_id));
2191 
2192  if (mp->is_add == 0)
2193  s = format (s, "del ");
2194 
2195  FINISH;
2196 }
2197 
2199  (vl_api_lisp_enable_disable_t * mp, void *handle)
2200 {
2201  u8 *s;
2202 
2203  s = format (0, "SCRIPT: lisp_enable_disable %s",
2204  mp->is_en ? "enable" : "disable");
2205 
2206  FINISH;
2207 }
2208 
2210  (vl_api_lisp_gpe_add_del_iface_t * mp, void *handle)
2211 {
2212  u8 *s;
2213 
2214  s = format (0, "SCRIPT: lisp_gpe_add_del_iface ");
2215 
2216  s = format (s, "%s ", mp->is_add ? "up" : "down");
2217  s = format (s, "vni %d ", mp->vni);
2218  s = format (s, "%s %d ", mp->is_l2 ? "bd_id" : "table_id", mp->dp_table);
2219 
2220  FINISH;
2221 }
2222 
2225 {
2226  u8 *s;
2227 
2228  s = format (0, "SCRIPT: lisp_pitr_set_locator_set ");
2229 
2230  if (mp->is_add)
2231  s = format (s, "locator-set %s ", mp->ls_name);
2232  else
2233  s = format (s, "del");
2234 
2235  FINISH;
2236 }
2237 
2238 static u8 *
2239 format_lisp_flat_eid (u8 * s, va_list * args)
2240 {
2241  u32 type = va_arg (*args, u32);
2242  u8 *eid = va_arg (*args, u8 *);
2243  u32 eid_len = va_arg (*args, u32);
2244 
2245  switch (type)
2246  {
2247  case 0:
2248  return format (s, "%U/%d", format_ip4_address, eid, eid_len);
2249  case 1:
2250  return format (s, "%U/%d", format_ip6_address, eid, eid_len);
2251  case 3:
2252  return format (s, "%U", format_ethernet_address, eid);
2253  }
2254  return 0;
2255 }
2256 
2257 static u8 *
2258 format_lisp_eid_vat (u8 * s, va_list * args)
2259 {
2260  u32 type = va_arg (*args, u32);
2261  u8 *eid = va_arg (*args, u8 *);
2262  u32 eid_len = va_arg (*args, u32);
2263  u8 *seid = va_arg (*args, u8 *);
2264  u32 seid_len = va_arg (*args, u32);
2265  u32 is_src_dst = va_arg (*args, u32);
2266 
2267  if (is_src_dst)
2268  s = format (s, "%U|", format_lisp_flat_eid, type, seid, seid_len);
2269 
2270  s = format (s, "%U", format_lisp_flat_eid, type, eid, eid_len);
2271 
2272  return s;
2273 }
2274 
2275 /** Used for transferring locators via VPP API */
2276 typedef CLIB_PACKED (struct
2277  {
2278  u8 is_ip4;
2279  /**< is locator an IPv4 address */
2280  u8 priority;
2281  /**< locator priority */
2282  u8 weight;
2283  /**< locator weight */
2284  u8 addr[16];
2285  /**< IPv4/IPv6 address */
2286  }) rloc_t;
2287 
2288 static u8 *
2289 format_rloc (u8 * s, va_list * args)
2290 {
2291  rloc_t *rloc = va_arg (*args, rloc_t *);
2292 
2293  if (rloc->is_ip4)
2294  s = format (s, "%U ", format_ip4_address, rloc->addr);
2295  else
2296  s = format (s, "%U ", format_ip6_address, rloc->addr);
2297 
2298  s = format (s, "p %d w %d", rloc->priority, rloc->weight);
2299 
2300  return s;
2301 }
2302 
2305 {
2306  u8 *s;
2307  u32 i, rloc_num = 0;
2308 
2309  s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
2310 
2311  if (mp->del_all)
2312  s = format (s, "del-all ");
2313 
2314  s = format (s, "%s ", mp->is_add ? "add" : "del");
2315  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2316 
2317  s = format (s, "deid %U ", format_lisp_eid_vat,
2318  mp->eid_type, mp->eid, mp->eid_len, mp->seid, mp->seid_len,
2319  mp->is_src_dst);
2320 
2321  rloc_num = clib_net_to_host_u32 (mp->rloc_num);
2322 
2323  if (0 == rloc_num)
2324  s = format (s, "action %d", mp->action);
2325  else
2326  {
2327  rloc_t *rloc = (rloc_t *) mp->rlocs;
2328  for (i = 0; i < rloc_num; i++)
2329  s = format (s, "%U ", format_rloc, &rloc[i]);
2330  }
2331 
2332  FINISH;
2333 }
2334 
2336  (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
2337 {
2338  u8 *s;
2339 
2340  s = format (0, "SCRIPT: lisp_add_del_adjacency ");
2341 
2342  s = format (s, "%s ", mp->is_add ? "add" : "del");
2343  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2344  s = format (s, "deid %U seid %U ",
2345  format_lisp_flat_eid, mp->eid_type, mp->deid, mp->deid_len,
2346  format_lisp_flat_eid, mp->eid_type, mp->seid, mp->seid_len);
2347 
2348  FINISH;
2349 }
2350 
2353 {
2354  u8 *s;
2355 
2356  s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
2357 
2358  if (mp->is_add)
2359  s = format (s, "%s", mp->locator_set_name);
2360  else
2361  s = format (s, "del");
2362 
2363  FINISH;
2364 }
2365 
2368 {
2369  u8 *s;
2370 
2371  s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
2372 
2373  if (!mp->is_add)
2374  s = format (s, "del ");
2375 
2376  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2377  s = format (s, "%s %d ",
2378  mp->is_l2 ? "bd_index" : "vrf",
2379  clib_net_to_host_u32 (mp->dp_table));
2380  FINISH;
2381 }
2382 
2384  (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
2385 {
2386  u8 *s;
2387 
2388  s = format (0, "SCRIPT: lisp_add_del_local_eid ");
2389 
2390  if (!mp->is_add)
2391  s = format (s, "del ");
2392 
2393  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
2394  s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
2395  mp->prefix_len);
2396  s = format (s, "locator-set %s ", mp->locator_set_name);
2397  FINISH;
2398 }
2399 
2402 {
2403  u8 *s;
2404 
2405  s = format (0, "SCRIPT: lisp_gpe_add_del_fwd_entry TODO");
2406 
2407  FINISH;
2408 }
2409 
2412 {
2413  u8 *s;
2414 
2415  s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
2416 
2417  if (!mp->is_add)
2418  s = format (s, "del ");
2419 
2420  if (mp->is_ipv6)
2421  s = format (s, "%U ", format_ip6_address, mp->ip_address);
2422  else
2423  s = format (s, "%U ", format_ip4_address, mp->ip_address);
2424 
2425  FINISH;
2426 }
2427 
2430 {
2431  u8 *s;
2432 
2433  s = format (0, "SCRIPT: lisp_gpe_enable_disable ");
2434 
2435  s = format (s, "%s ", mp->is_en ? "enable" : "disable");
2436 
2437  FINISH;
2438 }
2439 
2440 typedef CLIB_PACKED (struct
2441  {
2442  u32 sw_if_index;
2443  /**< locator sw_if_index */
2444  u8 priority;
2445  /**< locator priority */
2446  u8 weight;
2447  /**< locator weight */
2448  }) ls_locator_t;
2449 
2450 static u8 *
2451 format_locator (u8 * s, va_list * args)
2452 {
2453  ls_locator_t *l = va_arg (*args, ls_locator_t *);
2454 
2455  return format (s, "sw_if_index %d p %d w %d",
2456  l->sw_if_index, l->priority, l->weight);
2457 }
2458 
2461 {
2462  u8 *s;
2463  u32 loc_num = 0, i;
2464  ls_locator_t *locs;
2465 
2466  s = format (0, "SCRIPT: lisp_add_del_locator_set ");
2467 
2468  if (!mp->is_add)
2469  s = format (s, "del ");
2470 
2471  s = format (s, "locator-set %s ", mp->locator_set_name);
2472 
2473  loc_num = clib_net_to_host_u32 (mp->locator_num);
2474  locs = (ls_locator_t *) mp->locators;
2475 
2476  for (i = 0; i < loc_num; i++)
2477  s = format (s, "%U ", format_locator, &locs[i]);
2478 
2479  FINISH;
2480 }
2481 
2483  (vl_api_lisp_add_del_locator_t * mp, void *handle)
2484 {
2485  u8 *s;
2486 
2487  s = format (0, "SCRIPT: lisp_add_del_locator ");
2488 
2489  if (!mp->is_add)
2490  s = format (s, "del ");
2491 
2492  s = format (s, "locator-set %s ", mp->locator_set_name);
2493  s = format (s, "sw_if_index %d ", mp->sw_if_index);
2494  s = format (s, "p %d w %d ", mp->priority, mp->weight);
2495 
2496  FINISH;
2497 }
2498 
2500  (vl_api_lisp_locator_set_dump_t * mp, void *handle)
2501 {
2502  u8 *s;
2503 
2504  s = format (0, "SCRIPT: lisp_locator_set_dump ");
2505 
2506  /* not possible to reconstruct original VAT command */
2507 
2508  FINISH;
2509 }
2510 
2512  (vl_api_lisp_eid_table_dump_t * mp, void *handle)
2513 {
2514  u8 *s;
2515 
2516  s = format (0, "SCRIPT: lisp_eid_table_dump ");
2517 
2518  if (mp->eid_set)
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,
2522  mp->eid, mp->prefix_length);
2523  switch (mp->filter)
2524  {
2525  case 1:
2526  s = format (s, "local ");
2527  break;
2528  case 2:
2529  s = format (s, "remote ");
2530  break;
2531  }
2532  }
2533 
2534  FINISH;
2535 }
2536 
2539 {
2540  u8 *s;
2541 
2542  s = format (0, "SCRIPT: ipsec_gre_add_del_tunnel ");
2543 
2544  s = format (s, "dst %U ", format_ip4_address,
2545  (ip4_address_t *) & (mp->dst_address));
2546 
2547  s = format (s, "src %U ", format_ip4_address,
2548  (ip4_address_t *) & (mp->src_address));
2549 
2550  s = format (s, "local_sa %d ", ntohl (mp->local_sa_id));
2551 
2552  s = format (s, "remote_sa %d ", ntohl (mp->remote_sa_id));
2553 
2554  if (mp->is_add == 0)
2555  s = format (s, "del ");
2556 
2557  FINISH;
2558 }
2559 
2561  (vl_api_ipsec_gre_tunnel_dump_t * mp, void *handle)
2562 {
2563  u8 *s;
2564 
2565  s = format (0, "SCRIPT: ipsec_gre_tunnel_dump ");
2566 
2567  if (mp->sw_if_index != ~0)
2568  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2569 
2570  FINISH;
2571 }
2572 
2573 #define foreach_custom_print_no_arg_function \
2574 _(lisp_eid_table_map_dump) \
2575 _(lisp_map_resolver_dump) \
2576 _(lisp_gpe_tunnel_dump)
2577 
2578 #define _(f) \
2579 static void * vl_api_ ## f ## _t_print \
2580  (vl_api_ ## f ## _t * mp, void * handle) \
2581 { \
2582  u8 * s; \
2583  s = format (0, "SCRIPT: " #f ); \
2584  FINISH; \
2585 }
2587 #undef _
2588 #define foreach_custom_print_function \
2589 _(CREATE_LOOPBACK, create_loopback) \
2590 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
2591 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
2592 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
2593 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
2594 _(TAP_CONNECT, tap_connect) \
2595 _(TAP_MODIFY, tap_modify) \
2596 _(TAP_DELETE, tap_delete) \
2597 _(SW_INTERFACE_TAP_DUMP, sw_interface_tap_dump) \
2598 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \
2599 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
2600 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
2601 _(MPLS_ADD_DEL_DECAP, mpls_add_del_decap) \
2602 _(MPLS_ADD_DEL_ENCAP, mpls_add_del_encap) \
2603 _(MPLS_GRE_ADD_DEL_TUNNEL, mpls_gre_add_del_tunnel) \
2604 _(MPLS_ETHERNET_ADD_DEL_TUNNEL, mpls_ethernet_add_del_tunnel) \
2605 _(MPLS_ETHERNET_ADD_DEL_TUNNEL_2, mpls_ethernet_add_del_tunnel_2) \
2606 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
2607 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
2608 _(RESET_VRF, reset_vrf) \
2609 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
2610 _(CREATE_SUBIF, create_subif) \
2611 _(OAM_ADD_DEL, oam_add_del) \
2612 _(RESET_FIB, reset_fib) \
2613 _(DHCP_PROXY_CONFIG, dhcp_proxy_config) \
2614 _(DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss) \
2615 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
2616 _(SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS, \
2617  sw_interface_ip6_set_link_local_address) \
2618 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \
2619 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \
2620 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
2621 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
2622 _(SR_TUNNEL_ADD_DEL, sr_tunnel_add_del) \
2623 _(SR_POLICY_ADD_DEL, sr_policy_add_del) \
2624 _(SR_MULTICAST_MAP_ADD_DEL, sr_multicast_map_add_del) \
2625 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
2626 _(L2FIB_ADD_DEL, l2fib_add_del) \
2627 _(L2_FLAGS, l2_flags) \
2628 _(BRIDGE_FLAGS, bridge_flags) \
2629 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
2630 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
2631 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
2632 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
2633 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
2634 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
2635 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
2636 _(ADD_NODE_NEXT, add_node_next) \
2637 _(DHCP_PROXY_CONFIG_2, dhcp_proxy_config_2) \
2638 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \
2639 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \
2640 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \
2641 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \
2642 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
2643 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
2644 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
2645 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
2646 _(GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel) \
2647 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
2648 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
2649 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
2650 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
2651 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
2652 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
2653 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
2654 _(SW_INTERFACE_DUMP, sw_interface_dump) \
2655 _(CONTROL_PING, control_ping) \
2656 _(WANT_INTERFACE_EVENTS, want_interface_events) \
2657 _(CLI_REQUEST, cli_request) \
2658 _(MEMCLNT_CREATE, memclnt_create) \
2659 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
2660 _(SHOW_VERSION, show_version) \
2661 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
2662 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
2663 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
2664 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
2665 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
2666 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
2667 _(IP_ADDRESS_DUMP, ip_address_dump) \
2668 _(IP_DUMP, ip_dump) \
2669 _(DELETE_LOOPBACK, delete_loopback) \
2670 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
2671 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
2672 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
2673 _(AF_PACKET_CREATE, af_packet_create) \
2674 _(AF_PACKET_DELETE, af_packet_delete) \
2675 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
2676 _(MPLS_GRE_TUNNEL_DUMP, mpls_gre_tunnel_dump) \
2677 _(MPLS_ETH_TUNNEL_DUMP, mpls_eth_tunnel_dump) \
2678 _(MPLS_FIB_ENCAP_DUMP, mpls_fib_encap_dump) \
2679 _(MPLS_FIB_DECAP_DUMP, mpls_fib_decap_dump) \
2680 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
2681 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
2682 _(CLASSIFY_TABLE_INFO,classify_table_info) \
2683 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
2684 _(IPFIX_ENABLE,ipfix_enable) \
2685 _(IPFIX_DUMP,ipfix_dump) \
2686 _(GET_NEXT_INDEX, get_next_index) \
2687 _(PG_CREATE_INTERFACE,pg_create_interface) \
2688 _(PG_CAPTURE, pg_capture) \
2689 _(PG_ENABLE_DISABLE, pg_enable_disable) \
2690 _(POLICER_ADD_DEL, policer_add_del) \
2691 _(POLICER_DUMP, policer_dump) \
2692 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
2693 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
2694 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
2695  ip_source_and_port_range_check_add_del) \
2696 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
2697  ip_source_and_port_range_check_interface_add_del) \
2698 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
2699 _(LISP_GPE_ENABLE_DISABLE, lisp_gpe_enable_disable) \
2700 _(LISP_GPE_ADD_DEL_IFACE, lisp_gpe_add_del_iface) \
2701 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
2702 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
2703 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
2704 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
2705  lisp_add_del_map_request_itr_rlocs) \
2706 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
2707 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
2708 _(LISP_GPE_ADD_DEL_FWD_ENTRY, lisp_gpe_add_del_fwd_entry) \
2709 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
2710 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
2711 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
2712 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
2713 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
2714 _(LISP_GPE_TUNNEL_DUMP, lisp_gpe_tunnel_dump) \
2715 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
2716 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
2717 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
2718 _(IPSEC_GRE_ADD_DEL_TUNNEL, ipsec_gre_add_del_tunnel) \
2719 _(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump)
2720  void
2722 {
2723 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
2724  = (void *) vl_api_##f##_t_print;
2726 #undef _
2727 }
2728 
2729 /*
2730  * fd.io coding-style-patch-verification: ON
2731  *
2732  * Local Variables:
2733  * eval: (c-set-style "gnu")
2734  * End:
2735  */
format_function_t format_ip46_address
Definition: format.h:54
static void * vl_api_sw_interface_set_flags_t_print(vl_api_sw_interface_set_flags_t *mp, void *handle)
Definition: custom_dump.c:86
static void * vl_api_create_vhost_user_if_t_print(vl_api_create_vhost_user_if_t *mp, void *handle)
Definition: custom_dump.c:1502
static u8 * format_lisp_flat_eid(u8 *s, va_list *args)
Definition: custom_dump.c:2239
static void * vl_api_bridge_domain_add_del_t_print(vl_api_bridge_domain_add_del_t *mp, void *handle)
Definition: custom_dump.c:205
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:1257
static void * vl_api_lisp_add_del_adjacency_t_print(vl_api_lisp_add_del_adjacency_t *mp, void *handle)
Definition: custom_dump.c:2336
static void * vl_api_lisp_gpe_add_del_fwd_entry_t_print(vl_api_lisp_gpe_add_del_fwd_entry_t *mp, void *handle)
Definition: custom_dump.c:2401
Get list of policers.
Definition: vpe.api:4071
DHCP Proxy set / unset vss request.
Definition: vpe.api:859
Proxy ARP add / del request.
Definition: vpe.api:512
Classify get table IDs request.
Definition: vpe.api:4397
Dump mpls gre tunnel table.
Definition: vpe.api:4251
Reset VRF (remove all routes etc) request.
Definition: vpe.api:598
Add / del ipsec gre tunnel request.
Definition: vpe.api:4757
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:2224
L2 FIB add entry request.
Definition: vpe.api:1507
cop: enable/disable whitelist filtration features on an interface Note: the supplied fib_id must matc...
Definition: vpe.api:3801
static void * vl_api_sr_tunnel_add_del_t_print(vl_api_sr_tunnel_add_del_t *mp, void *handle)
Definition: custom_dump.c:1042
static void * vl_api_l2tpv3_set_tunnel_cookies_t_print(vl_api_l2tpv3_set_tunnel_cookies_t *mp, void *handle)
Definition: custom_dump.c:1306
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:1367
sll srl srl sll sra u16x4 i
Definition: vector_sse2.h:343
static void * vl_api_ipfix_enable_t_print(vl_api_ipfix_enable_t *mp, void *handle)
Definition: custom_dump.c:2062
static void * vl_api_l2_patch_add_del_t_print(vl_api_l2_patch_add_del_t *mp, void *handle)
Definition: custom_dump.c:1025
static void * vl_api_lisp_locator_set_dump_t_print(vl_api_lisp_locator_set_dump_t *mp, void *handle)
Definition: custom_dump.c:2500
static void * vl_api_delete_loopback_t_print(vl_api_delete_loopback_t *mp, void *handle)
Definition: custom_dump.c:75
static void * vl_api_reset_vrf_t_print(vl_api_reset_vrf_t *mp, void *handle)
Definition: custom_dump.c:669
Reset fib table request.
Definition: vpe.api:800
static void * vl_api_ipfix_dump_t_print(vl_api_ipfix_dump_t *mp, void *handle)
Definition: custom_dump.c:2081
#define IP6_SR_HEADER_FLAG_PL_ELT_EGRESS_PE
Flag bits.
Definition: sr_packet.h:211
#define foreach_create_subif_bit
Definition: custom_dump.c:700
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:912
static void * vl_api_reset_fib_t_print(vl_api_reset_fib_t *mp, void *handle)
Definition: custom_dump.c:756
add or delete lisp gpe tunnel
Definition: vpe.api:2456
static void * vl_api_lisp_add_del_locator_t_print(vl_api_lisp_add_del_locator_t *mp, void *handle)
Definition: custom_dump.c:2483
format_function_t format_ip6_address
Definition: format.h:87
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
#define IP6_SR_HEADER_FLAG_PROTECTED
Flag bits.
Definition: sr_packet.h:203
Set/unset policer classify interface.
Definition: vpe.api:4148
configure or disable LISP PITR node
Definition: vpe.api:2585
Set flags on the interface.
Definition: vpe.api:130
Control ping from client to api server request.
Definition: vpe.api:1131
static void * vl_api_interface_name_renumber_t_print(vl_api_interface_name_renumber_t *mp, void *handle)
Definition: custom_dump.c:1673
static void * vl_api_sr_multicast_map_add_del_t_print(vl_api_sr_multicast_map_add_del_t *mp, void *handle)
Definition: custom_dump.c:1157
static void * vl_api_add_node_next_t_print(vl_api_add_node_next_t *mp, void *handle)
Definition: custom_dump.c:1272
static void * vl_api_l2_fib_clear_table_t_print(vl_api_l2_fib_clear_table_t *mp, void *handle)
Definition: custom_dump.c:1460
#define L2_FLOOD
Definition: l2_bd.h:98
Set max allowed ARP or ip6 neighbor entries request.
Definition: vpe.api:1205
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:2367
static void * vl_api_tap_modify_t_print(vl_api_tap_modify_t *mp, void *handle)
Definition: custom_dump.c:356
static void * vl_api_input_acl_set_interface_t_print(vl_api_input_acl_set_interface_t *mp, void *handle)
Definition: custom_dump.c:1702
#define L2_FWD
Definition: l2_bd.h:97
VXLAN GPE definitions.
static void * vl_api_control_ping_t_print(vl_api_control_ping_t *mp, void *handle)
Definition: custom_dump.c:1583
static void * vl_api_ip_add_del_route_t_print(vl_api_ip_add_del_route_t *mp, void *handle)
Definition: custom_dump.c:398
Add / del gre tunnel request.
Definition: vpe.api:416
u8 tap_name[64]
Definition: vpe.api:262
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:2460
Classify add / del session request.
Definition: vpe.api:1669
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:482
static void * vl_api_bridge_domain_dump_t_print(vl_api_bridge_domain_dump_t *mp, void *handle)
Definition: custom_dump.c:226
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:1486
Dump tap interfaces request.
Definition: vpe.api:303
static void * vl_api_want_interface_events_t_print(vl_api_want_interface_events_t *mp, void *handle)
Definition: custom_dump.c:1593
static void * vl_api_sw_interface_clear_stats_t_print(vl_api_sw_interface_clear_stats_t *mp, void *handle)
Definition: custom_dump.c:1960
static void * vl_api_gre_add_del_tunnel_t_print(vl_api_gre_add_del_tunnel_t *mp, void *handle)
Definition: custom_dump.c:1424
Add/Delete classification table request.
Definition: vpe.api:1628
IPv6 router advertisement config request.
Definition: vpe.api:933
L2 bridge domain request operational state details.
Definition: vpe.api:3095
IPFIX dump request.
Definition: vpe.api:4553
static void * vl_api_tap_delete_t_print(vl_api_tap_delete_t *mp, void *handle)
Definition: custom_dump.c:376
Enable / disable packet generator request.
Definition: vpe.api:4663
static void * vl_api_ipsec_gre_tunnel_dump_t_print(vl_api_ipsec_gre_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:2561
static void * vl_api_classify_add_del_table_t_print(vl_api_classify_add_del_table_t *mp, void *handle)
Definition: custom_dump.c:1180
static void * vl_api_dhcp_proxy_set_vss_t_print(vl_api_dhcp_proxy_set_vss_t *mp, void *handle)
Definition: custom_dump.c:835
vhost-user interface create request
Definition: vpe.api:2091
static void * vl_api_mpls_ethernet_add_del_tunnel_t_print(vl_api_mpls_ethernet_add_del_tunnel_t *mp, void *handle)
Definition: custom_dump.c:562
format_function_t format_ip4_address
Definition: format.h:71
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:1634
static void * vl_api_bridge_flags_t_print(vl_api_bridge_flags_t *mp, void *handle)
Definition: custom_dump.c:288
static void * vl_api_l2tpv3_interface_enable_disable_t_print(vl_api_l2tpv3_interface_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:1324
add or delete gpe_iface
Definition: vpe.api:2559
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:476
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:166
static void * vl_api_proxy_arp_add_del_t_print(vl_api_proxy_arp_add_del_t *mp, void *handle)
Definition: custom_dump.c:457
static void * vl_api_ip_dump_t_print(vl_api_ip_dump_t *mp, void *handle)
Definition: custom_dump.c:1732
static void * vl_api_l2fib_add_del_t_print(vl_api_l2fib_add_del_t *mp, void *handle)
Definition: custom_dump.c:240
static void * vl_api_l2_flags_t_print(vl_api_l2_flags_t *mp, void *handle)
Definition: custom_dump.c:270
static void * vl_api_create_vlan_subif_t_print(vl_api_create_vlan_subif_t *mp, void *handle)
Definition: custom_dump.c:685
static void * vl_api_lisp_enable_disable_t_print(vl_api_lisp_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2199
static void * vl_api_oam_add_del_t_print(vl_api_oam_add_del_t *mp, void *handle)
Definition: custom_dump.c:736
Dump ipsec gre tunnel table.
Definition: vpe.api:4783
add or delete LISP adjacency adjacency
Definition: vpe.api:2660
u8 pcap_file_name[pcap_name_length]
Definition: vpe.api:4644
PacketGenerator capture packets on given interface request.
Definition: vpe.api:4636
u8 mac_address[6]
Definition: vpe.api:263
static void * vl_api_vxlan_gpe_tunnel_dump_t_print(vl_api_vxlan_gpe_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1661
u8 * format_ethernet_address(u8 *s, va_list *args)
Definition: format.c:44
Proxy ARP add / del request.
Definition: vpe.api:538
Clear interface statistics.
Definition: vpe.api:3856
static void * vl_api_memclnt_create_t_print(vl_api_memclnt_create_t *mp, void *handle)
Definition: custom_dump.c:1614
static void * vl_api_l2tpv3_set_lookup_key_t_print(vl_api_l2tpv3_set_lookup_key_t *mp, void *handle)
Definition: custom_dump.c:1339
static void * vl_api_dhcp_proxy_config_t_print(vl_api_dhcp_proxy_config_t *mp, void *handle)
Definition: custom_dump.c:772
DHCP Proxy config 2 add / del request.
Definition: vpe.api:1807
Classify sessions dump request.
Definition: vpe.api:4490
static u8 * format_policer_action(u8 *s, va_list *va)
Definition: custom_dump.c:1802
Set interface source and L4 port-range request.
Definition: vpe.api:4726
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:2091
u32 feature_bitmap
Definition: vpe.api:1543
static void * vl_api_ip_address_dump_t_print(vl_api_ip_address_dump_t *mp, void *handle)
Definition: custom_dump.c:1720
#define L2_UU_FLOOD
Definition: l2_bd.h:99
static void * vl_api_policer_dump_t_print(vl_api_policer_dump_t *mp, void *handle)
Definition: custom_dump.c:1905
add or delete map request itr rlocs
Definition: vpe.api:2689
#define clib_warning(format, args...)
Definition: error.h:59
Delete host-interface.
Definition: vpe.api:3992
Set/unset input ACL interface.
Definition: vpe.api:3179
Dump mpls fib decap table.
Definition: vpe.api:4363
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
Definition: vec.h:201
static void * vl_api_lisp_eid_table_dump_t_print(vl_api_lisp_eid_table_dump_t *mp, void *handle)
Definition: custom_dump.c:2512
static void * vl_api_sw_interface_set_table_t_print(vl_api_sw_interface_set_table_t *mp, void *handle)
Definition: custom_dump.c:131
Initialize a new tap interface with the given paramters.
Definition: vpe.api:225
u8 collector_address[16]
Definition: vpe.api:4532
static void * vl_api_sw_interface_set_unnumbered_t_print(vl_api_sw_interface_set_unnumbered_t *mp, void *handle)
Definition: custom_dump.c:617
#define IP6_SR_HEADER_FLAG_CLEANUP
Flag bits.
Definition: sr_packet.h:201
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:2144
Dump l2 fib (aka bridge domain) table.
Definition: vpe.api:2296
Configure IP source and L4 port-range check.
Definition: vpe.api:4695
Delete tap interface.
Definition: vpe.api:285
Set L2 flags request !!! TODO - need more info, feature bits in l2_input.h.
Definition: vpe.api:1537
static u8 * format_lisp_eid_vat(u8 *s, va_list *args)
Definition: custom_dump.c:2258
L2 fib clear table request, clear all mac entries in the l2 fib.
Definition: vpe.api:1912
static void * vl_api_pg_create_interface_t_print(vl_api_pg_create_interface_t *mp, void *handle)
Definition: custom_dump.c:2103
static void * vl_api_sw_interface_set_vpath_t_print(vl_api_sw_interface_set_vpath_t *mp, void *handle)
Definition: custom_dump.c:149
The Segment Routing Header (SRH).
IPv6 segment routing tunnel add / del request.
Definition: vpe.api:1265
IPv6 segment routing multicast map to policy add / del request.
Definition: vpe.api:1326
Set/unset l2 classification tables for an interface request.
Definition: vpe.api:1725
static void * vl_api_mpls_gre_tunnel_dump_t_print(vl_api_mpls_gre_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1972
Set bridge domain ip to mac entry request.
Definition: vpe.api:1595
u8 stream_name[stream_name_length]
Definition: vpe.api:4669
add or delete lisp eid-table
Definition: vpe.api:2415
static void * vl_api_gre_tunnel_dump_t_print(vl_api_gre_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1448
static void * vl_api_classify_add_del_session_t_print(vl_api_classify_add_del_session_t *mp, void *handle)
Definition: custom_dump.c:1210
static void * vl_api_ip_neighbor_add_del_t_print(vl_api_ip_neighbor_add_del_t *mp, void *handle)
Definition: custom_dump.c:634
static void * vl_api_cop_whitelist_enable_disable_t_print(vl_api_cop_whitelist_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:1758
MPLS Ethernet add/ del tunnel 2.
Definition: vpe.api:1415
static void * vl_api_lisp_gpe_add_del_iface_t_print(vl_api_lisp_gpe_add_del_iface_t *mp, void *handle)
Definition: custom_dump.c:2210
static void * vl_api_af_packet_delete_t_print(vl_api_af_packet_delete_t *mp, void *handle)
Definition: custom_dump.c:1791
static void * vl_api_lisp_gpe_enable_disable_t_print(vl_api_lisp_gpe_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2429
static void * vl_api_pg_enable_disable_t_print(vl_api_pg_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2130
Set or delete one or all ip addresses on a specified interface.
Definition: vpe.api:170
static void * vl_api_af_packet_create_t_print(vl_api_af_packet_create_t *mp, void *handle)
Definition: custom_dump.c:1776
Call from VLIB_INIT_FUNCTION to set the Linux kernel inject node name.
static void * vl_api_mpls_fib_decap_dump_t_print(vl_api_mpls_fib_decap_dump_t *mp, void *handle)
Definition: custom_dump.c:2006
Classify table info.
Definition: vpe.api:4451
static void * vl_api_modify_vhost_user_if_t_print(vl_api_modify_vhost_user_if_t *mp, void *handle)
Definition: custom_dump.c:1518
static void * vl_api_classify_table_by_interface_t_print(vl_api_classify_table_by_interface_t *mp, void *handle)
Definition: custom_dump.c:2026
static void * vl_api_show_version_t_print(vl_api_show_version_t *mp, void *handle)
Definition: custom_dump.c:1624
static void * vl_api_set_ip_flow_hash_t_print(vl_api_set_ip_flow_hash_t *mp, void *handle)
Definition: custom_dump.c:879
Enable and configure IPFIX exporter process request.
Definition: vpe.api:4528
PacketGenerator create interface request.
Definition: vpe.api:4610
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:2411
Set the ip flow hash config for a fib request.
Definition: vpe.api:892
static void * vl_api_create_loopback_t_print(vl_api_create_loopback_t *mp, void *handle)
Definition: custom_dump.c:64
enable or disable LISP feature
Definition: vpe.api:2537
Create host-interface.
Definition: vpe.api:3966
static void * vl_api_policer_add_del_t_print(vl_api_policer_add_del_t *mp, void *handle)
Definition: custom_dump.c:1830
static void * vl_api_mpls_add_del_encap_t_print(vl_api_mpls_add_del_encap_t *mp, void *handle)
Definition: custom_dump.c:514
static void * vl_api_dhcp_proxy_config_2_t_print(vl_api_dhcp_proxy_config_2_t *mp, void *handle)
Definition: custom_dump.c:803
cop: enable/disable junk filtration features on an interface
Definition: vpe.api:3770
static void * vl_api_cop_interface_enable_disable_t_print(vl_api_cop_interface_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:1743
Set/unset the classification table for an interface request.
Definition: vpe.api:1698
Dump mpls fib table.
Definition: vpe.api:4333
static void * vl_api_policer_classify_dump_t_print(vl_api_policer_classify_dump_t *mp, void *handle)
Definition: custom_dump.c:1936
#define FINISH
Definition: custom_dump.c:56
#define IP6_SR_HEADER_FLAG_PL_ELT_ORIG_SRC_ADDR
Flag bits.
Definition: sr_packet.h:213
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:2171
#define IP6_SR_HEADER_FLAG_PL_ELT_NOT_PRESENT
Flag bits.
Definition: sr_packet.h:207
add or delete map-resolver
Definition: vpe.api:2491
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:2538
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:2384
void vl_msg_api_custom_dump_configure(api_main_t *am)
Definition: custom_dump.c:2721
Delete loopback interface request.
Definition: vpe.api:1110
vhost-user interface modify request
Definition: vpe.api:2120
Register for interface events.
Definition: vpe.api:30
Set L2 XConnect between two interfaces request.
Definition: vpe.api:1448
IP neighbor add / del request.
Definition: vpe.api:568
static void * vl_api_create_subif_t_print(vl_api_create_subif_t *mp, void *handle)
Definition: custom_dump.c:711
unsigned int u32
Definition: types.h:88
Request for eid table summary status.
Definition: vpe.api:2849
static void * vl_api_dhcp_client_config_t_print(vl_api_dhcp_client_config_t *mp, void *handle)
Definition: custom_dump.c:857
Request for locator_set summary status.
Definition: vpe.api:2794
Get list of policer classify interfaces and tables.
Definition: vpe.api:4174
map/unmap vni/bd_index to vrf
Definition: vpe.api:2715
static void * vl_api_vxlan_add_del_tunnel_t_print(vl_api_vxlan_add_del_tunnel_t *mp, void *handle)
Definition: custom_dump.c:1377
u8 * format(u8 *s, char *fmt,...)
Definition: format.c:418
IPv6 router advertisement prefix config request.
Definition: vpe.api:978
Set the next node for a given node request.
Definition: vpe.api:1776
Query relative index via node names.
Definition: vpe.api:4585
static void * vl_api_classify_session_dump_t_print(vl_api_classify_session_dump_t *mp, void *handle)
Definition: custom_dump.c:2050
show version
Definition: vpe.api:2192
add or delete locator_set
Definition: vpe.api:2352
#define foreach_custom_print_function
Definition: custom_dump.c:2588
OAM add / del target request.
Definition: vpe.api:774
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:2352
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:107
#define IP6_SR_HEADER_FLAG_PL_ELT_INGRESS_PE
Flag bits.
Definition: sr_packet.h:209
Classify table ids by interface index request.
Definition: vpe.api:4421
typedef CLIB_PACKED(struct{u8 is_ip4;u8 priority;u8 weight;u8 addr[16];})
Used for transferring locators via VPP API.
Definition: custom_dump.c:2276
static void * vl_api_set_arp_neighbor_limit_t_print(vl_api_set_arp_neighbor_limit_t *mp, void *handle)
Definition: custom_dump.c:1010
static void * vl_api_want_ip4_arp_events_t_print(vl_api_want_ip4_arp_events_t *mp, void *handle)
Definition: custom_dump.c:1688
static void * vl_api_mpls_add_del_decap_t_print(vl_api_mpls_add_del_decap_t *mp, void *handle)
Definition: custom_dump.c:490
static void * vl_api_tap_connect_t_print(vl_api_tap_connect_t *mp, void *handle)
Definition: custom_dump.c:337
Add / del route request.
Definition: vpe.api:368
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:1241
static void * vl_api_classify_table_ids_t_print(vl_api_classify_table_ids_t *mp, void *handle)
Definition: custom_dump.c:2016
Interface bridge mode request.
Definition: vpe.api:1476
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:1470
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:315
static void * vl_api_sr_policy_add_del_t_print(vl_api_sr_policy_add_del_t *mp, void *handle)
Definition: custom_dump.c:1117
static void * vl_api_mpls_gre_add_del_tunnel_t_print(vl_api_mpls_gre_add_del_tunnel_t *mp, void *handle)
Definition: custom_dump.c:535
static void * vl_api_pg_capture_t_print(vl_api_pg_capture_t *mp, void *handle)
Definition: custom_dump.c:2114
unsigned char u8
Definition: types.h:56
static void * vl_api_delete_vhost_user_if_t_print(vl_api_delete_vhost_user_if_t *mp, void *handle)
Definition: custom_dump.c:1535
#define L2_ARP_TERM
Definition: l2_bd.h:100
Process a vpe parser cli string request.
Definition: vpe.api:1180
add or delete locator for locator_set
Definition: vpe.api:2381
static void * vl_api_mpls_fib_encap_dump_t_print(vl_api_mpls_fib_encap_dump_t *mp, void *handle)
Definition: custom_dump.c:1996
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:2304
L2 interface ethernet flow point filtering enable/disable request.
Definition: vpe.api:1934
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:185
static void * vl_api_mpls_ethernet_add_del_tunnel_2_t_print(vl_api_mpls_ethernet_add_del_tunnel_2_t *mp, void *handle)
Definition: custom_dump.c:587
Create loopback interface request.
Definition: vpe.api:1086
Set unnumbered interface add / del request.
Definition: vpe.api:1062
add or delete remote static mapping
Definition: vpe.api:2620
L2 interface vlan tag rewrite configure request.
Definition: vpe.api:2063
Add / del MPLS decapsulation request.
Definition: vpe.api:482
Create a new subinterface with the given vlan id.
Definition: vpe.api:326
L2 interface patch add / del request.
Definition: vpe.api:1230
Interface set vpath request.
Definition: vpe.api:1351
static void * vl_api_sw_interface_tap_dump_t_print(vl_api_sw_interface_tap_dump_t *mp, void *handle)
Definition: custom_dump.c:387
Modify a tap interface with the given paramters.
Definition: vpe.api:256
Add/del policer.
Definition: vpe.api:4030
static void * vl_api_l2_fib_table_dump_t_print(vl_api_l2_fib_table_dump_t *mp, void *handle)
Definition: custom_dump.c:1571
static void * vl_api_cli_request_t_print(vl_api_cli_request_t *mp, void *handle)
Definition: custom_dump.c:1604
Register for ip4 arp resolution events.
Definition: vpe.api:3019
static void * vl_api_sw_interface_dump_t_print(vl_api_sw_interface_dump_t *mp, void *handle)
Definition: custom_dump.c:1556
Set bridge flags (such as L2_LEARN, L2_FWD, L2_FLOOD, L2_UU_FLOOD, or L2_ARP_TERM) request...
Definition: vpe.api:1565
enable or disable lisp-gpe protocol
Definition: vpe.api:2515
vhost_vring_addr_t addr
Definition: vhost-user.h:82
static void * vl_api_mpls_eth_tunnel_dump_t_print(vl_api_mpls_eth_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1984
vhost-user interface delete request
Definition: vpe.api:2144
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:964
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:1284
MPLS Ethernet add / del tunnel request.
Definition: vpe.api:1379
l2tpv3 tunnel interface create request
Definition: vpe.api:1842
#define foreach_custom_print_no_arg_function
Definition: custom_dump.c:2573
#define L2_LEARN
Definition: l2_bd.h:96
Associate the specified interface with a fib table.
Definition: vpe.api:199
Dump mpls eth tunnel table.
Definition: vpe.api:4293
Add / del MPLS encapsulation request.
Definition: vpe.api:450
DHCP Client config add / del request.
Definition: vpe.api:3147
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:927
static void * vl_api_policer_classify_set_interface_t_print(vl_api_policer_classify_set_interface_t *mp, void *handle)
Definition: custom_dump.c:1917
static void * vl_api_vxlan_tunnel_dump_t_print(vl_api_vxlan_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1412
static int ip6_sr_policy_list_flags(u16 flags_host_byte_order, int pl_index)
pl_index is one-origined
Definition: sr_packet.h:230
DHCP Proxy config add / del request.
Definition: vpe.api:828
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:1546
static void * vl_api_classify_table_info_t_print(vl_api_classify_table_info_t *mp, void *handle)
Definition: custom_dump.c:2038
L2 bridge domain add or delete request.
Definition: vpe.api:3067
IPv6 segment routing policy add / del request.
Definition: vpe.api:1300