ikev2: add option to disable NAT traversal
[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   bool natt_disabled;
88   vl_api_ikev2_auth_t auth;
89 };
90
91 typedef ikev2_sa_transform
92 {
93   u8 transform_type;
94   u16 transform_id;
95   u16 key_len;
96   u16 key_trunc;
97   u16 block_size;
98   u8 dh_group;
99 };
100
101 typedef ikev2_keys
102 {
103   u8 sk_d[64];
104   u8 sk_d_len;
105   u8 sk_ai[64];
106   u8 sk_ai_len;
107   u8 sk_ar[64];
108   u8 sk_ar_len;
109   u8 sk_ei[64];
110   u8 sk_ei_len;
111   u8 sk_er[64];
112   u8 sk_er_len;
113   u8 sk_pi[64];
114   u8 sk_pi_len;
115   u8 sk_pr[64];
116   u8 sk_pr_len;
117 };
118
119 typedef ikev2_child_sa
120 {
121   u32 sa_index;
122   u32 child_sa_index;
123   u32 i_spi;
124   u32 r_spi;
125   vl_api_ikev2_keys_t keys;
126   vl_api_ikev2_sa_transform_t encryption;
127   vl_api_ikev2_sa_transform_t integrity;
128   vl_api_ikev2_sa_transform_t esn;
129 };
130
131 typedef ikev2_sa
132 {
133   u32 sa_index;
134   u32 profile_index;
135
136   u64 ispi;
137   u64 rspi;
138   vl_api_address_t iaddr;
139   vl_api_address_t raddr;
140
141   vl_api_ikev2_keys_t keys;
142
143   /* ID */
144   vl_api_ikev2_id_t i_id;
145   vl_api_ikev2_id_t r_id;
146
147   vl_api_ikev2_sa_transform_t encryption;
148   vl_api_ikev2_sa_transform_t integrity;
149   vl_api_ikev2_sa_transform_t prf;
150   vl_api_ikev2_sa_transform_t dh;
151 };