FD.io VPP  v20.05-21-gb1500e9ff
Vector Packet Processing
abf_itf_attach.c File Reference
+ Include dependency graph for abf_itf_attach.c:

Go to the source code of this file.

Data Structures

struct  abf_input_trace_t_
 

Macros

#define abf_error(n, s)   ABF_ERROR_##n,
 
#define abf_error(n, s)   s,
 

Typedefs

typedef enum abf_next_t_ abf_next_t
 
typedef struct abf_input_trace_t_ abf_input_trace_t
 

Enumerations

enum  abf_next_t_ { ABF_NEXT_DROP, ABF_N_NEXT }
 
enum  abf_error_t { abf_error, abf_error }
 

Functions

static u64 abf_itf_attach_mk_key (u32 abf_index, u32 sw_if_index)
 
static abf_itf_attach_tabf_itf_attach_db_find (u32 abf_index, u32 sw_if_index)
 
static void abf_itf_attach_db_add (u32 abf_index, u32 sw_if_index, abf_itf_attach_t *aia)
 
static void abf_itf_attach_db_del (u32 abf_index, u32 sw_if_index)
 
static void abf_itf_attach_stack (abf_itf_attach_t *aia)
 
static int abf_cmp_attach_for_sort (void *v1, void *v2)
 
void abf_setup_acl_lc (fib_protocol_t fproto, u32 sw_if_index)
 
int abf_itf_attach (fib_protocol_t fproto, u32 policy_id, u32 priority, u32 sw_if_index)
 
int abf_itf_detach (fib_protocol_t fproto, u32 policy_id, u32 sw_if_index)
 
static u8format_abf_intf_attach (u8 *s, va_list *args)
 
static clib_error_tabf_itf_attach_cmd (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tabf_show_attach_cmd (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
void abf_itf_attach_walk (abf_itf_attach_walk_cb_t cb, void *ctx)
 
static uword abf_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, fib_protocol_t fproto)
 
static uword abf_input_ip4 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword abf_input_ip6 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static u8format_abf_input_trace (u8 *s, va_list *args)
 
 VNET_FEATURE_INIT (abf_ip4_feat, static)
 
 VNET_FEATURE_INIT (abf_ip6_feat, static)
 
static fib_node_tabf_itf_attach_get_node (fib_node_index_t index)
 
static abf_itf_attach_tabf_itf_attach_get_from_node (fib_node_t *node)
 
static void abf_itf_attach_last_lock_gone (fib_node_t *node)
 
static fib_node_back_walk_rc_t abf_itf_attach_back_walk_notify (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 
static clib_error_tabf_itf_bond_init (vlib_main_t *vm)
 

Variables

vlib_node_registration_t abf_ip4_node
 Forward declarations;. More...
 
vlib_node_registration_t abf_ip6_node
 (constructor) VLIB_REGISTER_NODE (abf_ip6_node) More...
 
static fib_node_type_t abf_itf_attach_fib_node_type
 FIB node registered type for the bonds. More...
 
abf_itf_attach_tabf_itf_attach_pool
 Pool of ABF interface attachment objects. More...
 
static u32 ** abf_per_itf [FIB_PROTOCOL_MAX]
 A per interface vector of attached policies. More...
 
static u32abf_alctx_per_itf [FIB_PROTOCOL_MAX]
 Per interface values of ACL lookup context IDs. More...
 
static u32 abf_acl_user_id
 ABF ACL module user id returned during the initialization. More...
 
static acl_plugin_methods_t acl_plugin
 
static uwordabf_itf_attach_db
 A DB of attachments; key={abf_index,sw_if_index}. More...
 
static vlib_cli_command_t abf_itf_attach_cmd_node
 Attach an ABF policy to an interface. More...
 
static vlib_cli_command_t abf_show_attach_cmd_node
 (constructor) VLIB_CLI_COMMAND (abf_show_attach_cmd_node) More...
 
static char * abf_error_strings []
 
static const fib_node_vft_t abf_itf_attach_vft
 

Macro Definition Documentation

◆ abf_error [1/2]

#define abf_error (   n,
 
)    ABF_ERROR_##n,

Definition at line 497 of file abf_itf_attach.c.

◆ abf_error [2/2]

#define abf_error (   n,
 
)    s,

Definition at line 497 of file abf_itf_attach.c.

Typedef Documentation

◆ abf_input_trace_t

◆ abf_next_t

typedef enum abf_next_t_ abf_next_t

Enumeration Type Documentation

◆ abf_error_t

Enumerator
abf_error 
abf_error 

Definition at line 495 of file abf_itf_attach.c.

