]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h
[Description]:
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4ConfigDxe / Ip4Config.h
CommitLineData
83cbd279 1/** @file\r
2\r
3Copyright (c) 2006 - 2007, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12Module Name:\r
13\r
14 Ip4Config.h\r
15\r
16Abstract:\r
17\r
18 Header file for IP4Config driver.\r
19\r
20\r
21**/\r
22\r
23#ifndef __EFI_IP4CONFIG_H__\r
24#define __EFI_IP4CONFIG_H__\r
25\r
b2570da8 26#include <PiDxe.h>\r
27\r
28#include <Protocol/Dhcp4.h>\r
24e58768 29#include <Protocol/Ip4Config.h>\r
b2570da8 30#include <Protocol/ManagedNetwork.h>\r
31\r
32#include <Library/DebugLib.h>\r
33#include <Library/UefiRuntimeServicesTableLib.h>\r
34#include <Library/UefiDriverEntryPoint.h>\r
35#include <Library/UefiBootServicesTableLib.h>\r
36#include <Library/UefiLib.h>\r
37#include <Library/NetLib.h>\r
38#include <Library/BaseMemoryLib.h>\r
83cbd279 39#include <Library/MemoryAllocationLib.h>\r
40\r
41#include "NicIp4Variable.h"\r
42\r
43typedef struct _IP4_CONFIG_INSTANCE IP4_CONFIG_INSTANCE;\r
44\r
45enum {\r
46 IP4_CONFIG_STATE_IDLE = 0,\r
47 IP4_CONFIG_STATE_STARTED,\r
48 IP4_CONFIG_STATE_CONFIGURED,\r
49\r
50 IP4_PROTO_ICMP = 0x01,\r
51 IP4_CONFIG_INSTANCE_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', '4', 'C'),\r
52\r
53 DHCP_TAG_PARA_LIST = 55,\r
54 DHCP_TAG_NETMASK = 1,\r
55 DHCP_TAG_ROUTER = 3\r
56};\r
57\r
58//\r
59// Configure the DHCP to request the routers and netmask\r
60// from server. The DHCP_TAG_NETMASK is included in Head.\r
61//\r
62#pragma pack(1)\r
63typedef struct {\r
64 EFI_DHCP4_PACKET_OPTION Head;\r
65 UINT8 Route;\r
66} IP4_CONFIG_DHCP4_OPTION;\r
67#pragma pack()\r
68\r
69struct _IP4_CONFIG_INSTANCE {\r
70 UINT32 Signature;\r
71 EFI_HANDLE Controller;\r
72 EFI_HANDLE Image;\r
73\r
74 EFI_IP4_CONFIG_PROTOCOL Ip4ConfigProtocol;\r
75 EFI_NIC_IP4_CONFIG_PROTOCOL NicIp4Protocol;\r
76\r
77 //\r
78 // NicConfig's state, such as IP4_CONFIG_STATE_IDLE\r
79 //\r
80 INTN State;\r
81\r
82 //\r
83 // Mnp child to keep the connection with MNP.\r
84 //\r
85 EFI_MANAGED_NETWORK_PROTOCOL *Mnp;\r
86 EFI_HANDLE MnpHandle;\r
87\r
88 //\r
89 // User's requests data\r
90 //\r
91 EFI_EVENT DoneEvent;\r
92 EFI_EVENT ReconfigEvent;\r
93 EFI_STATUS Result;\r
94\r
95 //\r
96 // Identity of this interface and some configuration info.\r
97 //\r
98 NIC_ADDR NicAddr;\r
99 UINT16 NicName[IP4_NIC_NAME_LENGTH];\r
100 UINT32 NicIndex;\r
101 NIC_IP4_CONFIG_INFO *NicConfig;\r
102\r
103 //\r
104 // DHCP handles to access DHCP\r
105 //\r
106 EFI_DHCP4_PROTOCOL *Dhcp4;\r
107 EFI_HANDLE Dhcp4Handle;\r
108 EFI_EVENT Dhcp4Event;\r
109};\r
110\r
111#define IP4_CONFIG_INSTANCE_FROM_IP4CONFIG(this) \\r
112 CR (this, IP4_CONFIG_INSTANCE, Ip4ConfigProtocol, IP4_CONFIG_INSTANCE_SIGNATURE)\r
113\r
114#define IP4_CONFIG_INSTANCE_FROM_NIC_IP4CONFIG(this) \\r
115 CR (this, IP4_CONFIG_INSTANCE, NicIp4Protocol, IP4_CONFIG_INSTANCE_SIGNATURE)\r
116\r
117extern EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding;\r
118extern EFI_COMPONENT_NAME_PROTOCOL gIp4ConfigComponentName;\r
119extern EFI_COMPONENT_NAME2_PROTOCOL gIp4ConfigComponentName2;\r
120extern IP4_CONFIG_INSTANCE *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];\r
121extern EFI_IP4_CONFIG_PROTOCOL mIp4ConfigProtocolTemplate;\r
122extern EFI_NIC_IP4_CONFIG_PROTOCOL mNicIp4ConfigProtocolTemplate;\r
123\r
124VOID\r
125Ip4ConfigCleanDhcp4 (\r
126 IN IP4_CONFIG_INSTANCE *This\r
127 );\r
128\r
129VOID\r
130Ip4ConfigCleanConfig (\r
131 IN IP4_CONFIG_INSTANCE *Instance\r
132 );\r
133#endif\r