+/**\r
+ Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.\r
+ \r
+ The GetModeData() function returns the current operating mode and cached data\r
+ packet for the EFI DHCPv4 Protocol driver.\r
+\r
+ @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+ @param Dhcp4ModeData Pointer to storage for the EFI_DHCP4_MODE_DATA structure.\r
+\r
+ @retval EFI_SUCCESS The mode data was returned.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiDhcp4GetModeData (\r
+ IN EFI_DHCP4_PROTOCOL *This,\r
+ OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData\r
+ );\r
+\r
+/**\r
+ Initializes, changes, or resets the operational settings for the EFI DHCPv4 Protocol driver.\r
+\r
+ The Configure() function is used to initialize, change, or reset the operational\r
+ settings of the EFI DHCPv4 Protocol driver for the communication device on which\r
+ the EFI DHCPv4 Service Binding Protocol is installed. This function can be\r
+ successfully called only if both of the following are true:\r
+ * This instance of the EFI DHCPv4 Protocol driver is in the Dhcp4Stopped, Dhcp4Init,\r
+ Dhcp4InitReboot, or Dhcp4Bound states.\r
+ * No other EFI DHCPv4 Protocol driver instance that is controlled by this EFI\r
+ DHCPv4 Service Binding Protocol driver instance has configured this EFI DHCPv4\r
+ Protocol driver.\r
+ When this driver is in the Dhcp4Stopped state, it can transfer into one of the\r
+ following two possible initial states:\r
+ * Dhcp4Init\r
+ * Dhcp4InitReboot\r
+ The driver can transfer into these states by calling Configure() with a non-NULL\r
+ Dhcp4CfgData. The driver will transfer into the appropriate state based on the\r
+ supplied client network address in the ClientAddress parameter and DHCP options\r
+ in the OptionList parameter as described in RFC 2131.\r
+ When Configure() is called successfully while Dhcp4CfgData is set to NULL, the\r
+ default configuring data will be reset in the EFI DHCPv4 Protocol driver and\r
+ the state of the EFI DHCPv4 Protocol driver will not be changed. If one instance\r
+ wants to make it possible for another instance to configure the EFI DHCPv4 Protocol\r
+ driver, it must call this function with Dhcp4CfgData set to NULL.\r
+\r
+ @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+ @param Dhcp4CfgData Pointer to the EFI_DHCP4_CONFIG_DATA.\r
+\r
+ @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or\r
+ Dhcp4InitReboot state, if the original state of this driver\r
+ was Dhcp4Stopped and the value of Dhcp4CfgData was\r
+ not NULL. Otherwise, the state was left unchanged.\r
+ @retval EFI_ACCESS_DENIED This instance of the EFI DHCPv4 Protocol driver was not in the\r
+ Dhcp4Stopped, Dhcp4Init, Dhcp4InitReboot, or Dhcp4Bound state;\r
+ Or onother instance of this EFI DHCPv4 Protocol driver is already\r
+ in a valid configured state.\r
+ @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiDhcp4Configure (\r
+ IN EFI_DHCP4_PROTOCOL *This,\r
+ IN EFI_DHCP4_CONFIG_DATA *Dhcp4CfgData OPTIONAL\r
+ ); \r
+\r
+/**\r
+ Starts the DHCP configuration process.\r
+\r
+ The Start() function starts the DHCP configuration process. This function can\r
+ be called only when the EFI DHCPv4 Protocol driver is in the Dhcp4Init or\r
+ Dhcp4InitReboot state.\r
+ If the DHCP process completes successfully, the state of the EFI DHCPv4 Protocol\r
+ driver will be transferred through Dhcp4Selecting and Dhcp4Requesting to the\r
+ Dhcp4Bound state. The CompletionEvent will then be signaled if it is not NULL.\r
+ If the process aborts, either by the user or by some unexpected network error,\r
+ the state is restored to the Dhcp4Init state. The Start() function can be called\r
+ again to restart the process.\r
+ Refer to RFC 2131 for precise state transitions during this process. At the\r
+ time when each event occurs in this process, the callback function that was set\r
+ by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this\r
+ opportunity to control the process.\r
+ \r
+ @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+ @param CompletionEvent If not NULL, indicates the event that will be signaled when the\r
+ EFI DHCPv4 Protocol driver is transferred into the\r
+ Dhcp4Bound state or when the DHCP process is aborted.\r
+ EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
+ check the completion status. If NULL,\r
+ EFI_DHCP4_PROTOCOL.Start() will wait until the driver\r
+ is transferred into the Dhcp4Bound state or the process fails.\r
+\r
+ @retval EFI_SUCCESS The DHCP configuration process has started, or it has completed\r
+ when CompletionEvent is NULL.\r
+ @retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped\r
+ state. EFI_DHCP4_PROTOCOL. Configure() needs to be called.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
+ @retval EFI_TIMEOUT The DHCP configuration process failed because no response was\r
+ received from the server within the specified timeout value.\r
+ @retval EFI_ABORTED The user aborted the DHCP process.\r
+ @retval EFI_ALREADY_STARTED Some other EFI DHCPv4 Protocol instance already started the\r
+ DHCP process.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiDhcp4Start (\r
+ IN EFI_DHCP4_PROTOCOL *This,\r
+ IN EFI_EVENT CompletionEvent OPTIONAL\r
+ );\r
+\r
+/**\r
+ Extends the lease time by sending a request packet.\r
+ \r
+ The RenewRebind() function is used to manually extend the lease time when the\r
+ EFI DHCPv4 Protocol driver is in the Dhcp4Bound state and the lease time has\r
+ not expired yet. This function will send a request packet to the previously\r
+ found server (or to any server when RebindRequest is TRUE) and transfer the\r
+ state into the Dhcp4Renewing state (or Dhcp4Rebinding when RebindingRequest is\r
+ TRUE). When a response is received, the state is returned to Dhcp4Bound.\r
+ If no response is received before the try count is exceeded (the RequestTryCount\r
+ field that is specified in EFI_DHCP4_CONFIG_DATA) but before the lease time that\r
+ was issued by the previous server expires, the driver will return to the Dhcp4Bound\r
+ state and the previous configuration is restored. The outgoing and incoming packets\r
+ can be captured by the EFI_DHCP4_CALLBACK function.\r
+\r
+ @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+ @param RebindRequest If TRUE, this function broadcasts the request packets and enters\r
+ the Dhcp4Rebinding state. Otherwise, it sends a unicast\r
+ request packet and enters the Dhcp4Renewing state.\r
+ @param CompletionEvent If not NULL, this event is signaled when the renew/rebind phase\r
+ completes or some error occurs.\r
+ EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
+ check the completion status. If NULL,\r
+ EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait\r
+ until the DHCP process finishes.\r
+\r
+ @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the\r
+ Dhcp4Renewing state or is back to the Dhcp4Bound state.\r
+ @retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped\r
+ state. EFI_DHCP4_PROTOCOL.Configure() needs to\r
+ be called.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_TIMEOUT There was no response from the server when the try count was\r
+ exceeded.\r
+ @retval EFI_ACCESS_DENIED The driver is not in the Dhcp4Bound state.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiDhcp4RenewRebind (\r
+ IN EFI_DHCP4_PROTOCOL *This,\r
+ IN BOOLEAN RebindRequest,\r
+ IN EFI_EVENT CompletionEvent OPTIONAL\r
+ );\r
+\r
+/**\r
+ Releases the current address configuration.\r
+\r
+ The Release() function releases the current configured IP address by doing either\r
+ of the following:\r
+ * Sending a DHCPRELEASE packet when the EFI DHCPv4 Protocol driver is in the\r
+ Dhcp4Bound state\r
+ * Setting the previously assigned IP address that was provided with the\r
+ EFI_DHCP4_PROTOCOL.Configure() function to 0.0.0.0 when the driver is in\r
+ Dhcp4InitReboot state\r
+ After a successful call to this function, the EFI DHCPv4 Protocol driver returns\r
+ to the Dhcp4Init state and any subsequent incoming packets will be discarded silently.\r
+\r
+ @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+\r
+ @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_ACCESS_DENIED The EFI DHCPv4 Protocol driver is not Dhcp4InitReboot state.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiDhcp4Release (\r
+ IN EFI_DHCP4_PROTOCOL *This\r
+ );\r
+\r
+/**\r
+ Stops the current address configuration.\r
+ \r
+ The Stop() function is used to stop the DHCP configuration process. After this\r
+ function is called successfully, the EFI DHCPv4 Protocol driver is transferred\r
+ into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called\r
+ before DHCP configuration process can be started again. This function can be\r
+ called when the EFI DHCPv4 Protocol driver is in any state.\r
+\r
+ @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+\r
+ @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiDhcp4Stop (\r
+ IN EFI_DHCP4_PROTOCOL *This\r
+ );\r
+\r
+/**\r
+ Builds a DHCP packet, given the options to be appended or deleted or replaced.\r
+\r
+ The Build() function is used to assemble a new packet from the original packet\r
+ by replacing or deleting existing options or appending new options. This function\r
+ does not change any state of the EFI DHCPv4 Protocol driver and can be used at\r
+ any time.\r
+\r
+ @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+ @param SeedPacket Initial packet to be used as a base for building new packet.\r
+ @param DeleteCount Number of opcodes in the DeleteList.\r
+ @param DeleteList List of opcodes to be deleted from the seed packet.\r
+ Ignored if DeleteCount is zero.\r
+ @param AppendCount Number of entries in the OptionList.\r
+ @param AppendList Pointer to a DHCP option list to be appended to SeedPacket.\r
+ If SeedPacket also contains options in this list, they are\r
+ replaced by new options (except pad option). Ignored if\r
+ AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION\r
+ @param NewPacket Pointer to storage for the pointer to the new allocated packet.\r
+ Use the EFI Boot Service FreePool() on the resulting pointer\r
+ when done with the packet.\r
+\r
+ @retval EFI_SUCCESS The new packet was built.\r
+ @retval EFI_OUT_OF_RESOURCES Storage for the new packet could not be allocated.\r
+ @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiDhcp4Build (\r
+ IN EFI_DHCP4_PROTOCOL *This,\r
+ IN EFI_DHCP4_PACKET *SeedPacket,\r
+ IN UINT32 DeleteCount,\r
+ IN UINT8 *DeleteList OPTIONAL,\r
+ IN UINT32 AppendCount,\r
+ IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL,\r
+ OUT EFI_DHCP4_PACKET **NewPacket\r
+ );\r
+ \r
+ /**\r
+ Transmits a DHCP formatted packet and optionally waits for responses.\r
+ \r
+ The TransmitReceive() function is used to transmit a DHCP packet and optionally\r
+ wait for the response from servers. This function does not change the state of\r
+ the EFI DHCPv4 Protocol driver and thus can be used at any time.\r
+\r
+ @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+ @param Token Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.\r
+\r
+ @retval EFI_SUCCESS The packet was successfully queued for transmission.\r
+ @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+ @retval EFI_NOT_READY The previous call to this function has not finished yet. Try to call\r
+ this function after collection process completes.\r
+ @retval EFI_NO_MAPPING The default station address is not available yet.\r
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
+ @retval Others Some other unexpected error occurred.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiDhcp4TransmitReceive (\r
+ IN EFI_DHCP4_PROTOCOL *This,\r
+ IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ Parses the packed DHCP option data.\r
+ \r
+ The Parse() function is used to retrieve the option list from a DHCP packet.\r
+ If *OptionCount isn’t zero, and there is enough space for all the DHCP options\r
+ in the Packet, each element of PacketOptionList is set to point to somewhere in\r
+ the Packet->Dhcp4.Option where a new DHCP option begins. If RFC3396 is supported,\r
+ the caller should reassemble the parsed DHCP options to get the finial result.\r
+ If *OptionCount is zero or there isn’t enough space for all of them, the number\r
+ of DHCP options in the Packet is returned in OptionCount.\r
+\r
+ @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+ @param Packet Pointer to packet to be parsed.\r
+ @param OptionCount On input, the number of entries in the PacketOptionList.\r
+ On output, the number of entries that were written into the\r
+ PacketOptionList.\r
+ @param PacketOptionList List of packet option entries to be filled in. End option or pad\r
+ options are not included.\r
+\r
+ @retval EFI_SUCCESS The packet was successfully parsed.\r
+ @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+ @retval EFI_BUFFER_TOO_SMALL One or more of the following conditions is TRUE:\r
+ 1) *OptionCount is smaller than the number of options that\r
+ were found in the Packet.\r
+ 2) PacketOptionList is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiDhcp4Parse (\r
+ IN EFI_DHCP4_PROTOCOL *This,\r
+ IN EFI_DHCP4_PACKET *Packet,\r
+ IN OUT UINT32 *OptionCount,\r
+ OUT EFI_DHCP4_PACKET_OPTION *PacketOptionList[] OPTIONAL\r
+ );\r
+\r
+EFI_DHCP4_PROTOCOL mDhcp4ProtocolTemplate = {\r
+ EfiDhcp4GetModeData,\r
+ EfiDhcp4Configure,\r
+ EfiDhcp4Start,\r
+ EfiDhcp4RenewRebind,\r
+ EfiDhcp4Release,\r
+ EfiDhcp4Stop,\r
+ EfiDhcp4Build,\r
+ EfiDhcp4TransmitReceive,\r
+ EfiDhcp4Parse\r
+};\r