FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
dhcp6_pd_client_dp.h
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 #ifndef included_vnet_dhcp6_pd_client_dp_h
17 #define included_vnet_dhcp6_pd_client_dp_h
18 
19 #include <vlib/vlib.h>
21 
22 typedef struct
23 {
26  ip6_address_t prefix;
29 
30 typedef struct
31 {
43 
44 typedef struct
45 {
47  u8 keep_sending_client_message; /* when true then next fields are valid */
59 
60 typedef struct
61 {
63 
66 
68 
69  /* convenience */
73 
75 
76 typedef struct
77 {
78  ip6_address_t prefix;
84 
85 typedef struct
86 {
91 
94  params);
98  const u8 * prefix_group, u8 enable);
99 int dhcp6_cp_ip6_address_add_del (u32 sw_if_index, const u8 * prefix_group,
100  ip6_address_t address, u8 prefix_length,
101  u8 is_add);
102 
104 
105 enum
107 
108 #include <dhcp/dhcp.api_types.h>
109 
110 typedef struct _vnet_dhcp6_pd_reply_function_list_elt
111 {
112  struct _vnet_dhcp6_pd_reply_function_list_elt
113  *next_dhcp6_pd_reply_event_function;
115 } _vnet_dhcp6_pd_reply_event_function_list_elt_t;
116 
117 typedef struct
118 {
119  _vnet_dhcp6_pd_reply_event_function_list_elt_t *functions;
121 
123 
124 #define VNET_DHCP6_PD_REPLY_EVENT_FUNCTION(f) \
125  \
126 static void __vnet_dhcp6_pd_reply_event_function_init_##f (void) \
127  __attribute__((__constructor__)) ; \
128  \
129 static void __vnet_dhcp6_pd_reply_event_function_init_##f (void) \
130 { \
131  dhcp6_pd_client_public_main_t * nm = &dhcp6_pd_client_public_main; \
132  static _vnet_dhcp6_pd_reply_event_function_list_elt_t init_function; \
133  init_function.next_dhcp6_pd_reply_event_function = nm->functions; \
134  nm->functions = &init_function; \
135  init_function.fp = (void *) &f; \
136 } \
137  \
138 static void __vnet_dhcp6_pd_reply_event_function_deinit_##f (void) \
139  __attribute__((__destructor__)) ; \
140  \
141 static void __vnet_dhcp6_pd_reply_event_function_deinit_##f (void) \
142 { \
143  dhcp6_pd_client_public_main_t * nm = &dhcp6_pd_client_public_main; \
144  _vnet_dhcp6_pd_reply_event_function_list_elt_t *next; \
145  if (nm->functions->fp == (void *) &f) \
146  { \
147  nm->functions = \
148  nm->functions->next_dhcp6_pd_reply_event_function; \
149  return; \
150  } \
151  next = nm->functions; \
152  while (next->next_dhcp6_pd_reply_event_function) \
153  { \
154  if (next->next_dhcp6_pd_reply_event_function->fp == (void *) &f) \
155  { \
156  next->next_dhcp6_pd_reply_event_function = \
157  next->next_dhcp6_pd_reply_event_function->next_dhcp6_pd_reply_event_function; \
158  return; \
159  } \
160  next = next->next_dhcp6_pd_reply_event_function; \
161  } \
162 }
163 
164 #endif /* included_vnet_dhcp6_pd_client_dp_h */
165 
166 /*
167  * fd.io coding-style-patch-verification: ON
168  *
169  * Local Variables:
170  * eval: (c-set-style "gnu")
171  * End:
172  */
vlib.h
dhcp6_pd_send_client_message_params_prefix_t
Definition: dhcp6_pd_client_dp.h:22
dhcp6_pd_client_enable_disable
int dhcp6_pd_client_enable_disable(u32 sw_if_index, const u8 *prefix_group, u8 enable)
Definition: dhcp6_pd_client_cp.c:1238
dhcp6_pd_client_main_t::client_state_by_sw_if_index
dhcp6_pd_client_state_t * client_state_by_sw_if_index
Definition: dhcp6_pd_client_dp.h:62
prefix_report_t::n_prefixes
u32 n_prefixes
Definition: dhcp6_pd_client_dp.h:88
dhcp6_pd_client_main
dhcp6_pd_client_main_t dhcp6_pd_client_main
Definition: dhcp6_pd_client_dp.c:28
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
dhcp6_pd_client_public_main
dhcp6_pd_client_public_main_t dhcp6_pd_client_public_main
Definition: dhcp6_pd_client_dp.c:29
dhcp6_prefix_info_t::valid_time
u32 valid_time
Definition: dhcp6_pd_client_dp.h:80
prefix_report_t::body
dhcp6_report_common_t body
Definition: dhcp6_pd_client_dp.h:87
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
prefix_report_t
Definition: dhcp6_pd_client_dp.h:85
dhcp6_prefix_info_t::prefix
ip6_address_t prefix
Definition: dhcp6_pd_client_dp.h:78
u16
unsigned short u16
Definition: types.h:57
dhcp6_pd_send_client_message_params_t
Definition: dhcp6_pd_client_dp.h:30
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
node_index
node node_index
Definition: interface_output.c:440
dhcp6_pd_send_client_message_params_t::server_index
u32 server_index
Definition: dhcp6_pd_client_dp.h:33
r
vnet_hw_if_output_node_runtime_t * r
Definition: interface_output.c:1089
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
dhcp6_prefix_info_t::prefix_length
u8 prefix_length
Definition: dhcp6_pd_client_dp.h:79
dhcp6_pd_send_client_message_params_t::msg_type
u8 msg_type
Definition: dhcp6_pd_client_dp.h:38
dhcp6_pd_publish_report
int dhcp6_pd_publish_report(prefix_report_t *r)
Definition: dhcp6_pd_client_dp.c:48
prefix_report_t::prefixes
dhcp6_prefix_info_t * prefixes
Definition: dhcp6_pd_client_dp.h:89
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
dhcp6_pd_send_client_message_params_prefix_t::valid_lt
u32 valid_lt
Definition: dhcp6_pd_client_dp.h:25
dhcp6_prefix_info_t::preferred_time
u32 preferred_time
Definition: dhcp6_pd_client_dp.h:81
f64
double f64
Definition: types.h:142
address
manual_print typedef address
Definition: ip_types.api:96
dhcp6_pd_client_state_t::sleep_interval
f64 sleep_interval
Definition: dhcp6_pd_client_dp.h:50
dhcp6_pd_client_state_t::due_time
f64 due_time
Definition: dhcp6_pd_client_dp.h:51
dhcp6_prefix_info_t::status_code
u16 status_code
Definition: dhcp6_pd_client_dp.h:82
dhcp6_pd_client_main_t::vnet_main
vnet_main_t * vnet_main
Definition: dhcp6_pd_client_dp.h:71
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
dhcp6_report_common_t
Definition: dhcp6_client_common_dp.h:22
vnet_main_t
Definition: vnet.h:76
dhcp6_pd_send_client_message_params_prefix_t::preferred_lt
u32 preferred_lt
Definition: dhcp6_pd_client_dp.h:24
dhcp6_pd_client_state_t::keep_sending_client_message
u8 keep_sending_client_message
Definition: dhcp6_pd_client_dp.h:47
DHCP6_PD_DP_REPLY_REPORT
@ DHCP6_PD_DP_REPLY_REPORT
Definition: dhcp6_pd_client_dp.h:106
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
dhcp6_pd_send_client_message_params_t::sw_if_index
u32 sw_if_index
Definition: dhcp6_pd_client_dp.h:32
dhcp6_pd_client_main_t::seed
u32 seed
Definition: dhcp6_pd_client_dp.h:67
vl_api_dhcp6_pd_reply_event_t
Tell client about a DHCPv6 PD server reply event.
Definition: dhcp.api:490
dhcp6_client_common_dp.h
u32
unsigned int u32
Definition: types.h:88
dhcp6_pd_client_public_main_t::functions
_vnet_dhcp6_pd_reply_event_function_list_elt_t * functions
Definition: dhcp6_pd_client_dp.h:119
dhcp6_pd_send_client_message_params_prefix_t::prefix_length
u8 prefix_length
Definition: dhcp6_pd_client_dp.h:27
dhcp6_pd_client_main_t::publisher_et
uword publisher_et
Definition: dhcp6_pd_client_dp.h:65
dhcp6_pd_client_state_t::entry_valid
u8 entry_valid
Definition: dhcp6_pd_client_dp.h:46
dhcp6_pd_client_state_t::params
dhcp6_pd_send_client_message_params_t params
Definition: dhcp6_pd_client_dp.h:48
vlib_main_t
Definition: main.h:102
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_send_client_message_params_t::irt
u32 irt
Definition: dhcp6_pd_client_dp.h:34
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
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
dhcp6_prefix_info_t
Definition: dhcp6_pd_client_dp.h:76
dhcp6_pd_client_main_t::publisher_node
uword publisher_node
Definition: dhcp6_pd_client_dp.h:64
dhcp6_pd_reply_process_node
vlib_node_registration_t dhcp6_pd_reply_process_node
(constructor) VLIB_REGISTER_NODE (dhcp6_pd_reply_process_node)
Definition: dhcp_api.c:843
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
dhcp6_cp_ip6_address_add_del
int dhcp6_cp_ip6_address_add_del(u32 sw_if_index, const u8 *prefix_group, ip6_address_t address, u8 prefix_length, u8 is_add)
Definition: dhcp6_pd_client_cp.c:955
DHCP6_PD_DP_REPORT_MAX
@ DHCP6_PD_DP_REPORT_MAX
Definition: dhcp6_pd_client_dp.h:106
dhcp6_pd_client_main_t::vlib_main
vlib_main_t * vlib_main
Definition: dhcp6_pd_client_dp.h:70
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111