FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
vpe.api
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016 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 /** \file
17 
18  This file defines vpe control-plane API messages which are generally
19  called through a shared memory interface.
20 */
21 
22 option version = "1.6.1";
23 
24 import "vpp/api/vpe_types.api";
25 
26 /*
27  * Note: API placement cleanup in progress
28  * If you're looking for interface APIs, please
29  * see .../src/vnet/{interface.api,interface_api.c}
30  * IP APIs: see .../src/vnet/ip/{ip.api, ip_api.c}
31  * VXLAN APIs: see .../src/vnet/vxlan/{vxlan.api, vxlan_api.c}
32  * GENEVE APIs: see .../src/vnet/geneve/{geneve.api, geneve_api.c}
33  * LLDP APIs: see .../src/vnet/lldp/{lldp.api, lldp_api.c}
34  * AF-PACKET APIs: see ... /vnet/devices/af_packet/{af_packet.api, af_packet_api.c}
35  * VHOST-USER APIs: see .../vnet/devices/virtio/{vhost_user.api, vhost_user_api.c}
36  * VXLAN GPE APIs: see .../src/vnet/vxlan-gpe/{vxlan_gpe.api, vxlan_gpe_api.c}
37  * GRE APIs: see .../src/vnet/gre/{gre.api, gre_api.c}
38  * L2 APIs: see .../src/vnet/l2/{l2.api, l2_api.c}
39  * L2TP APIs: see .../src/vnet/l2tp/{l2tp.api, l2tp_api.c}
40  * BFD APIs: see .../src/vnet/bfd/{bfd.api, bfd_api.c}
41  * IPSEC APIs: see .../src/vnet/ipsec/{ipsec.api, ipsec_api.c}
42  * LISP APIs: see .../src/vnet/lisp/{lisp.api, lisp_api.c}
43  * LISP-GPE APIs: see .../src/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
44  * SESSION APIs: .../vnet/session/{session.api session_api.c}
45  * MPLS APIs: see .../src/vnet/mpls/{mpls.api, mpls_api.c}
46  * SR APIs: see .../src/vnet/srv6/{sr.api, sr_api.c}
47  * CLASSIFY APIs: see ... /src/vnet/classify/{classify.api, classify_api.c}
48  * FLOW APIs: see ... /src/vnet/flow/{flow.api, flow_api.c}
49  * DHCP APIs: see ... /src/vnet/dhcp/{dhcp.api, dhcp_api.c}
50  * COP APIs: see ... /src/vnet/cop/{cop.api, cop_api.c}
51  * POLICER APIs: see ... /src/vnet/policer/{policer.api, policer_api.c}
52  * BIER APIs: see ... /src/vnet/policer/{bier.api, bier_api.c}.
53  * flow APIs: see .../vnet/vnet/flow/{flow.api, flow_api.c}
54  */
55 
56 /** \brief Control ping from client to api server request
57  @param client_index - opaque cookie to identify the sender
58  @param context - sender context, to match reply w/ request
59 */
60 define control_ping
61 {
64 };
65 
66 /** \brief Control ping from the client to the server response
67  @param client_index - opaque cookie to identify the sender
68  @param context - sender context, to match reply w/ request
69  @param retval - return code for the request
70  @param vpe_pid - the pid of the vpe, returned by the server
71 */
72 define control_ping_reply
73 {
78 };
79 
80 /** \brief Process a vpe parser cli string request
81  @param client_index - opaque cookie to identify the sender
82  @param context - sender context, to match reply w/ request
83  @param cmd_in_shmem - pointer to cli command string
84 */
85 define cli
86 {
90 };
91 define cli_inband
92 {
95  string cmd[];
96 };
97 
98 /** \brief vpe parser cli string response
99  @param context - sender context, to match reply w/ request
100  @param retval - return code for request
101  @param reply_in_shmem - Reply string from cli processing if any
102 */
103 define cli_reply
104 {
108 };
109 define cli_inband_reply
110 {
113  string reply[];
114 };
115 
116 /** \brief Get node index using name request
117  @param client_index - opaque cookie to identify the sender
118  @param context - sender context, to match reply w/ request
119  @param node_name[] - name of the node
120 */
121 define get_node_index
122 {
125  string node_name[64];
126 };
127 
128 /** \brief Get node index using name request
129  @param context - sender context, to match reply w/ request
130  @param retval - return code for the request
131  @param node_index - index of the desired node if found, else ~0
132 */
133 define get_node_index_reply
134 {
138 };
139 
140 /** \brief Set the next node for a given node request
141  @param client_index - opaque cookie to identify the sender
142  @param context - sender context, to match reply w/ request
143  @param node_name[] - node to add the next node to
144  @param next_name[] - node to add as the next node
145 */
146 define add_node_next
147 {
150  string node_name[64];
151  string next_name[64];
152 };
153 
154 /** \brief IP Set the next node for a given node response
155  @param context - sender context, to match reply w/ request
156  @param retval - return code for the add next node request
157  @param next_index - the index of the next node if success, else ~0
158 */
159 define add_node_next_reply
160 {
164 };
165 
166 /** \brief show version
167  @param client_index - opaque cookie to identify the sender
168  @param context - sender context, to match reply w/ request
169 */
170 define show_version
171 {
174 };
175 
176 /** \brief show version response
177  @param context - sender context, to match reply w/ request
178  @param retval - return code for the request
179  @param program - name of the program (vpe)
180  @param version - version of the program
181  @param build_directory - root of the workspace where the program was built
182 */
183 define show_version_reply
184 {
187  string program[32];
188  string version[32];
189  string build_date[32];
190  string build_directory[256];
191 };
192 
193 
194 /** \brief show_threads display the information about vpp
195  threads running on system along with their process id,
196  cpu id, physical core and cpu socket.
197 */
198 define show_threads
199 {
202 };
203 
204 /** \brief thread data
205  @param id - thread index
206  @param name - thread name i.e. vpp_main or vpp_wk_0
207  @param type - thread type i.e. workers or stats
208  @param pid - thread Process Id
209  @param cpu_id - thread pinned to cpu.
210  "CPUs or Logical cores are the number of physical cores times
211  the number of threads that can run on each core through
212  the use of hyperthreading." (from unix.stackexchange.com)
213  @param core - thread pinned to actual physical core.
214  @param cpu_socket - thread is running on which cpu socket.
215 */
216 typedef thread_data
217 {
218  u32 id;
219  string name[64];
220  string type[64];
225 };
226 
227 /** \brief show_threads_reply
228  @param context - returned sender context, to match reply w/ request
229  @param retval - return code
230  @param count - number of threads in thread_data array
231  @param thread_data - array of thread data
232 */
233 define show_threads_reply
234 {
238  vl_api_thread_data_t thread_data[count];
239 };
240 
241 define get_node_graph
242 {
245 };
246 
247 /** \brief get_node_graph_reply
248  @param context - returned sender context, to match reply w/ request
249  @param retval - return code
250  @param reply_in_shmem - result from vlib_node_serialize, in shared
251  memory. Process with vlib_node_unserialize, remember to switch
252  heaps and free the result.
253 */
254 
255 define get_node_graph_reply
256 {
260 };
261 
262 /** \brief Query relative index via node names
263  @param client_index - opaque cookie to identify the sender
264  @param context - sender context, to match reply w/ request
265  @param node_name - name of node to find relative index from
266  @param next_name - next node from node_name to find relative index of
267 */
268 define get_next_index
269 {
272  string node_name[64];
273  string next_name[64];
274 };
275 
276 /** \brief Reply for get next node index
277  @param context - sender context which was passed in the request
278  @param retval - return value
279  @param next_index - index of the next_node
280 */
281 define get_next_index_reply
282 {
286 };
287 
288 define log_dump {
291  vl_api_timestamp_t start_timestamp;
292 };
293 
294 define log_details {
296  vl_api_timestamp_t timestamp;
297  vl_api_log_level_t level;
298  string msg_class[32];
299  string message[256];
300 };
301 
302 /** \brief Show the current system timestamp.
303  @param client_index - opaque cookie to identify the sender
304  @param context - sender context, to match reply w/ request
305 */
306 define show_vpe_system_time
307 {
310 };
311 
312 /** \brief Reply for show vpe system time.
313  @param context - sender context which was passed in the request
314  @param retval - return value
315  @param vpe_system_time - the time in seconds since epoch of the host system.
316 */
317 define show_vpe_system_time_reply
318 {
321  vl_api_timestamp_t vpe_system_time;
322 };
323 
324 /** \brief f64 types are not standardized across the wire. Sense wire format in each direction by sending the f64 value 1.0.
325  @param client_index - opaque cookie to identify the sender
326  @param context - sender context, to match reply w/ request
327  @param f64_one - The constant of 1.0. If you send a different value, expect an rv=VNET_API_ERROR_API_ENDIAN_FAILED.
328 */
329 define get_f64_endian_value
330 {
333  f64 f64_one [default=1.0];
334 };
335 
336 /** \brief get_f64_endian_value reply message
337  @param context - sender context which was passed in the request
338  @param retval - return value - VNET_API_ERROR_API_ENDIAN_FAILED if f64_one != 1.0
339  @param f64_one_result - The value of 'f64 1.0'
340 */
341 define get_f64_endian_value_reply
342 {
346 };
347 
348 /** \brief Verify f64 wire format by sending a value and receiving the value + 1.0
349  @param client_index - opaque cookie to identify the sender.
350  @param context - sender context, to match reply w/ request.
351  @param f64_value - The value you want to test. Default: 1.0.
352 */
353 define get_f64_increment_by_one
354 {
357  f64 f64_value [default=1.0];
358 };
359 
360 /** \brief get_f64_increment_by_one reply
361  @param client_index - opaque cookie to identify the sender.
362  @param context - sender context, to match reply w/ request.
363  @param f64_value - The input f64_value incremented by 1.0.
364 */
365 define get_f64_increment_by_one_reply
366 {
370 };
371 
372 /*
373  * Local Variables:
374  * eval: (c-set-style "gnu")
375  * End:
376  */
name
string name[64]
Definition: vpe.api:219
vl_api_show_threads_t
show_threads display the information about vpp threads running on system along with their process id,...
Definition: vpe.api:198
vl_api_add_node_next_reply_t::next_index
u32 next_index
Definition: vpe.api:163
vl_api_show_version_reply_t::context
u32 context
Definition: vpe.api:185
vl_api_get_node_index_t::context
u32 context
Definition: vpe.api:124
vl_api_show_vpe_system_time_reply_t::context
u32 context
Definition: vpe.api:319
vl_api_add_node_next_t::node_name
string node_name[64]
Definition: vpe.api:150
vl_api_get_f64_increment_by_one_t::f64_value
f64 f64_value[default=1.0]
Definition: vpe.api:357
vl_api_get_next_index_t::client_index
u32 client_index
Definition: vpe.api:270
vl_api_cli_t::cmd_in_shmem
u64 cmd_in_shmem
Definition: vpe.api:89
vl_api_get_next_index_reply_t::next_index
u32 next_index
Definition: vpe.api:285
vl_api_control_ping_reply_t::retval
i32 retval
Definition: vpe.api:75
vl_api_cli_inband_t::context
u32 context
Definition: vpe.api:94
vl_api_show_vpe_system_time_reply_t
Reply for show vpe system time.
Definition: vpe.api:317
vl_api_log_dump_t::start_timestamp
vl_api_timestamp_t start_timestamp
Definition: vpe.api:291
vl_api_get_f64_increment_by_one_reply_t::context
u32 context
Definition: vpe.api:367
vl_api_show_vpe_system_time_t
Show the current system timestamp.
Definition: vpe.api:306
vl_api_cli_inband_t::client_index
u32 client_index
Definition: vpe.api:93
vl_api_show_threads_reply_t::count
u32 count
Definition: vpe.api:237
core
u32 core
Definition: vpe.api:223
vl_api_cli_inband_t
Definition: vpe.api:91
vl_api_show_threads_reply_t::retval
i32 retval
Definition: vpe.api:236
vl_api_cli_t::client_index
u32 client_index
Definition: vpe.api:87
vl_api_get_f64_endian_value_t::context
u32 context
Definition: vpe.api:332
vl_api_log_details_t::message
string message[256]
Definition: vpe.api:299
vl_api_log_details_t::level
vl_api_log_level_t level
Definition: vpe.api:297
vl_api_get_f64_endian_value_reply_t::retval
u32 retval
Definition: vpe.api:344
vl_api_get_next_index_t
Query relative index via node names.
Definition: vpe.api:268
vl_api_get_next_index_t::node_name
string node_name[64]
Definition: vpe.api:272
vl_api_get_next_index_reply_t::retval
i32 retval
Definition: vpe.api:284
vl_api_get_node_index_t::client_index
u32 client_index
Definition: vpe.api:123
vl_api_add_node_next_t::next_name
string next_name[64]
Definition: vpe.api:151
vl_api_log_details_t::msg_class
string msg_class[32]
Definition: vpe.api:298
vl_api_get_f64_endian_value_reply_t::context
u32 context
Definition: vpe.api:343
vl_api_get_node_graph_reply_t
get_node_graph_reply
Definition: vpe.api:255
vl_api_control_ping_reply_t::context
u32 context
Definition: vpe.api:74
vl_api_add_node_next_t
Set the next node for a given node request.
Definition: vpe.api:146
i32
signed int i32
Definition: types.h:77
thread_data
typedef thread_data
thread data
Definition: vpe.api:217
vl_api_show_vpe_system_time_t::context
u32 context
Definition: vpe.api:309
vl_api_control_ping_reply_t
Control ping from the client to the server response.
Definition: vpe.api:72
version
option version
Definition: vpe.api:22
count
u8 count
Definition: dhcp.api:208
type
string type[64]
Definition: vpe.api:220
vl_api_get_next_index_t::context
u32 context
Definition: vpe.api:271
vl_api_show_vpe_system_time_t::client_index
u32 client_index
Definition: vpe.api:308
vl_api_get_node_graph_t::client_index
u32 client_index
Definition: vpe.api:243
vl_api_get_node_index_t
Get node index using name request.
Definition: vpe.api:121
vl_api_get_node_index_reply_t::retval
i32 retval
Definition: vpe.api:136
vl_api_get_node_index_t::node_name
string node_name[64]
Definition: vpe.api:125
vl_api_cli_inband_reply_t::retval
i32 retval
Definition: vpe.api:112
vl_api_cli_reply_t::retval
i32 retval
Definition: vpe.api:106
vl_api_show_version_reply_t::program
string program[32]
Definition: vpe.api:187
vl_api_show_version_reply_t::retval
i32 retval
Definition: vpe.api:186
vl_api_get_f64_endian_value_t
f64 types are not standardized across the wire.
Definition: vpe.api:329
vl_api_cli_reply_t
vpe parser cli string response
Definition: vpe.api:103
vl_api_add_node_next_t::context
u32 context
Definition: vpe.api:149
vl_api_control_ping_reply_t::client_index
u32 client_index
Definition: vpe.api:76
vl_api_get_node_graph_reply_t::reply_in_shmem
u64 reply_in_shmem
Definition: vpe.api:259
vl_api_get_next_index_reply_t::context
u32 context
Definition: vpe.api:283
vl_api_get_next_index_reply_t
Reply for get next node index.
Definition: vpe.api:281
f64
double f64
Definition: types.h:142
vl_api_get_f64_increment_by_one_t::client_index
u32 client_index
Definition: vpe.api:355
vl_api_get_f64_endian_value_reply_t
get_f64_endian_value reply message
Definition: vpe.api:341
vl_api_get_f64_increment_by_one_t
Verify f64 wire format by sending a value and receiving the value + 1.0.
Definition: vpe.api:353
vl_api_get_node_index_reply_t::context
u32 context
Definition: vpe.api:135
vl_api_show_vpe_system_time_reply_t::retval
i32 retval
Definition: vpe.api:320
vl_api_cli_inband_reply_t::reply
string reply[]
Definition: vpe.api:113
vl_api_get_f64_endian_value_t::client_index
u32 client_index
Definition: vpe.api:331
vl_api_get_node_graph_reply_t::retval
i32 retval
Definition: vpe.api:258
vl_api_show_version_t::context
u32 context
Definition: vpe.api:173
vl_api_show_threads_reply_t::context
u32 context
Definition: vpe.api:235
vl_api_control_ping_t::context
u32 context
Definition: vpe.api:63
vl_api_get_f64_endian_value_reply_t::f64_one_result
f64 f64_one_result
Definition: vpe.api:345
cpu_id
u32 cpu_id
Definition: vpe.api:222
vl_api_get_f64_endian_value_t::f64_one
f64 f64_one[default=1.0]
Definition: vpe.api:333
vl_api_get_f64_increment_by_one_t::context
u32 context
Definition: vpe.api:356
id
u8 id[64]
Definition: dhcp.api:160
vl_api_log_dump_t::client_index
u32 client_index
Definition: vpe.api:289
vl_api_log_details_t
Definition: vpe.api:294
vl_api_get_f64_increment_by_one_reply_t
get_f64_increment_by_one reply
Definition: vpe.api:365
vl_api_control_ping_t
Control ping from client to api server request.
Definition: vpe.api:60
vl_api_log_details_t::timestamp
vl_api_timestamp_t timestamp
Definition: vpe.api:296
vl_api_show_version_reply_t::build_directory
string build_directory[256]
Definition: vpe.api:190
vl_api_show_version_t
show version
Definition: vpe.api:170
u64
unsigned long u64
Definition: types.h:89
vl_api_show_threads_reply_t::thread_data
vl_api_thread_data_t thread_data[count]
Definition: vpe.api:238
vl_api_cli_t
Process a vpe parser cli string request.
Definition: vpe.api:85
vl_api_cli_t::context
u32 context
Definition: vpe.api:88
vl_api_cli_inband_reply_t
Definition: vpe.api:109
u32
unsigned int u32
Definition: types.h:88
vl_api_show_version_t::client_index
u32 client_index
Definition: vpe.api:172
vl_api_show_threads_t::client_index
u32 client_index
Definition: vpe.api:200
vl_api_show_vpe_system_time_reply_t::vpe_system_time
vl_api_timestamp_t vpe_system_time
Definition: vpe.api:321
cpu_socket
u32 cpu_socket
Definition: vpe.api:224
vl_api_get_node_graph_reply_t::context
u32 context
Definition: vpe.api:257
vl_api_log_details_t::context
u32 context
Definition: vpe.api:295
vl_api_log_dump_t
Definition: vpe.api:288
vl_api_control_ping_t::client_index
u32 client_index
Definition: vpe.api:62
vl_api_show_version_reply_t
show version response
Definition: vpe.api:183
vl_api_get_f64_increment_by_one_reply_t::retval
u32 retval
Definition: vpe.api:368
vl_api_control_ping_reply_t::vpe_pid
u32 vpe_pid
Definition: vpe.api:77
vl_api_add_node_next_reply_t::context
u32 context
Definition: vpe.api:161
vl_api_show_version_reply_t::build_date
string build_date[32]
Definition: vpe.api:189
vl_api_log_dump_t::context
u32 context
Definition: vpe.api:290
vl_api_get_node_graph_t::context
u32 context
Definition: vpe.api:244
pid
u32 pid
Definition: vpe.api:221
vl_api_show_threads_t::context
u32 context
Definition: vpe.api:201
vl_api_add_node_next_reply_t
IP Set the next node for a given node response.
Definition: vpe.api:159
vl_api_cli_inband_reply_t::context
u32 context
Definition: vpe.api:111
vl_api_get_next_index_t::next_name
string next_name[64]
Definition: vpe.api:273
vl_api_get_node_graph_t
Definition: vpe.api:241
vl_api_get_node_index_reply_t
Get node index using name request.
Definition: vpe.api:133
vl_api_add_node_next_reply_t::retval
i32 retval
Definition: vpe.api:162
vl_api_show_threads_reply_t
show_threads_reply
Definition: vpe.api:233
vl_api_cli_inband_t::cmd
string cmd[]
Definition: vpe.api:95
vl_api_show_version_reply_t::version
string version[32]
Definition: vpe.api:188
vl_api_cli_reply_t::reply_in_shmem
u64 reply_in_shmem
Definition: vpe.api:107
vl_api_cli_reply_t::context
u32 context
Definition: vpe.api:105
vl_api_get_node_index_reply_t::node_index
u32 node_index
Definition: vpe.api:137
vl_api_get_f64_increment_by_one_reply_t::f64_value
f64 f64_value
Definition: vpe.api:369
vl_api_add_node_next_t::client_index
u32 client_index
Definition: vpe.api:148