vcl: allow more rx events on peek
[vpp.git] / src / plugins / ikev2 / ikev2.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2015-2020 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 option version = "1.0.1";
18
19 import "plugins/ikev2/ikev2_types.api";
20 import "vnet/ip/ip_types.api";
21 import "vnet/interface_types.api";
22
23 /** \brief Get the plugin version
24     @param client_index - opaque cookie to identify the sender
25     @param context - sender context, to match reply w/ request
26 */
27 define ikev2_plugin_get_version
28 {
29   u32 client_index;
30   u32 context;
31 };
32
33 /** \brief Reply to get the plugin version
34     @param context - returned sender context, to match reply w/ request
35     @param major - Incremented every time a known breaking behavior change is introduced
36     @param minor - Incremented with small changes, may be used to avoid buggy versions
37 */
38 define ikev2_plugin_get_version_reply
39 {
40   u32 context;
41   u32 major;
42   u32 minor;
43 };
44
45 /** \brief Dump all profiles
46     @param client_index - opaque cookie to identify the sender
47     @param context - sender context, to match reply w/ request
48 */
49 define ikev2_profile_dump
50 {
51   u32 client_index;
52   u32 context;
53   option status="in_progress";
54 };
55
56 /** \brief Details about all profiles
57     @param context - returned sender context, to match reply w/ request
58     @param profile - profile element with encapsulated attributes
59 */
60 define ikev2_profile_details
61 {
62   u32 context;
63   vl_api_ikev2_profile_t profile;
64   option status="in_progress";
65 };
66
67 /** \brief Dump all SAs
68     @param client_index - opaque cookie to identify the sender
69     @param context - sender context, to match reply w/ request
70 */
71 define ikev2_sa_dump
72 {
73   u32 client_index;
74   u32 context;
75 };
76
77 /** \brief Dump all SAs
78     @param client_index - opaque cookie to identify the sender
79     @param context - sender context, to match reply w/ request
80 */
81 define ikev2_sa_v2_dump
82 {
83   u32 client_index;
84   u32 context;
85 };
86
87 /** \brief Dump all SAs
88     @param client_index - opaque cookie to identify the sender
89     @param context - sender context, to match reply w/ request
90 */
91 define ikev2_sa_v3_dump
92 {
93   u32 client_index;
94   u32 context;
95   option status = "in_progress";
96 };
97
98 /** \brief Details about IKE SA
99     @param context - sender context, to match reply w/ request
100     @param retval - return code
101     @param sa - SA data
102 */
103 define ikev2_sa_details
104 {
105   u32 context;
106   i32 retval;
107
108   vl_api_ikev2_sa_t sa;
109 };
110
111 /** \brief Details about IKE SA
112     @param context - sender context, to match reply w/ request
113     @param retval - return code
114     @param sa - SA data
115 */
116 define ikev2_sa_v2_details
117 {
118   u32 context;
119   i32 retval;
120
121   vl_api_ikev2_sa_v2_t sa;
122 };
123
124 /** \brief Details about IKE SA
125     @param context - sender context, to match reply w/ request
126     @param retval - return code
127     @param sa - SA data
128 */
129 define ikev2_sa_v3_details
130 {
131   u32 context;
132   i32 retval;
133
134   vl_api_ikev2_sa_v3_t sa;
135   option status = "in_progress";
136 };
137
138 /** \brief Dump child SA of specific SA
139     @param client_index - opaque cookie to identify the sender
140     @param context - sender context, to match reply w/ request
141     @param sa_index - index of specific sa
142 */
143 define ikev2_child_sa_dump
144 {
145   u32 client_index;
146   u32 context;
147
148   u32 sa_index;
149   option vat_help = "sa_index <index>";
150 };
151
152 /** \brief Child SA details
153     @param context - sender context, to match reply w/ request
154     @param retval - return code
155     @param child_sa - child SA data
156 */
157 define ikev2_child_sa_details
158 {
159   u32 context;
160   i32 retval;
161
162   vl_api_ikev2_child_sa_t child_sa;
163 };
164
165 /** \brief Dump child SA of specific SA
166     @param client_index - opaque cookie to identify the sender
167     @param context - sender context, to match reply w/ request
168     @param sa_index - index of specific sa
169 */
170 define ikev2_child_sa_v2_dump
171 {
172   u32 client_index;
173   u32 context;
174
175   u32 sa_index;
176   option vat_help = "sa_index <index>";
177   option status = "in_progress";
178 };
179
180 /** \brief Child SA details
181     @param context - sender context, to match reply w/ request
182     @param retval - return code
183     @param child_sa - child SA data
184 */
185 define ikev2_child_sa_v2_details
186 {
187   u32 context;
188   i32 retval;
189
190   vl_api_ikev2_child_sa_v2_t child_sa;
191   option status = "in_progress";
192 };
193
194 /** \brief get specific nonce
195     @param client_index - opaque cookie to identify the sender
196     @param context - sender context, to match reply w/ request
197     @param is_initiator - specify type initiator|responder of nonce
198     @param sa_index - index of specific sa
199 */
200 define ikev2_nonce_get
201 {
202   u32 client_index;
203   u32 context;
204
205   bool is_initiator;
206   u32 sa_index;
207   option vat_help = "initiator|responder sa_index <index>";
208   option status = "in_progress";
209 };
210
211 /** \brief reply on specific nonce
212     @param context - sender context, to match reply w/ request
213     @param retval - return code
214     @param data_len - nonce length
215     @param nonce - nonce data
216 */
217
218 define ikev2_nonce_get_reply
219 {
220   u32 context;
221   i32 retval;
222
223   u32 data_len;
224   u8 nonce[data_len];
225   option status = "in_progress";
226 };
227
228 /** \brief dump traffic selectors
229     @param client_index - opaque cookie to identify the sender
230     @param context - sender context, to match reply w/ request
231     @param is_initiator - specify type initiator|responder of nonce
232     @param sa_index - index of specific sa
233     @param child_sa_index - index of specific sa child of specific sa
234 */
235
236 define ikev2_traffic_selector_dump
237 {
238   u32 client_index;
239   u32 context;
240
241   bool is_initiator;
242   u32 sa_index;
243   u32 child_sa_index;
244   option vat_help = "initiator|responder sa_index <index> child_sa_index <index>";
245   option status = "in_progress";
246 };
247
248 /** \brief details on specific traffic selector
249     @param context - sender context, to match reply w/ request
250     @param retval - return code
251     @param ts - traffic selector data
252 */
253
254 define ikev2_traffic_selector_details
255 {
256   u32 context;
257   i32 retval;
258
259   vl_api_ikev2_ts_t ts;
260   option status = "in_progress";
261 };
262
263 /** \brief IKEv2: Add/delete profile
264     @param client_index - opaque cookie to identify the sender
265     @param context - sender context, to match reply w/ request
266     @param name - IKEv2 profile name
267     @param is_add - Add IKEv2 profile if non-zero, else delete
268 */
269 autoreply define ikev2_profile_add_del
270 {
271   u32 client_index;
272   u32 context;
273
274   string name[64];
275   bool is_add;
276   option vat_help = "name <profile_name> [del]";
277   option status="in_progress";
278 };
279
280 /** \brief IKEv2: Set IKEv2 profile authentication method
281     @param client_index - opaque cookie to identify the sender
282     @param context - sender context, to match reply w/ request
283     @param name - IKEv2 profile name
284     @param auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig)
285     @param is_hex - Authentication data in hex format if non-zero, else string
286     @param data_len - Authentication data length
287     @param data - Authentication data (for rsa-sig cert file path)
288 */
289 autoreply define ikev2_profile_set_auth
290 {
291   u32 client_index;
292   u32 context;
293
294   string name[64];
295   u8 auth_method;
296   bool is_hex;
297   u32 data_len;
298   u8 data[data_len];
299   option vat_help = "name <profile_name> auth_method <method> (auth_data 0x<data> | auth_data <data>)";
300   option status="in_progress";
301 };
302
303 /** \brief IKEv2: Set IKEv2 profile local/remote identification
304     @param client_index - opaque cookie to identify the sender
305     @param context - sender context, to match reply w/ request
306     @param name - IKEv2 profile name
307     @param is_local - Identification is local if non-zero, else remote
308     @param id_type - Identification type
309     @param data_len - Identification data length
310     @param data - Identification data
311 */
312 autoreply define ikev2_profile_set_id
313 {
314   u32 client_index;
315   u32 context;
316
317   string name[64];
318   bool is_local;
319   u8 id_type;
320   u32 data_len;
321   u8 data[data_len];
322   option vat_help = "name <profile_name> id_type <type> (id_data 0x<data> | id_data <data>) (local|remote)";
323   option status="in_progress";
324 };
325
326 /** \brief IKEv2: Disable NAT traversal
327     @param client_index - opaque cookie to identify the sender
328     @param context - sender context, to match reply w/ request
329     @param name - IKEv2 profile name
330 */
331 autoreply define ikev2_profile_disable_natt
332 {
333   u32 client_index;
334   u32 context;
335
336   string name[64];
337   option status="in_progress";
338 };
339
340 /** \brief IKEv2: Set IKEv2 profile traffic selector parameters
341     @param client_index - opaque cookie to identify the sender
342     @param context - sender context, to match reply w/ request
343     @param name - IKEv2 profile name
344     @param ts - traffic selector data
345 */
346 autoreply define ikev2_profile_set_ts
347 {
348   u32 client_index;
349   u32 context;
350
351   string name[64];
352   vl_api_ikev2_ts_t ts;
353   option vat_help = "name <profile_name> protocol <proto> start_port <port> end_port <port> start_addr <ip> end_addr <ip> (local|remote)";
354   option status="in_progress";
355 };
356
357 /** \brief IKEv2: Set IKEv2 local RSA private key
358     @param client_index - opaque cookie to identify the sender
359     @param context - sender context, to match reply w/ request
360     @param key_file - Key file absolute path
361 */
362 autoreply define ikev2_set_local_key
363 {
364   u32 client_index;
365   u32 context;
366
367   string key_file[256];
368   option vat_help = "file <absolute_file_path>";
369   option status="in_progress";
370 };
371
372 /** \brief IKEv2: Set the tunnel interface which will be protected by IKE
373     If this API is not called, a new tunnel will be created
374     @param client_index - opaque cookie to identify the sender
375     @param context - sender context, to match reply w/ request
376     @param name - IKEv2 profile name
377     @param sw_if_index - Of an existing tunnel
378 */
379 autoreply define ikev2_set_tunnel_interface
380 {
381   u32 client_index;
382   u32 context;
383   string name[64];
384
385   vl_api_interface_index_t sw_if_index;
386   option status="in_progress";
387 };
388
389 /** \brief IKEv2: Set IKEv2 responder interface and IP address
390     @param client_index - opaque cookie to identify the sender
391     @param context - sender context, to match reply w/ request
392     @param name - IKEv2 profile name
393     @param responder - responder data
394 */
395 autoreply define ikev2_set_responder
396 {
397   u32 client_index;
398   u32 context;
399
400   string name[64];
401   vl_api_ikev2_responder_t responder;
402   option vat_help = "<profile_name> interface <interface> address <addr>";
403   option status="in_progress";
404 };
405
406 autoreply define ikev2_set_responder_hostname
407 {
408   u32 client_index;
409   u32 context;
410
411   string name[64];
412   string hostname[64];
413   vl_api_interface_index_t sw_if_index;
414   option status="in_progress";
415 };
416
417 /** \brief IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296)
418     @param client_index - opaque cookie to identify the sender
419     @param context - sender context, to match reply w/ request
420     @param name - IKEv2 profile name
421     @param tr - IKE transforms
422 */
423 autoreply define ikev2_set_ike_transforms
424 {
425   u32 client_index;
426   u32 context;
427
428   string name[64];
429   vl_api_ikev2_ike_transforms_t tr;
430   option vat_help = "<profile_name> <crypto alg> <key size> <integrity alg> <DH group>";
431   option status="in_progress";
432 };
433
434 /** \brief IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296)
435     @param client_index - opaque cookie to identify the sender
436     @param context - sender context, to match reply w/ request
437     @param name - IKEv2 profile name
438     @param tr - ESP transforms
439 */
440 autoreply define ikev2_set_esp_transforms
441 {
442   u32 client_index;
443   u32 context;
444
445   string name[64];
446   vl_api_ikev2_esp_transforms_t tr;
447   option vat_help = "<profile_name> <crypto alg> <key size> <integrity alg>";
448   option status="in_progress";
449 };
450
451 /** \brief IKEv2: Set Child SA lifetime, limited by time and/or data
452     @param client_index - opaque cookie to identify the sender
453     @param context - sender context, to match reply w/ request
454     @param name - IKEv2 profile name
455     @param lifetime - SA maximum life time in seconds (0 to disable)
456     @param lifetime_jitter - Jitter added to prevent simultaneous rekeying
457     @param handover - Hand over time
458     @param lifetime_maxdata - SA maximum life time in bytes (0 to disable)
459 */
460 autoreply define ikev2_set_sa_lifetime
461 {
462   u32 client_index;
463   u32 context;
464
465   string name[64];
466   u64 lifetime;
467   u32 lifetime_jitter;
468   u32 handover;
469   u64 lifetime_maxdata;
470   option vat_help = "<profile_name> <seconds> <jitter> <handover> <max bytes>";
471   option status="in_progress";
472 };
473
474 /** \brief IKEv2: Initiate the SA_INIT exchange
475     @param client_index - opaque cookie to identify the sender
476     @param context - sender context, to match reply w/ request
477     @param name - IKEv2 profile name
478 */
479 autoreply define ikev2_initiate_sa_init
480 {
481   u32 client_index;
482   u32 context;
483
484   string name[64];
485   option vat_help = "<profile_name>";
486   option status="in_progress";
487 };
488
489 /** \brief IKEv2: Initiate the delete IKE SA exchange
490     @param client_index - opaque cookie to identify the sender
491     @param context - sender context, to match reply w/ request
492     @param ispi - IKE SA initiator SPI
493 */
494 autoreply define ikev2_initiate_del_ike_sa
495 {
496   u32 client_index;
497   u32 context;
498
499   u64 ispi;
500   option vat_help = "<ispi>";
501   option status="in_progress";
502 };
503
504 /** \brief IKEv2: Initiate the delete Child SA exchange
505     @param client_index - opaque cookie to identify the sender
506     @param context - sender context, to match reply w/ request
507     @param ispi - Child SA initiator SPI
508 */
509 autoreply define ikev2_initiate_del_child_sa
510 {
511   u32 client_index;
512   u32 context;
513
514   u32 ispi;
515   option vat_help = "<ispi>";
516   option status="in_progress";
517 };
518
519 /** \brief IKEv2: Initiate the rekey Child SA exchange
520     @param client_index - opaque cookie to identify the sender
521     @param context - sender context, to match reply w/ request
522     @param ispi - Child SA initiator SPI
523 */
524 autoreply define ikev2_initiate_rekey_child_sa
525 {
526   u32 client_index;
527   u32 context;
528
529   u32 ispi;
530   option vat_help = "<ispi>";
531   option status="in_progress";
532 };
533
534 /** \brief IKEv2: Set UDP encapsulation
535     @param client_index - opaque cookie to identify the sender
536     @param context - sender context, to match reply w/ request
537     @param name - IKEv2 profile name
538 */
539 autoreply define ikev2_profile_set_udp_encap
540 {
541   u32 client_index;
542   u32 context;
543
544   string name[64];
545   option status="in_progress";
546 };
547
548 /** \brief IKEv2: Set/unset custom ipsec-over-udp port
549     @param client_index - opaque cookie to identify the sender
550     @param context - sender context, to match reply w/ request
551     @param is_set - whether set or unset custom port
552     @param port - port number
553     @param name - IKEv2 profile name
554 */
555 autoreply define ikev2_profile_set_ipsec_udp_port
556 {
557   u32 client_index;
558   u32 context;
559
560   u8 is_set;
561   u16 port;
562   string name[64];
563   option status="in_progress";
564 };
565
566 /** \brief IKEv2: Set liveness parameters
567     @param client_index - opaque cookie to identify the sender
568     @param context - sender context, to match reply w/ request
569     @param period - how often is liveness check performed
570     @param max_retries - max retries for liveness check
571 */
572 autoreply define ikev2_profile_set_liveness
573 {
574   u32 client_index;
575   u32 context;
576
577   u32 period;
578   u32 max_retries;
579   option status="in_progress";
580 };
581
582 counters ikev2 {
583   processed {
584     severity info;
585     type counter64;
586     units "packets";
587     description "packets processed";
588   };
589   ike_sa_init_retransmit {
590     severity info;
591     type counter64;
592     units "packets";
593     description "IKE SA INIT retransmit";
594   };
595   ike_sa_init_ignore {
596     severity error;
597     type counter64;
598     units "packets";
599     description "IKE_SA_INIT ignore (IKE SA already auth)";
600   };
601   ike_req_retransmit {
602     severity error;
603     type counter64;
604     units "packets";
605     description "IKE request retransmit";
606   };
607   ike_req_ignore {
608     severity error;
609     type counter64;
610     units "packets";
611     description "IKE request ignore (old msgid)";
612   };
613   not_ikev2 {
614     severity error;
615     type counter64;
616     units "packets";
617     description "Non IKEv2 packets received";
618   };
619   bad_length {
620     severity error;
621     type counter64;
622     units "packets";
623     description "Bad packet length";
624   };
625   malformed_packet {
626     severity error;
627     type counter64;
628     units "packets";
629     description "Malformed packet";
630   };
631   no_buff_space {
632     severity error;
633     type counter64;
634     units "packets";
635     description "No buffer space";
636   };
637   keepalive {
638     severity info;
639     type counter64;
640     units "packets";
641     description "IKE keepalive messages received";
642   };
643   rekey_req {
644     severity info;
645     type counter64;
646     units "packets";
647     description "IKE rekey requests received";
648   };
649   init_sa_req {
650     severity info;
651     type counter64;
652     units "packets";
653     description "IKE EXCHANGE SA requests received";
654   };
655   ike_auth_req {
656     severity info;
657     type counter64;
658     units "packets";
659     description "IKE AUTH SA requests received";
660   };
661 };
662 paths {
663   "/err/ikev2-ip4" "ike";
664   "/err/ikev2-ip6" "ike";
665   "/err/ikev2-ip4-natt" "ike";
666 };
667
668 /*
669  * Local Variables:
670  * eval: (c-set-style "gnu")
671  * End:
672  */