|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
105 i32 diff_time = client_state->
T2 - current_time;
108 params.
mrd = diff_time;
118 params.
mrd = diff_time;
128 if (
vec_len (address_list) != 0)
133 addr = &addresses[
i];
150 if (address1->as_u64[0] != address2->as_u64[0])
152 return address1->as_u64[1] == address2->as_u64[1];
164 vl_api_dhcp6_address_info_t *api_address;
165 u32 inner_status_code;
199 (
"Advertise message arrived with NoAddrsAvail status code");
205 for (
i = 0;
i < n_addresses;
i++)
208 address = (ip6_address_t *) api_address->address;
210 address_info = &address_list[
i];
212 address_info->preferred_lt = 0;
213 address_info->valid_lt = 0;
228 clib_warning (
"Reply message arrived with Server ID different "
229 "from that in Request or Renew message");
235 clib_warning (
"Reply message arrived with NoAddrsAvail status code");
239 (
"Invalid Reply message arrived: It contains NoAddrsAvail "
240 "status code but also contains addresses");
247 clib_warning (
"Reply message arrived with UnspecFail status code");
254 for (
i = 0;
i < n_addresses;
i++)
262 address = (ip6_address_t *) api_address->address;
273 u8 address_already_present = 0;
283 address_already_present = 1;
284 goto address_pool_foreach_out;
288 address_pool_foreach_out:
290 if (address_already_present)
294 address_info->
due_time = current_time;
312 address_info->
due_time = current_time;
322 &address_info->
address, 64, 0);
328 client_state->
T1 = ntohl (mp->
T1);
329 client_state->
T2 = ntohl (mp->
T2);
330 if (client_state->
T1 != 0)
332 if (client_state->
T2 != 0)
354 clib_memcpy (&address_list[pos], address_info,
sizeof (*address_info));
371 f64 sleep_time = 1e9;
376 uword *event_data = 0;
395 due_time = current_time + 1e9;
399 if (address_info->
due_time > current_time)
401 if (address_info->
due_time < due_time)
468 while (due_time < current_time);
470 sleep_time = due_time - current_time;
480 .name =
"dhcp6-client-cp-process",
531 "preferred lifetime: %u, valid lifetime: %u "
535 address_info->
due_time - current_time);
544 .path =
"show dhcp6 addresses",
545 .short_help =
"show dhcp6 addresses",
561 const char *rebinding;
573 buf1 =
format (buf1,
"%u remaining",
577 buf1 =
format (buf1,
"timeout");
579 buf2 =
format (buf2,
"%u remaining",
582 buf2 =
format (buf2,
"timeout");
584 rebinding =
", REBINDING";
589 "sw_if_index: %u, T1: %u (%v), "
590 "T2: %u (%v), server index: %d%s",
i,
591 cs->
T1, buf1, cs->
T2, buf2,
606 .path =
"show dhcp6 clients",
607 .short_help =
"show dhcp6 clients",
638 if (!old_enabled && enable)
651 else if (old_enabled && !enable)
712 else if (
unformat (line_input,
"disable"))
750 .path =
"dhcp6 client",
751 .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)
#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,...)