48 } gs_stitched_external;
75 .gsk_fib_index = fib_index,
123 return (VNET_API_ERROR_INVALID_SW_IF_INDEX);
132 [fproto], ~0, 1, NULL,
239 return (VNET_API_ERROR_NO_SUCH_FIB);
247 return (VNET_API_ERROR_NO_SUCH_ENTRY);
274 return (VNET_API_ERROR_INCORRECT_ADJACENCY_TYPE);
280 return (VNET_API_ERROR_NO_SUCH_FIB);
346 else if (
unformat (line_input,
"rd %d", &rd_id))
358 else if (
unformat (line_input,
"type transport"))
360 else if (
unformat (line_input,
"type stitched-internal"))
362 else if (
unformat (line_input,
"type stitched-external"))
364 else if (
unformat (line_input,
"type anon-l3-out"))
366 else if (
unformat (line_input,
"type l3-out"))
372 else if (
unformat (line_input,
"sclass %u", &sclass))
391 case VNET_API_ERROR_NO_SUCH_FIB:
407 .path =
"gbp subnet",
408 .short_help =
"gbp subnet [del] rd <ID> prefix <prefix> type <type> [<interface>] [sclass <sclass>]\n",
448 gs->
gs_type, sw_if_index, sclass, ctx))
468 return (
format (s,
"stitched-internal"));
470 return (
format (s,
"stitched-external"));
472 return (
format (s,
"transport"));
474 return (
format (s,
"l3-out"));
476 return (
format (s,
"anon-l3-out"));
479 return (
format (s,
"unknown"));
495 s =
format (s,
"[%d] tbl:%d %U %U", gsi, table_id,
572 .path =
"show gbp subnet",
573 .short_help =
"show gbp subnet\n",
fib_protocol_t fp_proto
protocol type
u8 * format_fib_entry(u8 *s, va_list *args)
enum fib_source_t_ fib_source_t
The different sources that can create a route.
void gbp_subnet_walk(gbp_subnet_cb_t cb, void *ctx)
void gbp_route_domain_unlock(index_t index)
vl_api_wireguard_peer_flags_t flags
vnet_main_t * vnet_get_main(void)
gbp_subnet_key_t * gs_key
static u8 * format_gbp_subnet_type(u8 *s, va_list *args)
struct gbp_subnet_t_::@653::@655 gs_stitched_external
#define FIB_ENTRY_FORMAT_DETAIL
add paths without path extensions
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static void gbp_subnet_db_del(gbp_subnet_t *gs)
#define hash_set_mem(h, key, value)
unformat_function_t unformat_vnet_sw_interface
static int gbp_subnet_transport_add(gbp_subnet_t *gs)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
int gbp_subnet_del(u32 rd_id, const fib_prefix_t *pfx)
format_function_t format_vnet_sw_if_index_name
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
#define clib_memcpy(d, s, n)
fib_node_index_t fib_table_entry_update_one_path(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags)
Update the entry to have just one path.
static clib_error_t * gbp_subnet_init(vlib_main_t *vm)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
static int gbp_subnet_internal_add(gbp_subnet_t *gs)
int gbp_subnet_add(u32 rd_id, const fib_prefix_t *pfx, gbp_subnet_type_t type, u32 sw_if_index, sclass_t sclass)
u8 * format_fib_prefix(u8 *s, va_list *args)
Aggregate type for a prefix.
#define clib_error_return(e, args...)
enum gsb_subnet_show_flags_t_ gsb_subnet_show_flags_t
walk_rc_t(* gbp_subnet_cb_t)(u32 rd_id, const fib_prefix_t *pfx, gbp_subnet_type_t type, u32 sw_if_index, sclass_t sclass, void *ctx)
u16 fp_len
The mask length.
gbp_subnet_t * gbp_subnet_pool
pool of subnets
struct gbp_subnet_t_::@653::@656 gs_l3_out
static index_t gbp_subnet_db_find(u32 fib_index, const fib_prefix_t *pfx)
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)
vl_api_fib_path_type_t type
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define hash_create_mem(elts, key_bytes, value_bytes)
gbp_subnet_type_t gs_type
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define hash_unset_mem(h, key)
#define FIB_SOURCE_PRIORITY_HI
Some priority values that plugins might use when they are not to concerned where in the list they'll ...
enum gbp_subnet_type_t_ gbp_subnet_type_t
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
static void gbp_subnet_del_i(index_t gsi)
void gbp_policy_dpo_add_or_lock(dpo_proto_t dproto, gbp_scope_t scope, sclass_t sclass, u32 sw_if_index, dpo_id_t *dpo)
#define pool_put(P, E)
Free an object E in pool P.
u32 grd_uu_sw_if_index[FIB_PROTOCOL_IP_MAX]
The interfaces on which to send packets to unnknown EPs.
static clib_error_t * gbp_subnet_add_del_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
uword * gbp_subnet_db
A DB of the subnets; key={pfx,fib-index}.
fib_node_index_t fib_table_entry_special_dpo_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Update a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the...
void fib_table_entry_delete_index(fib_node_index_t fib_entry_index, fib_source_t source)
Delete a FIB entry.
index_t gbp_route_domain_find(u32 rd_id)
u32 grd_fib_index[FIB_PROTOCOL_IP_MAX]
void gbp_fwd_dpo_add_or_lock(dpo_proto_t dproto, dpo_id_t *dpo)
static int gbp_subnet_external_add(gbp_subnet_t *gs, u32 sw_if_index, sclass_t sclass)
u32 fib_node_index_t
A typedef of a node index.
enum fib_entry_flag_t_ fib_entry_flag_t
#define VLIB_CLI_COMMAND(x,...)
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Add a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
gbp_route_domain_t * gbp_route_domain_get(index_t i)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
static void clib_mem_free(void *p)
u8 * format_gbp_subnet(u8 *s, va_list *args)
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
static fib_source_t gbp_fib_source
static void * clib_mem_alloc(uword size)
struct gbp_subnet_t_ gbp_subnet_t
Subnet.
struct gbp_subnet_key_t_ gbp_subnet_key_t
a key for the DB
A route Domain Representation.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static clib_error_t * gbp_subnet_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
#define hash_get_mem(h, key)
static void gbp_subnet_db_add(u32 fib_index, const fib_prefix_t *pfx, gbp_subnet_t *gs)
u32 grd_id
Route-domain ID.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define pool_foreach_index(i, v, body)
Iterate pool by index.
const ip46_address_t ADJ_BCAST_ADDR
The special broadcast address (to construct a broadcast adjacency.
#define ip46_address_initializer
vl_api_interface_index_t sw_if_index
index_t gbp_route_domain_find_and_lock(u32 rd_id)
static int gbp_subnet_l3_out_add(gbp_subnet_t *gs, sclass_t sclass, int is_anon)