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