FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
gbp.c File Reference
+ Include dependency graph for gbp.c:

Go to the source code of this file.

Data Structures

struct  gbp_ip4_to_epg_db_t_
 IP4 destintion address to destination EPG mapping table. More...
 
struct  gbp_ip6_to_epg_db_t_
 IP6 destintion address to destination EPG mapping table. More...
 
struct  gbp_itf_t_
 Result of a interface to EPG mapping. More...
 
struct  gbp_itf_to_epg_db_t_
 Interface to source EPG DB - a per-interface vector. More...
 
struct  gbp_contract_db_t_
 EPG src,dst pair to ACL mapping table, aka contract DB. More...
 
struct  gbp_trace_t_
 per-packet trace data More...
 

Macros

#define foreach_gbp   _(DENY, "deny")
 

Typedefs

typedef struct gbp_ip4_to_epg_db_t_ gbp_ip4_to_epg_db_t
 IP4 destintion address to destination EPG mapping table. More...
 
typedef struct gbp_ip6_to_epg_db_t_ gbp_ip6_to_epg_db_t
 IP6 destintion address to destination EPG mapping table. More...
 
typedef struct gbp_itf_t_ gbp_itf_t
 Result of a interface to EPG mapping. More...
 
typedef struct gbp_itf_to_epg_db_t_ gbp_itf_to_epg_db_t
 Interface to source EPG DB - a per-interface vector. More...
 
typedef struct gbp_contract_db_t_ gbp_contract_db_t
 EPG src,dst pair to ACL mapping table, aka contract DB. More...
 
typedef struct gbp_trace_t_ gbp_trace_t
 per-packet trace data More...
 

Enumerations

enum  gbp_error_t { GBP_N_ERROR }
 
enum  gbp_next_t { GBP_N_NEXT }
 

Functions

static void gbp_ip_epg_update (const ip46_address_t *ip, epg_id_t epg_id)
 
static void gbp_ip_epg_delete (const ip46_address_t *ip)
 
static void gbp_itf_epg_update (u32 sw_if_index, epg_id_t src_epg)
 
static void gbp_itf_epg_delete (u32 sw_if_index)
 
void gbp_endpoint_update (u32 sw_if_index, const ip46_address_t *ip, epg_id_t epg_id)
 
void gbp_endpoint_delete (u32 sw_if_index, const ip46_address_t *ip)
 
void gbp_endpoint_walk (gbp_endpoint_cb_t cb, void *ctx)
 
void gbp_contract_update (epg_id_t src_epg, epg_id_t dst_epg, u32 acl_index)
 
void gbp_contract_delete (epg_id_t src_epg, epg_id_t dst_epg)
 
void gbp_contract_walk (gbp_contract_cb_t cb, void *ctx)
 
