BIER
[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.1
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   u32 table_id;
72   u8 weight;
73   u8 preference;
74   u8 is_local;
75   u8 is_drop;
76   u8 is_unreach;
77   u8 is_prohibit;
78   u8 afi;
79   u8 next_hop[16];
80 };
81
82 /** \brief IP FIB table response
83     @param table_id - IP fib table id
84     @address_length - mask length
85     @address - ip4 prefix
86     @param count - the number of fib_path in path
87     @param path  - array of of fib_path structures
88 */
89 manual_endian manual_print define ip_fib_details
90 {
91   u32 context;
92   u32 table_id;
93   u8  table_name[64];
94   u8  address_length;
95   u8  address[4];
96   u32 count;
97   vl_api_fib_path_t path[count];
98 };
99
100 /** \brief Dump IP6 fib table
101     @param client_index - opaque cookie to identify the sender
102 */
103 define ip6_fib_dump
104 {
105   u32 client_index;
106   u32 context;
107 };
108
109 /** \brief IP6 FIB table entry response
110     @param table_id - IP6 fib table id
111     @param address_length - mask length
112     @param address - ip6 prefix
113     @param count - the number of fib_path in path
114     @param path  - array of of fib_path structures
115 */
116 manual_endian manual_print define ip6_fib_details
117 {
118   u32 context;
119   u32 table_id;
120   u8  table_name[64];
121   u8  address_length;
122   u8  address[16];
123   u32 count;
124   vl_api_fib_path_t path[count];
125 };
126
127 /** \brief Dump IP neighboors
128     @param client_index - opaque cookie to identify the sender
129     @param context - sender context, to match reply w/ request
130     @param sw_if_index - the interface to dump neighboors
131     @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
132 */
133 define ip_neighbor_dump
134 {
135     u32 client_index;
136     u32 context;
137     u32 sw_if_index;
138     u8  is_ipv6;
139 };
140
141 /** \brief IP neighboors dump response
142     @param context - sender context which was passed in the request
143     @param is_static - [1|0] to indicate if neighbor is statically configured
144     @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
145 */
146 define ip_neighbor_details {
147     u32 context;
148     u8  is_static;
149     u8  is_ipv6;
150     u8  mac_address[6];
151     u8  ip_address[16];
152 };
153
154 /** \brief IP neighbor add / del request
155     @param client_index - opaque cookie to identify the sender
156     @param context - sender context, to match reply w/ request
157     @param sw_if_index - interface used to reach neighbor
158     @param is_add - 1 to add neighbor, 0 to delete
159     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
160     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
161     @param is_static - A static neighbor Entry - there are not flushed
162                        If the interface goes down.
163     @param is_no_adj_fib - Do not create a corresponding entry in the FIB
164                            table for the neighbor.
165     @param mac_address - l2 address of the neighbor
166     @param dst_address - ip4 or ip6 address of the neighbor
167 */
168 autoreply define ip_neighbor_add_del
169 {
170   u32 client_index;
171   u32 context;
172   u32 sw_if_index;
173   /* 1 = add, 0 = delete */
174   u8 is_add;
175   u8 is_ipv6;
176   u8 is_static;
177   u8 is_no_adj_fib;
178   u8 mac_address[6];
179   u8 dst_address[16];
180 };
181
182 /** \brief Set the ip flow hash config for a fib request
183     @param client_index - opaque cookie to identify the sender
184     @param context - sender context, to match reply w/ request
185     @param vrf_id - vrf/fib id
186     @param is_ipv6 - if non-zero the fib is ip6, else ip4
187     @param src - if non-zero include src in flow hash
188     @param dst - if non-zero include dst in flow hash
189     @param sport - if non-zero include sport in flow hash
190     @param dport - if non-zero include dport in flow hash
191     @param proto -if non-zero include proto in flow hash
192     @param reverse - if non-zero include reverse in flow hash
193 */
194 autoreply define set_ip_flow_hash
195 {
196   u32 client_index;
197   u32 context;
198   u32 vrf_id;
199   u8 is_ipv6;
200   u8 src;
201   u8 dst;
202   u8 sport;
203   u8 dport;
204   u8 proto;
205   u8 reverse;
206 };
207
208 /** \brief IPv6 router advertisement config request
209     @param client_index - opaque cookie to identify the sender
210     @param context - sender context, to match reply w/ request
211     @param suppress -
212     @param managed -
213     @param other -
214     @param ll_option -
215     @param send_unicast -
216     @param cease -
217     @param is_no -
218     @param default_router -
219     @param max_interval -
220     @param min_interval -
221     @param lifetime -
222     @param initial_count -
223     @param initial_interval -
224 */
225 autoreply define sw_interface_ip6nd_ra_config
226 {
227   u32 client_index;
228   u32 context;
229   u32 sw_if_index;
230   u8 suppress;
231   u8 managed;
232   u8 other;
233   u8 ll_option;
234   u8 send_unicast;
235   u8 cease;
236   u8 is_no;
237   u8 default_router;
238   u32 max_interval;
239   u32 min_interval;
240   u32 lifetime;
241   u32 initial_count;
242   u32 initial_interval;
243 };
244
245 /** \brief IPv6 router advertisement prefix config request
246     @param client_index - opaque cookie to identify the sender
247     @param context - sender context, to match reply w/ request
248     @param sw_if_index - The interface the RA prefix information is for
249     @param address[] - The prefix to advertise
250     @param address_length - the prefix length
251     @param use_default - Revert to default settings
252     @param no_advertise - Do not advertise this prefix
253     @param off_link - The prefix is off link (it is not configured on the interface)
254                       Configures the L-flag, When set, indicates that this
255                       prefix can be used for on-link determination.
256     @param no_autoconfig - Setting for the A-flag. When
257                            set indicates that this prefix can be used for
258                           stateless address configuration.
259     @param no_onlink - The prefix is not on link. Make sure this is consistent
260                        with the off_link parameter else YMMV
261     @param is_no - add/delete
262     @param val_lifetime - The length of time in
263                      seconds (relative to the time the packet is sent)
264                      that the prefix is valid for the purpose of on-link
265                      determination.  A value of all one bits
266                      (0xffffffff) represents infinity
267     @param pref_lifetime - The length of time in
268                      seconds (relative to the time the packet is sent)
269                      that addresses generated from the prefix via
270                      stateless address autoconfiguration remain
271                      preferred [ADDRCONF].  A value of all one bits
272                      (0xffffffff) represents infinity.
273 */
274 autoreply define sw_interface_ip6nd_ra_prefix
275 {
276   u32 client_index;
277   u32 context;
278   u32 sw_if_index;
279   u8 address[16];
280   u8 address_length;
281   u8 use_default;
282   u8 no_advertise;
283   u8 off_link;
284   u8 no_autoconfig;
285   u8 no_onlink;
286   u8 is_no;
287   u32 val_lifetime;
288   u32 pref_lifetime;
289 };
290
291 /** \brief IPv6 ND proxy config
292     @param client_index - opaque cookie to identify the sender
293     @param context - sender context, to match reply w/ request
294     @param sw_if_index - The interface the host is on
295     @param address - The address of the host for which to proxy for
296     @param is_add - Adding or deleting
297 */
298 autoreply define ip6nd_proxy_add_del
299 {
300   u32 client_index;
301   u32 context;
302   u32 sw_if_index;
303   u8 is_del;
304   u8 address[16];
305 };
306
307 /** \brief IPv6 ND proxy details returned after request
308     @param context - sender context, to match reply w/ request
309     @param retval - return code for the request
310 */
311 define ip6nd_proxy_details
312 {
313   u32 client_index;
314   u32 context;
315   u32 sw_if_index;
316   u8 address[16];
317 };
318
319 /** \brief IPv6 ND proxy dump request
320     @param context - sender context, to match reply w/ request
321     @param retval - return code for the request
322     @param sw_if_index - The interface the host is on
323     @param address - The address of the host for which to proxy for
324 */
325 define ip6nd_proxy_dump
326 {
327   u32 client_index;
328   u32 context;
329 };
330
331 /** \brief IPv6 interface enable / disable request
332     @param client_index - opaque cookie to identify the sender
333     @param context - sender context, to match reply w/ request
334     @param sw_if_index - interface used to reach neighbor
335     @param enable - if non-zero enable ip6 on interface, else disable
336 */
337 autoreply define sw_interface_ip6_enable_disable
338 {
339   u32 client_index;
340   u32 context;
341   u32 sw_if_index;
342   u8 enable;                    /* set to true if enable */
343 };
344
345 /** \brief IPv6 set link local address on interface request
346     @param client_index - opaque cookie to identify the sender
347     @param context - sender context, to match reply w/ request
348     @param sw_if_index - interface to set link local on
349     @param address[] - the new link local address
350 */
351 autoreply define sw_interface_ip6_set_link_local_address
352 {
353   u32 client_index;
354   u32 context;
355   u32 sw_if_index;
356   u8 address[16];
357 };
358
359 /** \brief Add / del route request
360     @param client_index - opaque cookie to identify the sender
361     @param context - sender context, to match reply w/ request
362     @param sw_if_index - software index of the new vlan's parent interface
363     @param vrf_id - fib table /vrf associated with the route
364     @param lookup_in_vrf - 
365     @param classify_table_index - 
366     @param create_vrf_if_needed - 
367     @param is_add - 1 if adding the route, 0 if deleting
368     @param is_drop - Drop the packet
369     @param is_unreach - Drop the packet and rate limit send ICMP unreachable
370     @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
371     @param is_ipv6 - 0 if an ip4 route, else ip6
372     @param is_local - The route will result in packets sent to VPP IP stack
373     @param is_udp_encap - The path describes a UDP-o-IP encapsulation.
374     @param is_classify - 
375     @param is_multipath - Set to 1 if this is a multipath route, else 0
376     @param is_source_lookup - The the path is a deaggregate path (i.e. a lookup
377                               in another table) is the lookup on the packet's
378                               source address or destination.
379     @param next_hop_weight - Weight for Unequal cost multi-path
380     @param next_hop_preference - Path that are up that have the best preference are
381                                  are used for forwarding. lower value is better.
382     @param next_hop_id - Used when the path resolves via an object that has a unique
383                          identifier.
384     @param dst_address_length - 
385     @param dst_address[16] - 
386     @param next_hop_address[16] - 
387     @param next_hop_n_out_labels - the number of labels in the label stack
388     @param next_hop_out_label_stack - the next-hop output label stack, outer most first
389     @param next_hop_via_label - The next-hop is a resolved via a local label
390 */
391 autoreply define ip_add_del_route
392 {
393   u32 client_index;
394   u32 context;
395   u32 next_hop_sw_if_index;
396   u32 table_id;
397   u32 classify_table_index;
398   u32 next_hop_table_id;
399   u32 next_hop_id;
400   u8 create_vrf_if_needed;
401   u8 is_add;
402   u8 is_drop;
403   u8 is_unreach;
404   u8 is_prohibit;
405   u8 is_ipv6;
406   u8 is_local;
407   u8 is_classify;
408   u8 is_multipath;
409   u8 is_resolve_host;
410   u8 is_resolve_attached;
411   u8 is_l2_bridged;
412   u8 is_source_lookup;
413   u8 is_udp_encap;
414   u8 next_hop_weight;
415   u8 next_hop_preference;
416   u8 next_hop_proto;
417   u8 dst_address_length;
418   u8 dst_address[16];
419   u8 next_hop_address[16];
420   u8 next_hop_n_out_labels;
421   u32 next_hop_via_label;
422   u32 next_hop_out_label_stack[next_hop_n_out_labels];
423 };
424
425 /** \brief Add / del route request
426     @param client_index - opaque cookie to identify the sender
427     @param context - sender context, to match reply w/ request
428     @param sw_if_index - software index of the new vlan's parent interface
429     @param vrf_id - fib table /vrf associated with the route
430     @param next_hop_afi - Use dpo_proto_t
431     FIXME
432 */
433 autoreply define ip_mroute_add_del
434 {
435   u32 client_index;
436   u32 context;
437   u32 next_hop_sw_if_index;
438   u32 table_id;
439   u32 entry_flags;
440   u32 itf_flags;
441   u32 rpf_id;
442   u32 bier_imp;
443   u16 grp_address_length;
444   u8 next_hop_afi;
445   u8 create_vrf_if_needed;
446   u8 is_add;
447   u8 is_ipv6;
448   u8 is_local;
449   u8 grp_address[16];
450   u8 src_address[16];
451 };
452
453 /** \brief Dump IP multicast fib table
454     @param client_index - opaque cookie to identify the sender
455 */
456 define ip_mfib_dump
457 {
458   u32 client_index;
459   u32 context;
460 };
461
462 /** \brief IP Multicast FIB table response
463     @param table_id - IP fib table id
464     @address_length - mask length
465     @grp_address - Group address/prefix
466     @src_address - Source address
467     @param count - the number of fib_path in path
468     @param path  - array of of fib_path structures
469 */
470 manual_endian manual_print define ip_mfib_details
471 {
472   u32 context;
473   u32 table_id;
474   u32 entry_flags;
475   u32 rpf_id;
476   u8  address_length;
477   u8  grp_address[4];
478   u8  src_address[4];
479   u32 count;
480   vl_api_fib_path_t path[count];
481 };
482
483 /** \brief Dump IP6 multicast fib table
484     @param client_index - opaque cookie to identify the sender
485 */
486 define ip6_mfib_dump
487 {
488   u32 client_index;
489   u32 context;
490 };
491
492 /** \brief IP6 Multicast FIB table response
493     @param table_id - IP fib table id
494     @address_length - mask length
495     @grp_address - Group address/prefix
496     @src_address - Source address
497     @param count - the number of fib_path in path
498     @param path  - array of of fib_path structures
499 */
500 manual_endian manual_print define ip6_mfib_details
501 {
502   u32 context;
503   u32 table_id;
504   u8  address_length;
505   u8  grp_address[16];
506   u8  src_address[16];
507   u32 count;
508   vl_api_fib_path_t path[count];
509 };
510
511 define ip_address_details
512 {
513   u32 client_index;
514   u32 context;
515   u8 ip[16];
516   u8 prefix_length;
517   u32 sw_if_index;
518   u8 is_ipv6;
519 };
520
521 define ip_address_dump
522 {
523   u32 client_index;
524   u32 context;
525   u32 sw_if_index;
526   u8 is_ipv6;
527 };
528
529 define ip_details
530 {
531   u32 sw_if_index;
532   u32 context;
533   u8 is_ipv6;
534 };
535
536 define ip_dump
537 {
538   u32 client_index;
539   u32 context;
540   u8 is_ipv6;
541 };
542
543 define mfib_signal_dump
544 {
545   u32 client_index;
546   u32 context;
547 };
548
549 define mfib_signal_details
550 {
551   u32 client_index;
552   u32 context;
553   u32 sw_if_index;
554   u32 table_id;
555   u16 grp_address_len;
556   u8 grp_address[16];
557   u8 src_address[16];
558   u16 ip_packet_len;
559   u8 ip_packet_data[256];
560 };
561
562 /** \brief IP punt policer
563     @param client_index - opaque cookie to identify the sender
564     @param context - sender context, to match reply w/ request
565     @param is_add - 1 to add neighbor, 0 to delete
566     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
567     @param policer_index - Index of policer to use
568 */
569 autoreply define ip_punt_police
570 {
571   u32 client_index;
572   u32 context;
573   u32 policer_index;
574   u8 is_add;
575   u8 is_ip6;
576 };
577
578 /** \brief IP punt redirect
579     @param client_index - opaque cookie to identify the sender
580     @param context - sender context, to match reply w/ request
581     @param is_add - 1 to add neighbor, 0 to delete
582     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
583     @param tx_sw_if_index - the TX interface to which traffic shoulde be
584                             redirected.
585     @param nh - The next-hop to redirect the traffic to.
586 */
587 autoreply define ip_punt_redirect
588 {
589   u32 client_index;
590   u32 context;
591   u32 rx_sw_if_index;
592   u32 tx_sw_if_index;
593   u8 is_add;
594   u8 is_ip6;
595   u8 nh[16];
596 };
597
598 autoreply define ip_container_proxy_add_del
599 {
600   u32 client_index;
601   u32 context;
602   u8 ip[16];
603   u8 is_ip4;
604   u8 plen;
605   u32 sw_if_index;
606   u8 is_add;
607 };
608
609 /*
610  * Local Variables:
611  * eval: (c-set-style "gnu")
612  * End:
613  */