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
ipv4-list-routing.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 University of Washington
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
19
#ifndef IPV4_LIST_ROUTING_H
20
#define IPV4_LIST_ROUTING_H
21
22
#include <list>
23
#include "ns3/ipv4-routing-protocol.h"
24
#include "ns3/simulator.h"
25
26
namespace
ns3 {
27
45
class
Ipv4ListRouting
:
public
Ipv4RoutingProtocol
46
{
47
public
:
48
static
TypeId
GetTypeId
(
void
);
49
50
Ipv4ListRouting
();
51
virtual
~Ipv4ListRouting
();
52
60
virtual
void
AddRoutingProtocol
(
Ptr<Ipv4RoutingProtocol>
routingProtocol, int16_t priority);
64
virtual
uint32_t
GetNRoutingProtocols
(
void
)
const
;
76
virtual
Ptr<Ipv4RoutingProtocol>
GetRoutingProtocol
(uint32_t index, int16_t& priority)
const
;
77
78
// Below are from Ipv4RoutingProtocol
79
virtual
Ptr<Ipv4Route>
RouteOutput
(
Ptr<Packet>
p,
const
Ipv4Header
&header,
Ptr<NetDevice>
oif,
Socket::SocketErrno
&sockerr);
80
81
virtual
bool
RouteInput
(
Ptr<const Packet>
p,
const
Ipv4Header
&header,
Ptr<const NetDevice>
idev,
82
UnicastForwardCallback
ucb,
MulticastForwardCallback
mcb,
83
LocalDeliverCallback
lcb,
ErrorCallback
ecb);
84
virtual
void
NotifyInterfaceUp
(uint32_t interface);
85
virtual
void
NotifyInterfaceDown
(uint32_t interface);
86
virtual
void
NotifyAddAddress
(uint32_t interface,
Ipv4InterfaceAddress
address);
87
virtual
void
NotifyRemoveAddress
(uint32_t interface,
Ipv4InterfaceAddress
address);
88
virtual
void
SetIpv4
(
Ptr<Ipv4>
ipv4);
89
virtual
void
PrintRoutingTable
(
Ptr<OutputStreamWrapper>
stream)
const
;
90
91
protected
:
92
void
DoDispose
(
void
);
93
void
DoStart
(
void
);
94
private
:
95
typedef
std::pair<int16_t, Ptr<Ipv4RoutingProtocol> >
Ipv4RoutingProtocolEntry
;
96
typedef
std::list<Ipv4RoutingProtocolEntry>
Ipv4RoutingProtocolList
;
97
Ipv4RoutingProtocolList
m_routingProtocols
;
98
static
bool
Compare
(
const
Ipv4RoutingProtocolEntry
& a,
const
Ipv4RoutingProtocolEntry
& b);
99
Ptr<Ipv4>
m_ipv4
;
100
101
};
102
103
}
// namespace ns3
104
105
#endif
/* IPV4_LIST_ROUTING_H */
src
internet
model
ipv4-list-routing.h
Generated on Tue Oct 9 2012 16:45:38 for ns-3 by
1.8.1.2