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-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
:
138
Ipv4RoutingTableEntry
(
Ipv4Address
network,
139
Ipv4Mask
mask,
140
Ipv4Address
gateway,
141
uint32_t interface);
142
Ipv4RoutingTableEntry
(
Ipv4Address
dest,
143
Ipv4Mask
mask,
144
uint32_t interface);
145
Ipv4RoutingTableEntry
(
Ipv4Address
dest,
146
Ipv4Address
gateway,
147
uint32_t interface);
148
Ipv4RoutingTableEntry
(
Ipv4Address
dest,
149
uint32_t interface);
150
151
Ipv4Address
m_dest
;
152
Ipv4Mask
m_destNetworkMask
;
153
Ipv4Address
m_gateway
;
154
uint32_t
m_interface
;
155
};
156
157
std::ostream&
operator<<
(std::ostream& os,
Ipv4RoutingTableEntry
const
& route);
158
164
class
Ipv4MulticastRoutingTableEntry
{
165
public
:
169
Ipv4MulticastRoutingTableEntry
();
170
175
Ipv4MulticastRoutingTableEntry
(
Ipv4MulticastRoutingTableEntry
const
&route);
180
Ipv4MulticastRoutingTableEntry
(
Ipv4MulticastRoutingTableEntry
const
*route);
184
Ipv4Address
GetOrigin
(
void
)
const
;
188
Ipv4Address
GetGroup
(
void
)
const
;
192
uint32_t
GetInputInterface
(
void
)
const
;
196
uint32_t
GetNOutputInterfaces
(
void
)
const
;
201
uint32_t
GetOutputInterface
(uint32_t n)
const
;
205
std::vector<uint32_t>
GetOutputInterfaces
(
void
)
const
;
213
static
Ipv4MulticastRoutingTableEntry
CreateMulticastRoute
(
Ipv4Address
origin,
214
Ipv4Address
group
, uint32_t inputInterface,
215
std::vector<uint32_t> outputInterfaces);
216
217
private
:
218
Ipv4MulticastRoutingTableEntry
(
Ipv4Address
origin,
Ipv4Address
group,
219
uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
220
221
Ipv4Address
m_origin
;
222
Ipv4Address
m_group
;
223
uint32_t
m_inputInterface
;
224
std::vector<uint32_t>
m_outputInterfaces
;
225
};
226
227
std::ostream&
operator<<
(std::ostream& os,
Ipv4MulticastRoutingTableEntry
const
& route);
228
229
}
// namespace ns3
230
231
#endif
/* IPV4_ROUTING_TABLE_ENTRY_H */
src
internet
model
ipv4-routing-table-entry.h
Generated on Tue Oct 9 2012 16:45:38 for ns-3 by
1.8.1.2