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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
37
class
RipNgRte
:
public
Header
38
{
39
public
:
40
RipNgRte
(
void
);
41
46
static
TypeId
GetTypeId
(
void
);
47
52
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
53
54
virtual
void
Print
(std::ostream& os)
const
;
55
60
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
61
66
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
67
73
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
74
79
void
SetPrefix
(
Ipv6Address
prefix);
80
85
Ipv6Address
GetPrefix
(
void
)
const
;
86
91
void
SetPrefixLen
(uint8_t prefixLen);
92
97
uint8_t
GetPrefixLen
(
void
)
const
;
98
103
void
SetRouteTag
(uint16_t routeTag);
104
109
uint16_t
GetRouteTag
(
void
)
const
;
110
115
void
SetRouteMetric
(uint8_t routeMetric);
116
121
uint8_t
GetRouteMetric
(
void
)
const
;
122
123
124
private
:
125
Ipv6Address
m_prefix
;
126
uint16_t
m_tag
;
127
uint8_t
m_prefixLen
;
128
uint8_t
m_metric
;
129
};
130
131
136
class
RipNgHeader
:
public
Header
137
{
138
public
:
139
RipNgHeader
(
void
);
140
145
static
TypeId
GetTypeId
(
void
);
146
151
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
152
153
virtual
void
Print
(std::ostream& os)
const
;
154
159
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
160
165
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
166
172
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
173
177
enum
Command_e
178
{
179
REQUEST
= 0x1,
180
RESPONSE
= 0x2,
181
};
182
187
void
SetCommand
(
Command_e
command);
188
193
Command_e
GetCommand
(
void
)
const
;
194
199
void
AddRte
(
RipNgRte
rte);
200
204
void
ClearRtes
();
205
210
uint16_t
GetRteNumber
(
void
)
const
;
211
216
std::list<RipNgRte>
GetRteList
(
void
)
const
;
217
218
private
:
219
uint8_t
m_command
;
220
std::list<RipNgRte>
m_rteList
;
221
};
222
223
}
224
225
#endif
/* RIPNG_HEADER_H */
226
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::RipNgHeader::GetRteNumber
uint16_t GetRteNumber(void) const
Get the number of RTE included in the message.
Definition:
ripng-header.cc:236
ns3::RipNgHeader::RESPONSE
Definition:
ripng-header.h:180
ns3::RipNgHeader::GetRteList
std::list< RipNgRte > GetRteList(void) const
Get the list of the RTEs included in the message.
Definition:
ripng-header.cc:241
ns3::RipNgHeader::Command_e
Command_e
Commands to be used in RipNg headers.
Definition:
ripng-header.h:177
ns3::RipNgRte::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
Definition:
ripng-header.cc:42
ns3::RipNgRte::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
Definition:
ripng-header.cc:69
ns3::RipNgRte::SetPrefix
void SetPrefix(Ipv6Address prefix)
Set the prefix.
Definition:
ripng-header.cc:82
ns3::RipNgRte::m_prefixLen
uint8_t m_prefixLen
prefix length
Definition:
ripng-header.h:127
visualizer.core.start
def start
Definition:
core.py:1482
ns3::RipNgRte::RipNgRte
RipNgRte(void)
Definition:
ripng-header.cc:31
ns3::RipNgHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Definition:
ripng-header.cc:168
ns3::RipNgHeader::RipNgHeader
RipNgHeader(void)
Definition:
ripng-header.cc:135
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::RipNgRte::m_prefix
Ipv6Address m_prefix
prefix
Definition:
ripng-header.h:125
ns3::RipNgHeader::AddRte
void AddRte(RipNgRte rte)
Add a RTE to the message.
Definition:
ripng-header.cc:226
ns3::RipNgHeader::m_command
uint8_t m_command
command type
Definition:
ripng-header.h:219
ns3::RipNgRte::m_metric
uint8_t m_metric
route metric
Definition:
ripng-header.h:128
ns3::RipNgRte::GetPrefix
Ipv6Address GetPrefix(void) const
Get the prefix.
Definition:
ripng-header.cc:87
ns3::RipNgHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
Definition:
ripng-header.cc:184
ns3::RipNgRte::SetRouteTag
void SetRouteTag(uint16_t routeTag)
Set the route tag.
Definition:
ripng-header.cc:102
ns3::RipNgHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
Definition:
ripng-header.cc:162
ns3::RipNgRte::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
ripng-header.cc:36
ns3::RipNgHeader
RipNgHeader - see RFC 2080
Definition:
ripng-header.h:136
ns3::RipNgRte::Serialize
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Definition:
ripng-header.cc:57
ns3::RipNgRte::GetRouteTag
uint16_t GetRouteTag(void) const
Get the route tag.
Definition:
ripng-header.cc:107
ns3::RipNgRte::SetRouteMetric
void SetRouteMetric(uint8_t routeMetric)
Set the route metric.
Definition:
ripng-header.cc:112
ns3::RipNgHeader::m_rteList
std::list< RipNgRte > m_rteList
list of the RTEs in the message
Definition:
ripng-header.h:220
ns3::RipNgRte::Print
virtual void Print(std::ostream &os) const
Definition:
ripng-header.cc:47
ns3::RipNgHeader::Print
virtual void Print(std::ostream &os) const
Definition:
ripng-header.cc:151
ns3::RipNgRte::m_tag
uint16_t m_tag
route tag
Definition:
ripng-header.h:126
ns3::RipNgHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
Definition:
ripng-header.cc:146
ns3::RipNgRte::GetPrefixLen
uint8_t GetPrefixLen(void) const
Get the prefix length.
Definition:
ripng-header.cc:97
ns3::RipNgRte::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
Definition:
ripng-header.cc:52
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:46
ns3::RipNgHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
ripng-header.cc:140
ns3::RipNgRte::GetRouteMetric
uint8_t GetRouteMetric(void) const
Get the route metric.
Definition:
ripng-header.cc:117
ns3::RipNgHeader::SetCommand
void SetCommand(Command_e command)
Set the command.
Definition:
ripng-header.cc:216
ns3::RipNgHeader::REQUEST
Definition:
ripng-header.h:179
ns3::RipNgHeader::GetCommand
Command_e GetCommand(void) const
Get the command.
Definition:
ripng-header.cc:221
ns3::RipNgHeader::ClearRtes
void ClearRtes()
Clear all the RTEs from the header.
Definition:
ripng-header.cc:231
ns3::RipNgRte
RipNg Routing Table Entry (RTE) - see RFC 2080
Definition:
ripng-header.h:37
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::RipNgRte::SetPrefixLen
void SetPrefixLen(uint8_t prefixLen)
Set the prefix length.
Definition:
ripng-header.cc:92
src
internet
model
ripng-header.h
Generated on Tue Jun 17 2014 01:12:54 for ns-3 by
1.8.6