소스 검색

[efi] Add definitions of GUIDs observed when chainloading from Intel driver

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 년 전
부모
커밋
a48a71b720

+ 387
- 0
src/include/ipxe/efi/Protocol/Arp.h 파일 보기

@@ -0,0 +1,387 @@
1
+/** @file
2
+  EFI ARP Protocol Definition
3
+
4
+  The EFI ARP Service Binding Protocol is used to locate EFI
5
+  ARP Protocol drivers to create and destroy child of the
6
+  driver to communicate with other host using ARP protocol.
7
+  The EFI ARP Protocol provides services to map IP network
8
+  address to hardware address used by a data link protocol.
9
+
10
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
11
+This program and the accompanying materials are licensed and made available under
12
+the terms and conditions of the BSD License that accompanies this distribution.
13
+The full text of the license may be found at
14
+http://opensource.org/licenses/bsd-license.php.
15
+
16
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
17
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18
+
19
+  @par Revision Reference:
20
+  This Protocol was introduced in UEFI Specification 2.0.
21
+
22
+**/
23
+
24
+#ifndef __EFI_ARP_PROTOCOL_H__
25
+#define __EFI_ARP_PROTOCOL_H__
26
+
27
+FILE_LICENCE ( BSD3 );
28
+
29
+#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \
30
+  { \
31
+    0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 } \
32
+  }
33
+
34
+#define EFI_ARP_PROTOCOL_GUID \
35
+  { \
36
+    0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } \
37
+  }
38
+
39
+typedef struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL;
40
+
41
+typedef struct {
42
+  ///
43
+  /// Length in bytes of this entry.
44
+  ///
45
+  UINT32                      Size;
46
+
47
+  ///
48
+  /// Set to TRUE if this entry is a "deny" entry.
49
+  /// Set to FALSE if this entry is a "normal" entry.
50
+  ///
51
+  BOOLEAN                     DenyFlag;
52
+
53
+  ///
54
+  /// Set to TRUE if this entry will not time out.
55
+  /// Set to FALSE if this entry will time out.
56
+  ///
57
+  BOOLEAN                     StaticFlag;
58
+
59
+  ///
60
+  /// 16-bit ARP hardware identifier number.
61
+  ///
62
+  UINT16                      HwAddressType;
63
+
64
+  ///
65
+  /// 16-bit protocol type number.
66
+  ///
67
+  UINT16                      SwAddressType;
68
+
69
+  ///
70
+  /// The length of the hardware address.
71
+  ///
72
+  UINT8                       HwAddressLength;
73
+
74
+  ///
75
+  /// The length of the protocol address.
76
+  ///
77
+  UINT8                       SwAddressLength;
78
+} EFI_ARP_FIND_DATA;
79
+
80
+typedef struct {
81
+  ///
82
+  /// 16-bit protocol type number in host byte order.
83
+  ///
84
+  UINT16                    SwAddressType;
85
+
86
+  ///
87
+  /// The length in bytes of the station's protocol address to register.
88
+  ///
89
+  UINT8                     SwAddressLength;
90
+
91
+  ///
92
+  /// The pointer to the first byte of the protocol address to register. For
93
+  /// example, if SwAddressType is 0x0800 (IP), then
94
+  /// StationAddress points to the first byte of this station's IP
95
+  /// address stored in network byte order.
96
+  ///
97
+  VOID                      *StationAddress;
98
+
99
+  ///
100
+  /// The timeout value in 100-ns units that is associated with each
101
+  /// new dynamic ARP cache entry. If it is set to zero, the value is
102
+  /// implementation-specific.
103
+  ///
104
+  UINT32                    EntryTimeOut;
105
+
106
+  ///
107
+  /// The number of retries before a MAC address is resolved. If it is
108
+  /// set to zero, the value is implementation-specific.
109
+  ///
110
+  UINT32                    RetryCount;
111
+
112
+  ///
113
+  /// The timeout value in 100-ns units that is used to wait for the ARP
114
+  /// reply packet or the timeout value between two retries. Set to zero
115
+  /// to use implementation-specific value.
116
+  ///
117
+  UINT32                    RetryTimeOut;
118
+} EFI_ARP_CONFIG_DATA;
119
+
120
+
121
+/**
122
+  This function is used to assign a station address to the ARP cache for this instance
123
+  of the ARP driver.
124
+
125
+  Each ARP instance has one station address. The EFI_ARP_PROTOCOL driver will
126
+  respond to ARP requests that match this registered station address. A call to
127
+  this function with the ConfigData field set to NULL will reset this ARP instance.
128
+
129
+  Once a protocol type and station address have been assigned to this ARP instance,
130
+  all the following ARP functions will use this information. Attempting to change
131
+  the protocol type or station address to a configured ARP instance will result in errors.
132
+
133
+  @param  This                   The pointer to the EFI_ARP_PROTOCOL instance.
134
+  @param  ConfigData             The pointer to the EFI_ARP_CONFIG_DATA structure.
135
+
136
+  @retval EFI_SUCCESS            The new station address was successfully
137
+                                 registered.
138
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:
139
+                                 * This is NULL.
140
+                                 * SwAddressLength is zero when ConfigData is not NULL.
141
+                                 * StationAddress is NULL when ConfigData is not NULL.
142
+  @retval EFI_ACCESS_DENIED      The SwAddressType, SwAddressLength, or
143
+                                 StationAddress is different from the one that is
144
+                                 already registered.
145
+  @retval EFI_OUT_OF_RESOURCES   Storage for the new StationAddress could not be
146
+                                 allocated.
147
+
148
+**/
149
+typedef
150
+EFI_STATUS
151
+(EFIAPI *EFI_ARP_CONFIGURE)(
152
+  IN EFI_ARP_PROTOCOL       *This,
153
+  IN EFI_ARP_CONFIG_DATA    *ConfigData   OPTIONAL
154
+  );
155
+
156
+/**
157
+  This function is used to insert entries into the ARP cache.
158
+
159
+  ARP cache entries are typically inserted and updated by network protocol drivers
160
+  as network traffic is processed. Most ARP cache entries will time out and be
161
+  deleted if the network traffic stops. ARP cache entries that were inserted
162
+  by the Add() function may be static (will not time out) or dynamic (will time out).
163
+  Default ARP cache timeout values are not covered in most network protocol
164
+  specifications (although RFC 1122 comes pretty close) and will only be
165
+  discussed in general terms in this specification. The timeout values that are
166
+  used in the EFI Sample Implementation should be used only as a guideline.
167
+  Final product implementations of the EFI network stack should be tuned for
168
+  their expected network environments.
169
+
170
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.
171
+  @param  DenyFlag               Set to TRUE if this entry is a deny entry. Set to
172
+                                 FALSE if this  entry is a normal entry.
173
+  @param  TargetSwAddress        Pointer to a protocol address to add (or deny).
174
+                                 May be set to NULL if DenyFlag is TRUE.
175
+  @param  TargetHwAddress        Pointer to a hardware address to add (or deny).
176
+                                 May be set to NULL if DenyFlag is TRUE.
177
+  @param  TimeoutValue           Time in 100-ns units that this entry will remain
178
+                                 in the ARP cache. A value of zero means that the
179
+                                 entry is permanent. A nonzero value will override
180
+                                 the one given by Configure() if the entry to be
181
+                                 added is a dynamic entry.
182
+  @param  Overwrite              If TRUE, the matching cache entry will be
183
+                                 overwritten with the supplied parameters. If
184
+                                 FALSE, EFI_ACCESS_DENIED is returned if the
185
+                                 corresponding cache entry already exists.
186
+
187
+  @retval EFI_SUCCESS            The entry has been added or updated.
188
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:
189
+                                 * This is NULL.
190
+                                 * DenyFlag is FALSE and TargetHwAddress is NULL.
191
+                                 * DenyFlag is FALSE and TargetSwAddress is NULL.
192
+                                 * TargetHwAddress is NULL and TargetSwAddress is NULL.
193
+                                 * Neither TargetSwAddress nor TargetHwAddress are NULL when DenyFlag is
194
+                                 TRUE.
195
+  @retval EFI_OUT_OF_RESOURCES   The new ARP cache entry could not be allocated.
196
+  @retval EFI_ACCESS_DENIED      The ARP cache entry already exists and Overwrite
197
+                                 is not true.
198
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.
199
+
200
+**/
201
+typedef
202
+EFI_STATUS
203
+(EFIAPI *EFI_ARP_ADD)(
204
+  IN EFI_ARP_PROTOCOL       *This,
205
+  IN BOOLEAN                DenyFlag,
206
+  IN VOID                   *TargetSwAddress  OPTIONAL,
207
+  IN VOID                   *TargetHwAddress  OPTIONAL,
208
+  IN UINT32                 TimeoutValue,
209
+  IN BOOLEAN                Overwrite
210
+  );
211
+
212
+/**
213
+  This function searches the ARP cache for matching entries and allocates a buffer into
214
+  which those entries are copied.
215
+
216
+  The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which
217
+  are protocol address pairs and hardware address pairs.
218
+  When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer
219
+  is not NULL), the ARP cache timeout for the found entry is reset if Refresh is
220
+  set to TRUE. If the found ARP cache entry is a permanent entry, it is not
221
+  affected by Refresh.
222
+
223
+  @param  This                   The pointer to the EFI_ARP_PROTOCOL instance.
224
+  @param  BySwAddress            Set to TRUE to look for matching software protocol
225
+                                 addresses. Set to FALSE to look for matching
226
+                                 hardware protocol addresses.
227
+  @param  AddressBuffer          The pointer to the address buffer. Set to NULL
228
+                                 to match all addresses.
229
+  @param  EntryLength            The size of an entry in the entries buffer.
230
+  @param  EntryCount             The number of ARP cache entries that are found by
231
+                                 the specified criteria.
232
+  @param  Entries                The pointer to the buffer that will receive the ARP
233
+                                 cache entries.
234
+  @param  Refresh                Set to TRUE to refresh the timeout value of the
235
+                                 matching ARP cache entry.
236
+
237
+  @retval EFI_SUCCESS            The requested ARP cache entries were copied into
238
+                                 the buffer.
239
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:
240
+                                 This is NULL. Both EntryCount and EntryLength are
241
+                                 NULL, when Refresh is FALSE.
242
+  @retval EFI_NOT_FOUND          No matching entries were found.
243
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.
244
+
245
+**/
246
+typedef
247
+EFI_STATUS
248
+(EFIAPI *EFI_ARP_FIND)(
249
+  IN EFI_ARP_PROTOCOL       *This,
250
+  IN BOOLEAN                BySwAddress,
251
+  IN VOID                   *AddressBuffer    OPTIONAL,
252
+  OUT UINT32                *EntryLength      OPTIONAL,
253
+  OUT UINT32                *EntryCount       OPTIONAL,
254
+  OUT EFI_ARP_FIND_DATA     **Entries         OPTIONAL,
255
+  IN BOOLEAN                Refresh
256
+  );
257
+
258
+
259
+/**
260
+  This function removes specified ARP cache entries.
261
+
262
+  @param  This                   The pointer to the EFI_ARP_PROTOCOL instance.
263
+  @param  BySwAddress            Set to TRUE to delete matching protocol addresses.
264
+                                 Set to FALSE to delete matching hardware
265
+                                 addresses.
266
+  @param  AddressBuffer          The pointer to the address buffer that is used as a
267
+                                 key to look for the cache entry. Set to NULL to
268
+                                 delete all entries.
269
+
270
+  @retval EFI_SUCCESS            The entry was removed from the ARP cache.
271
+  @retval EFI_INVALID_PARAMETER  This is NULL.
272
+  @retval EFI_NOT_FOUND          The specified deletion key was not found.
273
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.
274
+
275
+**/
276
+typedef
277
+EFI_STATUS
278
+(EFIAPI *EFI_ARP_DELETE)(
279
+  IN EFI_ARP_PROTOCOL       *This,
280
+  IN BOOLEAN                BySwAddress,
281
+  IN VOID                   *AddressBuffer   OPTIONAL
282
+  );
283
+
284
+/**
285
+  This function delete all dynamic entries from the ARP cache that match the specified
286
+  software protocol type.
287
+
288
+  @param  This                   The pointer to the EFI_ARP_PROTOCOL instance.
289
+
290
+  @retval EFI_SUCCESS            The cache has been flushed.
291
+  @retval EFI_INVALID_PARAMETER  This is NULL.
292
+  @retval EFI_NOT_FOUND          There are no matching dynamic cache entries.
293
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.
294
+
295
+**/
296
+typedef
297
+EFI_STATUS
298
+(EFIAPI *EFI_ARP_FLUSH)(
299
+  IN EFI_ARP_PROTOCOL       *This
300
+  );
301
+
302
+/**
303
+  This function tries to resolve the TargetSwAddress and optionally returns a
304
+  TargetHwAddress if it already exists in the ARP cache.
305
+
306
+  @param  This                   The pointer to the EFI_ARP_PROTOCOL instance.
307
+  @param  TargetSwAddress        The pointer to the protocol address to resolve.
308
+  @param  ResolvedEvent          The pointer to the event that will be signaled when
309
+                                 the address is resolved or some error occurs.
310
+  @param  TargetHwAddress        The pointer to the buffer for the resolved hardware
311
+                                 address in network byte order.
312
+
313
+  @retval EFI_SUCCESS            The data is copied from the ARP cache into the
314
+                                 TargetHwAddress buffer.
315
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:
316
+                                 This is NULL. TargetHwAddress is NULL.
317
+  @retval EFI_ACCESS_DENIED      The requested address is not present in the normal
318
+                                 ARP cache but is present in the deny address list.
319
+                                 Outgoing traffic to that address is forbidden.
320
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.
321
+  @retval EFI_NOT_READY          The request has been started and is not finished.
322
+
323
+**/
324
+typedef
325
+EFI_STATUS
326
+(EFIAPI *EFI_ARP_REQUEST)(
327
+  IN EFI_ARP_PROTOCOL       *This,
328
+  IN VOID                   *TargetSwAddress  OPTIONAL,
329
+  IN EFI_EVENT              ResolvedEvent     OPTIONAL,
330
+  OUT VOID                  *TargetHwAddress
331
+  );
332
+
333
+/**
334
+  This function aborts the previous ARP request (identified by This, TargetSwAddress
335
+  and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request().
336
+
337
+  If the request is in the internal ARP request queue, the request is aborted
338
+  immediately and its ResolvedEvent is signaled. Only an asynchronous address
339
+  request needs to be canceled. If TargeSwAddress and ResolveEvent are both
340
+  NULL, all the pending asynchronous requests that have been issued by This
341
+  instance will be cancelled and their corresponding events will be signaled.
342
+
343
+  @param  This                   The pointer to the EFI_ARP_PROTOCOL instance.
344
+  @param  TargetSwAddress        The pointer to the protocol address in previous
345
+                                 request session.
346
+  @param  ResolvedEvent          Pointer to the event that is used as the
347
+                                 notification event in previous request session.
348
+
349
+  @retval EFI_SUCCESS            The pending request session(s) is/are aborted and
350
+                                 corresponding event(s) is/are signaled.
351
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:
352
+                                 This is NULL. TargetSwAddress is not NULL and
353
+                                 ResolvedEvent is NULL. TargetSwAddress is NULL and
354
+                                 ResolvedEvent is not NULL.
355
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.
356
+  @retval EFI_NOT_FOUND          The request is not issued by
357
+                                 EFI_ARP_PROTOCOL.Request().
358
+
359
+
360
+**/
361
+typedef
362
+EFI_STATUS
363
+(EFIAPI *EFI_ARP_CANCEL)(
364
+  IN EFI_ARP_PROTOCOL       *This,
365
+  IN VOID                   *TargetSwAddress  OPTIONAL,
366
+  IN EFI_EVENT              ResolvedEvent     OPTIONAL
367
+  );
368
+
369
+///
370
+/// ARP is used to resolve local network protocol addresses into
371
+/// network hardware addresses.
372
+///
373
+struct _EFI_ARP_PROTOCOL {
374
+  EFI_ARP_CONFIGURE         Configure;
375
+  EFI_ARP_ADD               Add;
376
+  EFI_ARP_FIND              Find;
377
+  EFI_ARP_DELETE            Delete;
378
+  EFI_ARP_FLUSH             Flush;
379
+  EFI_ARP_REQUEST           Request;
380
+  EFI_ARP_CANCEL            Cancel;
381
+};
382
+
383
+
384
+extern EFI_GUID gEfiArpServiceBindingProtocolGuid;
385
+extern EFI_GUID gEfiArpProtocolGuid;
386
+
387
+#endif

+ 782
- 0
src/include/ipxe/efi/Protocol/Dhcp4.h 파일 보기

