A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
ipv4-route.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 University of Washington
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
*/
18
#ifndef IPV4_ROUTE_H
19
#define IPV4_ROUTE_H
20
21
#include "ns3/ipv4-address.h"
22
#include "ns3/simple-ref-count.h"
23
24
#include <list>
25
#include <map>
26
#include <ostream>
27
28
namespace
ns3
29
{
30
31
class
NetDevice;
32
41
class
Ipv4Route
:
public
SimpleRefCount
<Ipv4Route>
42
{
43
public
:
44
Ipv4Route
();
45
49
void
SetDestination
(
Ipv4Address
dest);
53
Ipv4Address
GetDestination
()
const
;
54
58
void
SetSource
(
Ipv4Address
src);
62
Ipv4Address
GetSource
()
const
;
63
67
void
SetGateway
(
Ipv4Address
gw);
71
Ipv4Address
GetGateway
()
const
;
72
78
void
SetOutputDevice
(
Ptr<NetDevice>
outputDevice);
82
Ptr<NetDevice>
GetOutputDevice
()
const
;
83
84
#ifdef NOTYET
85
// rtable.idev
86
void
SetInputIfIndex(uint32_t iif);
87
uint32_t GetInputIfIndex()
const
;
88
#endif
89
90
private
:
91
Ipv4Address
m_dest
;
92
Ipv4Address
m_source
;
93
Ipv4Address
m_gateway
;
94
Ptr<NetDevice>
m_outputDevice
;
95
#ifdef NOTYET
96
uint32_t m_inputIfIndex;
97
#endif
98
};
99
107
std::ostream&
operator<<
(std::ostream& os,
const
Ipv4Route
& route);
108
114
class
Ipv4MulticastRoute
:
public
SimpleRefCount
<Ipv4MulticastRoute>
115
{
116
public
:
117
Ipv4MulticastRoute
();
118
122
void
SetGroup
(
const
Ipv4Address
group);
126
Ipv4Address
GetGroup
()
const
;
127
131
void
SetOrigin
(
const
Ipv4Address
origin);
135
Ipv4Address
GetOrigin
()
const
;
136
140
void
SetParent
(uint32_t iif);
144
uint32_t
GetParent
()
const
;
145
150
void
SetOutputTtl
(uint32_t oif, uint32_t ttl);
151
155
std::map<uint32_t, uint32_t>
GetOutputTtlMap
()
const
;
156
157
static
const
uint32_t
MAX_INTERFACES
=
158
16;
159
static
const
uint32_t
MAX_TTL
= 255;
160
161
private
:
162
Ipv4Address
m_group
;
163
Ipv4Address
m_origin
;
164
uint32_t
m_parent
;
165
std::map<uint32_t, uint32_t>
m_ttls
;
166
};
167
168
}
// namespace ns3
169
170
#endif
/* IPV4_ROUTE_H */
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
ns3::Ipv4MulticastRoute
Ipv4 multicast route cache entry (similar to Linux struct mfc_cache)
Definition:
ipv4-route.h:115
ns3::Ipv4MulticastRoute::GetParent
uint32_t GetParent() const
Definition:
ipv4-route.cc:141
ns3::Ipv4MulticastRoute::m_group
Ipv4Address m_group
Group.
Definition:
ipv4-route.h:162
ns3::Ipv4MulticastRoute::GetGroup
Ipv4Address GetGroup() const
Definition:
ipv4-route.cc:113
ns3::Ipv4MulticastRoute::GetOutputTtlMap
std::map< uint32_t, uint32_t > GetOutputTtlMap() const
Definition:
ipv4-route.cc:167
ns3::Ipv4MulticastRoute::GetOrigin
Ipv4Address GetOrigin() const
Definition:
ipv4-route.cc:127
ns3::Ipv4MulticastRoute::SetOrigin
void SetOrigin(const Ipv4Address origin)
Definition:
ipv4-route.cc:120
ns3::Ipv4MulticastRoute::m_origin
Ipv4Address m_origin
Source of packet.
Definition:
ipv4-route.h:163
ns3::Ipv4MulticastRoute::SetOutputTtl
void SetOutputTtl(uint32_t oif, uint32_t ttl)
Definition:
ipv4-route.cc:148
ns3::Ipv4MulticastRoute::SetGroup
void SetGroup(const Ipv4Address group)
Definition:
ipv4-route.cc:106
ns3::Ipv4MulticastRoute::MAX_INTERFACES
static const uint32_t MAX_INTERFACES
Maximum number of multicast interfaces on a router.
Definition:
ipv4-route.h:157
ns3::Ipv4MulticastRoute::m_parent
uint32_t m_parent
Source interface.
Definition:
ipv4-route.h:164
ns3::Ipv4MulticastRoute::MAX_TTL
static const uint32_t MAX_TTL
Maximum time-to-live (TTL)
Definition:
ipv4-route.h:159
ns3::Ipv4MulticastRoute::m_ttls
std::map< uint32_t, uint32_t > m_ttls
Time to Live container.
Definition:
ipv4-route.h:165
ns3::Ipv4MulticastRoute::Ipv4MulticastRoute
Ipv4MulticastRoute()
Definition:
ipv4-route.cc:99
ns3::Ipv4MulticastRoute::SetParent
void SetParent(uint32_t iif)
Definition:
ipv4-route.cc:134
ns3::Ipv4Route
IPv4 route cache entry (similar to Linux struct rtable)
Definition:
ipv4-route.h:42
ns3::Ipv4Route::m_source
Ipv4Address m_source
Source address.
Definition:
ipv4-route.h:92
ns3::Ipv4Route::SetGateway
void SetGateway(Ipv4Address gw)
Definition:
ipv4-route.cc:64
ns3::Ipv4Route::GetOutputDevice
Ptr< NetDevice > GetOutputDevice() const
Definition:
ipv4-route.cc:85
ns3::Ipv4Route::GetGateway
Ipv4Address GetGateway() const
Definition:
ipv4-route.cc:71
ns3::Ipv4Route::SetDestination
void SetDestination(Ipv4Address dest)
Definition:
ipv4-route.cc:36
ns3::Ipv4Route::SetSource
void SetSource(Ipv4Address src)
Definition:
ipv4-route.cc:50
ns3::Ipv4Route::GetSource
Ipv4Address GetSource() const
Definition:
ipv4-route.cc:57
ns3::Ipv4Route::m_gateway
Ipv4Address m_gateway
Gateway address.
Definition:
ipv4-route.h:93
ns3::Ipv4Route::SetOutputDevice
void SetOutputDevice(Ptr< NetDevice > outputDevice)
Equivalent in Linux to dst_entry.dev.
Definition:
ipv4-route.cc:78
ns3::Ipv4Route::GetDestination
Ipv4Address GetDestination() const
Definition:
ipv4-route.cc:43
ns3::Ipv4Route::m_outputDevice
Ptr< NetDevice > m_outputDevice
Output device.
Definition:
ipv4-route.h:94
ns3::Ipv4Route::Ipv4Route
Ipv4Route()
Definition:
ipv4-route.cc:30
ns3::Ipv4Route::m_dest
Ipv4Address m_dest
Destination address.
Definition:
ipv4-route.h:91
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::SimpleRefCount
A template-based reference counting class.
Definition:
simple-ref-count.h:81
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:159
src
internet
model
ipv4-route.h
Generated on Sun Mar 3 2024 17:10:58 for ns-3 by
1.9.1