/** @file\r
+ IpIo Library.\r
\r
-Copyright (c) 2005 - 2007, Intel Corporation\r
+Copyright (c) 2005 - 2007, Intel Corporation.<BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
- IpIo.c\r
-\r
-Abstract:\r
-\r
- The implementation of the IpIo layer.\r
-\r
-\r
**/\r
\r
-#include <PiDxe.h>\r
+#include <Uefi.h>\r
\r
#include <Protocol/Udp4.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-\r
\r
-#define NET_PROTO_HDR(Buf, Type) ((Type *) ((Buf)->BlockOp[0].Head))\r
-#define ICMP_ERRLEN(IpHdr) \\r
- (sizeof(IP4_ICMP_HEAD) + EFI_IP4_HEADER_LEN(IpHdr) + 8)\r
\r
LIST_ENTRY mActiveIpIoList = {\r
&mActiveIpIoList,\r
0\r
};\r
\r
-STATIC ICMP_ERROR_INFO mIcmpErrMap[10] = {\r
+ICMP_ERROR_INFO mIcmpErrMap[10] = {\r
{FALSE, TRUE},\r
{FALSE, TRUE},\r
{TRUE, TRUE},\r
{FALSE, TRUE}\r
};\r
\r
-STATIC\r
+\r
+/**\r
+ Notify function for IP transmit token.\r
+\r
+ @param[in] Context The context passed in by the event notifier.\r
+\r
+**/\r
VOID\r
EFIAPI\r
IpIoTransmitHandlerDpc (\r
IN VOID *Context\r
);\r
\r
-STATIC\r
+\r
+/**\r
+ Notify function for IP transmit token.\r
+\r
+ @param[in] Event The event signaled.\r
+ @param[in] Context The context passed in by the event notifier.\r
+\r
+**/\r
VOID\r
EFIAPI\r
IpIoTransmitHandler (\r
\r
\r
/**\r
- This function create an ip child ,open the IP protocol, return the opened\r
- Ip protocol to Interface.\r
+ This function create an IP child ,open the IP protocol, and return the opened\r
+ IP protocol as Interface.\r
\r
- @param ControllerHandle The controller handle.\r
- @param ImageHandle The image handle.\r
- @param ChildHandle Pointer to the buffer to save the ip child handle.\r
- @param Interface Pointer used to get the ip protocol interface.\r
+ @param[in] ControllerHandle The controller handle.\r
+ @param[in] ImageHandle The image handle.\r
+ @param[in] ChildHandle Pointer to the buffer to save the IP child handle.\r
+ @param[out] Interface Pointer used to get the IP protocol interface.\r
\r
- @retval EFI_SUCCESS The ip child is created and the ip protocol\r
- interface is retrieved.\r
- @retval other The required operation failed.\r
+ @retval EFI_SUCCESS The IP child is created and the IP protocol\r
+ interface is retrieved.\r
+ @retval Others The required operation failed.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
IpIoCreateIpChildOpenProtocol (\r
IN EFI_HANDLE ControllerHandle,\r
EFI_STATUS Status;\r
\r
//\r
- // Create an ip child.\r
+ // Create an IP child.\r
//\r
Status = NetLibCreateServiceChild (\r
ControllerHandle,\r
}\r
\r
//\r
- // Open the ip protocol installed on the *ChildHandle.\r
+ // Open the IP protocol installed on the *ChildHandle.\r
//\r
Status = gBS->OpenProtocol (\r
*ChildHandle,\r
);\r
if (EFI_ERROR (Status)) {\r
//\r
- // On failure, destroy the ip child.\r
+ // On failure, destroy the IP child.\r
//\r
NetLibDestroyServiceChild (\r
ControllerHandle,\r
\r
\r
/**\r
- This function close the previously openned ip protocol and destroy the ip child.\r
+ This function close the previously openned IP protocol and destroy the IP child.\r
\r
- @param ControllerHandle The controller handle.\r
- @param ImageHandle the image handle.\r
- @param ChildHandle The child handle of the ip child.\r
+ @param[in] ControllerHandle The controller handle.\r
+ @param[in] ImageHandle The image handle.\r
+ @param[in] ChildHandle The child handle of the IP child.\r
\r
- @retval EFI_SUCCESS The ip protocol is closed and the relevant ip child\r
- is destroyed.\r
- @retval other The required operation failed.\r
+ @retval EFI_SUCCESS The IP protocol is closed and the relevant IP child\r
+ is destroyed.\r
+ @retval Others The required operation failed.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
IpIoCloseProtocolDestroyIpChild (\r
IN EFI_HANDLE ControllerHandle,\r
EFI_STATUS Status;\r
\r
//\r
- // Close the previously openned ip protocol.\r
+ // Close the previously openned IP protocol.\r
//\r
gBS->CloseProtocol (\r
ChildHandle,\r
);\r
\r
//\r
- // Destroy the ip child.\r
+ // Destroy the IP child.\r
//\r
Status = NetLibDestroyServiceChild (\r
ControllerHandle,\r
\r
\r
/**\r
- Handle ICMP packets.\r
+ This function handles ICMP packets.\r
\r
- @param IpIo Pointer to the IP_IO instance.\r
- @param Pkt Pointer to the ICMP packet.\r
- @param Session Pointer to the net session of this ICMP packet.\r
+ @param[in] IpIo Pointer to the IP_IO instance.\r
+ @param[in, out] Pkt Pointer to the ICMP packet.\r
+ @param[in] Session Pointer to the net session of this ICMP packet.\r
\r
- @retval EFI_SUCCESS The ICMP packet is handled successfully.\r
- @retval EFI_ABORTED This type of ICMP packet is not supported.\r
+ @retval EFI_SUCCESS The ICMP packet is handled successfully.\r
+ @retval EFI_ABORTED This type of ICMP packet is not supported.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
IpIoIcmpHandler (\r
- IN IP_IO *IpIo,\r
- IN NET_BUF *Pkt,\r
- IN EFI_NET_SESSION_DATA *Session\r
+ IN IP_IO *IpIo,\r
+ IN OUT NET_BUF *Pkt,\r
+ IN EFI_NET_SESSION_DATA *Session\r
)\r
{\r
IP4_ICMP_ERROR_HEAD *IcmpHdr;\r
\r
default:\r
return EFI_ABORTED;\r
-\r
- break;\r
}\r
\r
break;\r
\r
default:\r
return EFI_ABORTED;\r
-\r
- break;\r
}\r
\r
//\r
\r
\r
/**\r
- Ext free function for net buffer. This function is\r
- called when the net buffer is freed. It is used to\r
+ Free function for receive token of IP_IO. It is used to\r
signal the recycle event to notify IP to recycle the\r
data buffer.\r
\r
- @param Event The event to be signaled.\r
-\r
- @return None.\r
+ @param[in] Event The event to be signaled.\r
\r
**/\r
-STATIC\r
VOID\r
IpIoExtFree (\r
IN VOID *Event\r
Create a send entry to wrap a packet before sending\r
out it through IP.\r
\r
- @param IpIo Pointer to the IP_IO instance.\r
- @param Pkt Pointer to the packet.\r
- @param Sender Pointer to the IP sender.\r
- @param NotifyData Pointer to the notify data.\r
- @param Dest Pointer to the destination IP address.\r
- @param Override Pointer to the overriden IP_IO data.\r
+ @param[in, out] IpIo Pointer to the IP_IO instance.\r
+ @param[in, out] Pkt Pointer to the packet.\r
+ @param[in] Sender Pointer to the IP sender.\r
+ @param[in] Context Pointer to the context.\r
+ @param[in] NotifyData Pointer to the notify data.\r
+ @param[in] Dest Pointer to the destination IP address.\r
+ @param[in] Override Pointer to the overriden IP_IO data.\r
\r
@return Pointer to the data structure created to wrap the packet. If NULL,\r
@return resource limit occurred.\r
\r
**/\r
-STATIC\r
IP_IO_SEND_ENTRY *\r
IpIoCreateSndEntry (\r
- IN IP_IO *IpIo,\r
- IN NET_BUF *Pkt,\r
- IN EFI_IP4_PROTOCOL *Sender,\r
- IN VOID *Context OPTIONAL,\r
- IN VOID *NotifyData OPTIONAL,\r
- IN IP4_ADDR Dest,\r
- IN IP_IO_OVERRIDE *Override\r
+ IN OUT IP_IO *IpIo,\r
+ IN OUT NET_BUF *Pkt,\r
+ IN EFI_IP4_PROTOCOL *Sender,\r
+ IN VOID *Context OPTIONAL,\r
+ IN VOID *NotifyData OPTIONAL,\r
+ IN IP4_ADDR Dest,\r
+ IN IP_IO_OVERRIDE *Override\r
)\r
{\r
IP_IO_SEND_ENTRY *SndEntry;\r
// Set the fields of SndEntry\r
//\r
SndEntry->IpIo = IpIo;\r
- SndEntry->Ip = Sender;\r
+ SndEntry->Ip = Sender;\r
SndEntry->Context = Context;\r
SndEntry->NotifyData = NotifyData;\r
\r
\r
/**\r
Destroy the SndEntry.\r
+ \r
+ This function pairs with IpIoCreateSndEntry().\r
\r
- @param SndEntry Pointer to the send entry to be destroyed.\r
-\r
- @return None.\r
+ @param[in] SndEntry Pointer to the send entry to be destroyed.\r
\r
**/\r
-STATIC\r
VOID\r
IpIoDestroySndEntry (\r
IN IP_IO_SEND_ENTRY *SndEntry\r
/**\r
Notify function for IP transmit token.\r
\r
- @param Context The context passed in by the event notifier.\r
-\r
- @return None.\r
+ @param[in] Context The context passed in by the event notifier.\r
\r
**/\r
-STATIC\r
VOID\r
EFIAPI\r
IpIoTransmitHandlerDpc (\r
\r
IpIo = SndEntry->IpIo;\r
\r
- if (IpIo->PktSentNotify && SndEntry->NotifyData) {\r
+ if ((IpIo->PktSentNotify != NULL) && (SndEntry->NotifyData != NULL)) {\r
IpIo->PktSentNotify (\r
SndEntry->SndToken->Status,\r
SndEntry->Context,\r
IpIoDestroySndEntry (SndEntry);\r
}\r
\r
+\r
/**\r
Notify function for IP transmit token.\r
\r
- @param Event The event signaled.\r
- @param Context The context passed in by the event notifier.\r
-\r
- @return None.\r
+ @param[in] Event The event signaled.\r
+ @param[in] Context The context passed in by the event notifier.\r
\r
**/\r
-\r
-STATIC\r
VOID\r
EFIAPI\r
IpIoTransmitHandler (\r
/**\r
The dummy handler for the dummy IP receive token.\r
\r
- @param Context The context passed in by the event notifier.\r
-\r
- @return None.\r
+ @param[in] Context The context passed in by the event notifier.\r
\r
**/\r
-STATIC\r
VOID\r
EFIAPI\r
IpIoDummyHandlerDpc (\r
//\r
return;\r
} else if (EFI_SUCCESS == DummyToken->Status) {\r
- ASSERT (DummyToken->Packet.RxData);\r
+ ASSERT ((DummyToken->Packet.RxData)!= NULL);\r
\r
gBS->SignalEvent (DummyToken->Packet.RxData->RecycleSignal);\r
}\r
\r
\r
/**\r
- Request IpIoDummyHandlerDpc as a DPC at TPL_CALLBACK.\r
-\r
- @param Event The event signaled.\r
- @param Context The context passed in by the event notifier.\r
+ This function add IpIoDummyHandlerDpc to the end of the DPC queue.\r
\r
- @return None.\r
+ @param[in] Event The event signaled.\r
+ @param[in] Context The context passed in by the event notifier.\r
\r
**/\r
-STATIC\r
VOID\r
EFIAPI\r
IpIoDummyHandler (\r
Notify function for the IP receive token, used to process\r
the received IP packets.\r
\r
- @param Context The context passed in by the event notifier.\r
-\r
- @return None.\r
+ @param[in] Context The context passed in by the event notifier.\r
\r
**/\r
-STATIC\r
VOID\r
EFIAPI\r
IpIoListenHandlerDpc (\r
\r
if (((EFI_SUCCESS != Status) && (EFI_ICMP_ERROR != Status)) || (NULL == RxData)) {\r
//\r
- // Only process the normal packets and the icmp error packets, if RxData is NULL\r
- // with Status == EFI_SUCCESS or EFI_ICMP_ERROR, just resume the receive although\r
- // this should be a bug of the low layer (IP).\r
+ // @bug Only process the normal packets and the icmp error packets, if RxData is NULL\r
+ // @bug with Status == EFI_SUCCESS or EFI_ICMP_ERROR, just resume the receive although\r
+ // @bug this should be a bug of the low layer (IP).\r
//\r
goto Resume;\r
}\r
\r
\r
/**\r
- Request IpIoListenHandlerDpc as a DPC at TPL_CALLBACK\r
+ This function add IpIoListenHandlerDpc to the end of the DPC queue.\r
\r
- @param Event The event signaled.\r
- @param Context The context passed in by the event notifier.\r
-\r
- @return None.\r
+ @param[in] Event The event signaled.\r
+ @param[in] Context The context passed in by the event notifier.\r
\r
**/\r
-STATIC\r
VOID\r
EFIAPI\r
IpIoListenHandler (\r
\r
/**\r
Create a new IP_IO instance.\r
+ \r
+ This function uses IP4 service binding protocol in Controller to create an IP4\r
+ child (aka IP4 instance).\r
\r
- @param Image The image handle of an IP_IO consumer protocol.\r
- @param Controller The controller handle of an IP_IO consumer protocol\r
- installed on.\r
+ @param[in] Image The image handle of the driver or application that\r
+ consumes IP_IO.\r
+ @param[in] Controller The controller handle that has IP4 service binding\r
+ protocol installed.\r
\r
- @return Pointer to a newly created IP_IO instance.\r
+ @return Pointer to a newly created IP_IO instance, or NULL if failed.\r
\r
**/\r
IP_IO *\r
+EFIAPI\r
IpIoCreate (\r
IN EFI_HANDLE Image,\r
IN EFI_HANDLE Controller\r
\r
/**\r
Open an IP_IO instance for use.\r
-\r
- @param IpIo Pointer to an IP_IO instance that needs to open.\r
- @param OpenData The configuration data for the IP_IO instance.\r
-\r
- @retval EFI_SUCCESS The IP_IO instance opened with OpenData\r
- successfully.\r
- @retval other Error condition occurred.\r
+ \r
+ This function is called after IpIoCreate(). It is used for configuring the IP\r
+ instance and register the callbacks and their context data for sending and\r
+ receiving IP packets.\r
+\r
+ @param[in, out] IpIo Pointer to an IP_IO instance that needs\r
+ to open.\r
+ @param[in] OpenData The configuration data and callbacks for\r
+ the IP_IO instance.\r
+\r
+ @retval EFI_SUCCESS The IP_IO instance opened with OpenData\r
+ successfully.\r
+ @retval EFI_ACCESS_DENIED The IP_IO instance is configured, avoid to \r
+ reopen it.\r
+ @retval Others Error condition occurred.\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
IpIoOpen (\r
- IN IP_IO *IpIo,\r
- IN IP_IO_OPEN_DATA *OpenData\r
+ IN OUT IP_IO *IpIo,\r
+ IN IP_IO_OPEN_DATA *OpenData\r
)\r
{\r
EFI_STATUS Status;\r
}\r
\r
//\r
- // bugbug: to delete the default route entry in this Ip, if it is:\r
- // (0.0.0.0, 0.0.0.0, 0.0.0.0). Delete this statement if Ip modified\r
- // its code\r
+ // @bug To delete the default route entry in this Ip, if it is:\r
+ // @bug (0.0.0.0, 0.0.0.0, 0.0.0.0). Delete this statement if Ip modified\r
+ // @bug its code\r
//\r
Status = Ip->Routes (Ip, TRUE, &mZeroIp4Addr, &mZeroIp4Addr, &mZeroIp4Addr);\r
\r
\r
/**\r
Stop an IP_IO instance.\r
+ \r
+ This function is paired with IpIoOpen(). The IP_IO will be unconfigured and all\r
+ the pending send/receive tokens will be canceled.\r
\r
- @param IpIo Pointer to the IP_IO instance that needs to stop.\r
+ @param[in, out] IpIo Pointer to the IP_IO instance that needs to stop.\r
\r
- @retval EFI_SUCCESS The IP_IO instance stopped successfully.\r
- @retval other Error condition occurred.\r
+ @retval EFI_SUCCESS The IP_IO instance stopped successfully.\r
+ @retval Others Error condition occurred.\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
IpIoStop (\r
- IN IP_IO *IpIo\r
+ IN OUT IP_IO *IpIo\r
)\r
{\r
EFI_STATUS Status;\r
}\r
\r
//\r
- // All pending snd tokens should be flushed by reseting the IP instances.\r
+ // All pending send tokens should be flushed by reseting the IP instances.\r
//\r
ASSERT (IsListEmpty (&IpIo->PendingSndList));\r
\r
\r
/**\r
Destroy an IP_IO instance.\r
+ \r
+ This function is paired with IpIoCreate(). The IP_IO will be closed first.\r
+ Resource will be freed afterwards. See IpIoCloseProtocolDestroyIpChild().\r
\r
- @param IpIo Pointer to the IP_IO instance that needs to\r
- destroy.\r
+ @param[in, out] IpIo Pointer to the IP_IO instance that needs to be\r
+ destroyed.\r
\r
- @retval EFI_SUCCESS The IP_IO instance destroyed successfully.\r
- @retval other Error condition occurred.\r
+ @retval EFI_SUCCESS The IP_IO instance destroyed successfully.\r
+ @retval Others Error condition occurred.\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
IpIoDestroy (\r
- IN IP_IO *IpIo\r
+ IN OUT IP_IO *IpIo\r
)\r
{\r
//\r
\r
/**\r
Send out an IP packet.\r
-\r
- @param IpIo Pointer to an IP_IO instance used for sending IP\r
- packet.\r
- @param Pkt Pointer to the IP packet to be sent.\r
- @param Sender The IP protocol instance used for sending.\r
- @param NotifyData\r
- @param Dest The destination IP address to send this packet to.\r
- @param OverrideData The data to override some configuration of the IP\r
- instance used for sending.\r
-\r
- @retval EFI_SUCCESS The operation is completed successfully.\r
- @retval EFI_NOT_STARTED The IpIo is not configured.\r
- @retval EFI_OUT_OF_RESOURCES Failed due to resource limit.\r
+ \r
+ This function is called after IpIoOpen(). The data to be sent are wrapped in\r
+ Pkt. The IP instance wrapped in IpIo is used for sending by default but can be\r
+ overriden by Sender. Other sending configs, like source address and gateway\r
+ address etc., are specified in OverrideData.\r
+\r
+ @param[in, out] IpIo Pointer to an IP_IO instance used for sending IP\r
+ packet.\r
+ @param[in, out] Pkt Pointer to the IP packet to be sent.\r
+ @param[in] Sender The IP protocol instance used for sending.\r
+ @param[in] Context Optional context data.\r
+ @param[in] NotifyData Optional notify data.\r
+ @param[in] Dest The destination IP address to send this packet to.\r
+ @param[in] OverrideData The data to override some configuration of the IP\r
+ instance used for sending.\r
+\r
+ @retval EFI_SUCCESS The operation is completed successfully.\r
+ @retval EFI_NOT_STARTED The IpIo is not configured.\r
+ @retval EFI_OUT_OF_RESOURCES Failed due to resource limit.\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
IpIoSend (\r
- IN IP_IO *IpIo,\r
- IN NET_BUF *Pkt,\r
- IN IP_IO_IP_INFO *Sender,\r
- IN VOID *Context OPTIONAL,\r
- IN VOID *NotifyData OPTIONAL,\r
- IN IP4_ADDR Dest,\r
- IN IP_IO_OVERRIDE *OverrideData\r
+ IN OUT IP_IO *IpIo,\r
+ IN OUT NET_BUF *Pkt,\r
+ IN IP_IO_IP_INFO *Sender OPTIONAL,\r
+ IN VOID *Context OPTIONAL,\r
+ IN VOID *NotifyData OPTIONAL,\r
+ IN IP4_ADDR Dest,\r
+ IN IP_IO_OVERRIDE *OverrideData OPTIONAL\r
)\r
{\r
EFI_STATUS Status;\r
/**\r
Cancel the IP transmit token which wraps this Packet.\r
\r
- @param IpIo Pointer to the IP_IO instance.\r
- @param Packet Pointer to the packet to cancel.\r
-\r
- @return N/A.\r
+ @param[in] IpIo Pointer to the IP_IO instance.\r
+ @param[in] Packet Pointer to the packet of NET_BUF to cancel.\r
\r
**/\r
VOID\r
+EFIAPI\r
IpIoCancelTxToken (\r
IN IP_IO *IpIo,\r
IN VOID *Packet\r
IP_IO_SEND_ENTRY *SndEntry;\r
EFI_IP4_PROTOCOL *Ip;\r
\r
- ASSERT (IpIo && Packet);\r
+ ASSERT ((IpIo)!= NULL && (Packet)!= NULL);\r
\r
NET_LIST_FOR_EACH (Node, &IpIo->PendingSndList) {\r
\r
\r
/**\r
Add a new IP instance for sending data.\r
+ \r
+ The function is used to add the IP_IO to the IP_IO sending list. The caller\r
+ can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send\r
+ data.\r
\r
- @param IpIo Pointer to a IP_IO instance to add a new IP\r
- instance for sending purpose.\r
+ @param[in, out] IpIo Pointer to a IP_IO instance to add a new IP\r
+ instance for sending purpose.\r
\r
- @return Pointer to the created IP_IO_IP_INFO structure, NULL is failed.\r
+ @return Pointer to the created IP_IO_IP_INFO structure, NULL if failed.\r
\r
**/\r
IP_IO_IP_INFO *\r
+EFIAPI\r
IpIoAddIp (\r
- IN IP_IO *IpIo\r
+ IN OUT IP_IO *IpIo\r
)\r
{\r
EFI_STATUS Status;\r
IP_IO_IP_INFO *IpInfo;\r
\r
- ASSERT (IpIo);\r
+ ASSERT (IpIo != NULL);\r
\r
IpInfo = AllocatePool (sizeof (IP_IO_IP_INFO));\r
if (IpInfo == NULL) {\r
Configure the IP instance of this IpInfo and start the receiving if Ip4ConfigData\r
is not NULL.\r
\r
- @param IpInfo Pointer to the IP_IO_IP_INFO instance.\r
- @param Ip4ConfigData The IP4 configure data used to configure the ip\r
- instance, if NULL the ip instance is reseted. If\r
- UseDefaultAddress is set to TRUE, and the configure\r
- operation succeeds, the default address information\r
- is written back in this Ip4ConfigData.\r
+ @param[in, out] IpInfo Pointer to the IP_IO_IP_INFO instance.\r
+ @param[in, out] Ip4ConfigData The IP4 configure data used to configure the IP\r
+ instance, if NULL the IP instance is reset. If\r
+ UseDefaultAddress is set to TRUE, and the configure\r
+ operation succeeds, the default address information\r
+ is written back in this Ip4ConfigData.\r
\r
- @retval EFI_STATUS The status returned by IP4->Configure or\r
- IP4->Receive.\r
+ @retval EFI_SUCCESS The IP instance of this IpInfo is configured successfully\r
+ or no need to reconfigure it.\r
+ @retval Others Configuration fails.\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
IpIoConfigIp (\r
- IN IP_IO_IP_INFO *IpInfo,\r
+ IN OUT IP_IO_IP_INFO *IpInfo,\r
IN OUT EFI_IP4_CONFIG_DATA *Ip4ConfigData OPTIONAL\r
)\r
{\r
EFI_IP4_PROTOCOL *Ip;\r
EFI_IP4_MODE_DATA Ip4ModeData;\r
\r
- ASSERT (IpInfo);\r
+ ASSERT (IpInfo != NULL);\r
\r
if (IpInfo->RefCnt > 1) {\r
//\r
/**\r
Destroy an IP instance maintained in IpIo->IpList for\r
sending purpose.\r
+ \r
+ This function pairs with IpIoAddIp(). The IpInfo is previously created by\r
+ IpIoAddIp(). The IP_IO_IP_INFO::RefCnt is decremented and the IP instance\r
+ will be dstroyed if the RefCnt is zero.\r
\r
- @param IpIo Pointer to the IP_IO instance.\r
- @param IpInfo Pointer to the IpInfo to be removed.\r
-\r
- @return None.\r
+ @param[in] IpIo Pointer to the IP_IO instance.\r
+ @param[in] IpInfo Pointer to the IpInfo to be removed.\r
\r
**/\r
VOID\r
+EFIAPI\r
IpIoRemoveIp (\r
- IN IP_IO *IpIo,\r
- IN IP_IO_IP_INFO *IpInfo\r
+ IN IP_IO *IpIo,\r
+ IN IP_IO_IP_INFO *IpInfo\r
)\r
{\r
ASSERT (IpInfo->RefCnt > 0);\r
/**\r
Find the first IP protocol maintained in IpIo whose local\r
address is the same with Src.\r
+ \r
+ This function is called when the caller needs the IpIo to send data to the\r
+ specified Src. The IpIo was added previously by IpIoAddIp().\r
\r
- @param IpIo Pointer to the pointer of the IP_IO instance.\r
- @param Src The local IP address.\r
+ @param[in, out] IpIo Pointer to the pointer of the IP_IO instance.\r
+ @param[in] Src The local IP address.\r
\r
@return Pointer to the IP protocol can be used for sending purpose and its local\r
@return address is the same with Src.\r
\r
**/\r
IP_IO_IP_INFO *\r
+EFIAPI\r
IpIoFindSender (\r
IN OUT IP_IO **IpIo,\r
IN IP4_ADDR Src\r
\r
\r
/**\r
- Get the ICMP error map information, the ErrorStatus will be returned.\r
- The IsHard and Notify are optional. If they are not NULL, this rouine will\r
- fill them.\r
- We move IcmpErrMap[] to local variable to enable EBC build.\r
+ Get the ICMP error map information.\r
+ \r
+ The ErrorStatus will be returned. The IsHard and Notify are optional. If they\r
+ are not NULL, this routine will fill them.\r
\r
- @param IcmpError IcmpError Type\r
- @param IsHard Whether it is a hard error\r
- @param Notify Whether it need to notify SockError\r
+ @param[in] IcmpError IcmpError Type.\r
+ @param[out] IsHard Whether it is a hard error.\r
+ @param[out] Notify Whether it need to notify SockError.\r
\r
- @return ICMP Error Status\r
+ @return ICMP Error Status, such as EFI_NETWORK_UNREACHABLE.\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
IpIoGetIcmpErrStatus (\r
IN ICMP_ERROR IcmpError,\r
- OUT BOOLEAN *IsHard, OPTIONAL\r
- OUT BOOLEAN *Notify OPTIONAL\r
+ OUT BOOLEAN *IsHard OPTIONAL,\r
+ OUT BOOLEAN *Notify OPTIONAL\r
)\r
{\r
ASSERT ((IcmpError >= ICMP_ERR_UNREACH_NET) && (IcmpError <= ICMP_ERR_PARAMPROB));\r