31 0x0, 0x22, 0xBD, 0xF8, 0x19, 0xFF,
37 00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
62 #define GBP_BD_DBG(...) \ 63 vlib_log_debug (grd_logger, __VA_ARGS__); 68 return (grd - gbp_route_domain_pool);
232 pool_put (gbp_route_domain_pool, grd);
273 return (VNET_API_ERROR_NO_SUCH_ENTRY);
279 return (&GBP_ROUTED_SRC_MAC);
285 return (&GBP_ROUTED_DST_MAC);
318 vnm, &ip4_uu_sw_if_index))
321 vnm, &ip6_uu_sw_if_index))
323 else if (
unformat (input,
"ip4-table-id %d", &ip4_table_id))
325 else if (
unformat (input,
"ip6-table-id %d", &ip6_table_id))
331 else if (
unformat (input,
"rd %d", &rd_id))
333 else if (
unformat (input,
"scope %d", &scope))
344 if (~0 == ip4_table_id)
346 if (~0 == ip6_table_id)
352 ip4_uu_sw_if_index, ip6_uu_sw_if_index);
369 .path =
"gbp route-domain",
370 .short_help =
"gbp route-domain [del] rd <ID> ip4-table-id <ID> ip6-table-id <ID> [ip4-uu <interface>] [ip6-uu <interface>]",
381 s =
format (s,
"[%d] rd:%d ip4-uu:%U ip6-uu:%U locks:%d",
382 grd - gbp_route_domain_pool,
423 .path =
"show gbp route-domain",
424 .short_help =
"show gbp route-domain\n",
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
vlib_log_class_t grd_logger
logger
u32 grd_table_id[FIB_PROTOCOL_IP_MAX]
void gbp_route_domain_unlock(index_t index)
#define hash_set(h, key, value)
const mac_address_t * gbp_route_domain_get_local_mac(void)
#define hash_unset(h, key)
vnet_main_t * vnet_get_main(void)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
static void gbp_route_domain_db_remove(gbp_route_domain_t *grd)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
unformat_function_t unformat_vnet_sw_interface
static clib_error_t * gbp_route_domain_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 grd_adj[FIB_PROTOCOL_IP_MAX]
adjacencies on the UU interfaces.
index_t gbp_route_domain_index(const gbp_route_domain_t *grd)
adj_index_t adj_nbr_add_or_lock_w_rewrite(fib_protocol_t nh_proto, vnet_link_t link_type, const ip46_address_t *nh_addr, u32 sw_if_index, u8 *rewrite)
Add (and lock) a new or lock an existing neighbour adjacency.
format_function_t format_vnet_sw_if_index_name
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static_always_inline void mac_address_to_bytes(const mac_address_t *mac, u8 *bytes)
#define VLIB_INIT_FUNCTION(x)
void gbp_route_domain_walk(gbp_route_domain_cb_t cb, void *ctx)
A high priority source a plugin can use.
#define clib_error_return(e, args...)
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
gbp_scope_t gbp_route_domain_get_scope(index_t grdi)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
int gbp_route_domain_delete(u32 rd_id)
static void gbp_route_domain_lock(index_t i)
#define pool_put(P, E)
Free an object E in pool P.
u8 * format_gbp_route_domain(u8 *s, va_list *args)
struct gbp_route_domain_db_t gbp_route_domain_db_t
DB of route_domains.
u32 grd_uu_sw_if_index[FIB_PROTOCOL_IP_MAX]
The interfaces on which to send packets to unnknown EPs.
void fib_table_unlock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Take a reference counting lock on the table.
static int gbp_route_domain_show_one(gbp_route_domain_t *gb, void *ctx)
int gbp_route_domain_add_and_lock(u32 rd_id, gbp_scope_t scope, u32 ip4_table_id, u32 ip6_table_id, u32 ip4_uu_sw_if_index, u32 ip6_uu_sw_if_index)
static clib_error_t * gbp_route_domain_init(vlib_main_t *vm)
index_t gbp_route_domain_find(u32 rd_id)
u32 grd_fib_index[FIB_PROTOCOL_IP_MAX]
static void gbp_route_domain_db_add(gbp_route_domain_t *grd)
#define VLIB_CLI_COMMAND(x,...)
gbp_route_domain_t * gbp_route_domain_get(index_t i)
u32 fib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, fib_source_t src)
Get the index of the FIB for a Table-ID.
const mac_address_t * gbp_route_domain_get_remote_mac(void)
static clib_error_t * gbp_route_domain_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int(* gbp_route_domain_cb_t)(gbp_route_domain_t *gb, void *ctx)
A route Domain Representation.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
u32 gbp_route_domain_get_rd_id(index_t grdi)
#define FOR_EACH_FIB_IP_PROTOCOL(_item)
static gbp_route_domain_db_t gbp_route_domain_db
gbp_route_domain_t * gbp_route_domain_pool
Pool of GBP route_domains.
u32 grd_id
Route-domain ID.
vnet_link_t fib_proto_to_link(fib_protocol_t proto)
Convert from a protocol to a link type.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
const ip46_address_t ADJ_BCAST_ADDR
The special broadcast address (to construct a broadcast adjacency.
index_t gbp_route_domain_find_and_lock(u32 rd_id)