TianoCore EDK2 master
|
#include "Ip4Impl.h"
Go to the source code of this file.
Variables | |
CHAR16 | mIp4Config2StorageName [] = L"IP4_CONFIG2_IFR_NVDATA" |
Helper functions for configuring or getting the parameters relating to Ip4.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Ip4Config2Nv.c.
UINT8 GetSubnetMaskPrefixLength | ( | IN EFI_IPv4_ADDRESS * | SubnetMask | ) |
Calculate the prefix length of the IPv4 subnet mask.
[in] | SubnetMask | The IPv4 subnet mask. |
0 | Other errors as indicated. |
Definition at line 23 of file Ip4Config2Nv.c.
EFI_STATUS Ip4Config2ConvertConfigNvDataToIfrNvData | ( | IN IP4_CONFIG2_INSTANCE * | Instance, |
IN OUT IP4_CONFIG2_IFR_NVDATA * | IfrNvData | ||
) |
Convert the network configuration data into the IFR data.
[in] | Instance | The IP4 config2 instance. |
[in,out] | IfrNvData | The IFR nv data. |
EFI_SUCCESS | The configure parameter to IFR data was set successfully. |
EFI_INVALID_PARAMETER | Source instance or target IFR data is not available. |
Others | Other errors as indicated. |
Definition at line 383 of file Ip4Config2Nv.c.
EFI_STATUS Ip4Config2ConvertIfrNvDataToConfigNvData | ( | IN IP4_CONFIG2_IFR_NVDATA * | IfrFormNvData, |
IN OUT IP4_CONFIG2_INSTANCE * | Instance | ||
) |
Convert the IFR data into the network configuration data and set the IP configure parameters for the NIC.
[in] | IfrFormNvData | The IFR NV data. |
[in,out] | Instance | The IP4 config2 instance. |
EFI_SUCCESS | The configure parameter for this NIC was set successfully. |
EFI_INVALID_PARAMETER | The address information for setting is invalid. |
Others | Other errors as indicated. |
Definition at line 551 of file Ip4Config2Nv.c.
EFI_STATUS Ip4Config2FormInit | ( | IN OUT IP4_CONFIG2_INSTANCE * | Instance | ) |
Install HII Config Access protocol for network device and allocate resource.
[in,out] | Instance | The IP4 config2 Instance. |
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 1266 of file Ip4Config2Nv.c.
VOID Ip4Config2FormUnload | ( | IN OUT IP4_CONFIG2_INSTANCE * | Instance | ) |
Uninstall the HII Config Access protocol for network devices and free up the resources.
[in,out] | Instance | The IP4 config2 instance to unload a form. |
Definition at line 1413 of file Ip4Config2Nv.c.
EFI_STATUS Ip4Config2IpListToStr | ( | IN EFI_IPv4_ADDRESS * | Ip, |
IN UINTN | IpCount, | ||
OUT CHAR16 * | Str | ||
) |
Convert the IPv4 address list into string consists of several decimal dotted IPv4 addresses separated by space.
[in] | Ip | The IPv4 address list. |
[in] | IpCount | The size of IPv4 address list. |
[out] | Str | The string contains several decimal dotted IPv4 addresses separated by space. |
EFI_SUCCESS | Operation is success. |
EFI_OUT_OF_RESOURCES | Error occurs in allocating memory. |
Definition at line 294 of file Ip4Config2Nv.c.
VOID Ip4Config2IpToStr | ( | IN EFI_IPv4_ADDRESS * | Ip, |
OUT CHAR16 * | Str | ||
) |
Convert the IPv4 address into a dotted string.
[in] | Ip | The IPv4 address. |
[out] | Str | The dotted IP string. |
Definition at line 264 of file Ip4Config2Nv.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 362 of file Ip4Config2Nv.c.
EFI_STATUS Ip4Config2StrToIp | ( | IN CHAR16 * | Str, |
OUT EFI_IPv4_ADDRESS * | Ip | ||
) |
Convert the decimal dotted IPv4 address into the binary IPv4 address.
[in] | Str | The UNICODE string. |
[out] | Ip | The storage to return the IPv4 address. |
EFI_SUCCESS | The binary IP address is returned in Ip. |
EFI_INVALID_PARAMETER | The IP string is malformatted. |
Definition at line 65 of file Ip4Config2Nv.c.
EFI_STATUS Ip4Config2StrToIpList | ( | IN CHAR16 * | Str, |
OUT EFI_IPv4_ADDRESS ** | PtrIpList, | ||
OUT UINTN * | IpCount | ||
) |
Convert the decimal dotted IPv4 addresses separated by space into the binary IPv4 address list.
[in] | Str | The UNICODE string contains IPv4 addresses. |
[out] | PtrIpList | The storage to return the IPv4 address list. |
[out] | IpCount | The size of the IPv4 address list. |
EFI_SUCCESS | The binary IP address list is returned in PtrIpList. |
EFI_OUT_OF_RESOURCES | Error occurs in allocating memory. |
EFI_INVALID_PARAMETER | The IP string is malformatted. |
Definition at line 130 of file Ip4Config2Nv.c.
EFI_STATUS EFIAPI Ip4FormCallback | ( | 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 enerated 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_PARAMETERS | Passing in wrong parameter. |
Others | Other errors as indicated. |
Definition at line 1138 of file Ip4Config2Nv.c.
EFI_STATUS EFIAPI Ip4FormExtractConfig | ( | 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_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 895 of file Ip4Config2Nv.c.
EFI_STATUS EFIAPI Ip4FormRouteConfig | ( | 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 1041 of file Ip4Config2Nv.c.
CHAR16 mIp4Config2StorageName[] = L"IP4_CONFIG2_IFR_NVDATA" |
Definition at line 11 of file Ip4Config2Nv.c.