@@ -0,0 +1,782 @@
1
+/** @file
2
+  EFI_DHCP4_PROTOCOL as defined in UEFI 2.0.
3
+  EFI_DHCP4_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
4
+  These protocols are used to collect configuration information for the EFI IPv4 Protocol
5
+  drivers and to provide DHCPv4 server and PXE boot server discovery services.
6
+
7
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
8
+This program and the accompanying materials are licensed and made available under
9
+the terms and conditions of the BSD License that accompanies this distribution.
10
+The full text of the license may be found at
11
+http://opensource.org/licenses/bsd-license.php.
12
+
13
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
+
16
+  @par Revision Reference:
17
+  This Protocol was introduced in UEFI Specification 2.0.
18
+
19
+**/
20
+
21
+#ifndef __EFI_DHCP4_PROTOCOL_H__
22
+#define __EFI_DHCP4_PROTOCOL_H__
23
+
24
+FILE_LICENCE ( BSD3 );
25
+
26
+#define EFI_DHCP4_PROTOCOL_GUID \
27
+  { \
28
+    0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } \
29
+  }
30
+
31
+#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \
32
+  { \
33
+    0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } \
34
+  }
35
+
36
+typedef struct _EFI_DHCP4_PROTOCOL EFI_DHCP4_PROTOCOL;
37
+
38
+
39
+#pragma pack(1)
40
+typedef struct {
41
+  ///
42
+  /// DHCP option code.
43
+  ///
44
+  UINT8               OpCode;
45
+  ///
46
+  /// Length of the DHCP option data. Not present if OpCode is 0 or 255.
47
+  ///
48
+  UINT8               Length;
49
+  ///
50
+  /// Start of the DHCP option data. Not present if OpCode is 0 or 255 or if Length is zero.
51
+  ///
52
+  UINT8               Data[1];
53
+} EFI_DHCP4_PACKET_OPTION;
54
+#pragma pack()
55
+
56
+
57
+#pragma pack(1)
58
+///
59
+/// EFI_DHCP4_PACKET defines the format of DHCPv4 packets. See RFC 2131 for more information.
60
+///
61
+typedef struct {
62
+  UINT8             OpCode;
63
+  UINT8             HwType;
64
+  UINT8             HwAddrLen;
65
+  UINT8             Hops;
66
+  UINT32            Xid;
67
+  UINT16            Seconds;
68
+  UINT16            Reserved;
69
+  EFI_IPv4_ADDRESS  ClientAddr;       ///< Client IP address from client.
70
+  EFI_IPv4_ADDRESS  YourAddr;         ///< Client IP address from server.
71
+  EFI_IPv4_ADDRESS  ServerAddr;       ///< IP address of next server in bootstrap.
72
+  EFI_IPv4_ADDRESS  GatewayAddr;      ///< Relay agent IP address.
73
+  UINT8             ClientHwAddr[16]; ///< Client hardware address.
74
+  CHAR8             ServerName[64];
75
+  CHAR8             BootFileName[128];
76
+}EFI_DHCP4_HEADER;
77
+#pragma pack()
78
+
79
+
80
+#pragma pack(1)
81
+typedef struct {
82
+  ///
83
+  /// Size of the EFI_DHCP4_PACKET buffer.
84
+  ///
85
+  UINT32              Size;
86
+  ///
87
+  /// Length of the EFI_DHCP4_PACKET from the first byte of the Header field
88
+  /// to the last byte of the Option[] field.
89
+  ///
90
+  UINT32              Length;
91
+
92
+  struct {
93
+    ///
94
+    /// DHCP packet header.
95
+    ///
96
+    EFI_DHCP4_HEADER  Header;
97
+    ///
98
+    /// DHCP magik cookie in network byte order.
99
+    ///
100
+    UINT32            Magik;
101
+    ///
102
+    /// Start of the DHCP packed option data.
103
+    ///
104
+    UINT8             Option[1];
105
+  } Dhcp4;
106
+} EFI_DHCP4_PACKET;
107
+#pragma pack()
108
+
109
+
110
+typedef enum {
111
+  ///
112
+  /// The EFI DHCPv4 Protocol driver is stopped.
113
+  ///
114
+  Dhcp4Stopped        = 0x0,
115
+  ///
116
+  /// The EFI DHCPv4 Protocol driver is inactive.
117
+  ///
118
+  Dhcp4Init           = 0x1,
119
+  ///
120
+  /// The EFI DHCPv4 Protocol driver is collecting DHCP offer packets from DHCP servers.
121
+  ///
122
+  Dhcp4Selecting      = 0x2,
123
+  ///
124
+  /// The EFI DHCPv4 Protocol driver has sent the request to the DHCP server and is waiting for a response.
125
+  ///
126
+  Dhcp4Requesting     = 0x3,
127
+  ///
128
+  /// The DHCP configuration has completed.
129
+  ///
130
+  Dhcp4Bound          = 0x4,
131
+  ///
132
+  /// The DHCP configuration is being renewed and another request has
133
+  /// been sent out, but it has not received a response from the server yet.
134
+  ///
135
+  Dhcp4Renewing       = 0x5,
136
+  ///
137
+  /// The DHCP configuration has timed out and the EFI DHCPv4
138
+  /// Protocol driver is trying to extend the lease time.
139
+  ///
140
+  Dhcp4Rebinding      = 0x6,
141
+  ///
142
+  /// The EFI DHCPv4 Protocol driver was initialized with a previously
143
+  /// allocated or known IP address.
144
+  ///
145
+  Dhcp4InitReboot     = 0x7,
146
+  ///
147
+  /// The EFI DHCPv4 Protocol driver is seeking to reuse the previously
148
+  /// allocated IP address by sending a request to the DHCP server.
149
+  ///
150
+  Dhcp4Rebooting      = 0x8
151
+} EFI_DHCP4_STATE;
152
+
153
+
154
+typedef enum{
155
+  ///
156
+  /// The packet to start the configuration sequence is about to be sent.
157
+  ///
158
+  Dhcp4SendDiscover   = 0x01,
159
+  ///
160
+  /// A reply packet was just received.
161
+  ///
162
+  Dhcp4RcvdOffer      = 0x02,
163
+  ///
164
+  /// It is time for Dhcp4Callback to select an offer.
165
+  ///
166
+  Dhcp4SelectOffer    = 0x03,
167
+  ///
168
+  /// A request packet is about to be sent.
169
+  ///
170
+  Dhcp4SendRequest    = 0x04,
171
+  ///
172
+  /// A DHCPACK packet was received and will be passed to Dhcp4Callback.
173
+  ///
174
+  Dhcp4RcvdAck        = 0x05,
175
+  ///
176
+  /// A DHCPNAK packet was received and will be passed to Dhcp4Callback.
177
+  ///
178
+  Dhcp4RcvdNak        = 0x06,
179
+  ///
180
+  /// A decline packet is about to be sent.
181
+  ///
182
+  Dhcp4SendDecline    = 0x07,
183
+  ///
184
+  /// The DHCP configuration process has completed. No packet is associated with this event.
185
+  ///
186
+  Dhcp4BoundCompleted = 0x08,
187
+  ///
188
+  /// It is time to enter the Dhcp4Renewing state and to contact the server
189
+  /// that originally issued the network address. No packet is associated with this event.
190
+  ///
191
+  Dhcp4EnterRenewing  = 0x09,
192
+  ///
193
+  /// It is time to enter the Dhcp4Rebinding state and to contact any server.
194
+  /// No packet is associated with this event.
195
+  ///
196
+  Dhcp4EnterRebinding = 0x0a,
197
+  ///
198
+  /// The configured IP address was lost either because the lease has expired,
199
+  /// the user released the configuration, or a DHCPNAK packet was received in
200
+  /// the Dhcp4Renewing or Dhcp4Rebinding state. No packet is associated with this event.
201
+  ///
202
+  Dhcp4AddressLost    = 0x0b,
203
+  ///
204
+  /// The DHCP process failed because a DHCPNAK packet was received or the user
205
+  /// aborted the DHCP process at a time when the configuration was not available yet.
206
+  /// No packet is associated with this event.
207
+  ///
208
+  Dhcp4Fail           = 0x0c
209
+} EFI_DHCP4_EVENT;
210
+
211
+/**
212
+  Callback routine.
213
+
214
+  EFI_DHCP4_CALLBACK is provided by the consumer of the EFI DHCPv4 Protocol driver
215
+  to intercept events that occurred in the configuration process. This structure
216
+  provides advanced control of each state transition of the DHCP process. The
217
+  returned status code determines the behavior of the EFI DHCPv4 Protocol driver.
218
+  There are three possible returned values, which are described in the following
219
+  table.
220
+
221
+  @param  This                  The pointer to the EFI DHCPv4 Protocol instance that is used to
222
+                                configure this callback function.
223
+  @param  Context               The pointer to the context that is initialized by
224
+                                EFI_DHCP4_PROTOCOL.Configure().
225
+  @param  CurrentState          The current operational state of the EFI DHCPv4 Protocol
226
+                                driver.
227
+  @param  Dhcp4Event            The event that occurs in the current state, which usually means a
228
+                                state transition.
229
+  @param  Packet                The DHCP packet that is going to be sent or already received.
230
+  @param  NewPacket             The packet that is used to replace the above Packet.
231
+
232
+  @retval EFI_SUCCESS           Tells the EFI DHCPv4 Protocol driver to continue the DHCP process.
233
+                                When it is in the Dhcp4Selecting state, it tells the EFI DHCPv4 Protocol
234
+                                driver to stop collecting additional packets. The driver will exit
235
+                                the Dhcp4Selecting state and enter the Dhcp4Requesting state.
236
+  @retval EFI_NOT_READY         Only used in the Dhcp4Selecting state. The EFI DHCPv4 Protocol
237
+                                driver will continue to wait for more packets until the retry
238
+                                timeout expires.
239
+  @retval EFI_ABORTED           Tells the EFI DHCPv4 Protocol driver to abort the current process and
240
+                                return to the Dhcp4Init or Dhcp4InitReboot state.
241
+
242
+**/
243
+typedef
244
+EFI_STATUS
245
+(EFIAPI *EFI_DHCP4_CALLBACK)(
246
+  IN  EFI_DHCP4_PROTOCOL         *This,
247
+  IN  VOID                       *Context,
248
+  IN  EFI_DHCP4_STATE            CurrentState,
249
+  IN  EFI_DHCP4_EVENT            Dhcp4Event,
250
+  IN  EFI_DHCP4_PACKET           *Packet     OPTIONAL,
251
+  OUT EFI_DHCP4_PACKET           **NewPacket OPTIONAL
252
+  );
253
+
254
+typedef struct {
255
+  ///
256
+  /// The number of times to try sending a packet during the Dhcp4SendDiscover
257
+  /// event and waiting for a response during the Dhcp4RcvdOffer event.
258
+  /// Set to zero to use the default try counts and timeout values.
259
+  ///
260
+  UINT32                      DiscoverTryCount;
261
+  ///
262
+  /// The maximum amount of time (in seconds) to wait for returned packets in each
263
+  /// of the retries. Timeout values of zero will default to a timeout value
264
+  /// of one second. Set to NULL to use default timeout values.
265
+  ///
266
+  UINT32                      *DiscoverTimeout;
267
+  ///
268
+  /// The number of times to try sending a packet during the Dhcp4SendRequest event
269
+  /// and waiting for a response during the Dhcp4RcvdAck event before accepting
270
+  /// failure. Set to zero to use the default try counts and timeout values.
271
+  ///
272
+  UINT32                      RequestTryCount;
273
+  ///
274
+  /// The maximum amount of time (in seconds) to wait for return packets in each of the retries.
275
+  /// Timeout values of zero will default to a timeout value of one second.
276
+  /// Set to NULL to use default timeout values.
277
+  ///
278
+  UINT32                      *RequestTimeout;
279
+  ///
280
+  /// For a DHCPDISCOVER, setting this parameter to the previously allocated IP
281
+  /// address will cause the EFI DHCPv4 Protocol driver to enter the Dhcp4InitReboot state.
282
+  /// And set this field to 0.0.0.0 to enter the Dhcp4Init state.
283
+  /// For a DHCPINFORM this parameter should be set to the client network address
284
+  /// which was assigned to the client during a DHCPDISCOVER.
285
+  ///
286
+  EFI_IPv4_ADDRESS            ClientAddress;
287
+  ///
288
+  /// The callback function to intercept various events that occurred in
289
+  /// the DHCP configuration process. Set to NULL to ignore all those events.
290
+  ///
291
+  EFI_DHCP4_CALLBACK          Dhcp4Callback;
292
+  ///
293
+  /// The pointer to the context that will be passed to Dhcp4Callback when it is called.
294
+  ///
295
+  VOID                        *CallbackContext;
296
+  ///
297
+  /// Number of DHCP options in the OptionList.
298
+  ///
299
+  UINT32                      OptionCount;
300
+  ///
301
+  /// List of DHCP options to be included in every packet that is sent during the
302
+  /// Dhcp4SendDiscover event. Pad options are appended automatically by DHCP driver
303
+  /// in outgoing DHCP packets. If OptionList itself contains pad option, they are
304
+  /// ignored by the driver. OptionList can be freed after EFI_DHCP4_PROTOCOL.Configure()
305
+  /// returns. Ignored if OptionCount is zero.
306
+  ///
307
+  EFI_DHCP4_PACKET_OPTION     **OptionList;
308
+} EFI_DHCP4_CONFIG_DATA;
309
+
310
+
311
+typedef struct {
312
+  ///
313
+  /// The EFI DHCPv4 Protocol driver operating state.
314
+  ///
315
+  EFI_DHCP4_STATE             State;
316
+  ///
317
+  /// The configuration data of the current EFI DHCPv4 Protocol driver instance.
318
+  ///
319
+  EFI_DHCP4_CONFIG_DATA       ConfigData;
320
+  ///
321
+  /// The client IP address that was acquired from the DHCP server. If it is zero,
322
+  /// the DHCP acquisition has not completed yet and the following fields in this structure are undefined.
323
+  ///
324
+  EFI_IPv4_ADDRESS            ClientAddress;
325
+  ///
326
+  /// The local hardware address.
327
+  ///
328
+  EFI_MAC_ADDRESS             ClientMacAddress;
329
+  ///
330
+  /// The server IP address that is providing the DHCP service to this client.
331
+  ///
332
+  EFI_IPv4_ADDRESS            ServerAddress;
333
+  ///
334
+  /// The router IP address that was acquired from the DHCP server.
335
+  /// May be zero if the server does not offer this address.
336
+  ///
337
+  EFI_IPv4_ADDRESS            RouterAddress;
338
+  ///
339
+  /// The subnet mask of the connected network that was acquired from the DHCP server.
340
+  ///
341
+  EFI_IPv4_ADDRESS            SubnetMask;
342
+  ///
343
+  /// The lease time (in 1-second units) of the configured IP address.
344
+  /// The value 0xFFFFFFFF means that the lease time is infinite.
345
+  /// A default lease of 7 days is used if the DHCP server does not provide a value.
346
+  ///
347
+  UINT32                      LeaseTime;
348
+  ///
349
+  /// The cached latest DHCPACK or DHCPNAK or BOOTP REPLY packet. May be NULL if no packet is cached.
350
+  ///
351
+  EFI_DHCP4_PACKET            *ReplyPacket;
352
+} EFI_DHCP4_MODE_DATA;
353
+
354
+
355
+typedef struct {
356
+  ///
357
+  /// Alternate listening address. It can be a unicast, multicast, or broadcast address.
358
+  ///
359
+  EFI_IPv4_ADDRESS            ListenAddress;
360
+  ///
361
+  /// The subnet mask of above listening unicast/broadcast IP address.
362
+  /// Ignored if ListenAddress is a multicast address.
363
+  ///
364
+  EFI_IPv4_ADDRESS            SubnetMask;
365
+  ///
366
+  /// Alternate station source (or listening) port number.
367
+  /// If zero, then the default station port number (68) will be used.
368
+  ///
369
+  UINT16                      ListenPort;
370
+} EFI_DHCP4_LISTEN_POINT;
371
+
372
+
373
+typedef struct {
374
+  ///
375
+  /// The completion status of transmitting and receiving.
376
+  ///
377
+  EFI_STATUS              Status;
378
+  ///
379
+  /// If not NULL, the event that will be signaled when the collection process
380
+  /// completes. If NULL, this function will busy-wait until the collection process competes.
381
+  ///
382
+  EFI_EVENT               CompletionEvent;
383
+  ///
384
+  /// The pointer to the server IP address. This address may be a unicast, multicast, or broadcast address.
385
+  ///
386
+  EFI_IPv4_ADDRESS        RemoteAddress;
387
+  ///
388
+  /// The server listening port number. If zero, the default server listening port number (67) will be used.
389
+  ///
390
+  UINT16                  RemotePort;
391
+  ///
392
+  /// The pointer to the gateway address to override the existing setting.
393
+  ///
394
+  EFI_IPv4_ADDRESS        GatewayAddress;
395
+  ///
396
+  /// The number of entries in ListenPoints. If zero, the default station address and port number 68 are used.
397
+  ///
398
+  UINT32                  ListenPointCount;
399
+  ///
400
+  /// An array of station address and port number pairs that are used as receiving filters.
401
+  /// The first entry is also used as the source address and source port of the outgoing packet.
402
+  ///
403
+  EFI_DHCP4_LISTEN_POINT  *ListenPoints;
404
+  ///
405
+  /// The number of seconds to collect responses. Zero is invalid.
406
+  ///
407
+  UINT32                  TimeoutValue;
408
+  ///
409
+  /// The pointer to the packet to be transmitted.
410
+  ///
411
+  EFI_DHCP4_PACKET        *Packet;
412
+  ///
413
+  /// Number of received packets.
414
+  ///
415
+  UINT32                  ResponseCount;
416
+  ///
417
+  /// The pointer to the allocated list of received packets.
418
+  ///
419
+  EFI_DHCP4_PACKET        *ResponseList;
420
+} EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN;
421
+
422
+
423
+/**
424
+  Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.
425
+
426
+  The GetModeData() function returns the current operating mode and cached data
427
+  packet for the EFI DHCPv4 Protocol driver.
428
+
429
+  @param  This          The pointer to the EFI_DHCP4_PROTOCOL instance.
430
+  @param  Dhcp4ModeData The pointer to storage for the EFI_DHCP4_MODE_DATA structure.
431
+
432
+  @retval EFI_SUCCESS           The mode data was returned.
433
+  @retval EFI_INVALID_PARAMETER This is NULL.
434
+
435
+**/
436
+typedef
437
+EFI_STATUS
438
+(EFIAPI *EFI_DHCP4_GET_MODE_DATA)(
439
+  IN  EFI_DHCP4_PROTOCOL      *This,
440
+  OUT EFI_DHCP4_MODE_DATA     *Dhcp4ModeData
441
+  );
442
+
443
+/**
444
+  Initializes, changes, or resets the operational settings for the EFI DHCPv4 Protocol driver.
445
+
446
+  The Configure() function is used to initialize, change, or reset the operational
447
+  settings of the EFI DHCPv4 Protocol driver for the communication device on which
448
+  the EFI DHCPv4 Service Binding Protocol is installed. This function can be
449
+  successfully called only if both of the following are true:
450
+  * This instance of the EFI DHCPv4 Protocol driver is in the Dhcp4Stopped, Dhcp4Init,
451
+    Dhcp4InitReboot, or Dhcp4Bound states.
452
+  * No other EFI DHCPv4 Protocol driver instance that is controlled by this EFI
453
+    DHCPv4 Service Binding Protocol driver instance has configured this EFI DHCPv4
454
+    Protocol driver.
455
+  When this driver is in the Dhcp4Stopped state, it can transfer into one of the
456
+  following two possible initial states:
457
+  * Dhcp4Init
458
+  * Dhcp4InitReboot.
459
+  The driver can transfer into these states by calling Configure() with a non-NULL
460
+  Dhcp4CfgData. The driver will transfer into the appropriate state based on the
461
+  supplied client network address in the ClientAddress parameter and DHCP options
462
+  in the OptionList parameter as described in RFC 2131.
463
+  When Configure() is called successfully while Dhcp4CfgData is set to NULL, the
464
+  default configuring data will be reset in the EFI DHCPv4 Protocol driver and
465
+  the state of the EFI DHCPv4 Protocol driver will not be changed. If one instance
466
+  wants to make it possible for another instance to configure the EFI DHCPv4 Protocol
467
+  driver, it must call this function with Dhcp4CfgData set to NULL.
468
+
469
+  @param  This                   The pointer to the EFI_DHCP4_PROTOCOL instance.
470
+  @param  Dhcp4CfgData           The pointer to the EFI_DHCP4_CONFIG_DATA.
471
+
472
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or
473
+                                Dhcp4InitReboot state, if the original state of this driver
474
+                                was Dhcp4Stopped, Dhcp4Init,Dhcp4InitReboot, or Dhcp4Bound
475
+                                and the value of Dhcp4CfgData was not NULL.
476
+                                Otherwise, the state was left unchanged.
477
+  @retval EFI_ACCESS_DENIED     This instance of the EFI DHCPv4 Protocol driver was not in the
478
+                                Dhcp4Stopped, Dhcp4Init, Dhcp4InitReboot, or Dhcp4Bound state;
479
+                                Or onother instance of this EFI DHCPv4 Protocol driver is already
480
+                                in a valid configured state.
481
+  @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
482
+                                This is NULL.
483
+                                DiscoverTryCount > 0 and DiscoverTimeout is NULL
484
+                                RequestTryCount > 0 and RequestTimeout is NULL.
485
+                                OptionCount >0 and OptionList is NULL.
486
+                                ClientAddress is not a valid unicast address.
487
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.
488
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
489
+
490
+**/
491
+typedef
492
+EFI_STATUS
493
+(EFIAPI *EFI_DHCP4_CONFIGURE)(
494
+  IN EFI_DHCP4_PROTOCOL       *This,
495
+  IN EFI_DHCP4_CONFIG_DATA    *Dhcp4CfgData  OPTIONAL
496
+  );
497
+
498
+
499
+/**
500
+  Starts the DHCP configuration process.
501
+
502
+  The Start() function starts the DHCP configuration process. This function can
503
+  be called only when the EFI DHCPv4 Protocol driver is in the Dhcp4Init or
504
+  Dhcp4InitReboot state.
505
+  If the DHCP process completes successfully, the state of the EFI DHCPv4 Protocol
506
+  driver will be transferred through Dhcp4Selecting and Dhcp4Requesting to the
507
+  Dhcp4Bound state. The CompletionEvent will then be signaled if it is not NULL.
508
+  If the process aborts, either by the user or by some unexpected network error,
509
+  the state is restored to the Dhcp4Init state. The Start() function can be called
510
+  again to restart the process.
511
+  Refer to RFC 2131 for precise state transitions during this process. At the
512
+  time when each event occurs in this process, the callback function that was set
513
+  by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this
514
+  opportunity to control the process.
515
+
516
+  @param  This            The pointer to the EFI_DHCP4_PROTOCOL instance.
517
+  @param  CompletionEvent If not NULL, it indicates the event that will be signaled when the
518
+                          EFI DHCPv4 Protocol driver is transferred into the
519
+                          Dhcp4Bound state or when the DHCP process is aborted.
520
+                          EFI_DHCP4_PROTOCOL.GetModeData() can be called to
521
+                          check the completion status. If NULL,
522
+                          EFI_DHCP4_PROTOCOL.Start() will wait until the driver
523
+                          is transferred into the Dhcp4Bound state or the process fails.
524
+
525
+  @retval EFI_SUCCESS           The DHCP configuration process has started, or it has completed
526
+                                when CompletionEvent is NULL.
527
+  @retval EFI_NOT_STARTED       The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped
528
+                                state. EFI_DHCP4_PROTOCOL. Configure() needs to be called.
529
+  @retval EFI_INVALID_PARAMETER This is NULL.
530
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.
531
+  @retval EFI_TIMEOUT           The DHCP configuration process failed because no response was
532
+                                received from the server within the specified timeout value.
533
+  @retval EFI_ABORTED           The user aborted the DHCP process.
534
+  @retval EFI_ALREADY_STARTED   Some other EFI DHCPv4 Protocol instance already started the
535
+                                DHCP process.
536
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
537
+  @retval EFI_NO_MEDIA          There was a media error.
538
+
539
+**/
540
+typedef
541
+EFI_STATUS
542
+(EFIAPI *EFI_DHCP4_START)(
543
+  IN EFI_DHCP4_PROTOCOL       *This,
544
+  IN EFI_EVENT                CompletionEvent   OPTIONAL
545
+  );
546
+
547
+/**
548
+  Extends the lease time by sending a request packet.
549
+
550
+  The RenewRebind() function is used to manually extend the lease time when the
551
+  EFI DHCPv4 Protocol driver is in the Dhcp4Bound state, and the lease time has
552
+  not expired yet. This function will send a request packet to the previously
553
+  found server (or to any server when RebindRequest is TRUE) and transfer the
554
+  state into the Dhcp4Renewing state (or Dhcp4Rebinding when RebindingRequest is
555
+  TRUE). When a response is received, the state is returned to Dhcp4Bound.
556
+  If no response is received before the try count is exceeded (the RequestTryCount
557
+  field that is specified in EFI_DHCP4_CONFIG_DATA) but before the lease time that
558
+  was issued by the previous server expires, the driver will return to the Dhcp4Bound
559
+  state, and the previous configuration is restored. The outgoing and incoming packets
560
+  can be captured by the EFI_DHCP4_CALLBACK function.
561
+
562
+  @param  This            The pointer to the EFI_DHCP4_PROTOCOL instance.
563
+  @param  RebindRequest   If TRUE, this function broadcasts the request packets and enters
564
+                          the Dhcp4Rebinding state. Otherwise, it sends a unicast
565
+                          request packet and enters the Dhcp4Renewing state.
566
+  @param  CompletionEvent If not NULL, this event is signaled when the renew/rebind phase
567
+                          completes or some error occurs.
568
+                          EFI_DHCP4_PROTOCOL.GetModeData() can be called to
569
+                          check the completion status. If NULL,
570
+                          EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait
571
+                          until the DHCP process finishes.
572
+
573
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the
574
+                                Dhcp4Renewing state or is back to the Dhcp4Bound state.
575
+  @retval EFI_NOT_STARTED       The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped
576
+                                state. EFI_DHCP4_PROTOCOL.Configure() needs to
577
+                                be called.
578
+  @retval EFI_INVALID_PARAMETER This is NULL.
579
+  @retval EFI_TIMEOUT           There was no response from the server when the try count was
580
+                                exceeded.
581
+  @retval EFI_ACCESS_DENIED     The driver is not in the Dhcp4Bound state.
582
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
583
+
584
+**/
585
+typedef
586
+EFI_STATUS
587
+(EFIAPI *EFI_DHCP4_RENEW_REBIND)(
588
+  IN EFI_DHCP4_PROTOCOL       *This,
589
+  IN BOOLEAN                  RebindRequest,
590
+  IN EFI_EVENT                CompletionEvent  OPTIONAL
591
+  );
592
+
593
+/**
594
+  Releases the current address configuration.
595
+
596
+  The Release() function releases the current configured IP address by doing either
597
+  of the following:
598
+  * Sending a DHCPRELEASE packet when the EFI DHCPv4 Protocol driver is in the
599
+    Dhcp4Bound state
600
+  * Setting the previously assigned IP address that was provided with the
601
+    EFI_DHCP4_PROTOCOL.Configure() function to 0.0.0.0 when the driver is in
602
+    Dhcp4InitReboot state
603
+  After a successful call to this function, the EFI DHCPv4 Protocol driver returns
604
+  to the Dhcp4Init state, and any subsequent incoming packets will be discarded silently.
605
+
606
+  @param  This                  The pointer to the EFI_DHCP4_PROTOCOL instance.
607
+
608
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase.
609
+  @retval EFI_INVALID_PARAMETER This is NULL.
610
+  @retval EFI_ACCESS_DENIED     The EFI DHCPv4 Protocol driver is not Dhcp4InitReboot state.
611
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
612
+
613
+**/
614
+typedef
615
+EFI_STATUS
616
+(EFIAPI *EFI_DHCP4_RELEASE)(
617
+  IN EFI_DHCP4_PROTOCOL       *This
618
+  );
619
+
620
+/**
621
+  Stops the current address configuration.
622
+
623
+  The Stop() function is used to stop the DHCP configuration process. After this
624
+  function is called successfully, the EFI DHCPv4 Protocol driver is transferred
625
+  into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called
626
+  before DHCP configuration process can be started again. This function can be
627
+  called when the EFI DHCPv4 Protocol driver is in any state.
628
+
629
+  @param  This                  The pointer to the EFI_DHCP4_PROTOCOL instance.
630
+
631
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase.
632
+  @retval EFI_INVALID_PARAMETER This is NULL.
633
+
634
+**/
635
+typedef
636
+EFI_STATUS
637
+(EFIAPI *EFI_DHCP4_STOP)(
638
+  IN EFI_DHCP4_PROTOCOL       *This
639
+  );
640
+
641
+/**
642
+  Builds a DHCP packet, given the options to be appended or deleted or replaced.
643
+
644
+  The Build() function is used to assemble a new packet from the original packet
645
+  by replacing or deleting existing options or appending new options. This function
646
+  does not change any state of the EFI DHCPv4 Protocol driver and can be used at
647
+  any time.
648
+
649
+  @param  This        The pointer to the EFI_DHCP4_PROTOCOL instance.
650
+  @param  SeedPacket  Initial packet to be used as a base for building new packet.
651
+  @param  DeleteCount Number of opcodes in the DeleteList.
652
+  @param  DeleteList  List of opcodes to be deleted from the seed packet.
653
+                      Ignored if DeleteCount is zero.
654
+  @param  AppendCount Number of entries in the OptionList.
655
+  @param  AppendList  The pointer to a DHCP option list to be appended to SeedPacket.
656
+                      If SeedPacket also contains options in this list, they are
657
+                      replaced by new options (except pad option). Ignored if
658
+                      AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION
659
+  @param  NewPacket   The pointer to storage for the pointer to the new allocated packet.
660
+                      Use the EFI Boot Service FreePool() on the resulting pointer
661
+                      when done with the packet.
662
+
663
+  @retval EFI_SUCCESS           The new packet was built.
664
+  @retval EFI_OUT_OF_RESOURCES  Storage for the new packet could not be allocated.
665
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
666
+                                This is NULL.
667
+                                SeedPacket is NULL.
668
+                                SeedPacket is not a well-formed DHCP packet.
669
+                                AppendCount is not zero and AppendList is NULL.
670
+                                DeleteCount is not zero and DeleteList is NULL.
671
+                                NewPacket is NULL
672
+                                Both DeleteCount and AppendCount are zero and
673
+                                NewPacket is not NULL.
674
+
675
+**/
676
+typedef
677
+EFI_STATUS
678
+(EFIAPI *EFI_DHCP4_BUILD)(
679
+  IN  EFI_DHCP4_PROTOCOL      *This,
680
+  IN  EFI_DHCP4_PACKET        *SeedPacket,
681
+  IN  UINT32                  DeleteCount,
682
+  IN  UINT8                   *DeleteList         OPTIONAL,
683
+  IN  UINT32                  AppendCount,
684
+  IN  EFI_DHCP4_PACKET_OPTION *AppendList[]       OPTIONAL,
685
+  OUT EFI_DHCP4_PACKET        **NewPacket
686
+  );
687
+
688
+
689
+/**
690
+  Transmits a DHCP formatted packet and optionally waits for responses.
691
+
692
+  The TransmitReceive() function is used to transmit a DHCP packet and optionally
693
+  wait for the response from servers. This function does not change the state of
694
+  the EFI DHCPv4 Protocol driver. It can be used at any time because of this.
695
+
696
+  @param  This    The pointer to the EFI_DHCP4_PROTOCOL instance.
697
+  @param  Token   The pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.
698
+
699
+  @retval EFI_SUCCESS           The packet was successfully queued for transmission.
700
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
701
+                                This is NULL.
702
+                                Token.RemoteAddress is zero.
703
+                                Token.Packet is NULL.
704
+                                Token.Packet is not a well-formed DHCP packet.
705
+                                The transaction ID in Token.Packet is in use by another DHCP process.
706
+  @retval EFI_NOT_READY         The previous call to this function has not finished yet. Try to call
707
+                                this function after collection process completes.
708
+  @retval EFI_NO_MAPPING        The default station address is not available yet.
709
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.
710
+  @retval EFI_UNSUPPORTED       The implementation doesn't support this function
711
+  @retval Others                Some other unexpected error occurred.
712
+
713
+**/
714
+typedef
715
+EFI_STATUS
716
+(EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE)(
717
+  IN EFI_DHCP4_PROTOCOL                *This,
718
+  IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN  *Token
719
+  );
720
+
721
+
722
+/**
723
+  Parses the packed DHCP option data.
724
+
725
+  The Parse() function is used to retrieve the option list from a DHCP packet.
726
+  If *OptionCount isn't zero, and there is enough space for all the DHCP options
727
+  in the Packet, each element of PacketOptionList is set to point to somewhere in
728
+  the Packet->Dhcp4.Option where a new DHCP option begins. If RFC3396 is supported,
729
+  the caller should reassemble the parsed DHCP options to get the final result.
730
+  If *OptionCount is zero or there isn't enough space for all of them, the number
731
+  of DHCP options in the Packet is returned in OptionCount.
732
+
733
+  @param  This             The pointer to the EFI_DHCP4_PROTOCOL instance.
734
+  @param  Packet           The pointer to packet to be parsed.
735
+  @param  OptionCount      On input, the number of entries in the PacketOptionList.
736
+                           On output, the number of entries that were written into the
737
+                           PacketOptionList.
738
+  @param  PacketOptionList A list of packet option entries to be filled in. End option or pad
739
+                           options are not included.
740
+
741
+  @retval EFI_SUCCESS           The packet was successfully parsed.
742
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
743
+                                This is NULL.
744
+                                The packet is NULL.
745
+                                The packet is not a well-formed DHCP packet.
746
+                                OptionCount is NULL.
747
+  @retval EFI_BUFFER_TOO_SMALL  One or more of the following conditions is TRUE:
748
+                                1) *OptionCount is smaller than the number of options that
749
+                                were found in the Packet.
750
+                                2) PacketOptionList is NULL.
751
+  @retval EFI_OUT_OF_RESOURCE   The packet failed to parse because of a resource shortage.
752
+
753
+**/
754
+typedef
755
+EFI_STATUS
756
+(EFIAPI *EFI_DHCP4_PARSE)(
757
+  IN EFI_DHCP4_PROTOCOL        *This,
758
+  IN EFI_DHCP4_PACKET          *Packet,
759
+  IN OUT UINT32                *OptionCount,
760
+  OUT EFI_DHCP4_PACKET_OPTION  *PacketOptionList[]  OPTIONAL
761
+  );
762
+
763
+///
764
+/// This protocol is used to collect configuration information for the EFI IPv4 Protocol drivers
765
+/// and to provide DHCPv4 server and PXE boot server discovery services.
766
+///
767
+struct _EFI_DHCP4_PROTOCOL {
768
+  EFI_DHCP4_GET_MODE_DATA      GetModeData;
769
+  EFI_DHCP4_CONFIGURE          Configure;
770
+  EFI_DHCP4_START              Start;
771
+  EFI_DHCP4_RENEW_REBIND       RenewRebind;
772
+  EFI_DHCP4_RELEASE            Release;
773
+  EFI_DHCP4_STOP               Stop;
774
+  EFI_DHCP4_BUILD              Build;
775
+  EFI_DHCP4_TRANSMIT_RECEIVE   TransmitReceive;
776
+  EFI_DHCP4_PARSE              Parse;
777
+};
778
+
779
+extern EFI_GUID gEfiDhcp4ProtocolGuid;
780
+extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid;
781
+
782
+#endif

