Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 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 | */ |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 15 | |
| 16 | vl_api_version 1.0.0 |
| 17 | |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 18 | /** \brief client->vpp, attach application to session layer |
| 19 | @param client_index - opaque cookie to identify the sender |
| 20 | @param context - sender context, to match reply w/ request |
| 21 | @param initial_segment_size - size of the initial shm segment to be |
| 22 | allocated |
| 23 | @param options - segment size, fifo sizes, etc. |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 24 | @param namespace_id_len - length of the namespace id c-string |
| 25 | @param namespace_id - 0 terminted c-string |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 26 | */ |
| 27 | define application_attach { |
| 28 | u32 client_index; |
| 29 | u32 context; |
| 30 | u32 initial_segment_size; |
| 31 | u64 options[16]; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 32 | u8 namespace_id_len; |
| 33 | u8 namespace_id [64]; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | /** \brief Application attach reply |
| 37 | @param context - sender context, to match reply w/ request |
| 38 | @param retval - return code for the request |
| 39 | @param app_event_queue_address - vpp event queue address or 0 if this |
| 40 | connection shouldn't send events |
| 41 | @param segment_size - size of first shm segment |
| 42 | @param segment_name_length - length of segment name |
| 43 | @param segment_name - name of segment client needs to attach to |
| 44 | */ |
| 45 | define application_attach_reply { |
| 46 | u32 context; |
| 47 | i32 retval; |
| 48 | u64 app_event_queue_address; |
| 49 | u32 segment_size; |
| 50 | u8 segment_name_length; |
| 51 | u8 segment_name[128]; |
| 52 | }; |
| 53 | |
| 54 | /** \brief client->vpp, attach application to session layer |
| 55 | @param client_index - opaque cookie to identify the sender |
| 56 | @param context - sender context, to match reply w/ request |
| 57 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 58 | autoreply define application_detach { |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 59 | u32 client_index; |
| 60 | u32 context; |
| 61 | }; |
| 62 | |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 63 | /** \brief vpp->client, please map an additional shared memory segment |
| 64 | @param client_index - opaque cookie to identify the sender |
| 65 | @param context - sender context, to match reply w/ request |
| 66 | @param segment_name - |
| 67 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 68 | autoreply define map_another_segment { |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 69 | u32 client_index; |
| 70 | u32 context; |
| 71 | u32 segment_size; |
| 72 | u8 segment_name[128]; |
| 73 | }; |
| 74 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 75 | /** \brief Bind to a given URI |
| 76 | @param client_index - opaque cookie to identify the sender |
| 77 | @param context - sender context, to match reply w/ request |
| 78 | @param accept_cookie - sender accept cookie, to identify this bind flavor |
| 79 | @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4] |
| 80 | "tcp://::/0/80" [ipv6] etc. |
| 81 | @param options - socket options, fifo sizes, etc. |
| 82 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 83 | autoreply define bind_uri { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 84 | u32 client_index; |
| 85 | u32 context; |
| 86 | u32 accept_cookie; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 87 | u8 uri[128]; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 88 | }; |
| 89 | |
| 90 | /** \brief Unbind a given URI |
| 91 | @param client_index - opaque cookie to identify the sender |
| 92 | @param context - sender context, to match reply w/ request |
| 93 | @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4] |
| 94 | "tcp://::/0/80" [ipv6], etc. |
| 95 | @param options - socket options, fifo sizes, etc. |
| 96 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 97 | autoreply define unbind_uri { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 98 | u32 client_index; |
| 99 | u32 context; |
| 100 | u8 uri[128]; |
| 101 | }; |
| 102 | |
| 103 | /** \brief Connect to a given URI |
| 104 | @param client_index - opaque cookie to identify the sender |
| 105 | @param context - sender context, to match reply w/ request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 106 | @param client_queue_address - binary API client queue address. Used by |
| 107 | local server when connect was redirected. |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 108 | @param options - socket options, fifo sizes, etc. passed by vpp to the |
| 109 | server when redirecting connects |
| 110 | @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80" |
| 111 | "tcp6://::/0/80" [ipv6], etc. |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 112 | */ |
Dave Wallace | 33e002b | 2017-09-06 01:20:02 -0400 | [diff] [blame] | 113 | autoreply define connect_uri { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 114 | u32 client_index; |
| 115 | u32 context; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 116 | u64 client_queue_address; |
| 117 | u64 options[16]; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 118 | u8 uri[128]; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 119 | }; |
| 120 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 121 | /** \brief vpp->client, accept this session |
| 122 | @param context - sender context, to match reply w/ request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 123 | @param listener_handle - tells client which listener this pertains to |
| 124 | @param handle - unique session identifier |
| 125 | @param session_thread_index - thread index of new session |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 126 | @param rx_fifo_address - rx (vpp -> vpp-client) fifo address |
| 127 | @param tx_fifo_address - tx (vpp-client -> vpp) fifo address |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 128 | @param vpp_event_queue_address - vpp's event queue address |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 129 | @param port - remote port |
| 130 | @param is_ip4 - 1 if the ip is ip4 |
| 131 | @param ip - remote ip |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 132 | */ |
| 133 | define accept_session { |
| 134 | u32 client_index; |
| 135 | u32 context; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 136 | u64 listener_handle; |
| 137 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 138 | u64 server_rx_fifo; |
| 139 | u64 server_tx_fifo; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 140 | u64 vpp_event_queue_address; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 141 | u16 port; |
| 142 | u8 is_ip4; |
| 143 | u8 ip[16]; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 144 | }; |
| 145 | |
| 146 | /** \brief client->vpp, reply to an accept message |
| 147 | @param context - sender context, to match reply w/ request |
| 148 | @param retval - return code for the request |
| 149 | @param session_index - session index from accept_session / connect_reply |
| 150 | @param session_thread_index - thread index from accept_session / |
| 151 | connect_reply |
| 152 | */ |
| 153 | define accept_session_reply { |
| 154 | u32 context; |
| 155 | i32 retval; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 156 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 157 | }; |
| 158 | |
| 159 | /** \brief bidirectional disconnect API |
| 160 | @param client_index - opaque cookie to identify the sender |
| 161 | client to vpp direction only |
| 162 | @param context - sender context, to match reply w/ request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 163 | @param handle - session handle obtained from accept/connect |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 164 | */ |
| 165 | define disconnect_session { |
| 166 | u32 client_index; |
| 167 | u32 context; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 168 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 169 | }; |
| 170 | |
| 171 | /** \brief bidirectional disconnect reply API |
| 172 | @param client_index - opaque cookie to identify the sender |
| 173 | client to vpp direction only |
| 174 | @param context - sender context, to match reply w/ request |
| 175 | @param retval - return code for the request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 176 | @param handle - session handle |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 177 | */ |
| 178 | define disconnect_session_reply { |
| 179 | u32 client_index; |
| 180 | u32 context; |
| 181 | i32 retval; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 182 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 183 | }; |
| 184 | |
| 185 | /** \brief vpp->client reset session API |
| 186 | @param client_index - opaque cookie to identify the sender |
| 187 | client to vpp direction only |
| 188 | @param context - sender context, to match reply w/ request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 189 | @param handle - session handle obtained via accept/connects |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 190 | */ |
| 191 | define reset_session { |
| 192 | u32 client_index; |
| 193 | u32 context; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 194 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 195 | }; |
| 196 | |
| 197 | /** \brief client->vpp reset session reply |
| 198 | @param client_index - opaque cookie to identify the sender |
| 199 | client to vpp direction only |
| 200 | @param context - sender context, to match reply w/ request |
| 201 | @param retval - return code for the request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 202 | @param handle - session handle obtained via accept/connect |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 203 | */ |
| 204 | define reset_session_reply { |
| 205 | u32 client_index; |
| 206 | u32 context; |
| 207 | i32 retval; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 208 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 209 | }; |
| 210 | |
| 211 | /** \brief Bind to an ip:port pair for a given transport protocol |
| 212 | @param client_index - opaque cookie to identify the sender |
| 213 | @param context - sender context, to match reply w/ request |
| 214 | @param vrf - bind namespace |
| 215 | @param is_ip4 - flag that is 1 if ip address family is IPv4 |
| 216 | @param ip - ip address |
| 217 | @param port - port |
| 218 | @param proto - protocol 0 - TCP 1 - UDP |
| 219 | @param options - socket options, fifo sizes, etc. |
| 220 | */ |
| 221 | define bind_sock { |
| 222 | u32 client_index; |
| 223 | u32 context; |
| 224 | u32 vrf; |
| 225 | u8 is_ip4; |
| 226 | u8 ip[16]; |
| 227 | u16 port; |
| 228 | u8 proto; |
| 229 | u64 options[16]; |
| 230 | }; |
| 231 | |
| 232 | /** \brief Unbind |
| 233 | @param client_index - opaque cookie to identify the sender |
| 234 | @param context - sender context, to match reply w/ request |
| 235 | @param handle - bind handle obtained from bind reply |
| 236 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 237 | autoreply define unbind_sock { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 238 | u32 client_index; |
| 239 | u32 context; |
| 240 | u64 handle; |
| 241 | }; |
| 242 | |
| 243 | /** \brief Connect to a remote peer |
| 244 | @param client_index - opaque cookie to identify the sender |
| 245 | @param context - sender context, to match reply w/ request |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 246 | @param client_queue_address - client's API queue address. Non-zero when |
| 247 | used to perform redirects |
| 248 | @param options - socket options, fifo sizes, etc. when doing redirects |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 249 | @param vrf - connection namespace |
| 250 | @param is_ip4 - flag that is 1 if ip address family is IPv4 |
| 251 | @param ip - ip address |
| 252 | @param port - port |
| 253 | @param proto - protocol 0 - TCP 1 - UDP |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 254 | */ |
Dave Wallace | 33e002b | 2017-09-06 01:20:02 -0400 | [diff] [blame] | 255 | autoreply define connect_sock { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 256 | u32 client_index; |
| 257 | u32 context; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 258 | u64 client_queue_address; |
| 259 | u64 options[16]; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 260 | u32 vrf; |
| 261 | u8 is_ip4; |
| 262 | u8 ip[16]; |
| 263 | u16 port; |
| 264 | u8 proto; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 265 | }; |
| 266 | |
| 267 | /** \brief Bind reply |
| 268 | @param context - sender context, to match reply w/ request |
| 269 | @param handle - bind handle |
| 270 | @param retval - return code for the request |
| 271 | @param event_queue_address - vpp event queue address or 0 if this |
| 272 | connection shouldn't send events |
| 273 | @param segment_name_length - length of segment name |
| 274 | @param segment_name - name of segment client needs to attach to |
| 275 | */ |
| 276 | define bind_sock_reply { |
| 277 | u32 context; |
| 278 | u64 handle; |
| 279 | i32 retval; |
| 280 | u64 server_event_queue_address; |
| 281 | u32 segment_size; |
| 282 | u8 segment_name_length; |
| 283 | u8 segment_name[128]; |
| 284 | }; |
| 285 | |
Dave Wallace | 33e002b | 2017-09-06 01:20:02 -0400 | [diff] [blame] | 286 | /* Dummy connect message -- needed to satisfy api generators |
| 287 | * |
| 288 | * NEVER USED, doxygen tags elided on purpose. |
| 289 | */ |
| 290 | define connect_session { |
| 291 | u32 client_index; |
| 292 | u32 context; |
| 293 | }; |
| 294 | |
| 295 | /** \brief vpp/server->client, connect reply -- used for all connect_* messages |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 296 | @param context - sender context, to match reply w/ request |
| 297 | @param retval - return code for the request |
| 298 | @param handle - connection handle |
| 299 | @param server_rx_fifo - rx (vpp -> vpp-client) fifo address |
| 300 | @param server_tx_fifo - tx (vpp-client -> vpp) fifo address |
| 301 | @param vpp_event_queue_address - vpp's event queue address |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 302 | @param segment_size - size of segment to be attached. Only for redirects. |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 303 | @param segment_name_length - non-zero if the client needs to attach to |
| 304 | the fifo segment |
| 305 | @param segment_name - set if the client needs to attach to the segment |
| 306 | */ |
Dave Wallace | 33e002b | 2017-09-06 01:20:02 -0400 | [diff] [blame] | 307 | define connect_session_reply { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 308 | u32 context; |
| 309 | i32 retval; |
| 310 | u64 handle; |
| 311 | u64 server_rx_fifo; |
| 312 | u64 server_tx_fifo; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 313 | u64 vpp_event_queue_address; |
| 314 | u32 segment_size; |
| 315 | u8 segment_name_length; |
| 316 | u8 segment_name[128]; |
| 317 | }; |
| 318 | |
Florin Coras | e04c299 | 2017-03-01 08:17:34 -0800 | [diff] [blame] | 319 | /** \brief enable/disable session layer |
| 320 | @param client_index - opaque cookie to identify the sender |
| 321 | client to vpp direction only |
| 322 | @param context - sender context, to match reply w/ request |
| 323 | @param is_enable - disable session layer if 0, enable otherwise |
| 324 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 325 | autoreply define session_enable_disable { |
Florin Coras | e04c299 | 2017-03-01 08:17:34 -0800 | [diff] [blame] | 326 | u32 client_index; |
| 327 | u32 context; |
| 328 | u8 is_enable; |
| 329 | }; |
| 330 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 331 | /** \brief add/del application namespace |
| 332 | @param client_index - opaque cookie to identify the sender |
| 333 | client to vpp direction only |
| 334 | @param context - sender context, to match reply w/ request |
| 335 | @param secret - secret shared between app and vpp |
| 336 | @param sw_if_index - local interface that "supports" namespace. Set to |
| 337 | ~0 if no preference |
| 338 | @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored |
| 339 | if sw_if_index set. |
| 340 | @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored |
| 341 | if sw_if_index set. |
| 342 | @param namespace_id_len - length of namespace id lower |
| 343 | @param namespace_id - namespace id |
| 344 | */ |
| 345 | autoreply define app_namespace_add_del { |
| 346 | u32 client_index; |
| 347 | u32 context; |
| 348 | u64 secret; |
| 349 | u32 sw_if_index; |
| 350 | u32 ip4_fib_id; |
| 351 | u32 ip6_fib_id; |
| 352 | u8 namespace_id_len; |
| 353 | u8 namespace_id[64]; |
| 354 | }; |
| 355 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 356 | /* |
| 357 | * Local Variables: |
| 358 | * eval: (c-set-style "gnu") |
| 359 | * End: |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 360 | */ |