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