]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h
Update to support to produce Component Name and & Component Name 2 protocol based...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Io.h
1 /** @file
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12
13 Module Name:
14
15 Dhcp4Io.h
16
17 Abstract:
18
19 The DHCP4 protocol implementation.
20
21
22 **/
23
24 #ifndef __EFI_DHCP4_IO_H__
25 #define __EFI_DHCP4_IO_H__
26
27 #include <PiDxe.h>
28
29 #include <Protocol/ServiceBinding.h>
30
31 #include <Library/NetLib.h>
32 #include <Library/UdpIoLib.h>
33 #include <Library/BaseMemoryLib.h>
34 #include <Library/MemoryAllocationLib.h>
35
36
37 enum {
38 DHCP_WAIT_OFFER = 3, // Time to wait the offers
39 DHCP_DEFAULT_LEASE = 7 *24 *60 *60, // Seven days as default.
40 DHCP_SERVER_PORT = 67,
41 DHCP_CLIENT_PORT = 68,
42
43 //
44 // BOOTP header "op" field
45 //
46 BOOTP_REQUEST = 1,
47 BOOTP_REPLY = 2,
48
49 //
50 // DHCP message types
51 //
52 DHCP_MSG_DISCOVER = 1,
53 DHCP_MSG_OFFER = 2,
54 DHCP_MSG_REQUEST = 3,
55 DHCP_MSG_DECLINE = 4,
56 DHCP_MSG_ACK = 5,
57 DHCP_MSG_NAK = 6,
58 DHCP_MSG_RELEASE = 7,
59 DHCP_MSG_INFORM = 8,
60
61 //
62 // DHCP notify user type
63 //
64 DHCP_NOTIFY_COMPLETION = 1,
65 DHCP_NOTIFY_RENEWREBIND,
66 DHCP_NOTIFY_ALL
67 };
68
69 #define DHCP_IS_BOOTP(Parameter) (((Parameter) == NULL) || ((Parameter)->DhcpType == 0))
70
71 #define DHCP_CONNECTED(State) \
72 (((State) == Dhcp4Bound) || ((State) == (Dhcp4Renewing)) || ((State) == Dhcp4Rebinding))
73
74 EFI_STATUS
75 DhcpSetState (
76 IN DHCP_SERVICE *DhcpSb,
77 IN INTN State,
78 IN BOOLEAN CallUser
79 );
80
81 EFI_STATUS
82 DhcpSendMessage (
83 IN DHCP_SERVICE *DhcpSb,
84 IN EFI_DHCP4_PACKET *Seed,
85 IN DHCP_PARAMETER *Para,
86 IN UINT8 Type,
87 IN UINT8 *Msg
88 );
89
90 VOID
91 EFIAPI
92 DhcpOnTimerTick (
93 IN EFI_EVENT Event,
94 IN VOID *Context
95 );
96
97 VOID
98 DhcpInput (
99 NET_BUF *UdpPacket,
100 UDP_POINTS *Points,
101 EFI_STATUS IoStatus,
102 VOID *Context
103 );
104
105 EFI_STATUS
106 DhcpInitRequest (
107 IN DHCP_SERVICE *DhcpSb
108 );
109
110 VOID
111 DhcpCleanLease (
112 IN DHCP_SERVICE *DhcpSb
113 );
114
115 #endif