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>
21 #define vl_typedefs /* define message structures */
22 #include <vnet/vnet_all_api_h.h>
31 } dhcp6_pd_send_client_message_params_prefix_t;
44 dhcp6_pd_send_client_message_params_prefix_t *prefixes;
45 } dhcp6_pd_send_client_message_params_t;
47 void dhcp6_pd_send_client_message (vlib_main_t * vm, u32 sw_if_index, u8 stop,
48 dhcp6_pd_send_client_message_params_t *
50 void dhcp6_pd_set_publisher_node (uword node_index, uword event_type);
51 void dhcp6_clients_enable_disable (u8 enable);
54 vl_api_want_dhcp6_pd_reply_events_t_handler
55 (vl_api_want_dhcp6_pd_reply_events_t * mp);
57 vl_api_dhcp6_pd_send_client_message_t_handler
58 (vl_api_dhcp6_pd_send_client_message_t * mp);
60 vl_api_dhcp6_clients_enable_disable_t_handler
61 (vl_api_dhcp6_clients_enable_disable_t * mp);
62 void vl_api_dhcp6_duid_ll_set_t_handler (vl_api_dhcp6_duid_ll_set_t * mp);
64 extern vlib_node_registration_t dhcp6_pd_reply_process_node;
67 { DHCP6_PD_DP_REPLY_REPORT, REPORT_MAX };
69 typedef struct _vnet_dhcp6_pd_reply_function_list_elt
71 struct _vnet_dhcp6_pd_reply_function_list_elt
72 *next_dhcp6_pd_reply_event_function;
73 clib_error_t *(*fp) (vl_api_dhcp6_pd_reply_event_t * mp);
74 } _vnet_dhcp6_pd_reply_event_function_list_elt_t;
78 _vnet_dhcp6_pd_reply_event_function_list_elt_t *functions;
79 } dhcp6_pd_client_public_main_t;
81 extern dhcp6_pd_client_public_main_t dhcp6_pd_client_public_main;
83 #define VNET_DHCP6_PD_REPLY_EVENT_FUNCTION(f) \
85 static void __vnet_dhcp6_pd_reply_event_function_init_##f (void) \
86 __attribute__((__constructor__)) ; \
88 static void __vnet_dhcp6_pd_reply_event_function_init_##f (void) \
90 dhcp6_pd_client_public_main_t * nm = &dhcp6_pd_client_public_main; \
91 static _vnet_dhcp6_pd_reply_event_function_list_elt_t init_function; \
92 init_function.next_dhcp6_pd_reply_event_function = nm->functions; \
93 nm->functions = &init_function; \
94 init_function.fp = (void *) &f; \
97 static void __vnet_dhcp6_pd_reply_event_function_deinit_##f (void) \
98 __attribute__((__destructor__)) ; \
100 static void __vnet_dhcp6_pd_reply_event_function_deinit_##f (void) \
102 dhcp6_pd_client_public_main_t * nm = &dhcp6_pd_client_public_main; \
103 _vnet_dhcp6_pd_reply_event_function_list_elt_t *next; \
104 if (nm->functions->fp == (void *) &f) \
107 nm->functions->next_dhcp6_pd_reply_event_function; \
110 next = nm->functions; \
111 while (next->next_dhcp6_pd_reply_event_function) \
113 if (next->next_dhcp6_pd_reply_event_function->fp == (void *) &f) \
115 next->next_dhcp6_pd_reply_event_function = \
116 next->next_dhcp6_pd_reply_event_function->next_dhcp6_pd_reply_event_function; \
119 next = next->next_dhcp6_pd_reply_event_function; \
123 #endif /* included_vnet_dhcp6_pd_client_dp_h */
126 * fd.io coding-style-patch-verification: ON
129 * eval: (c-set-style "gnu")