TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip6ConfigNv.c File Reference
#include "Ip6Impl.h"

Go to the source code of this file.

Functions

VOID EFIAPI Ip6ConfigManualAddressNotify (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS Ip6ConfigNvGetData (IN EFI_IP6_CONFIG_PROTOCOL *Ip6Config, IN EFI_IP6_CONFIG_DATA_TYPE DataType, OUT UINTN *DataSize, OUT VOID **Data)
 
VOID Ip6FreeAddressInfoList (IN LIST_ENTRY *ListHead)
 
VOID Ip6ToStr (IN EFI_IPv6_ADDRESS *Ip6, OUT CHAR16 *Str)
 
EFI_STATUS Ip6ConvertInterfaceIdToString (OUT CHAR16 *String, IN EFI_IP6_CONFIG_INTERFACE_ID *IfId)
 
EFI_STATUS Ip6ParseInterfaceIdFromString (IN CONST CHAR16 *String, OUT EFI_IP6_CONFIG_INTERFACE_ID *IfId)
 
EFI_STATUS Ip6CreateOpCode (IN UINT16 StartLabelNumber, OUT VOID **StartOpCodeHandle, OUT EFI_IFR_GUID_LABEL **StartLabel, OUT VOID **EndOpCodeHandle, OUT EFI_IFR_GUID_LABEL **EndLabel)
 
EFI_STATUS Ip6ConvertAddressListToString (IN OUT CHAR16 *String, IN EFI_HII_HANDLE HiiHandle, IN IP6_CONFIG_NV_ADDRESS_TYPE AddressType, IN VOID *AddressInfo, IN UINTN AddressCount)
 
EFI_STATUS Ip6ParseAddressListFromString (IN CONST CHAR16 *String, OUT LIST_ENTRY *ListHead, OUT UINT32 *AddressCount)
 
EFI_STATUS Ip6ConvertInterfaceInfoToString (IN EFI_IP6_CONFIG_INTERFACE_INFO *IfInfo, IN EFI_HII_HANDLE HiiHandle, IN OUT IP6_CONFIG_IFR_NVDATA *IfrNvData)
 
EFI_STATUS Ip6BuildNvAddressInfo (IN IP6_CONFIG_INSTANCE *Instance, IN IP6_CONFIG_NV_ADDRESS_TYPE AddressType, OUT VOID **AddressInfo, OUT UINTN *AddressSize)
 
EFI_STATUS Ip6ConvertConfigNvDataToIfrNvData (IN OUT IP6_CONFIG_IFR_NVDATA *IfrNvData, IN IP6_CONFIG_INSTANCE *Instance)
 
EFI_STATUS Ip6ConvertIfrNvDataToConfigNvDataGeneral (IN IP6_CONFIG_IFR_NVDATA *IfrNvData, IN OUT IP6_CONFIG_INSTANCE *Instance)
 
EFI_STATUS Ip6ConvertIfrNvDataToConfigNvDataAdvanced (IN IP6_CONFIG_IFR_NVDATA *IfrNvData, IN OUT IP6_CONFIG_INSTANCE *Instance)
 
EFI_STATUS EFIAPI Ip6FormExtractConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
 
EFI_STATUS EFIAPI Ip6FormRouteConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
 
EFI_STATUS Ip6GetCurrentSetting (IN IP6_CONFIG_INSTANCE *Instance)
 
EFI_STATUS EFIAPI Ip6FormCallback (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
 
EFI_STATUS Ip6ConfigFormInit (IN OUT IP6_CONFIG_INSTANCE *Instance)
 
VOID Ip6ConfigFormUnload (IN OUT IP6_CONFIG_INSTANCE *Instance)
 

Variables

CHAR16 mIp6ConfigStorageName [] = L"IP6_CONFIG_IFR_NVDATA"
 

Detailed Description

Helper functions for configuring or obtaining the parameters relating to IP6.

Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.

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

Definition in file Ip6ConfigNv.c.

Function Documentation

◆ Ip6BuildNvAddressInfo()

EFI_STATUS Ip6BuildNvAddressInfo ( IN IP6_CONFIG_INSTANCE Instance,
IN IP6_CONFIG_NV_ADDRESS_TYPE  AddressType,
OUT VOID **  AddressInfo,
OUT UINTN AddressSize 
)

Build the address info list from list array of node in IP6_ADDRESS_INFO_ENTRY.

Parameters
[in]InstancePoints to IP6 config instance data.
[in]AddressTypeThe address type.
[out]AddressInfoThe pointer to the buffer to store the address list.
[out]AddressSizeThe address size of the address list.
Return values
EFI_SUCCESSThe operation finished successfully.
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_UNSUPPORTEDThe AddressType is not supported.

Definition at line 794 of file Ip6ConfigNv.c.

◆ Ip6ConfigFormInit()

EFI_STATUS Ip6ConfigFormInit ( IN OUT IP6_CONFIG_INSTANCE Instance)

Install HII Config Access protocol for network device and allocate resources.

Parameters
[in,out]InstanceThe IP6_CONFIG_INSTANCE to create a form.
Return values
EFI_SUCCESSThe HII Config Access protocol is installed.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
OthersOther errors as indicated.

Definition at line 1887 of file Ip6ConfigNv.c.

◆ Ip6ConfigFormUnload()

VOID Ip6ConfigFormUnload ( IN OUT IP6_CONFIG_INSTANCE Instance)

Uninstall the HII Config Access protocol for network devices and free up the resources.

Parameters
[in,out]InstanceThe IP6_CONFIG_INSTANCE to unload a form.

Definition at line 2036 of file Ip6ConfigNv.c.

◆ Ip6ConfigManualAddressNotify()

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

The notify function of create event when performing a manual configuration.

Parameters
[in]EventThe pointer of Event.
[in]ContextThe pointer of Context.

Definition at line 23 of file Ip6ConfigNv.c.

◆ Ip6ConfigNvGetData()

EFI_STATUS Ip6ConfigNvGetData ( IN EFI_IP6_CONFIG_PROTOCOL Ip6Config,
IN EFI_IP6_CONFIG_DATA_TYPE  DataType,
OUT UINTN DataSize,
OUT VOID **  Data 
)

Get the configuration data for the EFI IPv6 network stack running on the communication. It is a help function to the call EfiIp6ConfigGetData().

Parameters
[in]Ip6ConfigThe pointer to the EFI_IP6_CONFIG_PROTOCOL instance.
[in]DataTypeThe type of data to get.
[out]DataSizeThe size of buffer required in bytes.
[out]DataThe data buffer in which the configuration data is returned. The type of the data buffer associated with the DataType. It is the caller's responsibility to free the resource.
Return values
EFI_SUCCESSThe specified configuration data was obtained successfully.
EFI_INVALID_PARAMETEROne or more of the followings are TRUE:
  • Ip6Config is NULL or invalid.
  • DataSize is NULL.
  • Data is NULL.
EFI_OUT_OF_RESOURCESFail to perform the operation due to lack of resources.
EFI_NOT_READYThe specified configuration data is not ready due to an asynchronous configuration process already in progress.
EFI_NOT_FOUNDThe specified configuration data was not found.

Definition at line 54 of file Ip6ConfigNv.c.

◆ Ip6ConvertAddressListToString()

EFI_STATUS Ip6ConvertAddressListToString ( IN OUT CHAR16 *  String,
IN EFI_HII_HANDLE  HiiHandle,
IN IP6_CONFIG_NV_ADDRESS_TYPE  AddressType,
IN VOID *  AddressInfo,
IN UINTN  AddressCount 
)

This function converts the different format of address list to string format and then generates the corresponding text opcode to illustrate the address info in IP6 configuration page. Currently, the following formats are supported: EFI_IP6_ADDRESS_INFO AddressType: Ip6ConfigNvHostAddress; EFI_IPv6_ADDRESS AddressType: Ip6ConfigNvGatewayAddress and Ip6ConfigNvDnsAddress; EFI_IP6_ROUTE_TABLE AddressType: Ip6ConfigNvRouteTable.

Parameters
[in,out]StringThe pointer to the buffer to store the converted string.
[in]HiiHandleA handle that was previously registered in the HII Database.
[in]AddressTypeThe address type.
[in]AddressInfoPointer to the address list.
[in]AddressCountThe address count of the address list.
Return values
EFI_SUCCESSThe operation finished successfully.
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_UNSUPPORTEDThe AddressType is not supported.

Definition at line 432 of file Ip6ConfigNv.c.

◆ Ip6ConvertConfigNvDataToIfrNvData()

EFI_STATUS Ip6ConvertConfigNvDataToIfrNvData ( IN OUT IP6_CONFIG_IFR_NVDATA IfrNvData,
IN IP6_CONFIG_INSTANCE Instance 
)

Convert the IP6 configuration data into the IFR data.

Parameters
[in,out]IfrNvDataThe IFR NV data.
[in]InstanceThe IP6 config instance data.
Return values
EFI_SUCCESSThe operation finished successfully.
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_UNSUPPORTEDThe policy is not supported in the current implementation.
OthersOther errors as indicated.

Definition at line 871 of file Ip6ConfigNv.c.

◆ Ip6ConvertIfrNvDataToConfigNvDataAdvanced()

EFI_STATUS Ip6ConvertIfrNvDataToConfigNvDataAdvanced ( IN IP6_CONFIG_IFR_NVDATA IfrNvData,
IN OUT IP6_CONFIG_INSTANCE Instance 
)

Convert IFR data into IP6 configuration data. The policy, configured manual address, gateway address, and DNS server address will be saved.

Parameters
[in]IfrNvDataThe IFR NV data.
[in,out]InstanceThe IP6 config instance data.
Return values
EFI_SUCCESSThe operation finished successfully.
EFI_INVALID_PARAMETERAny input parameter is invalid.
OthersOther errors as indicated.

Definition at line 1085 of file Ip6ConfigNv.c.

◆ Ip6ConvertIfrNvDataToConfigNvDataGeneral()

EFI_STATUS Ip6ConvertIfrNvDataToConfigNvDataGeneral ( IN IP6_CONFIG_IFR_NVDATA IfrNvData,
IN OUT IP6_CONFIG_INSTANCE Instance 
)

Convert IFR data into IP6 configuration data. The policy, alternative interface ID, and DAD transmit counts, and will be saved.

Parameters
[in]IfrNvDataThe IFR NV data.
[in,out]InstanceThe IP6 config instance data.
Return values
EFI_SUCCESSThe operation finished successfully.
EFI_INVALID_PARAMETERAny input parameter is invalid.
OthersOther errors as indicated.

Definition at line 1002 of file Ip6ConfigNv.c.

◆ Ip6ConvertInterfaceIdToString()

EFI_STATUS Ip6ConvertInterfaceIdToString ( OUT CHAR16 *  String,
IN EFI_IP6_CONFIG_INTERFACE_ID IfId 
)

Convert EFI_IP6_CONFIG_INTERFACE_ID to string format.

Parameters
[out]StringThe buffer to store the converted string.
[in]IfIdThe pointer of EFI_IP6_CONFIG_INTERFACE_ID.
Return values
EFI_SUCCESSThe string converted successfully.
EFI_INVALID_PARAMETERAny input parameter is invalid.

Definition at line 221 of file Ip6ConfigNv.c.

◆ Ip6ConvertInterfaceInfoToString()

EFI_STATUS Ip6ConvertInterfaceInfoToString ( IN EFI_IP6_CONFIG_INTERFACE_INFO IfInfo,
IN EFI_HII_HANDLE  HiiHandle,
IN OUT IP6_CONFIG_IFR_NVDATA IfrNvData 
)

This function converts the interface info to string and draws it to the IP6 UI. The interface information includes interface name, interface type, hardware address and route table information.

Parameters
[in]IfInfoThe pointer of EFI_IP6_CONFIG_INTERFACE_INFO.
[in]HiiHandleThe handle that was previously registered in the HII Database.
[in,out]IfrNvDataPoints to IP6_CONFIG_IFR_NVDATA.
Return values
EFI_SUCCESSThe operation finished successfully.
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_OUT_OF_RESOURCESThe operation failed due to lack of resources.

Definition at line 682 of file Ip6ConfigNv.c.

◆ Ip6CreateOpCode()

EFI_STATUS Ip6CreateOpCode ( IN UINT16  StartLabelNumber,
OUT VOID **  StartOpCodeHandle,
OUT EFI_IFR_GUID_LABEL **  StartLabel,
OUT VOID **  EndOpCodeHandle,
OUT EFI_IFR_GUID_LABEL **  EndLabel 
)

Create Hii Extend Label OpCode as the start opcode and end opcode. It is a help function.

Parameters
[in]StartLabelNumberThe number of start label.
[out]StartOpCodeHandlePoints to the start opcode handle.
[out]StartLabelPoints to the created start opcode.
[out]EndOpCodeHandlePoints to the end opcode handle.
[out]EndLabelPoints to the created end opcode.
Return values
EFI_OUT_OF_RESOURCESDoes not have sufficient resources to finish this operation.
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_SUCCESSThe operation completed successfully.

Definition at line 326 of file Ip6ConfigNv.c.

◆ Ip6FormCallback()

EFI_STATUS EFIAPI Ip6FormCallback ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN EFI_BROWSER_ACTION  Action,
IN EFI_QUESTION_ID  QuestionId,
IN UINT8  Type,
IN EFI_IFR_TYPE_VALUE Value,
OUT EFI_BROWSER_ACTION_REQUEST *  ActionRequest 
)

This function is called to provide results data to the driver. This data consists of a unique key that is used to identify which data is either being passed back or being asked for.

Parameters
[in]ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
[in]ActionSpecifies the type of action taken by the browser.
[in]QuestionIdA unique value which is sent to the original exporting driver so that it can identify the type of data to expect. The format of the data tends to vary based on the opcode that generated the callback.
[in]TypeThe type of value for the question.
[in]ValueA pointer to the data being sent to the original exporting driver.
[out]ActionRequestOn return, points to the action requested by the callback function.
Return values
EFI_SUCCESSThe callback successfully handled the action.
EFI_OUT_OF_RESOURCESNot enough storage is available to hold the variable and its data.
EFI_DEVICE_ERRORThe variable could not be saved.
EFI_UNSUPPORTEDThe specified Action is not supported by the callback. Currently not implemented.
EFI_INVALID_PARAMETERPassed in the wrong parameter.
OthersOther errors as indicated.

Definition at line 1701 of file Ip6ConfigNv.c.

◆ Ip6FormExtractConfig()

EFI_STATUS EFIAPI Ip6FormExtractConfig ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN CONST EFI_STRING  Request,
OUT EFI_STRING *  Progress,
OUT EFI_STRING *  Results 
)

