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