Proxy ND (RFC4389 - or a sub-set thereof). This allows the 'emulation' of bridging...
[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_static - 
132     @param mac_address - l2 address of the neighbor
133     @param dst_address - ip4 or ip6 address of the neighbor
134 */
135 define ip_neighbor_add_del
136 {
137   u32 client_index;
138   u32 context;
139   u32 sw_if_index;
140   /* 1 = add, 0 = delete */
141   u8 is_add;
142   u8 is_ipv6;
143   u8 is_static;
144   u8 mac_address[6];
145   u8 dst_address[16];
146 };
147
148 /** \brief Reply for IP Neighbor add / delete request
149     @param context - returned sender context, to match reply w/ request
150     @param retval - return code
151 */
152 define ip_neighbor_add_del_reply
153 {
154   u32 context;
155   i32 retval;
156 };
157
158 /** \brief Set the ip flow hash config for a fib request
159     @param client_index - opaque cookie to identify the sender
160     @param context - sender context, to match reply w/ request
161     @param vrf_id - vrf/fib id
162     @param is_ipv6 - if non-zero the fib is ip6, else ip4
163     @param src - if non-zero include src in flow hash
164     @param dst - if non-zero include dst in flow hash
165     @param sport - if non-zero include sport in flow hash
166     @param dport - if non-zero include dport in flow hash
167     @param proto -if non-zero include proto in flow hash
168     @param reverse - if non-zero include reverse in flow hash
169 */
170 define set_ip_flow_hash
171 {
172   u32 client_index;
173   u32 context;
174   u32 vrf_id;
175   u8 is_ipv6;
176   u8 src;
177   u8 dst;
178   u8 sport;
179   u8 dport;
180   u8 proto;
181   u8 reverse;
182 };
183
184 /** \brief Set the ip flow hash config for a fib response
185     @param context - sender context, to match reply w/ request
186     @param retval - return code for the request
187 */
188 define set_ip_flow_hash_reply
189 {
190   u32 context;
191   i32 retval;
192 };
193
194 /** \brief IPv6 router advertisement config request
195     @param client_index - opaque cookie to identify the sender
196     @param context - sender context, to match reply w/ request
197     @param suppress -
198     @param managed -
199     @param other -
200     @param ll_option -
201     @param send_unicast -
202     @param cease -
203     @param is_no -
204     @param default_router -
205     @param max_interval -
206     @param min_interval -
207     @param lifetime -
208     @param initial_count -
209     @param initial_interval -
210 */
211 define sw_interface_ip6nd_ra_config
212 {
213   u32 client_index;
214   u32 context;
215   u32 sw_if_index;
216   u8 suppress;
217   u8 managed;
218   u8 other;
219   u8 ll_option;
220   u8 send_unicast;
221   u8 cease;
222   u8 is_no;
223   u8 default_router;
224   u32 max_interval;
225   u32 min_interval;
226   u32 lifetime;
227   u32 initial_count;
228   u32 initial_interval;
229 };
230
231 /** \brief IPv6 router advertisement config response
232     @param context - sender context, to match reply w/ request
233     @param retval - return code for the request
234 */
235 define sw_interface_ip6nd_ra_config_reply
236 {
237   u32 context;
238   i32 retval;
239 };
240
241 /** \brief IPv6 router advertisement prefix config request
242     @param client_index - opaque cookie to identify the sender
243     @param context - sender context, to match reply w/ request
244     @param sw_if_index - The interface the RA prefix information is for
245     @param address[] - The prefix to advertise
246     @param address_length - the prefix length
247     @param use_default - Revert to default settings
248     @param no_advertise - Do not advertise this prefix
249     @param off_link - The prefix is off link (it is not configured on the interface)
250                       Configures the L-flag, When set, indicates that this
251                       prefix can be used for on-link determination.
252     @param no_autoconfig - Setting for the A-flag. When
253                            set indicates that this prefix can be used for
254                           stateless address configuration.
255     @param no_onlink - The prefix is not on link. Make sure this is consistent
256                        with the off_link parameter else YMMV
257     @param is_no - add/delete
258     @param val_lifetime - The length of time in
259                      seconds (relative to the time the packet is sent)
260                      that the prefix is valid for the purpose of on-link
261                      determination.  A value of all one bits
262                      (0xffffffff) represents infinity
263     @param pref_lifetime - The length of time in
264                      seconds (relative to the time the packet is sent)
265                      that addresses generated from the prefix via
266                      stateless address autoconfiguration remain
267                      preferred [ADDRCONF].  A value of all one bits
268                      (0xffffffff) represents infinity.
269 */
270 define sw_interface_ip6nd_ra_prefix
271 {
272   u32 client_index;
273   u32 context;
274   u32 sw_if_index;
275   u8 address[16];
276   u8 address_length;
277   u8 use_default;
278   u8 no_advertise;
279   u8 off_link;
280   u8 no_autoconfig;
281   u8 no_onlink;
282   u8 is_no;
283   u32 val_lifetime;
284   u32 pref_lifetime;
285 };
286
287 /** \brief IPv6 router advertisement prefix config response
288     @param context - sender context, to match reply w/ request
289     @param retval - return code for the request
290 */
291 define sw_interface_ip6nd_ra_prefix_reply
292 {
293   u32 context;
294   i32 retval;
295 };
296
297 /** \brief IPv6 ND proxy config
298     @param client_index - opaque cookie to identify the sender
299     @param context - sender context, to match reply w/ request
300     @param sw_if_index - The interface the host is on
301     @param address - The address of the host for which to proxy for
302     @param is_add - Adding or deleting
303 */
304 define ip6nd_proxy_add_del
305 {
306   u32 client_index;
307   u32 context;
308   u32 sw_if_index;
309   u8 is_del;
310   u8 address[16];
311 };
312
313 /** \brief IPv6 ND proxy response
314     @param context - sender context, to match reply w/ request
315     @param retval - return code for the request
316 */
317 define ip6nd_proxy_add_del_reply
318 {
319   u32 context;
320   i32 retval;
321 };
322
323 /** \brief IPv6 ND proxy details returned after request
324     @param context - sender context, to match reply w/ request
325     @param retval - return code for the request
326 */
327 define ip6nd_proxy_details
328 {
329   u32 client_index;
330   u32 context;
331   u32 sw_if_index;
332   u8 address[16];
333 };
334
335 /** \brief IPv6 ND proxy dump request
336     @param context - sender context, to match reply w/ request
337     @param retval - return code for the request
338     @param sw_if_index - The interface the host is on
339     @param address - The address of the host for which to proxy for
340 */
341 define ip6nd_proxy_dump
342 {
343   u32 client_index;
344   u32 context;
345 };
346
347 /** \brief IPv6 interface enable / disable request
348     @param client_index - opaque cookie to identify the sender
349     @param context - sender context, to match reply w/ request
350     @param sw_if_index - interface used to reach neighbor
351     @param enable - if non-zero enable ip6 on interface, else disable
352 */
353 define sw_interface_ip6_enable_disable
354 {
355   u32 client_index;
356   u32 context;
357   u32 sw_if_index;
358   u8 enable;                    /* set to true if enable */
359 };
360
361 /** \brief IPv6 interface enable / disable response
362     @param context - sender context, to match reply w/ request
363     @param retval - return code for the request
364 */
365 define sw_interface_ip6_enable_disable_reply
366 {
367   u32 context;
368   i32 retval;
369 };
370
371 /** \brief IPv6 set link local address on interface request
372     @param client_index - opaque cookie to identify the sender
373     @param context - sender context, to match reply w/ request
374     @param sw_if_index - interface to set link local on
375     @param address[] - the new link local address
376 */
377 define sw_interface_ip6_set_link_local_address
378 {
379   u32 client_index;
380   u32 context;
381   u32 sw_if_index;
382   u8 address[16];
383 };
384
385 /** \brief IPv6 set link local address on interface response
386     @param context - sender context, to match reply w/ request
387     @param retval - error code for the request
388 */
389 define sw_interface_ip6_set_link_local_address_reply
390 {
391   u32 context;
392   i32 retval;
393 };
394
395 /** \brief Add / del route request
396     @param client_index - opaque cookie to identify the sender
397     @param context - sender context, to match reply w/ request
398     @param sw_if_index - software index of the new vlan's parent interface
399     @param vrf_id - fib table /vrf associated with the route
400     @param lookup_in_vrf - 
401     @param classify_table_index - 
402     @param create_vrf_if_needed - 
403     @param is_add - 1 if adding the route, 0 if deleting
404     @param is_drop - Drop the packet
405     @param is_unreach - Drop the packet and rate limit send ICMP unreachable
406     @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
407     @param is_ipv6 - 0 if an ip4 route, else ip6
408     @param is_local - 
409     @param is_classify - 
410     @param is_multipath - Set to 1 if this is a multipath route, else 0
411     @param not_last - Is last or not last msg in group of multiple add/del msgs
412     @param next_hop_weight - 
413     @param dst_address_length - 
414     @param dst_address[16] - 
415     @param next_hop_address[16] - 
416     @param next_hop_n_out_labels - the number of labels in the label stack
417     @param next_hop_out_label_stack - the next-hop output label stack, outer most first
418     @param next_hop_via_label - The next-hop is a resolved via a local label
419 */
420 define ip_add_del_route
421 {
422   u32 client_index;
423   u32 context;
424   u32 next_hop_sw_if_index;
425   u32 table_id;
426   u32 classify_table_index;
427   u32 next_hop_table_id;
428   u8 create_vrf_if_needed;
429   u8 is_add;
430   u8 is_drop;
431   u8 is_unreach;
432   u8 is_prohibit;
433   u8 is_ipv6;
434   u8 is_local;
435   u8 is_classify;
436   u8 is_multipath;
437   u8 is_resolve_host;
438   u8 is_resolve_attached;
439   /* Is last/not-last message in group of multiple add/del messages. */
440   u8 not_last;
441   u8 next_hop_weight;
442   u8 dst_address_length;
443   u8 dst_address[16];
444   u8 next_hop_address[16];
445   u8 next_hop_n_out_labels;
446   u32 next_hop_via_label;
447   u32 next_hop_out_label_stack[next_hop_n_out_labels];
448 };
449
450 /** \brief Reply for add / del route request
451     @param context - returned sender context, to match reply w/ request
452     @param retval - return code
453 */
454 define ip_add_del_route_reply
455 {
456   u32 context;
457   i32 retval;
458 };
459
460 /** \brief Add / del route request
461     @param client_index - opaque cookie to identify the sender
462     @param context - sender context, to match reply w/ request
463     @param sw_if_index - software index of the new vlan's parent interface
464     @param vrf_id - fib table /vrf associated with the route
465
466     FIXME
467 */
468 define ip_mroute_add_del
469 {
470   u32 client_index;
471   u32 context;
472   u32 next_hop_sw_if_index;
473   u32 table_id;
474   u32 entry_flags;
475   u32 itf_flags;
476   u16 grp_address_length;
477   u8 create_vrf_if_needed;
478   u8 is_add;
479   u8 is_ipv6;
480   u8 is_local;
481   u8 grp_address[16];
482   u8 src_address[16];
483 };
484
485 /** \brief Reply for add / del mroute request
486     @param context - returned sender context, to match reply w/ request
487     @param retval - return code
488 */
489 define ip_mroute_add_del_reply
490 {
491   u32 context;
492   i32 retval;
493 };
494
495 /** \brief Dump IP multicast fib table
496     @param client_index - opaque cookie to identify the sender
497 */
498 define ip_mfib_dump
499 {
500   u32 client_index;
501   u32 context;
502 };
503
504 /** \brief IP Multicast FIB table response
505     @param table_id - IP fib table id
506     @address_length - mask length
507     @grp_address - Group address/prefix
508     @src_address - Source address
509     @param count - the number of fib_path in path
510     @param path  - array of of fib_path structures
511 */
512 manual_endian manual_print define ip_mfib_details
513 {
514   u32 context;
515   u32 table_id;
516   u8  address_length;
517   u8  grp_address[4];
518   u8  src_address[4];
519   u32 count;
520   vl_api_fib_path_t path[count];
521 };
522
523 /** \brief Dump IP6 multicast fib table
524     @param client_index - opaque cookie to identify the sender
525 */
526 define ip6_mfib_dump
527 {
528   u32 client_index;
529   u32 context;
530 };
531
532 /** \brief IP6 Multicast FIB table response
533     @param table_id - IP fib table id
534     @address_length - mask length
535     @grp_address - Group address/prefix
536     @src_address - Source address
537     @param count - the number of fib_path in path
538     @param path  - array of of fib_path structures
539 */
540 manual_endian manual_print define ip6_mfib_details
541 {
542   u32 context;
543   u32 table_id;
544   u8  address_length;
545   u8  grp_address[16];
546   u8  src_address[16];
547   u32 count;
548   vl_api_fib_path_t path[count];
549 };
550
551 define ip_address_details
552 {
553   u32 client_index;
554   u32 context;
555   u8 ip[16];
556   u8 prefix_length;
557   u32 sw_if_index;
558   u8 is_ipv6;
559 };
560
561 define ip_address_dump
562 {
563   u32 client_index;
564   u32 context;
565   u32 sw_if_index;
566   u8 is_ipv6;
567 };
568
569 define ip_details
570 {
571   u32 sw_if_index;
572   u32 context;
573   u8 is_ipv6;
574 };
575
576 define ip_dump
577 {
578   u32 client_index;
579   u32 context;
580   u8 is_ipv6;
581 };
582
583 define mfib_signal_dump
584 {
585   u32 client_index;
586   u32 context;
587 };
588
589 define mfib_signal_details
590 {
591   u32 client_index;
592   u32 context;
593   u32 sw_if_index;
594   u32 table_id;
595   u16 grp_address_len;
596   u8 grp_address[16];
597   u8 src_address[16];
598   u16 ip_packet_len;
599   u8 ip_packet_data[256];
600 };
601
602 /*
603  * Local Variables:
604  * eval: (c-set-style "gnu")
605  * End:
606  */