53 return clib_net_to_host_u32 (a1->
data_u32) -
64 clib_net_to_host_u16 (a1->
as_u16[i]) -
65 clib_net_to_host_u16 (a2->
as_u16[i]);
74 .path =
"set interface ip",
75 .short_help =
"IP4/IP6 commands",
95 ip4_address_t * x = (ip4_address_t *)
96 ip_interface_address_get_address (&im4->lookup_main, ia);
97 vec_add1 (ip4_addrs, x[0]);
98 vec_add1 (ip4_masks, ia->address_length);
106 ip6_address_t * x = (ip6_address_t *)
107 ip_interface_address_get_address (&im6->lookup_main, ia);
108 vec_add1 (ip6_addrs, x[0]);
109 vec_add1 (ip6_masks, ia->address_length);
113 for (i = 0; i <
vec_len (ip4_addrs); i++)
116 for (i = 0; i <
vec_len (ip6_addrs); i++)
151 u32 sw_if_index, length, is_del;
166 if (is_del &&
unformat (input,
"all"))
215 .path =
"set interface ip address",
217 .short_help =
"set interface ip address [del] <interface> <ip-addr>/<mask> | [all]",
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
sll srl srl sll sra u16x4 i
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)
#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)
#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)
ip4_main_t ip4_main
Global ip4 main structure.
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)