33 u32 *inside_sw_if_indices = 0;
34 u32 *outside_sw_if_indices = 0;
46 vec_add1 (inside_sw_if_indices, sw_if_index);
49 vec_add1 (outside_sw_if_indices, sw_if_index);
50 else if (
unformat (line_input,
"del"))
60 if (
vec_len (inside_sw_if_indices))
62 for (i = 0; i <
vec_len (inside_sw_if_indices); i++)
64 sw_if_index = inside_sw_if_indices[
i];
68 case VNET_API_ERROR_NO_SUCH_ENTRY:
74 case VNET_API_ERROR_VALUE_EXIST:
80 case VNET_API_ERROR_INVALID_VALUE:
81 case VNET_API_ERROR_INVALID_VALUE_2:
84 "%U NAT66 feature enable/disable failed.",
95 if (
vec_len (outside_sw_if_indices))
97 for (i = 0; i <
vec_len (outside_sw_if_indices); i++)
99 sw_if_index = outside_sw_if_indices[
i];
103 case VNET_API_ERROR_NO_SUCH_ENTRY:
109 case VNET_API_ERROR_VALUE_EXIST:
115 case VNET_API_ERROR_INVALID_VALUE:
116 case VNET_API_ERROR_INVALID_VALUE_2:
119 "%U NAT66 feature enable/disable failed.",
178 if (
unformat (line_input,
"local %U external %U",
182 else if (
unformat (line_input,
"vrf %u", &vrf_id))
184 else if (
unformat (line_input,
"del"))
198 case VNET_API_ERROR_NO_SUCH_ENTRY:
201 case VNET_API_ERROR_VALUE_EXIST:
259 .path =
"set interface nat66",
260 .short_help =
"set interface nat66 in|out <intfc> [del]",
276 .path =
"show nat66 interfaces",
277 .short_help =
"show nat66 interfaces",
291 .path =
"nat66 add static mapping",
292 .short_help =
"nat66 add static mapping local <ip6-addr> external <ip6-addr>" 293 " [vfr <table-id>] [del]",
309 .path =
"show nat66 static mappings",
310 .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 int nat66_cli_interface_walk(snat_interface_t *i, void *ctx)
static clib_error_t * nat66_interface_feature_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vl_api_interface_index_t sw_if_index
#define clib_error_return(e, args...)
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
#define nat_interface_is_inside(i)
Check if NAT interface is inside.
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...
#define vec_free(V)
Free vector's memory (no header).
#define VLIB_CLI_COMMAND(x,...)
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)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
A protocol Independent FIB table.