Network Doxygen warnings start
This commit is contained in:
@@ -169,7 +169,7 @@ Address::Deserialize (TagBuffer buffer)
|
||||
buffer.Read (m_data, m_len);
|
||||
}
|
||||
|
||||
ATTRIBUTE_HELPER_CPP (Address);
|
||||
ATTRIBUTE_HELPER_CPP (Address); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
|
||||
bool operator == (const Address &a, const Address &b)
|
||||
|
||||
@@ -224,7 +224,7 @@ private:
|
||||
* \brief hold objects of type ns3::Address
|
||||
*/
|
||||
|
||||
ATTRIBUTE_HELPER_HEADER (Address);
|
||||
ATTRIBUTE_HELPER_HEADER (Address); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
bool operator == (const Address &a, const Address &b);
|
||||
bool operator != (const Address &a, const Address &b);
|
||||
|
||||
@@ -123,11 +123,11 @@ protected:
|
||||
virtual void DoDispose (void);
|
||||
virtual void DoInitialize (void);
|
||||
|
||||
Ptr<Node> m_node;
|
||||
Time m_startTime;
|
||||
Time m_stopTime;
|
||||
EventId m_startEvent;
|
||||
EventId m_stopEvent;
|
||||
Ptr<Node> m_node; /// The node that this application is installed on
|
||||
Time m_startTime; /// The simulation time that the appliacation will start
|
||||
Time m_stopTime; /// The simulation time that the appliacation will end
|
||||
EventId m_startEvent; /// The event that will fire at m_startTime to start the application
|
||||
EventId m_stopEvent; /// The event that will fire at m_stopTime to end the application
|
||||
};
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -68,24 +68,53 @@ struct ByteTagListData;
|
||||
class ByteTagList
|
||||
{
|
||||
public:
|
||||
|
||||
/*
|
||||
* \brief An iterator for iterating through a byte tag list
|
||||
*
|
||||
* An iterator for iterating through a byte tag list
|
||||
*
|
||||
*/
|
||||
class Iterator
|
||||
{
|
||||
public:
|
||||
/*
|
||||
* \brief An item specifies an individual tag within a byte buffer
|
||||
*
|
||||
* An item specifies an individual tag within a byte buffer
|
||||
*
|
||||
*/
|
||||
struct Item
|
||||
{
|
||||
TypeId tid;
|
||||
uint32_t size;
|
||||
int32_t start;
|
||||
int32_t end;
|
||||
TagBuffer buf;
|
||||
Item (TagBuffer buf);
|
||||
TypeId tid; /// type of the tag
|
||||
uint32_t size; /// size of tag data
|
||||
int32_t start; /// offset to the start of the tag from the virtual byte buffer
|
||||
int32_t end; /// offset to the end of the tag from the virtual byte buffer
|
||||
TagBuffer buf; /// the data for the tag as generated by Tag::Serialize
|
||||
Item (TagBuffer buf); /// constructs an item with the given TagBuffer
|
||||
private:
|
||||
friend class ByteTagList;
|
||||
friend class ByteTagList::Iterator;
|
||||
};
|
||||
|
||||
/*
|
||||
* \brief Used to determine if the iterator is at the end of the byteTagList
|
||||
*
|
||||
* \returns true if there are more Items in the list
|
||||
*/
|
||||
bool HasNext (void) const;
|
||||
|
||||
/*
|
||||
* \brief Returns the next Item from the ByteTagList
|
||||
*
|
||||
* \returns the next Item in the ByteTagList
|
||||
*/
|
||||
struct ByteTagList::Iterator::Item Next (void);
|
||||
|
||||
/*
|
||||
* \brief Returns the offset from the start of the virtual byte buffer to the ByteTagList
|
||||
*
|
||||
* \returns offset to the start of this ByteTagList
|
||||
*/
|
||||
uint32_t GetOffsetStart (void) const;
|
||||
private:
|
||||
friend class ByteTagList;
|
||||
@@ -102,7 +131,26 @@ private:
|
||||
};
|
||||
|
||||
ByteTagList ();
|
||||
|
||||
/**
|
||||
*
|
||||
* Copy constructor, copies the data and increases reference count
|
||||
*
|
||||
* \param The ByteTagList to copy
|
||||
* \returns The newly created ByteTagList
|
||||
*
|
||||
*/
|
||||
ByteTagList (const ByteTagList &o);
|
||||
|
||||
/**
|
||||
*
|
||||
* Assignment operator, deallocates current data and assigns
|
||||
* value of passed in ByteTagList. Also increases reference count
|
||||
*
|
||||
* \param o reference to the ByteTagList to copy
|
||||
* \returns reference to the assignee
|
||||
*
|
||||
*/
|
||||
ByteTagList &operator = (const ByteTagList &o);
|
||||
~ByteTagList ();
|
||||
|
||||
@@ -125,6 +173,10 @@ private:
|
||||
*/
|
||||
void Add (const ByteTagList &o);
|
||||
|
||||
/**
|
||||
*
|
||||
* Removes all of the tags from the ByteTagList
|
||||
*/
|
||||
void RemoveAll (void);
|
||||
|
||||
/**
|
||||
@@ -144,12 +196,20 @@ private:
|
||||
* Adjust the offsets stored internally by the adjustment delta and
|
||||
* make sure that all offsets are smaller than appendOffset which represents
|
||||
* the location where new bytes have been added to the byte buffer.
|
||||
*
|
||||
* \param adjustment value to change stored offsets by
|
||||
* \param appendOffset maximum offset value
|
||||
*
|
||||
*/
|
||||
void AddAtEnd (int32_t adjustment, int32_t appendOffset);
|
||||
/**
|
||||
* Adjust the offsets stored internally by the adjustment delta and
|
||||
* make sure that all offsets are bigger than prependOffset which represents
|
||||
* the location where new bytes have been added to the byte buffer.
|
||||
*
|
||||
* \param adjustment value to change stored offsets byte
|
||||
* \param prependOffset minimum offset value
|
||||
*
|
||||
*/
|
||||
void AddAtStart (int32_t adjustment, int32_t prependOffset);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ NS_LOG_COMPONENT_DEFINE ("NixVector");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
typedef std::vector<uint32_t> NixBits_t;
|
||||
typedef std::vector<uint32_t> NixBits_t; ///typedef for the nixVector
|
||||
|
||||
NixVector::NixVector ()
|
||||
: m_nixVector (0),
|
||||
@@ -77,6 +77,7 @@ NixVector::Copy (void) const
|
||||
return Ptr<NixVector> (new NixVector (*this), false);
|
||||
}
|
||||
|
||||
/* For printing the nix vector */
|
||||
std::ostream & operator << (std::ostream &os, const NixVector &nix)
|
||||
{
|
||||
nix.DumpNixVector (os);
|
||||
|
||||
@@ -75,6 +75,8 @@ public:
|
||||
*/
|
||||
NixVector (const NixVector &o);
|
||||
/**
|
||||
* \return a reference to the assignee
|
||||
*
|
||||
* \param o the NixVector to copy to a new NixVector using the
|
||||
* equals operator
|
||||
*/
|
||||
|
||||
@@ -30,10 +30,11 @@
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
/*
|
||||
* A class representing an ascii file.
|
||||
/**
|
||||
* \brief A class representing an ascii file.
|
||||
*
|
||||
* This class represents an ascii file
|
||||
*/
|
||||
|
||||
class AsciiFile
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -182,7 +182,7 @@ DoParse (const std::string s, uint64_t *v)
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
ATTRIBUTE_HELPER_CPP (DataRate);
|
||||
ATTRIBUTE_HELPER_CPP (DataRate); /// Macro to make help make data-rate an ns-3 attribute
|
||||
|
||||
DataRate::DataRate ()
|
||||
: m_bps (0)
|
||||
@@ -248,11 +248,13 @@ DataRate::DataRate (std::string rate)
|
||||
}
|
||||
}
|
||||
|
||||
/* For printing of data rate */
|
||||
std::ostream &operator << (std::ostream &os, const DataRate &rate)
|
||||
{
|
||||
os << rate.GetBitRate () << "bps";
|
||||
return os;
|
||||
}
|
||||
/* Initialize a data rate from an input stream */
|
||||
std::istream &operator >> (std::istream &is, DataRate &rate)
|
||||
{
|
||||
std::string value;
|
||||
@@ -267,13 +269,26 @@ std::istream &operator >> (std::istream &is, DataRate &rate)
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Multiply datarate by a time value
|
||||
*
|
||||
* Calculates the number of bits that have been transmitted over a period of time
|
||||
* \param lhs rate
|
||||
* \param rhs time
|
||||
* \return the number of bits over the period of time
|
||||
*/
|
||||
double operator* (const DataRate& lhs, const Time& rhs)
|
||||
{
|
||||
return rhs.GetSeconds ()*lhs.GetBitRate ();
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Multiply time value by a data rate
|
||||
*
|
||||
* Calculates the number of bits that have been transmitted over a period of time
|
||||
* \param lhs time
|
||||
* \param rhs rate
|
||||
* \return the number of bits over the period of time
|
||||
*/
|
||||
double operator* (const Time& lhs, const DataRate& rhs)
|
||||
{
|
||||
return lhs.GetSeconds ()*rhs.GetBitRate ();
|
||||
|
||||
@@ -81,13 +81,66 @@ public:
|
||||
* \param bps bit/s value
|
||||
*/
|
||||
DataRate (uint64_t bps);
|
||||
/**
|
||||
* \brief String constructor
|
||||
*
|
||||
* Construct a data rate from a string. Many different unit strings are supported
|
||||
* Supported unit strings:
|
||||
* bps, b/s, Bps, B/s \n
|
||||
* kbps, kb/s, Kbps, Kb/s, kBps, kB/s, KBps, KB/s, Kib/s, KiB/s \n
|
||||
* Mbps, Mb/s, MBps, MB/s, Mib/s, MiB/s \n
|
||||
* Gbps, Gb/s, GBps, GB/s, Gib/s, GiB/s \n
|
||||
*
|
||||
* Examples:
|
||||
* "56kbps" = 56,000 bits/s \n
|
||||
* "128 kb/s" = 128,000 bits/s \n
|
||||
* "8Kib/s" = 1 KiB/s = 8192 bits/s \n
|
||||
* "1kB/s" = 8000 bits/s
|
||||
*
|
||||
* \param rate string representing the desired rate
|
||||
*/
|
||||
DataRate (std::string rate);
|
||||
|
||||
/**
|
||||
* \return true if this rate is less than rhs
|
||||
*
|
||||
* \param rhs the datarate to compare to this datarate
|
||||
*/
|
||||
bool operator < (const DataRate& rhs) const;
|
||||
|
||||
/**
|
||||
* \return true if this rate is less than or equal to rhs
|
||||
*
|
||||
* \param rhs the datarate to compare to this datarate
|
||||
*/
|
||||
bool operator <= (const DataRate& rhs) const;
|
||||
|
||||
/**
|
||||
* \return true if this rate is greater than rhs
|
||||
*
|
||||
* \param rhs the datarate to compare to this datarate
|
||||
*/
|
||||
bool operator > (const DataRate& rhs) const;
|
||||
|
||||
/**
|
||||
* \return true if this rate is greather than or equal to rhs
|
||||
*
|
||||
* \param rhs the datarate to compare to this datarate
|
||||
*/
|
||||
bool operator >= (const DataRate& rhs) const;
|
||||
|
||||
/**
|
||||
* \return true if this rate is equal to rhs
|
||||
*
|
||||
* \param rhs the datarate to compare to this datarate
|
||||
*/
|
||||
bool operator == (const DataRate& rhs) const;
|
||||
|
||||
/**
|
||||
* \return true if this rate is not equal to rhs
|
||||
*
|
||||
* \param rhs the datarate to compare to this datarate
|
||||
*/
|
||||
bool operator != (const DataRate& rhs) const;
|
||||
|
||||
/**
|
||||
@@ -118,7 +171,8 @@ std::istream &operator >> (std::istream &is, DataRate &rate);
|
||||
* \brief hold objects of type ns3::DataRate
|
||||
*/
|
||||
|
||||
ATTRIBUTE_HELPER_HEADER (DataRate);
|
||||
|
||||
ATTRIBUTE_HELPER_HEADER (DataRate); /// Macro to make help make data-rate an ns-3 attribute
|
||||
|
||||
/**
|
||||
* \param lhs
|
||||
|
||||
@@ -277,19 +277,19 @@ public:
|
||||
*/
|
||||
double GetBurstRate (void) const;
|
||||
/**
|
||||
* \param burstRate the error rate to be used by the model
|
||||
* \param rate the error rate to be used by the model
|
||||
*/
|
||||
void SetBurstRate (double rate);
|
||||
|
||||
/**
|
||||
* \param ranVariable A random variable distribution to generate random variates
|
||||
* \param ranVar A random variable distribution to generate random variates
|
||||
*/
|
||||
void SetRandomVariable (Ptr<RandomVariableStream>);
|
||||
void SetRandomVariable (Ptr<RandomVariableStream> ranvar);
|
||||
|
||||
/**
|
||||
* \param burstSize A random variable distribution to generate random burst size
|
||||
* \param burstSz A random variable distribution to generate random burst size
|
||||
*/
|
||||
void SetRandomBurstSize (Ptr<RandomVariableStream>);
|
||||
void SetRandomBurstSize (Ptr<RandomVariableStream> burstSz);
|
||||
|
||||
/**
|
||||
* Assign a fixed random variable stream number to the random variables
|
||||
|
||||
@@ -34,9 +34,27 @@ public:
|
||||
virtual void Deserialize (TagBuffer buf);
|
||||
virtual void Print (std::ostream &os) const;
|
||||
FlowIdTag ();
|
||||
|
||||
/**
|
||||
* Constructs a FlowIdTag with the given flow id
|
||||
*
|
||||
* \param flowId Id to use for the tag
|
||||
*/
|
||||
FlowIdTag (uint32_t flowId);
|
||||
/**
|
||||
* Sets the flow id for the tag
|
||||
* \param flowId Id to assign to the tag
|
||||
*/
|
||||
void SetFlowId (uint32_t flowId);
|
||||
/**
|
||||
* Gets the flow id for the tag
|
||||
* \returns current flow id for this tag
|
||||
*/
|
||||
uint32_t GetFlowId (void) const;
|
||||
/**
|
||||
* Uses a static variable to generate sequential flow id
|
||||
* \returns flow id allocated
|
||||
*/
|
||||
static uint32_t AllocateFlowId (void);
|
||||
private:
|
||||
uint32_t m_flowId;
|
||||
|
||||
@@ -417,7 +417,7 @@ bool operator != (Ipv4Mask const &a, Ipv4Mask const &b)
|
||||
return !a.IsEqual (b);
|
||||
}
|
||||
|
||||
ATTRIBUTE_HELPER_CPP (Ipv4Address);
|
||||
ATTRIBUTE_HELPER_CPP (Ipv4Mask);
|
||||
ATTRIBUTE_HELPER_CPP (Ipv4Address); /// Macro to make help make class an ns-3 attribute
|
||||
ATTRIBUTE_HELPER_CPP (Ipv4Mask); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -286,8 +286,8 @@ private:
|
||||
* \brief hold objects of type ns3::Ipv4Mask
|
||||
*/
|
||||
|
||||
ATTRIBUTE_HELPER_HEADER (Ipv4Address);
|
||||
ATTRIBUTE_HELPER_HEADER (Ipv4Mask);
|
||||
ATTRIBUTE_HELPER_HEADER (Ipv4Address); /// Macro to make help make class an ns-3 attribute
|
||||
ATTRIBUTE_HELPER_HEADER (Ipv4Mask); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, Ipv4Address const& address);
|
||||
std::ostream& operator<< (std::ostream& os, Ipv4Mask const& mask);
|
||||
|
||||
@@ -929,8 +929,8 @@ size_t Ipv6AddressHash::operator () (Ipv6Address const &x) const
|
||||
return lookuphash (buf, sizeof (buf), 0);
|
||||
}
|
||||
|
||||
ATTRIBUTE_HELPER_CPP (Ipv6Address);
|
||||
ATTRIBUTE_HELPER_CPP (Ipv6Prefix);
|
||||
ATTRIBUTE_HELPER_CPP (Ipv6Address); /// Macro to make help make class an ns-3 attribute
|
||||
ATTRIBUTE_HELPER_CPP (Ipv6Prefix); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
} /* namespace ns3 */
|
||||
|
||||
|
||||
@@ -510,13 +510,13 @@ private:
|
||||
* \class ns3::Ipv6AddressValue
|
||||
* \brief Hold objects of type ns3::Ipv6Address
|
||||
*/
|
||||
ATTRIBUTE_HELPER_HEADER (Ipv6Address);
|
||||
ATTRIBUTE_HELPER_HEADER (Ipv6Address); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
/**
|
||||
* \class ns3::Ipv6PrefixValue
|
||||
* \brief Hold objects of type ns3::Ipv6Prefix
|
||||
*/
|
||||
ATTRIBUTE_HELPER_HEADER (Ipv6Prefix);
|
||||
ATTRIBUTE_HELPER_HEADER (Ipv6Prefix); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
/**
|
||||
* \brief Stream insertion operator.
|
||||
|
||||
@@ -30,7 +30,7 @@ NS_LOG_COMPONENT_DEFINE ("Mac16Address");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
ATTRIBUTE_HELPER_CPP (Mac16Address);
|
||||
ATTRIBUTE_HELPER_CPP (Mac16Address); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
#define ASCII_a (0x41)
|
||||
#define ASCII_z (0x5a)
|
||||
|
||||
@@ -80,6 +80,7 @@ public:
|
||||
static bool IsMatchingType (const Address &address);
|
||||
/**
|
||||
* Allocate a new Mac16Address.
|
||||
* \returns newly allocated mac16Address
|
||||
*/
|
||||
static Mac16Address Allocate (void);
|
||||
|
||||
@@ -104,7 +105,7 @@ private:
|
||||
* \brief hold objects of type ns3::Mac16Address
|
||||
*/
|
||||
|
||||
ATTRIBUTE_HELPER_HEADER (Mac16Address);
|
||||
ATTRIBUTE_HELPER_HEADER (Mac16Address); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
inline bool operator == (const Mac16Address &a, const Mac16Address &b)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ NS_LOG_COMPONENT_DEFINE ("Mac48Address");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
ATTRIBUTE_HELPER_CPP (Mac48Address);
|
||||
ATTRIBUTE_HELPER_CPP (Mac48Address); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
#define ASCII_a (0x41)
|
||||
#define ASCII_z (0x5a)
|
||||
|
||||
@@ -84,6 +84,7 @@ public:
|
||||
static bool IsMatchingType (const Address &address);
|
||||
/**
|
||||
* Allocate a new Mac48Address.
|
||||
* \returns newly allocated mac48Address
|
||||
*/
|
||||
static Mac48Address Allocate (void);
|
||||
|
||||
@@ -146,7 +147,7 @@ private:
|
||||
* \brief hold objects of type ns3::Mac48Address
|
||||
*/
|
||||
|
||||
ATTRIBUTE_HELPER_HEADER (Mac48Address);
|
||||
ATTRIBUTE_HELPER_HEADER (Mac48Address); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
inline bool operator == (const Mac48Address &a, const Mac48Address &b)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ NS_LOG_COMPONENT_DEFINE ("Mac64Address");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
ATTRIBUTE_HELPER_CPP (Mac64Address);
|
||||
ATTRIBUTE_HELPER_CPP (Mac64Address); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
#define ASCII_a (0x41)
|
||||
#define ASCII_z (0x5a)
|
||||
|
||||
@@ -83,6 +83,7 @@ public:
|
||||
static bool IsMatchingType (const Address &address);
|
||||
/**
|
||||
* Allocate a new Mac64Address.
|
||||
* \returns newly allocated mac64Address
|
||||
*/
|
||||
static Mac64Address Allocate (void);
|
||||
private:
|
||||
@@ -106,7 +107,7 @@ private:
|
||||
* \brief hold objects of type ns3::Mac64Address
|
||||
*/
|
||||
|
||||
ATTRIBUTE_HELPER_HEADER (Mac64Address);
|
||||
ATTRIBUTE_HELPER_HEADER (Mac64Address); /// Macro to make help make class an ns-3 attribute
|
||||
|
||||
inline bool operator == (const Mac64Address &a, const Mac64Address &b)
|
||||
{
|
||||
|
||||
@@ -31,13 +31,30 @@ namespace ns3 {
|
||||
/**
|
||||
* \ingroup stats
|
||||
*
|
||||
* A stat for counting packets
|
||||
*
|
||||
*/
|
||||
class PacketCounterCalculator : public CounterCalculator<uint32_t> {
|
||||
public:
|
||||
PacketCounterCalculator();
|
||||
virtual ~PacketCounterCalculator();
|
||||
|
||||
/**
|
||||
* Increments the packet counter by one
|
||||
*
|
||||
* \param path not used in this method
|
||||
* \param packet not used in this method
|
||||
*/
|
||||
void PacketUpdate (std::string path, Ptr<const Packet> packet);
|
||||
|
||||
/**
|
||||
* Increments the packet counter by one
|
||||
*
|
||||
* \param path not used in this method
|
||||
* \param packet not used in this method
|
||||
* \param realto not used in this method
|
||||
*/
|
||||
|
||||
void FrameUpdate (std::string path, Ptr<const Packet> packet,
|
||||
Mac48Address realto);
|
||||
|
||||
@@ -51,14 +68,30 @@ protected:
|
||||
/**
|
||||
* \ingroup stats
|
||||
*
|
||||
* A stat for collecting packet size statistics: min, max and average
|
||||
*
|
||||
*/
|
||||
class PacketSizeMinMaxAvgTotalCalculator :
|
||||
public MinMaxAvgTotalCalculator<uint32_t> {
|
||||
public:
|
||||
PacketSizeMinMaxAvgTotalCalculator();
|
||||
virtual ~PacketSizeMinMaxAvgTotalCalculator();
|
||||
|
||||
|
||||
/**
|
||||
* Increments the packet stats by the size of the packet
|
||||
*
|
||||
* \param path not used in this method
|
||||
* \param packet packet size used to update stats
|
||||
*/
|
||||
void PacketUpdate (std::string path, Ptr<const Packet> packet);
|
||||
|
||||
/**
|
||||
* Increments the packet stats by the size of the packet
|
||||
*
|
||||
* \param path not used in this method
|
||||
* \param packet packet size used to update stats
|
||||
* \param realto not used in this method
|
||||
*/
|
||||
void FrameUpdate (std::string path, Ptr<const Packet> packet,
|
||||
Mac48Address realto);
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ enum PbbAddressLength {
|
||||
class PbbTlvBlock
|
||||
{
|
||||
public:
|
||||
typedef std::list< Ptr<PbbTlv> >::iterator Iterator;
|
||||
typedef std::list< Ptr<PbbTlv> >::const_iterator ConstIterator;
|
||||
typedef std::list< Ptr<PbbTlv> >::iterator Iterator; /// this is an iterator
|
||||
typedef std::list< Ptr<PbbTlv> >::const_iterator ConstIterator; /// this is a const iterator
|
||||
|
||||
PbbTlvBlock (void);
|
||||
~PbbTlvBlock (void);
|
||||
@@ -192,7 +192,17 @@ public:
|
||||
*/
|
||||
void Print (std::ostream &os, int level) const;
|
||||
|
||||
/**
|
||||
* \brief Equality operator for PbbTlvBlock
|
||||
* \param other PbbTlvBlock to compare this one to
|
||||
* \returns true if the blocks are equal
|
||||
*/
|
||||
bool operator== (const PbbTlvBlock &other) const;
|
||||
/**
|
||||
* \brief Inequality operator for PbbTlvBlock
|
||||
* \param other PbbTlvBlock to compare this one to
|
||||
* \returns true if the blocks are not equal
|
||||
*/
|
||||
bool operator!= (const PbbTlvBlock &other) const;
|
||||
|
||||
private:
|
||||
@@ -207,8 +217,8 @@ private:
|
||||
class PbbAddressTlvBlock
|
||||
{
|
||||
public:
|
||||
typedef std::list< Ptr<PbbAddressTlv> >::iterator Iterator;
|
||||
typedef std::list< Ptr<PbbAddressTlv> >::const_iterator ConstIterator;
|
||||
typedef std::list< Ptr<PbbAddressTlv> >::iterator Iterator; /// This is a PbbAddressTlv iterator for PbbAddressTlvBlock
|
||||
typedef std::list< Ptr<PbbAddressTlv> >::const_iterator ConstIterator; /// This is a const PbbAddressTlv iterator for PbbAddressTlvBlock
|
||||
|
||||
PbbAddressTlvBlock (void);
|
||||
~PbbAddressTlvBlock (void);
|
||||
@@ -346,7 +356,18 @@ public:
|
||||
*/
|
||||
void Print (std::ostream &os, int level) const;
|
||||
|
||||
/**
|
||||
* \brief Equality operator for PbbAddressTlvBlock
|
||||
* \param other PbbAddressTlvBlock to compare to this one
|
||||
* \returns true if PbbAddressTlvBlock are equal
|
||||
*/
|
||||
bool operator== (const PbbAddressTlvBlock &other) const;
|
||||
|
||||
/**
|
||||
* \brief Inequality operator for PbbAddressTlvBlock
|
||||
* \param other PbbAddressTlvBlock to compare to this one
|
||||
* \returns true if PbbAddressTlvBlock are not equal
|
||||
*/
|
||||
bool operator!= (const PbbAddressTlvBlock &other) const;
|
||||
|
||||
private:
|
||||
@@ -364,10 +385,10 @@ private:
|
||||
class PbbPacket : public SimpleRefCount<PbbPacket,Header>
|
||||
{
|
||||
public:
|
||||
typedef std::list< Ptr<PbbTlv> >::iterator TlvIterator;
|
||||
typedef std::list< Ptr<PbbTlv> >::const_iterator ConstTlvIterator;
|
||||
typedef std::list< Ptr<PbbMessage> >::iterator MessageIterator;
|
||||
typedef std::list< Ptr<PbbMessage> >::const_iterator ConstMessageIterator;
|
||||
typedef std::list< Ptr<PbbTlv> >::iterator TlvIterator; /// This is a PbbTlv iterator for PbbPacket
|
||||
typedef std::list< Ptr<PbbTlv> >::const_iterator ConstTlvIterator; /// This is a const PbbTlv iterator for PbbPacket
|
||||
typedef std::list< Ptr<PbbMessage> >::iterator MessageIterator; /// This is a PbbMessageIterator for PbbPacket
|
||||
typedef std::list< Ptr<PbbMessage> >::const_iterator ConstMessageIterator; /// This is a const PbbMessageIterator for PbbPacket
|
||||
|
||||
PbbPacket (void);
|
||||
~PbbPacket (void);
|
||||
@@ -627,7 +648,18 @@ public:
|
||||
*/
|
||||
virtual void Print (std::ostream &os) const;
|
||||
|
||||
/**
|
||||
* \brief Equality operator for PbbPacket
|
||||
* \param other PbbPacket to compare to this one
|
||||
* \returns true if PbbPacket are equal
|
||||
*/
|
||||
bool operator== (const PbbPacket &other) const;
|
||||
|
||||
/**
|
||||
* \brief Inequality operator for PbbPacket
|
||||
* \param other PbbPacket to compare to this one
|
||||
* \returns true if PbbPacket are not equal
|
||||
*/
|
||||
bool operator!= (const PbbPacket &other) const;
|
||||
|
||||
protected:
|
||||
@@ -652,10 +684,10 @@ private:
|
||||
class PbbMessage : public SimpleRefCount<PbbMessage>
|
||||
{
|
||||
public:
|
||||
typedef std::list< Ptr<PbbTlv> >::iterator TlvIterator;
|
||||
typedef std::list< Ptr<PbbTlv> >::const_iterator ConstTlvIterator;
|
||||
typedef std::list< Ptr<PbbAddressBlock> >::iterator AddressBlockIterator;
|
||||
typedef std::list< Ptr<PbbAddressBlock> >::const_iterator ConstAddressBlockIterator;
|
||||
typedef std::list< Ptr<PbbTlv> >::iterator TlvIterator; /// This is a PbbTlv iterator for PbbMessage
|
||||
typedef std::list< Ptr<PbbTlv> >::const_iterator ConstTlvIterator; /// This is a const PbbTlv iterator for PbbMessage
|
||||
typedef std::list< Ptr<PbbAddressBlock> >::iterator AddressBlockIterator; /// This is a PbbAddressBlock iterator for PbbMessage
|
||||
typedef std::list< Ptr<PbbAddressBlock> >::const_iterator ConstAddressBlockIterator; /// This is a const PbbAddressBlock iterator for PbbMessage
|
||||
|
||||
PbbMessage ();
|
||||
virtual ~PbbMessage ();
|
||||
@@ -1004,13 +1036,27 @@ public:
|
||||
*/
|
||||
void Print (std::ostream &os, int level) const;
|
||||
|
||||
/**
|
||||
* \brief Equality operator for PbbMessage
|
||||
* \param other PbbMessage to compare to this one
|
||||
* \returns true if PbbMessages are equal
|
||||
*/
|
||||
bool operator== (const PbbMessage &other) const;
|
||||
/**
|
||||
* \brief Inequality operator for PbbMessage
|
||||
* \param other PbbMessage to compare to this one
|
||||
* \returns true if PbbMessages are not equal
|
||||
*/
|
||||
bool operator!= (const PbbMessage &other) const;
|
||||
|
||||
protected:
|
||||
/* PbbMessage size in bytes - 1.
|
||||
protected:
|
||||
/**
|
||||
* \brief Returns address length (IPV4 3 or IPV6 15)
|
||||
*
|
||||
* IPv4 = 4 - 1 = 3, IPv6 = 16 - 1 = 15
|
||||
* Returns message size in bytes - 1
|
||||
* IPv4 = 4 - 1 = 3, IPv6 = 16 - 1 = 15
|
||||
*
|
||||
* \returns Address length (IPV4 3 or IPV6 15)
|
||||
*/
|
||||
virtual PbbAddressLength GetAddressLength (void) const = 0;
|
||||
|
||||
@@ -1051,6 +1097,14 @@ public:
|
||||
virtual ~PbbMessageIpv4 ();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* \brief Returns address length (IPV4 3 or IPV6 15)
|
||||
*
|
||||
* Returns message size in bytes - 1
|
||||
* IPv4 = 4 - 1 = 3, IPv6 = 16 - 1 = 15
|
||||
*
|
||||
* \returns Address length (IPV4 3 or IPV6 15)
|
||||
*/
|
||||
virtual PbbAddressLength GetAddressLength (void) const;
|
||||
|
||||
virtual void SerializeOriginatorAddress (Buffer::Iterator &start) const;
|
||||
@@ -1071,6 +1125,14 @@ public:
|
||||
virtual ~PbbMessageIpv6 ();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* \brief Returns address length (IPV4 3 or IPV6 15)
|
||||
*
|
||||
* Returns message size in bytes - 1
|
||||
* IPv4 = 4 - 1 = 3, IPv6 = 16 - 1 = 15
|
||||
*
|
||||
* \returns Address length (IPV4 3 or IPV6 15)
|
||||
*/
|
||||
virtual PbbAddressLength GetAddressLength (void) const;
|
||||
|
||||
virtual void SerializeOriginatorAddress (Buffer::Iterator &start) const;
|
||||
@@ -1089,14 +1151,14 @@ protected:
|
||||
class PbbAddressBlock : public SimpleRefCount<PbbAddressBlock>
|
||||
{
|
||||
public:
|
||||
typedef std::list< Address >::iterator AddressIterator;
|
||||
typedef std::list< Address >::const_iterator ConstAddressIterator;
|
||||
typedef std::list< Address >::iterator AddressIterator; /// this is an address iterator for PbbAddressBlock
|
||||
typedef std::list< Address >::const_iterator ConstAddressIterator; /// this is an const address iterator for PbbAddressBlock
|
||||
|
||||
typedef std::list<uint8_t>::iterator PrefixIterator;
|
||||
typedef std::list<uint8_t>::const_iterator ConstPrefixIterator;
|
||||
typedef std::list<uint8_t>::iterator PrefixIterator; /// this is a prefix iterator for PbbAddressBlock
|
||||
typedef std::list<uint8_t>::const_iterator ConstPrefixIterator; /// this is a const prefix iterator for PbbAddressBlock
|
||||
|
||||
typedef PbbAddressTlvBlock::Iterator TlvIterator;
|
||||
typedef PbbAddressTlvBlock::ConstIterator ConstTlvIterator;
|
||||
typedef PbbAddressTlvBlock::Iterator TlvIterator; /// this is a tlvblock iterator for PbbAddressBlock
|
||||
typedef PbbAddressTlvBlock::ConstIterator ConstTlvIterator; /// this is a const tlvblock iterator for PbbAddressBlock
|
||||
|
||||
PbbAddressBlock ();
|
||||
virtual ~PbbAddressBlock ();
|
||||
@@ -1440,12 +1502,26 @@ public:
|
||||
*/
|
||||
void Print (std::ostream &os, int level) const;
|
||||
|
||||
/**
|
||||
* \brief Equality operator for PbbAddressBlock
|
||||
* \param other PbbAddressBlock to compare to this one
|
||||
* \returns true if PbbMessages are equal
|
||||
*/
|
||||
bool operator== (const PbbAddressBlock &other) const;
|
||||
|
||||
/**
|
||||
* \brief Inequality operator for PbbAddressBlock
|
||||
* \param other PbbAddressBlock to compare to this one
|
||||
* \returns true if PbbAddressBlock are not equal
|
||||
*/
|
||||
bool operator!= (const PbbAddressBlock &other) const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* \brief Returns address length
|
||||
* \returns Address length
|
||||
*/
|
||||
virtual uint8_t GetAddressLength (void) const = 0;
|
||||
|
||||
virtual void SerializeAddress (uint8_t *buffer, ConstAddressIterator iter) const = 0;
|
||||
virtual Address DeserializeAddress (uint8_t *buffer) const = 0;
|
||||
virtual void PrintAddress (std::ostream &os, ConstAddressIterator iter) const = 0;
|
||||
@@ -1473,8 +1549,11 @@ public:
|
||||
virtual ~PbbAddressBlockIpv4 ();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* \brief Returns address length
|
||||
* \returns Address length
|
||||
*/
|
||||
virtual uint8_t GetAddressLength (void) const;
|
||||
|
||||
virtual void SerializeAddress (uint8_t *buffer, ConstAddressIterator iter) const;
|
||||
virtual Address DeserializeAddress (uint8_t *buffer) const;
|
||||
virtual void PrintAddress (std::ostream &os, ConstAddressIterator iter) const;
|
||||
@@ -1492,8 +1571,11 @@ public:
|
||||
virtual ~PbbAddressBlockIpv6 ();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* \brief Returns address length
|
||||
* \returns Address length
|
||||
*/
|
||||
virtual uint8_t GetAddressLength (void) const;
|
||||
|
||||
virtual void SerializeAddress (uint8_t *buffer, ConstAddressIterator iter) const;
|
||||
virtual Address DeserializeAddress (uint8_t *buffer) const;
|
||||
virtual void PrintAddress (std::ostream &os, ConstAddressIterator iter) const;
|
||||
@@ -1620,7 +1702,18 @@ public:
|
||||
*/
|
||||
void Print (std::ostream &os, int level) const;
|
||||
|
||||
/**
|
||||
* \brief Equality operator for PbbTlv
|
||||
* \param other PbbTlv to compare to this one
|
||||
* \returns true if PbbTlv are equal
|
||||
*/
|
||||
bool operator== (const PbbTlv &other) const;
|
||||
|
||||
/**
|
||||
* \brief Inequality operator for PbbTlv
|
||||
* \param other PbbTlv to compare to this one
|
||||
* \returns true if PbbTlv are not equal
|
||||
*/
|
||||
bool operator!= (const PbbTlv &other) const;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -31,12 +31,14 @@ namespace ns3 {
|
||||
class Packet;
|
||||
class Header;
|
||||
|
||||
/*
|
||||
|
||||
/**
|
||||
* \brief A class representing a pcap file
|
||||
*
|
||||
* A class representing a pcap file. This allows easy creation, writing and
|
||||
* reading of files composed of stored packets; which may be viewed using
|
||||
* standard tools.
|
||||
*/
|
||||
|
||||
class PcapFile
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -156,7 +156,11 @@ private:
|
||||
virtual Ptr<const Packet> DoPeek (void) const = 0;
|
||||
|
||||
protected:
|
||||
// called by subclasses to notify parent of packet drops.
|
||||
/**
|
||||
* \brief Drop a packet
|
||||
* \param packet packet that was dropped
|
||||
* This method is called by subclasses to notify parent (this class) of packet drops.
|
||||
*/
|
||||
void Drop (Ptr<Packet> packet);
|
||||
|
||||
private:
|
||||
|
||||
@@ -83,46 +83,43 @@ class RedQueue : public Queue
|
||||
{
|
||||
public:
|
||||
static TypeId GetTypeId (void);
|
||||
/*
|
||||
/**
|
||||
* \brief RedQueue Constructor
|
||||
*
|
||||
* Create a RED queue
|
||||
*/
|
||||
RedQueue ();
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Destructor
|
||||
*
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~RedQueue ();
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Stats
|
||||
*
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
// Early probability drops
|
||||
uint32_t unforcedDrop;
|
||||
// Forced drops, qavg > max threshold
|
||||
uint32_t forcedDrop;
|
||||
// Drops due to queue limits
|
||||
uint32_t qLimDrop;
|
||||
{
|
||||
uint32_t unforcedDrop; /// Early probability drops
|
||||
uint32_t forcedDrop; /// Forced drops, qavg > max threshold
|
||||
uint32_t qLimDrop; /// Drops due to queue limits
|
||||
} Stats;
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Drop types
|
||||
*
|
||||
*/
|
||||
enum
|
||||
{
|
||||
DTYPE_NONE, // Ok, no drop
|
||||
DTYPE_FORCED, // A "forced" drop
|
||||
DTYPE_UNFORCED, // An "unforced" (random) drop
|
||||
DTYPE_NONE, /// Ok, no drop
|
||||
DTYPE_FORCED, /// A "forced" drop
|
||||
DTYPE_UNFORCED, /// An "unforced" (random) drop
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Set the operating mode of this queue.
|
||||
* Set operating mode
|
||||
*
|
||||
@@ -130,7 +127,7 @@ public:
|
||||
*/
|
||||
void SetMode (RedQueue::QueueMode mode);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Get the encapsulation mode of this queue.
|
||||
* Get the encapsulation mode of this queue
|
||||
*
|
||||
@@ -138,21 +135,21 @@ public:
|
||||
*/
|
||||
RedQueue::QueueMode GetMode (void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Get the current value of the queue in bytes or packets.
|
||||
*
|
||||
* \returns The queue size in bytes or packets.
|
||||
*/
|
||||
uint32_t GetQueueSize (void);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Set the limit of the queue.
|
||||
*
|
||||
* \param lim The limit in bytes or packets.
|
||||
*/
|
||||
void SetQueueLimit (uint32_t lim);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Set the thresh limits of RED.
|
||||
*
|
||||
* \param min Minimum thresh in bytes or packets.
|
||||
@@ -160,7 +157,7 @@ public:
|
||||
*/
|
||||
void SetTh (double minTh, double maxTh);
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Get the RED statistics after running.
|
||||
*
|
||||
* \returns The drop statistics.
|
||||
|
||||
@@ -64,19 +64,30 @@ public:
|
||||
: m_value (value)
|
||||
{}
|
||||
|
||||
// copy contructor
|
||||
/**
|
||||
* \brief Constructs a SequenceNumber from a copy
|
||||
* \param value sequence number to copy
|
||||
*/
|
||||
SequenceNumber (SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> const &value)
|
||||
: m_value (value.m_value)
|
||||
{}
|
||||
|
||||
// assignment from a plain number
|
||||
/**
|
||||
* \brief Constructs a SequenceNumber from an assignment of given value
|
||||
* \param value sequence number to copy
|
||||
* \returns reference to the assignee
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE>& operator= (NUMERIC_TYPE value)
|
||||
{
|
||||
m_value = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// assignment from a sequence number
|
||||
/**
|
||||
* \brief Constructs a SequenceNumber from an assignment of another sequence number
|
||||
* \param value sequence number to copy
|
||||
* \returns reference to the assignee
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE>& operator= (SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> const &value)
|
||||
{
|
||||
m_value = value.m_value;
|
||||
@@ -100,14 +111,20 @@ public:
|
||||
return m_value;
|
||||
}
|
||||
|
||||
// prefix ++
|
||||
/**
|
||||
* \brief Prefix increment operator
|
||||
* \returns incremented sequence number
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> operator++ ()
|
||||
{
|
||||
m_value++;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// postfix ++
|
||||
/**
|
||||
* \brief Postfix increment operator
|
||||
* \returns incremented sequence number
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> operator++ (int)
|
||||
{
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> retval (m_value);
|
||||
@@ -115,14 +132,20 @@ public:
|
||||
return retval;
|
||||
}
|
||||
|
||||
// prefix --
|
||||
/**
|
||||
* \brief Prefix decrement operator
|
||||
* \returns decremented sequence number
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> operator-- ()
|
||||
{
|
||||
m_value--;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// postfix --
|
||||
/**
|
||||
* \brief Postfix decrement operator
|
||||
* \returns incremented sequence number
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> operator-- (int)
|
||||
{
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> retval (m_value);
|
||||
@@ -130,33 +153,63 @@ public:
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Plus equals operator
|
||||
* \param value value to add to sequence number
|
||||
* \returns incremented sequence number
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE>& operator+= (SIGNED_TYPE value)
|
||||
{
|
||||
m_value += value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Minus equals operator
|
||||
* \param value value to subtract from sequence number
|
||||
* \returns decremented sequence number
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE>& operator-= (SIGNED_TYPE value)
|
||||
{
|
||||
m_value -= value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Operator defining addition of two sequence numbers
|
||||
* \param other sequence number added to this
|
||||
* \returns sequence number representing sum
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> operator + (const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &other) const
|
||||
{
|
||||
return SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> (m_value + other.m_value);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Addition operator for adding numeric value to sequence number
|
||||
* \param delta value to add to sequence number
|
||||
* \returns sequence number representing sum
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> operator + (SIGNED_TYPE delta) const
|
||||
{
|
||||
return SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> (m_value + delta);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Subtraction operator for subtracting numeric value from sequence number
|
||||
* \param delta value to subtract from sequence number
|
||||
* \returns sequence number representing difference
|
||||
*/
|
||||
SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> operator - (SIGNED_TYPE delta) const
|
||||
{
|
||||
return SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> (m_value - delta);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Subtraction operator for subtracting sequence number from sequence number
|
||||
* \param other sequence number to subtract from this sequence number
|
||||
* \returns numeric value representing the difference
|
||||
*/
|
||||
SIGNED_TYPE operator - (const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &other) const
|
||||
{
|
||||
static const NUMERIC_TYPE maxValue = std::numeric_limits<NUMERIC_TYPE>::max ();
|
||||
@@ -199,16 +252,18 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Here is the critical part, how the comparison is made taking into
|
||||
// account wrap-around. From RFC 3626:
|
||||
//
|
||||
// The sequence number S1 is said to be "greater than" the sequence
|
||||
// number S2 if:
|
||||
//
|
||||
// S1 > S2 AND S1 - S2 <= MAXVALUE/2 OR
|
||||
//
|
||||
// S2 > S1 AND S2 - S1 > MAXVALUE/2
|
||||
/**
|
||||
* Here is the critical part, how the comparison is made taking into
|
||||
* account wrap-around. From RFC 3626:
|
||||
*
|
||||
* The sequence number S1 is said to be "greater than" the sequence
|
||||
* number S2 if:
|
||||
* S1 > S2 AND S1 - S2 <= MAXVALUE/2 OR
|
||||
* S2 > S1 AND S2 - S1 > MAXVALUE/2
|
||||
*
|
||||
* \param other sequence number to compare to this one
|
||||
* \returns true if this sequence number is greater than other
|
||||
*/
|
||||
bool operator > (const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &other) const
|
||||
{
|
||||
static const NUMERIC_TYPE halfMaxValue = std::numeric_limits<NUMERIC_TYPE>::max () / 2;
|
||||
@@ -217,35 +272,71 @@ public:
|
||||
|| ((other.m_value > m_value) && (other.m_value - m_value) > halfMaxValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Equality operator for comparing sequence number
|
||||
* \param other sequence number to compare to this sequence number
|
||||
* \returns true if the sequence numbers are equal
|
||||
*/
|
||||
bool operator == (const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &other) const
|
||||
{
|
||||
return (m_value == other.m_value);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Inequality operator for comparing sequence numbers
|
||||
* \param other sequence number to compare to this sequence number
|
||||
* \returns true if the sequence numbers are not equal
|
||||
*/
|
||||
bool operator != (const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &other) const
|
||||
{
|
||||
return (m_value != other.m_value);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Less than or equal operator for comparing sequence numbers
|
||||
* \param other sequence number to compare to this sequence number
|
||||
* \returns true if this sequence number is less than or equal to other
|
||||
*/
|
||||
bool operator <= (const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &other) const
|
||||
{
|
||||
return (!this->operator> (other));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Greater than or equal operator for comparing sequence numbers
|
||||
* \param other sequence number to compare to this sequence number
|
||||
* \returns true if this sequence number is greater than or equal to other
|
||||
*/
|
||||
bool operator >= (const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &other) const
|
||||
{
|
||||
return (this->operator> (other) || this->operator== (other));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Less than operator for comparing sequence numbers
|
||||
* \param other sequence number to compare to this sequence number
|
||||
* \returns true if this sequence number is less than other
|
||||
*/
|
||||
bool operator < (const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &other) const
|
||||
{
|
||||
return !this->operator> (other) && m_value != other.m_value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief For printing sequence number
|
||||
* \param os output stream
|
||||
* \param val sequence number to display
|
||||
* \returns output stream os
|
||||
*/
|
||||
template<typename NUMERIC_TYPE2, typename SIGNED_TYPE2>
|
||||
friend std::ostream & operator<< (std::ostream& os, const SequenceNumber<NUMERIC_TYPE2, SIGNED_TYPE2> &val);
|
||||
|
||||
/**
|
||||
* \brief For loading sequence number from input streams
|
||||
* \param is input stream
|
||||
* \param val sequence number to load
|
||||
* \returns input stream is
|
||||
*/
|
||||
template<typename NUMERIC_TYPE2, typename SIGNED_TYPE2>
|
||||
friend std::istream & operator >> (std::istream &is, const SequenceNumber<NUMERIC_TYPE2, SIGNED_TYPE2> &val);
|
||||
|
||||
@@ -271,7 +362,6 @@ private:
|
||||
NUMERIC_TYPE m_value;
|
||||
};
|
||||
|
||||
|
||||
template<typename NUMERIC_TYPE, typename SIGNED_TYPE>
|
||||
std::ostream &
|
||||
operator<< (std::ostream& os, const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &val)
|
||||
|
||||
@@ -39,9 +39,26 @@ public:
|
||||
static TypeId GetTypeId (void);
|
||||
SimpleChannel ();
|
||||
|
||||
/**
|
||||
* A packet is sent by a net device. A receive event will be
|
||||
* scheduled for all net device connected to the channel other
|
||||
* than the net device who sent the packet
|
||||
*
|
||||
* \param p packet to be sent
|
||||
* \param protocol protocol number
|
||||
* \param to address to send packet to
|
||||
* \param from address the packet is coming from
|
||||
* \param sender netdevice who sent the packet
|
||||
*
|
||||
*/
|
||||
void Send (Ptr<Packet> p, uint16_t protocol, Mac48Address to, Mac48Address from,
|
||||
Ptr<SimpleNetDevice> sender);
|
||||
|
||||
/**
|
||||
* Attached a net device to the channel.
|
||||
*
|
||||
* \param device the device to attach to the channel
|
||||
*/
|
||||
void Add (Ptr<SimpleNetDevice> device);
|
||||
|
||||
// inherited from ns3::Channel
|
||||
|
||||
@@ -48,7 +48,26 @@ public:
|
||||
static TypeId GetTypeId (void);
|
||||
SimpleNetDevice ();
|
||||
|
||||
/**
|
||||
* Receive a packet from a connected SimpleChannel. The
|
||||
* SimpleNetDevice receives packets from its connected channel
|
||||
* and then forwards them by calling its rx callback method
|
||||
*
|
||||
* \param packet Packet received on the channel
|
||||
* \param protocol protocol number
|
||||
* \param to address packet should be sent to
|
||||
* \param from address packet was sent from
|
||||
*/
|
||||
void Receive (Ptr<Packet> packet, uint16_t protocol, Mac48Address to, Mac48Address from);
|
||||
|
||||
/**
|
||||
*
|
||||
* Attach a channel to this net device. This will be the
|
||||
* channel the net device sends on
|
||||
*
|
||||
* \param channel channel to assign to this net device
|
||||
*
|
||||
*/
|
||||
void SetChannel (Ptr<SimpleChannel> channel);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user