diff options
author | tye <tye@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-10-26 10:15:40 +0000 |
---|---|---|
committer | tye <tye@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-10-26 10:15:40 +0000 |
commit | fb115c61504fe6c4f94be0a87f75e28e1684657f (patch) | |
tree | 5e5b43d24f64f96eaa93d7acb1d48cc7c028c2c7 /MdeModulePkg/Library/DxeNetLib | |
parent | 326f0711dc8dd443908ca856df138e93d0eca557 (diff) | |
download | edk2-platforms-fb115c61504fe6c4f94be0a87f75e28e1684657f.tar.xz |
NetLib:
1. Add new interface Ip6IsValidUnicast
2. Add new enum IP6_EXTENSION_HEADER_TYPE
3. Add new structure IP6_ICMP_* definitions
4. Update structure from EFI_UDP4_HEADER to EFI_UDP_HEADER
5. Add new macro EFI_IP6_EQUAL
IpIoLib:
1. Update the IpIoLib to a combined library for both v4 and v6 network stack
2. Fix a bug in IpIoIcmpHandler() - for IPv6 packet, the header length is variable (basic header + extension) rathar than fixed length.
The fix removes the IPv6 header fields and notify the user with the ICMPv6 packet only containing payload.
TcpDxe/UdpDxe:
1. Update to adapt the new combined IpIoLib
2. Add gEfiIp6ProtocolGuid/gEfiIp6ServiceBindingProtocolGuid to [Protocols] in INF file since the Ip6.h is included in IpIoLib and NetLib.
3. Pass the TCP4/UDP4 UEFI SCT test on NT32 platform.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9374 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/DxeNetLib')
-rw-r--r-- | MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index f18aa41e34..4c7414acfb 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -203,6 +203,46 @@ Ip4IsUnicast ( return TRUE;
}
+/**
+ Check whether the incoming IPv6 address is a valid unicast address.
+
+ If the address is a multicast address has binary 0xFF at the start, it is not
+ a valid unicast address. If the address is unspecified ::, it is not a valid
+ unicast address to be assigned to any node. If the address is loopback address
+ ::1, it is also not a valid unicast address to be assigned to any physical
+ interface.
+
+ @param[in] Ip6 The IPv6 address to check against.
+
+ @return TRUE if Ip6 is a valid unicast address on the network, otherwise FALSE.
+
+**/
+BOOLEAN
+Ip6IsValidUnicast (
+ IN EFI_IPv6_ADDRESS *Ip6
+ )
+{
+ UINT8 t;
+ UINT8 i;
+
+ if (Ip6->Addr[0] == 0xFF) {
+ return FALSE;
+ }
+
+ for (i = 0; i < 15; i++) {
+ if (Ip6->Addr[i] != 0) {
+ return TRUE;
+ }
+ }
+
+ t = Ip6->Addr[i];
+
+ if (t == 0x0 || t == 0x1) {
+ return FALSE;
+ }
+
+ return TRUE;
+}
/**
Initialize a random seed using current time.
|