FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
gbp_endpoint.h File Reference
+ Include dependency graph for gbp_endpoint.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gbp_endpoint_key_t_
 This is the identity of an endpoint, as such it is information about an endpoint that is idempotent. More...
 
struct  gbp_endpoint_loc_t_
 Information about the location of the endpoint provided by a source of endpoints. More...
 
struct  gbp_endpoint_fwd_t_
 And endpoints current forwarding state. More...
 
struct  gbp_endpoint_t_
 A Group Based Policy Endpoint. More...
 
struct  gbp_ep_by_ip_itf_db_t_
 GBP Endpoint Databases. More...
 

Macros

#define GBP_ENDPOINT_ATTR_NAMES
 
#define foreach_gbp_endpoint_src
 Sources of Endpoints in priority order. More...
 
#define GBP_ENDPOINT_SRC_MAX   (GBP_ENDPOINT_SRC_RR+1)
 

Typedefs

typedef enum gbp_endpoint_attr_t_ gbp_endpoint_attr_t
 Flags for each endpoint. More...
 
typedef enum gbp_endpoint_flags_t_ gbp_endpoint_flags_t
 
typedef enum gbp_endpoint_src_t_ gbp_endpoint_src_t
 
typedef struct gbp_endpoint_key_t_ gbp_endpoint_key_t
 This is the identity of an endpoint, as such it is information about an endpoint that is idempotent. More...
 
typedef struct gbp_endpoint_loc_t_ gbp_endpoint_loc_t
 Information about the location of the endpoint provided by a source of endpoints. More...
 
typedef struct gbp_endpoint_fwd_t_ gbp_endpoint_fwd_t
 And endpoints current forwarding state. More...
 
typedef struct gbp_endpoint_t_ gbp_endpoint_t
 A Group Based Policy Endpoint. More...
 
typedef struct gbp_ep_by_ip_itf_db_t_ gbp_ep_db_t
 GBP Endpoint Databases. More...
 
typedef walk_rc_t(* gbp_endpoint_cb_t) (index_t gbpei, void *ctx)
 

Enumerations

enum  gbp_endpoint_attr_t_ {
  GBP_ENDPOINT_ATTR_FIRST = 0, GBP_ENDPOINT_ATTR_BOUNCE = GBP_ENDPOINT_ATTR_FIRST, GBP_ENDPOINT_ATTR_REMOTE, GBP_ENDPOINT_ATTR_LEARNT,
  GBP_ENDPOINT_ATTR_EXTERNAL, GBP_ENDPOINT_ATTR_LAST
}
 Flags for each endpoint. More...
 
enum  gbp_endpoint_flags_t_ {
  GBP_ENDPOINT_FLAG_NONE = 0, GBP_ENDPOINT_FLAG_BOUNCE = (1 << GBP_ENDPOINT_ATTR_BOUNCE), GBP_ENDPOINT_FLAG_REMOTE = (1 << GBP_ENDPOINT_ATTR_REMOTE), GBP_ENDPOINT_FLAG_LEARNT = (1 << GBP_ENDPOINT_ATTR_LEARNT),
  GBP_ENDPOINT_FLAG_EXTERNAL = (1 << GBP_ENDPOINT_ATTR_EXTERNAL)
}
 
enum  gbp_endpoint_src_t_ { foreach_gbp_endpoint_src }
 

Functions

u8format_gbp_endpoint_flags (u8 *s, va_list *args)
 
u8format_gbp_endpoint_src (u8 *s, va_list *args)
 
u8format_gbp_endpoint (u8 *s, va_list *args)
 
int gbp_endpoint_update_and_lock (gbp_endpoint_src_t src, u32 sw_if_index, const ip46_address_t *ip, const mac_address_t *mac, index_t gbd, index_t grd, sclass_t sclass, gbp_endpoint_flags_t flags, const ip46_address_t *tun_src, const ip46_address_t *tun_dst, u32 *handle)
 
void gbp_endpoint_unlock (gbp_endpoint_src_t src, index_t gbpei)
 
u32 gbp_endpoint_child_add (index_t gei, fib_node_type_t type, fib_node_index_t index)
 
void gbp_endpoint_child_remove (index_t gei, u32 sibling)
 
void gbp_endpoint_walk (gbp_endpoint_cb_t cb, void *ctx)
 
void gbp_endpoint_scan (vlib_main_t *vm)
 
int gbp_endpoint_is_remote (const gbp_endpoint_t *ge)
 
int gbp_endpoint_is_local (const gbp_endpoint_t *ge)
 
int gbp_endpoint_is_external (const gbp_endpoint_t *ge)
 
int gbp_endpoint_is_learnt (const gbp_endpoint_t *ge)
 
void gbp_endpoint_flush (gbp_endpoint_src_t src, u32 sw_if_index)
 remove all learnt endpoints using the interface More...
 
static gbp_endpoint_tgbp_endpoint_get (index_t gbpei)
 Get the endpoint from a port/interface. More...
 
