TianoCore EDK2 master
Loading...
Searching...
No Matches
Dhcp4Option.h
Go to the documentation of this file.
1
9#ifndef __EFI_DHCP4_OPTION_H__
10#define __EFI_DHCP4_OPTION_H__
11
15
16#define DHCP_OPTION_MAGIC 0x63538263 // Network byte order
17#define DHCP_MAX_OPTIONS 256
18
19//
20// DHCP option types, this is used to validate the DHCP options.
21//
22#define DHCP_OPTION_SWITCH 1
23#define DHCP_OPTION_INT8 2
24#define DHCP_OPTION_INT16 3
25#define DHCP_OPTION_INT32 4
26#define DHCP_OPTION_IP 5
27#define DHCP_OPTION_IPPAIR 6
28
29//
30// Value of DHCP overload option
31//
32#define DHCP_OVERLOAD_FILENAME 1
33#define DHCP_OVERLOAD_SVRNAME 2
34#define DHCP_OVERLOAD_BOTH 3
35
40typedef struct {
41 UINT8 Tag;
42 UINT16 Len;
43 UINT8 *Data;
45
49typedef struct {
50 UINT8 Index;
51 UINT16 Offset;
53
54typedef struct {
55 DHCP_OPTION_COUNT *OpCount;
56 DHCP_OPTION *Options;
57 UINT8 *Buf;
59
65typedef struct {
66 IP4_ADDR NetMask; // DHCP4_TAG_NETMASK
67 IP4_ADDR Router; // DHCP4_TAG_ROUTER, only the first router is used
68
69 //
70 // DHCP specific options
71 //
72 UINT8 DhcpType; // DHCP4_TAG_MSG_TYPE
73 UINT8 Overload; // DHCP4_TAG_OVERLOAD
74 IP4_ADDR ServerId; // DHCP4_TAG_SERVER_ID
75 UINT32 Lease; // DHCP4_TAG_LEASE
76 UINT32 T1; // DHCP4_TAG_T1
77 UINT32 T2; // DHCP4_TAG_T2
79
88typedef struct {
89 UINT8 Tag;
90 INTN Type;
91 INTN MinOccur;
92 INTN MaxOccur;
93 BOOLEAN Alert;
95
96typedef
98(*DHCP_CHECK_OPTION) (
99 IN UINT8 Tag,
100 IN UINT8 Len,
101 IN UINT8 *Data,
102 IN VOID *Context
103 );
104
122 IN EFI_DHCP4_PACKET *Packet,
123 IN DHCP_CHECK_OPTION Check OPTIONAL,
124 IN VOID *Context
125 );
126
141 IN EFI_DHCP4_PACKET *Packet,
142 OUT DHCP_PARAMETER **Para OPTIONAL
143 );
144
175 IN EFI_DHCP4_PACKET *Packet,
176 OUT INTN *Count,
177 OUT DHCP_OPTION **OptionPoint
178 );
179
192UINT8 *
194 OUT UINT8 *Buf,
195 IN UINT8 Tag,
196 IN UINT16 DataLen,
197 IN UINT8 *Data
198 );
199
218DhcpBuild (
219 IN EFI_DHCP4_PACKET *SeedPacket,
220 IN UINT32 DeleteCount,
221 IN UINT8 *DeleteList OPTIONAL,
222 IN UINT32 AppendCount,
223 IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL,
224 OUT EFI_DHCP4_PACKET **NewPacket
225 );
226
227#endif
INT64 INTN
EFI_STATUS DhcpParseOption(IN EFI_DHCP4_PACKET *Packet, OUT INTN *Count, OUT DHCP_OPTION **OptionPoint)
Definition: Dhcp4Option.c:541
EFI_STATUS DhcpBuild(IN EFI_DHCP4_PACKET *SeedPacket, IN UINT32 DeleteCount, IN UINT8 *DeleteList OPTIONAL, IN UINT32 AppendCount, IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL, OUT EFI_DHCP4_PACKET **NewPacket)
Definition: Dhcp4Option.c:770
EFI_STATUS DhcpIterateOptions(IN EFI_DHCP4_PACKET *Packet, IN DHCP_CHECK_OPTION Check OPTIONAL, IN VOID *Context)
Definition: Dhcp4Option.c:382
EFI_STATUS DhcpValidateOptions(IN EFI_DHCP4_PACKET *Packet, OUT DHCP_PARAMETER **Para OPTIONAL)
Definition: Dhcp4Option.c:641
UINT8 * DhcpAppendOption(OUT UINT8 *Buf, IN UINT8 Tag, IN UINT16 DataLen, IN UINT8 *Data)
Definition: Dhcp4Option.c:727
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29