|
typedef struct _EFI_DHCP4_PROTOCOL | EFI_DHCP4_PROTOCOL |
|
typedef EFI_STATUS(EFIAPI * | EFI_DHCP4_CALLBACK) (IN EFI_DHCP4_PROTOCOL *This, IN VOID *Context, IN EFI_DHCP4_STATE CurrentState, IN EFI_DHCP4_EVENT Dhcp4Event, IN EFI_DHCP4_PACKET *Packet OPTIONAL, OUT EFI_DHCP4_PACKET **NewPacket OPTIONAL) |
|
typedef EFI_STATUS(EFIAPI * | EFI_DHCP4_GET_MODE_DATA) (IN EFI_DHCP4_PROTOCOL *This, OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData) |
|
typedef EFI_STATUS(EFIAPI * | EFI_DHCP4_CONFIGURE) (IN EFI_DHCP4_PROTOCOL *This, IN EFI_DHCP4_CONFIG_DATA *Dhcp4CfgData OPTIONAL) |
|
typedef EFI_STATUS(EFIAPI * | EFI_DHCP4_START) (IN EFI_DHCP4_PROTOCOL *This, IN EFI_EVENT CompletionEvent OPTIONAL) |
|
typedef EFI_STATUS(EFIAPI * | EFI_DHCP4_RENEW_REBIND) (IN EFI_DHCP4_PROTOCOL *This, IN BOOLEAN RebindRequest, IN EFI_EVENT CompletionEvent OPTIONAL) |
|
typedef EFI_STATUS(EFIAPI * | EFI_DHCP4_RELEASE) (IN EFI_DHCP4_PROTOCOL *This) |
|
typedef EFI_STATUS(EFIAPI * | EFI_DHCP4_STOP) (IN EFI_DHCP4_PROTOCOL *This) |
|
typedef EFI_STATUS(EFIAPI * | EFI_DHCP4_BUILD) (IN EFI_DHCP4_PROTOCOL *This, IN EFI_DHCP4_PACKET *SeedPacket, IN UINT32 DeleteCount, IN UINT8 *DeleteList OPTIONAL, IN UINT32 AppendCount, IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL, OUT EFI_DHCP4_PACKET **NewPacket) |
|
typedef EFI_STATUS(EFIAPI * | EFI_DHCP4_TRANSMIT_RECEIVE) (IN EFI_DHCP4_PROTOCOL *This, IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token) |
|
typedef EFI_STATUS(EFIAPI * | EFI_DHCP4_PARSE) (IN EFI_DHCP4_PROTOCOL *This, IN EFI_DHCP4_PACKET *Packet, IN OUT UINT32 *OptionCount, OUT EFI_DHCP4_PACKET_OPTION *PacketOptionList[] OPTIONAL) |
|
EFI_DHCP4_PROTOCOL as defined in UEFI 2.0. EFI_DHCP4_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0. These protocols are used to collect configuration information for the EFI IPv4 Protocol drivers and to provide DHCPv4 server and PXE boot server discovery services.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
- Revision Reference:
- This Protocol was introduced in UEFI Specification 2.0.
Definition in file Dhcp4.h.
Initializes, changes, or resets the operational settings for the EFI DHCPv4 Protocol driver.
The Configure() function is used to initialize, change, or reset the operational settings of the EFI DHCPv4 Protocol driver for the communication device on which the EFI DHCPv4 Service Binding Protocol is installed. This function can be successfully called only if both of the following are true: This instance of the EFI DHCPv4 Protocol driver is in the Dhcp4Stopped, Dhcp4Init, Dhcp4InitReboot, or Dhcp4Bound states. No other EFI DHCPv4 Protocol driver instance that is controlled by this EFI DHCPv4 Service Binding Protocol driver instance has configured this EFI DHCPv4 Protocol driver. When this driver is in the Dhcp4Stopped state, it can transfer into one of the following two possible initial states: Dhcp4Init Dhcp4InitReboot. The driver can transfer into these states by calling Configure() with a non-NULL Dhcp4CfgData. The driver will transfer into the appropriate state based on the supplied client network address in the ClientAddress parameter and DHCP options in the OptionList parameter as described in RFC 2131. When Configure() is called successfully while Dhcp4CfgData is set to NULL, the default configuring data will be reset in the EFI DHCPv4 Protocol driver and the state of the EFI DHCPv4 Protocol driver will not be changed. If one instance wants to make it possible for another instance to configure the EFI DHCPv4 Protocol driver, it must call this function with Dhcp4CfgData set to NULL.
- Parameters
-
This | The pointer to the EFI_DHCP4_PROTOCOL instance. |
Dhcp4CfgData | The pointer to the EFI_DHCP4_CONFIG_DATA. |
- Return values
-
EFI_SUCCESS | The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or Dhcp4InitReboot state, if the original state of this driver was Dhcp4Stopped, Dhcp4Init,Dhcp4InitReboot, or Dhcp4Bound and the value of Dhcp4CfgData was not NULL. Otherwise, the state was left unchanged. |
EFI_ACCESS_DENIED | This instance of the EFI DHCPv4 Protocol driver was not in the Dhcp4Stopped, Dhcp4Init, Dhcp4InitReboot, or Dhcp4Bound state; Or onother instance of this EFI DHCPv4 Protocol driver is already in a valid configured state. |
EFI_INVALID_PARAMETER | One or more following conditions are TRUE: This is NULL. DiscoverTryCount > 0 and DiscoverTimeout is NULL RequestTryCount > 0 and RequestTimeout is NULL. OptionCount >0 and OptionList is NULL. ClientAddress is not a valid unicast address. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_DEVICE_ERROR | An unexpected system or network error occurred. |
Definition at line 475 of file Dhcp4.h.
Parses the packed DHCP option data.
The Parse() function is used to retrieve the option list from a DHCP packet. If *OptionCount isn't zero, and there is enough space for all the DHCP options in the Packet, each element of PacketOptionList is set to point to somewhere in the Packet->Dhcp4.Option where a new DHCP option begins. If RFC3396 is supported, the caller should reassemble the parsed DHCP options to get the final result. If *OptionCount is zero or there isn't enough space for all of them, the number of DHCP options in the Packet is returned in OptionCount.
- Parameters
-
This | The pointer to the EFI_DHCP4_PROTOCOL instance. |
Packet | The pointer to packet to be parsed. |
OptionCount | On input, the number of entries in the PacketOptionList. On output, the number of entries that were written into the PacketOptionList. |
PacketOptionList | A list of packet option entries to be filled in. End option or pad options are not included. |
- Return values
-
EFI_SUCCESS | The packet was successfully parsed. |
EFI_INVALID_PARAMETER | One or more of the following conditions is TRUE: This is NULL. The packet is NULL. The packet is not a well-formed DHCP packet. OptionCount is NULL. |
EFI_BUFFER_TOO_SMALL | One or more of the following conditions is TRUE: 1) *OptionCount is smaller than the number of options that were found in the Packet. 2) PacketOptionList is NULL. |
EFI_OUT_OF_RESOURCE | The packet failed to parse because of a resource shortage. |
Definition at line 735 of file Dhcp4.h.
Releases the current address configuration.
The Release() function releases the current configured IP address by doing either of the following: Sending a DHCPRELEASE packet when the EFI DHCPv4 Protocol driver is in the Dhcp4Bound state Setting the previously assigned IP address that was provided with the EFI_DHCP4_PROTOCOL.Configure() function to 0.0.0.0 when the driver is in Dhcp4InitReboot state After a successful call to this function, the EFI DHCPv4 Protocol driver returns to the Dhcp4Init state, and any subsequent incoming packets will be discarded silently.
- Parameters
-
This | The pointer to the EFI_DHCP4_PROTOCOL instance. |
- Return values
-
EFI_SUCCESS | The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase. |
EFI_INVALID_PARAMETER | This is NULL. |
EFI_ACCESS_DENIED | The EFI DHCPv4 Protocol driver is not Dhcp4InitReboot state. |
EFI_DEVICE_ERROR | An unexpected system or network error occurred. |
Definition at line 597 of file Dhcp4.h.
Extends the lease time by sending a request packet.
The RenewRebind() function is used to manually extend the lease time when the EFI DHCPv4 Protocol driver is in the Dhcp4Bound state, and the lease time has not expired yet. This function will send a request packet to the previously found server (or to any server when RebindRequest is TRUE) and transfer the state into the Dhcp4Renewing state (or Dhcp4Rebinding when RebindingRequest is TRUE). When a response is received, the state is returned to Dhcp4Bound. If no response is received before the try count is exceeded (the RequestTryCount field that is specified in EFI_DHCP4_CONFIG_DATA) but before the lease time that was issued by the previous server expires, the driver will return to the Dhcp4Bound state, and the previous configuration is restored. The outgoing and incoming packets can be captured by the EFI_DHCP4_CALLBACK function.
- Parameters
-
This | The pointer to the EFI_DHCP4_PROTOCOL instance. |
RebindRequest | If TRUE, this function broadcasts the request packets and enters the Dhcp4Rebinding state. Otherwise, it sends a unicast request packet and enters the Dhcp4Renewing state. |
CompletionEvent | If not NULL, this event is signaled when the renew/rebind phase completes or some error occurs. EFI_DHCP4_PROTOCOL.GetModeData() can be called to check the completion status. If NULL, EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait until the DHCP process finishes. |
- Return values
-
EFI_SUCCESS | The EFI DHCPv4 Protocol driver is now in the Dhcp4Renewing state or is back to the Dhcp4Bound state. |
EFI_NOT_STARTED | The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called. |
EFI_INVALID_PARAMETER | This is NULL. |
EFI_TIMEOUT | There was no response from the server when the try count was exceeded. |
EFI_ACCESS_DENIED | The driver is not in the Dhcp4Bound state. |
EFI_DEVICE_ERROR | An unexpected system or network error occurred. |
Definition at line 568 of file Dhcp4.h.
Starts the DHCP configuration process.
The Start() function starts the DHCP configuration process. This function can be called only when the EFI DHCPv4 Protocol driver is in the Dhcp4Init or Dhcp4InitReboot state. If the DHCP process completes successfully, the state of the EFI DHCPv4 Protocol driver will be transferred through Dhcp4Selecting and Dhcp4Requesting to the Dhcp4Bound state. The CompletionEvent will then be signaled if it is not NULL. If the process aborts, either by the user or by some unexpected network error, the state is restored to the Dhcp4Init state. The Start() function can be called again to restart the process. Refer to RFC 2131 for precise state transitions during this process. At the time when each event occurs in this process, the callback function that was set by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this opportunity to control the process.
- Parameters
-
This | The pointer to the EFI_DHCP4_PROTOCOL instance. |
CompletionEvent | If not NULL, it indicates the event that will be signaled when the EFI DHCPv4 Protocol driver is transferred into the Dhcp4Bound state or when the DHCP process is aborted. EFI_DHCP4_PROTOCOL.GetModeData() can be called to check the completion status. If NULL, EFI_DHCP4_PROTOCOL.Start() will wait until the driver is transferred into the Dhcp4Bound state or the process fails. |
- Return values
-
EFI_SUCCESS | The DHCP configuration process has started, or it has completed when CompletionEvent is NULL. |
EFI_NOT_STARTED | The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL. Configure() needs to be called. |
EFI_INVALID_PARAMETER | This is NULL. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_TIMEOUT | The DHCP configuration process failed because no response was received from the server within the specified timeout value. |
EFI_ABORTED | The user aborted the DHCP process. |
EFI_ALREADY_STARTED | Some other EFI DHCPv4 Protocol instance already started the DHCP process. |
EFI_DEVICE_ERROR | An unexpected system or network error occurred. |
EFI_NO_MEDIA | There was a media error. |
Definition at line 523 of file Dhcp4.h.