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