]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/Udp6Dxe/Udp6Impl.h
1. Add EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() support.
[mirror_edk2.git] / NetworkPkg / Udp6Dxe / Udp6Impl.h
1 /** @file
2 Udp6 driver's whole implementation and internal data structures.
3
4 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef _UDP6_IMPL_H_
17 #define _UDP6_IMPL_H_
18
19 #include <Uefi.h>
20
21 #include <Protocol/Ip6.h>
22 #include <Protocol/Udp6.h>
23
24 #include <Library/IpIoLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/UefiRuntimeServicesTableLib.h>
27 #include <Library/UefiBootServicesTableLib.h>
28 #include <Library/BaseLib.h>
29 #include <Library/UefiLib.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/MemoryAllocationLib.h>
32 #include <Library/DpcLib.h>
33 #include <Library/PrintLib.h>
34
35 #include "Udp6Driver.h"
36
37 extern EFI_COMPONENT_NAME2_PROTOCOL gUdp6ComponentName2;
38 extern EFI_COMPONENT_NAME_PROTOCOL gUdp6ComponentName;
39 extern EFI_UNICODE_STRING_TABLE *gUdp6ControllerNameTable;
40 extern EFI_SERVICE_BINDING_PROTOCOL mUdp6ServiceBinding;
41 extern EFI_UDP6_PROTOCOL mUdp6Protocol;
42 extern UINT16 mUdp6RandomPort;
43
44 //
45 // Define time out 50 milliseconds
46 //
47 #define UDP6_TIMEOUT_INTERVAL (50 * TICKS_PER_MS)
48 #define UDP6_HEADER_SIZE sizeof (EFI_UDP_HEADER)
49 #define UDP6_MAX_DATA_SIZE 65507
50 #define UDP6_PORT_KNOWN 1024
51
52 #define UDP6_SERVICE_DATA_SIGNATURE SIGNATURE_32 ('U', 'd', 'p', '6')
53 #define UDP6_INSTANCE_DATA_SIGNATURE SIGNATURE_32 ('U', 'd', 'p', 'S')
54
55 #define UDP6_SERVICE_DATA_FROM_THIS(a) \
56 CR ( \
57 (a), \
58 UDP6_SERVICE_DATA, \
59 ServiceBinding, \
60 UDP6_SERVICE_DATA_SIGNATURE \
61 )
62
63 #define UDP6_INSTANCE_DATA_FROM_THIS(a) \
64 CR ( \
65 (a), \
66 UDP6_INSTANCE_DATA, \
67 Udp6Proto, \
68 UDP6_INSTANCE_DATA_SIGNATURE \
69 )
70 //
71 // Udp6 service contest data
72 //
73 typedef struct _UDP6_SERVICE_DATA {
74 UINT32 Signature;
75 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
76 EFI_HANDLE ImageHandle;
77 EFI_HANDLE ControllerHandle;
78 LIST_ENTRY ChildrenList;
79 UINTN ChildrenNumber;
80 IP_IO *IpIo;
81 EFI_EVENT TimeoutEvent;
82 CHAR16 *MacString;
83 } UDP6_SERVICE_DATA;
84
85 typedef struct _UDP6_INSTANCE_DATA {
86 UINT32 Signature;
87 LIST_ENTRY Link;
88 UDP6_SERVICE_DATA *Udp6Service;
89 EFI_UDP6_PROTOCOL Udp6Proto;
90 EFI_UDP6_CONFIG_DATA ConfigData;
91 EFI_HANDLE ChildHandle;
92 BOOLEAN Configured;
93 BOOLEAN IsNoMapping;
94 NET_MAP TxTokens;
95 NET_MAP RxTokens;
96 NET_MAP McastIps;
97 LIST_ENTRY RcvdDgramQue;
98 LIST_ENTRY DeliveredDgramQue;
99 UINT16 HeadSum;
100 EFI_STATUS IcmpError;
101 IP_IO_IP_INFO *IpInfo;
102 BOOLEAN InDestroy;
103 } UDP6_INSTANCE_DATA;
104
105 typedef struct _UDP6_RXDATA_WRAP {
106 LIST_ENTRY Link;
107 NET_BUF *Packet;
108 UINT32 TimeoutTick;
109 EFI_UDP6_RECEIVE_DATA RxData;
110 } UDP6_RXDATA_WRAP;
111
112 typedef struct {
113 EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
114 UINTN NumberOfChildren;
115 EFI_HANDLE *ChildHandleBuffer;
116 } UDP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT;
117
118 /**
119 Clean the Udp service context data.
120
121 @param[in, out] Udp6Service Pointer to the UDP6_SERVICE_DATA.
122
123 **/
124 VOID
125 Udp6CleanService (
126 IN OUT UDP6_SERVICE_DATA *Udp6Service
127 );
128
129 /**
130 Create the Udp service context data.
131
132 @param[in] Udp6Service Pointer to the UDP6_SERVICE_DATA.
133 @param[in] ImageHandle The image handle of this udp6 driver.
134 @param[in] ControllerHandle The controller handle this udp6 driver binds on.
135
136 @retval EFI_SUCCESS The udp6 service context data was created and
137 initialized.
138 @retval EFI_OUT_OF_RESOURCES Cannot allocate memory.
139 @retval Others An error condition occurred.
140
141 **/
142 EFI_STATUS
143 Udp6CreateService (
144 IN UDP6_SERVICE_DATA *Udp6Service,
145 IN EFI_HANDLE ImageHandle,
146 IN EFI_HANDLE ControllerHandle
147 );
148
149 /**
150 Set the Udp6 variable data.
151
152 @param[in] Udp6Service Udp6 service data.
153
154 @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the
155 variable.
156 @retval other Set variable failed.
157
158 **/
159 EFI_STATUS
160 Udp6SetVariableData (
161 IN UDP6_SERVICE_DATA *Udp6Service
162 );
163
164 /**
165 This function cleans the udp instance.
166
167 @param[in, out] Instance Pointer to the UDP6_INSTANCE_DATA to clean.
168
169 **/
170 VOID
171 Udp6CleanInstance (
172 IN OUT UDP6_INSTANCE_DATA *Instance
173 );
174
175 /**
176 Clear the variable and free the resource.
177
178 @param[in, out] Udp6Service Udp6 service data.
179
180 **/
181 VOID
182 Udp6ClearVariableData (
183 IN OUT UDP6_SERVICE_DATA *Udp6Service
184 );
185
186 /**
187 This function intializes the new created udp instance.
188
189 @param[in] Udp6Service Pointer to the UDP6_SERVICE_DATA.
190 @param[in, out] Instance Pointer to the un-initialized UDP6_INSTANCE_DATA.
191
192 **/
193 VOID
194 Udp6InitInstance (
195 IN UDP6_SERVICE_DATA *Udp6Service,
196 IN OUT UDP6_INSTANCE_DATA *Instance
197 );
198
199 /**
200 This function reports the received ICMP error.
201
202 @param[in] Instance Pointer to the udp instance context data.
203
204 **/
205 VOID
206 Udp6ReportIcmpError (
207 IN UDP6_INSTANCE_DATA *Instance
208 );
209
210 /**
211 This function copies the current operational settings of this EFI UDPv6 Protocol
212 instance into user-supplied buffers. This function is used optionally to retrieve
213 the operational mode data of underlying networks or drivers.
214
215 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
216 @param[out] Udp6ConfigData The buffer in which the current UDP configuration
217 data is returned. This parameter is optional and
218 may be NULL.
219 @param[out] Ip6ModeData The buffer in which the current EFI IPv6 Protocol
220 mode data is returned. This parameter is optional
221 and may be NULL.
222 @param[out] MnpConfigData The buffer in which the current managed network
223 configuration data is returned. This parameter
224 is optional and may be NULL.
225 @param[out] SnpModeData The buffer in which the simple network mode data
226 is returned. This parameter is optional and may be NULL.
227
228 @retval EFI_SUCCESS The mode data was read.
229 @retval EFI_NOT_STARTED When Udp6ConfigData is queried, no configuration
230 data is available because this instance has not
231 been started.
232 @retval EFI_INVALID_PARAMETER This is NULL.
233
234 **/
235 EFI_STATUS
236 EFIAPI
237 Udp6GetModeData (
238 IN EFI_UDP6_PROTOCOL *This,
239 OUT EFI_UDP6_CONFIG_DATA *Udp6ConfigData OPTIONAL,
240 OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
241 OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
242 OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
243 );
244
245 /**
246 This function is used to do the following:
247 Initialize and start this instance of the EFI UDPv6 Protocol.
248 Change the filtering rules and operational parameters.
249 Reset this instance of the EFI UDPv6 Protocol.
250
251 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
252 @param[in] UdpConfigData Pointer to the buffer to set the configuration
253 data. This parameter is optional and may be NULL.
254
255 @retval EFI_SUCCESS The configuration settings were set, changed, or
256 reset successfully.
257 @retval EFI_NO_MAPPING When the UdpConifgData.UseAnyStationAddress is set
258 to true and there is no address available for IP6
259 driver to binding source address to this
260 instance.
261 @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
262 This is NULL.
263 UdpConfigData.StationAddress is not a valid
264 unicast IPv6 address.
265 UdpConfigData.RemoteAddress is not a valid unicast
266 IPv6 address, if it is not zero.
267 @retval EFI_ALREADY_STARTED The EFI UDPv6 Protocol instance is already
268 started/configured and must be stopped/reset
269 before it can be reconfigured. Only TrafficClass,
270 HopLimit, ReceiveTimeout, and TransmitTimeout can
271 be reconfigured without stopping the current
272 instance of the EFI UDPv6 Protocol.
273 @retval EFI_ACCESS_DENIED UdpConfigData.AllowDuplicatePort is FALSE, and
274 UdpConfigData.StationPort is already used by another
275 instance.
276 @retval EFI_OUT_OF_RESOURCES The EFI UDPv6 Protocol driver cannot allocate
277 memory for this EFI UDPv6 Protocol instance.
278 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred, and
279 this instance was not opened.
280
281 **/
282 EFI_STATUS
283 EFIAPI
284 Udp6Configure (
285 IN EFI_UDP6_PROTOCOL *This,
286 IN EFI_UDP6_CONFIG_DATA *UdpConfigData OPTIONAL
287 );
288
289 /**
290 This function places a sending request to this instance of the EFI UDPv6 Protocol,
291 alongside the transmit data that was filled by the user.
292
293 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
294 @param[in] Token Pointer to the completion token that will be
295 placed into the transmit queue.
296
297 @retval EFI_SUCCESS The data has been queued for transmission.
298 @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been
299 started.
300 @retval EFI_NO_MAPPING The under-layer IPv6 driver was responsible for
301 choosing a source address for this instance, but
302 no source address was available for use.
303 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
304 This is NULL. Token is NULL. Token.Event is NULL.
305 Token.Packet.TxData is NULL.
306 Token.Packet.TxData.FragmentCount is zero.
307 Token.Packet.TxData.DataLength is not equal to the
308 sum of fragment lengths.
309 One or more of the
310 Token.Packet.TxData.FragmentTable[]
311 .FragmentLength fields is zero.
312 One or more of the
313 Token.Packet.TxData.FragmentTable[]
314 .FragmentBuffer fields is NULL.
315 One or more of the
316 Token.Packet.TxData.UdpSessionData.
317 DestinationAddres are not valid unicast IPv6
318 addresses, if the UdpSessionData is not NULL.
319 Token.Packet.TxData.UdpSessionData.
320 DestinationAddres is NULL
321 Token.Packet.TxData.UdpSessionData.
322 DestinatioPort is zero.
323 Token.Packet.TxData.UdpSessionData is
324 NULL and this instance's
325 UdpConfigData.RemoteAddress is unspecified.
326 @retval EFI_ACCESS_DENIED The transmit completion token with the same
327 Token.Event is already in the transmit queue.
328 @retval EFI_NOT_READY The completion token could not be queued because
329 the transmit queue is full.
330 @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
331 @retval EFI_NOT_FOUND There is no route to the destination network or
332 address.
333 @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP
334 packet size. Or the length of the IP header + UDP
335 header + data length is greater than MTU if
336 DoNotFragment is TRUE.
337
338 **/
339 EFI_STATUS
340 EFIAPI
341 Udp6Transmit (
342 IN EFI_UDP6_PROTOCOL *This,
343 IN EFI_UDP6_COMPLETION_TOKEN *Token
344 );
345
346 /**
347 This function places a completion token into the receive packet queue. This function
348 is always asynchronous.
349
350 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
351 @param[in] Token Pointer to a token that is associated with the
352 receive data descriptor.
353
354 @retval EFI_SUCCESS The receive completion token is cached.
355 @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been
356 started.
357 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP,
358 BOOTP, RARP, etc.) is not finished yet.
359 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
360 This is NULL.
361 Token is NULL.
362 Token.Event is NULL.
363 @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued
364 due to a lack of system resources (usually
365 memory).
366 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
367 The EFI UDPv6 Protocol instance has been reset to
368 startup defaults.
369 @retval EFI_ACCESS_DENIED A receive completion token with the same
370 Token.Event is already in the receive queue.
371 @retval EFI_NOT_READY The receive request could not be queued because
372 the receive queue is full.
373
374 **/
375 EFI_STATUS
376 EFIAPI
377 Udp6Receive (
378 IN EFI_UDP6_PROTOCOL *This,
379 IN EFI_UDP6_COMPLETION_TOKEN *Token
380 );
381
382 /**
383 This function is used to abort a pending transmit or receive request.
384
385 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
386 @param[in] Token Pointer to a token that has been issued by
387 EFI_UDP6_PROTOCOL.Transmit() or
388 EFI_UDP6_PROTOCOL.Receive(). This parameter is
389 optional and may be NULL.
390
391 @retval EFI_SUCCESS The asynchronous I/O request is aborted and
392 Token.Event is signaled. When Token is NULL, all
393 pending requests are aborted and their events are
394 signaled.
395 @retval EFI_INVALID_PARAMETER This is NULL.
396 @retval EFI_NOT_STARTED This instance has not been started.
397 @retval EFI_NO_MAPPING When using the default address, configuration
398 (DHCP, BOOTP, RARP, etc.) is not finished yet.
399 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O
400 request is not found in the transmit or receive
401 queue. It either completed or was not issued by
402 Transmit() or Receive().
403
404 **/
405 EFI_STATUS
406 EFIAPI
407 Udp6Cancel (
408 IN EFI_UDP6_PROTOCOL *This,
409 IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL
410 );
411
412 /**
413 This function can be used by network drivers and applications to increase the rate that
414 data packets are moved between the communications device and the transmit/receive queues.
415
416 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
417
418 @retval EFI_SUCCESS Incoming or outgoing data was processed.
419 @retval EFI_INVALID_PARAMETER This is NULL.
420 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
421 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or
422 receive queue.
423
424 **/
425 EFI_STATUS
426 EFIAPI
427 Udp6Poll (
428 IN EFI_UDP6_PROTOCOL *This
429 );
430
431 /**
432 This function is used to enable and disable the multicast group filtering.
433
434 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
435 @param[in] JoinFlag Set to TRUE to join a multicast group. Set to
436 FALSE to leave one or all multicast groups.
437 @param[in] MulticastAddress Pointer to multicast group address to join or
438 leave. This parameter is optional and may be NULL.
439
440 @retval EFI_SUCCESS The operation completed successfully.
441 @retval EFI_NOT_STARTED The EFI UDPv6 Protocol instance has not been
442 started.
443 @retval EFI_OUT_OF_RESOURCES Could not allocate resources to join the group.
444 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
445 This is NULL. JoinFlag is TRUE and
446 MulticastAddress is NULL. JoinFlag is TRUE and
447 *MulticastAddress is not a valid multicast
448 address.
449 @retval EFI_ALREADY_STARTED The group address is already in the group table
450 (when JoinFlag is TRUE).
451 @retval EFI_NOT_FOUND The group address is not in the group table (when
452 JoinFlag is FALSE).
453 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
454
455 **/
456 EFI_STATUS
457 EFIAPI
458 Udp6Groups (
459 IN EFI_UDP6_PROTOCOL *This,
460 IN BOOLEAN JoinFlag,
461 IN EFI_IPv6_ADDRESS *MulticastAddress OPTIONAL
462 );
463
464 /**
465 This function tries to bind the udp instance according to the configured port
466 allocation stragety.
467
468 @param[in] InstanceList Pointer to the head of the list linking the udp
469 instances.
470 @param[in] ConfigData Pointer to the ConfigData of the instance to be
471 bound.
472
473 @retval EFI_SUCCESS The bound operation completed successfully.
474 @retval EFI_ACCESS_DENIED The <Address, Port> specified by the ConfigData is
475 already used by another instance.
476 @retval EFI_OUT_OF_RESOURCES No available port resources.
477
478 **/
479 EFI_STATUS
480 Udp6Bind (
481 IN LIST_ENTRY *InstanceList,
482 IN EFI_UDP6_CONFIG_DATA *ConfigData
483 );
484
485 /**
486 This function builds the Ip6 configdata from the Udp6ConfigData.
487
488 @param[in] Udp6ConfigData Pointer to the EFI_UDP6_CONFIG_DATA.
489 @param[in, out] Ip6ConfigData Pointer to the EFI_IP6_CONFIG_DATA.
490
491 **/
492 VOID
493 Udp6BuildIp6ConfigData (
494 IN EFI_UDP6_CONFIG_DATA *Udp6ConfigData,
495 IN OUT EFI_IP6_CONFIG_DATA *Ip6ConfigData
496 );
497
498 /**
499 This function checks whether the specified Token duplicates with the one in the Map.
500
501 @param[in] Map Pointer to the NET_MAP.
502 @param[in] Item Pointer to the NET_MAP_ITEM contain the pointer to
503 the Token.
504 @param[in] Context Pointer to the Token to be checked.
505
506 @retval EFI_SUCCESS The Token specified by Context differs from the
507 one in the Item.
508 @retval EFI_ACCESS_DENIED The Token duplicates with the one in the Item.
509
510 **/
511 EFI_STATUS
512 EFIAPI
513 Udp6TokenExist (
514 IN NET_MAP *Map,
515 IN NET_MAP_ITEM *Item,
516 IN VOID *Context
517 );
518
519 /**
520 This function removes the specified Token from the TokenMap.
521
522 @param[in] TokenMap Pointer to the NET_MAP containing the tokens.
523 @param[in] Token Pointer to the Token to be removed.
524
525 @retval EFI_SUCCESS The specified Token is removed from the TokenMap.
526 @retval EFI_NOT_FOUND The specified Token is not found in the TokenMap.
527
528 **/
529 EFI_STATUS
530 Udp6RemoveToken (
531 IN NET_MAP *TokenMap,
532 IN EFI_UDP6_COMPLETION_TOKEN *Token
533 );
534
535 /**
536 This function is used to check whether the NewConfigData has any un-reconfigurable
537 parameters changed compared to the OldConfigData.
538
539 @param[in] OldConfigData Pointer to the current ConfigData the udp instance
540 uses.
541 @param[in] NewConfigData Pointer to the new ConfigData.
542
543 @retval TRUE The instance is reconfigurable according to NewConfigData.
544 @retval FALSE The instance is not reconfigurable according to NewConfigData.
545
546 **/
547 BOOLEAN
548 Udp6IsReconfigurable (
549 IN EFI_UDP6_CONFIG_DATA *OldConfigData,
550 IN EFI_UDP6_CONFIG_DATA *NewConfigData
551 );
552
553 /**
554 This function removes the multicast group specified by Arg from the Map.
555
556 @param[in] Map Pointer to the NET_MAP.
557 @param[in] Item Pointer to the NET_MAP_ITEM.
558 @param[in] Arg Pointer to the Arg. It is the pointer to a
559 multicast IPv6 Address. This parameter is
560 optional and may be NULL.
561
562 @retval EFI_SUCCESS The multicast address is removed.
563 @retval EFI_ABORTED The specified multicast address is removed, and the
564 Arg is not NULL.
565
566 **/
567 EFI_STATUS
568 EFIAPI
569 Udp6LeaveGroup (
570 IN NET_MAP *Map,
571 IN NET_MAP_ITEM *Item,
572 IN VOID *Arg OPTIONAL
573 );
574
575 /**
576 This function validates the TxToken, it returns the error code according to the spec.
577
578 @param[in] Instance Pointer to the udp instance context data.
579 @param[in] TxToken Pointer to the token to be checked.
580
581 @retval EFI_SUCCESS The TxToken is valid.
582 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
583 Token.Event is NULL.
584 Token.Packet.TxData is NULL.
585 Token.Packet.TxData.FragmentCount is zero.
586 Token.Packet.TxData.DataLength is not equal to the
587 sum of fragment lengths.
588 One or more of the
589 Token.Packet.TxData.FragmentTable[].FragmentLength
590 fields is zero.
591 One or more of the
592 Token.Packet.TxData.FragmentTable[].FragmentBuffer
593 fields is NULL.
594 UdpSessionData.DestinationAddress are not valid
595 unicast IPv6 addresses if the UdpSessionData is
596 not NULL.
597 UdpSessionData.DestinationPort and
598 ConfigData.RemotePort are all zero if the
599 UdpSessionData is not NULL.
600 @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP
601 packet size.
602
603 **/
604 EFI_STATUS
605 Udp6ValidateTxToken (
606 IN UDP6_INSTANCE_DATA *Instance,
607 IN EFI_UDP6_COMPLETION_TOKEN *TxToken
608 );
609
610 /**
611 This function is a dummy ext-free function for the NET_BUF created for the output
612 udp datagram.
613
614 @param[in] Context Pointer to the context data.
615
616 **/
617 VOID
618 EFIAPI
619 Udp6NetVectorExtFree (
620 IN VOID *Context
621 );
622
623 /**
624 This function calculates the checksum for the Packet, utilizing the pre-calculated
625 pseudo header to reduce overhead.
626
627 @param[in] Packet Pointer to the NET_BUF contains the udp datagram.
628 @param[in] HeadSum Checksum of the pseudo header execpt the length
629 field.
630
631 @return The 16-bit checksum of this udp datagram.
632
633 **/
634 UINT16
635 Udp6Checksum (
636 IN NET_BUF *Packet,
637 IN UINT16 HeadSum
638 );
639
640 /**
641 This function delivers the received datagrams to the specified instance.
642
643 @param[in] Instance Pointer to the instance context data.
644
645 **/
646 VOID
647 Udp6InstanceDeliverDgram (
648 IN UDP6_INSTANCE_DATA *Instance
649 );
650
651 /**
652 Cancel Udp6 tokens from the Udp6 instance.
653
654 @param[in] Instance Pointer to the udp instance context data.
655 @param[in] Token Pointer to the token to be canceled. If NULL, all
656 tokens in this instance will be cancelled.
657 This parameter is optional and may be NULL.
658
659 @retval EFI_SUCCESS The Token is cancelled.
660 @retval EFI_NOT_FOUND The Token is not found.
661
662 **/
663 EFI_STATUS
664 Udp6InstanceCancelToken (
665 IN UDP6_INSTANCE_DATA *Instance,
666 IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL
667 );
668
669 /**
670 This function removes all the Wrap datas in the RcvdDgramQue.
671
672 @param[in] Instance Pointer to the Udp6 Instance.
673
674 **/
675 VOID
676 Udp6FlushRcvdDgram (
677 IN UDP6_INSTANCE_DATA *Instance
678 );
679
680 #endif
681