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 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 16 | option version = "1.2.0"; |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 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 |
Florin Coras | 9936831 | 2018-08-02 10:45:44 -0700 | [diff] [blame] | 41 | @param n_fds - number of fds exchanged |
| 42 | @param fd_flags - set of flags that indicate which fds are to be expected |
| 43 | over the socket (set only if socket transport available) |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 44 | @param segment_size - size of first shm segment |
| 45 | @param segment_name_length - length of segment name |
| 46 | @param segment_name - name of segment client needs to attach to |
| 47 | */ |
| 48 | define application_attach_reply { |
| 49 | u32 context; |
| 50 | i32 retval; |
| 51 | u64 app_event_queue_address; |
Florin Coras | 9936831 | 2018-08-02 10:45:44 -0700 | [diff] [blame] | 52 | u8 n_fds; |
| 53 | u8 fd_flags; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 54 | u32 segment_size; |
| 55 | u8 segment_name_length; |
| 56 | u8 segment_name[128]; |
| 57 | }; |
| 58 | |
Florin Coras | 371ca50 | 2018-02-21 12:07:41 -0800 | [diff] [blame] | 59 | /** \brief Application add TLS certificate |
| 60 | @param client_index - opaque cookie to identify the sender |
| 61 | @param context - sender context, to match reply w/ request |
| 62 | @param cert_len - certificate length |
| 63 | @param cert - certificate as a string |
| 64 | */ |
| 65 | autoreply define application_tls_cert_add { |
| 66 | u32 client_index; |
| 67 | u32 context; |
| 68 | u32 app_index; |
| 69 | u16 cert_len; |
| 70 | u8 cert[cert_len]; |
| 71 | }; |
| 72 | |
| 73 | /** \brief Application add TLS key |
| 74 | @param client_index - opaque cookie to identify the sender |
| 75 | @param context - sender context, to match reply w/ request |
| 76 | @param key_len - certificate length |
| 77 | @param key - PEM encoded key as a string |
| 78 | */ |
| 79 | autoreply define application_tls_key_add { |
| 80 | u32 client_index; |
| 81 | u32 context; |
| 82 | u32 app_index; |
| 83 | u16 key_len; |
| 84 | u8 key[key_len]; |
| 85 | }; |
| 86 | |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 87 | /** \brief client->vpp, attach application to session layer |
| 88 | @param client_index - opaque cookie to identify the sender |
| 89 | @param context - sender context, to match reply w/ request |
| 90 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 91 | autoreply define application_detach { |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 92 | u32 client_index; |
| 93 | u32 context; |
| 94 | }; |
| 95 | |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 96 | /** \brief vpp->client, please map an additional shared memory segment |
| 97 | @param client_index - opaque cookie to identify the sender |
| 98 | @param context - sender context, to match reply w/ request |
Florin Coras | 9936831 | 2018-08-02 10:45:44 -0700 | [diff] [blame] | 99 | @param fd_flags - set of flags that indicate which, if any, fds are |
| 100 | to be expected over the socket. This is set only if |
| 101 | socket transport available |
| 102 | @param segment_size - size of the segment to be mapped |
| 103 | @param segment_name - name of the segment to be mapped |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 104 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 105 | autoreply define map_another_segment { |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 106 | u32 client_index; |
| 107 | u32 context; |
Florin Coras | 9936831 | 2018-08-02 10:45:44 -0700 | [diff] [blame] | 108 | u8 fd_flags; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 109 | u32 segment_size; |
| 110 | u8 segment_name[128]; |
| 111 | }; |
| 112 | |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 113 | /** \brief vpp->client unmap shared memory segment |
| 114 | @param client_index - opaque cookie to identify the sender |
| 115 | @param context - sender context, to match reply w/ request |
| 116 | @param segment_name - |
| 117 | */ |
| 118 | autoreply define unmap_segment { |
| 119 | u32 client_index; |
| 120 | u32 context; |
| 121 | u8 segment_name[128]; |
| 122 | }; |
| 123 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 124 | /** \brief Bind to a given URI |
| 125 | @param client_index - opaque cookie to identify the sender |
| 126 | @param context - sender context, to match reply w/ request |
| 127 | @param accept_cookie - sender accept cookie, to identify this bind flavor |
| 128 | @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4] |
| 129 | "tcp://::/0/80" [ipv6] etc. |
| 130 | @param options - socket options, fifo sizes, etc. |
| 131 | */ |
Florin Coras | 7fb0fe1 | 2018-04-09 09:24:52 -0700 | [diff] [blame] | 132 | define bind_uri { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 133 | u32 client_index; |
| 134 | u32 context; |
| 135 | u32 accept_cookie; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 136 | u8 uri[128]; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 137 | }; |
| 138 | |
Florin Coras | 7fb0fe1 | 2018-04-09 09:24:52 -0700 | [diff] [blame] | 139 | define bind_uri_reply { |
| 140 | u32 context; |
| 141 | u64 handle; |
| 142 | i32 retval; |
| 143 | u64 rx_fifo; |
| 144 | u64 tx_fifo; |
| 145 | u8 lcl_is_ip4; |
| 146 | u8 lcl_ip[16]; |
| 147 | u16 lcl_port; |
| 148 | u64 vpp_evt_q; |
| 149 | }; |
| 150 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 151 | /** \brief Unbind a given URI |
| 152 | @param client_index - opaque cookie to identify the sender |
| 153 | @param context - sender context, to match reply w/ request |
| 154 | @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4] |
| 155 | "tcp://::/0/80" [ipv6], etc. |
| 156 | @param options - socket options, fifo sizes, etc. |
| 157 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 158 | autoreply define unbind_uri { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 159 | u32 client_index; |
| 160 | u32 context; |
| 161 | u8 uri[128]; |
| 162 | }; |
| 163 | |
| 164 | /** \brief Connect to a given URI |
| 165 | @param client_index - opaque cookie to identify the sender |
| 166 | @param context - sender context, to match reply w/ request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 167 | @param client_queue_address - binary API client queue address. Used by |
| 168 | local server when connect was redirected. |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 169 | @param options - socket options, fifo sizes, etc. passed by vpp to the |
| 170 | server when redirecting connects |
| 171 | @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80" |
| 172 | "tcp6://::/0/80" [ipv6], etc. |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 173 | */ |
Dave Wallace | 33e002b | 2017-09-06 01:20:02 -0400 | [diff] [blame] | 174 | autoreply define connect_uri { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 175 | u32 client_index; |
| 176 | u32 context; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 177 | u64 client_queue_address; |
| 178 | u64 options[16]; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 179 | u8 uri[128]; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 180 | }; |
| 181 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 182 | /** \brief vpp->client, accept this session |
| 183 | @param context - sender context, to match reply w/ request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 184 | @param listener_handle - tells client which listener this pertains to |
| 185 | @param handle - unique session identifier |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 186 | @param rx_fifo_address - rx (vpp -> vpp-client) fifo address |
| 187 | @param tx_fifo_address - tx (vpp-client -> vpp) fifo address |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 188 | @param vpp_event_queue_address - vpp's event queue address or client's |
| 189 | event queue for cut through |
| 190 | @param server_event_queue_address - server's event queue address for |
| 191 | cut through sessions |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 192 | @param port - remote port |
| 193 | @param is_ip4 - 1 if the ip is ip4 |
| 194 | @param ip - remote ip |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 195 | */ |
| 196 | define accept_session { |
| 197 | u32 client_index; |
| 198 | u32 context; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 199 | u64 listener_handle; |
| 200 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 201 | u64 server_rx_fifo; |
| 202 | u64 server_tx_fifo; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 203 | u64 vpp_event_queue_address; |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 204 | u64 server_event_queue_address; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 205 | u16 port; |
| 206 | u8 is_ip4; |
| 207 | u8 ip[16]; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 208 | }; |
| 209 | |
| 210 | /** \brief client->vpp, reply to an accept message |
| 211 | @param context - sender context, to match reply w/ request |
| 212 | @param retval - return code for the request |
| 213 | @param session_index - session index from accept_session / connect_reply |
| 214 | @param session_thread_index - thread index from accept_session / |
| 215 | connect_reply |
| 216 | */ |
| 217 | define accept_session_reply { |
| 218 | u32 context; |
| 219 | i32 retval; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 220 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 221 | }; |
| 222 | |
| 223 | /** \brief bidirectional disconnect API |
| 224 | @param client_index - opaque cookie to identify the sender |
| 225 | client to vpp direction only |
| 226 | @param context - sender context, to match reply w/ request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 227 | @param handle - session handle obtained from accept/connect |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 228 | */ |
| 229 | define disconnect_session { |
| 230 | u32 client_index; |
| 231 | u32 context; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 232 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 233 | }; |
| 234 | |
| 235 | /** \brief bidirectional disconnect reply API |
| 236 | @param client_index - opaque cookie to identify the sender |
| 237 | client to vpp direction only |
| 238 | @param context - sender context, to match reply w/ request |
| 239 | @param retval - return code for the request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 240 | @param handle - session handle |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 241 | */ |
| 242 | define disconnect_session_reply { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 243 | u32 context; |
| 244 | i32 retval; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 245 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 246 | }; |
| 247 | |
| 248 | /** \brief vpp->client reset session API |
| 249 | @param client_index - opaque cookie to identify the sender |
| 250 | client to vpp direction only |
| 251 | @param context - sender context, to match reply w/ request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 252 | @param handle - session handle obtained via accept/connects |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 253 | */ |
| 254 | define reset_session { |
| 255 | u32 client_index; |
| 256 | u32 context; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 257 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 258 | }; |
| 259 | |
| 260 | /** \brief client->vpp reset session reply |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 261 | @param context - sender context, to match reply w/ request |
| 262 | @param retval - return code for the request |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 263 | @param handle - session handle obtained via accept/connect |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 264 | */ |
| 265 | define reset_session_reply { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 266 | u32 context; |
| 267 | i32 retval; |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 268 | u64 handle; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 269 | }; |
| 270 | |
| 271 | /** \brief Bind to an ip:port pair for a given transport protocol |
| 272 | @param client_index - opaque cookie to identify the sender |
| 273 | @param context - sender context, to match reply w/ request |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 274 | @param wrk_index - index of worker requesting the bind |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 275 | @param vrf - bind namespace |
| 276 | @param is_ip4 - flag that is 1 if ip address family is IPv4 |
| 277 | @param ip - ip address |
| 278 | @param port - port |
| 279 | @param proto - protocol 0 - TCP 1 - UDP |
| 280 | @param options - socket options, fifo sizes, etc. |
| 281 | */ |
| 282 | define bind_sock { |
| 283 | u32 client_index; |
| 284 | u32 context; |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 285 | u32 wrk_index; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 286 | u32 vrf; |
| 287 | u8 is_ip4; |
| 288 | u8 ip[16]; |
| 289 | u16 port; |
| 290 | u8 proto; |
| 291 | u64 options[16]; |
| 292 | }; |
| 293 | |
| 294 | /** \brief Unbind |
| 295 | @param client_index - opaque cookie to identify the sender |
| 296 | @param context - sender context, to match reply w/ request |
| 297 | @param handle - bind handle obtained from bind reply |
| 298 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 299 | autoreply define unbind_sock { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 300 | u32 client_index; |
| 301 | u32 context; |
| 302 | u64 handle; |
| 303 | }; |
| 304 | |
| 305 | /** \brief Connect to a remote peer |
| 306 | @param client_index - opaque cookie to identify the sender |
| 307 | @param context - sender context, to match reply w/ request |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 308 | @param wrk_index - worker that requests the connect |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 309 | @param client_queue_address - client's API queue address. Non-zero when |
| 310 | used to perform redirects |
| 311 | @param options - socket options, fifo sizes, etc. when doing redirects |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 312 | @param vrf - connection namespace |
| 313 | @param is_ip4 - flag that is 1 if ip address family is IPv4 |
| 314 | @param ip - ip address |
| 315 | @param port - port |
| 316 | @param proto - protocol 0 - TCP 1 - UDP |
Florin Coras | 8f89dd0 | 2018-03-05 16:53:07 -0800 | [diff] [blame] | 317 | @param hostname-len - length of hostname |
| 318 | @param hostname - destination's hostname. If present, used by protocols |
| 319 | like tls. |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 320 | */ |
Dave Wallace | 33e002b | 2017-09-06 01:20:02 -0400 | [diff] [blame] | 321 | autoreply define connect_sock { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 322 | u32 client_index; |
| 323 | u32 context; |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 324 | u32 wrk_index; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 325 | u64 client_queue_address; |
| 326 | u64 options[16]; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 327 | u32 vrf; |
| 328 | u8 is_ip4; |
| 329 | u8 ip[16]; |
| 330 | u16 port; |
| 331 | u8 proto; |
Florin Coras | 8f89dd0 | 2018-03-05 16:53:07 -0800 | [diff] [blame] | 332 | u8 hostname_len; |
| 333 | u8 hostname[hostname_len]; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 334 | }; |
| 335 | |
| 336 | /** \brief Bind reply |
| 337 | @param context - sender context, to match reply w/ request |
| 338 | @param handle - bind handle |
| 339 | @param retval - return code for the request |
Florin Coras | 7fb0fe1 | 2018-04-09 09:24:52 -0700 | [diff] [blame] | 340 | @param lcl_is_ip4 - local ip address type |
| 341 | @param lcl_ip6 - local ip address |
| 342 | @param lcl_port - local port |
| 343 | @param rx_fifo - rx fifo address if allocated (connectionless) |
| 344 | @param tx_fifo - tx fifo address if allocated (connectionless) |
| 345 | @param vpp_evt_q - vpp event queue address (connectionless) |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 346 | @param segment_name_length - length of segment name |
| 347 | @param segment_name - name of segment client needs to attach to |
| 348 | */ |
| 349 | define bind_sock_reply { |
| 350 | u32 context; |
| 351 | u64 handle; |
| 352 | i32 retval; |
Florin Coras | dcf55ce | 2017-11-16 15:32:50 -0800 | [diff] [blame] | 353 | u8 lcl_is_ip4; |
| 354 | u8 lcl_ip[16]; |
| 355 | u16 lcl_port; |
Florin Coras | 7fb0fe1 | 2018-04-09 09:24:52 -0700 | [diff] [blame] | 356 | u64 rx_fifo; |
| 357 | u64 tx_fifo; |
| 358 | u64 vpp_evt_q; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 359 | u32 segment_size; |
| 360 | u8 segment_name_length; |
| 361 | u8 segment_name[128]; |
| 362 | }; |
| 363 | |
Dave Wallace | 33e002b | 2017-09-06 01:20:02 -0400 | [diff] [blame] | 364 | /* Dummy connect message -- needed to satisfy api generators |
| 365 | * |
| 366 | * NEVER USED, doxygen tags elided on purpose. |
| 367 | */ |
| 368 | define connect_session { |
| 369 | u32 client_index; |
| 370 | u32 context; |
| 371 | }; |
| 372 | |
| 373 | /** \brief vpp/server->client, connect reply -- used for all connect_* messages |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 374 | @param context - sender context, to match reply w/ request |
| 375 | @param retval - return code for the request |
| 376 | @param handle - connection handle |
| 377 | @param server_rx_fifo - rx (vpp -> vpp-client) fifo address |
| 378 | @param server_tx_fifo - tx (vpp-client -> vpp) fifo address |
| 379 | @param vpp_event_queue_address - vpp's event queue address |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 380 | @param client_event_queue_address - client's event queue address |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 381 | @param segment_size - size of segment to be attached. Only for redirects. |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 382 | @param segment_name_length - non-zero if the client needs to attach to |
| 383 | the fifo segment |
| 384 | @param segment_name - set if the client needs to attach to the segment |
Florin Coras | ade70e4 | 2017-10-14 18:56:41 -0700 | [diff] [blame] | 385 | @param lcl_ip - local ip for connection |
| 386 | @param is_ip4 - flag to indicate if ip is v4 or v6 |
| 387 | @param lcl_port - local port |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 388 | */ |
Dave Wallace | 33e002b | 2017-09-06 01:20:02 -0400 | [diff] [blame] | 389 | define connect_session_reply { |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 390 | u32 context; |
| 391 | i32 retval; |
| 392 | u64 handle; |
| 393 | u64 server_rx_fifo; |
| 394 | u64 server_tx_fifo; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 395 | u64 vpp_event_queue_address; |
Florin Coras | f8f516a | 2018-02-08 15:10:09 -0800 | [diff] [blame] | 396 | u64 client_event_queue_address; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 397 | u32 segment_size; |
| 398 | u8 segment_name_length; |
| 399 | u8 segment_name[128]; |
Florin Coras | ade70e4 | 2017-10-14 18:56:41 -0700 | [diff] [blame] | 400 | u8 lcl_ip[16]; |
| 401 | u8 is_ip4; |
| 402 | u16 lcl_port; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 403 | }; |
| 404 | |
Florin Coras | 9936831 | 2018-08-02 10:45:44 -0700 | [diff] [blame] | 405 | /** \brief ask app to add a new cut-through registration |
| 406 | @param client_index - opaque cookie to identify the sender |
| 407 | client to vpp direction only |
| 408 | @param context - sender context, to match reply w/ request |
| 409 | @param evt_q_address - address of the mq in ssvm segment |
| 410 | @param peer_evt_q_address - address of peer's mq in ssvm segment |
Florin Coras | 134a996 | 2018-08-28 11:32:04 -0700 | [diff] [blame] | 411 | @param wrk_index - index of worker to receive the registration |
Florin Coras | 9936831 | 2018-08-02 10:45:44 -0700 | [diff] [blame] | 412 | @param n_fds - number of fds exchanged |
| 413 | @param fd_flags - flag indicating the fds that will be exchanged over |
| 414 | api socket |
| 415 | */ |
| 416 | autoreply define app_cut_through_registration_add |
| 417 | { |
| 418 | u32 client_index; |
| 419 | u32 context; |
| 420 | u64 evt_q_address; |
| 421 | u64 peer_evt_q_address; |
Florin Coras | 134a996 | 2018-08-28 11:32:04 -0700 | [diff] [blame] | 422 | u32 wrk_index; |
Florin Coras | 9936831 | 2018-08-02 10:45:44 -0700 | [diff] [blame] | 423 | u8 n_fds; |
| 424 | u8 fd_flags; |
| 425 | }; |
| 426 | |
Florin Coras | 1553197 | 2018-08-12 23:50:53 -0700 | [diff] [blame] | 427 | /** \brief add/del application worker |
| 428 | @param client_index - opaque cookie to identify the sender |
| 429 | client to vpp direction only |
| 430 | @param context - sender context, to match reply w/ request |
| 431 | @param app_api_index - explicit client api index |
| 432 | @param wrk_index - worker index, if a delete |
| 433 | @param is_add - set if an add |
| 434 | */ |
| 435 | define app_worker_add_del |
| 436 | { |
| 437 | u32 client_index; |
| 438 | u32 context; |
| 439 | u32 app_api_index; |
| 440 | u32 wrk_index; |
| 441 | u8 is_add; |
| 442 | }; |
| 443 | |
| 444 | /** \brief Reply for app worker add/del |
| 445 | @param context - returned sender context, to match reply w/ request |
| 446 | @param retval - return code |
| 447 | @param wrk_index - worker index, if add |
| 448 | @param app_event_queue_address - vpp event queue address of new worker |
| 449 | @param n_fds - number of fds exchanged |
| 450 | @param fd_flags - set of flags that indicate which fds are to be expected |
| 451 | over the socket (set only if socket transport available) |
| 452 | @param segment_name_length - length of segment name |
| 453 | @param segment_name - name of segment client needs to attach to |
| 454 | */ |
| 455 | define app_worker_add_del_reply |
| 456 | { |
| 457 | u32 context; |
| 458 | i32 retval; |
| 459 | u32 wrk_index; |
| 460 | u64 app_event_queue_address; |
| 461 | u8 n_fds; |
| 462 | u8 fd_flags; |
| 463 | u8 segment_name_length; |
| 464 | u8 segment_name[128]; |
| 465 | u8 is_add; |
| 466 | }; |
| 467 | |
Florin Coras | e04c299 | 2017-03-01 08:17:34 -0800 | [diff] [blame] | 468 | /** \brief enable/disable session layer |
| 469 | @param client_index - opaque cookie to identify the sender |
| 470 | client to vpp direction only |
| 471 | @param context - sender context, to match reply w/ request |
| 472 | @param is_enable - disable session layer if 0, enable otherwise |
| 473 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 474 | autoreply define session_enable_disable { |
Florin Coras | e04c299 | 2017-03-01 08:17:34 -0800 | [diff] [blame] | 475 | u32 client_index; |
| 476 | u32 context; |
| 477 | u8 is_enable; |
| 478 | }; |
| 479 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 480 | /** \brief add/del application namespace |
| 481 | @param client_index - opaque cookie to identify the sender |
| 482 | client to vpp direction only |
| 483 | @param context - sender context, to match reply w/ request |
| 484 | @param secret - secret shared between app and vpp |
| 485 | @param sw_if_index - local interface that "supports" namespace. Set to |
| 486 | ~0 if no preference |
| 487 | @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored |
| 488 | if sw_if_index set. |
| 489 | @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored |
| 490 | if sw_if_index set. |
| 491 | @param namespace_id_len - length of namespace id lower |
| 492 | @param namespace_id - namespace id |
| 493 | */ |
Florin Coras | 6e8c667 | 2017-11-10 09:03:54 -0800 | [diff] [blame] | 494 | define app_namespace_add_del { |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 495 | u32 client_index; |
| 496 | u32 context; |
| 497 | u64 secret; |
| 498 | u32 sw_if_index; |
| 499 | u32 ip4_fib_id; |
| 500 | u32 ip6_fib_id; |
| 501 | u8 namespace_id_len; |
| 502 | u8 namespace_id[64]; |
| 503 | }; |
| 504 | |
Florin Coras | 6e8c667 | 2017-11-10 09:03:54 -0800 | [diff] [blame] | 505 | /** \brief Reply for app namespace add/del |
| 506 | @param context - returned sender context, to match reply w/ request |
| 507 | @param retval - return code |
| 508 | @param appns_index - app namespace index |
| 509 | */ |
| 510 | define app_namespace_add_del_reply |
| 511 | { |
| 512 | u32 context; |
| 513 | i32 retval; |
| 514 | u32 appns_index; |
| 515 | }; |
| 516 | |
Florin Coras | 1c71045 | 2017-10-17 00:03:13 -0700 | [diff] [blame] | 517 | /** \brief add/del session rule |
| 518 | @param client_index - opaque cookie to identify the sender |
| 519 | client to vpp direction only |
| 520 | @param context - sender context, to match reply w/ request |
| 521 | @param transport_proto - transport protocol (0 - tcp 1 - udp) |
| 522 | @param is_ip4 - flag to indicate if ip addresses are ip4 or 6 |
| 523 | @param lcl_ip - local ip |
| 524 | @param lcl_plen - local prefix length |
| 525 | @param rmt_ip - remote ip |
| 526 | @param rmt_ple - remote prefix length |
| 527 | @param lcl_port - local port |
| 528 | @param rmt_port - remote port |
| 529 | @param action_index - the only action defined now is forward to |
| 530 | application with index action_index |
| 531 | @param is_add - flag to indicate if add or del |
| 532 | @param appns_index - application namespace where rule is to be applied |
| 533 | to |
| 534 | @param scope - flag that indicates scope of the rule: global or local. |
| 535 | If 0, default is global, 1 is global 2 is local, 3 is |
| 536 | both |
| 537 | */ |
| 538 | autoreply define session_rule_add_del { |
| 539 | u32 client_index; |
| 540 | u32 context; |
| 541 | u8 transport_proto; |
| 542 | u8 is_ip4; |
| 543 | u8 lcl_ip[16]; |
| 544 | u8 lcl_plen; |
| 545 | u8 rmt_ip[16]; |
| 546 | u8 rmt_plen; |
| 547 | u16 lcl_port; |
| 548 | u16 rmt_port; |
| 549 | u32 action_index; |
| 550 | u8 is_add; |
| 551 | u32 appns_index; |
| 552 | u8 scope; |
Florin Coras | c97a739 | 2017-11-05 23:07:07 -0800 | [diff] [blame] | 553 | u8 tag[64]; |
Florin Coras | 1c71045 | 2017-10-17 00:03:13 -0700 | [diff] [blame] | 554 | }; |
| 555 | |
Florin Coras | 6c36f53 | 2017-11-03 18:32:34 -0700 | [diff] [blame] | 556 | /** \brief Dump session rules |
| 557 | @param client_index - opaque cookie to identify the sender |
| 558 | @param context - sender context, to match reply w/ request |
| 559 | */ |
| 560 | define session_rules_dump |
| 561 | { |
| 562 | u32 client_index; |
| 563 | u32 context; |
| 564 | }; |
| 565 | |
| 566 | /** \brief Session rules details |
| 567 | @param context - sender context, to match reply w/ request |
| 568 | @param transport_proto - transport protocol (0 - tcp 1 - udp) |
| 569 | @param is_ip4 - flag to indicate if ip addresses are ip4 or 6 |
| 570 | @param lcl_ip - local ip |
| 571 | @param lcl_plen - local prefix length |
| 572 | @param rmt_ip - remote ip |
| 573 | @param rmt_ple - remote prefix length |
| 574 | @param lcl_port - local port |
| 575 | @param rmt_port - remote port |
| 576 | @param action_index - the only action defined now is forward to |
| 577 | application with index action_index |
| 578 | @param appns_index - application namespace where rule is to be applied |
| 579 | to |
| 580 | @param scope - flag that indicates scope of the rule: global or local. |
| 581 | If 0, default is global, 1 is global 2 is local, 3 is |
| 582 | both |
| 583 | */ |
| 584 | define session_rules_details |
| 585 | { |
| 586 | u32 context; |
| 587 | u8 transport_proto; |
| 588 | u8 is_ip4; |
| 589 | u8 lcl_ip[16]; |
| 590 | u8 lcl_plen; |
| 591 | u8 rmt_ip[16]; |
| 592 | u8 rmt_plen; |
| 593 | u16 lcl_port; |
| 594 | u16 rmt_port; |
| 595 | u32 action_index; |
| 596 | u32 appns_index; |
| 597 | u8 scope; |
Florin Coras | c97a739 | 2017-11-05 23:07:07 -0800 | [diff] [blame] | 598 | u8 tag[64]; |
Florin Coras | 6c36f53 | 2017-11-03 18:32:34 -0700 | [diff] [blame] | 599 | }; |
| 600 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 601 | /* |
| 602 | * Local Variables: |
| 603 | * eval: (c-set-style "gnu") |
| 604 | * End: |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 605 | */ |