FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
ipsec.api
Go to the documentation of this file.
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 = "3.0.0";
18 
19 import "vnet/ip/ip_types.api";
20 
21 /** \brief IPsec: Add/delete Security Policy Database
22  @param client_index - opaque cookie to identify the sender
23  @param context - sender context, to match reply w/ request
24  @param is_add - add SPD if non-zero, else delete
25  @param spd_id - SPD instance id (control plane allocated)
26 */
27 
28 autoreply define ipsec_spd_add_del
29 {
34 };
35 
36 /** \brief IPsec: Add/delete SPD from interface
37 
38  @param client_index - opaque cookie to identify the sender
39  @param context - sender context, to match reply w/ request
40  @param is_add - add security mode if non-zero, else delete
41  @param sw_if_index - index of the interface
42  @param spd_id - SPD instance id to use for lookups
43 */
44 
45 
46 autoreply define ipsec_interface_add_del_spd
47 {
50 
54 };
55 
56 
58 {
59  /* bypass - no IPsec processing */
61  /* discard - discard packet with ICMP processing */
63  /* resolve - send request to control plane for SA resolving */
65  /* protect - apply IPsec policy using following parameters */
67 };
68 
69 /** \brief IPsec: Security Policy Database entry
70 
71  See RFC 4301, 4.4.1.1 on how to match packet to selectors
72 
73  @param spd_id - SPD instance id (control plane allocated)
74  @param priority - priority of SPD entry (non-unique value). Used to order SPD matching - higher priorities match before lower
75  @param is_outbound - entry applies to outbound traffic if non-zero, otherwise applies to inbound traffic
76  @param remote_address_start - start of remote address range to match
77  @param remote_address_stop - end of remote address range to match
78  @param local_address_start - start of local address range to match
79  @param local_address_stop - end of local address range to match
80  @param protocol - protocol type to match [0 means any] otherwise IANA value
81  @param remote_port_start - start of remote port range to match ...
82  @param remote_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
83  @param local_port_start - start of local port range to match ...
84  @param local_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
85  @param policy - action to perform on match
86  @param sa_id - SAD instance id (control plane allocated)
87 */
88 typedef ipsec_spd_entry
89 {
90  u32 spd_id;
93 
95  vl_api_ipsec_spd_action_t policy;
97 
98  // Selector
99  vl_api_address_t remote_address_start;
100  vl_api_address_t remote_address_stop;
101  vl_api_address_t local_address_start;
102  vl_api_address_t local_address_stop;
103 
108 };
109 
110 /** \brief IPsec: Add/delete Security Policy Database entry
111 
112  @param client_index - opaque cookie to identify the sender
113  @param context - sender context, to match reply w/ request
114  @param is_add - add SPD if non-zero, else delete
115  @param entry - Description of the entry to add/dell
116 */
117 define ipsec_spd_entry_add_del
118 {
122  vl_api_ipsec_spd_entry_t entry;
123 };
124 
125 /** \brief IPsec: Reply Add/delete Security Policy Database entry
126 
127  @param context - sender context, to match reply w/ request
128  @param retval - success/fail rutrun code
129  @param stat_index - An index for the policy in the stats segment @ /net/ipec/policy
130 */
131 define ipsec_spd_entry_add_del_reply
132 {
136 };
137 
138 /** \brief Dump IPsec all SPD IDs
139  @param client_index - opaque cookie to identify the sender
140  @param context - sender context, to match reply w/ request
141 */
142 define ipsec_spds_dump {
145 };
146 
147 /** \brief Dump IPsec all SPD IDs response
148  @param client_index - opaque cookie to identify the sender
149  @param spd_id - SPD instance id (control plane allocated)
150  @param npolicies - number of policies in SPD
151 */
152 define ipsec_spds_details {
156 };
157 
158 /** \brief Dump ipsec policy database data
159  @param client_index - opaque cookie to identify the sender
160  @param context - sender context, to match reply w/ request
161  @param spd_id - SPD instance id
162  @param sa_id - SA id, optional, set to ~0 to see all policies in SPD
163 */
164 define ipsec_spd_dump {
169 };
170 
171 /** \brief IPsec policy database response
172  @param context - sender context which was passed in the request
173  €param entry - The SPD entry.
174  @param bytes - byte count of packets matching this policy
175  @param packets - count of packets matching this policy
176 */
177 define ipsec_spd_details {
179  vl_api_ipsec_spd_entry_t entry;
180 };
181 
182 /*
183  * @brief Support cryptographic algorithms
184  */
186 {
199 };
200 
201 /*
202  * @brief Supported Integrity Algorithms
203  */
205 {
207  /* RFC2403 */
209  /* RFC2404 */
211  /* draft-ietf-ipsec-ciph-sha-256-00 */
213  /* RFC4868 */
215  /* RFC4868 */
217  /* RFC4868 */
219 };
220 
222 {
224  /* Enable extended sequence numbers */
226  /* Enable Anti-replay */
228  /* IPsec tunnel mode if non-zero, else transport mode */
230  /* IPsec tunnel mode is IPv6 if non-zero,
231  * else IPv4 tunnel only valid if is_tunnel is non-zero */
233  /* enable UDP encapsulation for NAT traversal */
235 };
236 
238 {
241 };
242 
243 typedef key
244 {
245  /* the length of the key */
246  u8 length;
247  /* The data for the key */
248  u8 data[128];
249 };
250 
251 /** \brief IPsec: Security Association Database entry
252  @param client_index - opaque cookie to identify the sender
253  @param context - sender context, to match reply w/ request
254  @param is_add - add SAD entry if non-zero, else delete
255  @param sad_id - sad id
256  @param spi - security parameter index
257  @param protocol - 0 = AH, 1 = ESP
258  @param crypto_algorithm - a supported crypto algorithm
259  @param crypto_key - crypto keying material
260  @param integrity_algorithm - one of the supported algorithms
261  @param integrity_key - integrity keying material
262  @param tunnel_src_address - IPsec tunnel source address IPv6 if is_tunnel_ipv6 is non-zero, else IPv4. Only valid if is_tunnel is non-zero
263  @param tunnel_dst_address - IPsec tunnel destination address IPv6 if is_tunnel_ipv6 is non-zero, else IPv4. Only valid if is_tunnel is non-zero
264  @param tx_table_id - the FIB id used for encapsulated packets
265  */
266 typedef ipsec_sad_entry
267 {
268  u32 sad_id;
269 
271 
272  vl_api_ipsec_proto_t protocol;
273 
274  vl_api_ipsec_crypto_alg_t crypto_algorithm;
275  vl_api_key_t crypto_key;
276 
277  vl_api_ipsec_integ_alg_t integrity_algorithm;
278  vl_api_key_t integrity_key;
279 
280  vl_api_ipsec_sad_flags_t flags;
281 
282  vl_api_address_t tunnel_src;
283  vl_api_address_t tunnel_dst;
285 };
286 
287 /** \brief IPsec: Add/delete Security Association Database entry
288  @param client_index - opaque cookie to identify the sender
289  @param context - sender context, to match reply w/ request
290  @param entry - Entry to add or delete
291  */
292 define ipsec_sad_entry_add_del
293 {
297  vl_api_ipsec_sad_entry_t entry;
298 };
299 define ipsec_sad_entry_add_del_reply
300 {
304 };
305 
306 /** \brief IPsec: Update Security Association keys
307  @param client_index - opaque cookie to identify the sender
308  @param context - sender context, to match reply w/ request
309 
310  @param sa_id - sa id
311 
312  @param crypto_key - crypto keying material
313  @param integrity_key - integrity keying material
314 */
315 
316 autoreply define ipsec_sa_set_key
317 {
320 
322 
323  vl_api_key_t crypto_key;
324  vl_api_key_t integrity_key;
325 };
326 
327 /** \brief IPsec: Get SPD interfaces
328  @param client_index - opaque cookie to identify the sender
329  @param context - sender context, to match reply w/ request
330  @param spd_index - SPD index
331  @param spd_index_valid - if 1 spd_index is used to filter
332  spd_index's, if 0 no filtering is done
333 */
334 define ipsec_spd_interface_dump {
339 };
340 
341 /** \brief IPsec: SPD interface response
342  @param context - sender context which was passed in the request
343  @param spd_index - SPD index
344  @param sw_if_index - index of the interface
345 */
346 define ipsec_spd_interface_details {
350 };
351 
352 /** \brief Add or delete IPsec tunnel interface
353  @param client_index - opaque cookie to identify the sender
354  @param context - sender context, to match reply w/ request
355  @param is_add - add IPsec tunnel interface if nonzero, else delete
356  @param is_ip6 - tunnel v6 or v4
357  @param esn - enable extended sequence numbers if nonzero, else disable
358  @param anti_replay - enable anti replay check if nonzero, else disable
359  @param local_ip - local IP address
360  @param remote_ip - IP address of remote IPsec peer
361  @param local_spi - SPI of outbound IPsec SA
362  @param remote_spi - SPI of inbound IPsec SA
363  @param crypto_alg - encryption algorithm ID
364  @param local_crypto_key_len - length of local crypto key in bytes
365  @param local_crypto_key - crypto key for outbound IPsec SA
366  @param remote_crypto_key_len - length of remote crypto key in bytes
367  @param remote_crypto_key - crypto key for inbound IPsec SA
368  @param integ_alg - integrity algorithm ID
369  @param local_integ_key_len - length of local integrity key in bytes
370  @param local_integ_key - integrity key for outbound IPsec SA
371  @param remote_integ_key_len - length of remote integrity key in bytes
372  @param remote_integ_key - integrity key for inbound IPsec SA
373  @param renumber - intf display name uses a specified instance if != 0
374  @param show_instance - instance to display for intf if renumber is set
375  @param udp_encap - enable UDP encapsulation for NAT traversal
376  @param tx_table_id - the FIB id used after packet encap
377 */
378 define ipsec_tunnel_if_add_del {
384  vl_api_address_t local_ip;
385  vl_api_address_t remote_ip;
390  u8 local_crypto_key[128];
392  u8 remote_crypto_key[128];
395  u8 local_integ_key[128];
397  u8 remote_integ_key[128];
402 };
403 
404 /** \brief Add/delete IPsec tunnel interface response
405  @param context - sender context, to match reply w/ request
406  @param retval - return status
407  @param sw_if_index - sw_if_index of new interface (for successful add)
408 */
409 define ipsec_tunnel_if_add_del_reply {
413 };
414 
415 /** \brief Dump IPsec security association
416  @param client_index - opaque cookie to identify the sender
417  @param context - sender context, to match reply w/ request
418  @param sa_id - optional ID of an SA to dump, if ~0 dump all SAs in SAD
419 */
420 define ipsec_sa_dump {
424 };
425 
426 /** \brief IPsec security association database response
427  @param context - sender context which was passed in the request
428  @param sa_id - SA ID, policy-based SAs >=0, tunnel interface SAs = 0
429  @param sw_if_index - sw_if_index of tunnel interface, policy-based SAs = ~0
430  @param spi - security parameter index
431  @param protocol - IPsec protocol (value from ipsec_protocol_t)
432  @param crypto_alg - crypto algorithm (value from ipsec_crypto_alg_t)
433  @param crypto_key_len - length of crypto_key in bytes
434  @param crypto_key - crypto keying material
435  @param integ_alg - integrity algorithm (value from ipsec_integ_alg_t)
436  @param integ_key_len - length of integ_key in bytes
437  @param integ_key - integrity keying material
438  @param use_esn - using extended sequence numbers when non-zero
439  @param use_anti_replay - using anti-replay window when non-zero
440  @param is_tunnel - IPsec tunnel mode when non-zero, else transport mode
441  @param is_tunnel_ipv6 - If using tunnel mode, endpoints are IPv6
442  @param tunnel_src_addr - Tunnel source address if using tunnel mode
443  @param tunnel_dst_addr - Tunnel destination address is using tunnel mode
444  @param salt - 4 byte salt
445  @param seq - current sequence number for outbound
446  @param seq_hi - high 32 bits of ESN for outbound
447  @param last_seq - highest sequence number received inbound
448  @param last_seq_hi - high 32 bits of highest ESN received inbound
449  @param replay_window - bit map of seq nums received relative to last_seq if using anti-replay
450  @param total_data_size - total bytes sent or received
451  @param udp_encap - 1 if UDP encap enabled, 0 otherwise
452 */
453 define ipsec_sa_details {
455  vl_api_ipsec_sad_entry_t entry;
456 
462 
464 };
465 
466 /** \brief Set key on IPsec interface
467  @param client_index - opaque cookie to identify the sender
468  @param context - sender context, to match reply w/ request
469  @param sw_if_index - index of tunnel interface
470  @param key_type - type of key being set
471  @param alg - algorithm used with key
472  @param key_len - length key in bytes
473  @param key - key
474 */
475 autoreply define ipsec_tunnel_if_set_key {
482  u8 key[128];
483 };
484 
485 /** \brief Set new SA on IPsec interface
486  @param client_index - opaque cookie to identify the sender
487  @param context - sender context, to match reply w/ request
488  @param sw_if_index - index of tunnel interface
489  @param sa_id - ID of SA to use
490  @param is_outbound - 1 if outbound (local) SA, 0 if inbound (remote)
491 */
492 autoreply define ipsec_tunnel_if_set_sa {
498 };
499 
500 /** \brief Dump IPsec backends
501  @param client_index - opaque cookie to identify the sender
502  @param context - sender context, to match reply w/ request
503 */
504 define ipsec_backend_dump {
507 };
508 
509 /** \brief IPsec backend details
510  @param name - name of the backend
511  @param protocol - IPsec protocol (value from ipsec_protocol_t)
512  @param index - backend index
513  @param active - set to 1 if the backend is active, otherwise 0
514 */
515 define ipsec_backend_details {
517  u8 name[128];
518  vl_api_ipsec_proto_t protocol;
521 };
522 
523 /** \brief Select IPsec backend
524  @param client_index - opaque cookie to identify the sender
525  @param context - sender context, to match reply w/ request
526  @param protocol - IPsec protocol (value from ipsec_protocol_t)
527  @param index - backend index
528 */
529 autoreply define ipsec_select_backend {
532  vl_api_ipsec_proto_t protocol;
534 };
535 
536 /*
537  * Local Variables:
538  * eval: (c-set-style "gnu")
539  * End:
540  */
541 
u32 tx_table_id
Definition: ipsec.api:284
vl_api_key_t crypto_key
Definition: ipsec.api:323
typedef ipsec_sad_entry
IPsec: Security Association Database entry.
Definition: ipsec.api:267
unsigned long u64
Definition: types.h:89
u32 context
Definition: ipsec.api:301
vl_api_ipsec_proto_t protocol
Definition: ipsec.api:518
vl_api_address_t local_address_stop
Definition: ipsec.api:102
u16 local_port_stop
Definition: ipsec.api:107
vl_api_address_t local_address_start
Definition: ipsec.api:101
vl_api_ipsec_spd_action_t policy
Definition: ipsec.api:95
vl_api_ipsec_crypto_alg_t crypto_algorithm
Definition: ipsec.api:274
u8 data[128]
Definition: ipsec.api:248
vl_api_key_t integrity_key
Definition: ipsec.api:278
u8 is_add
Definition: ipsec.api:121
unsigned char u8
Definition: types.h:56
vl_api_address_t remote_ip
Definition: ipsec.api:385
vl_api_key_t crypto_key
Definition: ipsec.api:275
vl_api_address_t remote_address_start
Definition: ipsec.api:99
vl_api_address_t local_ip
Definition: ipsec.api:384
unsigned int u32
Definition: types.h:88
ipsec_spd_action
Definition: ipsec.api:57
u32 context
Definition: ipsec.api:133
vl_api_address_t remote_address_stop
Definition: ipsec.api:100
u32 sa_id
Definition: ipsec.api:94
unsigned short u16
Definition: types.h:57
typedef ipsec_spd_entry
IPsec: Security Policy Database entry.
Definition: ipsec.api:89
vl_api_ipsec_integ_alg_t integrity_algorithm
Definition: ipsec.api:277
u16 remote_port_stop
Definition: ipsec.api:105
vl_api_ipsec_sad_flags_t flags
Definition: ipsec.api:280
u8 name[64]
Definition: memclnt.api:152
i32 priority
Definition: ipsec.api:91
ipsec_proto
Definition: ipsec.api:237
u32 client_index
Definition: ipsec.api:294
vl_api_ipsec_sad_entry_t entry
Definition: ipsec.api:297
vl_api_ipsec_proto_t protocol
Definition: ipsec.api:532
u8 is_outbound
Definition: ipsec.api:92
ipsec_sad_flags
Definition: ipsec.api:221
vl_api_ipsec_sad_entry_t entry
Definition: ipsec.api:455
signed int i32
Definition: types.h:77
u32 spi
Definition: ipsec.api:270
option version
Definition: ipsec.api:17
u32 stat_index
Definition: ipsec.api:135
u32 client_index
Definition: ipsec.api:119
ipsec_crypto_alg
Definition: ipsec.api:185
vl_api_ipsec_spd_entry_t entry
Definition: ipsec.api:179
vl_api_ipsec_spd_entry_t entry
Definition: ipsec.api:122
vl_api_address_t tunnel_src
Definition: ipsec.api:282
ipsec_integ_alg
Definition: ipsec.api:204
u16 remote_port_start
Definition: ipsec.api:104
typedef key
Definition: ipsec.api:244
u8 is_add
Definition: ipsec.api:296
u32 context
Definition: ipsec.api:120
vl_api_key_t integrity_key
Definition: ipsec.api:324
i32 retval
Definition: ipsec.api:302
u16 local_port_start
Definition: ipsec.api:106
i32 retval
Definition: ipsec.api:134
vl_api_address_t tunnel_dst
Definition: ipsec.api:283
u8 protocol
Definition: ipsec.api:96
u32 context
Definition: ipsec.api:295
u32 stat_index
Definition: ipsec.api:303