30 0x0, 0x22, 0xBD, 0xF8, 0x19, 0xFF,
36 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);
231 pool_put (gbp_route_domain_pool, grd);
272 return (VNET_API_ERROR_NO_SUCH_ENTRY);
278 return (&GBP_ROUTED_SRC_MAC);
284 return (&GBP_ROUTED_DST_MAC);
317 vnm, &ip4_uu_sw_if_index))
320 vnm, &ip6_uu_sw_if_index))
322 else if (
unformat (input,
"ip4-table-id %d", &ip4_table_id))
324 else if (
unformat (input,
"ip6-table-id %d", &ip6_table_id))
330 else if (
unformat (input,
"rd %d", &rd_id))
332 else if (
unformat (input,
"scope %d", &scope))
343 if (~0 == ip4_table_id)
345 if (~0 == ip6_table_id)
351 ip4_uu_sw_if_index, ip6_uu_sw_if_index);
368 .path =
"gbp route-domain",
369 .short_help =
"gbp route-domain [del] rd <ID> ip4-table-id <ID> ip6-table-id <ID> [ip4-uu <interface>] [ip6-uu <interface>]",
380 s =
format (s,
"[%d] rd:%d ip4-uu:%U ip6-uu:%U locks:%d",
381 grd - gbp_route_domain_pool,
422 .path =
"show gbp route-domain",
423 .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
enum fib_source_t_ fib_source_t
The different sources that can create a route.
u32 grd_table_id[FIB_PROTOCOL_IP_MAX]
void gbp_route_domain_unlock(index_t index)
#define hash_set(h, key, value)
If your adding a new source from a plugin pick one of these.
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.
#define pool_foreach(VAR, POOL)
Iterate through pool.
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.
vl_api_interface_index_t ip4_uu_sw_if_index
static_always_inline void mac_address_to_bytes(const mac_address_t *mac, u8 *bytes)
#define VLIB_INIT_FUNCTION(x)
description fragment has unexpected format
void gbp_route_domain_walk(gbp_route_domain_cb_t cb, void *ctx)
#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)
fib_source_t fib_source_allocate(const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define FIB_SOURCE_PRIORITY_HI
Some priority values that plugins might use when they are not to concerned where in the list they'll ...
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)
sll srl srl sll sra u16x4 i
index_t gbp_route_domain_find(u32 rd_id)
u32 grd_fib_index[FIB_PROTOCOL_IP_MAX]
static fib_source_t gbp_fib_source
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)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
vl_api_interface_index_t ip6_uu_sw_if_index
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.
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)