misc: move part of vpe apis to vlibmemory
[vpp.git] / src / vlibmemory / vlib.api
1 /*
2  * Copyright (c) 2021 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 option version = "1.0.0";
17
18 /** \brief Process a vpe parser cli string request
19     @param client_index - opaque cookie to identify the sender
20     @param context - sender context, to match reply w/ request
21     @param cmd_in_shmem - pointer to cli command string
22 */
23 define cli
24 {
25   u32 client_index;
26   u32 context;
27   u64 cmd_in_shmem;
28 };
29 define cli_inband
30 {
31   u32 client_index;
32   u32 context;
33   string cmd[];
34 };
35
36 /** \brief vpe parser cli string response
37     @param context - sender context, to match reply w/ request
38     @param retval - return code for request
39     @param reply_in_shmem - Reply string from cli processing if any
40 */
41 define cli_reply
42 {
43   u32 context;
44   i32 retval;
45   u64 reply_in_shmem;
46 };
47 define cli_inband_reply
48 {
49   u32 context;
50   i32 retval;
51   string reply[];
52 };
53
54 /** \brief Get node index using name request
55     @param client_index - opaque cookie to identify the sender
56     @param context - sender context, to match reply w/ request
57     @param node_name[] - name of the node
58 */
59 define get_node_index
60 {
61   u32 client_index;
62   u32 context;
63   string node_name[64];
64 };
65
66 /** \brief Get node index using name request
67     @param context - sender context, to match reply w/ request
68     @param retval - return code for the request
69     @param node_index - index of the desired node if found, else ~0
70 */
71 define get_node_index_reply
72 {
73   u32 context;
74   i32 retval;
75   u32 node_index;
76 };
77
78 /** \brief Set the next node for a given node request
79     @param client_index - opaque cookie to identify the sender
80     @param context - sender context, to match reply w/ request
81     @param node_name[] - node to add the next node to
82     @param next_name[] - node to add as the next node
83 */
84 define add_node_next
85 {
86   u32 client_index;
87   u32 context;
88   string node_name[64];
89   string next_name[64];
90 };
91
92 /** \brief IP Set the next node for a given node response
93     @param context - sender context, to match reply w/ request
94     @param retval - return code for the add next node request
95     @param next_index - the index of the next node if success, else ~0
96 */
97 define add_node_next_reply
98 {
99   u32 context;
100   i32 retval;
101   u32 next_index;
102 };
103
104 /** \brief show_threads display the information about vpp
105     threads running on system along with their process id,
106     cpu id, physical core and cpu socket.
107 */
108 define show_threads
109 {
110   u32 client_index;
111   u32 context;
112 };
113
114 /** \brief thread data
115     @param id - thread index
116     @param name - thread name i.e. vpp_main or vpp_wk_0
117     @param type - thread type i.e. workers or stats
118     @param pid - thread Process Id
119     @param cpu_id - thread pinned to cpu.
120     "CPUs or Logical cores are the number of physical cores times
121     the number of threads that can run on each core through
122     the use of hyperthreading." (from unix.stackexchange.com)
123     @param core - thread pinned to actual physical core.
124     @param cpu_socket - thread is running on which cpu socket.
125 */
126 typedef thread_data
127 {
128   u32 id;
129   string name[64];
130   string type[64];
131   u32 pid;
132   u32 cpu_id;
133   u32 core;
134   u32 cpu_socket;
135 };
136
137 /** \brief show_threads_reply
138     @param context - returned sender context, to match reply w/ request
139     @param retval - return code
140     @param count - number of threads in thread_data array
141     @param thread_data - array of thread data
142 */
143 define show_threads_reply
144 {
145   u32 context;
146   i32 retval;
147   u32 count;
148   vl_api_thread_data_t thread_data[count];
149 };
150
151 define get_node_graph
152 {
153   u32 client_index;
154   u32 context;
155 };
156
157 /** \brief get_node_graph_reply
158     @param context - returned sender context, to match reply w/ request
159     @param retval - return code
160     @param reply_in_shmem - result from vlib_node_serialize, in shared
161     memory. Process with vlib_node_unserialize, remember to switch
162     heaps and free the result.
163 */
164
165 define get_node_graph_reply
166 {
167   u32 context;
168   i32 retval;
169   u64 reply_in_shmem;
170 };
171
172 /** \brief Query relative index via node names
173     @param client_index - opaque cookie to identify the sender
174     @param context - sender context, to match reply w/ request
175     @param node_name - name of node to find relative index from
176     @param next_name - next node from node_name to find relative index of
177 */
178 define get_next_index
179 {
180   u32 client_index;
181   u32 context;
182   string node_name[64];
183   string next_name[64];
184 };
185
186 /** \brief Reply for get next node index
187     @param context - sender context which was passed in the request
188     @param retval - return value
189     @param next_index - index of the next_node
190 */
191 define get_next_index_reply
192 {
193   u32 context;
194   i32 retval;
195   u32 next_index;
196 };
197
198 /** \brief f64 types are not standardized across the wire. Sense wire format in each direction by sending the f64 value 1.0.
199     @param client_index - opaque cookie to identify the sender
200     @param context - sender context, to match reply w/ request
201     @param f64_one - The constant of 1.0.  If you send a different value, expect an rv=VNET_API_ERROR_API_ENDIAN_FAILED.
202 */
203 define get_f64_endian_value
204 {
205   u32 client_index;
206   u32 context;
207   f64 f64_one [default=1.0];
208 };
209
210 /** \brief get_f64_endian_value reply message
211     @param context - sender context which was passed in the request
212     @param retval - return value - VNET_API_ERROR_API_ENDIAN_FAILED if f64_one != 1.0
213     @param f64_one_result - The value of 'f64 1.0'
214 */
215 define get_f64_endian_value_reply
216 {
217   u32 context;
218   u32 retval;
219   f64 f64_one_result;
220 };
221
222 /** \brief Verify f64 wire format by sending a value and receiving the value + 1.0
223     @param client_index - opaque cookie to identify the sender.
224     @param context - sender context, to match reply w/ request.
225     @param f64_value - The value you want to test.  Default: 1.0.
226 */
227 define get_f64_increment_by_one
228 {
229   u32 client_index;
230   u32 context;
231   f64 f64_value [default=1.0];
232 };
233
234 /** \brief get_f64_increment_by_one reply
235     @param client_index - opaque cookie to identify the sender.
236     @param context - sender context, to match reply w/ request.
237     @param f64_value - The input f64_value incremented by 1.0.
238 */
239 define get_f64_increment_by_one_reply
240 {
241   u32 context;
242   u32 retval;
243   f64 f64_value;
244 };
245
246 /*
247  * Local Variables:
248  * eval: (c-set-style "gnu")
249  * End:
250  */