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
21 #include <dhcp/dhcp6_client_common_dp.h>
27 ip6_address_t address;
28 } dhcp6_send_client_message_params_address_t;
41 dhcp6_send_client_message_params_address_t *addresses;
42 } dhcp6_send_client_message_params_t;
47 u8 keep_sending_client_message; /* when true then next fields are valid */
48 dhcp6_send_client_message_params_t params;
49 f64 transaction_start;
55 vlib_buffer_t *buffer;
58 } dhcp6_ia_na_client_state_t;
62 dhcp6_ia_na_client_state_t *client_state_by_sw_if_index;
70 vlib_main_t *vlib_main;
71 vnet_main_t *vnet_main;
72 } dhcp6_ia_na_client_main_t;
74 extern dhcp6_ia_na_client_main_t dhcp6_ia_na_client_main;
78 ip6_address_t address;
82 } dhcp6_address_info_t;
86 dhcp6_report_common_t body;
88 dhcp6_address_info_t *addresses;
91 void dhcp6_send_client_message (vlib_main_t * vm, u32 sw_if_index, u8 stop,
92 dhcp6_send_client_message_params_t * params);
93 void dhcp6_set_publisher_node (uword node_index, uword event_type);
94 int dhcp6_publish_report (address_report_t * r);
95 int dhcp6_client_enable_disable (u32 sw_if_index, u8 enable);
97 extern vlib_node_registration_t dhcp6_reply_process_node;
100 { DHCP6_DP_REPLY_REPORT, DHCP6_DP_REPORT_MAX };
102 #include <dhcp/dhcp.api_types.h>
104 typedef struct _vnet_dhcp6_reply_function_list_elt
106 struct _vnet_dhcp6_reply_function_list_elt *next_dhcp6_reply_event_function;
107 clib_error_t *(*fp) (vl_api_dhcp6_reply_event_t * mp);
108 } _vnet_dhcp6_reply_event_function_list_elt_t;
112 _vnet_dhcp6_reply_event_function_list_elt_t *functions;
113 } dhcp6_ia_na_client_public_main_t;
115 extern dhcp6_ia_na_client_public_main_t dhcp6_ia_na_client_public_main;
117 #define VNET_DHCP6_REPLY_EVENT_FUNCTION(f) \
119 static void __vnet_dhcp6_reply_event_function_init_##f (void) \
120 __attribute__((__constructor__)) ; \
122 static void __vnet_dhcp6_reply_event_function_init_##f (void) \
124 dhcp6_ia_na_client_public_main_t * nm = &dhcp6_ia_na_client_public_main; \
125 static _vnet_dhcp6_reply_event_function_list_elt_t init_function; \
126 init_function.next_dhcp6_reply_event_function = nm->functions; \
127 nm->functions = &init_function; \
128 init_function.fp = (void *) &f; \
131 static void __vnet_dhcp6_reply_event_function_deinit_##f (void) \
132 __attribute__((__destructor__)) ; \
134 static void __vnet_dhcp6_reply_event_function_deinit_##f (void) \
136 dhcp6_ia_na_client_public_main_t * nm = &dhcp6_ia_na_client_public_main; \
137 _vnet_dhcp6_reply_event_function_list_elt_t *next; \
138 if (nm->functions->fp == (void *) &f) \
141 nm->functions->next_dhcp6_reply_event_function; \
144 next = nm->functions; \
145 while (next->next_dhcp6_reply_event_function) \
147 if (next->next_dhcp6_reply_event_function->fp == (void *) &f) \
149 next->next_dhcp6_reply_event_function = \
150 next->next_dhcp6_reply_event_function->next_dhcp6_reply_event_function; \
153 next = next->next_dhcp6_reply_event_function; \
157 #endif /* included_vnet_dhcp6_client_dp_h */
160 * fd.io coding-style-patch-verification: ON
163 * eval: (c-set-style "gnu")