Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 1 | /* |
Florin Coras | 288eaab | 2019-02-03 15:26:14 -0800 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 Cisco and/or its affiliates. |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [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 | */ |
| 15 | |
| 16 | #include <vnet/session/application_namespace.h> |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 17 | #include <vnet/session/application.h> |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 18 | #include <vnet/session/session_table.h> |
| 19 | #include <vnet/session/session.h> |
| 20 | #include <vnet/fib/fib_table.h> |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 21 | #include <vppinfra/file.h> |
Nathan Skrzypczak | 3d5e741 | 2021-09-17 11:53:25 +0200 | [diff] [blame] | 22 | #include <vppinfra/format_table.h> |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 23 | #include <vlib/unix/unix.h> |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Hash table of application namespaces by app ns ids |
| 27 | */ |
| 28 | uword *app_namespace_lookup_table; |
| 29 | |
| 30 | /** |
| 31 | * Pool of application namespaces |
| 32 | */ |
| 33 | static app_namespace_t *app_namespace_pool; |
| 34 | |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 35 | static u8 app_sapi_enabled; |
| 36 | |
Steven Luong | c4b5d10 | 2024-07-30 13:44:01 -0700 | [diff] [blame] | 37 | void |
| 38 | app_namespace_walk (app_namespace_walk_fn_t fn, void *ctx) |
| 39 | { |
| 40 | app_namespace_t *app_ns; |
| 41 | |
| 42 | pool_foreach (app_ns, app_namespace_pool) |
| 43 | { |
| 44 | fn (app_ns, ctx); |
| 45 | } |
| 46 | } |
| 47 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 48 | app_namespace_t * |
| 49 | app_namespace_get (u32 index) |
| 50 | { |
| 51 | return pool_elt_at_index (app_namespace_pool, index); |
| 52 | } |
| 53 | |
| 54 | app_namespace_t * |
Steven Luong | e38d947 | 2024-11-06 13:47:26 -0800 | [diff] [blame] | 55 | app_namespace_get_if_valid (u32 index) |
| 56 | { |
| 57 | if (pool_is_free_index (app_namespace_pool, index)) |
| 58 | return 0; |
| 59 | return pool_elt_at_index (app_namespace_pool, index); |
| 60 | } |
| 61 | |
| 62 | app_namespace_t * |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 63 | app_namespace_get_from_id (const u8 *ns_id) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 64 | { |
| 65 | u32 index = app_namespace_index_from_id (ns_id); |
| 66 | if (index == APP_NAMESPACE_INVALID_INDEX) |
| 67 | return 0; |
| 68 | return app_namespace_get (index); |
| 69 | } |
| 70 | |
| 71 | u32 |
| 72 | app_namespace_index (app_namespace_t * app_ns) |
| 73 | { |
| 74 | return (app_ns - app_namespace_pool); |
| 75 | } |
| 76 | |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 77 | void |
| 78 | app_namespace_free (app_namespace_t *app_ns) |
| 79 | { |
| 80 | hash_unset_mem (app_namespace_lookup_table, app_ns->ns_id); |
| 81 | vec_free (app_ns->ns_id); |
| 82 | |
| 83 | pool_put (app_namespace_pool, app_ns); |
| 84 | } |
| 85 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 86 | app_namespace_t * |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 87 | app_namespace_alloc (const u8 *ns_id) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 88 | { |
| 89 | app_namespace_t *app_ns; |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 90 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 91 | pool_get (app_namespace_pool, app_ns); |
Dave Barach | b7b9299 | 2018-10-17 10:38:51 -0400 | [diff] [blame] | 92 | clib_memset (app_ns, 0, sizeof (*app_ns)); |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 93 | |
| 94 | app_ns->ns_id = vec_dup ((u8 *) ns_id); |
| 95 | vec_terminate_c_string (app_ns->ns_id); |
| 96 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 97 | hash_set_mem (app_namespace_lookup_table, app_ns->ns_id, |
| 98 | app_ns - app_namespace_pool); |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 99 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 100 | return app_ns; |
| 101 | } |
| 102 | |
Filip Tehlar | 0028e6f | 2023-06-28 10:47:32 +0200 | [diff] [blame] | 103 | session_error_t |
| 104 | vnet_app_namespace_add_del (vnet_app_namespace_add_del_args_t *a) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 105 | { |
| 106 | app_namespace_t *app_ns; |
| 107 | session_table_t *st; |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 108 | u32 ns_index; |
Filip Tehlar | 0028e6f | 2023-06-28 10:47:32 +0200 | [diff] [blame] | 109 | session_error_t rv; |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 110 | u32 ip4_fib_index, ip6_fib_index; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 111 | |
| 112 | if (a->is_add) |
| 113 | { |
| 114 | if (a->sw_if_index != APP_NAMESPACE_INVALID_INDEX |
Dave Barach | 3940de3 | 2019-07-23 16:28:36 -0400 | [diff] [blame] | 115 | && !vnet_get_sw_interface_or_null (vnet_get_main (), |
| 116 | a->sw_if_index)) |
Filip Tehlar | 0028e6f | 2023-06-28 10:47:32 +0200 | [diff] [blame] | 117 | return SESSION_E_INVALID; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 118 | |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 119 | /* |
| 120 | * sw_if_index takes precedence over fib_id's. |
| 121 | * When sw_if_index is provided, overwrite what's in fib_id's |
| 122 | */ |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 123 | if (a->sw_if_index != APP_NAMESPACE_INVALID_INDEX) |
| 124 | { |
| 125 | a->ip4_fib_id = |
| 126 | fib_table_get_table_id_for_sw_if_index (FIB_PROTOCOL_IP4, |
| 127 | a->sw_if_index); |
| 128 | a->ip6_fib_id = |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 129 | fib_table_get_table_id_for_sw_if_index (FIB_PROTOCOL_IP6, |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 130 | a->sw_if_index); |
| 131 | } |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 132 | /* Either sw_if_index or one of 2 fib_id's must be provided */ |
| 133 | if (a->sw_if_index == APP_NAMESPACE_INVALID_INDEX && |
| 134 | a->ip4_fib_id == APP_NAMESPACE_INVALID_INDEX && |
| 135 | a->ip6_fib_id == APP_NAMESPACE_INVALID_INDEX) |
| 136 | return SESSION_E_INVALID; |
| 137 | |
| 138 | /* Validate the fib_id's */ |
| 139 | ip4_fib_index = fib_table_find (FIB_PROTOCOL_IP4, a->ip4_fib_id); |
| 140 | ip6_fib_index = fib_table_find (FIB_PROTOCOL_IP6, a->ip6_fib_id); |
| 141 | if ((ip4_fib_index == ~0) && (ip6_fib_index == ~0)) |
| 142 | return SESSION_E_INVALID; |
| 143 | |
| 144 | /* if fib_id entered, check fib_id exist */ |
| 145 | if (((a->ip4_fib_id != APP_NAMESPACE_INVALID_INDEX) && |
| 146 | (ip4_fib_index == ~0)) || |
| 147 | ((a->ip6_fib_id != APP_NAMESPACE_INVALID_INDEX) && |
| 148 | (ip6_fib_index == ~0))) |
Filip Tehlar | 0028e6f | 2023-06-28 10:47:32 +0200 | [diff] [blame] | 149 | return SESSION_E_INVALID; |
Florin Coras | c1a4265 | 2019-02-08 18:27:29 -0800 | [diff] [blame] | 150 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 151 | app_ns = app_namespace_get_from_id (a->ns_id); |
| 152 | if (!app_ns) |
Florin Coras | fc1c612 | 2017-10-26 14:25:12 -0700 | [diff] [blame] | 153 | { |
| 154 | app_ns = app_namespace_alloc (a->ns_id); |
| 155 | st = session_table_alloc (); |
Florin Coras | 6c36f53 | 2017-11-03 18:32:34 -0700 | [diff] [blame] | 156 | session_table_init (st, FIB_PROTOCOL_MAX); |
| 157 | st->is_local = 1; |
Steven Luong | e0c4e6e | 2024-10-22 10:44:07 -0700 | [diff] [blame] | 158 | vec_add1 (st->appns_index, app_namespace_index (app_ns)); |
Florin Coras | fc1c612 | 2017-10-26 14:25:12 -0700 | [diff] [blame] | 159 | app_ns->local_table_index = session_table_index (st); |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 160 | if (a->sock_name) |
| 161 | { |
| 162 | app_ns->sock_name = vec_dup (a->sock_name); |
| 163 | vec_terminate_c_string (app_ns->sock_name); |
| 164 | } |
| 165 | |
| 166 | /* Add socket for namespace, |
| 167 | * only at creation time */ |
| 168 | if (app_sapi_enabled) |
| 169 | { |
| 170 | rv = appns_sapi_add_ns_socket (app_ns); |
| 171 | if (rv) |
| 172 | return rv; |
| 173 | } |
Florin Coras | fc1c612 | 2017-10-26 14:25:12 -0700 | [diff] [blame] | 174 | } |
Steven Luong | 41ae1e2 | 2024-11-14 14:28:34 -0800 | [diff] [blame] | 175 | else |
| 176 | { |
| 177 | /* |
| 178 | * Not creating a new app_ns. We are just changing the binding of an |
| 179 | * existing app_ns to different fib tables. Clean up the old session |
| 180 | * table that was bound to these fib indices. |
| 181 | */ |
| 182 | ns_index = app_namespace_index (app_ns); |
| 183 | session_lookup_table_cleanup (FIB_PROTOCOL_IP4, |
| 184 | app_ns->ip4_fib_index, ns_index); |
| 185 | session_lookup_table_cleanup (FIB_PROTOCOL_IP6, |
| 186 | app_ns->ip6_fib_index, ns_index); |
| 187 | } |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 188 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 189 | app_ns->ns_secret = a->secret; |
| 190 | app_ns->sw_if_index = a->sw_if_index; |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 191 | |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 192 | app_ns->ip4_fib_index = ip4_fib_index; |
| 193 | app_ns->ip6_fib_index = ip6_fib_index; |
Steven Luong | 67bae20 | 2024-07-08 11:21:23 -0700 | [diff] [blame] | 194 | session_lookup_set_tables_appns (app_ns); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 195 | } |
| 196 | else |
| 197 | { |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 198 | ns_index = app_namespace_index_from_id (a->ns_id); |
| 199 | if (ns_index == APP_NAMESPACE_INVALID_INDEX) |
Filip Tehlar | 0028e6f | 2023-06-28 10:47:32 +0200 | [diff] [blame] | 200 | return SESSION_E_INVALID; |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 201 | |
| 202 | app_ns = app_namespace_get (ns_index); |
| 203 | if (!app_ns) |
Filip Tehlar | 0028e6f | 2023-06-28 10:47:32 +0200 | [diff] [blame] | 204 | return SESSION_E_INVALID; |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 205 | |
| 206 | application_namespace_cleanup (app_ns); |
| 207 | |
| 208 | if (app_sapi_enabled) |
| 209 | appns_sapi_del_ns_socket (app_ns); |
| 210 | |
| 211 | st = session_table_get (app_ns->local_table_index); |
| 212 | |
| 213 | session_table_free (st, FIB_PROTOCOL_MAX); |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 214 | if (app_ns->sock_name) |
| 215 | vec_free (app_ns->sock_name); |
| 216 | |
Steven Luong | e0c4e6e | 2024-10-22 10:44:07 -0700 | [diff] [blame] | 217 | session_lookup_table_cleanup (FIB_PROTOCOL_IP4, app_ns->ip4_fib_index, |
| 218 | ns_index); |
| 219 | session_lookup_table_cleanup (FIB_PROTOCOL_IP6, app_ns->ip6_fib_index, |
| 220 | ns_index); |
Steven Luong | 67bae20 | 2024-07-08 11:21:23 -0700 | [diff] [blame] | 221 | |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 222 | app_namespace_free (app_ns); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 223 | } |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 224 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 225 | return 0; |
| 226 | } |
| 227 | |
| 228 | const u8 * |
| 229 | app_namespace_id (app_namespace_t * app_ns) |
| 230 | { |
| 231 | return app_ns->ns_id; |
| 232 | } |
| 233 | |
| 234 | u32 |
| 235 | app_namespace_index_from_id (const u8 * ns_id) |
| 236 | { |
| 237 | uword *indexp; |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 238 | u8 *key; |
| 239 | |
| 240 | key = vec_dup ((u8 *) ns_id); |
| 241 | vec_terminate_c_string (key); |
| 242 | |
| 243 | indexp = hash_get_mem (app_namespace_lookup_table, key); |
| 244 | vec_free (key); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 245 | if (!indexp) |
| 246 | return APP_NAMESPACE_INVALID_INDEX; |
| 247 | return *indexp; |
| 248 | } |
| 249 | |
| 250 | const u8 * |
| 251 | app_namespace_id_from_index (u32 index) |
| 252 | { |
| 253 | app_namespace_t *app_ns; |
| 254 | |
| 255 | app_ns = app_namespace_get (index); |
| 256 | return app_namespace_id (app_ns); |
| 257 | } |
| 258 | |
Florin Coras | 1c71045 | 2017-10-17 00:03:13 -0700 | [diff] [blame] | 259 | u32 |
| 260 | app_namespace_get_fib_index (app_namespace_t * app_ns, u8 fib_proto) |
| 261 | { |
| 262 | return fib_proto == FIB_PROTOCOL_IP4 ? |
| 263 | app_ns->ip4_fib_index : app_ns->ip6_fib_index; |
| 264 | } |
| 265 | |
| 266 | session_table_t * |
| 267 | app_namespace_get_local_table (app_namespace_t * app_ns) |
| 268 | { |
| 269 | return session_table_get (app_ns->local_table_index); |
| 270 | } |
| 271 | |
Nathan Skrzypczak | 7b3a3df | 2021-07-28 14:09:50 +0200 | [diff] [blame] | 272 | int |
| 273 | appns_sapi_enable_disable (int is_enable) |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 274 | { |
Nathan Skrzypczak | 7b3a3df | 2021-07-28 14:09:50 +0200 | [diff] [blame] | 275 | /* This cannot be called with active sockets */ |
| 276 | if (pool_elts (app_namespace_pool)) |
| 277 | return -1; |
| 278 | |
| 279 | app_sapi_enabled = is_enable; |
| 280 | return 0; |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | u8 |
| 284 | appns_sapi_enabled (void) |
| 285 | { |
| 286 | return app_sapi_enabled; |
| 287 | } |
| 288 | |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 289 | static void |
| 290 | app_namespace_table_bind_v4 (ip4_main_t *im, uword opaque, u32 sw_if_index, |
| 291 | u32 new_fib_index, u32 old_fib_index) |
| 292 | { |
| 293 | app_namespace_t *app_ns; |
| 294 | |
| 295 | pool_foreach (app_ns, app_namespace_pool) |
| 296 | { |
| 297 | if (app_ns->sw_if_index == sw_if_index) |
| 298 | { |
| 299 | /* |
| 300 | * For add, call vnet_app_namespace_add_del without sw_if_index and |
| 301 | * keep the existing ip6_fib_index. |
| 302 | */ |
| 303 | vnet_app_namespace_add_del_args_t add = { |
| 304 | .ns_id = vec_dup (app_ns->ns_id), |
| 305 | .secret = app_ns->ns_secret, |
| 306 | .sw_if_index = APP_NAMESPACE_INVALID_INDEX, |
| 307 | .sock_name = vec_dup (app_ns->sock_name), |
| 308 | .ip4_fib_id = |
| 309 | fib_table_get_table_id (new_fib_index, FIB_PROTOCOL_IP4), |
| 310 | .ip6_fib_id = |
| 311 | fib_table_get_table_id (app_ns->ip6_fib_index, FIB_PROTOCOL_IP6), |
| 312 | .is_add = 1, |
| 313 | }; |
| 314 | vnet_app_namespace_add_del_args_t del = { |
| 315 | .ns_id = app_ns->ns_id, |
| 316 | .is_add = 0, |
| 317 | }; |
| 318 | vnet_app_namespace_add_del (&del); |
| 319 | |
| 320 | vnet_app_namespace_add_del (&add); |
| 321 | |
| 322 | /* keep the sw_if_index */ |
| 323 | app_ns->sw_if_index = sw_if_index; |
| 324 | |
| 325 | vec_free (add.ns_id); |
| 326 | vec_free (add.sock_name); |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | static void |
| 332 | app_namespace_table_bind_v6 (ip6_main_t *im, uword opaque, u32 sw_if_index, |
| 333 | u32 new_fib_index, u32 old_fib_index) |
| 334 | { |
| 335 | app_namespace_t *app_ns; |
| 336 | |
| 337 | pool_foreach (app_ns, app_namespace_pool) |
| 338 | { |
| 339 | if (app_ns->sw_if_index == sw_if_index) |
| 340 | { |
| 341 | /* |
| 342 | * For add, call vnet_app_namespace_add_del without sw_if_index and |
| 343 | * keep the existing ip4_fib_index. |
| 344 | */ |
| 345 | vnet_app_namespace_add_del_args_t add = { |
| 346 | .ns_id = vec_dup (app_ns->ns_id), |
| 347 | .secret = app_ns->ns_secret, |
| 348 | .sw_if_index = APP_NAMESPACE_INVALID_INDEX, |
| 349 | .sock_name = vec_dup (app_ns->sock_name), |
| 350 | .ip4_fib_id = |
| 351 | fib_table_get_table_id (app_ns->ip4_fib_index, FIB_PROTOCOL_IP4), |
| 352 | .ip6_fib_id = |
| 353 | fib_table_get_table_id (new_fib_index, FIB_PROTOCOL_IP6), |
| 354 | .is_add = 1, |
| 355 | }; |
| 356 | vnet_app_namespace_add_del_args_t del = { |
| 357 | .ns_id = app_ns->ns_id, |
| 358 | .is_add = 0, |
| 359 | }; |
| 360 | vnet_app_namespace_add_del (&del); |
| 361 | |
| 362 | vnet_app_namespace_add_del (&add); |
| 363 | |
| 364 | /* keep the sw_if_index */ |
| 365 | app_ns->sw_if_index = sw_if_index; |
| 366 | |
| 367 | vec_free (add.ns_id); |
| 368 | vec_free (add.sock_name); |
| 369 | } |
| 370 | } |
| 371 | } |
| 372 | |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 373 | void |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 374 | app_namespaces_init (void) |
| 375 | { |
| 376 | u8 *ns_id = format (0, "default"); |
Florin Coras | fc1c612 | 2017-10-26 14:25:12 -0700 | [diff] [blame] | 377 | |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 378 | VNET_SW_INTERFACE_TABLE_BIND_V4_CB (app_namespace_table_bind_v4); |
| 379 | VNET_SW_INTERFACE_TABLE_BIND_V6_CB (app_namespace_table_bind_v6); |
| 380 | |
Florin Coras | fc1c612 | 2017-10-26 14:25:12 -0700 | [diff] [blame] | 381 | if (!app_namespace_lookup_table) |
| 382 | app_namespace_lookup_table = |
| 383 | hash_create_vec (0, sizeof (u8), sizeof (uword)); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 384 | |
| 385 | /* |
| 386 | * Allocate default namespace |
| 387 | */ |
Florin Coras | 7cb471a | 2021-07-23 08:39:26 -0700 | [diff] [blame] | 388 | |
| 389 | /* clang-format off */ |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 390 | vnet_app_namespace_add_del_args_t a = { |
| 391 | .ns_id = ns_id, |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 392 | .sock_name = 0, |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 393 | .secret = 0, |
| 394 | .sw_if_index = APP_NAMESPACE_INVALID_INDEX, |
| 395 | .is_add = 1 |
| 396 | }; |
Florin Coras | 7cb471a | 2021-07-23 08:39:26 -0700 | [diff] [blame] | 397 | /* clang-format on */ |
| 398 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 399 | vnet_app_namespace_add_del (&a); |
| 400 | vec_free (ns_id); |
| 401 | } |
| 402 | |
| 403 | static clib_error_t * |
| 404 | app_ns_fn (vlib_main_t * vm, unformat_input_t * input, |
| 405 | vlib_cli_command_t * cmd) |
| 406 | { |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 407 | u8 is_add = 0, *ns_id = 0, secret_set = 0, sw_if_index_set = 0; |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 408 | u8 fib6_id_set = 0, fib4_id_set = 0; |
Nathan Skrzypczak | 51f1b26 | 2023-04-27 12:43:46 +0200 | [diff] [blame] | 409 | u8 *sock_name = 0; |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 410 | unformat_input_t _line_input, *line_input = &_line_input; |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 411 | u32 sw_if_index = APP_NAMESPACE_INVALID_INDEX; |
| 412 | u32 fib4_id = ~0, fib6_id = ~0; |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 413 | vnet_main_t *vnm = vnet_get_main (); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 414 | u64 secret; |
| 415 | clib_error_t *error = 0; |
Florin Coras | c1a4265 | 2019-02-08 18:27:29 -0800 | [diff] [blame] | 416 | int rv; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 417 | |
| 418 | session_cli_return_if_not_enabled (); |
| 419 | |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 420 | if (!unformat_user (input, unformat_line_input, line_input)) |
| 421 | return 0; |
| 422 | |
| 423 | while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 424 | { |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 425 | if (unformat (line_input, "add")) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 426 | is_add = 1; |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 427 | else if (unformat (line_input, "del")) |
| 428 | is_add = 0; |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 429 | else if (unformat (line_input, "id %_%v%_", &ns_id)) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 430 | ; |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 431 | else if (unformat (line_input, "secret %lu", &secret)) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 432 | secret_set = 1; |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 433 | else if (unformat (line_input, "sw_if_index %u", &sw_if_index)) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 434 | sw_if_index_set = 1; |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 435 | else if (unformat (line_input, "if %U", unformat_vnet_sw_interface, vnm, |
| 436 | &sw_if_index)) |
| 437 | sw_if_index_set = 1; |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 438 | else if (unformat (line_input, "ip4-fib-id %u", &fib4_id)) |
| 439 | fib4_id_set = 1; |
| 440 | else if (unformat (line_input, "ip6-fib-id %u", &fib6_id)) |
| 441 | fib6_id_set = 1; |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 442 | else if (unformat (line_input, "sock-name %_%v%_", &sock_name)) |
| 443 | ; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 444 | else |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 445 | { |
| 446 | error = clib_error_return (0, "unknown input `%U'", |
| 447 | format_unformat_error, line_input); |
Florin Coras | 7cb471a | 2021-07-23 08:39:26 -0700 | [diff] [blame] | 448 | goto done; |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 449 | } |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 450 | } |
| 451 | |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 452 | if (!ns_id) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 453 | { |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 454 | vlib_cli_output (vm, "namespace-id must be provided"); |
Florin Coras | 7cb471a | 2021-07-23 08:39:26 -0700 | [diff] [blame] | 455 | goto done; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 456 | } |
| 457 | |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 458 | if (is_add && |
| 459 | (!secret_set || (!sw_if_index_set && !fib4_id_set && !fib6_id_set))) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 460 | { |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 461 | vlib_cli_output (vm, "secret and interface or fib-id must be provided"); |
| 462 | goto done; |
| 463 | } |
| 464 | |
| 465 | /* Validate the fib-id is valid */ |
| 466 | if (fib4_id_set && (fib_table_find (FIB_PROTOCOL_IP4, fib4_id) == ~0)) |
| 467 | { |
| 468 | vlib_cli_output (vm, "ip4-fib-id %u does not exist", fib4_id); |
| 469 | goto done; |
| 470 | } |
| 471 | |
| 472 | if (fib6_id_set && (fib_table_find (FIB_PROTOCOL_IP6, fib6_id) == ~0)) |
| 473 | { |
| 474 | vlib_cli_output (vm, "ip6-fib-id %u does not exist", fib6_id); |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 475 | goto done; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 476 | } |
| 477 | |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 478 | /* clang-format off */ |
| 479 | vnet_app_namespace_add_del_args_t args = { |
| 480 | .ns_id = ns_id, |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 481 | .secret = secret, |
| 482 | .sw_if_index = sw_if_index, |
| 483 | .sock_name = sock_name, |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 484 | .ip4_fib_id = fib4_id, |
| 485 | .ip6_fib_id = fib6_id, |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 486 | .is_add = is_add, |
| 487 | }; |
| 488 | /* clang-format on */ |
| 489 | |
| 490 | if ((rv = vnet_app_namespace_add_del (&args))) |
| 491 | error = clib_error_return (0, "app namespace add del returned %d", rv); |
| 492 | |
Florin Coras | 7cb471a | 2021-07-23 08:39:26 -0700 | [diff] [blame] | 493 | done: |
| 494 | |
| 495 | vec_free (ns_id); |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 496 | vec_free (sock_name); |
Florin Coras | 7cb471a | 2021-07-23 08:39:26 -0700 | [diff] [blame] | 497 | unformat_free (line_input); |
| 498 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 499 | return error; |
| 500 | } |
| 501 | |
Florin Coras | 7cb471a | 2021-07-23 08:39:26 -0700 | [diff] [blame] | 502 | VLIB_CLI_COMMAND (app_ns_command, static) = { |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 503 | .path = "app ns", |
Nathan Skrzypczak | b3ea73e | 2021-08-05 10:22:52 +0200 | [diff] [blame] | 504 | .short_help = "app ns [add|del] id <namespace-id> secret <secret> " |
Steven Luong | 2e67a3f | 2024-11-08 08:35:14 -0800 | [diff] [blame] | 505 | "sw_if_index <sw_if_index> " |
| 506 | "{ip4-fib-id <id> ip6-fib-id <id> | if <interface>}", |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 507 | .function = app_ns_fn, |
| 508 | }; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 509 | |
| 510 | u8 * |
| 511 | format_app_namespace (u8 * s, va_list * args) |
| 512 | { |
| 513 | app_namespace_t *app_ns = va_arg (*args, app_namespace_t *); |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 514 | vnet_main_t *vnm = vnet_get_main (); |
Florin Coras | 7cb471a | 2021-07-23 08:39:26 -0700 | [diff] [blame] | 515 | |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 516 | s = format (s, "Application namespace [%u]\nid: %s\nsecret: %lu", |
| 517 | app_namespace_index (app_ns), app_ns->ns_id, app_ns->ns_secret); |
| 518 | if (app_ns->sw_if_index != (u32) ~0) |
| 519 | s = format (s, "\nInterface: %U", format_vnet_sw_if_index_name, vnm, |
| 520 | app_ns->sw_if_index); |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 521 | if (app_ns->sock_name) |
| 522 | s = format (s, "\nSocket: %s", app_ns->sock_name); |
| 523 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 524 | return s; |
| 525 | } |
| 526 | |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 527 | static void |
| 528 | app_namespace_show_api (vlib_main_t * vm, app_namespace_t * app_ns) |
| 529 | { |
| 530 | app_ns_api_handle_t *handle; |
| 531 | app_worker_t *app_wrk; |
| 532 | clib_socket_t *cs; |
| 533 | clib_file_t *cf; |
| 534 | |
| 535 | if (!app_sapi_enabled) |
| 536 | { |
| 537 | vlib_cli_output (vm, "app socket api not enabled!"); |
| 538 | return; |
| 539 | } |
| 540 | |
| 541 | vlib_cli_output (vm, "socket: %v\n", app_ns->sock_name); |
| 542 | |
| 543 | if (!pool_elts (app_ns->app_sockets)) |
| 544 | return; |
| 545 | |
| 546 | vlib_cli_output (vm, "%12s%12s%5s", "app index", "wrk index", "fd"); |
| 547 | |
| 548 | |
Damjan Marion | b2c31b6 | 2020-12-13 21:47:40 +0100 | [diff] [blame] | 549 | pool_foreach (cs, app_ns->app_sockets) { |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 550 | handle = (app_ns_api_handle_t *) &cs->private_data; |
| 551 | cf = clib_file_get (&file_main, handle->aah_file_index); |
| 552 | if (handle->aah_app_wrk_index == APP_INVALID_INDEX) |
| 553 | { |
| 554 | vlib_cli_output (vm, "%12d%12d%5u", -1, -1, cf->file_descriptor); |
| 555 | continue; |
| 556 | } |
| 557 | app_wrk = app_worker_get (handle->aah_app_wrk_index); |
| 558 | vlib_cli_output (vm, "%12d%12d%5u", app_wrk->app_index, |
| 559 | app_wrk->wrk_map_index, cf->file_descriptor); |
Damjan Marion | b2c31b6 | 2020-12-13 21:47:40 +0100 | [diff] [blame] | 560 | } |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 561 | } |
| 562 | |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 563 | static clib_error_t * |
Florin Coras | dcdff6e | 2017-11-07 22:36:02 -0800 | [diff] [blame] | 564 | show_app_ns_fn (vlib_main_t * vm, unformat_input_t * main_input, |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 565 | vlib_cli_command_t * cmd) |
| 566 | { |
Florin Coras | dcdff6e | 2017-11-07 22:36:02 -0800 | [diff] [blame] | 567 | unformat_input_t _line_input, *line_input = &_line_input; |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 568 | u8 *ns_id = 0, do_table = 0, had_input = 1, do_api = 0; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 569 | app_namespace_t *app_ns; |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 570 | vnet_main_t *vnm = vnet_get_main (); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 571 | session_table_t *st; |
Nathan Skrzypczak | 3d5e741 | 2021-09-17 11:53:25 +0200 | [diff] [blame] | 572 | table_t table = {}, *t = &table; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 573 | |
| 574 | session_cli_return_if_not_enabled (); |
| 575 | |
Florin Coras | dcdff6e | 2017-11-07 22:36:02 -0800 | [diff] [blame] | 576 | if (!unformat_user (main_input, unformat_line_input, line_input)) |
Florin Coras | 2640808 | 2017-11-09 02:06:07 -0800 | [diff] [blame] | 577 | { |
| 578 | had_input = 0; |
| 579 | goto do_ns_list; |
| 580 | } |
Florin Coras | dcdff6e | 2017-11-07 22:36:02 -0800 | [diff] [blame] | 581 | |
| 582 | while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 583 | { |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 584 | if (unformat (line_input, "id %_%v%_", &ns_id)) |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 585 | do_table = 1; |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 586 | else if (unformat (line_input, "api-clients")) |
| 587 | do_api = 1; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 588 | else |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 589 | { |
Florin Coras | dcdff6e | 2017-11-07 22:36:02 -0800 | [diff] [blame] | 590 | vlib_cli_output (vm, "unknown input [%U]", format_unformat_error, |
| 591 | line_input); |
| 592 | goto done; |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 593 | } |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 594 | } |
| 595 | |
Florin Coras | 61ae056 | 2020-09-02 19:10:28 -0700 | [diff] [blame] | 596 | if (do_api) |
| 597 | { |
| 598 | if (!do_table) |
| 599 | { |
| 600 | vlib_cli_output (vm, "must specify a table for api"); |
| 601 | goto done; |
| 602 | } |
| 603 | app_ns = app_namespace_get_from_id (ns_id); |
| 604 | app_namespace_show_api (vm, app_ns); |
| 605 | goto done; |
| 606 | } |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 607 | if (do_table) |
| 608 | { |
| 609 | app_ns = app_namespace_get_from_id (ns_id); |
| 610 | if (!app_ns) |
| 611 | { |
| 612 | vlib_cli_output (vm, "ns %v not found", ns_id); |
Florin Coras | dcdff6e | 2017-11-07 22:36:02 -0800 | [diff] [blame] | 613 | goto done; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 614 | } |
| 615 | st = session_table_get (app_ns->local_table_index); |
| 616 | if (!st) |
| 617 | { |
| 618 | vlib_cli_output (vm, "table for ns %v could not be found", ns_id); |
Florin Coras | dcdff6e | 2017-11-07 22:36:02 -0800 | [diff] [blame] | 619 | goto done; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 620 | } |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 621 | vlib_cli_output (vm, "%U", format_app_namespace, app_ns); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 622 | session_lookup_show_table_entries (vm, st, 0, 1); |
| 623 | vec_free (ns_id); |
Florin Coras | dcdff6e | 2017-11-07 22:36:02 -0800 | [diff] [blame] | 624 | goto done; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 625 | } |
| 626 | |
Florin Coras | 2640808 | 2017-11-09 02:06:07 -0800 | [diff] [blame] | 627 | do_ns_list: |
Nathan Skrzypczak | 51f1b26 | 2023-04-27 12:43:46 +0200 | [diff] [blame] | 628 | table_add_header_col (t, 5, "Index", "Secret", "Interface", "Id", "Socket"); |
Nathan Skrzypczak | 3d5e741 | 2021-09-17 11:53:25 +0200 | [diff] [blame] | 629 | int i = 0; |
| 630 | pool_foreach (app_ns, app_namespace_pool) |
| 631 | { |
| 632 | int j = 0; |
| 633 | table_format_cell (t, i, j++, "%u", app_namespace_index (app_ns)); |
| 634 | table_format_cell (t, i, j++, "%lu", app_ns->ns_secret); |
| 635 | table_format_cell (t, i, j++, "%U", format_vnet_sw_if_index_name, vnm, |
| 636 | app_ns->sw_if_index); |
| 637 | table_format_cell (t, i, j++, "%s", app_ns->ns_id); |
Nathan Skrzypczak | 3d5e741 | 2021-09-17 11:53:25 +0200 | [diff] [blame] | 638 | table_format_cell (t, i++, j++, "%s", app_ns->sock_name); |
| 639 | } |
Florin Coras | dff48db | 2017-11-19 18:06:58 -0800 | [diff] [blame] | 640 | |
Nathan Skrzypczak | 3d5e741 | 2021-09-17 11:53:25 +0200 | [diff] [blame] | 641 | t->default_body.align = TTAA_LEFT; |
| 642 | t->default_header_col.align = TTAA_LEFT; |
| 643 | t->default_header_col.fg_color = TTAC_YELLOW; |
| 644 | t->default_header_col.flags = TTAF_FG_COLOR_SET; |
| 645 | vlib_cli_output (vm, "%U", format_table, t); |
| 646 | table_free (t); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 647 | |
Florin Coras | dcdff6e | 2017-11-07 22:36:02 -0800 | [diff] [blame] | 648 | done: |
Florin Coras | 2640808 | 2017-11-09 02:06:07 -0800 | [diff] [blame] | 649 | if (had_input) |
| 650 | unformat_free (line_input); |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 651 | return 0; |
| 652 | } |
| 653 | |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 654 | VLIB_CLI_COMMAND (show_app_ns_command, static) = { |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 655 | .path = "show app ns", |
Nathan Skrzypczak | 1a9e2f9 | 2021-07-28 19:35:08 +0200 | [diff] [blame] | 656 | .short_help = "show app ns [id <id> [api-clients]]", |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 657 | .function = show_app_ns_fn, |
| 658 | }; |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 659 | |
| 660 | /* |
| 661 | * fd.io coding-style-patch-verification: ON |
| 662 | * |
| 663 | * Local Variables: |
| 664 | * eval: (c-set-style "gnu") |
| 665 | * End: |
| 666 | */ |