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