API: Use string type instead of u8.
[vpp.git] / src / vpp / api / vpe.api
1 /*
2  * Copyright (c) 2015-2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 /** \file
17
18     This file defines vpe control-plane API messages which are generally
19     called through a shared memory interface. 
20 */
21
22 option version = "1.1.0";
23
24 /* 
25  * Note: API placement cleanup in progress
26  * If you're looking for interface APIs, please
27  * see .../src/vnet/{interface.api,interface_api.c}
28  * IP APIs: see .../src/vnet/ip/{ip.api, ip_api.c}
29  * TAP APIs: see .../src/vnet/unix/{tap.api, tap_api.c}
30  * VXLAN APIs: see .../src/vnet/vxlan/{vxlan.api, vxlan_api.c}
31  * GENEVE APIs: see .../src/vnet/geneve/{geneve.api, geneve_api.c}
32  * LLDP APIs: see .../src/vnet/lldp/{lldp.api, lldp_api.c}
33  * AF-PACKET APIs: see ... /vnet/devices/af_packet/{af_packet.api, af_packet_api.c}
34  * NETMAP APIs: see ... /src/vnet/devices/netmap/{netmap.api, netmap_api.c}
35  * VHOST-USER APIs: see .../vnet/devices/virtio/{vhost_user.api, vhost_user_api.c}
36  * VXLAN GPE APIs: see .../src/vnet/vxlan-gpe/{vxlan_gpe.api, vxlan_gpe_api.c}
37  * GRE APIs: see .../src/vnet/gre/{gre.api, gre_api.c}
38  * L2 APIs: see .../src/vnet/l2/{l2.api, l2_api.c}
39  * L2TP APIs: see .../src/vnet/l2tp/{l2tp.api, l2tp_api.c}
40  * BFD APIs: see .../src/vnet/bfd/{bfd.api, bfd_api.c}
41  * IPSEC APIs: see .../src/vnet/ipsec/{ipsec.api, ipsec_api.c}
42  * IPSEC-GRE APIs: see .../src/vnet/ipsec-gre/{ipsec_gre.api, ipsec_gre_api.c}
43  * LISP APIs: see .../src/vnet/lisp/{lisp.api, lisp_api.c}
44  * LISP-GPE APIs: see .../src/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
45  * SESSION APIs: .../vnet/session/{session.api session_api.c}
46  * MPLS APIs: see .../src/vnet/mpls/{mpls.api, mpls_api.c}
47  * SR APIs: see .../src/vnet/srv6/{sr.api, sr_api.c}
48  * CLASSIFY APIs: see ... /src/vnet/classify/{classify.api, classify_api.c}
49  * FLOW APIs: see ... /src/vnet/flow/{flow.api, flow_api.c}
50  * DHCP APIs: see ... /src/vnet/dhcp/{dhcp.api, dhcp_api.c}
51  * COP APIs: see ... /src/vnet/cop/{cop.api, cop_api.c}
52  * POLICER APIs: see ... /src/vnet/policer/{policer.api, policer_api.c}
53  * STATS APIs: see .../src/vpp/stats/{stats.api, stats.c}
54  * BIER APIs: see ... /src/vnet/policer/{bier.api, bier_api.c}
55  */
56
57 /** \brief Control ping from client to api server request
58     @param client_index - opaque cookie to identify the sender
59     @param context - sender context, to match reply w/ request
60 */
61 define control_ping
62 {
63   u32 client_index;
64   u32 context;
65 };
66
67 /** \brief Control ping from the client to the server response
68     @param client_index - opaque cookie to identify the sender
69     @param context - sender context, to match reply w/ request
70     @param retval - return code for the request
71     @param vpe_pid - the pid of the vpe, returned by the server
72 */
73 define control_ping_reply
74 {
75   u32 context;
76   i32 retval;
77   u32 client_index;
78   u32 vpe_pid;
79 };
80
81 /** \brief Process a vpe parser cli string request
82     @param client_index - opaque cookie to identify the sender
83     @param context - sender context, to match reply w/ request
84     @param cmd_in_shmem - pointer to cli command string
85 */
86 define cli
87 {
88   u32 client_index;
89   u32 context;
90   u64 cmd_in_shmem;
91 };
92 define cli_inband
93 {
94   u32 client_index;
95   u32 context;
96   string cmd;
97 };
98
99 /** \brief vpe parser cli string response
100     @param context - sender context, to match reply w/ request
101     @param retval - return code for request
102     @param reply_in_shmem - Reply string from cli processing if any
103 */
104 define cli_reply
105 {
106   u32 context;
107   i32 retval;
108   u64 reply_in_shmem;
109 };
110 define cli_inband_reply
111 {
112   u32 context;
113   i32 retval;
114   string reply;
115 };
116
117 /** \brief Get node index using name request
118     @param client_index - opaque cookie to identify the sender
119     @param context - sender context, to match reply w/ request
120     @param node_name[] - name of the node
121 */
122 define get_node_index
123 {
124   u32 client_index;
125   u32 context;
126   u8 node_name[64];
127 };
128
129 /** \brief Get node index using name request
130     @param context - sender context, to match reply w/ request
131     @param retval - return code for the request
132     @param node_index - index of the desired node if found, else ~0
133 */
134 define get_node_index_reply
135 {
136   u32 context;
137   i32 retval;
138   u32 node_index;
139 };
140
141 /** \brief Set the next node for a given node request
142     @param client_index - opaque cookie to identify the sender
143     @param context - sender context, to match reply w/ request
144     @param node_name[] - node to add the next node to
145     @param next_name[] - node to add as the next node
146 */
147 define add_node_next
148 {
149   u32 client_index;
150   u32 context;
151   u8 node_name[64];
152   u8 next_name[64];
153 };
154
155 /** \brief IP Set the next node for a given node response
156     @param context - sender context, to match reply w/ request
157     @param retval - return code for the add next node request
158     @param next_index - the index of the next node if success, else ~0
159 */
160 define add_node_next_reply
161 {
162   u32 context;
163   i32 retval;
164   u32 next_index;
165 };
166
167 /** \brief show version
168     @param client_index - opaque cookie to identify the sender
169     @param context - sender context, to match reply w/ request
170 */
171 define show_version
172 {
173   u32 client_index;
174   u32 context;
175 };
176
177 /** \brief show version response
178     @param context - sender context, to match reply w/ request
179     @param retval - return code for the request
180     @param program - name of the program (vpe)
181     @param version  - version of the program
182     @param build_directory - root of the workspace where the program was built
183 */
184 define show_version_reply
185 {
186   u32 context;
187   i32 retval;
188   string program;
189   string version;
190   string build_date;
191   string build_directory;
192 };
193
194
195 /** \brief show_threads display the information about vpp
196     threads running on system along with their process id,
197     cpu id, physical core and cpu socket.
198 */
199 define show_threads
200 {
201   u32 client_index;
202   u32 context;
203 };
204
205 /** \brief thread data
206     @param id - thread index
207     @param name - thread name i.e. vpp_main or vpp_wk_0
208     @param type - thread type i.e. workers or stats
209     @param pid - thread Process Id
210     @param cpu_id - thread pinned to cpu.
211     "CPUs or Logical cores are the number of physical cores times
212     the number of threads that can run on each core through
213     the use of hyperthreading." (from unix.stackexchange.com)
214     @param core - thread pinned to actual physical core.
215     @param cpu_socket - thread is running on which cpu socket.
216 */
217 typeonly define thread_data
218 {
219   u32 id;
220   u8 name[64];
221   u8 type[64];
222   u32 pid;
223   u32 cpu_id;
224   u32 core;
225   u32 cpu_socket;
226 };
227
228 /** \brief show_threads_reply
229     @param context - returned sender context, to match reply w/ request
230     @param retval - return code
231     @param count - number of threads in thread_data array
232     @param thread_data - array of thread data
233 */
234 define show_threads_reply
235 {
236   u32 context;
237   i32 retval;
238   u32 count;
239   vl_api_thread_data_t thread_data[count];
240 };
241
242 define get_node_graph
243 {
244   u32 client_index;
245   u32 context;
246 };
247
248 /** \brief get_node_graph_reply
249     @param context - returned sender context, to match reply w/ request
250     @param retval - return code
251     @param reply_in_shmem - result from vlib_node_serialize, in shared
252     memory. Process with vlib_node_unserialize, remember to switch
253     heaps and free the result.
254 */
255
256 define get_node_graph_reply
257 {
258   u32 context;
259   i32 retval;
260   u64 reply_in_shmem;
261 };
262
263 /** \brief Query relative index via node names
264     @param client_index - opaque cookie to identify the sender
265     @param context - sender context, to match reply w/ request
266     @param node_name - name of node to find relative index from
267     @param next_name - next node from node_name to find relative index of
268 */
269 define get_next_index
270 {
271   u32 client_index;
272   u32 context;
273   u8 node_name[64];
274   u8 next_name[64];
275 };
276
277 /** \brief Reply for get next node index
278     @param context - sender context which was passed in the request
279     @param retval - return value
280     @param next_index - index of the next_node
281 */
282 define get_next_index_reply
283 {
284   u32 context;
285   i32 retval;
286   u32 next_index;
287 };
288
289 /*
290  * Local Variables:
291  * eval: (c-set-style "gnu")
292  * End:
293  */