diff options
author | tye <tye@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-11-04 08:18:34 +0000 |
---|---|---|
committer | tye <tye@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-11-04 08:18:34 +0000 |
commit | f6b7393ceb34c9b3a27434268bf2ce517047641f (patch) | |
tree | e0183d3d6c4773dec89876ab0aa2f85df5202cc4 /MdeModulePkg/Universal | |
parent | 7be273b7f583ef202bb4e3d4cede9e332cb306e5 (diff) | |
download | edk2-f6b7393ceb34c9b3a27434268bf2ce517047641f.zip edk2-f6b7393ceb34c9b3a27434268bf2ce517047641f.tar.gz edk2-f6b7393ceb34c9b3a27434268bf2ce517047641f.tar.bz2 |
[Change summary]:
1. Update NetLib to a combined NetLib support dual network stack:
1) Add Network Debug facility for IPv4 stack.
2) Extend the library APIs to support IPv6 stack:
a. NetIp6IsUnspecifiedAddr
b. NetIp6IsLinkLocalAddr
c. NetIp6IsNetEqual
d. NetLibCreateIPv6DPathNode.
e. NetIp6PseudoHeadChecksum
f. NetIp6IsValidUnicast
3) Update the structure definitions:
a. Update NET_BUF to add EFI_IP6_HEADER and EFI_UDP_HEADER
b. Add NET_IP6_PSEUDO_HDR
4) Update Ip4IsUnicast to NetIp4IsUnicast
2. Update the impacted modules to adopt the combined NetLib.
3. Clean up coding style errors in all network drivers and libraries.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9391 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
49 files changed, 749 insertions, 808 deletions
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c index 9704f21..05884ca 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c @@ -928,7 +928,7 @@ ArpConfigureInstance ( if (ConfigData->SwAddressType == IPV4_ETHER_PROTO_TYPE) {
CopyMem (&Ip, ConfigData->StationAddress, sizeof (IP4_ADDR));
- if (!Ip4IsUnicast (NTOHL (Ip), 0)) {
+ if (!NetIp4IsUnicast (NTOHL (Ip), 0)) {
//
// The station address is not a valid IPv4 unicast address.
//
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h index bc9128d..6fc9507 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h @@ -1,7 +1,7 @@ /** @file
EFI Address Resolution Protocol (ARP) Protocol interface header file.
-Copyright (c) 2006 - 2008, Intel Corporation.<BR>
+Copyright (c) 2006 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at<BR>
@@ -186,17 +186,19 @@ typedef struct { #define ARP_MAX_PROTOCOL_ADDRESS_LEN sizeof(EFI_IP_ADDRESS)
#define ARP_MAX_HARDWARE_ADDRESS_LEN sizeof(EFI_MAC_ADDRESS)
+typedef union {
+ UINT8 ProtoAddress[ARP_MAX_PROTOCOL_ADDRESS_LEN];
+ UINT8 HwAddress[ARP_MAX_HARDWARE_ADDRESS_LEN];
+} NET_ARP_ADDRESS_UNION;
+
//
// ARP address structure in an ARP packet.
//
typedef struct {
- UINT16 Type;
- UINT8 Length;
- UINT8 *AddressPtr;
- union {
- UINT8 ProtoAddress[ARP_MAX_PROTOCOL_ADDRESS_LEN];
- UINT8 HwAddress[ARP_MAX_HARDWARE_ADDRESS_LEN];
- } Buffer;
+ UINT16 Type;
+ UINT8 Length;
+ UINT8 *AddressPtr;
+ NET_ARP_ADDRESS_UNION Buffer;
} NET_ARP_ADDRESS;
//
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c index acacec7..fb03327 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c @@ -661,7 +661,7 @@ EfiDhcp4Configure ( CopyMem (&Ip, &Dhcp4CfgData->ClientAddress, sizeof (IP4_ADDR));
- if ((Ip != 0) && !Ip4IsUnicast (NTOHL (Ip), 0)) {
+ if ((Ip != 0) && !NetIp4IsUnicast (NTOHL (Ip), 0)) {
return EFI_INVALID_PARAMETER;
}
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h index 7d15b84..ed066ea 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h @@ -43,18 +43,18 @@ typedef struct _DHCP_PROTOCOL DHCP_PROTOCOL; #define DHCP_SERVICE_SIGNATURE SIGNATURE_32 ('D', 'H', 'C', 'P')
#define DHCP_PROTOCOL_SIGNATURE SIGNATURE_32 ('d', 'h', 'c', 'p')
-typedef enum {
- //
- // The state of the DHCP service. It starts as UNCONFIGED. If
- // and active child configures the service successfully, it
- // goes to CONFIGED. If the active child configures NULL, it
- // goes back to UNCONFIGED. It becomes DESTORY if it is (partly)
- // destoried.
- //
- DHCP_UNCONFIGED = 0,
- DHCP_CONFIGED,
- DHCP_DESTORY
-} DHCP_STATE;
+
+//
+// The state of the DHCP service. It starts as UNCONFIGED. If
+// and active child configures the service successfully, it
+// goes to CONFIGED. If the active child configures NULL, it
+// goes back to UNCONFIGED. It becomes DESTORY if it is (partly)
+// destoried.
+//
+#define DHCP_UNCONFIGED 0
+#define DHCP_CONFIGED 1
+#define DHCP_DESTORY 2
+
struct _DHCP_PROTOCOL {
UINT32 Signature;
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h index bc7ef68..ce1a80b 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h @@ -31,36 +31,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define DHCP_SERVER_PORT 67
#define DHCP_CLIENT_PORT 68
-typedef enum {
- //
- // BOOTP header "op" field
- //
- BOOTP_REQUEST = 1,
- BOOTP_REPLY = 2
-} DHCP_OP_TYPE;
-
-typedef enum {
- //
- // DHCP message types
- //
- DHCP_MSG_DISCOVER = 1,
- DHCP_MSG_OFFER = 2,
- DHCP_MSG_REQUEST = 3,
- DHCP_MSG_DECLINE = 4,
- DHCP_MSG_ACK = 5,
- DHCP_MSG_NAK = 6,
- DHCP_MSG_RELEASE = 7,
- DHCP_MSG_INFORM = 8
-} DHCP_MSG_TYPE;
-
-typedef enum {
- //
- // DHCP notify user type
- //
- DHCP_NOTIFY_COMPLETION = 1,
- DHCP_NOTIFY_RENEWREBIND,
- DHCP_NOTIFY_ALL
-} DHCP_NOTIFY_TYPE;
+//
+// BOOTP header "op" field
+//
+#define BOOTP_REQUEST 1
+#define BOOTP_REPLY 2
+
+//
+// DHCP message types
+//
+#define DHCP_MSG_DISCOVER 1
+#define DHCP_MSG_OFFER 2
+#define DHCP_MSG_REQUEST 3
+#define DHCP_MSG_DECLINE 4
+#define DHCP_MSG_ACK 5
+#define DHCP_MSG_NAK 6
+#define DHCP_MSG_RELEASE 7
+#define DHCP_MSG_INFORM 8
+
+//
+// DHCP notify user type
+//
+#define DHCP_NOTIFY_COMPLETION 1
+#define DHCP_NOTIFY_RENEWREBIND 2
+#define DHCP_NOTIFY_ALL 3
#define DHCP_IS_BOOTP(Parameter) (((Parameter) == NULL) || ((Parameter)->DhcpType == 0))
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.h b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.h index 3685b37..e01f53e 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.h +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.h @@ -1,7 +1,7 @@ /** @file
To validate, parse and process the DHCP options.
-Copyright (c) 2006, Intel Corporation.<BR>
+Copyright (c) 2006 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -18,136 +18,133 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ///
/// DHCP option tags (types)
///
-typedef enum {
- //
- // RFC1497 vendor extensions
- //
- DHCP_TAG_PAD = 0, // Pad Option
- DHCP_TAG_EOP = 255, // End Option
- DHCP_TAG_NETMASK = 1, // Subnet Mask
- DHCP_TAG_TIME_OFFSET = 2, // Time Offset from UTC
- DHCP_TAG_ROUTER = 3, // Router option,
- DHCP_TAG_TIME_SERVER = 4, // Time Server
- DHCP_TAG_NAME_SERVER = 5, // Name Server
- DHCP_TAG_DNS_SERVER = 6, // Domain Name Server
- DHCP_TAG_LOG_SERVER = 7, // Log Server
- DHCP_TAG_COOKIE_SERVER = 8, // Cookie Server
- DHCP_TAG_LPR_SERVER = 9, // LPR Print Server
- DHCP_TAG_IMPRESS_SERVER = 10, // Impress Server
- DHCP_TAG_RL_SERVER = 11, // Resource Location Server
- DHCP_TAG_HOSTNAME = 12, // Host Name
- DHCP_TAG_BOOTFILE_LEN = 13, // Boot File Size
- DHCP_TAG_DUMP = 14, // Merit Dump File
- DHCP_TAG_DOMAINNAME = 15, // Domain Name
- DHCP_TAG_SWAP_SERVER = 16, // Swap Server
- DHCP_TAG_ROOTPATH = 17, // Root path
- DHCP_TAG_EXTEND_PATH = 18, // Extensions Path
-
- //
- // IP Layer Parameters per Host
- //
- DHCP_TAG_IPFORWARD = 19, // IP Forwarding Enable/Disable
- DHCP_TAG_NONLOCAL_SRR = 20, // on-Local Source Routing Enable/Disable
- DHCP_TAG_POLICY_SRR = 21, // Policy Filter
- DHCP_TAG_EMTU = 22, // Maximum Datagram Reassembly Size
- DHCP_TAG_TTL = 23, // Default IP Time-to-live
- DHCP_TAG_PATHMTU_AGE = 24, // Path MTU Aging Timeout
- DHCP_TAG_PATHMTU_PLATEAU = 25, // Path MTU Plateau Table
-
- //
- // IP Layer Parameters per Interface
- //
- DHCP_TAG_IFMTU = 26, // Interface MTU
- DHCP_TAG_SUBNET_LOCAL = 27, // All Subnets are Local
- DHCP_TAG_BROADCAST = 28, // Broadcast Address
- DHCP_TAG_DISCOVER_MASK = 29, // Perform Mask Discovery
- DHCP_TAG_SUPPLY_MASK = 30, // Mask Supplier
- DHCP_TAG_DISCOVER_ROUTE = 31, // Perform Router Discovery
- DHCP_TAG_ROUTER_SOLICIT = 32, // Router Solicitation Address
- DHCP_TAG_STATIC_ROUTE = 33, // Static Route
-
- //
- // Link Layer Parameters per Interface
- //
- DHCP_TAG_TRAILER = 34, // Trailer Encapsulation
- DHCP_TAG_ARPAGE = 35, // ARP Cache Timeout
- DHCP_TAG_ETHER_ENCAP = 36, // Ethernet Encapsulation
- //
- // TCP Parameters
- //
- DHCP_TAG_TCP_TTL = 37, // TCP Default TTL
- DHCP_TAG_KEEP_INTERVAL = 38, // TCP Keepalive Interval
- DHCP_TAG_KEEP_GARBAGE = 39, // TCP Keepalive Garbage
-
- //
- // Application and Service Parameters
- //
- DHCP_TAG_NIS_DOMAIN = 40, // Network Information Service Domain
- DHCP_TAG_NIS_SERVER = 41, // Network Information Servers
- DHCP_TAG_NTP_SERVER = 42, // Network Time Protocol Servers
- DHCP_TAG_VENDOR = 43, // Vendor Specific Information
- DHCP_TAG_NBNS = 44, // NetBIOS over TCP/IP Name Server
- DHCP_TAG_NBDD = 45, // NetBIOS Datagram Distribution Server
- DHCP_TAG_NBTYPE = 46, // NetBIOS over TCP/IP Node Type
- DHCP_TAG_NBSCOPE = 47, // NetBIOS over TCP/IP Scope
- DHCP_TAG_XFONT = 48, // X Window System Font Server
- DHCP_TAG_XDM = 49, // X Window System Display Manager
- DHCP_TAG_NISPLUS = 64, // Network Information Service+ Domain
- DHCP_TAG_NISPLUS_SERVER = 65, // Network Information Service+ Servers
- DHCP_TAG_MOBILEIP = 68, // Mobile IP Home Agent
- DHCP_TAG_SMTP = 69, // Simple Mail Transport Protocol Server
- DHCP_TAG_POP3 = 70, // Post Office Protocol (POP3) Server
- DHCP_TAG_NNTP = 71, // Network News Transport Protocol Server
- DHCP_TAG_WWW = 72, // Default World Wide Web (WWW) Server
- DHCP_TAG_FINGER = 73, // Default Finger Server
- DHCP_TAG_IRC = 74, // Default Internet Relay Chat (IRC) Server
- DHCP_TAG_STTALK = 75, // StreetTalk Server
- DHCP_TAG_STDA = 76, // StreetTalk Directory Assistance Server
- DHCP_TAG_CLASSLESS_ROUTE = 121, // Classless Route
-
- //
- // DHCP Extensions
- //
- DHCP_TAG_REQUEST_IP = 50, // Requested IP Address
- DHCP_TAG_LEASE = 51, // IP Address Lease Time
- DHCP_TAG_OVERLOAD = 52, // Option Overload
- DHCP_TAG_TFTP = 66, // TFTP server name
- DHCP_TAG_BOOTFILE = 67, // Bootfile name
- DHCP_TAG_TYPE = 53, // DHCP Message Type
- DHCP_TAG_SERVER_ID = 54, // Server Identifier
- DHCP_TAG_PARA_LIST = 55, // Parameter Request List
- DHCP_TAG_MESSAGE = 56, // Message
- DHCP_TAG_MAXMSG = 57, // Maximum DHCP Message Size
- DHCP_TAG_T1 = 58, // Renewal (T1) Time Value
- DHCP_TAG_T2 = 59, // Rebinding (T2) Time Value
- DHCP_TAG_VENDOR_CLASS = 60, // Vendor class identifier
- DHCP_TAG_CLIENT_ID = 61 // Client-identifier
-} DHCP_TAGS;
-
-#define DHCP_OPTION_MAGIC 0x63538263 // Network byte order
-#define DHCP_MAX_OPTIONS 256
-
-typedef enum {
- //
- // DHCP option types, this is used to validate the DHCP options.
- //
- DHCP_OPTION_SWITCH = 1,
- DHCP_OPTION_INT8,
- DHCP_OPTION_INT16,
- DHCP_OPTION_INT32,
- DHCP_OPTION_IP,
- DHCP_OPTION_IPPAIR
-} DHCP_OPTION_TYPE;
-
-typedef enum {
- //
- // Value of DHCP overload option
- //
- DHCP_OVERLOAD_FILENAME = 1,
- DHCP_OVERLOAD_SVRNAME = 2,
- DHCP_OVERLOAD_BOTH = 3
-} DHCP_OVERLOAD_TYPE;
+//
+// RFC1497 vendor extensions
+//
+#define DHCP_TAG_PAD 0 // Pad Option
+#define DHCP_TAG_EOP 255 // End Option
+#define DHCP_TAG_NETMASK 1 // Subnet Mask
+#define DHCP_TAG_TIME_OFFSET 2 // Time Offset from UTC
+#define DHCP_TAG_ROUTER 3 // Router option,
+#define DHCP_TAG_TIME_SERVER 4 // Time Server
+#define DHCP_TAG_NAME_SERVER 5 // Name Server
+#define DHCP_TAG_DNS_SERVER 6 // Domain Name Server
+#define DHCP_TAG_LOG_SERVER 7 // Log Server
+#define DHCP_TAG_COOKIE_SERVER 8 // Cookie Server
+#define DHCP_TAG_LPR_SERVER 9 // LPR Print Server
+#define DHCP_TAG_IMPRESS_SERVER 10 // Impress Server
+#define DHCP_TAG_RL_SERVER 11 // Resource Location Server
+#define DHCP_TAG_HOSTNAME 12 // Host Name
+#define DHCP_TAG_BOOTFILE_LEN 13 // Boot File Size
+#define DHCP_TAG_DUMP 14 // Merit Dump File
+#define DHCP_TAG_DOMAINNAME 15 // Domain Name
+#define DHCP_TAG_SWAP_SERVER 16 // Swap Server
+#define DHCP_TAG_ROOTPATH 17 // Root path
+#define DHCP_TAG_EXTEND_PATH 18 // Extensions Path
+
+//
+// IP Layer Parameters per Host
+//
+#define DHCP_TAG_IPFORWARD 19 // IP Forwarding Enable/Disable
+#define DHCP_TAG_NONLOCAL_SRR 20 // on-Local Source Routing Enable/Disable
+#define DHCP_TAG_POLICY_SRR 21 // Policy Filter
+#define DHCP_TAG_EMTU 22 // Maximum Datagram Reassembly Size
+#define DHCP_TAG_TTL 23 // Default IP Time-to-live
+#define DHCP_TAG_PATHMTU_AGE 24 // Path MTU Aging Timeout
+#define DHCP_TAG_PATHMTU_PLATEAU 25 // Path MTU Plateau Table
+
+//
+// IP Layer Parameters per Interface
+//
+#define DHCP_TAG_IFMTU 26 // Interface MTU
+#define DHCP_TAG_SUBNET_LOCAL 27 // All Subnets are Local
+#define DHCP_TAG_BROADCAST 28 // Broadcast Address
+#define DHCP_TAG_DISCOVER_MASK 29 // Perform Mask Discovery
+#define DHCP_TAG_SUPPLY_MASK 30 // Mask Supplier
+#define DHCP_TAG_DISCOVER_ROUTE 31 // Perform Router Discovery
+#define DHCP_TAG_ROUTER_SOLICIT 32 // Router Solicitation Address
+#define DHCP_TAG_STATIC_ROUTE 33 // Static Route
+
+//
+// Link Layer Parameters per Interface
+//
+#define DHCP_TAG_TRAILER 34 // Trailer Encapsulation
+#define DHCP_TAG_ARPAGE 35 // ARP Cache Timeout
+#define DHCP_TAG_ETHER_ENCAP 36 // Ethernet Encapsulation
+
+//
+// TCP Parameters
+//
+#define DHCP_TAG_TCP_TTL 37 // TCP Default TTL
+#define DHCP_TAG_KEEP_INTERVAL 38 // TCP Keepalive Interval
+#define DHCP_TAG_KEEP_GARBAGE 39 // TCP Keepalive Garbage
+
+//
+// Application and Service Parameters
+//
+#define DHCP_TAG_NIS_DOMAIN 40 // Network Information Service Domain
+#define DHCP_TAG_NIS_SERVER 41 // Network Information Servers
+#define DHCP_TAG_NTP_SERVER 42 // Network Time Protocol Servers
+#define DHCP_TAG_VENDOR 43 // Vendor Specific Information
+#define DHCP_TAG_NBNS 44 // NetBIOS over TCP/IP Name Server
+#define DHCP_TAG_NBDD 45 // NetBIOS Datagram Distribution Server
+#define DHCP_TAG_NBTYPE 46 // NetBIOS over TCP/IP Node Type
+#define DHCP_TAG_NBSCOPE 47 // NetBIOS over TCP/IP Scope
+#define DHCP_TAG_XFONT 48 // X Window System Font Server
+#define DHCP_TAG_XDM 49 // X Window System Display Manager
+#define DHCP_TAG_NISPLUS 64 // Network Information Service+ Domain
+#define DHCP_TAG_NISPLUS_SERVER 65 // Network Information Service+ Servers
+#define DHCP_TAG_MOBILEIP 68 // Mobile IP Home Agent
+#define DHCP_TAG_SMTP 69 // Simple Mail Transport Protocol Server
+#define DHCP_TAG_POP3 70 // Post Office Protocol (POP3) Server
+#define DHCP_TAG_NNTP 71 // Network News Transport Protocol Server
+#define DHCP_TAG_WWW 72 // Default World Wide Web (WWW) Server
+#define DHCP_TAG_FINGER 73 // Default Finger Server
+#define DHCP_TAG_IRC 74 // Default Internet Relay Chat (IRC) Server
+#define DHCP_TAG_STTALK 75 // StreetTalk Server
+#define DHCP_TAG_STDA 76 // StreetTalk Directory Assistance Server
+#define DHCP_TAG_CLASSLESS_ROUTE 121 // Classless Route
+
+//
+// DHCP Extensions
+//
+#define DHCP_TAG_REQUEST_IP 50 // Requested IP Address
+#define DHCP_TAG_LEASE 51 // IP Address Lease Time
+#define DHCP_TAG_OVERLOAD 52 // Option Overload
+#define DHCP_TAG_TFTP 66 // TFTP server name
+#define DHCP_TAG_BOOTFILE 67 // Bootfile name
+#define DHCP_TAG_TYPE 53 // DHCP Message Type
+#define DHCP_TAG_SERVER_ID 54 // Server Identifier
+#define DHCP_TAG_PARA_LIST 55 // Parameter Request List
+#define DHCP_TAG_MESSAGE 56 // Message
+#define DHCP_TAG_MAXMSG 57 // Maximum DHCP Message Size
+#define DHCP_TAG_T1 58 // Renewal (T1) Time Value
+#define DHCP_TAG_T2 59 // Rebinding (T2) Time Value
+#define DHCP_TAG_VENDOR_CLASS 60 // Vendor class identifier
+#define DHCP_TAG_CLIENT_ID 61 // Client-identifier
+
+
+#define DHCP_OPTION_MAGIC 0x63538263 // Network byte order
+#define DHCP_MAX_OPTIONS 256
+
+
+//
+// DHCP option types, this is used to validate the DHCP options.
+//
+#define DHCP_OPTION_SWITCH 1
+#define DHCP_OPTION_INT8 2
+#define DHCP_OPTION_INT16 3
+#define DHCP_OPTION_INT32 4
+#define DHCP_OPTION_IP 5
+#define DHCP_OPTION_IPPAIR 6
+
+//
+// Value of DHCP overload option
+//
+#define DHCP_OVERLOAD_FILENAME 1
+#define DHCP_OVERLOAD_SVRNAME 2
+#define DHCP_OVERLOAD_BOTH 3
///
/// The DHCP option structure. This structure extends the EFI_DHCP_OPTION
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.h index cce7e5a..6de87d0 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.h +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.h @@ -1,7 +1,7 @@ /** @file
The header file of CHAP configuration.
-Copyright (c) 2004 - 2007, Intel Corporation.<BR>
+Copyright (c) 2004 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -37,13 +37,12 @@ extern EFI_GUID mIScsiCHAPAuthInfoGuid; /// MD5_HASHSIZE
///
#define ISCSI_CHAP_RSP_LEN 16
-typedef enum {
- ISCSI_CHAP_INITIAL,
- ISCSI_CHAP_STEP_ONE,
- ISCSI_CHAP_STEP_TWO,
- ISCSI_CHAP_STEP_THREE,
- ISCSI_CHAP_STEP_FOUR
-} ISCSI_CHAP_STEP;
+
+#define ISCSI_CHAP_INITIAL 0
+#define ISCSI_CHAP_STEP_ONE 1
+#define ISCSI_CHAP_STEP_TWO 2
+#define ISCSI_CHAP_STEP_THREE 3
+#define ISCSI_CHAP_STEP_FOUR 4
#pragma pack(1)
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c index 59840f7..62fc37a 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c @@ -1,7 +1,7 @@ /** @file
Helper functions for configuring or getting the parameters relating to iSCSI.
-Copyright (c) 2004 - 2008, Intel Corporation.<BR>
+Copyright (c) 2004 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -544,7 +544,7 @@ IScsiFormCallback ( case KEY_LOCAL_IP:
IScsiUnicodeStrToAsciiStr (IfrNvData->LocalIp, Ip4String);
Status = IScsiAsciiStrToIp (Ip4String, &HostIp.v4);
- if (EFI_ERROR (Status) || !Ip4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
+ if (EFI_ERROR (Status) || !NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid IP address!", NULL);
Status = EFI_INVALID_PARAMETER;
} else {
@@ -568,7 +568,7 @@ IScsiFormCallback ( case KEY_GATE_WAY:
IScsiUnicodeStrToAsciiStr (IfrNvData->Gateway, Ip4String);
Status = IScsiAsciiStrToIp (Ip4String, &Gateway.v4);
- if (EFI_ERROR (Status) || ((Gateway.Addr[0] != 0) && !Ip4IsUnicast (NTOHL (Gateway.Addr[0]), 0))) {
+ if (EFI_ERROR (Status) || ((Gateway.Addr[0] != 0) && !NetIp4IsUnicast (NTOHL (Gateway.Addr[0]), 0))) {
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Gateway!", NULL);
Status = EFI_INVALID_PARAMETER;
} else {
@@ -580,7 +580,7 @@ IScsiFormCallback ( case KEY_TARGET_IP:
IScsiUnicodeStrToAsciiStr (IfrNvData->TargetIp, Ip4String);
Status = IScsiAsciiStrToIp (Ip4String, &HostIp.v4);
- if (EFI_ERROR (Status) || !Ip4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
+ if (EFI_ERROR (Status) || !NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid IP address!", NULL);
Status = EFI_INVALID_PARAMETER;
} else {
@@ -678,7 +678,7 @@ IScsiFormCallback ( //
if (!Private->Current->SessionConfigData.TargetInfoFromDhcp) {
CopyMem (&HostIp.v4, &Private->Current->SessionConfigData.TargetIp, sizeof (HostIp.v4));
- if (!Ip4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
+ if (!NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Target IP is invalid!", NULL);
Status = EFI_INVALID_PARAMETER;
break;
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c index dfb3209..d0f2089 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c @@ -1,7 +1,7 @@ /** @file
iSCSI DHCP related configuration routines.
-Copyright (c) 2004 - 2007, 2009, Intel Corporation.<BR>
+Copyright (c) 2004 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -38,7 +38,7 @@ IScsiDhcpExtractRootPath ( CHAR8 *TmpStr;
ISCSI_ROOT_PATH_FIELD Fields[RP_FIELD_IDX_MAX];
ISCSI_ROOT_PATH_FIELD *Field;
- RP_FIELD_IDX FieldIndex;
+ UINT32 FieldIndex;
UINT8 Index;
//
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.h index fd1fbe4..07b30a9 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.h +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.h @@ -1,7 +1,7 @@ /** @file
The header file of IScsiDhcp.
-Copyright (c) 2004 - 2008, Intel Corporation.<BR>
+Copyright (c) 2004 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -26,14 +26,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define ISCSI_ROOT_PATH_ID "iscsi:"
#define ISCSI_ROOT_PATH_FIELD_DELIMITER ':'
-typedef enum {
- RP_FIELD_IDX_SERVERNAME = 0,
- RP_FIELD_IDX_PROTOCOL,
- RP_FIELD_IDX_PORT,
- RP_FIELD_IDX_LUN,
- RP_FIELD_IDX_TARGETNAME,
- RP_FIELD_IDX_MAX
-} RP_FIELD_IDX;
+#define RP_FIELD_IDX_SERVERNAME 0
+#define RP_FIELD_IDX_PROTOCOL 1
+#define RP_FIELD_IDX_PORT 2
+#define RP_FIELD_IDX_LUN 3
+#define RP_FIELD_IDX_TARGETNAME 4
+#define RP_FIELD_IDX_MAX 5
typedef struct _ISCSI_ROOT_PATH_FIELD {
CHAR8 *Str;
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c index d712331..ca08da7 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c @@ -20,7 +20,9 @@ UINTN mTableKey; /**
Initialize the header of the iSCSI Boot Firmware Table.
- @param[out] Header The header of the iSCSI Boot Firmware Table.
+ @param[out] Header The header of the iSCSI Boot Firmware Table.
+ @param[in] OemId The OEM ID.
+ @param[in] OemTableId The OEM table ID for the iBFT.
**/
VOID
IScsiInitIbfTableHeader (
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c index 9eff185..5194233 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c @@ -126,7 +126,7 @@ IScsiAsciiStrToLun ( UINTN Index, IndexValue, IndexNum, SizeStr;
CHAR8 TemStr[2];
UINT8 TemValue;
- UINT16 Value [4];
+ UINT16 Value[4];
ZeroMem (Lun, 8);
ZeroMem (TemStr, 2);
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c index a370e29..d73a961 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c @@ -1,7 +1,7 @@ /** @file
The implementation of iSCSI protocol based on RFC3720.
-Copyright (c) 2004 - 2008, Intel Corporation.<BR>
+Copyright (c) 2004 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -225,8 +225,8 @@ IScsiCreateConnection ( // set the default connection-only parameters
//
Conn->MaxRecvDataSegmentLength = DEFAULT_MAX_RECV_DATA_SEG_LEN;
- Conn->HeaderDigest = ISCSI_DIGEST_NONE;
- Conn->DataDigest = ISCSI_DIGEST_NONE;
+ Conn->HeaderDigest = IScsiDigestNone;
+ Conn->DataDigest = IScsiDigestNone;
CopyMem (&Tcp4IoConfig.LocalIp, &Session->ConfigData.NvData.LocalIp, sizeof (EFI_IPv4_ADDRESS));
CopyMem (&Tcp4IoConfig.SubnetMask, &Session->ConfigData.NvData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
@@ -1146,11 +1146,11 @@ IScsiCheckOpParams ( }
if (AsciiStrCmp (Value, "CRC32") == 0) {
- if (Conn->HeaderDigest != ISCSI_DIGEST_CRC32) {
+ if (Conn->HeaderDigest != IScsiDigestCRC32) {
goto ON_ERROR;
}
} else if (AsciiStrCmp (Value, ISCSI_KEY_VALUE_NONE) == 0) {
- Conn->HeaderDigest = ISCSI_DIGEST_NONE;
+ Conn->HeaderDigest = IScsiDigestNone;
} else {
goto ON_ERROR;
}
@@ -1163,11 +1163,11 @@ IScsiCheckOpParams ( }
if (AsciiStrCmp (Value, "CRC32") == 0) {
- if (Conn->DataDigest != ISCSI_DIGEST_CRC32) {
+ if (Conn->DataDigest != IScsiDigestCRC32) {
goto ON_ERROR;
}
} else if (AsciiStrCmp (Value, ISCSI_KEY_VALUE_NONE) == 0) {
- Conn->DataDigest = ISCSI_DIGEST_NONE;
+ Conn->DataDigest = IScsiDigestNone;
} else {
goto ON_ERROR;
}
@@ -1361,10 +1361,10 @@ IScsiFillOpParams ( Session = Conn->Session;
- AsciiSPrint (Value, sizeof (Value), "%a", (Conn->HeaderDigest == ISCSI_DIGEST_CRC32) ? "None,CRC32" : "None");
+ AsciiSPrint (Value, sizeof (Value), "%a", (Conn->HeaderDigest == IScsiDigestCRC32) ? "None,CRC32" : "None");
IScsiAddKeyValuePair (Pdu, ISCSI_KEY_HEADER_DIGEST, Value);
- AsciiSPrint (Value, sizeof (Value), "%a", (Conn->DataDigest == ISCSI_DIGEST_CRC32) ? "None,CRC32" : "None");
+ AsciiSPrint (Value, sizeof (Value), "%a", (Conn->DataDigest == IScsiDigestCRC32) ? "None,CRC32" : "None");
IScsiAddKeyValuePair (Pdu, ISCSI_KEY_DATA_DIGEST, Value);
AsciiSPrint (Value, sizeof (Value), "%d", Session->ErrorRecoveryLevel);
@@ -1854,7 +1854,7 @@ IScsiNewScsiCmdPdu ( ScsiCmd->CmdSN = NTOHL (Tcb->CmdSN);
ScsiCmd->ExpStatSN = NTOHL (Tcb->Conn->ExpStatSN);
- CopyMem (ScsiCmd->CDB, Packet->Cdb, sizeof (ScsiCmd->CDB));
+ CopyMem (ScsiCmd->Cdb, Packet->Cdb, sizeof (ScsiCmd->Cdb));
if (Packet->CdbLength > 16) {
Header->Length = NTOHS (Packet->CdbLength - 15);
@@ -2258,7 +2258,7 @@ IScsiOnR2TRcvd ( R2THdr->InitiatorTaskTag = NTOHL (R2THdr->InitiatorTaskTag);
R2THdr->TargetTransferTag = NTOHL (R2THdr->TargetTransferTag);
R2THdr->StatSN = NTOHL (R2THdr->StatSN);
- R2THdr->R2TSN = NTOHL (R2THdr->R2TSN);
+ R2THdr->R2TSeqNum = NTOHL (R2THdr->R2TSeqNum);
R2THdr->BufferOffset = NTOHL (R2THdr->BufferOffset);
R2THdr->DesiredDataTransferLength = NTOHL (R2THdr->DesiredDataTransferLength);
@@ -2268,7 +2268,7 @@ IScsiOnR2TRcvd ( //
// Check the sequence number.
//
- Status = IScsiCheckSN (&Tcb->ExpDataSN, R2THdr->R2TSN);
+ Status = IScsiCheckSN (&Tcb->ExpDataSN, R2THdr->R2TSeqNum);
if (EFI_ERROR (Status)) {
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h index 3ffb2c4..93fe2af 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h @@ -1,7 +1,7 @@ /** @file
The header file of iSCSI Protocol that defines many specific data structures.
-Copyright (c) 2004 - 2008, Intel Corporation.<BR>
+Copyright (c) 2004 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -75,25 +75,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ///
/// connection state for initiator
///
-typedef enum {
- CONN_STATE_FREE,
- CONN_STATE_XPT_WAIT,
- CONN_STATE_IN_LOGIN,
- CONN_STATE_LOGGED_IN,
- CONN_STATE_IN_LOGOUT,
- CONN_STATE_LOGOUT_REQUESTED,
- CONN_STATE_CLEANUP_WAIT,
- CONN_STATE_IN_CLEANUP
-} CONNECTION_STATE;
+
+#define CONN_STATE_FREE 0
+#define CONN_STATE_XPT_WAIT 1
+#define CONN_STATE_IN_LOGIN 2
+#define CONN_STATE_LOGGED_IN 3
+#define CONN_STATE_IN_LOGOUT 4
+#define CONN_STATE_LOGOUT_REQUESTED 5
+#define CONN_STATE_CLEANUP_WAIT 6
+#define CONN_STATE_IN_CLEANUP 7
///
/// session state for initiator
///
-typedef enum {
- SESSION_STATE_FREE,
- SESSION_STATE_LOGGED_IN,
- SESSION_STATE_FAILED
-} SESSION_STATE;
+#define SESSION_STATE_FREE 0
+#define SESSION_STATE_LOGGED_IN 1
+#define SESSION_STATE_FAILED 2
typedef enum {
DataIn = 0,
@@ -227,7 +224,7 @@ typedef struct _SCSI_COMMAND { UINT32 ExpDataXferLength;
UINT32 CmdSN;
UINT32 ExpStatSN;
- UINT8 CDB[16];
+ UINT8 Cdb[16];
} SCSI_COMMAND;
//
@@ -378,7 +375,7 @@ typedef struct _ISCSI_READY_TO_TRANSFER { UINT32 StatSN;
UINT32 ExpCmdSN;
UINT32 MaxCmdSN;
- UINT32 R2TSN;
+ UINT32 R2TSeqNum;
UINT32 BufferOffset;
UINT32 DesiredDataTransferLength;
} ISCSI_READY_TO_TRANSFER;
@@ -586,8 +583,8 @@ typedef struct _ISCSI_NOP_IN { #define ISCSI_FULL_FEATURE_PHASE 3
typedef enum {
- ISCSI_DIGEST_NONE,
- ISCSI_DIGEST_CRC32
+ IScsiDigestNone,
+ IScsiDigestCRC32
} ISCSI_DIGEST_TYPE;
typedef struct _ISCSI_XFER_CONTEXT {
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h index 8cc789d..e8814a1 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h @@ -46,27 +46,24 @@ typedef struct _IP4_CONFIG_INSTANCE IP4_CONFIG_INSTANCE; //
// Global variables
//
-extern EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding;
-extern EFI_COMPONENT_NAME_PROTOCOL gIp4ConfigComponentName;
-extern EFI_COMPONENT_NAME2_PROTOCOL gIp4ConfigComponentName2;
-
-extern IP4_CONFIG_INSTANCE *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];
-extern EFI_IP4_CONFIG_PROTOCOL mIp4ConfigProtocolTemplate;
+extern EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding;
+extern EFI_COMPONENT_NAME_PROTOCOL gIp4ConfigComponentName;
+extern EFI_COMPONENT_NAME2_PROTOCOL gIp4ConfigComponentName2;
+
+extern IP4_CONFIG_INSTANCE *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];
+extern EFI_IP4_CONFIG_PROTOCOL mIp4ConfigProtocolTemplate;
#define IP4_PROTO_ICMP 0x01
#define IP4_CONFIG_INSTANCE_SIGNATURE SIGNATURE_32 ('I', 'P', '4', 'C')
-typedef enum {
- IP4_CONFIG_STATE_IDLE = 0,
- IP4_CONFIG_STATE_STARTED,
- IP4_CONFIG_STATE_CONFIGURED
-} IP4_CONFIG_STATE;
-
-typedef enum {
- DHCP_TAG_PARA_LIST = 55,
- DHCP_TAG_NETMASK = 1,
- DHCP_TAG_ROUTER = 3
-} DHCP_TAGS;
+#define IP4_CONFIG_STATE_IDLE 0
+#define IP4_CONFIG_STATE_STARTED 1
+#define IP4_CONFIG_STATE_CONFIGURED 2
+
+#define DHCP_TAG_PARA_LIST 55
+#define DHCP_TAG_NETMASK 1
+#define DHCP_TAG_ROUTER 3
+
//
// Configure the DHCP to request the routers and netmask
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c index a5b7c93..c97184a 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c @@ -198,8 +198,8 @@ Ip4ConfigIpToStr ( /**
Convert the network configuration data into the IFR data.
- @param[in] ConfigFormEntry The IP4 configuration form entry.
- @param[out] IfrNvData The IFR nv data.
+ @param[in] Ip4ConfigInstance The IP4Config instance
+ @param[out] IfrFormNvData The IFR nv data.
**/
VOID
Ip4ConfigConvertDeviceConfigDataToIfrNvData (
@@ -700,7 +700,7 @@ Ip4FormCallback ( case KEY_LOCAL_IP:
UnicodeStrToAsciiStr (IfrFormNvData->StationAddress, Ip4String);
Status = Ip4AsciiStrToIp (Ip4String, &HostIp.v4);
- if (EFI_ERROR (Status) || !Ip4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
+ if (EFI_ERROR (Status) || !NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid IP address!", NULL);
Status = EFI_INVALID_PARAMETER;
} else {
@@ -724,7 +724,7 @@ Ip4FormCallback ( case KEY_GATE_WAY:
UnicodeStrToAsciiStr (IfrFormNvData->GatewayAddress, Ip4String);
Status = Ip4AsciiStrToIp (Ip4String, &Gateway.v4);
- if (EFI_ERROR (Status) || ((Gateway.Addr[0] != 0) && !Ip4IsUnicast (NTOHL (Gateway.Addr[0]), 0))) {
+ if (EFI_ERROR (Status) || ((Gateway.Addr[0] != 0) && !NetIp4IsUnicast (NTOHL (Gateway.Addr[0]), 0))) {
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Gateway!", NULL);
Status = EFI_INVALID_PARAMETER;
} else {
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c index a5f00ee..17709af 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c @@ -1,7 +1,7 @@ /** @file
Routines used to operate the Ip4 configure variable.
-Copyright (c) 2006 - 2008, Intel Corporation.<BR>
+Copyright (c) 2006 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at<BR>
@@ -45,7 +45,7 @@ Ip4ConfigIsValid ( Netmask = EFI_NTOHL (IpConfig->SubnetMask);
if ((Netmask == 0) || !IP4_IS_VALID_NETMASK (Netmask) ||
- (Station == 0) || !Ip4IsUnicast (Station, Netmask)) {
+ (Station == 0) || !NetIp4IsUnicast (Station, Netmask)) {
return FALSE;
}
@@ -57,7 +57,7 @@ Ip4ConfigIsValid ( Gateway = EFI_NTOHL (IpConfig->RouteTable[Index].GatewayAddress);
if ((Gateway != 0) && (!IP4_NET_EQUAL (Station, Gateway, Netmask) ||
- !Ip4IsUnicast (Gateway, Netmask))) {
+ !NetIp4IsUnicast (Gateway, Netmask))) {
return FALSE;
}
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h index af01a03..0e221f7 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h @@ -1,7 +1,7 @@ /** @file
Common definition for IP4.
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -19,38 +19,32 @@ typedef struct _IP4_INTERFACE IP4_INTERFACE; typedef struct _IP4_PROTOCOL IP4_PROTOCOL;
typedef struct _IP4_SERVICE IP4_SERVICE;
-
-typedef enum {
- IP4_ETHER_PROTO = 0x0800,
-
- IP4_PROTO_ICMP = 0x01,
- IP4_PROTO_IGMP = 0x02,
-
- //
- // The packet is received as link level broadcast/multicast/promiscuous.
- //
- IP4_LINK_BROADCAST = 0x00000001,
- IP4_LINK_MULTICAST = 0x00000002,
- IP4_LINK_PROMISC = 0x00000004,
-
- //
- // IP4 address cast type classfication. Keep it true that any
- // type bigger than or equal to LOCAL_BROADCAST is broadcast.
- //
- IP4_PROMISCUOUS = 1,
- IP4_LOCAL_HOST,
- IP4_MULTICAST,
- IP4_LOCAL_BROADCAST, // Destination is 255.255.255.255
- IP4_SUBNET_BROADCAST,
- IP4_NET_BROADCAST,
-
- //
- // IP4 header flags
- //
- IP4_HEAD_DF_MASK = 0x4000,
- IP4_HEAD_MF_MASK = 0x2000,
- IP4_HEAD_OFFSET_MASK = 0x1fff
-} IP_ENUM_TYPES;
+#define IP4_ETHER_PROTO 0x0800
+
+//
+// The packet is received as link level broadcast/multicast/promiscuous.
+//
+#define IP4_LINK_BROADCAST 0x00000001
+#define IP4_LINK_MULTICAST 0x00000002
+#define IP4_LINK_PROMISC 0x00000004
+
+//
+// IP4 address cast type classfication. Keep it true that any
+// type bigger than or equal to LOCAL_BROADCAST is broadcast.
+//
+#define IP4_PROMISCUOUS 1
+#define IP4_LOCAL_HOST 2
+#define IP4_MULTICAST 3
+#define IP4_LOCAL_BROADCAST 4 // Destination is 255.255.255.255
+#define IP4_SUBNET_BROADCAST 5
+#define IP4_NET_BROADCAST 6
+
+//
+// IP4 header flags
+//
+#define IP4_HEAD_DF_MASK 0x4000
+#define IP4_HEAD_MF_MASK 0x2000
+#define IP4_HEAD_OFFSET_MASK 0x1fff
#define IP4_ALLZERO_ADDRESS 0x00000000u
#define IP4_ALLONE_ADDRESS 0xFFFFFFFFu
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c index 757d7aa..76208e0 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c @@ -1,6 +1,6 @@ /** @file
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -62,7 +62,7 @@ mIp4SupportedIcmp[23] = { {ICMP_ECHO_REQUEST, ICMP_DEFAULT_CODE },
{ICMP_TIME_EXCEEDED, ICMP_TIMEOUT_IN_TRANSIT },
- {ICMP_TIME_EXCEEDED, ICMp_TIMEOUT_REASSEMBLE },
+ {ICMP_TIME_EXCEEDED, ICMP_TIMEOUT_REASSEMBLE },
{ICMP_PARAMETER_PROBLEM, ICMP_DEFAULT_CODE },
};
@@ -247,7 +247,7 @@ Ip4IcmpReplyEcho ( ReplyHead.Tos = 0;
ReplyHead.Fragment = 0;
ReplyHead.Ttl = 64;
- ReplyHead.Protocol = IP4_PROTO_ICMP;
+ ReplyHead.Protocol = EFI_IP_PROTO_ICMP;
ReplyHead.Src = 0;
//
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h index f9db6a3..2488e61 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h @@ -1,7 +1,7 @@ /** @file
Header file for ICMP protocol.
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -15,63 +15,61 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef __EFI_IP4_ICMP_H__
#define __EFI_IP4_ICMP_H__
-typedef enum {
//
// ICMP type definations
//
- ICMP_ECHO_REPLY = 0,
- ICMP_DEST_UNREACHABLE = 3,
- ICMP_SOURCE_QUENCH = 4,
- ICMP_REDIRECT = 5,
- ICMP_ECHO_REQUEST = 8,
- ICMP_TIME_EXCEEDED = 11,
- ICMP_PARAMETER_PROBLEM = 12,
- ICMP_TIMESTAMP = 13,
- ICMP_INFO_REQUEST = 15,
- ICMP_INFO_REPLY = 16,
- ICMP_TYPE_MAX = ICMP_INFO_REPLY,
+#define ICMP_ECHO_REPLY 0
+#define ICMP_DEST_UNREACHABLE 3
+#define ICMP_SOURCE_QUENCH 4
+#define ICMP_REDIRECT 5
+#define ICMP_ECHO_REQUEST 8
+#define ICMP_TIME_EXCEEDED 11
+#define ICMP_PARAMETER_PROBLEM 12
+#define ICMP_TIMESTAMP 13
+#define ICMP_INFO_REQUEST 15
+#define ICMP_INFO_REPLY 16
+#define ICMP_TYPE_MAX ICMP_INFO_REPLY
- ICMP_DEFAULT_CODE = 0,
+#define ICMP_DEFAULT_CODE 0
//
// ICMP code definations for ICMP_DEST_UNREACHABLE
//
- ICMP_NET_UNREACHABLE = 0,
- ICMP_HOST_UNREACHABLE = 1,
- ICMP_PROTO_UNREACHABLE = 2, // Host may generate
- ICMP_PORT_UNREACHABLE = 3, // Host may generate
- ICMP_FRAGMENT_FAILED = 4,
- ICMP_SOURCEROUTE_FAILED = 5, // Host may generate
- ICMP_NET_UNKNOWN = 6,
- ICMP_HOST_UNKNOWN = 7,
- ICMP_SOURCE_ISOLATED = 8,
- ICMP_NET_PROHIBITED = 9,
- ICMP_HOST_PROHIBITED = 10,
- ICMP_NET_UNREACHABLE_TOS = 11,
- ICMP_HOST_UNREACHABLE_TOS = 12,
+#define ICMP_NET_UNREACHABLE 0
+#define ICMP_HOST_UNREACHABLE 1
+#define ICMP_PROTO_UNREACHABLE 2 // Host may generate
+#define ICMP_PORT_UNREACHABLE 3 // Host may generate
+#define ICMP_FRAGMENT_FAILED 4
+#define ICMP_SOURCEROUTE_FAILED 5 // Host may generate
+#define ICMP_NET_UNKNOWN 6
+#define ICMP_HOST_UNKNOWN 7
+#define ICMP_SOURCE_ISOLATED 8
+#define ICMP_NET_PROHIBITED 9
+#define ICMP_HOST_PROHIBITED 10
+#define ICMP_NET_UNREACHABLE_TOS 11
+#define ICMP_HOST_UNREACHABLE_TOS 12
//
// ICMP code definations for ICMP_TIME_EXCEEDED
//
- ICMP_TIMEOUT_IN_TRANSIT = 0,
- ICMp_TIMEOUT_REASSEMBLE = 1, // Host may generate
+#define ICMP_TIMEOUT_IN_TRANSIT 0
+#define ICMP_TIMEOUT_REASSEMBLE 1 // Host may generate
//
// ICMP code definations for ICMP_TIME_EXCEEDED
//
- ICMP_NET_REDIRECT = 0,
- ICMP_HOST_REDIRECT = 1,
- ICMP_NET_TOS_REDIRECT = 2,
- ICMP_HOST_TOS_REDIRECT = 3,
+#define ICMP_NET_REDIRECT 0
+#define ICMP_HOST_REDIRECT 1
+#define ICMP_NET_TOS_REDIRECT 2
+#define ICMP_HOST_TOS_REDIRECT 3
//
// ICMP message classes, each class of ICMP message shares
// a common message format. INVALID_MESSAGE is only a flag.
//
- ICMP_INVALID_MESSAGE = 0,
- ICMP_ERROR_MESSAGE = 1,
- ICMP_QUERY_MESSAGE = 2
-} ICMP_ENUM_TYPES;
+#define ICMP_INVALID_MESSAGE 0
+#define ICMP_ERROR_MESSAGE 1
+#define ICMP_QUERY_MESSAGE 2
typedef struct {
UINT8 IcmpType;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h index 305e826..2032c6d 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h @@ -1,7 +1,7 @@ /** @file
Definition for IP4 pesudo interface structure.
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -15,12 +15,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef __EFI_IP4_IF_H__
#define __EFI_IP4_IF_H__
-typedef enum {
- IP4_FRAME_RX_SIGNATURE = SIGNATURE_32 ('I', 'P', 'F', 'R'),
- IP4_FRAME_TX_SIGNATURE = SIGNATURE_32 ('I', 'P', 'F', 'T'),
- IP4_FRAME_ARP_SIGNATURE = SIGNATURE_32 ('I', 'P', 'F', 'A'),
- IP4_INTERFACE_SIGNATURE = SIGNATURE_32 ('I', 'P', 'I', 'F')
-} IP4_IF_ENUM_TYPES;
+#define IP4_FRAME_RX_SIGNATURE SIGNATURE_32 ('I', 'P', 'F', 'R')
+#define IP4_FRAME_TX_SIGNATURE SIGNATURE_32 ('I', 'P', 'F', 'T')
+#define IP4_FRAME_ARP_SIGNATURE SIGNATURE_32 ('I', 'P', 'F', 'A')
+#define IP4_INTERFACE_SIGNATURE SIGNATURE_32 ('I', 'P', 'I', 'F')
/**
This prototype is used by both receive and transmission.
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h index b82d3cc..549d4a2 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h @@ -1,6 +1,6 @@ /** @file
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -14,6 +14,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef __EFI_IP4_IGMP_H__
#define __EFI_IP4_IGMP_H__
+//
+// IGMP message type
+//
+#define IGMP_MEMBERSHIP_QUERY 0x11
+#define IGMP_V1_MEMBERSHIP_REPORT 0x12
+#define IGMP_V2_MEMBERSHIP_REPORT 0x16
+#define IGMP_LEAVE_GROUP 0x17
+
+#define IGMP_V1ROUTER_PRESENT 400
+#define IGMP_UNSOLICIATED_REPORT 10
+
#pragma pack(1)
typedef struct {
UINT8 Type;
@@ -48,19 +59,6 @@ typedef struct { LIST_ENTRY Groups;
} IGMP_SERVICE_DATA;
-typedef enum {
- //
- // IGMP message type
- //
- IGMP_MEMBERSHIP_QUERY = 0x11,
- IGMP_V1_MEMBERSHIP_REPORT = 0x12,
- IGMP_V2_MEMBERSHIP_REPORT = 0x16,
- IGMP_LEAVE_GROUP = 0x17,
-
- IGMP_V1ROUTER_PRESENT = 400,
- IGMP_UNSOLICIATED_REPORT = 10
-} IGMP_ENUM_TYPES;
-
/**
Init the IGMP control data of the IP4 service instance, configure
MNP to receive ALL SYSTEM multicast.
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c index 714f3d9..4788d40 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -1962,7 +1962,7 @@ EfiIp4Transmit ( // a IP4_TXTOKEN_WRAP and the data in a netbuf
//
Status = EFI_OUT_OF_RESOURCES;
- Wrap = AllocatePool (sizeof (IP4_TXTOKEN_WRAP));
+ Wrap = AllocateZeroPool (sizeof (IP4_TXTOKEN_WRAP));
if (Wrap == NULL) {
goto ON_EXIT;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h index 615e5ae..8b2e286 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h @@ -1,7 +1,7 @@ /** @file
Ip4 internal functions and type defintions.
-Copyright (c) 2005 - 2007, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -43,34 +43,31 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "Ip4Input.h"
#include "Ip4Output.h"
+#define IP4_PROTOCOL_SIGNATURE SIGNATURE_32 ('I', 'P', '4', 'P')
+#define IP4_SERVICE_SIGNATURE SIGNATURE_32 ('I', 'P', '4', 'S')
+
+//
+// The state of IP4 protocol. It starts from UNCONFIGED. if it is
+// successfully configured, it goes to CONFIGED. if configure NULL
+// is called, it becomes UNCONFIGED again. If (partly) destoried, it
+// becomes DESTORY.
+//
+#define IP4_STATE_UNCONFIGED 0
+#define IP4_STATE_CONFIGED 1
+#define IP4_STATE_DESTORY 2
+
+//
+// The state of IP4 service. It starts from UNSTARTED. It transits
+// to STARTED if autoconfigure is started. If default address is
+// configured, it becomes CONFIGED. and if partly destoried, it goes
+// to DESTORY.
+//
+#define IP4_SERVICE_UNSTARTED 0
+#define IP4_SERVICE_STARTED 1
+#define IP4_SERVICE_CONFIGED 2
+#define IP4_SERVICE_DESTORY 3
-typedef enum {
- IP4_PROTOCOL_SIGNATURE = SIGNATURE_32 ('I', 'P', '4', 'P'),
- IP4_SERVICE_SIGNATURE = SIGNATURE_32 ('I', 'P', '4', 'S'),
-
- //
- // The state of IP4 protocol. It starts from UNCONFIGED. if it is
- // successfully configured, it goes to CONFIGED. if configure NULL
- // is called, it becomes UNCONFIGED again. If (partly) destoried, it
- // becomes DESTORY.
- //
- IP4_STATE_UNCONFIGED = 0,
- IP4_STATE_CONFIGED,
- IP4_STATE_DESTORY,
-
- //
- // The state of IP4 service. It starts from UNSTARTED. It transits
- // to STARTED if autoconfigure is started. If default address is
- // configured, it becomes CONFIGED. and if partly destoried, it goes
- // to DESTORY.
- //
- IP4_SERVICE_UNSTARTED = 0,
- IP4_SERVICE_STARTED,
- IP4_SERVICE_CONFIGED,
- IP4_SERVICE_DESTORY
-} IP4_IMPL_ENUM_TYPES;
-
///
/// IP4_TXTOKEN_WRAP wraps the upper layer's transmit token.
/// The user's data is kept in the Packet. When fragment is
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c index b495e75..7257353 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c @@ -228,7 +228,7 @@ Ip4Reassemble ( NET_BUF *NewPacket;
INTN Index;
- IpHead = Packet->Ip;
+ IpHead = Packet->Ip.Ip4;
This = IP4_GET_CLIP_INFO (Packet);
ASSERT (IpHead != NULL);
@@ -417,7 +417,7 @@ Ip4Reassemble ( return NULL;
}
- NewPacket->Ip = Assemble->Head;
+ NewPacket->Ip.Ip4 = Assemble->Head;
CopyMem (IP4_GET_CLIP_INFO (NewPacket), Assemble->Info, sizeof (*IP4_GET_CLIP_INFO (NewPacket)));
return NewPacket;
}
@@ -501,7 +501,7 @@ Ip4AccpetFrame ( //
// Convert the IP header to host byte order, then get the per packet info.
//
- Packet->Ip = Ip4NtohHead (Head);
+ Packet->Ip.Ip4 = Ip4NtohHead (Head);
Info = IP4_GET_CLIP_INFO (Packet);
Info->LinkFlag = Flag;
@@ -570,11 +570,11 @@ Ip4AccpetFrame ( // info must be reloaded bofore use. The ownership of the packet
// is transfered to the packet process logic.
//
- Head = Packet->Ip;
+ Head = Packet->Ip.Ip4;
IP4_GET_CLIP_INFO (Packet)->Status = EFI_SUCCESS;
switch (Head->Protocol) {
- case IP4_PROTO_ICMP:
+ case EFI_IP_PROTO_ICMP:
Ip4IcmpHandle (IpSb, Head, Packet);
break;
@@ -655,7 +655,7 @@ Ip4InstanceFrameAcceptable ( //
Proto = Head->Protocol;
- if (Proto == IP4_PROTO_ICMP) {
+ if (Proto == EFI_IP_PROTO_ICMP) {
NetbufCopy (Packet, 0, sizeof (Icmp.Head), (UINT8 *) &Icmp.Head);
if (mIcmpClass[Icmp.Head.Type].IcmpClass == ICMP_ERROR_MESSAGE) {
@@ -850,13 +850,13 @@ Ip4WrapRxData ( return NULL;
}
- ASSERT (Packet->Ip != NULL);
+ ASSERT (Packet->Ip.Ip4 != NULL);
//
// The application expects a network byte order header.
//
- RxData->HeaderLength = (Packet->Ip->HeadLen << 2);
- RxData->Header = (EFI_IP4_HEADER *) Ip4NtohHead (Packet->Ip);
+ RxData->HeaderLength = (Packet->Ip.Ip4->HeadLen << 2);
+ RxData->Header = (EFI_IP4_HEADER *) Ip4NtohHead (Packet->Ip.Ip4);
RxData->OptionsLength = RxData->HeaderLength - IP4_MIN_HEADLEN;
RxData->Options = NULL;
@@ -938,9 +938,9 @@ Ip4InstanceDeliverPacket ( // may be not continuous before the data.
//
Head = NetbufAllocSpace (Dup, IP4_MAX_HEADLEN, NET_BUF_HEAD);
- Dup->Ip = (IP4_HEAD *) Head;
+ Dup->Ip.Ip4 = (IP4_HEAD *) Head;
- CopyMem (Head, Packet->Ip, Packet->Ip->HeadLen << 2);
+ CopyMem (Head, Packet->Ip.Ip4, Packet->Ip.Ip4->HeadLen << 2);
NetbufTrim (Dup, IP4_MAX_HEADLEN, TRUE);
Wrap = Ip4WrapRxData (IpInstance, Dup);
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h index eea4d7e..cd1367b 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h @@ -1,6 +1,6 @@ /** @file
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -14,14 +14,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef __EFI_IP4_INPUT_H__
#define __EFI_IP4_INPUT_H__
-typedef enum {
- IP4_MIN_HEADLEN = 20,
- IP4_MAX_HEADLEN = 60,
+#define IP4_MIN_HEADLEN 20
+#define IP4_MAX_HEADLEN 60
- IP4_ASSEMLE_HASH_SIZE = 31,
- IP4_FRAGMENT_LIFE = 120,
- IP4_MAX_PACKET_SIZE = 65535
-} IP4_INPUT_ENUM_TYPES;
+#define IP4_ASSEMLE_HASH_SIZE 31
+#define IP4_FRAGMENT_LIFE 120
+#define IP4_MAX_PACKET_SIZE 65535
///
/// Per packet information for input process. LinkFlag specifies whether
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.h index 206c920..421872c 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.h @@ -1,7 +1,7 @@ /** @file
IP4 option support routines.
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -15,15 +15,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef __EFI_IP4_OPTION_H__
#define __EFI_IP4_OPTION_H__
-typedef enum {
- IP4_OPTION_EOP = 0,
- IP4_OPTION_NOP = 1,
- IP4_OPTION_LSRR = 131, // Loss source and record routing, 10000011
- IP4_OPTION_SSRR = 137, // Strict source and record routing, 10001001
- IP4_OPTION_RR = 7, // Record routing, 00000111
+#define IP4_OPTION_EOP 0
+#define IP4_OPTION_NOP 1
+#define IP4_OPTION_LSRR 131 // Loss source and record routing, 10000011
+#define IP4_OPTION_SSRR 137 // Strict source and record routing, 10001001
+#define IP4_OPTION_RR 7 // Record routing, 00000111
- IP4_OPTION_COPY_MASK = 0x80
-} IP4_OPTION_ENUM_TYPES;
+#define IP4_OPTION_COPY_MASK 0x80
/**
Validate the IP4 option format for both the packets we received
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c index 306ab2d..53317c8 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c @@ -1,7 +1,7 @@ /** @file
Transmit the IP4 packet.
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -83,7 +83,7 @@ Ip4PrependHead ( PacketHead->Dst = HTONL (Head->Dst);
PacketHead->Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) PacketHead, HeadLen));
- Packet->Ip = PacketHead;
+ Packet->Ip.Ip4 = PacketHead;
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c index 4c238a6..0c901e8 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c @@ -1,6 +1,6 @@ /** @file
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -145,7 +145,7 @@ Ip4InitRouteCache ( {
UINT32 Index;
- for (Index = 0; Index < IP4_ROUTE_CACHE_HASH; Index++) {
+ for (Index = 0; Index < IP4_ROUTE_CACHE_HASH_VALUE; Index++) {
InitializeListHead (&(RtCache->CacheBucket[Index]));
}
}
@@ -168,7 +168,7 @@ Ip4CleanRouteCache ( IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
UINT32 Index;
- for (Index = 0; Index < IP4_ROUTE_CACHE_HASH; Index++) {
+ for (Index = 0; Index < IP4_ROUTE_CACHE_HASH_VALUE; Index++) {
NET_LIST_FOR_EACH_SAFE (Entry, Next, &(RtCache->CacheBucket[Index])) {
RtCacheEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_CACHE_ENTRY, Link);
@@ -278,7 +278,7 @@ Ip4PurgeRouteCache ( IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
UINT32 Index;
- for (Index = 0; Index < IP4_ROUTE_CACHE_HASH; Index++) {
+ for (Index = 0; Index < IP4_ROUTE_CACHE_HASH_VALUE; Index++) {
NET_LIST_FOR_EACH_SAFE (Entry, Next, &RtCache->CacheBucket[Index]) {
RtCacheEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_CACHE_ENTRY, Link);
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h index ee1f6a9..774dd60 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h @@ -1,7 +1,7 @@ /** @file
EFI IP4 route table and route cache table defintions.
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -17,14 +17,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "Ip4Common.h"
-typedef enum {
- IP4_DIRECT_ROUTE = 0x00000001,
+#define IP4_DIRECT_ROUTE 0x00000001
- IP4_ROUTE_CACHE_HASH = 31,
- IP4_ROUTE_CACHE_MAX = 64 // Max NO. of cache entry per hash bucket
-} IP4_ROUTE_ENUM_TYPES;
+#define IP4_ROUTE_CACHE_HASH_VALUE 31
+#define IP4_ROUTE_CACHE_MAX 64 // Max NO. of cache entry per hash bucket
-#define IP4_ROUTE_CACHE_HASH(Dst, Src) (((Dst) ^ (Src)) % IP4_ROUTE_CACHE_HASH)
+#define IP4_ROUTE_CACHE_HASH(Dst, Src) (((Dst) ^ (Src)) % IP4_ROUTE_CACHE_HASH_VALUE)
///
/// The route entry in the route table. Dest/Netmask is the destion
@@ -69,7 +67,7 @@ typedef struct { /// detach them later.
///
typedef struct {
- LIST_ENTRY CacheBucket[IP4_ROUTE_CACHE_HASH];
+ LIST_ENTRY CacheBucket[IP4_ROUTE_CACHE_HASH_VALUE];
} IP4_ROUTE_CACHE;
///
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c index 06f0231..229a355 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c @@ -178,7 +178,7 @@ Mtftp4OverrideValid ( IP4_ADDR Gateway;
CopyMem (&Ip, &Override->ServerIp, sizeof (IP4_ADDR));
- if (!Ip4IsUnicast (NTOHL (Ip), 0)) {
+ if (!NetIp4IsUnicast (NTOHL (Ip), 0)) {
return FALSE;
}
@@ -194,7 +194,7 @@ Mtftp4OverrideValid ( Netmask = NTOHL (Netmask);
Ip = NTOHL (Ip);
- if (!Ip4IsUnicast (Gateway, Netmask) || !IP4_NET_EQUAL (Gateway, Ip, Netmask)) {
+ if (!NetIp4IsUnicast (Gateway, Netmask) || !IP4_NET_EQUAL (Gateway, Ip, Netmask)) {
return FALSE;
}
}
@@ -653,18 +653,18 @@ EfiMtftp4Configure ( Gateway = NTOHL (Gateway);
ServerIp = NTOHL (ServerIp);
- if (!Ip4IsUnicast (ServerIp, 0)) {
+ if (!NetIp4IsUnicast (ServerIp, 0)) {
return EFI_INVALID_PARAMETER;
}
if (!ConfigData->UseDefaultSetting &&
- ((!IP4_IS_VALID_NETMASK (Netmask) || !Ip4IsUnicast (Ip, Netmask)))) {
+ ((!IP4_IS_VALID_NETMASK (Netmask) || !NetIp4IsUnicast (Ip, Netmask)))) {
return EFI_INVALID_PARAMETER;
}
if ((Gateway != 0) &&
- (!IP4_NET_EQUAL (Gateway, Ip, Netmask) || !Ip4IsUnicast (Gateway, Netmask))) {
+ (!IP4_NET_EQUAL (Gateway, Ip, Netmask) || !NetIp4IsUnicast (Gateway, Netmask))) {
return EFI_INVALID_PARAMETER;
}
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h index d4644c7..a1abf6f 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h @@ -48,20 +48,18 @@ typedef struct _MTFTP4_PROTOCOL MTFTP4_PROTOCOL; ///
/// Some constant value of Mtftp service.
///
-typedef enum {
- MTFTP4_SERVICE_SIGNATURE = SIGNATURE_32 ('T', 'F', 'T', 'P'),
- MTFTP4_PROTOCOL_SIGNATURE = SIGNATURE_32 ('t', 'f', 't', 'p'),
-
- MTFTP4_DEFAULT_SERVER_PORT = 69,
- MTFTP4_DEFAULT_TIMEOUT = 3,
- MTFTP4_DEFAULT_RETRY = 5,
- MTFTP4_DEFAULT_BLKSIZE = 512,
- MTFTP4_TIME_TO_GETMAP = 5,
-
- MTFTP4_STATE_UNCONFIGED = 0,
- MTFTP4_STATE_CONFIGED,
- MTFTP4_STATE_DESTORY
-} MTFTP4_SERVICE_CONST_VALUE;
+#define MTFTP4_SERVICE_SIGNATURE SIGNATURE_32 ('T', 'F', 'T', 'P')
+#define MTFTP4_PROTOCOL_SIGNATURE SIGNATURE_32 ('t', 'f', 't', 'p')
+
+#define MTFTP4_DEFAULT_SERVER_PORT 69
+#define MTFTP4_DEFAULT_TIMEOUT 3
+#define MTFTP4_DEFAULT_RETRY 5
+#define MTFTP4_DEFAULT_BLKSIZE 512
+#define MTFTP4_TIME_TO_GETMAP 5
+
+#define MTFTP4_STATE_UNCONFIGED 0
+#define MTFTP4_STATE_CONFIGED 1
+#define MTFTP4_STATE_DESTORY 2
///
/// Mtftp service block
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h index 3e45010..48687c1 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h @@ -1,7 +1,7 @@ /** @file
Routines to process MTFTP4 options.
-Copyright (c) 2006 - 2007, Intel Corporation<BR>
+Copyright (c) 2006 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -16,20 +16,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef __EFI_MTFTP4_OPTION_H__
#define __EFI_MTFTP4_OPTION_H__
+#define MTFTP4_SUPPORTED_OPTIONS 4
+#define MTFTP4_OPCODE_LEN 2
+#define MTFTP4_ERRCODE_LEN 2
+#define MTFTP4_BLKNO_LEN 2
+#define MTFTP4_DATA_HEAD_LEN 4
-
-typedef enum {
- MTFTP4_SUPPORTED_OPTIONS = 4,
- MTFTP4_OPCODE_LEN = 2,
- MTFTP4_ERRCODE_LEN = 2,
- MTFTP4_BLKNO_LEN = 2,
- MTFTP4_DATA_HEAD_LEN = 4,
-
- MTFTP4_BLKSIZE_EXIST = 0x01,
- MTFTP4_TIMEOUT_EXIST = 0x02,
- MTFTP4_TSIZE_EXIST = 0x04,
- MTFTP4_MCAST_EXIST = 0x08
-} MTFTP4_OPTION_CONST_VALUE;
+#define MTFTP4_BLKSIZE_EXIST 0x01
+#define MTFTP4_TIMEOUT_EXIST 0x02
+#define MTFTP4_TSIZE_EXIST 0x04
+#define MTFTP4_MCAST_EXIST 0x08
typedef struct {
UINT16 BlkSize;
diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Snp.h b/MdeModulePkg/Universal/Network/SnpDxe/Snp.h index 5fd0a4f..37de65a 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Snp.h +++ b/MdeModulePkg/Universal/Network/SnpDxe/Snp.h @@ -135,13 +135,15 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gSimpleNetworkComponentName2; //
// Virtual to physical mapping for all UNDI 3.0s.
//
-typedef struct _V2P {
- struct _V2P *Next;
+typedef struct _V2P V2P;
+
+struct _V2P {
+ V2P *Next;
VOID *VirtualAddress;
UINTN BufferSize;
EFI_PHYSICAL_ADDRESS PhysicalAddress;
VOID *Unmap;
-} V2P;
+};
/**
This routine maps the given CPU address to a Device address. It creates a
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c index 243cb68..dad64ae 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c @@ -1,7 +1,7 @@ /** @file
Implementation of the Socket.
-Copyright (c) 2005 - 2006, Intel Corporation<BR>
+Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -215,7 +215,7 @@ SockProcessRcvToken ( ASSERT (Sock != NULL);
- ASSERT (SOCK_STREAM == Sock->Type);
+ ASSERT (SockStream == Sock->Type);
RxData = RcvToken->Packet.RxData;
@@ -481,7 +481,7 @@ SockProcessSndToken ( EFI_TCP4_TRANSMIT_DATA *TxData;
EFI_STATUS Status;
- ASSERT ((Sock != NULL) && (SOCK_STREAM == Sock->Type));
+ ASSERT ((Sock != NULL) && (SockStream == Sock->Type));
FreeSpace = SockGetFreeSpace (Sock, SOCK_SND_BUF);
@@ -557,7 +557,7 @@ SockCreate ( EFI_STATUS Status;
ASSERT ((SockInitData != NULL) && (SockInitData->ProtoHandler != NULL));
- ASSERT (SockInitData->Type == SOCK_STREAM);
+ ASSERT (SockInitData->Type == SockStream);
ASSERT ((SockInitData->ProtoData != NULL) && (SockInitData->DataSize <= PROTO_RESERVED_LEN));
Parent = SockInitData->Parent;
@@ -720,7 +720,7 @@ SockDestroy ( EFI_GUID *ProtocolGuid;
EFI_STATUS Status;
- ASSERT (SOCK_STREAM == Sock->Type);
+ ASSERT (SockStream == Sock->Type);
if (Sock->DestroyCallback != NULL) {
Sock->DestroyCallback (Sock, Sock->Context);
@@ -873,13 +873,13 @@ SockConnFlush ( Set the state of the socket.
@param Sock Pointer to the socket.
- @param State The new state to be set.
+ @param State The new socket state to be set.
**/
VOID
SockSetState (
IN OUT SOCKET *Sock,
- IN SOCK_STATE State
+ IN UINT8 State
)
{
Sock->State = State;
@@ -1070,7 +1070,7 @@ SockGetDataToSend ( IN UINT8 *Dest
)
{
- ASSERT ((Sock != NULL) && SOCK_STREAM == Sock->Type);
+ ASSERT ((Sock != NULL) && SockStream == Sock->Type);
return NetbufQueCopy (
Sock->SndBuffer.DataQueue,
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c index 1722742..017d6e4 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c @@ -1,7 +1,7 @@ /** @file
Interface function of the Socket.
-Copyright (c) 2005 - 2006, Intel Corporation<BR>
+Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -397,7 +397,7 @@ SockAccept ( SOCKET *Socket;
EFI_EVENT Event;
- ASSERT (SOCK_STREAM == Sock->Type);
+ ASSERT (SockStream == Sock->Type);
Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
@@ -510,7 +510,7 @@ SockSend ( SOCK_TOKEN *SockToken;
UINT32 DataLen;
- ASSERT (SOCK_STREAM == Sock->Type);
+ ASSERT (SockStream == Sock->Type);
Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
@@ -633,7 +633,7 @@ SockRcv ( EFI_STATUS Status;
EFI_EVENT Event;
- ASSERT (SOCK_STREAM == Sock->Type);
+ ASSERT (SockStream == Sock->Type);
Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
@@ -733,7 +733,7 @@ SockFlush ( {
EFI_STATUS Status;
- ASSERT (SOCK_STREAM == Sock->Type);
+ ASSERT (SockStream == Sock->Type);
Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
@@ -798,7 +798,7 @@ SockClose ( EFI_STATUS Status;
EFI_EVENT Event;
- ASSERT (SOCK_STREAM == Sock->Type);
+ ASSERT (SockStream == Sock->Type);
Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h index a5576a5..e98fb62 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h @@ -1,7 +1,7 @@ /** @file
Socket header file.
-Copyright (c) 2005 - 2006, Intel Corporation<BR>
+Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -68,23 +68,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ///
/// Socket state
///
-typedef enum {
- SO_CLOSED = 0,
- SO_LISTENING,
- SO_CONNECTING,
- SO_CONNECTED,
- SO_DISCONNECTING
-} SOCK_STATE;
+#define SO_CLOSED 0
+#define SO_LISTENING 1
+#define SO_CONNECTING 2
+#define SO_CONNECTED 3
+#define SO_DISCONNECTING 4
///
/// Socket configure state
///
-typedef enum {
- SO_UNCONFIGURED = 0,
- SO_CONFIGURED_ACTIVE,
- SO_CONFIGURED_PASSIVE,
- SO_NO_MAPPING
-} SOCK_CONFIGURE_STATE;
+#define SO_UNCONFIGURED 0
+#define SO_CONFIGURED_ACTIVE 1
+#define SO_CONFIGURED_PASSIVE 2
+#define SO_NO_MAPPING 3
/**
Set socket SO_NO_MORE_DATA flag.
@@ -331,44 +327,44 @@ typedef struct _SOCK_COMPLETION_TOKEN { EFI_STATUS Status; ///< The status to be issued
} SOCK_COMPLETION_TOKEN;
+typedef union {
+ VOID *RxData;
+ VOID *TxData;
+} SOCK_IO_DATA;
+
///
/// The application token with data packet
///
typedef struct _SOCK_IO_TOKEN {
SOCK_COMPLETION_TOKEN Token;
- union {
- VOID *RxData;
- VOID *TxData;
- } Packet;
+ SOCK_IO_DATA Packet;
} SOCK_IO_TOKEN;
///
/// The request issued from socket layer to protocol layer.
///
-typedef enum {
- SOCK_ATTACH, ///< Attach current socket to a new PCB
- SOCK_DETACH, ///< Detach current socket from the PCB
- SOCK_CONFIGURE, ///< Configure attached PCB
- SOCK_FLUSH, ///< Flush attached PCB
- SOCK_SND, ///< Need protocol to send something
- SOCK_SNDPUSH, ///< Need protocol to send pushed data
- SOCK_SNDURG, ///< Need protocol to send urgent data
- SOCK_CONSUMED, ///< Application has retrieved data from socket
- SOCK_CONNECT, ///< Need to connect to a peer
- SOCK_CLOSE, ///< Need to close the protocol process
- SOCK_ABORT, ///< Need to reset the protocol process
- SOCK_POLL, ///< Need to poll to the protocol layer
- SOCK_ROUTE, ///< Need to add a route information
- SOCK_MODE, ///< Need to get the mode data of the protocol
- SOCK_GROUP ///< Need to join a mcast group
-} SOCK_REQUEST;
+#define SOCK_ATTACH 0 ///< Attach current socket to a new PCB
+#define SOCK_DETACH 1 ///< Detach current socket from the PCB
+#define SOCK_CONFIGURE 2 ///< Configure attached PCB
+#define SOCK_FLUSH 3 ///< Flush attached PCB
+#define SOCK_SND 4 ///< Need protocol to send something
+#define SOCK_SNDPUSH 5 ///< Need protocol to send pushed data
+#define SOCK_SNDURG 6 ///< Need protocol to send urgent data
+#define SOCK_CONSUMED 7 ///< Application has retrieved data from socket
+#define SOCK_CONNECT 8 ///< Need to connect to a peer
+#define SOCK_CLOSE 9 ///< Need to close the protocol process
+#define SOCK_ABORT 10 ///< Need to reset the protocol process
+#define SOCK_POLL 11 ///< Need to poll to the protocol layer
+#define SOCK_ROUTE 12 ///< Need to add a route information
+#define SOCK_MODE 13 ///< Need to get the mode data of the protocol
+#define SOCK_GROUP 14 ///< Need to join a mcast group
///
/// The socket type.
///
typedef enum {
- SOCK_DGRAM, ///< This socket providing datagram service
- SOCK_STREAM ///< This socket providing stream service
+ SockDgram, ///< This socket providing datagram service
+ SockStream ///< This socket providing stream service
} SOCK_TYPE;
///
@@ -396,7 +392,7 @@ typedef EFI_STATUS
(*SOCK_PROTO_HANDLER) (
IN SOCKET *Socket,
- IN SOCK_REQUEST Request,
+ IN UINT8 Request,
IN VOID *RequestData
);
@@ -413,13 +409,13 @@ EFI_STATUS Set the state of the socket.
@param Sock Pointer to the socket.
- @param State The new state to be set.
+ @param State The new socket state to be set.
**/
VOID
SockSetState (
IN OUT SOCKET *Sock,
- IN SOCK_STATE State
+ IN UINT8 State
);
/**
@@ -592,7 +588,7 @@ VOID ///
typedef struct _SOCK_INIT_DATA {
SOCK_TYPE Type;
- SOCK_STATE State;
+ UINT8 State;
SOCKET *Parent; ///< The parent of this socket
UINT32 BackLog; ///< The connection limit for listening socket
@@ -641,9 +637,9 @@ struct _SOCKET { EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
LIST_ENTRY Link;
- SOCK_CONFIGURE_STATE ConfigureState;
+ UINT8 ConfigureState;
SOCK_TYPE Type;
- SOCK_STATE State;
+ UINT8 State;
UINT16 Flag;
EFI_LOCK Lock; ///< The lock of socket
SOCK_BUFFER SndBuffer; ///< Send buffer of application's data
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c index a6acd26..fb224f4 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c @@ -592,7 +592,7 @@ OnExit: EFI_STATUS
Tcp4Dispatcher (
IN SOCKET *Sock,
- IN SOCK_REQUEST Request,
+ IN UINT8 Request,
IN VOID *Data OPTIONAL
)
{
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c index cffd53e..f48eb8c 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c @@ -38,8 +38,8 @@ EFI_TCP4_PROTOCOL mTcp4ProtocolTemplate = { };
SOCK_INIT_DATA mTcp4DefaultSockData = {
- SOCK_STREAM,
- (SOCK_STATE) 0,
+ SockStream,
+ 0,
NULL,
TCP_BACKLOG,
TCP_SND_BUF_SIZE,
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h index f430437..c744870 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h @@ -122,7 +122,7 @@ TcpSendIpPacket ( EFI_STATUS
Tcp4Dispatcher (
IN SOCKET *Sock,
- IN SOCK_REQUEST Request,
+ IN UINT8 Request,
IN VOID *Data OPTIONAL
);
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c index 25ca210..8339189 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c @@ -1,7 +1,7 @@ /** @file
Implementation of TCP4 protocol services.
-Copyright (c) 2005 - 2006, Intel Corporation<BR>
+Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -170,7 +170,7 @@ Tcp4Configure ( if (NULL != TcpConfigData) {
CopyMem (&Ip, &TcpConfigData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
- if ((Ip != 0) && !Ip4IsUnicast (NTOHL (Ip), 0)) {
+ if ((Ip != 0) && !NetIp4IsUnicast (NTOHL (Ip), 0)) {
return EFI_INVALID_PARAMETER;
}
@@ -183,7 +183,7 @@ Tcp4Configure ( CopyMem (&Ip, &TcpConfigData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
CopyMem (&SubnetMask, &TcpConfigData->AccessPoint.SubnetMask, sizeof (IP4_ADDR));
- if (!Ip4IsUnicast (NTOHL (Ip), 0) || !IP4_IS_VALID_NETMASK (NTOHL (SubnetMask))) {
+ if (!NetIp4IsUnicast (NTOHL (Ip), 0) || !IP4_IS_VALID_NETMASK (NTOHL (SubnetMask))) {
return EFI_INVALID_PARAMETER;
}
}
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h index 763789e..af44042 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h @@ -1,7 +1,7 @@ /** @file
TCP4 protocol services header file.
-Copyright (c) 2005 - 2006, Intel Corporation<BR>
+Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -50,7 +50,7 @@ extern CHAR16 *mTcpStateName[]; EFI_STATUS
Tcp4Dispatcher (
IN SOCKET *Sock,
- IN SOCK_REQUEST Request,
+ IN UINT8 Request,
IN VOID *Data OPTIONAL
);
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h index 243def8..e7da405 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h @@ -1,7 +1,7 @@ /** @file
Tcp option's routine header file.
-Copyright (c) 2005 - 2006, Intel Corporation<BR>
+Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -27,47 +27,44 @@ typedef struct _TCP_OPTION { UINT32 TSEcr; ///< The TSEcr field in a timestamp option
} TCP_OPTION;
-typedef enum {
-
- //
- // supported TCP option type and their length
- //
- TCP_OPTION_EOP = 0, ///< End Of oPtion
- TCP_OPTION_NOP = 1, ///< No-Option.
- TCP_OPTION_MSS = 2, ///< Maximum Segment Size
- TCP_OPTION_WS = 3, ///< Window scale
- TCP_OPTION_TS = 8, ///< Timestamp
- TCP_OPTION_MSS_LEN = 4, ///< Length of MSS option
- TCP_OPTION_WS_LEN = 3, ///< Length of window scale option
- TCP_OPTION_TS_LEN = 10, ///< Length of timestamp option
- TCP_OPTION_WS_ALIGNED_LEN = 4, ///< Length of window scale option, aligned
- TCP_OPTION_TS_ALIGNED_LEN = 12, ///< Length of timestamp option, aligned
-
- //
- // recommend format of timestamp window scale
- // option for fast process.
- //
- TCP_OPTION_TS_FAST = ((TCP_OPTION_NOP << 24) |
- (TCP_OPTION_NOP << 16) |
- (TCP_OPTION_TS << 8) |
- TCP_OPTION_TS_LEN),
-
- TCP_OPTION_WS_FAST = ((TCP_OPTION_NOP << 24) |
- (TCP_OPTION_WS << 16) |
- (TCP_OPTION_WS_LEN << 8)),
-
- TCP_OPTION_MSS_FAST = ((TCP_OPTION_MSS << 24) |
- (TCP_OPTION_MSS_LEN << 16)),
-
- //
- // Other misc definations
- //
- TCP_OPTION_RCVD_MSS = 0x01,
- TCP_OPTION_RCVD_WS = 0x02,
- TCP_OPTION_RCVD_TS = 0x04,
- TCP_OPTION_MAX_WS = 14, ///< Maxium window scale value
- TCP_OPTION_MAX_WIN = 0xffff ///< Max window size in TCP header
-} TCP_OPTION_TYPE;
+//
+// supported TCP option type and their length
+//
+#define TCP_OPTION_EOP 0 ///< End Of oPtion
+#define TCP_OPTION_NOP 1 ///< No-Option.
+#define TCP_OPTION_MSS 2 ///< Maximum Segment Size
+#define TCP_OPTION_WS 3 ///< Window scale
+#define TCP_OPTION_TS 8 ///< Timestamp
+#define TCP_OPTION_MSS_LEN 4 ///< Length of MSS option
+#define TCP_OPTION_WS_LEN 3 ///< Length of window scale option
+#define TCP_OPTION_TS_LEN 10 ///< Length of timestamp option
+#define TCP_OPTION_WS_ALIGNED_LEN 4 ///< Length of window scale option, aligned
+#define TCP_OPTION_TS_ALIGNED_LEN 12 ///< Length of timestamp option, aligned
+
+//
+// recommend format of timestamp window scale
+// option for fast process.
+//
+#define TCP_OPTION_TS_FAST ((TCP_OPTION_NOP << 24) | \
+ (TCP_OPTION_NOP << 16) | \
+ (TCP_OPTION_TS << 8) | \
+ (TCP_OPTION_TS_LEN))
+
+#define TCP_OPTION_WS_FAST ((TCP_OPTION_NOP << 24) | \
+ (TCP_OPTION_WS << 16) | \
+ (TCP_OPTION_WS_LEN << 8))
+
+#define TCP_OPTION_MSS_FAST ((TCP_OPTION_MSS << 24) | (TCP_OPTION_MSS_LEN << 16))
+
+//
+// Other misc definations
+//
+#define TCP_OPTION_RCVD_MSS 0x01
+#define TCP_OPTION_RCVD_WS 0x02
+#define TCP_OPTION_RCVD_TS 0x04
+#define TCP_OPTION_MAX_WS 14 ///< Maxium window scale value
+#define TCP_OPTION_MAX_WIN 0xffff ///< Max window size in TCP header
+
/**
Compute the window scale value according to the given buffer size.
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h index 78d2eb3..da88bff 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h @@ -1,7 +1,7 @@ /** @file
Tcp Protocol header file.
-Copyright (c) 2005 - 2006, Intel Corporation<BR>
+Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -27,122 +27,116 @@ typedef struct _TCP_CB TCP_CB; /// Tcp states, Don't change their order, it is used as
/// index to mTcpOutFlag and other macros
///
-typedef enum {
- TCP_CLOSED = 0,
- TCP_LISTEN,
- TCP_SYN_SENT,
- TCP_SYN_RCVD,
- TCP_ESTABLISHED,
- TCP_FIN_WAIT_1,
- TCP_FIN_WAIT_2,
- TCP_CLOSING,
- TCP_TIME_WAIT,
- TCP_CLOSE_WAIT,
- TCP_LAST_ACK
-} TCP_STATES;
+#define TCP_CLOSED 0
+#define TCP_LISTEN 1
+#define TCP_SYN_SENT 2
+#define TCP_SYN_RCVD 3
+#define TCP_ESTABLISHED 4
+#define TCP_FIN_WAIT_1 5
+#define TCP_FIN_WAIT_2 6
+#define TCP_CLOSING 7
+#define TCP_TIME_WAIT 8
+#define TCP_CLOSE_WAIT 9
+#define TCP_LAST_ACK 10
+
///
/// Flags in the TCP header
///
-typedef enum {
-
- TCP_FLG_FIN = 0x01,
- TCP_FLG_SYN = 0x02,
- TCP_FLG_RST = 0x04,
- TCP_FLG_PSH = 0x08,
- TCP_FLG_ACK = 0x10,
- TCP_FLG_URG = 0x20,
-
- //
- // mask for all the flags
- //
- TCP_FLG_FLAG = 0x3F
-} TCP_HEADER_FLAG;
-
-typedef enum {
+#define TCP_FLG_FIN 0x01
+#define TCP_FLG_SYN 0x02
+#define TCP_FLG_RST 0x04
+#define TCP_FLG_PSH 0x08
+#define TCP_FLG_ACK 0x10
+#define TCP_FLG_URG 0x20
+
+ //
+ // mask for all the flags
+ //
+#define TCP_FLG_FLAG 0x3F
+
+
+#define TCP_CONNECT_REFUSED (-1) ///< TCP error status
+#define TCP_CONNECT_RESET (-2) ///< TCP error status
+#define TCP_CONNECT_CLOSED (-3) ///< TCP error status
- TCP_CONNECT_REFUSED = -1, ///< TCP error status
- TCP_CONNECT_RESET = -2, ///< TCP error status
- TCP_CONNECT_CLOSED = -3, ///< TCP error status
-
- //
- // Current congestion status as suggested by RFC3782.
- //
- TCP_CONGEST_RECOVER = 1, ///< During the NewReno fast recovery
- TCP_CONGEST_LOSS = 2, ///< Retxmit because of retxmit time out
- TCP_CONGEST_OPEN = 3, ///< TCP is opening its congestion window
+//
+// Current congestion status as suggested by RFC3782.
+//
+#define TCP_CONGEST_RECOVER 1 ///< During the NewReno fast recovery
+#define TCP_CONGEST_LOSS 2 ///< Retxmit because of retxmit time out
+#define TCP_CONGEST_OPEN 3 ///< TCP is opening its congestion window
- //
- // TCP control flags
- //
- TCP_CTRL_NO_NAGLE = 0x0001, ///< Disable Nagle algorithm
- TCP_CTRL_NO_KEEPALIVE = 0x0002, ///< Disable keepalive timer
- TCP_CTRL_NO_WS = 0x0004, ///< Disable window scale option
- TCP_CTRL_RCVD_WS = 0x0008, ///< Received a wnd scale option in syn
- TCP_CTRL_NO_TS = 0x0010, ///< Disable Timestamp option
- TCP_CTRL_RCVD_TS = 0x0020, ///< Received a Timestamp option in syn
- TCP_CTRL_SND_TS = 0x0040, ///< Send Timestamp option to remote
- TCP_CTRL_SND_URG = 0x0080, ///< In urgent send mode
- TCP_CTRL_RCVD_URG = 0x0100, ///< In urgent receive mode
- TCP_CTRL_SND_PSH = 0x0200, ///< In PUSH send mode
- TCP_CTRL_FIN_SENT = 0x0400, ///< FIN is sent
- TCP_CTRL_FIN_ACKED = 0x0800, ///< FIN is ACKed.
- TCP_CTRL_TIMER_ON = 0x1000, ///< At least one of the timer is on
- TCP_CTRL_RTT_ON = 0x2000, ///< The RTT measurement is on
- TCP_CTRL_ACK_NOW = 0x4000, ///< Send the ACK now, don't delay
+//
+// TCP control flags
+//
+#define TCP_CTRL_NO_NAGLE 0x0001 ///< Disable Nagle algorithm
+#define TCP_CTRL_NO_KEEPALIVE 0x0002 ///< Disable keepalive timer
+#define TCP_CTRL_NO_WS 0x0004 ///< Disable window scale option
+#define TCP_CTRL_RCVD_WS 0x0008 ///< Received a wnd scale option in syn
+#define TCP_CTRL_NO_TS 0x0010 ///< Disable Timestamp option
+#define TCP_CTRL_RCVD_TS 0x0020 ///< Received a Timestamp option in syn
+#define TCP_CTRL_SND_TS 0x0040 ///< Send Timestamp option to remote
+#define TCP_CTRL_SND_URG 0x0080 ///< In urgent send mode
+#define TCP_CTRL_RCVD_URG 0x0100 ///< In urgent receive mode
+#define TCP_CTRL_SND_PSH 0x0200 ///< In PUSH send mode
+#define TCP_CTRL_FIN_SENT 0x0400 ///< FIN is sent
+#define TCP_CTRL_FIN_ACKED 0x0800 ///< FIN is ACKed.
+#define TCP_CTRL_TIMER_ON 0x1000 ///< At least one of the timer is on
+#define TCP_CTRL_RTT_ON 0x2000 ///< The RTT measurement is on
+#define TCP_CTRL_ACK_NOW 0x4000 ///< Send the ACK now, don't delay
- //
- // Timer related values
- //
- TCP_TIMER_CONNECT = 0, ///< Connection establishment timer
- TCP_TIMER_REXMIT = 1, ///< Retransmit timer
- TCP_TIMER_PROBE = 2, ///< Window probe timer
- TCP_TIMER_KEEPALIVE = 3, ///< Keepalive timer
- TCP_TIMER_FINWAIT2 = 4, ///< FIN_WAIT_2 timer
- TCP_TIMER_2MSL = 5, ///< TIME_WAIT tiemr
- TCP_TIMER_NUMBER = 6, ///< The total number of TCP timer.
- TCP_TICK = 200, ///< Every TCP tick is 200ms
- TCP_TICK_HZ = 5, ///< The frequence of TCP tick
- TCP_RTT_SHIFT = 3, ///< SRTT & RTTVAR scaled by 8
- TCP_RTO_MIN = TCP_TICK_HZ, ///< The minium value of RTO
- TCP_RTO_MAX = (TCP_TICK_HZ * 60), ///< The maxium value of RTO
- TCP_FOLD_RTT = 4, ///< Timeout threshod to fold RTT
+//
+// Timer related values
+//
+#define TCP_TIMER_CONNECT 0 ///< Connection establishment timer
+#define TCP_TIMER_REXMIT 1 ///< Retransmit timer
+#define TCP_TIMER_PROBE 2 ///< Window probe timer
+#define TCP_TIMER_KEEPALIVE 3 ///< Keepalive timer
+#define TCP_TIMER_FINWAIT2 4 ///< FIN_WAIT_2 timer
+#define TCP_TIMER_2MSL 5 ///< TIME_WAIT tiemr
+#define TCP_TIMER_NUMBER 6 ///< The total number of TCP timer.
+#define TCP_TICK 200 ///< Every TCP tick is 200ms
+#define TCP_TICK_HZ 5 ///< The frequence of TCP tick
+#define TCP_RTT_SHIFT 3 ///< SRTT & RTTVAR scaled by 8
+#define TCP_RTO_MIN TCP_TICK_HZ ///< The minium value of RTO
+#define TCP_RTO_MAX (TCP_TICK_HZ * 60) ///< The maxium value of RTO
+#define TCP_FOLD_RTT 4 ///< Timeout threshod to fold RTT
- //
- // Default values for some timers
- //
- TCP_MAX_LOSS = 12, ///< Default max times to retxmit
- TCP_KEEPALIVE_IDLE_MIN = (TCP_TICK_HZ * 60 * 60 * 2), ///< First keep alive
- TCP_KEEPALIVE_PERIOD = (TCP_TICK_HZ * 60),
- TCP_MAX_KEEPALIVE = 8,
- TCP_FIN_WAIT2_TIME = (2 * TCP_TICK_HZ),
- TCP_TIME_WAIT_TIME = (2 * TCP_TICK_HZ),
- TCP_PAWS_24DAY = (24 * 24 * 60 * 60 * TCP_TICK_HZ),
- TCP_CONNECT_TIME = (75 * TCP_TICK_HZ),
+//
+// Default values for some timers
+//
+#define TCP_MAX_LOSS 12 ///< Default max times to retxmit
+#define TCP_KEEPALIVE_IDLE_MIN (TCP_TICK_HZ * 60 * 60 * 2) ///< First keep alive
+#define TCP_KEEPALIVE_PERIOD (TCP_TICK_HZ * 60)
+#define TCP_MAX_KEEPALIVE 8
+#define TCP_FIN_WAIT2_TIME (2 * TCP_TICK_HZ)
+#define TCP_TIME_WAIT_TIME (2 * TCP_TICK_HZ)
+#define TCP_PAWS_24DAY (24 * 24 * 60 * 60 * TCP_TICK_HZ)
+#define TCP_CONNECT_TIME (75 * TCP_TICK_HZ)
- //
- // The header space to be reserved before TCP data to accomodate :
- // 60byte IP head + 60byte TCP head + link layer head
- //
- TCP_MAX_HEAD = 192,
+//
+// The header space to be reserved before TCP data to accomodate :
+// 60byte IP head + 60byte TCP head + link layer head
+//
+#define TCP_MAX_HEAD 192
- //
- // Value ranges for some control option
- //
- TCP_RCV_BUF_SIZE = (2 * 1024 * 1024),
- TCP_RCV_BUF_SIZE_MIN = (8 * 1024),
- TCP_SND_BUF_SIZE = (2 * 1024 * 1024),
- TCP_SND_BUF_SIZE_MIN = (8 * 1024),
- TCP_BACKLOG = 10,
- TCP_BACKLOG_MIN = 5,
- TCP_MAX_LOSS_MIN = 6,
- TCP_CONNECT_TIME_MIN = (60 * TCP_TICK_HZ),
- TCP_MAX_KEEPALIVE_MIN = 4,
- TCP_KEEPALIVE_IDLE_MAX = (TCP_TICK_HZ * 60 * 60 * 4),
- TCP_KEEPALIVE_PERIOD_MIN= (TCP_TICK_HZ * 30),
- TCP_FIN_WAIT2_TIME_MAX = (4 * TCP_TICK_HZ),
- TCP_TIME_WAIT_TIME_MAX = (60 * TCP_TICK_HZ)
-} TCP_MISC_VALUES;
+//
+// Value ranges for some control option
+//
+#define TCP_RCV_BUF_SIZE (2 * 1024 * 1024)
+#define TCP_RCV_BUF_SIZE_MIN (8 * 1024)
+#define TCP_SND_BUF_SIZE (2 * 1024 * 1024)
+#define TCP_SND_BUF_SIZE_MIN (8 * 1024)
+#define TCP_BACKLOG 10
+#define TCP_BACKLOG_MIN 5
+#define TCP_MAX_LOSS_MIN 6
+#define TCP_CONNECT_TIME_MIN (60 * TCP_TICK_HZ)
+#define TCP_MAX_KEEPALIVE_MIN 4
+#define TCP_KEEPALIVE_IDLE_MAX (TCP_TICK_HZ * 60 * 60 * 4)
+#define TCP_KEEPALIVE_PERIOD_MIN (TCP_TICK_HZ * 30)
+#define TCP_FIN_WAIT2_TIME_MAX (4 * TCP_TICK_HZ)
+#define TCP_TIME_WAIT_TIME_MAX (60 * TCP_TICK_HZ)
///
/// TCP segmentation data
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c index c923117..3c0e65f 100644 --- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c +++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c @@ -824,7 +824,7 @@ Udp4ValidateTxToken ( if (TxData->GatewayAddress != NULL) {
CopyMem (&GatewayAddress, TxData->GatewayAddress, sizeof (IP4_ADDR));
- if (!Ip4IsUnicast (NTOHL (GatewayAddress), 0)) {
+ if (!NetIp4IsUnicast (NTOHL (GatewayAddress), 0)) {
//
// The specified GatewayAddress is not a unicast IPv4 address while it's not 0.
//
@@ -839,7 +839,7 @@ Udp4ValidateTxToken ( CopyMem (&SourceAddress, &UdpSessionData->SourceAddress, sizeof (IP4_ADDR));
- if ((SourceAddress != 0) && !Ip4IsUnicast (HTONL (SourceAddress), 0)) {
+ if ((SourceAddress != 0) && !NetIp4IsUnicast (HTONL (SourceAddress), 0)) {
//
// Check whether SourceAddress is a valid IPv4 address in case it's not zero.
// The configured station address is used if SourceAddress is zero.
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c index 582d6f6..5002f6f 100644 --- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c +++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c @@ -171,8 +171,8 @@ Udp4Configure ( if (!UdpConfigData->UseDefaultAddress &&
(!IP4_IS_VALID_NETMASK (SubnetMask) ||
- !((StationAddress == 0) || Ip4IsUnicast (StationAddress, SubnetMask)) ||
- !((RemoteAddress == 0) || Ip4IsUnicast (RemoteAddress, 0)))) {
+ !((StationAddress == 0) || NetIp4IsUnicast (StationAddress, SubnetMask)) ||
+ !((RemoteAddress == 0) || NetIp4IsUnicast (RemoteAddress, 0)))) {
//
// Don't use default address, and subnet mask is invalid or StationAddress is not
// a valid unicast IPv4 address or RemoteAddress is not a valid unicast IPv4 address
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h index 103ae2f..829caa8 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h @@ -15,115 +15,109 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef __EFI_PXEBC_DHCP_H__
#define __EFI_PXEBC_DHCP_H__
-typedef enum {
- PXEBC_DHCP4_MAX_OPTION_NUM = 16,
- PXEBC_DHCP4_MAX_OPTION_SIZE = 312,
- PXEBC_DHCP4_MAX_PACKET_SIZE = 1472,
-
- PXEBC_DHCP4_S_PORT = 67,
- PXEBC_DHCP4_C_PORT = 68,
- PXEBC_BS_DOWNLOAD_PORT = 69,
- PXEBC_BS_DISCOVER_PORT = 4011,
-
- PXEBC_DHCP4_OPCODE_REQUEST = 1,
- PXEBC_DHCP4_OPCODE_REPLY = 2,
- PXEBC_DHCP4_MSG_TYPE_REQUEST = 3,
- PXEBC_DHCP4_MAGIC = 0x63538263, // network byte order
- //
- // Dhcp Options
- //
- PXEBC_DHCP4_TAG_PAD = 0, // Pad Option
- PXEBC_DHCP4_TAG_EOP = 255, // End Option
- PXEBC_DHCP4_TAG_NETMASK = 1, // Subnet Mask
- PXEBC_DHCP4_TAG_TIME_OFFSET = 2, // Time Offset from UTC
- PXEBC_DHCP4_TAG_ROUTER = 3, // Router option,
- PXEBC_DHCP4_TAG_TIME_SERVER = 4, // Time Server
- PXEBC_DHCP4_TAG_NAME_SERVER = 5, // Name Server
- PXEBC_DHCP4_TAG_DNS_SERVER = 6, // Domain Name Server
- PXEBC_DHCP4_TAG_HOSTNAME = 12, // Host Name
- PXEBC_DHCP4_TAG_BOOTFILE_LEN = 13, // Boot File Size
- PXEBC_DHCP4_TAG_DUMP = 14, // Merit Dump File
- PXEBC_DHCP4_TAG_DOMAINNAME = 15, // Domain Name
- PXEBC_DHCP4_TAG_ROOTPATH = 17, // Root path
- PXEBC_DHCP4_TAG_EXTEND_PATH = 18, // Extensions Path
- PXEBC_DHCP4_TAG_EMTU = 22, // Maximum Datagram Reassembly Size
- PXEBC_DHCP4_TAG_TTL = 23, // Default IP Time-to-live
- PXEBC_DHCP4_TAG_BROADCAST = 28, // Broadcast Address
- PXEBC_DHCP4_TAG_NIS_DOMAIN = 40, // Network Information Service Domain
- PXEBC_DHCP4_TAG_NIS_SERVER = 41, // Network Information Servers
- PXEBC_DHCP4_TAG_NTP_SERVER = 42, // Network Time Protocol Servers
- PXEBC_DHCP4_TAG_VENDOR = 43, // Vendor Specific Information
- PXEBC_DHCP4_TAG_REQUEST_IP = 50, // Requested IP Address
- PXEBC_DHCP4_TAG_LEASE = 51, // IP Address Lease Time
- PXEBC_DHCP4_TAG_OVERLOAD = 52, // Option Overload
- PXEBC_DHCP4_TAG_MSG_TYPE = 53, // DHCP Message Type
- PXEBC_DHCP4_TAG_SERVER_ID = 54, // Server Identifier
- PXEBC_DHCP4_TAG_PARA_LIST = 55, // Parameter Request List
- PXEBC_DHCP4_TAG_MAXMSG = 57, // Maximum DHCP Message Size
- PXEBC_DHCP4_TAG_T1 = 58, // Renewal (T1) Time Value
- PXEBC_DHCP4_TAG_T2 = 59, // Rebinding (T2) Time Value
- PXEBC_DHCP4_TAG_CLASS_ID = 60, // Vendor class identifier
- PXEBC_DHCP4_TAG_CLIENT_ID = 61, // Client-identifier
- PXEBC_DHCP4_TAG_TFTP = 66, // TFTP server name
- PXEBC_DHCP4_TAG_BOOTFILE = 67, // Bootfile name
- PXEBC_PXE_DHCP4_TAG_ARCH = 93,
- PXEBC_PXE_DHCP4_TAG_UNDI = 94,
- PXEBC_PXE_DHCP4_TAG_UUID = 97,
- //
- // Sub-Options in Dhcp Vendor Option
- //
- PXEBC_VENDOR_TAG_MTFTP_IP = 1,
- PXEBC_VENDOR_TAG_MTFTP_CPORT = 2,
- PXEBC_VENDOR_TAG_MTFTP_SPORT = 3,
- PXEBC_VENDOR_TAG_MTFTP_TIMEOUT = 4,
- PXEBC_VENDOR_TAG_MTFTP_DELAY = 5,
- PXEBC_VENDOR_TAG_DISCOVER_CTRL = 6,
- PXEBC_VENDOR_TAG_DISCOVER_MCAST = 7,
- PXEBC_VENDOR_TAG_BOOT_SERVERS = 8,
- PXEBC_VENDOR_TAG_BOOT_MENU = 9,
- PXEBC_VENDOR_TAG_MENU_PROMPT = 10,
- PXEBC_VENDOR_TAG_MCAST_ALLOC = 11,
- PXEBC_VENDOR_TAG_CREDENTIAL_TYPES = 12,
- PXEBC_VENDOR_TAG_BOOT_ITEM = 71,
-
- PXEBC_DHCP4_DISCOVER_INIT_TIMEOUT = 4,
- PXEBC_DHCP4_DISCOVER_RETRIES = 4,
-
- PXEBC_MAX_MENU_NUM = 24,
- PXEBC_MAX_OFFER_NUM = 16,
-
- PXEBC_BOOT_REQUEST_TIMEOUT = 1,
- PXEBC_BOOT_REQUEST_RETRIES = 4,
-
- PXEBC_DHCP4_OVERLOAD_FILE = 1,
- PXEBC_DHCP4_OVERLOAD_SERVER_NAME = 2
-} PXEBC_ENUM_TYPES;
+#define PXEBC_DHCP4_MAX_OPTION_NUM 16
+#define PXEBC_DHCP4_MAX_OPTION_SIZE 312
+#define PXEBC_DHCP4_MAX_PACKET_SIZE 1472
+
+#define PXEBC_DHCP4_S_PORT 67
+#define PXEBC_DHCP4_C_PORT 68
+#define PXEBC_BS_DOWNLOAD_PORT 69
+#define PXEBC_BS_DISCOVER_PORT 4011
+
+#define PXEBC_DHCP4_OPCODE_REQUEST 1
+#define PXEBC_DHCP4_OPCODE_REPLY 2
+#define PXEBC_DHCP4_MSG_TYPE_REQUEST 3
+#define PXEBC_DHCP4_MAGIC 0x63538263 // network byte order
+//
+// Dhcp Options
+//
+#define PXEBC_DHCP4_TAG_PAD 0 // Pad Option
+#define PXEBC_DHCP4_TAG_EOP 255 // End Option
+#define PXEBC_DHCP4_TAG_NETMASK 1 // Subnet Mask
+#define PXEBC_DHCP4_TAG_TIME_OFFSET 2 // Time Offset from UTC
+#define PXEBC_DHCP4_TAG_ROUTER 3 // Router option,
+#define PXEBC_DHCP4_TAG_TIME_SERVER 4 // Time Server
+#define PXEBC_DHCP4_TAG_NAME_SERVER 5 // Name Server
+#define PXEBC_DHCP4_TAG_DNS_SERVER 6 // Domain Name Server
+#define PXEBC_DHCP4_TAG_HOSTNAME 12 // Host Name
+#define PXEBC_DHCP4_TAG_BOOTFILE_LEN 13 // Boot File Size
+#define PXEBC_DHCP4_TAG_DUMP 14 // Merit Dump File
+#define PXEBC_DHCP4_TAG_DOMAINNAME 15 // Domain Name
+#define PXEBC_DHCP4_TAG_ROOTPATH 17 // Root path
+#define PXEBC_DHCP4_TAG_EXTEND_PATH 18 // Extensions Path
+#define PXEBC_DHCP4_TAG_EMTU 22 // Maximum Datagram Reassembly Size
+#define PXEBC_DHCP4_TAG_TTL 23 // Default IP Time-to-live
+#define PXEBC_DHCP4_TAG_BROADCAST 28 // Broadcast Address
+#define PXEBC_DHCP4_TAG_NIS_DOMAIN 40 // Network Information Service Domain
+#define PXEBC_DHCP4_TAG_NIS_SERVER 41 // Network Information Servers
+#define PXEBC_DHCP4_TAG_NTP_SERVER 42 // Network Time Protocol Servers
+#define PXEBC_DHCP4_TAG_VENDOR 43 // Vendor Specific Information
+#define PXEBC_DHCP4_TAG_REQUEST_IP 50 // Requested IP Address
+#define PXEBC_DHCP4_TAG_LEASE 51 // IP Address Lease Time
+#define PXEBC_DHCP4_TAG_OVERLOAD 52 // Option Overload
+#define PXEBC_DHCP4_TAG_MSG_TYPE 53 // DHCP Message Type
+#define PXEBC_DHCP4_TAG_SERVER_ID 54 // Server Identifier
+#define PXEBC_DHCP4_TAG_PARA_LIST 55 // Parameter Request List
+#define PXEBC_DHCP4_TAG_MAXMSG 57 // Maximum DHCP Message Size
+#define PXEBC_DHCP4_TAG_T1 58 // Renewal (T1) Time Value
+#define PXEBC_DHCP4_TAG_T2 59 // Rebinding (T2) Time Value
+#define PXEBC_DHCP4_TAG_CLASS_ID 60 // Vendor class identifier
+#define PXEBC_DHCP4_TAG_CLIENT_ID 61 // Client-identifier
+#define PXEBC_DHCP4_TAG_TFTP 66 // TFTP server name
+#define PXEBC_DHCP4_TAG_BOOTFILE 67 // Bootfile name
+#define PXEBC_PXE_DHCP4_TAG_ARCH 93
+#define PXEBC_PXE_DHCP4_TAG_UNDI 94
+#define PXEBC_PXE_DHCP4_TAG_UUID 97
+//
+// Sub-Options in Dhcp Vendor Option
+//
+#define PXEBC_VENDOR_TAG_MTFTP_IP 1
+#define PXEBC_VENDOR_TAG_MTFTP_CPORT 2
+#define PXEBC_VENDOR_TAG_MTFTP_SPORT 3
+#define PXEBC_VENDOR_TAG_MTFTP_TIMEOUT 4
+#define PXEBC_VENDOR_TAG_MTFTP_DELAY 5
+#define PXEBC_VENDOR_TAG_DISCOVER_CTRL 6
+#define PXEBC_VENDOR_TAG_DISCOVER_MCAST 7
+#define PXEBC_VENDOR_TAG_BOOT_SERVERS 8
+#define PXEBC_VENDOR_TAG_BOOT_MENU 9
+#define PXEBC_VENDOR_TAG_MENU_PROMPT 10
+#define PXEBC_VENDOR_TAG_MCAST_ALLOC 11
+#define PXEBC_VENDOR_TAG_CREDENTIAL_TYPES 12
+#define PXEBC_VENDOR_TAG_BOOT_ITEM 71
+
+#define PXEBC_DHCP4_DISCOVER_INIT_TIMEOUT 4
+#define PXEBC_DHCP4_DISCOVER_RETRIES 4
+
+#define PXEBC_MAX_MENU_NUM 24
+#define PXEBC_MAX_OFFER_NUM 16
+
+#define PXEBC_BOOT_REQUEST_TIMEOUT 1
+#define PXEBC_BOOT_REQUEST_RETRIES 4
+
+#define PXEBC_DHCP4_OVERLOAD_FILE 1
+#define PXEBC_DHCP4_OVERLOAD_SERVER_NAME 2
//
// The array index of the DHCP4 option tag interested
//
-typedef enum {
- PXEBC_DHCP4_TAG_INDEX_BOOTFILE_LEN,
- PXEBC_DHCP4_TAG_INDEX_VENDOR,
- PXEBC_DHCP4_TAG_INDEX_OVERLOAD,
- PXEBC_DHCP4_TAG_INDEX_MSG_TYPE,
- PXEBC_DHCP4_TAG_INDEX_SERVER_ID,
- PXEBC_DHCP4_TAG_INDEX_CLASS_ID,
- PXEBC_DHCP4_TAG_INDEX_BOOTFILE,
- PXEBC_DHCP4_TAG_INDEX_MAX
-} PXEBC_DHCP4_TAG_INDEX_ENUM_TYPES;
+#define PXEBC_DHCP4_TAG_INDEX_BOOTFILE_LEN 0
+#define PXEBC_DHCP4_TAG_INDEX_VENDOR 1
+#define PXEBC_DHCP4_TAG_INDEX_OVERLOAD 2
+#define PXEBC_DHCP4_TAG_INDEX_MSG_TYPE 3
+#define PXEBC_DHCP4_TAG_INDEX_SERVER_ID 4
+#define PXEBC_DHCP4_TAG_INDEX_CLASS_ID 5
+#define PXEBC_DHCP4_TAG_INDEX_BOOTFILE 6
+#define PXEBC_DHCP4_TAG_INDEX_MAX 7
//
// The type of DHCP OFFER, arranged by priority, PXE10 has the highest priority.
//
-typedef enum {
- DHCP4_PACKET_TYPE_PXE10,
- DHCP4_PACKET_TYPE_WFM11A,
- DHCP4_PACKET_TYPE_BINL,
- DHCP4_PACKET_TYPE_DHCP_ONLY,
- DHCP4_PACKET_TYPE_MAX,
- DHCP4_PACKET_TYPE_BOOTP = DHCP4_PACKET_TYPE_MAX
-} DHCP4_PACKET_TYPE_ENUM_TYPES;
+#define DHCP4_PACKET_TYPE_PXE10 0
+#define DHCP4_PACKET_TYPE_WFM11A 1
+#define DHCP4_PACKET_TYPE_BINL 2
+#define DHCP4_PACKET_TYPE_DHCP_ONLY 3
+#define DHCP4_PACKET_TYPE_MAX 4
+#define DHCP4_PACKET_TYPE_BOOTP DHCP4_PACKET_TYPE_MAX
#define BIT(x) (1 << x)
#define CTRL(x) (0x1F & (x))
@@ -274,13 +268,14 @@ typedef struct { #define PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE (OFFSET_OF (EFI_DHCP4_PACKET, Dhcp4) + PXEBC_DHCP4_MAX_PACKET_SIZE)
-typedef struct {
- union {
- EFI_DHCP4_PACKET Offer;
- EFI_DHCP4_PACKET Ack;
- UINT8 Buffer[PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE];
- } Packet;
+typedef union {
+ EFI_DHCP4_PACKET Offer;
+ EFI_DHCP4_PACKET Ack;
+ UINT8 Buffer[PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE];
+} PXEBC_DHCP4_PACKET;
+typedef struct {
+ PXEBC_DHCP4_PACKET Packet;
BOOLEAN IsPxeOffer;
UINT8 OfferType;
EFI_DHCP4_PACKET_OPTION *Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_MAX];
@@ -438,7 +433,7 @@ PxeBcBuildDhcpOptions ( /**
- Create the boot options
+ Create the boot options.
@param OptList Pointer to the list of the options
@param Type the type of option
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c index 659f638..e04ae3a 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c @@ -176,7 +176,7 @@ IcmpErrorListenHandlerDpc ( }
if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&
- !Ip4IsUnicast (EFI_NTOHL (RxData->Header->SourceAddress), 0)) {
+ !NetIp4IsUnicast (EFI_NTOHL (RxData->Header->SourceAddress), 0)) {
//
// The source address is not zero and it's not a unicast IP address, discard it.
//
@@ -1044,11 +1044,11 @@ EfiPxeBcMtftp ( EFI_PXE_BASE_CODE_MODE *Mode;
EFI_MAC_ADDRESS TempMacAddr;
- if ((This == NULL) ||
- (Filename == NULL) ||
- (BufferSize == NULL) ||
- ((ServerIp == NULL) || !Ip4IsUnicast (NTOHL (ServerIp->Addr[0]), 0)) ||
- ((BufferPtr == NULL) && DontUseBuffer) ||
+ if ((This == NULL) ||
+ (Filename == NULL) ||
+ (BufferSize == NULL) ||
+ ((ServerIp == NULL) || !NetIp4IsUnicast (NTOHL (ServerIp->Addr[0]), 0)) ||
+ ((BufferPtr == NULL) && DontUseBuffer) ||
((BlockSize != NULL) && (*BlockSize < 512))) {
return EFI_INVALID_PARAMETER;
@@ -1243,7 +1243,7 @@ EfiPxeBcUdpWrite ( return EFI_INVALID_PARAMETER;
}
- if ((GatewayIp != NULL) && !Ip4IsUnicast (NTOHL (GatewayIp->Addr[0]), 0)) {
+ if ((GatewayIp != NULL) && !NetIp4IsUnicast (NTOHL (GatewayIp->Addr[0]), 0)) {
//
// Gateway is provided but it's not a unicast IP address.
//
@@ -1783,7 +1783,7 @@ EfiPxeBcSetIpFilter ( DEBUG ((EFI_D_ERROR, "There is broadcast address in NewFilter.\n"));
return EFI_INVALID_PARAMETER;
}
- if (Ip4IsUnicast (EFI_IP4 (NewFilter->IpList[Index].v4), 0) &&
+ if (NetIp4IsUnicast (EFI_IP4 (NewFilter->IpList[Index].v4), 0) &&
(NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP)
) {
//
@@ -2110,7 +2110,7 @@ EfiPxeBcSetStationIP ( return EFI_INVALID_PARAMETER;
}
- if (NewStationIp != NULL && !Ip4IsUnicast (NTOHL (NewStationIp->Addr[0]), 0)) {
+ if (NewStationIp != NULL && !NetIp4IsUnicast (NTOHL (NewStationIp->Addr[0]), 0)) {
return EFI_INVALID_PARAMETER;
}
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.h b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.h index 2ef0450..4d795a2 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.h +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.h @@ -1,7 +1,7 @@ /** @file
Mtftp routines for PxeBc.
-Copyright (c) 2007, Intel Corporation.<BR>
+Copyright (c) 2007 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -15,13 +15,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef __EFI_PXEBC_MTFTP_H__
#define __EFI_PXEBC_MTFTP_H__
-typedef enum {
- PXE_MTFTP_OPTION_BLKSIZE_INDEX,
- PXE_MTFTP_OPTION_TIMEOUT_INDEX,
- PXE_MTFTP_OPTION_TSIZE_INDEX,
- PXE_MTFTP_OPTION_MULTICAST_INDEX,
- PXE_MTFTP_OPTION_MAXIMUM_INDEX
-} PXE_MTFTP_OPTION_ENUM_TYPES;
+#define PXE_MTFTP_OPTION_BLKSIZE_INDEX 0
+#define PXE_MTFTP_OPTION_TIMEOUT_INDEX 1
+#define PXE_MTFTP_OPTION_TSIZE_INDEX 2
+#define PXE_MTFTP_OPTION_MULTICAST_INDEX 3
+#define PXE_MTFTP_OPTION_MAXIMUM_INDEX 4
/**
|