]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Udp6.h
11120501129c19885be79dbc6a5d114d8f92d31a
[mirror_edk2.git] / MdePkg / Include / Protocol / Udp6.h
1 /** @file
2 The EFI UDPv6 (User Datagram Protocol version 6) Protocol Definition, which is built upon
3 the EFI IPv6 Protocol and provides simple packet-oriented services to transmit and receive
4 UDP packets.
5
6 Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 @par Revision Reference:
16 This Protocol is introduced in UEFI Specification 2.2
17
18 **/
19
20 #ifndef __EFI_UDP6_PROTOCOL_H__
21 #define __EFI_UDP6_PROTOCOL_H__
22
23 #include <Protocol/Ip6.h>
24
25 #define EFI_UDP6_SERVICE_BINDING_PROTOCOL_GUID \
26 { \
27 0x66ed4721, 0x3c98, 0x4d3e, {0x81, 0xe3, 0xd0, 0x3d, 0xd3, 0x9a, 0x72, 0x54 } \
28 }
29
30 #define EFI_UDP6_PROTOCOL_GUID \
31 { \
32 0x4f948815, 0xb4b9, 0x43cb, {0x8a, 0x33, 0x90, 0xe0, 0x60, 0xb3, 0x49, 0x55 } \
33 }
34
35 typedef struct {
36 ///
37 /// The EFI UDPv6 Protocol instance handle that is using this address/port pair.
38 ///
39 EFI_HANDLE InstanceHandle;
40 ///
41 /// The IPv6 address to which this instance of the EFI UDPv6 Protocol is bound.
42 /// Set to 0::/128, if this instance is used to listen all packets from any
43 /// source address.
44 ///
45 EFI_IPv6_ADDRESS LocalAddress;
46 ///
47 /// The port number in host byte order on which the service is listening.
48 ///
49 UINT16 LocalPort;
50 ///
51 /// The IPv6 address of the remote host. May be 0::/128 if it is not connected
52 /// to any remote host or connected with more than one remote host.
53 ///
54 EFI_IPv6_ADDRESS RemoteAddress;
55 ///
56 /// The port number in host byte order on which the remote host is
57 /// listening. Maybe zero if it is not connected to any remote host.
58 ///
59 UINT16 RemotePort;
60 } EFI_UDP6_SERVICE_POINT;
61
62 typedef struct {
63 ///
64 /// The handle of the driver that creates this entry.
65 ///
66 EFI_HANDLE DriverHandle;
67 ///
68 /// The number of address/port pairs that follow this data structure.
69 ///
70 UINT32 ServiceCount;
71 ///
72 /// List of address/port pairs that are currently in use.
73 ///
74 EFI_UDP6_SERVICE_POINT Services[1];
75 } EFI_UDP6_VARIABLE_DATA;
76
77 typedef struct _EFI_UDP6_PROTOCOL EFI_UDP6_PROTOCOL;
78
79 ///
80 /// EFI_UDP6_FRAGMENT_DATA allows multiple receive or transmit buffers to be specified.
81 /// The purpose of this structure is to avoid copying the same packet multiple times.
82 ///
83 typedef struct {
84 UINT32 FragmentLength; ///< Length of the fragment data buffer.
85 VOID *FragmentBuffer; ///< Pointer to the fragment data buffer.
86 } EFI_UDP6_FRAGMENT_DATA;
87
88 ///
89 /// The EFI_UDP6_SESSION_DATA is used to retrieve the settings when receiving packets or
90 /// to override the existing settings (only DestinationAddress and DestinationPort can
91 /// be overridden) of this EFI UDPv6 Protocol instance when sending packets.
92 ///
93 typedef struct {
94 ///
95 /// Address from which this packet is sent. This field should not be used when
96 /// sending packets.
97 ///
98 EFI_IPv6_ADDRESS SourceAddress;
99 ///
100 /// Port from which this packet is sent. It is in host byte order. This field should
101 /// not be used when sending packets.
102 ///
103 UINT16 SourcePort;
104 ///
105 /// Address to which this packet is sent. When sending packet, it'll be ignored
106 /// if it is zero.
107 ///
108 EFI_IPv6_ADDRESS DestinationAddress;
109 ///
110 /// Port to which this packet is sent. When sending packet, it'll be
111 /// ignored if it is zero.
112 ///
113 UINT16 DestinationPort;
114 } EFI_UDP6_SESSION_DATA;
115
116 typedef struct {
117 ///
118 /// Set to TRUE to accept UDP packets that are sent to any address.
119 ///
120 BOOLEAN AcceptPromiscuous;
121 ///
122 /// Set to TRUE to accept UDP packets that are sent to any port.
123 ///
124 BOOLEAN AcceptAnyPort;
125 ///
126 /// Set to TRUE to allow this EFI UDPv6 Protocol child instance to open a port number
127 /// that is already being used by another EFI UDPv6 Protocol child instance.
128 ///
129 BOOLEAN AllowDuplicatePort;
130 ///
131 /// TrafficClass field in transmitted IPv6 packets.
132 ///
133 UINT8 TrafficClass;
134 ///
135 /// HopLimit field in transmitted IPv6 packets.
136 ///
137 UINT8 HopLimit;
138 ///
139 /// The receive timeout value (number of microseconds) to be associated with each
140 /// incoming packet. Zero means do not drop incoming packets.
141 ///
142 UINT32 ReceiveTimeout;
143 ///
144 /// The transmit timeout value (number of microseconds) to be associated with each
145 /// outgoing packet. Zero means do not drop outgoing packets.
146 ///
147 UINT32 TransmitTimeout;
148 ///
149 /// The station IP address that will be assigned to this EFI UDPv6 Protocol instance.
150 /// The EFI UDPv6 and EFI IPv6 Protocol drivers will only deliver incoming packets
151 /// whose destination matches this IP address exactly. Address 0::/128 is also accepted
152 /// as a special case. Under this situation, underlying IPv6 driver is responsible for
153 /// binding a source address to this EFI IPv6 protocol instance according to source
154 /// address selection algorithm. Only incoming packet from the selected source address
155 /// is delivered. This field can be set and changed only when the EFI IPv6 driver is
156 /// transitioning from the stopped to the started states. If no address is available
157 /// for selecting, the EFI IPv6 Protocol driver will use EFI_IP6_CONFIG_PROTOCOL to
158 /// retrieve the IPv6 address.
159 EFI_IPv6_ADDRESS StationAddress;
160 ///
161 /// The port number to which this EFI UDPv6 Protocol instance is bound. If a client
162 /// of the EFI UDPv6 Protocol does not care about the port number, set StationPort
163 /// to zero. The EFI UDPv6 Protocol driver will assign a random port number to transmitted
164 /// UDP packets. Ignored it if AcceptAnyPort is TRUE.
165 ///
166 UINT16 StationPort;
167 ///
168 /// The IP address of remote host to which this EFI UDPv6 Protocol instance is connecting.
169 /// If RemoteAddress is not 0::/128, this EFI UDPv6 Protocol instance will be connected to
170 /// RemoteAddress; i.e., outgoing packets of this EFI UDPv6 Protocol instance will be sent
171 /// to this address by default and only incoming packets from this address will be delivered
172 /// to client. Ignored for incoming filtering if AcceptPromiscuous is TRUE.
173 EFI_IPv6_ADDRESS RemoteAddress;
174 ///
175 /// The port number of the remote host to which this EFI UDPv6 Protocol instance is connecting.
176 /// If it is not zero, outgoing packets of this EFI UDPv6 Protocol instance will be sent to
177 /// this port number by default and only incoming packets from this port will be delivered
178 /// to client. Ignored if RemoteAddress is 0::/128 and ignored for incoming filtering if
179 /// AcceptPromiscuous is TRUE.
180 UINT16 RemotePort;
181 } EFI_UDP6_CONFIG_DATA;
182
183 ///
184 /// The EFI UDPv6 Protocol client must fill this data structure before sending a packet.
185 /// The packet may contain multiple buffers that may be not in a continuous memory location.
186 ///
187 typedef struct {
188 ///
189 /// If not NULL, the data that is used to override the transmitting settings.Only the two
190 /// filed UdpSessionData.DestinationAddress and UdpSessionData.DestionPort can be used as
191 /// the transmitting setting filed.
192 ///
193 EFI_UDP6_SESSION_DATA *UdpSessionData;
194 ///
195 /// Sum of the fragment data length. Must not exceed the maximum UDP packet size.
196 ///
197 UINT32 DataLength;
198 ///
199 /// Number of fragments.
200 ///
201 UINT32 FragmentCount;
202 ///
203 /// Array of fragment descriptors.
204 ///
205 EFI_UDP6_FRAGMENT_DATA FragmentTable[1];
206 } EFI_UDP6_TRANSMIT_DATA;
207
208 ///
209 /// EFI_UDP6_RECEIVE_DATA is filled by the EFI UDPv6 Protocol driver when this EFI UDPv6
210 /// Protocol instance receives an incoming packet. If there is a waiting token for incoming
211 /// packets, the CompletionToken.Packet.RxData field is updated to this incoming packet and
212 /// the CompletionToken.Event is signaled. The EFI UDPv6 Protocol client must signal the
213 /// RecycleSignal after processing the packet.
214 /// FragmentTable could contain multiple buffers that are not in the continuous memory locations.
215 /// The EFI UDPv6 Protocol client might need to combine two or more buffers in FragmentTable to
216 /// form their own protocol header.
217 ///
218 typedef struct {
219 ///
220 /// Time when the EFI UDPv6 Protocol accepted the packet.
221 ///
222 EFI_TIME TimeStamp;
223 ///
224 /// Indicates the event to signal when the received data has been processed.
225 ///
226 EFI_EVENT RecycleSignal;
227 ///
228 /// The UDP session data including SourceAddress, SourcePort, DestinationAddress,
229 /// and DestinationPort.
230 ///
231 EFI_UDP6_SESSION_DATA UdpSession;
232 ///
233 /// The sum of the fragment data length.
234 ///
235 UINT32 DataLength;
236 ///
237 /// Number of fragments. Maybe zero.
238 ///
239 UINT32 FragmentCount;
240 ///
241 /// Array of fragment descriptors. Maybe zero.
242 ///
243 EFI_UDP6_FRAGMENT_DATA FragmentTable[1];
244 } EFI_UDP6_RECEIVE_DATA;
245
246 ///
247 /// The EFI_UDP6_COMPLETION_TOKEN structures are used for both transmit and receive operations.
248 /// When used for transmitting, the Event and TxData fields must be filled in by the EFI UDPv6
249 /// Protocol client. After the transmit operation completes, the Status field is updated by the
250 /// EFI UDPv6 Protocol and the Event is signaled.
251 /// When used for receiving, only the Event field must be filled in by the EFI UDPv6 Protocol
252 /// client. After a packet is received, RxData and Status are filled in by the EFI UDPv6 Protocol
253 /// and the Event is signaled.
254 ///
255 typedef struct {
256 ///
257 /// This Event will be signaled after the Status field is updated by the EFI UDPv6 Protocol
258 /// driver. The type of Event must be EVT_NOTIFY_SIGNAL.
259 ///
260 EFI_EVENT Event;
261 ///
262 /// Will be set to one of the following values:
263 /// - EFI_SUCCESS: The receive or transmit operation completed successfully.
264 /// - EFI_ABORTED: The receive or transmit was aborted.
265 /// - EFI_TIMEOUT: The transmit timeout expired.
266 /// - EFI_NETWORK_UNREACHABLE: The destination network is unreachable. RxData is set to
267 /// NULL in this situation.
268 /// - EFI_HOST_UNREACHABLE: The destination host is unreachable. RxData is set to NULL in
269 /// this situation.
270 /// - EFI_PROTOCOL_UNREACHABLE: The UDP protocol is unsupported in the remote system.
271 /// RxData is set to NULL in this situation.
272 /// - EFI_PORT_UNREACHABLE: No service is listening on the remote port. RxData is set to
273 /// NULL in this situation.
274 /// - EFI_ICMP_ERROR: Some other Internet Control Message Protocol (ICMP) error report was
275 /// received. For example, packets are being sent too fast for the destination to receive them
276 /// and the destination sent an ICMP source quench report. RxData is set to NULL in this situation.
277 /// - EFI_DEVICE_ERROR: An unexpected system or network error occurred.
278 /// - EFI_SECURITY_VIOLATION: The transmit or receive was failed because of IPsec policy check.
279 /// - EFI_NO_MEDIA: There was a media error.
280 ///
281 EFI_STATUS Status;
282 union {
283 ///
284 /// When this token is used for receiving, RxData is a pointer to EFI_UDP6_RECEIVE_DATA.
285 ///
286 EFI_UDP6_RECEIVE_DATA *RxData;
287 ///
288 /// When this token is used for transmitting, TxData is a pointer to EFI_UDP6_TRANSMIT_DATA.
289 ///
290 EFI_UDP6_TRANSMIT_DATA *TxData;
291 } Packet;
292 } EFI_UDP6_COMPLETION_TOKEN;
293
294 /**
295 Read the current operational settings.
296
297 The GetModeData() function copies the current operational settings of this EFI UDPv6 Protocol
298 instance into user-supplied buffers. This function is used optionally to retrieve the operational
299 mode data of underlying networks or drivers.
300
301 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
302 @param[out] Udp6ConfigData The buffer in which the current UDP configuration data is returned.
303 @param[out] Ip6ModeData The buffer in which the current EFI IPv6 Protocol mode data is returned.
304 @param[out] MnpConfigData The buffer in which the current managed network configuration data is
305 returned.
306 @param[out] SnpModeData The buffer in which the simple network mode data is returned.
307
308 @retval EFI_SUCCESS The mode data was read.
309 @retval EFI_NOT_STARTED When Udp6ConfigData is queried, no configuration data is available
310 because this instance has not been started.
311 @retval EFI_INVALID_PARAMETER This is NULL.
312
313 **/
314 typedef
315 EFI_STATUS
316 (EFIAPI *EFI_UDP6_GET_MODE_DATA)(
317 IN EFI_UDP6_PROTOCOL *This,
318 OUT EFI_UDP6_CONFIG_DATA *Udp6ConfigData OPTIONAL,
319 OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
320 OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
321 OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
322 );
323
324 /**
325 Initializes, changes, or resets the operational parameters for this instance of the EFI UDPv6
326 Protocol.
327
328 The Configure() function is used to do the following:
329 - Initialize and start this instance of the EFI UDPv6 Protocol.
330 - Change the filtering rules and operational parameters.
331 - Reset this instance of the EFI UDPv6 Protocol.
332
333 Until these parameters are initialized, no network traffic can be sent or received by this instance.
334 This instance can be also reset by calling Configure() with UdpConfigData set to NULL.
335 Once reset, the receiving queue and transmitting queue are flushed and no traffic is allowed through
336 this instance.
337
338 With different parameters in UdpConfigData, Configure() can be used to bind this instance to specified
339 port.
340
341 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
342 @param[in] UdpConfigData Pointer to the buffer contained the configuration data.
343
344 @retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.
345 @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
346 address for this instance, but no source address was available for use.
347 @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
348 - This is NULL.
349 - UdpConfigData.StationAddress neither zero nor one of the configured IP
350 addresses in the underlying IPv6 driver.
351 - UdpConfigData.RemoteAddress is not a valid unicast IPv6 address if it
352 is not zero.
353 @retval EFI_ALREADY_STARTED The EFI UDPv6 Protocol instance is already started/configured and must be
354 stopped/reset before it can be reconfigured. Only TrafficClass, HopLimit,
355 ReceiveTimeout, and TransmitTimeout can be reconfigured without stopping
356 the current instance of the EFI UDPv6 Protocol.
357 @retval EFI_ACCESS_DENIED UdpConfigData.AllowDuplicatePort is FALSE and UdpConfigData.StationPort
358 is already used by other instance.
359 @retval EFI_OUT_OF_RESOURCES The EFI UDPv6 Protocol driver cannot allocate memory for this EFI UDPv6
360 Protocol instance.
361 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance was not
362 opened.
363
364 **/
365 typedef
366 EFI_STATUS
367 (EFIAPI *EFI_UDP6_CONFIGURE)(
368 IN EFI_UDP6_PROTOCOL *This,
369 IN EFI_UDP6_CONFIG_DATA *UdpConfigData OPTIONAL
370 );
371
372 /**
373 Joins and leaves multicast groups.
374
375 The Groups() function is used to join or leave one or more multicast group.
376 If the JoinFlag is FALSE and the MulticastAddress is NULL, then all currently joined groups are left.
377
378 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
379 @param[in] JoinFlag Set to TRUE to join a multicast group. Set to FALSE to leave one
380 or all multicast groups.
381 @param[in] MulticastAddress Pointer to multicast group address to join or leave.
382
383 @retval EFI_SUCCESS The operation completed successfully.
384 @retval EFI_NOT_STARTED The EFI UDPv6 Protocol instance has not been started.
385 @retval EFI_OUT_OF_RESOURCES Could not allocate resources to join the group.
386 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
387 - This is NULL.
388 - JoinFlag is TRUE and MulticastAddress is NULL.
389 - JoinFlag is TRUE and *MulticastAddress is not a valid multicast address.
390 @retval EFI_ALREADY_STARTED The group address is already in the group table (when JoinFlag is TRUE).
391 @retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is FALSE).
392 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
393
394 **/
395 typedef
396 EFI_STATUS
397 (EFIAPI *EFI_UDP6_GROUPS)(
398 IN EFI_UDP6_PROTOCOL *This,
399 IN BOOLEAN JoinFlag,
400 IN EFI_IPv6_ADDRESS *MulticastAddress OPTIONAL
401 );
402
403 /**
404 Queues outgoing data packets into the transmit queue.
405
406 The Transmit() function places a sending request to this instance of the EFI UDPv6 Protocol,
407 alongside the transmit data that was filled by the user. Whenever the packet in the token is
408 sent out or some errors occur, the Token.Event will be signaled and Token.Status is updated.
409 Providing a proper notification function and context for the event will enable the user to
410 receive the notification and transmitting status.
411
412 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
413 @param[in] Token Pointer to the completion token that will be placed into the
414 transmit queue.
415
416 @retval EFI_SUCCESS The data has been queued for transmission.
417 @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been started.
418 @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
419 address for this instance, but no source address was available
420 for use.
421 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
422 - This is NULL.
423 - Token is NULL.
424 - Token.Event is NULL.
425 - Token.Packet.TxData is NULL.
426 - Token.Packet.TxData.FragmentCount is zero.
427 - Token.Packet.TxData.DataLength is not equal to the sum of fragment
428 lengths.
429 - One or more of the Token.Packet.TxData.FragmentTable[].FragmentLength
430 fields is zero.
431 - One or more of the Token.Packet.TxData.FragmentTable[].FragmentBuffer
432 fields is NULL.
433 - Token.Packet.TxData.UdpSessionData.DestinationAddress is not zero
434 and is not valid unicast Ipv6 address if UdpSessionData is not NULL.
435 - Token.Packet.TxData.UdpSessionData is NULL and this instance's
436 UdpConfigData.RemoteAddress is unspecified.
437 - Token.Packet.TxData.UdpSessionData.DestinationAddress is non-zero
438 when DestinationAddress is configured as non-zero when doing Configure()
439 for this EFI Udp6 protocol instance.
440 - Token.Packet.TxData.UdpSesionData.DestinationAddress is zero when
441 DestinationAddress is unspecified when doing Configure() for this
442 EFI Udp6 protocol instance.
443 @retval EFI_ACCESS_DENIED The transmit completion token with the same Token.Event was already
444 in the transmit queue.
445 @retval EFI_NOT_READY The completion token could not be queued because the transmit queue
446 is full.
447 @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
448 @retval EFI_NOT_FOUND There is no route to the destination network or address.
449 @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP packet size.
450
451 **/
452 typedef
453 EFI_STATUS
454 (EFIAPI *EFI_UDP6_TRANSMIT)(
455 IN EFI_UDP6_PROTOCOL *This,
456 IN EFI_UDP6_COMPLETION_TOKEN *Token
457 );
458
459 /**
460 Places an asynchronous receive request into the receiving queue.
461
462 The Receive() function places a completion token into the receive packet queue. This function is
463 always asynchronous.
464 The caller must fill in the Token.Event field in the completion token, and this field cannot be
465 NULL. When the receive operation completes, the EFI UDPv6 Protocol driver updates the Token.Status
466 and Token.Packet.RxData fields and the Token.Event is signaled.
467 Providing a proper notification function and context for the event will enable the user to receive
468 the notification and receiving status. That notification function is guaranteed to not be re-entered.
469
470 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
471 @param[in] Token Pointer to a token that is associated with the receive data descriptor.
472
473 @retval EFI_SUCCESS The receive completion token was cached.
474 @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been started.
475 @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
476 address for this instance, but no source address was available
477 for use.
478 @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:
479 - This is NULL.
480 - Token is NULL.
481 - Token.Event is NULL.
482 @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system
483 resources (usually memory).
484 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI UDPv6 Protocol
485 instance has been reset to startup defaults.
486 @retval EFI_ACCESS_DENIED A receive completion token with the same Token.Event was already in
487 the receive queue.
488 @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
489
490 **/
491 typedef
492 EFI_STATUS
493 (EFIAPI *EFI_UDP6_RECEIVE)(
494 IN EFI_UDP6_PROTOCOL *This,
495 IN EFI_UDP6_COMPLETION_TOKEN *Token
496 );
497
498 /**
499 Aborts an asynchronous transmit or receive request.
500
501 The Cancel() function is used to abort a pending transmit or receive request. If the token is in the
502 transmit or receive request queues, after calling this function, Token.Status will be set to
503 EFI_ABORTED and then Token.Event will be signaled. If the token is not in one of the queues,
504 which usually means that the asynchronous operation has completed, this function will not signal the
505 token and EFI_NOT_FOUND is returned.
506
507 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
508 @param[in] Token Pointer to a token that has been issued by EFI_UDP6_PROTOCOL.Transmit()
509 or EFI_UDP6_PROTOCOL.Receive().If NULL, all pending tokens are aborted.
510
511 @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event was signaled.
512 When Token is NULL, all pending requests are aborted and their events
513 are signaled.
514 @retval EFI_INVALID_PARAMETER This is NULL.
515 @retval EFI_NOT_STARTED This instance has not been started.
516 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was not found in
517 the transmit or receive queue. It has either completed or was not issued
518 by Transmit() and Receive().
519
520 **/
521 typedef
522 EFI_STATUS
523 (EFIAPI *EFI_UDP6_CANCEL)(
524 IN EFI_UDP6_PROTOCOL *This,
525 IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL
526 );
527
528 /**
529 Polls for incoming data packets and processes outgoing data packets.
530
531 The Poll() function can be used by network drivers and applications to increase the rate that data
532 packets are moved between the communications device and the transmit and receive queues.
533 In some systems, the periodic timer event in the managed network driver may not poll the underlying
534 communications device fast enough to transmit and/or receive all data packets without missing incoming
535 packets or dropping outgoing packets. Drivers and applications that are experiencing packet loss should
536 try calling the Poll() function more often.
537
538 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
539
540 @retval EFI_SUCCESS Incoming or outgoing data was processed.
541 @retval EFI_INVALID_PARAMETER This is NULL.
542 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
543 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
544 Consider increasing the polling rate.
545
546 **/
547 typedef
548 EFI_STATUS
549 (EFIAPI *EFI_UDP6_POLL)(
550 IN EFI_UDP6_PROTOCOL *This
551 );
552
553 ///
554 /// The EFI_UDP6_PROTOCOL defines an EFI UDPv6 Protocol session that can be used by any network drivers,
555 /// applications, or daemons to transmit or receive UDP packets. This protocol instance can either be
556 /// bound to a specified port as a service or connected to some remote peer as an active client.
557 /// Each instance has its own settings, such as group table, that are independent from each other.
558 ///
559 struct _EFI_UDP6_PROTOCOL {
560 EFI_UDP6_GET_MODE_DATA GetModeData;
561 EFI_UDP6_CONFIGURE Configure;
562 EFI_UDP6_GROUPS Groups;
563 EFI_UDP6_TRANSMIT Transmit;
564 EFI_UDP6_RECEIVE Receive;
565 EFI_UDP6_CANCEL Cancel;
566 EFI_UDP6_POLL Poll;
567 };
568
569 extern EFI_GUID gEfiUdp6ServiceBindingProtocolGuid;
570 extern EFI_GUID gEfiUdp6ProtocolGuid;
571
572 #endif