static_always_inline void gbp_endpoint_mk_key_mac (const u8 *mac, u32 bd_index, clib_bihash_kv_16_8_t *key)
 
static_always_inline gbp_endpoint_tgbp_endpoint_find_mac (const u8 *mac, u32 bd_index)
 
static_always_inline void gbp_endpoint_mk_key_ip (const ip46_address_t *ip, u32 fib_index, clib_bihash_kv_24_8_t *key)
 
static_always_inline void gbp_endpoint_mk_key_ip4 (const ip4_address_t *ip, u32 fib_index, clib_bihash_kv_24_8_t *key)
 
static_always_inline gbp_endpoint_tgbp_endpoint_find_ip4 (const ip4_address_t *ip, u32 fib_index)
 
static_always_inline void gbp_endpoint_mk_key_ip6 (const ip6_address_t *ip, u32 fib_index, clib_bihash_kv_24_8_t *key)
 
static_always_inline gbp_endpoint_tgbp_endpoint_find_ip6 (const ip6_address_t *ip, u32 fib_index)
 
static_always_inline gbp_endpoint_tgbp_endpoint_find_itf (u32 sw_if_index)
 

Variables

gbp_ep_db_t gbp_ep_db
 DP functions and databases. More...
 
gbp_endpoint_tgbp_endpoint_pool
 Pool of GBP endpoints. More...
 

Macro Definition Documentation

◆ foreach_gbp_endpoint_src

#define foreach_gbp_endpoint_src
Value:
_(DP, "data-plane") \
_(CP, "control-plane") \
_(RR, "recursive-resolution")

Sources of Endpoints in priority order.

The best (lowest value) source provides the forwarding information. Data-plane takes preference because the CP data is not always complete, it may not have the sclass.

Definition at line 66 of file gbp_endpoint.h.

◆ GBP_ENDPOINT_ATTR_NAMES

#define GBP_ENDPOINT_ATTR_NAMES

◆ GBP_ENDPOINT_SRC_MAX

#define GBP_ENDPOINT_SRC_MAX   (GBP_ENDPOINT_SRC_RR+1)

Definition at line 78 of file gbp_endpoint.h.

Typedef Documentation

◆ gbp_endpoint_attr_t

Flags for each endpoint.

◆ gbp_endpoint_cb_t

typedef walk_rc_t(* gbp_endpoint_cb_t) (index_t gbpei, void *ctx)

Definition at line 244 of file gbp_endpoint.h.

◆ gbp_endpoint_flags_t

◆ gbp_endpoint_fwd_t

And endpoints current forwarding state.

◆ gbp_endpoint_key_t

This is the identity of an endpoint, as such it is information about an endpoint that is idempotent.

The ID is used to add the EP into the various data-bases for retrieval.

◆ gbp_endpoint_loc_t

Information about the location of the endpoint provided by a source of endpoints.

◆ gbp_endpoint_src_t

◆ gbp_endpoint_t

A Group Based Policy Endpoint.

This is typically a VM or container. If the endpoint is local (i.e. on the same compute node as VPP) then there is one interface per-endpoint. If the EP is remote,e.g. reachable over a [vxlan] tunnel, then there will be multiple EPs reachable over the tunnel and they can be distinguished via either their MAC or IP Address[es].

◆ gbp_ep_db_t

GBP Endpoint Databases.

Enumeration Type Documentation

◆ gbp_endpoint_attr_t_

Flags for each endpoint.

Enumerator
GBP_ENDPOINT_ATTR_FIRST 
GBP_ENDPOINT_ATTR_BOUNCE 
GBP_ENDPOINT_ATTR_REMOTE 
GBP_ENDPOINT_ATTR_LEARNT 
GBP_ENDPOINT_ATTR_EXTERNAL 
GBP_ENDPOINT_ATTR_LAST 

Definition at line 32 of file gbp_endpoint.h.

◆ gbp_endpoint_flags_t_

Enumerator
GBP_ENDPOINT_FLAG_NONE 
GBP_ENDPOINT_FLAG_BOUNCE 
GBP_ENDPOINT_FLAG_REMOTE 
GBP_ENDPOINT_FLAG_LEARNT 
GBP_ENDPOINT_FLAG_EXTERNAL 

Definition at line 42 of file gbp_endpoint.h.

◆ gbp_endpoint_src_t_

Enumerator
foreach_gbp_endpoint_src 

Definition at line 71 of file gbp_endpoint.h.

Function Documentation

◆ format_gbp_endpoint()

u8* format_gbp_endpoint ( u8 s,
va_list *  args 
)

Definition at line 1230 of file gbp_endpoint.c.

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

◆ format_gbp_endpoint_flags()

u8* format_gbp_endpoint_flags ( u8 s,
va_list *  args 
)

Definition at line 70 of file gbp_endpoint.c.

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

◆ format_gbp_endpoint_src()

u8* format_gbp_endpoint_src ( u8 s,
va_list *  args 
)

Definition at line 1155 of file gbp_endpoint.c.

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

◆ gbp_endpoint_child_add()

