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_pd_client_dp_h
17 #define included_vnet_dhcp6_pd_client_dp_h
19 #include <vlib/vlib.h>
20 #include <dhcp/dhcp6_client_common_dp.h>
28 } dhcp6_pd_send_client_message_params_prefix_t;
41 dhcp6_pd_send_client_message_params_prefix_t *prefixes;
42 } dhcp6_pd_send_client_message_params_t;
47 u8 keep_sending_client_message; /* when true then next fields are valid */
48 dhcp6_pd_send_client_message_params_t params;
49 f64 transaction_start;
55 vlib_buffer_t *buffer;
58 } dhcp6_pd_client_state_t;
62 dhcp6_pd_client_state_t *client_state_by_sw_if_index;
70 vlib_main_t *vlib_main;
71 vnet_main_t *vnet_main;
72 } dhcp6_pd_client_main_t;
74 extern dhcp6_pd_client_main_t dhcp6_pd_client_main;
83 } dhcp6_prefix_info_t;
87 dhcp6_report_common_t body;
89 dhcp6_prefix_info_t *prefixes;
92 void dhcp6_pd_send_client_message (vlib_main_t * vm, u32 sw_if_index, u8 stop,
93 dhcp6_pd_send_client_message_params_t *
95 void dhcp6_pd_set_publisher_node (uword node_index, uword event_type);
96 int dhcp6_pd_publish_report (prefix_report_t * r);
97 int dhcp6_pd_client_enable_disable (u32 sw_if_index,
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,
103 extern vlib_node_registration_t dhcp6_pd_reply_process_node;
106 { DHCP6_PD_DP_REPLY_REPORT, DHCP6_PD_DP_REPORT_MAX };
108 #include <dhcp/dhcp.api_types.h>
110 typedef struct _vnet_dhcp6_pd_reply_function_list_elt
112 struct _vnet_dhcp6_pd_reply_function_list_elt
113 *next_dhcp6_pd_reply_event_function;
114 clib_error_t *(*fp) (vl_api_dhcp6_pd_reply_event_t * mp);
115 } _vnet_dhcp6_pd_reply_event_function_list_elt_t;
119 _vnet_dhcp6_pd_reply_event_function_list_elt_t *functions;
120 } dhcp6_pd_client_public_main_t;
122 extern dhcp6_pd_client_public_main_t dhcp6_pd_client_public_main;
124 #define VNET_DHCP6_PD_REPLY_EVENT_FUNCTION(f) \
126 static void __vnet_dhcp6_pd_reply_event_function_init_##f (void) \
127 __attribute__((__constructor__)) ; \
129 static void __vnet_dhcp6_pd_reply_event_function_init_##f (void) \
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; \
138 static void __vnet_dhcp6_pd_reply_event_function_deinit_##f (void) \
139 __attribute__((__destructor__)) ; \
141 static void __vnet_dhcp6_pd_reply_event_function_deinit_##f (void) \
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) \
148 nm->functions->next_dhcp6_pd_reply_event_function; \
151 next = nm->functions; \
152 while (next->next_dhcp6_pd_reply_event_function) \
154 if (next->next_dhcp6_pd_reply_event_function->fp == (void *) &f) \
156 next->next_dhcp6_pd_reply_event_function = \
157 next->next_dhcp6_pd_reply_event_function->next_dhcp6_pd_reply_event_function; \
160 next = next->next_dhcp6_pd_reply_event_function; \
164 #endif /* included_vnet_dhcp6_pd_client_dp_h */
167 * fd.io coding-style-patch-verification: ON
170 * eval: (c-set-style "gnu")