+ 614
- 0
src/include/ipxe/efi/Protocol/Ip4.h 파일 보기

@@ -0,0 +1,614 @@
1
+/** @file
2
+  This file defines the EFI IPv4 (Internet Protocol version 4)
3
+  Protocol interface. It is split into the following three main
4
+  sections:
5
+  - EFI IPv4 Service Binding Protocol
6
+  - EFI IPv4 Variable (deprecated in UEFI 2.4B)
7
+  - EFI IPv4 Protocol.
8
+  The EFI IPv4 Protocol provides basic network IPv4 packet I/O services,
9
+  which includes support foR a subset of the Internet Control Message
10
+  Protocol (ICMP) and may include support for the Internet Group Management
11
+  Protocol (IGMP).
12
+
13
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
14
+This program and the accompanying materials are licensed and made available under
15
+the terms and conditions of the BSD License that accompanies this distribution.
16
+The full text of the license may be found at
17
+http://opensource.org/licenses/bsd-license.php.
18
+
19
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
20
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21
+
22
+  @par Revision Reference:
23
+  This Protocol is introduced in UEFI Specification 2.0.
24
+
25
+**/
26
+
27
+#ifndef __EFI_IP4_PROTOCOL_H__
28
+#define __EFI_IP4_PROTOCOL_H__
29
+
30
+FILE_LICENCE ( BSD3 );
31
+
32
+#include <ipxe/efi/Protocol/ManagedNetwork.h>
33
+
34
+#define EFI_IP4_SERVICE_BINDING_PROTOCOL_GUID \
35
+  { \
36
+    0xc51711e7, 0xb4bf, 0x404a, {0xbf, 0xb8, 0x0a, 0x04, 0x8e, 0xf1, 0xff, 0xe4 } \
37
+  }
38
+
39
+#define EFI_IP4_PROTOCOL_GUID \
40
+  { \
41
+    0x41d94cd2, 0x35b6, 0x455a, {0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd } \
42
+  }
43
+
44
+typedef struct _EFI_IP4_PROTOCOL EFI_IP4_PROTOCOL;
45
+
46
+///
47
+/// EFI_IP4_ADDRESS_PAIR is deprecated in the UEFI 2.4B and should not be used any more.
48
+/// The definition in here is only present to provide backwards compatability.
49
+///
50
+typedef struct {
51
+  EFI_HANDLE              InstanceHandle;
52
+  EFI_IPv4_ADDRESS        Ip4Address;
53
+  EFI_IPv4_ADDRESS        SubnetMask;
54
+} EFI_IP4_ADDRESS_PAIR;
55
+
56
+///
57
+/// EFI_IP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.
58
+/// The definition in here is only present to provide backwards compatability.
59
+///
60
+typedef struct {
61
+  EFI_HANDLE              DriverHandle;
62
+  UINT32                  AddressCount;
63
+  EFI_IP4_ADDRESS_PAIR    AddressPairs[1];
64
+} EFI_IP4_VARIABLE_DATA;
65
+
66
+typedef struct {
67
+  ///
68
+  /// The default IPv4 protocol packets to send and receive. Ignored
69
+  /// when AcceptPromiscuous is TRUE.
70
+  ///
71
+  UINT8                   DefaultProtocol;
72
+  ///
73
+  /// Set to TRUE to receive all IPv4 packets that get through the receive filters.
74
+  /// Set to FALSE to receive only the DefaultProtocol IPv4
75
+  /// packets that get through the receive filters.
76
+  ///
77
+  BOOLEAN                 AcceptAnyProtocol;
78
+  ///
79
+  /// Set to TRUE to receive ICMP error report packets. Ignored when
80
+  /// AcceptPromiscuous or AcceptAnyProtocol is TRUE.
81
+  ///
82
+  BOOLEAN                 AcceptIcmpErrors;
83
+  ///
84
+  /// Set to TRUE to receive broadcast IPv4 packets. Ignored when
85
+  /// AcceptPromiscuous is TRUE.
86
+  /// Set to FALSE to stop receiving broadcast IPv4 packets.
87
+  ///
88
+  BOOLEAN                 AcceptBroadcast;
89
+  ///
90
+  /// Set to TRUE to receive all IPv4 packets that are sent to any
91
+  /// hardware address or any protocol address.
92
+  /// Set to FALSE to stop receiving all promiscuous IPv4 packets
93
+  ///
94
+  BOOLEAN                 AcceptPromiscuous;
95
+  ///
96
+  /// Set to TRUE to use the default IPv4 address and default routing table.
97
+  ///
98
+  BOOLEAN                 UseDefaultAddress;
99
+  ///
100
+  /// The station IPv4 address that will be assigned to this EFI IPv4Protocol instance.
101
+  ///
102
+  EFI_IPv4_ADDRESS        StationAddress;
103
+  ///
104
+  /// The subnet address mask that is associated with the station address.
105
+  ///
106
+  EFI_IPv4_ADDRESS        SubnetMask;
107
+  ///
108
+  /// TypeOfService field in transmitted IPv4 packets.
109
+  ///
110
+  UINT8                   TypeOfService;
111
+  ///
112
+  /// TimeToLive field in transmitted IPv4 packets.
113
+  ///
114
+  UINT8                   TimeToLive;
115
+  ///
116
+  /// State of the DoNotFragment bit in transmitted IPv4 packets.
117
+  ///
118
+  BOOLEAN                 DoNotFragment;
119
+  ///
120
+  /// Set to TRUE to send and receive unformatted packets. The other
121
+  /// IPv4 receive filters are still applied. Fragmentation is disabled for RawData mode.
122
+  ///
123
+  BOOLEAN                 RawData;
124
+  ///
125
+  /// The timer timeout value (number of microseconds) for the
126
+  /// receive timeout event to be associated with each assembled
127
+  /// packet. Zero means do not drop assembled packets.
128
+  ///
129
+  UINT32                  ReceiveTimeout;
130
+  ///
131
+  /// The timer timeout value (number of microseconds) for the
132
+  /// transmit timeout event to be associated with each outgoing
133
+  /// packet. Zero means do not drop outgoing packets.
134
+  ///
135
+  UINT32                  TransmitTimeout;
136
+} EFI_IP4_CONFIG_DATA;
137
+
138
+
139
+typedef struct {
140
+  EFI_IPv4_ADDRESS        SubnetAddress;
141
+  EFI_IPv4_ADDRESS        SubnetMask;
142
+  EFI_IPv4_ADDRESS        GatewayAddress;
143
+} EFI_IP4_ROUTE_TABLE;
144
+
145
+typedef struct {
146
+  UINT8                   Type;
147
+  UINT8                   Code;
148
+} EFI_IP4_ICMP_TYPE;
149
+
150
+typedef struct {
151
+  ///
152
+  /// Set to TRUE after this EFI IPv4 Protocol instance has been successfully configured.
153
+  ///
154
+  BOOLEAN                 IsStarted;
155
+  ///
156
+  /// The maximum packet size, in bytes, of the packet which the upper layer driver could feed.
157
+  ///
158
+  UINT32                  MaxPacketSize;
159
+  ///
160
+  /// Current configuration settings.
161
+  ///
162
+  EFI_IP4_CONFIG_DATA     ConfigData;
163
+  ///
164
+  /// Set to TRUE when the EFI IPv4 Protocol instance has a station address and subnet mask.
165
+  ///
166
+  BOOLEAN                 IsConfigured;
167
+  ///
168
+  /// Number of joined multicast groups.
169
+  ///
170
+  UINT32                  GroupCount;
171
+  ///
172
+  /// List of joined multicast group addresses.
173
+  ///
174
+  EFI_IPv4_ADDRESS        *GroupTable;
175
+  ///
176
+  /// Number of entries in the routing table.
177
+  ///
178
+  UINT32                  RouteCount;
179
+  ///
180
+  /// Routing table entries.
181
+  ///
182
+  EFI_IP4_ROUTE_TABLE     *RouteTable;
183
+  ///
184
+  /// Number of entries in the supported ICMP types list.
185
+  ///
186
+  UINT32                  IcmpTypeCount;
187
+  ///
188
+  /// Array of ICMP types and codes that are supported by this EFI IPv4 Protocol driver
189
+  ///
190
+  EFI_IP4_ICMP_TYPE       *IcmpTypeList;
191
+} EFI_IP4_MODE_DATA;
192
+
193
+#pragma pack(1)
194
+
195
+typedef struct {
196
+  UINT8                   HeaderLength:4;
197
+  UINT8                   Version:4;
198
+  UINT8                   TypeOfService;
199
+  UINT16                  TotalLength;
200
+  UINT16                  Identification;
201
+  UINT16                  Fragmentation;
202
+  UINT8                   TimeToLive;
203
+  UINT8                   Protocol;
204
+  UINT16                  Checksum;
205
+  EFI_IPv4_ADDRESS        SourceAddress;
206
+  EFI_IPv4_ADDRESS        DestinationAddress;
207
+} EFI_IP4_HEADER;
208
+#pragma pack()
209
+
210
+
211
+typedef struct {
212
+  UINT32                  FragmentLength;
213
+  VOID                    *FragmentBuffer;
214
+} EFI_IP4_FRAGMENT_DATA;
215
+
216
+
217
+typedef struct {
218
+  EFI_TIME               TimeStamp;
219
+  EFI_EVENT              RecycleSignal;
220
+  UINT32                 HeaderLength;
221
+  EFI_IP4_HEADER         *Header;
222
+  UINT32                 OptionsLength;
223
+  VOID                   *Options;
224
+  UINT32                 DataLength;
225
+  UINT32                 FragmentCount;
226
+  EFI_IP4_FRAGMENT_DATA  FragmentTable[1];
227
+} EFI_IP4_RECEIVE_DATA;
228
+
229
+
230
+typedef struct {
231
+  EFI_IPv4_ADDRESS       SourceAddress;
232
+  EFI_IPv4_ADDRESS       GatewayAddress;
233
+  UINT8                  Protocol;
234
+  UINT8                  TypeOfService;
235
+  UINT8                  TimeToLive;
236
+  BOOLEAN                DoNotFragment;
237
+} EFI_IP4_OVERRIDE_DATA;
238
+
239
+typedef struct {
240
+  EFI_IPv4_ADDRESS       DestinationAddress;
241
+  EFI_IP4_OVERRIDE_DATA  *OverrideData;      //OPTIONAL
242
+  UINT32                 OptionsLength;      //OPTIONAL
243
+  VOID                   *OptionsBuffer;     //OPTIONAL
244
+  UINT32                 TotalDataLength;
245
+  UINT32                 FragmentCount;
246
+  EFI_IP4_FRAGMENT_DATA  FragmentTable[1];
247
+} EFI_IP4_TRANSMIT_DATA;
248
+
249
+typedef struct {
250
+  ///
251
+  /// This Event will be signaled after the Status field is updated
252
+  /// by the EFI IPv4 Protocol driver. The type of Event must be
253
+  /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of
254
+  /// Event must be lower than or equal to TPL_CALLBACK.
255
+  ///
256
+  EFI_EVENT                Event;
257
+  ///
258
+  /// The status that is returned to the caller at the end of the operation
259
+  /// to indicate whether this operation completed successfully.
260
+  ///
261
+  EFI_STATUS               Status;
262
+  union {
263
+    ///
264
+    /// When this token is used for receiving, RxData is a pointer to the EFI_IP4_RECEIVE_DATA.
265
+    ///
266
+    EFI_IP4_RECEIVE_DATA   *RxData;
267
+    ///
268
+    /// When this token is used for transmitting, TxData is a pointer to the EFI_IP4_TRANSMIT_DATA.
269
+    ///
270
+    EFI_IP4_TRANSMIT_DATA  *TxData;
271
+  } Packet;
272
+} EFI_IP4_COMPLETION_TOKEN;
273
+
274
+/**
275
+  Gets the current operational settings for this instance of the EFI IPv4 Protocol driver.
276
+
277
+  The GetModeData() function returns the current operational mode data for this
278
+  driver instance. The data fields in EFI_IP4_MODE_DATA are read only. This
279
+  function is used optionally to retrieve the operational mode data of underlying
280
+  networks or drivers.
281
+
282
+  @param  This          The pointer to the EFI_IP4_PROTOCOL instance.
283
+  @param  Ip4ModeData   The pointer to the EFI IPv4 Protocol mode data structure.
284
+  @param  MnpConfigData The pointer to the managed network configuration data structure.
285
+  @param  SnpModeData   The pointer to the simple network mode data structure.
286
+
287
+  @retval EFI_SUCCESS           The operation completed successfully.
288
+  @retval EFI_INVALID_PARAMETER This is NULL.
289
+  @retval EFI_OUT_OF_RESOURCES  The required mode data could not be allocated.
290
+
291
+**/
292
+typedef
293
+EFI_STATUS
294
+(EFIAPI *EFI_IP4_GET_MODE_DATA)(
295
+  IN CONST  EFI_IP4_PROTOCOL                *This,
296
+  OUT       EFI_IP4_MODE_DATA               *Ip4ModeData     OPTIONAL,
297
+  OUT       EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData   OPTIONAL,
298
+  OUT       EFI_SIMPLE_NETWORK_MODE         *SnpModeData     OPTIONAL
299
+  );
300
+
301
+/**
302
+  Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.
303
+
304
+  The Configure() function is used to set, change, or reset the operational
305
+  parameters and filter settings for this EFI IPv4 Protocol instance. Until these
306
+  parameters have been set, no network traffic can be sent or received by this
307
+  instance. Once the parameters have been reset (by calling this function with
308
+  IpConfigData set to NULL), no more traffic can be sent or received until these
309
+  parameters have been set again. Each EFI IPv4 Protocol instance can be started
310
+  and stopped independently of each other by enabling or disabling their receive
311
+  filter settings with the Configure() function.
312
+
313
+  When IpConfigData.UseDefaultAddress is set to FALSE, the new station address will
314
+  be appended as an alias address into the addresses list in the EFI IPv4 Protocol
315
+  driver. While set to TRUE, Configure() will trigger the EFI_IP4_CONFIG_PROTOCOL
316
+  to retrieve the default IPv4 address if it is not available yet. Clients could
317
+  frequently call GetModeData() to check the status to ensure that the default IPv4
318
+  address is ready.
319
+
320
+  If operational parameters are reset or changed, any pending transmit and receive
321
+  requests will be cancelled. Their completion token status will be set to EFI_ABORTED
322
+  and their events will be signaled.
323
+
324
+  @param  This         The pointer to the EFI_IP4_PROTOCOL instance.
325
+  @param  IpConfigData The pointer to the EFI IPv4 Protocol configuration data structure.
326
+
327
+  @retval EFI_SUCCESS           The driver instance was successfully opened.
328
+  @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,
329
+                                RARP, etc.) is not finished yet.
330
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
331
+                                This is NULL.
332
+                                IpConfigData.StationAddress is not a unicast IPv4 address.
333
+                                IpConfigData.SubnetMask is not a valid IPv4 subnet
334
+  @retval EFI_UNSUPPORTED       One or more of the following conditions is TRUE:
335
+                                A configuration protocol (DHCP, BOOTP, RARP, etc.) could
336
+                                not be located when clients choose to use the default IPv4
337
+                                address. This EFI IPv4 Protocol implementation does not
338
+                                support this requested filter or timeout setting.
339
+  @retval EFI_OUT_OF_RESOURCES  The EFI IPv4 Protocol driver instance data could not be allocated.
340
+  @retval EFI_ALREADY_STARTED   The interface is already open and must be stopped before the
341
+                                IPv4 address or subnet mask can be changed. The interface must
342
+                                also be stopped when switching to/from raw packet mode.
343
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred. The EFI IPv4
344
+                                Protocol driver instance is not opened.
345
+
346
+**/
347
+typedef
348
+EFI_STATUS
349
+(EFIAPI *EFI_IP4_CONFIGURE)(
350
+  IN EFI_IP4_PROTOCOL    *This,
351
+  IN EFI_IP4_CONFIG_DATA *IpConfigData     OPTIONAL
352
+  );
353
+
354
+/**
355
+  Joins and leaves multicast groups.
356
+
357
+  The Groups() function is used to join and leave multicast group sessions. Joining
358
+  a group will enable reception of matching multicast packets. Leaving a group will
359
+  disable the multicast packet reception.
360
+
361
+  If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.
362
+
363
+  @param  This                  The pointer to the EFI_IP4_PROTOCOL instance.
364
+  @param  JoinFlag              Set to TRUE to join the multicast group session and FALSE to leave.
365
+  @param  GroupAddress          The pointer to the IPv4 multicast address.
366
+
367
+  @retval EFI_SUCCESS           The operation completed successfully.
368
+  @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:
369
+                                - This is NULL.
370
+                                - JoinFlag is TRUE and GroupAddress is NULL.
371
+                                - GroupAddress is not NULL and *GroupAddress is
372
+                                  not a multicast IPv4 address.
373
+  @retval EFI_NOT_STARTED       This instance has not been started.
374
+  @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,
375
+                                RARP, etc.) is not finished yet.
376
+  @retval EFI_OUT_OF_RESOURCES  System resources could not be allocated.
377
+  @retval EFI_UNSUPPORTED       This EFI IPv4 Protocol implementation does not support multicast groups.
378
+  @retval EFI_ALREADY_STARTED   The group address is already in the group table (when
379
+                                JoinFlag is TRUE).
380
+  @retval EFI_NOT_FOUND         The group address is not in the group table (when JoinFlag is FALSE).
381
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
382
+
383
+**/
384
+typedef
385
+EFI_STATUS
386
+(EFIAPI *EFI_IP4_GROUPS)(
387
+  IN EFI_IP4_PROTOCOL    *This,
388
+  IN BOOLEAN             JoinFlag,
389
+  IN EFI_IPv4_ADDRESS    *GroupAddress  OPTIONAL
390
+  );
391
+
392
+/**
393
+  Adds and deletes routing table entries.
394
+
395
+  The Routes() function adds a route to or deletes a route from the routing table.
396
+
397
+  Routes are determined by comparing the SubnetAddress with the destination IPv4
398
+  address arithmetically AND-ed with the SubnetMask. The gateway address must be
399
+  on the same subnet as the configured station address.
400
+
401
+  The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0.
402
+  The default route matches all destination IPv4 addresses that do not match any
403
+  other routes.
404
+
405
+  A GatewayAddress that is zero is a nonroute. Packets are sent to the destination
406
+  IP address if it can be found in the ARP cache or on the local subnet. One automatic
407
+  nonroute entry will be inserted into the routing table for outgoing packets that
408
+  are addressed to a local subnet (gateway address of 0.0.0.0).
409
+
410
+  Each EFI IPv4 Protocol instance has its own independent routing table. Those EFI
411
+  IPv4 Protocol instances that use the default IPv4 address will also have copies
412
+  of the routing table that was provided by the EFI_IP4_CONFIG_PROTOCOL, and these
413
+  copies will be updated whenever the EIF IPv4 Protocol driver reconfigures its
414
+  instances. As a result, client modification to the routing table will be lost.
415
+
416
+  @param  This                   The pointer to the EFI_IP4_PROTOCOL instance.
417
+  @param  DeleteRoute            Set to TRUE to delete this route from the routing table. Set to
418
+                                 FALSE to add this route to the routing table. SubnetAddress
419
+                                 and SubnetMask are used as the key to each route entry.
420
+  @param  SubnetAddress          The address of the subnet that needs to be routed.
421
+  @param  SubnetMask             The subnet mask of SubnetAddress.
422
+  @param  GatewayAddress         The unicast gateway IPv4 address for this route.
423
+
424
+  @retval EFI_SUCCESS            The operation completed successfully.
425
+  @retval EFI_NOT_STARTED        The driver instance has not been started.
426
+  @retval EFI_NO_MAPPING         When using the default address, configuration (DHCP, BOOTP,
427
+                                 RARP, etc.) is not finished yet.
428
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:
429
+                                 - This is NULL.
430
+                                 - SubnetAddress is NULL.
431
+                                 - SubnetMask is NULL.
432
+                                 - GatewayAddress is NULL.
433
+                                 - *SubnetAddress is not a valid subnet address.
434
+                                 - *SubnetMask is not a valid subnet mask.
435
+                                 - *GatewayAddress is not a valid unicast IPv4 address.
436
+  @retval EFI_OUT_OF_RESOURCES   Could not add the entry to the routing table.
437
+  @retval EFI_NOT_FOUND          This route is not in the routing table (when DeleteRoute is TRUE).
438
+  @retval EFI_ACCESS_DENIED      The route is already defined in the routing table (when
439
+                                 DeleteRoute is FALSE).
440
+
441
+**/
442
+typedef
443
+EFI_STATUS
444
+(EFIAPI *EFI_IP4_ROUTES)(
445
+  IN EFI_IP4_PROTOCOL    *This,
446
+  IN BOOLEAN             DeleteRoute,
447
+  IN EFI_IPv4_ADDRESS    *SubnetAddress,
448
+  IN EFI_IPv4_ADDRESS    *SubnetMask,
449
+  IN EFI_IPv4_ADDRESS    *GatewayAddress
450
+  );
451
+
452
+/**
453
+  Places outgoing data packets into the transmit queue.
454
+
455
+  The Transmit() function places a sending request in the transmit queue of this
456
+  EFI IPv4 Protocol instance. Whenever the packet in the token is sent out or some
457
+  errors occur, the event in the token will be signaled and the status is updated.
458
+
459
+  @param  This  The pointer to the EFI_IP4_PROTOCOL instance.
460
+  @param  Token The pointer to the transmit token.
461
+
462
+  @retval  EFI_SUCCESS           The data has been queued for transmission.
463
+  @retval  EFI_NOT_STARTED       This instance has not been started.
464
+  @retval  EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,
465
+                                 RARP, etc.) is not finished yet.
466
+  @retval  EFI_INVALID_PARAMETER One or more pameters are invalid.
467
+  @retval  EFI_ACCESS_DENIED     The transmit completion token with the same Token.Event
468
+                                 was already in the transmit queue.
469
+  @retval  EFI_NOT_READY         The completion token could not be queued because the transmit
470
+                                 queue is full.
471
+  @retval  EFI_NOT_FOUND         Not route is found to destination address.
472
+  @retval  EFI_OUT_OF_RESOURCES  Could not queue the transmit data.
473
+  @retval  EFI_BUFFER_TOO_SMALL  Token.Packet.TxData.TotalDataLength is too
474
+                                 short to transmit.
475
+  @retval  EFI_BAD_BUFFER_SIZE   The length of the IPv4 header + option length + total data length is
476
+                                 greater than MTU (or greater than the maximum packet size if
477
+                                 Token.Packet.TxData.OverrideData.
478
+                                 DoNotFragment is TRUE.)
479
+
480
+**/
481
+typedef
482
+EFI_STATUS
483
+(EFIAPI *EFI_IP4_TRANSMIT)(
484
+  IN EFI_IP4_PROTOCOL          *This,
485
+  IN EFI_IP4_COMPLETION_TOKEN  *Token
486
+  );
487
+
488
+/**
489
+  Places a receiving request into the receiving queue.
490
+
491
+  The Receive() function places a completion token into the receive packet queue.
492
+  This function is always asynchronous.
493
+
494
+  The Token.Event field in the completion token must be filled in by the caller
495
+  and cannot be NULL. When the receive operation completes, the EFI IPv4 Protocol
496
+  driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event
497
+  is signaled.
498
+
499
+  @param  This  The pointer to the EFI_IP4_PROTOCOL instance.
500
+  @param  Token The pointer to a token that is associated with the receive data descriptor.
501
+
502
+  @retval EFI_SUCCESS           The receive completion token was cached.
503
+  @retval EFI_NOT_STARTED       This EFI IPv4 Protocol instance has not been started.
504
+  @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP, RARP, etc.)
505
+                                is not finished yet.
506
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
507
+                                - This is NULL.
508
+                                - Token is NULL.
509
+                                - Token.Event is NULL.
510
+  @retval EFI_OUT_OF_RESOURCES  The receive completion token could not be queued due to a lack of system
511
+                                resources (usually memory).
512
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
513
+                                The EFI IPv4 Protocol instance has been reset to startup defaults.
514
+  @retval EFI_ACCESS_DENIED     The receive completion token with the same Token.Event was already
515
+                                in the receive queue.
516
+  @retval EFI_NOT_READY         The receive request could not be queued because the receive queue is full.
517
+  @retval EFI_ICMP_ERROR        An ICMP error packet was received.
518
+
519
+**/
520
+typedef
521
+EFI_STATUS
522
+(EFIAPI *EFI_IP4_RECEIVE)(
523
+  IN EFI_IP4_PROTOCOL          *This,
524
+  IN EFI_IP4_COMPLETION_TOKEN  *Token
525
+  );
526
+
527
+/**
528
+  Abort an asynchronous transmit or receive request.
529
+
530
+  The Cancel() function is used to abort a pending transmit or receive request.
531
+  If the token is in the transmit or receive request queues, after calling this
532
+  function, Token->Status will be set to EFI_ABORTED and then Token->Event will
533
+  be signaled. If the token is not in one of the queues, which usually means the
534
+  asynchronous operation has completed, this function will not signal the token
535
+  and EFI_NOT_FOUND is returned.
536
+
537
+  @param  This  The pointer to the EFI_IP4_PROTOCOL instance.
538
+  @param  Token The pointer to a token that has been issued by
539
+                EFI_IP4_PROTOCOL.Transmit() or
540
+                EFI_IP4_PROTOCOL.Receive(). If NULL, all pending
541
+                tokens are aborted. Type EFI_IP4_COMPLETION_TOKEN is
542
+                defined in EFI_IP4_PROTOCOL.Transmit().
543
+
544
+  @retval EFI_SUCCESS           The asynchronous I/O request was aborted and
545
+                                Token->Event was signaled. When Token is NULL, all
546
+                                pending requests were aborted and their events were signaled.
547
+  @retval EFI_INVALID_PARAMETER This is NULL.
548
+  @retval EFI_NOT_STARTED       This instance has not been started.
549
+  @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,
550
+                                RARP, etc.) is not finished yet.
551
+  @retval EFI_NOT_FOUND         When Token is not NULL, the asynchronous I/O request was
552
+                                not found in the transmit or receive queue. It has either completed
553
+                                or was not issued by Transmit() and Receive().
554
+
555
+**/
556
+typedef
557
+EFI_STATUS
558
+(EFIAPI *EFI_IP4_CANCEL)(
559
+  IN EFI_IP4_PROTOCOL          *This,
560
+  IN EFI_IP4_COMPLETION_TOKEN  *Token OPTIONAL
561
+  );
562
+
563
+/**
564
+  Polls for incoming data packets and processes outgoing data packets.
565
+
566
+  The Poll() function polls for incoming data packets and processes outgoing data
567
+  packets. Network drivers and applications can call the EFI_IP4_PROTOCOL.Poll()
568
+  function to increase the rate that data packets are moved between the communications
569
+  device and the transmit and receive queues.
570
+
571
+  In some systems the periodic timer event may not poll the underlying communications
572
+  device fast enough to transmit and/or receive all data packets without missing
573
+  incoming packets or dropping outgoing packets. Drivers and applications that are
574
+  experiencing packet loss should try calling the EFI_IP4_PROTOCOL.Poll() function
575
+  more often.
576
+
577
+  @param  This The pointer to the EFI_IP4_PROTOCOL instance.
578
+
579
+  @retval  EFI_SUCCESS           Incoming or outgoing data was processed.
580
+  @retval  EFI_NOT_STARTED       This EFI IPv4 Protocol instance has not been started.
581
+  @retval  EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,
582
+                                 RARP, etc.) is not finished yet.
583
+  @retval  EFI_INVALID_PARAMETER This is NULL.
584
+  @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.
585
+  @retval  EFI_NOT_READY         No incoming or outgoing data is processed.
586
+  @retval  EFI_TIMEOUT           Data was dropped out of the transmit and/or receive queue.
587
+                                 Consider increasing the polling rate.
588
+
589
+**/
590
+typedef
591
+EFI_STATUS
592
+(EFIAPI *EFI_IP4_POLL)(
593
+  IN EFI_IP4_PROTOCOL          *This
594
+  );
595
+
596
+///
597
+/// The EFI IPv4 Protocol implements a simple packet-oriented interface that can be
598
+/// used by drivers, daemons, and applications to transmit and receive network packets.
599
+///
600
+struct _EFI_IP4_PROTOCOL {
601
+  EFI_IP4_GET_MODE_DATA        GetModeData;
602
+  EFI_IP4_CONFIGURE            Configure;
603
+  EFI_IP4_GROUPS               Groups;
604
+  EFI_IP4_ROUTES               Routes;
605
+  EFI_IP4_TRANSMIT             Transmit;
606
+  EFI_IP4_RECEIVE              Receive;
607
+  EFI_IP4_CANCEL               Cancel;
608
+  EFI_IP4_POLL                 Poll;
609
+};
610
+
611
+extern EFI_GUID gEfiIp4ServiceBindingProtocolGuid;
612
+extern EFI_GUID gEfiIp4ProtocolGuid;
613
+
614
+#endif

