blob: 08b829cfe20c74b4b456ca4e2b82251bfe000287 [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 */
32manual_print
33define memclnt_create {
Ed Warnickecb9cada2015-12-08 15:45:58 -070034 u32 context; /* opaque value to be returned in the reply */
Klement Sekeradab732a2018-07-04 13:43:46 +020035 i32 ctx_quota; /* requested punt context quota */
Ed Warnickecb9cada2015-12-08 15:45:58 -070036 u64 input_queue; /* client's queue */
Ole Troandaa4bff2019-08-28 14:12:02 +020037 string name[64]; /* for show, find by name, whatever */
Ed Warnickecb9cada2015-12-08 15:45:58 -070038 u32 api_versions[8]; /* client-server pairs use as desired */
39};
40
41define memclnt_create_reply {
Klement Sekeradab732a2018-07-04 13:43:46 +020042 u32 context; /* opaque value from the create request */
Ed Warnickecb9cada2015-12-08 15:45:58 -070043 i32 response; /* Non-negative = success */
Dave Barach557d1282016-11-10 14:22:49 -050044 u64 handle; /* handle by which vlib knows this client */
Ed Warnickecb9cada2015-12-08 15:45:58 -070045 u32 index; /* index, used e.g. by API trace replay */
Dave Barach557d1282016-11-10 14:22:49 -050046 u64 message_table; /* serialized message table in shmem */
Ed Warnickecb9cada2015-12-08 15:45:58 -070047};
48
49/*
50 * Delete a client registration
51 */
52manual_print
53define memclnt_delete {
54 u32 index; /* index, used e.g. by API trace replay */
55 u64 handle; /* handle by which vlib knows this client */
Florin Coraseaec2a62018-12-04 16:34:05 -080056 u8 do_cleanup; /* vlib to cleanup the registration */
Ed Warnickecb9cada2015-12-08 15:45:58 -070057};
58
59define memclnt_delete_reply {
60 i32 response; /* Non-negative = success */
61 u64 handle; /* in case the client wonders */
62};
63
Ole Troandfc9b7c2017-03-06 23:51:57 +010064/*
Ed Warnickecb9cada2015-12-08 15:45:58 -070065 * Client RX thread exit
66 */
Ed Warnickecb9cada2015-12-08 15:45:58 -070067define rx_thread_exit {
68 u8 dummy;
69};
70
71/*
Ole Troandfc9b7c2017-03-06 23:51:57 +010072 * Client RX thread suspend
73 */
74define memclnt_rx_thread_suspend {
75 u8 dummy;
76};
77
78/*
79 * Client read timeout
80 */
81define memclnt_read_timeout {
82 u8 dummy;
83};
84
85/*
Ed Warnickecb9cada2015-12-08 15:45:58 -070086 * RPC
87 */
Dave Barach11b8dbf2017-04-24 10:46:54 -040088autoreply define rpc_call {
Ed Warnickecb9cada2015-12-08 15:45:58 -070089 u32 client_index;
90 u32 context;
91 u64 function;
92 u8 multicast;
93 u8 need_barrier_sync;
94 u8 send_reply;
Juraj Sloboda75282452018-06-12 14:20:49 +020095 u32 data_len;
96 u8 data[data_len];
Ed Warnickecb9cada2015-12-08 15:45:58 -070097};
98
Ed Warnickecb9cada2015-12-08 15:45:58 -070099/*
100 * Lookup message-ID base by name
101 */
102define get_first_msg_id {
103 u32 client_index;
104 u32 context;
Ole Troandaa4bff2019-08-28 14:12:02 +0200105 string name[64];
Ed Warnickecb9cada2015-12-08 15:45:58 -0700106};
107
108define get_first_msg_id_reply {
Ed Warnickecb9cada2015-12-08 15:45:58 -0700109 u32 context;
110 i32 retval;
111 u16 first_msg_id;
112};
Dave Barach987e11d2017-02-27 13:10:27 -0500113
114/*
Dave Barach0d056e52017-09-28 15:11:16 -0400115 * Get API version table (includes built-in and plugins)
116 */
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400117typedef module_version {
Dave Barach0d056e52017-09-28 15:11:16 -0400118 u32 major;
119 u32 minor;
120 u32 patch;
Ole Troandaa4bff2019-08-28 14:12:02 +0200121 string name[64];
Dave Barach0d056e52017-09-28 15:11:16 -0400122};
123define api_versions {
124 u32 client_index;
125 u32 context;
126};
127define api_versions_reply {
Dave Barach0d056e52017-09-28 15:11:16 -0400128 u32 context;
129 i32 retval;
130 u32 count;
131 vl_api_module_version_t api_versions[count];
132};
133
134/*
Dave Barach987e11d2017-02-27 13:10:27 -0500135 * Trace the plugin message-id allocator
136 * so we stand a chance of dealing with different sets of plugins
137 * at api trace replay time
138 */
139
140manual_print define trace_plugin_msg_ids
141{
142 u32 client_index;
143 u32 context;
Ole Troandaa4bff2019-08-28 14:12:02 +0200144 string plugin_name[128];
Dave Barach987e11d2017-02-27 13:10:27 -0500145 u16 first_msg_id;
146 u16 last_msg_id;
147};
Dave Barach59b25652017-09-10 15:04:27 -0400148
Ole Troan94495f22018-08-02 11:58:12 +0200149typedef message_table_entry
150{
151 u16 index;
Ole Troandaa4bff2019-08-28 14:12:02 +0200152 string name[64];
Ole Troan94495f22018-08-02 11:58:12 +0200153};
154
Dave Barach59b25652017-09-10 15:04:27 -0400155/*
156 * Create a socket client registration.
157 */
158define sockclnt_create {
Dave Barach59b25652017-09-10 15:04:27 -0400159 u32 context; /* opaque value to be returned in the reply */
Ole Troandaa4bff2019-08-28 14:12:02 +0200160 string name[64]; /* for show, find by name, whatever */
Dave Barach59b25652017-09-10 15:04:27 -0400161};
162
163define sockclnt_create_reply {
Ole Troan94495f22018-08-02 11:58:12 +0200164 u32 client_index;
Klement Sekeradab732a2018-07-04 13:43:46 +0200165 u32 context; /* opaque value from the create request */
Dave Barach59b25652017-09-10 15:04:27 -0400166 i32 response; /* Non-negative = success */
Dave Barach59b25652017-09-10 15:04:27 -0400167 u32 index; /* index, used e.g. by API trace replay */
Ole Troan94495f22018-08-02 11:58:12 +0200168 u16 count;
169 vl_api_message_table_entry_t message_table[count];
Dave Barach59b25652017-09-10 15:04:27 -0400170};
171
172/*
173 * Delete a client registration
174 */
175define sockclnt_delete {
Ole Troan94495f22018-08-02 11:58:12 +0200176 u32 client_index;
177 u32 context;
Dave Barach59b25652017-09-10 15:04:27 -0400178 u32 index; /* index, used e.g. by API trace replay */
Dave Barach59b25652017-09-10 15:04:27 -0400179};
180
181define sockclnt_delete_reply {
Ole Troan94495f22018-08-02 11:58:12 +0200182 u32 context;
Dave Barach59b25652017-09-10 15:04:27 -0400183 i32 response; /* Non-negative = success */
Dave Barach59b25652017-09-10 15:04:27 -0400184};
185
186/*
Florin Coras90a63982017-12-19 04:50:01 -0800187 * Initialize shm api over socket api
188 */
Dave Barach78958722018-05-10 16:44:27 -0400189autoreply define sock_init_shm {
Florin Coras90a63982017-12-19 04:50:01 -0800190 u32 client_index;
191 u32 context;
192 u32 requested_size;
193 u8 nitems;
194 u64 configs[nitems];
195};
196
Dave Barach78958722018-05-10 16:44:27 -0400197/* define sock_init_shm_reply {
Florin Coras90a63982017-12-19 04:50:01 -0800198 u32 client_index;
199 u32 context;
200 i32 retval;
Dave Barach78958722018-05-10 16:44:27 -0400201}; */
Florin Coras90a63982017-12-19 04:50:01 -0800202
203/*
Dave Barach59b25652017-09-10 15:04:27 -0400204 * Memory client ping / response
205 * Only sent on inactive connections
206 */
207autoreply define memclnt_keepalive
208{
209 u32 client_index;
210 u32 context;
211};