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