INET Framework for OMNeT++/OMNEST
inet::ospfv3::Ipv4AddressRange Struct Reference

#include <Ospfv3Common.h>

Public Member Functions

 Ipv4AddressRange ()
 
 Ipv4AddressRange (Ipv4Address addressPar, Ipv4Address maskPar)
 
bool operator< (const Ipv4AddressRange &other) const
 
bool operator== (const Ipv4AddressRange &other) const
 
bool contains (const Ipv4Address &other) const
 
bool contains (const Ipv4AddressRange &other) const
 
bool containsRange (const Ipv4Address &otherAddress, const Ipv4Address &otherMask) const
 
bool containedByRange (const Ipv4Address &otherAddress, const Ipv4Address &otherMask) const
 
bool operator!= (Ipv4AddressRange other) const
 
std::string str () const
 

Public Attributes

Ipv4Address address
 
Ipv4Address mask
 

Constructor & Destructor Documentation

◆ Ipv4AddressRange() [1/2]

inet::ospfv3::Ipv4AddressRange::Ipv4AddressRange ( )
inline
156 : address(), mask() {}

◆ Ipv4AddressRange() [2/2]

inet::ospfv3::Ipv4AddressRange::Ipv4AddressRange ( Ipv4Address  addressPar,
Ipv4Address  maskPar 
)
inline
157 : address(addressPar), mask(maskPar) {}

Member Function Documentation

◆ containedByRange()

bool inet::ospfv3::Ipv4AddressRange::containedByRange ( const Ipv4Address otherAddress,
const Ipv4Address otherMask 
) const
inline
185  {
186  return Ipv4Address::maskedAddrAreEqual(otherAddress, address, otherMask) && (otherMask <= mask);
187  }

Referenced by inet::ospfv3::Ospfv3Area::calculateInterAreaRoutes().

◆ contains() [1/2]

bool inet::ospfv3::Ipv4AddressRange::contains ( const Ipv4Address other) const
inline
170  {
172  }

Referenced by inet::ospfv3::Ospfv3Area::addAddressRange().

◆ contains() [2/2]

bool inet::ospfv3::Ipv4AddressRange::contains ( const Ipv4AddressRange other) const
inline
175  {
176  return Ipv4Address::maskedAddrAreEqual(address, other.address, mask) && (mask <= other.mask);
177  }

◆ containsRange()

bool inet::ospfv3::Ipv4AddressRange::containsRange ( const Ipv4Address otherAddress,
const Ipv4Address otherMask 
) const
inline
180  {
181  return Ipv4Address::maskedAddrAreEqual(address, otherAddress, mask) && (mask <= otherMask);
182  }

◆ operator!=()

bool inet::ospfv3::Ipv4AddressRange::operator!= ( Ipv4AddressRange  other) const
inline
190  {
191  return !operator==(other);
192  }

◆ operator<()

bool inet::ospfv3::Ipv4AddressRange::operator< ( const Ipv4AddressRange other) const
inline
160  {
161  return (mask > other.mask) || ((mask == other.mask) && (address < other.address));
162  }

◆ operator==()

bool inet::ospfv3::Ipv4AddressRange::operator== ( const Ipv4AddressRange other) const
inline
165  {
166  return (address == other.address) && (mask == other.mask);
167  }

Referenced by operator!=().

◆ str()

std::string inet::ospfv3::Ipv4AddressRange::str ( ) const
inline
198 {
199  std::string str(address.str(false));
200  str += "/";
201  str += mask.str(false);
202  return str;
203 }

Referenced by inet::ospfv3::Ospfv3Area::addAddressRange().

Member Data Documentation

◆ address

◆ mask


The documentation for this struct was generated from the following file:
inet::ospfv3::Ipv4AddressRange::address
Ipv4Address address
Definition: Ospfv3Common.h:154
inet::ospfv3::Ipv4AddressRange::mask
Ipv4Address mask
Definition: Ospfv3Common.h:155
inet::ospfv3::Ipv4AddressRange::str
std::string str() const
Definition: Ospfv3Common.h:197
inet::Ipv4Address::maskedAddrAreEqual
static bool maskedAddrAreEqual(const Ipv4Address &addr1, const Ipv4Address &addr2, const Ipv4Address &netmask)
Test if the masked addresses (ie the mask is applied to addr1 and addr2) are equal.
Definition: Ipv4Address.cc:249
inet::Ipv4Address::str
std::string str(bool printUnspec=true) const
Returns the string representation of the address (e.g.
Definition: Ipv4Address.cc:98
inet::ospfv3::Ipv4AddressRange::operator==
bool operator==(const Ipv4AddressRange &other) const
Definition: Ospfv3Common.h:164