static clib_error_tgbp_endpoint_cli (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tgbp_contract_cli (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static int gbp_endpoint_show_one (gbp_endpoint_t *gbpe, void *ctx)
 
static clib_error_tgbp_endpoint_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tgbp_contract_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static uword gbp_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip6)
 
static u8format_gbp_trace (u8 *s, va_list *args)
 
static uword gbp_4 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword gbp_6 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (gbp_4_node, gbp_4)
 
 VNET_FEATURE_INIT (gbp_4_node, static)
 
 VLIB_NODE_FUNCTION_MULTIARCH (gbp_6_node, gbp_6)
 
 VNET_FEATURE_INIT (gbp_6_node, static)
 
static clib_error_tgbp_init (vlib_main_t *vm)
 

Variables

static gbp_ip4_to_epg_db_t gbp_ip4_to_epg_db
 
static gbp_ip6_to_epg_db_t gbp_ip6_to_epg_db
 
static const gbp_itf_t ITF_INVALID
 
static gbp_itf_to_epg_db_t gbp_itf_to_epg_db
 
static gbp_endpoint_tgbp_endpoint_pool
 Pool of GBP endpoints. More...
 
static uwordgbp_endpoint_db
 DB of endpoints. More...
 
static gbp_contract_db_t gbp_contract_db
 Since contract DB instance. More...
 
static vlib_cli_command_t gbp_endpoint_cli_node
 (constructor) VLIB_CLI_COMMAND (gbp_endpoint_cli_node) More...
 
static vlib_cli_command_t gbp_contract_cli_node
 (constructor) VLIB_CLI_COMMAND (gbp_contract_cli_node) More...
 
static vlib_cli_command_t gbp_endpoint_show_node
 (constructor) VLIB_CLI_COMMAND (gbp_endpoint_show_node) More...
 
static vlib_cli_command_t gbp_contract_show_node
 (constructor) VLIB_CLI_COMMAND (gbp_contract_show_node) More...
 
static char * gbp_error_strings []
 
vlib_node_registration_t gbp_4_node
 (constructor) VLIB_REGISTER_NODE (gbp_4_node) More...
 
vlib_node_registration_t gbp_6_node
 (constructor) VLIB_REGISTER_NODE (gbp_6_node) More...
 

Macro Definition Documentation

#define foreach_gbp   _(DENY, "deny")

Definition at line 505 of file gbp.c.

Typedef Documentation

EPG src,dst pair to ACL mapping table, aka contract DB.

IP4 destintion address to destination EPG mapping table.

IP6 destintion address to destination EPG mapping table.

typedef struct gbp_itf_t_ gbp_itf_t

Result of a interface to EPG mapping.

multiple Endpoints can occur on the same interface, so this mapping needs to be reference counted.

Interface to source EPG DB - a per-interface vector.

typedef struct gbp_trace_t_ gbp_trace_t

per-packet trace data

Enumeration Type Documentation

Enumerator
GBP_N_ERROR 

Definition at line 508 of file gbp.c.

enum gbp_next_t
Enumerator
GBP_N_NEXT 

Definition at line 522 of file gbp.c.

Function Documentation

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

Definition at line 687 of file gbp.c.

+ Here is the call graph for this function:

static uword gbp_4 ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
inlinestatic

Definition at line 700 of file gbp.c.

+ Here is the call graph for this function:

static uword gbp_6 ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
inlinestatic

Definition at line 706 of file gbp.c.

+ Here is the call graph for this function:

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

Definition at line 324 of file gbp.c.

+ Here is the call graph for this function:

void gbp_contract_delete ( epg_id_t  src_epg,
epg_id_t  dst_epg 
)

Definition at line 249 of file gbp.c.

+ Here is the caller graph for this function:

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

Definition at line 456 of file gbp.c.

+ Here is the call graph for this function:

void gbp_contract_update ( epg_id_t  src_epg,
epg_id_t  dst_epg,
u32  acl_index 
)

Definition at line 238 of file gbp.c.

+ Here is the caller graph for this function:

void gbp_contract_walk ( gbp_contract_cb_t  cb,
void *  ctx 
)

Definition at line 260 of file gbp.c.

+ Here is the caller graph for this function:

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

Definition at line 280 of file gbp.c.

+ Here is the call graph for this function:

void gbp_endpoint_delete ( u32  sw_if_index,
const ip46_address_t *  ip 
)

Definition at line 197 of file gbp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 409 of file gbp.c.

+ Here is the call graph for this function:

static int gbp_endpoint_show_one ( gbp_endpoint_t gbpe,
void *  ctx 
)
static

Definition at line 393 of file gbp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gbp_endpoint_update ( u32  sw_if_index,
const ip46_address_t *  ip,
epg_id_t  epg_id 
)

Definition at line 164 of file gbp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gbp_endpoint_walk ( gbp_endpoint_cb_t  cb,
void *  ctx 
)

Definition at line 224 of file gbp.c.

+ Here is the caller graph for this function:

static clib_error_t* gbp_init ( vlib_main_t vm)
static

Definition at line 764 of file gbp.c.

static uword gbp_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ip6 
)
inlinestatic

Definition at line 542 of file gbp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbp_ip_epg_delete ( const ip46_address_t *  ip)
static

Definition at line 116 of file gbp.c.

+ Here is the caller graph for this function:

static void gbp_ip_epg_update ( const ip46_address_t *  ip,
epg_id_t  epg_id 
)
static

Definition at line 99 of file gbp.c.

+ Here is the caller graph for this function:

static void gbp_itf_epg_delete ( u32  sw_if_index)
static

Definition at line 146 of file gbp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gbp_itf_epg_update ( u32  sw_if_index,
epg_id_t  src_epg 
)
static