This function allows the caller to request the current configuration for one or more named elements. The resulting string is in <ConfigAltResp> format. Any and all alternative configuration strings shall also be appended to the end of the current configuration string. If they are, they must appear after the current configuration. They must contain the same routing (GUID, NAME, PATH) as the current configuration string. They must have an additional description indicating the type of alternative configuration the string represents, "ALTCFG=<StringToken>". That <StringToken> (when converted from Hex UNICODE to binary) is a reference to a string in the associated string pack.

Parameters
[in]ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
[in]RequestA null-terminated Unicode string in <ConfigRequest> format. Note that this includes the routing information as well as the configurable name / value pairs. It is invalid for this string to be in <MultiConfigRequest> format.
[out]ProgressOn return, points to a character in the Request string. Points to the string's null terminator if request was successful. Points to the most recent "&" before the first failing name / value pair (or the beginning of the string if the failure is in the first name / value pair) if the request was not successful.
[out]ResultsA null-terminated Unicode string in <ConfigAltResp> format which has all values filled in for the names in the Request string. String to be allocated by the called function.
Return values
EFI_SUCCESSThe Results string is filled with the values corresponding to all requested names.
EFI_OUT_OF_RESOURCESNot enough memory to store the parts of the results that must be stored awaiting possible future protocols.
EFI_INVALID_PARAMETERFor example, passing in a NULL for the Request parameter would result in this type of error. In this case, the Progress parameter would be set to NULL.
EFI_NOT_FOUNDRouting data doesn't match any known driver. Progress set to the first character in the routing header. Note: There is no requirement that the driver validate the routing data. It must skip the <ConfigHdr> in order to process the names.
EFI_INVALID_PARAMETERIllegal syntax. Progress set to most recent & before the error or the beginning of the string.
EFI_INVALID_PARAMETERUnknown name. Progress points to the & before the name in question. Currently not implemented.