+ 184
- 0
src/include/ipxe/efi/Protocol/Ip4Config.h 파일 보기

@@ -0,0 +1,184 @@
1
+/** @file
2
+  This file provides a definition of the EFI IPv4 Configuration
3
+  Protocol.
4
+
5
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
6
+This program and the accompanying materials are licensed and made available under
7
+the terms and conditions of the BSD License that accompanies this distribution.
8
+The full text of the license may be found at
9
+http://opensource.org/licenses/bsd-license.php.
10
+
11
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
+
14
+  @par Revision Reference:
15
+  This Protocol is introduced in UEFI Specification 2.0.
16
+
17
+**/
18
+#ifndef __EFI_IP4CONFIG_PROTOCOL_H__
19
+#define __EFI_IP4CONFIG_PROTOCOL_H__
20
+
21
+FILE_LICENCE ( BSD3 );
22
+
23
+#include <ipxe/efi/Protocol/Ip4.h>
24
+
25
+#define EFI_IP4_CONFIG_PROTOCOL_GUID \
26
+  { \
27
+    0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } \
28
+  }
29
+
30
+typedef struct _EFI_IP4_CONFIG_PROTOCOL EFI_IP4_CONFIG_PROTOCOL;
31
+
32
+#define IP4_CONFIG_VARIABLE_ATTRIBUTES \
33
+        (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)
34
+
35
+///
36
+/// EFI_IP4_IPCONFIG_DATA contains the minimum IPv4 configuration data
37
+/// that is needed to start basic network communication. The StationAddress
38
+/// and SubnetMask must be a valid unicast IP address and subnet mask.
39
+/// If RouteTableSize is not zero, then RouteTable contains a properly
40
+/// formatted routing table for the StationAddress/SubnetMask, with the
41
+/// last entry in the table being the default route.
42
+///
43
+typedef struct {
44
+  ///
45
+  /// Default station IP address, stored in network byte order.
46
+  ///
47
+  EFI_IPv4_ADDRESS             StationAddress;
48
+  ///
49
+  /// Default subnet mask, stored in network byte order.
50
+  ///
51
+  EFI_IPv4_ADDRESS             SubnetMask;
52
+  ///
53
+  /// Number of entries in the following RouteTable. May be zero.
54
+  ///
55
+  UINT32                       RouteTableSize;
56
+  ///
57
+  /// Default routing table data (stored in network byte order).
58
+  /// Ignored if RouteTableSize is zero.
59
+  ///
60
+  EFI_IP4_ROUTE_TABLE          *RouteTable;
61
+} EFI_IP4_IPCONFIG_DATA;
62
+
63
+
64
+/**
65
+  Starts running the configuration policy for the EFI IPv4 Protocol driver.
66
+
67
+  The Start() function is called to determine and to begin the platform
68
+  configuration policy by the EFI IPv4 Protocol driver. This determination may
69
+  be as simple as returning EFI_UNSUPPORTED if there is no EFI IPv4 Protocol
70
+  driver configuration policy. It may be as involved as loading some defaults
71
+  from nonvolatile storage, downloading dynamic data from a DHCP server, and
72
+  checking permissions with a site policy server.
73
+  Starting the configuration policy is just the beginning. It may finish almost
74
+  instantly or it may take several minutes before it fails to retrieve configuration
75
+  information from one or more servers. Once the policy is started, drivers
76
+  should use the DoneEvent parameter to determine when the configuration policy
77
+  has completed. EFI_IP4_CONFIG_PROTOCOL.GetData() must then be called to
78
+  determine if the configuration succeeded or failed.
79
+  Until the configuration completes successfully, EFI IPv4 Protocol driver instances
80
+  that are attempting to use default configurations must return EFI_NO_MAPPING.
81
+  Once the configuration is complete, the EFI IPv4 Configuration Protocol driver
82
+  signals DoneEvent. The configuration may need to be updated in the future.
83
+  Note that in this case the EFI IPv4 Configuration Protocol driver must signal
84
+  ReconfigEvent, and all EFI IPv4 Protocol driver instances that are using default
85
+  configurations must return EFI_NO_MAPPING until the configuration policy has
86
+  been rerun.
87
+
88
+  @param  This                   The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
89
+  @param  DoneEvent              Event that will be signaled when the EFI IPv4
90
+                                 Protocol driver configuration policy completes
91
+                                 execution. This event must be of type EVT_NOTIFY_SIGNAL.
92
+  @param  ReconfigEvent          Event that will be signaled when the EFI IPv4
93
+                                 Protocol driver configuration needs to be updated.
94
+                                 This event must be of type EVT_NOTIFY_SIGNAL.
95
+
96
+  @retval EFI_SUCCESS            The configuration policy for the EFI IPv4 Protocol
97
+                                 driver is now running.
98
+  @retval EFI_INVALID_PARAMETER  One or more of the following parameters is NULL:
99
+                                  This
100
+                                  DoneEvent
101
+                                  ReconfigEvent
102
+  @retval EFI_OUT_OF_RESOURCES   Required system resources could not be allocated.
103
+  @retval EFI_ALREADY_STARTED    The configuration policy for the EFI IPv4 Protocol
104
+                                 driver was already started.
105
+  @retval EFI_DEVICE_ERROR       An unexpected system error or network error occurred.
106
+  @retval EFI_UNSUPPORTED        This interface does not support the EFI IPv4 Protocol
107
+                                 driver configuration.
108
+
109
+**/
110
+typedef
111
+EFI_STATUS
112
+(EFIAPI *EFI_IP4_CONFIG_START)(
113
+  IN EFI_IP4_CONFIG_PROTOCOL   *This,
114
+  IN EFI_EVENT                 DoneEvent,
115
+  IN EFI_EVENT                 ReconfigEvent
116
+  );
117
+
118
+/**
119
+  Stops running the configuration policy for the EFI IPv4 Protocol driver.
120
+
121
+  The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver.
122
+  All configuration data will be lost after calling Stop().
123
+
124
+  @param  This                   The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
125
+
126
+  @retval EFI_SUCCESS            The configuration policy for the EFI IPv4 Protocol
127
+                                 driver has been stopped.
128
+  @retval EFI_INVALID_PARAMETER  This is NULL.
129
+  @retval EFI_NOT_STARTED        The configuration policy for the EFI IPv4 Protocol
130
+                                 driver was not started.
131
+
132
+**/
133
+typedef
134
+EFI_STATUS
135
+(EFIAPI *EFI_IP4_CONFIG_STOP)(
136
+  IN EFI_IP4_CONFIG_PROTOCOL   *This
137
+  );
138
+
139
+/**
140
+  Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.
141
+
142
+  The GetData() function returns the current configuration data for the EFI IPv4
143
+  Protocol driver after the configuration policy has completed.
144
+
145
+  @param  This                   The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
146
+  @param  IpConfigDataSize       On input, the size of the IpConfigData buffer.
147
+                                 On output, the count of bytes that were written
148
+                                 into the IpConfigData buffer.
149
+  @param  IpConfigData           The pointer to the EFI IPv4 Configuration Protocol
150
+                                 driver configuration data structure.
151
+                                 Type EFI_IP4_IPCONFIG_DATA is defined in
152
+                                 "Related Definitions" below.
153
+
154
+  @retval EFI_SUCCESS            The EFI IPv4 Protocol driver configuration has been returned.
155
+  @retval EFI_INVALID_PARAMETER  This is NULL.
156
+  @retval EFI_NOT_STARTED        The configuration policy for the EFI IPv4 Protocol
157
+                                 driver is not running.
158
+  @retval EFI_NOT_READY EFI      IPv4 Protocol driver configuration is still running.
159
+  @retval EFI_ABORTED EFI        IPv4 Protocol driver configuration could not complete.
160
+  @retval EFI_BUFFER_TOO_SMALL   *IpConfigDataSize is smaller than the configuration
161
+                                 data buffer or IpConfigData is NULL.
162
+
163
+**/
164
+typedef
165
+EFI_STATUS
166
+(EFIAPI *EFI_IP4_CONFIG_GET_DATA)(
167
+  IN EFI_IP4_CONFIG_PROTOCOL   *This,
168
+  IN OUT UINTN                 *IpConfigDataSize,
169
+  OUT EFI_IP4_IPCONFIG_DATA    *IpConfigData    OPTIONAL
170
+  );
171
+
172
+///
173
+/// The EFI_IP4_CONFIG_PROTOCOL driver performs platform-dependent and policy-dependent
174
+/// configurations for the EFI IPv4 Protocol driver.
175
+///
176
+struct _EFI_IP4_CONFIG_PROTOCOL {
177
+  EFI_IP4_CONFIG_START         Start;
178
+  EFI_IP4_CONFIG_STOP          Stop;
179
+  EFI_IP4_CONFIG_GET_DATA      GetData;
180
+};
181
+
182
+extern EFI_GUID gEfiIp4ConfigProtocolGuid;
183
+
184
+#endif

+ 374
- 0
src/include/ipxe/efi/Protocol/ManagedNetwork.h 파일 보기

@@ -0,0 +1,374 @@
1
+/** @file
2
+  EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
3
+  EFI_MANAGED_NETWORK_PROTOCOL as defined in UEFI 2.0.
4
+
5
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
6
+This program and the accompanying materials are licensed and made available under
7
+the terms and conditions of the BSD License that accompanies this distribution.
8
+The full text of the license may be found at
9
+http://opensource.org/licenses/bsd-license.php.
10
+
11
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
+
14
+  @par Revision Reference:
15
+  This Protocol is introduced in UEFI Specification 2.0
16
+
17
+**/
18
+
19
+#ifndef __EFI_MANAGED_NETWORK_PROTOCOL_H__
20
+#define __EFI_MANAGED_NETWORK_PROTOCOL_H__
21
+
22
+FILE_LICENCE ( BSD3 );
23
+
24
+#include <ipxe/efi/Protocol/SimpleNetwork.h>
25
+
26
+#define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \
27
+  { \
28
+    0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } \
29
+  }
30
+
31
+#define EFI_MANAGED_NETWORK_PROTOCOL_GUID \
32
+  { \
33
+    0x7ab33a91, 0xace5, 0x4326, { 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } \
34
+  }
35
+
36
+typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL;
37
+
38
+typedef struct {
39
+  ///
40
+  /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed
41
+  /// from the MNP receive queue will be dropped if its receive timeout expires.
42
+  ///
43
+  UINT32     ReceivedQueueTimeoutValue;
44
+  ///
45
+  /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed
46
+  /// from the MNP transmit queue will be dropped if its receive timeout expires.
47
+  ///
48
+  UINT32     TransmitQueueTimeoutValue;
49
+  ///
50
+  /// Ethernet type II 16-bit protocol type in host byte order. Valid
51
+  /// values are zero and 1,500 to 65,535.
52
+  ///
53
+  UINT16     ProtocolTypeFilter;
54
+  ///
55
+  /// Set to TRUE to receive packets that are sent to the network
56
+  /// device MAC address. The startup default value is FALSE.
57
+  ///
58
+  BOOLEAN    EnableUnicastReceive;
59
+  ///
60
+  /// Set to TRUE to receive packets that are sent to any of the
61
+  /// active multicast groups. The startup default value is FALSE.
62
+  ///
63
+  BOOLEAN    EnableMulticastReceive;
64
+  ///
65
+  /// Set to TRUE to receive packets that are sent to the network
66
+  /// device broadcast address. The startup default value is FALSE.
67
+  ///
68
+  BOOLEAN    EnableBroadcastReceive;
69
+  ///
70
+  /// Set to TRUE to receive packets that are sent to any MAC address.
71
+  /// The startup default value is FALSE.
72
+  ///
73
+  BOOLEAN    EnablePromiscuousReceive;
74
+  ///
75
+  /// Set to TRUE to drop queued packets when the configuration
76
+  /// is changed. The startup default value is FALSE.
77
+  ///
78
+  BOOLEAN    FlushQueuesOnReset;
79
+  ///
80
+  /// Set to TRUE to timestamp all packets when they are received
81
+  /// by the MNP. Note that timestamps may be unsupported in some
82
+  /// MNP implementations. The startup default value is FALSE.
83
+  ///
84
+  BOOLEAN    EnableReceiveTimestamps;
85
+  ///
86
+  /// Set to TRUE to disable background polling in this MNP
87
+  /// instance. Note that background polling may not be supported in
88
+  /// all MNP implementations. The startup default value is FALSE,
89
+  /// unless background polling is not supported.
90
+  ///
91
+  BOOLEAN    DisableBackgroundPolling;
92
+} EFI_MANAGED_NETWORK_CONFIG_DATA;
93
+
94
+typedef struct {
95
+  EFI_TIME      Timestamp;
96
+  EFI_EVENT     RecycleEvent;
97
+  UINT32        PacketLength;
98
+  UINT32        HeaderLength;
99
+  UINT32        AddressLength;
100
+  UINT32        DataLength;
101
+  BOOLEAN       BroadcastFlag;
102
+  BOOLEAN       MulticastFlag;
103
+  BOOLEAN       PromiscuousFlag;
104
+  UINT16        ProtocolType;
105
+  VOID          *DestinationAddress;
106
+  VOID          *SourceAddress;
107
+  VOID          *MediaHeader;
108
+  VOID          *PacketData;
109
+} EFI_MANAGED_NETWORK_RECEIVE_DATA;
110
+
111
+typedef struct {
112
+  UINT32        FragmentLength;
113
+  VOID          *FragmentBuffer;
114
+} EFI_MANAGED_NETWORK_FRAGMENT_DATA;
115
+
116
+typedef struct {
117
+  EFI_MAC_ADDRESS                   *DestinationAddress; //OPTIONAL
118
+  EFI_MAC_ADDRESS                   *SourceAddress;      //OPTIONAL
119
+  UINT16                            ProtocolType;        //OPTIONAL
120
+  UINT32                            DataLength;
121
+  UINT16                            HeaderLength;        //OPTIONAL
122
+  UINT16                            FragmentCount;
123
+  EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1];
124
+} EFI_MANAGED_NETWORK_TRANSMIT_DATA;
125
+
126
+
127
+typedef struct {
128
+  ///
129
+  /// This Event will be signaled after the Status field is updated
130
+  /// by the MNP. The type of Event must be
131
+  /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of
132
+  /// Event must be lower than or equal to TPL_CALLBACK.
133
+  ///
134
+  EFI_EVENT                             Event;
135
+  ///
136
+  /// The status that is returned to the caller at the end of the operation
137
+  /// to indicate whether this operation completed successfully.
138
+  ///
139
+  EFI_STATUS                            Status;
140
+  union {
141
+    ///
142
+    /// When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA.
143
+    ///
144
+    EFI_MANAGED_NETWORK_RECEIVE_DATA    *RxData;
145
+    ///
146
+    /// When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DATA.
147
+    ///
148
+    EFI_MANAGED_NETWORK_TRANSMIT_DATA   *TxData;
149
+  } Packet;
150
+} EFI_MANAGED_NETWORK_COMPLETION_TOKEN;
151
+
152
+/**
153
+  Returns the operational parameters for the current MNP child driver.
154
+
155
+  @param  This          The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
156
+  @param  MnpConfigData The pointer to storage for MNP operational parameters.
157
+  @param  SnpModeData   The pointer to storage for SNP operational parameters.
158
+
159
+  @retval EFI_SUCCESS           The operation completed successfully.
160
+  @retval EFI_INVALID_PARAMETER This is NULL.
161
+  @retval EFI_UNSUPPORTED       The requested feature is unsupported in this MNP implementation.
162
+  @retval EFI_NOT_STARTED       This MNP child driver instance has not been configured. The default
163
+                                values are returned in MnpConfigData if it is not NULL.
164
+  @retval Other                 The mode data could not be read.
165
+
166
+**/
167
+typedef
168
+EFI_STATUS
169
+(EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA)(
170
+  IN  EFI_MANAGED_NETWORK_PROTOCOL     *This,
171
+  OUT EFI_MANAGED_NETWORK_CONFIG_DATA  *MnpConfigData  OPTIONAL,
172
+  OUT EFI_SIMPLE_NETWORK_MODE          *SnpModeData    OPTIONAL
173
+  );
174
+
175
+/**
176
+  Sets or clears the operational parameters for the MNP child driver.
177
+
178
+  @param  This          The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
179
+  @param  MnpConfigData The pointer to configuration data that will be assigned to the MNP
180
+                        child driver instance. If NULL, the MNP child driver instance is
181
+                        reset to startup defaults and all pending transmit and receive
182
+                        requests are flushed.
183
+
184
+  @retval EFI_SUCCESS           The operation completed successfully.
185
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
186
+  @retval EFI_OUT_OF_RESOURCES  Required system resources (usually memory) could not be
187
+                                allocated.
188
+  @retval EFI_UNSUPPORTED       The requested feature is unsupported in this [MNP]
189
+                                implementation.
190
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred.
191
+  @retval Other                 The MNP child driver instance has been reset to startup defaults.
192
+
193
+**/
194
+typedef
195
+EFI_STATUS
196
+(EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE)(
197
+  IN EFI_MANAGED_NETWORK_PROTOCOL     *This,
198
+  IN EFI_MANAGED_NETWORK_CONFIG_DATA  *MnpConfigData  OPTIONAL
199
+  );
200
+
201
+/**
202
+  Translates an IP multicast address to a hardware (MAC) multicast address.
203
+
204
+  @param  This       The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
205
+  @param  Ipv6Flag   Set to TRUE to if IpAddress is an IPv6 multicast address.
206
+                     Set to FALSE if IpAddress is an IPv4 multicast address.
207
+  @param  IpAddress  The pointer to the multicast IP address (in network byte order) to convert.
208
+  @param  MacAddress The pointer to the resulting multicast MAC address.
209
+
210
+  @retval EFI_SUCCESS           The operation completed successfully.
211
+  @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:
212
+                                - This is NULL.
213
+                                - IpAddress is NULL.
214
+                                - *IpAddress is not a valid multicast IP address.
215
+                                - MacAddress is NULL.
216
+  @retval EFI_NOT_STARTED       This MNP child driver instance has not been configured.
217
+  @retval EFI_UNSUPPORTED       The requested feature is unsupported in this MNP implementation.
218
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred.
219
+  @retval Other                 The address could not be converted.
220
+
221
+**/
222
+typedef
223
+EFI_STATUS
224
+(EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC)(
225
+  IN  EFI_MANAGED_NETWORK_PROTOCOL  *This,
226
+  IN  BOOLEAN                       Ipv6Flag,
227
+  IN  EFI_IP_ADDRESS                *IpAddress,
228
+  OUT EFI_MAC_ADDRESS               *MacAddress
229
+  );
230
+
231
+/**
232
+  Enables and disables receive filters for multicast address.
233
+
234
+  @param  This       The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
235
+  @param  JoinFlag   Set to TRUE to join this multicast group.
236
+                     Set to FALSE to leave this multicast group.
237
+  @param  MacAddress The pointer to the multicast MAC group (address) to join or leave.
238
+
239
+  @retval EFI_SUCCESS           The requested operation completed successfully.
240
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
241
+                                - This is NULL.
242
+                                - JoinFlag is TRUE and MacAddress is NULL.
243
+                                - *MacAddress is not a valid multicast MAC address.
244
+  @retval EFI_NOT_STARTED       This MNP child driver instance has not been configured.
245
+  @retval EFI_ALREADY_STARTED   The supplied multicast group is already joined.
246
+  @retval EFI_NOT_FOUND         The supplied multicast group is not joined.
247
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred.
248
+  @retval EFI_UNSUPPORTED       The requested feature is unsupported in this MNP implementation.
249
+  @retval Other                 The requested operation could not be completed.
250
+
251
+**/
252
+typedef
253
+EFI_STATUS
254
+(EFIAPI *EFI_MANAGED_NETWORK_GROUPS)(
255
+  IN EFI_MANAGED_NETWORK_PROTOCOL  *This,
256
+  IN BOOLEAN                       JoinFlag,
257
+  IN EFI_MAC_ADDRESS               *MacAddress  OPTIONAL
258
+  );
259
+
260
+/**
261
+  Places asynchronous outgoing data packets into the transmit queue.
262
+
263
+  @param  This  The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
264
+  @param  Token The pointer to a token associated with the transmit data descriptor.
265
+
266
+  @retval EFI_SUCCESS           The transmit completion token was cached.
267
+  @retval EFI_NOT_STARTED       This MNP child driver instance has not been configured.
268
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
269
+  @retval EFI_ACCESS_DENIED     The transmit completion token is already in the transmit queue.
270
+  @retval EFI_OUT_OF_RESOURCES  The transmit data could not be queued due to a lack of system resources
271
+                                (usually memory).
272
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
273
+  @retval EFI_NOT_READY         The transmit request could not be queued because the transmit queue is full.
274
+
275
+**/
276
+typedef
277
+EFI_STATUS
278
+(EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT)(
279
+  IN EFI_MANAGED_NETWORK_PROTOCOL          *This,
280
+  IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN  *Token
281
+  );
282
+
283
+/**
284
+  Places an asynchronous receiving request into the receiving queue.
285
+
286
+  @param  This  The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
287
+  @param  Token The pointer to a token associated with the receive data descriptor.
288
+
289
+  @retval EFI_SUCCESS           The receive completion token was cached.
290
+  @retval EFI_NOT_STARTED       This MNP child driver instance has not been configured.
291
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
292
+                                - This is NULL.
293
+                                - Token is NULL.
294
+                                - Token.Event is NULL.
295
+  @retval EFI_OUT_OF_RESOURCES  The transmit data could not be queued due to a lack of system resources
296
+                                (usually memory).
297
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
298
+  @retval EFI_ACCESS_DENIED     The receive completion token was already in the receive queue.
299
+  @retval EFI_NOT_READY         The receive request could not be queued because the receive queue is full.
300
+
301
+**/
302
+typedef
303
+EFI_STATUS
304
+(EFIAPI *EFI_MANAGED_NETWORK_RECEIVE)(
305
+  IN EFI_MANAGED_NETWORK_PROTOCOL          *This,
306
+  IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN  *Token
307
+  );
308
+
309
+
310
+/**
311
+  Aborts an asynchronous transmit or receive request.
312
+
313
+  @param  This  The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
314
+  @param  Token The pointer to a token that has been issued by
315
+                EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
316
+                EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If
317
+                NULL, all pending tokens are aborted.
318
+
319
+  @retval  EFI_SUCCESS           The asynchronous I/O request was aborted and Token.Event
320
+                                 was signaled. When Token is NULL, all pending requests were
321
+                                 aborted and their events were signaled.
322
+  @retval  EFI_NOT_STARTED       This MNP child driver instance has not been configured.
323
+  @retval  EFI_INVALID_PARAMETER This is NULL.
324
+  @retval  EFI_NOT_FOUND         When Token is not NULL, the asynchronous I/O request was
325
+                                 not found in the transmit or receive queue. It has either completed
326
+                                 or was not issued by Transmit() and Receive().
327
+
328
+**/
329
+typedef
330
+EFI_STATUS
331
+(EFIAPI *EFI_MANAGED_NETWORK_CANCEL)(
332
+  IN EFI_MANAGED_NETWORK_PROTOCOL          *This,
333
+  IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN  *Token  OPTIONAL
334
+  );
335
+
336
+/**
337
+  Polls for incoming data packets and processes outgoing data packets.
338
+
339
+  @param  This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
340
+
341
+  @retval EFI_SUCCESS      Incoming or outgoing data was processed.
342
+  @retval EFI_NOT_STARTED  This MNP child driver instance has not been configured.
343
+  @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
344
+  @retval EFI_NOT_READY    No incoming or outgoing data was processed. Consider increasing
345
+                           the polling rate.
346
+  @retval EFI_TIMEOUT      Data was dropped out of the transmit and/or receive queue.
347
+                            Consider increasing the polling rate.
348
+
349
+**/
350
+typedef
351
+EFI_STATUS
352
+(EFIAPI *EFI_MANAGED_NETWORK_POLL)(
353
+  IN EFI_MANAGED_NETWORK_PROTOCOL    *This
354
+  );
355
+
356
+///
357
+/// The MNP is used by network applications (and drivers) to
358
+/// perform raw (unformatted) asynchronous network packet I/O.
359
+///
360
+struct _EFI_MANAGED_NETWORK_PROTOCOL {
361
+  EFI_MANAGED_NETWORK_GET_MODE_DATA       GetModeData;
362
+  EFI_MANAGED_NETWORK_CONFIGURE           Configure;
363
+  EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC     McastIpToMac;
364
+  EFI_MANAGED_NETWORK_GROUPS              Groups;
365
+  EFI_MANAGED_NETWORK_TRANSMIT            Transmit;
366
+  EFI_MANAGED_NETWORK_RECEIVE             Receive;
367
+  EFI_MANAGED_NETWORK_CANCEL              Cancel;
368
+  EFI_MANAGED_NETWORK_POLL                Poll;
369
+};
370
+
371
+extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;
372
+extern EFI_GUID gEfiManagedNetworkProtocolGuid;
373
+
374
+#endif

