VPP-1335 vapi crash when memclnt_keepalive received
[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 = "1.0.0";
18
19 /*
20  * Define services not following the normal convetions 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 manual_print 
33 define memclnt_create {
34     u32 context;                /* opaque value to be returned in the reply */
35     i32 ctx_quota;              /* requested punt context quota */
36     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
41 define memclnt_create_reply {
42     u32 context;                /* opaque value from the create request */
43     i32 response;               /* Non-negative = success */
44     u64 handle;                 /* handle by which vlib knows this client */
45     u32 index;                  /* index, used e.g. by API trace replay */
46     u64 message_table;          /* serialized message table in shmem */
47 };
48
49 /*
50  * Delete a client registration 
51  */
52 manual_print
53 define 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
58 define memclnt_delete_reply {
59     i32 response;               /* Non-negative = success */
60     u64 handle;               /* in case the client wonders */
61 };
62
63 /*
64  * Client RX thread exit
65  */
66 define rx_thread_exit {
67     u8 dummy;
68 };
69
70 /*
71  * Client RX thread suspend
72  */
73 define memclnt_rx_thread_suspend {
74     u8 dummy;
75 };
76
77 /*
78  * Client read timeout
79  */
80 define memclnt_read_timeout {
81     u8 dummy;
82 };
83
84 /*
85  * RPC
86  */
87 autoreply define rpc_call {
88     u32 client_index;
89     u32 context;
90     u64 function;
91     u8 multicast;
92     u8 need_barrier_sync;
93     u8 send_reply;
94     u8 data[0];
95 };
96
97 /*
98  * Lookup message-ID base by name
99  */
100 define get_first_msg_id {
101     u32 client_index;
102     u32 context;
103     u8 name[64];
104 };
105
106 define get_first_msg_id_reply {
107     u32 client_index;
108     u32 context;
109     i32 retval;
110     u16 first_msg_id;
111 };
112
113 /*
114  * Get API version table (includes built-in and plugins)
115  */
116 typeonly define module_version {
117   u32 major;
118   u32 minor;
119   u32 patch;
120   u8 name[64];
121 };
122 define api_versions {
123   u32 client_index;
124   u32 context;
125 };
126 define api_versions_reply {
127   u32 client_index;
128   u32 context;
129   i32 retval;
130   u32 count;
131   vl_api_module_version_t api_versions[count];
132 };
133
134 /*
135  * 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
140 manual_print define trace_plugin_msg_ids
141 {
142     u32 client_index;
143     u32 context;
144     u8 plugin_name[128];
145     u16 first_msg_id;
146     u16 last_msg_id;
147 };
148
149 /*
150  * Create a socket client registration. 
151  */
152 define sockclnt_create {
153     u32 context;                /* opaque value to be returned in the reply */
154     u8 name[64];                /* for show, find by name, whatever */
155 };
156
157 define sockclnt_create_reply {
158     u32 context;                /* opaque value from the create request */
159     i32 response;               /* Non-negative = success */
160     u64 handle;                 /* handle by which vlib knows this client */
161     u32 index;                  /* index, used e.g. by API trace replay */
162 };
163
164 /*
165  * Delete a client registration 
166  */
167 define sockclnt_delete {
168     u32 index;                  /* index, used e.g. by API trace replay */
169     u64 handle;                 /* handle by which vlib knows this client */
170 };
171
172 define sockclnt_delete_reply {
173     i32 response;               /* Non-negative = success */
174     u64 handle;                 /* in case the client wonders */
175 };
176
177 /*
178  * Initialize shm api over socket api
179  */
180 autoreply define sock_init_shm {
181     u32 client_index;
182     u32 context;
183     u32 requested_size;
184     u8 nitems;
185     u64 configs[nitems];
186 };
187
188 /* define sock_init_shm_reply {
189     u32 client_index;
190     u32 context;
191     i32 retval;
192 }; */
193
194 /*
195  * Memory client ping / response
196  * Only sent on inactive connections
197  */
198 autoreply define memclnt_keepalive
199 {
200   u32 client_index;
201   u32 context;
202 };