\r
#include <PiDxe.h>\r
\r
-#include <Protocol/IP4.h>\r
-#include <Protocol/IP4Config.h>\r
+#include <Protocol/Ip4.h>\r
+#include <Protocol/Ip4Config.h>\r
#include <Protocol/Arp.h>\r
#include <Protocol/ManagedNetwork.h>\r
\r
#include "Ip4Input.h"\r
#include "Ip4Output.h"\r
\r
-enum {\r
+typedef enum {\r
IP4_PROTOCOL_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', '4', 'P'),\r
IP4_SERVICE_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', '4', 'S'),\r
\r
IP4_SERVICE_STARTED,\r
IP4_SERVICE_CONFIGED,\r
IP4_SERVICE_DESTORY\r
-};\r
-\r
-//\r
-// IP4_TXTOKEN_WRAP wraps the upper layer's transmit token.\r
-// The user's data is kept in the Packet. When fragment is\r
-// needed, each fragment of the Packet has a reference to the\r
-// Packet, no data is actually copied. The Packet will be\r
-// released when all the fragments of it have been recycled by\r
-// MNP. Upon then, the IP4_TXTOKEN_WRAP will be released, and\r
-// user's event signalled.\r
-//\r
+} IP4_IMPL_ENUM_TYPES;\r
+\r
+///\r
+/// IP4_TXTOKEN_WRAP wraps the upper layer's transmit token.\r
+/// The user's data is kept in the Packet. When fragment is\r
+/// needed, each fragment of the Packet has a reference to the\r
+/// Packet, no data is actually copied. The Packet will be\r
+/// released when all the fragments of it have been recycled by\r
+/// MNP. Upon then, the IP4_TXTOKEN_WRAP will be released, and\r
+/// user's event signalled.\r
+///\r
typedef struct {\r
IP4_PROTOCOL *IpInstance;\r
EFI_IP4_COMPLETION_TOKEN *Token;\r
INTN Life;\r
} IP4_TXTOKEN_WRAP;\r
\r
-//\r
-// IP4_RXDATA_WRAP wraps the data IP4 child delivers to the\r
-// upper layers. The received packet is kept in the Packet.\r
-// The Packet itself may be constructured from some fragments.\r
-// All the fragments of the Packet is organized by a\r
-// IP4_ASSEMBLE_ENTRY structure. If the Packet is recycled by\r
-// the upper layer, the assemble entry and its associated\r
-// fragments will be freed at last.\r
-//\r
+///\r
+/// IP4_RXDATA_WRAP wraps the data IP4 child delivers to the\r
+/// upper layers. The received packet is kept in the Packet.\r
+/// The Packet itself may be constructured from some fragments.\r
+/// All the fragments of the Packet is organized by a\r
+/// IP4_ASSEMBLE_ENTRY structure. If the Packet is recycled by\r
+/// the upper layer, the assemble entry and its associated\r
+/// fragments will be freed at last.\r
+///\r
typedef struct {\r
- NET_LIST_ENTRY Link;\r
+ LIST_ENTRY Link;\r
IP4_PROTOCOL *IpInstance;\r
NET_BUF *Packet;\r
EFI_IP4_RECEIVE_DATA RxData;\r
} IP4_RXDATA_WRAP;\r
\r
-struct _IP4_PROTOCOL {\r
+typedef struct _IP4_PROTOCOL {\r
UINT32 Signature;\r
\r
EFI_IP4_PROTOCOL Ip4Proto;\r
INTN State;\r
\r
IP4_SERVICE *Service;\r
- NET_LIST_ENTRY Link; // Link to all the IP protocol from the service\r
+ LIST_ENTRY Link; // Link to all the IP protocol from the service\r
\r
//\r
// User's transmit/receive tokens, and received/deliverd packets\r
//\r
NET_MAP RxTokens;\r
NET_MAP TxTokens; // map between (User's Token, IP4_TXTOKE_WRAP)\r
- NET_LIST_ENTRY Received; // Received but not delivered packet\r
- NET_LIST_ENTRY Delivered; // Delivered and to be recycled packets\r
+ LIST_ENTRY Received; // Received but not delivered packet\r
+ LIST_ENTRY Delivered; // Delivered and to be recycled packets\r
EFI_LOCK RecycleLock;\r
\r
//\r
// is used to communicate the current route info to the upper layer.\r
//\r
IP4_INTERFACE *Interface;\r
- NET_LIST_ENTRY AddrLink; // Ip instances with the same IP address.\r
+ LIST_ENTRY AddrLink; // Ip instances with the same IP address.\r
IP4_ROUTE_TABLE *RouteTable;\r
\r
EFI_IP4_ROUTE_TABLE *EfiRouteTable;\r
\r
EFI_IP4_CONFIG_DATA ConfigData;\r
\r
-};\r
+} IP4_PROTOCOL;\r
\r
-struct _IP4_SERVICE {\r
+typedef struct _IP4_SERVICE {\r
UINT32 Signature;\r
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r
INTN State;\r
// interface and route table and caches.\r
//\r
UINTN NumChildren;\r
- NET_LIST_ENTRY Children;\r
+ LIST_ENTRY Children;\r
\r
- NET_LIST_ENTRY Interfaces;\r
+ LIST_ENTRY Interfaces;\r
\r
IP4_INTERFACE *DefaultInterface;\r
IP4_ROUTE_TABLE *DefaultRouteTable;\r
// NIC this IP4_SERVICE works on.\r
//\r
CHAR16 *MacString;\r
-};\r
+} IP4_SERVICE;\r
\r
#define IP4_INSTANCE_FROM_PROTOCOL(Ip4) \\r
CR ((Ip4), IP4_PROTOCOL, Ip4Proto, IP4_PROTOCOL_SIGNATURE)\r