|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
63 app_ns->ns_id =
vec_dup (ns_id);
80 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
94 return VNET_API_ERROR_INVALID_VALUE;
106 app_ns->ns_secret =
a->secret;
107 app_ns->sw_if_index =
a->sw_if_index;
108 app_ns->ip4_fib_index =
110 app_ns->ip6_fib_index =
120 return VNET_API_ERROR_UNIMPLEMENTED;
128 return app_ns->ns_id;
154 app_ns->ip4_fib_index : app_ns->ip6_fib_index;
202 u8 is_add = 0, *ns_id = 0, secret_set = 0, sw_if_index_set = 0;
217 else if (
unformat (line_input,
"id %_%v%_", &ns_id))
219 else if (
unformat (line_input,
"secret %lu", &secret))
223 else if (
unformat (line_input,
"fib_id", &fib_id))
235 if (!ns_id || !secret_set || !sw_if_index_set)
248 .ip4_fib_id = fib_id,
262 .short_help =
"app ns [add] id <namespace-id> secret <secret> "
263 "sw_if_index <sw_if_index>",
273 app_ns->ns_secret, app_ns->sw_if_index, app_ns->ns_id);
320 u8 *ns_id, do_table = 0, had_input = 1, do_api = 0;
334 if (
unformat (line_input,
"table %_%v%_", &ns_id))
336 else if (
unformat (line_input,
"api-clients"))
378 "sw_if_index",
"Name");
395 .path =
"show app ns",
396 .short_help =
"show app ns [table <id> [api-clients]]",
#define FIB_PROTOCOL_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements.
clib_file_main_t file_main
const u8 * app_namespace_id_from_index(u32 index)
struct _vnet_app_namespace_add_del_args vnet_app_namespace_add_del_args_t
#define APP_NAMESPACE_INVALID_INDEX
u8 * format_app_namespace(u8 *s, va_list *args)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static vnet_sw_interface_t * vnet_get_sw_interface_or_null(vnet_main_t *vnm, u32 sw_if_index)
struct _app_namespace app_namespace_t
#define clib_error_return(e, args...)
#define hash_create_vec(elts, key_bytes, value_bytes)
static clib_error_t * app_ns_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int appns_sapi_add_ns_socket(app_namespace_t *app_ns)
#define APP_INVALID_INDEX
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
void app_namespaces_init(void)
app_namespace_t * app_namespace_get(u32 index)
void session_lookup_show_table_entries(vlib_main_t *vm, session_table_t *table, u8 type, u8 is_local)
app_namespace_t * app_namespace_alloc(u8 *ns_id)
void session_table_init(session_table_t *slt, u8 fib_proto)
Initialize session table hash tables.
uword * app_namespace_lookup_table
Hash table of application namespaces by app ns ids.
#define pool_foreach(VAR, POOL)
Iterate through pool.
u32 app_namespace_get_fib_index(app_namespace_t *app_ns, u8 fib_proto)
u32 fib_table_get_table_id_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the Table-ID of the FIB bound to the interface.
static vlib_cli_command_t app_ns_command
(constructor) VLIB_CLI_COMMAND (app_ns_command)
#define vec_dup(V)
Return copy of vector (no header, no alignment)
vnet_main_t * vnet_get_main(void)
static app_namespace_t * app_namespace_pool
Pool of application namespaces.
u32 session_table_index(session_table_t *slt)
#define hash_set_mem(h, key, value)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define VLIB_CLI_COMMAND(x,...)
static clib_error_t * show_app_ns_fn(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static clib_file_t * clib_file_get(clib_file_main_t *fm, u32 file_index)
#define vec_free(V)
Free vector's memory (no header).
static void app_namespace_show_api(vlib_main_t *vm, app_namespace_t *app_ns)
#define hash_get_mem(h, key)
description fragment has unexpected format
u32 app_namespace_index_from_id(const u8 *ns_id)
app_worker_t * app_worker_get(u32 wrk_index)
static vlib_cli_command_t show_app_ns_command
(constructor) VLIB_CLI_COMMAND (show_app_ns_command)
static uword pool_elts(void *v)
Number of active elements in a pool.
u32 app_namespace_index(app_namespace_t *app_ns)
void appns_sapi_enable(void)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
u32 wrk_map_index
Worker index in app's map pool.
session_table_t * session_table_alloc(void)
u32 app_index
Index of owning app.
struct _socket_t clib_socket_t
void session_lookup_set_tables_appns(app_namespace_t *app_ns)
Mark (global) tables as pertaining to app ns.
int vnet_app_namespace_add_del(vnet_app_namespace_add_del_args_t *a)
#define session_cli_return_if_not_enabled()
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
vl_api_interface_index_t sw_if_index
session_table_t * app_namespace_get_local_table(app_namespace_t *app_ns)
u8 appns_sapi_enabled(void)
struct _session_lookup_table session_table_t
app_namespace_t * app_namespace_get_from_id(const u8 *ns_id)
session_table_t * session_table_get(u32 table_index)
static u8 app_sapi_enabled
const u8 * app_namespace_id(app_namespace_t *app_ns)