vppapigen: support per-file (major,minor,patch) version stamps
[vpp.git] / src / vnet / ip / ip.api
1 /*
2  * Copyright (c) 2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 /** \file
17
18     This file defines vpp IP control-plane API messages which are generally
19     called through a shared memory interface. 
20 */
21
22 vl_api_version 1.0.0
23
24 /** \brief Add / del table request
25            A table can be added multiple times, but need be deleted only once.
26     @param client_index - opaque cookie to identify the sender
27     @param context - sender context, to match reply w/ request
28     @param is_ipv6 - V4 or V6 table
29     @param table_id - table ID associated with the route
30                       This table ID will apply to both the unicats
31                       and mlticast FIBs
32     @param name - A client provided name/tag for the table. If this is
33                   not set by the client, then VPP will generate something
34                   meaningfull.
35 */
36 autoreply define ip_table_add_del
37 {
38   u32 client_index;
39   u32 context;
40   u32 table_id;
41   u8 is_ipv6;
42   u8 is_add;
43   u8 name[64];
44 };
45
46 /** \brief Dump IP fib table
47     @param client_index - opaque cookie to identify the sender
48 */
49 define ip_fib_dump
50 {
51   u32 client_index;
52   u32 context;
53 };
54
55 /** \brief FIB path
56     @param sw_if_index - index of the interface
57     @param weight - The weight, for UCMP
58     @param preference - The preference of the path. lowest preference is prefered
59     @param is_local - local if non-zero, else remote
60     @param is_drop - Drop the packet
61     @param is_unreach - Drop the packet and rate limit send ICMP unreachable
62     @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
63     @param afi - the afi of the next hop, IP46_TYPE_IP4=1, IP46_TYPE_IP6=2
64     @param next_hop[16] - the next hop address
65
66     WARNING: this type is replicated, pending cleanup completion
67 */
68 typeonly manual_print manual_endian define fib_path
69 {
70   u32 sw_if_index;
71   u8 weight;
72   u8 preference;
73   u8 is_local;
74   u8 is_drop;
75   u8 is_unreach;
76   u8 is_prohibit;
77   u8 afi;
78   u8 next_hop[16];
79 };
80
81 /** \brief IP FIB table response
82     @param table_id - IP fib table id
83     @address_length - mask length
84     @address - ip4 prefix
85     @param count - the number of fib_path in path
86     @param path  - array of of fib_path structures
87 */
88 manual_endian manual_print define ip_fib_details
89 {
90   u32 context;
91   u32 table_id;
92   u8  table_name[64];
93   u8  address_length;
94   u8  address[4];
95   u32 count;
96   vl_api_fib_path_t path[count];
97 };
98
99 /** \brief Dump IP6 fib table
100     @param client_index - opaque cookie to identify the sender
101 */
102 define ip6_fib_dump
103 {
104   u32 client_index;
105   u32 context;
106 };
107
108 /** \brief IP6 FIB table entry response
109     @param table_id - IP6 fib table id
110     @param address_length - mask length
111     @param address - ip6 prefix
112     @param count - the number of fib_path in path
113     @param path  - array of of fib_path structures
114 */
115 manual_endian manual_print define ip6_fib_details
116 {
117   u32 context;
118   u32 table_id;
119   u8  table_name[64];
120   u8  address_length;
121   u8  address[16];
122   u32 count;
123   vl_api_fib_path_t path[count];
124 };
125
126 /** \brief Dump IP neighboors
127     @param client_index - opaque cookie to identify the sender
128     @param context - sender context, to match reply w/ request
129     @param sw_if_index - the interface to dump neighboors
130     @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
131 */
132 define ip_neighbor_dump
133 {
134     u32 client_index;
135     u32 context;
136     u32 sw_if_index;
137     u8  is_ipv6;
138 };
139
140 /** \brief IP neighboors dump response
141     @param context - sender context which was passed in the request
142     @param is_static - [1|0] to indicate if neighbor is statically configured
143     @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
144 */
145 define ip_neighbor_details {
146     u32 context;
147     u8  is_static;
148     u8  is_ipv6;
149     u8  mac_address[6];
150     u8  ip_address[16];
151 };
152
153 /** \brief IP neighbor add / del request
154     @param client_index - opaque cookie to identify the sender
155     @param context - sender context, to match reply w/ request
156     @param sw_if_index - interface used to reach neighbor
157     @param is_add - 1 to add neighbor, 0 to delete
158     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
159     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
160     @param is_static - A static neighbor Entry - there are not flushed
161                        If the interface goes down.
162     @param is_no_adj_fib - Do not create a corresponding entry in the FIB
163                            table for the neighbor.
164     @param mac_address - l2 address of the neighbor
165     @param dst_address - ip4 or ip6 address of the neighbor
166 */
167 autoreply define ip_neighbor_add_del
168 {
169   u32 client_index;
170   u32 context;
171   u32 sw_if_index;
172   /* 1 = add, 0 = delete */
173   u8 is_add;
174   u8 is_ipv6;
175   u8 is_static;
176   u8 is_no_adj_fib;
177   u8 mac_address[6];
178   u8 dst_address[16];
179 };
180
181 /** \brief Set the ip flow hash config for a fib request
182     @param client_index - opaque cookie to identify the sender
183     @param context - sender context, to match reply w/ request
184     @param vrf_id - vrf/fib id
185     @param is_ipv6 - if non-zero the fib is ip6, else ip4
186     @param src - if non-zero include src in flow hash
187     @param dst - if non-zero include dst in flow hash
188     @param sport - if non-zero include sport in flow hash
189     @param dport - if non-zero include dport in flow hash
190     @param proto -if non-zero include proto in flow hash
191     @param reverse - if non-zero include reverse in flow hash
192 */
193 autoreply define set_ip_flow_hash
194 {
195   u32 client_index;
196   u32 context;
197   u32 vrf_id;
198   u8 is_ipv6;
199   u8 src;
200   u8 dst;
201   u8 sport;
202   u8 dport;
203   u8 proto;
204   u8 reverse;
205 };
206
207 /** \brief IPv6 router advertisement config request
208     @param client_index - opaque cookie to identify the sender
209     @param context - sender context, to match reply w/ request
210     @param suppress -
211     @param managed -
212     @param other -
213     @param ll_option -
214     @param send_unicast -
215     @param cease -
216     @param is_no -
217     @param default_router -
218     @param max_interval -
219     @param min_interval -
220     @param lifetime -
221     @param initial_count -
222     @param initial_interval -
223 */
224 autoreply define sw_interface_ip6nd_ra_config
225 {
226   u32 client_index;
227   u32 context;
228   u32 sw_if_index;
229   u8 suppress;
230   u8 managed;
231   u8 other;
232   u8 ll_option;
233   u8 send_unicast;
234   u8 cease;
235   u8 is_no;
236   u8 default_router;
237   u32 max_interval;
238   u32 min_interval;
239   u32 lifetime;
240   u32 initial_count;
241   u32 initial_interval;
242 };
243
244 /** \brief IPv6 router advertisement prefix config request
245     @param client_index - opaque cookie to identify the sender
246     @param context - sender context, to match reply w/ request
247     @param sw_if_index - The interface the RA prefix information is for
248     @param address[] - The prefix to advertise
249     @param address_length - the prefix length
250     @param use_default - Revert to default settings
251     @param no_advertise - Do not advertise this prefix
252     @param off_link - The prefix is off link (it is not configured on the interface)
253                       Configures the L-flag, When set, indicates that this
254                       prefix can be used for on-link determination.
255     @param no_autoconfig - Setting for the A-flag. When
256                            set indicates that this prefix can be used for
257                           stateless address configuration.
258     @param no_onlink - The prefix is not on link. Make sure this is consistent
259                        with the off_link parameter else YMMV
260     @param is_no - add/delete
261     @param val_lifetime - The length of time in
262                      seconds (relative to the time the packet is sent)
263                      that the prefix is valid for the purpose of on-link
264                      determination.  A value of all one bits
265                      (0xffffffff) represents infinity
266     @param pref_lifetime - The length of time in
267                      seconds (relative to the time the packet is sent)
268                      that addresses generated from the prefix via
269                      stateless address autoconfiguration remain
270                      preferred [ADDRCONF].  A value of all one bits
271                      (0xffffffff) represents infinity.
272 */
273 autoreply define sw_interface_ip6nd_ra_prefix
274 {
275   u32 client_index;
276   u32 context;
277   u32 sw_if_index;
278   u8 address[16];
279   u8 address_length;
280   u8 use_default;
281   u8 no_advertise;
282   u8 off_link;
283   u8 no_autoconfig;
284   u8 no_onlink;
285   u8 is_no;
286   u32 val_lifetime;
287   u32 pref_lifetime;
288 };
289
290 /** \brief IPv6 ND proxy config
291     @param client_index - opaque cookie to identify the sender
292     @param context - sender context, to match reply w/ request
293     @param sw_if_index - The interface the host is on
294     @param address - The address of the host for which to proxy for
295     @param is_add - Adding or deleting
296 */
297 autoreply define ip6nd_proxy_add_del
298 {
299   u32 client_index;
300   u32 context;
301   u32 sw_if_index;
302   u8 is_del;
303   u8 address[16];
304 };
305
306 /** \brief IPv6 ND proxy details returned after request
307     @param context - sender context, to match reply w/ request
308     @param retval - return code for the request
309 */
310 define ip6nd_proxy_details
311 {
312   u32 client_index;
313   u32 context;
314   u32 sw_if_index;
315   u8 address[16];
316 };
317
318 /** \brief IPv6 ND proxy dump request
319     @param context - sender context, to match reply w/ request
320     @param retval - return code for the request
321     @param sw_if_index - The interface the host is on
322     @param address - The address of the host for which to proxy for
323 */
324 define ip6nd_proxy_dump
325 {
326   u32 client_index;
327   u32 context;
328 };
329
330 /** \brief IPv6 interface enable / disable request
331     @param client_index - opaque cookie to identify the sender
332     @param context - sender context, to match reply w/ request
333     @param sw_if_index - interface used to reach neighbor
334     @param enable - if non-zero enable ip6 on interface, else disable
335 */
336 autoreply define sw_interface_ip6_enable_disable
337 {
338   u32 client_index;
339   u32 context;
340   u32 sw_if_index;
341   u8 enable;                    /* set to true if enable */
342 };
343
344 /** \brief IPv6 set link local address on interface request
345     @param client_index - opaque cookie to identify the sender
346     @param context - sender context, to match reply w/ request
347     @param sw_if_index - interface to set link local on
348     @param address[] - the new link local address
349 */
350 autoreply define sw_interface_ip6_set_link_local_address
351 {
352   u32 client_index;
353   u32 context;
354   u32 sw_if_index;
355   u8 address[16];
356 };
357
358 /** \brief Add / del route request
359     @param client_index - opaque cookie to identify the sender
360     @param context - sender context, to match reply w/ request
361     @param sw_if_index - software index of the new vlan's parent interface
362     @param vrf_id - fib table /vrf associated with the route
363     @param lookup_in_vrf - 
364     @param classify_table_index - 
365     @param create_vrf_if_needed - 
366     @param is_add - 1 if adding the route, 0 if deleting
367     @param is_drop - Drop the packet
368     @param is_unreach - Drop the packet and rate limit send ICMP unreachable
369     @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
370     @param is_ipv6 - 0 if an ip4 route, else ip6
371     @param is_local - 
372     @param is_classify - 
373     @param is_multipath - Set to 1 if this is a multipath route, else 0
374     @param not_last - Is last or not last msg in group of multiple add/del msgs
375     @param next_hop_weight - 
376     @param dst_address_length - 
377     @param dst_address[16] - 
378     @param next_hop_address[16] - 
379     @param next_hop_n_out_labels - the number of labels in the label stack
380     @param next_hop_out_label_stack - the next-hop output label stack, outer most first
381     @param next_hop_via_label - The next-hop is a resolved via a local label
382 */
383 autoreply define ip_add_del_route
384 {
385   u32 client_index;
386   u32 context;
387   u32 next_hop_sw_if_index;
388   u32 table_id;
389   u32 classify_table_index;
390   u32 next_hop_table_id;
391   u8 create_vrf_if_needed;
392   u8 is_add;
393   u8 is_drop;
394   u8 is_unreach;
395   u8 is_prohibit;
396   u8 is_ipv6;
397   u8 is_local;
398   u8 is_classify;
399   u8 is_multipath;
400   u8 is_resolve_host;
401   u8 is_resolve_attached;
402   u8 is_l2_bridged;
403   /* Is last/not-last message in group of multiple add/del messages. */
404   u8 not_last;
405   u8 next_hop_weight;
406   u8 next_hop_preference;
407   u8 dst_address_length;
408   u8 dst_address[16];
409   u8 next_hop_address[16];
410   u8 next_hop_n_out_labels;
411   u32 next_hop_via_label;
412   u32 next_hop_out_label_stack[next_hop_n_out_labels];
413 };
414
415 /** \brief Add / del route request
416     @param client_index - opaque cookie to identify the sender
417     @param context - sender context, to match reply w/ request
418     @param sw_if_index - software index of the new vlan's parent interface
419     @param vrf_id - fib table /vrf associated with the route
420
421     FIXME
422 */
423 autoreply define ip_mroute_add_del
424 {
425   u32 client_index;
426   u32 context;
427   u32 next_hop_sw_if_index;
428   u32 table_id;
429   u32 entry_flags;
430   u32 itf_flags;
431   u32 rpf_id;
432   u16 grp_address_length;
433   u8 create_vrf_if_needed;
434   u8 is_add;
435   u8 is_ipv6;
436   u8 is_local;
437   u8 grp_address[16];
438   u8 src_address[16];
439 };
440
441 /** \brief Dump IP multicast fib table
442     @param client_index - opaque cookie to identify the sender
443 */
444 define ip_mfib_dump
445 {
446   u32 client_index;
447   u32 context;
448 };
449
450 /** \brief IP Multicast FIB table response
451     @param table_id - IP fib table id
452     @address_length - mask length
453     @grp_address - Group address/prefix
454     @src_address - Source address
455     @param count - the number of fib_path in path
456     @param path  - array of of fib_path structures
457 */
458 manual_endian manual_print define ip_mfib_details
459 {
460   u32 context;
461   u32 table_id;
462   u32 entry_flags;
463   u32 rpf_id;
464   u8  address_length;
465   u8  grp_address[4];
466   u8  src_address[4];
467   u32 count;
468   vl_api_fib_path_t path[count];
469 };
470
471 /** \brief Dump IP6 multicast fib table
472     @param client_index - opaque cookie to identify the sender
473 */
474 define ip6_mfib_dump
475 {
476   u32 client_index;
477   u32 context;
478 };
479
480 /** \brief IP6 Multicast FIB table response
481     @param table_id - IP fib table id
482     @address_length - mask length
483     @grp_address - Group address/prefix
484     @src_address - Source address
485     @param count - the number of fib_path in path
486     @param path  - array of of fib_path structures
487 */
488 manual_endian manual_print define ip6_mfib_details
489 {
490   u32 context;
491   u32 table_id;
492   u8  address_length;
493   u8  grp_address[16];
494   u8  src_address[16];
495   u32 count;
496   vl_api_fib_path_t path[count];
497 };
498
499 define ip_address_details
500 {
501   u32 client_index;
502   u32 context;
503   u8 ip[16];
504   u8 prefix_length;
505   u32 sw_if_index;
506   u8 is_ipv6;
507 };
508
509 define ip_address_dump
510 {
511   u32 client_index;
512   u32 context;
513   u32 sw_if_index;
514   u8 is_ipv6;
515 };
516
517 define ip_details
518 {
519   u32 sw_if_index;
520   u32 context;
521   u8 is_ipv6;
522 };
523
524 define ip_dump
525 {
526   u32 client_index;
527   u32 context;
528   u8 is_ipv6;
529 };
530
531 define mfib_signal_dump
532 {
533   u32 client_index;
534   u32 context;
535 };
536
537 define mfib_signal_details
538 {
539   u32 client_index;
540   u32 context;
541   u32 sw_if_index;
542   u32 table_id;
543   u16 grp_address_len;
544   u8 grp_address[16];
545   u8 src_address[16];
546   u16 ip_packet_len;
547   u8 ip_packet_data[256];
548 };
549
550 /*
551  * Local Variables:
552  * eval: (c-set-style "gnu")
553  * End:
554  */