ikev2: API downgrade due to lack of ikev2 tests
[vpp.git] / src / plugins / ikev2 / ikev2.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2015-2016 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
68 /** \brief IKEv2: Add/delete profile
69     @param client_index - opaque cookie to identify the sender
70     @param context - sender context, to match reply w/ request
71     @param name - IKEv2 profile name
72     @param is_add - Add IKEv2 profile if non-zero, else delete
73 */
74 autoreply define ikev2_profile_add_del
75 {
76   u32 client_index;
77   u32 context;
78
79   string name[64];
80   bool is_add;
81   option vat_help = "name <profile_name> [del]";
82   option status="in_progress";
83 };
84
85 /** \brief IKEv2: Set IKEv2 profile authentication method
86     @param client_index - opaque cookie to identify the sender
87     @param context - sender context, to match reply w/ request
88     @param name - IKEv2 profile name
89     @param auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig)
90     @param is_hex - Authentication data in hex format if non-zero, else string
91     @param data_len - Authentication data length
92     @param data - Authentication data (for rsa-sig cert file path)
93 */
94 autoreply define ikev2_profile_set_auth
95 {
96   u32 client_index;
97   u32 context;
98
99   string name[64];
100   u8 auth_method;
101   bool is_hex;
102   u32 data_len;
103   u8 data[data_len];
104   option vat_help = "name <profile_name> auth_method <method> (auth_data 0x<data> | auth_data <data>)";
105   option status="in_progress";
106 };
107
108 /** \brief IKEv2: Set IKEv2 profile local/remote identification
109     @param client_index - opaque cookie to identify the sender
110     @param context - sender context, to match reply w/ request
111     @param name - IKEv2 profile name
112     @param is_local - Identification is local if non-zero, else remote
113     @param id_type - Identification type
114     @param data_len - Identification data length
115     @param data - Identification data
116 */
117 autoreply define ikev2_profile_set_id
118 {
119   u32 client_index;
120   u32 context;
121
122   string name[64];
123   bool is_local;
124   u8 id_type;
125   u32 data_len;
126   u8 data[data_len];
127   option vat_help = "name <profile_name> id_type <type> (id_data 0x<data> | id_data <data>) (local|remote)";
128   option status="in_progress";
129 };
130
131 /** \brief IKEv2: Set IKEv2 profile traffic selector parameters
132     @param client_index - opaque cookie to identify the sender
133     @param context - sender context, to match reply w/ request
134     @param name - IKEv2 profile name
135     @param is_local - Traffic selector is local if non-zero, else remote
136     @param proto - Traffic selector IP protocol (if zero not relevant)
137     @param start_port - The smallest port number allowed by traffic selector
138     @param end_port - The largest port number allowed by traffic selector
139     @param start_addr - The smallest address included in traffic selector
140     @param end_addr - The largest address included in traffic selector
141 */
142 autoreply define ikev2_profile_set_ts
143 {
144   u32 client_index;
145   u32 context;
146
147   string name[64];
148   bool is_local;
149   u8 proto;
150   u16 start_port;
151   u16 end_port;
152   u32 start_addr;
153   u32 end_addr;
154   option vat_help = "name <profile_name> protocol <proto> start_port <port> end_port <port> start_addr <ip4> end_addr <ip4> (local|remote)";
155   option status="in_progress";
156 };
157
158 /** \brief IKEv2: Set IKEv2 local RSA private key
159     @param client_index - opaque cookie to identify the sender
160     @param context - sender context, to match reply w/ request
161
162     @param key_file - Key file absolute path
163 */
164 autoreply define ikev2_set_local_key
165 {
166   u32 client_index;
167   u32 context;
168
169   string key_file[256];
170   option vat_help = "file <absolute_file_path>";
171   option status="in_progress";
172 };
173
174 /** \brief IKEv2: Set the tunnel interface which will be protected by IKE
175     If this API is not called, a new tunnel will be created
176     @param client_index - opaque cookie to identify the sender
177     @param context - sender context, to match reply w/ request
178     @param name - IKEv2 profile name
179     @param sw_if_index - Of an existing tunnel
180 */
181 autoreply define ikev2_set_tunnel_interface
182 {
183   u32 client_index;
184   u32 context;
185   string name[64];
186
187   vl_api_interface_index_t sw_if_index;
188   option status="in_progress";
189 };
190
191 /** \brief IKEv2: Set IKEv2 responder interface and IP address
192     @param client_index - opaque cookie to identify the sender
193     @param context - sender context, to match reply w/ request
194     @param name - IKEv2 profile name
195     @param sw_if_index - interface index
196     @param address - interface address
197 */
198 autoreply define ikev2_set_responder
199 {
200   u32 client_index;
201   u32 context;
202
203   string name[64];
204   vl_api_interface_index_t sw_if_index;
205   vl_api_ip4_address_t address;
206   option vat_help = "<profile_name> interface <interface> address <addr>";
207   option status="in_progress";
208 };
209
210 /** \brief IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296)
211     @param client_index - opaque cookie to identify the sender
212     @param context - sender context, to match reply w/ request
213     @param name - IKEv2 profile name
214     @param crypto_alg - encryption algorithm
215     @param crypto_key_size - encryption key size
216     @param integ_alg - integrity algorithm
217     @param dh_group - Diffie-Hellman group
218 */
219 autoreply define ikev2_set_ike_transforms
220 {
221   u32 client_index;
222   u32 context;
223
224   string name[64];
225   u32 crypto_alg;
226   u32 crypto_key_size;
227   u32 integ_alg;
228   u32 dh_group;
229   option vat_help = "<profile_name> <crypto alg> <key size> <integrity alg> <DH group>";
230   option status="in_progress";
231 };
232
233 /** \brief IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296)
234     @param client_index - opaque cookie to identify the sender
235     @param context - sender context, to match reply w/ request
236     @param name - IKEv2 profile name
237     @param crypto_alg - encryption algorithm
238     @param crypto_key_size - encryption key size
239     @param integ_alg - integrity algorithm
240     @param dh_group - Diffie-Hellman group
241 */
242 autoreply define ikev2_set_esp_transforms
243 {
244   u32 client_index;
245   u32 context;
246
247   string name[64];
248   u32 crypto_alg;
249   u32 crypto_key_size;
250   u32 integ_alg;
251   u32 dh_group;
252   option vat_help = "<profile_name> <crypto alg> <key size> <integrity alg> <DH group>";
253   option status="in_progress";
254 };
255
256 /** \brief IKEv2: Set Child SA lifetime, limited by time and/or data
257     @param client_index - opaque cookie to identify the sender
258     @param context - sender context, to match reply w/ request
259     @param name - IKEv2 profile name
260     @param lifetime - SA maximum life time in seconds (0 to disable)
261     @param lifetime_jitter - Jitter added to prevent simultaneous rekeying
262     @param handover - Hand over time
263     @param lifetime_maxdata - SA maximum life time in bytes (0 to disable)
264 */
265 autoreply define ikev2_set_sa_lifetime
266 {
267   u32 client_index;
268   u32 context;
269
270   string name[64];
271   u64 lifetime;
272   u32 lifetime_jitter;
273   u32 handover;
274   u64 lifetime_maxdata;
275   option vat_help = "<profile_name> <seconds> <jitter> <handover> <max bytes>";
276   option status="in_progress";
277 };
278
279 /** \brief IKEv2: Initiate the SA_INIT exchange
280     @param client_index - opaque cookie to identify the sender
281     @param context - sender context, to match reply w/ request
282     @param name - IKEv2 profile name
283 */
284 autoreply define ikev2_initiate_sa_init
285 {
286   u32 client_index;
287   u32 context;
288
289   string name[64];
290   option vat_help = "<profile_name>";
291   option status="in_progress";
292 };
293
294 /** \brief IKEv2: Initiate the delete IKE SA exchange
295     @param client_index - opaque cookie to identify the sender
296     @param context - sender context, to match reply w/ request
297     @param ispi - IKE SA initiator SPI
298 */
299 autoreply define ikev2_initiate_del_ike_sa
300 {
301   u32 client_index;
302   u32 context;
303
304   u64 ispi;
305   option vat_help = "<ispi>";
306   option status="in_progress";
307 };
308
309 /** \brief IKEv2: Initiate the delete Child SA exchange
310     @param client_index - opaque cookie to identify the sender
311     @param context - sender context, to match reply w/ request
312     @param ispi - Child SA initiator SPI
313 */
314 autoreply define ikev2_initiate_del_child_sa
315 {
316   u32 client_index;
317   u32 context;
318
319   u32 ispi;
320   option vat_help = "<ispi>";
321   option status="in_progress";
322 };
323
324 /** \brief IKEv2: Initiate the rekey Child SA exchange
325     @param client_index - opaque cookie to identify the sender
326     @param context - sender context, to match reply w/ request
327     @param ispi - Child SA initiator SPI
328 */
329 autoreply define ikev2_initiate_rekey_child_sa
330 {
331   u32 client_index;
332   u32 context;
333
334   u32 ispi;
335   option vat_help = "<ispi>";
336   option status="in_progress";
337 };
338
339 /** \brief IKEv2: Set UDP encapsulation
340     @param client_index - opaque cookie to identify the sender
341     @param context - sender context, to match reply w/ request
342     @param name - IKEv2 profile name
343 */
344 autoreply define ikev2_profile_set_udp_encap
345 {
346   u32 client_index;
347   u32 context;
348
349   string name[64];
350   option status="in_progress";
351 };
352
353 /** \brief IKEv2: Set/unset custom ipsec-over-udp port
354     @param client_index - opaque cookie to identify the sender
355     @param context - sender context, to match reply w/ request
356     @param is_set - whether set or unset custom port
357     @param port - port number
358     @param name - IKEv2 profile name
359 */
360 autoreply define ikev2_profile_set_ipsec_udp_port
361 {
362   u32 client_index;
363   u32 context;
364
365   u8 is_set;
366   u16 port;
367   string name[64];
368   option status="in_progress";
369 };
370
371 /** \brief IKEv2: Set liveness parameters
372     @param client_index - opaque cookie to identify the sender
373     @param context - sender context, to match reply w/ request
374     @param period - how often is liveness check performed
375     @param max_retries - max retries for liveness check
376 */
377 autoreply define ikev2_profile_set_liveness
378 {
379   u32 client_index;
380   u32 context;
381
382   u32 period;
383   u32 max_retries;
384   option status="in_progress";
385 };
386
387 /*
388  * Local Variables:
389  * eval: (c-set-style "gnu")
390  * End:
391  */