26 u32 start_host_order, end_host_order;
42 end_addr = start_addr;
43 else if (
unformat (line_input,
"del"))
53 start_host_order = clib_host_to_net_u32 (start_addr.
as_u32);
54 end_host_order = clib_host_to_net_u32 (end_addr.
as_u32);
56 if (end_host_order < start_host_order)
62 count = (end_host_order - start_host_order) + 1;
63 this_addr = start_addr;
65 for (i = 0; i <
count; i++)
71 case VNET_API_ERROR_NO_SUCH_ENTRY:
76 case VNET_API_ERROR_VALUE_EXIST:
145 "Set DS-Lite AFTR tunnel endpoint address failed.");
167 dslite_session_t *session = va_arg (*args, dslite_session_t *);
170 s =
format (s,
"%Uin %U:%u out %U:%u protocol %U\n",
173 clib_net_to_host_u16 (session->in2out.port),
175 clib_net_to_host_u16 (session->out2in.port),
177 s =
format (s,
"%Utotal pkts %d, total bytes %lld\n",
179 session->total_pkts, session->total_bytes);
189 u32 elt_index, head_index;
191 dslite_session_t *session;
202 elt_index = head->
next;
204 session_index = elt->
value;
205 while (session_index != ~0)
209 elt_index = elt->
next;
211 session_index = elt->
value;
231 vlib_cli_output (vm,
"%U", format_dslite_b4, td, b4);
242 .path =
"dslite add pool address",
243 .short_help =
"dslite add pool address <ip4-range-start> [- <ip4-range-end>] " 249 .path =
"show dslite pool",
250 .short_help =
"show dslite pool",
255 .path =
"dslite set aftr-tunnel-endpoint-address",
256 .short_help =
"dslite set aftr-tunnel-endpoint-address <ip6>",
261 .path =
"show dslite aftr-tunnel-endpoint-address",
262 .short_help =
"show dslite aftr-tunnel-endpoint-address",
267 .path =
"show dslite sessions",
268 .short_help =
"show dslite sessions",
sll srl srl sll sra u16x4 i
u8 * format_snat_protocol(u8 *s, va_list *args)
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)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define clib_error_return(e, args...)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
snat_address_t * addr_pool
int dslite_add_del_pool_addr(dslite_main_t *dm, ip4_address_t *addr, u8 is_add)
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)
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
void increment_v4_address(ip4_address_t *a)
static u8 * format_dslite_b4(u8 *s, va_list *args)
dslite_session_t * sessions
#define vec_foreach(var, vec)
Vector iterator.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
int dslite_set_aftr_ip6_addr(dslite_main_t *dm, ip6_address_t *addr)
u32 sessions_per_b4_list_head_index