A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
dsdv-packet.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010 Hemanth Narra
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
* Author: Hemanth Narra <hemanth@ittc.ku.com>
18
*
19
* James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
20
* ResiliNets Research Group https://resilinets.org/
21
* Information and Telecommunication Technology Center (ITTC)
22
* and Department of Electrical Engineering and Computer Science
23
* The University of Kansas Lawrence, KS USA.
24
*
25
* Work supported in part by NSF FIND (Future Internet Design) Program
26
* under grant CNS-0626918 (Postmodern Internet Architecture),
27
* NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
28
* US Department of Defense (DoD), and ITTC at The University of Kansas.
29
*/
30
31
#ifndef DSDV_PACKET_H
32
#define DSDV_PACKET_H
33
34
#include "ns3/header.h"
35
#include "ns3/ipv4-address.h"
36
#include "ns3/nstime.h"
37
38
#include <iostream>
39
40
namespace
ns3
41
{
42
namespace
dsdv
43
{
60
class
DsdvHeader
:
public
Header
61
{
62
public
:
70
DsdvHeader
(
Ipv4Address
dst =
Ipv4Address
(), uint32_t hopcount = 0, uint32_t dstSeqNo = 0);
71
~DsdvHeader
()
override
;
76
static
TypeId
GetTypeId
();
77
TypeId
GetInstanceTypeId
()
const override
;
78
uint32_t
GetSerializedSize
()
const override
;
79
void
Serialize
(
Buffer::Iterator
start
)
const override
;
80
uint32_t
Deserialize
(
Buffer::Iterator
start
)
override
;
81
void
Print
(std::ostream& os)
const override
;
82
87
void
SetDst
(
Ipv4Address
destination)
88
{
89
m_dst
= destination;
90
}
91
96
Ipv4Address
GetDst
()
const
97
{
98
return
m_dst
;
99
}
100
105
void
SetHopCount
(uint32_t hopCount)
106
{
107
m_hopCount
= hopCount;
108
}
109
114
uint32_t
GetHopCount
()
const
115
{
116
return
m_hopCount
;
117
}
118
123
void
SetDstSeqno
(uint32_t sequenceNumber)
124
{
125
m_dstSeqNo
= sequenceNumber;
126
}
127
132
uint32_t
GetDstSeqno
()
const
133
{
134
return
m_dstSeqNo
;
135
}
136
137
private
:
138
Ipv4Address
m_dst
;
139
uint32_t
m_hopCount
;
140
uint32_t
m_dstSeqNo
;
141
};
142
143
static
inline
std::ostream&
144
operator<<
(std::ostream& os,
const
DsdvHeader
& packet)
145
{
146
packet.
Print
(os);
147
return
os;
148
}
149
}
// namespace dsdv
150
}
// namespace ns3
151
152
#endif
/* DSDV_PACKET_H */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:100
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:44
ns3::Header::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::dsdv::DsdvHeader
DSDV Update Packet Format.
Definition:
dsdv-packet.h:61
ns3::dsdv::DsdvHeader::m_hopCount
uint32_t m_hopCount
Number of Hops.
Definition:
dsdv-packet.h:139
ns3::dsdv::DsdvHeader::DsdvHeader
DsdvHeader(Ipv4Address dst=Ipv4Address(), uint32_t hopcount=0, uint32_t dstSeqNo=0)
Constructor.
Definition:
dsdv-packet.cc:42
ns3::dsdv::DsdvHeader::GetDst
Ipv4Address GetDst() const
Get destination address.
Definition:
dsdv-packet.h:96
ns3::dsdv::DsdvHeader::SetDstSeqno
void SetDstSeqno(uint32_t sequenceNumber)
Set destination sequence number.
Definition:
dsdv-packet.h:123
ns3::dsdv::DsdvHeader::GetHopCount
uint32_t GetHopCount() const
Get hop count.
Definition:
dsdv-packet.h:114
ns3::dsdv::DsdvHeader::m_dst
Ipv4Address m_dst
Destination IP Address.
Definition:
dsdv-packet.h:138
ns3::dsdv::DsdvHeader::GetDstSeqno
uint32_t GetDstSeqno() const
Get destination sequence number.
Definition:
dsdv-packet.h:132
ns3::dsdv::DsdvHeader::~DsdvHeader
~DsdvHeader() override
Definition:
dsdv-packet.cc:49
ns3::dsdv::DsdvHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition:
dsdv-packet.cc:76
ns3::dsdv::DsdvHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
dsdv-packet.cc:54
ns3::dsdv::DsdvHeader::SetDst
void SetDst(Ipv4Address destination)
Set destination address.
Definition:
dsdv-packet.h:87
ns3::dsdv::DsdvHeader::m_dstSeqNo
uint32_t m_dstSeqNo
Destination Sequence Number.
Definition:
dsdv-packet.h:140
ns3::dsdv::DsdvHeader::Print
void Print(std::ostream &os) const override
Definition:
dsdv-packet.cc:98
ns3::dsdv::DsdvHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition:
dsdv-packet.cc:70
ns3::dsdv::DsdvHeader::SetHopCount
void SetHopCount(uint32_t hopCount)
Set hop count.
Definition:
dsdv-packet.h:105
ns3::dsdv::DsdvHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
dsdv-packet.cc:64
ns3::dsdv::operator<<
static std::ostream & operator<<(std::ostream &os, const DsdvHeader &packet)
Definition:
dsdv-packet.h:144
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
two-ray-to-three-gpp-ch-calibration.start
start
Definition:
two-ray-to-three-gpp-ch-calibration.py:520
src
dsdv
model
dsdv-packet.h
Generated on Sun Mar 3 2024 17:10:56 for ns-3 by
1.9.1