16 #ifndef __GBP_ENDPOINT_H__ 17 #define __GBP_ENDPOINT_H__ 50 #define GBP_ENDPOINT_ATTR_NAMES { \ 51 [GBP_ENDPOINT_ATTR_BOUNCE] = "bounce", \ 52 [GBP_ENDPOINT_ATTR_REMOTE] = "remote", \ 53 [GBP_ENDPOINT_ATTR_LEARNT] = "learnt", \ 54 [GBP_ENDPOINT_ATTR_EXTERNAL] = "external", \ 63 #define foreach_gbp_endpoint_src \ 64 _(CP, "control-plane") \ 66 _(RR, "recursive-resolution") 70 #define _(v,s) GBP_ENDPOINT_SRC_##v, 75 #define GBP_ENDPOINT_SRC_MAX (GBP_ENDPOINT_SRC_RR+1) 227 const ip46_address_t * ip,
232 const ip46_address_t * tun_src,
233 const ip46_address_t * tun_dst,
272 key->
key[1] = bd_index;
283 rv = clib_bihash_search_16_8 (&gbp_ep_db.
ged_by_mac_bd, &key, &value);
295 key->
key[0] = ip->as_u64[0];
296 key->
key[1] = ip->as_u64[1];
297 key->
key[2] = fib_index;
304 const ip46_address_t
a = {
318 rv = clib_bihash_search_24_8 (&gbp_ep_db.
ged_by_ip_rd, &key, &value);
332 key->
key[2] = fib_index;
343 rv = clib_bihash_search_24_8 (&gbp_ep_db.
ged_by_ip_rd, &key, &value);
index_t gek_grd
Index of the Route-Domain.
u32 gef_fib_index
FIB index the EP is in.
static gbp_endpoint_t * gbp_endpoint_get(index_t gbpei)
Get the endpoint from a port/interface.
f64 ge_last_time
The last time a packet from seen from this end point.
index_t * ged_by_sw_if_index
A Group Based Policy Endpoint.
fib_prefix_t * gek_ips
A vector of ip addresses that belong to the endpoint.
Information about the location of the endpoint provided by a source of endpoints. ...
gbp_endpoint_fwd_t ge_fwd
gbp_endpoint_key_t ge_key
The key/ID of this EP.
index_t * gef_adjs
The L3 adj, if created.
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)
gbp_endpoint_flags_t gef_flags
index_t gef_itf
The interface on which the EP is connected.
enum gbp_endpoint_src_t_ gbp_endpoint_src_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
gbp_endpoint_src_t gel_src
The source providing this location information.
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...
static_always_inline gbp_endpoint_t * gbp_endpoint_find_ip4(const ip4_address_t *ip, u32 fib_index)
enum walk_rc_t_ walk_rc_t
Walk return code.
struct gbp_endpoint_fwd_t_ gbp_endpoint_fwd_t
And endpoints current forwarding state.
#define static_always_inline
gbp_endpoint_flags_t gel_flags
Endpoint flags.
gbp_endpoint_t * gbp_endpoint_pool
Pool of GBP endpoints.
gbp_endpoint_attr_t_
Flags for each endpoint.
void gbp_endpoint_scan(vlib_main_t *vm)
clib_bihash_24_8_t ged_by_ip_rd
u32 gel_sw_if_index
The interface on which the EP is connected.
static_always_inline gbp_endpoint_t * gbp_endpoint_find_mac(const u8 *mac, u32 bd_index)
Aggregrate type for a prefix.
static_always_inline void gbp_endpoint_mk_key_ip6(const ip6_address_t *ip, u32 fib_index, clib_bihash_kv_24_8_t *key)
index_t gek_gbd
Index of the Bridge-Domain.
u8 * format_gbp_endpoint_flags(u8 *s, va_list *args)
u8 * format_gbp_endpoint_src(u8 *s, va_list *args)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
clib_bihash_16_8_t ged_by_mac_bd
void gbp_endpoint_unlock(gbp_endpoint_src_t src, index_t gbpei)
An node in the FIB graph.
sclass_t gef_sclass
Endpoint Group's sclass.
mac_address_t gek_mac
MAC address of the endpoint.
u32 gel_parent_sw_if_index
static_always_inline gbp_endpoint_t * gbp_endpoint_find_ip6(const ip6_address_t *ip, u32 fib_index)
u8 * format_gbp_endpoint(u8 *s, va_list *args)
enum gbp_endpoint_attr_t_ gbp_endpoint_attr_t
Flags for each endpoint.
void gbp_endpoint_flush(gbp_endpoint_src_t src, u32 sw_if_index)
remove all learnt endpoints using the interface
u32 fib_node_index_t
A typedef of a node index.
int gbp_endpoint_is_learnt(const gbp_endpoint_t *ge)
static u64 ethernet_mac_address_u64(const u8 *a)
This is the identity of an endpoint, as such it is information about an endpoint that is idempotent...
u32 gbp_endpoint_child_add(index_t gei, fib_node_type_t type, fib_node_index_t index)
struct gbp_endpoint_t_ gbp_endpoint_t
A Group Based Policy Endpoint.
enum gbp_endpoint_flags_t_ gbp_endpoint_flags_t
gbp_ep_db_t gbp_ep_db
DP functions and databases.
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 void gbp_endpoint_mk_key_ip(const ip46_address_t *ip, u32 fib_index, clib_bihash_kv_24_8_t *key)
fib_node_t ge_node
A FIB node that allows the tracking of children.
u32 gel_locks
number of times this source has locked this
And endpoints current forwarding state.
void gbp_endpoint_walk(gbp_endpoint_cb_t cb, void *ctx)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
struct gbp_endpoint_loc_t_ gbp_endpoint_loc_t
Information about the location of the endpoint provided by a source of endpoints. ...
void gbp_endpoint_child_remove(index_t gei, u32 sibling)
vl_api_gbp_endpoint_tun_t tun
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
static_always_inline gbp_endpoint_t * gbp_endpoint_find_itf(u32 sw_if_index)
int gbp_endpoint_is_external(const gbp_endpoint_t *ge)
int gbp_endpoint_is_remote(const gbp_endpoint_t *ge)
index_t gel_epg
Endpoint Group.
static_always_inline void gbp_endpoint_mk_key_ip4(const ip4_address_t *ip, u32 fib_index, clib_bihash_kv_24_8_t *key)
gbp_endpoint_loc_t * ge_locs
Location information provided by the various sources.
#define foreach_gbp_endpoint_src
Sources of Endpoints in priority order.
walk_rc_t(* gbp_endpoint_cb_t)(index_t gbpei, void *ctx)
struct gbp_ep_by_ip_itf_db_t_ gbp_ep_db_t
GBP Endpoint Databases.
int gbp_endpoint_is_local(const gbp_endpoint_t *ge)