[Ns-bugs] [Bug 588] "New" Ipv4: cannot change address

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Sat Jun 13 21:42:18 PDT 2009


http://www.nsnam.org/bugzilla/show_bug.cgi?id=588


Tom Henderson <tomh at tomh.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tomh at tomh.org




--- Comment #1 from Tom Henderson <tomh at tomh.org>  2009-06-14 00:42:18 EDT ---
API proposal:

--- a/src/node/ipv4.h   Sat Jun 13 14:59:35 2009 -0700
+++ b/src/node/ipv4.h   Sat Jun 13 15:35:17 2009 -0700
@@ -159,9 +159,9 @@ public:
   /**
    * \param interface Interface number of an Ipv4 interface
    * \param address Ipv4InterfaceAddress address to associate with the
underlying Ipv4 interface
-   * \returns The address index of the newly-added address
+   * \returns true if the operation succeeded
    */
-  virtual uint32_t AddAddress (uint32_t interface, Ipv4InterfaceAddress
address) = 0;
+  virtual bool AddAddress (uint32_t interface, Ipv4InterfaceAddress address) =
0;

   /**
    * \param interface Interface number of an Ipv4 interface
@@ -170,11 +170,26 @@ public:
   virtual uint32_t GetNAddresses (uint32_t interface) const = 0;

   /**
+   * Because addresses can be removed, the addressIndex is not guaranteed
+   * to be static across calls to this method.
+   * 
    * \param interface Interface number of an Ipv4 interface
    * \param addressIndex index of Ipv4InterfaceAddress 
    * \returns the Ipv4InterfaceAddress associated to the interface and
addresIndex
    */
   virtual Ipv4InterfaceAddress GetAddress (uint32_t interface, uint32_t
addressIndex) const = 0;
+
+  /**
+   * Remove the address at addressIndex on named interface.  The addressIndex
+   * for all higher indices will decrement by one after this method is called;
+   * so, for example, to remove 5 addresses from an interface i, one could
+   * call RemoveAddress (i, 0); 5 times.  
+   * 
+   * \param interface Interface number of an Ipv4 interface
+   * \param addressIndex index of Ipv4InterfaceAddress to remove 
+   * \returns true if the operation succeeded
+   */
+  virtual bool RemoveAddress (uint32_t interface, uint32_t addressIndex) = 0;




-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Ns-bugs mailing list