22 #include <vpp/app/version.h> 43 u32 *sixrd_domain_index,
53 memset(d, 0,
sizeof (*d));
54 *sixrd_domain_index = d - mm->
domains;
64 if (ip4_prefix_len < 32)
65 d->
shift = 64 - ip6_prefix_len + (32 - ip4_prefix_len);
154 clib_warning(
"SIXRD domain delete: domain does not exist: %d",
193 u32 ip6_prefix_len=0, ip4_prefix_len=0, sixrd_domain_index;
209 else if (
unformat(line_input,
"mtu %d", &mtu))
218 if (num_m_args < 3) {
224 &ip4_src, &sixrd_domain_index, mtu);
239 u32 sixrd_domain_index;
247 if (
unformat(line_input,
"index %d", &sixrd_domain_index))
256 if (num_m_args != 1) {
276 "[%d] ip6-pfx %U/%d ip4-pfx %U/%d ip4-src %U mtu %d",
305 int domains = 0, domaincount = 0;
310 domains += sizeof(*d);
315 vlib_cli_output(vm,
"SIXRD domains: %d (%d bytes)\n", domaincount, domains);
331 s =
format(s,
"SIXRD domain index: %d", sixrd_domain_index);
337 .path =
"sixrd add domain",
339 "sixrd add domain ip6-pfx <ip6-pfx> ip4-pfx <ip4-pfx> ip4-src <ip4-addr>",
344 .path =
"sixrd del domain",
346 "sixrd del domain index <domain>",
351 .path =
"show sixrd domain",
356 .path =
"show sixrd stats",
362 .version = VPP_BUILD_VER,
363 .description =
"IPv6 Rapid Deployment on IPv4 Infrastructure (RFC5969)",
fib_protocol_t fp_proto
protocol type
fib_node_index_t fib_table_lookup_exact_match(u32 fib_index, const fib_prefix_t *prefix)
Perfom an exact match in the non-forwarding table.
void sixrd_dpo_create(dpo_proto_t dproto, u32 domain_index, dpo_id_t *dpo)
vnet_main_t * vnet_get_main(void)
static clib_error_t * show_sixrd_stats_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static u8 * format_sixrd_domain(u8 *s, va_list *args)
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
static clib_error_t * sixrd_add_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 sd_domain
the SIXRD domain index
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
void fib_table_entry_special_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Remove a 'special' entry from the FIB.
Aggregrate type for a prefix.
#define clib_error_return(e, args...)
const int fib_entry_get_dpo_for_source(fib_node_index_t fib_entry_index, fib_source_t source, dpo_id_t *dpo)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static clib_error_t * show_sixrd_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
dpo_type_t dpoi_type
the type
static clib_error_t * sixrd_del_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
load-balancing over a choice of [un]equal cost paths
#define pool_put(P, E)
Free an object E in pool P.
static sixrd_dpo_t * sixrd_dpo_get(index_t index)
const dpo_id_t * load_balance_get_bucket(index_t lbi, u32 bucket)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P (general version).
int sixrd_delete_domain(u32 sixrd_domain_index)
#define clib_warning(format, args...)
u32 fib_node_index_t
A typedef of a node index.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#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...
static clib_error_t * sixrd_init(vlib_main_t *vm)
u8 * format_sixrd_trace(u8 *s, va_list *args)
index_t dpoi_index
the index of objects of that type
#define FIB_NODE_INDEX_INVALID
int sixrd_create_domain(ip6_address_t *ip6_prefix, u8 ip6_prefix_len, ip4_address_t *ip4_prefix, u8 ip4_prefix_len, ip4_address_t *ip4_src, u32 *sixrd_domain_index, u16 mtu)
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
A representation of a 6RD DPO.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define CLIB_CACHE_LINE_BYTES
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
void sixrd_dpo_module_init(void)
static uword pool_elts(void *v)
Number of active elements in a pool.