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