|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
106 i32 diff_time = client_state->
T2 - current_time;
109 params.
mrd = diff_time;
119 params.
mrd = diff_time;
129 if (
vec_len (address_list) != 0)
134 addr = &addresses[
i];
151 if (address1->as_u64[0] != address2->as_u64[0])
153 return address1->as_u64[1] == address2->as_u64[1];
165 vl_api_dhcp6_address_info_t *api_address;
166 u32 inner_status_code;
200 (
"Advertise message arrived with NoAddrsAvail status code");
206 for (
i = 0;
i < n_addresses;
i++)
209 address = (ip6_address_t *) api_address->address;
211 address_info = &address_list[
i];
213 address_info->preferred_lt = 0;
214 address_info->valid_lt = 0;
229 clib_warning (
"Reply message arrived with Server ID different "
230 "from that in Request or Renew message");
236 clib_warning (
"Reply message arrived with NoAddrsAvail status code");
240 (
"Invalid Reply message arrived: It contains NoAddrsAvail "
241 "status code but also contains addresses");
248 clib_warning (
"Reply message arrived with UnspecFail status code");
255 for (
i = 0;
i < n_addresses;
i++)
263 address = (ip6_address_t *) api_address->address;
274 u8 address_already_present = 0;
284 address_already_present = 1;
285 goto address_pool_foreach_out;
289 address_pool_foreach_out:
291 if (address_already_present)
295 address_info->
due_time = current_time;
313 address_info->
due_time = current_time;
323 &address_info->
address, 64, 0);
329 client_state->
T1 = ntohl (mp->
T1);
330 client_state->
T2 = ntohl (mp->
T2);
331 if (client_state->
T1 != 0)
333 if (client_state->
T2 != 0)
355 clib_memcpy (&address_list[pos], address_info,
sizeof (*address_info));
372 f64 sleep_time = 1e9;
377 uword *event_data = 0;
396 due_time = current_time + 1e9;
400 if (address_info->
due_time > current_time)
402 if (address_info->
due_time < due_time)
469 while (due_time < current_time);
471 sleep_time = due_time - current_time;
481 .name =
"dhcp6-client-cp-process",
532 "preferred lifetime: %u, valid lifetime: %u "
536 address_info->
due_time - current_time);
545 .path =
"show dhcp6 addresses",
546 .short_help =
"show dhcp6 addresses",
562 const char *rebinding;
574 buf1 =
format (buf1,
"%u remaining",
578 buf1 =
format (buf1,
"timeout");
580 buf2 =
format (buf2,
"%u remaining",
583 buf2 =
format (buf2,
"timeout");
585 rebinding =
", REBINDING";
590 "sw_if_index: %u, T1: %u (%v), "
591 "T2: %u (%v), server index: %d%s",
i,
592 cs->
T1, buf1, cs->
T2, buf2,
607 .path =
"show dhcp6 clients",
608 .short_help =
"show dhcp6 clients",
639 if (!old_enabled && enable)
652 else if (old_enabled && !enable)
713 else if (
unformat (line_input,
"disable"))
751 .path =
"dhcp6 client",
752 .short_help =
"dhcp6 client <interface> [disable]",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static uword ip6_address_is_link_local_unicast(const ip6_address_t *a)
static clib_error_t * dhcp_ia_na_client_cp_init(vlib_main_t *vm)
static clib_error_t * dhcp6_client_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static dhcp6_client_cp_main_t dhcp6_client_cp_main
static void enable_process(void)
#define clib_memcpy(d, s, n)
static address_info_t * create_address_list(u32 sw_if_index)
VNET_DHCP6_REPLY_EVENT_FUNCTION(dhcp6_reply_event_handler)
static void vlib_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
Set node dispatch state.
@ DHCPV6_STATUS_NOADDRS_AVAIL
int dhcp6_client_enable_disable(u32 sw_if_index, u8 enable)
vlib_main_t vlib_node_runtime_t * node
vl_api_dhcpv6_msg_type_t msg_type
#define clib_error_return(e, args...)
vl_api_interface_index_t sw_if_index
vlib_node_main_t node_main
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
void vlib_start_process(vlib_main_t *vm, uword process_index)
address_info_t * address_pool
dhcp6_send_client_message_params_address_t * addresses
static uword vnet_sw_interface_is_api_valid(vnet_main_t *vnm, u32 sw_if_index)
static void interrupt_process(void)
#define vec_elt(v, i)
Get vector value at index i.
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type,...
static clib_error_t * dhcp6_clients_show_command_function(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define pool_foreach(VAR, POOL)
Iterate through pool.
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)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vnet_main_t * vnet_get_main(void)
Tell client about a DHCPv6 server reply event.
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
static clib_error_t * dhcp6_reply_event_handler(vl_api_dhcp6_reply_event_t *mp)
static api_main_t * vlibapi_get_main(void)
sll srl srl sll sra u16x4 i
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
manual_print typedef address
#define VLIB_CLI_COMMAND(x,...)
struct _vlib_node_registration vlib_node_registration_t
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static clib_error_t * dhcp6_addresses_show_command_function(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void dhcp6_send_client_message(vlib_main_t *vm, u32 sw_if_index, u8 stop, dhcp6_send_client_message_params_t *params)
API main structure, used by both vpp and binary API clients.
static void disable_process(void)
#define vec_free(V)
Free vector's memory (no header).
static vlib_cli_command_t dhcp6_addresses_show_command
(constructor) VLIB_CLI_COMMAND (dhcp6_addresses_show_command)
unformat_function_t unformat_vnet_sw_interface
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
description fragment has unexpected format
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
#define VLIB_INIT_FUNCTION(x)
void dhcp6_clients_enable_disable(u8 enable)
vl_api_dhcp6_address_info_t addresses[n_addresses]
vlib_node_registration_t dhcp6_client_cp_process_node
(constructor) VLIB_REGISTER_NODE (dhcp6_client_cp_process_node)
vnet_interface_output_runtime_t * rt
@ DHCPV6_STATUS_UNSPEC_FAIL
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
#define clib_warning(format, args...)
@ DHCPV6_MSG_API_ADVERTISE
static f64 vlib_time_now(vlib_main_t *vm)
client_state_t * client_state_by_sw_if_index
static u8 ip6_addresses_equal(ip6_address_t *address1, ip6_address_t *address2)
int ip6_link_enable(u32 sw_if_index, const ip6_address_t *link_local_addr)
IPv6 Configuration on an interface.
vl_api_interface_index_t sw_if_index
static void send_client_message_start_stop(u32 sw_if_index, u32 server_index, u8 msg_type, address_info_t *address_list, u8 start)
static uword dhcp6_client_cp_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
static vlib_cli_command_t dhcp6_client_enable_disable_command
(constructor) VLIB_CLI_COMMAND (dhcp6_client_enable_disable_command)
static vlib_cli_command_t dhcp6_clients_show_command
(constructor) VLIB_CLI_COMMAND (dhcp6_clients_show_command)
#define VLIB_REGISTER_NODE(x,...)