35 u32 *sixrd_domain_index,
49 memset(d, 0,
sizeof (*d));
50 *sixrd_domain_index = d - mm->
domains;
60 if (ip4_prefix_len < 32)
61 d->
shift = 64 - ip6_prefix_len + (32 - ip4_prefix_len);
64 memset(&adj, 0,
sizeof(adj));
67 p = (
u32 *)&adj.rewrite_data[0];
68 *p = (
u32) (*sixrd_domain_index);
71 memset(&args6, 0,
sizeof(args6));
94 p = (
u32 *)&adj4->rewrite_data[0];
101 memset(&args4, 0,
sizeof(args4));
130 clib_warning(
"SIXRD domain delete: domain does not exist: %d", sixrd_domain_index);
136 memset(&adj, 0,
sizeof(adj));
141 memset(&args6, 0,
sizeof (args6));
159 u32 *p = (
u32 *)&adj4->rewrite_data[0];
162 memset(&args4, 0,
sizeof(args4));
189 u32 ip6_prefix_len, ip4_prefix_len, sixrd_domain_index;
204 else if (
unformat(line_input,
"mtu %d", &mtu))
216 &ip4_src, &sixrd_domain_index, mtu);
228 u32 sixrd_domain_index;
235 if (
unformat(line_input,
"index %d", &sixrd_domain_index))
258 "[%d] ip6-pfx %U/%d ip4-pfx %U/%d ip4-src %U mtu %d",
287 int domains = 0, domaincount = 0;
292 domains += sizeof(*d);
297 vlib_cli_output(vm,
"SIXRD domains: %d (%d bytes)\n", domaincount, domains);
313 s =
format(s,
"SIXRD domain index: %d", sixrd_domain_index);
319 .path =
"sixrd add domain",
321 "sixrd add domain ip6-pfx <ip6-pfx> ip4-pfx <ip4-pfx> ip4-src <ip4-addr>",
326 .path =
"sixrd del domain",
328 "sixrd del domain index <domain>",
333 .path =
"show sixrd domain",
338 .path =
"show sixrd stats",
ip_lookup_next_t lookup_next_index
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)
ip_lookup_main_t lookup_main
static clib_error_t * sixrd_add_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vnet_main_t * vnet_get_main(void)
#define pool_foreach(VAR, POOL, BODY)
#define VLIB_INIT_FUNCTION(x)
always_inline uword pool_elts(void *v)
#define clib_warning(format, args...)
u32 table_index_or_table_id
void ip6_add_del_route(ip6_main_t *im, ip6_add_del_route_args_t *args)
ip6_address_t dst_address
#define pool_elt_at_index(p, i)
static clib_error_t * show_sixrd_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void * ip4_get_route(ip4_main_t *im, u32 fib_index_or_table_id, u32 flags, u8 *address, u32 address_length)
static clib_error_t * sixrd_del_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define pool_get_aligned(P, E, A)
int sixrd_delete_domain(u32 sixrd_domain_index)
#define IP6_ROUTE_FLAG_DEL
#define pool_is_free_index(P, I)
#define IP4_ROUTE_FLAG_DEL
#define VLIB_CLI_COMMAND(x,...)
ip4_address_t dst_address
#define IP4_ROUTE_FLAG_ADD
always_inline ip_adjacency_t * ip_get_adjacency(ip_lookup_main_t *lm, u32 adj_index)
clib_error_t * sixrd_init(vlib_main_t *vm)
u8 * format_sixrd_trace(u8 *s, va_list *args)
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)
u32 table_index_or_table_id
#define IP6_ROUTE_FLAG_ADD
#define clib_error_return(e, args...)
void ip4_add_del_route(ip4_main_t *im, ip4_add_del_route_args_t *args)
#define CLIB_CACHE_LINE_BYTES