]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h
1. Sync the latest network stack. Add NetLibCreateIPv4DPathNode () in netlib library.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Io.h
CommitLineData
772db4bb 1/** @file
2
3Copyright (c) 2006, Intel Corporation
4All rights reserved. This program and the accompanying materials
5are licensed and made available under the terms and conditions of the BSD License
6which accompanies this distribution. The full text of the license may be found at
7http://opensource.org/licenses/bsd-license.php
8
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12
13Module Name:
14
15 Dhcp4Io.h
16
17Abstract:
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
37enum {
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,
687a2e5f 66 DHCP_NOTIFY_ALL
772db4bb 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
74EFI_STATUS
75DhcpSetState (
76 IN DHCP_SERVICE *DhcpSb,
77 IN INTN State,
78 IN BOOLEAN CallUser
79 );
80
81EFI_STATUS
82DhcpSendMessage (
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
90VOID
91EFIAPI
92DhcpOnTimerTick (
93 IN EFI_EVENT Event,
94 IN VOID *Context
95 );
96
97VOID
98DhcpInput (
99 NET_BUF *UdpPacket,
100 UDP_POINTS *Points,
101 EFI_STATUS IoStatus,
102 VOID *Context
103 );
104
105EFI_STATUS
106DhcpInitRequest (
107 IN DHCP_SERVICE *DhcpSb
108 );
109
110VOID
111DhcpCleanLease (
112 IN DHCP_SERVICE *DhcpSb
113 );
114
115#endif