blob: cc37c7c2f8d45f7744d3baa82a799033c1bdf1f4 [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
Juraj Sloboda75282452018-06-12 14:20:49 +020017option version = "2.0.0";
Dave Barach0d056e52017-09-28 15:11:16 -040018
Ed Warnickecb9cada2015-12-08 15:45:58 -070019/*
Marek Gradzki51e59682018-03-06 10:05:44 +010020 * Define services not following the normal convetions here
21 */
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 */
37 u8 name[64]; /* for show, find by name, whatever */
38 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 */
56};
57
58define memclnt_delete_reply {
59 i32 response; /* Non-negative = success */
60 u64 handle; /* in case the client wonders */
61};
62
Ole Troandfc9b7c2017-03-06 23:51:57 +010063/*
Ed Warnickecb9cada2015-12-08 15:45:58 -070064 * Client RX thread exit
65 */
Ed Warnickecb9cada2015-12-08 15:45:58 -070066define rx_thread_exit {
67 u8 dummy;
68};
69
70/*
Ole Troandfc9b7c2017-03-06 23:51:57 +010071 * Client RX thread suspend
72 */
73define memclnt_rx_thread_suspend {
74 u8 dummy;
75};
76
77/*
78 * Client read timeout
79 */
80define memclnt_read_timeout {
81 u8 dummy;
82};
83
84/*
Ed Warnickecb9cada2015-12-08 15:45:58 -070085 * RPC
86 */
Dave Barach11b8dbf2017-04-24 10:46:54 -040087autoreply define rpc_call {
Ed Warnickecb9cada2015-12-08 15:45:58 -070088 u32 client_index;
89 u32 context;
90 u64 function;
91 u8 multicast;
92 u8 need_barrier_sync;
93 u8 send_reply;
Juraj Sloboda75282452018-06-12 14:20:49 +020094 u32 data_len;
95 u8 data[data_len];
Ed Warnickecb9cada2015-12-08 15:45:58 -070096};
97
Ed Warnickecb9cada2015-12-08 15:45:58 -070098/*
99 * Lookup message-ID base by name
100 */
101define get_first_msg_id {
102 u32 client_index;
103 u32 context;
104 u8 name[64];
105};
106
107define get_first_msg_id_reply {
108 u32 client_index;
109 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 */
117typeonly define module_version {
118 u32 major;
119 u32 minor;
120 u32 patch;
121 u8 name[64];
122};
123define api_versions {
124 u32 client_index;
125 u32 context;
126};
127define api_versions_reply {
128 u32 client_index;
129 u32 context;
130 i32 retval;
131 u32 count;
132 vl_api_module_version_t api_versions[count];
133};
134
135/*
Dave Barach987e11d2017-02-27 13:10:27 -0500136 * Trace the plugin message-id allocator
137 * so we stand a chance of dealing with different sets of plugins
138 * at api trace replay time
139 */
140
141manual_print define trace_plugin_msg_ids
142{
143 u32 client_index;
144 u32 context;
145 u8 plugin_name[128];
146 u16 first_msg_id;
147 u16 last_msg_id;
148};
Dave Barach59b25652017-09-10 15:04:27 -0400149
150/*
151 * Create a socket client registration.
152 */
153define sockclnt_create {
Dave Barach59b25652017-09-10 15:04:27 -0400154 u32 context; /* opaque value to be returned in the reply */
Klement Sekeradab732a2018-07-04 13:43:46 +0200155 u8 name[64]; /* for show, find by name, whatever */
Dave Barach59b25652017-09-10 15:04:27 -0400156};
157
158define sockclnt_create_reply {
Klement Sekeradab732a2018-07-04 13:43:46 +0200159 u32 context; /* opaque value from the create request */
Dave Barach59b25652017-09-10 15:04:27 -0400160 i32 response; /* Non-negative = success */
161 u64 handle; /* handle by which vlib knows this client */
162 u32 index; /* index, used e.g. by API trace replay */
Dave Barach59b25652017-09-10 15:04:27 -0400163};
164
165/*
166 * Delete a client registration
167 */
168define sockclnt_delete {
169 u32 index; /* index, used e.g. by API trace replay */
170 u64 handle; /* handle by which vlib knows this client */
171};
172
173define sockclnt_delete_reply {
174 i32 response; /* Non-negative = success */
175 u64 handle; /* in case the client wonders */
176};
177
178/*
Florin Coras90a63982017-12-19 04:50:01 -0800179 * Initialize shm api over socket api
180 */
Dave Barach78958722018-05-10 16:44:27 -0400181autoreply define sock_init_shm {
Florin Coras90a63982017-12-19 04:50:01 -0800182 u32 client_index;
183 u32 context;
184 u32 requested_size;
185 u8 nitems;
186 u64 configs[nitems];
187};
188
Dave Barach78958722018-05-10 16:44:27 -0400189/* define sock_init_shm_reply {
Florin Coras90a63982017-12-19 04:50:01 -0800190 u32 client_index;
191 u32 context;
192 i32 retval;
Dave Barach78958722018-05-10 16:44:27 -0400193}; */
Florin Coras90a63982017-12-19 04:50:01 -0800194
195/*
Dave Barach59b25652017-09-10 15:04:27 -0400196 * Memory client ping / response
197 * Only sent on inactive connections
198 */
199autoreply define memclnt_keepalive
200{
201 u32 client_index;
202 u32 context;
203};