17 #define DSLITE_EXPECTED_ARGUMENT "expected required argument(s)" 27 u32 start_host_order, end_host_order;
44 else if (
unformat (line_input,
"del"))
54 start_host_order = clib_host_to_net_u32 (start_addr.
as_u32);
55 end_host_order = clib_host_to_net_u32 (end_addr.
as_u32);
57 if (end_host_order < start_host_order)
63 count = (end_host_order - start_host_order) + 1;
70 case VNET_API_ERROR_NO_SUCH_ENTRY:
75 case VNET_API_ERROR_VALUE_EXIST:
114 ip6_address_t ip6_addr;
139 "Set DS-Lite AFTR tunnel endpoint address failed.");
165 ip6_address_t ip6_addr;
211 dslite_session_t *session = va_arg (*args, dslite_session_t *);
214 s =
format (s,
"%Uin %U:%u out %U:%u protocol %U\n",
217 clib_net_to_host_u16 (session->in2out.port),
219 clib_net_to_host_u16 (session->out2in.port),
221 s =
format (s,
"%Utotal pkts %d, total bytes %lld\n",
223 session->total_pkts, session->total_bytes);
233 u32 elt_index, head_index;
235 dslite_session_t *session;
246 elt_index = head->
next;
248 session_index = elt->
value;
249 while (session_index != ~0)
253 elt_index = elt->
next;
255 session_index = elt->
value;
296 .path =
"dslite add pool address",
297 .short_help =
"dslite add pool address <ip4-range-start> [- <ip4-range-end>] " 315 .path =
"show dslite pool",
316 .short_help =
"show dslite pool",
329 .path =
"dslite set aftr-tunnel-endpoint-address",
330 .short_help =
"dslite set aftr-tunnel-endpoint-address <ip6>",
343 .path =
"show dslite aftr-tunnel-endpoint-address",
344 .short_help =
"show dslite aftr-tunnel-endpoint-address",
357 .path =
"dslite set b4-tunnel-endpoint-address",
358 .short_help =
"dslite set b4-tunnel-endpoint-address <ip6>",
371 .path =
"show dslite b4-tunnel-endpoint-address",
372 .short_help =
"show dslite b4-tunnel-endpoint-address",
392 .path =
"show dslite sessions",
393 .short_help =
"show dslite sessions",
vl_api_address_t end_addr
#define pool_foreach(VAR, POOL)
Iterate through pool.
vl_api_address_t start_addr
static u8 * format_dslite_session(u8 *s, va_list *args)
static clib_error_t * dslite_show_aftr_ip6_addr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
description fragment has unexpected format
ip6_address_t b4_ip6_addr
#define clib_error_return(e, args...)
#define DSLITE_EXPECTED_ARGUMENT
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
format_function_t format_nat_protocol
static clib_error_t * dslite_set_b4_tunnel_addr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
nat_ip4_pool_addr_t * pool_addr
ip6_address_t aftr_ip6_addr
dslite_main_t dslite_main
#define VLIB_CLI_COMMAND(x,...)
static clib_error_t * dslite_add_del_pool_addr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * dslite_show_sessions_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,...)
static clib_error_t * dslite_show_pool_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * dslite_set_aftr_tunnel_addr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
dslite_per_thread_data_t * per_thread_data
static u8 * format_dslite_b4(u8 *s, va_list *args)
int dslite_set_b4_ip6_addr(dslite_main_t *dm, ip6_address_t *addr)
dslite_session_t * sessions
#define vec_foreach(var, vec)
Vector iterator.
int nat_add_del_ip4_pool_addrs(nat_ip4_pool_t *pool, ip4_address_t addr, u32 count, u8 is_add, void *opaque)
int dslite_set_aftr_ip6_addr(dslite_main_t *dm, ip6_address_t *addr)
u32 sessions_per_b4_list_head_index
static clib_error_t * dslite_show_b4_ip6_addr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)