TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip4Config2Impl.h File Reference

Go to the source code of this file.

Data Structures

union  IP4_CONFIG2_DATA
 
struct  IP4_CONFIG2_DATA_ITEM
 
struct  IP4_CONFIG2_DATA_RECORD
 
struct  IP4_CONFIG2_VARIABLE
 
struct  IP4_CONFIG2_NVDATA
 
struct  _IP4_FORM_CALLBACK_INFO
 
struct  _IP4_CONFIG2_INSTANCE
 
struct  IP4_CONFIG2_DHCP4_OPTION
 

Macros

#define IP4_CONFIG2_INSTANCE_SIGNATURE   SIGNATURE_32 ('I', 'P', 'C', '2')
 
#define IP4_FORM_CALLBACK_INFO_SIGNATURE   SIGNATURE_32 ('I', 'F', 'C', 'I')
 
#define IP4_CONFIG2_VARIABLE_ATTRIBUTE   (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)
 
#define DATA_ATTRIB_SIZE_FIXED   0x1
 
#define DATA_ATTRIB_VOLATILE   0x2
 
#define DATA_ATTRIB_SET(Attrib, Bits)   (BOOLEAN)((Attrib) & (Bits))
 
#define SET_DATA_ATTRIB(Attrib, Bits)   ((Attrib) |= (Bits))
 
#define REMOVE_DATA_ATTRIB(Attrib, Bits)   ((Attrib) &= (~Bits))
 
#define IP4_CONFIG2_INSTANCE_FROM_PROTOCOL(Proto)
 
#define IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE(Instance)
 
#define IP4_CONFIG2_INSTANCE_FROM_FORM_CALLBACK(Callback)
 
#define IP4_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS(ConfigAccess)
 

Typedefs

typedef struct _IP4_CONFIG2_INSTANCE IP4_CONFIG2_INSTANCE
 