Definition at line 1351 of file Ip6ConfigNv.c.

◆ Ip6FormRouteConfig()

EFI_STATUS EFIAPI Ip6FormRouteConfig ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN CONST EFI_STRING  Configuration,
OUT EFI_STRING *  Progress 
)

This function applies changes in a driver's configuration. Input is a Configuration, which has the routing data for this driver followed by name / value configuration pairs. The driver must apply those pairs to its configurable storage. If the driver's configuration is stored in a linear block of data and the driver's name / value pairs are in <BlockConfig> format, it may use the ConfigToBlock helper function (above) to simplify the job. Currently not implemented.

Parameters
[in]ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
[in]ConfigurationA null-terminated Unicode string in <ConfigString> format.
[out]ProgressA pointer to a string filled in with the offset of the most recent '&' before the first failing name / value pair (or the beginning of the string if the failure is in the first name / value pair) or the terminating NULL if all was successful.
Return values
EFI_SUCCESSThe results have been distributed or are awaiting distribution.
EFI_OUT_OF_MEMORYNot enough memory to store the parts of the results that must be stored awaiting possible future protocols.
EFI_INVALID_PARAMETERSPassing in a NULL for the Results parameter would result in this type of error.
EFI_NOT_FOUNDTarget for the specified routing data was not found.

