32 u32 *inside_sw_if_indices = 0;
33 u32 *outside_sw_if_indices = 0;
45 vec_add1 (inside_sw_if_indices, sw_if_index);
48 vec_add1 (outside_sw_if_indices, sw_if_index);
49 else if (
unformat (line_input,
"del"))
59 if (
vec_len (inside_sw_if_indices))
61 for (i = 0; i <
vec_len (inside_sw_if_indices); i++)
63 sw_if_index = inside_sw_if_indices[
i];
67 case VNET_API_ERROR_NO_SUCH_ENTRY:
73 case VNET_API_ERROR_VALUE_EXIST:
79 case VNET_API_ERROR_INVALID_VALUE:
80 case VNET_API_ERROR_INVALID_VALUE_2:
83 "%U NAT66 feature enable/disable failed.",
94 if (
vec_len (outside_sw_if_indices))
96 for (i = 0; i <
vec_len (outside_sw_if_indices); i++)
98 sw_if_index = outside_sw_if_indices[
i];
102 case VNET_API_ERROR_NO_SUCH_ENTRY:
108 case VNET_API_ERROR_VALUE_EXIST:
114 case VNET_API_ERROR_INVALID_VALUE:
115 case VNET_API_ERROR_INVALID_VALUE_2:
118 "%U NAT66 feature enable/disable failed.",
167 ip6_address_t l_addr, e_addr;
177 if (
unformat (line_input,
"local %U external %U",
181 else if (
unformat (line_input,
"vrf %u", &vrf_id))
183 else if (
unformat (line_input,
"del"))
197 case VNET_API_ERROR_NO_SUCH_ENTRY:
200 case VNET_API_ERROR_VALUE_EXIST:
258 .path =
"set interface nat66",
259 .short_help =
"set interface nat66 in|out <intfc> [del]",
275 .path =
"show nat66 interfaces",
276 .short_help =
"show nat66 interfaces",
290 .path =
"nat66 add static mapping",
291 .short_help =
"nat66 add static mapping local <ip6-addr> external <ip6-addr>" 292 " [vfr <table-id>] [del]",
308 .path =
"show nat66 static mappings",
309 .short_help =
"show nat66 static mappings",
vnet_main_t * vnet_get_main(void)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Combined counter to hold both packets and byte differences.
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * nat66_show_interfaces_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
unformat_function_t unformat_vnet_sw_interface
static clib_error_t * nat66_show_static_mappings_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * nat66_interface_feature_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define nat66_interface_is_inside(i)
#define clib_error_return(e, args...)
static int nat66_cli_interface_walk(nat66_interface_t *i, void *ctx)
format_function_t format_vnet_sw_interface_name
void nat66_static_mappings_walk(nat66_static_mapping_walk_fn_t fn, void *ctx)
counter_t packets
packet counter
static int nat66_cli_static_mapping_walk(nat66_static_mapping_t *sm, void *ctx)
int nat66_interface_add_del(u32 sw_if_index, u8 is_inside, u8 is_add)
u32 ft_table_id
Table ID (hash key) for this FIB.
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
#define VLIB_CLI_COMMAND(x,...)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
counter_t bytes
byte counter
vlib_combined_counter_main_t session_counters
Session counters.
void nat66_interfaces_walk(nat66_interface_walk_fn_t fn, void *ctx)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
int nat66_static_mapping_add_del(ip6_address_t *l_addr, ip6_address_t *e_addr, u32 vrf_id, u8 is_add)
nat66_static_mapping_t * sm
Static mapping pool.
NAT66 global declarations.
static clib_error_t * nat66_add_del_static_mapping_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vl_api_interface_index_t sw_if_index
A protocol Independent FIB table.