55 return clib_net_to_host_u32 (a1->
data_u32) -
66 clib_net_to_host_u16 (a1->
as_u16[i]) -
67 clib_net_to_host_u16 (a2->
as_u16[i]);
76 .path =
"set interface ip",
77 .short_help =
"IP4/IP6 commands",
97 ip4_address_t * x = (ip4_address_t *)
98 ip_interface_address_get_address (&im4->lookup_main, ia);
99 vec_add1 (ip4_addrs, x[0]);
100 vec_add1 (ip4_masks, ia->address_length);
108 ip6_address_t * x = (ip6_address_t *)
109 ip_interface_address_get_address (&im6->lookup_main, ia);
110 vec_add1 (ip6_addrs, x[0]);
111 vec_add1 (ip6_masks, ia->address_length);
115 for (i = 0; i <
vec_len (ip4_addrs); i++)
118 for (i = 0; i <
vec_len (ip6_addrs); i++)
168 if (is_del &&
unformat (input,
"all"))
217 .path =
"set interface ip address",
219 .short_help =
"set interface ip address [del] <interface> <ip-addr>/<mask> | [all]",
250 else if (
unformat (line_input,
"off"))
255 else if (
unformat (line_input,
"ip4"))
260 else if (
unformat (line_input,
"ip6"))
277 "`ip4_full_reass_enable_disable' API call failed, rv=%d:%U, " 278 "`ip6_full_reass_enable_disable' API call failed, rv=%d:%U",
285 "`ip4_full_reass_enable_disable' API call failed, rv=%d:%U",
291 "`ip6_full_reass_enable_disable' API call failed, rv=%d:%U",
299 .path =
"set interface reassembly",
300 .short_help =
"set interface reassembly <interface-name> [on|off|ip4|ip6]",
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
vnet_api_error_t ip4_full_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
vnet_main_t * vnet_get_main(void)
void ip_del_all_interface_addresses(vlib_main_t *vm, u32 sw_if_index)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
ip_lookup_main_t lookup_main
unformat_function_t unformat_vnet_sw_interface
static clib_error_t * ip4_cli_init(vlib_main_t *vm)
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
#define clib_error_return(e, args...)
VNET_HW_INTERFACE_ADD_DEL_FUNCTION(ip_address_delete_cleanup)
clib_error_t * ip4_add_del_interface_address(vlib_main_t *vm, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 is_del)
static clib_error_t * ip_address_delete_cleanup(vnet_main_t *vnm, u32 hw_if_index, u32 is_create)
int ip6_address_compare(ip6_address_t *a1, ip6_address_t *a2)
static u8 * format_vnet_api_errno(u8 *s, va_list *args)
#define vec_free(V)
Free vector's memory (no header).
static clib_error_t * add_del_ip_address(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_CLI_COMMAND(x,...)
ip_lookup_main_t lookup_main
static vlib_main_t * vlib_get_main(void)
int ip4_address_compare(ip4_address_t *a1, ip4_address_t *a2)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static clib_error_t * set_reassembly_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
ip4_main_t ip4_main
Global ip4 main structure.
vnet_api_error_t ip6_full_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
clib_error_t * ip6_add_del_interface_address(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *address, u32 address_length, u32 is_del)