X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FDhcp4Dxe%2FDhcp4Io.h;h=f51575278138bd83f2f87124e132337895a9cede;hb=d1102dba7210b95e41d06c2338a22ba6af248645;hp=4dab42e9a7440b060d690ce7c10e1474688d2a5c;hpb=f92046412a466c208adbeb5e09e511a3a5e2ae31;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h index 4dab42e9a7..f515752781 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h @@ -1,7 +1,8 @@ /** @file + The DHCP4 protocol implementation. -Copyright (c) 2006 - 2008, 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 @@ -9,22 +10,12 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - Dhcp4Io.h - -Abstract: - - The DHCP4 protocol implementation. - - **/ #ifndef __EFI_DHCP4_IO_H__ #define __EFI_DHCP4_IO_H__ -#include +#include #include @@ -40,36 +31,30 @@ Abstract: #define DHCP_SERVER_PORT 67 #define DHCP_CLIENT_PORT 68 -typedef enum { - // - // BOOTP header "op" field - // - BOOTP_REQUEST = 1, - BOOTP_REPLY = 2 -} DHCP_OP_TYPE; - -typedef enum { - // - // DHCP message types - // - DHCP_MSG_DISCOVER = 1, - DHCP_MSG_OFFER = 2, - DHCP_MSG_REQUEST = 3, - DHCP_MSG_DECLINE = 4, - DHCP_MSG_ACK = 5, - DHCP_MSG_NAK = 6, - DHCP_MSG_RELEASE = 7, - DHCP_MSG_INFORM = 8 -} DHCP_MSG_TYPE; - -typedef enum { - // - // DHCP notify user type - // - DHCP_NOTIFY_COMPLETION = 1, - DHCP_NOTIFY_RENEWREBIND, - DHCP_NOTIFY_ALL -} DHCP_NOTIFY_TYPE; +// +// BOOTP header "op" field +// +#define BOOTP_REQUEST 1 +#define BOOTP_REPLY 2 + +// +// DHCP message types +// +#define DHCP_MSG_DISCOVER 1 +#define DHCP_MSG_OFFER 2 +#define DHCP_MSG_REQUEST 3 +#define DHCP_MSG_DECLINE 4 +#define DHCP_MSG_ACK 5 +#define DHCP_MSG_NAK 6 +#define DHCP_MSG_RELEASE 7 +#define DHCP_MSG_INFORM 8 + +// +// DHCP notify user type +// +#define DHCP_NOTIFY_COMPLETION 1 +#define DHCP_NOTIFY_RENEWREBIND 2 +#define DHCP_NOTIFY_ALL 3 #define DHCP_IS_BOOTP(Parameter) (((Parameter) == NULL) || ((Parameter)->DhcpType == 0)) @@ -93,9 +78,9 @@ typedef enum { **/ EFI_STATUS DhcpSetState ( - IN DHCP_SERVICE *DhcpSb, - IN INTN State, - IN BOOLEAN CallUser + IN OUT DHCP_SERVICE *DhcpSb, + IN INTN State, + IN BOOLEAN CallUser ); /** @@ -104,16 +89,17 @@ DhcpSetState ( the state (as defined in Figure 5. of the same RFC) before sending a DHCP message. The table is adjusted accordingly. - @param DhcpSb The DHCP service instance - @param Seed The seed packet which the new packet is based on - @param Para The DHCP parameter of the Seed packet - @param Type The message type to send - @param Msg The human readable message to include in the packet - sent. + @param[in] DhcpSb The DHCP service instance + @param[in] Seed The seed packet which the new packet is based on + @param[in] Para The DHCP parameter of the Seed packet + @param[in] Type The message type to send + @param[in] Msg The human readable message to include in the packet + sent. @retval EFI_OUT_OF_RESOURCES Failed to allocate resources for the packet @retval EFI_ACCESS_DENIED Failed to transmit the packet through UDP @retval EFI_SUCCESS The message is sent + @retval other Other error occurs **/ EFI_STATUS @@ -132,10 +118,8 @@ DhcpSendMessage ( and lease to determine the time to renew and rebind the lease. DhcpOnTimerTick will be called once every second. - @param Event The timer event - @param Context The context, which is the DHCP service instance. - - @return None + @param[in] Event The timer event + @param[in] Context The context, which is the DHCP service instance. **/ VOID @@ -146,21 +130,20 @@ DhcpOnTimerTick ( ); /** - Handle the received DHCP packets. This function drivers the DHCP + Handle the received DHCP packets. This function drives the DHCP state machine. @param UdpPacket The UDP packets received. - @param Points The local/remote UDP access points + @param EndPoint The local/remote UDP access point @param IoStatus The status of the UDP receive @param Context The opaque parameter to the function. - @return None - **/ VOID +EFIAPI DhcpInput ( NET_BUF *UdpPacket, - UDP_POINTS *Points, + UDP_END_POINT *EndPoint, EFI_STATUS IoStatus, VOID *Context ); @@ -169,9 +152,10 @@ DhcpInput ( Send an initial DISCOVER or REQUEST message according to the DHCP service's current state. - @param DhcpSb The DHCP service instance + @param[in] DhcpSb The DHCP service instance @retval EFI_SUCCESS The request has been sent + @retval other Some error occurs when sending the request. **/ EFI_STATUS @@ -184,8 +168,6 @@ DhcpInitRequest ( @param DhcpSb The DHCP instance service. - @return None - **/ VOID DhcpCleanLease ( @@ -196,17 +178,16 @@ DhcpCleanLease ( Release the net buffer when packet is sent. @param UdpPacket The UDP packets received. - @param Points The local/remote UDP access points + @param EndPoint The local/remote UDP access point @param IoStatus The status of the UDP receive @param Context The opaque parameter to the function. - @return None - **/ VOID +EFIAPI DhcpOnPacketSent ( NET_BUF *Packet, - UDP_POINTS *Points, + UDP_END_POINT *EndPoint, EFI_STATUS IoStatus, VOID *Context );