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
flame-rtable.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 IITP RAS
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: Kirill Andreev <andreev@iitp.ru>
19
*/
20
21
#ifndef FLAME_RTABLE_H
22
#define FLAME_RTABLE_H
23
24
#include <map>
25
#include "ns3/nstime.h"
26
#include "ns3/object.h"
27
#include "ns3/mac48-address.h"
28
29
namespace
ns3 {
30
namespace
flame {
36
class
FlameRtable
:
public
Object
37
{
38
public
:
40
const
static
uint32_t
INTERFACE_ANY
= 0xffffffff;
42
const
static
uint32_t
MAX_COST
= 0xff;
43
45
struct
LookupResult
46
{
47
Mac48Address
retransmitter
;
48
uint32_t
ifIndex
;
49
uint8_t
cost
;
50
uint16_t
seqnum
;
51
LookupResult
(
Mac48Address
r =
Mac48Address::GetBroadcast
(),
52
uint32_t i =
INTERFACE_ANY
,
53
uint8_t c =
MAX_COST
,
54
uint16_t
s
= 0)
55
:
retransmitter
(r),
56
ifIndex
(i),
57
cost
(c),
58
seqnum
(
s
)
59
{
60
}
62
bool
IsValid
()
const
;
64
bool
operator==
(
const
LookupResult
& o)
const
;
65
};
66
public
:
67
static
TypeId
GetTypeId
();
68
FlameRtable
();
69
~FlameRtable
();
70
void
DoDispose
();
71
73
void
AddPath
(
74
const
Mac48Address
destination,
75
const
Mac48Address
retransmitter,
76
const
uint32_t interface,
77
const
uint8_t cost,
78
const
uint16_t seqnum
79
);
84
LookupResult
Lookup
(
Mac48Address
destination);
85
private
:
86
FlameRtable
&
operator=
(
const
FlameRtable
&);
87
FlameRtable
(
const
FlameRtable
&);
88
90
struct
Route
91
{
92
Mac48Address
retransmitter
;
93
uint32_t
interface
;
94
uint32_t
cost
;
95
Time
whenExpire
;
96
uint32_t
seqnum
;
97
};
99
Time
m_lifetime
;
101
std::map<Mac48Address, Route>
m_routes
;
102
};
103
104
}
// namespace flame
105
}
// namespace ns3
106
#endif
/* FLAME_PROTOCOL_H */
ns3::flame::FlameRtable::MAX_COST
static const uint32_t MAX_COST
Maximum (the best?) path cost.
Definition:
flame-rtable.h:42
ns3::flame::FlameRtable
Routing table for FLAME.
Definition:
flame-rtable.h:36
ns3::Time
keep track of time values and allow control of global simulation resolution
Definition:
nstime.h:81
ns3::flame::FlameRtable::FlameRtable
FlameRtable()
Definition:
flame-rtable.cc:49
ns3::flame::FlameRtable::AddPath
void AddPath(const Mac48Address destination, const Mac48Address retransmitter, const uint32_t interface, const uint8_t cost, const uint16_t seqnum)
Add path.
Definition:
flame-rtable.cc:62
ns3::flame::FlameRtable::Route::cost
uint32_t cost
Definition:
flame-rtable.h:94
ns3::flame::FlameRtable::Route::retransmitter
Mac48Address retransmitter
Definition:
flame-rtable.h:92
ns3::flame::FlameRtable::m_routes
std::map< Mac48Address, Route > m_routes
List of routes.
Definition:
flame-rtable.h:101
s
Ptr< SampleEmitter > s
Definition:
double-probe-test-suite.cc:51
ns3::flame::FlameRtable::LookupResult::retransmitter
Mac48Address retransmitter
Definition:
flame-rtable.h:47
ns3::Mac48Address::GetBroadcast
static Mac48Address GetBroadcast(void)
Definition:
mac48-address.cc:165
ns3::flame::FlameRtable::Route::seqnum
uint32_t seqnum
Definition:
flame-rtable.h:96
ns3::flame::FlameRtable::~FlameRtable
~FlameRtable()
Definition:
flame-rtable.cc:53
ns3::flame::FlameRtable::LookupResult::seqnum
uint16_t seqnum
Definition:
flame-rtable.h:50
ns3::flame::FlameRtable::m_lifetime
Time m_lifetime
Lifetime parameter.
Definition:
flame-rtable.h:99
ns3::flame::FlameRtable::Route::interface
uint32_t interface
Definition:
flame-rtable.h:93
ns3::flame::FlameRtable::LookupResult
Route lookup result, return type of LookupXXX methods.
Definition:
flame-rtable.h:45
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:41
ns3::flame::FlameRtable::LookupResult::operator==
bool operator==(const LookupResult &o) const
Compare route lookup results, used by tests.
Definition:
flame-rtable.cc:101
ns3::flame::FlameRtable::GetTypeId
static TypeId GetTypeId()
Definition:
flame-rtable.cc:35
ns3::flame::FlameRtable::INTERFACE_ANY
static const uint32_t INTERFACE_ANY
Means all interfaces.
Definition:
flame-rtable.h:40
ns3::flame::FlameRtable::LookupResult::LookupResult
LookupResult(Mac48Address r=Mac48Address::GetBroadcast(), uint32_t i=INTERFACE_ANY, uint8_t c=MAX_COST, uint16_t s=0)
Definition:
flame-rtable.h:51
ns3::flame::FlameRtable::LookupResult::IsValid
bool IsValid() const
True for valid route.
Definition:
flame-rtable.cc:107
ns3::flame::FlameRtable::LookupResult::cost
uint8_t cost
Definition:
flame-rtable.h:49
ns3::flame::FlameRtable::operator=
FlameRtable & operator=(const FlameRtable &)
ns3::Object
a base class which provides memory management and object aggregation
Definition:
object.h:63
ns3::flame::FlameRtable::Route
Routing table entry.
Definition:
flame-rtable.h:90
ns3::flame::FlameRtable::LookupResult::ifIndex
uint32_t ifIndex
Definition:
flame-rtable.h:48
ns3::flame::FlameRtable::DoDispose
void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition:
flame-rtable.cc:57
ns3::flame::FlameRtable::Route::whenExpire
Time whenExpire
Definition:
flame-rtable.h:95
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::flame::FlameRtable::Lookup
LookupResult Lookup(Mac48Address destination)
Lookup path to destination.
Definition:
flame-rtable.cc:85
src
mesh
model
flame
flame-rtable.h
Generated on Sat Apr 19 2014 14:07:03 for ns-3 by
1.8.6