summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-07-23 09:18:27 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-07-23 09:18:27 +0000
commitb2570da8b7d2154b2d1344f2eb25acac9e6b6578 (patch)
tree6db5aab6f76ae3f697ace8e24d9f0c600d188ab9 /MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h
parentcbf316f20726bb31b7c37424601643790dbd02d9 (diff)
downloadedk2-platforms-b2570da8b7d2154b2d1344f2eb25acac9e6b6578.tar.xz
Import Ip4Config module
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3406 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h')
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h132
1 files changed, 132 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h
new file mode 100644
index 0000000000..90e55993c2
--- /dev/null
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h
@@ -0,0 +1,132 @@
+/** @file
+
+Copyright (c) 2006 - 2007, Intel Corporation
+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
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+ Ip4Config.h
+
+Abstract:
+
+ Header file for IP4Config driver.
+
+
+**/
+
+#ifndef __EFI_IP4CONFIG_H__
+#define __EFI_IP4CONFIG_H__
+
+#include <PiDxe.h>
+
+#include <Protocol/Dhcp4.h>
+#include <Protocol/IP4Config.h>
+#include <Protocol/ManagedNetwork.h>
+
+#include <Library/DebugLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/UefiDriverEntryPoint.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+#include <Library/NetLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+
+#include "NicIp4Variable.h"
+
+typedef struct _IP4_CONFIG_INSTANCE IP4_CONFIG_INSTANCE;
+
+enum {
+ IP4_CONFIG_STATE_IDLE = 0,
+ IP4_CONFIG_STATE_STARTED,
+ IP4_CONFIG_STATE_CONFIGURED,
+
+ IP4_PROTO_ICMP = 0x01,
+ IP4_CONFIG_INSTANCE_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', '4', 'C'),
+
+ DHCP_TAG_PARA_LIST = 55,
+ DHCP_TAG_NETMASK = 1,
+ DHCP_TAG_ROUTER = 3,
+};
+
+//
+// Configure the DHCP to request the routers and netmask
+// from server. The DHCP_TAG_NETMASK is included in Head.
+//
+#pragma pack(1)
+typedef struct {
+ EFI_DHCP4_PACKET_OPTION Head;
+ UINT8 Route;
+} IP4_CONFIG_DHCP4_OPTION;
+#pragma pack()
+
+typedef struct _IP4_CONFIG_INSTANCE {
+ UINT32 Signature;
+ EFI_HANDLE Controller;
+ EFI_HANDLE Image;
+
+ EFI_IP4_CONFIG_PROTOCOL Ip4ConfigProtocol;
+ EFI_NIC_IP4_CONFIG_PROTOCOL NicIp4Protocol;
+
+ //
+ // NicConfig's state, such as IP4_CONFIG_STATE_IDLE
+ //
+ INTN State;
+
+ //
+ // Mnp child to keep the connection with MNP.
+ //
+ EFI_MANAGED_NETWORK_PROTOCOL *Mnp;
+ EFI_HANDLE MnpHandle;
+
+ //
+ // User's requests data
+ //
+ EFI_EVENT DoneEvent;
+ EFI_EVENT ReconfigEvent;
+ EFI_STATUS Result;
+
+ //
+ // Identity of this interface and some configuration info.
+ //
+ NIC_ADDR NicAddr;
+ UINT16 NicName[IP4_NIC_NAME_LENGTH];
+ UINT32 NicIndex;
+ NIC_IP4_CONFIG_INFO *NicConfig;
+
+ //
+ // DHCP handles to access DHCP
+ //
+ EFI_DHCP4_PROTOCOL *Dhcp4;
+ EFI_HANDLE Dhcp4Handle;
+ EFI_EVENT Dhcp4Event;
+};
+
+#define IP4_CONFIG_INSTANCE_FROM_IP4CONFIG(this) \
+ CR (this, IP4_CONFIG_INSTANCE, Ip4ConfigProtocol, IP4_CONFIG_INSTANCE_SIGNATURE)
+
+#define IP4_CONFIG_INSTANCE_FROM_NIC_IP4CONFIG(this) \
+ CR (this, IP4_CONFIG_INSTANCE, NicIp4Protocol, IP4_CONFIG_INSTANCE_SIGNATURE)
+
+extern EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding;
+extern EFI_COMPONENT_NAME_PROTOCOL gIp4ConfigComponentName;
+extern IP4_CONFIG_INSTANCE *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];
+extern EFI_IP4_CONFIG_PROTOCOL mIp4ConfigProtocolTemplate;
+extern EFI_NIC_IP4_CONFIG_PROTOCOL mNicIp4ConfigProtocolTemplate;
+
+VOID
+Ip4ConfigCleanDhcp4 (
+ IN IP4_CONFIG_INSTANCE *This
+ );
+
+VOID
+Ip4ConfigCleanConfig (
+ IN IP4_CONFIG_INSTANCE *Instance
+ );
+#endif