ikev2: refactor and test profile dump API
[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 ts - traffic selector data
136 */
137 autoreply define ikev2_profile_set_ts
138 {
139   u32 client_index;
140   u32 context;
141
142   string name[64];
143   vl_api_ikev2_ts_t ts;
144   option vat_help = "name <profile_name> protocol <proto> start_port <port> end_port <port> start_addr <ip4> end_addr <ip4> (local|remote)";
145   option status="in_progress";
146 };
147
148 /** \brief IKEv2: Set IKEv2 local RSA private key
149     @param client_index - opaque cookie to identify the sender
150     @param context - sender context, to match reply w/ request
151     @param key_file - Key file absolute path
152 */
153 autoreply define ikev2_set_local_key
154 {
155   u32 client_index;
156   u32 context;
157
158   string key_file[256];
159   option vat_help = "file <absolute_file_path>";
160   option status="in_progress";
161 };
162
163 /** \brief IKEv2: Set the tunnel interface which will be protected by IKE
164     If this API is not called, a new tunnel will be created
165     @param client_index - opaque cookie to identify the sender
166     @param context - sender context, to match reply w/ request
167     @param name - IKEv2 profile name
168     @param sw_if_index - Of an existing tunnel
169 */
170 autoreply define ikev2_set_tunnel_interface
171 {
172   u32 client_index;
173   u32 context;
174   string name[64];
175
176   vl_api_interface_index_t sw_if_index;
177   option status="in_progress";
178 };
179
180 /** \brief IKEv2: Set IKEv2 responder interface and IP address
181     @param client_index - opaque cookie to identify the sender
182     @param context - sender context, to match reply w/ request
183     @param name - IKEv2 profile name
184     @param responder - responder data
185 */
186 autoreply define ikev2_set_responder
187 {
188   u32 client_index;
189   u32 context;
190
191   string name[64];
192   vl_api_ikev2_responder_t responder;
193   option vat_help = "<profile_name> interface <interface> address <addr>";
194   option status="in_progress";
195 };
196
197 /** \brief IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296)
198     @param client_index - opaque cookie to identify the sender
199     @param context - sender context, to match reply w/ request
200     @param name - IKEv2 profile name
201     @param tr - IKE transforms
202 */
203 autoreply define ikev2_set_ike_transforms
204 {
205   u32 client_index;
206   u32 context;
207
208   string name[64];
209   vl_api_ikev2_ike_transforms_t tr;
210   option vat_help = "<profile_name> <crypto alg> <key size> <integrity alg> <DH group>";
211   option status="in_progress";
212 };
213
214 /** \brief IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296)
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 tr - ESP transforms
219 */
220 autoreply define ikev2_set_esp_transforms
221 {
222   u32 client_index;
223   u32 context;
224
225   string name[64];
226   vl_api_ikev2_esp_transforms_t tr;
227   option vat_help = "<profile_name> <crypto alg> <key size> <integrity alg>";
228   option status="in_progress";
229 };
230
231 /** \brief IKEv2: Set Child SA lifetime, limited by time and/or data
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 lifetime - SA maximum life time in seconds (0 to disable)
236     @param lifetime_jitter - Jitter added to prevent simultaneous rekeying
237     @param handover - Hand over time
238     @param lifetime_maxdata - SA maximum life time in bytes (0 to disable)
239 */
240 autoreply define ikev2_set_sa_lifetime
241 {
242   u32 client_index;
243   u32 context;
244
245   string name[64];
246   u64 lifetime;
247   u32 lifetime_jitter;
248   u32 handover;
249   u64 lifetime_maxdata;
250   option vat_help = "<profile_name> <seconds> <jitter> <handover> <max bytes>";
251   option status="in_progress";
252 };
253
254 /** \brief IKEv2: Initiate the SA_INIT exchange
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 */
259 autoreply define ikev2_initiate_sa_init
260 {
261   u32 client_index;
262   u32 context;
263
264   string name[64];
265   option vat_help = "<profile_name>";
266   option status="in_progress";
267 };
268
269 /** \brief IKEv2: Initiate the delete IKE SA exchange
270     @param client_index - opaque cookie to identify the sender
271     @param context - sender context, to match reply w/ request
272     @param ispi - IKE SA initiator SPI
273 */
274 autoreply define ikev2_initiate_del_ike_sa
275 {
276   u32 client_index;
277   u32 context;
278
279   u64 ispi;
280   option vat_help = "<ispi>";
281   option status="in_progress";
282 };
283
284 /** \brief IKEv2: Initiate the delete Child SA exchange
285     @param client_index - opaque cookie to identify the sender
286     @param context - sender context, to match reply w/ request
287     @param ispi - Child SA initiator SPI
288 */
289 autoreply define ikev2_initiate_del_child_sa
290 {
291   u32 client_index;
292   u32 context;
293
294   u32 ispi;
295   option vat_help = "<ispi>";
296   option status="in_progress";
297 };
298
299 /** \brief IKEv2: Initiate the rekey Child SA exchange
300     @param client_index - opaque cookie to identify the sender
301     @param context - sender context, to match reply w/ request
302     @param ispi - Child SA initiator SPI
303 */
304 autoreply define ikev2_initiate_rekey_child_sa
305 {
306   u32 client_index;
307   u32 context;
308
309   u32 ispi;
310   option vat_help = "<ispi>";
311   option status="in_progress";
312 };
313
314 /** \brief IKEv2: Set UDP encapsulation
315     @param client_index - opaque cookie to identify the sender
316     @param context - sender context, to match reply w/ request
317     @param name - IKEv2 profile name
318 */
319 autoreply define ikev2_profile_set_udp_encap
320 {
321   u32 client_index;
322   u32 context;
323
324   string name[64];
325   option status="in_progress";
326 };
327
328 /** \brief IKEv2: Set/unset custom ipsec-over-udp port
329     @param client_index - opaque cookie to identify the sender
330     @param context - sender context, to match reply w/ request
331     @param is_set - whether set or unset custom port
332     @param port - port number
333     @param name - IKEv2 profile name
334 */
335 autoreply define ikev2_profile_set_ipsec_udp_port
336 {
337   u32 client_index;
338   u32 context;
339
340   u8 is_set;
341   u16 port;
342   string name[64];
343   option status="in_progress";
344 };
345
346 /** \brief IKEv2: Set liveness parameters
347     @param client_index - opaque cookie to identify the sender
348     @param context - sender context, to match reply w/ request
349     @param period - how often is liveness check performed
350     @param max_retries - max retries for liveness check
351 */
352 autoreply define ikev2_profile_set_liveness
353 {
354   u32 client_index;
355   u32 context;
356
357   u32 period;
358   u32 max_retries;
359   option status="in_progress";
360 };
361
362 /*
363  * Local Variables:
364  * eval: (c-set-style "gnu")
365  * End:
366  */