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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
ipv4-routing-protocol.h
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
#ifndef IPV4_ROUTING_PROTOCOL_H
19
#define IPV4_ROUTING_PROTOCOL_H
20
21
#include "ns3/packet.h"
22
#include "ns3/callback.h"
23
#include "ns3/object.h"
24
#include "ns3/socket.h"
25
#include "ipv4-header.h"
26
#include "ns3/ipv4-interface-address.h"
27
#include "ipv4.h"
28
#include "ns3/output-stream-wrapper.h"
29
#include "ns3/repository.h"
30
31
namespace
ns3 {
32
33
class
Ipv4MulticastRoute;
34
class
Ipv4Route;
35
class
NetDevice;
36
51
class
Ipv4RoutingProtocol
:
public
Object
52
{
53
public
:
54
static
TypeId
GetTypeId (
void
);
55
56
typedef
Callback<void, Ptr<Ipv4Route>
,
Ptr<const Packet>
,
const
Ipv4Header
&>
UnicastForwardCallback
;
57
typedef
Callback<void, Ptr<Ipv4MulticastRoute>
,
Ptr<const Packet>
,
const
Ipv4Header
&>
MulticastForwardCallback
;
58
typedef
Callback<void, Ptr<const Packet>
,
const
Ipv4Header
&, uint32_t >
LocalDeliverCallback
;
59
typedef
Callback<void, Ptr<const Packet>
,
const
Ipv4Header
&, Socket::SocketErrno >
ErrorCallback
;
60
81
virtual
Ptr<Ipv4Route>
RouteOutput
(
Ptr<Packet>
p,
const
Ipv4Header
&header,
Ptr<NetDevice>
oif, Socket::SocketErrno &sockerr) = 0;
82
104
virtual
bool
RouteInput
(
Ptr<const Packet>
p,
const
Ipv4Header
&header,
Ptr<const NetDevice>
idev,
105
UnicastForwardCallback
ucb,
MulticastForwardCallback
mcb,
106
LocalDeliverCallback
lcb,
ErrorCallback
ecb) = 0;
107
114
virtual
void
NotifyInterfaceUp
(uint32_t interface) = 0;
121
virtual
void
NotifyInterfaceDown
(uint32_t interface) = 0;
122
131
virtual
void
NotifyAddAddress
(uint32_t interface,
Ipv4InterfaceAddress
address) = 0;
132
141
virtual
void
NotifyRemoveAddress
(uint32_t interface,
Ipv4InterfaceAddress
address) = 0;
142
148
virtual
void
SetIpv4
(
Ptr<Ipv4>
ipv4) = 0;
149
155
virtual
void
PrintRoutingTable
(
Ptr<OutputStreamWrapper>
stream)
const
= 0;
156
162
virtual
void
SetRepository
(
Ptr<Repository>
repo) {
return
; }
163
};
164
165
}
// namespace ns3
166
167
#endif
/* IPV4_ROUTING_PROTOCOL_H */
ns3::Ipv4RoutingProtocol::SetIpv4
virtual void SetIpv4(Ptr< Ipv4 > ipv4)=0
ns3::Ptr< const Packet >
ns3::Callback
Callback template class.
Definition:
callback.h:369
ns3::Ipv4RoutingProtocol::SetRepository
virtual void SetRepository(Ptr< Repository > repo)
Set cognitive radio repository.
Definition:
ipv4-routing-protocol.h:162
ns3::Ipv4RoutingProtocol::NotifyRemoveAddress
virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address)=0
ns3::Ipv4RoutingProtocol::NotifyInterfaceUp
virtual void NotifyInterfaceUp(uint32_t interface)=0
ns3::Ipv4Header
Packet header for IPv4.
Definition:
ipv4-header.h:31
ns3::Ipv4RoutingProtocol::NotifyAddAddress
virtual void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address)=0
ns3::Ipv4RoutingProtocol::RouteInput
virtual bool RouteInput(Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)=0
Route an input packet (to be forwarded or locally delivered)
ns3::Ipv4RoutingProtocol::PrintRoutingTable
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream) const =0
Print the Routing Table entries.
ns3::Ipv4InterfaceAddress
a class to store IPv4 address information on an interface
Definition:
ipv4-interface-address.h:42
ns3::Ipv4RoutingProtocol
Abstract base class for IPv4 routing protocols.
Definition:
ipv4-routing-protocol.h:51
ns3::Ipv4RoutingProtocol::RouteOutput
virtual Ptr< Ipv4Route > RouteOutput(Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr)=0
Query routing cache for an existing route, for an outbound packet.
ns3::Object
a base class which provides memory management and object aggregation
Definition:
object.h:63
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:44
ns3::Ipv4RoutingProtocol::NotifyInterfaceDown
virtual void NotifyInterfaceDown(uint32_t interface)=0
src
internet
model
ipv4-routing-protocol.h
Generated on Sun Mar 16 2014 11:25:04 for ns-3 by
1.8.6