48 } gs_stitched_external;
73 .gsk_fib_index = fib_index,
121 return (VNET_API_ERROR_INVALID_SW_IF_INDEX);
130 [fproto], ~0, 1, NULL,
237 return (VNET_API_ERROR_NO_SUCH_FIB);
245 return (VNET_API_ERROR_NO_SUCH_ENTRY);
272 return (VNET_API_ERROR_INCORRECT_ADJACENCY_TYPE);
278 return (VNET_API_ERROR_NO_SUCH_FIB);
344 else if (
unformat (line_input,
"rd %d", &rd_id))
356 else if (
unformat (line_input,
"type transport"))
358 else if (
unformat (line_input,
"type stitched-internal"))
360 else if (
unformat (line_input,
"type stitched-external"))
362 else if (
unformat (line_input,
"type anon-l3-out"))
364 else if (
unformat (line_input,
"type l3-out"))
370 else if (
unformat (line_input,
"sclass %u", &sclass))
389 case VNET_API_ERROR_NO_SUCH_FIB:
405 .path =
"gbp subnet",
406 .short_help =
"gbp subnet [del] rd <ID> prefix <prefix> type <type> [<interface>] [sclass <sclass>]\n",
446 gs->
gs_type, sw_if_index, sclass, ctx))
466 return (
format (s,
"stitched-internal"));
468 return (
format (s,
"stitched-external"));
470 return (
format (s,
"transport"));
472 return (
format (s,
"l3-out"));
474 return (
format (s,
"anon-l3-out"));
477 return (
format (s,
"unknown"));
493 s =
format (s,
"[%d] tbl:%d %U %U", gsi, table_id,
570 .path =
"show gbp subnet",
571 .short_help =
"show gbp subnet\n",
fib_protocol_t fp_proto
protocol type
u8 * format_fib_entry(u8 *s, va_list *args)
void gbp_subnet_walk(gbp_subnet_cb_t cb, void *ctx)
void gbp_route_domain_unlock(index_t index)
vnet_main_t * vnet_get_main(void)
gbp_subnet_key_t * gs_key
static u8 * format_gbp_subnet_type(u8 *s, va_list *args)
#define FIB_ENTRY_FORMAT_DETAIL
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.
vl_api_interface_index_t sw_if_index
#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)
A high priority source a plugin can use.
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
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)
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)
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)
struct gbp_subnet_t_::@470::@473 gs_l3_out
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)
#define ip46_address_initializer
struct gbp_subnet_t_::@470::@472 gs_stitched_external
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)
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 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.
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)
static int gbp_subnet_l3_out_add(gbp_subnet_t *gs, sclass_t sclass, int is_anon)