Definition at line 1493 of file Ip6ConfigNv.c.

◆ Ip6FreeAddressInfoList()

VOID Ip6FreeAddressInfoList ( IN LIST_ENTRY ListHead)

Free all nodes in IP6_ADDRESS_INFO_ENTRY in the list array specified with ListHead.

Parameters
[in]ListHeadThe head of the list array in IP6_ADDRESS_INFO_ENTRY.

Definition at line 110 of file Ip6ConfigNv.c.

◆ Ip6GetCurrentSetting()

EFI_STATUS Ip6GetCurrentSetting ( IN IP6_CONFIG_INSTANCE Instance)

Display host addresses, route table, DNS addresses and gateway addresses in "IPv6 Current Setting" page.

Parameters
[in]InstanceThe IP6 config instance data.
Return values
EFI_SUCCESSThe operation finished successfully.
OthersOther errors as indicated.

Definition at line 1528 of file Ip6ConfigNv.c.

◆ Ip6ParseAddressListFromString()

EFI_STATUS Ip6ParseAddressListFromString ( IN CONST CHAR16 *  String,
OUT LIST_ENTRY ListHead,
OUT UINT32 *  AddressCount 
)

Parse address list in string format and convert it to a list array of node in IP6_ADDRESS_INFO_ENTRY.

