Implementation cut over to use Ipv4InterfaceAddress

This commit is contained in:
Tom Henderson
2009-04-12 22:13:49 -07:00
parent 13140ee899
commit 5c3fa90cac
26 changed files with 213 additions and 263 deletions

View File

@@ -45,9 +45,13 @@ Ipv4::GetInterfaceByAddress (Ipv4Address addr, Ipv4Mask mask)
{
for (uint32_t i = 0; i < GetNInterfaces (); i++)
{
if (GetAddress (i).CombineMask(mask) == addr.CombineMask(mask) )
for (uint32_t j = 0; j < GetNAddresses (i); j++)
{
return i;
Ipv4InterfaceAddress ipv4InAddr = GetAddress (i, j);
if (ipv4InAddr.GetLocal ().CombineMask(mask) == addr.CombineMask(mask) )
{
return i;
}
}
}
// Mapping not found

View File

@@ -411,24 +411,6 @@ public:
*/
virtual Ipv4InterfaceAddress GetAddress (uint32_t interface, uint32_t addressIndex) const = 0;
/**
* \param i index of ipv4 interface
* \param address address to associate to the underlying ipv4 interface
*/
virtual void SetAddress (uint32_t i, Ipv4Address address) = 0;
/**
* \param i index of ipv4 interface
* \param mask mask to associate to the underlying ipv4 interface
*/
virtual void SetNetworkMask (uint32_t i, Ipv4Mask mask) = 0;
/**
* \param i index of ipv4 interface
* \returns the mask associated to the underlying ipv4 interface
*/
virtual Ipv4Mask GetNetworkMask (uint32_t i) const = 0;
/**
* \param i index of ipv4 interface
* \param metric routing metric (cost) associated to the underlying
@@ -443,17 +425,6 @@ public:
*/
virtual uint16_t GetMetric (uint32_t i) const = 0;
/**
* \param i index of ipv4 interface
* \returns the address associated to the underlying ipv4 interface
*
* Note that the broadcast address for this interface may be fetched
* from the Ipv4Address object returned here using
* Ipv4Address::GetSubnetDirectedBroadcast(mask), where the mask for
* the interface may be retrived using Ipv4::GetNetworkMask(i).
*/
virtual Ipv4Address GetAddress (uint32_t i) const = 0;
/**
* \param destination The IP address of a hypothetical destination.
* \returns The IP address assigned to the interface that will be used