+ 595
- 0
src/include/ipxe/efi/Protocol/Mtftp4.h 파일 보기

@@ -0,0 +1,595 @@
1
+/** @file
2
+  EFI Multicast Trivial File Tranfer Protocol Definition
3
+
4
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5
+This program and the accompanying materials are licensed and made available under
6
+the terms and conditions of the BSD License that accompanies this distribution.
7
+The full text of the license may be found at
8
+http://opensource.org/licenses/bsd-license.php.
9
+
10
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
+
13
+  @par Revision Reference:
14
+  This Protocol is introduced in UEFI Specification 2.0
15
+
16
+**/
17
+
18
+#ifndef __EFI_MTFTP4_PROTOCOL_H__
19
+#define __EFI_MTFTP4_PROTOCOL_H__
20
+
21
+FILE_LICENCE ( BSD3 );
22
+
23
+#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \
24
+  { \
25
+    0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } \
26
+  }
27
+
28
+#define EFI_MTFTP4_PROTOCOL_GUID \
29
+  { \
30
+    0x78247c57, 0x63db, 0x4708, {0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b } \
31
+  }
32
+
33
+typedef struct _EFI_MTFTP4_PROTOCOL EFI_MTFTP4_PROTOCOL;
34
+typedef struct _EFI_MTFTP4_TOKEN EFI_MTFTP4_TOKEN;
35
+
36
+//
37
+//MTFTP4 packet opcode definition
38
+//
39
+#define EFI_MTFTP4_OPCODE_RRQ                     1
40
+#define EFI_MTFTP4_OPCODE_WRQ                     2
41
+#define EFI_MTFTP4_OPCODE_DATA                    3
42
+#define EFI_MTFTP4_OPCODE_ACK                     4
43
+#define EFI_MTFTP4_OPCODE_ERROR                   5
44
+#define EFI_MTFTP4_OPCODE_OACK                    6
45
+#define EFI_MTFTP4_OPCODE_DIR                     7
46
+#define EFI_MTFTP4_OPCODE_DATA8                   8
47
+#define EFI_MTFTP4_OPCODE_ACK8                    9
48
+
49
+//
50
+// MTFTP4 error code definition
51
+//
52
+#define EFI_MTFTP4_ERRORCODE_NOT_DEFINED          0
53
+#define EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND       1
54
+#define EFI_MTFTP4_ERRORCODE_ACCESS_VIOLATION     2
55
+#define EFI_MTFTP4_ERRORCODE_DISK_FULL            3
56
+#define EFI_MTFTP4_ERRORCODE_ILLEGAL_OPERATION    4
57
+#define EFI_MTFTP4_ERRORCODE_UNKNOWN_TRANSFER_ID  5
58
+#define EFI_MTFTP4_ERRORCODE_FILE_ALREADY_EXISTS  6
59
+#define EFI_MTFTP4_ERRORCODE_NO_SUCH_USER         7
60
+#define EFI_MTFTP4_ERRORCODE_REQUEST_DENIED       8
61
+
62
+//
63
+// MTFTP4 pacekt definitions
64
+//
65
+#pragma pack(1)
66
+
67
+typedef struct {
68
+  UINT16                  OpCode;
69
+  UINT8                   Filename[1];
70
+} EFI_MTFTP4_REQ_HEADER;
71
+
72
+typedef struct {
73
+  UINT16                  OpCode;
74
+  UINT8                   Data[1];
75
+} EFI_MTFTP4_OACK_HEADER;
76
+
77
+typedef struct {
78
+  UINT16                  OpCode;
79
+  UINT16                  Block;
80
+  UINT8                   Data[1];
81
+} EFI_MTFTP4_DATA_HEADER;
82
+
83
+typedef struct {
84
+  UINT16                  OpCode;
85
+  UINT16                  Block[1];
86
+} EFI_MTFTP4_ACK_HEADER;
87
+
88
+typedef struct {
89
+  UINT16                  OpCode;
90
+  UINT64                  Block;
91
+  UINT8                   Data[1];
92
+} EFI_MTFTP4_DATA8_HEADER;
93
+
94
+typedef struct {
95
+  UINT16                  OpCode;
96
+  UINT64                  Block[1];
97
+} EFI_MTFTP4_ACK8_HEADER;
98
+
99
+typedef struct {
100
+  UINT16                  OpCode;
101
+  UINT16                  ErrorCode;
102
+  UINT8                   ErrorMessage[1];
103
+} EFI_MTFTP4_ERROR_HEADER;
104
+
105
+typedef union {
106
+  ///
107
+  /// Type of packets as defined by the MTFTPv4 packet opcodes.
108
+  ///
109
+  UINT16                  OpCode;
110
+  ///
111
+  /// Read request packet header.
112
+  ///
113
+  EFI_MTFTP4_REQ_HEADER   Rrq;
114
+  ///
115
+  /// Write request packet header.
116
+  ///
117
+  EFI_MTFTP4_REQ_HEADER   Wrq;
118
+  ///
119
+  /// Option acknowledge packet header.
120
+  ///
121
+  EFI_MTFTP4_OACK_HEADER  Oack;
122
+  ///
123
+  /// Data packet header.
124
+  ///
125
+  EFI_MTFTP4_DATA_HEADER  Data;
126
+  ///
127
+  /// Acknowledgement packet header.
128
+  ///
129
+  EFI_MTFTP4_ACK_HEADER   Ack;
130
+  ///
131
+  /// Data packet header with big block number.
132
+  ///
133
+  EFI_MTFTP4_DATA8_HEADER Data8;
134
+  ///
135
+  /// Acknowledgement header with big block num.
136
+  ///
137
+  EFI_MTFTP4_ACK8_HEADER  Ack8;
138
+  ///
139
+  /// Error packet header.
140
+  ///
141
+  EFI_MTFTP4_ERROR_HEADER Error;
142
+} EFI_MTFTP4_PACKET;
143
+
144
+#pragma pack()
145
+
146
+///
147
+/// MTFTP4 option definition.
148
+///
149
+typedef struct {
150
+  UINT8                   *OptionStr;
151
+  UINT8                   *ValueStr;
152
+} EFI_MTFTP4_OPTION;
153
+
154
+
155
+typedef struct {
156
+  BOOLEAN                 UseDefaultSetting;
157
+  EFI_IPv4_ADDRESS        StationIp;
158
+  EFI_IPv4_ADDRESS        SubnetMask;
159
+  UINT16                  LocalPort;
160
+  EFI_IPv4_ADDRESS        GatewayIp;
161
+  EFI_IPv4_ADDRESS        ServerIp;
162
+  UINT16                  InitialServerPort;
163
+  UINT16                  TryCount;
164
+  UINT16                  TimeoutValue;
165
+} EFI_MTFTP4_CONFIG_DATA;
166
+
167
+
168
+typedef struct {
169
+  EFI_MTFTP4_CONFIG_DATA  ConfigData;
170
+  UINT8                   SupportedOptionCount;
171
+  UINT8                   **SupportedOptoins;
172
+  UINT8                   UnsupportedOptionCount;
173
+  UINT8                   **UnsupportedOptoins;
174
+} EFI_MTFTP4_MODE_DATA;
175
+
176
+
177
+typedef struct {
178
+  EFI_IPv4_ADDRESS        GatewayIp;
179
+  EFI_IPv4_ADDRESS        ServerIp;
180
+  UINT16                  ServerPort;
181
+  UINT16                  TryCount;
182
+  UINT16                  TimeoutValue;
183
+} EFI_MTFTP4_OVERRIDE_DATA;
184
+
185
+//
186
+// Protocol interfaces definition
187
+//
188
+
189
+/**
190
+  A callback function that is provided by the caller to intercept
191
+  the EFI_MTFTP4_OPCODE_DATA or EFI_MTFTP4_OPCODE_DATA8 packets processed in the
192
+  EFI_MTFTP4_PROTOCOL.ReadFile() function, and alternatively to intercept
193
+  EFI_MTFTP4_OPCODE_OACK or EFI_MTFTP4_OPCODE_ERROR packets during a call to
194
+  EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile() or ReadDirectory().
195
+
196
+  @param  This        The pointer to the EFI_MTFTP4_PROTOCOL instance.
197
+  @param  Token       The token that the caller provided in the
198
+                      EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile()
199
+                      or ReadDirectory() function.
200
+  @param  PacketLen   Indicates the length of the packet.
201
+  @param  Packet      The pointer to an MTFTPv4 packet.
202
+
203
+  @retval EFI_SUCCESS The operation was successful.
204
+  @retval Others      Aborts the transfer process.
205
+
206
+**/
207
+typedef
208
+EFI_STATUS
209
+(EFIAPI *EFI_MTFTP4_CHECK_PACKET)(
210
+  IN EFI_MTFTP4_PROTOCOL  *This,
211
+  IN EFI_MTFTP4_TOKEN     *Token,
212
+  IN UINT16               PacketLen,
213
+  IN EFI_MTFTP4_PACKET    *Paket
214
+  );
215
+
216
+/**
217
+  Timeout callback funtion.
218
+
219
+  @param  This           The pointer to the EFI_MTFTP4_PROTOCOL instance.
220
+  @param  Token          The token that is provided in the
221
+                         EFI_MTFTP4_PROTOCOL.ReadFile() or
222
+                         EFI_MTFTP4_PROTOCOL.WriteFile() or
223
+                         EFI_MTFTP4_PROTOCOL.ReadDirectory() functions
224
+                         by the caller.
225
+
226
+  @retval EFI_SUCCESS   The operation was successful.
227
+  @retval Others        Aborts download process.
228
+
229
+**/
230
+typedef
231
+EFI_STATUS
232
+(EFIAPI *EFI_MTFTP4_TIMEOUT_CALLBACK)(
233
+  IN EFI_MTFTP4_PROTOCOL  *This,
234
+  IN EFI_MTFTP4_TOKEN     *Token
235
+  );
236
+
237
+/**
238
+  A callback function that the caller provides to feed data to the
239
+  EFI_MTFTP4_PROTOCOL.WriteFile() function.
240
+
241
+  @param  This   The pointer to the EFI_MTFTP4_PROTOCOL instance.
242
+  @param  Token  The token provided in the
243
+                 EFI_MTFTP4_PROTOCOL.WriteFile() by the caller.
244
+  @param  Length Indicates the length of the raw data wanted on input, and the
245
+                 length the data available on output.
246
+  @param  Buffer The pointer to the buffer where the data is stored.
247
+
248
+  @retval EFI_SUCCESS The operation was successful.
249
+  @retval Others      Aborts session.
250
+
251
+**/
252
+typedef
253
+EFI_STATUS
254
+(EFIAPI *EFI_MTFTP4_PACKET_NEEDED)(
255
+  IN  EFI_MTFTP4_PROTOCOL *This,
256
+  IN  EFI_MTFTP4_TOKEN    *Token,
257
+  IN  OUT UINT16          *Length,
258
+  OUT VOID                **Buffer
259
+  );
260
+
261
+
262
+/**
263
+  Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
264
+
265
+  @param  This     The pointer to the EFI_MTFTP4_PROTOCOL instance.
266
+  @param  ModeData The pointer to storage for the EFI MTFTPv4 Protocol driver mode data.
267
+
268
+  @retval EFI_SUCCESS           The configuration data was successfully returned.
269
+  @retval EFI_OUT_OF_RESOURCES  The required mode data could not be allocated.
270
+  @retval EFI_INVALID_PARAMETER This is NULL or ModeData is NULL.
271
+
272
+**/
273
+typedef
274
+EFI_STATUS
275
+(EFIAPI *EFI_MTFTP4_GET_MODE_DATA)(
276
+  IN  EFI_MTFTP4_PROTOCOL     *This,
277
+  OUT EFI_MTFTP4_MODE_DATA    *ModeData
278
+  );
279
+
280
+
281
+/**
282
+  Initializes, changes, or resets the default operational setting for this
283
+  EFI MTFTPv4 Protocol driver instance.
284
+
285
+  @param  This            The pointer to the EFI_MTFTP4_PROTOCOL instance.
286
+  @param  MtftpConfigData The pointer to the configuration data structure.
287
+
288
+  @retval EFI_SUCCESS           The EFI MTFTPv4 Protocol driver was configured successfully.
289
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
290
+  @retval EFI_ACCESS_DENIED     The EFI configuration could not be changed at this time because
291
+                                there is one MTFTP background operation in progress.
292
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,
293
+                                RARP, etc.) has not finished yet.
294
+  @retval EFI_UNSUPPORTED       A configuration protocol (DHCP, BOOTP, RARP, etc.) could not
295
+                                be located when clients choose to use the default address
296
+                                settings.
297
+  @retval EFI_OUT_OF_RESOURCES  The EFI MTFTPv4 Protocol driver instance data could not be
298
+                                allocated.
299
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred. The EFI
300
+                                 MTFTPv4 Protocol driver instance is not configured.
301
+
302
+**/
303
+typedef
304
+EFI_STATUS
305
+(EFIAPI *EFI_MTFTP4_CONFIGURE)(
306
+  IN EFI_MTFTP4_PROTOCOL       *This,
307
+  IN EFI_MTFTP4_CONFIG_DATA    *MtftpConfigData OPTIONAL
308
+  );
309
+
310
+
311
+/**
312
+  Gets information about a file from an MTFTPv4 server.
313
+
314
+  @param  This         The pointer to the EFI_MTFTP4_PROTOCOL instance.
315
+  @param  OverrideData Data that is used to override the existing parameters. If NULL,
316
+                       the default parameters that were set in the
317
+                       EFI_MTFTP4_PROTOCOL.Configure() function are used.
318
+  @param  Filename     The pointer to null-terminated ASCII file name string.
319
+  @param  ModeStr      The pointer to null-terminated ASCII mode string. If NULL, "octet" will be used.
320
+  @param  OptionCount  Number of option/value string pairs in OptionList.
321
+  @param  OptionList   The pointer to array of option/value string pairs. Ignored if
322
+                       OptionCount is zero.
323
+  @param  PacketLength The number of bytes in the returned packet.
324
+  @param  Packet       The pointer to the received packet. This buffer must be freed by
325
+                       the caller.
326
+
327
+  @retval EFI_SUCCESS              An MTFTPv4 OACK packet was received and is in the Packet.
328
+  @retval EFI_INVALID_PARAMETER    One or more of the following conditions is TRUE:
329
+                                   - This is NULL.
330
+                                   - Filename is NULL.
331
+                                   - OptionCount is not zero and OptionList is NULL.
332
+                                   - One or more options in OptionList have wrong format.
333
+                                   - PacketLength is NULL.
334
+                                   - One or more IPv4 addresses in OverrideData are not valid
335
+                                     unicast IPv4 addresses if OverrideData is not NULL.
336
+  @retval EFI_UNSUPPORTED          One or more options in the OptionList are in the
337
+                                   unsupported list of structure EFI_MTFTP4_MODE_DATA.
338
+  @retval EFI_NOT_STARTED          The EFI MTFTPv4 Protocol driver has not been started.
339
+  @retval EFI_NO_MAPPING           When using a default address, configuration (DHCP, BOOTP,
340
+                                   RARP, etc.) has not finished yet.
341
+  @retval EFI_ACCESS_DENIED        The previous operation has not completed yet.
342
+  @retval EFI_OUT_OF_RESOURCES     Required system resources could not be allocated.
343
+  @retval EFI_TFTP_ERROR           An MTFTPv4 ERROR packet was received and is in the Packet.
344
+  @retval EFI_NETWORK_UNREACHABLE  An ICMP network unreachable error packet was received and the Packet is set to NULL.
345
+  @retval EFI_HOST_UNREACHABLE     An ICMP host unreachable error packet was received and the Packet is set to NULL.
346
+  @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received and the Packet is set to NULL.
347
+  @retval EFI_PORT_UNREACHABLE     An ICMP port unreachable error packet was received and the Packet is set to NULL.
348
+  @retval EFI_ICMP_ERROR           Some other ICMP ERROR packet was received and is in the Buffer.
349
+  @retval EFI_PROTOCOL_ERROR       An unexpected MTFTPv4 packet was received and is in the Packet.
350
+  @retval EFI_TIMEOUT              No responses were received from the MTFTPv4 server.
351
+  @retval EFI_DEVICE_ERROR         An unexpected network error or system error occurred.
352
+  @retval EFI_NO_MEDIA             There was a media error.
353
+
354
+**/
355
+typedef
356
+EFI_STATUS
357
+(EFIAPI *EFI_MTFTP4_GET_INFO)(
358
+  IN  EFI_MTFTP4_PROTOCOL      *This,
359
+  IN  EFI_MTFTP4_OVERRIDE_DATA *OverrideData   OPTIONAL,
360
+  IN  UINT8                    *Filename,
361
+  IN  UINT8                    *ModeStr        OPTIONAL,
362
+  IN  UINT8                    OptionCount,
363
+  IN  EFI_MTFTP4_OPTION        *OptionList,
364
+  OUT UINT32                   *PacketLength,
365
+  OUT EFI_MTFTP4_PACKET        **Packet        OPTIONAL
366
+  );
367
+
368
+/**
369
+  Parses the options in an MTFTPv4 OACK packet.
370
+
371
+  @param  This         The pointer to the EFI_MTFTP4_PROTOCOL instance.
372
+  @param  PacketLen    Length of the OACK packet to be parsed.
373
+  @param  Packet       The pointer to the OACK packet to be parsed.
374
+  @param  OptionCount  The pointer to the number of options in following OptionList.
375
+  @param  OptionList   The pointer to EFI_MTFTP4_OPTION storage. Call the EFI Boot
376
+                       Service FreePool() to release the OptionList if the options
377
+                       in this OptionList are not needed any more.
378
+
379
+  @retval EFI_SUCCESS           The OACK packet was valid and the OptionCount and
380
+                                OptionList parameters have been updated.
381
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
382
+                                - PacketLen is 0.
383
+                                - Packet is NULL or Packet is not a valid MTFTPv4 packet.
384
+                                - OptionCount is NULL.
385
+  @retval EFI_NOT_FOUND         No options were found in the OACK packet.
386
+  @retval EFI_OUT_OF_RESOURCES  Storage for the OptionList array cannot be allocated.
387
+  @retval EFI_PROTOCOL_ERROR    One or more of the option fields is invalid.
388
+
389
+**/
390
+typedef
391
+EFI_STATUS
392
+(EFIAPI *EFI_MTFTP4_PARSE_OPTIONS)(
393
+  IN  EFI_MTFTP4_PROTOCOL      *This,
394
+  IN  UINT32                   PacketLen,
395
+  IN  EFI_MTFTP4_PACKET        *Packet,
396
+  OUT UINT32                   *OptionCount,
397
+  OUT EFI_MTFTP4_OPTION        **OptionList OPTIONAL
398
+  );
399
+
400
+
401
+/**
402
+  Downloads a file from an MTFTPv4 server.
403
+
404
+  @param  This  The pointer to the EFI_MTFTP4_PROTOCOL instance.
405
+  @param  Token The pointer to the token structure to provide the parameters that are
406
+                used in this operation.
407
+
408
+  @retval EFI_SUCCESS              The data file has been transferred successfully.
409
+  @retval EFI_OUT_OF_RESOURCES     Required system resources could not be allocated.
410
+  @retval EFI_BUFFER_TOO_SMALL     BufferSize is not zero but not large enough to hold the
411
+                                   downloaded data in downloading process.
412
+  @retval EFI_ABORTED              Current operation is aborted by user.
413
+  @retval EFI_NETWORK_UNREACHABLE  An ICMP network unreachable error packet was received.
414
+  @retval EFI_HOST_UNREACHABLE     An ICMP host unreachable error packet was received.
415
+  @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received.
416
+  @retval EFI_PORT_UNREACHABLE     An ICMP port unreachable error packet was received.
417
+  @retval EFI_ICMP_ERROR           Some other  ICMP ERROR packet was received.
418
+  @retval EFI_TIMEOUT              No responses were received from the MTFTPv4 server.
419
+  @retval EFI_TFTP_ERROR           An MTFTPv4 ERROR packet was received.
420
+  @retval EFI_DEVICE_ERROR         An unexpected network error or system error occurred.
421
+  @retval EFI_NO_MEDIA             There was a media error.
422
+
423
+**/
424
+typedef
425
+EFI_STATUS
426
+(EFIAPI *EFI_MTFTP4_READ_FILE)(
427
+  IN EFI_MTFTP4_PROTOCOL       *This,
428
+  IN EFI_MTFTP4_TOKEN          *Token
429
+  );
430
+
431
+
432
+
433
+/**
434
+  Sends a file to an MTFTPv4 server.
435
+
436
+  @param  This  The pointer to the EFI_MTFTP4_PROTOCOL instance.
437
+  @param  Token The pointer to the token structure to provide the parameters that are
438
+                used in this operation.
439
+
440
+  @retval EFI_SUCCESS           The upload session has started.
441
+  @retval EFI_UNSUPPORTED       The operation is not supported by this implementation.
442
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
443
+  @retval EFI_UNSUPPORTED       One or more options in the Token.OptionList are in
444
+                                the unsupported list of structure EFI_MTFTP4_MODE_DATA.
445
+  @retval EFI_NOT_STARTED       The EFI MTFTPv4 Protocol driver has not been started.
446
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,
447
+                                RARP, etc.) is not finished yet.
448
+  @retval EFI_ALREADY_STARTED   This Token is already being used in another MTFTPv4 session.
449
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.
450
+  @retval EFI_ACCESS_DENIED     The previous operation has not completed yet.
451
+  @retval EFI_DEVICE_ERROR      An unexpected network error or system error occurred.
452
+
453
+**/
454
+typedef
455
+EFI_STATUS
456
+(EFIAPI *EFI_MTFTP4_WRITE_FILE)(
457
+  IN EFI_MTFTP4_PROTOCOL       *This,
458
+  IN EFI_MTFTP4_TOKEN          *Token
459
+  );
460
+
461
+
462
+/**
463
+  Downloads a data file "directory" from an MTFTPv4 server. May be unsupported in some EFI
464
+  implementations.
465
+
466
+  @param  This  The pointer to the EFI_MTFTP4_PROTOCOL instance.
467
+  @param  Token The pointer to the token structure to provide the parameters that are
468
+                used in this operation.
469
+
470
+  @retval EFI_SUCCESS           The MTFTPv4 related file "directory" has been downloaded.
471
+  @retval EFI_UNSUPPORTED       The operation is not supported by this implementation.
472
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
473
+  @retval EFI_UNSUPPORTED       One or more options in the Token.OptionList are in
474
+                                the unsupported list of structure EFI_MTFTP4_MODE_DATA.
475
+  @retval EFI_NOT_STARTED       The EFI MTFTPv4 Protocol driver has not been started.
476
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,
477
+                                RARP, etc.) is not finished yet.
478
+  @retval EFI_ALREADY_STARTED   This Token is already being used in another MTFTPv4 session.
479
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.
480
+  @retval EFI_ACCESS_DENIED     The previous operation has not completed yet.
481
+  @retval EFI_DEVICE_ERROR      An unexpected network error or system error occurred.
482
+
483
+**/
484
+typedef
485
+EFI_STATUS
486
+(EFIAPI *EFI_MTFTP4_READ_DIRECTORY)(
487
+  IN EFI_MTFTP4_PROTOCOL       *This,
488
+  IN EFI_MTFTP4_TOKEN          *Token
489
+  );
490
+
491
+/**
492
+  Polls for incoming data packets and processes outgoing data packets.
493
+
494
+  @param  This The pointer to the EFI_MTFTP4_PROTOCOL instance.
495
+
496
+  @retval  EFI_SUCCESS           Incoming or outgoing data was processed.
497
+  @retval  EFI_NOT_STARTED       This EFI MTFTPv4 Protocol instance has not been started.
498
+  @retval  EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,
499
+                                 RARP, etc.) is not finished yet.
500
+  @retval  EFI_INVALID_PARAMETER This is NULL.
501
+  @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.
502
+  @retval  EFI_TIMEOUT           Data was dropped out of the transmit and/or receive queue.
503
+                                 Consider increasing the polling rate.
504
+
505
+**/
506
+typedef
507
+EFI_STATUS
508
+(EFIAPI *EFI_MTFTP4_POLL)(
509
+  IN EFI_MTFTP4_PROTOCOL       *This
510
+  );
511
+
512
+///
513
+/// The EFI_MTFTP4_PROTOCOL is designed to be used by UEFI drivers and applications
514
+/// to transmit and receive data files. The EFI MTFTPv4 Protocol driver uses
515
+/// the underlying EFI UDPv4 Protocol driver and EFI IPv4 Protocol driver.
516
+///
517
+struct _EFI_MTFTP4_PROTOCOL {
518
+  EFI_MTFTP4_GET_MODE_DATA     GetModeData;
519
+  EFI_MTFTP4_CONFIGURE         Configure;
520
+  EFI_MTFTP4_GET_INFO          GetInfo;
521
+  EFI_MTFTP4_PARSE_OPTIONS     ParseOptions;
522
+  EFI_MTFTP4_READ_FILE         ReadFile;
523
+  EFI_MTFTP4_WRITE_FILE        WriteFile;
524
+  EFI_MTFTP4_READ_DIRECTORY    ReadDirectory;
525
+  EFI_MTFTP4_POLL              Poll;
526
+};
527
+
528
+struct _EFI_MTFTP4_TOKEN {
529
+  ///
530
+  /// The status that is returned to the caller at the end of the operation
531
+  /// to indicate whether this operation completed successfully.
532
+  ///
533
+  EFI_STATUS                  Status;
534
+  ///
535
+  /// The event that will be signaled when the operation completes. If
536
+  /// set to NULL, the corresponding function will wait until the read or
537
+  /// write operation finishes. The type of Event must be
538
+  /// EVT_NOTIFY_SIGNAL. The Task Priority Level (TPL) of
539
+  /// Event must be lower than or equal to TPL_CALLBACK.
540
+  ///
541
+  EFI_EVENT                   Event;
542
+  ///
543
+  /// If not NULL, the data that will be used to override the existing configure data.
544
+  ///
545
+  EFI_MTFTP4_OVERRIDE_DATA    *OverrideData;
546
+  ///
547
+  /// The pointer to the null-terminated ASCII file name string.
548
+  ///
549
+  UINT8                       *Filename;
550
+  ///
551
+  /// The pointer to the null-terminated ASCII mode string. If NULL, "octet" is used.
552
+  ///
553
+  UINT8                       *ModeStr;
554
+  ///
555
+  /// Number of option/value string pairs.
556
+  ///
557
+  UINT32                      OptionCount;
558
+  ///
559
+  /// The pointer to an array of option/value string pairs. Ignored if OptionCount is zero.
560
+  ///
561
+  EFI_MTFTP4_OPTION           *OptionList;
562
+  ///
563
+  /// The size of the data buffer.
564
+  ///
565
+  UINT64                      BufferSize;
566
+  ///
567
+  /// The pointer to the data buffer. Data that is downloaded from the
568
+  /// MTFTPv4 server is stored here. Data that is uploaded to the
569
+  /// MTFTPv4 server is read from here. Ignored if BufferSize is zero.
570
+  ///
571
+  VOID                        *Buffer;
572
+  ///
573
+  /// The pointer to the context that will be used by CheckPacket,
574
+  /// TimeoutCallback and PacketNeeded.
575
+  ///
576
+  VOID                        *Context;
577
+  ///
578
+  /// The pointer to the callback function to check the contents of the received packet.
579
+  ///
580
+  EFI_MTFTP4_CHECK_PACKET     CheckPacket;
581
+  ///
582
+  /// The pointer to the function to be called when a timeout occurs.
583
+  ///
584
+  EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback;
585
+  ///
586
+  /// The pointer to the function to provide the needed packet contents.
587
+  ///
588
+  EFI_MTFTP4_PACKET_NEEDED    PacketNeeded;
589
+};
590
+
591
+extern EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid;
592
+extern EFI_GUID gEfiMtftp4ProtocolGuid;
593
+
594
+#endif
595
+

