|
Bugzilla – Full Text Bug Listing |
| Summary: | "New" Ipv4: cannot change address | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Francesco Malandrino <francesco.malandrino> |
| Component: | internet | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | francesco.malandrino, mathieu.lacage, tomh |
| Priority: | P5 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | untested patch to fix | ||
|
Description
Francesco Malandrino
2009-06-11 07:28:50 UTC
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;
Created attachment 465 [details]
untested patch to fix
+1 changeset 55948d1baa64 |