]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h
7fd5e1bf31a5674e06f1f4ef91daeb7c00695fac
[mirror_edk2.git] / MdeModulePkg / Universal / Network / ArpDxe / ArpImpl.h
1 /** @file
2 Abstract:
3
4 Copyright (c) 2006 - 2008, Intel Corporation.<BR>
5 All rights reserved. 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<BR>
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 **/
14
15 #ifndef _ARP_IMPL_H_
16 #define _ARP_IMPL_H_
17
18
19 #include <PiDxe.h>
20
21 #include <Protocol/Arp.h>
22 #include <Protocol/ManagedNetwork.h>
23 #include <Protocol/ServiceBinding.h>
24
25 #include <Library/DebugLib.h>
26 #include <Library/UefiDriverEntryPoint.h>
27 #include <Library/UefiBootServicesTableLib.h>
28 #include <Library/UefiLib.h>
29 #include <Library/NetLib.h>
30 #include <Library/BaseLib.h>
31 #include <Library/BaseMemoryLib.h>
32 #include <Library/MemoryAllocationLib.h>
33
34
35 #define ARP_ETHER_PROTO_TYPE 0x0806
36 #define IPV4_ETHER_PROTO_TYPE 0x0800
37 #define IPV6_ETHER_PROTO_TYPE 0x86DD
38
39 #define ARP_OPCODE_REQUEST 0x0001
40 #define ARP_OPCODE_REPLY 0x0002
41
42 #define ARP_DEFAULT_TIMEOUT_VALUE (400 * TICKS_PER_SECOND)
43 #define ARP_DEFAULT_RETRY_COUNT 2
44 #define ARP_DEFAULT_RETRY_INTERVAL (5 * TICKS_PER_MS)
45 #define ARP_PERIODIC_TIMER_INTERVAL (500 * TICKS_PER_MS)
46
47 #pragma pack(1)
48 typedef struct {
49 UINT16 HwType;
50 UINT16 ProtoType;
51 UINT8 HwAddrLen;
52 UINT8 ProtoAddrLen;
53 UINT16 OpCode;
54 } ARP_HEAD;
55 #pragma pack()
56
57 typedef struct {
58 UINT8 *SenderHwAddr;
59 UINT8 *SenderProtoAddr;
60 UINT8 *TargetHwAddr;
61 UINT8 *TargetProtoAddr;
62 } ARP_ADDRESS;
63
64 #define MATCH_SW_ADDRESS 0x1
65 #define MATCH_HW_ADDRESS 0x2
66
67 typedef enum {
68 ByNone = 0,
69 ByProtoAddress = MATCH_SW_ADDRESS,
70 ByHwAddress = MATCH_HW_ADDRESS,
71 ByBoth = MATCH_SW_ADDRESS | MATCH_HW_ADDRESS
72 } FIND_OPTYPE;
73
74 #define ARP_INSTANCE_DATA_SIGNATURE SIGNATURE_32('A', 'R', 'P', 'I')
75
76 //
77 //comment for macro
78 //
79 #define ARP_INSTANCE_DATA_FROM_THIS(a) \
80 CR ( \
81 (a), \
82 ARP_INSTANCE_DATA, \
83 ArpProto, \
84 ARP_INSTANCE_DATA_SIGNATURE \
85 )
86
87 typedef struct _ARP_SERVICE_DATA ARP_SERVICE_DATA;
88
89 typedef struct {
90 UINT32 Signature;
91 ARP_SERVICE_DATA *ArpService;
92 EFI_HANDLE Handle;
93 EFI_ARP_PROTOCOL ArpProto;
94 LIST_ENTRY List;
95 EFI_ARP_CONFIG_DATA ConfigData;
96 BOOLEAN Configured;
97 BOOLEAN Destroyed;
98 } ARP_INSTANCE_DATA;
99
100 #define ARP_SERVICE_DATA_SIGNATURE SIGNATURE_32('A', 'R', 'P', 'S')
101
102 //
103 //comment for macro
104 //
105 #define ARP_SERVICE_DATA_FROM_THIS(a) \
106 CR ( \
107 (a), \
108 ARP_SERVICE_DATA, \
109 ServiceBinding, \
110 ARP_SERVICE_DATA_SIGNATURE \
111 )
112
113 struct _ARP_SERVICE_DATA {
114 UINT32 Signature;
115 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
116
117 EFI_HANDLE MnpChildHandle;
118 EFI_HANDLE ImageHandle;
119 EFI_HANDLE ControllerHandle;
120
121 EFI_MANAGED_NETWORK_PROTOCOL *Mnp;
122 EFI_MANAGED_NETWORK_CONFIG_DATA MnpConfigData;
123 EFI_MANAGED_NETWORK_COMPLETION_TOKEN RxToken;
124
125 EFI_SIMPLE_NETWORK_MODE SnpMode;
126
127 UINTN ChildrenNumber;
128 LIST_ENTRY ChildrenList;
129
130 LIST_ENTRY PendingRequestTable;
131 LIST_ENTRY DeniedCacheTable;
132 LIST_ENTRY ResolvedCacheTable;
133
134 EFI_EVENT PeriodicTimer;
135 };
136
137 typedef struct {
138 LIST_ENTRY List;
139 ARP_INSTANCE_DATA *Instance;
140 EFI_EVENT UserRequestEvent;
141 VOID *UserHwAddrBuffer;
142 } USER_REQUEST_CONTEXT;
143
144 #define ARP_MAX_PROTOCOL_ADDRESS_LEN sizeof(EFI_IP_ADDRESS)
145 #define ARP_MAX_HARDWARE_ADDRESS_LEN sizeof(EFI_MAC_ADDRESS)
146
147 typedef struct {
148 UINT16 Type;
149 UINT8 Length;
150 UINT8 *AddressPtr;
151 union {
152 UINT8 ProtoAddress[ARP_MAX_PROTOCOL_ADDRESS_LEN];
153 UINT8 HwAddress[ARP_MAX_HARDWARE_ADDRESS_LEN];
154 } Buffer;
155 } NET_ARP_ADDRESS;
156
157 typedef enum {
158 Hardware,
159 Protocol
160 } ARP_ADDRESS_TYPE;
161
162 typedef struct {
163 LIST_ENTRY List;
164
165 UINT32 RetryCount;
166 UINT32 DefaultDecayTime;
167 UINT32 DecayTime;
168 UINT32 NextRetryTime;
169
170 NET_ARP_ADDRESS Addresses[2];
171
172 LIST_ENTRY UserRequestList;
173 } ARP_CACHE_ENTRY;
174
175 /**
176 This function is used to assign a station address to the ARP cache for this instance
177 of the ARP driver. Each ARP instance has one station address. The EFI_ARP_PROTOCOL
178 driver will respond to ARP requests that match this registered station address.
179 A call to this function with the ConfigData field set to NULL will reset this
180 ARP instance.
181
182 Once a protocol type and station address have been assigned to this ARP instance,
183 all the following ARP functions will use this information. Attempting to change
184 the protocol type or station address to a configured ARP instance will result in errors.
185
186 @param[in] This Pointer to the EFI_ARP_PROTOCOL instance.
187 @param[in] ConfigData Pointer to the EFI_ARP_CONFIG_DATA structure.
188
189 @retval EFI_SUCCESS The new station address was successfully
190 registered.
191 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
192 This is NULL. SwAddressLength is zero when
193 ConfigData is not NULL. StationAddress is NULL
194 when ConfigData is not NULL.
195 @retval EFI_ACCESS_DENIED The SwAddressType, SwAddressLength, or
196 StationAddress is different from the one that is
197 already registered.
198 @retval EFI_OUT_OF_RESOURCES Storage for the new StationAddress could not be
199 allocated.
200
201 **/
202 EFI_STATUS
203 EFIAPI
204 ArpConfigure (
205 IN EFI_ARP_PROTOCOL *This,
206 IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL
207 );
208
209 /**
210 This function is used to insert entries into the ARP cache.
211
212 ARP cache entries are typically inserted and updated by network protocol drivers
213 as network traffic is processed. Most ARP cache entries will time out and be
214 deleted if the network traffic stops. ARP cache entries that were inserted
215 by the Add() function may be static (will not time out) or dynamic (will time out).
216 Default ARP cache timeout values are not covered in most network protocol
217 specifications (although RFC 1122 comes pretty close) and will only be
218 discussed in general in this specification. The timeout values that are
219 used in the EFI Sample Implementation should be used only as a guideline.
220 Final product implementations of the EFI network stack should be tuned for
221 their expected network environments.
222
223 @param[in] This Pointer to the EFI_ARP_PROTOCOL instance.
224 @param[in] DenyFlag Set to TRUE if this entry is a deny entry. Set to
225 FALSE if this entry is a normal entry.
226 @param[in] TargetSwAddress Pointer to a protocol address to add (or deny).
227 May be set to NULL if DenyFlag is TRUE.
228 @param[in] TargetHwAddress Pointer to a hardware address to add (or deny).
229 May be set to NULL if DenyFlag is TRUE.
230 @param[in] TimeoutValue Time in 100-ns units that this entry will remain
231 in the ARP cache. A value of zero means that the
232 entry is permanent. A nonzero value will override
233 the one given by Configure() if the entry to be
234 added is a dynamic entry.
235 @param[in] Overwrite If TRUE, the matching cache entry will be
236 overwritten with the supplied parameters. If
237 FALSE, EFI_ACCESS_DENIED is returned if the
238 corresponding cache entry already exists.
239
240 @retval EFI_SUCCESS The entry has been added or updated.
241 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
242 This is NULL. DenyFlag is FALSE and
243 TargetHwAddress is NULL. DenyFlag is FALSE and
244 TargetSwAddress is NULL. TargetHwAddress is NULL
245 and TargetSwAddress is NULL. Both TargetSwAddress
246 and TargetHwAddress are not NULL when DenyFlag is
247 TRUE.
248 @retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated.
249 @retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite
250 is not true.
251 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
252
253 **/
254 EFI_STATUS
255 EFIAPI
256 ArpAdd (
257 IN EFI_ARP_PROTOCOL *This,
258 IN BOOLEAN DenyFlag,
259 IN VOID *TargetSwAddress OPTIONAL,
260 IN VOID *TargetHwAddress OPTIONAL,
261 IN UINT32 TimeoutValue,
262 IN BOOLEAN Overwrite
263 );
264
265 /**
266 This function searches the ARP cache for matching entries and allocates a buffer into
267 which those entries are copied.
268
269 The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which
270 are protocol address pairs and hardware address pairs.
271 When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer
272 is not NULL), the ARP cache timeout for the found entry is reset if Refresh is
273 set to TRUE. If the found ARP cache entry is a permanent entry, it is not
274 affected by Refresh.
275
276 @param[in] This Pointer to the EFI_ARP_PROTOCOL instance.
277 @param[in] BySwAddress Set to TRUE to look for matching software protocol
278 addresses. Set to FALSE to look for matching
279 hardware protocol addresses.
280 @param[in] AddressBuffer Pointer to address buffer. Set to NULL to match
281 all addresses.
282 @param[out] EntryLength The size of an entry in the entries buffer.
283 @param[out] EntryCount The number of ARP cache entries that are found by
284 the specified criteria.
285 @param[out] Entries Pointer to the buffer that will receive the ARP
286 cache entries.
287 @param[in] Refresh Set to TRUE to refresh the timeout value of the
288 matching ARP cache entry.
289
290 @retval EFI_SUCCESS The requested ARP cache entries were copied into
291 the buffer.
292 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
293 This is NULL. Both EntryCount and EntryLength are
294 NULL, when Refresh is FALSE.
295 @retval EFI_NOT_FOUND No matching entries were found.
296 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
297
298 **/
299 EFI_STATUS
300 EFIAPI
301 ArpFind (
302 IN EFI_ARP_PROTOCOL *This,
303 IN BOOLEAN BySwAddress,
304 IN VOID *AddressBuffer OPTIONAL,
305 OUT UINT32 *EntryLength OPTIONAL,
306 OUT UINT32 *EntryCount OPTIONAL,
307 OUT EFI_ARP_FIND_DATA **Entries OPTIONAL,
308 IN BOOLEAN Refresh
309 );
310
311 /**
312 This function removes specified ARP cache entries.
313
314 @param[in] This Pointer to the EFI_ARP_PROTOCOL instance.
315 @param[in] BySwAddress Set to TRUE to delete matching protocol addresses.
316 Set to FALSE to delete matching hardware
317 addresses.
318 @param[in] AddressBuffer Pointer to the address buffer that is used as a
319 key to look for the cache entry. Set to NULL to
320 delete all entries.
321
322 @retval EFI_SUCCESS The entry was removed from the ARP cache.
323 @retval EFI_INVALID_PARAMETER This is NULL.
324 @retval EFI_NOT_FOUND The specified deletion key was not found.
325 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
326
327 **/
328 EFI_STATUS
329 EFIAPI
330 ArpDelete (
331 IN EFI_ARP_PROTOCOL *This,
332 IN BOOLEAN BySwAddress,
333 IN VOID *AddressBuffer OPTIONAL
334 );
335
336 /**
337 This function delete all dynamic entries from the ARP cache that match the specified
338 software protocol type.
339
340 @param[in] This Pointer to the EFI_ARP_PROTOCOL instance.
341
342 @retval EFI_SUCCESS The cache has been flushed.
343 @retval EFI_INVALID_PARAMETER This is NULL.
344 @retval EFI_NOT_FOUND There are no matching dynamic cache entries.
345 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
346
347 **/
348 EFI_STATUS
349 EFIAPI
350 ArpFlush (
351 IN EFI_ARP_PROTOCOL *This
352 );
353
354 /**
355 This function tries to resolve the TargetSwAddress and optionally returns a
356 TargetHwAddress if it already exists in the ARP cache.
357
358 @param[in] This Pointer to the EFI_ARP_PROTOCOL instance.
359 @param[in] TargetSwAddress Pointer to the protocol address to resolve.
360 @param[in] ResolvedEvent Pointer to the event that will be signaled when
361 the address is resolved or some error occurs.
362 @param[out] TargetHwAddress Pointer to the buffer for the resolved hardware
363 address in network byte order.
364
365 @retval EFI_SUCCESS The data is copied from the ARP cache into the
366 TargetHwAddress buffer.
367 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
368 This is NULL. TargetHwAddress is NULL.
369 @retval EFI_ACCESS_DENIED The requested address is not present in the normal
370 ARP cache but is present in the deny address list.
371 Outgoing traffic to that address is forbidden.
372 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
373 @retval EFI_NOT_READY The request has been started and is not finished.
374
375 **/
376 EFI_STATUS
377 EFIAPI
378 ArpRequest (
379 IN EFI_ARP_PROTOCOL *This,
380 IN VOID *TargetSwAddress OPTIONAL,
381 IN EFI_EVENT ResolvedEvent OPTIONAL,
382 OUT VOID *TargetHwAddress
383 );
384
385 /**
386 This function aborts the previous ARP request (identified by This, TargetSwAddress
387 and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request().
388
389 If the request is in the internal ARP request queue, the request is aborted
390 immediately and its ResolvedEvent is signaled. Only an asynchronous address
391 request needs to be canceled. If TargeSwAddress and ResolveEvent are both
392 NULL, all the pending asynchronous requests that have been issued by This
393 instance will be cancelled and their corresponding events will be signaled.
394
395 @param[in] This Pointer to the EFI_ARP_PROTOCOL instance.
396 @param[in] TargetSwAddress Pointer to the protocol address in previous
397 request session.
398 @param[in] ResolvedEvent Pointer to the event that is used as the
399 notification event in previous request session.
400
401 @retval EFI_SUCCESS The pending request session(s) is/are aborted and
402 corresponding event(s) is/are signaled.
403 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
404 This is NULL. TargetSwAddress is not NULL and
405 ResolvedEvent is NULL. TargetSwAddress is NULL and
406 ResolvedEvent is not NULL.
407 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
408 @retval EFI_NOT_FOUND The request is not issued by
409 EFI_ARP_PROTOCOL.Request().
410
411 **/
412 EFI_STATUS
413 EFIAPI
414 ArpCancel (
415 IN EFI_ARP_PROTOCOL *This,
416 IN VOID *TargetSwAddress OPTIONAL,
417 IN EFI_EVENT ResolvedEvent OPTIONAL
418 );
419
420 /**
421 Configure the instance using the ConfigData. ConfigData is already validated.
422
423 @param[in] Instance Pointer to the instance context data to be
424 configured.
425 @param[in] ConfigData Pointer to the configuration data used to
426 configure the instance.
427
428 @retval EFI_SUCCESS The instance is configured with the ConfigData.
429 @retval EFI_ACCESS_DENIED The instance is already configured and the
430 ConfigData tries to reset some unchangeable
431 fields.
432 @retval EFI_INVALID_PARAMETER The ConfigData provides a non-unicast IPv4 address
433 when the SwAddressType is IPv4.
434 @retval EFI_OUT_OF_RESOURCES The instance fails to configure due to memory
435 limitation.
436
437 **/
438 EFI_STATUS
439 ArpConfigureInstance (
440 IN ARP_INSTANCE_DATA *Instance,
441 IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL
442 );
443
444 /**
445 Find the CacheEntry, using ProtocolAddress or HardwareAddress or both, as the keyword,
446 in the DeniedCacheTable.
447
448 @param[in] ArpService Pointer to the arp service context data.
449 @param[in] ProtocolAddress Pointer to the protocol address.
450 @param[in] HardwareAddress Pointer to the hardware address.
451
452 @return Pointer to the matched cache entry, if NULL no match is found.
453
454 **/
455 ARP_CACHE_ENTRY *
456 ArpFindDeniedCacheEntry (
457 IN ARP_SERVICE_DATA *ArpService,
458 IN NET_ARP_ADDRESS *ProtocolAddress OPTIONAL,
459 IN NET_ARP_ADDRESS *HardwareAddress OPTIONAL
460 );
461
462 /**
463 Find the CacheEntry which matches the requirements in the specified CacheTable.
464
465 @param[in] CacheTable Pointer to the arp cache table.
466 @param[in] StartEntry Pointer to the start entry this search begins with
467 in the cache table.
468 @param[in] FindOpType The search type.
469 @param[in] ProtocolAddress Pointer to the protocol address to match.
470 @param[in] HardwareAddress Pointer to the hardware address to match.
471
472 @return Pointer to the matched arp cache entry, if NULL, no match is found.
473
474 **/
475 ARP_CACHE_ENTRY *
476 ArpFindNextCacheEntryInTable (
477 IN LIST_ENTRY *CacheTable,
478 IN LIST_ENTRY *StartEntry,
479 IN FIND_OPTYPE FindOpType,
480 IN NET_ARP_ADDRESS *ProtocolAddress OPTIONAL,
481 IN NET_ARP_ADDRESS *HardwareAddress OPTIONAL
482 );
483
484 /**
485 Allocate a cache entry and initialize it.
486
487 @param[in] Instance Pointer to the instance context data.
488
489 @return Pointer to the new created cache entry.
490
491 **/
492 ARP_CACHE_ENTRY *
493 ArpAllocCacheEntry (
494 IN ARP_INSTANCE_DATA *Instance
495 );
496
497 /**
498 Fill the addresses in the CacheEntry using the information passed in by
499 HwAddr and SwAddr.
500
501 @param[in] CacheEntry Pointer to the cache entry.
502 @param[in] HwAddr Pointer to the software address.
503 @param[in] SwAddr Pointer to the hardware address.
504
505 @return None.
506
507 **/
508 VOID
509 ArpFillAddressInCacheEntry (
510 IN ARP_CACHE_ENTRY *CacheEntry,
511 IN NET_ARP_ADDRESS *HwAddr OPTIONAL,
512 IN NET_ARP_ADDRESS *SwAddr OPTIONAL
513 );
514
515 /**
516 Turn the CacheEntry into the resolved status.
517
518 @param[in] CacheEntry Pointer to the resolved cache entry.
519 @param[in] Instance Pointer to the instance context data.
520 @param[in] UserEvent Pointer to the UserEvent to notify.
521
522 @return The count of notifications sent to the instance.
523
524 **/
525 UINTN
526 ArpAddressResolved (
527 IN ARP_CACHE_ENTRY *CacheEntry,
528 IN ARP_INSTANCE_DATA *Instance OPTIONAL,
529 IN EFI_EVENT UserEvent OPTIONAL
530 );
531
532 /**
533 Delete cache entries in all the cache tables.
534
535 @param[in] Instance Pointer to the instance context data.
536 @param[in] BySwAddress Delete the cache entry by software address or by
537 hardware address.
538 @param[in] AddressBuffer Pointer to the buffer containing the address to
539 match for the deletion.
540 @param[in] Force This deletion is forced or not.
541
542 @return The count of the deleted cache entries.
543
544 **/
545 UINTN
546 ArpDeleteCacheEntry (
547 IN ARP_INSTANCE_DATA *Instance,
548 IN BOOLEAN BySwAddress,
549 IN UINT8 *AddressBuffer OPTIONAL,
550 IN BOOLEAN Force
551 );
552
553 /**
554 Send out an arp frame using the CachEntry and the ArpOpCode.
555
556 @param[in] Instance Pointer to the instance context data.
557 @param[in] CacheEntry Pointer to the configuration data used to
558 configure the instance.
559 @param[in] ArpOpCode The opcode used to send out this Arp frame, either
560 request or reply.
561
562 @return None.
563
564 **/
565 VOID
566 ArpSendFrame (
567 IN ARP_INSTANCE_DATA *Instance,
568 IN ARP_CACHE_ENTRY *CacheEntry,
569 IN UINT16 ArpOpCode
570 );
571
572 /**
573 Initialize the instance context data.
574
575 @param[in] ArpService Pointer to the arp service context data this
576 instance belongs to.
577 @param[in] Instance Pointer to the instance context data.
578
579 @return None.
580
581 **/
582 VOID
583 ArpInitInstance (
584 IN ARP_SERVICE_DATA *ArpService,
585 IN ARP_INSTANCE_DATA *Instance
586 );
587
588 /**
589 Process the Arp packets received from Mnp, the procedure conforms to RFC826.
590
591 @param[in] Context Pointer to the context data registerd to the
592 Event.
593
594 @return None.
595
596 **/
597 VOID
598 EFIAPI
599 ArpOnFrameRcvdDpc (
600 IN VOID *Context
601 );
602
603 /**
604 Queue ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK.
605
606 @param[in] Event The Event this notify function registered to.
607 @param[in] Context Pointer to the context data registerd to the
608 Event.
609
610 @return None.
611
612 **/
613 VOID
614 EFIAPI
615 ArpOnFrameRcvd (
616 IN EFI_EVENT Event,
617 IN VOID *Context
618 );
619
620 /**
621 Process the already sent arp packets.
622
623 @param[in] Context Pointer to the context data registerd to the
624 Event.
625
626 @return None.
627
628 **/
629 VOID
630 EFIAPI
631 ArpOnFrameSentDpc (
632 IN VOID *Context
633 );
634
635 /**
636 Queue ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK.
637
638 @param[in] Event The Event this notify function registered to.
639 @param[in] Context Pointer to the context data registerd to the
640 Event.
641
642 @return None.
643
644 **/
645 VOID
646 EFIAPI
647 ArpOnFrameSent (
648 IN EFI_EVENT Event,
649 IN VOID *Context
650 );
651
652 /**
653 Process the arp cache olding and drive the retrying arp requests.
654
655 @param[in] Event The Event this notify function registered to.
656 @param[in] Context Pointer to the context data registerd to the
657 Event.
658
659 @return None.
660
661 **/
662 VOID
663 EFIAPI
664 ArpTimerHandler (
665 IN EFI_EVENT Event,
666 IN VOID *Context
667 );
668
669 /**
670 Cancel the arp request.
671
672 @param[in] Instance Pointer to the instance context data.
673 @param[in] TargetSwAddress Pointer to the buffer containing the target
674 software address to match the arp request.
675 @param[in] UserEvent The user event used to notify this request
676 cancellation.
677
678 @return The count of the cancelled requests.
679
680 **/
681 UINTN
682 ArpCancelRequest (
683 IN ARP_INSTANCE_DATA *Instance,
684 IN VOID *TargetSwAddress OPTIONAL,
685 IN EFI_EVENT UserEvent OPTIONAL
686 );
687
688 /**
689 Find the cache entry in the cache table.
690
691 @param[in] Instance Pointer to the instance context data.
692 @param[in] BySwAddress Set to TRUE to look for matching software protocol
693 addresses. Set to FALSE to look for matching
694 hardware protocol addresses.
695 @param[in] AddressBuffer Pointer to address buffer. Set to NULL to match
696 all addresses.
697 @param[out] EntryLength The size of an entry in the entries buffer.
698 @param[out] EntryCount The number of ARP cache entries that are found by
699 the specified criteria.
700 @param[out] Entries Pointer to the buffer that will receive the ARP
701 cache entries.
702 @param[in] Refresh Set to TRUE to refresh the timeout value of the
703 matching ARP cache entry.
704
705 @retval EFI_SUCCESS The requested ARP cache entries are copied into
706 the buffer.
707 @retval EFI_NOT_FOUND No matching entries found.
708 @retval EFI_OUT_OF_RESOURCE There is a memory allocation failure.
709
710 **/
711 EFI_STATUS
712 ArpFindCacheEntry (
713 IN ARP_INSTANCE_DATA *Instance,
714 IN BOOLEAN BySwAddress,
715 IN VOID *AddressBuffer OPTIONAL,
716 OUT UINT32 *EntryLength OPTIONAL,
717 OUT UINT32 *EntryCount OPTIONAL,
718 OUT EFI_ARP_FIND_DATA **Entries OPTIONAL,
719 IN BOOLEAN Refresh
720 );
721
722 #endif