ethernet: check destination mac for L3 in ethernet-input node
[vpp.git] / src / vlibmemory / memclnt.api
1 /* 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
17 option version = "2.1.0";
18
19 /*
20  * Define services not following the normal conventions here
21  */
22 service {
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 /*
30  * Create a client registration
31  */
32 define memclnt_create {
33   option deprecated;
34
35     u32 context;                /* opaque value to be returned in the reply */
36     i32 ctx_quota;              /* requested punt context quota */
37     u64 input_queue;            /* client's queue */
38     string name[64];            /* for show, find by name, whatever */
39     u32 api_versions[8];        /* client-server pairs use as desired */
40 };
41
42 define memclnt_create_reply {
43   option deprecated;
44
45     u32 context;                /* opaque value from the create request */
46     i32 response;               /* Non-negative = success */
47     u64 handle;                 /* handle by which vlib knows this client */
48     u32 index;                  /* index, used e.g. by API trace replay */
49     u64 message_table;          /* serialized message table in shmem */
50 };
51
52 /*
53  * Delete a client registration
54  */
55 define memclnt_delete {
56     u32 index;                  /* index, used e.g. by API trace replay */
57     u64 handle;               /* handle by which vlib knows this client */
58     bool do_cleanup;            /* vlib to cleanup the registration */
59 };
60
61 define memclnt_delete_reply {
62     i32 response;               /* Non-negative = success */
63     u64 handle;               /* in case the client wonders */
64 };
65
66 /*
67  * Client RX thread exit
68  */
69 define rx_thread_exit {
70     u8 dummy;
71 };
72
73 /*
74  * Client RX thread suspend
75  */
76 define memclnt_rx_thread_suspend {
77     u8 dummy;
78 };
79
80 /*
81  * Client read timeout
82  */
83 define memclnt_read_timeout {
84     u8 dummy;
85 };
86
87 /*
88  * RPC
89  */
90 autoreply define rpc_call {
91     u32 client_index;
92     u32 context;
93     u64 function;
94     u8 multicast;
95     u8 need_barrier_sync;
96     u8 send_reply;
97     u32 data_len;
98     u8 data[data_len];
99 };
100
101 /*
102  * Lookup message-ID base by name
103  */
104 define get_first_msg_id {
105     u32 client_index;
106     u32 context;
107     string name[64];
108 };
109
110 define get_first_msg_id_reply {
111     u32 context;
112     i32 retval;
113     u16 first_msg_id;
114 };
115
116 /*
117  * Get API version table (includes built-in and plugins)
118  */
119 typedef module_version {
120   u32 major;
121   u32 minor;
122   u32 patch;
123   string name[64];
124 };
125 define api_versions {
126   u32 client_index;
127   u32 context;
128 };
129 define api_versions_reply {
130   u32 context;
131   i32 retval;
132   u32 count;
133   vl_api_module_version_t api_versions[count];
134 };
135
136 /*
137  * 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
142 define trace_plugin_msg_ids
143 {
144     u32 client_index;
145     u32 context;
146     string plugin_name[128];
147     u16 first_msg_id;
148     u16 last_msg_id;
149 };
150
151 typedef message_table_entry
152 {
153   u16 index;
154   string name[64];
155 };
156
157 /*
158  * Create a socket client registration.
159  */
160 define sockclnt_create {
161     u32 context;                /* opaque value to be returned in the reply */
162     string name[64];                /* for show, find by name, whatever */
163 };
164
165 define sockclnt_create_reply {
166     u32 client_index;
167     u32 context;                /* opaque value from the create request */
168     i32 response;               /* Non-negative = success */
169     u32 index;                  /* index, used e.g. by API trace replay */
170     u16 count;
171     vl_api_message_table_entry_t message_table[count];
172 };
173
174 /*
175  * Delete a client registration
176  */
177 define sockclnt_delete {
178     u32 client_index;
179     u32 context;
180     u32 index;                  /* index, used e.g. by API trace replay */
181 };
182
183 define sockclnt_delete_reply {
184     u32 context;
185     i32 response;               /* Non-negative = success */
186 };
187
188 /*
189  * Initialize shm api over socket api
190  */
191 autoreply define sock_init_shm {
192     u32 client_index;
193     u32 context;
194     u32 requested_size;
195     u8 nitems;
196     u64 configs[nitems];
197 };
198
199 /* define sock_init_shm_reply {
200     u32 client_index;
201     u32 context;
202     i32 retval;
203 }; */
204
205 /*
206  * Memory client ping / response
207  * Only sent on inactive connections
208  */
209 autoreply define memclnt_keepalive
210 {
211   u32 client_index;
212   u32 context;
213 };
214
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 */
219 define 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 */
231 define control_ping_reply
232 {
233   u32 context;
234   i32 retval;
235   u32 client_index;
236   u32 vpe_pid;
237 };
238
239 define 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
248 define 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 };
255
256 define get_api_json {
257     u32 client_index;
258     u32 context;
259 };
260
261 define get_api_json_reply {
262     u32 context;
263     i32 retval;
264     string json[];
265 };