A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
ipv4-routing-table-entry.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005 INRIA
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
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
*/
19
#ifndef IPV4_ROUTING_TABLE_ENTRY_H
20
#define IPV4_ROUTING_TABLE_ENTRY_H
21
22
#include "ns3/ipv4-address.h"
23
24
#include <list>
25
#include <ostream>
26
#include <vector>
27
28
namespace
ns3
29
{
30
37
class
Ipv4RoutingTableEntry
38
{
39
public
:
43
Ipv4RoutingTableEntry
();
48
Ipv4RoutingTableEntry
(
const
Ipv4RoutingTableEntry
& route);
53
Ipv4RoutingTableEntry
(
const
Ipv4RoutingTableEntry
* route);
57
bool
IsHost
()
const
;
63
bool
IsNetwork
()
const
;
67
bool
IsDefault
()
const
;
71
bool
IsGateway
()
const
;
75
Ipv4Address
GetGateway
()
const
;
79
Ipv4Address
GetDest
()
const
;
83
Ipv4Address
GetDestNetwork
()
const
;
87
Ipv4Mask
GetDestNetworkMask
()
const
;
91
uint32_t
GetInterface
()
const
;
98
static
Ipv4RoutingTableEntry
CreateHostRouteTo
(
Ipv4Address
dest,
99
Ipv4Address
nextHop,
100
uint32_t
interface);
106
static
Ipv4RoutingTableEntry
CreateHostRouteTo
(
Ipv4Address
dest,
uint32_t
interface);
114
static
Ipv4RoutingTableEntry
CreateNetworkRouteTo
(
Ipv4Address
network,
115
Ipv4Mask
networkMask,
116
Ipv4Address
nextHop,
117
uint32_t
interface);
124
static
Ipv4RoutingTableEntry
CreateNetworkRouteTo
(
Ipv4Address
network,
125
Ipv4Mask
networkMask,
126
uint32_t
interface);
134
static
Ipv4RoutingTableEntry
CreateDefaultRoute
(
Ipv4Address
nextHop,
uint32_t
interface);
135
136
private
:
144
Ipv4RoutingTableEntry
(
Ipv4Address
network,
145
Ipv4Mask
mask,
146
Ipv4Address
gateway,
147
uint32_t
interface);
154
Ipv4RoutingTableEntry
(
Ipv4Address
dest,
Ipv4Mask
mask,
uint32_t
interface);
161
Ipv4RoutingTableEntry
(
Ipv4Address
dest,
Ipv4Address
gateway,
uint32_t
interface);
167
Ipv4RoutingTableEntry
(
Ipv4Address
dest,
uint32_t
interface);
168
169
Ipv4Address
m_dest
;
170
Ipv4Mask
m_destNetworkMask
;
171
Ipv4Address
m_gateway
;
172
uint32_t
m_interface
;
173
};
174
182
std::ostream&
operator<<
(std::ostream& os,
const
Ipv4RoutingTableEntry
& route);
183
191
bool
operator==
(
const
Ipv4RoutingTableEntry
a,
const
Ipv4RoutingTableEntry
b);
192
198
class
Ipv4MulticastRoutingTableEntry
199
{
200
public
:
204
Ipv4MulticastRoutingTableEntry
();
205
210
Ipv4MulticastRoutingTableEntry
(
const
Ipv4MulticastRoutingTableEntry
& route);
215
Ipv4MulticastRoutingTableEntry
(
const
Ipv4MulticastRoutingTableEntry
* route);
219
Ipv4Address
GetOrigin
()
const
;
223
Ipv4Address
GetGroup
()
const
;
227
uint32_t
GetInputInterface
()
const
;
231
uint32_t
GetNOutputInterfaces
()
const
;
236
uint32_t
GetOutputInterface
(
uint32_t
n)
const
;
240
std::vector<uint32_t>
GetOutputInterfaces
()
const
;
248
static
Ipv4MulticastRoutingTableEntry
CreateMulticastRoute
(
249
Ipv4Address
origin,
250
Ipv4Address
group,
251
uint32_t
inputInterface,
252
std::vector<uint32_t> outputInterfaces);
253
254
private
:
262
Ipv4MulticastRoutingTableEntry
(
Ipv4Address
origin,
263
Ipv4Address
group,
264
uint32_t
inputInterface,
265
std::vector<uint32_t> outputInterfaces);
266
267
Ipv4Address
m_origin
;
268
Ipv4Address
m_group
;
269
uint32_t
m_inputInterface
;
270
std::vector<uint32_t>
m_outputInterfaces
;
271
};
272
280
std::ostream&
operator<<
(std::ostream& os,
const
Ipv4MulticastRoutingTableEntry
& route);
281
289
bool
operator==
(
const
Ipv4MulticastRoutingTableEntry
a,
const
Ipv4MulticastRoutingTableEntry
b);
290
291
}
// namespace ns3
292
293
#endif
/* IPV4_ROUTING_TABLE_ENTRY_H */
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
ns3::Ipv4Mask
a class to represent an Ipv4 address mask
Definition:
ipv4-address.h:257
ns3::Ipv4MulticastRoutingTableEntry
A record of an IPv4 multicast route for Ipv4GlobalRouting and Ipv4StaticRouting.
Definition:
ipv4-routing-table-entry.h:199
ns3::Ipv4MulticastRoutingTableEntry::m_origin
Ipv4Address m_origin
source address
Definition:
ipv4-routing-table-entry.h:267
ns3::Ipv4MulticastRoutingTableEntry::GetGroup
Ipv4Address GetGroup() const
Definition:
ipv4-routing-table-entry.cc:298
ns3::Ipv4MulticastRoutingTableEntry::GetOrigin
Ipv4Address GetOrigin() const
Definition:
ipv4-routing-table-entry.cc:291
ns3::Ipv4MulticastRoutingTableEntry::m_outputInterfaces
std::vector< uint32_t > m_outputInterfaces
output interfaces
Definition:
ipv4-routing-table-entry.h:270
ns3::Ipv4MulticastRoutingTableEntry::GetOutputInterfaces
std::vector< uint32_t > GetOutputInterfaces() const
Definition:
ipv4-routing-table-entry.cc:329
ns3::Ipv4MulticastRoutingTableEntry::m_group
Ipv4Address m_group
destination address
Definition:
ipv4-routing-table-entry.h:268
ns3::Ipv4MulticastRoutingTableEntry::GetOutputInterface
uint32_t GetOutputInterface(uint32_t n) const
Definition:
ipv4-routing-table-entry.cc:319
ns3::Ipv4MulticastRoutingTableEntry::Ipv4MulticastRoutingTableEntry
Ipv4MulticastRoutingTableEntry()
This constructor does nothing.
Definition:
ipv4-routing-table-entry.cc:252
ns3::Ipv4MulticastRoutingTableEntry::CreateMulticastRoute
static Ipv4MulticastRoutingTableEntry CreateMulticastRoute(Ipv4Address origin, Ipv4Address group, uint32_t inputInterface, std::vector< uint32_t > outputInterfaces)
Definition:
ipv4-routing-table-entry.cc:336
ns3::Ipv4MulticastRoutingTableEntry::GetNOutputInterfaces
uint32_t GetNOutputInterfaces() const
Definition:
ipv4-routing-table-entry.cc:312
ns3::Ipv4MulticastRoutingTableEntry::GetInputInterface
uint32_t GetInputInterface() const
Definition:
ipv4-routing-table-entry.cc:305
ns3::Ipv4MulticastRoutingTableEntry::m_inputInterface
uint32_t m_inputInterface
input interface
Definition:
ipv4-routing-table-entry.h:269
ns3::Ipv4RoutingTableEntry
A record of an IPv4 routing table entry for Ipv4GlobalRouting and Ipv4StaticRouting.
Definition:
ipv4-routing-table-entry.h:38
ns3::Ipv4RoutingTableEntry::GetDest
Ipv4Address GetDest() const
Definition:
ipv4-routing-table-entry.cc:106
ns3::Ipv4RoutingTableEntry::GetGateway
Ipv4Address GetGateway() const
Definition:
ipv4-routing-table-entry.cc:148
ns3::Ipv4RoutingTableEntry::CreateDefaultRoute
static Ipv4RoutingTableEntry CreateDefaultRoute(Ipv4Address nextHop, uint32_t interface)
Definition:
ipv4-routing-table-entry.cc:195
ns3::Ipv4RoutingTableEntry::IsHost
bool IsHost() const
Definition:
ipv4-routing-table-entry.cc:99
ns3::Ipv4RoutingTableEntry::m_dest
Ipv4Address m_dest
destination address
Definition:
ipv4-routing-table-entry.h:169
ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry
Ipv4RoutingTableEntry()
This constructor does nothing.
Definition:
ipv4-routing-table-entry.cc:34
ns3::Ipv4RoutingTableEntry::IsNetwork
bool IsNetwork() const
Definition:
ipv4-routing-table-entry.cc:113
ns3::Ipv4RoutingTableEntry::m_interface
uint32_t m_interface
output interface
Definition:
ipv4-routing-table-entry.h:172
ns3::Ipv4RoutingTableEntry::IsGateway
bool IsGateway() const
Definition:
ipv4-routing-table-entry.cc:141
ns3::Ipv4RoutingTableEntry::m_destNetworkMask
Ipv4Mask m_destNetworkMask
destination network mask
Definition:
ipv4-routing-table-entry.h:170
ns3::Ipv4RoutingTableEntry::GetDestNetwork
Ipv4Address GetDestNetwork() const
Definition:
ipv4-routing-table-entry.cc:127
ns3::Ipv4RoutingTableEntry::GetInterface
uint32_t GetInterface() const
Definition:
ipv4-routing-table-entry.cc:155
ns3::Ipv4RoutingTableEntry::m_gateway
Ipv4Address m_gateway
gateway
Definition:
ipv4-routing-table-entry.h:171
ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo
static Ipv4RoutingTableEntry CreateNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface)
Definition:
ipv4-routing-table-entry.cc:176
ns3::Ipv4RoutingTableEntry::CreateHostRouteTo
static Ipv4RoutingTableEntry CreateHostRouteTo(Ipv4Address dest, Ipv4Address nextHop, uint32_t interface)
Definition:
ipv4-routing-table-entry.cc:162
ns3::Ipv4RoutingTableEntry::IsDefault
bool IsDefault() const
Definition:
ipv4-routing-table-entry.cc:120
ns3::Ipv4RoutingTableEntry::GetDestNetworkMask
Ipv4Mask GetDestNetworkMask() const
Definition:
ipv4-routing-table-entry.cc:134
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator==
bool operator==(const EventId &a, const EventId &b)
Definition:
event-id.h:157
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:129
src
internet
model
ipv4-routing-table-entry.h
Generated on Sun Jul 2 2023 18:21:39 for ns-3 by
1.9.6