A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
mesh
model
mesh-l2-routing-protocol.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008,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
* Authors: Kirill Andreev <andreev@iitp.ru>
19
* Pavel Boyko <boyko@iitp.ru>
20
*/
21
22
#ifndef MESH_L2_ROUTING_PROTOCOL_H
23
#define MESH_L2_ROUTING_PROTOCOL_H
24
25
#include "ns3/object.h"
26
#include "ns3/mac48-address.h"
27
#include "ns3/packet.h"
28
29
namespace
ns3
{
30
31
class
Packet;
32
class
MeshPointDevice;
33
44
class
MeshL2RoutingProtocol
:
public
Object
45
{
46
public
:
51
static
TypeId
GetTypeId
();
53
virtual
~MeshL2RoutingProtocol
();
76
typedef
Callback
<void,
/* return type */
77
bool,
/* flag */
78
Ptr<Packet>
,
/* packet */
79
Mac48Address
,
/* src */
80
Mac48Address
,
/* dst */
81
uint16_t,
/* protocol */
82
uint32_t
/* out interface ID */
83
>
RouteReplyCallback
;
100
virtual
bool
RequestRoute
(uint32_t sourceIface,
const
Mac48Address
source,
const
Mac48Address
destination,
Ptr
<
101
const
Packet
> packet, uint16_t protocolType,
RouteReplyCallback
routeReply) = 0;
116
virtual
bool
RemoveRoutingStuff
(uint32_t fromIface,
const
Mac48Address
source,
const
Mac48Address
destination,
Ptr
<
117
Packet
> packet, uint16_t & protocolType) = 0;
123
void
124
SetMeshPoint
(
Ptr<MeshPointDevice>
mp);
130
Ptr<MeshPointDevice>
131
GetMeshPoint
()
const
;
132
protected
:
134
Ptr<MeshPointDevice>
m_mp
;
135
};
136
}
// namespace ns3
137
#endif
ns3::MeshL2RoutingProtocol::SetMeshPoint
void SetMeshPoint(Ptr< MeshPointDevice > mp)
Set host mesh point, analog of SetNode (...) methods for upper layer protocols.
Definition:
mesh-l2-routing-protocol.cc:48
ns3::Ptr< Packet >
ns3::MeshL2RoutingProtocol::GetMeshPoint
Ptr< MeshPointDevice > GetMeshPoint() const
Each mesh protocol must be installed on the mesh point to work.
Definition:
mesh-l2-routing-protocol.cc:54
ns3::Callback
Callback template class.
Definition:
callback.h:1176
ns3::MeshL2RoutingProtocol::RouteReplyCallback
Callback< void, bool, Ptr< Packet >, Mac48Address, Mac48Address, uint16_t, uint32_t > RouteReplyCallback
Callback to be invoked when route discovery procedure is completed.
Definition:
mesh-l2-routing-protocol.h:83
ns3::Packet
network packets
Definition:
packet.h:231
ns3::MeshL2RoutingProtocol::m_mp
Ptr< MeshPointDevice > m_mp
Host mesh point.
Definition:
mesh-l2-routing-protocol.h:134
ns3::MeshL2RoutingProtocol::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
mesh-l2-routing-protocol.cc:33
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:43
ns3::MeshL2RoutingProtocol::RemoveRoutingStuff
virtual bool RemoveRoutingStuff(uint32_t fromIface, const Mac48Address source, const Mac48Address destination, Ptr< Packet > packet, uint16_t &protocolType)=0
When packet is ready to go to upper layer, protocol must remove all its information: tags...
ns3::MeshL2RoutingProtocol::~MeshL2RoutingProtocol
virtual ~MeshL2RoutingProtocol()
virtual D-tor for subclasses
Definition:
mesh-l2-routing-protocol.cc:42
ns3::MeshL2RoutingProtocol::RequestRoute
virtual bool RequestRoute(uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, Ptr< const Packet > packet, uint16_t protocolType, RouteReplyCallback routeReply)=0
Request routing information, all packets must go through this request.
ns3::MeshL2RoutingProtocol
Interface for L2 mesh routing protocol and mesh point communication.
Definition:
mesh-l2-routing-protocol.h:44
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:87
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
Generated on Wed Nov 7 2018 10:02:05 for ns-3 by
1.8.14