|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
43 return (auser -
am->acl_users);
51 return (auser -
am->acl_users);
104 return VNET_API_ERROR_INVALID_REGISTRATION;
118 u32 new_context_id = acontext -
am->acl_lookup_contexts;
119 vec_add1(
am->acl_users[acl_user_id].lookup_contexts, new_context_id);
121 return new_context_id;
129 vec_add1(
am->lc_index_vec_by_acl[acl], lc_index);
151 clib_warning(
"BUG: can not unlock acl %d lc_index %d", acl, lc_index);
196 clib_warning(
"BUG: lc_index %d is not valid", lc_index);
219 uword *seen_acl_bitmap = 0;
231 clib_warning(
"BUG: lc_index %d is not valid", lc_index);
240 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
246 clib_warning (
"ERROR: ACL %d being applied twice", *pacln);
247 rv = VNET_API_ERROR_ENTRY_ALREADY_EXISTS;
299 u32 * r_rule_match_p,
315 u32 curr_user_index = (auser -
am->acl_users);
316 if (user_index == ~0 || (curr_user_index == user_index)) {
330 if (!
am->acl_lookup_contexts)
338 u32 curr_lc_index = (acontext -
am->acl_lookup_contexts);
339 if ((lc_index == ~0) || (curr_lc_index == lc_index)) {
347 vlib_cli_output (
vm,
"index %d: user_id: %d user_val1: %d user_val2: %d, acl_indices: %U",
366 #define _(name) m->name = acl_plugin_ ## name;
static void lock_acl(acl_main_t *am, u32 acl, u32 lc_index)
void hash_acl_delete(acl_main_t *am, int acl_index)
void acl_plugin_show_lookup_user(u32 user_index)
__clib_export clib_error_t * acl_plugin_methods_vtable_init(acl_plugin_methods_t *m)
static void unlock_acl(acl_main_t *am, u32 acl, u32 lc_index)
static int acl_plugin_match_5tuple_inline(void *p_acl_main, u32 lc_index, fa_5tuple_opaque_t *pkt_5tuple, int is_ip6, u8 *r_action, u32 *r_acl_pos_p, u32 *r_acl_match_p, u32 *r_rule_match_p, u32 *trace_bitmap)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static u32 get_acl_user_id(acl_main_t *am, char *user_module_name, char *val1_label, char *val2_label)
static u32 acl_plugin_register_user_module(char *user_module_name, char *val1_label, char *val2_label)
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
int hash_acl_exists(acl_main_t *am, int acl_index)
static int acl_lc_index_valid(acl_main_t *am, u32 lc_index)
void hash_acl_unapply(acl_main_t *am, u32 lc_index, int acl_index)
#define elog_acl_cond_trace_X2(am, trace_cond, acl_elog_trace_format_label, acl_elog_trace_format_args, acl_elog_val1, acl_elog_val2)
static u8 acl_plugin_acl_exists(u32 acl_index)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define vec_dup(V)
Return copy of vector (no header, no alignment)
static void lock_acl_vec(u32 lc_index, u32 *acls)
void hash_acl_add(acl_main_t *am, int acl_index)
#define foreach_acl_plugin_exported_method_name
#define clib_bitmap_free(v)
Free a bitmap.
static int acl_plugin_match_5tuple(u32 lc_index, fa_5tuple_opaque_t *pkt_5tuple, int is_ip6, u8 *r_action, u32 *r_acl_pos_p, u32 *r_acl_match_p, u32 *r_rule_match_p, u32 *trace_bitmap)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
static int acl_plugin_set_acl_vec_for_context(u32 lc_index, u32 *acl_list)
void hash_acl_apply(acl_main_t *am, u32 lc_index, int acl_index, u32 acl_position)
static void acl_plugin_put_lookup_context_index(u32 lc_index)
static int acl_plugin_get_lookup_context_index(u32 acl_user_id, u32 val1, u32 val2)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define vec_search(v, E)
Search a vector for the index of the entry that matches.
static void unlock_acl_vec(u32 lc_index, u32 *acls)
#define vec_free(V)
Free vector's memory (no header).
static void unapply_acl_vec(u32 lc_index, u32 *acls)
static void acl_plugin_fill_5tuple_inline(void *p_acl_main, u32 lc_index, vlib_buffer_t *b0, int is_ip6, int is_input, int is_l2_path, fa_5tuple_opaque_t *p5tuple_pkt)
#define vec_foreach(var, vec)
Vector iterator.
static void apply_acl_vec(u32 lc_index, u32 *acls)
void acl_plugin_show_lookup_context(u32 lc_index)
void * acl_plugin_get_p_acl_main(void)
void acl_plugin_lookup_context_notify_acl_change(u32 acl_num)
#define clib_warning(format, args...)
#define elog_acl_cond_trace_X1(am, trace_cond, acl_elog_trace_format_label, acl_elog_trace_format_args, acl_elog_val1)
static void acl_plugin_fill_5tuple(u32 lc_index, vlib_buffer_t *b0, int is_ip6, int is_input, int is_l2_path, fa_5tuple_opaque_t *p5tuple_pkt)
#define vec_del1(v, i)
Delete the element at index I.
static int acl_user_id_valid(acl_main_t *am, u32 acl_user_id)
VLIB buffer representation.