aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/api/vpe.api
blob: 2eb14bc2fd4ad69e9e4be83513beb25fba68af86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
/*
 * Copyright (c) 2015-2016 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/** \file

    This file defines vpe control-plane API messages which are generally
    called through a shared memory interface. 
*/

option version = "1.0.0";

/* 
 * Note: API placement cleanup in progress
 * If you're looking for interface APIs, please
 * see .../src/vnet/{interface.api,interface_api.c}
 * IP APIs: see .../src/vnet/ip/{ip.api, ip_api.c}
 * TAP APIs: see .../src/vnet/unix/{tap.api, tap_api.c}
 * VXLAN APIs: see .../src/vnet/vxlan/{vxlan.api, vxlan_api.c}
 * GENEVE APIs: see .../src/vnet/geneve/{geneve.api, geneve_api.c}
 * LLDP APIs: see .../src/vnet/lldp/{lldp.api, lldp_api.c}
 * AF-PACKET APIs: see ... /vnet/devices/af_packet/{af_packet.api, af_packet_api.c}
 * NETMAP APIs: see ... /src/vnet/devices/netmap/{netmap.api, netmap_api.c}
 * VHOST-USER APIs: see .../vnet/devices/virtio/{vhost_user.api, vhost_user_api.c}
 * VXLAN GPE APIs: see .../src/vnet/vxlan-gpe/{vxlan_gpe.api, vxlan_gpe_api.c}
 * GRE APIs: see .../src/vnet/gre/{gre.api, gre_api.c}
 * L2 APIs: see .../src/vnet/l2/{l2.api, l2_api.c}
 * L2TP APIs: see .../src/vnet/l2tp/{l2tp.api, l2tp_api.c}
 * BFD APIs: see .../src/vnet/bfd/{bfd.api, bfd_api.c}
 * IPSEC APIs: see .../src/vnet/ipsec/{ipsec.api, ipsec_api.c}
 * IPSEC-GRE APIs: see .../src/vnet/ipsec-gre/{ipsec_gre.api, ipsec_gre_api.c}
 * LISP APIs: see .../src/vnet/lisp/{lisp.api, lisp_api.c}
 * LISP-GPE APIs: see .../src/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
 * SESSION APIs: .../vnet/session/{session.api session_api.c}
 * MPLS APIs: see .../src/vnet/mpls/{mpls.api, mpls_api.c}
 * SR APIs: see .../src/vnet/srv6/{sr.api, sr_api.c}
 * CLASSIFY APIs: see ... /src/vnet/classify/{classify.api, classify_api.c}
 * FLOW APIs: see ... /src/vnet/flow/{flow.api, flow_api.c}
 * DHCP APIs: see ... /src/vnet/dhcp/{dhcp.api, dhcp_api.c}
 * COP APIs: see ... /src/vnet/cop/{cop.api, cop_api.c}
 * POLICER APIs: see ... /src/vnet/policer/{policer.api, policer_api.c}
 * STATS APIs: see .../src/vpp/stats/{stats.api, stats.c}
 * BIER APIs: see ... /src/vnet/policer/{bier.api, bier_api.c}
 */

/** \brief Control ping from client to api server request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define control_ping
{
  u32 client_index;
  u32 context;
};

/** \brief Control ping from the client to the server response
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param vpe_pid - the pid of the vpe, returned by the server
*/
define control_ping_reply
{
  u32 context;
  i32 retval;
  u32 client_index;
  u32 vpe_pid;
};

/** \brief Process a vpe parser cli string request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param cmd_in_shmem - pointer to cli command string
*/
define cli
{
  u32 client_index;
  u32 context;
  u64 cmd_in_shmem;
};
define cli_inband
{
  u32 client_index;
  u32 context;
  u32 length;
  u8 cmd[length];
};

/** \brief vpe parser cli string response
    @param context - sender context, to match reply w/ request
    @param retval - return code for request
    @param reply_in_shmem - Reply string from cli processing if any
*/
define cli_reply
{
  u32 context;
  i32 retval;
  u64 reply_in_shmem;
};
define cli_inband_reply
{
  u32 context;
  i32 retval;
  u32 length;
  u8 reply[length];
};

/** \brief Get node index using name request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param node_name[] - name of the node
*/
define get_node_index
{
  u32 client_index;
  u32 context;
  u8 node_name[64];
};

/** \brief Get node index using name request
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param node_index - index of the desired node if found, else ~0
*/
define get_node_index_reply
{
  u32 context;
  i32 retval;
  u32 node_index;
};

/** \brief Set the next node for a given node request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param node_name[] - node to add the next node to
    @param next_name[] - node to add as the next node
*/
define add_node_next
{
  u32 client_index;
  u32 context;
  u8 node_name[64];
  u8 next_name[64];
};

/** \brief IP Set the next node for a given node response
    @param context - sender context, to match reply w/ request
    @param retval - return code for the add next node request
    @param next_index - the index of the next node if success, else ~0
*/
define add_node_next_reply
{
  u32 context;
  i32 retval;
  u32 next_index;
};

/** \brief show version
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define show_version
{
  u32 client_index;
  u32 context;
};

/** \brief show version response
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param program - name of the program (vpe)
    @param version  - version of the program
    @param build_directory - root of the workspace where the program was built
*/
define show_version_reply
{
  u32 context;
  i32 retval;
  u8 program[32];
  u8 version[32];
  u8 build_date[32];
  u8 build_directory[256];
};

define get_node_graph
{
  u32 client_index;
  u32 context;
};

/** \brief get_node_graph_reply
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
    @param reply_in_shmem - result from vlib_node_serialize, in shared
    memory. Process with vlib_node_unserialize, remember to switch
    heaps and free the result.
*/

define get_node_graph_reply
{
  u32 context;
  i32 retval;
  u64 reply_in_shmem;
};

/** \brief Query relative index via node names
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param node_name - name of node to find relative index from
    @param next_name - next node from node_name to find relative index of
*/
define get_next_index
{
  u32 client_index;
  u32 context;
  u8 node_name[64];
  u8 next_name[64];
};

/** \brief Reply for get next node index
    @param context - sender context which was passed in the request
    @param retval - return value
    @param next_index - index of the next_node
*/
define get_next_index_reply
{
  u32 context;
  i32 retval;
  u32 next_index;
};

/*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */