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
ipv6-static-routing.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007-2009 Strasbourg University
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: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
19
*/
20
21
#ifndef IPV6_STATIC_ROUTING_H
22
#define IPV6_STATIC_ROUTING_H
23
24
#include <stdint.h>
25
26
#include <list>
27
28
#include "ns3/ptr.h"
29
#include "ns3/ipv6-address.h"
30
#include "ns3/ipv6.h"
31
#include "ns3/ipv6-header.h"
32
#include "ns3/ipv6-routing-protocol.h"
33
34
namespace
ns3 {
35
36
class
Packet;
37
class
NetDevice;
38
class
Ipv6Interface;
39
class
Ipv6Route;
40
class
Node;
41
class
Ipv6RoutingTableEntry;
42
class
Ipv6MulticastRoutingTableEntry;
43
55
class
Ipv6StaticRouting
:
public
Ipv6RoutingProtocol
56
{
57
public
:
62
static
TypeId
GetTypeId
();
63
67
Ipv6StaticRouting
();
68
72
virtual
~Ipv6StaticRouting
();
73
82
void
AddHostRouteTo
(
Ipv6Address
dest,
Ipv6Address
nextHop, uint32_t interface,
Ipv6Address
prefixToUse =
Ipv6Address
(
"::"
), uint32_t metric = 0);
83
90
void
AddHostRouteTo
(
Ipv6Address
dest, uint32_t interface, uint32_t metric = 0);
91
100
void
AddNetworkRouteTo
(
Ipv6Address
network,
Ipv6Prefix
networkPrefix,
Ipv6Address
nextHop, uint32_t interface, uint32_t metric = 0);
101
111
void
AddNetworkRouteTo
(
Ipv6Address
network,
Ipv6Prefix
networkPrefix,
Ipv6Address
nextHop, uint32_t interface,
Ipv6Address
prefixToUse, uint32_t metric = 0);
112
120
void
AddNetworkRouteTo
(
Ipv6Address
network,
Ipv6Prefix
networkPrefix, uint32_t interface, uint32_t metric = 0);
121
129
void
SetDefaultRoute
(
Ipv6Address
nextHop, uint32_t interface,
Ipv6Address
prefixToUse =
Ipv6Address
(
"::"
), uint32_t metric = 0);
130
135
uint32_t
GetNRoutes
()
const
;
136
143
Ipv6RoutingTableEntry
GetDefaultRoute
();
144
150
Ipv6RoutingTableEntry
GetRoute
(uint32_t i)
const
;
151
157
uint32_t
GetMetric
(uint32_t index)
const
;
158
163
void
RemoveRoute
(uint32_t i);
164
172
void
RemoveRoute
(
Ipv6Address
network,
Ipv6Prefix
prefix, uint32_t ifIndex,
Ipv6Address
prefixToUse);
173
182
void
AddMulticastRoute
(
Ipv6Address
origin,
Ipv6Address
group
, uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
183
188
void
SetDefaultMulticastRoute
(uint32_t outputInterface);
189
194
uint32_t
GetNMulticastRoutes
()
const
;
195
201
Ipv6MulticastRoutingTableEntry
GetMulticastRoute
(uint32_t i)
const
;
202
209
bool
RemoveMulticastRoute
(
Ipv6Address
origin,
Ipv6Address
group, uint32_t inputInterface);
210
215
void
RemoveMulticastRoute
(uint32_t i);
216
223
bool
HasNetworkDest
(
Ipv6Address
dest, uint32_t interfaceIndex);
224
225
virtual
Ptr<Ipv6Route>
RouteOutput
(
Ptr<Packet>
p,
const
Ipv6Header
&header,
Ptr<NetDevice>
oif,
Socket::SocketErrno
&sockerr);
226
227
virtual
bool
RouteInput
(
Ptr<const Packet>
p,
const
Ipv6Header
&header,
Ptr<const NetDevice>
idev,
228
UnicastForwardCallback
ucb,
MulticastForwardCallback
mcb,
229
LocalDeliverCallback
lcb,
ErrorCallback
ecb);
230
231
virtual
void
NotifyInterfaceUp
(uint32_t interface);
232
virtual
void
NotifyInterfaceDown
(uint32_t interface);
233
virtual
void
NotifyAddAddress
(uint32_t interface,
Ipv6InterfaceAddress
address);
234
virtual
void
NotifyRemoveAddress
(uint32_t interface,
Ipv6InterfaceAddress
address);
235
virtual
void
NotifyAddRoute
(
Ipv6Address
dst,
Ipv6Prefix
mask,
Ipv6Address
nextHop, uint32_t interface,
Ipv6Address
prefixToUse =
Ipv6Address::GetZero
());
236
virtual
void
NotifyRemoveRoute
(
Ipv6Address
dst,
Ipv6Prefix
mask,
Ipv6Address
nextHop, uint32_t interface,
Ipv6Address
prefixToUse =
Ipv6Address::GetZero
());
237
virtual
void
SetIpv6
(
Ptr<Ipv6>
ipv6);
238
244
virtual
void
PrintRoutingTable
(
Ptr<OutputStreamWrapper>
stream)
const
;
245
246
protected
:
250
virtual
void
DoDispose
();
251
252
private
:
253
typedef
std::list<std::pair <Ipv6RoutingTableEntry *, uint32_t> >
NetworkRoutes
;
254
typedef
std::list<std::pair <Ipv6RoutingTableEntry *, uint32_t> >::const_iterator
NetworkRoutesCI
;
255
typedef
std::list<std::pair <Ipv6RoutingTableEntry *, uint32_t> >::iterator
NetworkRoutesI
;
256
257
typedef
std::list<Ipv6MulticastRoutingTableEntry *>
MulticastRoutes
;
258
typedef
std::list<Ipv6MulticastRoutingTableEntry *>::const_iterator
MulticastRoutesCI
;
259
typedef
std::list<Ipv6MulticastRoutingTableEntry *>::iterator
MulticastRoutesI
;
260
267
Ptr<Ipv6Route>
LookupStatic
(
Ipv6Address
dest,
Ptr<NetDevice>
= 0);
268
276
Ptr<Ipv6MulticastRoute>
LookupStatic
(
Ipv6Address
origin,
Ipv6Address
group, uint32_t ifIndex);
277
284
Ipv6Address
SourceAddressSelection
(uint32_t interface,
Ipv6Address
dest);
285
289
NetworkRoutes
m_networkRoutes
;
290
294
MulticastRoutes
m_multicastRoutes
;
295
299
Ptr<Ipv6>
m_ipv6
;
300
};
301
302
}
/* namespace ns3 */
303
304
#endif
/* IPV6_STATIC_ROUTING_H */
305
src
internet
model
ipv6-static-routing.h
Generated on Tue Oct 9 2012 16:45:39 for ns-3 by
1.8.1.2