u32 gbp_endpoint_child_add ( index_t  gei,
fib_node_type_t  type,
fib_node_index_t  index 
)

Definition at line 990 of file gbp_endpoint.c.

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

◆ gbp_endpoint_child_remove()

void gbp_endpoint_child_remove ( index_t  gei,
u32  sibling 
)

Definition at line 997 of file gbp_endpoint.c.

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

◆ gbp_endpoint_find_ip4()

static_always_inline gbp_endpoint_t* gbp_endpoint_find_ip4 ( const ip4_address_t ip,
u32  fib_index 
)

Definition at line 314 of file gbp_endpoint.h.

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

◆ gbp_endpoint_find_ip6()

static_always_inline gbp_endpoint_t* gbp_endpoint_find_ip6 ( const ip6_address_t ip,
u32  fib_index 
)

Definition at line 339 of file gbp_endpoint.h.

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

◆ gbp_endpoint_find_itf()

static_always_inline gbp_endpoint_t* gbp_endpoint_find_itf ( u32  sw_if_index)

Definition at line 355 of file gbp_endpoint.h.

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

◆ gbp_endpoint_find_mac()

static_always_inline gbp_endpoint_t* gbp_endpoint_find_mac ( const u8 mac,
u32  bd_index 
)

Definition at line 279 of file gbp_endpoint.h.

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

◆ gbp_endpoint_flush()

void gbp_endpoint_flush ( gbp_endpoint_src_t  src,
u32  sw_if_index 
)

remove all learnt endpoints using the interface

Definition at line 1031 of file gbp_endpoint.c.

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

◆ gbp_endpoint_get()

static gbp_endpoint_t* gbp_endpoint_get ( index_t  gbpei)
inlinestatic

Get the endpoint from a port/interface.

Definition at line 265 of file gbp_endpoint.h.

+ Here is the caller graph for this function:

◆ gbp_endpoint_is_external()

int gbp_endpoint_is_external ( const gbp_endpoint_t ge)

Definition at line 99 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

◆ gbp_endpoint_is_learnt()

int gbp_endpoint_is_learnt ( const gbp_endpoint_t ge)

Definition at line 105 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

◆ gbp_endpoint_is_local()

int gbp_endpoint_is_local ( const gbp_endpoint_t ge)

Definition at line 93 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

◆ gbp_endpoint_is_remote()

int gbp_endpoint_is_remote ( const gbp_endpoint_t ge)

Definition at line 87 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

◆ gbp_endpoint_mk_key_ip()

static_always_inline void gbp_endpoint_mk_key_ip ( const ip46_address_t *  ip,
u32  fib_index,
clib_bihash_kv_24_8_t key 
)

Definition at line 295 of file gbp_endpoint.h.

+ Here is the caller graph for this function:

◆ gbp_endpoint_mk_key_ip4()

static_always_inline void gbp_endpoint_mk_key_ip4 ( const ip4_address_t ip,
u32  fib_index,
clib_bihash_kv_24_8_t key 
)

Definition at line 304 of file gbp_endpoint.h.

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

◆ gbp_endpoint_mk_key_ip6()

static_always_inline void gbp_endpoint_mk_key_ip6 ( const ip6_address_t ip,
u32  fib_index,
clib_bihash_kv_24_8_t key 
)

Definition at line 330 of file gbp_endpoint.h.

+ Here is the caller graph for this function:

◆ gbp_endpoint_mk_key_mac()

static_always_inline void gbp_endpoint_mk_key_mac ( const u8 mac,
u32  bd_index,
clib_bihash_kv_16_8_t key 
)

Definition at line 271 of file gbp_endpoint.h.

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

◆ gbp_endpoint_scan()

void gbp_endpoint_scan ( vlib_main_t vm)

Definition at line 1485 of file gbp_endpoint.c.

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

◆ gbp_endpoint_unlock()

void gbp_endpoint_unlock ( gbp_endpoint_src_t  src,
index_t  gbpei 
)

Definition at line 909 of file gbp_endpoint.c.

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

◆ gbp_endpoint_update_and_lock()

int gbp_endpoint_update_and_lock ( gbp_endpoint_src_t  src,
u32  sw_if_index,
const ip46_address_t *  ip,
const mac_address_t mac,
index_t  gbd,
index_t  grd,
sclass_t  sclass,
gbp_endpoint_flags_t  flags,
const ip46_address_t *  tun_src,
const ip46_address_t *  tun_dst,
u32 handle 
)

Definition at line 813 of file gbp_endpoint.c.

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

◆ gbp_endpoint_walk()

void gbp_endpoint_walk ( gbp_endpoint_cb_t  cb,
void *  ctx 
)

Definition at line 1054 of file gbp_endpoint.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ gbp_endpoint_pool

gbp_endpoint_t* gbp_endpoint_pool

Pool of GBP endpoints.

Definition at line 57 of file gbp_endpoint.c.

◆ gbp_ep_db

gbp_ep_db_t gbp_ep_db

DP functions and databases.

DP functions and databases.

Definition at line 41 of file gbp_endpoint.c.