typedef EFI_STATUS(* IP4_CONFIG2_SET_DATA) (IN IP4_CONFIG2_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
 
typedef EFI_STATUS(* IP4_CONFIG2_GET_DATA) (IN IP4_CONFIG2_INSTANCE *Instance, IN OUT UINTN *DataSize, IN VOID *Data OPTIONAL)
 
typedef struct _IP4_FORM_CALLBACK_INFO IP4_FORM_CALLBACK_INFO
 

Functions

EFI_STATUS Ip4Config2ReadConfigData (IN CHAR16 *VarName, IN OUT IP4_CONFIG2_INSTANCE *Instance)
 
EFI_STATUS Ip4StartAutoConfig (IN IP4_CONFIG2_INSTANCE *Instance)
 
EFI_STATUS Ip4Config2InitInstance (OUT IP4_CONFIG2_INSTANCE *Instance)
 
VOID Ip4Config2CleanInstance (IN OUT IP4_CONFIG2_INSTANCE *Instance)
 
VOID EFIAPI Ip4AutoReconfigCallBack (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS Ip4Config2DestroyDhcp4 (IN OUT IP4_CONFIG2_INSTANCE *Instance)
 

Detailed Description

Definitions for EFI IPv4 Configuration II Protocol implementation.

Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ip4Config2Impl.h.

Macro Definition Documentation

◆ DATA_ATTRIB_SET

#define DATA_ATTRIB_SET (   Attrib,
  Bits 
)    (BOOLEAN)((Attrib) & (Bits))

Definition at line 22 of file Ip4Config2Impl.h.

◆ DATA_ATTRIB_SIZE_FIXED

#define DATA_ATTRIB_SIZE_FIXED   0x1

Definition at line 19 of file Ip4Config2Impl.h.

◆ DATA_ATTRIB_VOLATILE

#define DATA_ATTRIB_VOLATILE   0x2

Definition at line 20 of file Ip4Config2Impl.h.

◆ IP4_CONFIG2_INSTANCE_FROM_FORM_CALLBACK

#define IP4_CONFIG2_INSTANCE_FROM_FORM_CALLBACK (   Callback)
Value:
CR ((Callback), \
CallbackInfo, \
IP4_CONFIG2_INSTANCE_SIGNATURE \
)
#define CR(Record, TYPE, Field, TestSignature)
Definition: DebugLib.h:659

Definition at line 42 of file Ip4Config2Impl.h.

◆ IP4_CONFIG2_INSTANCE_FROM_PROTOCOL

#define IP4_CONFIG2_INSTANCE_FROM_PROTOCOL (   Proto)
Value:
CR ((Proto), \
Ip4Config2, \
IP4_CONFIG2_INSTANCE_SIGNATURE \
)

Definition at line 28 of file Ip4Config2Impl.h.

◆ IP4_CONFIG2_INSTANCE_SIGNATURE

#define IP4_CONFIG2_INSTANCE_SIGNATURE   SIGNATURE_32 ('I', 'P', 'C', '2')

Definition at line 14 of file Ip4Config2Impl.h.

◆ IP4_CONFIG2_VARIABLE_ATTRIBUTE

#define IP4_CONFIG2_VARIABLE_ATTRIBUTE   (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)

Definition at line 17 of file Ip4Config2Impl.h.

◆ IP4_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS

#define IP4_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS (   ConfigAccess)
Value:
CR ((ConfigAccess), \
HiiConfigAccessProtocol, \
IP4_FORM_CALLBACK_INFO_SIGNATURE \
)

Definition at line 49 of file Ip4Config2Impl.h.

◆ IP4_FORM_CALLBACK_INFO_SIGNATURE

#define IP4_FORM_CALLBACK_INFO_SIGNATURE   SIGNATURE_32 ('I', 'F', 'C', 'I')

Definition at line 15 of file Ip4Config2Impl.h.

◆ IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE

#define IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (   Instance)
Value:
CR ((Instance), \
Ip4Config2Instance, \
IP4_SERVICE_SIGNATURE \
)

Definition at line 35 of file Ip4Config2Impl.h.

◆ REMOVE_DATA_ATTRIB

#define REMOVE_DATA_ATTRIB (   Attrib,
  Bits 
)    ((Attrib) &= (~Bits))

Definition at line 24 of file Ip4Config2Impl.h.

◆ SET_DATA_ATTRIB

#define SET_DATA_ATTRIB (   Attrib,
  Bits 
)    ((Attrib) |= (Bits))

Definition at line 23 of file Ip4Config2Impl.h.

Typedef Documentation

◆ IP4_CONFIG2_GET_DATA

typedef EFI_STATUS(* IP4_CONFIG2_GET_DATA) (IN IP4_CONFIG2_INSTANCE *Instance, IN OUT UINTN *DataSize, IN VOID *Data OPTIONAL)

The prototype of work function for EfiIp4Config2GetData().

Parameters
[in]InstanceThe pointer to the IP4 config2 instance data.
[in,out]DataSizeOn input, in bytes, the size of Data. On output, in bytes, the size of buffer required to store the specified configuration data.
[in]DataThe data buffer in which the configuration data is returned. Ignored if DataSize is ZERO.
Return values
EFI_BUFFER_TOO_SMALLThe size of Data is too small for the specified configuration data, and the required size is returned in DataSize.
EFI_SUCCESSThe specified configuration data was obtained successfully.

Definition at line 94 of file Ip4Config2Impl.h.

◆ IP4_CONFIG2_INSTANCE

Definition at line 26 of file Ip4Config2Impl.h.

◆ IP4_CONFIG2_SET_DATA

typedef EFI_STATUS(* IP4_CONFIG2_SET_DATA) (IN IP4_CONFIG2_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)

The prototype of work function for EfiIp4Config2SetData().

