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-protocol.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_PROTOCOL_H
22
#define FLAME_PROTOCOL_H
23
24
25
#include "ns3/mesh-l2-routing-protocol.h"
26
#include "ns3/nstime.h"
27
#include "ns3/tag.h"
28
#include <map>
29
45
namespace
ns3 {
46
namespace
flame {
47
class
FlameProtocolMac;
48
class
FlameHeader;
49
class
FlameRtable;
54
class
FlameTag
:
public
Tag
55
{
56
public
:
58
Mac48Address
transmitter
;
60
Mac48Address
receiver
;
61
62
FlameTag
(
Mac48Address
a =
Mac48Address
()) :
63
receiver
(a){}
64
66
//\{
67
static
TypeId
GetTypeId
();
68
TypeId
GetInstanceTypeId
()
const
;
69
uint32_t
GetSerializedSize
()
const
;
70
void
Serialize
(
TagBuffer
i)
const
;
71
void
Deserialize
(
TagBuffer
i);
72
void
Print
(std::ostream &os)
const
;
73
//\}
74
};
75
80
class
FlameProtocol
:
public
MeshL2RoutingProtocol
81
{
82
public
:
83
static
TypeId
GetTypeId
();
84
FlameProtocol
();
85
~FlameProtocol
();
86
void
DoDispose
();
87
89
bool
RequestRoute
(uint32_t sourceIface,
const
Mac48Address
source,
const
Mac48Address
destination,
90
Ptr<const Packet>
packet, uint16_t protocolType,
RouteReplyCallback
routeReply);
92
bool
RemoveRoutingStuff
(uint32_t fromIface,
const
Mac48Address
source,
93
const
Mac48Address
destination,
Ptr<Packet>
packet, uint16_t& protocolType);
102
bool
Install
(
Ptr<MeshPointDevice>
);
103
Mac48Address
GetAddress
();
105
void
Report
(std::ostream &)
const
;
106
void
ResetStats
();
107
private
:
108
FlameProtocol
&
operator=
(
const
FlameProtocol
&);
109
FlameProtocol
(
const
FlameProtocol
&);
110
112
static
const
uint16_t
FLAME_PROTOCOL
= 0x4040;
118
bool
HandleDataFrame
(uint16_t seqno,
Mac48Address
source,
const
FlameHeader
flameHdr,
Mac48Address
receiver, uint32_t fromIface);
123
typedef
std::map<uint32_t, Ptr<FlameProtocolMac> >
FlamePluginMap
;
124
FlamePluginMap
m_interfaces
;
125
Mac48Address
m_address
;
126
//\}
131
Time
m_broadcastInterval
;
132
Time
m_lastBroadcast
;
133
//\}
135
uint8_t
m_maxCost
;
137
uint16_t
m_myLastSeqno
;
139
Ptr<FlameRtable>
m_rtable
;
142
struct
Statistics
143
{
144
uint16_t
txUnicast
;
145
uint16_t
txBroadcast
;
146
uint32_t
txBytes
;
147
uint16_t
droppedTtl
;
148
uint16_t
totalDropped
;
149
void
Print
(std::ostream & os)
const
;
150
Statistics
();
151
};
152
Statistics
m_stats
;
154
155
};
156
}
// namespace flame
157
}
// namespace ns3
158
#endif
/* FLAME_PROTOCOL_H */
src
mesh
model
flame
flame-protocol.h
Generated on Tue Nov 13 2012 10:32:18 for ns-3 by
1.8.1.2