2 * Copyright (c) 2017 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #include <vnet/vnet.h>
17 #include <vnet/session/session_table.h>
19 #ifndef SRC_VNET_SESSION_APPLICATION_NAMESPACE_H_
20 #define SRC_VNET_SESSION_APPLICATION_NAMESPACE_H_
22 typedef struct _app_namespace
25 * Local sw_if_index that supports transport connections for this namespace
30 * Network namespace (e.g., fib_index associated to the sw_if_index)
31 * wherein connections are to be established. Since v4 and v6 fibs are
32 * separate, we actually need to keep pointers to both.
38 * Local session table associated to ns
40 u32 local_table_index;
43 * Secret apps need to provide to authorize attachment to the namespace
48 * Application namespace id
53 typedef struct _vnet_app_namespace_add_del_args
61 } vnet_app_namespace_add_del_args_t;
63 #define APP_NAMESPACE_INVALID_INDEX ((u32)~0)
65 app_namespace_t *app_namespace_alloc (u8 * ns_id);
66 app_namespace_t *app_namespace_get (u32 index);
67 app_namespace_t *app_namespace_get_from_id (const u8 * ns_id);
68 u32 app_namespace_index (app_namespace_t * app_ns);
69 const u8 *app_namespace_id (app_namespace_t * app_ns);
70 const u8 *app_namespace_id_from_index (u32 index);
71 u32 app_namespace_index_from_id (const u8 * ns_id);
72 void app_namespaces_init (void);
73 clib_error_t *vnet_app_namespace_add_del (vnet_app_namespace_add_del_args_t *
75 u32 app_namespace_get_fib_index (app_namespace_t * app_ns, u8 fib_proto);
76 session_table_t *app_namespace_get_local_table (app_namespace_t * app_ns);
78 always_inline app_namespace_t *
79 app_namespace_get_default (void)
81 return app_namespace_get (0);
84 #endif /* SRC_VNET_SESSION_APPLICATION_NAMESPACE_H_ */
87 * fd.io coding-style-patch-verification: ON
90 * eval: (c-set-style "gnu")