FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
dhcp6_pd_client_dp.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <vlib/vlib.h>
17 #include <dhcp/dhcp6_packet.h>
18 #include <dhcp/dhcp_proxy.h>
19 #include <vnet/mfib/mfib_table.h>
20 #include <vnet/mfib/ip6_mfib.h>
21 #include <vnet/fib/fib.h>
22 #include <vnet/adj/adj_mcast.h>
25 #include <vnet/ip/ip_types_api.h>
26 #include <vnet/ip/ip6_link.h>
27 
30 
31 static void
33 {
36  uword ni = cm->publisher_node;
37  uword et = cm->publisher_et;
38 
39  if (ni == (uword) ~ 0)
40  return;
41  prefix_report_t *q =
42  vlib_process_signal_event_data (vm, ni, et, 1, sizeof *q);
43 
44  *q = *r;
45 }
46 
47 int
49 {
50  void vl_api_rpc_call_main_thread (void *fp, u8 * data, u32 data_length);
52  return 0;
53 }
54 
55 void
57 {
59  cm->publisher_node = node_index;
60  cm->publisher_et = event_type;
61 }
62 
63 static void
65  dhcp6_pd_client_state_t * client_state)
66 {
67  u32 bi0;
68 
69  client_state->keep_sending_client_message = 0;
70  vec_free (client_state->params.prefixes);
71  if (client_state->buffer)
72  {
73  bi0 = vlib_get_buffer_index (vm, client_state->buffer);
74  vlib_buffer_free (vm, &bi0, 1);
75  client_state->buffer = 0;
76  adj_unlock (client_state->adj_index);
77  client_state->adj_index = ~0;
78  }
79 }
80 
81 static vlib_buffer_t *
85  * client_state, u32 type)
86 {
89  u32 bi;
91  udp_header_t *udp;
92  dhcpv6_header_t *dhcp;
93  const ip6_address_t *src_addr;
94  u32 dhcp_opt_len = 0;
95  client_state->transaction_start = vlib_time_now (vm);
96  u32 n_prefixes;
97  u32 i;
98 
99  /*
100  * Note: do NOT psychoanalyze link-state here.
101  * If the interface is down, let the driver turf the packet.
102  */
103 
104  /* Get a link-local address */
106 
107  if (src_addr->as_u8[0] != 0xfe)
108  {
109  clib_warning ("Could not find source address to send DHCPv6 packet");
110  return NULL;
111  }
112 
113  if (vlib_buffer_alloc (vm, &bi, 1) != 1)
114  {
115  clib_warning ("Buffer allocation failed");
116  return NULL;
117  }
118 
119  b = vlib_get_buffer (vm, bi);
120  vnet_buffer (b)->sw_if_index[VLIB_RX] = sw_if_index;
121  vnet_buffer (b)->sw_if_index[VLIB_TX] = sw_if_index;
124  sw_if_index);
125  vnet_buffer (b)->ip.adj_index[VLIB_TX] = client_state->adj_index;
126  b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
127 
129  udp = (udp_header_t *) (ip + 1);
130  dhcp = (dhcpv6_header_t *) (udp + 1);
131 
132  ip->src_address = *src_addr;
133  ip->hop_limit = 255;
134  ip->ip_version_traffic_class_and_flow_label =
135  clib_host_to_net_u32 (0x6 << 28);
136  ip->payload_length = 0;
137  ip->protocol = IP_PROTOCOL_UDP;
138 
139  udp->src_port = clib_host_to_net_u16 (DHCPV6_CLIENT_PORT);
140  udp->dst_port = clib_host_to_net_u16 (DHCPV6_SERVER_PORT);
141  udp->checksum = 0;
142  udp->length = 0;
143 
144  dhcp->msg_type = type;
145  dhcp->xid[0] = (client_state->transaction_id & 0x00ff0000) >> 16;
146  dhcp->xid[1] = (client_state->transaction_id & 0x0000ff00) >> 8;
147  dhcp->xid[2] = (client_state->transaction_id & 0x000000ff) >> 0;
148 
149  void *d = (void *) dhcp->data;
150  dhcpv6_option_t *duid;
151  dhcpv6_elapsed_t *elapsed;
152  dhcpv6_ia_header_t *ia_hdr;
153  dhcpv6_ia_opt_pd_t *opt_pd;
157  {
158  duid = (dhcpv6_option_t *) d;
159  duid->option = clib_host_to_net_u16 (DHCPV6_OPTION_CLIENTID);
160  duid->length = clib_host_to_net_u16 (CLIENT_DUID_LENGTH);
162  d += sizeof (*duid) + CLIENT_DUID_LENGTH;
163 
164  if (client_state->params.server_index != ~0)
165  {
166  server_id_t *se =
167  &ccm->server_ids[client_state->params.server_index];
168 
169  duid = (dhcpv6_option_t *) d;
170  duid->option = clib_host_to_net_u16 (DHCPV6_OPTION_SERVERID);
171  duid->length = clib_host_to_net_u16 (se->len);
172  clib_memcpy (duid + 1, se->data, se->len);
173  d += sizeof (*duid) + se->len;
174  }
175 
176  elapsed = (dhcpv6_elapsed_t *) d;
177  elapsed->opt.option = clib_host_to_net_u16 (DHCPV6_OPTION_ELAPSED_TIME);
178  elapsed->opt.length =
179  clib_host_to_net_u16 (sizeof (*elapsed) - sizeof (elapsed->opt));
180  elapsed->elapsed_10ms = 0;
181  client_state->elapsed_pos =
182  (char *) &elapsed->elapsed_10ms -
183  (char *) vlib_buffer_get_current (b);
184  d += sizeof (*elapsed);
185 
186  ia_hdr = (dhcpv6_ia_header_t *) d;
187  ia_hdr->opt.option = clib_host_to_net_u16 (DHCPV6_OPTION_IA_PD);
188  ia_hdr->iaid = clib_host_to_net_u32 (DHCPV6_CLIENT_IAID);
189  ia_hdr->t1 = clib_host_to_net_u32 (client_state->params.T1);
190  ia_hdr->t2 = clib_host_to_net_u32 (client_state->params.T2);
191  d += sizeof (*ia_hdr);
192 
193  n_prefixes = vec_len (client_state->params.prefixes);
194 
195  ia_hdr->opt.length =
196  clib_host_to_net_u16 (sizeof (*ia_hdr) +
197  n_prefixes * sizeof (*opt_pd) -
198  sizeof (ia_hdr->opt));
199 
200  for (i = 0; i < n_prefixes; i++)
201  {
203  &client_state->params.prefixes[i];
204  opt_pd = (dhcpv6_ia_opt_pd_t *) d;
205  opt_pd->opt.option = clib_host_to_net_u16 (DHCPV6_OPTION_IAPREFIX);
206  opt_pd->opt.length =
207  clib_host_to_net_u16 (sizeof (*opt_pd) - sizeof (opt_pd->opt));
208  opt_pd->addr = pref->prefix;
209  opt_pd->prefix = pref->prefix_length;
210  opt_pd->valid = clib_host_to_net_u32 (pref->valid_lt);
211  opt_pd->preferred = clib_host_to_net_u32 (pref->preferred_lt);
212  d += sizeof (*opt_pd);
213  }
214  }
215  else
216  {
217  clib_warning ("State not implemented");
218  }
219 
220  dhcp_opt_len = ((u8 *) d) - dhcp->data;
221  udp->length =
222  clib_host_to_net_u16 (sizeof (*udp) + sizeof (*dhcp) + dhcp_opt_len);
223  ip->payload_length = udp->length;
224  b->current_length =
225  sizeof (*ip) + sizeof (*udp) + sizeof (*dhcp) + dhcp_opt_len;
226 
227  ip->dst_address = all_dhcp6_relay_agents_and_servers;
228 
229  return b;
230 }
231 
232 static inline u8
234  dhcp6_pd_client_state_t * client_state,
235  f64 current_time, f64 * due_time)
236 {
237  vlib_buffer_t *p0;
238  vlib_frame_t *f;
239  u32 *to_next;
240  u32 next_index;
241  vlib_buffer_t *c0;
242  ip6_header_t *ip;
243  udp_header_t *udp;
244  u32 ci0;
245  int bogus_length = 0;
246 
248 
249  f64 now = vlib_time_now (vm);
250 
251  if (!client_state->keep_sending_client_message)
252  return false;
253 
254  params = &client_state->params;
255 
256  if (client_state->due_time > current_time)
257  {
258  *due_time = client_state->due_time;
259  return true;
260  }
261 
262  p0 = client_state->buffer;
263 
265 
266  c0 = vlib_buffer_copy (vm, p0);
267  if (c0 == NULL)
268  return client_state->keep_sending_client_message;
269 
270  ci0 = vlib_get_buffer_index (vm, c0);
271 
273  udp = (udp_header_t *) (ip + 1);
274 
275  u16 *elapsed_field = (u16 *) ((void *) ip + client_state->elapsed_pos);
276  *elapsed_field =
277  clib_host_to_net_u16 ((u16)
278  ((now - client_state->transaction_start) * 100));
279 
280  udp->checksum = 0;
281  udp->checksum =
282  ip6_tcp_udp_icmp_compute_checksum (vm, 0, ip, &bogus_length);
283 
285  to_next = vlib_frame_vector_args (f);
286  to_next[0] = ci0;
287  f->n_vectors = 1;
289 
290  if (params->mrc != 0 && --client_state->n_left == 0)
291  stop_sending_client_message (vm, client_state);
292  else
293  {
294  client_state->sleep_interval =
295  (2.0 + random_f64_from_to (-0.1, 0.1)) * client_state->sleep_interval;
296  if (client_state->sleep_interval > params->mrt)
297  client_state->sleep_interval =
298  (1.0 + random_f64_from_to (-0.1, 0.1)) * params->mrt;
299 
300  client_state->due_time = current_time + client_state->sleep_interval;
301 
302  if (params->mrd != 0
303  && current_time > client_state->start_time + params->mrd)
304  stop_sending_client_message (vm, client_state);
305  else
306  *due_time = client_state->due_time;
307  }
308 
309  return client_state->keep_sending_client_message;
310 }
311 
312 static uword
315  vlib_frame_t * f0)
316 {
318  dhcp6_pd_client_state_t *client_state;
319  uword *event_data = 0;
320  f64 sleep_time = 1e9;
321  f64 current_time;
322  f64 due_time;
323  f64 dt = 0;
324  int i;
325 
326  while (true)
327  {
329  vlib_process_get_events (vm, &event_data);
330  vec_reset_length (event_data);
331 
332  current_time = vlib_time_now (vm);
333  do
334  {
335  due_time = current_time + 1e9;
336  for (i = 0; i < vec_len (cm->client_state_by_sw_if_index); i++)
337  {
338  client_state = &cm->client_state_by_sw_if_index[i];
339  if (!client_state->entry_valid)
340  continue;
342  (vm, client_state, current_time, &dt) && (dt < due_time))
343  due_time = dt;
344  }
345  current_time = vlib_time_now (vm);
346  }
347  while (due_time < current_time);
348 
349  sleep_time = due_time - current_time;
350  }
351 
352  return 0;
353 }
354 
355 /* *INDENT-OFF* */
358  .type = VLIB_NODE_TYPE_PROCESS,
359  .name = "send-dhcp6-pd-client-message-process",
360 };
361 /* *INDENT-ON* */
362 
363 void
366 {
368  dhcp6_pd_client_state_t *client_state = 0;
369  dhcp6_pd_client_state_t empty_state = {
370  0,
371  };
372 
373  ASSERT (~0 != sw_if_index);
374 
375  vec_validate_init_empty (cm->client_state_by_sw_if_index, sw_if_index,
376  empty_state);
377  client_state = &cm->client_state_by_sw_if_index[sw_if_index];
378  if (!client_state->entry_valid)
379  {
380  client_state->entry_valid = 1;
381  client_state->adj_index = ~0;
382  }
383 
384  stop_sending_client_message (vm, client_state);
385 
386  if (!stop)
387  {
388  client_state->keep_sending_client_message = 1;
389  vec_free (client_state->params.prefixes);
390  client_state->params = *params;
391  client_state->params.prefixes = vec_dup (params->prefixes);
392  client_state->n_left = params->mrc;
393  client_state->start_time = vlib_time_now (vm);
394  client_state->sleep_interval =
395  (1 + random_f64_from_to (-0.1, 0.1)) * params->irt;
396  client_state->due_time = 0; /* send first packet ASAP */
397  client_state->transaction_id = random_u32 (&cm->seed) & 0x00ffffff;
398  client_state->buffer =
400  params->msg_type);
401  if (client_state->buffer)
404  }
405 }
406 
407 static clib_error_t *
409 {
411 
412  cm->vlib_main = vm;
413  cm->vnet_main = vnet_get_main ();
414  cm->publisher_node = ~0;
415  cm->seed = (u32) clib_cpu_time_now ();
416 
417  return 0;
418 }
419 
421 
422 /*
423  * fd.io coding-style-patch-verification: ON
424  *
425  * Local Variables:
426  * eval: (c-set-style "gnu")
427  * End:
428  */
vec_reset_length
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
Definition: vec_bootstrap.h:194
vlib.h
dhcp6_pd_send_client_message_params_prefix_t
Definition: dhcp6_pd_client_dp.h:22
vlib_frame_t::n_vectors
u16 n_vectors
Definition: node.h:387
vlib_buffer_free
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
Definition: buffer_funcs.h:979
udp_header_t::src_port
u16 src_port
Definition: udp_packet.h:48
fib.h
DHCPV6_MSG_REBIND
@ DHCPV6_MSG_REBIND
Definition: dhcp6_packet.h:41
udp_header_t::length
u16 length
Definition: udp_packet.h:51
stop_sending_client_message
static void stop_sending_client_message(vlib_main_t *vm, dhcp6_pd_client_state_t *client_state)
Definition: dhcp6_pd_client_dp.c:64
dhcp6_pd_send_client_message
void dhcp6_pd_send_client_message(vlib_main_t *vm, u32 sw_if_index, u8 stop, dhcp6_pd_send_client_message_params_t *params)
Definition: dhcp6_pd_client_dp.c:364
send_dhcp6_pd_client_message_process_node
static vlib_node_registration_t send_dhcp6_pd_client_message_process_node
(constructor) VLIB_REGISTER_NODE (send_dhcp6_pd_client_message_process_node)
Definition: dhcp6_pd_client_dp.c:356
ip6_tcp_udp_icmp_compute_checksum
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
Definition: ip6_forward.c:1096
vlib_buffer_copy
static vlib_buffer_t * vlib_buffer_copy(vlib_main_t *vm, vlib_buffer_t *b)
Definition: buffer_funcs.h:1078
clib_memcpy
#define clib_memcpy(d, s, n)
Definition: string.h:197
next_index
nat44_ei_hairpin_src_next_t next_index
Definition: nat44_ei_hairpinning.c:412
dhcp6_pd_send_client_message_params_t::prefixes
dhcp6_pd_send_client_message_params_prefix_t * prefixes
Definition: dhcp6_pd_client_dp.h:41
dhcp6_pd_client_state_t::elapsed_pos
u32 elapsed_pos
Definition: dhcp6_pd_client_dp.h:56
vlib_get_buffer
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:111
f
vlib_frame_t * f
Definition: interface_output.c:1098
dhcp6_pd_client_state_t::buffer
vlib_buffer_t * buffer
Definition: dhcp6_pd_client_dp.h:55
dhcp6_pd_send_client_message_params_t::mrt
u32 mrt
Definition: dhcp6_pd_client_dp.h:35
dhcp6_pd_client_state_t::n_left
u32 n_left
Definition: dhcp6_pd_client_dp.h:52
dhcp6_pd_client_public_main_t
Definition: dhcp6_pd_client_dp.h:117
dhcp6_pd_client_state_t::start_time
f64 start_time
Definition: dhcp6_pd_client_dp.h:53
adj_mcast_add_or_lock
adj_index_t adj_mcast_add_or_lock(fib_protocol_t proto, vnet_link_t link_type, u32 sw_if_index)
Mcast Adjacency.
Definition: adj_mcast.c:51
adj_mcast.h
prefix_report_t
Definition: dhcp6_pd_client_dp.h:85
dhcpv6_hdr_::xid
u8 xid[3]
Definition: dhcp6_packet.h:118
adj_unlock
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
Definition: adj.c:358
u16
unsigned short u16
Definition: types.h:57
dhcp6_pd_send_client_message_params_t
Definition: dhcp6_pd_client_dp.h:30
dhcpv6_hdr_::data
u8 data[0]
Definition: dhcp6_packet.h:119
server_id_t
Definition: dhcp6_client_common_dp.h:34
dhcp6_pd_send_client_message_params_t::mrc
u32 mrc
Definition: dhcp6_pd_client_dp.h:36
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
VLIB_RX
@ VLIB_RX
Definition: defs.h:46
node_index
node node_index
Definition: interface_output.c:440
DHCPV6_CLIENT_PORT
#define DHCPV6_CLIENT_PORT
Definition: dhcp6_packet.h:26
dhcp6_pd_send_client_message_params_t::server_index
u32 server_index
Definition: dhcp6_pd_client_dp.h:33
ccm
vlib_combined_counter_main_t * ccm
Definition: interface_output.c:416
r
vnet_hw_if_output_node_runtime_t * r
Definition: interface_output.c:1089
vlib_frame_t
Definition: node.h:372
vlib_get_frame_to_node
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
Definition: main.c:184
vlib_process_signal_event
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
Definition: node_funcs.h:1019
udp_header_t
Definition: udp_packet.h:45
dhcp6_pd_client_init
static clib_error_t * dhcp6_pd_client_init(vlib_main_t *vm)
Definition: dhcp6_pd_client_dp.c:408
check_pd_send_client_message
static u8 check_pd_send_client_message(vlib_main_t *vm, dhcp6_pd_client_state_t *client_state, f64 current_time, f64 *due_time)
Definition: dhcp6_pd_client_dp.c:233
DHCPV6_MSG_RELEASE
@ DHCPV6_MSG_RELEASE
Definition: dhcp6_packet.h:43
random_u32
static u32 random_u32(u32 *seed)
32-bit random number generator
Definition: random.h:69
ip6_mfib.h
dhcp6_pd_client_public_main
dhcp6_pd_client_public_main_t dhcp6_pd_client_public_main
Definition: dhcp6_pd_client_dp.c:29
vlib_process_get_events
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,...
Definition: node_funcs.h:583
vlib_put_frame_to_node
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
Definition: main.c:218
dhcp6_pd_send_client_message_params_t::msg_type
u8 msg_type
Definition: dhcp6_pd_client_dp.h:38
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
send_dhcp6_pd_client_message_process
static uword send_dhcp6_pd_client_message_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f0)
Definition: dhcp6_pd_client_dp.c:313
CLIENT_DUID_LENGTH
#define CLIENT_DUID_LENGTH
Definition: dhcp6_client_common_dp.h:59
vlib_buffer_alloc
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
Definition: buffer_funcs.h:702
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:441
vec_dup
#define vec_dup(V)
Return copy of vector (no header, no alignment)
Definition: vec.h:444
server_id_t::data
u8 * data
Definition: dhcp6_client_common_dp.h:36
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
src_addr
vl_api_mac_address_t src_addr
Definition: flow_types.api:64
vlib_get_buffer_index
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
Definition: buffer_funcs.h:324
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301
ip6_rewrite_mcast_node
vlib_node_registration_t ip6_rewrite_mcast_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_mcast_node)
Definition: ip6_forward.c:2227
dhcp6_pd_client_state_t
Definition: dhcp6_pd_client_dp.h:44
uword
u64 uword
Definition: types.h:112
dhcp6_pd_client_state_t::transaction_id
u32 transaction_id
Definition: dhcp6_pd_client_dp.h:54
dhcp6_pd_send_client_message_params_t::mrd
u32 mrd
Definition: dhcp6_pd_client_dp.h:37
if
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
dhcp6_pd_send_client_message_params_prefix_t::valid_lt
u32 valid_lt
Definition: dhcp6_pd_client_dp.h:25
f64
double f64
Definition: types.h:142
vlib_process_signal_event_data
static void * vlib_process_signal_event_data(vlib_main_t *vm, uword node_index, uword type_opaque, uword n_data_elts, uword n_data_elt_bytes)
Definition: node_funcs.h:913
cm
vnet_feature_config_main_t * cm
Definition: nat44_ei_hairpinning.c:594
DHCPV6_MSG_RENEW
@ DHCPV6_MSG_RENEW
Definition: dhcp6_packet.h:40
server_id_t::len
u16 len
Definition: dhcp6_client_common_dp.h:37
dhcp6_pd_client_state_t::sleep_interval
f64 sleep_interval
Definition: dhcp6_pd_client_dp.h:50
mfib_table.h
dhcp6_pd_client_state_t::due_time
f64 due_time
Definition: dhcp6_pd_client_dp.h:51
dhcp6_pd_client_dp.h
dhcp6_pd_set_publisher_node
void dhcp6_pd_set_publisher_node(uword node_index, uword event_type)
Definition: dhcp6_pd_client_dp.c:56
dhcp6_pd_client_main_t
Definition: dhcp6_pd_client_dp.h:60
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
dhcp6_pd_client_state_t::transaction_start
f64 transaction_start
Definition: dhcp6_pd_client_dp.h:49
vlib_buffer_t::current_length
u16 current_length
Nbytes between current data and the end of this buffer.
Definition: buffer.h:122
udp_header_t::checksum
u16 checksum
Definition: udp_packet.h:55
data
u8 data[128]
Definition: ipsec_types.api:95
dhcpv6_hdr_::msg_type
u8 msg_type
Definition: dhcp6_packet.h:117
dhcp6_pd_send_client_message_params_prefix_t::preferred_lt
u32 preferred_lt
Definition: dhcp6_pd_client_dp.h:24
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
dhcp6_pd_client_state_t::keep_sending_client_message
u8 keep_sending_client_message
Definition: dhcp6_pd_client_dp.h:47
dhcp6_pd_send_client_message_params_t::T1
u32 T1
Definition: dhcp6_pd_client_dp.h:39
dhcp6_pd_client_state_t::adj_index
u32 adj_index
Definition: dhcp6_pd_client_dp.h:57
all_dhcp6_relay_agents_and_servers
static const ip6_address_t all_dhcp6_relay_agents_and_servers
Definition: dhcp6_client_common_dp.h:80
dhcpv6_duid_ll_string_t::bin_string
char bin_string[10]
Definition: dhcp6_client_common_dp.h:55
vlib_process_wait_for_event_or_clock
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...
Definition: node_funcs.h:755
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
vec_validate_init_empty
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
Definition: vec.h:570
dhcp6_client_common_dp.h
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
udp_header_t::dst_port
u16 dst_port
Definition: udp_packet.h:48
dhcpv6_hdr_
Definition: dhcp6_packet.h:115
FIB_PROTOCOL_IP6
@ FIB_PROTOCOL_IP6
Definition: fib_types.h:37
dhcp6_pd_send_client_message_params_prefix_t::prefix_length
u8 prefix_length
Definition: dhcp6_pd_client_dp.h:27
vl_api_rpc_call_main_thread
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
Definition: vlib_api.c:620
VLIB_NODE_TYPE_PROCESS
@ VLIB_NODE_TYPE_PROCESS
Definition: node.h:84
dhcp6_pd_client_state_t::entry_valid
u8 entry_valid
Definition: dhcp6_pd_client_dp.h:46
ip6_header_t
Definition: ip6_packet.h:294
dhcp6_pd_client_state_t::params
dhcp6_pd_send_client_message_params_t params
Definition: dhcp6_pd_client_dp.h:48
client_duid
dhcpv6_duid_ll_string_t client_duid
Definition: dhcp6_client_common_dp.c:26
now
f64 now
Definition: nat44_ei_out2in.c:710
DHCPV6_SERVER_PORT
#define DHCPV6_SERVER_PORT
Definition: dhcp6_packet.h:27
vlib_main_t
Definition: main.h:102
dhcp_proxy.h
dhcp6_pd_publish_report
int dhcp6_pd_publish_report(prefix_report_t *r)
Definition: dhcp6_pd_client_dp.c:48
dhcp6_pd_send_client_message_params_t::irt
u32 irt
Definition: dhcp6_pd_client_dp.h:34
vlib_get_main
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:38
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
u8
unsigned char u8
Definition: types.h:56
DHCPV6_MSG_SOLICIT
@ DHCPV6_MSG_SOLICIT
Definition: dhcp6_packet.h:36
clib_error_t
Definition: clib_error.h:21
VNET_LINK_IP6
@ VNET_LINK_IP6
Definition: interface.h:348
vlib_buffer_get_current
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:257
rt
vnet_interface_output_runtime_t * rt
Definition: interface_output.c:419
ip
vl_api_address_t ip
Definition: l2.api:558
DHCPV6_CLIENT_IAID
#define DHCPV6_CLIENT_IAID
Definition: dhcp6_client_common_dp.h:60
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
dhcp6_pd_send_client_message_params_prefix_t::prefix
ip6_address_t prefix
Definition: dhcp6_pd_client_dp.h:26
dhcp6_pd_send_client_message_params_t::T2
u32 T2
Definition: dhcp6_pd_client_dp.h:40
i
int i
Definition: flowhash_template.h:376
dhcp6_packet.h
random_f64_from_to
static_always_inline f64 random_f64_from_to(f64 from, f64 to)
Definition: dhcp6_client_common_dp.h:68
clib_warning
#define clib_warning(format, args...)
Definition: error.h:59
dhcp6_pd_client_main
dhcp6_pd_client_main_t dhcp6_pd_client_main
Definition: dhcp6_pd_client_dp.c:28
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:327
vlib_node_runtime_t
Definition: node.h:454
dhcp6_client_common_main
dhcp6_client_common_main_t dhcp6_client_common_main
Definition: dhcp6_client_common_dp.c:25
clib_cpu_time_now
static u64 clib_cpu_time_now(void)
Definition: time.h:81
create_buffer_for_client_message
static vlib_buffer_t * create_buffer_for_client_message(vlib_main_t *vm, u32 sw_if_index, dhcp6_pd_client_state_t *client_state, u32 type)
Definition: dhcp6_pd_client_dp.c:82
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
ip_types_api.h
VLIB_TX
@ VLIB_TX
Definition: defs.h:47
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
DHCPV6_MSG_REQUEST
@ DHCPV6_MSG_REQUEST
Definition: dhcp6_packet.h:38
vlib_buffer_t::flags
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
Definition: buffer.h:133
dhcp6_client_common_main_t
Definition: dhcp6_client_common_dp.h:40
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169
signal_report
static void signal_report(prefix_report_t *r)
Definition: dhcp6_pd_client_dp.c:32