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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef included_vnet_dhcp6_client_dp_h
17 #define included_vnet_dhcp6_client_dp_h
19 #include <vlib/vlib.h>
20 #include <vnet/dhcp/dhcp6_client_common_dp.h>
26 ip6_address_t address;
27 } dhcp6_send_client_message_params_address_t;
40 dhcp6_send_client_message_params_address_t *addresses;
41 } dhcp6_send_client_message_params_t;
46 u8 keep_sending_client_message; /* when true then next fields are valid */
47 dhcp6_send_client_message_params_t params;
48 f64 transaction_start;
54 vlib_buffer_t *buffer;
57 } dhcp6_ia_na_client_state_t;
61 dhcp6_ia_na_client_state_t *client_state_by_sw_if_index;
69 vlib_main_t *vlib_main;
70 vnet_main_t *vnet_main;
71 } dhcp6_ia_na_client_main_t;
73 extern dhcp6_ia_na_client_main_t dhcp6_ia_na_client_main;
77 ip6_address_t address;
81 } dhcp6_address_info_t;
85 dhcp6_report_common_t body;
87 dhcp6_address_info_t *addresses;
90 #define vl_typedefs /* define message structures */
91 #include <vnet/vnet_all_api_h.h>
94 void dhcp6_send_client_message (vlib_main_t * vm, u32 sw_if_index, u8 stop,
95 dhcp6_send_client_message_params_t * params);
96 void dhcp6_set_publisher_node (uword node_index, uword event_type);
97 int dhcp6_publish_report (address_report_t * r);
101 vl_api_want_dhcp6_reply_events_t_handler
102 (vl_api_want_dhcp6_reply_events_t * mp);
104 vl_api_dhcp6_send_client_message_t_handler
105 (vl_api_dhcp6_send_client_message_t * mp);
107 vl_api_dhcp6_clients_enable_disable_t_handler
108 (vl_api_dhcp6_clients_enable_disable_t * mp);
110 extern vlib_node_registration_t dhcp6_reply_process_node;
113 { DHCP6_DP_REPLY_REPORT, DHCP6_DP_REPORT_MAX };
115 typedef struct _vnet_dhcp6_reply_function_list_elt
117 struct _vnet_dhcp6_reply_function_list_elt *next_dhcp6_reply_event_function;
118 clib_error_t *(*fp) (vl_api_dhcp6_reply_event_t * mp);
119 } _vnet_dhcp6_reply_event_function_list_elt_t;
123 _vnet_dhcp6_reply_event_function_list_elt_t *functions;
124 } dhcp6_ia_na_client_public_main_t;
126 extern dhcp6_ia_na_client_public_main_t dhcp6_ia_na_client_public_main;
128 #define VNET_DHCP6_REPLY_EVENT_FUNCTION(f) \
130 static void __vnet_dhcp6_reply_event_function_init_##f (void) \
131 __attribute__((__constructor__)) ; \
133 static void __vnet_dhcp6_reply_event_function_init_##f (void) \
135 dhcp6_ia_na_client_public_main_t * nm = &dhcp6_ia_na_client_public_main; \
136 static _vnet_dhcp6_reply_event_function_list_elt_t init_function; \
137 init_function.next_dhcp6_reply_event_function = nm->functions; \
138 nm->functions = &init_function; \
139 init_function.fp = (void *) &f; \
142 static void __vnet_dhcp6_reply_event_function_deinit_##f (void) \
143 __attribute__((__destructor__)) ; \
145 static void __vnet_dhcp6_reply_event_function_deinit_##f (void) \
147 dhcp6_ia_na_client_public_main_t * nm = &dhcp6_ia_na_client_public_main; \
148 _vnet_dhcp6_reply_event_function_list_elt_t *next; \
149 if (nm->functions->fp == (void *) &f) \
152 nm->functions->next_dhcp6_reply_event_function; \
155 next = nm->functions; \
156 while (next->next_dhcp6_reply_event_function) \
158 if (next->next_dhcp6_reply_event_function->fp == (void *) &f) \
160 next->next_dhcp6_reply_event_function = \
161 next->next_dhcp6_reply_event_function->next_dhcp6_reply_event_function; \
164 next = next->next_dhcp6_reply_event_function; \
168 #endif /* included_vnet_dhcp6_client_dp_h */
171 * fd.io coding-style-patch-verification: ON
174 * eval: (c-set-style "gnu")