A Discrete-Event Network Simulator
API
aodv-packet.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 IITP RAS
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Based on
18  * NS-2 AODV model developed by the CMU/MONARCH group and optimized and
19  * tuned by Samir Das and Mahesh Marina, University of Cincinnati;
20  *
21  * AODV-UU implementation by Erik Nordström of Uppsala University
22  * https://web.archive.org/web/20100527072022/http://core.it.uu.se/core/index.php/AODV-UU
23  *
24  * Authors: Elena Buchatskaia <borovkovaes@iitp.ru>
25  * Pavel Boyko <boyko@iitp.ru>
26  */
27 #include "aodv-packet.h"
28 
29 #include "ns3/address-utils.h"
30 #include "ns3/packet.h"
31 
32 namespace ns3
33 {
34 namespace aodv
35 {
36 
37 NS_OBJECT_ENSURE_REGISTERED(TypeHeader);
38 
40  : m_type(t),
41  m_valid(true)
42 {
43 }
44 
45 TypeId
47 {
48  static TypeId tid = TypeId("ns3::aodv::TypeHeader")
49  .SetParent<Header>()
50  .SetGroupName("Aodv")
51  .AddConstructor<TypeHeader>();
52  return tid;
53 }
54 
55 TypeId
57 {
58  return GetTypeId();
59 }
60 
61 uint32_t
63 {
64  return 1;
65 }
66 
67 void
69 {
70  i.WriteU8((uint8_t)m_type);
71 }
72 
73 uint32_t
75 {
77  uint8_t type = i.ReadU8();
78  m_valid = true;
79  switch (type)
80  {
81  case AODVTYPE_RREQ:
82  case AODVTYPE_RREP:
83  case AODVTYPE_RERR:
84  case AODVTYPE_RREP_ACK: {
86  break;
87  }
88  default:
89  m_valid = false;
90  }
91  uint32_t dist = i.GetDistanceFrom(start);
92  NS_ASSERT(dist == GetSerializedSize());
93  return dist;
94 }
95 
96 void
97 TypeHeader::Print(std::ostream& os) const
98 {
99  switch (m_type)
100  {
101  case AODVTYPE_RREQ: {
102  os << "RREQ";
103  break;
104  }
105  case AODVTYPE_RREP: {
106  os << "RREP";
107  break;
108  }
109  case AODVTYPE_RERR: {
110  os << "RERR";
111  break;
112  }
113  case AODVTYPE_RREP_ACK: {
114  os << "RREP_ACK";
115  break;
116  }
117  default:
118  os << "UNKNOWN_TYPE";
119  }
120 }
121 
122 bool
124 {
125  return (m_type == o.m_type && m_valid == o.m_valid);
126 }
127 
128 std::ostream&
129 operator<<(std::ostream& os, const TypeHeader& h)
130 {
131  h.Print(os);
132  return os;
133 }
134 
135 //-----------------------------------------------------------------------------
136 // RREQ
137 //-----------------------------------------------------------------------------
139  uint8_t reserved,
140  uint8_t hopCount,
141  uint32_t requestID,
142  Ipv4Address dst,
143  uint32_t dstSeqNo,
144  Ipv4Address origin,
145  uint32_t originSeqNo)
146  : m_flags(flags),
147  m_reserved(reserved),
148  m_hopCount(hopCount),
149  m_requestID(requestID),
150  m_dst(dst),
151  m_dstSeqNo(dstSeqNo),
152  m_origin(origin),
153  m_originSeqNo(originSeqNo)
154 {
155 }
156 
158 
159 TypeId
161 {
162  static TypeId tid = TypeId("ns3::aodv::RreqHeader")
163  .SetParent<Header>()
164  .SetGroupName("Aodv")
165  .AddConstructor<RreqHeader>();
166  return tid;
167 }
168 
169 TypeId
171 {
172  return GetTypeId();
173 }
174 
175 uint32_t
177 {
178  return 23;
179 }
180 
181 void
183 {
184  i.WriteU8(m_flags);
185  i.WriteU8(m_reserved);
186  i.WriteU8(m_hopCount);
188  WriteTo(i, m_dst);
190  WriteTo(i, m_origin);
192 }
193 
194 uint32_t
196 {
198  m_flags = i.ReadU8();
199  m_reserved = i.ReadU8();
200  m_hopCount = i.ReadU8();
201  m_requestID = i.ReadNtohU32();
202  ReadFrom(i, m_dst);
203  m_dstSeqNo = i.ReadNtohU32();
204  ReadFrom(i, m_origin);
206 
207  uint32_t dist = i.GetDistanceFrom(start);
208  NS_ASSERT(dist == GetSerializedSize());
209  return dist;
210 }
211 
212 void
213 RreqHeader::Print(std::ostream& os) const
214 {
215  os << "RREQ ID " << m_requestID << " destination: ipv4 " << m_dst << " sequence number "
216  << m_dstSeqNo << " source: ipv4 " << m_origin << " sequence number " << m_originSeqNo
217  << " flags:"
218  << " Gratuitous RREP " << (*this).GetGratuitousRrep() << " Destination only "
219  << (*this).GetDestinationOnly() << " Unknown sequence number " << (*this).GetUnknownSeqno();
220 }
221 
222 std::ostream&
223 operator<<(std::ostream& os, const RreqHeader& h)
224 {
225  h.Print(os);
226  return os;
227 }
228 
229 void
231 {
232  if (f)
233  {
234  m_flags |= (1 << 5);
235  }
236  else
237  {
238  m_flags &= ~(1 << 5);
239  }
240 }
241 
242 bool
244 {
245  return (m_flags & (1 << 5));
246 }
247 
248 void
250 {
251  if (f)
252  {
253  m_flags |= (1 << 4);
254  }
255  else
256  {
257  m_flags &= ~(1 << 4);
258  }
259 }
260 
261 bool
263 {
264  return (m_flags & (1 << 4));
265 }
266 
267 void
269 {
270  if (f)
271  {
272  m_flags |= (1 << 3);
273  }
274  else
275  {
276  m_flags &= ~(1 << 3);
277  }
278 }
279 
280 bool
282 {
283  return (m_flags & (1 << 3));
284 }
285 
286 bool
288 {
289  return (m_flags == o.m_flags && m_reserved == o.m_reserved && m_hopCount == o.m_hopCount &&
290  m_requestID == o.m_requestID && m_dst == o.m_dst && m_dstSeqNo == o.m_dstSeqNo &&
292 }
293 
294 //-----------------------------------------------------------------------------
295 // RREP
296 //-----------------------------------------------------------------------------
297 
298 RrepHeader::RrepHeader(uint8_t prefixSize,
299  uint8_t hopCount,
300  Ipv4Address dst,
301  uint32_t dstSeqNo,
302  Ipv4Address origin,
303  Time lifeTime)
304  : m_flags(0),
305  m_prefixSize(prefixSize),
306  m_hopCount(hopCount),
307  m_dst(dst),
308  m_dstSeqNo(dstSeqNo),
309  m_origin(origin)
310 {
311  m_lifeTime = uint32_t(lifeTime.GetMilliSeconds());
312 }
313 
315 
316 TypeId
318 {
319  static TypeId tid = TypeId("ns3::aodv::RrepHeader")
320  .SetParent<Header>()
321  .SetGroupName("Aodv")
322  .AddConstructor<RrepHeader>();
323  return tid;
324 }
325 
326 TypeId
328 {
329  return GetTypeId();
330 }
331 
332 uint32_t
334 {
335  return 19;
336 }
337 
338 void
340 {
341  i.WriteU8(m_flags);
343  i.WriteU8(m_hopCount);
344  WriteTo(i, m_dst);
346  WriteTo(i, m_origin);
348 }
349 
350 uint32_t
352 {
354 
355  m_flags = i.ReadU8();
356  m_prefixSize = i.ReadU8();
357  m_hopCount = i.ReadU8();
358  ReadFrom(i, m_dst);
359  m_dstSeqNo = i.ReadNtohU32();
360  ReadFrom(i, m_origin);
361  m_lifeTime = i.ReadNtohU32();
362 
363  uint32_t dist = i.GetDistanceFrom(start);
364  NS_ASSERT(dist == GetSerializedSize());
365  return dist;
366 }
367 
368 void
369 RrepHeader::Print(std::ostream& os) const
370 {
371  os << "destination: ipv4 " << m_dst << " sequence number " << m_dstSeqNo;
372  if (m_prefixSize != 0)
373  {
374  os << " prefix size " << m_prefixSize;
375  }
376  os << " source ipv4 " << m_origin << " lifetime " << m_lifeTime
377  << " acknowledgment required flag " << (*this).GetAckRequired();
378 }
379 
380 void
382 {
384 }
385 
386 Time
388 {
390  return t;
391 }
392 
393 void
395 {
396  if (f)
397  {
398  m_flags |= (1 << 6);
399  }
400  else
401  {
402  m_flags &= ~(1 << 6);
403  }
404 }
405 
406 bool
408 {
409  return (m_flags & (1 << 6));
410 }
411 
412 void
414 {
415  m_prefixSize = sz;
416 }
417 
418 uint8_t
420 {
421  return m_prefixSize;
422 }
423 
424 bool
426 {
427  return (m_flags == o.m_flags && m_prefixSize == o.m_prefixSize && m_hopCount == o.m_hopCount &&
428  m_dst == o.m_dst && m_dstSeqNo == o.m_dstSeqNo && m_origin == o.m_origin &&
429  m_lifeTime == o.m_lifeTime);
430 }
431 
432 void
433 RrepHeader::SetHello(Ipv4Address origin, uint32_t srcSeqNo, Time lifetime)
434 {
435  m_flags = 0;
436  m_prefixSize = 0;
437  m_hopCount = 0;
438  m_dst = origin;
439  m_dstSeqNo = srcSeqNo;
440  m_origin = origin;
441  m_lifeTime = lifetime.GetMilliSeconds();
442 }
443 
444 std::ostream&
445 operator<<(std::ostream& os, const RrepHeader& h)
446 {
447  h.Print(os);
448  return os;
449 }
450 
451 //-----------------------------------------------------------------------------
452 // RREP-ACK
453 //-----------------------------------------------------------------------------
454 
456  : m_reserved(0)
457 {
458 }
459 
461 
462 TypeId
464 {
465  static TypeId tid = TypeId("ns3::aodv::RrepAckHeader")
466  .SetParent<Header>()
467  .SetGroupName("Aodv")
468  .AddConstructor<RrepAckHeader>();
469  return tid;
470 }
471 
472 TypeId
474 {
475  return GetTypeId();
476 }
477 
478 uint32_t
480 {
481  return 1;
482 }
483 
484 void
486 {
487  i.WriteU8(m_reserved);
488 }
489 
490 uint32_t
492 {
494  m_reserved = i.ReadU8();
495  uint32_t dist = i.GetDistanceFrom(start);
496  NS_ASSERT(dist == GetSerializedSize());
497  return dist;
498 }
499 
500 void
501 RrepAckHeader::Print(std::ostream& os) const
502 {
503 }
504 
505 bool
507 {
508  return m_reserved == o.m_reserved;
509 }
510 
511 std::ostream&
512 operator<<(std::ostream& os, const RrepAckHeader& h)
513 {
514  h.Print(os);
515  return os;
516 }
517 
518 //-----------------------------------------------------------------------------
519 // RERR
520 //-----------------------------------------------------------------------------
522  : m_flag(0),
523  m_reserved(0)
524 {
525 }
526 
528 
529 TypeId
531 {
532  static TypeId tid = TypeId("ns3::aodv::RerrHeader")
533  .SetParent<Header>()
534  .SetGroupName("Aodv")
535  .AddConstructor<RerrHeader>();
536  return tid;
537 }
538 
539 TypeId
541 {
542  return GetTypeId();
543 }
544 
545 uint32_t
547 {
548  return (3 + 8 * GetDestCount());
549 }
550 
551 void
553 {
554  i.WriteU8(m_flag);
555  i.WriteU8(m_reserved);
556  i.WriteU8(GetDestCount());
557  for (auto j = m_unreachableDstSeqNo.begin(); j != m_unreachableDstSeqNo.end(); ++j)
558  {
559  WriteTo(i, (*j).first);
560  i.WriteHtonU32((*j).second);
561  }
562 }
563 
564 uint32_t
566 {
568  m_flag = i.ReadU8();
569  m_reserved = i.ReadU8();
570  uint8_t dest = i.ReadU8();
571  m_unreachableDstSeqNo.clear();
573  uint32_t seqNo;
574  for (uint8_t k = 0; k < dest; ++k)
575  {
576  ReadFrom(i, address);
577  seqNo = i.ReadNtohU32();
578  m_unreachableDstSeqNo.insert(std::make_pair(address, seqNo));
579  }
580 
581  uint32_t dist = i.GetDistanceFrom(start);
582  NS_ASSERT(dist == GetSerializedSize());
583  return dist;
584 }
585 
586 void
587 RerrHeader::Print(std::ostream& os) const
588 {
589  os << "Unreachable destination (ipv4 address, seq. number):";
590  for (auto j = m_unreachableDstSeqNo.begin(); j != m_unreachableDstSeqNo.end(); ++j)
591  {
592  os << (*j).first << ", " << (*j).second;
593  }
594  os << "No delete flag " << (*this).GetNoDelete();
595 }
596 
597 void
599 {
600  if (f)
601  {
602  m_flag |= (1 << 0);
603  }
604  else
605  {
606  m_flag &= ~(1 << 0);
607  }
608 }
609 
610 bool
612 {
613  return (m_flag & (1 << 0));
614 }
615 
616 bool
618 {
619  if (m_unreachableDstSeqNo.find(dst) != m_unreachableDstSeqNo.end())
620  {
621  return true;
622  }
623 
624  NS_ASSERT(GetDestCount() < 255); // can't support more than 255 destinations in single RERR
625  m_unreachableDstSeqNo.insert(std::make_pair(dst, seqNo));
626  return true;
627 }
628 
629 bool
630 RerrHeader::RemoveUnDestination(std::pair<Ipv4Address, uint32_t>& un)
631 {
632  if (m_unreachableDstSeqNo.empty())
633  {
634  return false;
635  }
636  auto i = m_unreachableDstSeqNo.begin();
637  un = *i;
638  m_unreachableDstSeqNo.erase(i);
639  return true;
640 }
641 
642 void
644 {
645  m_unreachableDstSeqNo.clear();
646  m_flag = 0;
647  m_reserved = 0;
648 }
649 
650 bool
652 {
653  if (m_flag != o.m_flag || m_reserved != o.m_reserved || GetDestCount() != o.GetDestCount())
654  {
655  return false;
656  }
657 
658  auto j = m_unreachableDstSeqNo.begin();
659  auto k = o.m_unreachableDstSeqNo.begin();
660  for (uint8_t i = 0; i < GetDestCount(); ++i)
661  {
662  if ((j->first != k->first) || (j->second != k->second))
663  {
664  return false;
665  }
666 
667  j++;
668  k++;
669  }
670  return true;
671 }
672 
673 std::ostream&
674 operator<<(std::ostream& os, const RerrHeader& h)
675 {
676  h.Print(os);
677  return os;
678 }
679 } // namespace aodv
680 } // namespace ns3
double f(double x, void *params)
Definition: 80211b.c:70
iterator in a Buffer instance
Definition: buffer.h:100
uint8_t ReadU8()
Definition: buffer.h:1027
void WriteU8(uint8_t data)
Definition: buffer.h:881
uint32_t ReadNtohU32()
Definition: buffer.h:978
void WriteHtonU32(uint32_t data)
Definition: buffer.h:933
uint32_t GetDistanceFrom(const Iterator &o) const
Definition: buffer.cc:780
Protocol header serialization and deserialization.
Definition: header.h:44
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:42
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
int64_t GetMilliSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:408
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:931
Route Error (RERR) Message Format.
Definition: aodv-packet.h:592
uint8_t GetDestCount() const
Definition: aodv-packet.h:640
void Clear()
Clear header.
Definition: aodv-packet.cc:643
static TypeId GetTypeId()
Get the type ID.
Definition: aodv-packet.cc:530
uint8_t m_reserved
Not used (must be 0)
Definition: aodv-packet.h:654
bool GetNoDelete() const
Get the no delete flag.
Definition: aodv-packet.cc:611
uint32_t GetSerializedSize() const override
Definition: aodv-packet.cc:546
RerrHeader()
constructor
Definition: aodv-packet.cc:521
uint8_t m_flag
No delete flag.
Definition: aodv-packet.h:653
bool operator==(const RerrHeader &o) const
Comparison operator.
Definition: aodv-packet.cc:651
void Serialize(Buffer::Iterator i) const override
Definition: aodv-packet.cc:552
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: aodv-packet.cc:540
void SetNoDelete(bool f)
Set the no delete flag.
Definition: aodv-packet.cc:598
bool AddUnDestination(Ipv4Address dst, uint32_t seqNo)
Add unreachable node address and its sequence number in RERR header.
Definition: aodv-packet.cc:617
std::map< Ipv4Address, uint32_t > m_unreachableDstSeqNo
List of Unreachable destination: IP addresses and sequence numbers.
Definition: aodv-packet.h:657
void Print(std::ostream &os) const override
Definition: aodv-packet.cc:587
bool RemoveUnDestination(std::pair< Ipv4Address, uint32_t > &un)
Delete pair (address + sequence number) from REER header, if the number of unreachable destinations >...
Definition: aodv-packet.cc:630
Route Reply Acknowledgment (RREP-ACK) Message Format.
Definition: aodv-packet.h:538
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: aodv-packet.cc:473
void Serialize(Buffer::Iterator start) const override
Definition: aodv-packet.cc:485
void Print(std::ostream &os) const override
Definition: aodv-packet.cc:501
static TypeId GetTypeId()
Get the type ID.
Definition: aodv-packet.cc:463
bool operator==(const RrepAckHeader &o) const
Comparison operator.
Definition: aodv-packet.cc:506
uint32_t GetSerializedSize() const override
Definition: aodv-packet.cc:479
RrepAckHeader()
constructor
Definition: aodv-packet.cc:455
uint8_t m_reserved
Not used (must be 0)
Definition: aodv-packet.h:562
Route Reply (RREP) Message Format.
Definition: aodv-packet.h:358
bool GetAckRequired() const
get the ack required flag
Definition: aodv-packet.cc:407
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: aodv-packet.cc:327
uint8_t GetPrefixSize() const
Set the prefix size.
Definition: aodv-packet.cc:419
void Print(std::ostream &os) const override
Definition: aodv-packet.cc:369
void Serialize(Buffer::Iterator start) const override
Definition: aodv-packet.cc:339
void SetHello(Ipv4Address src, uint32_t srcSeqNo, Time lifetime)
Configure RREP to be a Hello message.
Definition: aodv-packet.cc:433
static TypeId GetTypeId()
Get the type ID.
Definition: aodv-packet.cc:317
uint32_t GetSerializedSize() const override
Definition: aodv-packet.cc:333
uint32_t m_dstSeqNo
Destination Sequence Number.
Definition: aodv-packet.h:514
void SetLifeTime(Time t)
Set the lifetime.
Definition: aodv-packet.cc:381
void SetAckRequired(bool f)
Set the ack required flag.
Definition: aodv-packet.cc:394
void SetPrefixSize(uint8_t sz)
Set the prefix size.
Definition: aodv-packet.cc:413
RrepHeader(uint8_t prefixSize=0, uint8_t hopCount=0, Ipv4Address dst=Ipv4Address(), uint32_t dstSeqNo=0, Ipv4Address origin=Ipv4Address(), Time lifetime=MilliSeconds(0))
constructor
Definition: aodv-packet.cc:298
Time GetLifeTime() const
Get the lifetime.
Definition: aodv-packet.cc:387
Ipv4Address m_dst
Destination IP Address.
Definition: aodv-packet.h:513
uint8_t m_flags
A - acknowledgment required flag.
Definition: aodv-packet.h:510
uint8_t m_hopCount
Hop Count.
Definition: aodv-packet.h:512
uint8_t m_prefixSize
Prefix Size.
Definition: aodv-packet.h:511
bool operator==(const RrepHeader &o) const
Comparison operator.
Definition: aodv-packet.cc:425
Ipv4Address m_origin
Source IP Address.
Definition: aodv-packet.h:515
uint32_t m_lifeTime
Lifetime (in milliseconds)
Definition: aodv-packet.h:516
Route Request (RREQ) Message Format.
Definition: aodv-packet.h:138
bool GetUnknownSeqno() const
Get the unknown sequence number flag.
Definition: aodv-packet.cc:281
uint32_t m_originSeqNo
Source Sequence Number.
Definition: aodv-packet.h:328
RreqHeader(uint8_t flags=0, uint8_t reserved=0, uint8_t hopCount=0, uint32_t requestID=0, Ipv4Address dst=Ipv4Address(), uint32_t dstSeqNo=0, Ipv4Address origin=Ipv4Address(), uint32_t originSeqNo=0)
constructor
Definition: aodv-packet.cc:138
uint8_t m_hopCount
Hop Count.
Definition: aodv-packet.h:323
void SetUnknownSeqno(bool f)
Set the unknown sequence number flag.
Definition: aodv-packet.cc:268
void SetGratuitousRrep(bool f)
Set the gratuitous RREP flag.
Definition: aodv-packet.cc:230
void SetDestinationOnly(bool f)
Set the Destination only flag.
Definition: aodv-packet.cc:249
Ipv4Address m_origin
Originator IP Address.
Definition: aodv-packet.h:327
bool GetDestinationOnly() const
Get the Destination only flag.
Definition: aodv-packet.cc:262
uint32_t GetSerializedSize() const override
Definition: aodv-packet.cc:176
Ipv4Address m_dst
Destination IP Address.
Definition: aodv-packet.h:325
static TypeId GetTypeId()
Get the type ID.
Definition: aodv-packet.cc:160
uint32_t m_requestID
RREQ ID.
Definition: aodv-packet.h:324
void Print(std::ostream &os) const override
Definition: aodv-packet.cc:213
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: aodv-packet.cc:170
void Serialize(Buffer::Iterator start) const override
Definition: aodv-packet.cc:182
uint8_t m_reserved
Not used (must be 0)
Definition: aodv-packet.h:322
bool GetGratuitousRrep() const
Get the gratuitous RREP flag.
Definition: aodv-packet.cc:243
uint32_t m_dstSeqNo
Destination Sequence Number.
Definition: aodv-packet.h:326
bool operator==(const RreqHeader &o) const
Comparison operator.
Definition: aodv-packet.cc:287
uint8_t m_flags
|J|R|G|D|U| bit flags, see RFC
Definition: aodv-packet.h:321
TypeHeader(MessageType t=AODVTYPE_RREQ)
constructor
Definition: aodv-packet.cc:39
bool operator==(const TypeHeader &o) const
Comparison operator.
Definition: aodv-packet.cc:123
void Print(std::ostream &os) const override
Definition: aodv-packet.cc:97
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: aodv-packet.cc:56
void Serialize(Buffer::Iterator start) const override
Definition: aodv-packet.cc:68
MessageType m_type
type of the message
Definition: aodv-packet.h:104
bool m_valid
Indicates if the message is valid.
Definition: aodv-packet.h:105
uint32_t GetSerializedSize() const override
Definition: aodv-packet.cc:62
static TypeId GetTypeId()
Get the type ID.
Definition: aodv-packet.cc:46
MessageType
MessageType enumeration.
Definition: aodv-packet.h:48
@ AODVTYPE_RREP
AODVTYPE_RREP.
Definition: aodv-packet.h:50
@ AODVTYPE_RREP_ACK
AODVTYPE_RREP_ACK.
Definition: aodv-packet.h:52
@ AODVTYPE_RERR
AODVTYPE_RERR.
Definition: aodv-packet.h:51
@ AODVTYPE_RREQ
AODVTYPE_RREQ.
Definition: aodv-packet.h:49
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1338
address
Definition: first.py:47
std::ostream & operator<<(std::ostream &os, const TypeHeader &h)
Stream output operator.
Definition: aodv-packet.cc:129
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.