Parameters
[in]StringThe buffer to string to be parsed.
[out]ListHeadThe list head of array.
[out]AddressCountThe number of list nodes in the array.
Return values
EFI_SUCCESSThe operation finished successfully.
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_OUT_OF_RESOURCESFailed to perform the operation due to lack of resource.

Definition at line 579 of file Ip6ConfigNv.c.

◆ Ip6ParseInterfaceIdFromString()

EFI_STATUS Ip6ParseInterfaceIdFromString ( IN CONST CHAR16 *  String,
OUT EFI_IP6_CONFIG_INTERFACE_ID IfId 
)

Parse InterfaceId in string format and convert it to EFI_IP6_CONFIG_INTERFACE_ID.

Parameters
[in]StringThe buffer of the string to be parsed.
[out]IfIdThe pointer of EFI_IP6_CONFIG_INTERFACE_ID.
Return values
EFI_SUCCESSThe operation finished successfully.
EFI_INVALID_PARAMETERAny input parameter is invalid.

Definition at line 259 of file Ip6ConfigNv.c.

◆ Ip6ToStr()

VOID Ip6ToStr ( IN EFI_IPv6_ADDRESS Ip6,
OUT CHAR16 *  Str 
)

Convert the IPv6 address into a formatted string.

Parameters
[in]Ip6The IPv6 address.
[out]StrThe formatted IP string.

Definition at line 133 of file Ip6ConfigNv.c.

Variable Documentation

◆ mIp6ConfigStorageName

CHAR16 mIp6ConfigStorageName[] = L"IP6_CONFIG_IFR_NVDATA"

Definition at line 12 of file Ip6ConfigNv.c.