ip: Use .api declared error counters
[vpp.git] / src / vnet / ip / ip.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2018 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /** \file
18
19     This file defines vpp IP control-plane API messages which are generally
20     called through a shared memory interface.
21 */
22
23 option version = "3.2.0";
24
25 import "vnet/interface_types.api";
26 import "vnet/fib/fib_types.api";
27 import "vnet/ethernet/ethernet_types.api";
28 import "vnet/mfib/mfib_types.api";
29 import "vnet/interface_types.api";
30
31 /** \brief An IP table
32     @param is_ipv6 - V4 or V6 table
33     @param table_id - table ID associated with the route
34                      This table ID will apply to both the unicast
35                       and multicast FIBs
36     @param name - A client provided name/tag for the table. If this is
37                   not set by the client, then VPP will generate something
38                   meaningful.
39 */
40 typedef ip_table
41 {
42   u32 table_id;
43   bool is_ip6;
44   string name[64];
45 };
46
47 /** \brief Add / del table request
48            A table can be added multiple times, but need be deleted only once.
49     @param client_index - opaque cookie to identify the sender
50     @param context - sender context, to match reply w/ request
51 */
52 autoreply define ip_table_add_del
53 {
54   u32 client_index;
55   u32 context;
56   bool is_add [default=true];
57   vl_api_ip_table_t table;
58 };
59
60 /** \brief Allocate an unused table
61            A table can be added multiple times.
62            If a large number of tables are in use (millions), this API might
63            fail to find a free ID with very low probability, and will return
64            EAGAIN. A subsequent attempt may be successful.
65   @param client_index - opaque cookie to identify the sender
66   @param context - sender context, to match reply w/ request
67   @param table - if table.table_id == ~0, vpp allocates an unused table_id and
68                     proceeds as in ip_table_add_del with is_add = true
69                  if table.table_id != ~0, vpp uses the table.table_id and
70                     proceeds as in ip_table_add_del with is_add = true
71                  table.table_id should never be 0
72 */
73 define ip_table_allocate
74 {
75   u32 client_index;
76   u32 context;
77
78   vl_api_ip_table_t table;
79 };
80
81 define ip_table_allocate_reply
82 {
83   u32 context;
84   i32 retval;
85
86   vl_api_ip_table_t table;
87 };
88
89 /** \brief Dump IP all fib tables
90     @param client_index - opaque cookie to identify the sender
91     @param context - sender context, to match reply w/ request
92 */
93 define ip_table_dump
94 {
95   u32 client_index;
96   u32 context;
97 };
98
99 /** \brief IP table replace being
100
101     The use-case is that, for some unspecified reason, the control plane
102     has a very different set of entries it wants in the table than VPP
103     currently has. The CP would thus like to 'replace' VPP's current table
104     only by specifying what the new set of entries shall be, i.e. it is not
105     going to delete anything that already exists.
106     the CP declares the start of this procedure with this begin_replace
107     API Call, and when it has populated all the entries it wants, it calls
108     the below end_replace API. From this point on it is of course free
109     to add and delete entries as usual.
110     The underlying mechanism by which VPP implements this replace is
111     purposefully left unspecified.
112
113     @param client_index - opaque cookie to identify the sender
114     @param context - sender context, to match reply w/ request
115     @param table - The table to resync
116 */
117 autoreply define ip_table_replace_begin
118 {
119   u32 client_index;
120   u32 context;
121   vl_api_ip_table_t table;
122 };
123
124 /** \brief IP table replace end
125
126     see replace start/
127
128     @param client_index - opaque cookie to identify the sender
129     @param context - sender context, to match reply w/ request
130     @param table - The table that has converged
131 */
132 autoreply define ip_table_replace_end
133 {
134   u32 client_index;
135   u32 context;
136   vl_api_ip_table_t table;
137 };
138
139 /** \brief IP table flush
140     Flush a table of all routes
141     @param client_index - opaque cookie to identify the sender
142     @param context - sender context, to match reply w/ request
143     @param table - The table to flush
144 */
145 autoreply define ip_table_flush
146 {
147   u32 client_index;
148   u32 context;
149   vl_api_ip_table_t table;
150 };
151
152 /** \brief IP FIB table response
153     @param context - sender context
154     @param table - description of the table
155 */
156 define ip_table_details
157 {
158   u32 context;
159   vl_api_ip_table_t table;
160 };
161
162 /** \brief An IP route
163   @param table_id The IP table the route is in
164   @param stats_index The index of the route in the stats segment
165   @param prefix the prefix for the route
166   @param n_paths The number of paths the route has
167   @param src The entity adding the route. either 0 for default
168              or a value returned from fib_source_sdd.
169   @param paths The paths of the route
170 */
171 typedef ip_route
172 {
173   u32 table_id;
174   u32 stats_index;
175   vl_api_prefix_t prefix;
176   u8 n_paths;
177   vl_api_fib_path_t paths[n_paths];
178 };
179 typedef ip_route_v2
180 {
181   u32 table_id;
182   u32 stats_index;
183   vl_api_prefix_t prefix;
184   u8 n_paths;
185   u8 src;
186   vl_api_fib_path_t paths[n_paths];
187 };
188
189 /** \brief Add / del route request
190     @param client_index - opaque cookie to identify the sender
191     @param context - sender context, to match reply w/ request
192     @param is_multipath - Set to 1 if these paths will be added/removed
193                           to/from the existing set, or 0 to replace
194                           the existing set.
195                           is_add=0 & is_multipath=0 implies delete all paths
196     @param is_add - Are the paths being added or removed
197 */
198 define ip_route_add_del
199 {
200   u32 client_index;
201   u32 context;
202   bool is_add [default=true];
203   bool is_multipath;
204   vl_api_ip_route_t route;
205 };
206 define ip_route_add_del_v2
207 {
208   option in_progress;
209   u32 client_index;
210   u32 context;
211   bool is_add [default=true];
212   bool is_multipath;
213   vl_api_ip_route_v2_t route;
214 };
215 define ip_route_add_del_reply
216 {
217   u32 context;
218   i32 retval;
219   u32 stats_index;
220 };
221 define ip_route_add_del_v2_reply
222 {
223   option in_progress;
224   u32 context;
225   i32 retval;
226   u32 stats_index;
227 };
228
229 /** \brief Dump IP routes from a table
230     @param client_index - opaque cookie to identify the sender
231     @param src The entity adding the route. either 0 for default
232                or a value returned from fib_source_sdd.
233     @param table - The table from which to dump routes (ony ID an AF are needed)
234 */
235 define ip_route_dump
236 {
237   u32 client_index;
238   u32 context;
239   vl_api_ip_table_t table;
240 };
241 define ip_route_v2_dump
242 {
243   option in_progress;
244   u32 client_index;
245   u32 context;
246   /* vl_api_fib_source_t src; */
247   u8 src;
248   vl_api_ip_table_t table;
249 };
250
251 /** \brief IP FIB table entry response
252     @param route The route entry in the table
253 */
254 define ip_route_details
255 {
256   u32 context;
257   vl_api_ip_route_t route;
258 };
259 define ip_route_v2_details
260 {
261   option in_progress;
262   u32 context;
263   vl_api_ip_route_v2_t route;
264 };
265
266 /** \brief Lookup IP route from a table
267     @param client_index - opaque cookie to identify the sender
268     @param table_id - The IP table to look the route up in
269     @param exact - 0 for normal route lookup, 1 for exact match only
270     @param prefix - The prefix (or host) for route lookup.
271 */
272 define ip_route_lookup
273 {
274   u32 client_index;
275   u32 context;
276   u32 table_id;
277   u8 exact;
278   vl_api_prefix_t prefix;
279 };
280 define ip_route_lookup_v2
281 {
282   option in_progress;
283   u32 client_index;
284   u32 context;
285   u32 table_id;
286   u8 exact;
287   vl_api_prefix_t prefix;
288 };
289
290 /** \brief IP FIB table lookup response
291     @param retval - return code of the lookup
292     @param route - The route entry in the table if found
293 */
294 define ip_route_lookup_reply
295 {
296   u32 context;
297   i32 retval;
298   vl_api_ip_route_t route;
299 };
300 define ip_route_lookup_v2_reply
301 {
302   option in_progress;
303   u32 context;
304   i32 retval;
305   vl_api_ip_route_v2_t route;
306 };
307
308 /** \brief Set the ip flow hash config for a fib request
309     @param client_index - opaque cookie to identify the sender
310     @param context - sender context, to match reply w/ request
311     @param vrf_id - vrf/fib id
312     @param is_ipv6 - if non-zero the fib is ip6, else ip4
313     @param src - if non-zero include src in flow hash
314     @param dst - if non-zero include dst in flow hash
315     @param sport - if non-zero include sport in flow hash
316     @param dport - if non-zero include dport in flow hash
317     @param proto -if non-zero include proto in flow hash
318     @param reverse - if non-zero include reverse in flow hash
319     @param symmetric - if non-zero include symmetry in flow hash
320 */
321 autoreply define set_ip_flow_hash
322 {
323   option deprecated;
324   u32 client_index;
325   u32 context;
326   u32 vrf_id;
327   bool is_ipv6;
328   bool src;
329   bool dst;
330   bool sport;
331   bool dport;
332   bool proto;
333   bool reverse;
334   bool symmetric;
335 };
336
337 /**
338     @brief flow hash settings for an IP table
339     @param src - include src in flow hash
340     @param dst - include dst in flow hash
341     @param sport - include sport in flow hash
342     @param dport - include dport in flow hash
343     @param proto - include proto in flow hash
344     @param reverse - include reverse in flow hash
345     @param symmetric - include symmetry in flow hash
346     @param flowlabel - include flowlabel in flow hash
347 */
348 enumflag ip_flow_hash_config
349 {
350   IP_API_FLOW_HASH_SRC_IP = 0x01,
351   IP_API_FLOW_HASH_DST_IP = 0x02,
352   IP_API_FLOW_HASH_SRC_PORT = 0x04,
353   IP_API_FLOW_HASH_DST_PORT = 0x08,
354   IP_API_FLOW_HASH_PROTO = 0x10,
355   IP_API_FLOW_HASH_REVERSE = 0x20,
356   IP_API_FLOW_HASH_SYMETRIC = 0x40,
357   IP_API_FLOW_HASH_FLOW_LABEL = 0x80,
358 };
359
360 autoreply define set_ip_flow_hash_v2
361 {
362   u32 client_index;
363   u32 context;
364   u32 table_id;
365   vl_api_address_family_t af;
366   vl_api_ip_flow_hash_config_t flow_hash_config;
367 };
368
369 /** \brief Set the ip flow hash router ID
370     @param client_index - opaque cookie to identify the sender
371     @param context - sender context, to match reply w/ request
372     @param router_id - The ID of the router. Mixed into the hash.
373                        Used to prevent polarisation across a network,
374                        since each router is assumed to have a different ID
375 */
376 autoreply define set_ip_flow_hash_router_id
377 {
378   u32 client_index;
379   u32 context;
380   u32 router_id;
381 };
382
383 /** \brief IPv6 interface enable / disable request
384     @param client_index - opaque cookie to identify the sender
385     @param context - sender context, to match reply w/ request
386     @param sw_if_index - interface used to reach neighbor
387     @param enable - if non-zero enable ip6 on interface, else disable
388 */
389 autoreply define sw_interface_ip6_enable_disable
390 {
391   u32 client_index;
392   u32 context;
393   vl_api_interface_index_t sw_if_index;
394   bool enable;                  /* set to true if enable */
395 };
396
397 /** \brief Dump IP multicast fib table
398     @param client_index - opaque cookie to identify the sender
399 */
400 define ip_mtable_dump
401 {
402   u32 client_index;
403   u32 context;
404 };
405 define ip_mtable_details
406 {
407   u32 client_index;
408   u32 context;
409   vl_api_ip_table_t table;
410 };
411
412 /** \brief Add / del route request
413
414     Adds a route, consisting both of the MFIB entry to match packets
415     (which may already exist) and a path to send those packets down.
416     Routes can be entered repeatedly to add multiple paths.  Deletions are
417     per-path.
418
419     @param client_index - opaque cookie to identify the sender
420     @param context - sender context, to match reply w/ request
421     @param table_id - fib table /vrf associated with the route
422     @param is_add - true if adding a route; false if deleting one
423     @param is_ipv6 - true iff all the addresses are v6
424     @param entry_flags - see fib_entry_flag_t
425     @param itf_flags - see mfib_entry_flags_t
426     @param next_hop_afi - see dpo_proto_t; the type of destination description
427     @param src_address - the source of the packet
428     @param grp_address - the group the packet is destined to
429     @param nh_address - the nexthop to forward the packet to
430     @param next_hop_sw_if_index - interface to emit packet on
431
432     BIER AFIs use the BIER imposition ID.  v4 and v6 AFIs use either the
433     interface or the nexthop address.
434
435     Note that if the route is source-specific (S is supplied, not all 0s),
436     the prefix match is treated as exact (prefixlen /32 or /128).
437
438     FIXME not complete yet
439 */
440 typedef ip_mroute
441 {
442   u32 table_id;
443   vl_api_mfib_entry_flags_t entry_flags;
444   u32 rpf_id;
445   vl_api_mprefix_t prefix;
446   u8 n_paths;
447   vl_api_mfib_path_t paths[n_paths];
448 };
449
450 define ip_mroute_add_del
451 {
452   u32 client_index;
453   u32 context;
454   bool is_add [default=true];
455   bool is_multipath;
456   vl_api_ip_mroute_t route;
457 };
458 define ip_mroute_add_del_reply
459 {
460   u32 context;
461   i32 retval;
462   u32 stats_index;
463 };
464
465 /** \brief Dump IP multicast fib table
466     @param table - The table from which to dump routes (ony ID an AF are needed)
467 */
468 define ip_mroute_dump
469 {
470   u32 client_index;
471   u32 context;
472   vl_api_ip_table_t table;
473 };
474
475 /** \brief IP Multicast Route Details
476     @param route - Details of the route
477 */
478 define ip_mroute_details
479 {
480   u32 context;
481   vl_api_ip_mroute_t route;
482 };
483
484 define ip_address_details
485 {
486   u32 context;
487   vl_api_interface_index_t sw_if_index;
488   vl_api_address_with_prefix_t prefix;
489 };
490
491 define ip_address_dump
492 {
493   u32 client_index;
494   u32 context;
495   vl_api_interface_index_t sw_if_index;
496   bool is_ipv6;
497 };
498
499 /** \brief IP unnumbered configurations
500     @param sw_if_index The interface that has unnumbered configuration
501     @param ip_sw_if_index The IP interface that it is unnumbered to
502 */
503 define ip_unnumbered_details
504 {
505   u32 context;
506   vl_api_interface_index_t sw_if_index;
507   vl_api_interface_index_t ip_sw_if_index;
508 };
509
510 /** \brief Dump IP unnumbered configurations
511     @param sw_if_index ~0 for all interfaces, else the interface desired
512 */
513 define ip_unnumbered_dump
514 {
515   u32 client_index;
516   u32 context;
517   vl_api_interface_index_t sw_if_index [default=0xffffffff];
518 };
519
520 define ip_details
521 {
522   u32 context;
523   vl_api_interface_index_t sw_if_index;
524   bool is_ipv6;
525 };
526
527 define ip_dump
528 {
529   u32 client_index;
530   u32 context;
531   bool is_ipv6;
532 };
533
534 define mfib_signal_dump
535 {
536   u32 client_index;
537   u32 context;
538 };
539
540 define mfib_signal_details
541 {
542   u32 context;
543   vl_api_interface_index_t sw_if_index;
544   u32 table_id;
545   vl_api_mprefix_t prefix;
546   u16 ip_packet_len;
547   u8 ip_packet_data[256];
548 };
549
550 /** \brief IP punt policer
551     @param client_index - opaque cookie to identify the sender
552     @param context - sender context, to match reply w/ request
553     @param is_add - 1 to add neighbor, 0 to delete
554     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
555     @param policer_index - Index of policer to use
556 */
557 autoreply define ip_punt_police
558 {
559   u32 client_index;
560   u32 context;
561   u32 policer_index;
562   bool is_add [default=true];
563   bool is_ip6;
564 };
565
566 /** \brief Punt redirect type
567     @param rx_sw_if_index - specify the original RX interface of traffic
568                             that should be redirected. ~0 means any interface.
569     @param tx_sw_if_index - the TX interface to which traffic should be
570                             redirected.
571     @param nh - the next-hop to redirect the traffic to.
572     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
573 */
574 typedef punt_redirect
575 {
576   vl_api_interface_index_t rx_sw_if_index;
577   vl_api_interface_index_t tx_sw_if_index;
578   vl_api_address_t nh;
579 };
580
581 /** \brief IP punt redirect
582     @param client_index - opaque cookie to identify the sender
583     @param context - sender context, to match reply w/ request
584     @param punt - punt definition
585     @param is_add - 1 to add neighbor, 0 to delete
586 */
587 autoreply define ip_punt_redirect
588 {
589   option deprecated;
590   u32 client_index;
591   u32 context;
592   vl_api_punt_redirect_t punt;
593   bool is_add [default=true];
594 };
595
596 define ip_punt_redirect_dump
597 {
598   u32 client_index;
599   u32 context;
600   vl_api_interface_index_t sw_if_index;
601   bool is_ipv6;
602 };
603
604 define ip_punt_redirect_details
605 {
606   u32 context;
607   vl_api_punt_redirect_t punt;
608 };
609
610 /** \brief Punt redirect type
611     @param rx_sw_if_index - specify the original RX interface of traffic
612                             that should be redirected. ~0 means any interface.
613     @param af - Address family (ip4 or ip6)
614     @param paths - the TX paths to which traffic should be redirected.
615 */
616 typedef punt_redirect_v2
617 {
618   vl_api_interface_index_t rx_sw_if_index [default=0xffffffff];
619   vl_api_address_family_t af;
620   u32 n_paths;
621   vl_api_fib_path_t paths[n_paths];
622 };
623
624 /** \brief Add IP punt redirect rule
625     @param client_index - opaque cookie to identify the sender
626     @param context - sender context, to match reply w/ request
627     @param punt - punt definition
628     @param is_add - 1 to add punt_redirect rule, 0 to delete
629 */
630 autoreply define add_del_ip_punt_redirect_v2
631 {
632   u32 client_index;
633   u32 context;
634   bool is_add [default=true];
635   vl_api_punt_redirect_v2_t punt;
636 };
637
638 define ip_punt_redirect_v2_dump
639 {
640   u32 client_index;
641   u32 context;
642   vl_api_interface_index_t sw_if_index;
643   vl_api_address_family_t af;
644 };
645
646 define ip_punt_redirect_v2_details
647 {
648   u32 context;
649   vl_api_punt_redirect_v2_t punt;
650 };
651
652 autoreply define ip_container_proxy_add_del
653 {
654   u32 client_index;
655   u32 context;
656   vl_api_prefix_t pfx;
657   vl_api_interface_index_t sw_if_index;
658   bool is_add [default=true];
659 };
660
661 define ip_container_proxy_dump
662 {
663   u32 client_index;
664   u32 context;
665 };
666
667 define ip_container_proxy_details
668 {
669   u32 context;
670   vl_api_interface_index_t sw_if_index;
671   vl_api_prefix_t prefix;
672 };
673
674 /** \brief Configure IP source and L4 port-range check
675     @param client_index - opaque cookie to identify the sender
676     @param context - sender context, to match reply w/ request
677     @param is_ip6 - 1 if source address type is IPv6
678     @param is_add - 1 if add, 0 if delete
679     @param ip - prefix to match
680     @param number_of_ranges - length of low_port and high_port arrays (must match)
681     @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
682     @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
683     @param vrf_id - fib table/vrf id to associate the source and port-range check with
684     @note To specify a single port set low_port and high_port entry the same
685 */
686 autoreply define ip_source_and_port_range_check_add_del
687 {
688   u32 client_index;
689   u32 context;
690   bool is_add [default=true];
691   vl_api_prefix_t prefix;
692   u8 number_of_ranges;
693   u16 low_ports[32];
694   u16 high_ports[32];
695   u32 vrf_id;
696 };
697
698 /** \brief Set interface source and L4 port-range request
699     @param client_index - opaque cookie to identify the sender
700     @param context - sender context, to match reply w/ request
701     @param interface_id - interface index
702     @param tcp_vrf_id - VRF associated with source and TCP port-range check
703     @param udp_vrf_id - VRF associated with source and TCP port-range check
704 */
705 autoreply define ip_source_and_port_range_check_interface_add_del
706 {
707   u32 client_index;
708   u32 context;
709   bool is_add [default=true];
710   vl_api_interface_index_t sw_if_index;
711   u32 tcp_in_vrf_id;
712   u32 tcp_out_vrf_id;
713   u32 udp_in_vrf_id;
714   u32 udp_out_vrf_id;
715 };
716
717 /** \brief IPv6 set link local address on interface request
718     @param client_index - opaque cookie to identify the sender
719     @param context - sender context, to match reply w/ request
720     @param sw_if_index - interface to set link local on
721     @param ip - the new link local address
722 */
723 autoreply define sw_interface_ip6_set_link_local_address
724 {
725   u32 client_index;
726   u32 context;
727   vl_api_interface_index_t sw_if_index;
728   vl_api_ip6_address_t ip;
729 };
730
731 /** \brief IPv6 get link local address on interface request
732     @param client_index - opaque cookie to identify the sender
733     @param context - sender context, to match reply w/ request
734     @param sw_if_index - interface to set link local on
735 */
736 define sw_interface_ip6_get_link_local_address
737 {
738   u32 client_index;
739   u32 context;
740   vl_api_interface_index_t sw_if_index;
741 };
742
743 /** \brief IPv6 link local address detail
744     @param context - sender context, to match reply w/ request
745     @param ip - the link local address
746 */
747 define sw_interface_ip6_get_link_local_address_reply
748 {
749   u32 context;
750   i32 retval;
751   vl_api_ip6_address_t ip;
752 };
753
754 /** \brief IOAM enable : Enable in-band OAM
755     @param id - profile id
756     @param seqno - To enable Seqno Processing
757     @param analyse - Enabling analysis of iOAM at decap node
758     @param pow_enable - Proof of Work enabled or not flag
759     @param trace_enable - iOAM Trace enabled or not flag
760 */
761 autoreply define ioam_enable
762 {
763   u32 client_index;
764   u32 context;
765   u16 id;
766   bool seqno;
767   bool analyse;
768   bool pot_enable;
769   bool trace_enable;
770   u32 node_id;
771 };
772
773 /** \brief iOAM disable
774     @param client_index - opaque cookie to identify the sender
775     @param context - sender context, to match reply w/ request
776     @param index - MAP Domain index
777 */
778 autoreply define ioam_disable
779 {
780   u32 client_index;
781   u32 context;
782   u16 id;
783 };
784
785 enum ip_reass_type
786 {
787   IP_REASS_TYPE_FULL = 0,
788   IP_REASS_TYPE_SHALLOW_VIRTUAL = 0x1,
789 };
790
791 autoreply define ip_reassembly_set
792 {
793   u32 client_index;
794   u32 context;
795   u32 timeout_ms;
796   u32 max_reassemblies;
797   u32 max_reassembly_length;
798   u32 expire_walk_interval_ms;
799   bool is_ip6;
800   vl_api_ip_reass_type_t type;
801 };
802
803 define ip_reassembly_get
804 {
805   u32 client_index;
806   u32 context;
807   bool is_ip6;
808   vl_api_ip_reass_type_t type;
809 };
810
811 define ip_reassembly_get_reply
812 {
813   u32 context;
814   i32 retval;
815   u32 timeout_ms;
816   u32 max_reassemblies;
817   u32 max_reassembly_length;
818   u32 expire_walk_interval_ms;
819   bool is_ip6;
820 };
821
822 /** \brief Enable/disable reassembly feature
823     @param client_index - opaque cookie to identify the sender
824     @param context - sender context, to match reply w/ request
825     @param sw_if_index - interface to enable/disable feature on
826     @param enable_ip4 - enable ip4 reassembly if non-zero, disable if 0
827     @param enable_ip6 - enable ip6 reassembly if non-zero, disable if 0
828 */
829 autoreply define ip_reassembly_enable_disable
830 {
831   u32 client_index;
832   u32 context;
833   vl_api_interface_index_t sw_if_index;
834   bool enable_ip4;
835   bool enable_ip6;
836   vl_api_ip_reass_type_t type;
837 };
838
839 /** enable/disable full reassembly of packets aimed at our addresses */
840 autoreply define ip_local_reass_enable_disable
841 {
842   u32 client_index;
843   u32 context;
844   bool enable_ip4;
845   bool enable_ip6;
846 };
847
848 /** get status of local reassembly */
849 define ip_local_reass_get
850 {
851   u32 client_index;
852   u32 context;
853 };
854
855 define ip_local_reass_get_reply
856 {
857   u32 context;
858   i32 retval;
859   bool ip4_is_enabled;
860   bool ip6_is_enabled;
861 };
862
863 /**
864     @brief Set a Path MTU value. i.e. a MTU value for a given neighbour.
865            The neighbour can be described as attached (w/ interface and next-hop)
866            or remote (w/ table_id and next-hop);
867     @param client_index - opaque cookie to identify the sender
868     @param context - sender context, to match reply w/ request
869     @param table_id - table-ID for next-hop
870     @param nh - Next hop
871     @param path_mtu - value to set, 0 is disable.
872 */
873 typedef ip_path_mtu
874 {
875   u32 client_index;
876   u32 context;
877   u32 table_id;
878   vl_api_address_t nh;
879   u16 path_mtu;
880 };
881 autoreply define ip_path_mtu_update
882 {
883   u32 client_index;
884   u32 context;
885   vl_api_ip_path_mtu_t pmtu;
886 };
887 define ip_path_mtu_get
888 {
889   u32 client_index;
890   u32 context;
891   u32 cursor;
892 };
893 define ip_path_mtu_get_reply
894 {
895   u32 context;
896   i32 retval;
897   u32 cursor;
898 };
899 define ip_path_mtu_details
900 {
901   u32 context;
902   vl_api_ip_path_mtu_t pmtu;
903 };
904 service {
905   rpc ip_path_mtu_get returns ip_path_mtu_get_reply
906     stream ip_path_mtu_details;
907 };
908
909 autoreply define ip_path_mtu_replace_begin
910 {
911   u32 client_index;
912   u32 context;
913 };
914 autoreply define ip_path_mtu_replace_end
915 {
916   u32 client_index;
917   u32 context;
918 };
919
920 counters ip_frag {
921   none {
922     severity info;
923     type counter64;
924     units "packets";
925     description "packet fragmented";
926   };
927   small_packet {
928     severity error;
929     type counter64;
930     units "packets";
931     description "packet smaller than MTU";
932   };
933   fragment_sent {
934     severity info;
935     type counter64;
936     units "packets";
937     description "number of sent fragments";
938   };
939   cant_fragment_header {
940     severity error;
941     type counter64;
942     units "packets";
943     description "can't fragment header";
944   };
945   dont_fragment_set {
946     severity error;
947     type counter64;
948     units "packets";
949     description "can't fragment this packet";
950   };
951   malformed {
952     severity error;
953     type counter64;
954     units "packets";
955     description "malformed packet";
956   };
957   memory {
958     severity error;
959     type counter64;
960     units "packets";
961     description "could not allocate buffer";
962   };
963   unknown {
964     severity error;
965     type counter64;
966     units "packets";
967     description "unknown error";
968   };
969 };
970
971 counters ip4 {
972   /* Must be first. */
973   none {
974     severity info;
975     type counter64;
976     units "packets";
977     description "valid ip4 packets";
978   };
979
980   /* Errors signalled by ip4-input */
981   too_short {
982     severity error;
983     type counter64;
984     units "packets";
985     description "ip4 length < 20 bytes";
986   };
987   bad_length {
988     severity error;
989     type counter64;
990     units "packets";
991     description "ip4 length > l2 length";
992   };
993   bad_checksum {
994     severity error;
995     type counter64;
996     units "packets";
997     description "bad ip4 checksum";
998   };
999   version {
1000     severity error;
1001     type counter64;
1002     units "packets";
1003     description "ip4 version != 4";
1004   };
1005   options {
1006     severity info;
1007     type counter64;
1008     units "packets";
1009     description "ip4 options present";
1010   };
1011   fragment_offset_one {
1012     severity error;
1013     type counter64;
1014     units "packets";
1015     description "ip4 fragment offset == 1";
1016   };
1017   time_expired {
1018     severity error;
1019     type counter64;
1020     units "packets";
1021     description "ip4 ttl <= 1";
1022   };
1023
1024   /* Errors signalled by ip4-rewrite. */
1025   mtu_exceeded {
1026     severity error;
1027     type counter64;
1028     units "packets";
1029     description "ip4 MTU exceeded and DF set";
1030   };
1031   dst_lookup_miss {
1032     severity error;
1033     type counter64;
1034     units "packets";
1035     description "ip4 destination lookup miss";
1036   };
1037   src_lookup_miss {
1038     severity error;
1039     type counter64;
1040     units "packets";
1041     description "ip4 source lookup miss";
1042   };
1043   drop {
1044     severity error;
1045     type counter64;
1046     units "packets";
1047     description "ip4 drop";
1048   };
1049   punt {
1050     severity error;
1051     type counter64;
1052     units "packets";
1053     description "ip4 punt";
1054   };
1055   same_interface {
1056     severity error;
1057     type counter64;
1058     units "packets";
1059     description "ip4 egress interface same as ingress";
1060   };
1061
1062   /* errors signalled by ip4-local. */
1063   unknown_protocol {
1064     severity error;
1065     type counter64;
1066     units "packets";
1067     description "unknown ip protocol";
1068   };
1069   tcp_checksum {
1070     severity error;
1071     type counter64;
1072     units "packets";
1073     description "bad tcp checksum";
1074   };
1075   udp_checksum {
1076     severity error;
1077     type counter64;
1078     units "packets";
1079     description "bad udp checksum";
1080   };
1081   udp_length {
1082     severity error;
1083     type counter64;
1084     units "packets";
1085     description "inconsistent udp/ip lengths";
1086   };
1087
1088   /* spoofed packets in ip4-rewrite-local */
1089   spoofed_local_packets {
1090     severity error;
1091     type counter64;
1092     units "packets";
1093     description "ip4 spoofed local-address packet drops";
1094   };
1095
1096   /* Errors signalled by ip4-inacl */
1097   inacl_table_miss {
1098     severity error;
1099     type counter64;
1100     units "packets";
1101     description "input ACL table-miss drops";
1102   };
1103   inacl_session_deny {
1104     severity error;
1105     type counter64;
1106     units "packets";
1107     description "input ACL session deny drops";
1108   };
1109
1110   /* Errors singalled by ip4-outacl */
1111   outacl_table_miss {
1112     severity error;
1113     type counter64;
1114     units "packets";
1115     description "output ACL table-miss drops";
1116   };
1117   outacl_session_deny {
1118     severity error;
1119     type counter64;
1120     units "packets";
1121     description "output ACL session deny drops";
1122   };
1123
1124   /* Errors from mfib-forward */
1125   rpf_failure {
1126     severity error;
1127     type counter64;
1128     units "packets";
1129     description "Multicast RPF check failed";
1130   };
1131
1132   /* Errors signalled by ip4-reassembly */
1133   reass_duplicate_fragment {
1134     severity error;
1135     type counter64;
1136     units "packets";
1137     description "duplicate/overlapping fragments";
1138   };
1139   reass_limit_reached {
1140     severity error;
1141     type counter64;
1142     units "packets";
1143     description "drops due to concurrent reassemblies limit";
1144   };
1145   reass_fragment_chain_too_long {
1146     severity error;
1147     type counter64;
1148     units "packets";
1149     description "fragment chain too long (drop)";
1150   };
1151   reass_no_buf {
1152     severity error;
1153     type counter64;
1154     units "packets";
1155     description "out of buffers (drop)";
1156   };
1157   reass_malformed_packet {
1158     severity error;
1159     type counter64;
1160     units "packets";
1161     description "malformed packets";
1162   };
1163   reass_internal_error {
1164     severity error;
1165     type counter64;
1166     units "packets";
1167     description "drops due to internal reassembly error";
1168   };
1169   reass_timeout {
1170     severity error;
1171     type counter64;
1172     units "packets";
1173     description "fragments dropped due to reassembly timeout";
1174   };
1175   reass_to_custom_app {
1176     severity error;
1177     type counter64;
1178     units "packets";
1179     description "send to custom drop app";
1180   };
1181   reass_success {
1182     severity info;
1183     type counter64;
1184     units "packets";
1185     description "successful reassemblies";
1186   };
1187   reass_fragments_reassembled {
1188     severity info;
1189     type counter64;
1190     units "packets";
1191     description "fragments reassembled";
1192   };
1193   reass_fragments_rcvd {
1194     severity info;
1195     type counter64;
1196     units "packets";
1197     description "fragments received";
1198   };
1199   reass_unsupp_ip_prot {
1200     severity error;
1201     type counter64;
1202     units "packets";
1203     description "unsupported ip protocol";
1204   };
1205 };
1206
1207 /**
1208  * IPv6 Error/info counters
1209  */
1210 counters ip6 {
1211   /* Must be first. */
1212   none {
1213     severity info;
1214     type counter64;
1215     units "packets";
1216     description "valid ip6 packets";
1217   };
1218
1219   /* Errors signalled by ip6-input */
1220   too_short {
1221     severity error;
1222     type counter64;
1223     units "packets";
1224     description "ip6 length < 40 bytes";
1225   };
1226   bad_length {
1227     severity error;
1228     type counter64;
1229     units "packets";
1230     description "ip6 length > l2 length";
1231   };
1232   version {
1233     severity error;
1234     type counter64;
1235     units "packets";
1236     description "ip6 version != 6";
1237   };
1238   time_expired {
1239     severity error;
1240     type counter64;
1241     units "packets";
1242     description "ip6 ttl <= 1";
1243   };
1244
1245   /* Errors signalled by ip6-rewrite. */
1246   mtu_exceeded {
1247     severity error;
1248     type counter64;
1249     units "packets";
1250     description "ip6 MTU exceeded";
1251   };
1252   dst_lookup_miss {
1253     severity error;
1254     type counter64;
1255     units "packets";
1256     description "ip6 destination lookup miss";
1257   };
1258   src_lookup_miss {
1259     severity error;
1260     type counter64;
1261     units "packets";
1262     description "ip6 source lookup miss";
1263   };
1264   drop {
1265     severity error;
1266     type counter64;
1267     units "packets";
1268     description "ip6 drop";
1269   };
1270   punt {
1271     severity error;
1272     type counter64;
1273     units "packets";
1274     description "ip6 punt";
1275   };
1276
1277   /* errors signalled by ip6-local. */
1278   unknown_protocol {
1279     severity error;
1280     type counter64;
1281     units "packets";
1282     description "unknown ip protocol";
1283   };
1284   udp_checksum {
1285     severity error;
1286     type counter64;
1287     units "packets";
1288     description "bad udp checksum";
1289   };
1290   icmp_checksum {
1291     severity error;
1292     type counter64;
1293     units "packets";
1294     description "bad icmp checksum";
1295   };
1296   udp_length {
1297     severity error;
1298     type counter64;
1299     units "packets";
1300     description "inconsistent udp/ip lengths";
1301   };
1302   /* Errors signalled by udp6-lookup. */
1303   unknown_udp_port {
1304     severity error;
1305     type counter64;
1306     units "packets";
1307     description "no listener for udp port";
1308   };
1309
1310   /* spoofed packets in ip6-rewrite-local */
1311   spoofed_local_packets {
1312     severity error;
1313     type counter64;
1314     units "packets";
1315     description "ip6 spoofed local-address packet drops";
1316   };
1317
1318   /* Errors signalled by ip6-inacl */
1319   inacl_table_miss {
1320     severity error;
1321     type counter64;
1322     units "packets";
1323     description "input ACL table-miss drops";
1324   };
1325   inacl_session_deny {
1326     severity error;
1327     type counter64;
1328     units "packets";
1329     description "input ACL session deny drops";
1330   };
1331
1332   /* Errors singalled by ip6-outacl */
1333   outacl_table_miss {
1334     severity error;
1335     type counter64;
1336     units "packets";
1337     description "output ACL table-miss drops";
1338   };
1339   outacl_session_deny {
1340     severity error;
1341     type counter64;
1342     units "packets";
1343     description "output ACL session deny drops";
1344   };
1345
1346   /* Errors from mfib-forward */
1347   rpf_failure {
1348     severity error;
1349     type counter64;
1350     units "packets";
1351     description "Multicast RPF check failed";
1352   };
1353
1354   /* Errors signalled by ip6-reassembly */
1355   reass_missing_upper {
1356     severity error;
1357     type counter64;
1358     units "packets";
1359     description "missing-upper layer drops";
1360   };
1361   reass_duplicate_fragment {
1362     severity error;
1363     type counter64;
1364     units "packets";
1365     description "duplicate fragments";
1366   };
1367   reass_overlapping_fragment {
1368     severity error;
1369     type counter64;
1370     units "packets";
1371     description "overlapping fragments";
1372   };
1373   reass_limit_reached {
1374     severity error;
1375     type counter64;
1376     units "packets";
1377     description "drops due to concurrent reassemblies limit";
1378   };
1379   reass_fragment_chain_too_long {
1380     severity error;
1381     type counter64;
1382     units "packets";
1383     description "fragment chain too long (drop)";
1384   };
1385   reass_no_buf {
1386     severity error;
1387     type counter64;
1388     units "packets";
1389     description "out of buffers (drop)";
1390   };
1391   reass_timeout {
1392     severity error;
1393     type counter64;
1394     units "packets";
1395     description "fragments dropped due to reassembly timeout";
1396   };
1397   reass_internal_error {
1398     severity error;
1399     type counter64;
1400     units "packets";
1401     description "drops due to internal reassembly error";
1402   };
1403   reass_invalid_frag_len {
1404     severity error;
1405     type counter64;
1406     units "packets";
1407     description "invalid fragment length";
1408   };
1409   reass_to_custom_app {
1410     severity error;
1411     type counter64;
1412     units "packets";
1413     description "send to custom drop app";
1414   };
1415   reass_no_frag_hdr {
1416     severity error;
1417     type counter64;
1418     units "packets";
1419     description "no fragmentation header";
1420   };
1421   reass_invalid_frag_size {
1422     severity error;
1423     type counter64;
1424     units "packets";
1425     description "drop due to invalid fragment size";
1426   };
1427   reass_success {
1428     severity info;
1429     type counter64;
1430     units "packets";
1431     description "successful reassemblies";
1432   };
1433   reass_fragments_reassembled {
1434     severity info;
1435     type counter64;
1436     units "packets";
1437     description "fragments reassembled";
1438   };
1439   reass_fragments_rcvd {
1440     severity info;
1441     type counter64;
1442     units "packets";
1443     description "fragments received";
1444   };
1445   reass_unsupp_ip_proto {
1446     severity error;
1447     type counter64;
1448     units "packets";
1449     description "unsupported ip protocol";
1450   };
1451 };
1452
1453 paths {
1454   "/err/ip-frag" "ip_frag";
1455   "/err/mpls-frag" "ip_frag";
1456   "/err/ip4-mpls-label-disposition-pipe" "ip4";
1457   "/err/ip4-mpls-label-disposition-uniform" "ip4";
1458   "/err/ip4-local" "ip4";
1459   "/err/ip4-input" "ip4";
1460   "/err/ip4-full-reassembly" "ip4";
1461   "/err/ip4-local-full-reassembly" "ip4";
1462   "/err/ip4-full-reassembly-feature" "ip4";
1463   "/err/ip4-full-reassembly-custom" "ip4";
1464   "/err/ip4-full-reassembly-expire-walk" "ip4";
1465   "/err/ip4-sv-reassembly" "ip4";
1466   "/err/ip4-sv-reassembly-feature" "ip4";
1467   "/err/ip4-sv-reassembly-output-feature" "ip4";
1468   "/err/ip4-sv-reassembly-custom-next" "ip4";
1469   "/err/ip4-sv-reassembly-expire-walk" "ip4";
1470   "/err/ip6-mpls-label-disposition-pipe" "ip6";
1471   "/err/ip6-mpls-label-disposition-uniform" "ip6";
1472   "/err/ip6-local" "ip6";
1473   "/err/ip6-input" "ip6";
1474   "/err/ip6-full-reassembly" "ip6";
1475   "/err/ip6-local-full-reassembly" "ip6";
1476   "/err/ip6-full-reassembly-feature" "ip6";
1477   "/err/ip6-full-reassembly-custom" "ip6";
1478   "/err/ip6-full-reassembly-expire-walk" "ip6";
1479   "/err/ip6-sv-reassembly" "ip6";
1480   "/err/ip6-sv-reassembly-feature" "ip6";
1481   "/err/ip6-sv-reassembly-output-feature" "ip6";
1482   "/err/ip6-sv-reassembly-custom-next" "ip6";
1483   "/err/ip6-sv-reassembly-expire-walk" "ip6";
1484 };
1485
1486 /*
1487  * Local Variables:
1488  * eval: (c-set-style "gnu")
1489  * End:
1490  */