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