src/internet-node/arp-cache.h
changeset 632 1e419ebb4012
parent 568 e1660959ecbb
child 1161 bb72baff8b26
--- a/src/internet-node/arp-cache.h	Wed May 16 13:37:39 2007 -0400
+++ b/src/internet-node/arp-cache.h	Wed May 16 16:39:32 2007 -0400
@@ -35,16 +35,30 @@
 class NetDevice;
 class Ipv4Interface;
 
+/**
+ * \brief An ARP cache
+ *
+ * A cached lookup table for translating layer 3 addresses to layer 2.
+ * This implementation does lookups from IPv4 to a MAC address
+ */
 class ArpCache {
 public:
   class Entry;
-
+  /**
+   * \param device The hardware NetDevice associated with this ARP chache
+   * \param interface the Ipv4Interface associated with this ARP chache
+   */
   ArpCache (Ptr<NetDevice> device, Ipv4Interface *interface);
   ~ArpCache ();
-
+  /**
+   * \return The NetDevice that this ARP cache is associated with
+   */
   Ptr<NetDevice> GetDevice (void) const;
+  /**
+   * \return the Ipv4Interface that this ARP cache is associated with
+   */
   Ipv4Interface *GetInterface (void) const;
-
+  
   void SetAliveTimeout (Time aliveTimeout);
   void SetDeadTimeout (Time deadTimeout);
   void SetWaitReplyTimeout (Time waitReplyTimeout);
@@ -52,26 +66,71 @@
   Time GetDeadTimeout (void) const;
   Time GetWaitReplyTimeout (void) const;
 
-  
+  /**
+   * \brief Do lookup in the ARP chache against an IP address
+   * \param destination The destination IPv4 address to lookup the MAC address
+   * of
+   * \return An ArpCache::Entry with info about layer 2
+   */
   ArpCache::Entry *Lookup (Ipv4Address destination);
+  /**
+   * \brief Add an Ipv4Address to this ARP cache
+   */
   ArpCache::Entry *Add (Ipv4Address to);
+  /**
+   * \brief Clear the ArpCache of all entries
+   */
   void Flush (void);
 
-
+  /**
+   * \brief A record that that holds information about an ArpCache entry
+   */
   class Entry {
   public:
+    /**
+     * \brief Constructor
+     * \param arp The ArpCache this entry belongs to
+     */
     Entry (ArpCache *arp);
-
+    
+    /**
+     * \brief Changes the state of this entry to dead
+     */
     void MarkDead (void);
+    /**
+     * \param macAddress
+     * \return 
+     */
     Packet MarkAlive (MacAddress macAddress);
+    /**
+     * \param waiting
+     */
     void MarkWaitReply (Packet waiting);
+    /**
+     * \param waiting
+     * \return 
+     */
     Packet UpdateWaitReply (Packet waiting);
-    
+    /**
+     * \return True if the state of this entry is dead; false otherwise.
+     */
     bool IsDead (void);
+    /**
+     * \return True if the state of this entry is alive; false otherwise.
+     */
     bool IsAlive (void);
+    /**
+     * \return True if the state of this entry is wait_reply; false otherwise.
+     */
     bool IsWaitReply (void);
     
+    /**
+     * \return The MacAddress of this entry
+     */
     MacAddress GetMacAddress (void);
+    /**
+     * \return True if this entry has timedout; false otherwise.
+     */
     bool IsExpired (void);
   private:
     enum ArpCacheEntryState_e {