Parameters
[in]InstanceThe pointer to the IP4 config2 instance data.
[in]DataSizeIn bytes, the size of the buffer pointed to by Data.
[in]DataThe data buffer to set.
Return values
EFI_BAD_BUFFER_SIZEThe DataSize does not match the size of the type, 8 bytes.
EFI_SUCCESSThe specified configuration data for the EFI IPv4 network stack was set successfully.

Definition at line 70 of file Ip4Config2Impl.h.

Function Documentation

◆ Ip4AutoReconfigCallBack()

VOID EFIAPI Ip4AutoReconfigCallBack ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Request Ip4AutoReconfigCallBackDpc as a DPC at TPL_CALLBACK.

Parameters
EventThe event that is signalled.
ContextThe IP4 service binding instance.

Definition at line 2134 of file Ip4Config2Impl.c.

◆ Ip4Config2CleanInstance()

VOID Ip4Config2CleanInstance ( IN OUT IP4_CONFIG2_INSTANCE Instance)

Release an IP4_CONFIG2_INSTANCE.

Parameters
[in,out]InstanceThe buffer of IP4_CONFIG2_INSTANCE to be freed.

Definition at line 2049 of file Ip4Config2Impl.c.

◆ Ip4Config2DestroyDhcp4()

EFI_STATUS Ip4Config2DestroyDhcp4 ( IN OUT IP4_CONFIG2_INSTANCE Instance)

Destroy the Dhcp4 child in IP4_CONFIG2_INSTANCE and release the resources.

Parameters
[in,out]InstanceThe buffer of IP4 config2 instance to be freed.
Return values
EFI_SUCCESSThe child was successfully destroyed.
OthersFailed to destroy the child.

Definition at line 40 of file Ip4Config2Impl.c.

◆ Ip4Config2InitInstance()

EFI_STATUS Ip4Config2InitInstance ( OUT IP4_CONFIG2_INSTANCE Instance)

Initialize an IP4_CONFIG2_INSTANCE.

Parameters
[out]InstanceThe buffer of IP4_CONFIG2_INSTANCE to be initialized.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate resources to complete the operation.
EFI_SUCCESSThe IP4_CONFIG2_INSTANCE initialized successfully.

Definition at line 1942 of file Ip4Config2Impl.c.

◆ Ip4Config2ReadConfigData()

EFI_STATUS Ip4Config2ReadConfigData ( IN CHAR16 *  VarName,
IN OUT IP4_CONFIG2_INSTANCE Instance 
)

Read the configuration data from variable storage according to the VarName and gEfiIp4Config2ProtocolGuid. It checks the integrity of variable data. If the data is corrupted, it clears the variable data to ZERO. Otherwise, it outputs the configuration data to IP4_CONFIG2_INSTANCE.

Parameters
[in]VarNameThe pointer to the variable name
[in,out]InstanceThe pointer to the IP4 config2 instance data.
Return values
EFI_NOT_FOUNDThe variable can not be found or already corrupted.
EFI_OUT_OF_RESOURCESFail to allocate resource to complete the operation.
EFI_SUCCESSThe configuration data was retrieved successfully.

Definition at line 188 of file Ip4Config2Impl.c.

◆ Ip4StartAutoConfig()

EFI_STATUS Ip4StartAutoConfig ( IN IP4_CONFIG2_INSTANCE Instance)

Start the DHCP configuration for this IP service instance. It will locates the EFI_IP4_CONFIG2_PROTOCOL, then start the DHCP configuration.

Parameters
[in]InstanceThe IP4 config2 instance to configure.
Return values
EFI_SUCCESSThe auto configuration is successfully started.
OthersFailed to start auto configuration.

Start the DHCP configuration for this IP service instance. It will locates the EFI_IP4_CONFIG2_PROTOCOL, then start the DHCP configuration.

Parameters
[in]InstanceThe IP4 config2 instance to configure
Return values
EFI_SUCCESSThe auto configuration is successfully started
OthersFailed to start auto configuration.

Definition at line 885 of file Ip4Config2Impl.c.