LISP: L2 ARP handling
[vpp.git] / src / vnet / lisp-cp / one.api
1 /*
2  * Copyright (c) 2015-2017 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 typeonly manual_print manual_endian define one_local_locator
17 {
18   u32 sw_if_index;
19   u8 priority;
20   u8 weight;
21 };
22
23 /** \brief add or delete locator_set
24     @param client_index - opaque cookie to identify the sender
25     @param context - sender context, to match reply w/ request
26     @param is_add - add address if non-zero, else delete
27     @param locator_set_name - locator name
28     @param locator_num - number of locators
29     @param locators - locator records
30 */
31 manual_endian manual_print define one_add_del_locator_set
32 {
33   u32 client_index;
34   u32 context;
35   u8 is_add;
36   u8 locator_set_name[64];
37   u32 locator_num;
38   vl_api_one_local_locator_t locators[locator_num];
39 };
40
41 /** \brief Reply for locator_set add/del
42     @param context - returned sender context, to match reply w/ request
43     @param retval - return code
44     @param ls_index - locator set index
45 */
46 define one_add_del_locator_set_reply
47 {
48   u32 context;
49   i32 retval;
50   u32 ls_index;
51 };
52
53 /** \brief add or delete locator for locator set
54     @param client_index - opaque cookie to identify the sender
55     @param context - sender context, to match reply w/ request
56     @param is_add - add address if non-zero, else delete
57     @param locator_set_name - name of locator_set to add/del locator
58     @param sw_if_index - index of the interface
59     @param priority - priority of the locator
60     @param weight - weight of the locator
61 */
62 autoreply define one_add_del_locator
63 {
64   u32 client_index;
65   u32 context;
66   u8 is_add;
67   u8 locator_set_name[64];
68   u32 sw_if_index;
69   u8 priority;
70   u8 weight;
71 };
72
73 /** \brief add or delete ONE eid-table
74     @param client_index - opaque cookie to identify the sender
75     @param context - sender context, to match reply w/ request
76     @param is_add - add address if non-zero, else delete
77     @param eid_type:
78       0 : ipv4
79       1 : ipv6
80       2 : mac
81     @param eid - EID can be ip4, ip6 or mac
82     @param prefix_len - prefix len
83     @param locator_set_name - name of locator_set to add/del eid-table
84     @param vni - virtual network instance
85     @param key_id
86       HMAC_NO_KEY           0
87       HMAC_SHA_1_96         1
88       HMAC_SHA_256_128      2
89     @param key - secret key
90 */
91 autoreply define one_add_del_local_eid
92 {
93   u32 client_index;
94   u32 context;
95   u8 is_add;
96   u8 eid_type;
97   u8 eid[16];
98   u8 prefix_len;
99   u8 locator_set_name[64];
100   u32 vni;
101   u16 key_id;
102   u8 key[64];
103 };
104
105 /** \brief Add/delete map server
106     @param client_index - opaque cookie to identify the sender
107     @param context - sender context, to match reply w/ request
108     @param is_add - add address if non-zero; delete otherwise
109     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
110     @param ip_address - map server IP address
111 */
112 autoreply define one_add_del_map_server
113 {
114   u32 client_index;
115   u32 context;
116   u8 is_add;
117   u8 is_ipv6;
118   u8 ip_address[16];
119 };
120
121 /** \brief add or delete map-resolver
122     @param client_index - opaque cookie to identify the sender
123     @param context - sender context, to match reply w/ request
124     @param is_add - add address if non-zero, else delete
125     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
126     @param ip_address - array of address bytes
127 */
128 autoreply define one_add_del_map_resolver
129 {
130   u32 client_index;
131   u32 context;
132   u8 is_add;
133   u8 is_ipv6;
134   u8 ip_address[16];
135 };
136
137 /** \brief enable or disable ONE feature
138     @param client_index - opaque cookie to identify the sender
139     @param context - sender context, to match reply w/ request
140     @param is_en - enable protocol if non-zero, else disable
141 */
142 autoreply define one_enable_disable
143 {
144   u32 client_index;
145   u32 context;
146   u8 is_en;
147 };
148
149 /** \brief configure or disable ONE PITR node
150     @param client_index - opaque cookie to identify the sender
151     @param context - sender context, to match reply w/ request
152     @param ls_name - locator set name
153     @param is_add - add locator set if non-zero, else disable pitr
154 */
155 autoreply define one_pitr_set_locator_set
156 {
157   u32 client_index;
158   u32 context;
159   u8 is_add;
160   u8 ls_name[64];
161 };
162
163 /** \brief configure or disable use of PETR
164     @param client_index - opaque cookie to identify the sender
165     @param context - sender context, to match reply w/ request
166     @param is_ip4 - Address is IPv4 if set and IPv6 otherwise
167     @param address - PETR IP address
168     @param is_add - add locator set if non-zero, else disable PETR
169 */
170 autoreply define one_use_petr
171 {
172   u32 client_index;
173   u32 context;
174   u8 is_ip4;
175   u8 address[16];
176   u8 is_add;
177 };
178
179 /** \brief Request for ONE PETR status
180     @param client_index - opaque cookie to identify the sender
181     @param context - sender context, to match reply w/ request
182 */
183 define show_one_use_petr
184 {
185   u32 client_index;
186   u32 context;
187 };
188
189 /** \brief ONE PETR status, enable or disable
190     @param context - sender context, to match reply w/ request
191     @param status - ONE PETR enable if non-zero, else disable
192     @param is_ip4 - Address is IPv4 if non-zero, else IPv6
193     @param address - PETR IP address
194 */
195 define show_one_use_petr_reply
196 {
197   u32 context;
198   i32 retval;
199   u8 status;
200   u8 is_ip4;
201   u8 address[16];
202 };
203
204 /** \brief Get state of ONE RLOC probing
205     @param client_index - opaque cookie to identify the sender
206     @param context - sender context, to match reply w/ request
207 */
208 define show_one_rloc_probe_state
209 {
210   u32 client_index;
211   u32 context;
212 };
213
214 /** \brief Reply for show_one_rloc_probe_state
215     @param context - returned sender context, to match reply w/ request
216     @param retval - return code
217     @param is_enabled - state of RLOC probing
218 */
219 define show_one_rloc_probe_state_reply
220 {
221   u32 context;
222   i32 retval;
223   u8 is_enabled;
224 };
225
226 /** \brief enable/disable ONE RLOC probing
227     @param client_index - opaque cookie to identify the sender
228     @param context - sender context, to match reply w/ request
229     @param is_enable - enable if non-zero; disable otherwise
230 */
231 autoreply define one_rloc_probe_enable_disable
232 {
233   u32 client_index;
234   u32 context;
235   u8 is_enabled;
236 };
237
238 /** \brief enable/disable ONE map-register
239     @param client_index - opaque cookie to identify the sender
240     @param context - sender context, to match reply w/ request
241     @param is_enable - enable if non-zero; disable otherwise
242 */
243 autoreply define one_map_register_enable_disable
244 {
245   u32 client_index;
246   u32 context;
247   u8 is_enabled;
248 };
249
250 /** \brief Get state of ONE map-register
251     @param client_index - opaque cookie to identify the sender
252     @param context - sender context, to match reply w/ request
253 */
254 define show_one_map_register_state
255 {
256   u32 client_index;
257   u32 context;
258 };
259
260 /** \brief Reply for show_one_map_register_state
261     @param context - returned sender context, to match reply w/ request
262     @param retval - return code
263 */
264 define show_one_map_register_state_reply
265 {
266   u32 context;
267   i32 retval;
268   u8 is_enabled;
269 };
270
271 /** \brief set ONE map-request mode. Based on configuration VPP will send
272       src/dest or just normal destination map requests.
273     @param client_index - opaque cookie to identify the sender
274     @param context - sender context, to match reply w/ request
275     @param mode - new map-request mode. Supported values are:
276       0 - destination only
277       1 - source/destaination
278 */
279 autoreply define one_map_request_mode
280 {
281   u32 client_index;
282   u32 context;
283   u8 mode;
284 };
285
286 /** \brief Request for ONE map-request mode
287     @param client_index - opaque cookie to identify the sender
288     @param context - sender context, to match reply w/ request
289 */
290 define show_one_map_request_mode
291 {
292   u32 client_index;
293   u32 context;
294 };
295
296 /** \brief Reply for show_one_map_request_mode
297     @param context - returned sender context, to match reply w/ request
298     @param retval - return code
299     @param mode - map-request mode
300 */
301 define show_one_map_request_mode_reply
302 {
303   u32 context;
304   i32 retval;
305   u8 mode;
306 };
307
308 typeonly manual_endian manual_print define one_remote_locator
309 {
310   u8 is_ip4;
311   u8 priority;
312   u8 weight;
313   u8 addr[16];
314 };
315
316 /** \brief add or delete remote static mapping
317     @param client_index - opaque cookie to identify the sender
318     @param context - sender context, to match reply w/ request
319     @param is_add - add address if non-zero, else delete
320     @param is_src_dst - flag indicating src/dst based routing policy
321     @param del_all - if set, delete all remote mappings
322     @param vni - virtual network instance
323     @param action - negative map-reply action
324     @param eid_type -
325       0 : ipv4
326       1 : ipv6
327       2 : mac
328     @param deid - dst EID
329     @param seid - src EID, valid only if is_src_dst is enabled
330     @param rloc_num - number of remote locators
331     @param rlocs - remote locator records
332 */
333 autoreply manual_print manual_endian define one_add_del_remote_mapping
334 {
335   u32 client_index;
336   u32 context;
337   u8 is_add;
338   u8 is_src_dst;
339   u8 del_all;
340   u32 vni;
341   u8 action;
342   u8 eid_type;
343   u8 eid[16];
344   u8 eid_len;
345   u8 seid[16];
346   u8 seid_len;
347   u32 rloc_num;
348   vl_api_one_remote_locator_t rlocs[rloc_num];
349 };
350
351 /** \brief Add/delete L2 ARP entries
352     @param client_index - opaque cookie to identify the sender
353     @param context - sender context, to match reply w/ request
354     @param is_add - add if non-zero; delete otherwise
355     @param bd - bridge domain
356     @param mac - MAC address
357     @param ip4 - IPv4 address
358 */
359 autoreply define one_add_del_l2_arp_entry
360 {
361   u32 client_index;
362   u32 context;
363   u8 is_add;
364   u8 mac[6];
365   u32 bd;
366   u32 ip4;
367 };
368
369 /** \brief Request for L2 ARP entries from specified bridge domain
370     @param client_index - opaque cookie to identify the sender
371     @param context - sender context, to match reply w/ request
372     @param bd - bridge domain
373 */
374 define one_l2_arp_entries_get
375 {
376   u32 client_index;
377   u32 context;
378   u32 bd;
379 };
380
381 typeonly manual_print manual_endian define one_l2_arp_entry
382 {
383   u8 mac[6];
384   u32 ip4;
385 };
386
387 /** \brief Reply with L2 ARP entries from specified bridge domain
388     @param context - sender context, to match reply w/ request
389     @param retval - error code
390     @param count - number of elements in the list
391     @param vl_api_one_arp_entry_t - list of entries
392 */
393 manual_print manual_endian define one_l2_arp_entries_get_reply
394 {
395   u32 context;
396   i32 retval;
397   u32 count;
398   vl_api_one_l2_arp_entry_t entries[count];
399 };
400
401 /** \brief Request for list of bridge domains used by L2 ARP table
402     @param client_index - opaque cookie to identify the sender
403     @param context - sender context, to match reply w/ request
404 */
405 define one_l2_arp_bd_get
406 {
407   u32 client_index;
408   u32 context;
409 };
410
411 /** \brief Reply with list of bridge domains used by L2 ARP table
412     @param context - sender context, to match reply w/ request
413     @param count - number of elements in the list
414     @param bridge_domains - list of BDs
415 */
416 manual_print manual_endian define one_l2_arp_bd_get_reply
417 {
418   u32 context;
419   i32 retval;
420   u32 count;
421   u32 bridge_domains[count];
422 };
423
424 /** \brief add or delete ONE adjacency adjacency
425     @param client_index - opaque cookie to identify the sender
426     @param context - sender context, to match reply w/ request
427     @param is_add - add address if non-zero, else delete
428     @param vni - virtual network instance
429     @param eid_type -
430       0 : ipv4
431       1 : ipv6
432       2 : mac
433     @param reid - remote EID
434     @param leid - local EID
435 */
436 autoreply define one_add_del_adjacency
437 {
438   u32 client_index;
439   u32 context;
440   u8 is_add;
441   u32 vni;
442   u8 eid_type;
443   u8 reid[16];
444   u8 leid[16];
445   u8 reid_len;
446   u8 leid_len;
447 };
448
449 /** \brief add or delete map request itr rlocs
450     @param client_index - opaque cookie to identify the sender
451     @param context - sender context, to match reply w/ request
452     @param is_add - add address if non-zero, else delete
453     @param locator_set_name - locator set name
454 */
455 autoreply define one_add_del_map_request_itr_rlocs
456 {
457   u32 client_index;
458   u32 context;
459   u8 is_add;
460   u8 locator_set_name[64];
461 };
462
463 /** \brief map/unmap vni/bd_index to vrf
464     @param client_index - opaque cookie to identify the sender
465     @param context - sender context, to match reply w/ request
466     @param is_add - add or delete mapping
467     @param dp_table - virtual network id/bridge domain index
468     @param vrf - vrf
469 */
470 autoreply define one_eid_table_add_del_map
471 {
472   u32 client_index;
473   u32 context;
474   u8 is_add;
475   u32 vni;
476   u32 dp_table;
477   u8 is_l2;
478 };
479
480 /** \brief Request for map one locator status
481     @param client_index - opaque cookie to identify the sender
482     @param context - sender context, to match reply w/ request
483     @param locator_set_index - index of locator_set
484     @param ls_name - locator set name
485     @param is_index_set - flag indicating whether ls_name or ls_index is set
486  */
487 define one_locator_dump
488 {
489   u32 client_index;
490   u32 context;
491   u32 ls_index;
492   u8 ls_name[64];
493   u8 is_index_set;
494 };
495
496 /** \brief ONE locator_set status
497     @param local - if is set, then locator is local
498     @param locator_set_name - name of the locator_set
499     @param sw_if_index - sw_if_index of the locator
500     @param priority - locator priority
501     @param weight - locator weight
502   */
503 define one_locator_details
504 {
505   u32 context;
506   u8 local;
507   u32 sw_if_index;
508   u8 is_ipv6;
509   u8 ip_address[16];
510   u8 priority;
511   u8 weight;
512 };
513
514 /** \brief ONE locator_set status
515     @param context - sender context, to match reply w/ request
516     @param ls_index - locator set index
517     @param ls_name - name of the locator set
518  */
519 define one_locator_set_details
520 {
521   u32 context;
522   u32 ls_index;
523   u8 ls_name[64];
524 };
525
526 /** \brief Request for locator_set summary status
527     @param client_index - opaque cookie to identify the sender
528     @param context - sender context, to match reply w/ request
529     @param filter - filter type
530       Supported values:
531         0: all locator sets
532         1: local locator sets
533         2: remote locator sets
534  */
535 define one_locator_set_dump
536 {
537   u32 client_index;
538   u32 context;
539   u8 filter;
540 };
541
542 /** \brief Dump ONE eid-table
543     @param client_index - opaque cookie to identify the sender
544     @param context - sender context, to match reply w/ request
545     @param locator_set_index - index of locator_set, if ~0 then the mapping
546                                 is negative
547     @param action - negative map request action
548     @param is_local - local if non-zero, else remote
549     @param eid_type:
550       0 : ipv4
551       1 : ipv6
552       2 : mac
553     @param is_src_dst - EID is type of source/destination
554     @param eid - EID can be ip4, ip6 or mac
555     @param eid_prefix_len - prefix length
556     @param seid - source EID can be ip4, ip6 or mac
557     @param seid_prefix_len - source prefix length
558     @param vni - virtual network instance
559     @param ttl - time to live
560     @param authoritative - authoritative
561     @param key_id
562       HMAC_NO_KEY           0
563       HMAC_SHA_1_96         1
564       HMAC_SHA_256_128      2
565     @param key - secret key
566 */
567
568 define one_eid_table_details
569 {
570   u32 context;
571   u32 locator_set_index;
572   u8 action;
573   u8 is_local;
574   u8 eid_type;
575   u8 is_src_dst;
576   u32 vni;
577   u8 eid[16];
578   u8 eid_prefix_len;
579   u8 seid[16];
580   u8 seid_prefix_len;
581   u32 ttl;
582   u8 authoritative;
583   u16 key_id;
584   u8 key[64];
585 };
586
587 /** \brief Request for eid table summary status
588     @param client_index - opaque cookie to identify the sender
589     @param context - sender context, to match reply w/ request
590     @param eid_set - if non-zero request info about specific mapping
591     @param vni - virtual network instance; valid only if eid_set != 0
592     @param prefix_length - prefix length if EID is IP address;
593       valid only if eid_set != 0
594     @param eid_type - EID type; valid only if eid_set != 0
595       Supported values:
596         0: EID is IPv4
597         1: EID is IPv6
598         2: EID is ethernet address
599     @param eid - endpoint identifier
600     @param filter - filter type;
601       Support values:
602         0: all eid
603         1: local eid
604         2: remote eid
605  */
606 define one_eid_table_dump
607 {
608   u32 client_index;
609   u32 context;
610   u8 eid_set;
611   u8 prefix_length;
612   u32 vni;
613   u8 eid_type;
614   u8 eid[16];
615   u8 filter;
616 };
617
618 /** \brief ONE adjacency
619     @param eid_type -
620       0 : ipv4
621       1 : ipv6
622       2 : mac
623     @param reid - remote EID
624     @param leid - local EID
625     @param reid_prefix_len - remote EID IP prefix length
626     @param leid_prefix_len - local EID IP prefix length
627   */
628 typeonly manual_print manual_endian define one_adjacency
629 {
630   u8 eid_type;
631   u8 reid[16];
632   u8 leid[16];
633   u8 reid_prefix_len;
634   u8 leid_prefix_len;
635 };
636
637 /** \brief ONE adjacency reply
638     @param count - number of adjacencies
639     @param adjacencies - array of adjacencies
640   */
641 manual_endian manual_print define one_adjacencies_get_reply
642 {
643   u32 context;
644   i32 retval;
645   u32 count;
646   vl_api_one_adjacency_t adjacencies[count];
647 };
648
649 /** \brief Request for ONE adjacencies
650     @param client_index - opaque cookie to identify the sender
651     @param context - sender context, to match reply w/ request
652     @param vni - filter adjacencies by VNI
653  */
654 define one_adjacencies_get
655 {
656   u32 client_index;
657   u32 context;
658   u32 vni;
659 };
660
661 /** \brief Shows relationship between vni and vrf/bd
662     @param dp_table - VRF index or bridge domain index
663     @param vni - vitual network instance
664   */
665 define one_eid_table_map_details
666 {
667   u32 context;
668   u32 vni;
669   u32 dp_table;
670 };
671
672 /** \brief Request for one_eid_table_map_details
673     @param client_index - opaque cookie to identify the sender
674     @param context - sender context, to match reply w/ request
675     @param is_l2 - if set dump vni/bd mappings else vni/vrf
676  */
677 define one_eid_table_map_dump
678 {
679   u32 client_index;
680   u32 context;
681   u8 is_l2;
682 };
683
684 /** \brief Dumps all VNIs used in mappings
685     @param client_index - opaque cookie to identify the sender
686     @param context - sender context, to match reply w/ request
687   */
688 define one_eid_table_vni_dump
689 {
690   u32 client_index;
691   u32 context;
692 };
693
694 /** \brief reply to one_eid_table_vni_dump
695     @param client_index - opaque cookie to identify the sender
696     @param context - sender context, to match reply w/ request
697     @param vni - virtual network instance
698  */
699 define one_eid_table_vni_details
700 {
701   u32 client_index;
702   u32 context;
703   u32 vni;
704 };
705
706 /** \brief ONE map resolver status
707     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
708     @param ip_address - array of address bytes
709  */
710 define one_map_resolver_details
711 {
712   u32 context;
713   u8 is_ipv6;
714   u8 ip_address[16];
715 };
716
717 /** \brief Request for map resolver summary status
718     @param client_index - opaque cookie to identify the sender
719     @param context - sender context, to match reply w/ request
720  */
721 define one_map_resolver_dump
722 {
723   u32 client_index;
724   u32 context;
725 };
726
727 /** \brief ONE map server details
728     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
729     @param ip_address - array of address bytes
730  */
731 define one_map_server_details
732 {
733   u32 context;
734   u8 is_ipv6;
735   u8 ip_address[16];
736 };
737
738 /** \brief Request for map server summary status
739     @param client_index - opaque cookie to identify the sender
740     @param context - sender context, to match reply w/ request
741  */
742 define one_map_server_dump
743 {
744   u32 client_index;
745   u32 context;
746 };
747
748 /** \brief Request for ONE status
749     @param client_index - opaque cookie to identify the sender
750     @param context - sender context, to match reply w/ request
751 */
752 define show_one_status
753 {
754   u32 client_index;
755   u32 context;
756 };
757
758 /** \brief ONE status
759     @param context - sender context, to match reply w/ request
760     @param feature_status - enabled if non-zero, else disabled
761     @param gpe_status - enabled if non-zero, else disabled
762 */
763 define show_one_status_reply
764 {
765   u32 context;
766   i32 retval;
767   u8 feature_status;
768   u8 gpe_status;
769 };
770
771 /** \brief Get ONE map request itr rlocs status
772     @param context - sender context, to match reply w/ request
773     @param locator_set_name - name of the locator_set
774  */
775 define one_get_map_request_itr_rlocs
776 {
777   u32 client_index;
778   u32 context;
779 };
780
781 /** \brief Request for map request itr rlocs summary status
782  */
783 define one_get_map_request_itr_rlocs_reply
784 {
785   u32 context;
786   i32 retval;
787   u8 locator_set_name[64];
788 };
789
790 /** \brief Request for ONE PITR status
791     @param client_index - opaque cookie to identify the sender
792     @param context - sender context, to match reply w/ request
793 */
794 define show_one_pitr
795 {
796   u32 client_index;
797   u32 context;
798 };
799
800 /** \brief Status of ONE PITR, enable or disable
801     @param context - sender context, to match reply w/ request
802     @param status - ONE PITR enable if non-zero, else disable
803     @param locator_set_name -  name of the locator_set
804 */
805 define show_one_pitr_reply
806 {
807   u32 context;
808   i32 retval;
809   u8 status;
810   u8 locator_set_name[64];
811 };
812
813 define one_stats_dump
814 {
815   u32 client_index;
816   u32 context;
817 };
818
819 define one_stats_details
820 {
821   u32 context;
822   u32 vni;
823   u8 eid_type;
824   u8 deid[16];
825   u8 seid[16];
826   u8 deid_pref_len;
827   u8 seid_pref_len;
828   u8 is_ip4;
829   u8 rloc[16];
830   u8 lloc[16];
831
832   u32 pkt_count;
833   u32 bytes;
834 };
835
836 autoreply define one_stats_flush
837 {
838   u32 client_index;
839   u32 context;
840 };
841
842 autoreply define one_stats_enable_disable
843 {
844   u32 client_index;
845   u32 context;
846   u8 is_en;
847 };
848
849 define show_one_stats_enable_disable
850 {
851   u32 client_index;
852   u32 context;
853 };
854
855 define show_one_stats_enable_disable_reply
856 {
857   u32 context;
858   i32 retval;
859   u8 is_en;
860 };
861
862 /*
863  * Local Variables:
864  * eval: (c-set-style "gnu")
865  * End:
866  */