X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FDhcp4Dxe%2FDhcp4Impl.h;h=ccca4a29af9e5738d091ffcaeea4e0bf65ec40de;hb=479a3b6053bb4c508d7397c65f482e0a8f3c9719;hp=36f3ecb81978155b8fffbaf4217497853dbac477;hpb=434ce3feca7f5a430db3d5853c54a06343d02ed2;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h index 36f3ecb819..ccca4a29af 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h @@ -6,8 +6,8 @@ RFC 1534: Interoperation Between DHCP and BOOTP RFC 3396: Encoding Long Options in DHCP. -Copyright (c) 2006 - 2009, Intel Corporation.
-All rights reserved. This program and the accompanying materials +Copyright (c) 2006 - 2018, Intel Corporation. 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 @@ -26,7 +26,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include - +#include #include #include #include @@ -43,18 +43,19 @@ typedef struct _DHCP_PROTOCOL DHCP_PROTOCOL; #define DHCP_SERVICE_SIGNATURE SIGNATURE_32 ('D', 'H', 'C', 'P') #define DHCP_PROTOCOL_SIGNATURE SIGNATURE_32 ('d', 'h', 'c', 'p') -typedef enum { - // - // The state of the DHCP service. It starts as UNCONFIGED. If - // and active child configures the service successfully, it - // goes to CONFIGED. If the active child configures NULL, it - // goes back to UNCONFIGED. It becomes DESTORY if it is (partly) - // destoried. - // - DHCP_UNCONFIGED = 0, - DHCP_CONFIGED, - DHCP_DESTORY -} DHCP_STATE; +#define DHCP_CHECK_MEDIA_WAITING_TIME EFI_TIMER_PERIOD_SECONDS(20) + +// +// The state of the DHCP service. It starts as UNCONFIGED. If +// and active child configures the service successfully, it +// goes to CONFIGED. If the active child configures NULL, it +// goes back to UNCONFIGED. It becomes DESTROY if it is (partly) +// destroyed. +// +#define DHCP_UNCONFIGED 0 +#define DHCP_CONFIGED 1 +#define DHCP_DESTROY 2 + struct _DHCP_PROTOCOL { UINT32 Signature; @@ -63,14 +64,15 @@ struct _DHCP_PROTOCOL { EFI_HANDLE Handle; DHCP_SERVICE *Service; - BOOLEAN InDestory; + BOOLEAN InDestroy; EFI_EVENT CompletionEvent; EFI_EVENT RenewRebindEvent; EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token; - UDP_IO_PORT *UdpIo; // The UDP IO used for TransmitReceive. + UDP_IO *UdpIo; // The UDP IO used for TransmitReceive. UINT32 Timeout; + UINT16 ElaspedTime; NET_BUF_QUEUE ResponseQueue; }; @@ -82,8 +84,7 @@ struct _DHCP_SERVICE { UINT32 Signature; EFI_SERVICE_BINDING_PROTOCOL ServiceBinding; - INTN ServiceState; // CONFIGED, UNCONFIGED, and DESTORY - BOOLEAN InDestory; + INTN ServiceState; // CONFIGED, UNCONFIGED, and DESTROY EFI_HANDLE Controller; EFI_HANDLE Image; @@ -108,8 +109,8 @@ struct _DHCP_SERVICE { UINT32 T2; INTN ExtraRefresh; // This refresh is reqested by user - UDP_IO_PORT *UdpIo; // Udp child receiving all DHCP message - UDP_IO_PORT *LeaseIoPort; // Udp child with lease IP + UDP_IO *UdpIo; // Udp child receiving all DHCP message + UDP_IO *LeaseIoPort; // Udp child with lease IP EFI_DHCP4_PACKET *LastPacket; // The last sent packet for retransmission EFI_MAC_ADDRESS Mac; UINT8 HwType; @@ -161,7 +162,7 @@ DhcpYieldControl ( /** Complete a Dhcp4 transaction and signal the upper layer. - + @param Instance Dhcp4 instance. **/ @@ -170,4 +171,42 @@ PxeDhcpDone ( IN DHCP_PROTOCOL *Instance ); +/** + Free the resource related to the configure parameters. + DHCP driver will make a copy of the user's configure + such as the time out value. + + @param Config The DHCP configure data + +**/ +VOID +DhcpCleanConfigure ( + IN OUT EFI_DHCP4_CONFIG_DATA *Config + ); + +/** + Callback of Dhcp packet. Does nothing. + + @param Arg The context. + +**/ +VOID +EFIAPI +DhcpDummyExtFree ( + IN VOID *Arg + ); + +/** + Set the elapsed time based on the given instance and the pointer to the + elapsed time option. + + @param[in] Elapsed The pointer to the position to append. + @param[in] Instance The pointer to the Dhcp4 instance. +**/ +VOID +SetElapsedTime ( + IN UINT16 *Elapsed, + IN DHCP_PROTOCOL *Instance + ); + #endif