◆ abf_next_t_

Enumerator
ABF_NEXT_DROP 
ABF_N_NEXT 

Definition at line 483 of file abf_itf_attach.c.

Function Documentation

◆ abf_cmp_attach_for_sort()

static int abf_cmp_attach_for_sort ( void *  v1,
void *  v2 
)
static

Definition at line 134 of file abf_itf_attach.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abf_input_inline()

static uword abf_input_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
fib_protocol_t  fproto 
)
inlinestatic

Definition at line 504 of file abf_itf_attach.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abf_input_ip4()

static uword abf_input_ip4 ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 629 of file abf_itf_attach.c.

+ Here is the call graph for this function:

◆ abf_input_ip6()

static uword abf_input_ip6 ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 636 of file abf_itf_attach.c.

+ Here is the call graph for this function:

◆ abf_itf_attach()

int abf_itf_attach ( fib_protocol_t  fproto,
u32  policy_id,
u32  priority,
u32  sw_if_index 
)

Definition at line 166 of file abf_itf_attach.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abf_itf_attach_back_walk_notify()

static fib_node_back_walk_rc_t abf_itf_attach_back_walk_notify ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Definition at line 737 of file abf_itf_attach.c.

+ Here is the call graph for this function:

◆ abf_itf_attach_cmd()

static clib_error_t* abf_itf_attach_cmd ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 342 of file abf_itf_attach.c.

+ Here is the call graph for this function:

◆ abf_itf_attach_db_add()

static void abf_itf_attach_db_add ( u32  abf_index,
u32  sw_if_index,
abf_itf_attach_t aia 
)
static

Definition at line 90 of file abf_itf_attach.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abf_itf_attach_db_del()

static void abf_itf_attach_db_del ( u32  abf_index,
u32  sw_if_index 
)
static

Definition at line 100 of file abf_itf_attach.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abf_itf_attach_db_find()

static abf_itf_attach_t* abf_itf_attach_db_find ( u32  abf_index,
u32  sw_if_index 
)
static

Definition at line 74 of file abf_itf_attach.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abf_itf_attach_get_from_node()

static abf_itf_attach_t* abf_itf_attach_get_from_node ( fib_node_t node)
static

Definition at line 715 of file abf_itf_attach.c.

+ Here is the caller graph for this function:

◆ abf_itf_attach_get_node()

static fib_node_t* abf_itf_attach_get_node ( fib_node_index_t  index)
static

Definition at line 708 of file abf_itf_attach.c.

+ Here is the call graph for this function:

◆ abf_itf_attach_last_lock_gone()

static void abf_itf_attach_last_lock_gone ( fib_node_t node)
static

Definition at line 723 of file abf_itf_attach.c.

◆ abf_itf_attach_mk_key()

static u64 abf_itf_attach_mk_key ( u32  abf_index,
u32  sw_if_index 
)
static

Definition at line 62 of file abf_itf_attach.c.

+ Here is the caller graph for this function:

◆ abf_itf_attach_stack()

static void abf_itf_attach_stack ( abf_itf_attach_t aia)
static

Definition at line 110 of file abf_itf_attach.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abf_itf_attach_walk()

void abf_itf_attach_walk ( abf_itf_attach_walk_cb_t  cb,
void *  ctx 
)

Definition at line 470 of file abf_itf_attach.c.

+ Here is the caller graph for this function:

◆ abf_itf_bond_init()

static clib_error_t* abf_itf_bond_init ( vlib_main_t vm)
static

Definition at line 760 of file abf_itf_attach.c.

+ Here is the call graph for this function:

◆ abf_itf_detach()

int abf_itf_detach ( fib_protocol_t  fproto,
u32  policy_id,
u32  sw_if_index 
)

Definition at line 250 of file abf_itf_attach.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abf_setup_acl_lc()

void abf_setup_acl_lc ( fib_protocol_t  fproto,
u32  sw_if_index 
)

Definition at line 146 of file abf_itf_attach.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abf_show_attach_cmd()

static clib_error_t* abf_show_attach_cmd ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 415 of file abf_itf_attach.c.

+ Here is the call graph for this function:

◆ format_abf_input_trace()

static u8* format_abf_input_trace ( u8 s,
va_list *  args 
)
static

Definition at line 643 of file abf_itf_attach.c.

+ Here is the call graph for this function:

◆ format_abf_intf_attach()

static u8* format_abf_intf_attach ( u8 s,
va_list *  args 
)
static

Definition at line 328 of file abf_itf_attach.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VNET_FEATURE_INIT() [1/2]

