src/internet-node/arp-cache.h
changeset 548 85c56883f1c6
parent 524 082ffdd8fbd7
child 551 12ed30c77cab
equal deleted inserted replaced
547:fc6c84abb832 548:85c56883f1c6
    26 #include "ns3/nstime.h"
    26 #include "ns3/nstime.h"
    27 #include "ns3/net-device.h"
    27 #include "ns3/net-device.h"
    28 #include "ns3/ipv4-address.h"
    28 #include "ns3/ipv4-address.h"
    29 #include "ns3/mac-address.h"
    29 #include "ns3/mac-address.h"
    30 #include "sgi-hashmap.h"
    30 #include "sgi-hashmap.h"
       
    31 #include "ns3/ptr.h"
       
    32 #include "ipv4-interface.h"
    31 
    33 
    32 namespace ns3 {
    34 namespace ns3 {
    33 
    35 
    34 class NetDevice;
    36 class NetDevice;
    35 class Ipv4Interface;
       
    36 
    37 
    37 class ArpCache {
    38 class ArpCache {
    38 public:
    39 public:
    39   class Entry;
    40   class Entry;
    40 
    41 
    41   ArpCache (NetDevice *device, Ipv4Interface *interface);
    42   ArpCache (NetDevice *device, Ptr<Ipv4Interface> interface);
    42   ~ArpCache ();
    43   ~ArpCache ();
    43 
    44 
    44   NetDevice *PeekDevice (void) const;
    45   NetDevice *PeekDevice (void) const;
    45   Ipv4Interface *GetInterface (void) const;
    46   Ptr<Ipv4Interface> GetInterface (void) const;
    46 
    47 
    47   void SetAliveTimeout (Time aliveTimeout);
    48   void SetAliveTimeout (Time aliveTimeout);
    48   void SetDeadTimeout (Time deadTimeout);
    49   void SetDeadTimeout (Time deadTimeout);
    49   void SetWaitReplyTimeout (Time waitReplyTimeout);
    50   void SetWaitReplyTimeout (Time waitReplyTimeout);
    50   Time GetAliveTimeout (void) const;
    51   Time GetAliveTimeout (void) const;
    90 private:
    91 private:
    91   typedef sgi::hash_map<Ipv4Address, ArpCache::Entry *, Ipv4AddressHash> Cache;
    92   typedef sgi::hash_map<Ipv4Address, ArpCache::Entry *, Ipv4AddressHash> Cache;
    92   typedef sgi::hash_map<Ipv4Address, ArpCache::Entry *, Ipv4AddressHash>::iterator CacheI;
    93   typedef sgi::hash_map<Ipv4Address, ArpCache::Entry *, Ipv4AddressHash>::iterator CacheI;
    93 
    94 
    94   NetDevice *m_device;
    95   NetDevice *m_device;
    95   Ipv4Interface *m_interface;
    96   Ptr<Ipv4Interface> m_interface;
    96   Time m_aliveTimeout;
    97   Time m_aliveTimeout;
    97   Time m_deadTimeout;
    98   Time m_deadTimeout;
    98   Time m_waitReplyTimeout;
    99   Time m_waitReplyTimeout;
    99   Cache m_arpCache;
   100   Cache m_arpCache;
   100 };
   101 };