FD.io VPP
v20.09-64-g4f7b92f0a
Vector Packet Processing
session.api
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015-2020 Cisco and/or its affiliates.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at:
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
16
option
version
=
"3.2.0"
;
17
18
import
"vnet/interface_types.api"
;
19
import
"vnet/ip/ip_types.api"
;
20
21
22
enum
transport_proto
:
u8
23
{
24
TRANSPORT_PROTO_API_TCP
,
25
TRANSPORT_PROTO_API_UDP
,
26
TRANSPORT_PROTO_API_NONE
,
27
TRANSPORT_PROTO_API_TLS
,
28
TRANSPORT_PROTO_API_QUIC
,
29
};
30
31
/** \brief Application attach to session layer
32
@param client_index - opaque cookie to identify the sender
33
@param context - sender context, to match reply w/ request
34
@param options - segment size, fifo sizes, etc.
35
@param namespace_id - string
36
*/
37
define app_attach {
38
u32
client_index
;
39
u32
context
;
40
u64
options
[18];
41
string
namespace_id[];
42
};
43
44
/** \brief Application attach reply
45
@param context - sender context, to match reply w/ request
46
@param retval - return code for the request
47
@param app_mq - app message queue
48
@param vpp_ctrl_mq - vpp message queue for control events that should
49
be handled in main thread, i.e., bind/connect
50
@param vpp_ctrl_mq_thread_index - thread index of the ctrl mq
51
@param app_index - index of the newly created app
52
@param n_fds - number of fds exchanged
53
@param fd_flags - set of flags that indicate which fds are to be expected
54
over the socket (set only if socket transport available)
55
@param segment_size - size of first shm segment
56
@param segment_handle - handle for segment
57
@param segment_name - name of segment client needs to attach to
58
*/
59
define app_attach_reply {
60
u32
context
;
61
i32
retval
;
62
u64
app_mq
;
63
u64
vpp_ctrl_mq
;
64
u8
vpp_ctrl_mq_thread
;
65
u32
app_index
;
66
u8
n_fds
;
67
u8
fd_flags
;
68
u32
segment_size
;
69
u64
segment_handle
;
70
string
segment_name[];
71
};
72
73
/** \brief Application detach from session layer
74
@param client_index - opaque cookie to identify the sender
75
@param context - sender context, to match reply w/ request
76
*/
77
autoreply define application_detach {
78
u32
client_index
;
79
u32
context
;
80
};
81
82
/** \brief Add certificate and key
83
@param client_index - opaque cookie to identify the sender
84
@param context - sender context, to match reply w/ request
85
@param engine - crypto engine
86
@param cert_len - cert length (comes first)
87
@param certkey_len - cert and key length
88
@param certkey - cert & key data (due to API limitation)
89
*/
90
define app_add_cert_key_pair {
91
u32
client_index
;
92
u32
context
;
93
u16
cert_len
;
94
u16
certkey_len
;
95
u8
certkey[certkey_len];
96
};
97
98
/** \brief Add certificate and key
99
@param context - sender context, to match reply w/ request
100
@param retval - return code for the request
101
@param index - index in certificate store
102
*/
103
define app_add_cert_key_pair_reply {
104
u32
context
;
105
i32
retval
;
106
u32
index
;
107
};
108
109
/** \brief Delete certificate and key
110
@param client_index - opaque cookie to identify the sender
111
@param context - sender context, to match reply w/ request
112
@param index - index in certificate store
113
*/
114
autoreply define app_del_cert_key_pair {
115
u32
client_index
;
116
u32
context
;
117
u32
index
;
118
};
119
120
/** \brief Application add TLS certificate
121
### WILL BE DEPRECATED POST 20.01 ###
122
@param client_index - opaque cookie to identify the sender
123
@param context - sender context, to match reply w/ request
124
@param cert_len - certificate length
125
@param cert - certificate as a string
126
*/
127
autoreply define application_tls_cert_add {
128
u32
client_index
;
129
u32
context
;
130
u32
app_index
;
131
u16
cert_len
;
132
u8
cert[cert_len];
133
};
134
135
/** \brief Application add TLS key
136
### WILL BE DEPRECATED POST 20.01 ###
137
@param client_index - opaque cookie to identify the sender
138
@param context - sender context, to match reply w/ request
139
@param key_len - certificate length
140
@param key - PEM encoded key as a string
141
*/
142
autoreply define application_tls_key_add {
143
u32
client_index
;
144
u32
context
;
145
u32
app_index
;
146
u16
key_len
;
147
u8
key
[
key_len
];
148
};
149
150
/** \brief add/del application worker
151
@param client_index - opaque cookie to identify the sender
152
client to vpp direction only
153
@param context - sender context, to match reply w/ request
154
@param app_index - application index
155
@param wrk_index - worker index, if a delete
156
@param is_add - set if an add
157
*/
158
define app_worker_add_del
159
{
160
u32
client_index
;
161
u32
context
;
162
u32
app_index
;
163
u32
wrk_index
;
164
bool
is_add [
default
=
true
];
165
};
166
167
/** \brief Reply for app worker add/del
168
@param context - returned sender context, to match reply w/ request
169
@param retval - return code
170
@param wrk_index - worker index, if add
171
@param app_event_queue_address - vpp event queue address of new worker
172
@param n_fds - number of fds exchanged
173
@param fd_flags - set of flags that indicate which fds are to be expected
174
over the socket (set only if socket transport available)
175
@param segment_handle - handle for segment
176
@param is_add - add if non zero, else delete
177
@param segment_name - name of segment client needs to attach to
178
*/
179
define app_worker_add_del_reply
180
{
181
u32
context
;
182
i32
retval
;
183
u32
wrk_index
;
184
u64
app_event_queue_address
;
185
u8
n_fds
;
186
u8
fd_flags
;
187
u64
segment_handle
;
188
bool
is_add [
default
=
true
];
189
string
segment_name[];
190
};
191
192
/** \brief enable/disable session layer
193
@param client_index - opaque cookie to identify the sender
194
client to vpp direction only
195
@param context - sender context, to match reply w/ request
196
@param is_enable - disable session layer if 0, enable otherwise
197
*/
198
autoreply define session_enable_disable {
199
u32
client_index
;
200
u32
context
;
201
bool
is_enable [
default
=
true
];
202
};
203
204
/** \brief add/del application namespace
205
@param client_index - opaque cookie to identify the sender
206
client to vpp direction only
207
@param context - sender context, to match reply w/ request
208
@param secret - secret shared between app and vpp
209
@param sw_if_index - local interface that "supports" namespace. Set to
210
~0 if no preference
211
@param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
212
if sw_if_index set.
213
@param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
214
if sw_if_index set.
215
@param namespace_id - namespace id
216
*/
217
define app_namespace_add_del {
218
u32
client_index
;
219
u32
context
;
220
u64
secret
;
221
vl_api_interface_index_t
sw_if_index
[
default
=0xffffffff];
222
u32
ip4_fib_id
;
223
u32
ip6_fib_id
;
224
string
namespace_id[];
225
};
226
227
/** \brief Reply for app namespace add/del
228
@param context - returned sender context, to match reply w/ request
229
@param retval - return code
230
@param appns_index - app namespace index
231
*/
232
define app_namespace_add_del_reply
233
{
234
u32
context
;
235
i32
retval
;
236
u32
appns_index
;
237
};
238
239
enum
session_rule_scope
{
240
SESSION_RULE_SCOPE_API_GLOBAL
= 0,
241
SESSION_RULE_SCOPE_API_LOCAL
= 1,
242
SESSION_RULE_SCOPE_API_BOTH
= 2,
243
};
244
245
/** \brief add/del session rule
246
@param client_index - opaque cookie to identify the sender
247
client to vpp direction only
248
@param context - sender context, to match reply w/ request
249
@param transport_proto - transport protocol
250
@param is_ip4 - flag to indicate if ip addresses are ip4 or 6
251
@param lcl_ip - local ip
252
@param lcl_plen - local prefix length
253
@param rmt_ip - remote ip
254
@param rmt_ple - remote prefix length
255
@param lcl_port - local port
256
@param rmt_port - remote port
257
@param action_index - the only action defined now is forward to
258
application with index action_index
259
@param is_add - flag to indicate if add or del
260
@param appns_index - application namespace where rule is to be applied to
261
@param scope - enum that indicates scope of the rule: global or local.
262
If 0, default is global, 1 is global 2 is local, 3 is both
263
@param tag - tag
264
*/
265
autoreply define session_rule_add_del {
266
u32
client_index
;
267
u32
context
;
268
vl_api_transport_proto_t
transport_proto
;
269
vl_api_prefix_t
lcl
;
270
vl_api_prefix_t
rmt
;
271
u16
lcl_port
;
272
u16
rmt_port
;
273
u32
action_index
;
274
bool
is_add [
default
=
true
];
275
u32
appns_index
;
276
vl_api_session_rule_scope_t
scope
;
277
string
tag[64];
278
};
279
280
/** \brief Dump session rules
281
@param client_index - opaque cookie to identify the sender
282
@param context - sender context, to match reply w/ request
283
*/
284
define session_rules_dump
285
{
286
u32
client_index
;
287
u32
context
;
288
};
289
290
/** \brief Session rules details
291
@param context - sender context, to match reply w/ request
292
@param transport_proto - transport protocol
293
@param is_ip4 - flag to indicate if ip addresses are ip4 or 6
294
@param lcl_ip - local ip
295
@param lcl_plen - local prefix length
296
@param rmt_ip - remote ip
297
@param rmt_ple - remote prefix length
298
@param lcl_port - local port
299
@param rmt_port - remote port
300
@param action_index - the only action defined now is forward to
301
application with index action_index
302
@param appns_index - application namespace where rule is to be applied to
303
@param scope - enum that indicates scope of the rule: global or local.
304
If 0, default is global, 1 is global 2 is local, 3 is both
305
@param tag - tag
306
*/
307
define session_rules_details
308
{
309
u32
context
;
310
vl_api_transport_proto_t
transport_proto
;
311
vl_api_prefix_t
lcl
;
312
vl_api_prefix_t
rmt
;
313
u16
lcl_port
;
314
u16
rmt_port
;
315
u32
action_index
;
316
u32
appns_index
;
317
vl_api_session_rule_scope_t
scope
;
318
string
tag[64];
319
};
320
321
/*
322
* Local Variables:
323
* eval: (c-set-style "gnu")
324
* End:
325
*/
vl_api_app_attach_t::client_index
u32 client_index
Definition:
session.api:38
vl_api_session_rule_add_del_t::rmt_port
u16 rmt_port
Definition:
session.api:272
vl_api_app_worker_add_del_t::app_index
u32 app_index
Definition:
session.api:162
TRANSPORT_PROTO_API_QUIC
Definition:
session.api:28
vl_api_app_namespace_add_del_reply_t::context
u32 context
Definition:
session.api:234
vl_api_app_del_cert_key_pair_t::client_index
u32 client_index
Definition:
session.api:115
vl_api_session_rule_add_del_t::appns_index
u32 appns_index
Definition:
session.api:275
transport_proto
transport_proto
Definition:
session.api:22
vl_api_app_add_cert_key_pair_t::certkey_len
u16 certkey_len
Definition:
session.api:94
vl_api_session_rules_details_t::lcl
vl_api_prefix_t lcl
Definition:
session.api:311
vl_api_session_rules_details_t::transport_proto
vl_api_transport_proto_t transport_proto
Definition:
session.api:310
vl_api_app_namespace_add_del_t::ip4_fib_id
u32 ip4_fib_id
Definition:
session.api:222
u64
unsigned long u64
Definition:
types.h:89
vl_api_session_rule_add_del_t::transport_proto
vl_api_transport_proto_t transport_proto
Definition:
session.api:268
vl_api_session_rule_add_del_t::scope
vl_api_session_rule_scope_t scope
Definition:
session.api:276
SESSION_RULE_SCOPE_API_BOTH
Definition:
session.api:242
vl_api_session_rules_details_t::appns_index
u32 appns_index
Definition:
session.api:316
vl_api_application_tls_key_add_t::context
u32 context
Definition:
session.api:144
vl_api_app_namespace_add_del_reply_t::retval
i32 retval
Definition:
session.api:235
vl_api_app_worker_add_del_reply_t::n_fds
u8 n_fds
Definition:
session.api:185
key_len
u16 key_len
Definition:
ikev2_types.api:95
vl_api_session_rules_details_t::action_index
u32 action_index
Definition:
session.api:315
vl_api_app_worker_add_del_t::wrk_index
u32 wrk_index
Definition:
session.api:163
SESSION_RULE_SCOPE_API_LOCAL
Definition:
session.api:241
vl_api_session_rule_add_del_t::client_index
u32 client_index
Definition:
session.api:266
vl_api_app_worker_add_del_reply_t::app_event_queue_address
u64 app_event_queue_address
Definition:
session.api:184
vl_api_app_add_cert_key_pair_t::context
u32 context
Definition:
session.api:92
vl_api_app_attach_reply_t::segment_handle
u64 segment_handle
Definition:
session.api:69
u8
unsigned char u8
Definition:
types.h:56
vl_api_session_rules_dump_t::client_index
u32 client_index
Definition:
session.api:286
vl_api_session_rules_details_t::lcl_port
u16 lcl_port
Definition:
session.api:313
vl_api_app_add_cert_key_pair_reply_t::retval
i32 retval
Definition:
session.api:105
vl_api_app_attach_reply_t::vpp_ctrl_mq_thread
u8 vpp_ctrl_mq_thread
Definition:
session.api:64
vl_api_app_add_cert_key_pair_reply_t::index
u32 index
Definition:
session.api:106
TRANSPORT_PROTO_API_TCP
Definition:
session.api:24
vl_api_app_worker_add_del_reply_t::fd_flags
u8 fd_flags
Definition:
session.api:186
vl_api_app_attach_reply_t::app_mq
u64 app_mq
Definition:
session.api:62
vl_api_app_del_cert_key_pair_t::index
u32 index
Definition:
session.api:117
u32
unsigned int u32
Definition:
types.h:88
TRANSPORT_PROTO_API_NONE
Definition:
session.api:26
vl_api_session_enable_disable_t::context
u32 context
Definition:
session.api:200
vl_api_application_tls_cert_add_t::client_index
u32 client_index
Definition:
session.api:128
vl_api_app_attach_reply_t::segment_size
u32 segment_size
Definition:
session.api:68
version
option version
Definition:
session.api:16
vl_api_session_rules_details_t::context
u32 context
Definition:
session.api:309
vl_api_session_rules_dump_t::context
u32 context
Definition:
session.api:287
vl_api_session_rule_add_del_t::rmt
vl_api_prefix_t rmt
Definition:
session.api:270
vl_api_app_namespace_add_del_t::client_index
u32 client_index
Definition:
session.api:218
vl_api_app_worker_add_del_t::client_index
u32 client_index
Definition:
session.api:160
vl_api_session_rules_details_t::rmt
vl_api_prefix_t rmt
Definition:
session.api:312
u16
unsigned short u16
Definition:
types.h:57
vl_api_session_enable_disable_t::client_index
u32 client_index
Definition:
session.api:199
vl_api_application_detach_t::context
u32 context
Definition:
session.api:79
vl_api_app_add_cert_key_pair_reply_t::context
u32 context
Definition:
session.api:104
vl_api_session_rule_add_del_t::context
u32 context
Definition:
session.api:267
TRANSPORT_PROTO_API_TLS
Definition:
session.api:27
vl_api_application_tls_key_add_t::client_index
u32 client_index
Definition:
session.api:143
vl_api_app_attach_reply_t::fd_flags
u8 fd_flags
Definition:
session.api:67
SESSION_RULE_SCOPE_API_GLOBAL
Definition:
session.api:240
vl_api_app_worker_add_del_reply_t::context
u32 context
Definition:
session.api:181
vl_api_application_detach_t::client_index
u32 client_index
Definition:
session.api:78
vl_api_session_rules_details_t::rmt_port
u16 rmt_port
Definition:
session.api:314
vl_api_app_add_cert_key_pair_t::client_index
u32 client_index
Definition:
session.api:91
i32
signed int i32
Definition:
types.h:77
vl_api_app_attach_reply_t::n_fds
u8 n_fds
Definition:
session.api:66
vl_api_app_attach_t::context
u32 context
Definition:
session.api:39
vl_api_application_tls_cert_add_t::app_index
u32 app_index
Definition:
session.api:130
vl_api_app_attach_reply_t::app_index
u32 app_index
Definition:
session.api:65
vl_api_session_rules_details_t::scope
vl_api_session_rule_scope_t scope
Definition:
session.api:317
vl_api_app_del_cert_key_pair_t::context
u32 context
Definition:
session.api:116
key
typedef key
Definition:
ipsec_types.api:85
session_rule_scope
session_rule_scope
Definition:
session.api:239
vl_api_app_namespace_add_del_reply_t::appns_index
u32 appns_index
Definition:
session.api:236
vl_api_app_worker_add_del_t::context
u32 context
Definition:
session.api:161
vl_api_application_tls_key_add_t::app_index
u32 app_index
Definition:
session.api:145
vl_api_application_tls_cert_add_t::cert_len
u16 cert_len
Definition:
session.api:131
vl_api_app_namespace_add_del_t::secret
u64 secret
Definition:
session.api:220
vl_api_app_attach_reply_t::context
u32 context
Definition:
session.api:60
vl_api_app_attach_reply_t::vpp_ctrl_mq
u64 vpp_ctrl_mq
Definition:
session.api:63
vl_api_session_rule_add_del_t::lcl
vl_api_prefix_t lcl
Definition:
session.api:269
TRANSPORT_PROTO_API_UDP
Definition:
session.api:25
vl_api_application_tls_cert_add_t::context
u32 context
Definition:
session.api:129
vl_api_app_worker_add_del_reply_t::retval
i32 retval
Definition:
session.api:182
options
static struct option options[]
Definition:
main.c:52
vl_api_session_rule_add_del_t::action_index
u32 action_index
Definition:
session.api:273
vl_api_app_add_cert_key_pair_t::cert_len
u16 cert_len
Definition:
session.api:93
vl_api_app_namespace_add_del_t::context
u32 context
Definition:
session.api:219
vl_api_application_tls_key_add_t::key_len
u16 key_len
Definition:
session.api:146
vl_api_app_worker_add_del_reply_t::segment_handle
u64 segment_handle
Definition:
session.api:187
vl_api_app_namespace_add_del_t::ip6_fib_id
u32 ip6_fib_id
Definition:
session.api:223
sw_if_index
vl_api_interface_index_t sw_if_index
Definition:
wireguard.api:33
vl_api_app_worker_add_del_reply_t::wrk_index
u32 wrk_index
Definition:
session.api:183
vl_api_app_attach_reply_t::retval
i32 retval
Definition:
session.api:61
vl_api_session_rule_add_del_t::lcl_port
u16 lcl_port
Definition:
session.api:271
src
vnet
session
session.api
Generated on Thu Jun 3 2021 16:06:32 for FD.io VPP by
1.8.13