104 return VNET_API_ERROR_INVALID_REGISTRATION;
121 return new_context_id;
137 for(i=0; i<
vec_len(acls); i++) {
151 clib_warning(
"BUG: can not unlock acl %d lc_index %d", acl, lc_index);
182 for(i=
vec_len(acls); i > 0; i--)
196 clib_warning(
"BUG: lc_index %d is not valid", lc_index);
219 uword *seen_acl_bitmap = 0;
226 for(i=0; i<
vec_len(acl_list); i++) {
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,
316 if (user_index == ~0 || (curr_user_index == user_index)) {
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; #define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
__clib_export clib_error_t * acl_plugin_methods_vtable_init(acl_plugin_methods_t *m)
static void unapply_acl_vec(u32 lc_index, u32 *acls)
void hash_acl_unapply(acl_main_t *am, u32 lc_index, int acl_index)
static void unlock_acl(acl_main_t *am, u32 acl, u32 lc_index)
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
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. ...
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static u32 acl_plugin_register_user_module(char *user_module_name, char *val1_label, char *val2_label)
void acl_plugin_lookup_context_notify_acl_change(u32 acl_num)
void hash_acl_add(acl_main_t *am, int acl_index)
u32 ** lc_index_vec_by_acl
static int acl_plugin_get_lookup_context_index(u32 acl_user_id, u32 val1, u32 val2)
static void acl_plugin_put_lookup_context_index(u32 lc_index)
static u8 acl_plugin_acl_exists(u32 acl_index)
#define elog_acl_cond_trace_X1(am, trace_cond, acl_elog_trace_format_label, acl_elog_trace_format_args, acl_elog_val1)
static void lock_acl(acl_main_t *am, u32 acl, u32 lc_index)
#define vec_search(v, E)
Search a vector for the index of the entry that matches.
static int acl_lc_index_valid(acl_main_t *am, u32 lc_index)
void hash_acl_apply(acl_main_t *am, u32 lc_index, int acl_index, u32 acl_position)
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)
int hash_acl_exists(acl_main_t *am, int acl_index)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void apply_acl_vec(u32 lc_index, u32 *acls)
#define pool_put(P, E)
Free an object E in pool P.
#define vec_dup(V)
Return copy of vector (no header, no alignment)
#define vec_del1(v, i)
Delete the element at index I.
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
void hash_acl_delete(acl_main_t *am, int acl_index)
#define clib_warning(format, args...)
void acl_plugin_show_lookup_user(u32 user_index)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
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)
static u32 get_acl_user_id(acl_main_t *am, char *user_module_name, char *val1_label, char *val2_label)
#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)
void acl_plugin_show_lookup_context(u32 lc_index)
#define clib_bitmap_free(v)
Free a bitmap.
#define foreach_acl_plugin_exported_method_name
void * acl_plugin_get_p_acl_main(void)
acl_lookup_context_t * acl_lookup_contexts
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VLIB buffer representation.
static void unlock_acl_vec(u32 lc_index, u32 *acls)
#define vec_foreach(var, vec)
Vector iterator.
static int acl_user_id_valid(acl_main_t *am, u32 acl_user_id)
static int acl_plugin_set_acl_vec_for_context(u32 lc_index, u32 *acl_list)
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)
static void lock_acl_vec(u32 lc_index, u32 *acls)
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)
acl_lookup_context_user_t * acl_users
foreach_fa_cleaner_counter vlib_main_t * vlib_main