+ 579
- 0
src/include/ipxe/efi/Protocol/Tcp4.h 파일 보기

@@ -0,0 +1,579 @@
1
+/** @file
2
+  EFI TCPv4(Transmission Control Protocol version 4) Protocol Definition
3
+  The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create
4
+  and destroy child of the driver to communicate with other host using TCP protocol.
5
+  The EFI TCPv4 Protocol provides services to send and receive data stream.
6
+
7
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
8
+This program and the accompanying materials are licensed and made available under
9
+the terms and conditions of the BSD License that accompanies this distribution.
10
+The full text of the license may be found at
11
+http://opensource.org/licenses/bsd-license.php.
12
+
13
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
+
16
+  @par Revision Reference:
17
+  This Protocol is introduced in UEFI Specification 2.0.
18
+
19
+**/
20
+
21
+#ifndef __EFI_TCP4_PROTOCOL_H__
22
+#define __EFI_TCP4_PROTOCOL_H__
23
+
24
+FILE_LICENCE ( BSD3 );
25
+
26
+#include <ipxe/efi/Protocol/Ip4.h>
27
+
28
+#define EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID \
29
+  { \
30
+    0x00720665, 0x67EB, 0x4a99, {0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } \
31
+  }
32
+
33
+#define EFI_TCP4_PROTOCOL_GUID \
34
+  { \
35
+    0x65530BC7, 0xA359, 0x410f, {0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } \
36
+  }
37
+
38
+typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL;
39
+
40
+///
41
+/// EFI_TCP4_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more.
42
+/// The definition in here is only present to provide backwards compatability.
43
+///
44
+typedef struct {
45
+  EFI_HANDLE              InstanceHandle;
46
+  EFI_IPv4_ADDRESS        LocalAddress;
47
+  UINT16                  LocalPort;
48
+  EFI_IPv4_ADDRESS        RemoteAddress;
49
+  UINT16                  RemotePort;
50
+} EFI_TCP4_SERVICE_POINT;
51
+
52
+///
53
+/// EFI_TCP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.
54
+/// The definition in here is only present to provide backwards compatability.
55
+///
56
+typedef struct {
57
+  EFI_HANDLE              DriverHandle;
58
+  UINT32                  ServiceCount;
59
+  EFI_TCP4_SERVICE_POINT  Services[1];
60
+} EFI_TCP4_VARIABLE_DATA;
61
+
62
+typedef struct {
63
+  BOOLEAN                 UseDefaultAddress;
64
+  EFI_IPv4_ADDRESS        StationAddress;
65
+  EFI_IPv4_ADDRESS        SubnetMask;
66
+  UINT16                  StationPort;
67
+  EFI_IPv4_ADDRESS        RemoteAddress;
68
+  UINT16                  RemotePort;
69
+  BOOLEAN                 ActiveFlag;
70
+} EFI_TCP4_ACCESS_POINT;
71
+
72
+typedef struct {
73
+  UINT32                  ReceiveBufferSize;
74
+  UINT32                  SendBufferSize;
75
+  UINT32                  MaxSynBackLog;
76
+  UINT32                  ConnectionTimeout;
77
+  UINT32                  DataRetries;
78
+  UINT32                  FinTimeout;
79
+  UINT32                  TimeWaitTimeout;
80
+  UINT32                  KeepAliveProbes;
81
+  UINT32                  KeepAliveTime;
82
+  UINT32                  KeepAliveInterval;
83
+  BOOLEAN                 EnableNagle;
84
+  BOOLEAN                 EnableTimeStamp;
85
+  BOOLEAN                 EnableWindowScaling;
86
+  BOOLEAN                 EnableSelectiveAck;
87
+  BOOLEAN                 EnablePathMtuDiscovery;
88
+} EFI_TCP4_OPTION;
89
+
90
+typedef struct {
91
+  //
92
+  // I/O parameters
93
+  //
94
+  UINT8                   TypeOfService;
95
+  UINT8                   TimeToLive;
96
+
97
+  //
98
+  // Access Point
99
+  //
100
+  EFI_TCP4_ACCESS_POINT   AccessPoint;
101
+
102
+  //
103
+  // TCP Control Options
104
+  //
105
+  EFI_TCP4_OPTION         *ControlOption;
106
+} EFI_TCP4_CONFIG_DATA;
107
+
108
+///
109
+/// TCP4 connnection state
110
+///
111
+typedef enum {
112
+  Tcp4StateClosed         = 0,
113
+  Tcp4StateListen         = 1,
114
+  Tcp4StateSynSent        = 2,
115
+  Tcp4StateSynReceived    = 3,
116
+  Tcp4StateEstablished    = 4,
117
+  Tcp4StateFinWait1       = 5,
118
+  Tcp4StateFinWait2       = 6,
119
+  Tcp4StateClosing        = 7,
120
+  Tcp4StateTimeWait       = 8,
121
+  Tcp4StateCloseWait      = 9,
122
+  Tcp4StateLastAck        = 10
123
+} EFI_TCP4_CONNECTION_STATE;
124
+
125
+typedef struct {
126
+  EFI_EVENT   Event;
127
+  EFI_STATUS  Status;
128
+} EFI_TCP4_COMPLETION_TOKEN;
129
+
130
+typedef struct {
131
+  ///
132
+  /// The Status in the CompletionToken will be set to one of
133
+  /// the following values if the active open succeeds or an unexpected
134
+  /// error happens:
135
+  /// EFI_SUCCESS:              The active open succeeds and the instance's
136
+  ///                           state is Tcp4StateEstablished.
137
+  /// EFI_CONNECTION_RESET:     The connect fails because the connection is reset
138
+  ///                           either by instance itself or the communication peer.
139
+  /// EFI_CONNECTION_REFUSED:   The connect fails because this connection is initiated with
140
+  ///                           an active open and the connection is refused.
141
+  /// EFI_ABORTED:              The active open is aborted.
142
+  /// EFI_TIMEOUT:              The connection establishment timer expires and
143
+  ///                           no more specific information is available.
144
+  /// EFI_NETWORK_UNREACHABLE:  The active open fails because
145
+  ///                           an ICMP network unreachable error is received.
146
+  /// EFI_HOST_UNREACHABLE:     The active open fails because an
147
+  ///                           ICMP host unreachable error is received.
148
+  /// EFI_PROTOCOL_UNREACHABLE: The active open fails
149
+  ///                           because an ICMP protocol unreachable error is received.
150
+  /// EFI_PORT_UNREACHABLE:     The connection establishment
151
+  ///                           timer times out and an ICMP port unreachable error is received.
152
+  /// EFI_ICMP_ERROR:           The connection establishment timer timeout and some other ICMP
153
+  ///                           error is received.
154
+  /// EFI_DEVICE_ERROR:         An unexpected system or network error occurred.
155
+  /// EFI_NO_MEDIA:             There was a media error.
156
+  ///
157
+  EFI_TCP4_COMPLETION_TOKEN CompletionToken;
158
+} EFI_TCP4_CONNECTION_TOKEN;
159
+
160
+typedef struct {
161
+  EFI_TCP4_COMPLETION_TOKEN CompletionToken;
162
+  EFI_HANDLE                NewChildHandle;
163
+} EFI_TCP4_LISTEN_TOKEN;
164
+
165
+typedef struct {
166
+  UINT32 FragmentLength;
167
+  VOID   *FragmentBuffer;
168
+} EFI_TCP4_FRAGMENT_DATA;
169
+
170
+typedef struct {
171
+  BOOLEAN                   UrgentFlag;
172
+  UINT32                    DataLength;
173
+  UINT32                    FragmentCount;
174
+  EFI_TCP4_FRAGMENT_DATA    FragmentTable[1];
175
+} EFI_TCP4_RECEIVE_DATA;
176
+
177
+typedef struct {
178
+  BOOLEAN                   Push;
179
+  BOOLEAN                   Urgent;
180
+  UINT32                    DataLength;
181
+  UINT32                    FragmentCount;
182
+  EFI_TCP4_FRAGMENT_DATA    FragmentTable[1];
183
+} EFI_TCP4_TRANSMIT_DATA;
184
+
185
+typedef struct {
186
+  ///
187
+  /// When transmission finishes or meets any unexpected error it will
188
+  /// be set to one of the following values:
189
+  /// EFI_SUCCESS:              The receiving or transmission operation
190
+  ///                           completes successfully.
191
+  /// EFI_CONNECTION_FIN:       The receiving operation fails because the communication peer
192
+  ///                           has closed the connection and there is no more data in the
193
+  ///                           receive buffer of the instance.
194
+  /// EFI_CONNECTION_RESET:     The receiving or transmission operation fails
195
+  ///                           because this connection is reset either by instance
196
+  ///                           itself or the communication peer.
197
+  /// EFI_ABORTED:              The receiving or transmission is aborted.
198
+  /// EFI_TIMEOUT:              The transmission timer expires and no more
199
+  ///                           specific information is available.
200
+  /// EFI_NETWORK_UNREACHABLE:  The transmission fails
201
+  ///                           because an ICMP network unreachable error is received.
202
+  /// EFI_HOST_UNREACHABLE:     The transmission fails because an
203
+  ///                           ICMP host unreachable error is received.
204
+  /// EFI_PROTOCOL_UNREACHABLE: The transmission fails
205
+  ///                           because an ICMP protocol unreachable error is received.
206
+  /// EFI_PORT_UNREACHABLE:     The transmission fails and an
207
+  ///                           ICMP port unreachable error is received.
208
+  /// EFI_ICMP_ERROR:           The transmission fails and some other
209
+  ///                           ICMP error is received.
210
+  /// EFI_DEVICE_ERROR:         An unexpected system or network error occurs.
211
+  /// EFI_NO_MEDIA:             There was a media error.
212
+  ///
213
+  EFI_TCP4_COMPLETION_TOKEN CompletionToken;
214
+  union {
215
+    ///
216
+    /// When this token is used for receiving, RxData is a pointer to EFI_TCP4_RECEIVE_DATA.
217
+    ///
218
+    EFI_TCP4_RECEIVE_DATA   *RxData;
219
+    ///
220
+    /// When this token is used for transmitting, TxData is a pointer to EFI_TCP4_TRANSMIT_DATA.
221
+    ///
222
+    EFI_TCP4_TRANSMIT_DATA  *TxData;
223
+  } Packet;
224
+} EFI_TCP4_IO_TOKEN;
225
+
226
+typedef struct {
227
+  EFI_TCP4_COMPLETION_TOKEN CompletionToken;
228
+  BOOLEAN                   AbortOnClose;
229
+} EFI_TCP4_CLOSE_TOKEN;
230
+
231
+//
232
+// Interface definition for TCP4 protocol
233
+//
234
+
235
+/**
236
+  Get the current operational status.
237
+
238
+  @param  This           The pointer to the EFI_TCP4_PROTOCOL instance.
239
+  @param  Tcp4State      The pointer to the buffer to receive the current TCP state.
240
+  @param  Tcp4ConfigData The pointer to the buffer to receive the current TCP configuration.
241
+  @param  Ip4ModeData    The pointer to the buffer to receive the current IPv4 configuration
242
+                         data used by the TCPv4 instance.
243
+  @param  MnpConfigData  The pointer to the buffer to receive the current MNP configuration
244
+                         data used indirectly by the TCPv4 instance.
245
+  @param  SnpModeData    The pointer to the buffer to receive the current SNP configuration
246
+                         data used indirectly by the TCPv4 instance.
247
+
248
+  @retval EFI_SUCCESS           The mode data was read.
249
+  @retval EFI_INVALID_PARAMETER This is NULL.
250
+  @retval EFI_NOT_STARTED       No configuration data is available because this instance hasn't
251
+                                 been started.
252
+
253
+**/
254
+typedef
255
+EFI_STATUS
256
+(EFIAPI *EFI_TCP4_GET_MODE_DATA)(
257
+  IN   EFI_TCP4_PROTOCOL                  *This,
258
+  OUT  EFI_TCP4_CONNECTION_STATE          *Tcp4State      OPTIONAL,
259
+  OUT  EFI_TCP4_CONFIG_DATA               *Tcp4ConfigData OPTIONAL,
260
+  OUT  EFI_IP4_MODE_DATA                  *Ip4ModeData    OPTIONAL,
261
+  OUT  EFI_MANAGED_NETWORK_CONFIG_DATA    *MnpConfigData  OPTIONAL,
262
+  OUT  EFI_SIMPLE_NETWORK_MODE            *SnpModeData    OPTIONAL
263
+  );
264
+
265
+/**
266
+  Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.
267
+
268
+  @param  This           The pointer to the EFI_TCP4_PROTOCOL instance.
269
+  @param  Tcp4ConfigData The pointer to the configure data to configure the instance.
270
+
271
+  @retval EFI_SUCCESS           The operational settings are set, changed, or reset
272
+                                successfully.
273
+  @retval EFI_INVALID_PARAMETER Some parameter is invalid.
274
+  @retval EFI_NO_MAPPING        When using a default address, configuration (through
275
+                                DHCP, BOOTP, RARP, etc.) is not finished yet.
276
+  @retval EFI_ACCESS_DENIED     Configuring TCP instance when it is configured without
277
+                                calling Configure() with NULL to reset it.
278
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred.
279
+  @retval EFI_UNSUPPORTED       One or more of the control options are not supported in
280
+                                the implementation.
281
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough system resources when
282
+                                executing Configure().
283
+
284
+**/
285
+typedef
286
+EFI_STATUS
287
+(EFIAPI *EFI_TCP4_CONFIGURE)(
288
+  IN EFI_TCP4_PROTOCOL                   *This,
289
+  IN EFI_TCP4_CONFIG_DATA                *TcpConfigData OPTIONAL
290
+  );
291
+
292
+
293
+/**
294
+  Add or delete a route entry to the route table
295
+
296
+  @param  This           The pointer to the EFI_TCP4_PROTOCOL instance.
297
+  @param  DeleteRoute    Set it to TRUE to delete this route from the routing table. Set it to
298
+                         FALSE to add this route to the routing table.
299
+                         DestinationAddress and SubnetMask are used as the
300
+                         keywords to search route entry.
301
+  @param  SubnetAddress  The destination network.
302
+  @param  SubnetMask     The subnet mask of the destination network.
303
+  @param  GatewayAddress The gateway address for this route. It must be on the same
304
+                         subnet with the station address unless a direct route is specified.
305
+
306
+  @retval EFI_SUCCESS           The operation completed successfully.
307
+  @retval EFI_NOT_STARTED       The EFI TCPv4 Protocol instance has not been configured.
308
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,
309
+                                RARP, etc.) is not finished yet.
310
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
311
+                                - This is NULL.
312
+                                - SubnetAddress is NULL.
313
+                                - SubnetMask is NULL.
314
+                                - GatewayAddress is NULL.
315
+                                - *SubnetAddress is not NULL a valid subnet address.
316
+                                - *SubnetMask is not a valid subnet mask.
317
+                                - *GatewayAddress is not a valid unicast IP address or it
318
+                                is not in the same subnet.
319
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resources to add the entry to the
320
+                                routing table.
321
+  @retval EFI_NOT_FOUND         This route is not in the routing table.
322
+  @retval EFI_ACCESS_DENIED     The route is already defined in the routing table.
323
+  @retval EFI_UNSUPPORTED       The TCP driver does not support this operation.
324
+
325
+**/
326
+typedef
327
+EFI_STATUS
328
+(EFIAPI *EFI_TCP4_ROUTES)(
329
+  IN EFI_TCP4_PROTOCOL                   *This,
330
+  IN BOOLEAN                             DeleteRoute,
331
+  IN EFI_IPv4_ADDRESS                    *SubnetAddress,
332
+  IN EFI_IPv4_ADDRESS                    *SubnetMask,
333
+  IN EFI_IPv4_ADDRESS                    *GatewayAddress
334
+  );
335
+
336
+/**
337
+  Initiate a nonblocking TCP connection request for an active TCP instance.
338
+
339
+  @param  This                  The pointer to the EFI_TCP4_PROTOCOL instance.
340
+  @param  ConnectionToken       The pointer to the connection token to return when the TCP three
341
+                                way handshake finishes.
342
+
343
+  @retval EFI_SUCCESS           The connection request is successfully initiated and the state
344
+                                of this TCPv4 instance has been changed to Tcp4StateSynSent.
345
+  @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.
346
+  @retval EFI_ACCESS_DENIED     One or more of the following conditions are TRUE:
347
+                                - This instance is not configured as an active one.
348
+                                - This instance is not in Tcp4StateClosed state.
349
+  @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
350
+                                - This is NULL.
351
+                                - ConnectionToken is NULL.
352
+                                - ConnectionToken->CompletionToken.Event is NULL.
353
+  @retval EFI_OUT_OF_RESOURCES  The driver can't allocate enough resource to initiate the activ eopen.
354
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
355
+
356
+**/
357
+typedef
358
+EFI_STATUS
359
+(EFIAPI *EFI_TCP4_CONNECT)(
360
+  IN EFI_TCP4_PROTOCOL                   *This,
361
+  IN EFI_TCP4_CONNECTION_TOKEN           *ConnectionToken
362
+  );
363
+
364
+
365
+/**
366
+  Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation.
367
+
368
+  @param  This        The pointer to the EFI_TCP4_PROTOCOL instance.
369
+  @param  ListenToken The pointer to the listen token to return when operation finishes.
370
+
371
+  @retval EFI_SUCCESS           The listen token has been queued successfully.
372
+  @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.
373
+  @retval EFI_ACCESS_DENIED     One or more of the following are TRUE:
374
+                                - This instance is not a passive instance.
375
+                                - This instance is not in Tcp4StateListen state.
376
+                                - The same listen token has already existed in the listen
377
+                                token queue of this TCP instance.
378
+  @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
379
+                                - This is NULL.
380
+                                - ListenToken is NULL.
381
+                                - ListentToken->CompletionToken.Event is NULL.
382
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resource to finish the operation.
383
+  @retval EFI_DEVICE_ERROR      Any unexpected and not belonged to above category error.
384
+
385
+**/
386
+typedef
387
+EFI_STATUS
388
+(EFIAPI *EFI_TCP4_ACCEPT)(
389
+  IN EFI_TCP4_PROTOCOL                   *This,
390
+  IN EFI_TCP4_LISTEN_TOKEN               *ListenToken
391
+  );
392
+
393
+/**
394
+  Queues outgoing data into the transmit queue.
395
+
396
+  @param  This  The pointer to the EFI_TCP4_PROTOCOL instance.
397
+  @param  Token The pointer to the completion token to queue to the transmit queue.
398
+
399
+  @retval EFI_SUCCESS             The data has been queued for transmission.
400
+  @retval EFI_NOT_STARTED         This EFI TCPv4 Protocol instance has not been configured.
401
+  @retval EFI_NO_MAPPING          When using a default address, configuration (DHCP, BOOTP,
402
+                                  RARP, etc.) is not finished yet.
403
+  @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:
404
+                                  - This is NULL.
405
+                                  - Token is NULL.
406
+                                  - Token->CompletionToken.Event is NULL.
407
+                                  - Token->Packet.TxData is NULL L.
408
+                                  - Token->Packet.FragmentCount is zero.
409
+                                  - Token->Packet.DataLength is not equal to the sum of fragment lengths.
410
+  @retval EFI_ACCESS_DENIED       One or more of the following conditions is TRUE:
411
+                                  - A transmit completion token with the same Token->CompletionToken.Event
412
+                                  was already in the transmission queue.
413
+                                  - The current instance is in Tcp4StateClosed state.
414
+                                  - The current instance is a passive one and it is in
415
+                                  Tcp4StateListen state.
416
+                                  - User has called Close() to disconnect this connection.
417
+  @retval EFI_NOT_READY           The completion token could not be queued because the
418
+                                  transmit queue is full.
419
+  @retval EFI_OUT_OF_RESOURCES    Could not queue the transmit data because of resource
420
+                                  shortage.
421
+  @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address.
422
+
423
+**/
424
+typedef
425
+EFI_STATUS
426
+(EFIAPI *EFI_TCP4_TRANSMIT)(
427
+  IN EFI_TCP4_PROTOCOL                   *This,
428
+  IN EFI_TCP4_IO_TOKEN                   *Token
429
+  );
430
+
431
+
432
+/**
433
+  Places an asynchronous receive request into the receiving queue.
434
+
435
+  @param  This  The pointer to the EFI_TCP4_PROTOCOL instance.
436
+  @param  Token The pointer to a token that is associated with the receive data
437
+                descriptor.
438
+
439
+  @retval EFI_SUCCESS           The receive completion token was cached.
440
+  @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.
441
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP, RARP,
442
+                                etc.) is not finished yet.
443
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
444
+                                - This is NULL.
445
+                                - Token is NULL.
446
+                                - Token->CompletionToken.Event is NULL.
447
+                                - Token->Packet.RxData is NULL.
448
+                                - Token->Packet.RxData->DataLength is 0.
449
+                                - The Token->Packet.RxData->DataLength is not
450
+                                the sum of all FragmentBuffer length in FragmentTable.
451
+  @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of
452
+                               system resources (usually memory).
453
+  @retval EFI_DEVICE_ERROR     An unexpected system or network error occurred.
454
+  @retval EFI_ACCESS_DENIED    One or more of the following conditions is TRUE:
455
+                               - A receive completion token with the same Token-
456
+                               >CompletionToken.Event was already in the receive
457
+                               queue.
458
+                               - The current instance is in Tcp4StateClosed state.
459
+                               - The current instance is a passive one and it is in
460
+                               Tcp4StateListen state.
461
+                               - User has called Close() to disconnect this connection.
462
+  @retval EFI_CONNECTION_FIN   The communication peer has closed the connection and there is
463
+                               no any buffered data in the receive buffer of this instance.
464
+  @retval EFI_NOT_READY        The receive request could not be queued because the receive queue is full.
465
+
466
+**/
467
+typedef
468
+EFI_STATUS
469
+(EFIAPI *EFI_TCP4_RECEIVE)(
470
+  IN EFI_TCP4_PROTOCOL                   *This,
471
+  IN EFI_TCP4_IO_TOKEN                   *Token
472
+  );
473
+
474
+/**
475
+  Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a
476
+  nonblocking operation.
477
+
478
+  @param  This       The pointer to the EFI_TCP4_PROTOCOL instance.
479
+  @param  CloseToken The pointer to the close token to return when operation finishes.
480
+
481
+  @retval EFI_SUCCESS           The Close() is called successfully.
482
+  @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.
483
+  @retval EFI_ACCESS_DENIED     One or more of the following are TRUE:
484
+                                - Configure() has been called with
485
+                                TcpConfigData set to NULL and this function has
486
+                                not returned.
487
+                                - Previous Close() call on this instance has not
488
+                                finished.
489
+  @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
490
+                                - This is NULL.
491
+                                - CloseToken is NULL.
492
+                                - CloseToken->CompletionToken.Event is NULL.
493
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resource to finish the operation.
494
+  @retval EFI_DEVICE_ERROR      Any unexpected and not belonged to above category error.
495
+
496
+**/
497
+typedef
498
+EFI_STATUS
499
+(EFIAPI *EFI_TCP4_CLOSE)(
500
+  IN EFI_TCP4_PROTOCOL                   *This,
501
+  IN EFI_TCP4_CLOSE_TOKEN                *CloseToken
502
+  );
503
+
504
+/**
505
+  Abort an asynchronous connection, listen, transmission or receive request.
506
+
507
+  @param  This  The pointer to the EFI_TCP4_PROTOCOL instance.
508
+  @param  Token The pointer to a token that has been issued by
509
+                EFI_TCP4_PROTOCOL.Connect(),
510
+                EFI_TCP4_PROTOCOL.Accept(),
511
+                EFI_TCP4_PROTOCOL.Transmit() or
512
+                EFI_TCP4_PROTOCOL.Receive(). If NULL, all pending
513
+                tokens issued by above four functions will be aborted. Type
514
+                EFI_TCP4_COMPLETION_TOKEN is defined in
515
+                EFI_TCP4_PROTOCOL.Connect().
516
+
517
+  @retval  EFI_SUCCESS             The asynchronous I/O request is aborted and Token->Event
518
+                                   is signaled.
519
+  @retval  EFI_INVALID_PARAMETER   This is NULL.
520
+  @retval  EFI_NOT_STARTED         This instance hasn't been configured.
521
+  @retval  EFI_NO_MAPPING          When using the default address, configuration
522
+                                   (DHCP, BOOTP,RARP, etc.) hasn't finished yet.
523
+  @retval  EFI_NOT_FOUND           The asynchronous I/O request isn't found in the
524
+                                   transmission or receive queue. It has either
525
+                                   completed or wasn't issued by Transmit() and Receive().
526
+  @retval  EFI_UNSUPPORTED         The implementation does not support this function.
527
+
528
+**/
529
+typedef
530
+EFI_STATUS
531
+(EFIAPI *EFI_TCP4_CANCEL)(
532
+  IN EFI_TCP4_PROTOCOL                   *This,
533
+  IN EFI_TCP4_COMPLETION_TOKEN           *Token OPTIONAL
534
+  );
535
+
536
+
537
+/**
538
+  Poll to receive incoming data and transmit outgoing segments.
539
+
540
+  @param  This The pointer to the EFI_TCP4_PROTOCOL instance.
541
+
542
+  @retval  EFI_SUCCESS           Incoming or outgoing data was processed.
543
+  @retval  EFI_INVALID_PARAMETER This is NULL.
544
+  @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.
545
+  @retval  EFI_NOT_READY         No incoming or outgoing data is processed.
546
+  @retval  EFI_TIMEOUT           Data was dropped out of the transmission or receive queue.
547
+                                 Consider increasing the polling rate.
548
+
549
+**/
550
+typedef
551
+EFI_STATUS
552
+(EFIAPI *EFI_TCP4_POLL)(
553
+  IN EFI_TCP4_PROTOCOL                   *This
554
+  );
555
+
556
+///
557
+/// The EFI_TCP4_PROTOCOL defines the EFI TCPv4 Protocol child to be used by
558
+/// any network drivers or applications to send or receive data stream.
559
+/// It can either listen on a specified port as a service or actively connected
560
+/// to remote peer as a client. Each instance has its own independent settings,
561
+/// such as the routing table.
562
+///
563
+struct _EFI_TCP4_PROTOCOL {
564
+  EFI_TCP4_GET_MODE_DATA                 GetModeData;
565
+  EFI_TCP4_CONFIGURE                     Configure;
566
+  EFI_TCP4_ROUTES                        Routes;
567
+  EFI_TCP4_CONNECT                       Connect;
568
+  EFI_TCP4_ACCEPT                        Accept;
569
+  EFI_TCP4_TRANSMIT                      Transmit;
570
+  EFI_TCP4_RECEIVE                       Receive;
571
+  EFI_TCP4_CLOSE                         Close;
572
+  EFI_TCP4_CANCEL                        Cancel;
573
+  EFI_TCP4_POLL                          Poll;
574
+};
575
+
576
+extern EFI_GUID gEfiTcp4ServiceBindingProtocolGuid;
577
+extern EFI_GUID gEfiTcp4ProtocolGuid;
578
+
579
+#endif