Definition at line 129 of file gbp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( gbp_4_node  ,
gbp_4   
)
VLIB_NODE_FUNCTION_MULTIARCH ( gbp_6_node  ,
gbp_6   
)
VNET_FEATURE_INIT ( gbp_4_node  ,
static   
)
VNET_FEATURE_INIT ( gbp_6_node  ,
static   
)

Variable Documentation

Initial value:
= {
.function = gbp_4,
.name = "gbp4",
.vector_size = sizeof (u32),
.format_trace = format_gbp_trace,
.error_strings = gbp_error_strings,
.n_next_nodes = GBP_N_NEXT,
.next_nodes = {
[GBP_NEXT_DENY] = "ip4-drop",
},
}
static char * gbp_error_strings[]
Definition: gbp.c:516
static u8 * format_gbp_trace(u8 *s, va_list *args)
Definition: gbp.c:687
static uword gbp_4(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: gbp.c:700
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (gbp_4_node)

Definition at line 712 of file gbp.c.

Initial value:
= {
.function = gbp_6,
.name = "gbp6",
.vector_size = sizeof (u32),
.format_trace = format_gbp_trace,
.error_strings = gbp_error_strings,
.n_next_nodes = GBP_N_NEXT,
.next_nodes = {
[GBP_NEXT_DENY] = "ip6-drop",
},
}
static char * gbp_error_strings[]
Definition: gbp.c:516
static uword gbp_6(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: gbp.c:706
static u8 * format_gbp_trace(u8 *s, va_list *args)
Definition: gbp.c:687
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (gbp_6_node)

Definition at line 737 of file gbp.c.

vlib_cli_command_t gbp_contract_cli_node
static
Initial value:
= {
.path = "gbp contract",
.short_help = "gbp contract [del] src-epg <ID> dst-epg <ID> acl-index <ACL>",
.function = gbp_contract_cli,
}
static clib_error_t * gbp_contract_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gbp.c:324

(constructor) VLIB_CLI_COMMAND (gbp_contract_cli_node)

Definition at line 385 of file gbp.c.

gbp_contract_db_t gbp_contract_db
static

Since contract DB instance.

Definition at line 96 of file gbp.c.

vlib_cli_command_t gbp_contract_show_node
static
Initial value:
= {
.path = "show gbp contract",
.short_help = "show gbp contract\n",
.function = gbp_contract_show,
}
static clib_error_t * gbp_contract_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gbp.c:456

(constructor) VLIB_CLI_COMMAND (gbp_contract_show_node)

Definition at line 498 of file gbp.c.

vlib_cli_command_t gbp_endpoint_cli_node
static
Initial value:
= {
.path = "gbp endpoint",
.short_help = "gbp endpoint [del] <interface> epg <ID> ip <IP>",
.function = gbp_endpoint_cli,
}
static clib_error_t * gbp_endpoint_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gbp.c:280

(constructor) VLIB_CLI_COMMAND (gbp_endpoint_cli_node)

Definition at line 372 of file gbp.c.

uword* gbp_endpoint_db
static

DB of endpoints.

Definition at line 80 of file gbp.c.

gbp_endpoint_t* gbp_endpoint_pool
static

Pool of GBP endpoints.

Definition at line 75 of file gbp.c.

vlib_cli_command_t gbp_endpoint_show_node
static
Initial value:
= {
.path = "show gbp endpoint",
.short_help = "show gbp endpoint\n",
.function = gbp_endpoint_show,
}
static clib_error_t * gbp_endpoint_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gbp.c:409

(constructor) VLIB_CLI_COMMAND (gbp_endpoint_show_node)

Definition at line 483 of file gbp.c.

char* gbp_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_gbp
Definition: gbp.c:505

Definition at line 516 of file gbp.c.

gbp_ip4_to_epg_db_t gbp_ip4_to_epg_db
static

Definition at line 31 of file gbp.c.

gbp_ip6_to_epg_db_t gbp_ip6_to_epg_db
static

Definition at line 44 of file gbp.c.

gbp_itf_to_epg_db_t gbp_itf_to_epg_db
static

Definition at line 70 of file gbp.c.

const gbp_itf_t ITF_INVALID
static
Initial value:
= {
.gi_epg = EPG_INVALID,
.gi_ref_count = 0,
}
#define EPG_INVALID
Definition: gbp.h:39

Definition at line 57 of file gbp.c.