Path: blob/main/sys/contrib/edk2/Include/Protocol/Ip4Config.h
96339 views
/** @file1This file provides a definition of the EFI IPv4 Configuration2Protocol.34Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>5SPDX-License-Identifier: BSD-2-Clause-Patent67@par Revision Reference:8This Protocol is introduced in UEFI Specification 2.0.910**/1112#ifndef __EFI_IP4CONFIG_PROTOCOL_H__13#define __EFI_IP4CONFIG_PROTOCOL_H__1415#include <Protocol/Ip4.h>1617#define EFI_IP4_CONFIG_PROTOCOL_GUID \18{ \190x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } \20}2122typedef struct _EFI_IP4_CONFIG_PROTOCOL EFI_IP4_CONFIG_PROTOCOL;2324#define IP4_CONFIG_VARIABLE_ATTRIBUTES \25(EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)2627///28/// EFI_IP4_IPCONFIG_DATA contains the minimum IPv4 configuration data29/// that is needed to start basic network communication. The StationAddress30/// and SubnetMask must be a valid unicast IP address and subnet mask.31/// If RouteTableSize is not zero, then RouteTable contains a properly32/// formatted routing table for the StationAddress/SubnetMask, with the33/// last entry in the table being the default route.34///35typedef struct {36///37/// Default station IP address, stored in network byte order.38///39EFI_IPv4_ADDRESS StationAddress;40///41/// Default subnet mask, stored in network byte order.42///43EFI_IPv4_ADDRESS SubnetMask;44///45/// Number of entries in the following RouteTable. May be zero.46///47UINT32 RouteTableSize;48///49/// Default routing table data (stored in network byte order).50/// Ignored if RouteTableSize is zero.51///52EFI_IP4_ROUTE_TABLE *RouteTable;53} EFI_IP4_IPCONFIG_DATA;5455/**56Starts running the configuration policy for the EFI IPv4 Protocol driver.5758The Start() function is called to determine and to begin the platform59configuration policy by the EFI IPv4 Protocol driver. This determination may60be as simple as returning EFI_UNSUPPORTED if there is no EFI IPv4 Protocol61driver configuration policy. It may be as involved as loading some defaults62from nonvolatile storage, downloading dynamic data from a DHCP server, and63checking permissions with a site policy server.64Starting the configuration policy is just the beginning. It may finish almost65instantly or it may take several minutes before it fails to retrieve configuration66information from one or more servers. Once the policy is started, drivers67should use the DoneEvent parameter to determine when the configuration policy68has completed. EFI_IP4_CONFIG_PROTOCOL.GetData() must then be called to69determine if the configuration succeeded or failed.70Until the configuration completes successfully, EFI IPv4 Protocol driver instances71that are attempting to use default configurations must return EFI_NO_MAPPING.72Once the configuration is complete, the EFI IPv4 Configuration Protocol driver73signals DoneEvent. The configuration may need to be updated in the future.74Note that in this case the EFI IPv4 Configuration Protocol driver must signal75ReconfigEvent, and all EFI IPv4 Protocol driver instances that are using default76configurations must return EFI_NO_MAPPING until the configuration policy has77been rerun.7879@param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.80@param DoneEvent Event that will be signaled when the EFI IPv481Protocol driver configuration policy completes82execution. This event must be of type EVT_NOTIFY_SIGNAL.83@param ReconfigEvent Event that will be signaled when the EFI IPv484Protocol driver configuration needs to be updated.85This event must be of type EVT_NOTIFY_SIGNAL.8687@retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol88driver is now running.89@retval EFI_INVALID_PARAMETER One or more of the following parameters is NULL:90This91DoneEvent92ReconfigEvent93@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.94@retval EFI_ALREADY_STARTED The configuration policy for the EFI IPv4 Protocol95driver was already started.96@retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.97@retval EFI_UNSUPPORTED This interface does not support the EFI IPv4 Protocol98driver configuration.99100**/101typedef102EFI_STATUS103(EFIAPI *EFI_IP4_CONFIG_START)(104IN EFI_IP4_CONFIG_PROTOCOL *This,105IN EFI_EVENT DoneEvent,106IN EFI_EVENT ReconfigEvent107);108109/**110Stops running the configuration policy for the EFI IPv4 Protocol driver.111112The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver.113All configuration data will be lost after calling Stop().114115@param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.116117@retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol118driver has been stopped.119@retval EFI_INVALID_PARAMETER This is NULL.120@retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol121driver was not started.122123**/124typedef125EFI_STATUS126(EFIAPI *EFI_IP4_CONFIG_STOP)(127IN EFI_IP4_CONFIG_PROTOCOL *This128);129130/**131Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.132133The GetData() function returns the current configuration data for the EFI IPv4134Protocol driver after the configuration policy has completed.135136@param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.137@param IpConfigDataSize On input, the size of the IpConfigData buffer.138On output, the count of bytes that were written139into the IpConfigData buffer.140@param IpConfigData The pointer to the EFI IPv4 Configuration Protocol141driver configuration data structure.142Type EFI_IP4_IPCONFIG_DATA is defined in143"Related Definitions" below.144145@retval EFI_SUCCESS The EFI IPv4 Protocol driver configuration has been returned.146@retval EFI_INVALID_PARAMETER This is NULL.147@retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol148driver is not running.149@retval EFI_NOT_READY EFI IPv4 Protocol driver configuration is still running.150@retval EFI_ABORTED EFI IPv4 Protocol driver configuration could not complete.151@retval EFI_BUFFER_TOO_SMALL *IpConfigDataSize is smaller than the configuration152data buffer or IpConfigData is NULL.153154**/155typedef156EFI_STATUS157(EFIAPI *EFI_IP4_CONFIG_GET_DATA)(158IN EFI_IP4_CONFIG_PROTOCOL *This,159IN OUT UINTN *IpConfigDataSize,160OUT EFI_IP4_IPCONFIG_DATA *IpConfigData OPTIONAL161);162163///164/// The EFI_IP4_CONFIG_PROTOCOL driver performs platform-dependent and policy-dependent165/// configurations for the EFI IPv4 Protocol driver.166///167struct _EFI_IP4_CONFIG_PROTOCOL {168EFI_IP4_CONFIG_START Start;169EFI_IP4_CONFIG_STOP Stop;170EFI_IP4_CONFIG_GET_DATA GetData;171};172173extern EFI_GUID gEfiIp4ConfigProtocolGuid;174175#endif176177178