This library is only intended to be used by UEFI network stack modules.\r
It provides basic functions for the UEFI network stack.\r
\r
-Copyright (c) 2005 - 2010, Intel Corporation.<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+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<BR>\r
http://opensource.org/licenses/bsd-license.php\r
#include <Protocol/Ip6.h>\r
\r
#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
\r
typedef UINT32 IP4_ADDR;\r
typedef UINT32 TCP_SEQNO;\r
\r
#define IP6_HOP_BY_HOP 0\r
#define IP6_DESTINATION 60\r
+#define IP6_ROUTING 43\r
#define IP6_FRAGMENT 44\r
#define IP6_AH 51\r
#define IP6_ESP 50\r
\r
**/\r
CHAR8 *\r
+EFIAPI\r
NetDebugASPrint (\r
IN CHAR8 *Format,\r
...\r
than the mNetDebugLevelMax. Or, it has been sent out.\r
**/\r
EFI_STATUS\r
+EFIAPI\r
NetDebugOutput (\r
IN UINT32 Level,\r
IN UINT8 *Module,\r
\r
**/\r
BOOLEAN\r
+EFIAPI\r
NetIp6IsValidUnicast (\r
IN EFI_IPv6_ADDRESS *Ip6\r
);\r
\r
**/\r
BOOLEAN\r
+EFIAPI\r
NetIp6IsUnspecifiedAddr (\r
IN EFI_IPv6_ADDRESS *Ip6\r
);\r
\r
**/\r
BOOLEAN\r
+EFIAPI\r
NetIp6IsLinkLocalAddr (\r
IN EFI_IPv6_ADDRESS *Ip6\r
);\r
\r
**/\r
BOOLEAN\r
+EFIAPI\r
NetIp6IsNetEqual (\r
EFI_IPv6_ADDRESS *Ip1,\r
EFI_IPv6_ADDRESS *Ip2,\r
\r
**/\r
EFI_IPv6_ADDRESS *\r
+EFIAPI\r
Ip6Swap128 (\r
EFI_IPv6_ADDRESS *Ip6\r
);\r
byte stream.\r
\r
@param[in, out] Buf The buffer in which to put the UINT32.\r
- @param[in] Data The data to put.\r
+ @param[in] Data The data to be converted and put into the byte stream.\r
\r
**/\r
VOID\r
\r
typedef\r
EFI_STATUS\r
-(*NET_MAP_CALLBACK) (\r
+(EFIAPI *NET_MAP_CALLBACK) (\r
IN NET_MAP *Map,\r
IN NET_MAP_ITEM *Item,\r
IN VOID *Arg\r
\r
The underlying UNDI driver may or may not support reporting media status from\r
GET_STATUS command (PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED). This routine\r
- will try to invoke Snp->GetStatus() to get the media status. Iif media is already\r
- present, it returns directly. If media isnot present, it will stop SNP and then\r
- restart SNP to get the latest media status. This provides an opportunity to get \r
+ will try to invoke Snp->GetStatus() to get the media status. If media is already\r
+ present, it returns directly. If media is not present, it will stop SNP and then\r
+ restart SNP to get the latest media status. This provides an opportunity to get \r
the correct media status for old UNDI driver, which doesn't support reporting \r
media status from GET_STATUS command.\r
Note: there are two limitations for the current algorithm:\r
1) For UNDI with this capability, when the cable is not attached, there will\r
be an redundant Stop/Start() process.\r
- 2) For UNDI without this capability, when the cable is attached, the UNDI\r
- initializes while unattached. Later, NetLibDetectMedia() will report\r
- MediaPresent as TRUE, causing upper layer apps to wait for timeout time.\r
+ 2) for UNDI without this capability, in case that network cable is attached when\r
+ Snp->Initialize() is invoked while network cable is unattached later,\r
+ NetLibDetectMedia() will report MediaPresent as TRUE, causing upper layer\r
+ apps to wait for timeout time.\r
\r
@param[in] ServiceHandle The handle where network service binding protocols are\r
installed.\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
NetLibAsciiStrToIp4 (\r
IN CONST CHAR8 *String,\r
OUT EFI_IPv4_ADDRESS *Ip4Address\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
NetLibAsciiStrToIp6 (\r
IN CONST CHAR8 *String,\r
OUT EFI_IPv6_ADDRESS *Ip6Address\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
NetLibStrToIp4 (\r
IN CONST CHAR16 *String,\r
OUT EFI_IPv4_ADDRESS *Ip4Address\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
NetLibStrToIp6 (\r
IN CONST CHAR16 *String,\r
OUT EFI_IPv6_ADDRESS *Ip6Address\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
NetLibStrToIp6andPrefix (\r
IN CONST CHAR16 *String,\r
OUT EFI_IPv6_ADDRESS *Ip6Address,\r
UINT8 *Bulk; // The block's Data\r
} NET_BLOCK;\r
\r
-typedef VOID (*NET_VECTOR_EXT_FREE) (VOID *Arg);\r
+typedef VOID (EFIAPI *NET_VECTOR_EXT_FREE) (VOID *Arg);\r
\r
//\r
//NET_VECTOR contains several blocks to hold all packet's\r
);\r
\r
/**\r
- Trim Len bytes of data from the queue header and release any net buffer\r
- that is trimmed wholely.\r
+ Trim Len bytes of data from the buffer queue and free any net buffer\r
+ that is completely trimmed.\r
\r
The trimming operation is the same as NetbufTrim but applies to the net buffer\r
queue instead of the net buffer.\r
\r
**/\r
UINT16\r
+EFIAPI\r
NetIp6PseudoHeadChecksum (\r
IN EFI_IPv6_ADDRESS *Src,\r
IN EFI_IPv6_ADDRESS *Dst,\r
IN UINT8 NextHeader,\r
IN UINT32 Len\r
);\r
+\r
+/**\r
+ The function frees the net buffer which allocated by the IP protocol. It releases \r
+ only the net buffer and doesn't call the external free function. \r
+\r
+ This function should be called after finishing the process of mIpSec->ProcessExt() \r
+ for outbound traffic. The (EFI_IPSEC2_PROTOCOL)->ProcessExt() allocates a new \r
+ buffer for the ESP, so there needs a function to free the old net buffer.\r
+\r
+ @param[in] Nbuf The network buffer to be freed.\r
+\r
+**/\r
+VOID\r
+NetIpSecNetbufFree (\r
+ NET_BUF *Nbuf\r
+ );\r
#endif\r