A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
internet
model
ripng-header.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2014 Universita' di Firenze, Italy
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: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19
*/
20
21
#ifndef RIPNG_HEADER_H
22
#define RIPNG_HEADER_H
23
24
#include <list>
25
#include "ns3/header.h"
26
#include "ns3/ipv6-address.h"
27
#include "ns3/packet.h"
28
#include "ns3/ipv6-header.h"
29
30
31
namespace
ns3
{
32
38
class
RipNgRte
:
public
Header
39
{
40
public
:
41
RipNgRte
(
void
);
42
47
static
TypeId
GetTypeId
(
void
);
48
53
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
54
55
virtual
void
Print
(std::ostream& os)
const
;
56
61
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
62
67
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
68
74
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
75
80
void
SetPrefix
(
Ipv6Address
prefix);
81
86
Ipv6Address
GetPrefix
(
void
)
const
;
87
92
void
SetPrefixLen
(uint8_t prefixLen);
93
98
uint8_t
GetPrefixLen
(
void
)
const
;
99
104
void
SetRouteTag
(uint16_t routeTag);
105
110
uint16_t
GetRouteTag
(
void
)
const
;
111
116
void
SetRouteMetric
(uint8_t routeMetric);
117
122
uint8_t
GetRouteMetric
(
void
)
const
;
123
124
125
private
:
126
Ipv6Address
m_prefix
;
127
uint16_t
m_tag
;
128
uint8_t
m_prefixLen
;
129
uint8_t
m_metric
;
130
};
131
139
std::ostream &
operator <<
(std::ostream & os,
const
RipNgRte
& h);
140
146
class
RipNgHeader
:
public
Header
147
{
148
public
:
149
RipNgHeader
(
void
);
150
155
static
TypeId
GetTypeId
(
void
);
156
161
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
162
163
virtual
void
Print
(std::ostream& os)
const
;
164
169
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
170
175
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
176
182
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
183
187
enum
Command_e
188
{
189
REQUEST
= 0x1,
190
RESPONSE
= 0x2,
191
};
192
197
void
SetCommand
(
Command_e
command);
198
203
Command_e
GetCommand
(
void
)
const
;
204
209
void
AddRte
(
RipNgRte
rte);
210
214
void
ClearRtes
();
215
220
uint16_t
GetRteNumber
(
void
)
const
;
221
226
std::list<RipNgRte>
GetRteList
(
void
)
const
;
227
228
private
:
229
uint8_t
m_command
;
230
std::list<RipNgRte>
m_rteList
;
231
};
232
240
std::ostream &
operator <<
(std::ostream & os,
const
RipNgHeader
& h);
241
242
}
243
244
#endif
/* RIPNG_HEADER_H */
245
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::RipNgHeader::Print
virtual void Print(std::ostream &os) const
Definition:
ripng-header.cc:157
ns3::RipNgHeader::RESPONSE
Definition:
ripng-header.h:190
ns3::RipNgHeader::Command_e
Command_e
Commands to be used in RipNg headers.
Definition:
ripng-header.h:187
ns3::RipNgRte::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
Definition:
ripng-header.cc:72
visualizer.core.start
def start()
Definition:
core.py:1844
ns3::RipNgRte::SetPrefix
void SetPrefix(Ipv6Address prefix)
Set the prefix.
Definition:
ripng-header.cc:85
ns3::RipNgRte::m_prefixLen
uint8_t m_prefixLen
prefix length
Definition:
ripng-header.h:128
ns3::RipNgRte::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
Definition:
ripng-header.cc:45
ns3::RipNgRte::GetRouteMetric
uint8_t GetRouteMetric(void) const
Get the route metric.
Definition:
ripng-header.cc:120
ns3::RipNgRte::RipNgRte
RipNgRte(void)
Definition:
ripng-header.cc:31
ns3::RipNgHeader::RipNgHeader
RipNgHeader(void)
Definition:
ripng-header.cc:138
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::RipNgRte::m_prefix
Ipv6Address m_prefix
prefix
Definition:
ripng-header.h:126
ns3::RipNgHeader::GetRteNumber
uint16_t GetRteNumber(void) const
Get the number of RTE included in the message.
Definition:
ripng-header.cc:248
ns3::RipNgHeader::AddRte
void AddRte(RipNgRte rte)
Add a RTE to the message.
Definition:
ripng-header.cc:238
ns3::RipNgHeader::m_command
uint8_t m_command
command type
Definition:
ripng-header.h:229
ns3::RipNgRte::GetPrefix
Ipv6Address GetPrefix(void) const
Get the prefix.
Definition:
ripng-header.cc:90
ns3::RipNgRte::m_metric
uint8_t m_metric
route metric
Definition:
ripng-header.h:129
ns3::RipNgHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
Definition:
ripng-header.cc:168
ns3::RipNgHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
Definition:
ripng-header.cc:190
ns3::RipNgRte::SetRouteTag
void SetRouteTag(uint16_t routeTag)
Set the route tag.
Definition:
ripng-header.cc:105
ns3::RipNgRte::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
ripng-header.cc:36
ns3::RipNgHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
Definition:
ripng-header.cc:152
ns3::RipNgHeader
RipNgHeader - see RFC 2080
Definition:
ripng-header.h:146
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition:
angles.cc:42
ns3::RipNgRte::SetRouteMetric
void SetRouteMetric(uint8_t routeMetric)
Set the route metric.
Definition:
ripng-header.cc:115
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::RipNgHeader::m_rteList
std::list< RipNgRte > m_rteList
list of the RTEs in the message
Definition:
ripng-header.h:230
ns3::RipNgHeader::GetCommand
Command_e GetCommand(void) const
Get the command.
Definition:
ripng-header.cc:233
ns3::RipNgRte::Serialize
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Definition:
ripng-header.cc:60
ns3::RipNgRte::m_tag
uint16_t m_tag
route tag
Definition:
ripng-header.h:127
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:49
ns3::RipNgRte::GetPrefixLen
uint8_t GetPrefixLen(void) const
Get the prefix length.
Definition:
ripng-header.cc:100
ns3::RipNgHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
ripng-header.cc:143
ns3::RipNgRte::Print
virtual void Print(std::ostream &os) const
Definition:
ripng-header.cc:50
ns3::RipNgHeader::GetRteList
std::list< RipNgRte > GetRteList(void) const
Get the list of the RTEs included in the message.
Definition:
ripng-header.cc:253
ns3::RipNgHeader::SetCommand
void SetCommand(Command_e command)
Set the command.
Definition:
ripng-header.cc:228
ns3::RipNgRte::GetRouteTag
uint16_t GetRouteTag(void) const
Get the route tag.
Definition:
ripng-header.cc:110
ns3::RipNgHeader::REQUEST
Definition:
ripng-header.h:189
ns3::RipNgRte::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
Definition:
ripng-header.cc:55
ns3::RipNgHeader::ClearRtes
void ClearRtes()
Clear all the RTEs from the header.
Definition:
ripng-header.cc:243
ns3::RipNgRte
RipNg Routing Table Entry (RTE) - see RFC 2080
Definition:
ripng-header.h:38
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::RipNgHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Definition:
ripng-header.cc:174
ns3::RipNgRte::SetPrefixLen
void SetPrefixLen(uint8_t prefixLen)
Set the prefix length.
Definition:
ripng-header.cc:95
Generated on Wed Nov 7 2018 10:01:56 for ns-3 by
1.8.14