A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
dsdv-packet.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 Hemanth Narra
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Hemanth Narra <hemanth@ittc.ku.com>
19
*
20
* James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
21
* ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets
22
* Information and Telecommunication Technology Center (ITTC)
23
* and Department of Electrical Engineering and Computer Science
24
* The University of Kansas Lawrence, KS USA.
25
*
26
* Work supported in part by NSF FIND (Future Internet Design) Program
27
* under grant CNS-0626918 (Postmodern Internet Architecture),
28
* NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
29
* US Department of Defense (DoD), and ITTC at The University of Kansas.
30
*/
31
32
#ifndef DSDV_PACKET_H
33
#define DSDV_PACKET_H
34
35
#include <iostream>
36
#include "ns3/header.h"
37
#include "ns3/ipv4-address.h"
38
#include "ns3/nstime.h"
39
40
namespace
ns3
{
41
namespace
dsdv {
58
class
DsdvHeader
:
public
Header
59
{
60
public
:
61
DsdvHeader
(
Ipv4Address
dst =
Ipv4Address
(), uint32_t hopcount = 0, uint32_t dstSeqNo = 0);
62
virtual
~DsdvHeader
();
63
static
TypeId
GetTypeId
(
void
);
64
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
65
virtual
uint32_t
GetSerializedSize
()
const
;
66
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
67
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
68
virtual
void
Print
(std::ostream &os)
const
;
69
70
void
71
SetDst
(
Ipv4Address
destination)
72
{
73
m_dst
= destination;
74
}
75
Ipv4Address
76
GetDst
()
const
77
{
78
return
m_dst
;
79
}
80
void
81
SetHopCount
(uint32_t hopCount)
82
{
83
m_hopCount
= hopCount;
84
}
85
uint32_t
86
GetHopCount
()
const
87
{
88
return
m_hopCount
;
89
}
90
void
91
SetDstSeqno
(uint32_t sequenceNumber)
92
{
93
m_dstSeqNo
= sequenceNumber;
94
}
95
uint32_t
96
GetDstSeqno
()
const
97
{
98
return
m_dstSeqNo
;
99
}
100
private
:
101
Ipv4Address
m_dst
;
102
uint32_t
m_hopCount
;
103
uint32_t
m_dstSeqNo
;
104
};
105
static
inline
std::ostream &
operator<<
(std::ostream& os,
const
DsdvHeader
& packet)
106
{
107
packet.
Print
(os);
108
return
os;
109
}
110
}
111
}
112
113
#endif
/* DSDV_PACKET_H */
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::dsdv::DsdvHeader::Print
virtual void Print(std::ostream &os) const
Definition:
dsdv-packet.cc:97
ns3::dsdv::DsdvHeader::SetDst
void SetDst(Ipv4Address destination)
Definition:
dsdv-packet.h:71
ns3::dsdv::DsdvHeader::GetSerializedSize
virtual uint32_t GetSerializedSize() const
Definition:
dsdv-packet.cc:68
ns3::dsdv::DsdvHeader::GetHopCount
uint32_t GetHopCount() const
Definition:
dsdv-packet.h:86
visualizer.core.start
def start()
Definition:
core.py:1482
ns3::dsdv::DsdvHeader::SetDstSeqno
void SetDstSeqno(uint32_t sequenceNumber)
Definition:
dsdv-packet.h:91
ns3::dsdv::DsdvHeader::m_hopCount
uint32_t m_hopCount
Number of Hops.
Definition:
dsdv-packet.h:102
ns3::dsdv::DsdvHeader::m_dstSeqNo
uint32_t m_dstSeqNo
Destination Sequence Number.
Definition:
dsdv-packet.h:103
ns3::dsdv::DsdvHeader::GetDstSeqno
uint32_t GetDstSeqno() const
Definition:
dsdv-packet.h:96
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::dsdv::DsdvHeader::GetDst
Ipv4Address GetDst() const
Definition:
dsdv-packet.h:76
ns3::dsdv::operator<<
static std::ostream & operator<<(std::ostream &os, const DsdvHeader &packet)
Definition:
dsdv-packet.h:105
ns3::dsdv::DsdvHeader::GetTypeId
static TypeId GetTypeId(void)
Definition:
dsdv-packet.cc:52
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::dsdv::DsdvHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
dsdv-packet.cc:74
ns3::dsdv::DsdvHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
dsdv-packet.cc:62
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:40
ns3::dsdv::DsdvHeader::m_dst
Ipv4Address m_dst
Destination IP Address.
Definition:
dsdv-packet.h:101
ns3::dsdv::DsdvHeader::SetHopCount
void SetHopCount(uint32_t hopCount)
Definition:
dsdv-packet.h:81
ns3::dsdv::DsdvHeader
DSDV Update Packet Format.
Definition:
dsdv-packet.h:58
ns3::dsdv::DsdvHeader::~DsdvHeader
virtual ~DsdvHeader()
Definition:
dsdv-packet.cc:47
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:57
ns3::dsdv::DsdvHeader::DsdvHeader
DsdvHeader(Ipv4Address dst=Ipv4Address(), uint32_t hopcount=0, uint32_t dstSeqNo=0)
Definition:
dsdv-packet.cc:40
ns3::dsdv::DsdvHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
dsdv-packet.cc:83
src
dsdv
model
dsdv-packet.h
Generated on Wed May 13 2015 14:59:13 for ns-3 by
1.8.9.1