blob: a8e7cfeaec04e2354cd62b3e8f442db83e7b491e [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/* Hey Emacs use -*- mode: C -*- */
2/*
3 * Copyright (c) 2015 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
Florin Coraseaec2a62018-12-04 16:34:05 -080017option version = "2.1.0";
Dave Barach0d056e52017-09-28 15:11:16 -040018
Ed Warnickecb9cada2015-12-08 15:45:58 -070019/*
Ole Troan94495f22018-08-02 11:58:12 +020020 * Define services not following the normal conventions here
Marek Gradzki51e59682018-03-06 10:05:44 +010021 */
22service {
23 rpc memclnt_rx_thread_suspend returns null;
24 rpc memclnt_read_timeout returns null;
25 rpc rx_thread_exit returns null;
26 rpc trace_plugin_msg_ids returns null;
27};
28
29/*
Ed Warnickecb9cada2015-12-08 15:45:58 -070030 * Create a client registration
31 */
Ed Warnickecb9cada2015-12-08 15:45:58 -070032define memclnt_create {
Ondrej Fabry7108cb12023-04-27 00:00:27 +020033 option deprecated;
34
Ed Warnickecb9cada2015-12-08 15:45:58 -070035 u32 context; /* opaque value to be returned in the reply */
Klement Sekeradab732a2018-07-04 13:43:46 +020036 i32 ctx_quota; /* requested punt context quota */
Ed Warnickecb9cada2015-12-08 15:45:58 -070037 u64 input_queue; /* client's queue */
Ole Troandaa4bff2019-08-28 14:12:02 +020038 string name[64]; /* for show, find by name, whatever */
Ed Warnickecb9cada2015-12-08 15:45:58 -070039 u32 api_versions[8]; /* client-server pairs use as desired */
40};
41
42define memclnt_create_reply {
Ondrej Fabry7108cb12023-04-27 00:00:27 +020043 option deprecated;
44
Klement Sekeradab732a2018-07-04 13:43:46 +020045 u32 context; /* opaque value from the create request */
Ed Warnickecb9cada2015-12-08 15:45:58 -070046 i32 response; /* Non-negative = success */
Dave Barach557d1282016-11-10 14:22:49 -050047 u64 handle; /* handle by which vlib knows this client */
Ed Warnickecb9cada2015-12-08 15:45:58 -070048 u32 index; /* index, used e.g. by API trace replay */
Dave Barach557d1282016-11-10 14:22:49 -050049 u64 message_table; /* serialized message table in shmem */
Ed Warnickecb9cada2015-12-08 15:45:58 -070050};
51
52/*
53 * Delete a client registration
54 */
Ed Warnickecb9cada2015-12-08 15:45:58 -070055define memclnt_delete {
56 u32 index; /* index, used e.g. by API trace replay */
57 u64 handle; /* handle by which vlib knows this client */
Ole Troan8e388392019-12-06 15:06:49 +010058 bool do_cleanup; /* vlib to cleanup the registration */
Ed Warnickecb9cada2015-12-08 15:45:58 -070059};
60
61define memclnt_delete_reply {
62 i32 response; /* Non-negative = success */
63 u64 handle; /* in case the client wonders */
64};
65
Ole Troandfc9b7c2017-03-06 23:51:57 +010066/*
Ed Warnickecb9cada2015-12-08 15:45:58 -070067 * Client RX thread exit
68 */
Ed Warnickecb9cada2015-12-08 15:45:58 -070069define rx_thread_exit {
70 u8 dummy;
71};
72
73/*
Ole Troandfc9b7c2017-03-06 23:51:57 +010074 * Client RX thread suspend
75 */
76define memclnt_rx_thread_suspend {
77 u8 dummy;
78};
79
80/*
81 * Client read timeout
82 */
83define memclnt_read_timeout {
84 u8 dummy;
85};
86
87/*
Ed Warnickecb9cada2015-12-08 15:45:58 -070088 * RPC
89 */
Dave Barach11b8dbf2017-04-24 10:46:54 -040090autoreply define rpc_call {
Ed Warnickecb9cada2015-12-08 15:45:58 -070091 u32 client_index;
92 u32 context;
93 u64 function;
94 u8 multicast;
95 u8 need_barrier_sync;
96 u8 send_reply;
Juraj Sloboda75282452018-06-12 14:20:49 +020097 u32 data_len;
98 u8 data[data_len];
Ed Warnickecb9cada2015-12-08 15:45:58 -070099};
100
Ed Warnickecb9cada2015-12-08 15:45:58 -0700101/*
102 * Lookup message-ID base by name
103 */
104define get_first_msg_id {
105 u32 client_index;
106 u32 context;
Ole Troandaa4bff2019-08-28 14:12:02 +0200107 string name[64];
Ed Warnickecb9cada2015-12-08 15:45:58 -0700108};
109
110define get_first_msg_id_reply {
Ed Warnickecb9cada2015-12-08 15:45:58 -0700111 u32 context;
112 i32 retval;
113 u16 first_msg_id;
114};
Dave Barach987e11d2017-02-27 13:10:27 -0500115
116/*
Dave Barach0d056e52017-09-28 15:11:16 -0400117 * Get API version table (includes built-in and plugins)
118 */
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400119typedef module_version {
Dave Barach0d056e52017-09-28 15:11:16 -0400120 u32 major;
121 u32 minor;
122 u32 patch;
Ole Troandaa4bff2019-08-28 14:12:02 +0200123 string name[64];
Dave Barach0d056e52017-09-28 15:11:16 -0400124};
125define api_versions {
126 u32 client_index;
127 u32 context;
128};
129define api_versions_reply {
Dave Barach0d056e52017-09-28 15:11:16 -0400130 u32 context;
131 i32 retval;
132 u32 count;
133 vl_api_module_version_t api_versions[count];
134};
135
136/*
Dave Barach987e11d2017-02-27 13:10:27 -0500137 * Trace the plugin message-id allocator
138 * so we stand a chance of dealing with different sets of plugins
139 * at api trace replay time
140 */
141
Filip Tehlar36217e32021-07-23 08:51:10 +0000142define trace_plugin_msg_ids
Dave Barach987e11d2017-02-27 13:10:27 -0500143{
144 u32 client_index;
145 u32 context;
Ole Troandaa4bff2019-08-28 14:12:02 +0200146 string plugin_name[128];
Dave Barach987e11d2017-02-27 13:10:27 -0500147 u16 first_msg_id;
148 u16 last_msg_id;
149};
Dave Barach59b25652017-09-10 15:04:27 -0400150
Ole Troan94495f22018-08-02 11:58:12 +0200151typedef message_table_entry
152{
153 u16 index;
Ole Troandaa4bff2019-08-28 14:12:02 +0200154 string name[64];
Ole Troan94495f22018-08-02 11:58:12 +0200155};
156
Dave Barach59b25652017-09-10 15:04:27 -0400157/*
158 * Create a socket client registration.
159 */
160define sockclnt_create {
Dave Barach59b25652017-09-10 15:04:27 -0400161 u32 context; /* opaque value to be returned in the reply */
Ole Troandaa4bff2019-08-28 14:12:02 +0200162 string name[64]; /* for show, find by name, whatever */
Dave Barach59b25652017-09-10 15:04:27 -0400163};
164
165define sockclnt_create_reply {
Ole Troan94495f22018-08-02 11:58:12 +0200166 u32 client_index;
Klement Sekeradab732a2018-07-04 13:43:46 +0200167 u32 context; /* opaque value from the create request */
Dave Barach59b25652017-09-10 15:04:27 -0400168 i32 response; /* Non-negative = success */
Dave Barach59b25652017-09-10 15:04:27 -0400169 u32 index; /* index, used e.g. by API trace replay */
Ole Troan94495f22018-08-02 11:58:12 +0200170 u16 count;
171 vl_api_message_table_entry_t message_table[count];
Dave Barach59b25652017-09-10 15:04:27 -0400172};
173
174/*
175 * Delete a client registration
176 */
177define sockclnt_delete {
Ole Troan94495f22018-08-02 11:58:12 +0200178 u32 client_index;
179 u32 context;
Dave Barach59b25652017-09-10 15:04:27 -0400180 u32 index; /* index, used e.g. by API trace replay */
Dave Barach59b25652017-09-10 15:04:27 -0400181};
182
183define sockclnt_delete_reply {
Ole Troan94495f22018-08-02 11:58:12 +0200184 u32 context;
Dave Barach59b25652017-09-10 15:04:27 -0400185 i32 response; /* Non-negative = success */
Dave Barach59b25652017-09-10 15:04:27 -0400186};
187
188/*
Florin Coras90a63982017-12-19 04:50:01 -0800189 * Initialize shm api over socket api
190 */
Dave Barach78958722018-05-10 16:44:27 -0400191autoreply define sock_init_shm {
Florin Coras90a63982017-12-19 04:50:01 -0800192 u32 client_index;
193 u32 context;
194 u32 requested_size;
195 u8 nitems;
196 u64 configs[nitems];
197};
198
Dave Barach78958722018-05-10 16:44:27 -0400199/* define sock_init_shm_reply {
Florin Coras90a63982017-12-19 04:50:01 -0800200 u32 client_index;
201 u32 context;
202 i32 retval;
Dave Barach78958722018-05-10 16:44:27 -0400203}; */
Florin Coras90a63982017-12-19 04:50:01 -0800204
205/*
Dave Barach59b25652017-09-10 15:04:27 -0400206 * Memory client ping / response
207 * Only sent on inactive connections
208 */
209autoreply define memclnt_keepalive
210{
211 u32 client_index;
212 u32 context;
213};
Filip Tehlarf0e67d72021-07-23 22:03:05 +0000214
215/** \brief Control ping from client to api server request
216 @param client_index - opaque cookie to identify the sender
217 @param context - sender context, to match reply w/ request
218*/
219define control_ping
220{
221 u32 client_index;
222 u32 context;
223};
224
225/** \brief Control ping from the client to the server response
226 @param client_index - opaque cookie to identify the sender
227 @param context - sender context, to match reply w/ request
228 @param retval - return code for the request
229 @param vpe_pid - the pid of the vpe, returned by the server
230*/
231define control_ping_reply
232{
233 u32 context;
234 i32 retval;
235 u32 client_index;
236 u32 vpe_pid;
237};
238
Ole Troan2ca88ff2022-01-27 16:25:43 +0100239define memclnt_create_v2 {
240 u32 context; /* opaque value to be returned in the reply */
241 i32 ctx_quota; /* requested punt context quota */
242 u64 input_queue; /* client's queue */
243 string name[64]; /* for show, find by name, whatever */
244 u32 api_versions[8]; /* client-server pairs use as desired */
245 bool keepalive[default=true]; /* dead client scan keepalives */
246};
247
248define memclnt_create_v2_reply {
249 u32 context; /* opaque value from the create request */
250 i32 response; /* Non-negative = success */
251 u64 handle; /* handle by which vlib knows this client */
252 u32 index; /* index, used e.g. by API trace replay */
253 u64 message_table; /* serialized message table in shmem */
254};