INET Framework for OMNeT++/OMNEST
inet::PIMBase::AssertMetric Struct Reference

#include <PIMBase.h>

Public Member Functions

 AssertMetric ()
 
 AssertMetric (int preference, int metric, IPv4Address address)
 
 AssertMetric (bool rptBit, int preference, int metric, IPv4Address address=IPv4Address::UNSPECIFIED_ADDRESS)
 
bool isInfinite () const
 
bool operator== (const AssertMetric &other) const
 
bool operator!= (const AssertMetric &other) const
 
bool operator< (const AssertMetric &other) const
 
AssertMetric setAddress (IPv4Address address) const
 

Public Attributes

short rptBit
 
short preference
 
int metric
 
IPv4Address address
 

Static Public Attributes

static const AssertMetric PIM_INFINITE
 

Constructor & Destructor Documentation

inet::PIMBase::AssertMetric::AssertMetric ( )
inline
50 : rptBit(1), preference(-1), metric(0) {}
short preference
Definition: PIMBase.h:44
int metric
Definition: PIMBase.h:45
short rptBit
Definition: PIMBase.h:43
inet::PIMBase::AssertMetric::AssertMetric ( int  preference,
int  metric,
IPv4Address  address 
)
inline
51  :
short preference
Definition: PIMBase.h:44
IPv4Address address
Definition: PIMBase.h:46
int metric
Definition: PIMBase.h:45
short rptBit
Definition: PIMBase.h:43
inet::PIMBase::AssertMetric::AssertMetric ( bool  rptBit,
int  preference,
int  metric,
IPv4Address  address = IPv4Address::UNSPECIFIED_ADDRESS 
)
inline
54  : rptBit(rptBit ? 1 : 0), preference(preference), metric(metric), address(address) { ASSERT(preference >= 0); }
short preference
Definition: PIMBase.h:44
IPv4Address address
Definition: PIMBase.h:46
int metric
Definition: PIMBase.h:45
short rptBit
Definition: PIMBase.h:43

Member Function Documentation

bool inet::PIMBase::AssertMetric::isInfinite ( ) const
inline

Referenced by operator<().

55 { return preference == -1; }
short preference
Definition: PIMBase.h:44
bool inet::PIMBase::AssertMetric::operator!= ( const AssertMetric other) const
47 {
48  return rptBit != other.rptBit || preference != other.preference ||
49  metric != other.metric || address != other.address;
50 }
short preference
Definition: PIMBase.h:44
IPv4Address address
Definition: PIMBase.h:46
int metric
Definition: PIMBase.h:45
short rptBit
Definition: PIMBase.h:43
bool inet::PIMBase::AssertMetric::operator< ( const AssertMetric other) const
53 {
54  if (isInfinite())
55  return false;
56  if (other.isInfinite())
57  return true;
58  if (rptBit != other.rptBit)
59  return rptBit < other.rptBit;
60  if (preference != other.preference)
61  return preference < other.preference;
62  if (metric != other.metric)
63  return metric < other.metric;
64  return address > other.address;
65 }
bool isInfinite() const
Definition: PIMBase.h:55
short preference
Definition: PIMBase.h:44
IPv4Address address
Definition: PIMBase.h:46
int metric
Definition: PIMBase.h:45
short rptBit
Definition: PIMBase.h:43
bool inet::PIMBase::AssertMetric::operator== ( const AssertMetric other) const
41 {
42  return rptBit == other.rptBit && preference == other.preference &&
43  metric == other.metric && address == other.address;
44 }
short preference
Definition: PIMBase.h:44
IPv4Address address
Definition: PIMBase.h:46
int metric
Definition: PIMBase.h:45
short rptBit
Definition: PIMBase.h:43
AssertMetric inet::PIMBase::AssertMetric::setAddress ( IPv4Address  address) const
inline

Referenced by inet::PIMDM::multicastPacketArrivedOnNonRpfInterface(), and inet::PIMDM::processAssert().

short preference
Definition: PIMBase.h:44
AssertMetric()
Definition: PIMBase.h:50
IPv4Address address
Definition: PIMBase.h:46
int metric
Definition: PIMBase.h:45
short rptBit
Definition: PIMBase.h:43

Member Data Documentation

int inet::PIMBase::AssertMetric::metric
const PIMBase::AssertMetric inet::PIMBase::AssertMetric::PIM_INFINITE
static
short inet::PIMBase::AssertMetric::preference
short inet::PIMBase::AssertMetric::rptBit

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