]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/Dhcp6Dxe/Dhcp6Io.h
554f0f5e5dc71113ad3eef8e5d5f45a5c435ddde
[mirror_edk2.git] / NetworkPkg / Dhcp6Dxe / Dhcp6Io.h
1 /** @file
2 Dhcp6 internal functions declaration.
3
4 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef __EFI_DHCP6_IO_H__
11 #define __EFI_DHCP6_IO_H__
12
13
14 /**
15 Clean up the specific nodes in the retry list.
16
17 @param[in] Instance The pointer to the Dhcp6 instance.
18 @param[in] Scope The scope of cleanup nodes.
19
20 **/
21 VOID
22 Dhcp6CleanupRetry (
23 IN DHCP6_INSTANCE *Instance,
24 IN UINT32 Scope
25 );
26
27 /**
28 Clean up the session of the instance stateful exchange.
29
30 @param[in, out] Instance The pointer to the Dhcp6 instance.
31 @param[in] Status The return status from udp.
32
33 **/
34 VOID
35 Dhcp6CleanupSession (
36 IN OUT DHCP6_INSTANCE *Instance,
37 IN EFI_STATUS Status
38 );
39
40 /**
41 Create the solicit message and send it.
42
43 @param[in] Instance The pointer to Dhcp6 instance.
44
45 @retval EFI_SUCCESS Create and send the solicit message successfully.
46 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
47 @retval Others Failed to send the solicit message.
48
49 **/
50 EFI_STATUS
51 Dhcp6SendSolicitMsg (
52 IN DHCP6_INSTANCE *Instance
53 );
54
55 /**
56 Create the request message and send it.
57
58 @param[in] Instance The pointer to the Dhcp6 instance.
59
60 @retval EFI_SUCCESS Create and send the request message successfully.
61 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
62 @retval EFI_DEVICE_ERROR An unexpected error.
63 @retval Others Failed to send the request message.
64
65 **/
66 EFI_STATUS
67 Dhcp6SendRequestMsg (
68 IN DHCP6_INSTANCE *Instance
69 );
70
71 /**
72 Create the renew/rebind message and send it.
73
74 @param[in] Instance The pointer to the Dhcp6 instance.
75 @param[in] RebindRequest If TRUE, it is a Rebind type message.
76 Otherwise, it is a Renew type message.
77
78 @retval EFI_SUCCESS Create and send the renew/rebind message successfully.
79 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
80 @retval EFI_DEVICE_ERROR An unexpected error.
81 @retval Others Failed to send the renew/rebind message.
82
83 **/
84 EFI_STATUS
85 Dhcp6SendRenewRebindMsg (
86 IN DHCP6_INSTANCE *Instance,
87 IN BOOLEAN RebindRequest
88 );
89
90 /**
91 Create the decline message and send it.
92
93 @param[in] Instance The pointer to the Dhcp6 instance.
94 @param[in] DecIa The pointer to the decline Ia.
95
96 @retval EFI_SUCCESS Create and send the decline message successfully.
97 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
98 @retval EFI_DEVICE_ERROR An unexpected error.
99 @retval Others Failed to send the decline message.
100
101 **/
102 EFI_STATUS
103 Dhcp6SendDeclineMsg (
104 IN DHCP6_INSTANCE *Instance,
105 IN EFI_DHCP6_IA *DecIa
106 );
107
108 /**
109 Create the release message and send it.
110
111 @param[in] Instance The pointer to the Dhcp6 instance.
112 @param[in] RelIa The pointer to the release Ia.
113
114 @retval EFI_SUCCESS Create and send the release message successfully.
115 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
116 @retval EFI_DEVICE_ERROR An unexpected error.
117 @retval Others Failed to send the release message.
118
119 **/
120 EFI_STATUS
121 Dhcp6SendReleaseMsg (
122 IN DHCP6_INSTANCE *Instance,
123 IN EFI_DHCP6_IA *RelIa
124 );
125
126 /**
127 Start the information request process.
128
129 @param[in] Instance The pointer to the Dhcp6 instance.
130 @param[in] SendClientId If TRUE, the client identifier option will be included in
131 information request message. Otherwise, the client identifier
132 option will not be included.
133 @param[in] OptionRequest The pointer to the option request option.
134 @param[in] OptionCount The number options in the OptionList.
135 @param[in] OptionList The array pointers to the appended options.
136 @param[in] Retransmission The pointer to the retransmission control.
137 @param[in] TimeoutEvent The event of timeout.
138 @param[in] ReplyCallback The callback function when the reply was received.
139 @param[in] CallbackContext The pointer to the parameter passed to the callback.
140
141 @retval EFI_SUCCESS Start the info-request process successfully.
142 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
143 @retval EFI_NO_MAPPING No source address is available for use.
144 @retval Others Failed to start the info-request process.
145
146 **/
147 EFI_STATUS
148 Dhcp6StartInfoRequest (
149 IN DHCP6_INSTANCE *Instance,
150 IN BOOLEAN SendClientId,
151 IN EFI_DHCP6_PACKET_OPTION *OptionRequest,
152 IN UINT32 OptionCount,
153 IN EFI_DHCP6_PACKET_OPTION *OptionList[] OPTIONAL,
154 IN EFI_DHCP6_RETRANSMISSION *Retransmission,
155 IN EFI_EVENT TimeoutEvent OPTIONAL,
156 IN EFI_DHCP6_INFO_CALLBACK ReplyCallback,
157 IN VOID *CallbackContext OPTIONAL
158 );
159
160 /**
161 Create the information request message and send it.
162
163 @param[in] Instance The pointer to the Dhcp6 instance.
164 @param[in] InfCb The pointer to the information request control block.
165 @param[in] SendClientId If TRUE, the client identifier option will be included in
166 information request message. Otherwise, the client identifier
167 option will not be included.
168 @param[in] OptionRequest The pointer to the option request option.
169 @param[in] OptionCount The number options in the OptionList.
170 @param[in] OptionList The array pointers to the appended options.
171 @param[in] Retransmission The pointer to the retransmission control.
172
173 @retval EFI_SUCCESS Create and send the info-request message successfully.
174 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
175 @retval Others Failed to send the info-request message.
176
177 **/
178 EFI_STATUS
179 Dhcp6SendInfoRequestMsg (
180 IN DHCP6_INSTANCE *Instance,
181 IN DHCP6_INF_CB *InfCb,
182 IN BOOLEAN SendClientId,
183 IN EFI_DHCP6_PACKET_OPTION *OptionRequest,
184 IN UINT32 OptionCount,
185 IN EFI_DHCP6_PACKET_OPTION *OptionList[],
186 IN EFI_DHCP6_RETRANSMISSION *Retransmission
187 );
188
189 /**
190 The receive callback function for the Dhcp6 exchange process.
191
192 @param[in] Udp6Wrap The pointer to the received net buffer.
193 @param[in] EndPoint The pointer to the udp end point.
194 @param[in] IoStatus The return status from udp io.
195 @param[in] Context The opaque parameter to the function.
196
197 **/
198 VOID
199 EFIAPI
200 Dhcp6ReceivePacket (
201 IN NET_BUF *Udp6Wrap,
202 IN UDP_END_POINT *EndPoint,
203 IN EFI_STATUS IoStatus,
204 IN VOID *Context
205 );
206
207 /**
208 The timer routine of the Dhcp6 instance for each second.
209
210 @param[in] Event The timer event.
211 @param[in] Context The opaque parameter to the function.
212
213 **/
214 VOID
215 EFIAPI
216 Dhcp6OnTimerTick (
217 IN EFI_EVENT Event,
218 IN VOID *Context
219 );
220
221 #endif