TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip4Config2Impl.h
Go to the documentation of this file.
1
11#ifndef __IP4_CONFIG2_IMPL_H__
12#define __IP4_CONFIG2_IMPL_H__
13
14#define IP4_CONFIG2_INSTANCE_SIGNATURE SIGNATURE_32 ('I', 'P', 'C', '2')
15#define IP4_FORM_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('I', 'F', 'C', 'I')
16
17#define IP4_CONFIG2_VARIABLE_ATTRIBUTE (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)
18
19#define DATA_ATTRIB_SIZE_FIXED 0x1
20#define DATA_ATTRIB_VOLATILE 0x2
21
22#define DATA_ATTRIB_SET(Attrib, Bits) (BOOLEAN)((Attrib) & (Bits))
23#define SET_DATA_ATTRIB(Attrib, Bits) ((Attrib) |= (Bits))
24#define REMOVE_DATA_ATTRIB(Attrib, Bits) ((Attrib) &= (~Bits))
25
27
28#define IP4_CONFIG2_INSTANCE_FROM_PROTOCOL(Proto) \
29 CR ((Proto), \
30 IP4_CONFIG2_INSTANCE, \
31 Ip4Config2, \
32 IP4_CONFIG2_INSTANCE_SIGNATURE \
33 )
34
35#define IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE(Instance) \
36 CR ((Instance), \
37 IP4_SERVICE, \
38 Ip4Config2Instance, \
39 IP4_SERVICE_SIGNATURE \
40 )
41
42#define IP4_CONFIG2_INSTANCE_FROM_FORM_CALLBACK(Callback) \
43 CR ((Callback), \
44 IP4_CONFIG2_INSTANCE, \
45 CallbackInfo, \
46 IP4_CONFIG2_INSTANCE_SIGNATURE \
47 )
48
49#define IP4_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS(ConfigAccess) \
50 CR ((ConfigAccess), \
51 IP4_FORM_CALLBACK_INFO, \
52 HiiConfigAccessProtocol, \
53 IP4_FORM_CALLBACK_INFO_SIGNATURE \
54 )
55
69typedef
72 IN IP4_CONFIG2_INSTANCE *Instance,
73 IN UINTN DataSize,
74 IN VOID *Data
75 );
76
93typedef
96 IN IP4_CONFIG2_INSTANCE *Instance,
97 IN OUT UINTN *DataSize,
98 IN VOID *Data OPTIONAL
99 );
100
101typedef union {
102 VOID *Ptr;
105 EFI_IP4_CONFIG2_MANUAL_ADDRESS *ManualAddress;
106 EFI_IPv4_ADDRESS *Gateway;
107 EFI_IPv4_ADDRESS *DnsServers;
109
110typedef struct {
111 IP4_CONFIG2_SET_DATA SetData;
112 IP4_CONFIG2_GET_DATA GetData;
113 EFI_STATUS Status;
114 UINT8 Attribute;
115 NET_MAP EventMap;
116 IP4_CONFIG2_DATA Data;
117 UINTN DataSize;
119
120typedef struct {
121 UINT16 Offset;
122 UINT32 DataSize;
125
126#pragma pack(1)
127
128//
129// heap data that contains the data for each data record.
130//
131// EFI_IP4_CONFIG2_POLICY Policy;
132// UINT32 ManualaddressCount;
133// UINT32 GatewayCount;
134// UINT32 DnsServersCount;
135// EFI_IP4_CONFIG2_MANUAL_ADDRESS ManualAddress[];
136// EFI_IPv4_ADDRESS Gateway[];
137// EFI_IPv4_ADDRESS DnsServers[];
138//
139typedef struct {
140 UINT16 Checksum;
141 UINT16 DataRecordCount;
142 IP4_CONFIG2_DATA_RECORD DataRecord[1];
144
145#pragma pack()
146
147typedef struct {
156
158 UINT32 Signature;
159 EFI_HANDLE ChildHandle;
160 EFI_HII_CONFIG_ACCESS_PROTOCOL HiiConfigAccessProtocol;
161 EFI_DEVICE_PATH_PROTOCOL *HiiVendorDevicePath;
162 EFI_HII_HANDLE RegisteredHandle;
164
166 UINT32 Signature;
167 BOOLEAN Configured;
168 LIST_ENTRY Link;
169 UINT16 IfIndex;
170
171 EFI_IP4_CONFIG2_PROTOCOL Ip4Config2;
172
173 EFI_IP4_CONFIG2_INTERFACE_INFO InterfaceInfo;
175 IP4_CONFIG2_DATA_ITEM DataItem[Ip4Config2DataTypeMaximum];
176
177 EFI_EVENT Dhcp4SbNotifyEvent;
178 VOID *Registration;
179 EFI_HANDLE Dhcp4Handle;
180 EFI_DHCP4_PROTOCOL *Dhcp4;
181 BOOLEAN DhcpSuccess;
182 BOOLEAN OtherInfoOnly;
183 EFI_EVENT Dhcp4Event;
184 UINT32 FailedIaAddressCount;
185 EFI_IPv4_ADDRESS *DeclineAddress;
186 UINT32 DeclineAddressCount;
187
188 IP4_FORM_CALLBACK_INFO CallbackInfo;
189
190 IP4_CONFIG2_NVDATA Ip4NvData;
191};
192
193//
194// Configure the DHCP to request the routers and netmask
195// from server. The DHCP4_TAG_NETMASK is included in Head.
196//
197#pragma pack(1)
198typedef struct {
200 UINT8 Route;
201 UINT8 Dns;
203#pragma pack()
204
221 IN CHAR16 *VarName,
222 IN OUT IP4_CONFIG2_INSTANCE *Instance
223 );
224
238 IN IP4_CONFIG2_INSTANCE *Instance
239 );
240
252 OUT IP4_CONFIG2_INSTANCE *Instance
253 );
254
261VOID
263 IN OUT IP4_CONFIG2_INSTANCE *Instance
264 );
265
273VOID
274EFIAPI
276 IN EFI_EVENT Event,
277 IN VOID *Context
278 );
279
291 IN OUT IP4_CONFIG2_INSTANCE *Instance
292 );
293
294#endif
UINT64 UINTN
EFI_IP4_CONFIG2_POLICY
Definition: Ip4Config2.h:127
EFI_IP4_CONFIG2_DATA_TYPE
Definition: Ip4Config2.h:28
EFI_STATUS Ip4Config2ReadConfigData(IN CHAR16 *VarName, IN OUT IP4_CONFIG2_INSTANCE *Instance)
EFI_STATUS Ip4Config2InitInstance(OUT IP4_CONFIG2_INSTANCE *Instance)
EFI_STATUS Ip4Config2DestroyDhcp4(IN OUT IP4_CONFIG2_INSTANCE *Instance)
EFI_STATUS(* IP4_CONFIG2_SET_DATA)(IN IP4_CONFIG2_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS(* IP4_CONFIG2_GET_DATA)(IN IP4_CONFIG2_INSTANCE *Instance, IN OUT UINTN *DataSize, IN VOID *Data OPTIONAL)
VOID Ip4Config2CleanInstance(IN OUT IP4_CONFIG2_INSTANCE *Instance)
VOID EFIAPI Ip4AutoReconfigCallBack(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS Ip4StartAutoConfig(IN IP4_CONFIG2_INSTANCE *Instance)
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
VOID * EFI_HII_HANDLE
EFI_IP4_CONFIG2_MANUAL_ADDRESS * ManualAddress
IP addresses.
EFI_IPv4_ADDRESS * DnsAddress
DNS server address.
UINT32 ManualAddressCount
IP addresses count.
UINT32 DnsAddressCount
DNS server address count.
EFI_IP4_CONFIG2_POLICY Policy
manual or automatic
EFI_IPv4_ADDRESS * GatewayAddress
Gateway address.
UINT32 GatewayAddressCount
Gateway address count.