cosmetics

This commit is contained in:
Borovkova Elena
2009-07-07 12:42:15 +04:00
parent e02d95fa41
commit 42a15f1229
2 changed files with 202 additions and 186 deletions

View File

@@ -71,7 +71,7 @@ RreqHeader::Deserialize (Buffer::Iterator start)
Buffer::Iterator i = start;
uint8_t t = i.ReadU8 ();
NS_ASSERT (t == type());
rq_flags = i.ReadU8 ();
reserved = i.ReadU8 ();
rq_hop_count = i.ReadU8 ();
@@ -80,7 +80,7 @@ RreqHeader::Deserialize (Buffer::Iterator start)
rq_dst_seqno = i.ReadNtohU32 ();
ReadFrom (i, rq_src);
rq_src_seqno = i.ReadNtohU32 ();
uint32_t dist = i.GetDistanceFrom (start);
NS_ASSERT (dist == GetSerializedSize ());
return dist;
@@ -89,7 +89,16 @@ RreqHeader::Deserialize (Buffer::Iterator start)
void
RreqHeader::Print (std::ostream &os) const
{
// TODO
os << "RREO ID " << rq_bcast_id << "\n"
<< "destination: ipv4 " << rq_dst << " "
<< "sequence number " << rq_dst_seqno << "\n"
<< "source: ipv4 " << rq_src << " "
<< "sequence number " << rq_src_seqno << "\n"
<< "flags:\n"
<< "Gratuitous RREP " << (*this).GetGratiousRrep() << "\n"
<< "Destination only " << (*this).GetDestinationOnly() << "\n"
<< "Unknown sequence number " << (*this).GetUnknownSeqno() << "\n";
}
std::ostream & operator<<(std::ostream & os, RreqHeader const & h)
@@ -173,7 +182,6 @@ bool RreqHeaderTest::RunTests ()
NS_TEST_ASSERT(h.GetDestinationOnly ());
h.SetUnknownSeqno (true);
NS_TEST_ASSERT(h.GetUnknownSeqno ());
Ptr<Packet> p = Create<Packet> ();
p->AddHeader (h);
RreqHeader h2;
@@ -190,27 +198,27 @@ bool RreqHeaderTest::RunTests ()
RrepHeader::RrepHeader() :rp_flags(0), prefixSize(0), rp_hop_count(0), rp_dst_seqno(0)
{
SetAckRequired(false);
SetAckRequired(false);
}
TypeId
RrepHeader::GetInstanceTypeId() const
{
return TypeId();
return TypeId();
}
uint32_t
RrepHeader::GetSerializedSize () const
{
return 20;
return 20;
}
void
RrepHeader::Serialize (Buffer::Iterator i) const
{
i.WriteU8(type());
i.WriteU8(rp_flags);
i.WriteU8(prefixSize);
i.WriteU8(type());
i.WriteU8(rp_flags);
i.WriteU8(prefixSize);
i.WriteU8 (rp_hop_count);
WriteTo (i, rp_dst);
i.WriteHtonU32 (rp_dst_seqno);
@@ -241,62 +249,70 @@ RrepHeader::Deserialize (Buffer::Iterator start)
void
RrepHeader::Print (std::ostream &os) const
{
// TODO
os << "RREP\n"
<< "destination: ipv4 " << rp_dst
<< "sequence number " << rp_dst_seqno;
if(prefixSize != 0)
os << "prefix size " << prefixSize << "\n";
else os << "\n";
os << "source ipv4 " << rp_src
<< "life time " << rp_lifetime << "\n"
<< "acknowledgment required flag " << (*this).GetAckRequired() << "\n";
}
void
RrepHeader::SetAckRequired (bool f)
{
if (f) rp_flags |= (1 << 1);
else rp_flags &= ~(1 << 1);
if (f) rp_flags |= (1 << 1);
else rp_flags &= ~(1 << 1);
}
bool
RrepHeader::GetAckRequired () const
{
return (rp_flags & (1 << 1));
return (rp_flags & (1 << 1));
}
void
RrepHeader::SetPrefixSize(uint8_t sz)
{
prefixSize = sz;
prefixSize = sz;
}
uint8_t
RrepHeader::GetPrefixSize() const
{
return prefixSize;
return prefixSize;
}
bool
RrepHeader::operator==(RrepHeader const & o) const
{
return (rp_flags == o.rp_flags && prefixSize == o.prefixSize &&
rp_hop_count == o.rp_hop_count && rp_dst == o.rp_dst &&
rp_dst_seqno == o.rp_dst_seqno && rp_src == o.rp_src &&
rp_lifetime == o.rp_lifetime);
return (rp_flags == o.rp_flags && prefixSize == o.prefixSize &&
rp_hop_count == o.rp_hop_count && rp_dst == o.rp_dst &&
rp_dst_seqno == o.rp_dst_seqno && rp_src == o.rp_src &&
rp_lifetime == o.rp_lifetime);
}
void
RrepHeader::SetHello(Ipv4Address src, uint32_t srcSeqNo)
{
rp_flags = 0;
prefixSize = 0;
rp_hop_count = 0;
rp_dst = src;
rp_dst_seqno = srcSeqNo;
rp_src = src;
rp_lifetime = HELLO_INTERVAL * ALLOWED_HELLO_LOSS;
rp_flags = 0;
prefixSize = 0;
rp_hop_count = 0;
rp_dst = src;
rp_dst_seqno = srcSeqNo;
rp_src = src;
rp_lifetime = HELLO_INTERVAL * ALLOWED_HELLO_LOSS;
}
bool
RrepHeader::IsHello(Ipv4Address src, uint32_t srcSeqNo)
{
return (rp_flags == 0 && prefixSize == 0 && rp_hop_count == 0 &&
rp_dst == src && rp_dst_seqno == srcSeqNo && rp_src == src &&
rp_lifetime == (HELLO_INTERVAL * ALLOWED_HELLO_LOSS));
return (rp_flags == 0 && prefixSize == 0 && rp_hop_count == 0 &&
rp_dst == src && rp_dst_seqno == srcSeqNo && rp_src == src &&
rp_lifetime == (HELLO_INTERVAL * ALLOWED_HELLO_LOSS));
}
std::ostream & operator<<(std::ostream & os, RrepHeader const & h)
@@ -357,20 +373,20 @@ RrepAckHeader::RrepAckHeader () : reserved(0)
TypeId
RrepAckHeader::GetInstanceTypeId() const
{
return TypeId();
return TypeId();
}
uint32_t
RrepAckHeader::GetSerializedSize () const
{
return 2;
return 2;
}
void
RrepAckHeader::Serialize (Buffer::Iterator i) const
{
i.WriteU8(type());
i.WriteU8(reserved);
i.WriteU8(type());
i.WriteU8(reserved);
}
uint32_t
@@ -388,27 +404,27 @@ RrepAckHeader::Deserialize (Buffer::Iterator start)
void
RrepAckHeader::Print (std::ostream &os) const
{
// TODO
// TODO
}
bool
RrepAckHeader::operator==(RrepAckHeader const & o) const
{
return reserved == o.reserved;
return reserved == o.reserved;
}
std::ostream & operator<<(std::ostream & os, RrepAckHeader const & h)
{
h.Print(os);
return os;
h.Print(os);
return os;
}
#ifdef RUN_SELF_TESTS
/// Unit test for RREP-ACK
struct RrepAckHeaderTest : public Test
{
RrepAckHeaderTest () : Test ("AODV/RREP-ACK") {}
RrepAckHeaderTest () : Test ("AODV/RREP-ACK") {}
virtual bool RunTests();
};
@@ -435,34 +451,34 @@ bool RrepAckHeaderTest::RunTests ()
//-----------------------------------------------------------------------------
RerrHeader::RerrHeader() : er_flag(0), reserved(0)
{
destCount = unreachable_dst.size();
destCount = unreachable_dst.size();
}
TypeId
RerrHeader::GetInstanceTypeId() const
{
return TypeId();
return TypeId();
}
uint32_t
RerrHeader::GetSerializedSize () const
{
return ( 4 + 8*destCount);
return ( 4 + 8*destCount);
}
void
RerrHeader::Serialize (Buffer::Iterator i) const
{
i.WriteU8(type());
i.WriteU8(er_flag);
i.WriteU8(reserved);
i.WriteU8(destCount);
std::map<Ipv4Address, uint32_t>::const_iterator j;
for(j = unreachable_dst.begin(); j != unreachable_dst.end(); ++j)
{
WriteTo (i, (*j).first);
i.WriteHtonU32 ((*j).second);
}
i.WriteU8(type());
i.WriteU8(er_flag);
i.WriteU8(reserved);
i.WriteU8(destCount);
std::map<Ipv4Address, uint32_t>::const_iterator j;
for(j = unreachable_dst.begin(); j != unreachable_dst.end(); ++j)
{
WriteTo (i, (*j).first);
i.WriteHtonU32 ((*j).second);
}
}
uint32_t
@@ -478,12 +494,12 @@ RerrHeader::Deserialize (Buffer::Iterator start)
unreachable_dst.clear();
Ipv4Address address;
uint32_t seqNo;
for(uint8_t k = 0; k < destCount; ++k)
{
ReadFrom (i, address);
seqNo = i.ReadNtohU32 ();
unreachable_dst[address] = seqNo;
}
for(uint8_t k = 0; k < destCount; ++k)
{
ReadFrom (i, address);
seqNo = i.ReadNtohU32 ();
unreachable_dst[address] = seqNo;
}
uint32_t dist = i.GetDistanceFrom (start);
NS_ASSERT (dist == GetSerializedSize ());
@@ -493,56 +509,56 @@ RerrHeader::Deserialize (Buffer::Iterator start)
void
RerrHeader::Print (std::ostream &os) const
{
// TODO
// TODO
}
void
RerrHeader::SetNoDelete(bool f)
{
if (f) er_flag |= (1 << 0);
else er_flag &= ~(1 << 0);
if (f) er_flag |= (1 << 0);
else er_flag &= ~(1 << 0);
}
bool
RerrHeader::GetNoDelete()
{
return (er_flag & (1 << 0));
return (er_flag & (1 << 0));
}
bool
RerrHeader::AddUnDestination(Ipv4Address dst, uint32_t seqNo)
{
if(unreachable_dst.find(dst) != unreachable_dst.end())
return false;
unreachable_dst[dst] = seqNo;
destCount = unreachable_dst.size();
return true;
if(unreachable_dst.find(dst) != unreachable_dst.end())
return false;
unreachable_dst[dst] = seqNo;
destCount = unreachable_dst.size();
return true;
}
bool
RerrHeader::operator==(RerrHeader const & o) const
{
bool result = ( er_flag == o.er_flag && reserved == o.reserved &&
destCount == o.destCount );
if(!result)
return false;
std::map<Ipv4Address, uint32_t>::const_iterator j = unreachable_dst.begin();
std::map<Ipv4Address, uint32_t>::const_iterator k = o.unreachable_dst.begin();
for(uint8_t i = 0; i < destCount; ++i)
{
result = result && ( (*j).first == (*k).first ) && ( (*j).second == (*k).second );
if(!result)
return false;
j++;
k++;
}
return result;
bool result = ( er_flag == o.er_flag && reserved == o.reserved &&
destCount == o.destCount );
if(!result)
return false;
std::map<Ipv4Address, uint32_t>::const_iterator j = unreachable_dst.begin();
std::map<Ipv4Address, uint32_t>::const_iterator k = o.unreachable_dst.begin();
for(uint8_t i = 0; i < destCount; ++i)
{
result = result && ( (*j).first == (*k).first ) && ( (*j).second == (*k).second );
if(!result)
return false;
j++;
k++;
}
return result;
}
std::ostream & operator<<(std::ostream & os, RerrHeader const & h)
{
h.Print(os);
return os;
h.Print(os);
return os;
}
#ifdef RUN_SELF_TESTS

View File

@@ -37,40 +37,40 @@ namespace aodv {
enum MessageType
{
AODVTYPE_RREQ = 0x02,
AODVTYPE_RREP = 0x04,
AODVTYPE_RERR = 0x08,
AODVTYPE_RREP_ACK = 0x10
AODVTYPE_RREP = 0x04,
AODVTYPE_RERR = 0x08,
AODVTYPE_RREP_ACK = 0x10
};
#define HELLO_INTERVAL 1 // 1000 ms
#define ALLOWED_HELLO_LOSS 3 // packets
/**
* \ingroup aodv
* \brief Route Request (RREQ) Message Format
\verbatim
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type |J|R|G|D|U| Reserved | Hop Count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RREQ ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination IP Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originator IP Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originator Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\endverbatim
*/
* \ingroup aodv
* \brief Route Request (RREQ) Message Format
\verbatim
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type |J|R|G|D|U| Reserved | Hop Count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RREQ ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination IP Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originator IP Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originator Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\endverbatim
*/
class RreqHeader : public Header
{
public:
RreqHeader ();
///\name Header serialization/deserialization
//\{
TypeId GetInstanceTypeId() const;
@@ -79,7 +79,7 @@ public:
uint32_t Deserialize (Buffer::Iterator start);
void Print (std::ostream &os) const;
//\}
///\name Fields
//\{
void SetHopCount (uint8_t count) { rq_hop_count = count; }
@@ -95,7 +95,7 @@ public:
void SetSrcSeqno (uint32_t s) { rq_src_seqno = s; }
uint32_t GetSrcSeqno () const { return rq_src_seqno; }
//\}
///\name Flags
//\{
void SetGratiousRrep (bool f);
@@ -105,54 +105,54 @@ public:
void SetUnknownSeqno (bool f);
bool GetUnknownSeqno () const;
//\}
bool operator==(RreqHeader const & o) const;
private:
static MessageType type() { return AODVTYPE_RREQ; }
uint8_t rq_flags; ///< |J|R|G|D|U| bit flags, see RFC
uint8_t reserved; ///< Not used
uint8_t rq_hop_count; ///< Hop Count
uint32_t rq_bcast_id; ///< RREQ ID
Ipv4Address rq_dst; ///< Destination IP Address
uint32_t rq_dst_seqno; ///< Destination Sequence Number
Ipv4Address rq_src; ///< Source IP Address
uint32_t rq_src_seqno; ///< Source Sequence Number
static MessageType type() { return AODVTYPE_RREQ; }
uint8_t rq_flags; ///< |J|R|G|D|U| bit flags, see RFC
uint8_t reserved; ///< Not used
uint8_t rq_hop_count; ///< Hop Count
uint32_t rq_bcast_id; ///< RREQ ID
Ipv4Address rq_dst; ///< Destination IP Address
uint32_t rq_dst_seqno; ///< Destination Sequence Number
Ipv4Address rq_src; ///< Source IP Address
uint32_t rq_src_seqno; ///< Source Sequence Number
};
std::ostream & operator<<(std::ostream & os, RreqHeader const &);
/**
* \ingroup aodv
* \brief Route Reply (RREP) Message Format
* \ingroup aodv
* \brief Route Reply (RREP) Message Format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type |R|A| Reserved |Prefix Sz| Hop Count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination IP address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originator IP address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*/
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type |R|A| Reserved |Prefix Sz| Hop Count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination IP address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originator IP address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*/
class RrepHeader : public Header
{
public:
RrepHeader();
///\name Header serialization/deserialization
//\{
TypeId GetInstanceTypeId() const;
uint32_t GetSerializedSize () const;
void Serialize (Buffer::Iterator start) const;
uint32_t Deserialize (Buffer::Iterator start);
void Print (std::ostream &os) const;
//\}
RrepHeader();
///\name Header serialization/deserialization
//\{
TypeId GetInstanceTypeId() const;
uint32_t GetSerializedSize () const;
void Serialize (Buffer::Iterator start) const;
uint32_t Deserialize (Buffer::Iterator start);
void Print (std::ostream &os) const;
//\}
///\name Fields
//\{
@@ -197,18 +197,18 @@ private:
std::ostream & operator<<(std::ostream & os, RrepHeader const &);
/**
* \ingroup aodv
* \brief Route Reply Acknowledgment (RREP-ACK) Message Format
* 0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
* \ingroup aodv
* \brief Route Reply Acknowledgment (RREP-ACK) Message Format
* 0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
class RrepAckHeader : public Header
{
public:
RrepAckHeader ();
RrepAckHeader ();
///\name Header serialization/deserialization
//\{
@@ -221,35 +221,35 @@ public:
bool operator==(RrepAckHeader const & o) const;
private:
static MessageType type() { return AODVTYPE_RREP_ACK; }
uint8_t reserved;
static MessageType type() { return AODVTYPE_RREP_ACK; }
uint8_t reserved;
};
std::ostream & operator<<(std::ostream & os, RrepAckHeader const &);
/**
* \ingroup aodv
* \brief Route Error (RERR) Message Format
* \ingroup aodv
* \brief Route Error (RERR) Message Format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type |N| Reserved | DestCount |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Unreachable Destination IP Address (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Unreachable Destination Sequence Number (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
| Additional Unreachable Destination IP Addresses (if needed) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Additional Unreachable Destination Sequence Numbers (if needed)|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*/
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type |N| Reserved | DestCount |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Unreachable Destination IP Address (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Unreachable Destination Sequence Number (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
| Additional Unreachable Destination IP Addresses (if needed) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Additional Unreachable Destination Sequence Numbers (if needed)|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*/
class RerrHeader : public Header
{
public:
RerrHeader ();
RerrHeader ();
///\name Header serialization/deserialization
//\{
@@ -262,20 +262,20 @@ public:
///\name No delete flag
//\{
void SetNoDelete(bool f);
bool GetNoDelete();
void SetNoDelete(bool f);
bool GetNoDelete();
//\}
bool AddUnDestination(Ipv4Address dst, uint32_t seqNo);
uint8_t GetDestCount() const { return destCount; }
bool AddUnDestination(Ipv4Address dst, uint32_t seqNo);
uint8_t GetDestCount() const { return destCount; }
bool operator==(RerrHeader const & o) const;
private:
static MessageType type() { return AODVTYPE_RERR; }
uint8_t er_flag; ///< No delete flag
uint8_t reserved; ///< Not used
uint8_t destCount; ///< DestCount
/// List of Unreachable destination IP addresses and sequence numbers
std::map<Ipv4Address, uint32_t> unreachable_dst;
static MessageType type() { return AODVTYPE_RERR; }
uint8_t er_flag; ///< No delete flag
uint8_t reserved; ///< Not used
uint8_t destCount; ///< DestCount
/// List of Unreachable destination IP addresses and sequence numbers
std::map<Ipv4Address, uint32_t> unreachable_dst;
};
std::ostream & operator<<(std::ostream & os, RerrHeader const &);