A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
internet
model
ipv4-routing-table-entry.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2005 INRIA
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
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
#ifndef IPV4_ROUTING_TABLE_ENTRY_H
21
#define IPV4_ROUTING_TABLE_ENTRY_H
22
23
#include <list>
24
#include <vector>
25
#include <ostream>
26
27
#include "ns3/ipv4-address.h"
28
29
namespace
ns3
{
30
37
class
Ipv4RoutingTableEntry
{
38
public
:
42
Ipv4RoutingTableEntry
();
47
Ipv4RoutingTableEntry
(
Ipv4RoutingTableEntry
const
&route);
52
Ipv4RoutingTableEntry
(
Ipv4RoutingTableEntry
const
*route);
56
bool
IsHost
(
void
)
const
;
62
bool
IsNetwork
(
void
)
const
;
66
bool
IsDefault
(
void
)
const
;
70
bool
IsGateway
(
void
)
const
;
74
Ipv4Address
GetGateway
(
void
)
const
;
78
Ipv4Address
GetDest
(
void
)
const
;
82
Ipv4Address
GetDestNetwork
(
void
)
const
;
86
Ipv4Mask
GetDestNetworkMask
(
void
)
const
;
90
uint32_t
GetInterface
(
void
)
const
;
97
static
Ipv4RoutingTableEntry
CreateHostRouteTo
(
Ipv4Address
dest,
98
Ipv4Address
nextHop,
99
uint32_t interface);
105
static
Ipv4RoutingTableEntry
CreateHostRouteTo
(
Ipv4Address
dest,
106
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,
135
uint32_t interface);
136
137
private
:
145
Ipv4RoutingTableEntry
(
Ipv4Address
network,
146
Ipv4Mask
mask,
147
Ipv4Address
gateway,
148
uint32_t interface);
155
Ipv4RoutingTableEntry
(
Ipv4Address
dest,
156
Ipv4Mask
mask,
157
uint32_t interface);
164
Ipv4RoutingTableEntry
(
Ipv4Address
dest,
165
Ipv4Address
gateway,
166
uint32_t interface);
172
Ipv4RoutingTableEntry
(
Ipv4Address
dest,
173
uint32_t interface);
174
175
Ipv4Address
m_dest
;
176
Ipv4Mask
m_destNetworkMask
;
177
Ipv4Address
m_gateway
;
178
uint32_t
m_interface
;
179
};
180
188
std::ostream&
operator<<
(std::ostream& os,
Ipv4RoutingTableEntry
const
& route);
189
197
bool
operator==
(
const
Ipv4RoutingTableEntry
a,
const
Ipv4RoutingTableEntry
b);
198
204
class
Ipv4MulticastRoutingTableEntry
{
205
public
:
209
Ipv4MulticastRoutingTableEntry
();
210
215
Ipv4MulticastRoutingTableEntry
(
Ipv4MulticastRoutingTableEntry
const
&route);
220
Ipv4MulticastRoutingTableEntry
(
Ipv4MulticastRoutingTableEntry
const
*route);
224
Ipv4Address
GetOrigin
(
void
)
const
;
228
Ipv4Address
GetGroup
(
void
)
const
;
232
uint32_t
GetInputInterface
(
void
)
const
;
236
uint32_t
GetNOutputInterfaces
(
void
)
const
;
241
uint32_t
GetOutputInterface
(uint32_t
n
)
const
;
245
std::vector<uint32_t>
GetOutputInterfaces
(
void
)
const
;
253
static
Ipv4MulticastRoutingTableEntry
CreateMulticastRoute
(
Ipv4Address
origin,
254
Ipv4Address
group, uint32_t inputInterface,
255
std::vector<uint32_t> outputInterfaces);
256
257
private
:
265
Ipv4MulticastRoutingTableEntry
(
Ipv4Address
origin,
Ipv4Address
group,
266
uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
267
268
Ipv4Address
m_origin
;
269
Ipv4Address
m_group
;
270
uint32_t
m_inputInterface
;
271
std::vector<uint32_t>
m_outputInterfaces
;
272
};
273
281
std::ostream&
operator<<
(std::ostream& os,
Ipv4MulticastRoutingTableEntry
const
& route);
282
290
bool
operator==
(
const
Ipv4MulticastRoutingTableEntry
a,
const
Ipv4MulticastRoutingTableEntry
b);
291
292
}
// namespace ns3
293
294
#endif
/* IPV4_ROUTING_TABLE_ENTRY_H */
ns3::Ipv4MulticastRoutingTableEntry::GetOutputInterface
uint32_t GetOutputInterface(uint32_t n) const
Definition:
ipv4-routing-table-entry.cc:337
ns3::Ipv4MulticastRoutingTableEntry::m_origin
Ipv4Address m_origin
source address
Definition:
ipv4-routing-table-entry.h:268
ns3::Ipv4MulticastRoutingTableEntry::m_inputInterface
uint32_t m_inputInterface
input interface
Definition:
ipv4-routing-table-entry.h:270
ns3::Ipv4Mask
a class to represent an Ipv4 address mask
Definition:
ipv4-address.h:258
ns3::Ipv4RoutingTableEntry::IsNetwork
bool IsNetwork(void) const
Definition:
ipv4-routing-table-entry.cc:115
ns3::Ipv4RoutingTableEntry::GetDest
Ipv4Address GetDest(void) const
Definition:
ipv4-routing-table-entry.cc:109
ns3::Ipv4RoutingTableEntry::GetDestNetwork
Ipv4Address GetDestNetwork(void) const
Definition:
ipv4-routing-table-entry.cc:134
ns3::Ipv4RoutingTableEntry::GetGateway
Ipv4Address GetGateway(void) const
Definition:
ipv4-routing-table-entry.cc:159
ns3::Ipv4RoutingTableEntry::m_interface
uint32_t m_interface
output interface
Definition:
ipv4-routing-table-entry.h:178
ns3::Ipv4MulticastRoutingTableEntry::CreateMulticastRoute
static Ipv4MulticastRoutingTableEntry CreateMulticastRoute(Ipv4Address origin, Ipv4Address group, uint32_t inputInterface, std::vector< uint32_t > outputInterfaces)
Definition:
ipv4-routing-table-entry.cc:354
ns3::Ipv4MulticastRoutingTableEntry::m_group
Ipv4Address m_group
destination address
Definition:
ipv4-routing-table-entry.h:269
ns3::Ipv4RoutingTableEntry::IsDefault
bool IsDefault(void) const
Definition:
ipv4-routing-table-entry.cc:121
ns3::Ipv4RoutingTableEntry::GetDestNetworkMask
Ipv4Mask GetDestNetworkMask(void) const
Definition:
ipv4-routing-table-entry.cc:140
ns3::Ipv4RoutingTableEntry
A record of an IPv4 routing table entry for Ipv4GlobalRouting and Ipv4StaticRouting.
Definition:
ipv4-routing-table-entry.h:37
sample-rng-plot.n
n
Definition:
sample-rng-plot.py:37
ns3::Ipv4MulticastRoutingTableEntry::GetGroup
Ipv4Address GetGroup(void) const
Definition:
ipv4-routing-table-entry.cc:316
ns3::Ipv4RoutingTableEntry::IsHost
bool IsHost(void) const
Definition:
ipv4-routing-table-entry.cc:96
ns3::Ipv4RoutingTableEntry::CreateHostRouteTo
static Ipv4RoutingTableEntry CreateHostRouteTo(Ipv4Address dest, Ipv4Address nextHop, uint32_t interface)
Definition:
ipv4-routing-table-entry.cc:172
ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo
static Ipv4RoutingTableEntry CreateNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface)
Definition:
ipv4-routing-table-entry.cc:187
ns3::Ipv4MulticastRoutingTableEntry::m_outputInterfaces
std::vector< uint32_t > m_outputInterfaces
output interfaces
Definition:
ipv4-routing-table-entry.h:271
ns3::Ipv4MulticastRoutingTableEntry::GetOutputInterfaces
std::vector< uint32_t > GetOutputInterfaces(void) const
Definition:
ipv4-routing-table-entry.cc:347
ns3::Ipv4MulticastRoutingTableEntry::GetInputInterface
uint32_t GetInputInterface(void) const
Definition:
ipv4-routing-table-entry.cc:323
ns3::Ipv4MulticastRoutingTableEntry::GetNOutputInterfaces
uint32_t GetNOutputInterfaces(void) const
Definition:
ipv4-routing-table-entry.cc:330
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition:
angles.cc:42
ns3::Ipv4RoutingTableEntry::m_gateway
Ipv4Address m_gateway
gateway
Definition:
ipv4-routing-table-entry.h:177
ns3::Ipv4MulticastRoutingTableEntry::Ipv4MulticastRoutingTableEntry
Ipv4MulticastRoutingTableEntry()
This constructor does nothing.
Definition:
ipv4-routing-table-entry.cc:270
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Ipv4RoutingTableEntry::GetInterface
uint32_t GetInterface(void) const
Definition:
ipv4-routing-table-entry.cc:165
ns3::Ipv4RoutingTableEntry::m_destNetworkMask
Ipv4Mask m_destNetworkMask
destination network mask
Definition:
ipv4-routing-table-entry.h:176
ns3::Ipv4RoutingTableEntry::CreateDefaultRoute
static Ipv4RoutingTableEntry CreateDefaultRoute(Ipv4Address nextHop, uint32_t interface)
Definition:
ipv4-routing-table-entry.cc:206
ns3::Ipv4MulticastRoutingTableEntry
A record of an IPv4 multicast route for Ipv4GlobalRouting and Ipv4StaticRouting.
Definition:
ipv4-routing-table-entry.h:204
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:40
ns3::Ipv4MulticastRoutingTableEntry::GetOrigin
Ipv4Address GetOrigin(void) const
Definition:
ipv4-routing-table-entry.cc:309
ns3::operator==
bool operator==(const EventId &a, const EventId &b)
Definition:
event-id.h:135
ns3::Ipv4RoutingTableEntry::IsGateway
bool IsGateway(void) const
Definition:
ipv4-routing-table-entry.cc:146
ns3::Ipv4RoutingTableEntry::m_dest
Ipv4Address m_dest
destination address
Definition:
ipv4-routing-table-entry.h:175
ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry
Ipv4RoutingTableEntry()
This constructor does nothing.
Definition:
ipv4-routing-table-entry.cc:33
Generated on Wed Nov 7 2018 10:01:54 for ns-3 by
1.8.14