2007-06-19 12:12:02 +02:00
|
|
|
/** @file
|
|
|
|
EFI_DHCP4_PROTOCOL as defined in UEFI 2.0.
|
|
|
|
EFI_DHCP4_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
|
2007-10-16 11:23:09 +02:00
|
|
|
These protocols are used to collect configuration information for the EFI IPv4 Protocol
|
2007-06-19 12:12:02 +02:00
|
|
|
drivers and to provide DHCPv4 server and PXE boot server discovery services.
|
|
|
|
|
2009-09-03 11:22:38 +02:00
|
|
|
Copyright (c) 2006 - 2009, Intel Corporation
|
2007-10-16 11:23:09 +02:00
|
|
|
All rights reserved. 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
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2007-10-16 11:23:09 +02:00
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2009-09-03 11:22:38 +02:00
|
|
|
@par Revision Reference:
|
|
|
|
This Protocol is introduced in UEFI Specification 2.0
|
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __EFI_DHCP4_PROTOCOL_H__
|
|
|
|
#define __EFI_DHCP4_PROTOCOL_H__
|
|
|
|
|
|
|
|
#define EFI_DHCP4_PROTOCOL_GUID \
|
|
|
|
{ \
|
|
|
|
0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \
|
|
|
|
{ \
|
|
|
|
0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } \
|
|
|
|
}
|
2007-10-16 11:23:09 +02:00
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
typedef struct _EFI_DHCP4_PROTOCOL EFI_DHCP4_PROTOCOL;
|
|
|
|
|
|
|
|
|
|
|
|
#pragma pack(1)
|
|
|
|
typedef struct {
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// DHCP option code.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT8 OpCode;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Length of the DHCP option data. Not present if OpCode is 0 or 255.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT8 Length;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Start of the DHCP option data. Not present if OpCode is 0 or 255 or if Length is zero.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT8 Data[1];
|
|
|
|
} EFI_DHCP4_PACKET_OPTION;
|
|
|
|
#pragma pack()
|
|
|
|
|
|
|
|
|
|
|
|
#pragma pack(1)
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// EFI_DHCP4_PACKET defines the format of DHCPv4 packets. See RFC 2131 for more information.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
typedef struct {
|
2008-11-19 15:23:54 +01:00
|
|
|
UINT8 OpCode;
|
|
|
|
UINT8 HwType;
|
|
|
|
UINT8 HwAddrLen;
|
|
|
|
UINT8 Hops;
|
|
|
|
UINT32 Xid;
|
|
|
|
UINT16 Seconds;
|
|
|
|
UINT16 Reserved;
|
|
|
|
EFI_IPv4_ADDRESS ClientAddr; ///< Client IP address from client
|
|
|
|
EFI_IPv4_ADDRESS YourAddr; ///< Client IP address from server
|
|
|
|
EFI_IPv4_ADDRESS ServerAddr; ///< IP address of next server in bootstrap
|
|
|
|
EFI_IPv4_ADDRESS GatewayAddr; ///< Relay agent IP address
|
|
|
|
UINT8 ClientHwAddr[16]; ///< Client hardware address
|
|
|
|
CHAR8 ServerName[64];
|
|
|
|
CHAR8 BootFileName[128];
|
2007-06-19 12:12:02 +02:00
|
|
|
}EFI_DHCP4_HEADER;
|
|
|
|
#pragma pack()
|
|
|
|
|
|
|
|
|
|
|
|
#pragma pack(1)
|
|
|
|
typedef struct {
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Size of the EFI_DHCP4_PACKET buffer.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT32 Size;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Length of the EFI_DHCP4_PACKET from the first byte of the Header field
|
|
|
|
/// to the last byte of the Option[] field.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT32 Length;
|
|
|
|
|
|
|
|
struct {
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// DHCP packet header.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_DHCP4_HEADER Header;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// DHCP magik cookie in network byte order.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT32 Magik;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Start of the DHCP packed option data.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT8 Option[1];
|
|
|
|
} Dhcp4;
|
|
|
|
} EFI_DHCP4_PACKET;
|
|
|
|
#pragma pack()
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The EFI DHCPv4 Protocol driver is stopped
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4Stopped = 0x0,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The EFI DHCPv4 Protocol driver is inactive
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4Init = 0x1,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The EFI DHCPv4 Protocol driver is collecting DHCP offer packets from DHCP servers.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4Selecting = 0x2,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The EFI DHCPv4 Protocol driver has sent the request to the DHCP server and is waiting for a response.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4Requesting = 0x3,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The DHCP configuration has completed.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4Bound = 0x4,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The DHCP configuration is being renewed and another request has
|
|
|
|
/// been sent out, but it has not received a response from the server yet.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4Renewing = 0x5,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The DHCP configuration has timed out and the EFI DHCPv4
|
|
|
|
/// Protocol driver is trying to extend the lease time.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4Rebinding = 0x6,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The EFI DHCPv4 Protocol driver is initialized with a previously
|
|
|
|
/// allocated or known IP address.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4InitReboot = 0x7,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The EFI DHCPv4 Protocol driver is seeking to reuse the previously
|
|
|
|
/// allocated IP address by sending a request to the DHCP server.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4Rebooting = 0x8
|
|
|
|
} EFI_DHCP4_STATE;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum{
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2009-03-27 08:14:00 +01:00
|
|
|
/// The packet to start the configuration sequence is about to be sent.
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4SendDiscover = 0x01,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2009-03-27 08:14:00 +01:00
|
|
|
/// A reply packet was just received.
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4RcvdOffer = 0x02,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// It is time for Dhcp4Callback to select an offer.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4SelectOffer = 0x03,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// A request packet is about to be sent.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4SendRequest = 0x04,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// A DHCPACK packet was received and will be passed to Dhcp4Callback.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4RcvdAck = 0x05,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// A DHCPNAK packet was received and will be passed to Dhcp4Callback.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4RcvdNak = 0x06,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// A decline packet is about to be sent.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4SendDecline = 0x07,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The DHCP configuration process has completed. No packet is associated with this event.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4BoundCompleted = 0x08,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// It is time to enter the Dhcp4Renewing state and to contact the server
|
|
|
|
/// that originally issued the network address. No packet is associated with this event.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4EnterRenewing = 0x09,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// It is time to enter the Dhcp4Rebinding state and to contact any server.
|
|
|
|
/// No packet is associated with this event.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4EnterRebinding = 0x0a,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The configured IP address was lost either because the lease has expired,
|
|
|
|
/// the user released the configuration, or a DHCPNAK packet was received in
|
|
|
|
/// the Dhcp4Renewing or Dhcp4Rebinding state. No packet is associated with this event.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4AddressLost = 0x0b,
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The DHCP process failed because a DHCPNAK packet was received or the user
|
|
|
|
/// aborted the DHCP process at a time when the configuration was not available yet.
|
|
|
|
/// No packet is associated with this event.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
Dhcp4Fail = 0x0c
|
|
|
|
} EFI_DHCP4_EVENT;
|
|
|
|
|
2007-10-16 11:23:09 +02:00
|
|
|
/**
|
2008-11-14 10:15:28 +01:00
|
|
|
Callback routine.
|
|
|
|
|
|
|
|
EFI_DHCP4_CALLBACK is provided by the consumer of the EFI DHCPv4 Protocol driver
|
|
|
|
to intercept events that occurred in the configuration process. This structure
|
|
|
|
provides advanced control of each state transition of the DHCP process. The
|
|
|
|
returned status code determines the behavior of the EFI DHCPv4 Protocol driver.
|
|
|
|
There are three possible returned values, which are described in the following
|
|
|
|
table.
|
2007-10-16 11:23:09 +02:00
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
@param This Pointer to the EFI DHCPv4 Protocol instance that is used to
|
2007-10-16 11:23:09 +02:00
|
|
|
configure this callback function.
|
2007-06-19 12:12:02 +02:00
|
|
|
@param Context Pointer to the context that is initialized by
|
2007-10-16 11:23:09 +02:00
|
|
|
EFI_DHCP4_PROTOCOL.Configure().
|
2007-06-19 12:12:02 +02:00
|
|
|
@param CurrentState The current operational state of the EFI DHCPv4 Protocol
|
2007-10-16 11:23:09 +02:00
|
|
|
driver.
|
2007-06-19 12:12:02 +02:00
|
|
|
@param Dhcp4Event The event that occurs in the current state, which usually means a
|
2007-10-16 11:23:09 +02:00
|
|
|
state transition.
|
|
|
|
@param Packet The DHCP packet that is going to be sent or already received.
|
2007-06-19 12:12:02 +02:00
|
|
|
@param NewPacket The packet that is used to replace the above Packet.
|
2007-10-16 11:23:09 +02:00
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
@retval EFI_SUCCESS Tells the EFI DHCPv4 Protocol driver to continue the DHCP process.
|
2009-03-27 08:14:00 +01:00
|
|
|
When it is in the Dhcp4Selecting state, it tells the EFI DHCPv4 Protocol
|
|
|
|
driver to stop collecting additional packets. The driver will exit
|
|
|
|
the Dhcp4Selecting state and enter the Dhcp4Requesting state.
|
2007-10-16 11:23:09 +02:00
|
|
|
@retval EFI_NOT_READY Only used in the Dhcp4Selecting state. The EFI DHCPv4 Protocol
|
2009-03-27 08:14:00 +01:00
|
|
|
driver will continue to wait for more packets until the retry
|
2007-10-16 11:23:09 +02:00
|
|
|
timeout expires.
|
2007-06-19 12:12:02 +02:00
|
|
|
@retval EFI_ABORTED Tells the EFI DHCPv4 Protocol driver to abort the current process and
|
2007-10-16 11:23:09 +02:00
|
|
|
return to the Dhcp4Init or Dhcp4InitReboot state.
|
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
**/
|
2007-10-16 11:23:09 +02:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_DHCP4_CALLBACK)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_DHCP4_PROTOCOL *This,
|
|
|
|
IN VOID *Context,
|
|
|
|
IN EFI_DHCP4_STATE CurrentState,
|
|
|
|
IN EFI_DHCP4_EVENT Dhcp4Event,
|
2007-10-16 11:23:09 +02:00
|
|
|
IN EFI_DHCP4_PACKET *Packet OPTIONAL,
|
2007-06-19 12:12:02 +02:00
|
|
|
OUT EFI_DHCP4_PACKET **NewPacket OPTIONAL
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef struct {
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2009-03-27 08:14:00 +01:00
|
|
|
/// Number of times to try sending a packet during the Dhcp4SendDiscover
|
|
|
|
/// event and waiting for a response during the Dhcp4RcvdOffer event.
|
2008-11-19 15:23:54 +01:00
|
|
|
/// Set to zero to use the default try counts and timeout values.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
UINT32 DiscoverTryCount;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2009-03-27 08:14:00 +01:00
|
|
|
/// Maximum amount of time (in seconds) to wait for returned packets in each
|
2008-11-19 15:23:54 +01:00
|
|
|
/// of the retries. Timeout values of zero will default to a timeout value
|
|
|
|
/// of one second. Set to NULL to use default timeout values.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT32 *DiscoverTimeout;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2009-03-27 08:14:00 +01:00
|
|
|
/// Number of times to try sending a packet during the Dhcp4SendRequest event
|
|
|
|
/// and waiting for a response during the Dhcp4RcvdAck event before accepting
|
|
|
|
/// failure. Set to zero to use the default try counts and timeout values.
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT32 RequestTryCount;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2009-03-27 08:14:00 +01:00
|
|
|
/// Maximum amount of time (in seconds) to wait for return packets in each of the retries.
|
2008-11-19 15:23:54 +01:00
|
|
|
/// Timeout values of zero will default to a timeout value of one second.
|
|
|
|
/// Set to NULL to use default timeout values.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT32 *RequestTimeout;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2009-03-27 08:14:00 +01:00
|
|
|
/// For a DHCPDISCOVER, setting this parameter to the previously allocated IP
|
|
|
|
/// address will cause the EFI DHCPv4 Protocol driver to enter the Dhcp4InitReboot state.
|
|
|
|
/// And set this field to 0.0.0.0 to enter the Dhcp4Init state.
|
|
|
|
/// For a DHCPINFORM this parameter should be set to the client network address
|
|
|
|
/// which was assigned to the client during a DHCPDISCOVER.
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_IPv4_ADDRESS ClientAddress;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The callback function to intercept various events that occurred in
|
|
|
|
/// the DHCP configuration process. Set to NULL to ignore all those events.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_DHCP4_CALLBACK Dhcp4Callback;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Pointer to the context that will be passed to Dhcp4Callback when it is called.
|
|
|
|
///
|
|
|
|
VOID *CallbackContext;
|
|
|
|
///
|
|
|
|
/// Number of DHCP options in the OptionList.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT32 OptionCount;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2009-03-27 08:14:00 +01:00
|
|
|
/// List of DHCP options to be included in every packet that is sent during the
|
|
|
|
/// Dhcp4SendDiscover event. Pad options are appended automatically by DHCP driver
|
|
|
|
/// in outgoing DHCP packets. If OptionList itself contains pad option, they are
|
|
|
|
/// ignored by the driver. OptionList can be freed after EFI_DHCP4_PROTOCOL.Configure()
|
|
|
|
/// returns. Ignored if OptionCount is zero.
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_DHCP4_PACKET_OPTION **OptionList;
|
|
|
|
} EFI_DHCP4_CONFIG_DATA;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The EFI DHCPv4 Protocol driver operating state.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_DHCP4_STATE State;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The configuration data of the current EFI DHCPv4 Protocol driver instance.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_DHCP4_CONFIG_DATA ConfigData;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The client IP address that was acquired from the DHCP server. If it is zero,
|
|
|
|
/// the DHCP acquisition has not completed yet and the following fields in this structure are undefined.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_IPv4_ADDRESS ClientAddress;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The local hardware address.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_MAC_ADDRESS ClientMacAddress;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The server IP address that is providing the DHCP service to this client.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_IPv4_ADDRESS ServerAddress;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The router IP address that was acquired from the DHCP server.
|
|
|
|
/// May be zero if the server does not offer this address.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_IPv4_ADDRESS RouterAddress;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The subnet mask of the connected network that was acquired from the DHCP server.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_IPv4_ADDRESS SubnetMask;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The lease time (in 1-second units) of the configured IP address.
|
|
|
|
/// The value 0xFFFFFFFF means that the lease time is infinite.
|
|
|
|
/// A default lease of 7 days is used if the DHCP server does not provide a value.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT32 LeaseTime;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The cached latest DHCPACK or DHCPNAK or BOOTP REPLY packet. May be NULL if no packet is cached.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_DHCP4_PACKET *ReplyPacket;
|
|
|
|
} EFI_DHCP4_MODE_DATA;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Alternate listening address. It can be a unicast, multicast, or broadcast address.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_IPv4_ADDRESS ListenAddress;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The subnet mask of above listening unicast/broadcast IP address.
|
|
|
|
/// Ignored if ListenAddress is a multicast address.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_IPv4_ADDRESS SubnetMask;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Alternate station source (or listening) port number.
|
|
|
|
/// If zero, then the default station port number (68) will be used.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT16 ListenPort;
|
|
|
|
} EFI_DHCP4_LISTEN_POINT;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The completion status of transmitting and receiving.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
EFI_STATUS Status;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// If not NULL, the event that will be signaled when the collection process
|
|
|
|
/// completes. If NULL, this function will busy-wait until the collection process competes.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
EFI_EVENT CompletionEvent;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Pointer to the server IP address. This address may be a unicast, multicast, or broadcast address.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
EFI_IPv4_ADDRESS RemoteAddress;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Server listening port number. If zero, the default server listening port number (67) will be used.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
UINT16 RemotePort;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Pointer to the gateway address to override the existing setting.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
EFI_IPv4_ADDRESS GatewayAddress;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// The number of entries in ListenPoints. If zero, the default station address and port number 68 are used.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
UINT32 ListenPointCount;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// An array of station address and port number pairs that are used as receiving filters.
|
|
|
|
/// The first entry is also used as the source address and source port of the outgoing packet.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
EFI_DHCP4_LISTEN_POINT *ListenPoints;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Number of seconds to collect responses. Zero is invalid.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
UINT32 TimeoutValue;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Pointer to the packet to be transmitted.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
EFI_DHCP4_PACKET *Packet;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Number of received packets.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
UINT32 ResponseCount;
|
2008-11-19 15:23:54 +01:00
|
|
|
///
|
|
|
|
/// Pointer to the allocated list of received packets.
|
|
|
|
///
|
2007-10-16 11:23:09 +02:00
|
|
|
EFI_DHCP4_PACKET *ResponseList;
|
2007-06-19 12:12:02 +02:00
|
|
|
} EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.
|
2008-11-14 10:15:28 +01:00
|
|
|
|
|
|
|
The GetModeData() function returns the current operating mode and cached data
|
|
|
|
packet for the EFI DHCPv4 Protocol driver.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
|
|
|
|
@param Dhcp4ModeData Pointer to storage for the EFI_DHCP4_MODE_DATA structure.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The mode data was returned.
|
|
|
|
@retval EFI_INVALID_PARAMETER This is NULL.
|
|
|
|
|
|
|
|
**/
|
2007-10-16 11:23:09 +02:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_DHCP4_GET_MODE_DATA)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_DHCP4_PROTOCOL *This,
|
|
|
|
OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Initializes, changes, or resets the operational settings for the EFI DHCPv4 Protocol driver.
|
|
|
|
|
2008-11-14 10:15:28 +01:00
|
|
|
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.
|
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
|
|
|
|
@param Dhcp4CfgData Pointer to the EFI_DHCP4_CONFIG_DATA.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or
|
|
|
|
Dhcp4InitReboot state, if the original state of this driver
|
2009-03-27 08:14:00 +01:00
|
|
|
was Dhcp4Stopped, Dhcp4Init,Dhcp4InitReboot, or Dhcp4Bound
|
|
|
|
and the value of Dhcp4CfgData was not NULL.
|
|
|
|
Otherwise, the state was left unchanged.
|
2007-06-19 12:12:02 +02:00
|
|
|
@retval 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.
|
2008-11-19 15:23:54 +01:00
|
|
|
@retval 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.
|
2007-06-19 12:12:02 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
|
|
|
|
|
|
|
**/
|
2007-10-16 11:23:09 +02:00
|
|
|
typedef
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_DHCP4_CONFIGURE)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_DHCP4_PROTOCOL *This,
|
|
|
|
IN EFI_DHCP4_CONFIG_DATA *Dhcp4CfgData OPTIONAL
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Starts the DHCP configuration process.
|
|
|
|
|
2008-11-14 10:15:28 +01:00
|
|
|
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.
|
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
|
|
|
|
@param CompletionEvent If not NULL, 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.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The DHCP configuration process has started, or it has completed
|
|
|
|
when CompletionEvent is NULL.
|
|
|
|
@retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped
|
|
|
|
state. EFI_DHCP4_PROTOCOL. Configure() needs to be called.
|
|
|
|
@retval EFI_INVALID_PARAMETER This is NULL.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
|
|
|
@retval EFI_TIMEOUT The DHCP configuration process failed because no response was
|
|
|
|
received from the server within the specified timeout value.
|
|
|
|
@retval EFI_ABORTED The user aborted the DHCP process.
|
|
|
|
@retval EFI_ALREADY_STARTED Some other EFI DHCPv4 Protocol instance already started the
|
|
|
|
DHCP process.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
|
|
|
|
|
|
|
**/
|
2007-10-16 11:23:09 +02:00
|
|
|
typedef
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_DHCP4_START)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_DHCP4_PROTOCOL *This,
|
|
|
|
IN EFI_EVENT CompletionEvent OPTIONAL
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Extends the lease time by sending a request packet.
|
2008-11-14 10:15:28 +01:00
|
|
|
|
|
|
|
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.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
|
|
|
|
@param 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.
|
|
|
|
@param 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.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the
|
|
|
|
Dhcp4Renewing state or is back to the Dhcp4Bound state.
|
|
|
|
@retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped
|
|
|
|
state. EFI_DHCP4_PROTOCOL.Configure() needs to
|
|
|
|
be called.
|
|
|
|
@retval EFI_INVALID_PARAMETER This is NULL.
|
|
|
|
@retval EFI_TIMEOUT There was no response from the server when the try count was
|
|
|
|
exceeded.
|
|
|
|
@retval EFI_ACCESS_DENIED The driver is not in the Dhcp4Bound state.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_DHCP4_RENEW_REBIND)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_DHCP4_PROTOCOL *This,
|
|
|
|
IN BOOLEAN RebindRequest,
|
|
|
|
IN EFI_EVENT CompletionEvent OPTIONAL
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Releases the current address configuration.
|
|
|
|
|
2008-11-14 10:15:28 +01:00
|
|
|
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.
|
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase.
|
|
|
|
@retval EFI_INVALID_PARAMETER This is NULL.
|
|
|
|
@retval EFI_ACCESS_DENIED The EFI DHCPv4 Protocol driver is not Dhcp4InitReboot state.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
|
|
|
|
|
|
|
**/
|
2007-10-16 11:23:09 +02:00
|
|
|
typedef
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_DHCP4_RELEASE)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_DHCP4_PROTOCOL *This
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Stops the current address configuration.
|
2008-11-14 10:15:28 +01:00
|
|
|
|
|
|
|
The Stop() function is used to stop the DHCP configuration process. After this
|
|
|
|
function is called successfully, the EFI DHCPv4 Protocol driver is transferred
|
|
|
|
into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called
|
|
|
|
before DHCP configuration process can be started again. This function can be
|
|
|
|
called when the EFI DHCPv4 Protocol driver is in any state.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
|
2007-10-16 11:23:09 +02:00
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
@retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase.
|
|
|
|
@retval EFI_INVALID_PARAMETER This is NULL.
|
|
|
|
|
|
|
|
**/
|
2007-10-16 11:23:09 +02:00
|
|
|
typedef
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_DHCP4_STOP)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_DHCP4_PROTOCOL *This
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Builds a DHCP packet, given the options to be appended or deleted or replaced.
|
|
|
|
|
2008-11-14 10:15:28 +01:00
|
|
|
The Build() function is used to assemble a new packet from the original packet
|
|
|
|
by replacing or deleting existing options or appending new options. This function
|
|
|
|
does not change any state of the EFI DHCPv4 Protocol driver and can be used at
|
|
|
|
any time.
|
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
|
2008-10-10 06:50:16 +02:00
|
|
|
@param SeedPacket Initial packet to be used as a base for building new packet.
|
2007-06-19 12:12:02 +02:00
|
|
|
@param DeleteCount Number of opcodes in the DeleteList.
|
|
|
|
@param DeleteList List of opcodes to be deleted from the seed packet.
|
|
|
|
Ignored if DeleteCount is zero.
|
|
|
|
@param AppendCount Number of entries in the OptionList.
|
|
|
|
@param AppendList Pointer to a DHCP option list to be appended to SeedPacket.
|
|
|
|
If SeedPacket also contains options in this list, they are
|
|
|
|
replaced by new options (except pad option). Ignored if
|
|
|
|
AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION
|
|
|
|
@param NewPacket Pointer to storage for the pointer to the new allocated packet.
|
|
|
|
Use the EFI Boot Service FreePool() on the resulting pointer
|
|
|
|
when done with the packet.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The new packet was built.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Storage for the new packet could not be allocated.
|
2008-11-19 15:23:54 +01:00
|
|
|
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
|
|
|
|
This is NULL.
|
|
|
|
SeedPacket is NULL.
|
|
|
|
SeedPacket is not a well-formed DHCP packet.
|
|
|
|
AppendCount is not zero and AppendList is NULL.
|
|
|
|
DeleteCount is not zero and DeleteList is NULL.
|
|
|
|
NewPacket is NULL
|
|
|
|
Both DeleteCount and AppendCount are zero and
|
|
|
|
NewPacket is not NULL.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_DHCP4_BUILD)(
|
2007-06-19 12:12:02 +02:00
|
|
|
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
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2008-11-14 10:15:28 +01:00
|
|
|
|
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
/**
|
|
|
|
Transmits a DHCP formatted packet and optionally waits for responses.
|
2008-11-14 10:15:28 +01:00
|
|
|
|
|
|
|
The TransmitReceive() function is used to transmit a DHCP packet and optionally
|
|
|
|
wait for the response from servers. This function does not change the state of
|
|
|
|
the EFI DHCPv4 Protocol driver and thus can be used at any time.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
|
|
|
|
@param Token Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The packet was successfully queued for transmission.
|
2008-11-19 15:23:54 +01:00
|
|
|
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
|
|
|
|
This is NULL.
|
|
|
|
Token.RemoteAddress is zero.
|
|
|
|
Token.Packet is NULL.
|
|
|
|
Token.Packet is not a well-formed DHCP packet.
|
|
|
|
The transaction ID in Token.Packet is in use by another DHCP process.
|
2007-06-19 12:12:02 +02:00
|
|
|
@retval EFI_NOT_READY The previous call to this function has not finished yet. Try to call
|
|
|
|
this function after collection process completes.
|
|
|
|
@retval EFI_NO_MAPPING The default station address is not available yet.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
2008-12-01 15:13:51 +01:00
|
|
|
@retval EFI_UNSUPPORTED The implementation doesn't support this function
|
2007-06-19 12:12:02 +02:00
|
|
|
@retval Others Some other unexpected error occurred.
|
|
|
|
|
|
|
|
**/
|
2007-10-16 11:23:09 +02:00
|
|
|
typedef
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_DHCP4_PROTOCOL *This,
|
|
|
|
IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Parses the packed DHCP option data.
|
2008-11-14 10:15:28 +01:00
|
|
|
|
|
|
|
The Parse() function is used to retrieve the option list from a DHCP packet.
|
2008-12-01 15:13:51 +01:00
|
|
|
If *OptionCount isn't zero, and there is enough space for all the DHCP options
|
2008-11-14 10:15:28 +01:00
|
|
|
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,
|
2009-06-04 07:49:29 +02:00
|
|
|
the caller should reassemble the parsed DHCP options to get the final result.
|
2008-12-01 15:13:51 +01:00
|
|
|
If *OptionCount is zero or there isn't enough space for all of them, the number
|
2008-11-14 10:15:28 +01:00
|
|
|
of DHCP options in the Packet is returned in OptionCount.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
|
|
|
|
@param Packet Pointer to packet to be parsed.
|
|
|
|
@param OptionCount On input, the number of entries in the PacketOptionList.
|
|
|
|
On output, the number of entries that were written into the
|
|
|
|
PacketOptionList.
|
|
|
|
@param PacketOptionList List of packet option entries to be filled in. End option or pad
|
|
|
|
options are not included.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The packet was successfully parsed.
|
2008-11-19 15:23:54 +01:00
|
|
|
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
|
|
|
|
This is NULL.
|
|
|
|
Packet is NULL.
|
|
|
|
Packet is not a well-formed DHCP packet.
|
|
|
|
OptionCount is NULL.
|
2007-06-19 12:12:02 +02:00
|
|
|
@retval 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.
|
2008-11-19 15:23:54 +01:00
|
|
|
@retval EFI_OUT_OF_RESOURCE The packet is failed to parse because of resource shortage.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_DHCP4_PARSE)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_DHCP4_PROTOCOL *This,
|
|
|
|
IN EFI_DHCP4_PACKET *Packet,
|
|
|
|
IN OUT UINT32 *OptionCount,
|
|
|
|
OUT EFI_DHCP4_PACKET_OPTION *PacketOptionList[] OPTIONAL
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2008-10-13 04:54:29 +02:00
|
|
|
///
|
|
|
|
/// This protocol is used to collect configuration information for the EFI IPv4 Protocol drivers
|
|
|
|
/// and to provide DHCPv4 server and PXE boot server discovery services.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
struct _EFI_DHCP4_PROTOCOL {
|
|
|
|
EFI_DHCP4_GET_MODE_DATA GetModeData;
|
|
|
|
EFI_DHCP4_CONFIGURE Configure;
|
|
|
|
EFI_DHCP4_START Start;
|
|
|
|
EFI_DHCP4_RENEW_REBIND RenewRebind;
|
|
|
|
EFI_DHCP4_RELEASE Release;
|
|
|
|
EFI_DHCP4_STOP Stop;
|
|
|
|
EFI_DHCP4_BUILD Build;
|
|
|
|
EFI_DHCP4_TRANSMIT_RECEIVE TransmitReceive;
|
|
|
|
EFI_DHCP4_PARSE Parse;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiDhcp4ProtocolGuid;
|
|
|
|
extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid;
|
|
|
|
|
|
|
|
#endif
|