FD.io VPP  v19.04.4-rc0-5-ge88582fac
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. Licensed under the
6  * Apache License, Version 2.0 (the "License"); you may not use this file
7  * except in compliance with the License. You may obtain a copy of the
8  * 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, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  * ------------------------------------------------------------------
18  */
19 
20 #include <vnet/vnet.h>
21 #include <vnet/ip/ip.h>
22 #include <vnet/ip/ip_neighbor.h>
23 #include <vnet/ip/ip_types_api.h>
24 #include <vnet/unix/tuntap.h>
25 #include <vnet/mpls/mpls.h>
26 #include <vnet/dhcp/dhcp_proxy.h>
27 #include <vnet/l2tp/l2tp.h>
28 #include <vnet/l2/l2_input.h>
29 #include <vnet/srv6/sr.h>
30 #include <vnet/srmpls/sr_mpls.h>
31 #include <vnet/gre/gre.h>
33 #include <vnet/geneve/geneve.h>
35 #include <vnet/policer/xlate.h>
36 #include <vnet/policer/policer.h>
38 #include <vlib/vlib.h>
39 #include <vlib/pci/pci.h>
40 #include <vlib/unix/unix.h>
41 #include <vlibapi/api.h>
42 #include <vlibmemory/api.h>
44 #include <vnet/qos/qos_types.h>
45 #include <vpp/oam/oam.h>
46 
47 #include <vnet/ethernet/ethernet.h>
49 #include <vnet/l2/l2_vtr.h>
50 
51 #include <vpp/api/vpe_msg_enum.h>
52 #include <vpp/api/types.h>
53 
54 #include <vnet/bonding/node.h>
55 
56 #define vl_typedefs /* define message structures */
57 #include <vpp/api/vpe_all_api_h.h>
58 #undef vl_typedefs
59 
60 #define vl_endianfun /* define message structures */
61 #include <vpp/api/vpe_all_api_h.h>
62 #undef vl_endianfun
63 
64 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
65 
66 #define FINISH \
67  vec_add1 (s, 0); \
68  vl_print (handle, (char *)s); \
69  vec_free (s); \
70  return handle;
71 
72 
74  (vl_api_create_loopback_t * mp, void *handle)
75 {
76  u8 *s;
77 
78  s = format (0, "SCRIPT: create_loopback ");
79  s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
80 
81  FINISH;
82 }
83 
85  (vl_api_create_loopback_instance_t * mp, void *handle)
86 {
87  u8 *s;
88 
89  s = format (0, "SCRIPT: create_loopback ");
90  s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address);
91  s = format (s, "instance %d ", ntohl (mp->user_instance));
92 
93  FINISH;
94 }
95 
97  (vl_api_delete_loopback_t * mp, void *handle)
98 {
99  u8 *s;
100 
101  s = format (0, "SCRIPT: delete_loopback ");
102  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
103 
104  FINISH;
105 }
106 
108  (vl_api_sw_interface_set_flags_t * mp, void *handle)
109 {
110  u8 *s;
111  s = format (0, "SCRIPT: sw_interface_set_flags ");
112 
113  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
114 
115  if (mp->admin_up_down)
116  s = format (s, "admin-up ");
117  else
118  s = format (s, "admin-down ");
119 
120  FINISH;
121 }
122 
125 {
126  u8 *s;
127  s = format (0, "SCRIPT: sw_interface_set_rx_placement ");
128 
129  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
130 
131  s = format (s, "queue %d ", ntohl (mp->queue_id));
132  if (mp->is_main)
133  s = format (s, "main ");
134  else
135  s = format (s, "worker %d ", ntohl (mp->worker_id));
136 
137  FINISH;
138 }
139 
142 {
143  u8 *s;
144  u32 sw_if_index = ntohl (mp->sw_if_index);
145 
146  s = format (0, "SCRIPT: sw_interface_rx_placement_dump ");
147 
148  if (sw_if_index != ~0)
149  s = format (s, "sw_if_index %d ", sw_if_index);
150 
151  FINISH;
152 }
153 
155  (vl_api_sw_interface_event_t * mp, void *handle)
156 {
157  u8 *s;
158  s = format (0, "SCRIPT: sw_interface_event ");
159 
160  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
161 
162  if (mp->admin_up_down)
163  s = format (s, "admin-up ");
164  else
165  s = format (s, "admin-down ");
166 
167  if (mp->link_up_down)
168  s = format (s, "link-up");
169  else
170  s = format (s, "link-down");
171 
172  if (mp->deleted)
173  s = format (s, " deleted");
174 
175  FINISH;
176 }
177 
180 {
181  u8 *s;
182 
183  s = format (0, "SCRIPT: sw_interface_add_del_address ");
184 
185  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
186 
187  if (mp->is_ipv6)
188  s = format (s, "%U/%d ", format_ip6_address,
189  (ip6_address_t *) mp->address, mp->address_length);
190  else
191  s = format (s, "%U/%d ", format_ip4_address,
192  (ip4_address_t *) mp->address, mp->address_length);
193 
194  if (mp->is_add == 0)
195  s = format (s, "del ");
196  if (mp->del_all)
197  s = format (s, "del-all ");
198 
199  FINISH;
200 }
201 
203  (vl_api_sw_interface_set_table_t * mp, void *handle)
204 {
205  u8 *s;
206 
207  s = format (0, "SCRIPT: sw_interface_set_table ");
208 
209  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
210 
211  if (mp->vrf_id)
212  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
213 
214  if (mp->is_ipv6)
215  s = format (s, "ipv6 ");
216 
217  FINISH;
218 }
219 
222 {
223  u8 *s;
224 
225  s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
226 
227  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
228 
229  if (mp->enable == 0)
230  s = format (s, "disable");
231 
232  FINISH;
233 }
234 
236  (vl_api_sw_interface_set_vpath_t * mp, void *handle)
237 {
238  u8 *s;
239 
240  s = format (0, "SCRIPT: sw_interface_set_vpath ");
241 
242  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
243 
244  if (mp->enable)
245  s = format (s, "enable ");
246  else
247  s = format (s, "disable ");
248 
249  FINISH;
250 }
251 
254 {
255  u8 *s;
256 
257  s = format (0, "SCRIPT: sw_interface_set_vxlan_bypass ");
258 
259  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
260 
261  if (mp->is_ipv6)
262  s = format (s, "ip6 ");
263 
264  if (mp->enable)
265  s = format (s, "enable ");
266  else
267  s = format (s, "disable ");
268 
269  FINISH;
270 }
271 
274 {
275  u8 *s;
276 
277  s = format (0, "SCRIPT: sw_interface_set_geneve_bypass ");
278 
279  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
280 
281  if (mp->is_ipv6)
282  s = format (s, "ip6 ");
283 
284  if (mp->enable)
285  s = format (s, "enable ");
286  else
287  s = format (s, "disable ");
288 
289  FINISH;
290 }
291 
294 {
295  u8 *s;
296 
297  s = format (0, "SCRIPT: sw_interface_set_l2_xconnect ");
298 
299  s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
300 
301  if (mp->enable)
302  {
303  s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
304  }
305  else
306  s = format (s, "delete ");
307 
308  FINISH;
309 }
310 
313 {
314  u8 *s;
315 
316  s = format (0, "SCRIPT: sw_interface_set_l2_bridge ");
317 
318  s = format (s, "sw_if_index %d ", ntohl (mp->rx_sw_if_index));
319 
320  if (mp->enable)
321  {
322  s = format (s, "bd_id %d shg %d ", ntohl (mp->bd_id), mp->shg);
323  if (L2_API_PORT_TYPE_BVI == ntohl (mp->port_type))
324  s = format (s, "bvi ");
325  if (L2_API_PORT_TYPE_UU_FWD == ntohl (mp->port_type))
326  s = format (s, "uu-fwd ");
327  s = format (s, "enable");
328  }
329  else
330  s = format (s, "disable ");
331 
332  FINISH;
333 }
334 
336  (vl_api_bridge_domain_add_del_t * mp, void *handle)
337 {
338  u8 *s;
339 
340  s = format (0, "SCRIPT: bridge_domain_add_del ");
341 
342  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
343 
344  if (mp->is_add)
345  {
346  if (mp->bd_tag[0])
347  s = format (s, "bd_tag %s ", mp->bd_tag);
348  s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood);
349  s = format (s, "forward %d learn %d ", mp->forward, mp->learn);
350  s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age);
351  }
352  else
353  s = format (s, "del ");
354 
355  FINISH;
356 }
357 
360 {
361  u8 *s;
362 
363  s = format (0, "SCRIPT: bridge_domain_set_mac_age ");
364 
365  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
366 
367  s = format (s, "mac-age %d", mp->mac_age);
368 
369  FINISH;
370 }
371 
373  (vl_api_bridge_domain_dump_t * mp, void *handle)
374 {
375  u8 *s;
376  u32 bd_id = ntohl (mp->bd_id);
377 
378  s = format (0, "SCRIPT: bridge_domain_dump ");
379 
380  if (bd_id != ~0)
381  s = format (s, "bd_id %d ", bd_id);
382 
383  FINISH;
384 }
385 
387  (vl_api_l2fib_flush_all_t * mp, void *handle)
388 {
389  u8 *s;
390 
391  s = format (0, "SCRIPT: l2fib_flush_all ");
392 
393  FINISH;
394 }
395 
396 
398  (vl_api_l2fib_flush_bd_t * mp, void *handle)
399 {
400  u8 *s;
401  u32 bd_id = ntohl (mp->bd_id);
402 
403  s = format (0, "SCRIPT: l2fib_flush_bd ");
404  s = format (s, "bd_id %d ", bd_id);
405 
406  FINISH;
407 }
408 
410  (vl_api_l2fib_flush_int_t * mp, void *handle)
411 {
412  u8 *s;
413  u32 sw_if_index = ntohl (mp->sw_if_index);
414 
415  s = format (0, "SCRIPT: l2fib_flush_int ");
416  s = format (s, "sw_if_index %d ", sw_if_index);
417 
418  FINISH;
419 }
420 
421 static void *vl_api_l2fib_add_del_t_print
422  (vl_api_l2fib_add_del_t * mp, void *handle)
423 {
424  u8 *s;
425 
426  s = format (0, "SCRIPT: l2fib_add_del ");
427 
428  s = format (s, "mac %U ", format_ethernet_address, mp->mac);
429 
430  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
431 
432 
433  if (mp->is_add)
434  {
435  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
436  if (mp->static_mac)
437  s = format (s, "%s", "static ");
438  if (mp->filter_mac)
439  s = format (s, "%s", "filter ");
440  if (mp->bvi_mac)
441  s = format (s, "%s", "bvi ");
442  }
443  else
444  {
445  s = format (s, "del ");
446  }
447 
448  FINISH;
449 }
450 
451 static void *
453 {
454  u8 *s;
455  u32 flags = ntohl (mp->feature_bitmap);
456 
457  s = format (0, "SCRIPT: l2_flags ");
458 
459  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
460 
461  if (flags & L2_LEARN)
462  s = format (s, "learn ");
463  if (flags & L2_FWD)
464  s = format (s, "forward ");
465  if (flags & L2_FLOOD)
466  s = format (s, "flood ");
467  if (flags & L2_UU_FLOOD)
468  s = format (s, "uu-flood ");
469  if (flags & L2_ARP_TERM)
470  s = format (s, "arp-term ");
471 
472  if (mp->is_set == 0)
473  s = format (s, "clear ");
474 
475  FINISH;
476 }
477 
478 static void *vl_api_bridge_flags_t_print
479  (vl_api_bridge_flags_t * mp, void *handle)
480 {
481  u8 *s;
482  u32 flags = ntohl (mp->flags);
483 
484  s = format (0, "SCRIPT: bridge_flags ");
485 
486  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
487 
488  if (flags & BRIDGE_API_FLAG_LEARN)
489  s = format (s, "learn ");
490  if (flags & BRIDGE_API_FLAG_FWD)
491  s = format (s, "forward ");
492  if (flags & BRIDGE_API_FLAG_FLOOD)
493  s = format (s, "flood ");
494  if (flags & BRIDGE_API_FLAG_UU_FLOOD)
495  s = format (s, "uu-flood ");
496  if (flags & BRIDGE_API_FLAG_ARP_TERM)
497  s = format (s, "arp-term ");
498 
499  if (mp->is_set == 0)
500  s = format (s, "clear ");
501 
502  FINISH;
503 }
504 
506  (vl_api_bd_ip_mac_add_del_t * mp, void *handle)
507 {
508  u8 *s;
509 
510  s = format (0, "SCRIPT: bd_ip_mac_add_del ");
511  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
512 
513  s = format (s, "%U ", format_vl_api_address, &mp->ip);
514  s = format (s, "%U ", format_vl_api_mac_address, &mp->mac);
515  if (mp->is_add == 0)
516  s = format (s, "del ");
517 
518  FINISH;
519 }
520 
522  (vl_api_bd_ip_mac_flush_t * mp, void *handle)
523 {
524  u8 *s;
525 
526  s = format (0, "SCRIPT: bd_ip_mac_flush ");
527  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
528 
529  FINISH;
530 }
531 
533  (vl_api_bd_ip_mac_dump_t * mp, void *handle)
534 {
535  u8 *s;
536 
537  s = format (0, "SCRIPT: bd_ip_mac_dump ");
538 
539  FINISH;
540 }
541 
542 static void *vl_api_tap_create_v2_t_print
543  (vl_api_tap_create_v2_t * mp, void *handle)
544 {
545  u8 *s;
546  u8 null_mac[6];
547 
548  clib_memset (null_mac, 0, sizeof (null_mac));
549 
550  s = format (0, "SCRIPT: tap_create_v2 ");
551  s = format (s, "id %u ", ntohl (mp->id));
552  if (memcmp (mp->mac_address, null_mac, 6))
553  s = format (s, "mac-address %U ",
555  if (memcmp (mp->host_mac_addr, null_mac, 6))
556  s = format (s, "host-mac-addr %U ",
558  if (mp->host_if_name_set)
559  s = format (s, "host-if-name %s ", mp->host_if_name);
560  if (mp->host_namespace_set)
561  s = format (s, "host-ns %s ", mp->host_namespace);
562  if (mp->host_bridge_set)
563  s = format (s, "host-bridge %s ", mp->host_bridge);
564  if (mp->host_ip4_addr_set)
565  s = format (s, "host-ip4-addr %U/%d ", format_ip4_address,
567  if (mp->host_ip6_addr_set)
568  s = format (s, "host-ip6-addr %U/%d ", format_ip6_address,
570  if (mp->host_ip4_gw_set)
571  s = format (s, "host-ip4-gw %U ", format_ip4_address, mp->host_ip4_addr);
572  if (mp->host_ip6_gw_set)
573  s = format (s, "host-ip6-gw %U ", format_ip6_address, mp->host_ip6_addr);
574  if (mp->tx_ring_sz)
575  s = format (s, "tx-ring-size %u ", ntohs (mp->tx_ring_sz));
576  if (mp->rx_ring_sz)
577  s = format (s, "rx-ring-size %u ", ntohs (mp->rx_ring_sz));
578  FINISH;
579 }
580 
581 static void *vl_api_tap_delete_v2_t_print
582  (vl_api_tap_delete_v2_t * mp, void *handle)
583 {
584  u8 *s;
585 
586  s = format (0, "SCRIPT: tap_delete_v2 ");
587  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
588 
589  FINISH;
590 }
591 
594 {
595  u8 *s;
596 
597  s = format (0, "SCRIPT: sw_interface_tap_v2_dump ");
598 
599  FINISH;
600 }
601 
603  (vl_api_virtio_pci_create_t * mp, void *handle)
604 {
605  u8 *s;
606  u8 null_mac[6];
607 
608  clib_memset (null_mac, 0, sizeof (null_mac));
609 
610  s = format (0, "SCRIPT: virtio_pci_create ");
611  s = format (s, "pci_addr %U ", format_vlib_pci_addr, ntohl (mp->pci_addr));
612  if (memcmp (mp->mac_address, null_mac, 6))
613  s = format (s, "mac-address %U ",
615  if (mp->tx_ring_sz)
616  s = format (s, "tx-ring-size %u ", ntohs (mp->tx_ring_sz));
617  if (mp->rx_ring_sz)
618  s = format (s, "rx-ring-size %u ", ntohs (mp->rx_ring_sz));
619  if (mp->features)
620  s = format (s, "features 0x%llx ", clib_net_to_host_u64 (mp->features));
621  FINISH;
622 }
623 
625  (vl_api_virtio_pci_delete_t * mp, void *handle)
626 {
627  u8 *s;
628 
629  s = format (0, "SCRIPT: virtio_pci_delete ");
630  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
631 
632  FINISH;
633 }
634 
637 {
638  u8 *s;
639 
640  s = format (0, "SCRIPT: sw_interface_virtio_pci_dump ");
641 
642  FINISH;
643 }
644 
645 static void *vl_api_bond_create_t_print
646  (vl_api_bond_create_t * mp, void *handle)
647 {
648  u8 *s;
649  u8 null_mac[6];
650 
651  clib_memset (null_mac, 0, sizeof (null_mac));
652 
653  s = format (0, "SCRIPT: bond_create ");
654  if (memcmp (mp->mac_address, null_mac, 6))
655  s = format (s, "mac-address %U ",
657  if (mp->mode)
658  s = format (s, "mode %U ", format_bond_mode, mp->mode);
659  if (mp->lb)
660  s = format (s, "lb %U ", format_bond_load_balance, mp->lb);
661  if (mp->id != ~0)
662  s = format (s, "id %u ", ntohl (mp->id));
663  FINISH;
664 }
665 
666 static void *vl_api_bond_delete_t_print
667  (vl_api_bond_delete_t * mp, void *handle)
668 {
669  u8 *s;
670 
671  s = format (0, "SCRIPT: bond_delete ");
672  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
673 
674  FINISH;
675 }
676 
677 static void *vl_api_bond_enslave_t_print
678  (vl_api_bond_enslave_t * mp, void *handle)
679 {
680  u8 *s;
681 
682  s = format (0, "SCRIPT: bond_enslave ");
683  s = format (s, "bond_sw_if_index %u ", mp->bond_sw_if_index);
684  s = format (s, "sw_if_index %u ", mp->sw_if_index);
685  if (mp->is_passive)
686  s = format (s, "passive ");
687  if (mp->is_long_timeout)
688  s = format (s, "long-timeout ");
689 
690  FINISH;
691 }
692 
694  (vl_api_bond_detach_slave_t * mp, void *handle)
695 {
696  u8 *s;
697 
698  s = format (0, "SCRIPT: bond_detach_slave ");
699  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
700 
701  FINISH;
702 }
703 
705  (vl_api_sw_interface_bond_dump_t * mp, void *handle)
706 {
707  u8 *s;
708 
709  s = format (0, "SCRIPT: sw_interface_bond_dump ");
710 
711  FINISH;
712 }
713 
715  (vl_api_sw_interface_slave_dump_t * mp, void *handle)
716 {
717  u8 *s;
718 
719  s = format (0, "SCRIPT: sw_interface_slave_dump ");
720  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
721 
722  FINISH;
723 }
724 
726  (vl_api_ip_add_del_route_t * mp, void *handle)
727 {
728  u8 *s;
729 
730  s = format (0, "SCRIPT: ip_add_del_route ");
731  if (mp->is_add == 0)
732  s = format (s, "del ");
733 
734  if (mp->is_ipv6)
735  s = format (s, "%U/%d ", format_ip6_address, mp->dst_address,
736  mp->dst_address_length);
737  else
738  s = format (s, "%U/%d ", format_ip4_address, mp->dst_address,
739  mp->dst_address_length);
740 
741  if (mp->table_id != 0)
742  s = format (s, "vrf %d ", ntohl (mp->table_id));
743 
744  if (mp->is_local)
745  s = format (s, "local ");
746  else if (mp->is_drop)
747  s = format (s, "drop ");
748  else if (mp->is_classify)
749  s = format (s, "classify %d", ntohl (mp->classify_table_index));
750  else if (mp->next_hop_via_label != htonl (MPLS_LABEL_INVALID))
751  s = format (s, "via via_label %d ", ntohl (mp->next_hop_via_label));
752  else
753  {
754  if (mp->is_ipv6)
755  s = format (s, "via %U ", format_ip6_address, mp->next_hop_address);
756  else
757  s = format (s, "via %U ", format_ip4_address, mp->next_hop_address);
758  if (mp->next_hop_sw_if_index != ~0)
759  s = format (s, "sw_if_index %d ", ntohl (mp->next_hop_sw_if_index));
760 
761  }
762 
763  if (mp->next_hop_weight != 1)
764  s = format (s, "weight %d ", (u32) mp->next_hop_weight);
765 
766  if (mp->is_multipath)
767  s = format (s, "multipath ");
768 
769  if (mp->next_hop_table_id)
770  s = format (s, "lookup-in-vrf %d ", ntohl (mp->next_hop_table_id));
771 
772  if (mp->next_hop_n_out_labels)
773  {
774  u8 i;
775  for (i = 0; i < mp->next_hop_n_out_labels; i++)
776  {
777  s = format (s, "out-label %d ",
778  ntohl (mp->next_hop_out_label_stack[i].label));
779  }
780  }
781 
782  FINISH;
783 }
784 
786  (vl_api_mpls_route_add_del_t * mp, void *handle)
787 {
788  u8 *s;
789 
790  s = format (0, "SCRIPT: mpls_route_add_del ");
791 
792  if (mp->mr_is_add)
793  s = format (s, "add ");
794  else
795  s = format (s, "del ");
796 
797  s = format (s, "%d ", ntohl (mp->mr_label));
798 
799  if (mp->mr_eos)
800  s = format (s, "eos ");
801  else
802  s = format (s, "non-eos ");
803 
804 
805  if (mp->mr_next_hop_proto == DPO_PROTO_IP4)
806  {
807  ip4_address_t ip4_null = {.as_u32 = 0, };
808  if (memcmp (mp->mr_next_hop, &ip4_null, sizeof (ip4_null)))
809  s = format (s, "via %U ", format_ip4_address, mp->mr_next_hop);
810  else
811  s = format (s, "via lookup-in-ip4-table %d ",
812  ntohl (mp->mr_next_hop_table_id));
813  }
814  else if (mp->mr_next_hop_proto == DPO_PROTO_IP6)
815  {
816  ip6_address_t ip6_null = { {0}
817  };
818  if (memcmp (mp->mr_next_hop, &ip6_null, sizeof (ip6_null)))
819  s = format (s, "via %U ", format_ip6_address, mp->mr_next_hop);
820  else
821  s = format (s, "via lookup-in-ip6-table %d ",
822  ntohl (mp->mr_next_hop_table_id));
823  }
824  else if (mp->mr_next_hop_proto == DPO_PROTO_ETHERNET)
825  {
826  s = format (s, "via l2-input-on ");
827  }
828  else if (mp->mr_next_hop_proto == DPO_PROTO_MPLS)
829  {
830  if (mp->mr_next_hop_via_label != htonl (MPLS_LABEL_INVALID))
831  s =
832  format (s, "via via-label %d ", ntohl (mp->mr_next_hop_via_label));
833  else
834  s = format (s, "via next-hop-table %d ",
835  ntohl (mp->mr_next_hop_table_id));
836  }
837  if (mp->mr_next_hop_sw_if_index != ~0)
838  s = format (s, "sw_if_index %d ", ntohl (mp->mr_next_hop_sw_if_index));
839 
840  if (mp->mr_next_hop_weight != 1)
841  s = format (s, "weight %d ", (u32) mp->mr_next_hop_weight);
842 
843  if (mp->mr_is_multipath)
844  s = format (s, "multipath ");
845 
846  if (mp->mr_is_classify)
847  s = format (s, "classify %d", ntohl (mp->mr_classify_table_index));
848 
849  if (mp->mr_next_hop_n_out_labels)
850  {
851  u8 i;
852  for (i = 0; i < mp->mr_next_hop_n_out_labels; i++)
853  {
854  s = format (s, "out-label %d ",
855  ntohl (mp->mr_next_hop_out_label_stack[i].label));
856  }
857  }
858 
859  FINISH;
860 }
861 
863  (vl_api_ip_table_add_del_t * mp, void *handle)
864 {
865  u8 *s;
866 
867  s = format (0, "SCRIPT: ip_table_add_del ");
868  if (mp->is_add)
869  s = format (s, "add ");
870  else
871  s = format (s, "del ");
872  if (mp->is_ipv6)
873  s = format (s, "ip6 ");
874  s = format (s, "table %d ", ntohl (mp->table_id));
875 
876  FINISH;
877 }
878 
880  (vl_api_mpls_table_add_del_t * mp, void *handle)
881 {
882  u8 *s;
883 
884  s = format (0, "SCRIPT: mpls_table_add_del ");
885  if (mp->mt_is_add)
886  s = format (s, "add ");
887  else
888  s = format (s, "del ");
889  s = format (s, "table %d ", ntohl (mp->mt_table_id));
890 
891  FINISH;
892 }
893 
895  (vl_api_proxy_arp_add_del_t * mp, void *handle)
896 {
897  u8 *s;
898 
899  s = format (0, "SCRIPT: proxy_arp_add_del ");
900 
901  s = format (s, "%U - %U ",
904 
905  s = format (s, "table %d ", ntohl (mp->proxy.table_id));
906 
907  if (mp->is_add == 0)
908  s = format (s, "del ");
909 
910  FINISH;
911 }
912 
915 {
916  u8 *s;
917 
918  s = format (0, "SCRIPT: proxy_arp_intfc_enable_disable ");
919 
920  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
921 
922  s = format (s, "enable %d ", mp->enable_disable);
923 
924  FINISH;
925 }
926 
928  (vl_api_mpls_tunnel_add_del_t * mp, void *handle)
929 {
930  u8 *s;
931 
932  s = format (0, "SCRIPT: mpls_tunnel_add_del ");
933 
934  if (mp->mt_is_add == 0)
935  s = format (s, "del sw_if_index %d ", ntohl (mp->mt_sw_if_index));
936 
937  mpls_label_t label = ntohl (mp->mt_next_hop_via_label);
938  if (label != MPLS_LABEL_INVALID)
939  s = format (s, "via-label %d ", label);
940  else if (mp->mt_next_hop_proto_is_ip4)
941  s = format (s, "via %U ", format_ip4_address, mp->mt_next_hop);
942  else
943  s = format (s, "via %U ", format_ip6_address, mp->mt_next_hop);
944 
945  if (mp->mt_next_hop_sw_if_index != ~0)
946  s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index));
947  else if (mp->mt_next_hop_table_id)
948  s = format (s, "next-hop-table %d ", ntohl (mp->mt_next_hop_table_id));
949 
950  if (mp->mt_l2_only)
951  s = format (s, "l2-only ");
952 
953  if (mp->mt_next_hop_n_out_labels)
954  {
955  u8 i;
956  for (i = 0; i < mp->mt_next_hop_n_out_labels; i++)
957  {
958  s = format (s, "out-label %d ",
959  ntohl (mp->mt_next_hop_out_label_stack[i].label));
960  }
961  }
962 
963  FINISH;
964 }
965 
967  (vl_api_sr_mpls_policy_add_t * mp, void *handle)
968 {
969  u8 *s;
970 
971  s = format (0, "SCRIPT: sr_mpls_policy_add ");
972 
973  s = format (s, "bsid %d ", ntohl (mp->bsid));
974 
975  if (mp->weight != htonl ((u32) 1))
976  s = format (s, "%d ", ntohl (mp->weight));
977 
978  if (mp->type)
979  s = format (s, "spray ");
980 
981  if (mp->n_segments)
982  {
983  int i;
984  for (i = 0; i < mp->n_segments; i++)
985  s = format (s, "next %d ", ntohl (mp->segments[i]));
986  }
987 
988  FINISH;
989 }
990 
992  (vl_api_sr_mpls_policy_del_t * mp, void *handle)
993 {
994  u8 *s;
995 
996  s = format (0, "SCRIPT: sr_mpls_policy_del ");
997 
998  s = format (s, "bsid %d ", ntohl (mp->bsid));
999 
1000  FINISH;
1001 }
1002 
1005 {
1006  u8 *s;
1007 
1008  s = format (0, "SCRIPT: sw_interface_set_unnumbered ");
1009 
1010  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1011 
1012  s = format (s, "unnum_if_index %d ", ntohl (mp->unnumbered_sw_if_index));
1013 
1014  if (mp->is_add == 0)
1015  s = format (s, "del ");
1016 
1017  FINISH;
1018 }
1019 
1021  (vl_api_ip_neighbor_add_del_t * mp, void *handle)
1022 {
1023  u8 *s;
1024 
1025  s = format (0, "SCRIPT: ip_neighbor_add_del ");
1026 
1027  s = format (s, "sw_if_index %d ", ntohl (mp->neighbor.sw_if_index));
1028 
1029  if (IP_API_NEIGHBOR_FLAG_STATIC & ntohl (mp->neighbor.flags))
1030  s = format (s, "is_static ");
1031 
1032  if (IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY & ntohl (mp->neighbor.flags))
1033  s = format (s, "is_no_fib_entry ");
1034 
1035  s = format (s, "mac %U ", format_vl_api_mac_address,
1036  &mp->neighbor.mac_address);
1037 
1038  s = format (s, "dst %U ", format_vl_api_address, &mp->neighbor.ip_address);
1039 
1040  if (mp->is_add == 0)
1041  s = format (s, "del ");
1042 
1043  FINISH;
1044 }
1045 
1046 
1048  (vl_api_create_vlan_subif_t * mp, void *handle)
1049 {
1050  u8 *s;
1051 
1052  s = format (0, "SCRIPT: create_vlan_subif ");
1053 
1054  if (mp->sw_if_index)
1055  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1056 
1057  if (mp->vlan_id)
1058  s = format (s, "vlan_id %d ", ntohl (mp->vlan_id));
1059 
1060  FINISH;
1061 }
1062 
1063 #define foreach_create_subif_bit \
1064 _(no_tags) \
1065 _(one_tag) \
1066 _(two_tags) \
1067 _(dot1ad) \
1068 _(exact_match) \
1069 _(default_sub) \
1070 _(outer_vlan_id_any) \
1071 _(inner_vlan_id_any)
1072 
1073 static void *vl_api_create_subif_t_print
1074  (vl_api_create_subif_t * mp, void *handle)
1075 {
1076  u8 *s;
1077 
1078  s = format (0, "SCRIPT: create_subif ");
1079 
1080  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1081 
1082  s = format (s, "sub_id %d ", ntohl (mp->sub_id));
1083 
1084  if (mp->outer_vlan_id)
1085  s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
1086 
1087  if (mp->inner_vlan_id)
1088  s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
1089 
1090 #define _(a) if (mp->a) s = format (s, "%s ", #a);
1092 #undef _
1093 
1094  FINISH;
1095 }
1096 
1097 static void *vl_api_delete_subif_t_print
1098  (vl_api_delete_subif_t * mp, void *handle)
1099 {
1100  u8 *s;
1101 
1102  s = format (0, "SCRIPT: delete_subif ");
1103  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1104 
1105  FINISH;
1106 }
1107 
1108 static void *vl_api_oam_add_del_t_print
1109  (vl_api_oam_add_del_t * mp, void *handle)
1110 {
1111  u8 *s;
1112 
1113  s = format (0, "SCRIPT: oam_add_del ");
1114 
1115  if (mp->vrf_id)
1116  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
1117 
1118  s = format (s, "src %U ", format_ip4_address, mp->src_address);
1119 
1120  s = format (s, "dst %U ", format_ip4_address, mp->dst_address);
1121 
1122  if (mp->is_add == 0)
1123  s = format (s, "del ");
1124 
1125  FINISH;
1126 }
1127 
1128 static void *
1130 {
1131  u8 *s;
1132 
1133  s = format (0, "SCRIPT: reset_fib ");
1134 
1135  if (mp->vrf_id)
1136  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
1137 
1138  if (mp->is_ipv6 != 0)
1139  s = format (s, "ipv6 ");
1140 
1141  FINISH;
1142 }
1143 
1145  (vl_api_dhcp_proxy_config_t * mp, void *handle)
1146 {
1147  u8 *s;
1148 
1149  s = format (0, "SCRIPT: dhcp_proxy_config_2 ");
1150 
1151  s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id));
1152  s = format (s, "server_vrf_id %d ", ntohl (mp->server_vrf_id));
1153 
1154  if (mp->is_ipv6)
1155  {
1156  s = format (s, "svr %U ", format_ip6_address,
1157  (ip6_address_t *) mp->dhcp_server);
1158  s = format (s, "src %U ", format_ip6_address,
1160  }
1161  else
1162  {
1163  s = format (s, "svr %U ", format_ip4_address,
1164  (ip4_address_t *) mp->dhcp_server);
1165  s = format (s, "src %U ", format_ip4_address,
1167  }
1168  if (mp->is_add == 0)
1169  s = format (s, "del ");
1170 
1171  FINISH;
1172 }
1173 
1175  (vl_api_dhcp_proxy_set_vss_t * mp, void *handle)
1176 {
1177  u8 *s;
1178 
1179  s = format (0, "SCRIPT: dhcp_proxy_set_vss ");
1180 
1181  s = format (s, "tbl_id %d ", ntohl (mp->tbl_id));
1182 
1183  if (mp->vss_type == VSS_TYPE_VPN_ID)
1184  {
1185  s = format (s, "fib_id %d ", ntohl (mp->vpn_index));
1186  s = format (s, "oui %d ", ntohl (mp->oui));
1187  }
1188  else if (mp->vss_type == VSS_TYPE_ASCII)
1189  s = format (s, "vpn_ascii_id %s", mp->vpn_ascii_id);
1190 
1191  if (mp->is_ipv6 != 0)
1192  s = format (s, "ipv6 ");
1193 
1194  if (mp->is_add == 0)
1195  s = format (s, "del ");
1196 
1197  FINISH;
1198 }
1199 
1201  (vl_api_dhcp_client_config_t * mp, void *handle)
1202 {
1203  u8 *s;
1204 
1205  s = format (0, "SCRIPT: dhcp_client_config ");
1206 
1207  s = format (s, "sw_if_index %d ", ntohl (mp->client.sw_if_index));
1208 
1209  s = format (s, "hostname %s ", mp->client.hostname);
1210 
1211  s = format (s, "want_dhcp_event %d ", mp->client.want_dhcp_event);
1212 
1213  s = format (s, "pid %d ", ntohl (mp->client.pid));
1214 
1215  if (mp->is_add == 0)
1216  s = format (s, "del ");
1217 
1218  FINISH;
1219 }
1220 
1221 
1223  (vl_api_set_ip_flow_hash_t * mp, void *handle)
1224 {
1225  u8 *s;
1226 
1227  s = format (0, "SCRIPT: set_ip_flow_hash ");
1228 
1229  s = format (s, "vrf_id %d ", ntohl (mp->vrf_id));
1230 
1231  if (mp->src)
1232  s = format (s, "src ");
1233 
1234  if (mp->dst)
1235  s = format (s, "dst ");
1236 
1237  if (mp->sport)
1238  s = format (s, "sport ");
1239 
1240  if (mp->dport)
1241  s = format (s, "dport ");
1242 
1243  if (mp->proto)
1244  s = format (s, "proto ");
1245 
1246  if (mp->reverse)
1247  s = format (s, "reverse ");
1248 
1249  if (mp->is_ipv6 != 0)
1250  s = format (s, "ipv6 ");
1251 
1252  FINISH;
1253 }
1254 
1257 {
1258  u8 *s;
1259 
1260  s = format (0, "SCRIPT: sw_interface_ip6nd_ra_prefix ");
1261 
1262  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1263 
1264  s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
1265 
1266  s = format (s, "val_life %d ", ntohl (mp->val_lifetime));
1267 
1268  s = format (s, "pref_life %d ", ntohl (mp->pref_lifetime));
1269 
1270  if (mp->use_default)
1271  s = format (s, "def ");
1272 
1273  if (mp->no_advertise)
1274  s = format (s, "noadv ");
1275 
1276  if (mp->off_link)
1277  s = format (s, "offl ");
1278 
1279  if (mp->no_autoconfig)
1280  s = format (s, "noauto ");
1281 
1282  if (mp->no_onlink)
1283  s = format (s, "nolink ");
1284 
1285  if (mp->is_no)
1286  s = format (s, "isno ");
1287 
1288  FINISH;
1289 }
1290 
1293 {
1294  u8 *s;
1295 
1296  s = format (0, "SCRIPT: sw_interface_ip6nd_ra_config ");
1297 
1298  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1299 
1300  s = format (s, "maxint %d ", ntohl (mp->max_interval));
1301 
1302  s = format (s, "minint %d ", ntohl (mp->min_interval));
1303 
1304  s = format (s, "life %d ", ntohl (mp->lifetime));
1305 
1306  s = format (s, "count %d ", ntohl (mp->initial_count));
1307 
1308  s = format (s, "interval %d ", ntohl (mp->initial_interval));
1309 
1310  if (mp->suppress)
1311  s = format (s, "suppress ");
1312 
1313  if (mp->managed)
1314  s = format (s, "managed ");
1315 
1316  if (mp->other)
1317  s = format (s, "other ");
1318 
1319  if (mp->ll_option)
1320  s = format (s, "ll ");
1321 
1322  if (mp->send_unicast)
1323  s = format (s, "send ");
1324 
1325  if (mp->cease)
1326  s = format (s, "cease ");
1327 
1328  if (mp->is_no)
1329  s = format (s, "isno ");
1330 
1331  if (mp->default_router)
1332  s = format (s, "def ");
1333 
1334  FINISH;
1335 }
1336 
1338  (vl_api_set_arp_neighbor_limit_t * mp, void *handle)
1339 {
1340  u8 *s;
1341 
1342  s = format (0, "SCRIPT: set_arp_neighbor_limit ");
1343 
1344  s = format (s, "arp_nbr_limit %d ", ntohl (mp->arp_neighbor_limit));
1345 
1346  if (mp->is_ipv6 != 0)
1347  s = format (s, "ipv6 ");
1348 
1349  FINISH;
1350 }
1351 
1353  (vl_api_l2_patch_add_del_t * mp, void *handle)
1354 {
1355  u8 *s;
1356 
1357  s = format (0, "SCRIPT: l2_patch_add_del ");
1358 
1359  s = format (s, "rx_sw_if_index %d ", ntohl (mp->rx_sw_if_index));
1360 
1361  s = format (s, "tx_sw_if_index %d ", ntohl (mp->tx_sw_if_index));
1362 
1363  if (mp->is_add == 0)
1364  s = format (s, "del ");
1365 
1366  FINISH;
1367 }
1368 
1370  (vl_api_sr_localsid_add_del_t * mp, void *handle)
1371 {
1372  vnet_main_t *vnm = vnet_get_main ();
1373  u8 *s;
1374 
1375  s = format (0, "SCRIPT: sr_localsid_add_del ");
1376 
1377  switch (mp->behavior)
1378  {
1379  case SR_BEHAVIOR_END:
1380  s = format (s, "Address: %U\nBehavior: End",
1382  s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1383  break;
1384  case SR_BEHAVIOR_X:
1385  s =
1386  format (s,
1387  "Address: %U\nBehavior: X (Endpoint with Layer-3 cross-connect)"
1388  "\nIface: %U\nNext hop: %U", format_ip6_address,
1389  (ip6_address_t *) mp->localsid.addr,
1390  format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1392  s = format (s, (mp->end_psp ? "End.PSP: True" : "End.PSP: False"));
1393  break;
1394  case SR_BEHAVIOR_DX4:
1395  s =
1396  format (s,
1397  "Address: %U\nBehavior: DX4 (Endpoint with decapsulation with IPv4 cross-connect)"
1398  "\nIface: %U\nNext hop: %U", format_ip6_address,
1399  (ip6_address_t *) mp->localsid.addr,
1400  format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1402  break;
1403  case SR_BEHAVIOR_DX6:
1404  s =
1405  format (s,
1406  "Address: %U\nBehavior: DX6 (Endpoint with decapsulation with IPv6 cross-connect)"
1407  "\nIface: %UNext hop: %U", format_ip6_address,
1408  (ip6_address_t *) mp->localsid.addr,
1409  format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index),
1411  break;
1412  case SR_BEHAVIOR_DX2:
1413  s =
1414  format (s,
1415  "Address: %U\nBehavior: DX2 (Endpoint with decapulation and Layer-2 cross-connect)"
1416  "\nIface: %U", format_ip6_address,
1417  (ip6_address_t *) mp->localsid.addr,
1418  format_vnet_sw_if_index_name, vnm, ntohl (mp->sw_if_index));
1419  break;
1420  case SR_BEHAVIOR_DT6:
1421  s =
1422  format (s,
1423  "Address: %U\nBehavior: DT6 (Endpoint with decapsulation and specific IPv6 table lookup)"
1424  "\nTable: %u", format_ip6_address,
1425  (ip6_address_t *) mp->localsid.addr, ntohl (mp->fib_table));
1426  break;
1427  case SR_BEHAVIOR_DT4:
1428  s =
1429  format (s,
1430  "Address: %U\nBehavior: DT4 (Endpoint with decapsulation and specific IPv4 table lookup)"
1431  "\nTable: %u", format_ip6_address,
1432  (ip6_address_t *) mp->localsid.addr, ntohl (mp->fib_table));
1433  break;
1434  default:
1435  if (mp->behavior >= SR_BEHAVIOR_LAST)
1436  {
1437  s = format (s, "Address: %U\n Behavior: %u",
1439  mp->behavior);
1440  }
1441  else
1442  //Should never get here...
1443  s = format (s, "Internal error");
1444  break;
1445  }
1446  FINISH;
1447 }
1448 
1450  (vl_api_sr_steering_add_del_t * mp, void *handle)
1451 {
1452  u8 *s;
1453 
1454  s = format (0, "SCRIPT: sr_steering_add_del ");
1455 
1456  s = format (s, (mp->is_del ? "Del: True" : "Del: False"));
1457 
1458  switch (mp->traffic_type)
1459  {
1460  case SR_STEER_L2:
1461  s = format (s, "Traffic type: L2 iface: %u", ntohl (mp->sw_if_index));
1462  break;
1463  case SR_STEER_IPV4:
1464  s = format (s, "Traffic type: IPv4 %U/%u", format_ip4_address,
1465  (ip4_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1466  break;
1467  case SR_STEER_IPV6:
1468  s = format (s, "Traffic type: IPv6 %U/%u", format_ip6_address,
1469  (ip6_address_t *) mp->prefix_addr, ntohl (mp->mask_width));
1470  break;
1471  default:
1472  s = format (s, "Traffic type: Unknown(%u)", mp->traffic_type);
1473  break;
1474  }
1475  s = format (s, "BindingSID: %U", format_ip6_address,
1476  (ip6_address_t *) mp->bsid_addr);
1477 
1478  s = format (s, "SR Policy Index: %u", ntohl (mp->sr_policy_index));
1479 
1480  s = format (s, "FIB_table: %u", ntohl (mp->table_id));
1481 
1482  FINISH;
1483 }
1484 
1485 static void *vl_api_sr_policy_add_t_print
1486  (vl_api_sr_policy_add_t * mp, void *handle)
1487 {
1488  u8 *s;
1489 
1490  ip6_address_t *segments = 0, *seg;
1491  ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1492 
1493  int i;
1494  for (i = 0; i < mp->sids.num_sids; i++)
1495  {
1496  vec_add2 (segments, seg, 1);
1497  clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1498  this_address++;
1499  }
1500 
1501  s = format (0, "SCRIPT: sr_policy_add ");
1502 
1503  s = format (s, "BSID: %U", format_ip6_address,
1504  (ip6_address_t *) mp->bsid_addr);
1505 
1506  s =
1507  format (s,
1508  (mp->is_encap ? "Behavior: Encapsulation" :
1509  "Behavior: SRH insertion"));
1510 
1511  s = format (s, "FIB_table: %u", ntohl (mp->fib_table));
1512 
1513  s = format (s, (mp->type ? "Type: Default" : "Type: Spray"));
1514 
1515  s = format (s, "SID list weight: %u", ntohl (mp->weight));
1516 
1517  s = format (s, "{");
1518  vec_foreach (seg, segments)
1519  {
1520  s = format (s, "%U, ", format_ip6_address, seg);
1521  }
1522  s = format (s, "\b\b } ");
1523 
1524  FINISH;
1525 }
1526 
1527 static void *vl_api_sr_policy_mod_t_print
1528  (vl_api_sr_policy_mod_t * mp, void *handle)
1529 {
1530  u8 *s;
1531 
1532  ip6_address_t *segments = 0, *seg;
1533  ip6_address_t *this_address = (ip6_address_t *) mp->sids.sids;
1534 
1535  int i;
1536  for (i = 0; i < mp->sids.num_sids; i++)
1537  {
1538  vec_add2 (segments, seg, 1);
1539  clib_memcpy (seg->as_u8, this_address->as_u8, sizeof (*this_address));
1540  this_address++;
1541  }
1542 
1543  s = format (0, "SCRIPT: sr_policy_mod ");
1544 
1545  s = format (s, "BSID: %U", format_ip6_address,
1546  (ip6_address_t *) mp->bsid_addr);
1547 
1548  s = format (s, "SR Policy index: %u", ntohl (mp->sr_policy_index));
1549 
1550  s = format (s, "Operation: %u", mp->operation);
1551 
1552  s = format (s, "SID list index: %u", ntohl (mp->sl_index));
1553 
1554  s = format (s, "SID list weight: %u", ntohl (mp->weight));
1555 
1556  s = format (s, "{");
1557  vec_foreach (seg, segments)
1558  {
1559  s = format (s, "%U, ", format_ip6_address, seg);
1560  }
1561  s = format (s, "\b\b } ");
1562 
1563  FINISH;
1564 }
1565 
1566 static void *vl_api_sr_policy_del_t_print
1567  (vl_api_sr_policy_del_t * mp, void *handle)
1568 {
1569  u8 *s;
1570 
1571  s = format (0, "SCRIPT: sr_policy_del ");
1572  s = format (s, "To be delivered. Good luck.");
1573  FINISH;
1574 }
1575 
1577  (vl_api_classify_add_del_table_t * mp, void *handle)
1578 {
1579  u8 *s;
1580  int i;
1581 
1582  s = format (0, "SCRIPT: classify_add_del_table ");
1583 
1584  if (mp->is_add == 0)
1585  {
1586  s = format (s, "table %d ", ntohl (mp->table_index));
1587  s = format (s, "%s ", mp->del_chain ? "del-chain" : "del");
1588  }
1589  else
1590  {
1591  s = format (s, "nbuckets %d ", ntohl (mp->nbuckets));
1592  s = format (s, "memory_size %d ", ntohl (mp->memory_size));
1593  s = format (s, "skip %d ", ntohl (mp->skip_n_vectors));
1594  s = format (s, "match %d ", ntohl (mp->match_n_vectors));
1595  s = format (s, "next-table %d ", ntohl (mp->next_table_index));
1596  s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
1597  s = format (s, "current-data-flag %d ", ntohl (mp->current_data_flag));
1598  if (mp->current_data_flag)
1599  s = format (s, "current-data-offset %d ",
1600  ntohl (mp->current_data_offset));
1601  s = format (s, "mask hex ");
1602  for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
1603  s = format (s, "%02x", mp->mask[i]);
1604  vec_add1 (s, ' ');
1605  }
1606 
1607  FINISH;
1608 }
1609 
1612 {
1613  u8 *s;
1614  int i, limit = 0;
1615 
1616  s = format (0, "SCRIPT: classify_add_del_session ");
1617 
1618  s = format (s, "table_index %d ", ntohl (mp->table_index));
1619  s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
1620  s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
1621  s = format (s, "advance %d ", ntohl (mp->advance));
1622  s = format (s, "action %d ", mp->action);
1623  if (mp->action)
1624  s = format (s, "metadata %d ", ntohl (mp->metadata));
1625  if (mp->is_add == 0)
1626  s = format (s, "del ");
1627 
1628  s = format (s, "match hex ");
1629  for (i = 5 * sizeof (u32x4) - 1; i > 0; i--)
1630  {
1631  if (mp->match[i] != 0)
1632  {
1633  limit = i + 1;
1634  break;
1635  }
1636  }
1637 
1638  for (i = 0; i < limit; i++)
1639  s = format (s, "%02x", mp->match[i]);
1640 
1641  FINISH;
1642 }
1643 
1646 {
1647  u8 *s;
1648 
1649  s = format (0, "SCRIPT: classify_set_interface_ip_table ");
1650 
1651  if (mp->is_ipv6)
1652  s = format (s, "ipv6 ");
1653 
1654  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1655  s = format (s, "table %d ", ntohl (mp->table_index));
1656 
1657  FINISH;
1658 }
1659 
1662 {
1663  u8 *s;
1664 
1665  s = format (0, "SCRIPT: classify_set_interface_l2_tables ");
1666 
1667  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1668  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
1669  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
1670  s = format (s, "other-table %d ", ntohl (mp->other_table_index));
1671  s = format (s, "is-input %d ", mp->is_input);
1672 
1673  FINISH;
1674 }
1675 
1676 static void *vl_api_add_node_next_t_print
1677  (vl_api_add_node_next_t * mp, void *handle)
1678 {
1679  u8 *s;
1680 
1681  s = format (0, "SCRIPT: add_node_next ");
1682 
1683  s = format (0, "node %s next %s ", mp->node_name, mp->next_name);
1684 
1685  FINISH;
1686 }
1687 
1689  (vl_api_l2tpv3_create_tunnel_t * mp, void *handle)
1690 {
1691  u8 *s;
1692 
1693  s = format (0, "SCRIPT: l2tpv3_create_tunnel ");
1694 
1695  s = format (s, "client_address %U our_address %U ",
1698  s = format (s, "local_session_id %d ", ntohl (mp->local_session_id));
1699  s = format (s, "remote_session_id %d ", ntohl (mp->remote_session_id));
1700  s = format (s, "local_cookie %lld ",
1701  clib_net_to_host_u64 (mp->local_cookie));
1702  s = format (s, "remote_cookie %lld ",
1703  clib_net_to_host_u64 (mp->remote_cookie));
1704  if (mp->l2_sublayer_present)
1705  s = format (s, "l2-sublayer-present ");
1706 
1707  FINISH;
1708 }
1709 
1712 {
1713  u8 *s;
1714 
1715  s = format (0, "SCRIPT: l2tpv3_set_tunnel_cookies ");
1716 
1717  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1718 
1719  s = format (s, "new_local_cookie %llu ",
1720  clib_net_to_host_u64 (mp->new_local_cookie));
1721 
1722  s = format (s, "new_remote_cookie %llu ",
1723  clib_net_to_host_u64 (mp->new_remote_cookie));
1724 
1725  FINISH;
1726 }
1727 
1730 {
1731  u8 *s;
1732 
1733  s = format (0, "SCRIPT: l2tpv3_interface_enable_disable ");
1734 
1735  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1736 
1737  if (mp->enable_disable == 0)
1738  s = format (s, "del ");
1739 
1740  FINISH;
1741 }
1742 
1744  (vl_api_l2tpv3_set_lookup_key_t * mp, void *handle)
1745 {
1746  u8 *s;
1747  char *str = "unknown";
1748 
1749  s = format (0, "SCRIPT: l2tpv3_set_lookup_key ");
1750 
1751  switch (mp->key)
1752  {
1754  str = "lookup_v6_src";
1755  break;
1757  str = "lookup_v6_dst";
1758  break;
1759  case L2T_LOOKUP_SESSION_ID:
1760  str = "lookup_session_id";
1761  break;
1762  default:
1763  break;
1764  }
1765 
1766  s = format (s, "%s ", str);
1767 
1768  FINISH;
1769 }
1770 
1773 {
1774  u8 *s;
1775 
1776  s = format (0, "SCRIPT: sw_if_l2tpv3_tunnel_dump ");
1777 
1778  FINISH;
1779 }
1780 
1782  (vl_api_vxlan_add_del_tunnel_t * mp, void *handle)
1783 {
1784  u8 *s;
1785  s = format (0, "SCRIPT: vxlan_add_del_tunnel ");
1786 
1787  ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
1788  ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
1789 
1790  u8 is_grp = ip46_address_is_multicast (&dst);
1791  char *dst_name = is_grp ? "group" : "dst";
1792 
1793  s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1794  s = format (s, "%s %U ", dst_name, format_ip46_address,
1795  &dst, IP46_TYPE_ANY);
1796 
1797  if (is_grp)
1798  s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1799 
1800  if (mp->encap_vrf_id)
1801  s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1802 
1803  s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1804 
1805  s = format (s, "vni %d ", ntohl (mp->vni));
1806 
1807  s = format (s, "instance %d ", ntohl (mp->instance));
1808 
1809  if (mp->is_add == 0)
1810  s = format (s, "del ");
1811 
1812  FINISH;
1813 }
1814 
1816  (vl_api_vxlan_offload_rx_t * mp, void *handle)
1817 {
1818  u8 *s;
1819  s = format (0, "SCRIPT: vxlan_offload_rx ");
1820 
1821  s = format (s, "hw hw_if_index %d ", ntohl (mp->hw_if_index));
1822  s = format (s, "rx sw_if_index %d ", ntohl (mp->sw_if_index));
1823  if (!mp->enable)
1824  s = format (s, "del ");
1825 
1826  FINISH;
1827 }
1828 
1830  (vl_api_vxlan_tunnel_dump_t * mp, void *handle)
1831 {
1832  u8 *s;
1833 
1834  s = format (0, "SCRIPT: vxlan_tunnel_dump ");
1835 
1836  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1837 
1838  FINISH;
1839 }
1840 
1843 {
1844  u8 *s;
1845  s = format (0, "SCRIPT: vxlan_gbp_tunnel_add_del ");
1846 
1847  if (mp->is_add)
1848  s = format (s, "add ");
1849  else
1850  s = format (s, "del ");
1851 
1852  s = format (s, "instance %d ", ntohl (mp->tunnel.instance));
1853  s = format (s, "src %U ", format_vl_api_address, &mp->tunnel.src);
1854  s = format (s, "dst %U ", format_vl_api_address, &mp->tunnel.dst);
1855  s =
1856  format (s, "mcast_sw_if_index %d ", ntohl (mp->tunnel.mcast_sw_if_index));
1857  s = format (s, "encap_table_id %d ", ntohl (mp->tunnel.encap_table_id));
1858  s = format (s, "vni %d ", ntohl (mp->tunnel.vni));
1859  s = format (s, "sw_if_index %d ", ntohl (mp->tunnel.sw_if_index));
1860 
1861  FINISH;
1862 }
1863 
1865  (vl_api_vxlan_gbp_tunnel_dump_t * mp, void *handle)
1866 {
1867  u8 *s;
1868 
1869  s = format (0, "SCRIPT: vxlan_gbp_tunnel_dump ");
1870 
1871  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1872 
1873  FINISH;
1874 }
1875 
1878 {
1879  u8 *s;
1880 
1881  s = format (0, "SCRIPT: sw_interface_set_vxlan_gbp_bypass ");
1882 
1883  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1884  s = format (s, "%s ", (mp->is_ipv6 != 0) ? "ipv6" : "ipv4");
1885  s = format (s, "%s ", (mp->enable != 0) ? "enable" : "disable");
1886 
1887  FINISH;
1888 }
1889 
1891  (vl_api_geneve_add_del_tunnel_t * mp, void *handle)
1892 {
1893  u8 *s;
1894  s = format (0, "SCRIPT: geneve_add_del_tunnel ");
1895 
1896  ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local_address);
1897  ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote_address);
1898 
1899  u8 is_grp = ip46_address_is_multicast (&remote);
1900  char *remote_name = is_grp ? "group" : "dst";
1901 
1902  s = format (s, "src %U ", format_ip46_address, &local, IP46_TYPE_ANY);
1903  s = format (s, "%s %U ", remote_name, format_ip46_address,
1904  &remote, IP46_TYPE_ANY);
1905 
1906  if (is_grp)
1907  s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
1908 
1909  if (mp->encap_vrf_id)
1910  s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
1911 
1912  s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
1913 
1914  s = format (s, "vni %d ", ntohl (mp->vni));
1915 
1916  if (mp->is_add == 0)
1917  s = format (s, "del ");
1918 
1919  FINISH;
1920 }
1921 
1923  (vl_api_geneve_tunnel_dump_t * mp, void *handle)
1924 {
1925  u8 *s;
1926 
1927  s = format (0, "SCRIPT: geneve_tunnel_dump ");
1928 
1929  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1930 
1931  FINISH;
1932 }
1933 
1935  (vl_api_gre_add_del_tunnel_t * mp, void *handle)
1936 {
1937  u8 *s;
1938  ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
1939  ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
1940 
1941  s = format (0, "SCRIPT: gre_add_del_tunnel ");
1942 
1943  s = format (s, "dst %U ", format_ip46_address, &dst, IP46_TYPE_ANY);
1944  s = format (s, "src %U ", format_ip46_address, &src, IP46_TYPE_ANY);
1945 
1946  s = format (s, "instance %d ", ntohl (mp->instance));
1947 
1948  if (mp->tunnel_type == GRE_TUNNEL_TYPE_TEB)
1949  s = format (s, "teb ");
1950 
1952  s = format (s, "erspan %d ", ntohs (mp->session_id));
1953 
1954  if (mp->outer_fib_id)
1955  s = format (s, "outer-fib-id %d ", ntohl (mp->outer_fib_id));
1956 
1957  if (mp->is_add == 0)
1958  s = format (s, "del ");
1959 
1960  FINISH;
1961 }
1962 
1963 static void *vl_api_gre_tunnel_dump_t_print
1964  (vl_api_gre_tunnel_dump_t * mp, void *handle)
1965 {
1966  u8 *s;
1967 
1968  s = format (0, "SCRIPT: gre_tunnel_dump ");
1969 
1970  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1971 
1972  FINISH;
1973 }
1974 
1976  (vl_api_l2_fib_clear_table_t * mp, void *handle)
1977 {
1978  u8 *s;
1979 
1980  s = format (0, "SCRIPT: l2_fib_clear_table ");
1981 
1982  FINISH;
1983 }
1984 
1987 {
1988  u8 *s;
1989 
1990  s = format (0, "SCRIPT: l2_interface_efp_filter ");
1991 
1992  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
1993  if (mp->enable_disable)
1994  s = format (s, "enable ");
1995  else
1996  s = format (s, "disable ");
1997 
1998  FINISH;
1999 }
2000 
2003 {
2004  u8 *s;
2005 
2006  s = format (0, "SCRIPT: l2_interface_vlan_tag_rewrite ");
2007 
2008  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2009  s = format (s, "vtr_op %d ", ntohl (mp->vtr_op));
2010  s = format (s, "push_dot1q %d ", ntohl (mp->push_dot1q));
2011  s = format (s, "tag1 %d ", ntohl (mp->tag1));
2012  s = format (s, "tag2 %d ", ntohl (mp->tag2));
2013 
2014  FINISH;
2015 }
2016 
2018  (vl_api_create_vhost_user_if_t * mp, void *handle)
2019 {
2020  u8 *s;
2021 
2022  s = format (0, "SCRIPT: create_vhost_user_if ");
2023 
2024  s = format (s, "socket %s ", mp->sock_filename);
2025  if (mp->is_server)
2026  s = format (s, "server ");
2027  if (mp->renumber)
2028  s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
2029  if (mp->disable_mrg_rxbuf)
2030  s = format (s, "disable_mrg_rxbuf ");
2031  if (mp->disable_indirect_desc)
2032  s = format (s, "disable_indirect_desc ");
2033  if (mp->tag[0])
2034  s = format (s, "tag %s", mp->tag);
2035 
2036  FINISH;
2037 }
2038 
2040  (vl_api_modify_vhost_user_if_t * mp, void *handle)
2041 {
2042  u8 *s;
2043 
2044  s = format (0, "SCRIPT: modify_vhost_user_if ");
2045 
2046  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2047  s = format (s, "socket %s ", mp->sock_filename);
2048  if (mp->is_server)
2049  s = format (s, "server ");
2050  if (mp->renumber)
2051  s = format (s, "renumber %d ", ntohl (mp->custom_dev_instance));
2052 
2053  FINISH;
2054 }
2055 
2057  (vl_api_delete_vhost_user_if_t * mp, void *handle)
2058 {
2059  u8 *s;
2060 
2061  s = format (0, "SCRIPT: delete_vhost_user_if ");
2062  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2063 
2064  FINISH;
2065 }
2066 
2069 {
2070  u8 *s;
2071 
2072  s = format (0, "SCRIPT: sw_interface_vhost_user_dump ");
2073 
2074  FINISH;
2075 }
2076 
2078  (vl_api_sw_interface_dump_t * mp, void *handle)
2079 {
2080  u8 *s;
2081 
2082  s = format (0, "SCRIPT: sw_interface_dump ");
2083 
2084  if (mp->name_filter_valid)
2085  s = format (s, "name_filter %s ", mp->name_filter);
2086  else
2087  s = format (s, "all ");
2088 
2089  FINISH;
2090 }
2091 
2093  (vl_api_l2_fib_table_dump_t * mp, void *handle)
2094 {
2095  u8 *s;
2096 
2097  s = format (0, "SCRIPT: l2_fib_table_dump ");
2098 
2099  s = format (s, "bd_id %d ", ntohl (mp->bd_id));
2100 
2101  FINISH;
2102 }
2103 
2104 static void *vl_api_control_ping_t_print
2105  (vl_api_control_ping_t * mp, void *handle)
2106 {
2107  u8 *s;
2108 
2109  s = format (0, "SCRIPT: control_ping ");
2110 
2111  FINISH;
2112 }
2113 
2115  (vl_api_want_interface_events_t * mp, void *handle)
2116 {
2117  u8 *s;
2118 
2119  s = format (0, "SCRIPT: want_interface_events pid %d enable %d ",
2120  ntohl (mp->pid), ntohl (mp->enable_disable));
2121 
2122  FINISH;
2123 }
2124 
2125 static void *
2126 vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
2127 {
2128  u8 *s;
2129 
2130  s = format (0, "SCRIPT: cli ");
2131 
2132  FINISH;
2133 }
2134 
2135 static void *vl_api_cli_inband_t_print
2136  (vl_api_cli_inband_t * mp, void *handle)
2137 {
2138  u8 *s;
2139  u8 *cmd = 0;
2140  u32 length = vl_api_string_len (&mp->cmd);
2141 
2142  vec_validate (cmd, length);
2143  clib_memcpy (cmd, vl_api_from_api_string (&mp->cmd), length);
2144 
2145  s = format (0, "SCRIPT: exec %v ", cmd);
2146 
2147  vec_free (cmd);
2148  FINISH;
2149 }
2150 
2151 static void *vl_api_memclnt_create_t_print
2152  (vl_api_memclnt_create_t * mp, void *handle)
2153 {
2154  u8 *s;
2155 
2156  s = format (0, "SCRIPT: memclnt_create name %s ", mp->name);
2157 
2158  FINISH;
2159 }
2160 
2161 static void *vl_api_sockclnt_create_t_print
2162  (vl_api_sockclnt_create_t * mp, void *handle)
2163 {
2164  u8 *s;
2165 
2166  s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name);
2167 
2168  FINISH;
2169 }
2170 
2171 static void *vl_api_show_version_t_print
2172  (vl_api_show_version_t * mp, void *handle)
2173 {
2174  u8 *s;
2175 
2176  s = format (0, "SCRIPT: show_version ");
2177 
2178  FINISH;
2179 }
2180 
2181 static void *vl_api_show_threads_t_print
2182  (vl_api_show_threads_t * mp, void *handle)
2183 {
2184  u8 *s;
2185 
2186  s = format (0, "SCRIPT: show_threads ");
2187 
2188  FINISH;
2189 }
2190 
2193 {
2194  u8 *s;
2195 
2196  s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
2197 
2198  ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local);
2199  ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote);
2200 
2201  u8 is_grp = ip46_address_is_multicast (&remote);
2202  char *remote_name = is_grp ? "group" : "remote";
2203 
2204  s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
2205  s = format (s, "%s %U ", remote_name, format_ip46_address,
2206  &remote, IP46_TYPE_ANY);
2207 
2208  if (is_grp)
2209  s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
2210  s = format (s, "protocol %d ", ntohl (mp->protocol));
2211 
2212  s = format (s, "vni %d ", ntohl (mp->vni));
2213 
2214  if (mp->is_add == 0)
2215  s = format (s, "del ");
2216 
2217  if (mp->encap_vrf_id)
2218  s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
2219 
2220  if (mp->decap_vrf_id)
2221  s = format (s, "decap-vrf-id %d ", ntohl (mp->decap_vrf_id));
2222 
2223  FINISH;
2224 }
2225 
2227  (vl_api_vxlan_gpe_tunnel_dump_t * mp, void *handle)
2228 {
2229  u8 *s;
2230 
2231  s = format (0, "SCRIPT: vxlan_gpe_tunnel_dump ");
2232 
2233  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2234 
2235  FINISH;
2236 }
2237 
2240 {
2241  u8 *s;
2242 
2243  s = format (0, "SCRIPT: interface_renumber ");
2244 
2245  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2246 
2247  s = format (s, "new_show_dev_instance %d ",
2248  ntohl (mp->new_show_dev_instance));
2249 
2250  FINISH;
2251 }
2252 
2254  (vl_api_ip_probe_neighbor_t * mp, void *handle)
2255 {
2256  u8 *s;
2257 
2258  s = format (0, "SCRIPT: ip_probe_neighbor ");
2259  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2260  s = format (s, "address %U ", format_vl_api_address, &mp->dst);
2261 
2262  FINISH;
2263 }
2264 
2267 {
2268  u8 *s;
2269 
2270  s = format (0, "SCRIPT: ip_scan_neighbor_enable_disable ");
2271 
2272  switch (mp->mode)
2273  {
2274  case IP_SCAN_V4_NEIGHBORS:
2275  s = format (s, "ip4 ");
2276  break;
2277  case IP_SCAN_V6_NEIGHBORS:
2278  s = format (s, "ip6 ");
2279  break;
2280  case IP_SCAN_V46_NEIGHBORS:
2281  s = format (s, "both ");
2282  break;
2283  default:
2284  s = format (s, "disable ");
2285  }
2286 
2287  s = format (s, "interval %d ", mp->scan_interval);
2288  s = format (s, "max-time %d ", mp->max_proc_time);
2289  s = format (s, "max-update %d ", mp->max_update);
2290  s = format (s, "delay %d ", mp->scan_int_delay);
2291  s = format (s, "stale %d ", mp->stale_threshold);
2292 
2293  FINISH;
2294 }
2295 
2297  (vl_api_want_ip4_arp_events_t * mp, void *handle)
2298 {
2299  u8 *s;
2300 
2301  s = format (0, "SCRIPT: want_ip4_arp_events ");
2302  s = format (s, "pid %d address %U ", ntohl (mp->pid),
2303  format_ip4_address, mp->ip);
2304  if (mp->enable_disable == 0)
2305  s = format (s, "del ");
2306 
2307  FINISH;
2308 }
2309 
2311  (vl_api_want_ip6_nd_events_t * mp, void *handle)
2312 {
2313  u8 *s;
2314 
2315  s = format (0, "SCRIPT: want_ip6_nd_events ");
2316  s = format (s, "pid %d address %U ", ntohl (mp->pid),
2318  if (mp->enable_disable == 0)
2319  s = format (s, "del ");
2320 
2321  FINISH;
2322 }
2323 
2325  (vl_api_want_l2_macs_events_t * mp, void *handle)
2326 {
2327  u8 *s;
2328 
2329  s = format (0, "SCRIPT: want_l2_macs_events ");
2330  s = format (s, "learn-limit %d ", ntohl (mp->learn_limit));
2331  s = format (s, "scan-delay %d ", (u32) mp->scan_delay);
2332  s = format (s, "max-entries %d ", (u32) mp->max_macs_in_event * 10);
2333  if (mp->enable_disable == 0)
2334  s = format (s, "disable");
2335 
2336  FINISH;
2337 }
2338 
2341 {
2342  u8 *s;
2343 
2344  s = format (0, "SCRIPT: input_acl_set_interface ");
2345 
2346  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2347  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2348  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2349  s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2350 
2351  if (mp->is_add == 0)
2352  s = format (s, "del ");
2353 
2354  FINISH;
2355 }
2356 
2359 {
2360  u8 *s;
2361 
2362  s = format (0, "SCRIPT: output_acl_set_interface ");
2363 
2364  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2365  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2366  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2367  s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2368 
2369  if (mp->is_add == 0)
2370  s = format (s, "del ");
2371 
2372  FINISH;
2373 }
2374 
2375 static void *vl_api_ip_address_dump_t_print
2376  (vl_api_ip_address_dump_t * mp, void *handle)
2377 {
2378  u8 *s;
2379 
2380  s = format (0, "SCRIPT: ip6_address_dump ");
2381  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2382  s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2383 
2384  FINISH;
2385 }
2386 
2387 static void *
2389 {
2390  u8 *s;
2391 
2392  s = format (0, "SCRIPT: ip_dump ");
2393  s = format (s, "is_ipv6 %d ", mp->is_ipv6 != 0);
2394 
2395  FINISH;
2396 }
2397 
2400 {
2401  u8 *s;
2402 
2403  s = format (0, "SCRIPT: cop_interface_enable_disable ");
2404  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2405  if (mp->enable_disable)
2406  s = format (s, "enable ");
2407  else
2408  s = format (s, "disable ");
2409 
2410  FINISH;
2411 }
2412 
2415 {
2416  u8 *s;
2417 
2418  s = format (0, "SCRIPT: cop_whitelist_enable_disable ");
2419  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2420  s = format (s, "fib-id %d ", ntohl (mp->fib_id));
2421  if (mp->ip4)
2422  s = format (s, "ip4 ");
2423  if (mp->ip6)
2424  s = format (s, "ip6 ");
2425  if (mp->default_cop)
2426  s = format (s, "default ");
2427 
2428  FINISH;
2429 }
2430 
2432  (vl_api_af_packet_create_t * mp, void *handle)
2433 {
2434  u8 *s;
2435 
2436  s = format (0, "SCRIPT: af_packet_create ");
2437  s = format (s, "host_if_name %s ", mp->host_if_name);
2438  if (mp->use_random_hw_addr)
2439  s = format (s, "hw_addr random ");
2440  else
2441  s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr);
2442 
2443  FINISH;
2444 }
2445 
2447  (vl_api_af_packet_delete_t * mp, void *handle)
2448 {
2449  u8 *s;
2450 
2451  s = format (0, "SCRIPT: af_packet_delete ");
2452  s = format (s, "host_if_name %s ", mp->host_if_name);
2453 
2454  FINISH;
2455 }
2456 
2457 static void *vl_api_af_packet_dump_t_print
2458  (vl_api_af_packet_dump_t * mp, void *handle)
2459 {
2460  u8 *s;
2461 
2462  s = format (0, "SCRIPT: af_packet_dump ");
2463 
2464  FINISH;
2465 }
2466 
2467 static u8 *
2468 format_policer_action (u8 * s, va_list * va)
2469 {
2470  u32 action = va_arg (*va, u32);
2471  u32 dscp = va_arg (*va, u32);
2472  char *t = 0;
2473 
2474  if (action == SSE2_QOS_ACTION_DROP)
2475  s = format (s, "drop");
2476  else if (action == SSE2_QOS_ACTION_TRANSMIT)
2477  s = format (s, "transmit");
2478  else if (action == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)
2479  {
2480  s = format (s, "mark-and-transmit ");
2481  switch (dscp)
2482  {
2483 #define _(v,f,str) case VNET_DSCP_##f: t = str; break;
2485 #undef _
2486  default:
2487  break;
2488  }
2489  s = format (s, "%s", t);
2490  }
2491  return s;
2492 }
2493 
2494 static void *vl_api_policer_add_del_t_print
2495  (vl_api_policer_add_del_t * mp, void *handle)
2496 {
2497  u8 *s;
2498 
2499  s = format (0, "SCRIPT: policer_add_del ");
2500  s = format (s, "name %s ", mp->name);
2501  s = format (s, "cir %d ", mp->cir);
2502  s = format (s, "eir %d ", mp->eir);
2503  s = format (s, "cb %d ", mp->cb);
2504  s = format (s, "eb %d ", mp->eb);
2505 
2506  switch (mp->rate_type)
2507  {
2508  case SSE2_QOS_RATE_KBPS:
2509  s = format (s, "rate_type kbps ");
2510  break;
2511  case SSE2_QOS_RATE_PPS:
2512  s = format (s, "rate_type pps ");
2513  break;
2514  default:
2515  break;
2516  }
2517 
2518  switch (mp->round_type)
2519  {
2521  s = format (s, "round_type closest ");
2522  break;
2523  case SSE2_QOS_ROUND_TO_UP:
2524  s = format (s, "round_type up ");
2525  break;
2527  s = format (s, "round_type down ");
2528  break;
2529  default:
2530  break;
2531  }
2532 
2533  switch (mp->type)
2534  {
2536  s = format (s, "type 1r2c ");
2537  break;
2539  s = format (s, "type 1r3c ");
2540  break;
2542  s = format (s, "type 2r3c-2698 ");
2543  break;
2545  s = format (s, "type 2r3c-4115 ");
2546  break;
2548  s = format (s, "type 2r3c-mef5cf1 ");
2549  break;
2550  default:
2551  break;
2552  }
2553 
2554  s = format (s, "conform_action %U ", format_policer_action,
2556  s = format (s, "exceed_action %U ", format_policer_action,
2557  mp->exceed_action_type, mp->exceed_dscp);
2558  s = format (s, "violate_action %U ", format_policer_action,
2560 
2561  if (mp->color_aware)
2562  s = format (s, "color-aware ");
2563  if (mp->is_add == 0)
2564  s = format (s, "del ");
2565 
2566  FINISH;
2567 }
2568 
2569 static void *vl_api_policer_dump_t_print
2570  (vl_api_policer_dump_t * mp, void *handle)
2571 {
2572  u8 *s;
2573 
2574  s = format (0, "SCRIPT: policer_dump ");
2575  if (mp->match_name_valid)
2576  s = format (s, "name %s ", mp->match_name);
2577 
2578  FINISH;
2579 }
2580 
2583 {
2584  u8 *s;
2585 
2586  s = format (0, "SCRIPT: policer_classify_set_interface ");
2587  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2588  if (mp->ip4_table_index != ~0)
2589  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
2590  if (mp->ip6_table_index != ~0)
2591  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
2592  if (mp->l2_table_index != ~0)
2593  s = format (s, "l2-table %d ", ntohl (mp->l2_table_index));
2594  if (mp->is_add == 0)
2595  s = format (s, "del ");
2596 
2597  FINISH;
2598 }
2599 
2601  (vl_api_policer_classify_dump_t * mp, void *handle)
2602 {
2603  u8 *s;
2604 
2605  s = format (0, "SCRIPT: policer_classify_dump ");
2606  switch (mp->type)
2607  {
2609  s = format (s, "type ip4 ");
2610  break;
2612  s = format (s, "type ip6 ");
2613  break;
2615  s = format (s, "type l2 ");
2616  break;
2617  default:
2618  break;
2619  }
2620 
2621  FINISH;
2622 }
2623 
2626 {
2627  u8 *s;
2628 
2629  s = format (0, "SCRIPT: sw_interface_clear_stats ");
2630  if (mp->sw_if_index != ~0)
2631  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2632 
2633  FINISH;
2634 }
2635 
2637  (vl_api_mpls_tunnel_dump_t * mp, void *handle)
2638 {
2639  u8 *s;
2640 
2641  s = format (0, "SCRIPT: mpls_tunnel_dump ");
2642 
2643  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2644 
2645  FINISH;
2646 }
2647 
2648 static void *vl_api_mpls_fib_dump_t_print
2649  (vl_api_mpls_fib_dump_t * mp, void *handle)
2650 {
2651  u8 *s;
2652 
2653  s = format (0, "SCRIPT: mpls_fib_decap_dump ");
2654 
2655  FINISH;
2656 }
2657 
2658 static void *vl_api_ip_fib_dump_t_print
2659  (vl_api_ip_fib_dump_t * mp, void *handle)
2660 {
2661  u8 *s;
2662 
2663  s = format (0, "SCRIPT: ip_fib_dump ");
2664 
2665  FINISH;
2666 }
2667 
2668 static void *vl_api_ip6_fib_dump_t_print
2669  (vl_api_ip6_fib_dump_t * mp, void *handle)
2670 {
2671  u8 *s;
2672 
2673  s = format (0, "SCRIPT: ip6_fib_dump ");
2674 
2675  FINISH;
2676 }
2677 
2679  (vl_api_classify_table_ids_t * mp, void *handle)
2680 {
2681  u8 *s;
2682 
2683  s = format (0, "SCRIPT: classify_table_ids ");
2684 
2685  FINISH;
2686 }
2687 
2690 {
2691  u8 *s;
2692 
2693  s = format (0, "SCRIPT: classify_table_by_interface ");
2694  if (mp->sw_if_index != ~0)
2695  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2696 
2697  FINISH;
2698 }
2699 
2701  (vl_api_classify_table_info_t * mp, void *handle)
2702 {
2703  u8 *s;
2704 
2705  s = format (0, "SCRIPT: classify_table_info ");
2706  if (mp->table_id != ~0)
2707  s = format (s, "table_id %d ", ntohl (mp->table_id));
2708 
2709  FINISH;
2710 }
2711 
2713  (vl_api_classify_session_dump_t * mp, void *handle)
2714 {
2715  u8 *s;
2716 
2717  s = format (0, "SCRIPT: classify_session_dump ");
2718  if (mp->table_id != ~0)
2719  s = format (s, "table_id %d ", ntohl (mp->table_id));
2720 
2721  FINISH;
2722 }
2723 
2725  (vl_api_set_ipfix_exporter_t * mp, void *handle)
2726 {
2727  u8 *s;
2728 
2729  s = format (0, "SCRIPT: set_ipfix_exporter ");
2730 
2731  s = format (s, "collector-address %U ", format_ip4_address,
2733  s = format (s, "collector-port %d ", ntohs (mp->collector_port));
2734  s = format (s, "src-address %U ", format_ip4_address,
2735  (ip4_address_t *) mp->src_address);
2736  s = format (s, "vrf-id %d ", ntohl (mp->vrf_id));
2737  s = format (s, "path-mtu %d ", ntohl (mp->path_mtu));
2738  s = format (s, "template-interval %d ", ntohl (mp->template_interval));
2739  s = format (s, "udp-checksum %d ", mp->udp_checksum);
2740 
2741  FINISH;
2742 }
2743 
2745  (vl_api_ipfix_exporter_dump_t * mp, void *handle)
2746 {
2747  u8 *s;
2748 
2749  s = format (0, "SCRIPT: ipfix_exporter_dump ");
2750 
2751  FINISH;
2752 }
2753 
2756 {
2757  u8 *s;
2758 
2759  s = format (0, "SCRIPT: set_ipfix_classify_stream ");
2760 
2761  s = format (s, "domain-id %d ", ntohl (mp->domain_id));
2762  s = format (s, "src-port %d ", ntohs (mp->src_port));
2763 
2764  FINISH;
2765 }
2766 
2769 {
2770  u8 *s;
2771 
2772  s = format (0, "SCRIPT: ipfix_classify_stream_dump ");
2773 
2774  FINISH;
2775 }
2776 
2779 {
2780  u8 *s;
2781 
2782  s = format (0, "SCRIPT: ipfix_classify_table_add_del ");
2783 
2784  s = format (s, "table-id %d ", ntohl (mp->table_id));
2785  s = format (s, "ip-version %d ", mp->ip_version);
2786  s = format (s, "transport-protocol %d ", mp->transport_protocol);
2787 
2788  FINISH;
2789 }
2790 
2793 {
2794  u8 *s;
2795 
2796  s = format (0, "SCRIPT: ipfix_classify_table_dump ");
2797 
2798  FINISH;
2799 }
2800 
2803 {
2804  u8 *s;
2805 
2806  s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
2807  s = format (s, "src_sw_if_index %u ", ntohl (mp->sw_if_index_from));
2808  s = format (s, "dst_sw_if_index %u ", ntohl (mp->sw_if_index_to));
2809 
2810  if (mp->is_l2)
2811  s = format (s, "l2 ");
2812 
2813  switch (mp->state)
2814  {
2815  case 0:
2816  s = format (s, "disable ");
2817  break;
2818  case 1:
2819  s = format (s, "rx ");
2820  break;
2821  case 2:
2822  s = format (s, "tx ");
2823  break;
2824  case 3:
2825  default:
2826  s = format (s, "both ");
2827  break;
2828  }
2829 
2830  FINISH;
2831 }
2832 
2833 static void *
2835  void *handle)
2836 {
2837  u8 *s;
2838 
2839  s = format (0, "SCRIPT: sw_interface_span_dump ");
2840 
2841  if (mp->is_l2)
2842  s = format (s, "l2 ");
2843 
2844  FINISH;
2845 }
2846 
2847 static void *vl_api_get_next_index_t_print
2848  (vl_api_get_next_index_t * mp, void *handle)
2849 {
2850  u8 *s;
2851 
2852  s = format (0, "SCRIPT: get_next_index ");
2853  s = format (s, "node-name %s ", mp->node_name);
2854  s = format (s, "next-node-name %s ", mp->next_name);
2855 
2856  FINISH;
2857 }
2858 
2860  (vl_api_pg_create_interface_t * mp, void *handle)
2861 {
2862  u8 *s;
2863 
2864  s = format (0, "SCRIPT: pg_create_interface ");
2865  s = format (0, "if_id %d", ntohl (mp->interface_id));
2866 
2867  FINISH;
2868 }
2869 
2870 static void *vl_api_pg_capture_t_print
2871  (vl_api_pg_capture_t * mp, void *handle)
2872 {
2873  u8 *s;
2874 
2875  s = format (0, "SCRIPT: pg_capture ");
2876  s = format (0, "if_id %d ", ntohl (mp->interface_id));
2877  s = format (0, "pcap %s", mp->pcap_file_name);
2878  if (mp->count != ~0)
2879  s = format (s, "count %d ", ntohl (mp->count));
2880  if (!mp->is_enabled)
2881  s = format (s, "disable");
2882 
2883  FINISH;
2884 }
2885 
2887  (vl_api_pg_enable_disable_t * mp, void *handle)
2888 {
2889  u8 *s;
2890 
2891  s = format (0, "SCRIPT: pg_enable_disable ");
2892  if (ntohl (mp->stream_name_length) > 0)
2893  s = format (s, "stream %s", mp->stream_name);
2894  if (!mp->is_enabled)
2895  s = format (s, "disable");
2896 
2897  FINISH;
2898 }
2899 
2902 {
2903  u8 *s;
2904  int i;
2905 
2906  s = format (0, "SCRIPT: ip_source_and_port_range_check_add_del ");
2907  s = format (s, "%U ", format_vl_api_prefix, &mp->prefix);
2908 
2909  for (i = 0; i < mp->number_of_ranges; i++)
2910  {
2911  s = format (s, "range %d - %d ", mp->low_ports[i], mp->high_ports[i]);
2912  }
2913 
2914  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
2915 
2916  if (mp->is_add == 0)
2917  s = format (s, "del ");
2918 
2919  FINISH;
2920 }
2921 
2924  void *handle)
2925 {
2926  u8 *s;
2927 
2928  s = format (0, "SCRIPT: ip_source_and_port_range_check_interface_add_del ");
2929 
2930  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
2931 
2932  if (mp->tcp_out_vrf_id != ~0)
2933  s = format (s, "tcp-out-vrf %d ", ntohl (mp->tcp_out_vrf_id));
2934 
2935  if (mp->udp_out_vrf_id != ~0)
2936  s = format (s, "udp-out-vrf %d ", ntohl (mp->udp_out_vrf_id));
2937 
2938  if (mp->tcp_in_vrf_id != ~0)
2939  s = format (s, "tcp-in-vrf %d ", ntohl (mp->tcp_in_vrf_id));
2940 
2941  if (mp->udp_in_vrf_id != ~0)
2942  s = format (s, "udp-in-vrf %d ", ntohl (mp->udp_in_vrf_id));
2943 
2944  if (mp->is_add == 0)
2945  s = format (s, "del ");
2946 
2947  FINISH;
2948 }
2949 
2951  (vl_api_lisp_enable_disable_t * mp, void *handle)
2952 {
2953  u8 *s;
2954 
2955  s = format (0, "SCRIPT: lisp_enable_disable %s",
2956  mp->is_en ? "enable" : "disable");
2957 
2958  FINISH;
2959 }
2960 
2962  (vl_api_gpe_add_del_iface_t * mp, void *handle)
2963 {
2964  u8 *s;
2965 
2966  s = format (0, "SCRIPT: gpe_add_del_iface ");
2967 
2968  s = format (s, "%s ", mp->is_add ? "up" : "down");
2969  s = format (s, "vni %d ", mp->vni);
2970  s = format (s, "%s %d ", mp->is_l2 ? "bd_id" : "table_id", mp->dp_table);
2971 
2972  FINISH;
2973 }
2974 
2977 {
2978  u8 *s;
2979 
2980  s = format (0, "SCRIPT: lisp_pitr_set_locator_set ");
2981 
2982  if (mp->is_add)
2983  s = format (s, "locator-set %s ", mp->ls_name);
2984  else
2985  s = format (s, "del");
2986 
2987  FINISH;
2988 }
2989 
2990 static u8 *
2991 format_lisp_flat_eid (u8 * s, va_list * args)
2992 {
2993  u32 type = va_arg (*args, u32);
2994  u8 *eid = va_arg (*args, u8 *);
2995  u32 eid_len = va_arg (*args, u32);
2996 
2997  switch (type)
2998  {
2999  case 0:
3000  return format (s, "%U/%d", format_ip4_address, eid, eid_len);
3001  case 1:
3002  return format (s, "%U/%d", format_ip6_address, eid, eid_len);
3003  case 3:
3004  return format (s, "%U", format_ethernet_address, eid);
3005  }
3006  return 0;
3007 }
3008 
3011 {
3012  u8 *s;
3013  u32 rloc_num = 0;
3014 
3015  s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
3016 
3017  if (mp->del_all)
3018  s = format (s, "del-all ");
3019 
3020  s = format (s, "%s ", mp->is_add ? "add" : "del");
3021  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3022 
3023  s = format (s, "eid %U ", format_lisp_flat_eid,
3024  mp->eid_type, mp->eid, mp->eid_len);
3025 
3026  if (mp->is_src_dst)
3027  {
3028  s = format (s, "seid %U ", format_lisp_flat_eid,
3029  mp->eid_type, mp->seid, mp->seid_len);
3030  }
3031  rloc_num = clib_net_to_host_u32 (mp->rloc_num);
3032 
3033  if (0 == rloc_num)
3034  s = format (s, "action %d", mp->action);
3035 
3036  FINISH;
3037 }
3038 
3040  (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
3041 {
3042  u8 *s;
3043 
3044  s = format (0, "SCRIPT: lisp_add_del_adjacency ");
3045 
3046  s = format (s, "%s ", mp->is_add ? "add" : "del");
3047  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3048  s = format (s, "reid %U leid %U ",
3049  format_lisp_flat_eid, mp->eid_type, mp->reid, mp->reid_len,
3050  format_lisp_flat_eid, mp->eid_type, mp->leid, mp->leid_len);
3051 
3052  FINISH;
3053 }
3054 
3057 {
3058  u8 *s;
3059 
3060  s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
3061 
3062  if (mp->is_add)
3063  s = format (s, "%s", mp->locator_set_name);
3064  else
3065  s = format (s, "del");
3066 
3067  FINISH;
3068 }
3069 
3072 {
3073  u8 *s;
3074 
3075  s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
3076 
3077  if (!mp->is_add)
3078  s = format (s, "del ");
3079 
3080  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3081  s = format (s, "%s %d ",
3082  mp->is_l2 ? "bd_index" : "vrf",
3083  clib_net_to_host_u32 (mp->dp_table));
3084  FINISH;
3085 }
3086 
3088  (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
3089 {
3090  u8 *s;
3091 
3092  s = format (0, "SCRIPT: lisp_add_del_local_eid ");
3093 
3094  if (!mp->is_add)
3095  s = format (s, "del ");
3096 
3097  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3098  s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
3099  mp->prefix_len);
3100  s = format (s, "locator-set %s ", mp->locator_set_name);
3101  if (*mp->key)
3102  {
3103  u32 key_id = mp->key_id;
3104  s = format (s, "key-id %U", format_hmac_key_id, key_id);
3105  s = format (s, "secret-key %s", mp->key);
3106  }
3107  FINISH;
3108 }
3109 
3111  (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle)
3112 {
3113  u8 *s;
3114 
3115  s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO");
3116 
3117  FINISH;
3118 }
3119 
3122 {
3123  u8 *s;
3124 
3125  s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
3126 
3127  if (!mp->is_add)
3128  s = format (s, "del ");
3129 
3130  if (mp->is_ipv6)
3131  s = format (s, "%U ", format_ip6_address, mp->ip_address);
3132  else
3133  s = format (s, "%U ", format_ip4_address, mp->ip_address);
3134 
3135  FINISH;
3136 }
3137 
3139  (vl_api_gpe_enable_disable_t * mp, void *handle)
3140 {
3141  u8 *s;
3142 
3143  s = format (0, "SCRIPT: gpe_enable_disable ");
3144 
3145  s = format (s, "%s ", mp->is_en ? "enable" : "disable");
3146 
3147  FINISH;
3148 }
3149 
3152 {
3153  u8 *s;
3154 
3155  s = format (0, "SCRIPT: lisp_add_del_locator_set ");
3156 
3157  if (!mp->is_add)
3158  s = format (s, "del ");
3159 
3160  s = format (s, "locator-set %s ", mp->locator_set_name);
3161 
3162  FINISH;
3163 }
3164 
3166  (vl_api_lisp_add_del_locator_t * mp, void *handle)
3167 {
3168  u8 *s;
3169 
3170  s = format (0, "SCRIPT: lisp_add_del_locator ");
3171 
3172  if (!mp->is_add)
3173  s = format (s, "del ");
3174 
3175  s = format (s, "locator-set %s ", mp->locator_set_name);
3176  s = format (s, "sw_if_index %d ", mp->sw_if_index);
3177  s = format (s, "p %d w %d ", mp->priority, mp->weight);
3178 
3179  FINISH;
3180 }
3181 
3183  (vl_api_lisp_locator_set_dump_t * mp, void *handle)
3184 {
3185  u8 *s;
3186 
3187  s = format (0, "SCRIPT: lisp_locator_set_dump ");
3188  if (mp->filter == 1)
3189  s = format (s, "local");
3190  else if (mp->filter == 2)
3191  s = format (s, "remote");
3192 
3193  FINISH;
3194 }
3195 
3197  (vl_api_lisp_locator_dump_t * mp, void *handle)
3198 {
3199  u8 *s;
3200 
3201  s = format (0, "SCRIPT: lisp_locator_dump ");
3202  if (mp->is_index_set)
3203  s = format (s, "ls_index %d", clib_net_to_host_u32 (mp->ls_index));
3204  else
3205  s = format (s, "ls_name %s", mp->ls_name);
3206 
3207  FINISH;
3208 }
3209 
3211  (vl_api_lisp_map_request_mode_t * mp, void *handle)
3212 {
3213  u8 *s;
3214 
3215  s = format (0, "SCRIPT: lisp_map_request_mode ");
3216 
3217  switch (mp->mode)
3218  {
3219  case 0:
3220  s = format (s, "dst-only");
3221  break;
3222  case 1:
3223  s = format (s, "src-dst");
3224  default:
3225  break;
3226  }
3227 
3228  FINISH;
3229 }
3230 
3232  (vl_api_lisp_eid_table_dump_t * mp, void *handle)
3233 {
3234  u8 *s;
3235 
3236  s = format (0, "SCRIPT: lisp_eid_table_dump ");
3237 
3238  if (mp->eid_set)
3239  {
3240  s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
3241  s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type,
3242  mp->eid, mp->prefix_length);
3243  switch (mp->filter)
3244  {
3245  case 1:
3246  s = format (s, "local ");
3247  break;
3248  case 2:
3249  s = format (s, "remote ");
3250  break;
3251  }
3252  }
3253  FINISH;
3254 }
3255 
3258 {
3259  u8 *s;
3260 
3261  s = format (0, "SCRIPT: lisp_rloc_probe_enable_disable ");
3262  if (mp->is_enabled)
3263  s = format (s, "enable");
3264  else
3265  s = format (s, "disable");
3266 
3267  FINISH;
3268 }
3269 
3272 {
3273  u8 *s;
3274 
3275  s = format (0, "SCRIPT: lisp_map_register_enable_disable ");
3276  if (mp->is_enabled)
3277  s = format (s, "enable");
3278  else
3279  s = format (s, "disable");
3280 
3281  FINISH;
3282 }
3283 
3285  (vl_api_lisp_adjacencies_get_t * mp, void *handle)
3286 {
3287  u8 *s;
3288 
3289  s = format (0, "SCRIPT: lisp_adjacencies_get ");
3290  s = format (s, "vni %d", clib_net_to_host_u32 (mp->vni));
3291 
3292  FINISH;
3293 }
3294 
3297 {
3298  u8 *s;
3299 
3300  s = format (0, "SCRIPT: lisp_eid_table_map_dump ");
3301 
3302  if (mp->is_l2)
3303  s = format (s, "l2");
3304  else
3305  s = format (s, "l3");
3306 
3307  FINISH;
3308 }
3309 
3312 {
3313  u8 *s;
3314 
3315  s = format (0, "SCRIPT: ipsec_tunnel_if_add_del ");
3316 
3317  if (mp->esn)
3318  s = format (s, "esn");
3319  if (mp->anti_replay)
3320  s = format (s, "anti-replay");
3321  if (mp->udp_encap)
3322  s = format (s, "udp-encap");
3323 
3324  s = format (s, "local-ip %U ", format_vl_api_address, &mp->remote_ip);
3325 
3326  s = format (s, "remote-ip %U ", format_vl_api_address, &mp->local_ip);
3327  s = format (s, "tx-table-id %d ", ntohl (mp->tx_table_id));
3328 
3329  s = format (s, "local-spi %d ", ntohl (mp->local_spi));
3330 
3331  s = format (s, "remote-spi %d ", ntohl (mp->remote_spi));
3332 
3333  s = format (s, "local-crypto-key-len %d ", mp->local_crypto_key_len);
3334  s = format (s, "local-crypto-key %U ", format_hex_bytes,
3336  s = format (s, "remote-crypto-key-len %d ", mp->remote_crypto_key_len);
3337  s = format (s, "remote-crypto-key %U ", format_hex_bytes,
3339  s = format (s, "local-integ-key-len %d ", mp->local_integ_key_len);
3340  s = format (s, "local-integ-key %U ", format_hex_bytes,
3341  mp->local_integ_key, mp->local_integ_key_len, 0);
3342  s = format (s, "remote-integ-key-len %d ", mp->remote_integ_key_len);
3343  s = format (s, "remote-integ-key %U ", format_hex_bytes,
3345 
3346  if (mp->is_add == 0)
3347  s = format (s, "del ");
3348 
3349  FINISH;
3350 }
3351 
3354 {
3355  u8 *s;
3356 
3357  s = format (0, "SCRIPT: ipsec_gre_tunnel_add_del ");
3358 
3359  s = format (s, "dst %U ", format_vl_api_ip4_address, mp->tunnel.dst);
3360 
3361  s = format (s, "src %U ", format_vl_api_ip4_address, mp->tunnel.src);
3362 
3363  s = format (s, "local_sa %d ", ntohl (mp->tunnel.local_sa_id));
3364 
3365  s = format (s, "remote_sa %d ", ntohl (mp->tunnel.remote_sa_id));
3366 
3367  if (mp->is_add == 0)
3368  s = format (s, "del ");
3369 
3370  FINISH;
3371 }
3372 
3374  (vl_api_ipsec_gre_tunnel_dump_t * mp, void *handle)
3375 {
3376  u8 *s;
3377 
3378  s = format (0, "SCRIPT: ipsec_gre_tunnel_dump ");
3379 
3380  if (mp->sw_if_index != ~0)
3381  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3382 
3383  FINISH;
3384 }
3385 
3388 {
3389  u8 *s;
3390  u32 vtr_op = ntohl (mp->vtr_op);
3391 
3392  s = format (0, "SCRIPT: l2_interface_pbb_tag_rewrite ");
3393 
3394  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3395  s = format (s, "vtr_op %d ", vtr_op);
3396  if (vtr_op != L2_VTR_DISABLED && vtr_op != L2_VTR_POP_2)
3397  {
3398  if (vtr_op == L2_VTR_TRANSLATE_2_2)
3399  s = format (s, "%d ", ntohs (mp->outer_tag));
3400  s = format (s, "dmac %U ", format_ethernet_address, &mp->b_dmac);
3401  s = format (s, "smac %U ", format_ethernet_address, &mp->b_smac);
3402  s = format (s, "sid %d ", ntohl (mp->i_sid));
3403  s = format (s, "vlanid %d ", ntohs (mp->b_vlanid));
3404  }
3405  FINISH;
3406 }
3407 
3410 {
3411  u8 *s;
3412 
3413  s = format (0, "SCRIPT: flow_classify_set_interface ");
3414  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3415  if (mp->ip4_table_index != ~0)
3416  s = format (s, "ip4-table %d ", ntohl (mp->ip4_table_index));
3417  if (mp->ip6_table_index != ~0)
3418  s = format (s, "ip6-table %d ", ntohl (mp->ip6_table_index));
3419  if (mp->is_add == 0)
3420  s = format (s, "del ");
3421 
3422  FINISH;
3423 }
3424 
3425 static void *
3427 {
3428  u8 *s;
3429 
3430  s = format (0, "SCRIPT: punt ");
3431 
3432  if (mp->punt.ipv != (u8) ~ 0)
3433  s = format (s, "ip %d ", mp->punt.ipv);
3434 
3435  s = format (s, "protocol %d ", mp->punt.l4_protocol);
3436 
3437  if (mp->punt.l4_port != (u16) ~ 0)
3438  s = format (s, "port %d ", ntohs (mp->punt.l4_port));
3439 
3440  if (!mp->is_add)
3441  s = format (s, "del ");
3442 
3443  FINISH;
3444 }
3445 
3447  (vl_api_flow_classify_dump_t * mp, void *handle)
3448 {
3449  u8 *s;
3450 
3451  s = format (0, "SCRIPT: flow_classify_dump ");
3452  switch (mp->type)
3453  {
3455  s = format (s, "type ip4 ");
3456  break;
3458  s = format (s, "type ip6 ");
3459  break;
3460  default:
3461  break;
3462  }
3463 
3464  FINISH;
3465 }
3466 
3468  (vl_api_get_first_msg_id_t * mp, void *handle)
3469 {
3470  u8 *s;
3471 
3472  s = format (0, "SCRIPT: get_first_msg_id %s ", mp->name);
3473 
3474  FINISH;
3475 }
3476 
3477 static void *vl_api_ioam_enable_t_print
3478  (vl_api_ioam_enable_t * mp, void *handle)
3479 {
3480  u8 *s;
3481 
3482  s = format (0, "SCRIPT: ioam_enable ");
3483 
3484  if (mp->trace_enable)
3485  s = format (s, "trace enabled");
3486 
3487  if (mp->pot_enable)
3488  s = format (s, "POT enabled");
3489 
3490  if (mp->seqno)
3491  s = format (s, "Seqno enabled");
3492 
3493  if (mp->analyse)
3494  s = format (s, "Analyse enabled");
3495 
3496  FINISH;
3497 }
3498 
3499 static void *vl_api_ioam_disable_t_print
3500  (vl_api_ioam_disable_t * mp, void *handle)
3501 {
3502  u8 *s;
3503 
3504  s = format (0, "SCRIPT: ioam_disable ");
3505  s = format (s, "trace disabled");
3506  s = format (s, "POT disabled");
3507  s = format (s, "Seqno disabled");
3508  s = format (s, "Analyse disabled");
3509 
3510  FINISH;
3511 }
3512 
3514  (vl_api_feature_enable_disable_t * mp, void *handle)
3515 {
3516  u8 *s;
3517 
3518  s = format (0, "SCRIPT: feature_enable_disable ");
3519  s = format (s, "arc_name %s ", mp->arc_name);
3520  s = format (s, "feature_name %s ", mp->feature_name);
3521  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3522  if (!mp->enable)
3523  s = format (s, "disable");
3524 
3525  FINISH;
3526 }
3527 
3530 {
3531  u8 *s;
3532 
3533  s = format (0, "SCRIPT: sw_interface_tag_add_del ");
3534  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3535  if (mp->is_add)
3536  s = format (s, "tag %s ", mp->tag);
3537  else
3538  s = format (s, "del ");
3539 
3540  FINISH;
3541 }
3542 
3544  (vl_api_hw_interface_set_mtu_t * mp, void *handle)
3545 {
3546  u8 *s;
3547 
3548  s = format (0, "SCRIPT: sw_interface_set_mtu ");
3549  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3550  s = format (s, "tag %d ", ntohs (mp->mtu));
3551 
3552  FINISH;
3553 }
3554 
3556  (vl_api_p2p_ethernet_add_t * mp, void *handle)
3557 {
3558  u8 *s;
3559 
3560  s = format (0, "SCRIPT: p2p_ethernet_add ");
3561  s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3562  s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3563 
3564  FINISH;
3565 }
3566 
3568  (vl_api_p2p_ethernet_del_t * mp, void *handle)
3569 {
3570  u8 *s;
3571 
3572  s = format (0, "SCRIPT: p2p_ethernet_del ");
3573  s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
3574  s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
3575 
3576  FINISH;
3577 }
3578 
3581 {
3582  u8 *s;
3583 
3584  s = format (0, "SCRIPT: tcp_configure_src_addresses ");
3585  if (mp->is_ipv6)
3586  s = format (s, "%U - %U ",
3589  else
3590  s = format (s, "%U - %U ",
3593 
3594  if (mp->vrf_id)
3595  s = format (s, "vrf %d ", ntohl (mp->vrf_id));
3596 
3597  FINISH;
3598 }
3599 
3601  (vl_api_app_namespace_add_del_t * mp, void *handle)
3602 {
3603  u8 *s, *ns_id = 0;
3605  ARRAY_LEN (mp->namespace_id) - 1);
3606  mp->namespace_id[len] = 0;
3607  s = format (0, "SCRIPT: app_namespace_add_del ");
3608  s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d "
3609  "ipv6_fib_id %d", (char *) mp->namespace_id, mp->secret,
3610  clib_net_to_host_u32 (mp->sw_if_index),
3611  clib_net_to_host_u32 (mp->ip4_fib_id),
3612  clib_net_to_host_u32 (mp->ip6_fib_id));
3613  FINISH;
3614 }
3615 
3616 static void *vl_api_lldp_config_t_print
3617  (vl_api_lldp_config_t * mp, void *handle)
3618 {
3619  u8 *s;
3620 
3621  s = format (0, "SCRIPT: lldp_config ");
3622  s = format (s, "system_name %s ", mp->system_name);
3623  s = format (s, "tx_hold %d ", ntohl (mp->tx_hold));
3624  s = format (s, "tx_interval %d ", ntohl (mp->tx_interval));
3625  FINISH;
3626 }
3627 
3629  (vl_api_dns_enable_disable_t * mp, void *handle)
3630 {
3631  u8 *s;
3632 
3633  s = format (0, "SCRIPT: dns_enable_disable ");
3634  s = format (s, "%s ", mp->enable ? "enable" : "disable");
3635 
3636  FINISH;
3637 }
3638 
3640  (vl_api_sw_interface_set_lldp_t * mp, void *handle)
3641 {
3642  u8 *s;
3643  u8 null_data[256];
3644 
3645  clib_memset (null_data, 0, sizeof (null_data));
3646 
3647  s = format (0, "SCRIPT: sw_interface_set_lldp ");
3648  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3649 
3650  if (memcmp (mp->port_desc, null_data, sizeof (mp->port_desc)))
3651  s = format (s, "port_desc %s ", mp->port_desc);
3652 
3653  if (memcmp (mp->mgmt_ip4, null_data, sizeof (mp->mgmt_ip4)))
3654  s = format (s, "mgmt_ip4 %U ", format_ip4_address, mp->mgmt_ip4);
3655 
3656  if (memcmp (mp->mgmt_ip6, null_data, sizeof (mp->mgmt_ip6)))
3657  s = format (s, "mgmt_ip6 %U ", format_ip6_address, mp->mgmt_ip6);
3658 
3659  if (memcmp (mp->mgmt_oid, null_data, sizeof (mp->mgmt_oid)))
3660  s = format (s, "mgmt_oid %s ", mp->mgmt_oid);
3661 
3662  if (mp->enable == 0)
3663  s = format (s, "disable ");
3664 
3665  FINISH;
3666 }
3667 
3670 {
3671  u8 *s;
3672 
3673  s = format (0, "SCRIPT: dns_name_server_add_del ");
3674  if (mp->is_ip6)
3675  s = format (s, "%U ", format_ip6_address,
3676  (ip6_address_t *) mp->server_address);
3677  else
3678  s = format (s, "%U ", format_ip4_address,
3679  (ip4_address_t *) mp->server_address);
3680 
3681  if (mp->is_add == 0)
3682  s = format (s, "del ");
3683 
3684  FINISH;
3685 }
3686 
3688  (vl_api_dns_resolve_name_t * mp, void *handle)
3689 {
3690  u8 *s;
3691 
3692  s = format (0, "SCRIPT: dns_resolve_name ");
3693  s = format (s, "%s ", mp->name);
3694  FINISH;
3695 }
3696 
3697 static void *vl_api_dns_resolve_ip_t_print
3698  (vl_api_dns_resolve_ip_t * mp, void *handle)
3699 {
3700  u8 *s;
3701 
3702  s = format (0, "SCRIPT: dns_resolve_ip ");
3703  if (mp->is_ip6)
3704  s = format (s, "%U ", format_ip6_address, mp->address);
3705  else
3706  s = format (s, "%U ", format_ip4_address, mp->address);
3707  FINISH;
3708 }
3709 
3711  (vl_api_session_rule_add_del_t * mp, void *handle)
3712 {
3713  u8 *s;
3714  char *proto = mp->transport_proto == 0 ? "tcp" : "udp";
3715  s = format (0, "SCRIPT: session_rule_add_del ");
3716  mp->tag[sizeof (mp->tag) - 1] = 0;
3717  if (mp->is_ip4)
3718  s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3719  mp->appns_index, mp->scope, proto, format_ip4_address,
3720  (ip4_address_t *) mp->lcl_ip, mp->lcl_plen,
3722  mp->rmt_plen, mp->action_index, mp->tag);
3723  else
3724  s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s",
3725  mp->appns_index, mp->scope, proto, format_ip6_address,
3726  (ip6_address_t *) mp->lcl_ip, mp->lcl_plen,
3728  mp->rmt_plen, mp->action_index, mp->tag);
3729  FINISH;
3730 }
3731 
3734 {
3735  u8 *s;
3736  s = format (0, "SCRIPT: ip_container_proxy_add_del ");
3737  s = format (s, "is_add %d prefix %U sw_if_index %d",
3739 
3740  FINISH;
3741 }
3742 
3745 {
3746  u8 *s;
3747 
3748  s = format (0, "SCRIPT: qos_record_enable_disable ");
3749  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
3750  s = format (s, "input_source %U ", format_qos_source,
3751  ntohl (mp->input_source));
3752 
3753  if (!mp->enable)
3754  s = format (s, "disable ");
3755 
3756  FINISH;
3757 }
3758 
3759 #define foreach_no_print_function \
3760 _(memclnt_keepalive_reply)
3761 
3762 #define _(f) \
3763 static void * vl_api_ ## f ## _t_print \
3764  (vl_api_ ## f ## _t * mp, void * handle) \
3765 { \
3766  return handle; \
3767 }
3769 #undef _
3770 
3771 #define foreach_custom_print_no_arg_function \
3772 _(lisp_eid_table_vni_dump) \
3773 _(lisp_map_resolver_dump) \
3774 _(lisp_map_server_dump) \
3775 _(show_lisp_rloc_probe_state) \
3776 _(show_lisp_map_register_state) \
3777 _(show_lisp_map_request_mode)
3778 
3779 #define _(f) \
3780 static void * vl_api_ ## f ## _t_print \
3781  (vl_api_ ## f ## _t * mp, void * handle) \
3782 { \
3783  u8 * s; \
3784  s = format (0, "SCRIPT: " #f ); \
3785  FINISH; \
3786 }
3788 #undef _
3789 #define foreach_custom_print_function \
3790 _(CREATE_LOOPBACK, create_loopback) \
3791 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
3792 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
3793 _(SW_INTERFACE_EVENT, sw_interface_event) \
3794 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
3795 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
3796 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
3797 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
3798 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
3799 _(SW_INTERFACE_SET_GENEVE_BYPASS, sw_interface_set_geneve_bypass) \
3800 _(BOND_CREATE, bond_create) \
3801 _(BOND_DELETE, bond_delete) \
3802 _(BOND_ENSLAVE, bond_enslave) \
3803 _(BOND_DETACH_SLAVE, bond_detach_slave) \
3804 _(TAP_CREATE_V2, tap_create_v2) \
3805 _(TAP_DELETE_V2, tap_delete_v2) \
3806 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) \
3807 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \
3808 _(IP_TABLE_ADD_DEL, ip_table_add_del) \
3809 _(MPLS_ROUTE_ADD_DEL, mpls_route_add_del) \
3810 _(MPLS_TABLE_ADD_DEL, mpls_table_add_del) \
3811 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
3812 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
3813 _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
3814 _(SR_MPLS_POLICY_ADD, sr_mpls_policy_add) \
3815 _(SR_MPLS_POLICY_DEL, sr_mpls_policy_del) \
3816 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
3817 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
3818 _(CREATE_VLAN_SUBIF, create_vlan_subif) \
3819 _(CREATE_SUBIF, create_subif) \
3820 _(OAM_ADD_DEL, oam_add_del) \
3821 _(RESET_FIB, reset_fib) \
3822 _(DHCP_PROXY_CONFIG, dhcp_proxy_config) \
3823 _(DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss) \
3824 _(SET_IP_FLOW_HASH, set_ip_flow_hash) \
3825 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \
3826 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \
3827 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
3828 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \
3829 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
3830 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
3831 _(SR_POLICY_ADD, sr_policy_add) \
3832 _(SR_POLICY_MOD, sr_policy_mod) \
3833 _(SR_POLICY_DEL, sr_policy_del) \
3834 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \
3835 _(L2FIB_ADD_DEL, l2fib_add_del) \
3836 _(L2FIB_FLUSH_ALL, l2fib_flush_all) \
3837 _(L2FIB_FLUSH_BD, l2fib_flush_bd) \
3838 _(L2FIB_FLUSH_INT, l2fib_flush_int) \
3839 _(L2_FLAGS, l2_flags) \
3840 _(BRIDGE_FLAGS, bridge_flags) \
3841 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table) \
3842 _(CLASSIFY_ADD_DEL_SESSION, classify_add_del_session) \
3843 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \
3844 _(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
3845 _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \
3846 _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \
3847 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \
3848 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \
3849 _(ADD_NODE_NEXT, add_node_next) \
3850 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \
3851 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \
3852 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \
3853 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \
3854 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
3855 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
3856 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
3857 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
3858 _(VXLAN_OFFLOAD_RX, vxlan_offload_rx) \
3859 _(GENEVE_ADD_DEL_TUNNEL, geneve_add_del_tunnel) \
3860 _(GENEVE_TUNNEL_DUMP, geneve_tunnel_dump) \
3861 _(GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel) \
3862 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
3863 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
3864 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \
3865 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \
3866 _(CREATE_VHOST_USER_IF, create_vhost_user_if) \
3867 _(MODIFY_VHOST_USER_IF, modify_vhost_user_if) \
3868 _(DELETE_VHOST_USER_IF, delete_vhost_user_if) \
3869 _(SW_INTERFACE_DUMP, sw_interface_dump) \
3870 _(CONTROL_PING, control_ping) \
3871 _(WANT_INTERFACE_EVENTS, want_interface_events) \
3872 _(CLI, cli) \
3873 _(CLI_INBAND, cli_inband) \
3874 _(MEMCLNT_CREATE, memclnt_create) \
3875 _(SOCKCLNT_CREATE, sockclnt_create) \
3876 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \
3877 _(SHOW_VERSION, show_version) \
3878 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
3879 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
3880 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
3881 _(VXLAN_GBP_TUNNEL_ADD_DEL, vxlan_gbp_tunnel_add_del) \
3882 _(VXLAN_GBP_TUNNEL_DUMP, vxlan_gbp_tunnel_dump) \
3883 _(SW_INTERFACE_SET_VXLAN_GBP_BYPASS, sw_interface_set_vxlan_gbp_bypass) \
3884 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
3885 _(IP_PROBE_NEIGHBOR, ip_probe_neighbor) \
3886 _(IP_SCAN_NEIGHBOR_ENABLE_DISABLE, ip_scan_neighbor_enable_disable) \
3887 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
3888 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \
3889 _(WANT_L2_MACS_EVENTS, want_l2_macs_events) \
3890 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \
3891 _(IP_ADDRESS_DUMP, ip_address_dump) \
3892 _(IP_DUMP, ip_dump) \
3893 _(DELETE_LOOPBACK, delete_loopback) \
3894 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \
3895 _(BD_IP_MAC_FLUSH, bd_ip_mac_flush) \
3896 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \
3897 _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
3898 _(AF_PACKET_CREATE, af_packet_create) \
3899 _(AF_PACKET_DELETE, af_packet_delete) \
3900 _(AF_PACKET_DUMP, af_packet_dump) \
3901 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
3902 _(MPLS_FIB_DUMP, mpls_fib_dump) \
3903 _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
3904 _(CLASSIFY_TABLE_IDS,classify_table_ids) \
3905 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface) \
3906 _(CLASSIFY_TABLE_INFO,classify_table_info) \
3907 _(CLASSIFY_SESSION_DUMP,classify_session_dump) \
3908 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \
3909 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \
3910 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \
3911 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \
3912 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \
3913 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \
3914 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \
3915 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \
3916 _(GET_NEXT_INDEX, get_next_index) \
3917 _(PG_CREATE_INTERFACE,pg_create_interface) \
3918 _(PG_CAPTURE, pg_capture) \
3919 _(PG_ENABLE_DISABLE, pg_enable_disable) \
3920 _(POLICER_ADD_DEL, policer_add_del) \
3921 _(POLICER_DUMP, policer_dump) \
3922 _(POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface) \
3923 _(POLICER_CLASSIFY_DUMP, policer_classify_dump) \
3924 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
3925  ip_source_and_port_range_check_add_del) \
3926 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
3927  ip_source_and_port_range_check_interface_add_del) \
3928 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
3929 _(GPE_ENABLE_DISABLE, gpe_enable_disable) \
3930 _(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \
3931 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
3932 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \
3933 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \
3934 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
3935 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
3936 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
3937  lisp_add_del_map_request_itr_rlocs) \
3938 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
3939 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
3940 _(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \
3941 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
3942 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
3943 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
3944 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
3945 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
3946 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \
3947 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
3948 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \
3949 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
3950 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \
3951 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \
3952 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \
3953 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \
3954 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \
3955 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \
3956 _(IPSEC_TUNNEL_IF_ADD_DEL, ipsec_tunnel_if_add_del) \
3957 _(IPSEC_GRE_TUNNEL_ADD_DEL, ipsec_gre_tunnel_add_del) \
3958 _(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \
3959 _(DELETE_SUBIF, delete_subif) \
3960 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
3961 _(SET_PUNT, set_punt) \
3962 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface) \
3963 _(FLOW_CLASSIFY_DUMP, flow_classify_dump) \
3964 _(GET_FIRST_MSG_ID, get_first_msg_id) \
3965 _(IOAM_ENABLE, ioam_enable) \
3966 _(IOAM_DISABLE, ioam_disable) \
3967 _(IP_FIB_DUMP, ip_fib_dump) \
3968 _(IP6_FIB_DUMP, ip6_fib_dump) \
3969 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) \
3970 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
3971 _(HW_INTERFACE_SET_MTU, hw_interface_set_mtu) \
3972 _(P2P_ETHERNET_ADD, p2p_ethernet_add) \
3973 _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
3974 _(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
3975 _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
3976 _(LLDP_CONFIG, lldp_config) \
3977 _(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \
3978 _(DNS_ENABLE_DISABLE, dns_enable_disable) \
3979 _(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \
3980 _(DNS_RESOLVE_NAME, dns_resolve_name) \
3981 _(DNS_RESOLVE_IP, dns_resolve_ip) \
3982 _(SESSION_RULE_ADD_DEL, session_rule_add_del) \
3983 _(OUTPUT_ACL_SET_INTERFACE, output_acl_set_interface) \
3984 _(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable) \
3985 _(MEMCLNT_KEEPALIVE_REPLY, memclnt_keepalive_reply)
3986 
3987 void
3989 {
3990 #define _(n,f) am->msg_print_handlers[VL_API_##n] \
3991  = (void *) vl_api_##f##_t_print;
3993 #undef _
3994 }
3995 
3996 /*
3997  * fd.io coding-style-patch-verification: ON
3998  *
3999  * Local Variables: eval: (c-set-style "gnu") End:
4000  */
static void * vl_api_sw_interface_set_flags_t_print(vl_api_sw_interface_set_flags_t *mp, void *handle)
Definition: custom_dump.c:108
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Definition: vec.h:439
static void * vl_api_create_vhost_user_if_t_print(vl_api_create_vhost_user_if_t *mp, void *handle)
Definition: custom_dump.c:2018
u32 sw_if_index
Definition: ipsec_gre.api:37
static u8 * format_lisp_flat_eid(u8 *s, va_list *args)
Definition: custom_dump.c:2991
static void * vl_api_sr_mpls_policy_add_t_print(vl_api_sr_mpls_policy_add_t *mp, void *handle)
Definition: custom_dump.c:967
static void * vl_api_bridge_domain_add_del_t_print(vl_api_bridge_domain_add_del_t *mp, void *handle)
Definition: custom_dump.c:336
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:1661
static void * vl_api_lisp_add_del_adjacency_t_print(vl_api_lisp_add_del_adjacency_t *mp, void *handle)
Definition: custom_dump.c:3040
Get list of policers.
Definition: policer.api:79
vl_api_vxlan_gbp_tunnel_t tunnel
Definition: vxlan_gbp.api:57
DHCP Proxy set / unset vss request.
Definition: dhcp.api:52
Proxy ARP add / del request.
Definition: ip.api:968
add or delete gpe_iface
Definition: lisp_gpe.api:89
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:221
Classify get table IDs request.
Definition: classify.api:174
static void * vl_api_mpls_fib_dump_t_print(vl_api_mpls_fib_dump_t *mp, void *handle)
Definition: custom_dump.c:2649
vl_api_address_t ip
Definition: l2.api:487
#define SR_STEER_IPV6
Definition: sr_mpls.h:42
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:2976
vl_api_proxy_arp_t proxy
Definition: ip.api:973
static void * vl_api_dns_enable_disable_t_print(vl_api_dns_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:3629
L2 FIB add entry request.
Definition: l2.api:128
cop: enable/disable whitelist filtration features on an interface Note: the supplied fib_id must matc...
Definition: cop.api:45
static void * vl_api_l2tpv3_set_tunnel_cookies_t_print(vl_api_l2tpv3_set_tunnel_cookies_t *mp, void *handle)
Definition: custom_dump.c:1711
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:1772
static void * vl_api_vxlan_offload_rx_t_print(vl_api_vxlan_offload_rx_t *mp, void *handle)
Definition: custom_dump.c:1816
Register for IP6 ND resolution event on recieving NA reply MAC/IP info from ICMP6 Neighbor Solicitati...
Definition: ip.api:856
u8 * format_hmac_key_id(u8 *s, va_list *args)
Definition: lisp_types.c:404
u32 flags
Definition: vhost_user.h:115
static void * vl_api_delete_subif_t_print(vl_api_delete_subif_t *mp, void *handle)
Definition: custom_dump.c:1098
static void * vl_api_l2_patch_add_del_t_print(vl_api_l2_patch_add_del_t *mp, void *handle)
Definition: custom_dump.c:1353
#define clib_min(x, y)
Definition: clib.h:295
static void * vl_api_lisp_locator_set_dump_t_print(vl_api_lisp_locator_set_dump_t *mp, void *handle)
Definition: custom_dump.c:3183
static void * vl_api_lisp_map_request_mode_t_print(vl_api_lisp_map_request_mode_t *mp, void *handle)
Definition: custom_dump.c:3211
enable/disable LISP RLOC probing
Definition: lisp.api:233
static void * vl_api_delete_loopback_t_print(vl_api_delete_loopback_t *mp, void *handle)
Definition: custom_dump.c:97
Reset fib table request.
Definition: ip.api:1031
IPFIX classify tables dump request.
static void * vl_api_sw_interface_slave_dump_t_print(vl_api_sw_interface_slave_dump_t *mp, void *handle)
Definition: custom_dump.c:715
#define SR_STEER_IPV4
Definition: sr_mpls.h:41
u8 * format_vl_api_mac_address(u8 *s, va_list *args)
Definition: types.c:82
#define foreach_create_subif_bit
Definition: custom_dump.c:1063
static void * vl_api_sr_mpls_policy_del_t_print(vl_api_sr_mpls_policy_del_t *mp, void *handle)
Definition: custom_dump.c:992
#define SR_BEHAVIOR_X
Definition: sr.h:38
static void * vl_api_reset_fib_t_print(vl_api_reset_fib_t *mp, void *handle)
Definition: custom_dump.c:1129
Dump IP fib table.
Definition: ip.api:53
static void * vl_api_geneve_tunnel_dump_t_print(vl_api_geneve_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1923
Create or delete a VXLAN-GBP tunnel.
Definition: vxlan_gbp.api:52
Transparent Ethernet Bridging - the tunnel is in L2 mode.
Definition: gre.h:50
vl_api_l2_port_type_t port_type
Definition: l2.api:467
static void * vl_api_lisp_add_del_locator_t_print(vl_api_lisp_add_del_locator_t *mp, void *handle)
Definition: custom_dump.c:3166
static void * vl_api_vxlan_gbp_tunnel_dump_t_print(vl_api_vxlan_gbp_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:1865
static void * vl_api_cli_inband_t_print(vl_api_cli_inband_t *mp, void *handle)
Definition: custom_dump.c:2136
static void * vl_api_bond_enslave_t_print(vl_api_bond_enslave_t *mp, void *handle)
Definition: custom_dump.c:678
vnet_main_t * vnet_get_main(void)
Definition: misc.c:47
static void * vl_api_ioam_enable_t_print(vl_api_ioam_enable_t *mp, void *handle)
Definition: custom_dump.c:3478
static void * vl_api_lisp_adjacencies_get_t_print(vl_api_lisp_adjacencies_get_t *mp, void *handle)
Definition: custom_dump.c:3285
Set/unset policer classify interface.
Definition: classify.api:135
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:3529
configure or disable LISP PITR node
Definition: lisp.api:157
Set flags on the interface.
Definition: interface.api:33
vl_api_ip_neighbor_t neighbor
Definition: ip.api:144
Control ping from client to api server request.
Definition: vpe.api:59
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:3409
static void * vl_api_interface_name_renumber_t_print(vl_api_interface_name_renumber_t *mp, void *handle)
Definition: custom_dump.c:2239
static void * vl_api_add_node_next_t_print(vl_api_add_node_next_t *mp, void *handle)
Definition: custom_dump.c:1677
static void * vl_api_l2_fib_clear_table_t_print(vl_api_l2_fib_clear_table_t *mp, void *handle)
Definition: custom_dump.c:1976
vl_api_ip6_address_t ip
Definition: ip.api:862
static void * vl_api_bd_ip_mac_flush_t_print(vl_api_bd_ip_mac_flush_t *mp, void *handle)
Definition: custom_dump.c:522
static void * vl_api_sr_steering_add_del_t_print(vl_api_sr_steering_add_del_t *mp, void *handle)
Definition: custom_dump.c:1450
iOAM disable
Definition: ip.api:1077
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
Set max allowed ARP or ip6 neighbor entries request.
Definition: ip.api:1045
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:3071
Interface set vxlan-bypass request.
Definition: vxlan.api:81
add/del session rule
Definition: session.api:402
u8 * format_vl_api_address(u8 *s, va_list *args)
Definition: types.c:23
static void * vl_api_input_acl_set_interface_t_print(vl_api_input_acl_set_interface_t *mp, void *handle)
Definition: custom_dump.c:2340
Set an interface&#39;s rx-placement Rx-Queue placement on specific thread is operational for only hardwar...
Definition: interface.api:396
VXLAN GPE definitions.
static void * vl_api_control_ping_t_print(vl_api_control_ping_t *mp, void *handle)
Definition: custom_dump.c:2105
static void * vl_api_ip_add_del_route_t_print(vl_api_ip_add_del_route_t *mp, void *handle)
Definition: custom_dump.c:726
Dump af_packet interfaces request.
Definition: af_packet.api:73
u32 mpls_label_t
A label value only, i.e.
Definition: packet.h:24
Definition: l2_bd.h:151
static void * vl_api_mpls_tunnel_add_del_t_print(vl_api_mpls_tunnel_add_del_t *mp, void *handle)
Definition: custom_dump.c:928
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:3151
#define IP_SCAN_V6_NEIGHBORS
Definition: ip_neighbor.h:23
Classify add / del session request.
Definition: classify.api:109
IPFIX exporter dump request.
#define SR_BEHAVIOR_DT6
Definition: sr.h:44
#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:81
static void * vl_api_bridge_domain_dump_t_print(vl_api_bridge_domain_dump_t *mp, void *handle)
Definition: custom_dump.c:373
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:3296
L2 bridge domain set mac age.
Definition: l2.api:233
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:2002
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
Definition: vec.h:560
for(i=1;i<=collision_buckets;i++)
int i
static void * vl_api_bond_create_t_print(vl_api_bond_create_t *mp, void *handle)
Definition: custom_dump.c:646
static void * vl_api_flow_classify_dump_t_print(vl_api_flow_classify_dump_t *mp, void *handle)
Definition: custom_dump.c:3447
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:2115
static void * vl_api_sw_interface_clear_stats_t_print(vl_api_sw_interface_clear_stats_t *mp, void *handle)
Definition: custom_dump.c:2625
static void * vl_api_gre_add_del_tunnel_t_print(vl_api_gre_add_del_tunnel_t *mp, void *handle)
Definition: custom_dump.c:1935
Request for lisp_eid_table_map_details.
Definition: lisp.api:611
Initialize a new virtio pci interface with the given paramters.
Definition: virtio.api:29
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:424
Dump virtio pci interfaces request.
Definition: virtio.api:66
Add/Delete classification table request.
Definition: classify.api:43
IPv6 router advertisement config request.
Definition: ip.api:221
L2 bridge domain request operational state details.
Definition: l2.api:273
vl_api_ip4_address_t dst
Definition: ipsec_gre.api:39
Dump MPLS fib table.
Definition: mpls.api:184
#define IP_SCAN_V46_NEIGHBORS
Definition: ip_neighbor.h:24
static void * vl_api_session_rule_add_del_t_print(vl_api_session_rule_add_del_t *mp, void *handle)
Definition: custom_dump.c:3711
static void * vl_api_output_acl_set_interface_t_print(vl_api_output_acl_set_interface_t *mp, void *handle)
Definition: custom_dump.c:2358
Enable / disable packet generator request.
Definition: pg.api:71
static void * vl_api_ipsec_gre_tunnel_dump_t_print(vl_api_ipsec_gre_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:3374
static void * vl_api_sw_interface_set_rx_placement_t_print(vl_api_sw_interface_set_rx_placement_t *mp, void *handle)
Definition: custom_dump.c:124
static void * vl_api_classify_add_del_table_t_print(vl_api_classify_add_del_table_t *mp, void *handle)
Definition: custom_dump.c:1577
static void * vl_api_dhcp_proxy_set_vss_t_print(vl_api_dhcp_proxy_set_vss_t *mp, void *handle)
Definition: custom_dump.c:1175
vhost-user interface create request
Definition: vhost_user.api:27
vl_api_fib_mpls_label_t next_hop_out_label_stack[next_hop_n_out_labels]
Definition: ip.api:426
Dump IP6 fib table.
Definition: ip.api:81
u8 * format_vl_api_ip6_address(u8 *s, va_list *args)
Definition: types.c:61
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:2192
DNS IP -> name resolution request.
Definition: dns.api:84
static void * vl_api_bridge_flags_t_print(vl_api_bridge_flags_t *mp, void *handle)
Definition: custom_dump.c:479
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:1729
Delete virtio pci interface.
Definition: virtio.api:58
unsigned char u8
Definition: types.h:56
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:914
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:293
vl_api_address_t remote_ip
Definition: ipsec.api:385
vl_api_srv6_sid_list_t sids
Definition: sr.api:110
#define SR_BEHAVIOR_DT4
Definition: sr.h:45
static void * vl_api_proxy_arp_add_del_t_print(vl_api_proxy_arp_add_del_t *mp, void *handle)
Definition: custom_dump.c:895
static void * vl_api_ip_dump_t_print(vl_api_ip_dump_t *mp, void *handle)
Definition: custom_dump.c:2388
static void * vl_api_l2fib_add_del_t_print(vl_api_l2fib_add_del_t *mp, void *handle)
Definition: custom_dump.c:422
static uword ip46_address_is_multicast(const ip46_address_t *a)
Definition: ip6_packet.h:178
Process a vpe parser cli string request.
Definition: vpe.api:84
static void * vl_api_l2_flags_t_print(vl_api_l2_flags_t *mp, void *handle)
Definition: custom_dump.c:452
static void * vl_api_create_vlan_subif_t_print(vl_api_create_vlan_subif_t *mp, void *handle)
Definition: custom_dump.c:1048
static void * vl_api_l2fib_flush_bd_t_print(vl_api_l2fib_flush_bd_t *mp, void *handle)
Definition: custom_dump.c:398
static void * vl_api_lisp_enable_disable_t_print(vl_api_lisp_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:2951
static void * vl_api_oam_add_del_t_print(vl_api_oam_add_del_t *mp, void *handle)
Definition: custom_dump.c:1109
#define clib_memcpy(d, s, n)
Definition: string.h:180
static void * vl_api_sockclnt_create_t_print(vl_api_sockclnt_create_t *mp, void *handle)
Definition: custom_dump.c:2162
static void * vl_api_sr_policy_add_t_print(vl_api_sr_policy_add_t *mp, void *handle)
Definition: custom_dump.c:1486
Dump tap interfaces request.
Definition: tapv2.api:108
Dump ipsec gre tunnel table.
Definition: ipsec_gre.api:65
add or delete LISP adjacency adjacency
Definition: lisp.api:365
u8 pcap_file_name[pcap_name_length]
Definition: pg.api:62
vl_api_mac_address_t mac
Definition: l2.api:488
static void * vl_api_p2p_ethernet_del_t_print(vl_api_p2p_ethernet_del_t *mp, void *handle)
Definition: custom_dump.c:3568
PacketGenerator capture packets on given interface request.
Definition: pg.api:54
static void * vl_api_vxlan_gpe_tunnel_dump_t_print(vl_api_vxlan_gpe_tunnel_dump_t *mp, void *handle)
Definition: custom_dump.c:2227
format_function_t format_ip4_address
Definition: format.h:75
static void * vl_api_ipfix_classify_stream_dump_t_print(vl_api_ipfix_classify_stream_dump_t *mp, void *handle)
Definition: custom_dump.c:2768
static void * vl_api_ip_fib_dump_t_print(vl_api_ip_fib_dump_t *mp, void *handle)
Definition: custom_dump.c:2659
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:3257
u8 * format_ethernet_address(u8 *s, va_list *args)
Definition: format.c:44
Proxy ARP add / del interface request.
Definition: ip.api:999
Clear interface statistics.
Definition: interface.api:304
static void * vl_api_memclnt_create_t_print(vl_api_memclnt_create_t *mp, void *handle)
Definition: custom_dump.c:2152
Interface set geneve-bypass request.
Definition: geneve.api:66
Add / del table request A table can be added multiple times, but need be deleted only once...
Definition: ip.api:40
vl_api_srv6_sid_list_t sids
Definition: sr.api:86
static void * vl_api_l2tpv3_set_lookup_key_t_print(vl_api_l2tpv3_set_lookup_key_t *mp, void *handle)
Definition: custom_dump.c:1744
static void * vl_api_dhcp_proxy_config_t_print(vl_api_dhcp_proxy_config_t *mp, void *handle)
Definition: custom_dump.c:1145
#define SR_BEHAVIOR_LAST
Definition: sr.h:46
Classify sessions dump request.
Definition: classify.api:267
static u8 * format_policer_action(u8 *s, va_list *va)
Definition: custom_dump.c:2468
MPLS Route Add / del route.
Definition: mpls.api:110
Set interface source and L4 port-range request.
Definition: ip.api:738
Set/unset output ACL interface.
Definition: classify.api:406
static void * vl_api_ip_table_add_del_t_print(vl_api_ip_table_add_del_t *mp, void *handle)
Definition: custom_dump.c:863
static void * vl_api_mpls_route_add_del_t_print(vl_api_mpls_route_add_del_t *mp, void *handle)
Definition: custom_dump.c:786
static void * vl_api_get_next_index_t_print(vl_api_get_next_index_t *mp, void *handle)
Definition: custom_dump.c:2848
u32 feature_bitmap
Definition: l2.api:212
vl_api_address_t local_ip
Definition: ipsec.api:384
add/del application namespace
Definition: session.api:360
static void * vl_api_ip_address_dump_t_print(vl_api_ip_address_dump_t *mp, void *handle)
Definition: custom_dump.c:2376
static void * vl_api_qos_record_enable_disable_t_print(vl_api_qos_record_enable_disable_t *mp, void *handle)
Definition: custom_dump.c:3744
u8 * format_hex_bytes(u8 *s, va_list *va)
Definition: std-formats.c:84
static void * vl_api_policer_dump_t_print(vl_api_policer_dump_t *mp, void *handle)
Definition: custom_dump.c:2570
#define VSS_TYPE_ASCII
Definition: dhcp_proxy.h:66
L2 FIB flush bridge domain entries.
Definition: l2.api:99
#define IP_SCAN_V4_NEIGHBORS
Definition: ip_neighbor.h:22
add or delete map request itr rlocs
Definition: lisp.api:384
static void * vl_api_cli_t_print(vl_api_cli_t *mp, void *handle)
Definition: custom_dump.c:2126
Delete host-interface.
Definition: af_packet.api:51
Set/unset input ACL interface.
Definition: classify.api:384
static void * vl_api_set_ipfix_classify_stream_t_print(vl_api_set_ipfix_classify_stream_t *mp, void *handle)
Definition: custom_dump.c:2755
unsigned int u32
Definition: types.h:88
static void * vl_api_lisp_eid_table_dump_t_print(vl_api_lisp_eid_table_dump_t *mp, void *handle)
Definition: custom_dump.c:3232
static void * vl_api_sw_interface_virtio_pci_dump_t_print(vl_api_sw_interface_virtio_pci_dump_t *mp, void *handle)
Definition: custom_dump.c:636
static void * vl_api_sw_interface_set_table_t_print(vl_api_sw_interface_set_table_t *mp, void *handle)
Definition: custom_dump.c:203
u8 dst_address[4]
Definition: oam.api:67