2015-06-08 04:04:06 +02:00
|
|
|
/** @file
|
|
|
|
This file provides a definition of the EFI IPv4 Configuration II
|
|
|
|
Protocol.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
2015-06-08 04:04:06 +02:00
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at<BR>
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
@par Revision Reference:
|
|
|
|
This Protocol is introduced in UEFI Specification 2.5
|
|
|
|
|
|
|
|
**/
|
|
|
|
#ifndef __EFI_IP4CONFIG2_PROTOCOL_H__
|
|
|
|
#define __EFI_IP4CONFIG2_PROTOCOL_H__
|
|
|
|
|
|
|
|
#include <Protocol/Ip4.h>
|
|
|
|
|
|
|
|
#define EFI_IP4_CONFIG2_PROTOCOL_GUID \
|
|
|
|
{ \
|
|
|
|
0x5b446ed1, 0xe30b, 0x4faa, {0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80 } \
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct _EFI_IP4_CONFIG2_PROTOCOL EFI_IP4_CONFIG2_PROTOCOL;
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
/// EFI_IP4_CONFIG2_DATA_TYPE
|
|
|
|
///
|
|
|
|
typedef enum {
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// The interface information of the communication device this EFI
|
|
|
|
/// IPv4 Configuration II Protocol instance manages. This type of
|
|
|
|
/// data is read only. The corresponding Data is of type
|
2015-06-08 04:04:06 +02:00
|
|
|
/// EFI_IP4_CONFIG2_INTERFACE_INFO.
|
|
|
|
///
|
|
|
|
Ip4Config2DataTypeInterfaceInfo,
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// The general configuration policy for the EFI IPv4 network stack
|
|
|
|
/// running on the communication device this EFI IPv4
|
|
|
|
/// Configuration II Protocol instance manages. The policy will
|
|
|
|
/// affect other configuration settings. The corresponding Data is of
|
2015-06-08 04:04:06 +02:00
|
|
|
/// type EFI_IP4_CONFIG2_POLICY.
|
|
|
|
///
|
|
|
|
Ip4Config2DataTypePolicy,
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// The station addresses set manually for the EFI IPv4 network
|
|
|
|
/// stack. It is only configurable when the policy is
|
|
|
|
/// Ip4Config2PolicyStatic. The corresponding Data is of
|
|
|
|
/// type EFI_IP4_CONFIG2_MANUAL_ADDRESS. When DataSize
|
|
|
|
/// is 0 and Data is NULL, the existing configuration is cleared
|
2017-02-20 02:30:29 +01:00
|
|
|
/// from the EFI IPv4 Configuration II Protocol instance.
|
2015-06-08 04:04:06 +02:00
|
|
|
///
|
|
|
|
Ip4Config2DataTypeManualAddress,
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// The gateway addresses set manually for the EFI IPv4 network
|
|
|
|
/// stack running on the communication device this EFI IPv4
|
|
|
|
/// Configuration II Protocol manages. It is not configurable when
|
|
|
|
/// the policy is Ip4Config2PolicyDhcp. The gateway
|
|
|
|
/// addresses must be unicast IPv4 addresses. The corresponding
|
2015-06-08 04:04:06 +02:00
|
|
|
/// Data is a pointer to an array of EFI_IPv4_ADDRESS instances.
|
2018-06-27 15:11:33 +02:00
|
|
|
/// When DataSize is 0 and Data is NULL, the existing configuration
|
2017-02-20 02:30:29 +01:00
|
|
|
/// is cleared from the EFI IPv4 Configuration II Protocol instance.
|
2015-06-08 04:04:06 +02:00
|
|
|
///
|
|
|
|
Ip4Config2DataTypeGateway,
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// The DNS server list for the EFI IPv4 network stack running on
|
|
|
|
/// the communication device this EFI IPv4 Configuration II
|
|
|
|
/// Protocol manages. It is not configurable when the policy is
|
|
|
|
/// Ip4Config2PolicyDhcp. The DNS server addresses must be
|
|
|
|
/// unicast IPv4 addresses. The corresponding Data is a pointer to
|
|
|
|
/// an array of EFI_IPv4_ADDRESS instances. When DataSize
|
|
|
|
/// is 0 and Data is NULL, the existing configuration is cleared
|
2017-02-20 02:30:29 +01:00
|
|
|
/// from the EFI IPv4 Configuration II Protocol instance.
|
2015-06-08 04:04:06 +02:00
|
|
|
///
|
|
|
|
Ip4Config2DataTypeDnsServer,
|
|
|
|
Ip4Config2DataTypeMaximum
|
|
|
|
} EFI_IP4_CONFIG2_DATA_TYPE;
|
|
|
|
|
2016-01-29 07:45:39 +01:00
|
|
|
///
|
|
|
|
/// EFI_IP4_CONFIG2_INTERFACE_INFO related definitions
|
|
|
|
///
|
|
|
|
#define EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE 32
|
|
|
|
|
2015-06-08 04:04:06 +02:00
|
|
|
///
|
|
|
|
/// EFI_IP4_CONFIG2_INTERFACE_INFO
|
|
|
|
///
|
|
|
|
typedef struct {
|
|
|
|
///
|
|
|
|
/// The name of the interface. It is a NULL-terminated Unicode string.
|
|
|
|
///
|
2016-01-29 07:45:39 +01:00
|
|
|
CHAR16 Name[EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE];
|
2015-06-08 04:04:06 +02:00
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// The interface type of the network interface. See RFC 1700,
|
2015-06-08 04:04:06 +02:00
|
|
|
/// section "Number Hardware Type".
|
|
|
|
///
|
|
|
|
UINT8 IfType;
|
|
|
|
///
|
|
|
|
/// The size, in bytes, of the network interface's hardware address.
|
|
|
|
///
|
|
|
|
UINT32 HwAddressSize;
|
|
|
|
///
|
|
|
|
/// The hardware address for the network interface.
|
|
|
|
///
|
|
|
|
EFI_MAC_ADDRESS HwAddress;
|
|
|
|
///
|
|
|
|
/// The station IPv4 address of this EFI IPv4 network stack.
|
|
|
|
///
|
|
|
|
EFI_IPv4_ADDRESS StationAddress;
|
|
|
|
///
|
|
|
|
/// The subnet address mask that is associated with the station address.
|
|
|
|
///
|
|
|
|
EFI_IPv4_ADDRESS SubnetMask;
|
|
|
|
///
|
|
|
|
/// Size of the following RouteTable, in bytes. May be zero.
|
|
|
|
///
|
|
|
|
UINT32 RouteTableSize;
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// The route table of the IPv4 network stack runs on this interface.
|
|
|
|
/// Set to NULL if RouteTableSize is zero. Type EFI_IP4_ROUTE_TABLE is defined in
|
2015-06-08 04:04:06 +02:00
|
|
|
/// EFI_IP4_PROTOCOL.GetModeData().
|
|
|
|
///
|
|
|
|
EFI_IP4_ROUTE_TABLE *RouteTable OPTIONAL;
|
|
|
|
} EFI_IP4_CONFIG2_INTERFACE_INFO;
|
|
|
|
|
|
|
|
///
|
|
|
|
/// EFI_IP4_CONFIG2_POLICY
|
|
|
|
///
|
|
|
|
typedef enum {
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// Under this policy, the Ip4Config2DataTypeManualAddress,
|
|
|
|
/// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration
|
|
|
|
/// data are required to be set manually. The EFI IPv4 Protocol will get all
|
|
|
|
/// required configuration such as IPv4 address, subnet mask and
|
2015-06-08 04:04:06 +02:00
|
|
|
/// gateway settings from the EFI IPv4 Configuration II protocol.
|
|
|
|
///
|
|
|
|
Ip4Config2PolicyStatic,
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// Under this policy, the Ip4Config2DataTypeManualAddress,
|
|
|
|
/// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration data are
|
|
|
|
/// not allowed to set via SetData(). All of these configurations are retrieved from DHCP
|
2015-06-08 04:04:06 +02:00
|
|
|
/// server or other auto-configuration mechanism.
|
|
|
|
///
|
|
|
|
Ip4Config2PolicyDhcp,
|
|
|
|
Ip4Config2PolicyMax
|
|
|
|
} EFI_IP4_CONFIG2_POLICY;
|
|
|
|
|
|
|
|
///
|
|
|
|
/// EFI_IP4_CONFIG2_MANUAL_ADDRESS
|
|
|
|
///
|
|
|
|
typedef struct {
|
2018-06-27 15:11:33 +02:00
|
|
|
///
|
2015-06-08 04:04:06 +02:00
|
|
|
/// The IPv4 unicast address.
|
|
|
|
///
|
|
|
|
EFI_IPv4_ADDRESS Address;
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// The subnet mask.
|
2015-06-08 04:04:06 +02:00
|
|
|
///
|
|
|
|
EFI_IPv4_ADDRESS SubnetMask;
|
|
|
|
} EFI_IP4_CONFIG2_MANUAL_ADDRESS;
|
|
|
|
|
|
|
|
/**
|
2018-06-27 15:11:33 +02:00
|
|
|
Set the configuration for the EFI IPv4 network stack running on the communication device this EFI
|
2015-06-08 04:04:06 +02:00
|
|
|
IPv4 Configuration II Protocol instance manages.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
This function is used to set the configuration data of type DataType for the EFI IPv4 network stack
|
2015-06-08 04:04:06 +02:00
|
|
|
running on the communication device this EFI IPv4 Configuration II Protocol instance manages.
|
|
|
|
The successfully configured data is valid after system reset or power-off.
|
2018-06-27 15:11:33 +02:00
|
|
|
The DataSize is used to calculate the count of structure instances in the Data for some
|
2015-06-08 04:04:06 +02:00
|
|
|
DataType that multiple structure instances are allowed.
|
2018-06-27 15:11:33 +02:00
|
|
|
This function is always non-blocking. When setting some typeof configuration data, an
|
|
|
|
asynchronous process is invoked to check the correctness of the data, such as doing address conflict
|
|
|
|
detection on the manually set local IPv4 address. EFI_NOT_READY is returned immediately to
|
|
|
|
indicate that such an asynchronous process is invoked and the process is not finished yet. The caller
|
2015-06-08 04:04:06 +02:00
|
|
|
willing to get the result of the asynchronous process is required to call RegisterDataNotify()
|
2018-06-27 15:11:33 +02:00
|
|
|
to register an event on the specified configuration data. Once the event is signaled, the caller can call
|
|
|
|
GetData()to get back the configuration data in order to 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.
|
2015-06-08 04:04:06 +02:00
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
@param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
|
2015-06-08 04:04:06 +02:00
|
|
|
@param[in] DataType The type of data to set.
|
|
|
|
@param[in] DataSize Size of the buffer pointed to by Data in bytes.
|
2018-06-27 15:11:33 +02:00
|
|
|
@param[in] Data The data buffer to set. The type ofthe data buffer is associated
|
|
|
|
with the DataType.
|
2015-06-08 04:04:06 +02:00
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
@retval EFI_SUCCESS The specified configuration data for the EFI IPv4 network stack is set
|
2015-06-08 04:04:06 +02:00
|
|
|
successfully.
|
|
|
|
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
|
|
|
|
This is NULL.
|
2018-06-27 15:11:33 +02:00
|
|
|
One or more fields in Data and DataSize do not match the
|
2017-02-20 02:30:29 +01:00
|
|
|
requirement of the data type indicated by DataType.
|
2018-06-27 15:11:33 +02:00
|
|
|
@retval EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified configuration
|
2015-06-08 04:04:06 +02:00
|
|
|
data can not be set under the current policy.
|
|
|
|
@retval EFI_ACCESS_DENIED Another set operation on the specified configuration data is already in process.
|
2018-06-27 15:11:33 +02:00
|
|
|
@retval EFI_NOT_READY An asynchronous process is invoked to set the specified configuration data and
|
2015-06-08 04:04:06 +02:00
|
|
|
the process is not finished yet.
|
2018-06-27 15:11:33 +02:00
|
|
|
@retval EFI_BAD_BUFFER_SIZE The DataSize does not match the size of the type indicated by DataType.
|
2015-06-08 04:04:06 +02:00
|
|
|
@retval EFI_UNSUPPORTED This DataType is not supported.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.
|
|
|
|
**/
|
2018-06-27 15:11:33 +02:00
|
|
|
typedef
|
2015-06-08 04:04:06 +02:00
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_IP4_CONFIG2_SET_DATA) (
|
|
|
|
IN EFI_IP4_CONFIG2_PROTOCOL *This,
|
|
|
|
IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
|
|
|
|
IN UINTN DataSize,
|
|
|
|
IN VOID *Data
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2018-06-27 15:11:33 +02:00
|
|
|
Get the configuration data for the EFI IPv4 network stack running on the communication device this
|
2015-06-08 04:04:06 +02:00
|
|
|
EFI IPv4 Configuration II Protocol instance manages.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
This function returns the configuration data of type DataType for the EFI IPv4 network stack
|
2015-06-08 04:04:06 +02:00
|
|
|
running on the communication device this EFI IPv4 Configuration II Protocol instance manages.
|
2018-06-27 15:11:33 +02:00
|
|
|
The caller is responsible for allocating the buffer usedto return the specified configuration data and
|
2015-06-08 04:04:06 +02:00
|
|
|
the required size will be returned to the caller if the size of the buffer is too small.
|
2018-06-27 15:11:33 +02:00
|
|
|
EFI_NOT_READY is returned if the specified configuration data is not ready due to an already in
|
|
|
|
progress asynchronous configuration process. 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
|
2015-06-08 04:04:06 +02:00
|
|
|
configuration data.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
@param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
|
2015-06-08 04:04:06 +02:00
|
|
|
@param[in] DataType The type of data to get.
|
2018-06-27 15:11:33 +02:00
|
|
|
@param[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.
|
|
|
|
@param[in] Data The data buffer in which the configuration data is returned. The
|
|
|
|
type of the data buffer is associated with the DataType. Ignored
|
|
|
|
if DataSize is 0.
|
2015-06-08 04:04:06 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The specified configuration data is got successfully.
|
|
|
|
@retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
|
|
|
|
This is NULL.
|
|
|
|
DataSize is NULL.
|
|
|
|
Data is NULL if *DataSizeis not zero.
|
2018-06-27 15:11:33 +02:00
|
|
|
@retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified configuration data
|
2015-06-08 04:04:06 +02:00
|
|
|
and the required size is returned in DataSize.
|
2018-06-27 15:11:33 +02:00
|
|
|
@retval EFI_NOT_READY The specified configuration data is not ready due to an already in
|
2015-06-08 04:04:06 +02:00
|
|
|
progress asynchronous configuration process.
|
|
|
|
@retval EFI_NOT_FOUND The specified configuration data is not found.
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_IP4_CONFIG2_GET_DATA) (
|
|
|
|
IN EFI_IP4_CONFIG2_PROTOCOL *This,
|
|
|
|
IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
|
|
|
|
IN OUT UINTN *DataSize,
|
|
|
|
IN VOID *Data OPTIONAL
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2018-06-27 15:11:33 +02:00
|
|
|
Register an event that is to be signaled whenever a configuration process on the specified
|
2015-06-08 04:04:06 +02:00
|
|
|
configuration data is done.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
This function registers an event that is to be signaled whenever a configuration process on the
|
2015-06-08 04:04:06 +02:00
|
|
|
specified configuration data is done. An event can be registered for different DataType
|
2018-06-27 15:11:33 +02:00
|
|
|
simultaneously and the caller is responsible for determining which type of configuration data causes
|
2015-06-08 04:04:06 +02:00
|
|
|
the signaling of the event in such case.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
@param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
|
2015-06-08 04:04:06 +02:00
|
|
|
@param[in] DataType The type of data to unregister the event for.
|
|
|
|
@param[in] Event The event to register.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
@retval EFI_SUCCESS The notification event for the specified configuration data is
|
2015-06-08 04:04:06 +02:00
|
|
|
registered.
|
|
|
|
@retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
|
|
|
|
@retval EFI_UNSUPPORTED The configuration data type specified by DataType is not supported.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
|
|
|
@retval EFI_ACCESS_DENIED The Event is already registered for the DataType.
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_IP4_CONFIG2_REGISTER_NOTIFY) (
|
|
|
|
IN EFI_IP4_CONFIG2_PROTOCOL *This,
|
|
|
|
IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
|
|
|
|
IN EFI_EVENT Event
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Remove a previously registered event for the specified configuration data.
|
|
|
|
|
|
|
|
This function removes a previously registeredevent for the specified configuration data.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
@param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
|
2015-06-08 04:04:06 +02:00
|
|
|
@param[in] DataType The type of data to remove the previously registered event for.
|
|
|
|
@param[in] Event The event to unregister.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The event registered for the specified configuration data is removed.
|
|
|
|
@retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
|
|
|
|
@retval EFI_NOT_FOUND The Eventhas not been registered for the specified DataType.
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_IP4_CONFIG2_UNREGISTER_NOTIFY) (
|
|
|
|
IN EFI_IP4_CONFIG2_PROTOCOL *This,
|
|
|
|
IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
|
|
|
|
IN EFI_EVENT Event
|
|
|
|
);
|
|
|
|
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// The EFI_IP4_CONFIG2_PROTOCOL is designed to be the central repository for the common
|
2015-06-08 04:04:06 +02:00
|
|
|
/// configurations and the administrator configurable settings for the EFI IPv4 network stack.
|
2018-06-27 15:11:33 +02:00
|
|
|
/// An EFI IPv4 Configuration II Protocol instance will be installed on each communication device that
|
2015-06-08 04:04:06 +02:00
|
|
|
/// the EFI IPv4 network stack runs on.
|
|
|
|
///
|
|
|
|
struct _EFI_IP4_CONFIG2_PROTOCOL {
|
|
|
|
EFI_IP4_CONFIG2_SET_DATA SetData;
|
|
|
|
EFI_IP4_CONFIG2_GET_DATA GetData;
|
|
|
|
EFI_IP4_CONFIG2_REGISTER_NOTIFY RegisterDataNotify;
|
|
|
|
EFI_IP4_CONFIG2_UNREGISTER_NOTIFY UnregisterDataNotify;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiIp4Config2ProtocolGuid;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|