ikev2: support ipv6 traffic selectors & overlay
[vpp.git] / src / plugins / ikev2 / ikev2_types.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2015-2020 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
18 import "vnet/ip/ip_types.api";
19 import "vnet/interface_types.api";
20
21 typedef ikev2_id
22 {
23   u8 type;
24   u8 data_len;
25   string data[64];
26 };
27
28 typedef ikev2_ts
29 {
30   u32 sa_index;
31   u32 child_sa_index;
32
33   bool is_local;
34   u8 protocol_id;
35   u16 start_port;
36   u16 end_port;
37   vl_api_address_t start_addr;
38   vl_api_address_t end_addr;
39 };
40
41 typedef ikev2_auth
42 {
43   u8 method;
44   u8 hex;                       /* hex encoding of the shared secret */
45   u32 data_len;
46   u8 data[data_len];
47 };
48
49 typedef ikev2_responder
50 {
51   vl_api_interface_index_t sw_if_index;
52   vl_api_address_t addr;
53 };
54
55 typedef ikev2_ike_transforms
56 {
57   u8 crypto_alg;
58   u32 crypto_key_size;
59   u8 integ_alg;
60   u8 dh_group;
61 };
62
63 typedef ikev2_esp_transforms
64 {
65   u8 crypto_alg;
66   u32 crypto_key_size;
67   u8 integ_alg;
68 };
69
70 typedef ikev2_profile
71 {
72   string name[64];
73   vl_api_ikev2_id_t loc_id;
74   vl_api_ikev2_id_t rem_id;
75   vl_api_ikev2_ts_t loc_ts;
76   vl_api_ikev2_ts_t rem_ts;
77   vl_api_ikev2_responder_t responder;
78   vl_api_ikev2_ike_transforms_t ike_ts;
79   vl_api_ikev2_esp_transforms_t esp_ts;
80   u64 lifetime;
81   u64 lifetime_maxdata;
82   u32 lifetime_jitter;
83   u32 handover;
84   u16 ipsec_over_udp_port;
85   u32 tun_itf;
86   bool udp_encap;
87   vl_api_ikev2_auth_t auth;
88 };
89
90 typedef ikev2_sa_transform
91 {
92   u8 transform_type;
93   u16 transform_id;
94   u16 key_len;
95   u16 key_trunc;
96   u16 block_size;
97   u8 dh_group;
98 };
99
100 typedef ikev2_keys
101 {
102   u8 sk_d[64];
103   u8 sk_d_len;
104   u8 sk_ai[64];
105   u8 sk_ai_len;
106   u8 sk_ar[64];
107   u8 sk_ar_len;
108   u8 sk_ei[64];
109   u8 sk_ei_len;
110   u8 sk_er[64];
111   u8 sk_er_len;
112   u8 sk_pi[64];
113   u8 sk_pi_len;
114   u8 sk_pr[64];
115   u8 sk_pr_len;
116 };
117
118 typedef ikev2_child_sa
119 {
120   u32 sa_index;
121   u32 child_sa_index;
122   u32 i_spi;
123   u32 r_spi;
124   vl_api_ikev2_keys_t keys;
125   vl_api_ikev2_sa_transform_t encryption;
126   vl_api_ikev2_sa_transform_t integrity;
127   vl_api_ikev2_sa_transform_t esn;
128 };
129
130 typedef ikev2_sa
131 {
132   u32 sa_index;
133   u32 profile_index;
134
135   u64 ispi;
136   u64 rspi;
137   vl_api_address_t iaddr;
138   vl_api_address_t raddr;
139
140   vl_api_ikev2_keys_t keys;
141
142   /* ID */
143   vl_api_ikev2_id_t i_id;
144   vl_api_ikev2_id_t r_id;
145
146   vl_api_ikev2_sa_transform_t encryption;
147   vl_api_ikev2_sa_transform_t integrity;
148   vl_api_ikev2_sa_transform_t prf;
149   vl_api_ikev2_sa_transform_t dh;
150 };