TianoCore EDK2 master
|
#include "Ip6Impl.h"
Go to the source code of this file.
Variables | |
LIST_ENTRY | mIp6ConfigInstanceList = { &mIp6ConfigInstanceList, &mIp6ConfigInstanceList } |
The implementation of EFI IPv6 Configuration Protocol.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Ip6ConfigImpl.c.
EFI_STATUS EFIAPI EfiIp6ConfigGetData | ( | IN EFI_IP6_CONFIG_PROTOCOL * | This, |
IN EFI_IP6_CONFIG_DATA_TYPE | DataType, | ||
IN OUT UINTN * | DataSize, | ||
IN VOID *Data | OPTIONAL | ||
) |
Get the configuration data for the EFI IPv6 network stack running on the communication device that this EFI IPv6 Configuration Protocol instance manages.
This function returns the configuration data of type DataType for the EFI IPv6 network stack running on the communication device that this EFI IPv6 Configuration Protocol instance manages.
The caller is responsible for allocating the buffer used to return the specified configuration data. The required size will be returned to the caller if the size of the buffer is too small.
EFI_NOT_READY is returned if the specified configuration data is not ready due to an asynchronous configuration process already in progress. The caller can call RegisterDataNotify() to register an event on the specified configuration data. Once the asynchronous configuration process is finished, the event will be signaled, and a subsequent GetData() call will return the specified configuration data.
[in] | This | Pointer to the EFI_IP6_CONFIG_PROTOCOL instance. |
[in] | DataType | The type of data to get. |
[in,out] | DataSize | On input, in bytes, the size of Data. On output, in bytes, the size of buffer required to store the specified configuration data. |
[in] | Data | The data buffer in which the configuration data is returned. The type of the data buffer is associated with the DataType. This is an optional parameter that may be NULL. |
EFI_SUCCESS | The specified configuration data was obtained successfully. |
EFI_INVALID_PARAMETER | One or more of the followings are TRUE:
|
EFI_BUFFER_TOO_SMALL | The size of Data is too small for the specified configuration data, and the required size is returned in DataSize. |
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 is not found. |
Definition at line 2091 of file Ip6ConfigImpl.c.
EFI_STATUS EFIAPI EfiIp6ConfigRegisterDataNotify | ( | IN EFI_IP6_CONFIG_PROTOCOL * | This, |
IN EFI_IP6_CONFIG_DATA_TYPE | DataType, | ||
IN EFI_EVENT | Event | ||
) |
Register an event that is signaled whenever a configuration process on the specified configuration data is done.
This function registers an event that is to be signaled whenever a configuration process on the specified configuration data is performed. An event can be registered for a different DataType simultaneously. The caller is responsible for determining which type of configuration data causes the signaling of the event in such an event.
[in] | This | Pointer to the EFI_IP6_CONFIG_PROTOCOL instance. |
[in] | DataType | The type of data to unregister the event for. |
[in] | Event | The event to register. |
EFI_SUCCESS | The notification event for the specified configuration data is registered. |
EFI_INVALID_PARAMETER | This is NULL or Event is NULL. |
EFI_UNSUPPORTED | The configuration data type specified by DataType is not supported. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_ACCESS_DENIED | The Event is already registered for the DataType. |
Definition at line 2161 of file Ip6ConfigImpl.c.
EFI_STATUS EFIAPI EfiIp6ConfigSetData | ( | IN EFI_IP6_CONFIG_PROTOCOL * | This, |
IN EFI_IP6_CONFIG_DATA_TYPE | DataType, | ||
IN UINTN | DataSize, | ||
IN VOID * | Data | ||
) |
Set the configuration for the EFI IPv6 network stack running on the communication device this EFI IPv6 Configuration Protocol instance manages.
This function is used to set the configuration data of type DataType for the EFI IPv6 network stack that is running on the communication device that this EFI IPv6 Configuration Protocol instance manages.
DataSize is used to calculate the count of structure instances in the Data for a DataType in which multiple structure instances are allowed.
This function is always non-blocking. When setting some type of configuration data, an asynchronous process is invoked to check the correctness of the data, such as performing Duplicate Address Detection on the manually set local IPv6 addresses. EFI_NOT_READY is returned immediately to indicate that such an asynchronous process is invoked, and the process is not finished yet. The caller wanting to get the result of the asynchronous process is required to call RegisterDataNotify() to register an event on the specified configuration data. Once the event is signaled, the caller can call GetData() to obtain the configuration data and know the result. For other types of configuration data that do not require an asynchronous configuration process, the result of the operation is immediately returned.
[in] | This | The pointer to the EFI_IP6_CONFIG_PROTOCOL instance. |
[in] | DataType | The type of data to set. |
[in] | DataSize | Size of the buffer pointed to by Data in bytes. |
[in] | Data | The data buffer to set. The type of the data buffer is associated with the DataType. |
EFI_SUCCESS | The specified configuration data for the EFI IPv6 network stack was set successfully. |
EFI_INVALID_PARAMETER | One or more of the following are TRUE:
|
EFI_WRITE_PROTECTED | The specified configuration data is read-only or the specified configuration data cannot be set under the current policy. |
EFI_ACCESS_DENIED | Another set operation on the specified configuration data is already in process. |
EFI_NOT_READY | An asynchronous process was invoked to set the specified configuration data, and the process is not finished yet. |
EFI_BAD_BUFFER_SIZE | The DataSize does not match the size of the type indicated by DataType. |
EFI_UNSUPPORTED | This DataType is not supported. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_DEVICE_ERROR | An unexpected system error or network error occurred. |
Definition at line 1985 of file Ip6ConfigImpl.c.
EFI_STATUS EFIAPI EfiIp6ConfigUnregisterDataNotify | ( | IN EFI_IP6_CONFIG_PROTOCOL * | This, |
IN EFI_IP6_CONFIG_DATA_TYPE | DataType, | ||
IN EFI_EVENT | Event | ||
) |
Remove a previously registered event for the specified configuration data.
This | The pointer to the EFI_IP6_CONFIG_PROTOCOL instance. |
DataType | The type of data to remove from the previously registered event. |
Event | The event to be unregistered. |
EFI_SUCCESS | The event registered for the specified configuration data was removed. |
EFI_INVALID_PARAMETER | This is NULL or Event is NULL. |
EFI_NOT_FOUND | The Event has not been registered for the specified DataType. |
Definition at line 2222 of file Ip6ConfigImpl.c.
VOID Ip6ConfigCleanInstance | ( | IN OUT IP6_CONFIG_INSTANCE * | Instance | ) |
Release an IP6_CONFIG_INSTANCE.
[in,out] | Instance | The buffer of IP6_CONFIG_INSTANCE to be freed. |
Definition at line 2420 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigDestroyDhcp6 | ( | IN OUT IP6_CONFIG_INSTANCE * | Instance | ) |
Destroy the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources.
[in,out] | Instance | The buffer of IP6_CONFIG_INSTANCE to be freed. |
EFI_SUCCESS | The child was successfully destroyed. |
Others | Failed to destroy the child. |
Definition at line 2479 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigGetIfInfo | ( | IN IP6_CONFIG_INSTANCE * | Instance, |
IN OUT UINTN * | DataSize, | ||
IN VOID *Data | OPTIONAL | ||
) |
The work function for EfiIp6ConfigGetData() to get the interface information of the communication device this IP6Config instance manages.
[in] | Instance | Pointer to the IP6 config instance data. |
[in,out] | DataSize | On input, in bytes, the size of Data. On output, in bytes, the size of buffer required to store the specified configuration data. |
[in] | Data | The data buffer in which the configuration data is returned. Ignored if DataSize is ZERO. |
EFI_BUFFER_TOO_SMALL | The size of Data is too small for the specified configuration data, and the required size is returned in DataSize. |
EFI_SUCCESS | The specified configuration data was obtained. |
Definition at line 559 of file Ip6ConfigImpl.c.
VOID Ip6ConfigInitIfInfo | ( | IN IP6_SERVICE * | IpSb, |
OUT EFI_IP6_CONFIG_INTERFACE_INFO * | IfInfo | ||
) |
Generate the operational state of the interface this IP6 config instance manages and output in EFI_IP6_CONFIG_INTERFACE_INFO.
[in] | IpSb | The pointer to the IP6 service binding instance. |
[out] | IfInfo | The pointer to the IP6 configuration interface information structure. |
Definition at line 1570 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigInitInstance | ( | OUT IP6_CONFIG_INSTANCE * | Instance | ) |
Initialize an IP6_CONFIG_INSTANCE.
[out] | Instance | The buffer of IP6_CONFIG_INSTANCE to be initialized. |
EFI_OUT_OF_RESOURCES | Failed to allocate resources to complete the operation. |
EFI_SUCCESS | The IP6_CONFIG_INSTANCE initialized successfully. |
Definition at line 2268 of file Ip6ConfigImpl.c.
The event handle routine when DHCPv6 process is finished or is updated.
[in] | Event | Not used. |
[in] | Context | The pointer to the IP6 configuration instance data. |
Definition at line 1779 of file Ip6ConfigImpl.c.
EFI_STATUS EFIAPI Ip6ConfigOnDhcp6Reply | ( | IN EFI_DHCP6_PROTOCOL * | This, |
IN VOID * | Context, | ||
IN EFI_DHCP6_PACKET * | Packet | ||
) |
The event process routine when the DHCPv6 server is answered with a reply packet for an information request.
[in] | This | Points to the EFI_DHCP6_PROTOCOL. |
[in] | Context | The pointer to the IP6 configuration instance data. |
[in] | Packet | The DHCPv6 reply packet. |
EFI_SUCCESS | The DNS server address was retrieved from the reply packet. |
EFI_NOT_READY | The reply packet does not contain the DNS server option, or the DNS server address is not valid. |
Definition at line 1898 of file Ip6ConfigImpl.c.
The event process routine when the DHCPv6 service binding protocol is installed in the system.
[in] | Event | Not used. |
[in] | Context | Pointer to the IP6 config instance data. |
The event process routine when the DHCPv6 service binding protocol is installed in the system.
[in] | Event | Not used. |
[in] | Context | The pointer to the IP6 config instance data. |
Definition at line 1917 of file Ip6ConfigImpl.c.
VOID Ip6ConfigOnPolicyChanged | ( | IN IP6_SERVICE * | IpSb, |
IN EFI_IP6_CONFIG_POLICY | NewPolicy | ||
) |
Update the current policy to NewPolicy. During the transition period, the default router list, on-link prefix list, autonomous prefix list and address list in all interfaces will be released.
[in] | IpSb | The IP6 service binding instance. |
[in] | NewPolicy | The new policy to be updated to. |
Definition at line 40 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigParseDhcpReply | ( | IN EFI_DHCP6_PROTOCOL * | Dhcp6, |
IN OUT IP6_CONFIG_INSTANCE * | Instance, | ||
IN EFI_DHCP6_PACKET * | Reply | ||
) |
Parse DHCPv6 reply packet to get the DNS server list. It is the work function for Ip6ConfigOnDhcp6Reply and Ip6ConfigOnDhcp6Event.
[in] | Dhcp6 | The pointer to the EFI_DHCP6_PROTOCOL instance. |
[in,out] | Instance | The pointer to the IP6 configuration instance data. |
[in] | Reply | The pointer to the DHCPv6 reply packet. |
EFI_SUCCESS | The DNS server address was retrieved from the reply packet. |
EFI_NOT_READY | The reply packet does not contain the DNS server option, or the DNS server address is not valid. |
Definition at line 1601 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigReadConfigData | ( | IN CHAR16 * | VarName, |
IN OUT IP6_CONFIG_INSTANCE * | Instance | ||
) |
Read the configuration data from variable storage according to the VarName and gEfiIp6ConfigProtocolGuid. 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 IP6_CONFIG_INSTANCE.
[in] | VarName | The pointer to the variable name |
[in,out] | Instance | The pointer to the IP6 config instance data. |
EFI_NOT_FOUND | The variable can not be found or already corrupted. |
EFI_OUT_OF_RESOURCES | Fail to allocate resource to complete the operation. |
EFI_SUCCESS | The configuration data was retrieved successfully. |
Definition at line 347 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigSetAltIfId | ( | IN IP6_CONFIG_INSTANCE * | Instance, |
IN UINTN | DataSize, | ||
IN VOID * | Data | ||
) |
The work function for EfiIp6ConfigSetData() to set the alternative interface ID for the communication device managed by this IP6Config instance, if the link local IPv6 addresses generated from the interface ID based on the default source the EFI IPv6 Protocol uses is a duplicate address.
[in] | Instance | Pointer to the IP6 configuration instance data. |
[in] | DataSize | Size of the buffer pointed to by Data in bytes. |
[in] | Data | The data buffer to set. |
EFI_BAD_BUFFER_SIZE | The DataSize does not match the size of the type, 8 bytes. |
EFI_SUCCESS | The specified configuration data for the EFI IPv6 network stack was set. |
Definition at line 636 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigSetDadXmits | ( | IN IP6_CONFIG_INSTANCE * | Instance, |
IN UINTN | DataSize, | ||
IN VOID * | Data | ||
) |
The work function for EfiIp6ConfigSetData() to set the number of consecutive Neighbor Solicitation messages sent while performing Duplicate Address Detection on a tentative address. A value of ZERO indicates that Duplicate Address Detection will not be performed on a tentative address.
[in] | Instance | The Instance Pointer to the IP6 config instance data. |
[in] | DataSize | Size of the buffer pointed to by Data in bytes. |
[in] | Data | The data buffer to set. |
EFI_BAD_BUFFER_SIZE | The DataSize does not match the size of the type. |
EFI_ABORTED | The new transmit count equals the current configuration. |
EFI_SUCCESS | The specified configuration data for the EFI IPv6 network stack was set. |
Definition at line 766 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigSetDnsServer | ( | IN IP6_CONFIG_INSTANCE * | Instance, |
IN UINTN | DataSize, | ||
IN VOID * | Data | ||
) |
The work function for EfiIp6ConfigSetData() to set the DNS server list for the EFI IPv6 network stack running on the communication device that this EFI IPv6 Configuration Protocol manages. It is not configurable when the policy is Ip6ConfigPolicyAutomatic. The DNS server addresses must be unicast IPv6 addresses.
[in] | Instance | The pointer to the IP6 config instance data. |
[in] | DataSize | The size of the buffer pointed to by Data in bytes. |
[in] | Data | The data buffer to set, points to an array of EFI_IPv6_ADDRESS instances. |
EFI_BAD_BUFFER_SIZE | The DataSize does not match the size of the type. |
EFI_WRITE_PROTECTED | The specified configuration data cannot be set under the current policy. |
EFI_INVALID_PARAMETER | One or more fields in Data is invalid. |
EFI_OUT_OF_RESOURCES | Failed to allocate resources to complete the operation. |
EFI_ABORTED | The DNS server addresses to be set equal the current configuration. |
EFI_SUCCESS | The specified configuration data for the EFI IPv6 network stack was set. |
Definition at line 1445 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigSetGateway | ( | IN IP6_CONFIG_INSTANCE * | Instance, |
IN UINTN | DataSize, | ||
IN VOID * | Data | ||
) |
The work function for EfiIp6ConfigSetData() to set the gateway addresses manually for the EFI IPv6 network stack that is running on the communication device that this EFI IPv6 Configuration Protocol manages. It is not configurable when the policy is Ip6ConfigPolicyAutomatic. The gateway addresses must be unicast IPv6 addresses.
[in] | Instance | The pointer to the IP6 config instance data. |
[in] | DataSize | The size of the buffer pointed to by Data in bytes. |
[in] | Data | The data buffer to set. This points to an array of EFI_IPv6_ADDRESS instances. |
EFI_BAD_BUFFER_SIZE | The DataSize does not match the size of the type. |
EFI_WRITE_PROTECTED | The specified configuration data cannot be set under the current policy. |
EFI_INVALID_PARAMETER | One or more fields in Data is invalid. |
EFI_OUT_OF_RESOURCES | Failed to allocate resource to complete the operation. |
EFI_ABORTED | The manual gateway addresses to be set equal the current configuration. |
EFI_SUCCESS | The specified configuration data for the EFI IPv6 network stack was set. |
Definition at line 1306 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigSetManualAddress | ( | IN IP6_CONFIG_INSTANCE * | Instance, |
IN UINTN | DataSize, | ||
IN VOID * | Data | ||
) |
The work function for EfiIp6ConfigSetData() to set the station addresses manually for the EFI IPv6 network stack. It is only configurable when the policy is Ip6ConfigPolicyManual.
[in] | Instance | Pointer to the IP6 configuration instance data. |
[in] | DataSize | Size of the buffer pointed to by Data in bytes. |
[in] | Data | The data buffer to set. |
EFI_BAD_BUFFER_SIZE | The DataSize does not match the size of the type. |
EFI_WRITE_PROTECTED | The specified configuration data cannot be set under the current policy. |
EFI_INVALID_PARAMETER | One or more fields in Data is invalid. |
EFI_OUT_OF_RESOURCES | Fail to allocate resource to complete the operation. |
EFI_NOT_READY | An asynchronous process is invoked to set the specified configuration data, and the process is not finished. |
EFI_ABORTED | The manual addresses to be set equal current configuration. |
EFI_SUCCESS | The specified configuration data for the EFI IPv6 network stack was set. |
Definition at line 931 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigSetPolicy | ( | IN IP6_CONFIG_INSTANCE * | Instance, |
IN UINTN | DataSize, | ||
IN VOID * | Data | ||
) |
The work function for EfiIp6ConfigSetData() to set the general configuration policy for the EFI IPv6 network stack that is running on the communication device managed by this IP6Config instance. The policy will affect other configuration settings.
[in] | Instance | Pointer to the IP6 config instance data. |
[in] | DataSize | Size of the buffer pointed to by Data in bytes. |
[in] | Data | The data buffer to set. |
EFI_INVALID_PARAMETER | The to be set policy is invalid. |
EFI_BAD_BUFFER_SIZE | The DataSize does not match the size of the type. |
EFI_ABORTED | The new policy equals the current policy. |
EFI_SUCCESS | The specified configuration data for the EFI IPv6 network stack was set. |
Definition at line 677 of file Ip6ConfigImpl.c.
VOID Ip6ConfigSetStatefulAddrCallback | ( | IN BOOLEAN | IsDadPassed, |
IN EFI_IPv6_ADDRESS * | TargetAddress, | ||
IN VOID * | Context | ||
) |
The callback function for Ip6SetAddr. The prototype is defined as IP6_DAD_CALLBACK. It is called after Duplicate Address Detection is performed on the tentative address by DHCPv6 in Ip6ConfigOnDhcp6Event().
[in] | IsDadPassed | If TRUE, Duplicate Address Detection passes. |
[in] | TargetAddress | The tentative IPv6 address to be checked. |
[in] | Context | Pointer to the IP6 configuration instance data. |
Definition at line 1715 of file Ip6ConfigImpl.c.
EFI_STATUS EFIAPI Ip6ConfigSignalEvent | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID * | Arg | ||
) |
Signal the registered event. It is the callback routine for NetMapIterate.
[in] | Map | Points to the list of registered event. |
[in] | Item | The registered event. |
[in] | Arg | Not used. |
Definition at line 321 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigStartStatefulAutoConfig | ( | IN IP6_CONFIG_INSTANCE * | Instance, |
IN BOOLEAN | OtherInfoOnly | ||
) |
The work function to trigger the DHCPv6 process to perform a stateful autoconfiguration.
[in] | Instance | Pointer to the IP6 config instance data. |
[in] | OtherInfoOnly | If FALSE, get stateful address and other information via DHCPv6. Otherwise, only get the other information. |
EFI_SUCCESS | The operation finished successfully. |
EFI_UNSUPPORTED | The DHCP6 driver is not available. |
Definition at line 176 of file Ip6ConfigImpl.c.
EFI_STATUS Ip6ConfigWriteConfigData | ( | IN CHAR16 * | VarName, |
IN IP6_CONFIG_INSTANCE * | Instance | ||
) |
Write the configuration data from IP6_CONFIG_INSTANCE to variable storage.
[in] | VarName | The pointer to the variable name. |
[in] | Instance | The pointer to the IP6 configuration instance data. |
EFI_OUT_OF_RESOURCES | Fail to allocate resource to complete the operation. |
EFI_SUCCESS | The configuration data is written successfully. |
Definition at line 479 of file Ip6ConfigImpl.c.
VOID Ip6ManualAddrDadCallback | ( | IN BOOLEAN | IsDadPassed, |
IN EFI_IPv6_ADDRESS * | TargetAddress, | ||
IN VOID * | Context | ||
) |
The callback function for Ip6SetAddr. The prototype is defined as IP6_DAD_CALLBACK. It is called after Duplicate Address Detection is performed for the manual address set by Ip6ConfigSetManualAddress.
[in] | IsDadPassed | If TRUE, Duplicate Address Detection passed. |
[in] | TargetAddress | The tentative IPv6 address to be checked. |
[in] | Context | Pointer to the IP6 configuration instance data. |
Definition at line 799 of file Ip6ConfigImpl.c.
LIST_ENTRY mIp6ConfigInstanceList = { &mIp6ConfigInstanceList, &mIp6ConfigInstanceList } |
Definition at line 13 of file Ip6ConfigImpl.c.