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