VNET_FEATURE_INIT ( abf_ip4_feat  ,
static   
)

◆ VNET_FEATURE_INIT() [2/2]

VNET_FEATURE_INIT ( abf_ip6_feat  ,
static   
)

Variable Documentation

◆ abf_acl_user_id

u32 abf_acl_user_id
static

ABF ACL module user id returned during the initialization.

Definition at line 49 of file abf_itf_attach.c.

◆ abf_alctx_per_itf

u32* abf_alctx_per_itf[FIB_PROTOCOL_MAX]
static

Per interface values of ACL lookup context IDs.

used in the data-plane

Definition at line 44 of file abf_itf_attach.c.

◆ abf_error_strings

char* abf_error_strings[]
static
Initial value:
= {
#define abf_error(n,s)
abf_error (NONE, "no match")
abf_error (MATCHED, "matched")
abf_error (MISSED, "missed")
}
#define abf_error(n, s)

Definition at line 653 of file abf_itf_attach.c.

◆ abf_ip4_node

Initial value:
=
{
.function = abf_input_ip4,
.name = "abf-input-ip4",
.vector_size = sizeof (u32),
.format_trace = format_abf_input_trace,
.n_errors = ABF_N_ERROR,
.error_strings = abf_error_strings,
.n_next_nodes = ABF_N_NEXT,
.next_nodes =
{
[ABF_NEXT_DROP] = "error-drop",
}
}
static char * abf_error_strings[]
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static u8 * format_abf_input_trace(u8 *s, va_list *args)
static uword abf_input_ip4(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)

Forward declarations;.

(constructor) VLIB_REGISTER_NODE (abf_ip4_node)

Definition at line 660 of file abf_itf_attach.c.

◆ abf_ip6_node

Initial value:
=
{
.function = abf_input_ip6,
.name = "abf-input-ip6",
.vector_size = sizeof (u32),
.format_trace = format_abf_input_trace,
.n_errors = 0,
.n_next_nodes = ABF_N_NEXT,
.next_nodes =
{
[ABF_NEXT_DROP] = "error-drop",
}
}
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static u8 * format_abf_input_trace(u8 *s, va_list *args)
static uword abf_input_ip6(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)

(constructor) VLIB_REGISTER_NODE (abf_ip6_node)

Definition at line 676 of file abf_itf_attach.c.

◆ abf_itf_attach_cmd_node

vlib_cli_command_t abf_itf_attach_cmd_node
static
Initial value:
= {
.path = "abf attach",
.function = abf_itf_attach_cmd,
.short_help = "abf attach <ip4|ip6> [del] policy <value> <interface>",
}
static clib_error_t * abf_itf_attach_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

Attach an ABF policy to an interface.

(constructor) VLIB_CLI_COMMAND (abf_itf_attach_cmd_node)

Definition at line 406 of file abf_itf_attach.c.

◆ abf_itf_attach_db

uword* abf_itf_attach_db
static

A DB of attachments; key={abf_index,sw_if_index}.

Definition at line 59 of file abf_itf_attach.c.

◆ abf_itf_attach_fib_node_type

fib_node_type_t abf_itf_attach_fib_node_type
static

FIB node registered type for the bonds.

Definition at line 29 of file abf_itf_attach.c.

◆ abf_itf_attach_pool

abf_itf_attach_t* abf_itf_attach_pool

Pool of ABF interface attachment objects.

Definition at line 34 of file abf_itf_attach.c.

◆ abf_itf_attach_vft

const fib_node_vft_t abf_itf_attach_vft
static
Initial value:
= {
}
static fib_node_back_walk_rc_t abf_itf_attach_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
static fib_node_t * abf_itf_attach_get_node(fib_node_index_t index)
static void abf_itf_attach_last_lock_gone(fib_node_t *node)

Definition at line 753 of file abf_itf_attach.c.

◆ abf_per_itf

u32** abf_per_itf[FIB_PROTOCOL_MAX]
static

A per interface vector of attached policies.

used in the data-plane

Definition at line 39 of file abf_itf_attach.c.

◆ abf_show_attach_cmd_node

vlib_cli_command_t abf_show_attach_cmd_node
static
Initial value:
= {
.path = "show abf attach",
.function = abf_show_attach_cmd,
.short_help = "show abf attach <interface>",
.is_mp_safe = 1,
}
static clib_error_t * abf_show_attach_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (abf_show_attach_cmd_node)

Definition at line 461 of file abf_itf_attach.c.

◆ acl_plugin

acl_plugin_methods_t acl_plugin
static

Definition at line 54 of file abf_itf_attach.c.