INET Framework for OMNeT++/OMNEST
inet::ospf::IPv4AddressRange Struct Reference

#include <OSPFcommon.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

inet::ospf::IPv4AddressRange::IPv4AddressRange ( )
inline
81 : address(), mask() {}
IPv4Address address
Definition: OSPFcommon.h:79
IPv4Address mask
Definition: OSPFcommon.h:80
inet::ospf::IPv4AddressRange::IPv4AddressRange ( IPv4Address  addressPar,
IPv4Address  maskPar 
)
inline
82 : address(addressPar), mask(maskPar) {}
IPv4Address address
Definition: OSPFcommon.h:79
IPv4Address mask
Definition: OSPFcommon.h:80

Member Function Documentation

bool inet::ospf::IPv4AddressRange::containedByRange ( const IPv4Address otherAddress,
const IPv4Address otherMask 
) const
inline

Referenced by inet::ospf::Area::calculateInterAreaRoutes().

110  {
111  return IPv4Address::maskedAddrAreEqual(otherAddress, address, otherMask) && (otherMask <= mask);
112  }
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:260
IPv4Address address
Definition: OSPFcommon.h:79
IPv4Address mask
Definition: OSPFcommon.h:80
bool inet::ospf::IPv4AddressRange::contains ( const IPv4Address other) const
inline

Referenced by inet::ospf::Area::addAddressRange().

95  {
97  }
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:260
IPv4Address address
Definition: OSPFcommon.h:79
IPv4Address mask
Definition: OSPFcommon.h:80
bool inet::ospf::IPv4AddressRange::contains ( const IPv4AddressRange other) const
inline
100  {
101  return IPv4Address::maskedAddrAreEqual(address, other.address, mask) && (mask <= other.mask);
102  }
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:260
IPv4Address address
Definition: OSPFcommon.h:79
IPv4Address mask
Definition: OSPFcommon.h:80
bool inet::ospf::IPv4AddressRange::containsRange ( const IPv4Address otherAddress,
const IPv4Address otherMask 
) const
inline

Referenced by inet::ospf::Router::lookup(), and inet::ospf::Area::originateSummaryLSA().

105  {
106  return IPv4Address::maskedAddrAreEqual(address, otherAddress, mask) && (mask <= otherMask);
107  }
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:260
IPv4Address address
Definition: OSPFcommon.h:79
IPv4Address mask
Definition: OSPFcommon.h:80
bool inet::ospf::IPv4AddressRange::operator!= ( IPv4AddressRange  other) const
inline
115  {
116  return !operator==(other);
117  }
bool operator==(const IPv4AddressRange &other) const
Definition: OSPFcommon.h:89
bool inet::ospf::IPv4AddressRange::operator< ( const IPv4AddressRange other) const
inline
85  {
86  return (mask > other.mask) || ((mask == other.mask) && (address < other.address));
87  }
IPv4Address address
Definition: OSPFcommon.h:79
IPv4Address mask
Definition: OSPFcommon.h:80
bool inet::ospf::IPv4AddressRange::operator== ( const IPv4AddressRange other) const
inline
90  {
91  return (address == other.address) && (mask == other.mask);
92  }
IPv4Address address
Definition: OSPFcommon.h:79
IPv4Address mask
Definition: OSPFcommon.h:80
std::string inet::ospf::IPv4AddressRange::str ( ) const
inline

Referenced by inet::ospf::Area::addAddressRange().

123 {
124  std::string str(address.str(false));
125  str += "/";
126  str += mask.str(false);
127  return str;
128 }
std::string str(bool printUnspec=true) const
Returns the string representation of the address (e.g.
Definition: IPv4Address.cc:109
IPv4Address address
Definition: OSPFcommon.h:79
std::string str() const
Definition: OSPFcommon.h:122
IPv4Address mask
Definition: OSPFcommon.h:80

Member Data Documentation


The documentation for this struct was generated from the following file: