IPSEC: SPD counters in the stats sgement
[vpp.git] / src / vnet / ipsec / ipsec.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 = "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 {
30   u32 client_index;
31   u32 context;
32   u8 is_add;
33   u32 spd_id;
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 {
48   u32 client_index;
49   u32 context;
50
51   u8 is_add;
52   u32 sw_if_index;
53   u32 spd_id;
54 };
55
56
57 enum ipsec_spd_action
58 {
59   /* bypass - no IPsec processing */
60   IPSEC_API_SPD_ACTION_BYPASS = 0,
61   /* discard - discard packet with ICMP processing */
62   IPSEC_API_SPD_ACTION_DISCARD,
63   /* resolve - send request to control plane for SA resolving */
64   IPSEC_API_SPD_ACTION_RESOLVE,
65   /* protect - apply IPsec policy using following parameters */
66   IPSEC_API_SPD_ACTION_PROTECT,
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;
91   i32 priority;
92   u8 is_outbound;
93
94   u32 sa_id;
95   vl_api_ipsec_spd_action_t policy;
96   u8 protocol;
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
104   u16 remote_port_start;
105   u16 remote_port_stop;
106   u16 local_port_start;
107   u16 local_port_stop;
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 {
119   u32 client_index;
120   u32 context;
121   u8 is_add;
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 {
133   u32 context;
134   i32 retval;
135   u32 stat_index;
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 {
143   u32 client_index;
144   u32 context;
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 {
153   u32 context;
154   u32 spd_id;
155   u32 npolicies;
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 {
165     u32 client_index;
166     u32 context;
167     u32 spd_id;
168     u32 sa_id;
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 {
178     u32 context;
179     vl_api_ipsec_spd_entry_t entry;
180 };
181
182 /*
183  * @brief Support cryptographic algorithms
184  */
185 enum ipsec_crypto_alg
186 {
187   IPSEC_API_CRYPTO_ALG_NONE = 0,
188   IPSEC_API_CRYPTO_ALG_AES_CBC_128,
189   IPSEC_API_CRYPTO_ALG_AES_CBC_192,
190   IPSEC_API_CRYPTO_ALG_AES_CBC_256,
191   IPSEC_API_CRYPTO_ALG_AES_CTR_128,
192   IPSEC_API_CRYPTO_ALG_AES_CTR_192,
193   IPSEC_API_CRYPTO_ALG_AES_CTR_256,
194   IPSEC_API_CRYPTO_ALG_AES_GCM_128,
195   IPSEC_API_CRYPTO_ALG_AES_GCM_192,
196   IPSEC_API_CRYPTO_ALG_AES_GCM_256,
197   IPSEC_API_CRYPTO_ALG_DES_CBC,
198   IPSEC_API_CRYPTO_ALG_3DES_CBC,
199 };
200
201 /*
202  * @brief Supported Integrity Algorithms
203  */
204 enum ipsec_integ_alg
205 {
206   IPSEC_API_INTEG_ALG_NONE = 0,
207   /* RFC2403 */
208   IPSEC_API_INTEG_ALG_MD5_96,
209   /* RFC2404 */
210   IPSEC_API_INTEG_ALG_SHA1_96,
211   /* draft-ietf-ipsec-ciph-sha-256-00 */
212   IPSEC_API_INTEG_ALG_SHA_256_96,
213   /* RFC4868 */
214   IPSEC_API_INTEG_ALG_SHA_256_128,
215   /* RFC4868 */
216   IPSEC_API_INTEG_ALG_SHA_384_192,
217   /* RFC4868 */
218   IPSEC_API_INTEG_ALG_SHA_512_256,
219 };
220
221 enum ipsec_sad_flags
222 {
223   IPSEC_API_SAD_FLAG_NONE = 0,
224   /* Enable extended sequence numbers */
225   IPSEC_API_SAD_FLAG_USE_EXTENDED_SEQ_NUM = 0x01,
226   /* Enable Anti-replay */
227   IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY = 0x02,
228   /* IPsec tunnel mode if non-zero, else transport mode */
229   IPSEC_API_SAD_FLAG_IS_TUNNEL = 0x04,
230   /* IPsec tunnel mode is IPv6 if non-zero,
231    *  else IPv4 tunnel only valid if is_tunnel is non-zero */
232   IPSEC_API_SAD_FLAG_IS_TUNNEL_V6 = 0x08,
233   /* enable UDP encapsulation for NAT traversal */
234   IPSEC_API_SAD_FLAG_UDP_ENCAP = 0x10,
235 };
236
237 enum ipsec_proto
238 {
239   IPSEC_API_PROTO_ESP,
240   IPSEC_API_PROTO_AH,
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  */
265 typedef ipsec_sad_entry
266 {
267   u32 sad_id;
268
269   u32 spi;
270
271   vl_api_ipsec_proto_t protocol;
272
273   vl_api_ipsec_crypto_alg_t crypto_algorithm;
274   vl_api_key_t crypto_key;
275
276   vl_api_ipsec_integ_alg_t integrity_algorithm;
277   vl_api_key_t integrity_key;
278
279   vl_api_ipsec_sad_flags_t flags;
280
281   vl_api_address_t tunnel_src;
282   vl_api_address_t tunnel_dst;
283 };
284
285 /** \brief IPsec: Add/delete Security Association Database entry
286     @param client_index - opaque cookie to identify the sender
287     @param context - sender context, to match reply w/ request
288     @param entry - Entry to add or delete
289  */
290 autoreply define ipsec_sad_entry_add_del
291 {
292   u32 client_index;
293   u32 context;
294   u8 is_add;
295   vl_api_ipsec_sad_entry_t entry;
296 };
297
298 /** \brief IPsec: Update Security Association keys
299     @param client_index - opaque cookie to identify the sender
300     @param context - sender context, to match reply w/ request
301
302     @param sa_id - sa id
303
304     @param crypto_key - crypto keying material
305     @param integrity_key - integrity keying material
306 */
307
308 autoreply define ipsec_sa_set_key
309 {
310   u32 client_index;
311   u32 context;
312
313   u32 sa_id;
314
315   vl_api_key_t crypto_key;
316   vl_api_key_t integrity_key;
317 };
318
319 /** \brief IKEv2: Add/delete profile
320     @param client_index - opaque cookie to identify the sender
321     @param context - sender context, to match reply w/ request
322
323     @param name - IKEv2 profile name
324     @param is_add - Add IKEv2 profile if non-zero, else delete
325 */
326 autoreply define ikev2_profile_add_del
327 {
328   u32 client_index;
329   u32 context;
330
331   u8 name[64];
332   u8 is_add;
333 };
334
335 /** \brief IKEv2: Set IKEv2 profile authentication method
336     @param client_index - opaque cookie to identify the sender
337     @param context - sender context, to match reply w/ request
338
339     @param name - IKEv2 profile name
340     @param auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig)
341     @param is_hex - Authentication data in hex format if non-zero, else string
342     @param data_len - Authentication data length
343     @param data - Authentication data (for rsa-sig cert file path)
344 */
345 autoreply define ikev2_profile_set_auth
346 {
347   u32 client_index;
348   u32 context;
349
350   u8 name[64];
351   u8 auth_method;
352   u8 is_hex;
353   u32 data_len;
354   u8 data[data_len];
355 };
356
357 /** \brief IKEv2: Set IKEv2 profile local/remote identification
358     @param client_index - opaque cookie to identify the sender
359     @param context - sender context, to match reply w/ request
360
361     @param name - IKEv2 profile name
362     @param is_local - Identification is local if non-zero, else remote
363     @param id_type - Identification type
364     @param data_len - Identification data length
365     @param data - Identification data
366 */
367 autoreply define ikev2_profile_set_id
368 {
369   u32 client_index;
370   u32 context;
371
372   u8 name[64];
373   u8 is_local;
374   u8 id_type;
375   u32 data_len;
376   u8 data[data_len];
377 };
378
379 /** \brief IKEv2: Set IKEv2 profile traffic selector parameters
380     @param client_index - opaque cookie to identify the sender
381     @param context - sender context, to match reply w/ request
382
383     @param name - IKEv2 profile name
384     @param is_local - Traffic selector is local if non-zero, else remote
385     @param proto - Traffic selector IP protocol (if zero not relevant)
386     @param start_port - The smallest port number allowed by traffic selector
387     @param end_port - The largest port number allowed by traffic selector
388     @param start_addr - The smallest address included in traffic selector
389     @param end_addr - The largest address included in traffic selector
390 */
391 autoreply define ikev2_profile_set_ts
392 {
393   u32 client_index;
394   u32 context;
395
396   u8 name[64];
397   u8 is_local;
398   u8 proto;
399   u16 start_port;
400   u16 end_port;
401   u32 start_addr;
402   u32 end_addr;
403 };
404
405 /** \brief IKEv2: Set IKEv2 local RSA private key
406     @param client_index - opaque cookie to identify the sender
407     @param context - sender context, to match reply w/ request
408
409     @param key_file - Key file absolute path
410 */
411 autoreply define ikev2_set_local_key
412 {
413   u32 client_index;
414   u32 context;
415
416   u8 key_file[256];
417 };
418
419 /** \brief IKEv2: Set IKEv2 responder interface and IP address
420     @param client_index - opaque cookie to identify the sender
421     @param context - sender context, to match reply w/ request
422
423     @param name - IKEv2 profile name
424     @param sw_if_index - interface index
425     @param address - interface address
426 */
427 autoreply define ikev2_set_responder
428 {
429   u32 client_index;
430   u32 context;
431
432   u8 name[64];
433   u32 sw_if_index;
434   u8 address[4];
435 };
436
437 /** \brief IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296)
438     @param client_index - opaque cookie to identify the sender
439     @param context - sender context, to match reply w/ request
440
441     @param name - IKEv2 profile name
442     @param crypto_alg - encryption algorithm
443     @param crypto_key_size - encryption key size
444     @param integ_alg - integrity algorithm
445     @param dh_group - Diffie-Hellman group
446     
447 */
448 autoreply define ikev2_set_ike_transforms
449 {
450   u32 client_index;
451   u32 context;
452
453   u8 name[64];
454   u32 crypto_alg;
455   u32 crypto_key_size;
456   u32 integ_alg;
457   u32 dh_group;
458 };
459
460 /** \brief IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296)
461     @param client_index - opaque cookie to identify the sender
462     @param context - sender context, to match reply w/ request
463
464     @param name - IKEv2 profile name
465     @param crypto_alg - encryption algorithm
466     @param crypto_key_size - encryption key size
467     @param integ_alg - integrity algorithm
468     @param dh_group - Diffie-Hellman group
469     
470 */
471 autoreply define ikev2_set_esp_transforms
472 {
473   u32 client_index;
474   u32 context;
475
476   u8 name[64];
477   u32 crypto_alg;
478   u32 crypto_key_size;
479   u32 integ_alg;
480   u32 dh_group;
481 };
482
483 /** \brief IKEv2: Set Child SA lifetime, limited by time and/or data
484     @param client_index - opaque cookie to identify the sender
485     @param context - sender context, to match reply w/ request
486
487     @param name - IKEv2 profile name
488     @param lifetime - SA maximum life time in seconds (0 to disable)
489     @param lifetime_jitter - Jitter added to prevent simultaneous rekeying
490     @param handover - Hand over time
491     @param lifetime_maxdata - SA maximum life time in bytes (0 to disable)
492     
493 */
494 autoreply define ikev2_set_sa_lifetime
495 {
496   u32 client_index;
497   u32 context;
498
499   u8 name[64];
500   u64 lifetime;
501   u32 lifetime_jitter;
502   u32 handover;
503   u64 lifetime_maxdata;
504 };
505
506 /** \brief IKEv2: Initiate the SA_INIT exchange
507     @param client_index - opaque cookie to identify the sender
508     @param context - sender context, to match reply w/ request
509
510     @param name - IKEv2 profile name
511     
512 */
513 autoreply define ikev2_initiate_sa_init
514 {
515   u32 client_index;
516   u32 context;
517
518   u8 name[64];
519 };
520
521 /** \brief IKEv2: Initiate the delete IKE SA exchange
522     @param client_index - opaque cookie to identify the sender
523     @param context - sender context, to match reply w/ request
524
525     @param ispi - IKE SA initiator SPI
526     
527 */
528 autoreply define ikev2_initiate_del_ike_sa
529 {
530   u32 client_index;
531   u32 context;
532
533   u64 ispi;
534 };
535
536 /** \brief IKEv2: Initiate the delete Child SA exchange
537     @param client_index - opaque cookie to identify the sender
538     @param context - sender context, to match reply w/ request
539
540     @param ispi - Child SA initiator SPI
541     
542 */
543 autoreply define ikev2_initiate_del_child_sa
544 {
545   u32 client_index;
546   u32 context;
547
548   u32 ispi;
549 };
550
551 /** \brief IKEv2: Initiate the rekey Child SA exchange
552     @param client_index - opaque cookie to identify the sender
553     @param context - sender context, to match reply w/ request
554
555     @param ispi - Child SA initiator SPI
556     
557 */
558 autoreply define ikev2_initiate_rekey_child_sa
559 {
560   u32 client_index;
561   u32 context;
562
563   u32 ispi;
564 };
565
566 /** \brief IPsec: Get SPD interfaces
567     @param client_index - opaque cookie to identify the sender
568     @param context - sender context, to match reply w/ request
569     @param spd_index - SPD index
570     @param spd_index_valid - if 1 spd_index is used to filter
571       spd_index's, if 0 no filtering is done
572 */
573 define ipsec_spd_interface_dump {
574     u32 client_index;
575     u32 context;
576     u32 spd_index;
577     u8 spd_index_valid;
578 };
579
580 /** \brief IPsec: SPD interface response
581     @param context - sender context which was passed in the request
582     @param spd_index - SPD index
583     @param sw_if_index - index of the interface
584 */
585 define ipsec_spd_interface_details {
586     u32 context;
587     u32 spd_index;
588     u32 sw_if_index;
589 };
590
591 /** \brief Add or delete IPsec tunnel interface
592     @param client_index - opaque cookie to identify the sender
593     @param context - sender context, to match reply w/ request
594     @param is_add - add IPsec tunnel interface if nonzero, else delete
595     @param esn - enable extended sequence numbers if nonzero, else disable
596     @param anti_replay - enable anti replay check if nonzero, else disable
597     @param local_ip - local IP address
598     @param remote_ip - IP address of remote IPsec peer
599     @param local_spi - SPI of outbound IPsec SA
600     @param remote_spi - SPI of inbound IPsec SA
601     @param crypto_alg - encryption algorithm ID
602     @param local_crypto_key_len - length of local crypto key in bytes
603     @param local_crypto_key - crypto key for outbound IPsec SA
604     @param remote_crypto_key_len - length of remote crypto key in bytes
605     @param remote_crypto_key - crypto key for inbound IPsec SA
606     @param integ_alg - integrity algorithm ID
607     @param local_integ_key_len - length of local integrity key in bytes
608     @param local_integ_key - integrity key for outbound IPsec SA
609     @param remote_integ_key_len - length of remote integrity key in bytes
610     @param remote_integ_key - integrity key for inbound IPsec SA
611     @param renumber - intf display name uses a specified instance if != 0
612     @param show_instance - instance to display for intf if renumber is set
613     @param udp_encap - enable UDP encapsulation for NAT traversal
614     @param tx_table_id - the FIB id used after packet encap
615 */
616 define ipsec_tunnel_if_add_del {
617   u32 client_index;
618   u32 context;
619   u8 is_add;
620   u8 esn;
621   u8 anti_replay;
622   u8 local_ip[4];
623   u8 remote_ip[4];
624   u32 local_spi;
625   u32 remote_spi;
626   u8 crypto_alg;
627   u8 local_crypto_key_len;
628   u8 local_crypto_key[128];
629   u8 remote_crypto_key_len;
630   u8 remote_crypto_key[128];
631   u8 integ_alg;
632   u8 local_integ_key_len;
633   u8 local_integ_key[128];
634   u8 remote_integ_key_len;
635   u8 remote_integ_key[128];
636   u8 renumber;
637   u32 show_instance;
638   u8 udp_encap;
639   u32 tx_table_id;
640 };
641
642 /** \brief Add/delete IPsec tunnel interface response
643     @param context - sender context, to match reply w/ request
644     @param retval - return status
645     @param sw_if_index - sw_if_index of new interface (for successful add)
646 */
647 define ipsec_tunnel_if_add_del_reply {
648   u32 context;
649   i32 retval;
650   u32 sw_if_index;
651 };
652
653 /** \brief Dump IPsec security association
654     @param client_index - opaque cookie to identify the sender
655     @param context - sender context, to match reply w/ request
656     @param sa_id - optional ID of an SA to dump, if ~0 dump all SAs in SAD
657 */
658 define ipsec_sa_dump {
659   u32 client_index;
660   u32 context;
661   u32 sa_id;
662 };
663
664 /** \brief IPsec security association database response
665     @param context - sender context which was passed in the request
666     @param sa_id - SA ID, policy-based SAs >=0, tunnel interface SAs = 0 
667     @param sw_if_index - sw_if_index of tunnel interface, policy-based SAs = ~0
668     @param spi - security parameter index
669     @param protocol - IPsec protocol (value from ipsec_protocol_t)
670     @param crypto_alg - crypto algorithm (value from ipsec_crypto_alg_t)
671     @param crypto_key_len - length of crypto_key in bytes
672     @param crypto_key - crypto keying material
673     @param integ_alg - integrity algorithm (value from ipsec_integ_alg_t)
674     @param integ_key_len - length of integ_key in bytes
675     @param integ_key - integrity keying material
676     @param use_esn - using extended sequence numbers when non-zero
677     @param use_anti_replay - using anti-replay window when non-zero
678     @param is_tunnel - IPsec tunnel mode when non-zero, else transport mode
679     @param is_tunnel_ipv6 - If using tunnel mode, endpoints are IPv6
680     @param tunnel_src_addr - Tunnel source address if using tunnel mode
681     @param tunnel_dst_addr - Tunnel destination address is using tunnel mode
682     @param salt - 4 byte salt 
683     @param seq - current sequence number for outbound
684     @param seq_hi - high 32 bits of ESN for outbound 
685     @param last_seq - highest sequence number received inbound
686     @param last_seq_hi - high 32 bits of highest ESN received inbound
687     @param replay_window - bit map of seq nums received relative to last_seq if using anti-replay
688     @param total_data_size - total bytes sent or received
689     @param udp_encap - 1 if UDP encap enabled, 0 otherwise
690     @param tx_table_id - the FIB id used for encapsulated packets
691 */
692 define ipsec_sa_details {
693   u32 context;
694   u32 sa_id;
695   u32 sw_if_index;
696
697   u32 spi;
698   u8 protocol;
699
700   u8 crypto_alg;
701   u8 crypto_key_len;
702   u8 crypto_key[128];
703
704   u8 integ_alg;
705   u8 integ_key_len;
706   u8 integ_key[128];
707
708   u8 use_esn;
709   u8 use_anti_replay;
710
711   u8 is_tunnel;
712   u8 is_tunnel_ip6;
713   u8 tunnel_src_addr[16];
714   u8 tunnel_dst_addr[16];
715
716   u32 salt;
717   u64 seq_outbound;
718   u64 last_seq_inbound;
719   u64 replay_window;
720
721   u64 total_data_size;
722   u8 udp_encap;
723
724   u32 tx_table_id;
725 };
726
727 /** \brief Set key on IPsec interface
728     @param client_index - opaque cookie to identify the sender
729     @param context - sender context, to match reply w/ request
730     @param sw_if_index - index of tunnel interface
731     @param key_type - type of key being set
732     @param alg - algorithm used with key
733     @param key_len - length key in bytes
734     @param key - key
735 */
736 autoreply define ipsec_tunnel_if_set_key {
737   u32 client_index;
738   u32 context;
739   u32 sw_if_index;
740   u8 key_type;
741   u8 alg;
742   u8 key_len;
743   u8 key[128];
744 };
745
746 /** \brief Set new SA on IPsec interface
747     @param client_index - opaque cookie to identify the sender
748     @param context - sender context, to match reply w/ request
749     @param sw_if_index - index of tunnel interface
750     @param sa_id - ID of SA to use
751     @param is_outbound - 1 if outbound (local) SA, 0 if inbound (remote)
752 */
753 autoreply define ipsec_tunnel_if_set_sa {
754   u32 client_index;
755   u32 context;
756   u32 sw_if_index;
757   u32 sa_id;
758   u8 is_outbound;
759 };
760
761 /** \brief Dump IPsec backends
762     @param client_index - opaque cookie to identify the sender
763     @param context - sender context, to match reply w/ request
764 */
765 define ipsec_backend_dump {
766   u32 client_index;
767   u32 context;
768 };
769
770 /** \brief IPsec backend details
771     @param name - name of the backend
772     @param protocol - IPsec protocol (value from ipsec_protocol_t)
773     @param index - backend index
774     @param active - set to 1 if the backend is active, otherwise 0
775 */
776 define ipsec_backend_details {
777   u32 context;
778   u8 name[128];
779   vl_api_ipsec_proto_t protocol;
780   u8 index;
781   u8 active;
782 };
783
784 /** \brief Select IPsec backend
785     @param client_index - opaque cookie to identify the sender
786     @param context - sender context, to match reply w/ request
787     @param protocol - IPsec protocol (value from ipsec_protocol_t)
788     @param index - backend index
789 */
790 autoreply define ipsec_select_backend {
791   u32 client_index;
792   u32 context;
793   vl_api_ipsec_proto_t protocol;
794   u8 index;
795 };
796
797 /*
798  * Local Variables:
799  * eval: (c-set-style "gnu")
800  * End:
801  */
802