ikev2: add support for custom ipsec-over-udp port
[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 "vnet/ip/ip_types.api";
20 import "vnet/interface_types.api";
21
22 /** \brief Get the plugin version
23     @param client_index - opaque cookie to identify the sender
24     @param context - sender context, to match reply w/ request
25 */
26 define ikev2_plugin_get_version
27 {
28   u32 client_index;
29   u32 context;
30 };
31
32 /** \brief Reply to get the plugin version
33     @param context - returned sender context, to match reply w/ request
34     @param major - Incremented every time a known breaking behavior change is introduced
35     @param minor - Incremented with small changes, may be used to avoid buggy versions
36 */
37 define ikev2_plugin_get_version_reply
38 {
39   u32 context;
40   u32 major;
41   u32 minor;
42 };
43
44 /** \brief IKEv2: Add/delete profile
45     @param client_index - opaque cookie to identify the sender
46     @param context - sender context, to match reply w/ request
47
48     @param name - IKEv2 profile name
49     @param is_add - Add IKEv2 profile if non-zero, else delete
50 */
51 autoreply define ikev2_profile_add_del
52 {
53   u32 client_index;
54   u32 context;
55
56   string name[64];
57   bool is_add;
58   option vat_help = "name <profile_name> [del]";
59 };
60
61 /** \brief IKEv2: Set IKEv2 profile authentication method
62     @param client_index - opaque cookie to identify the sender
63     @param context - sender context, to match reply w/ request
64
65     @param name - IKEv2 profile name
66     @param auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig)
67     @param is_hex - Authentication data in hex format if non-zero, else string
68     @param data_len - Authentication data length
69     @param data - Authentication data (for rsa-sig cert file path)
70 */
71 autoreply define ikev2_profile_set_auth
72 {
73   u32 client_index;
74   u32 context;
75
76   string name[64];
77   u8 auth_method;
78   bool is_hex;
79   u32 data_len;
80   u8 data[data_len];
81   option vat_help = "name <profile_name> auth_method <method> (auth_data 0x<data> | auth_data <data>)";
82 };
83
84 /** \brief IKEv2: Set IKEv2 profile local/remote identification
85     @param client_index - opaque cookie to identify the sender
86     @param context - sender context, to match reply w/ request
87
88     @param name - IKEv2 profile name
89     @param is_local - Identification is local if non-zero, else remote
90     @param id_type - Identification type
91     @param data_len - Identification data length
92     @param data - Identification data
93 */
94 autoreply define ikev2_profile_set_id
95 {
96   u32 client_index;
97   u32 context;
98
99   string name[64];
100   bool is_local;
101   u8 id_type;
102   u32 data_len;
103   u8 data[data_len];
104   option vat_help = "name <profile_name> id_type <type> (id_data 0x<data> | id_data <data>) (local|remote)";
105 };
106
107 /** \brief IKEv2: Set IKEv2 profile traffic selector parameters
108     @param client_index - opaque cookie to identify the sender
109     @param context - sender context, to match reply w/ request
110
111     @param name - IKEv2 profile name
112     @param is_local - Traffic selector is local if non-zero, else remote
113     @param proto - Traffic selector IP protocol (if zero not relevant)
114     @param start_port - The smallest port number allowed by traffic selector
115     @param end_port - The largest port number allowed by traffic selector
116     @param start_addr - The smallest address included in traffic selector
117     @param end_addr - The largest address included in traffic selector
118 */
119 autoreply define ikev2_profile_set_ts
120 {
121   u32 client_index;
122   u32 context;
123
124   string name[64];
125   bool is_local;
126   u8 proto;
127   u16 start_port;
128   u16 end_port;
129   u32 start_addr;
130   u32 end_addr;
131   option vat_help = "name <profile_name> protocol <proto> start_port <port> end_port <port> start_addr <ip4> end_addr <ip4> (local|remote)";
132 };
133
134 /** \brief IKEv2: Set IKEv2 local RSA private key
135     @param client_index - opaque cookie to identify the sender
136     @param context - sender context, to match reply w/ request
137
138     @param key_file - Key file absolute path
139 */
140 autoreply define ikev2_set_local_key
141 {
142   u32 client_index;
143   u32 context;
144
145   u8 key_file[256];
146   option vat_help = "file <absolute_file_path>";
147 };
148
149 /** \brief IKEv2: Set the tunnel interface which will be protected by IKE
150     If this API is not called, a new tunnel will be created
151     @param client_index - opaque cookie to identify the sender
152     @param context - sender context, to match reply w/ request
153     @param name - IKEv2 profile name
154     @param sw_if_index - Of an existing tunnel
155 */
156 autoreply define ikev2_set_tunnel_interface
157 {
158   u32 client_index;
159   u32 context;
160   string name[64];
161
162   vl_api_interface_index_t sw_if_index;
163 };
164
165 /** \brief IKEv2: Set IKEv2 responder interface and IP address
166     @param client_index - opaque cookie to identify the sender
167     @param context - sender context, to match reply w/ request
168
169     @param name - IKEv2 profile name
170     @param sw_if_index - interface index
171     @param address - interface address
172 */
173 autoreply define ikev2_set_responder
174 {
175   u32 client_index;
176   u32 context;
177
178   string name[64];
179   vl_api_interface_index_t sw_if_index;
180   vl_api_ip4_address_t address;
181   option vat_help = "<profile_name> interface <interface> address <addr>";
182 };
183
184 /** \brief IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296)
185     @param client_index - opaque cookie to identify the sender
186     @param context - sender context, to match reply w/ request
187
188     @param name - IKEv2 profile name
189     @param crypto_alg - encryption algorithm
190     @param crypto_key_size - encryption key size
191     @param integ_alg - integrity algorithm
192     @param dh_group - Diffie-Hellman group
193     
194 */
195 autoreply define ikev2_set_ike_transforms
196 {
197   u32 client_index;
198   u32 context;
199
200   string name[64];
201   u32 crypto_alg;
202   u32 crypto_key_size;
203   u32 integ_alg;
204   u32 dh_group;
205   option vat_help = "<profile_name> <crypto alg> <key size> <integrity alg> <DH group>";
206 };
207
208 /** \brief IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296)
209     @param client_index - opaque cookie to identify the sender
210     @param context - sender context, to match reply w/ request
211
212     @param name - IKEv2 profile name
213     @param crypto_alg - encryption algorithm
214     @param crypto_key_size - encryption key size
215     @param integ_alg - integrity algorithm
216     @param dh_group - Diffie-Hellman group
217     
218 */
219 autoreply define ikev2_set_esp_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 };
231
232 /** \brief IKEv2: Set Child SA lifetime, limited by time and/or data
233     @param client_index - opaque cookie to identify the sender
234     @param context - sender context, to match reply w/ request
235
236     @param name - IKEv2 profile name
237     @param lifetime - SA maximum life time in seconds (0 to disable)
238     @param lifetime_jitter - Jitter added to prevent simultaneous rekeying
239     @param handover - Hand over time
240     @param lifetime_maxdata - SA maximum life time in bytes (0 to disable)
241     
242 */
243 autoreply define ikev2_set_sa_lifetime
244 {
245   u32 client_index;
246   u32 context;
247
248   string name[64];
249   u64 lifetime;
250   u32 lifetime_jitter;
251   u32 handover;
252   u64 lifetime_maxdata;
253   option vat_help = "<profile_name> <seconds> <jitter> <handover> <max bytes>";
254 };
255
256 /** \brief IKEv2: Initiate the SA_INIT exchange
257     @param client_index - opaque cookie to identify the sender
258     @param context - sender context, to match reply w/ request
259
260     @param name - IKEv2 profile name
261     
262 */
263 autoreply define ikev2_initiate_sa_init
264 {
265   u32 client_index;
266   u32 context;
267
268   string name[64];
269   option vat_help = "<profile_name>";
270 };
271
272 /** \brief IKEv2: Initiate the delete IKE SA exchange
273     @param client_index - opaque cookie to identify the sender
274     @param context - sender context, to match reply w/ request
275
276     @param ispi - IKE SA initiator SPI
277     
278 */
279 autoreply define ikev2_initiate_del_ike_sa
280 {
281   u32 client_index;
282   u32 context;
283
284   u64 ispi;
285   option vat_help = "<ispi>";
286 };
287
288 /** \brief IKEv2: Initiate the delete Child SA exchange
289     @param client_index - opaque cookie to identify the sender
290     @param context - sender context, to match reply w/ request
291
292     @param ispi - Child SA initiator SPI
293     
294 */
295 autoreply define ikev2_initiate_del_child_sa
296 {
297   u32 client_index;
298   u32 context;
299
300   u32 ispi;
301   option vat_help = "<ispi>";
302 };
303
304 /** \brief IKEv2: Initiate the rekey Child SA exchange
305     @param client_index - opaque cookie to identify the sender
306     @param context - sender context, to match reply w/ request
307
308     @param ispi - Child SA initiator SPI
309     
310 */
311 autoreply define ikev2_initiate_rekey_child_sa
312 {
313   u32 client_index;
314   u32 context;
315
316   u32 ispi;
317   option vat_help = "<ispi>";
318 };
319
320 /** \brief IKEv2: Set UDP encapsulation
321     @param client_index - opaque cookie to identify the sender
322     @param context - sender context, to match reply w/ request
323     @param name - IKEv2 profile name
324 */
325 autoreply define ikev2_profile_set_udp_encap
326 {
327   u32 client_index;
328   u32 context;
329
330   string name[64];
331 };
332
333 /** \brief IKEv2: Set/unset custom ipsec-over-udp port
334     @param client_index - opaque cookie to identify the sender
335     @param context - sender context, to match reply w/ request
336     @param is_set - whether set or unset custom port
337     @port - port number
338     @param name - IKEv2 profile name
339 */
340 autoreply define ikev2_profile_set_ipsec_udp_port
341 {
342   u32 client_index;
343   u32 context;
344
345   u8 is_set;
346   u16 port;
347   string name[64];
348 };
349 /*
350  * Local Variables:
351  * eval: (c-set-style "gnu")
352  * End:
353  */
354