+ 447
- 0
src/include/ipxe/efi/Protocol/Udp4.h 파일 보기

@@ -0,0 +1,447 @@
1
+/** @file
2
+  UDP4 Service Binding Protocol as defined in UEFI specification.
3
+
4
+  The EFI UDPv4 Protocol provides simple packet-oriented services
5
+  to transmit and receive UDP packets.
6
+
7
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
8
+This program and the accompanying materials are licensed and made available under
9
+the terms and conditions of the BSD License that accompanies this distribution.
10
+The full text of the license may be found at
11
+http://opensource.org/licenses/bsd-license.php.
12
+
13
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
+
16
+  @par Revision Reference:
17
+  This Protocol is introduced in UEFI Specification 2.0.
18
+
19
+**/
20
+
21
+#ifndef __EFI_UDP4_PROTOCOL_H__
22
+#define __EFI_UDP4_PROTOCOL_H__
23
+
24
+FILE_LICENCE ( BSD3 );
25
+
26
+#include <ipxe/efi/Protocol/Ip4.h>
27
+//
28
+//GUID definitions
29
+//
30
+#define EFI_UDP4_SERVICE_BINDING_PROTOCOL_GUID \
31
+  { \
32
+    0x83f01464, 0x99bd, 0x45e5, {0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6 } \
33
+  }
34
+
35
+#define EFI_UDP4_PROTOCOL_GUID \
36
+  { \
37
+    0x3ad9df29, 0x4501, 0x478d, {0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } \
38
+  }
39
+
40
+typedef struct _EFI_UDP4_PROTOCOL EFI_UDP4_PROTOCOL;
41
+
42
+///
43
+/// EFI_UDP4_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more.
44
+/// The definition in here is only present to provide backwards compatability.
45
+///
46
+typedef struct {
47
+  EFI_HANDLE              InstanceHandle;
48
+  EFI_IPv4_ADDRESS        LocalAddress;
49
+  UINT16                  LocalPort;
50
+  EFI_IPv4_ADDRESS        RemoteAddress;
51
+  UINT16                  RemotePort;
52
+} EFI_UDP4_SERVICE_POINT;
53
+
54
+///
55
+/// EFI_UDP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.
56
+/// The definition in here is only present to provide backwards compatability.
57
+///
58
+typedef struct {
59
+  EFI_HANDLE              DriverHandle;
60
+  UINT32                  ServiceCount;
61
+  EFI_UDP4_SERVICE_POINT  Services[1];
62
+} EFI_UDP4_VARIABLE_DATA;
63
+
64
+typedef struct {
65
+  UINT32             FragmentLength;
66
+  VOID               *FragmentBuffer;
67
+} EFI_UDP4_FRAGMENT_DATA;
68
+
69
+typedef struct {
70
+  EFI_IPv4_ADDRESS   SourceAddress;
71
+  UINT16             SourcePort;
72
+  EFI_IPv4_ADDRESS   DestinationAddress;
73
+  UINT16             DestinationPort;
74
+} EFI_UDP4_SESSION_DATA;
75
+typedef struct {
76
+  //
77
+  // Receiving Filters
78
+  //
79
+  BOOLEAN            AcceptBroadcast;
80
+  BOOLEAN            AcceptPromiscuous;
81
+  BOOLEAN            AcceptAnyPort;
82
+  BOOLEAN            AllowDuplicatePort;
83
+  //
84
+  // I/O parameters
85
+  //
86
+  UINT8              TypeOfService;
87
+  UINT8              TimeToLive;
88
+  BOOLEAN            DoNotFragment;
89
+  UINT32             ReceiveTimeout;
90
+  UINT32             TransmitTimeout;
91
+  //
92
+  // Access Point
93
+  //
94
+  BOOLEAN            UseDefaultAddress;
95
+  EFI_IPv4_ADDRESS   StationAddress;
96
+  EFI_IPv4_ADDRESS   SubnetMask;
97
+  UINT16             StationPort;
98
+  EFI_IPv4_ADDRESS   RemoteAddress;
99
+  UINT16             RemotePort;
100
+} EFI_UDP4_CONFIG_DATA;
101
+
102
+typedef struct {
103
+  EFI_UDP4_SESSION_DATA     *UdpSessionData;       //OPTIONAL
104
+  EFI_IPv4_ADDRESS          *GatewayAddress;       //OPTIONAL
105
+  UINT32                    DataLength;
106
+  UINT32                    FragmentCount;
107
+  EFI_UDP4_FRAGMENT_DATA    FragmentTable[1];
108
+} EFI_UDP4_TRANSMIT_DATA;
109
+
110
+typedef struct {
111
+  EFI_TIME                  TimeStamp;
112
+  EFI_EVENT                 RecycleSignal;
113
+  EFI_UDP4_SESSION_DATA     UdpSession;
114
+  UINT32                    DataLength;
115
+  UINT32                    FragmentCount;
116
+  EFI_UDP4_FRAGMENT_DATA    FragmentTable[1];
117
+} EFI_UDP4_RECEIVE_DATA;
118
+
119
+
120
+typedef struct {
121
+  EFI_EVENT                 Event;
122
+  EFI_STATUS                Status;
123
+  union {
124
+    EFI_UDP4_RECEIVE_DATA   *RxData;
125
+    EFI_UDP4_TRANSMIT_DATA  *TxData;
126
+  } Packet;
127
+} EFI_UDP4_COMPLETION_TOKEN;
128
+
129
+/**
130
+  Reads the current operational settings.
131
+
132
+  The GetModeData() function copies the current operational settings of this EFI
133
+  UDPv4 Protocol instance into user-supplied buffers. This function is used
134
+  optionally to retrieve the operational mode data of underlying networks or
135
+  drivers.
136
+
137
+  @param  This           The pointer to the EFI_UDP4_PROTOCOL instance.
138
+  @param  Udp4ConfigData The pointer to the buffer to receive the current configuration data.
139
+  @param  Ip4ModeData    The pointer to the EFI IPv4 Protocol mode data structure.
140
+  @param  MnpConfigData  The pointer to the managed network configuration data structure.
141
+  @param  SnpModeData    The pointer to the simple network mode data structure.
142
+
143
+  @retval EFI_SUCCESS           The mode data was read.
144
+  @retval EFI_NOT_STARTED       When Udp4ConfigData is queried, no configuration data is
145
+                                available because this instance has not been started.
146
+  @retval EFI_INVALID_PARAMETER This is NULL.
147
+
148
+**/
149
+typedef
150
+EFI_STATUS
151
+(EFIAPI *EFI_UDP4_GET_MODE_DATA)(
152
+  IN  EFI_UDP4_PROTOCOL                *This,
153
+  OUT EFI_UDP4_CONFIG_DATA             *Udp4ConfigData OPTIONAL,
154
+  OUT EFI_IP4_MODE_DATA                *Ip4ModeData    OPTIONAL,
155
+  OUT EFI_MANAGED_NETWORK_CONFIG_DATA  *MnpConfigData  OPTIONAL,
156
+  OUT EFI_SIMPLE_NETWORK_MODE          *SnpModeData    OPTIONAL
157
+  );
158
+
159
+
160
+/**
161
+  Initializes, changes, or resets the operational parameters for this instance of the EFI UDPv4
162
+  Protocol.
163
+
164
+  The Configure() function is used to do the following:
165
+  * Initialize and start this instance of the EFI UDPv4 Protocol.
166
+  * Change the filtering rules and operational parameters.
167
+  * Reset this instance of the EFI UDPv4 Protocol.
168
+  Until these parameters are initialized, no network traffic can be sent or
169
+  received by this instance. This instance can be also reset by calling Configure()
170
+  with UdpConfigData set to NULL. Once reset, the receiving queue and transmitting
171
+  queue are flushed and no traffic is allowed through this instance.
172
+  With different parameters in UdpConfigData, Configure() can be used to bind
173
+  this instance to specified port.
174
+
175
+  @param  This           The pointer to the EFI_UDP4_PROTOCOL instance.
176
+  @param  Udp4ConfigData The pointer to the buffer to receive the current configuration data.
177
+
178
+  @retval EFI_SUCCESS           The configuration settings were set, changed, or reset successfully.
179
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,
180
+                                RARP, etc.) is not finished yet.
181
+  @retval EFI_INVALID_PARAMETER This is NULL.
182
+  @retval EFI_INVALID_PARAMETER UdpConfigData.StationAddress is not a valid unicast IPv4 address.
183
+  @retval EFI_INVALID_PARAMETER UdpConfigData.SubnetMask is not a valid IPv4 address mask. The subnet
184
+                                mask must be contiguous.
185
+  @retval EFI_INVALID_PARAMETER UdpConfigData.RemoteAddress is not a valid unicast IPv4 address if it
186
+                                is not zero.
187
+  @retval EFI_ALREADY_STARTED   The EFI UDPv4 Protocol instance is already started/configured
188
+                                and must be stopped/reset before it can be reconfigured.
189
+  @retval EFI_ACCESS_DENIED     UdpConfigData. AllowDuplicatePort is FALSE
190
+                                and UdpConfigData.StationPort is already used by
191
+                                other instance.
192
+  @retval EFI_OUT_OF_RESOURCES  The EFI UDPv4 Protocol driver cannot allocate memory for this
193
+                                EFI UDPv4 Protocol instance.
194
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred and this instance
195
+                                 was not opened.
196
+
197
+**/
198
+typedef
199
+EFI_STATUS
200
+(EFIAPI *EFI_UDP4_CONFIGURE)(
201
+  IN EFI_UDP4_PROTOCOL      *This,
202
+  IN EFI_UDP4_CONFIG_DATA   *UdpConfigData OPTIONAL
203
+  );
204
+
205
+/**
206
+  Joins and leaves multicast groups.
207
+
208
+  The Groups() function is used to enable and disable the multicast group
209
+  filtering. If the JoinFlag is FALSE and the MulticastAddress is NULL, then all
210
+  currently joined groups are left.
211
+
212
+  @param  This             The pointer to the EFI_UDP4_PROTOCOL instance.
213
+  @param  JoinFlag         Set to TRUE to join a multicast group. Set to FALSE to leave one
214
+                           or all multicast groups.
215
+  @param  MulticastAddress The pointer to multicast group address to join or leave.
216
+
217
+  @retval EFI_SUCCESS           The operation completed successfully.
218
+  @retval EFI_NOT_STARTED       The EFI UDPv4 Protocol instance has not been started.
219
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,
220
+                                RARP, etc.) is not finished yet.
221
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate resources to join the group.
222
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
223
+                                - This is NULL.
224
+                                - JoinFlag is TRUE and MulticastAddress is NULL.
225
+                                - JoinFlag is TRUE and *MulticastAddress is not
226
+                                  a valid multicast address.
227
+  @retval EFI_ALREADY_STARTED   The group address is already in the group table (when
228
+                                JoinFlag is TRUE).
229
+  @retval EFI_NOT_FOUND         The group address is not in the group table (when JoinFlag is
230
+                                FALSE).
231
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
232
+
233
+**/
234
+typedef
235
+EFI_STATUS
236
+(EFIAPI *EFI_UDP4_GROUPS)(
237
+  IN EFI_UDP4_PROTOCOL      *This,
238
+  IN BOOLEAN                JoinFlag,
239
+  IN EFI_IPv4_ADDRESS       *MulticastAddress    OPTIONAL
240
+  );
241
+
242
+/**
243
+  Adds and deletes routing table entries.
244
+
245
+  The Routes() function adds a route to or deletes a route from the routing table.
246
+  Routes are determined by comparing the SubnetAddress with the destination IP
247
+  address and arithmetically AND-ing it with the SubnetMask. The gateway address
248
+  must be on the same subnet as the configured station address.
249
+  The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0.
250
+  The default route matches all destination IP addresses that do not match any
251
+  other routes.
252
+  A zero GatewayAddress is a nonroute. Packets are sent to the destination IP
253
+  address if it can be found in the Address Resolution Protocol (ARP) cache or
254
+  on the local subnet. One automatic nonroute entry will be inserted into the
255
+  routing table for outgoing packets that are addressed to a local subnet
256
+  (gateway address of 0.0.0.0).
257
+  Each instance of the EFI UDPv4 Protocol has its own independent routing table.
258
+  Instances of the EFI UDPv4 Protocol that use the default IP address will also
259
+  have copies of the routing table provided by the EFI_IP4_CONFIG_PROTOCOL. These
260
+  copies will be updated automatically whenever the IP driver reconfigures its
261
+  instances; as a result, the previous modification to these copies will be lost.
262
+
263
+  @param  This           The pointer to the EFI_UDP4_PROTOCOL instance.
264
+  @param  DeleteRoute    Set to TRUE to delete this route from the routing table.
265
+                         Set to FALSE to add this route to the routing table.
266
+  @param  SubnetAddress  The destination network address that needs to be routed.
267
+  @param  SubnetMask     The subnet mask of SubnetAddress.
268
+  @param  GatewayAddress The gateway IP address for this route.
269
+
270
+  @retval EFI_SUCCESS           The operation completed successfully.
271
+  @retval EFI_NOT_STARTED       The EFI UDPv4 Protocol instance has not been started.
272
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,
273
+                                - RARP, etc.) is not finished yet.
274
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
275
+  @retval EFI_OUT_OF_RESOURCES  Could not add the entry to the routing table.
276
+  @retval EFI_NOT_FOUND         This route is not in the routing table.
277
+  @retval EFI_ACCESS_DENIED     The route is already defined in the routing table.
278
+
279
+**/
280
+typedef
281
+EFI_STATUS
282
+(EFIAPI *EFI_UDP4_ROUTES)(
283
+  IN EFI_UDP4_PROTOCOL      *This,
284
+  IN BOOLEAN                DeleteRoute,
285
+  IN EFI_IPv4_ADDRESS       *SubnetAddress,
286
+  IN EFI_IPv4_ADDRESS       *SubnetMask,
287
+  IN EFI_IPv4_ADDRESS       *GatewayAddress
288
+  );
289
+
290
+/**
291
+  Polls for incoming data packets and processes outgoing data packets.
292
+
293
+  The Poll() function can be used by network drivers and applications to increase
294
+  the rate that data packets are moved between the communications device and the
295
+  transmit and receive queues.
296
+  In some systems, the periodic timer event in the managed network driver may not
297
+  poll the underlying communications device fast enough to transmit and/or receive
298
+  all data packets without missing incoming packets or dropping outgoing packets.
299
+  Drivers and applications that are experiencing packet loss should try calling
300
+  the Poll() function more often.
301
+
302
+  @param  This The pointer to the EFI_UDP4_PROTOCOL instance.
303
+
304
+  @retval EFI_SUCCESS           Incoming or outgoing data was processed.
305
+  @retval EFI_INVALID_PARAMETER This is NULL.
306
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
307
+  @retval EFI_TIMEOUT           Data was dropped out of the transmit and/or receive queue.
308
+
309
+**/
310
+typedef
311
+EFI_STATUS
312
+(EFIAPI *EFI_UDP4_POLL)(
313
+  IN EFI_UDP4_PROTOCOL      *This
314
+  );
315
+
316
+/**
317
+  Places an asynchronous receive request into the receiving queue.
318
+
319
+  The Receive() function places a completion token into the receive packet queue.
320
+  This function is always asynchronous.
321
+  The caller must fill in the Token.Event field in the completion token, and this
322
+  field cannot be NULL. When the receive operation completes, the EFI UDPv4 Protocol
323
+  driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event
324
+  is signaled. Providing a proper notification function and context for the event
325
+  will enable the user to receive the notification and receiving status. That
326
+  notification function is guaranteed to not be re-entered.
327
+
328
+  @param  This  The pointer to the EFI_UDP4_PROTOCOL instance.
329
+  @param  Token The pointer to a token that is associated with the receive data
330
+                descriptor.
331
+
332
+  @retval EFI_SUCCESS           The receive completion token was cached.
333
+  @retval EFI_NOT_STARTED       This EFI UDPv4 Protocol instance has not been started.
334
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP, RARP, etc.)
335
+                                is not finished yet.
336
+  @retval EFI_INVALID_PARAMETER This is NULL.
337
+  @retval EFI_INVALID_PARAMETER Token is NULL.
338
+  @retval EFI_INVALID_PARAMETER Token.Event is NULL.
339
+  @retval EFI_OUT_OF_RESOURCES  The receive completion token could not be queued due to a lack of system
340
+                                resources (usually memory).
341
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
342
+  @retval EFI_ACCESS_DENIED     A receive completion token with the same Token.Event was already in
343
+                                the receive queue.
344
+  @retval EFI_NOT_READY         The receive request could not be queued because the receive queue is full.
345
+
346
+**/
347
+typedef
348
+EFI_STATUS
349
+(EFIAPI *EFI_UDP4_RECEIVE)(
350
+  IN EFI_UDP4_PROTOCOL          *This,
351
+  IN EFI_UDP4_COMPLETION_TOKEN  *Token
352
+  );
353
+
354
+/**
355
+  Queues outgoing data packets into the transmit queue.
356
+
357
+  The Transmit() function places a sending request to this instance of the EFI
358
+  UDPv4 Protocol, alongside the transmit data that was filled by the user. Whenever
359
+  the packet in the token is sent out or some errors occur, the Token.Event will
360
+  be signaled and Token.Status is updated. Providing a proper notification function
361
+  and context for the event will enable the user to receive the notification and
362
+  transmitting status.
363
+
364
+  @param  This  The pointer to the EFI_UDP4_PROTOCOL instance.
365
+  @param  Token The pointer to the completion token that will be placed into the
366
+                transmit queue.
367
+
368
+  @retval EFI_SUCCESS           The data has been queued for transmission.
369
+  @retval EFI_NOT_STARTED       This EFI UDPv4 Protocol instance has not been started.
370
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,
371
+                                RARP, etc.) is not finished yet.
372
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
373
+  @retval EFI_ACCESS_DENIED     The transmit completion token with the same
374
+                                Token.Event was already in the transmit queue.
375
+  @retval EFI_NOT_READY         The completion token could not be queued because the
376
+                                transmit queue is full.
377
+  @retval EFI_OUT_OF_RESOURCES  Could not queue the transmit data.
378
+  @retval EFI_NOT_FOUND         There is no route to the destination network or address.
379
+  @retval EFI_BAD_BUFFER_SIZE   The data length is greater than the maximum UDP packet
380
+                                size. Or the length of the IP header + UDP header + data
381
+                                length is greater than MTU if DoNotFragment is TRUE.
382
+
383
+**/
384
+typedef
385
+EFI_STATUS
386
+(EFIAPI *EFI_UDP4_TRANSMIT)(
387
+  IN EFI_UDP4_PROTOCOL           *This,
388
+  IN EFI_UDP4_COMPLETION_TOKEN   *Token
389
+  );
390
+
391
+/**
392
+  Aborts an asynchronous transmit or receive request.
393
+
394
+  The Cancel() function is used to abort a pending transmit or receive request.
395
+  If the token is in the transmit or receive request queues, after calling this
396
+  function, Token.Status will be set to EFI_ABORTED and then Token.Event will be
397
+  signaled. If the token is not in one of the queues, which usually means that
398
+  the asynchronous operation has completed, this function will not signal the
399
+  token and EFI_NOT_FOUND is returned.
400
+
401
+  @param  This  The pointer to the EFI_UDP4_PROTOCOL instance.
402
+  @param  Token The pointer to a token that has been issued by
403
+                EFI_UDP4_PROTOCOL.Transmit() or
404
+                EFI_UDP4_PROTOCOL.Receive().If NULL, all pending
405
+                tokens are aborted.
406
+
407
+  @retval  EFI_SUCCESS           The asynchronous I/O request was aborted and Token.Event
408
+                                 was signaled. When Token is NULL, all pending requests are
409
+                                 aborted and their events are signaled.
410
+  @retval  EFI_INVALID_PARAMETER This is NULL.
411
+  @retval  EFI_NOT_STARTED       This instance has not been started.
412
+  @retval  EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,
413
+                                 RARP, etc.) is not finished yet.
414
+  @retval  EFI_NOT_FOUND         When Token is not NULL, the asynchronous I/O request was
415
+                                 not found in the transmit or receive queue. It has either completed
416
+                                 or was not issued by Transmit() and Receive().
417
+
418
+**/
419
+typedef
420
+EFI_STATUS
421
+(EFIAPI *EFI_UDP4_CANCEL)(
422
+  IN EFI_UDP4_PROTOCOL          *This,
423
+  IN EFI_UDP4_COMPLETION_TOKEN  *Token  OPTIONAL
424
+  );
425
+
426
+///
427
+/// The EFI_UDP4_PROTOCOL defines an EFI UDPv4 Protocol session that can be used
428
+/// by any network drivers, applications, or daemons to transmit or receive UDP packets.
429
+/// This protocol instance can either be bound to a specified port as a service or
430
+/// connected to some remote peer as an active client. Each instance has its own settings,
431
+/// such as the routing table and group table, which are independent from each other.
432
+///
433
+struct _EFI_UDP4_PROTOCOL {
434
+  EFI_UDP4_GET_MODE_DATA        GetModeData;
435
+  EFI_UDP4_CONFIGURE            Configure;
436
+  EFI_UDP4_GROUPS               Groups;
437
+  EFI_UDP4_ROUTES               Routes;
438
+  EFI_UDP4_TRANSMIT             Transmit;
439
+  EFI_UDP4_RECEIVE              Receive;
440
+  EFI_UDP4_CANCEL               Cancel;
441
+  EFI_UDP4_POLL                 Poll;
442
+};
443
+
444
+extern EFI_GUID gEfiUdp4ServiceBindingProtocolGuid;
445
+extern EFI_GUID gEfiUdp4ProtocolGuid;
446
+
447
+#endif

