TianoCore EDK2 master
|
#include "Ip6Impl.h"
Go to the source code of this file.
Variables | |
CHAR16 | mIp6ConfigStorageName [] = L"IP6_CONFIG_IFR_NVDATA" |
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.
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.
[in] | Instance | Points to IP6 config instance data. |
[in] | AddressType | The address type. |
[out] | AddressInfo | The pointer to the buffer to store the address list. |
[out] | AddressSize | The address size of the address list. |
EFI_SUCCESS | The operation finished successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_UNSUPPORTED | The AddressType is not supported. |
Definition at line 794 of file Ip6ConfigNv.c.
EFI_STATUS Ip6ConfigFormInit | ( | IN OUT IP6_CONFIG_INSTANCE * | Instance | ) |
Install HII Config Access protocol for network device and allocate resources.
[in,out] | Instance | The IP6_CONFIG_INSTANCE to create a form. |
EFI_SUCCESS | The HII Config Access protocol is installed. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
Others | Other errors as indicated. |
Definition at line 1887 of file Ip6ConfigNv.c.
VOID Ip6ConfigFormUnload | ( | IN OUT IP6_CONFIG_INSTANCE * | Instance | ) |
Uninstall the HII Config Access protocol for network devices and free up the resources.
[in,out] | Instance | The IP6_CONFIG_INSTANCE to unload a form. |
Definition at line 2036 of file Ip6ConfigNv.c.
The notify function of create event when performing a manual configuration.
[in] | Event | The pointer of Event. |
[in] | Context | The pointer of Context. |
Definition at line 23 of file Ip6ConfigNv.c.
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().
[in] | Ip6Config | The pointer to the EFI_IP6_CONFIG_PROTOCOL instance. |
[in] | DataType | The type of data to get. |
[out] | DataSize | The size of buffer required in bytes. |
[out] | Data | The 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. |
EFI_SUCCESS | The specified configuration data was obtained successfully. |
EFI_INVALID_PARAMETER | One or more of the followings are TRUE:
|
EFI_OUT_OF_RESOURCES | Fail to perform the operation due to lack of resources. |
EFI_NOT_READY | The specified configuration data is not ready due to an asynchronous configuration process already in progress. |
EFI_NOT_FOUND | The specified configuration data was not found. |
Definition at line 54 of file Ip6ConfigNv.c.
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.
[in,out] | String | The pointer to the buffer to store the converted string. |
[in] | HiiHandle | A handle that was previously registered in the HII Database. |
[in] | AddressType | The address type. |
[in] | AddressInfo | Pointer to the address list. |
[in] | AddressCount | The address count of the address list. |
EFI_SUCCESS | The operation finished successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_UNSUPPORTED | The AddressType is not supported. |
Definition at line 432 of file Ip6ConfigNv.c.
EFI_STATUS Ip6ConvertConfigNvDataToIfrNvData | ( | IN OUT IP6_CONFIG_IFR_NVDATA * | IfrNvData, |
IN IP6_CONFIG_INSTANCE * | Instance | ||
) |
Convert the IP6 configuration data into the IFR data.
[in,out] | IfrNvData | The IFR NV data. |
[in] | Instance | The IP6 config instance data. |
EFI_SUCCESS | The operation finished successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_UNSUPPORTED | The policy is not supported in the current implementation. |
Others | Other errors as indicated. |
Definition at line 871 of file Ip6ConfigNv.c.
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.
[in] | IfrNvData | The IFR NV data. |
[in,out] | Instance | The IP6 config instance data. |
EFI_SUCCESS | The operation finished successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
Others | Other errors as indicated. |
Definition at line 1085 of file Ip6ConfigNv.c.
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.
[in] | IfrNvData | The IFR NV data. |
[in,out] | Instance | The IP6 config instance data. |
EFI_SUCCESS | The operation finished successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
Others | Other errors as indicated. |
Definition at line 1002 of file Ip6ConfigNv.c.
EFI_STATUS Ip6ConvertInterfaceIdToString | ( | OUT CHAR16 * | String, |
IN EFI_IP6_CONFIG_INTERFACE_ID * | IfId | ||
) |
Convert EFI_IP6_CONFIG_INTERFACE_ID to string format.
[out] | String | The buffer to store the converted string. |
[in] | IfId | The pointer of EFI_IP6_CONFIG_INTERFACE_ID. |
EFI_SUCCESS | The string converted successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
Definition at line 221 of file Ip6ConfigNv.c.
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.
[in] | IfInfo | The pointer of EFI_IP6_CONFIG_INTERFACE_INFO. |
[in] | HiiHandle | The handle that was previously registered in the HII Database. |
[in,out] | IfrNvData | Points to IP6_CONFIG_IFR_NVDATA. |
EFI_SUCCESS | The operation finished successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_OUT_OF_RESOURCES | The operation failed due to lack of resources. |
Definition at line 682 of file Ip6ConfigNv.c.
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.
[in] | StartLabelNumber | The number of start label. |
[out] | StartOpCodeHandle | Points to the start opcode handle. |
[out] | StartLabel | Points to the created start opcode. |
[out] | EndOpCodeHandle | Points to the end opcode handle. |
[out] | EndLabel | Points to the created end opcode. |
EFI_OUT_OF_RESOURCES | Does not have sufficient resources to finish this operation. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_SUCCESS | The operation completed successfully. |
Definition at line 326 of file Ip6ConfigNv.c.
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.
[in] | This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
[in] | Action | Specifies the type of action taken by the browser. |
[in] | QuestionId | A 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] | Type | The type of value for the question. |
[in] | Value | A pointer to the data being sent to the original exporting driver. |
[out] | ActionRequest | On return, points to the action requested by the callback function. |
EFI_SUCCESS | The callback successfully handled the action. |
EFI_OUT_OF_RESOURCES | Not enough storage is available to hold the variable and its data. |
EFI_DEVICE_ERROR | The variable could not be saved. |
EFI_UNSUPPORTED | The specified Action is not supported by the callback. Currently not implemented. |
EFI_INVALID_PARAMETER | Passed in the wrong parameter. |
Others | Other errors as indicated. |
Definition at line 1701 of file Ip6ConfigNv.c.
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.
[in] | This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
[in] | Request | A 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] | Progress | On 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] | Results | A 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. |
EFI_SUCCESS | The Results string is filled with the values corresponding to all requested names. |
EFI_OUT_OF_RESOURCES | Not enough memory to store the parts of the results that must be stored awaiting possible future protocols. |
EFI_INVALID_PARAMETER | For 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_FOUND | Routing 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_PARAMETER | Illegal syntax. Progress set to most recent & before the error or the beginning of the string. |
EFI_INVALID_PARAMETER | Unknown name. Progress points to the & before the name in question. Currently not implemented. |
Definition at line 1351 of file Ip6ConfigNv.c.
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.
[in] | This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
[in] | Configuration | A null-terminated Unicode string in <ConfigString> format. |
[out] | Progress | A 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. |
EFI_SUCCESS | The results have been distributed or are awaiting distribution. |
EFI_OUT_OF_MEMORY | Not enough memory to store the parts of the results that must be stored awaiting possible future protocols. |
EFI_INVALID_PARAMETERS | Passing in a NULL for the Results parameter would result in this type of error. |
EFI_NOT_FOUND | Target for the specified routing data was not found. |
Definition at line 1493 of file Ip6ConfigNv.c.
VOID Ip6FreeAddressInfoList | ( | IN LIST_ENTRY * | ListHead | ) |
Free all nodes in IP6_ADDRESS_INFO_ENTRY in the list array specified with ListHead.
[in] | ListHead | The head of the list array in IP6_ADDRESS_INFO_ENTRY. |
Definition at line 110 of file Ip6ConfigNv.c.
EFI_STATUS Ip6GetCurrentSetting | ( | IN IP6_CONFIG_INSTANCE * | Instance | ) |
Display host addresses, route table, DNS addresses and gateway addresses in "IPv6 Current Setting" page.
[in] | Instance | The IP6 config instance data. |
EFI_SUCCESS | The operation finished successfully. |
Others | Other errors as indicated. |
Definition at line 1528 of file Ip6ConfigNv.c.
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.
[in] | String | The buffer to string to be parsed. |
[out] | ListHead | The list head of array. |
[out] | AddressCount | The number of list nodes in the array. |
EFI_SUCCESS | The operation finished successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_OUT_OF_RESOURCES | Failed to perform the operation due to lack of resource. |
Definition at line 579 of file Ip6ConfigNv.c.
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.
[in] | String | The buffer of the string to be parsed. |
[out] | IfId | The pointer of EFI_IP6_CONFIG_INTERFACE_ID. |
EFI_SUCCESS | The operation finished successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
Definition at line 259 of file Ip6ConfigNv.c.
VOID Ip6ToStr | ( | IN EFI_IPv6_ADDRESS * | Ip6, |
OUT CHAR16 * | Str | ||
) |
Convert the IPv6 address into a formatted string.
[in] | Ip6 | The IPv6 address. |
[out] | Str | The formatted IP string. |
Definition at line 133 of file Ip6ConfigNv.c.
CHAR16 mIp6ConfigStorageName[] = L"IP6_CONFIG_IFR_NVDATA" |
Definition at line 12 of file Ip6ConfigNv.c.