TianoCore EDK2 master
|
#include "Udp6Impl.h"
Go to the source code of this file.
Variables | |
UINT16 | mUdp6RandomPort |
Udp6 driver's whole implementation.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Udp6Impl.c.
EFI_STATUS Udp6Bind | ( | IN LIST_ENTRY * | InstanceList, |
IN EFI_UDP6_CONFIG_DATA * | ConfigData | ||
) |
This function tries to bind the udp instance according to the configured port allocation strategy.
[in] | InstanceList | Pointer to the head of the list linking the udp instances. |
[in] | ConfigData | Pointer to the ConfigData of the instance to be bound. |
EFI_SUCCESS | The bound operation completed successfully. |
EFI_ACCESS_DENIED | The <Address, Port> specified by the ConfigData is already used by other instance. |
EFI_OUT_OF_RESOURCES | No available port resources. |
Definition at line 587 of file Udp6Impl.c.
VOID Udp6BuildIp6ConfigData | ( | IN EFI_UDP6_CONFIG_DATA * | Udp6ConfigData, |
IN OUT EFI_IP6_CONFIG_DATA * | Ip6ConfigData | ||
) |
This function builds the Ip6 configdata from the Udp6ConfigData.
[in] | Udp6ConfigData | Pointer to the EFI_UDP6_CONFIG_DATA. |
[in,out] | Ip6ConfigData | Pointer to the EFI_IP6_CONFIG_DATA. |
Definition at line 726 of file Udp6Impl.c.
EFI_STATUS EFIAPI Udp6CancelTokens | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID *Arg | OPTIONAL | ||
) |
This function cancel the token specified by Arg in the Map.
[in] | Map | Pointer to the NET_MAP. |
[in] | Item | Pointer to the NET_MAP_ITEM. |
[in] | Arg | Pointer to the token to be cancelled, if NULL, all the tokens in this Map will be cancelled. This parameter is optional and may be NULL. |
EFI_SUCCESS | The token is cancelled if Arg is NULL or the token is not the same as that in the Item if Arg is not NULL. |
EFI_ABORTED | Arg is not NULL, and the token specified by Arg is cancelled. |
This function cancel the token specified by Arg in the Map.
[in] | Map | Pointer to the NET_MAP. |
[in] | Item | Pointer to the NET_MAP_ITEM. |
[in] | Arg | Pointer to the token to be cancelled. If NULL, all the tokens in this Map will be cancelled. This parameter is optional and may be NULL. |
EFI_SUCCESS | The token is cancelled if Arg is NULL, or the token is not the same as that in the Item, if Arg is not NULL. |
EFI_ABORTED | Arg is not NULL, and the token specified by Arg is cancelled. |
Definition at line 1130 of file Udp6Impl.c.
This function calculates the checksum for the Packet, utilizing the pre-calculated pseudo HeadSum to reduce some overhead.
[in] | Packet | Pointer to the NET_BUF contains the udp datagram. |
[in] | HeadSum | Checksum of the pseudo header, except the length field. |
Definition at line 916 of file Udp6Impl.c.
This function checks and timeouts the I/O datagrams holding by the corresponding service context.
[in] | Event | The event this function is registered to. |
[in] | Context | The context data registered during the creation of the Event. |
This function checks and times out the I/O datagrams listed in the UDP6_SERVICE_DATA which is specified by the input parameter Context.
[in] | Event | The event this function registered to. |
[in] | Context | The context data registered during the creation of the Event. |
Definition at line 410 of file Udp6Impl.c.
VOID Udp6CleanInstance | ( | IN OUT UDP6_INSTANCE_DATA * | Instance | ) |
This function cleans the udp instance.
[in,out] | Instance | Pointer to the UDP6_INSTANCE_DATA to clean. |
Definition at line 507 of file Udp6Impl.c.
VOID Udp6CleanService | ( | IN OUT UDP6_SERVICE_DATA * | Udp6Service | ) |
Clean the Udp service context data.
[in,out] | Udp6Service | Pointer to the UDP6_SERVICE_DATA. |
Definition at line 380 of file Udp6Impl.c.
EFI_STATUS Udp6CreateService | ( | IN UDP6_SERVICE_DATA * | Udp6Service, |
IN EFI_HANDLE | ImageHandle, | ||
IN EFI_HANDLE | ControllerHandle | ||
) |
Create the Udp service context data.
[in] | Udp6Service | Pointer to the UDP6_SERVICE_DATA. |
[in] | ImageHandle | The image handle of this udp6 driver. |
[in] | ControllerHandle | The controller handle this udp6 driver binds on. |
EFI_SUCCESS | The udp6 service context data was created and initialized. |
EFI_OUT_OF_RESOURCES | Cannot allocate memory. |
Others | An error condition occurred. |
Definition at line 285 of file Udp6Impl.c.
VOID Udp6DeliverDgram | ( | IN UDP6_SERVICE_DATA * | Udp6Service | ) |
This function delivers the datagrams enqueued in the instances.
[in] | Udp6Service | Pointer to the udp service context data. |
Definition at line 1551 of file Udp6Impl.c.
VOID Udp6Demultiplex | ( | IN UDP6_SERVICE_DATA * | Udp6Service, |
IN EFI_NET_SESSION_DATA * | NetSession, | ||
IN NET_BUF * | Packet | ||
) |
This function demultiplexes the received udp datagram to the appropriate instances.
[in] | Udp6Service | Pointer to the udp service context data. |
[in] | NetSession | Pointer to the EFI_NET_SESSION_DATA abstracted from the received datagram. |
[in] | Packet | Pointer to the buffer containing the received udp datagram. |
Definition at line 1586 of file Udp6Impl.c.
VOID EFIAPI Udp6DgramRcvd | ( | IN EFI_STATUS | Status, |
IN UINT8 | IcmpError, | ||
IN EFI_NET_SESSION_DATA * | NetSession, | ||
IN NET_BUF * | Packet, | ||
IN VOID * | Context | ||
) |
This function processes the received datagram passed up by the IpIo layer.
If NetSession is NULL, then ASSERT(). If Packet is NULL, then ASSERT(). If Context is NULL, then ASSERT().
[in] | Status | The status of this udp datagram. |
[in] | IcmpError | The IcmpError code, only available when Status is EFI_ICMP_ERROR. |
[in] | NetSession | Pointer to the EFI_NET_SESSION_DATA. |
[in] | Packet | Pointer to the NET_BUF containing the received udp datagram. |
[in] | Context | Pointer to the context data. |
Definition at line 1025 of file Udp6Impl.c.
VOID EFIAPI Udp6DgramSent | ( | IN EFI_STATUS | Status, |
IN VOID * | Context, | ||
IN IP_IO_IP_PROTOCOL | Sender, | ||
IN VOID * | NotifyData | ||
) |
This function is the packet transmitting notify function registered to the IpIo interface. It's called to signal the udp TxToken when the IpIo layer completes transmitting of the udp datagram.
If Context is NULL, then ASSERT(). If NotifyData is NULL, then ASSERT().
[in] | Status | The completion status of the output udp datagram. |
[in] | Context | Pointer to the context data. |
[in] | Sender | Specify a EFI_IP6_PROTOCOL for sending. |
[in] | NotifyData | Pointer to the notify data. |
This function is the packet transmitting notify function registered to the IpIo interface. It's called to signal the udp TxToken when IpIo layer completes the transmitting of the udp datagram.
If Context is NULL, then ASSERT(). If NotifyData is NULL, then ASSERT().
[in] | Status | The completion status of the output udp datagram. |
[in] | Context | Pointer to the context data. |
[in] | Sender | Specify a EFI_IP6_PROTOCOL for sending. |
[in] | NotifyData | Pointer to the notify data. |
Definition at line 982 of file Udp6Impl.c.
UINTN Udp6EnqueueDgram | ( | IN UDP6_SERVICE_DATA * | Udp6Service, |
IN NET_BUF * | Packet, | ||
IN EFI_UDP6_RECEIVE_DATA * | RxData | ||
) |
This function enqueues the received datagram into the instances' receiving queues.
[in] | Udp6Service | Pointer to the udp service context data. |
[in] | Packet | Pointer to the buffer containing the received datagram. |
[in] | RxData | Pointer to the EFI_UDP6_RECEIVE_DATA of this datagram. |
Definition at line 1437 of file Udp6Impl.c.
BOOLEAN Udp6FindInstanceByPort | ( | IN LIST_ENTRY * | InstanceList, |
IN EFI_IPv6_ADDRESS * | Address, | ||
IN UINT16 | Port | ||
) |
This function finds the udp instance by the specified <Address, Port> pair.
[in] | InstanceList | Pointer to the head of the list linking the udp instances. |
[in] | Address | Pointer to the specified IPv6 address. |
[in] | Port | The udp port number. |
TRUE | The specified <Address, Port> pair is found. |
FALSE | Otherwise. |
Definition at line 529 of file Udp6Impl.c.
VOID Udp6FlushRcvdDgram | ( | IN UDP6_INSTANCE_DATA * | Instance | ) |
This function removes all the Wrap datas in the RcvdDgramQue.
[in] | Instance | Pointer to the Udp6 Instance. |
Definition at line 1180 of file Udp6Impl.c.
VOID Udp6IcmpHandler | ( | IN UDP6_SERVICE_DATA * | Udp6Service, |
IN UINT8 | IcmpError, | ||
IN EFI_NET_SESSION_DATA * | NetSession, | ||
IN OUT NET_BUF * | Packet | ||
) |
This function handles the received Icmp Error message and demultiplexes it to the instance.
[in] | Udp6Service | Pointer to the udp service context data. |
[in] | IcmpError | The icmp error code. |
[in] | NetSession | Pointer to the EFI_NET_SESSION_DATA abstracted from the received Icmp Error packet. |
[in,out] | Packet | Pointer to the Icmp Error packet. |
This function handles the received Icmp Error message and de-multiplexes it to the instance.
[in] | Udp6Service | Pointer to the udp service context data. |
[in] | IcmpError | The icmp error code. |
[in] | NetSession | Pointer to the EFI_NET_SESSION_DATA abstracted from the received Icmp Error packet. |
[in,out] | Packet | Pointer to the Icmp Error packet. |
Definition at line 1837 of file Udp6Impl.c.
VOID Udp6InitInstance | ( | IN UDP6_SERVICE_DATA * | Udp6Service, |
IN OUT UDP6_INSTANCE_DATA * | Instance | ||
) |
This function initializes the new created udp instance.
[in] | Udp6Service | Pointer to the UDP6_SERVICE_DATA. |
[in,out] | Instance | Pointer to the un-initialized UDP6_INSTANCE_DATA. |
Definition at line 465 of file Udp6Impl.c.
EFI_STATUS Udp6InstanceCancelToken | ( | IN UDP6_INSTANCE_DATA * | Instance, |
IN EFI_UDP6_COMPLETION_TOKEN *Token | OPTIONAL | ||
) |
Cancel Udp6 tokens from the Udp6 instance.
[in] | Instance | Pointer to the udp instance context data. |
[in] | Token | Pointer to the token to be canceled. If NULL, all tokens in this instance will be cancelled. This parameter is optional and may be NULL. |
EFI_SUCCESS | The Token is cancelled. |
EFI_NOT_FOUND | The Token is not found. |
Definition at line 1212 of file Udp6Impl.c.
VOID Udp6InstanceDeliverDgram | ( | IN UDP6_INSTANCE_DATA * | Instance | ) |
This function delivers the received datagrams to the specified instance.
[in] | Instance | Pointer to the instance context data. |
Definition at line 1487 of file Udp6Impl.c.
BOOLEAN Udp6IsReconfigurable | ( | IN EFI_UDP6_CONFIG_DATA * | OldConfigData, |
IN EFI_UDP6_CONFIG_DATA * | NewConfigData | ||
) |
This function is used to check whether the NewConfigData has any un-reconfigurable parameters changed compared to the OldConfigData.
[in] | OldConfigData | Pointer to the current ConfigData the udp instance uses. |
[in] | NewConfigData | Pointer to the new ConfigData. |
TRUE | The instance is reconfigurable according to the NewConfigData. |
FALSE | Otherwise. |
Definition at line 662 of file Udp6Impl.c.
EFI_STATUS EFIAPI Udp6LeaveGroup | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID *Arg | OPTIONAL | ||
) |
This function removes the multicast group specified by Arg from the Map.
[in] | Map | Pointer to the NET_MAP. |
[in] | Item | Pointer to the NET_MAP_ITEM. |
[in] | Arg | Pointer to the Arg, it's the pointer to a multicast IPv6 Address. This parameter is optional and may be NULL. |
EFI_SUCCESS | The multicast address is removed. |
EFI_ABORTED | The specified multicast address is removed, and the Arg is not NULL. |
Definition at line 1074 of file Udp6Impl.c.
NET_MAP_ITEM * Udp6MapMultiCastAddr | ( | IN NET_MAP * | Map, |
IN VOID * | Key | ||
) |
Find the key in the netmap
[in] | Map | The netmap to search within. |
[in] | Key | The key to search. |
Find the key in the netmap.
[in] | Map | The netmap to search within. |
[in] | Key | The key to search. |
Definition at line 1965 of file Udp6Impl.c.
BOOLEAN Udp6MatchDgram | ( | IN UDP6_INSTANCE_DATA * | Instance, |
IN EFI_UDP6_SESSION_DATA * | Udp6Session | ||
) |
This function check if the received udp datagram matches with the Instance.
[in] | Instance | Pointer to the udp instance context data. |
[in] | Udp6Session | Pointer to the EFI_UDP6_SESSION_DATA abstracted from the received udp datagram. |
TRUE | The udp datagram matches the receiving requirements of the Instance. |
FALSE | The udp datagram doe not match the receiving requirements of the Instance. |
This function checks if the received udp datagram matches with the Instance.
[in] | Instance | Pointer to the udp instance context data. |
[in] | Udp6Session | Pointer to the EFI_UDP6_SESSION_DATA abstracted from the received udp datagram. |
TRUE | The udp datagram matches the receiving requirements of the Instance. |
FALSE | The udp datagram does not match the receiving requirements of the Instance. |
Definition at line 1267 of file Udp6Impl.c.
VOID EFIAPI Udp6NetVectorExtFree | ( | IN VOID * | Context | ) |
This function is a dummy ext-free function for the NET_BUF created for the output udp datagram.
[in] | Context | Pointer to the context data. |
Definition at line 1949 of file Udp6Impl.c.
This function removes the Wrap specified by Context and releases relevant resources.
[in] | Event | The Event this notify function is registered to. |
[in] | Context | Pointer to the context data. |
This function removes the Wrap specified by Context and release relevant resources.
[in] | Event | The Event this notify function registered to. |
[in] | Context | Pointer to the context data. |
Definition at line 1339 of file Udp6Impl.c.
EFI_STATUS Udp6RemoveToken | ( | IN NET_MAP * | TokenMap, |
IN EFI_UDP6_COMPLETION_TOKEN * | Token | ||
) |
This function removes the specified Token from the TokenMap.
[in] | TokenMap | Pointer to the NET_MAP containing the tokens. |
[in] | Token | Pointer to the Token to be removed. |
EFI_SUCCESS | The specified Token is removed from the TokenMap. |
EFI_NOT_FOUND | The specified Token is not found in the TokenMap. |
Definition at line 942 of file Udp6Impl.c.
VOID Udp6ReportIcmpError | ( | IN UDP6_INSTANCE_DATA * | Instance | ) |
This function reports the received ICMP error.
[in] | Instance | Pointer to the udp instance context data. |
Definition at line 1906 of file Udp6Impl.c.
VOID Udp6SendPortUnreach | ( | IN IP_IO * | IpIo, |
IN EFI_NET_SESSION_DATA * | NetSession, | ||
IN VOID * | Udp6Header | ||
) |
This function builds and sends out a icmp port unreachable message.
[in] | IpIo | Pointer to the IP_IO instance. |
[in] | NetSession | Pointer to the EFI_NET_SESSION_DATA of the packet causes this icmp error message. |
[in] | Udp6Header | Pointer to the udp header of the datagram causes this icmp error message. |
Definition at line 1683 of file Udp6Impl.c.
EFI_STATUS EFIAPI Udp6TokenExist | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID * | Context | ||
) |
This function checks whether the specified Token duplicates the one in the Map.
[in] | Map | Pointer to the NET_MAP. |
[in] | Item | Pointer to the NET_MAP_ITEM contain the pointer to the Token. |
[in] | Context | Pointer to the Token to be checked. |
EFI_SUCCESS | The Token specified by Context differs from the one in the Item. |
EFI_ACCESS_DENIED | The Token duplicates with the one in the Item. |
Definition at line 881 of file Udp6Impl.c.
EFI_STATUS Udp6ValidateTxToken | ( | IN UDP6_INSTANCE_DATA * | Instance, |
IN EFI_UDP6_COMPLETION_TOKEN * | TxToken | ||
) |
This function validates the TxToken. It returns the error code according to the spec.
[in] | Instance | Pointer to the udp instance context data. |
[in] | TxToken | Pointer to the token to be checked. |
EFI_SUCCESS | The TxToken is valid. |
EFI_INVALID_PARAMETER | One or more of the following are TRUE: Token.Event is NULL; Token.Packet.TxData is NULL; Token.Packet.TxData.FragmentCount is zero; Token.Packet.TxData.DataLength is not equal to the sum of fragment lengths; One or more of the Token.Packet.TxData.FragmentTable[].FragmentLength fields is zero; One or more of the Token.Packet.TxData.FragmentTable[].FragmentBuffer fields is NULL; UdpSessionData.DestinationAddress are not valid unicast IPv6 addresses if the UdpSessionData is not NULL; UdpSessionData.DestinationPort and ConfigData.RemotePort are all zero if the UdpSessionData is not NULL. |
EFI_BAD_BUFFER_SIZE | The data length is greater than the maximum UDP packet size. |
Definition at line 776 of file Udp6Impl.c.
UDP6_RXDATA_WRAP * Udp6WrapRxData | ( | IN UDP6_INSTANCE_DATA * | Instance, |
IN NET_BUF * | Packet, | ||
IN EFI_UDP6_RECEIVE_DATA * | RxData | ||
) |
This function wraps the Packet into RxData.
[in] | Instance | Pointer to the instance context data. |
[in] | Packet | Pointer to the buffer containing the received datagram. |
[in] | RxData | Pointer to the EFI_UDP6_RECEIVE_DATA of this datagram. |
Definition at line 1380 of file Udp6Impl.c.
UINT16 mUdp6RandomPort |
Definition at line 12 of file Udp6Impl.c.