+ 145
- 0
src/include/ipxe/efi/Protocol/VlanConfig.h 파일 보기

@@ -0,0 +1,145 @@
1
+/** @file
2
+  EFI VLAN Config protocol is to provide manageability interface for VLAN configuration.
3
+
4
+  Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
5
+  This program and the accompanying materials
6
+  are licensed and made available under the terms and conditions of the BSD License
7
+  which accompanies this distribution.  The full text of the license may be found at
8
+  http://opensource.org/licenses/bsd-license.php
9
+
10
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
+
13
+  @par Revision Reference:
14
+  This Protocol is introduced in UEFI Specification 2.2
15
+
16
+**/
17
+
18
+#ifndef __EFI_VLANCONFIG_PROTOCOL_H__
19
+#define __EFI_VLANCONFIG_PROTOCOL_H__
20
+
21
+FILE_LICENCE ( BSD3 );
22
+
23
+
24
+#define EFI_VLAN_CONFIG_PROTOCOL_GUID \
25
+  { \
26
+    0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74 } \
27
+  }
28
+
29
+typedef struct _EFI_VLAN_CONFIG_PROTOCOL EFI_VLAN_CONFIG_PROTOCOL;
30
+
31
+
32
+///
33
+/// EFI_VLAN_FIND_DATA
34
+///
35
+typedef struct {
36
+  UINT16          VlanId;     ///< Vlan Identifier.
37
+  UINT8           Priority;   ///< Priority of this VLAN.
38
+} EFI_VLAN_FIND_DATA;
39
+
40
+
41
+/**
42
+  Create a VLAN device or modify the configuration parameter of an
43
+  already-configured VLAN.
44
+
45
+  The Set() function is used to create a new VLAN device or change the VLAN
46
+  configuration parameters. If the VlanId hasn't been configured in the
47
+  physical Ethernet device, a new VLAN device will be created. If a VLAN with
48
+  this VlanId is already configured, then related configuration will be updated
49
+  as the input parameters.
50
+
51
+  If VlanId is zero, the VLAN device will send and receive untagged frames.
52
+  Otherwise, the VLAN device will send and receive VLAN-tagged frames containing the VlanId.
53
+  If VlanId is out of scope of (0-4094), EFI_INVALID_PARAMETER is returned.
54
+  If Priority is out of the scope of (0-7), then EFI_INVALID_PARAMETER is returned.
55
+  If there is not enough system memory to perform the registration, then
56
+  EFI_OUT_OF_RESOURCES is returned.
57
+
58
+  @param[in] This                Points to the EFI_VLAN_CONFIG_PROTOCOL.
59
+  @param[in] VlanId              A unique identifier (1-4094) of the VLAN which is being created
60
+                                 or modified, or zero (0).
61
+  @param[in] Priority            3 bit priority in VLAN header. Priority 0 is default value. If
62
+                                 VlanId is zero (0), Priority is ignored.
63
+
64
+  @retval EFI_SUCCESS            The VLAN is successfully configured.
65
+  @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:
66
+                                 - This is NULL.
67
+                                 - VlanId is an invalid VLAN Identifier.
68
+                                 - Priority is invalid.
69
+  @retval EFI_OUT_OF_RESOURCES   There is not enough system memory to perform the registration.
70
+
71
+**/
72
+typedef
73
+EFI_STATUS
74
+(EFIAPI *EFI_VLAN_CONFIG_SET)(
75
+  IN  EFI_VLAN_CONFIG_PROTOCOL     *This,
76
+  IN  UINT16                       VlanId,
77
+  IN  UINT8                        Priority
78
+  );
79
+
80
+/**
81
+  Find configuration information for specified VLAN or all configured VLANs.
82
+
83
+  The Find() function is used to find the configuration information for matching
84
+  VLAN and allocate a buffer into which those entries are copied.
85
+
86
+  @param[in]  This               Points to the EFI_VLAN_CONFIG_PROTOCOL.
87
+  @param[in]  VlanId             Pointer to VLAN identifier. Set to NULL to find all
88
+                                 configured VLANs.
89
+  @param[out] NumberOfVlan       The number of VLANs which is found by the specified criteria.
90
+  @param[out] Entries            The buffer which receive the VLAN configuration.
91
+
92
+  @retval EFI_SUCCESS            The VLAN is successfully found.
93
+  @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:
94
+                                 - This is NULL.
95
+                                 - Specified VlanId is invalid.
96
+  @retval EFI_NOT_FOUND          No matching VLAN is found.
97
+
98
+**/
99
+typedef
100
+EFI_STATUS
101
+(EFIAPI *EFI_VLAN_CONFIG_FIND)(
102
+  IN  EFI_VLAN_CONFIG_PROTOCOL     *This,
103
+  IN  UINT16                       *VlanId  OPTIONAL,
104
+  OUT UINT16                       *NumberOfVlan,
105
+  OUT EFI_VLAN_FIND_DATA           **Entries
106
+  );
107
+
108
+/**
109
+  Remove the configured VLAN device.
110
+
111
+  The Remove() function is used to remove the specified VLAN device.
112
+  If the VlanId is out of the scope of (0-4094), EFI_INVALID_PARAMETER is returned.
113
+  If specified VLAN hasn't been previously configured, EFI_NOT_FOUND is returned.
114
+
115
+  @param[in] This                Points to the EFI_VLAN_CONFIG_PROTOCOL.
116
+  @param[in] VlanId              Identifier (0-4094) of the VLAN to be removed.
117
+
118
+  @retval EFI_SUCCESS            The VLAN is successfully removed.
119
+  @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:
120
+                                 - This is NULL.
121
+                                 - VlanId  is an invalid parameter.
122
+  @retval EFI_NOT_FOUND          The to-be-removed VLAN does not exist.
123
+
124
+**/
125
+typedef
126
+EFI_STATUS
127
+(EFIAPI *EFI_VLAN_CONFIG_REMOVE)(
128
+  IN  EFI_VLAN_CONFIG_PROTOCOL     *This,
129
+  IN  UINT16                       VlanId
130
+  );
131
+
132
+///
133
+/// EFI_VLAN_CONFIG_PROTOCOL
134
+/// provide manageability interface for VLAN setting. The intended
135
+/// VLAN tagging implementation is IEEE802.1Q.
136
+///
137
+struct _EFI_VLAN_CONFIG_PROTOCOL {
138
+  EFI_VLAN_CONFIG_SET              Set;
139
+  EFI_VLAN_CONFIG_FIND             Find;
140
+  EFI_VLAN_CONFIG_REMOVE           Remove;
141
+};
142
+
143
+extern EFI_GUID gEfiVlanConfigProtocolGuid;
144
+
145
+#endif

+ 16
- 0
src/include/ipxe/efi/efi.h 파일 보기

@@ -153,19 +153,30 @@ struct efi_config_table {
153 153
  */
154 154
 #define EEFI( efirc ) EPLATFORM ( EINFO_EPLATFORM, efirc )
155 155
 
156
+extern EFI_GUID efi_arp_protocol_guid;
157
+extern EFI_GUID efi_arp_service_binding_protocol_guid;
156 158
 extern EFI_GUID efi_block_io_protocol_guid;
157 159
 extern EFI_GUID efi_bus_specific_driver_override_protocol_guid;
158 160
 extern EFI_GUID efi_component_name_protocol_guid;
159 161
 extern EFI_GUID efi_component_name2_protocol_guid;
160 162
 extern EFI_GUID efi_device_path_protocol_guid;
163
+extern EFI_GUID efi_dhcp4_protocol_guid;
164
+extern EFI_GUID efi_dhcp4_service_binding_protocol_guid;
161 165
 extern EFI_GUID efi_disk_io_protocol_guid;
162 166
 extern EFI_GUID efi_driver_binding_protocol_guid;
163 167
 extern EFI_GUID efi_graphics_output_protocol_guid;
164 168
 extern EFI_GUID efi_hii_config_access_protocol_guid;
169
+extern EFI_GUID efi_ip4_protocol_guid;
170
+extern EFI_GUID efi_ip4_config_protocol_guid;
171
+extern EFI_GUID efi_ip4_service_binding_protocol_guid;
165 172
 extern EFI_GUID efi_load_file_protocol_guid;
166 173
 extern EFI_GUID efi_load_file2_protocol_guid;
167 174
 extern EFI_GUID efi_loaded_image_protocol_guid;
168 175
 extern EFI_GUID efi_loaded_image_device_path_protocol_guid;
176
+extern EFI_GUID efi_managed_network_protocol_guid;
177
+extern EFI_GUID efi_managed_network_service_binding_protocol_guid;
178
+extern EFI_GUID efi_mtftp4_protocol_guid;
179
+extern EFI_GUID efi_mtftp4_service_binding_protocol_guid;
169 180
 extern EFI_GUID efi_nii_protocol_guid;
170 181
 extern EFI_GUID efi_nii31_protocol_guid;
171 182
 extern EFI_GUID efi_pci_io_protocol_guid;
@@ -174,6 +185,11 @@ extern EFI_GUID efi_pxe_base_code_protocol_guid;
174 185
 extern EFI_GUID efi_simple_file_system_protocol_guid;
175 186
 extern EFI_GUID efi_simple_network_protocol_guid;
176 187
 extern EFI_GUID efi_tcg_protocol_guid;
188
+extern EFI_GUID efi_tcp4_protocol_guid;
189
+extern EFI_GUID efi_tcp4_service_binding_protocol_guid;
190
+extern EFI_GUID efi_udp4_protocol_guid;
191
+extern EFI_GUID efi_udp4_service_binding_protocol_guid;
192
+extern EFI_GUID efi_vlan_config_protocol_guid;
177 193
 
178 194
 extern EFI_HANDLE efi_image_handle;
179 195
 extern EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;

+ 50
- 2
src/interface/efi/efi_debug.c 파일 보기

@@ -42,6 +42,18 @@ FILE_LICENCE ( GPL2_OR_LATER );
42 42
 static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *efidpt;
43 43
 EFI_REQUEST_PROTOCOL ( EFI_DEVICE_PATH_TO_TEXT_PROTOCOL, &efidpt );
44 44
 
45
+/** Iscsi4Dxe module GUID */
46
+static EFI_GUID efi_iscsi4_dxe_guid = {
47
+	0x4579b72d, 0x7ec4, 0x4dd4,
48
+	{ 0x84, 0x86, 0x08, 0x3c, 0x86, 0xb1, 0x82, 0xa7 }
49
+};
50
+
51
+/** VlanConfigDxe module GUID */
52
+static EFI_GUID efi_vlan_config_dxe_guid = {
53
+	0xe4f61863, 0xfe2c, 0x4b56,
54
+	{ 0xa8, 0xf4, 0x08, 0x51, 0x9b, 0xc4, 0x39, 0xdf }
55
+};
56
+
45 57
 /** A well-known GUID */
46 58
 struct efi_well_known_guid {
47 59
 	/** GUID */
@@ -52,24 +64,40 @@ struct efi_well_known_guid {
52 64
 
53 65
 /** Well-known GUIDs */
54 66
 static struct efi_well_known_guid efi_well_known_guids[] = {
67
+	{ &efi_arp_protocol_guid,
68
+	  "Arp" },
69
+	{ &efi_arp_service_binding_protocol_guid,
70
+	  "ArpSb" },
55 71
 	{ &efi_block_io_protocol_guid,
56 72
 	  "BlockIo" },
57 73
 	{ &efi_bus_specific_driver_override_protocol_guid,
58 74
 	  "BusSpecificDriverOverride" },
59
-	{ &efi_component_name2_protocol_guid,
60
-	  "ComponentName2" },
61 75
 	{ &efi_component_name_protocol_guid,
62 76
 	  "ComponentName" },
77
+	{ &efi_component_name2_protocol_guid,
78
+	  "ComponentName2" },
63 79
 	{ &efi_device_path_protocol_guid,
64 80
 	  "DevicePath" },
65 81
 	{ &efi_driver_binding_protocol_guid,
66 82
 	  "DriverBinding" },
83
+	{ &efi_dhcp4_protocol_guid,
84
+	  "Dhcp4" },
85
+	{ &efi_dhcp4_service_binding_protocol_guid,
86
+	  "Dhcp4Sb" },
67 87
 	{ &efi_disk_io_protocol_guid,
68 88
 	  "DiskIo" },
69 89
 	{ &efi_graphics_output_protocol_guid,
70 90
 	  "GraphicsOutput" },
71 91
 	{ &efi_hii_config_access_protocol_guid,
72 92
 	  "HiiConfigAccess" },
93
+	{ &efi_ip4_protocol_guid,
94
+	  "Ip4" },
95
+	{ &efi_ip4_config_protocol_guid,
96
+	  "Ip4Config" },
97
+	{ &efi_ip4_service_binding_protocol_guid,
98
+	  "Ip4Sb" },
99
+	{ &efi_iscsi4_dxe_guid,
100
+	  "IScsi4Dxe" },
73 101
 	{ &efi_load_file_protocol_guid,
74 102
 	  "LoadFile" },
75 103
 	{ &efi_load_file2_protocol_guid,
@@ -78,6 +106,14 @@ static struct efi_well_known_guid efi_well_known_guids[] = {
78 106
 	  "LoadedImage" },
79 107
 	{ &efi_loaded_image_device_path_protocol_guid,
80 108
 	  "LoadedImageDevicePath"},
109
+	{ &efi_managed_network_protocol_guid,
110
+	  "ManagedNetwork" },
111
+	{ &efi_managed_network_service_binding_protocol_guid,
112
+	  "ManagedNetworkSb" },
113
+	{ &efi_mtftp4_protocol_guid,
114
+	  "Mtftp4" },
115
+	{ &efi_mtftp4_service_binding_protocol_guid,
116
+	  "Mtftp4Sb" },
81 117
 	{ &efi_nii_protocol_guid,
82 118
 	  "Nii" },
83 119
 	{ &efi_nii31_protocol_guid,
@@ -94,6 +130,18 @@ static struct efi_well_known_guid efi_well_known_guids[] = {
94 130
 	  "SimpleNetwork" },
95 131
 	{ &efi_tcg_protocol_guid,
96 132
 	  "Tcg" },
133
+	{ &efi_tcp4_protocol_guid,
134
+	  "Tcp4" },
135
+	{ &efi_tcp4_service_binding_protocol_guid,
136
+	  "Tcp4Sb" },
137
+	{ &efi_udp4_protocol_guid,
138
+	  "Udp4" },
139
+	{ &efi_udp4_service_binding_protocol_guid,
140
+	  "Udp4Sb" },
141
+	{ &efi_vlan_config_protocol_guid,
142
+	  "VlanConfig" },
143
+	{ &efi_vlan_config_dxe_guid,
144
+	  "VlanConfigDxe" },
97 145
 };
98 146
 
99 147
 /**

+ 73
- 0
src/interface/efi/efi_guid.c 파일 보기

@@ -20,19 +20,25 @@
20 20
 FILE_LICENCE ( GPL2_OR_LATER );
21 21
 
22 22
 #include <ipxe/efi/efi.h>
23
+#include <ipxe/efi/Protocol/Arp.h>
23 24
 #include <ipxe/efi/Protocol/BlockIo.h>
24 25
 #include <ipxe/efi/Protocol/BusSpecificDriverOverride.h>
25 26
 #include <ipxe/efi/Protocol/ComponentName.h>
26 27
 #include <ipxe/efi/Protocol/ComponentName2.h>
27 28
 #include <ipxe/efi/Protocol/DevicePath.h>
28 29
 #include <ipxe/efi/Protocol/DevicePathToText.h>
30
+#include <ipxe/efi/Protocol/Dhcp4.h>
29 31
 #include <ipxe/efi/Protocol/DiskIo.h>
30 32
 #include <ipxe/efi/Protocol/DriverBinding.h>
31 33
 #include <ipxe/efi/Protocol/GraphicsOutput.h>
32 34
 #include <ipxe/efi/Protocol/HiiConfigAccess.h>
35
+#include <ipxe/efi/Protocol/Ip4.h>
36
+#include <ipxe/efi/Protocol/Ip4Config.h>
33 37
 #include <ipxe/efi/Protocol/LoadFile.h>
34 38
 #include <ipxe/efi/Protocol/LoadFile2.h>
35 39
 #include <ipxe/efi/Protocol/LoadedImage.h>
40
+#include <ipxe/efi/Protocol/ManagedNetwork.h>
41
+#include <ipxe/efi/Protocol/Mtftp4.h>
36 42
 #include <ipxe/efi/Protocol/NetworkInterfaceIdentifier.h>
37 43
 #include <ipxe/efi/Protocol/PciIo.h>
38 44
 #include <ipxe/efi/Protocol/PciRootBridgeIo.h>
@@ -40,6 +46,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
40 46
 #include <ipxe/efi/Protocol/SimpleFileSystem.h>
41 47
 #include <ipxe/efi/Protocol/SimpleNetwork.h>
42 48
 #include <ipxe/efi/Protocol/TcgService.h>
49
+#include <ipxe/efi/Protocol/Tcp4.h>
50
+#include <ipxe/efi/Protocol/Udp4.h>
51
+#include <ipxe/efi/Protocol/VlanConfig.h>
43 52
 
44 53
 /** @file
45 54
  *
@@ -47,6 +56,14 @@ FILE_LICENCE ( GPL2_OR_LATER );
47 56
  *
48 57
  */
49 58
 
59
+/** ARP protocol GUID */
60
+EFI_GUID efi_arp_protocol_guid
61
+	= EFI_ARP_PROTOCOL_GUID;
62
+
63
+/** ARP service binding protocol GUID */
64
+EFI_GUID efi_arp_service_binding_protocol_guid
65
+	= EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID;
66
+
50 67
 /** Block I/O protocol GUID */
51 68
 EFI_GUID efi_block_io_protocol_guid
52 69
 	= EFI_BLOCK_IO_PROTOCOL_GUID;
@@ -67,6 +84,14 @@ EFI_GUID efi_component_name2_protocol_guid
67 84
 EFI_GUID efi_device_path_protocol_guid
68 85
 	= EFI_DEVICE_PATH_PROTOCOL_GUID;
69 86
 
87
+/** DHCPv4 protocol GUID */
88
+EFI_GUID efi_dhcp4_protocol_guid
89
+	= EFI_DHCP4_PROTOCOL_GUID;
90
+
91
+/** DHCPv4 service binding protocol GUID */
92
+EFI_GUID efi_dhcp4_service_binding_protocol_guid
93
+	= EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID;
94
+
70 95
 /** Disk I/O protocol GUID */
71 96
 EFI_GUID efi_disk_io_protocol_guid
72 97
 	= EFI_DISK_IO_PROTOCOL_GUID;
@@ -83,6 +108,18 @@ EFI_GUID efi_graphics_output_protocol_guid
83 108
 EFI_GUID efi_hii_config_access_protocol_guid
84 109
 	= EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID;
85 110
 
111
+/** IPv4 protocol GUID */
112
+EFI_GUID efi_ip4_protocol_guid
113
+	= EFI_IP4_PROTOCOL_GUID;
114
+
115
+/** IPv4 configuration protocol GUID */
116
+EFI_GUID efi_ip4_config_protocol_guid
117
+	= EFI_IP4_CONFIG_PROTOCOL_GUID;
118
+
119
+/** IPv4 service binding protocol GUID */
120
+EFI_GUID efi_ip4_service_binding_protocol_guid
121
+	= EFI_IP4_SERVICE_BINDING_PROTOCOL_GUID;
122
+
86 123
 /** Load file protocol GUID */
87 124
 EFI_GUID efi_load_file_protocol_guid
88 125
 	= EFI_LOAD_FILE_PROTOCOL_GUID;
@@ -99,6 +136,22 @@ EFI_GUID efi_loaded_image_protocol_guid
99 136
 EFI_GUID efi_loaded_image_device_path_protocol_guid
100 137
 	= EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID;
101 138
 
139
+/** Managed network protocol GUID */
140
+EFI_GUID efi_managed_network_protocol_guid
141
+	= EFI_MANAGED_NETWORK_PROTOCOL_GUID;
142
+
143
+/** Managed network service binding protocol GUID */
144
+EFI_GUID efi_managed_network_service_binding_protocol_guid
145
+	= EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID;
146
+
147
+/** MTFTPv4 protocol GUID */
148
+EFI_GUID efi_mtftp4_protocol_guid
149
+	= EFI_MTFTP4_PROTOCOL_GUID;
150
+
151
+/** MTFTPv4 service binding protocol GUID */
152
+EFI_GUID efi_mtftp4_service_binding_protocol_guid
153
+	= EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID;
154
+
102 155
 /** Network interface identifier protocol GUID (old version) */
103 156
 EFI_GUID efi_nii_protocol_guid
104 157
 	= EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID;
@@ -130,3 +183,23 @@ EFI_GUID efi_simple_network_protocol_guid
130 183
 /** TCG protocol GUID */
131 184
 EFI_GUID efi_tcg_protocol_guid
132 185
 	= EFI_TCG_PROTOCOL_GUID;
186
+
187
+/** TCPv4 protocol GUID */
188
+EFI_GUID efi_tcp4_protocol_guid
189
+	= EFI_TCP4_PROTOCOL_GUID;
190
+
191
+/** TCPv4 service binding protocol GUID */
192
+EFI_GUID efi_tcp4_service_binding_protocol_guid
193
+	= EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID;
194
+
195
+/** UDPv4 protocol GUID */
196
+EFI_GUID efi_udp4_protocol_guid
197
+	= EFI_UDP4_PROTOCOL_GUID;
198
+
199
+/** UDPv4 service binding protocol GUID */
200
+EFI_GUID efi_udp4_service_binding_protocol_guid
201
+	= EFI_UDP4_SERVICE_BINDING_PROTOCOL_GUID;
202
+
203
+/** VLAN configuration protocol GUID */
204
+EFI_GUID efi_vlan_config_protocol_guid
205
+	= EFI_VLAN_CONFIG_PROTOCOL_GUID;

Loading…
취소
저장