2 UDP4 Service Binding Protocol
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __EFI_UDP4_PROTOCOL_H__
16 #define __EFI_UDP4_PROTOCOL_H__
18 #include <Protocol/Ip4.h>
22 #define EFI_UDP4_SERVICE_BINDING_PROTOCOL_GUID \
24 0x83f01464, 0x99bd, 0x45e5, {0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6 } \
27 #define EFI_UDP4_PROTOCOL_GUID \
29 0x3ad9df29, 0x4501, 0x478d, {0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } \
32 typedef struct _EFI_UDP4_PROTOCOL EFI_UDP4_PROTOCOL
;
35 EFI_HANDLE InstanceHandle
;
36 EFI_IPv4_ADDRESS LocalAddress
;
38 EFI_IPv4_ADDRESS RemoteAddress
;
40 } EFI_UDP4_SERVICE_POINT
;
43 EFI_HANDLE DriverHandle
;
45 EFI_UDP4_SERVICE_POINT Services
[1];
46 } EFI_UDP4_VARIABLE_DATA
;
49 //ICMP error definitions
51 #define EFI_NETWORK_UNREACHABLE EFIERR(100)
52 #define EFI_HOST_UNREACHABLE EFIERR(101)
53 #define EFI_PROTOCOL_UNREACHABLE EFIERR(102)
54 #define EFI_PORT_UNREACHABLE EFIERR(103)
58 UINT32 FragmentLength
;
60 } EFI_UDP4_FRAGMENT_DATA
;
63 EFI_IPv4_ADDRESS SourceAddress
;
65 EFI_IPv4_ADDRESS DestinationAddress
;
66 UINT16 DestinationPort
;
67 } EFI_UDP4_SESSION_DATA
;
72 BOOLEAN AcceptBroadcast
;
73 BOOLEAN AcceptPromiscuous
;
74 BOOLEAN AcceptAnyPort
;
75 BOOLEAN AllowDuplicatePort
;
81 BOOLEAN DoNotFragment
;
82 UINT32 ReceiveTimeout
;
83 UINT32 TransmitTimeout
;
87 BOOLEAN UseDefaultAddress
;
88 EFI_IPv4_ADDRESS StationAddress
;
89 EFI_IPv4_ADDRESS SubnetMask
;
91 EFI_IPv4_ADDRESS RemoteAddress
;
93 } EFI_UDP4_CONFIG_DATA
;
96 EFI_UDP4_SESSION_DATA
*UdpSessionData
; //OPTIONAL
97 EFI_IPv4_ADDRESS
*GatewayAddress
; //OPTIONAL
100 EFI_UDP4_FRAGMENT_DATA FragmentTable
[1];
101 } EFI_UDP4_TRANSMIT_DATA
;
105 EFI_EVENT RecycleSignal
;
106 EFI_UDP4_SESSION_DATA UdpSession
;
108 UINT32 FragmentCount
;
109 EFI_UDP4_FRAGMENT_DATA FragmentTable
[1];
110 } EFI_UDP4_RECEIVE_DATA
;
117 EFI_UDP4_RECEIVE_DATA
*RxData
;
118 EFI_UDP4_TRANSMIT_DATA
*TxData
;
120 } EFI_UDP4_COMPLETION_TOKEN
;
123 Reads the current operational settings.
125 @param This Pointer to the EFI_UDP4_PROTOCOL instance.
126 @param Udp4ConfigData Pointer to the buffer to receive the current configuration data.
127 @param Ip4ModeData Pointer to the EFI IPv4 Protocol mode data structure.
128 @param MnpConfigData Pointer to the managed network configuration data structure.
129 @param SnpModeData Pointer to the simple network mode data structure.
131 @retval EFI_SUCCESS The mode data was read.
132 @retval EFI_NOT_STARTED When Udp4ConfigData is queried, no configuration data is
133 available because this instance has not been started.
134 @retval EFI_INVALID_PARAMETER This is NULL.
139 (EFIAPI
*EFI_UDP4_GET_MODE_DATA
) (
140 IN EFI_UDP4_PROTOCOL
*This
,
141 OUT EFI_UDP4_CONFIG_DATA
*Udp4ConfigData OPTIONAL
,
142 OUT EFI_IP4_MODE_DATA
*Ip4ModeData OPTIONAL
,
143 OUT EFI_MANAGED_NETWORK_CONFIG_DATA
*MnpConfigData OPTIONAL
,
144 OUT EFI_SIMPLE_NETWORK_MODE
*SnpModeData OPTIONAL
150 Initializes, changes, or resets the operational parameters for this instance of the EFI UDPv4
153 @param This Pointer to the EFI_UDP4_PROTOCOL instance.
154 @param Udp4ConfigData Pointer to the buffer to receive the current configuration data.
156 @retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.
157 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
158 RARP, etc.) is not finished yet.
159 @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
160 @retval EFI_ALREADY_STARTED The EFI UDPv4 Protocol instance is already started/configured
161 and must be stopped/reset before it can be reconfigured.
162 @retval EFI_ACCESS_DENIED UdpConfigData. AllowDuplicatePort is FALSE
163 and UdpConfigData.StationPort is already used by
165 @retval EFI_OUT_OF_RESOURCES The EFI UDPv4 Protocol driver cannot allocate memory for this
166 EFI UDPv4 Protocol instance.
167 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance
173 (EFIAPI
*EFI_UDP4_CONFIGURE
) (
174 IN EFI_UDP4_PROTOCOL
*This
,
175 IN EFI_UDP4_CONFIG_DATA
*UdpConfigData OPTIONAL
180 Joins and leaves multicast groups.
182 @param This Pointer to the EFI_UDP4_PROTOCOL instance.
183 @param JoinFlag Set to TRUE to join a multicast group. Set to FALSE to leave one
184 or all multicast groups.
185 @param MulticastAddress Pointer to multicast group address to join or leave.
187 @retval EFI_SUCCESS The operation completed successfully.
188 @retval EFI_NOT_STARTED The EFI UDPv4 Protocol instance has not been started.
189 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
190 RARP, etc.) is not finished yet.
191 @retval EFI_OUT_OF_RESOURCES Could not allocate resources to join the group.
192 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
194 - JoinFlag is TRUE and MulticastAddress is NULL.
195 - JoinFlag is TRUE and *MulticastAddress is not
196 a valid multicast address.
197 @retval EFI_ALREADY_STARTED The group address is already in the group table (when
199 @retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is
201 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
206 (EFIAPI
*EFI_UDP4_GROUPS
) (
207 IN EFI_UDP4_PROTOCOL
*This
,
209 IN EFI_IPv4_ADDRESS
*MulticastAddress OPTIONAL
214 Adds and deletes routing table entries.
216 @param This Pointer to the EFI_UDP4_PROTOCOL instance.
217 @param DeleteRoute Set to TRUE to delete this route from the routing table.
218 Set to FALSE to add this route to the routing table.
219 @param SubnetAddress The destination network address that needs to be routed.
220 @param SubnetMask The subnet mask of SubnetAddress.
221 @param GatewayAddress The gateway IP address for this route.
223 @retval EFI_SUCCESS The operation completed successfully.
224 @retval EFI_NOT_STARTED The EFI UDPv4 Protocol instance has not been started.
225 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
226 - RARP, etc.) is not finished yet.
227 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
228 @retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table.
229 @retval EFI_NOT_FOUND This route is not in the routing table.
230 @retval EFI_ACCESS_DENIED The route is already defined in the routing table.
235 (EFIAPI
*EFI_UDP4_ROUTES
) (
236 IN EFI_UDP4_PROTOCOL
*This
,
237 IN BOOLEAN DeleteRoute
,
238 IN EFI_IPv4_ADDRESS
*SubnetAddress
,
239 IN EFI_IPv4_ADDRESS
*SubnetMask
,
240 IN EFI_IPv4_ADDRESS
*GatewayAddress
245 Polls for incoming data packets and processes outgoing data packets.
247 @param This Pointer to the EFI_UDP4_PROTOCOL instance.
249 @retval EFI_SUCCESS Incoming or outgoing data was processed.
250 @retval EFI_INVALID_PARAMETER This is NULL.
251 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
252 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
257 (EFIAPI
*EFI_UDP4_POLL
) (
258 IN EFI_UDP4_PROTOCOL
*This
263 Places an asynchronous receive request into the receiving queue.
265 @param This Pointer to the EFI_UDP4_PROTOCOL instance.
266 @param Token Pointer to a token that is associated with the receive data
269 @retval EFI_SUCCESS The receive completion token was cached.
270 @retval EFI_NOT_STARTED This EFI UDPv4 Protocol instance has not been started.
271 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, RARP, etc.)
273 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
274 @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system
275 resources (usually memory).
276 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
277 @retval EFI_ACCESS_DENIED A receive completion token with the same Token.Event was already in
279 @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
284 (EFIAPI
*EFI_UDP4_RECEIVE
) (
285 IN EFI_UDP4_PROTOCOL
*This
,
286 IN EFI_UDP4_COMPLETION_TOKEN
*Token
291 Queues outgoing data packets into the transmit queue.
293 @param This Pointer to the EFI_UDP4_PROTOCOL instance.
294 @param Token Pointer to the completion token that will be placed into the
297 @retval EFI_SUCCESS The data has been queued for transmission.
298 @retval EFI_NOT_STARTED This EFI UDPv4 Protocol instance has not been started.
299 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
300 RARP, etc.) is not finished yet.
301 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
302 @retval EFI_ACCESS_DENIED The transmit completion token with the same
303 Token.Event was already in the transmit queue.
304 @retval EFI_NOT_READY The completion token could not be queued because the
305 transmit queue is full.
306 @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
307 @retval EFI_NOT_FOUND There is no route to the destination network or address.
308 @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP packet
309 size. Or the length of the IP header + UDP header + data
310 length is greater than MTU if DoNotFragment is TRUE.
315 (EFIAPI
*EFI_UDP4_TRANSMIT
) (
316 IN EFI_UDP4_PROTOCOL
*This
,
317 IN EFI_UDP4_COMPLETION_TOKEN
*Token
322 Aborts an asynchronous transmit or receive request.
324 @param This Pointer to the EFI_UDP4_PROTOCOL instance.
325 @param Token Pointer to a token that has been issued by
326 EFI_UDP4_PROTOCOL.Transmit() or
327 EFI_UDP4_PROTOCOL.Receive().If NULL, all pending
330 @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event
331 was signaled. When Token is NULL, all pending requests are
332 aborted and their events are signaled.
333 @retval EFI_INVALID_PARAMETER This is NULL.
334 @retval EFI_NOT_STARTED This instance has not been started.
335 @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
336 RARP, etc.) is not finished yet.
337 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
338 not found in the transmit or receive queue. It has either completed
339 or was not issued by Transmit() and Receive().
344 (EFIAPI
*EFI_UDP4_CANCEL
)(
345 IN EFI_UDP4_PROTOCOL
*This
,
346 IN EFI_UDP4_COMPLETION_TOKEN
*Token OPTIONAL
350 struct _EFI_UDP4_PROTOCOL
{
351 EFI_UDP4_GET_MODE_DATA GetModeData
;
352 EFI_UDP4_CONFIGURE Configure
;
353 EFI_UDP4_GROUPS Groups
;
354 EFI_UDP4_ROUTES Routes
;
355 EFI_UDP4_TRANSMIT Transmit
;
356 EFI_UDP4_RECEIVE Receive
;
357 EFI_UDP4_CANCEL Cancel
;
361 extern EFI_GUID gEfiUdp4ServiceBindingProtocolGuid
;
362 extern EFI_GUID gEfiUdp4ProtocolGuid
;