58b7fc05d9e204d4d0d7447adfae775dfb5a00d6
[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   option status = "in_progress";
77 };
78
79 /** \brief Dump all SAs
80     @param client_index - opaque cookie to identify the sender
81     @param context - sender context, to match reply w/ request
82 */
83 define ikev2_sa_v2_dump
84 {
85   u32 client_index;
86   u32 context;
87 };
88
89 /** \brief Details about IKE SA
90     @param context - sender context, to match reply w/ request
91     @param retval - return code
92     @param sa - SA data
93 */
94 define ikev2_sa_details
95 {
96   u32 context;
97   i32 retval;
98
99   vl_api_ikev2_sa_t sa;
100   option status = "in_progress";
101 };
102
103 /** \brief Details about IKE SA
104     @param context - sender context, to match reply w/ request
105     @param retval - return code
106     @param sa - SA data
107 */
108 define ikev2_sa_v2_details
109 {
110   u32 context;
111   i32 retval;
112
113   vl_api_ikev2_sa_v2_t sa;
114 };
115
116 /** \brief Dump child SA of specific SA
117     @param client_index - opaque cookie to identify the sender
118     @param context - sender context, to match reply w/ request
119     @param sa_index - index of specific sa
120 */
121 define ikev2_child_sa_dump
122 {
123   u32 client_index;
124   u32 context;
125
126   u32 sa_index;
127   option vat_help = "sa_index <index>";
128   option status = "in_progress";
129 };
130
131 /** \brief Child SA details
132     @param context - sender context, to match reply w/ request
133     @param retval - return code
134     @param child_sa - child SA data
135 */
136 define ikev2_child_sa_details
137 {
138   u32 context;
139   i32 retval;
140
141   vl_api_ikev2_child_sa_t child_sa;
142   option status = "in_progress";
143 };
144
145 /** \brief get specific nonce
146     @param client_index - opaque cookie to identify the sender
147     @param context - sender context, to match reply w/ request
148     @param is_initiator - specify type initiator|responder of nonce
149     @param sa_index - index of specific sa
150 */
151 define ikev2_nonce_get
152 {
153   u32 client_index;
154   u32 context;
155
156   bool is_initiator;
157   u32 sa_index;
158   option vat_help = "initiator|responder sa_index <index>";
159   option status = "in_progress";
160 };
161
162 /** \brief reply on specific nonce
163     @param context - sender context, to match reply w/ request
164     @param retval - return code
165     @param data_len - nonce length
166     @param nonce - nonce data
167 */
168
169 define ikev2_nonce_get_reply
170 {
171   u32 context;
172   i32 retval;
173
174   u32 data_len;
175   u8 nonce[data_len];
176   option status = "in_progress";
177 };
178
179 /** \brief dump traffic selectors
180     @param client_index - opaque cookie to identify the sender
181     @param context - sender context, to match reply w/ request
182     @param is_initiator - specify type initiator|responder of nonce
183     @param sa_index - index of specific sa
184     @param child_sa_index - index of specific sa child of specific sa
185 */
186
187 define ikev2_traffic_selector_dump
188 {
189   u32 client_index;
190   u32 context;
191
192   bool is_initiator;
193   u32 sa_index;
194   u32 child_sa_index;
195   option vat_help = "initiator|responder sa_index <index> child_sa_index <index>";
196   option status = "in_progress";
197 };
198
199 /** \brief details on specific traffic selector
200     @param context - sender context, to match reply w/ request
201     @param retval - return code
202     @param ts - traffic selector data
203 */
204
205 define ikev2_traffic_selector_details
206 {
207   u32 context;
208   i32 retval;
209
210   vl_api_ikev2_ts_t ts;
211   option status = "in_progress";
212 };
213
214 /** \brief IKEv2: Add/delete profile
215     @param client_index - opaque cookie to identify the sender
216     @param context - sender context, to match reply w/ request
217     @param name - IKEv2 profile name
218     @param is_add - Add IKEv2 profile if non-zero, else delete
219 */
220 autoreply define ikev2_profile_add_del
221 {
222   u32 client_index;
223   u32 context;
224
225   string name[64];
226   bool is_add;
227   option vat_help = "name <profile_name> [del]";
228   option status="in_progress";
229 };
230
231 /** \brief IKEv2: Set IKEv2 profile authentication method
232     @param client_index - opaque cookie to identify the sender
233     @param context - sender context, to match reply w/ request
234     @param name - IKEv2 profile name
235     @param auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig)
236     @param is_hex - Authentication data in hex format if non-zero, else string
237     @param data_len - Authentication data length
238     @param data - Authentication data (for rsa-sig cert file path)
239 */
240 autoreply define ikev2_profile_set_auth
241 {
242   u32 client_index;
243   u32 context;
244
245   string name[64];
246   u8 auth_method;
247   bool is_hex;
248   u32 data_len;
249   u8 data[data_len];
250   option vat_help = "name <profile_name> auth_method <method> (auth_data 0x<data> | auth_data <data>)";
251   option status="in_progress";
252 };
253
254 /** \brief IKEv2: Set IKEv2 profile local/remote identification
255     @param client_index - opaque cookie to identify the sender
256     @param context - sender context, to match reply w/ request
257     @param name - IKEv2 profile name
258     @param is_local - Identification is local if non-zero, else remote
259     @param id_type - Identification type
260     @param data_len - Identification data length
261     @param data - Identification data
262 */
263 autoreply define ikev2_profile_set_id
264 {
265   u32 client_index;
266   u32 context;
267
268   string name[64];
269   bool is_local;
270   u8 id_type;
271   u32 data_len;
272   u8 data[data_len];
273   option vat_help = "name <profile_name> id_type <type> (id_data 0x<data> | id_data <data>) (local|remote)";
274   option status="in_progress";
275 };
276
277 /** \brief IKEv2: Disable NAT traversal
278     @param client_index - opaque cookie to identify the sender
279     @param context - sender context, to match reply w/ request
280     @param name - IKEv2 profile name
281 */
282 autoreply define ikev2_profile_disable_natt
283 {
284   u32 client_index;
285   u32 context;
286
287   string name[64];
288   option status="in_progress";
289 };
290
291 /** \brief IKEv2: Set IKEv2 profile traffic selector parameters
292     @param client_index - opaque cookie to identify the sender
293     @param context - sender context, to match reply w/ request
294     @param name - IKEv2 profile name
295     @param ts - traffic selector data
296 */
297 autoreply define ikev2_profile_set_ts
298 {
299   u32 client_index;
300   u32 context;
301
302   string name[64];
303   vl_api_ikev2_ts_t ts;
304   option vat_help = "name <profile_name> protocol <proto> start_port <port> end_port <port> start_addr <ip> end_addr <ip> (local|remote)";
305   option status="in_progress";
306 };
307
308 /** \brief IKEv2: Set IKEv2 local RSA private key
309     @param client_index - opaque cookie to identify the sender
310     @param context - sender context, to match reply w/ request
311     @param key_file - Key file absolute path
312 */
313 autoreply define ikev2_set_local_key
314 {
315   u32 client_index;
316   u32 context;
317
318   string key_file[256];
319   option vat_help = "file <absolute_file_path>";
320   option status="in_progress";
321 };
322
323 /** \brief IKEv2: Set the tunnel interface which will be protected by IKE
324     If this API is not called, a new tunnel will be created
325     @param client_index - opaque cookie to identify the sender
326     @param context - sender context, to match reply w/ request
327     @param name - IKEv2 profile name
328     @param sw_if_index - Of an existing tunnel
329 */
330 autoreply define ikev2_set_tunnel_interface
331 {
332   u32 client_index;
333   u32 context;
334   string name[64];
335
336   vl_api_interface_index_t sw_if_index;
337   option status="in_progress";
338 };
339
340 /** \brief IKEv2: Set IKEv2 responder interface and IP address
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 responder - responder data
345 */
346 autoreply define ikev2_set_responder
347 {
348   u32 client_index;
349   u32 context;
350
351   string name[64];
352   vl_api_ikev2_responder_t responder;
353   option vat_help = "<profile_name> interface <interface> address <addr>";
354   option status="in_progress";
355 };
356
357 autoreply define ikev2_set_responder_hostname
358 {
359   u32 client_index;
360   u32 context;
361
362   string name[64];
363   string hostname[64];
364   vl_api_interface_index_t sw_if_index;
365   option status="in_progress";
366 };
367
368 /** \brief IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296)
369     @param client_index - opaque cookie to identify the sender
370     @param context - sender context, to match reply w/ request
371     @param name - IKEv2 profile name
372     @param tr - IKE transforms
373 */
374 autoreply define ikev2_set_ike_transforms
375 {
376   u32 client_index;
377   u32 context;
378
379   string name[64];
380   vl_api_ikev2_ike_transforms_t tr;
381   option vat_help = "<profile_name> <crypto alg> <key size> <integrity alg> <DH group>";
382   option status="in_progress";
383 };
384
385 /** \brief IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296)
386     @param client_index - opaque cookie to identify the sender
387     @param context - sender context, to match reply w/ request
388     @param name - IKEv2 profile name
389     @param tr - ESP transforms
390 */
391 autoreply define ikev2_set_esp_transforms
392 {
393   u32 client_index;
394   u32 context;
395
396   string name[64];
397   vl_api_ikev2_esp_transforms_t tr;
398   option vat_help = "<profile_name> <crypto alg> <key size> <integrity alg>";
399   option status="in_progress";
400 };
401
402 /** \brief IKEv2: Set Child SA lifetime, limited by time and/or data
403     @param client_index - opaque cookie to identify the sender
404     @param context - sender context, to match reply w/ request
405     @param name - IKEv2 profile name
406     @param lifetime - SA maximum life time in seconds (0 to disable)
407     @param lifetime_jitter - Jitter added to prevent simultaneous rekeying
408     @param handover - Hand over time
409     @param lifetime_maxdata - SA maximum life time in bytes (0 to disable)
410 */
411 autoreply define ikev2_set_sa_lifetime
412 {
413   u32 client_index;
414   u32 context;
415
416   string name[64];
417   u64 lifetime;
418   u32 lifetime_jitter;
419   u32 handover;
420   u64 lifetime_maxdata;
421   option vat_help = "<profile_name> <seconds> <jitter> <handover> <max bytes>";
422   option status="in_progress";
423 };
424
425 /** \brief IKEv2: Initiate the SA_INIT exchange
426     @param client_index - opaque cookie to identify the sender
427     @param context - sender context, to match reply w/ request
428     @param name - IKEv2 profile name
429 */
430 autoreply define ikev2_initiate_sa_init
431 {
432   u32 client_index;
433   u32 context;
434
435   string name[64];
436   option vat_help = "<profile_name>";
437   option status="in_progress";
438 };
439
440 /** \brief IKEv2: Initiate the delete IKE SA exchange
441     @param client_index - opaque cookie to identify the sender
442     @param context - sender context, to match reply w/ request
443     @param ispi - IKE SA initiator SPI
444 */
445 autoreply define ikev2_initiate_del_ike_sa
446 {
447   u32 client_index;
448   u32 context;
449
450   u64 ispi;
451   option vat_help = "<ispi>";
452   option status="in_progress";
453 };
454
455 /** \brief IKEv2: Initiate the delete Child SA exchange
456     @param client_index - opaque cookie to identify the sender
457     @param context - sender context, to match reply w/ request
458     @param ispi - Child SA initiator SPI
459 */
460 autoreply define ikev2_initiate_del_child_sa
461 {
462   u32 client_index;
463   u32 context;
464
465   u32 ispi;
466   option vat_help = "<ispi>";
467   option status="in_progress";
468 };
469
470 /** \brief IKEv2: Initiate the rekey Child SA exchange
471     @param client_index - opaque cookie to identify the sender
472     @param context - sender context, to match reply w/ request
473     @param ispi - Child SA initiator SPI
474 */
475 autoreply define ikev2_initiate_rekey_child_sa
476 {
477   u32 client_index;
478   u32 context;
479
480   u32 ispi;
481   option vat_help = "<ispi>";
482   option status="in_progress";
483 };
484
485 /** \brief IKEv2: Set UDP encapsulation
486     @param client_index - opaque cookie to identify the sender
487     @param context - sender context, to match reply w/ request
488     @param name - IKEv2 profile name
489 */
490 autoreply define ikev2_profile_set_udp_encap
491 {
492   u32 client_index;
493   u32 context;
494
495   string name[64];
496   option status="in_progress";
497 };
498
499 /** \brief IKEv2: Set/unset custom ipsec-over-udp port
500     @param client_index - opaque cookie to identify the sender
501     @param context - sender context, to match reply w/ request
502     @param is_set - whether set or unset custom port
503     @param port - port number
504     @param name - IKEv2 profile name
505 */
506 autoreply define ikev2_profile_set_ipsec_udp_port
507 {
508   u32 client_index;
509   u32 context;
510
511   u8 is_set;
512   u16 port;
513   string name[64];
514   option status="in_progress";
515 };
516
517 /** \brief IKEv2: Set liveness parameters
518     @param client_index - opaque cookie to identify the sender
519     @param context - sender context, to match reply w/ request
520     @param period - how often is liveness check performed
521     @param max_retries - max retries for liveness check
522 */
523 autoreply define ikev2_profile_set_liveness
524 {
525   u32 client_index;
526   u32 context;
527
528   u32 period;
529   u32 max_retries;
530   option status="in_progress";
531 };
532
533 counters ikev2 {
534   processed {
535     severity info;
536     type counter64;
537     units "packets";
538     description "packets processed";
539   };
540   ike_sa_init_retransmit {
541     severity info;
542     type counter64;
543     units "packets";
544     description "IKE SA INIT retransmit";
545   };
546   ike_sa_init_ignore {
547     severity error;
548     type counter64;
549     units "packets";
550     description "IKE_SA_INIT ignore (IKE SA already auth)";
551   };
552   ike_req_retransmit {
553     severity error;
554     type counter64;
555     units "packets";
556     description "IKE request retransmit";
557   };
558   ike_req_ignore {
559     severity error;
560     type counter64;
561     units "packets";
562     description "IKE request ignore (old msgid)";
563   };
564   not_ikev2 {
565     severity error;
566     type counter64;
567     units "packets";
568     description "Non IKEv2 packets received";
569   };
570   bad_length {
571     severity error;
572     type counter64;
573     units "packets";
574     description "Bad packet length";
575   };
576   malformed_packet {
577     severity error;
578     type counter64;
579     units "packets";
580     description "Malformed packet";
581   };
582   no_buff_space {
583     severity error;
584     type counter64;
585     units "packets";
586     description "No buffer space";
587   };
588   keepalive {
589     severity info;
590     type counter64;
591     units "packets";
592     description "IKE keepalive messages received";
593   };
594   rekey_req {
595     severity info;
596     type counter64;
597     units "packets";
598     description "IKE rekey requests received";
599   };
600   init_sa_req {
601     severity info;
602     type counter64;
603     units "packets";
604     description "IKE EXCHANGE SA requests received";
605   };
606   ike_auth_req {
607     severity info;
608     type counter64;
609     units "packets";
610     description "IKE AUTH SA requests received";
611   };
612 };
613 paths {
614   "/err/ikev2-ip4" "ike";
615   "/err/ikev2-ip6" "ike";
616   "/err/ikev2-ip4-natt" "ike";
617 };
618
619 /*
620  * Local Variables:
621  * eval: (c-set-style "gnu")
622  * End:
623  */