25 u32 start_host_order, end_host_order;
42 else if (
unformat (line_input,
"del"))
52 start_host_order = clib_host_to_net_u32 (start_addr.
as_u32);
53 end_host_order = clib_host_to_net_u32 (end_addr.
as_u32);
55 if (end_host_order < start_host_order)
61 count = (end_host_order - start_host_order) + 1;
68 case VNET_API_ERROR_NO_SUCH_ENTRY:
73 case VNET_API_ERROR_VALUE_EXIST:
112 ip6_address_t ip6_addr;
137 "Set DS-Lite AFTR tunnel endpoint address failed.");
163 ip6_address_t ip6_addr;
214 #define _(N, j, n, str) case NAT_PROTOCOL_##N: t = (u8 *) str; break; 218 s =
format (s,
"unknown");
228 dslite_session_t *session = va_arg (*args, dslite_session_t *);
231 s =
format (s,
"%Uin %U:%u out %U:%u protocol %U\n",
234 clib_net_to_host_u16 (session->in2out.port),
236 clib_net_to_host_u16 (session->out2in.port),
238 s =
format (s,
"%Utotal pkts %d, total bytes %lld\n",
240 session->total_pkts, session->total_bytes);
250 u32 elt_index, head_index;
252 dslite_session_t *session;
263 elt_index = head->
next;
265 session_index = elt->
value;
266 while (session_index != ~0)
270 elt_index = elt->
next;
272 session_index = elt->
value;
292 vlib_cli_output (vm,
"%U", format_dslite_b4, td, b4);
313 .path =
"dslite add pool address",
314 .short_help =
"dslite add pool address <ip4-range-start> [- <ip4-range-end>] " 332 .path =
"show dslite pool",
333 .short_help =
"show dslite pool",
346 .path =
"dslite set aftr-tunnel-endpoint-address",
347 .short_help =
"dslite set aftr-tunnel-endpoint-address <ip6>",
360 .path =
"show dslite aftr-tunnel-endpoint-address",
361 .short_help =
"show dslite aftr-tunnel-endpoint-address",
374 .path =
"dslite set b4-tunnel-endpoint-address",
375 .short_help =
"dslite set b4-tunnel-endpoint-address <ip6>",
388 .path =
"show dslite b4-tunnel-endpoint-address",
389 .short_help =
"show dslite b4-tunnel-endpoint-address",
409 .path =
"show dslite sessions",
410 .short_help =
"show dslite sessions",
vl_api_address_t end_addr
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)
static u8 * format_nat_protocol(u8 *s, va_list *args)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
ip6_address_t b4_ip6_addr
#define clib_error_return(e, args...)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static clib_error_t * dslite_set_b4_tunnel_addr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
nat_ip4_pool_addr_t * pool_addr
ip6_address_t aftr_ip6_addr
sll srl srl sll sra u16x4 i
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)