NetBurner 3.1
arpinternal.h
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
5 #ifndef _ARP_INTERNAL_H
6 #define _ARP_INTERNAL_H
7 
8 #include <basictypes.h>
9 #include <buffers.h>
10 #include <nettypes.h>
11 
12 /*-----------------------------------------------------------------------------**
13  ** The following structure defines the **
14  ** data records in the arp cache. **
15  ** The fields are: **
16  ** **
17  ** mac -> The hardware MAC address asociated with this record. **
18  ** This value is NULL when the entry has not yet been **
19  ** processed. **
20  ** **
21  ** ip -> The IP address asociated with this record. **
22  ** **
23  ** life_limit ->The seconds count when this entry should be deleted. **
24  ** **
25  ** pPendingSend ->The buffer pool pointer, this buffer should be sent when the **
26  ** mac address is finally resolved. **
27  **-----------------------------------------------------------------------------*/
28 #define ARP_STATIC_LIFETIME (0xFFFFFFFF)
29 typedef struct
30 {
31  MACADR mac;
32  IPADDR4 ip;
33  uint32_t life_limit;
34  PoolPtr pPendingSend;
35  uint16_t pvtData;
36  uint16_t interface;
37  OS_SEM *pPendingSem;
38  inline uint32_t SetLife(uint32_t newLife)
39  {
40  if (life_limit != ARP_STATIC_LIFETIME) { life_limit = newLife; }
41  return life_limit;
42  }
43 } ArpRecord;
44 
45 BOOL IsNull(ArpRecord *ar);
46 ArpRecord *FindArp(IPADDR4 ip);
47 ArpRecord *FindAddArp(IPADDR4 ip);
48 BOOL MacEqual(MACADR a1, MACADR a2);
49 void RawSendArp(ArpRecord *pa, IPADDR4 fromaddr, int ifout);
50 
51 #endif /* ----- #ifndef _ARP_INTERNAL_H_INC ----- */
Semaphores are used to control access to shared resource critical section, or to communicate between ...
Definition: nbrtos.h:318
NetBurner Buffers API.