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-route.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_ROUTE_H
20
#define IPV4_ROUTE_H
21
22
#include <list>
23
#include <map>
24
#include <ostream>
25
26
#include "ns3/simple-ref-count.h"
27
#include "ns3/ipv4-address.h"
28
#include "ns3/deprecated.h"
29
30
namespace
ns3 {
31
32
class
NetDevice;
33
42
class
Ipv4Route
:
public
SimpleRefCount
<Ipv4Route>
43
{
44
public
:
45
Ipv4Route
();
46
50
void
SetDestination
(
Ipv4Address
dest);
54
Ipv4Address
GetDestination
(
void
)
const
;
55
59
void
SetSource
(
Ipv4Address
src);
63
Ipv4Address
GetSource
(
void
)
const
;
64
68
void
SetGateway
(
Ipv4Address
gw);
72
Ipv4Address
GetGateway
(
void
)
const
;
73
79
void
SetOutputDevice
(
Ptr<NetDevice>
outputDevice);
83
Ptr<NetDevice>
GetOutputDevice
(
void
)
const
;
84
85
#ifdef NOTYET
86
// rtable.idev
87
void
SetInputIfIndex (uint32_t iif);
88
uint32_t GetInputIfIndex (
void
)
const
;
89
#endif
90
91
private
:
92
Ipv4Address
m_dest
;
93
Ipv4Address
m_source
;
94
Ipv4Address
m_gateway
;
95
Ptr<NetDevice>
m_outputDevice
;
96
#ifdef NOTYET
97
uint32_t m_inputIfIndex;
98
#endif
99
};
100
101
std::ostream&
operator<<
(std::ostream& os,
Ipv4Route
const
& route);
102
108
class
Ipv4MulticastRoute
:
public
SimpleRefCount
<Ipv4MulticastRoute>
109
{
110
public
:
111
Ipv4MulticastRoute
();
112
116
void
SetGroup
(
const
Ipv4Address
group
);
120
Ipv4Address
GetGroup
(
void
)
const
;
121
125
void
SetOrigin
(
const
Ipv4Address
origin);
129
Ipv4Address
GetOrigin
(
void
)
const
;
130
134
void
SetParent
(uint32_t iif);
138
uint32_t
GetParent
(
void
)
const
;
139
144
void
SetOutputTtl
(uint32_t oif, uint32_t ttl);
150
uint32_t
GetOutputTtl
(uint32_t oif)
NS_DEPRECATED
;
151
155
std::map<uint32_t, uint32_t>
GetOutputTtlMap
()
const
;
156
157
static
const
uint32_t
MAX_INTERFACES
= 16;
// Maximum number of multicast interfaces on a router
158
static
const
uint32_t
MAX_TTL
= 255;
// Maximum time-to-live (TTL)
159
160
private
:
161
Ipv4Address
m_group
;
// Group
162
Ipv4Address
m_origin
;
// Source of packet
163
uint32_t
m_parent
;
// Source interface
164
std::map<uint32_t, uint32_t>
m_ttls
;
165
};
166
167
}
// namespace ns3
168
169
#endif
/* IPV4_ROUTE_H */
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::Ipv4MulticastRoute::SetOrigin
void SetOrigin(const Ipv4Address origin)
Definition:
ipv4-route.cc:117
ns3::Ipv4MulticastRoute::SetGroup
void SetGroup(const Ipv4Address group)
Definition:
ipv4-route.cc:103
ns3::Ipv4Route::m_gateway
Ipv4Address m_gateway
Definition:
ipv4-route.h:94
ns3::Ipv4MulticastRoute::SetParent
void SetParent(uint32_t iif)
Definition:
ipv4-route.cc:131
ns3::Ipv4Route::SetSource
void SetSource(Ipv4Address src)
Definition:
ipv4-route.cc:49
ns3::Ipv4Route::GetOutputDevice
Ptr< NetDevice > GetOutputDevice(void) const
Definition:
ipv4-route.cc:84
ns3::Ipv4MulticastRoute::MAX_INTERFACES
static const uint32_t MAX_INTERFACES
Definition:
ipv4-route.h:157
NS_DEPRECATED
#define NS_DEPRECATED
Definition:
deprecated.h:7
ns3::Ipv4Route::SetGateway
void SetGateway(Ipv4Address gw)
Definition:
ipv4-route.cc:63
visualizer.higcontainer.group
tuple group
Definition:
higcontainer.py:88
ns3::Ipv4Route::m_source
Ipv4Address m_source
Definition:
ipv4-route.h:93
ns3::Ipv4Route::GetSource
Ipv4Address GetSource(void) const
Definition:
ipv4-route.cc:56
ns3::Ipv4MulticastRoute::m_origin
Ipv4Address m_origin
Definition:
ipv4-route.h:162
ns3::Ipv4Route::GetGateway
Ipv4Address GetGateway(void) const
Definition:
ipv4-route.cc:70
ns3::Ipv4MulticastRoute::Ipv4MulticastRoute
Ipv4MulticastRoute()
Definition:
ipv4-route.cc:96
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:43
ns3::Ipv4Route
Ipv4 route cache entry (similar to Linux struct rtable)
Definition:
ipv4-route.h:42
ns3::Ipv4Route::SetOutputDevice
void SetOutputDevice(Ptr< NetDevice > outputDevice)
Definition:
ipv4-route.cc:77
ns3::Ipv4Route::GetDestination
Ipv4Address GetDestination(void) const
Definition:
ipv4-route.cc:42
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:38
ns3::Ipv4MulticastRoute
Ipv4 multicast route cache entry (similar to Linux struct mfc_cache)
Definition:
ipv4-route.h:108
ns3::Ipv4MulticastRoute::m_ttls
std::map< uint32_t, uint32_t > m_ttls
Definition:
ipv4-route.h:164
ns3::Ipv4MulticastRoute::GetOrigin
Ipv4Address GetOrigin(void) const
Definition:
ipv4-route.cc:124
ns3::Ipv4MulticastRoute::GetOutputTtlMap
std::map< uint32_t, uint32_t > GetOutputTtlMap() const
Definition:
ipv4-route.cc:176
ns3::Ipv4MulticastRoute::m_parent
uint32_t m_parent
Definition:
ipv4-route.h:163
ns3::Ipv4MulticastRoute::GetOutputTtl
uint32_t GetOutputTtl(uint32_t oif) NS_DEPRECATED
Definition:
ipv4-route.cc:165
ns3::Ipv4MulticastRoute::m_group
Ipv4Address m_group
Definition:
ipv4-route.h:161
ns3::SimpleRefCount
A template-based reference counting class.
Definition:
simple-ref-count.h:64
ns3::Ipv4Route::Ipv4Route
Ipv4Route()
Definition:
ipv4-route.cc:29
ns3::Ipv4Route::m_outputDevice
Ptr< NetDevice > m_outputDevice
Definition:
ipv4-route.h:95
ns3::Ipv4MulticastRoute::GetGroup
Ipv4Address GetGroup(void) const
Definition:
ipv4-route.cc:110
ns3::Ipv4MulticastRoute::GetParent
uint32_t GetParent(void) const
Definition:
ipv4-route.cc:138
ns3::Ipv4MulticastRoute::MAX_TTL
static const uint32_t MAX_TTL
Definition:
ipv4-route.h:158
ns3::Ipv4MulticastRoute::SetOutputTtl
void SetOutputTtl(uint32_t oif, uint32_t ttl)
Definition:
ipv4-route.cc:145
ns3::Ipv4Route::SetDestination
void SetDestination(Ipv4Address dest)
Definition:
ipv4-route.cc:35
ns3::Ipv4Route::m_dest
Ipv4Address m_dest
Definition:
ipv4-route.h:92
src
internet
model
ipv4-route.h
Generated on Sat Nov 16 2013 16:17:41 for ns-3 by
1.8.5