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-interface.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2005,2006,2007 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
* Authors:
19
* Mathieu Lacage <mathieu.lacage@sophia.inria.fr>,
20
* Tom Henderson <tomh@tomh.org>
21
*/
22
#ifndef IPV4_INTERFACE_H
23
#define IPV4_INTERFACE_H
24
25
#include <list>
26
#include "ns3/ipv4-address.h"
27
#include "ns3/ipv4-interface-address.h"
28
#include "ns3/ptr.h"
29
#include "ns3/object.h"
30
31
namespace
ns3 {
32
33
class
NetDevice;
34
class
Packet;
35
class
Node;
36
class
ArpCache;
37
49
class
Ipv4Interface
:
public
Object
50
{
51
public
:
52
static
TypeId
GetTypeId
(
void
);
53
54
Ipv4Interface
();
55
virtual
~Ipv4Interface
();
56
57
void
SetNode
(
Ptr<Node>
node);
58
void
SetDevice
(
Ptr<NetDevice>
device);
59
void
SetArpCache
(
Ptr<ArpCache>
);
60
64
Ptr<NetDevice>
GetDevice
(
void
)
const
;
68
Ptr<ArpCache>
GetArpCache
()
const
;
69
77
void
SetMetric
(uint16_t metric);
78
86
uint16_t
GetMetric
(
void
)
const
;
87
96
bool
IsUp
(
void
)
const
;
97
101
bool
IsDown
(
void
)
const
;
102
106
void
SetUp
(
void
);
107
111
void
SetDown
(
void
);
112
116
bool
IsForwarding
(
void
)
const
;
117
121
void
SetForwarding
(
bool
val);
122
130
void
Send
(
Ptr<Packet>
p,
Ipv4Address
dest);
131
136
bool
AddAddress
(
Ipv4InterfaceAddress
address
);
137
142
Ipv4InterfaceAddress
GetAddress
(uint32_t index)
const
;
143
147
uint32_t
GetNAddresses
(
void
)
const
;
148
153
Ipv4InterfaceAddress
RemoveAddress
(uint32_t index);
154
162
Ipv4InterfaceAddress
RemoveAddress
(
Ipv4Address
address);
163
164
protected
:
165
virtual
void
DoDispose
(
void
);
166
private
:
167
void
DoSetup
(
void
);
168
typedef
std::list<Ipv4InterfaceAddress>
Ipv4InterfaceAddressList
;
169
typedef
std::list<Ipv4InterfaceAddress>::const_iterator
Ipv4InterfaceAddressListCI
;
170
typedef
std::list<Ipv4InterfaceAddress>::iterator
Ipv4InterfaceAddressListI
;
171
172
bool
m_ifup
;
173
bool
m_forwarding
;
// IN_DEV_FORWARD
174
uint16_t
m_metric
;
175
Ipv4InterfaceAddressList
m_ifaddrs
;
176
Ptr<Node>
m_node
;
177
Ptr<NetDevice>
m_device
;
178
Ptr<ArpCache>
m_cache
;
179
};
180
181
}
// namespace ns3
182
183
#endif
ns3::Ipv4Interface::SetDown
void SetDown(void)
Definition:
ipv4-interface.cc:179
ns3::Ipv4Interface::SetForwarding
void SetForwarding(bool val)
Definition:
ipv4-interface.cc:193
ns3::Ipv4Interface::Ipv4Interface
Ipv4Interface()
Definition:
ipv4-interface.cc:60
ns3::Ptr< Node >
ns3::Ipv4Interface::Send
void Send(Ptr< Packet > p, Ipv4Address dest)
Definition:
ipv4-interface.cc:200
ns3::Ipv4Interface
The IPv4 representation of a network interface.
Definition:
ipv4-interface.h:49
ns3::Ipv4Interface::GetArpCache
Ptr< ArpCache > GetArpCache() const
Definition:
ipv4-interface.cc:146
ns3::Ipv4Interface::RemoveAddress
Ipv4InterfaceAddress RemoveAddress(uint32_t index)
Definition:
ipv4-interface.cc:324
ns3::Ipv4Interface::AddAddress
bool AddAddress(Ipv4InterfaceAddress address)
Definition:
ipv4-interface.cc:295
ns3::Ipv4Interface::m_device
Ptr< NetDevice > m_device
Definition:
ipv4-interface.h:177
ns3::Ipv4Interface::m_cache
Ptr< ArpCache > m_cache
Definition:
ipv4-interface.h:178
ns3::Ipv4Interface::SetNode
void SetNode(Ptr< Node > node)
Definition:
ipv4-interface.cc:86
ns3::Ipv4Interface::Ipv4InterfaceAddressListCI
std::list< Ipv4InterfaceAddress >::const_iterator Ipv4InterfaceAddressListCI
Definition:
ipv4-interface.h:169
ns3::Ipv4Interface::m_forwarding
bool m_forwarding
Definition:
ipv4-interface.h:173
ns3::Ipv4Interface::GetTypeId
static TypeId GetTypeId(void)
Definition:
ipv4-interface.cc:40
ns3::Ipv4Interface::Ipv4InterfaceAddressList
std::list< Ipv4InterfaceAddress > Ipv4InterfaceAddressList
Definition:
ipv4-interface.h:168
ns3::Ipv4Interface::SetDevice
void SetDevice(Ptr< NetDevice > device)
Definition:
ipv4-interface.cc:94
ns3::Ipv4Interface::m_ifaddrs
Ipv4InterfaceAddressList m_ifaddrs
Definition:
ipv4-interface.h:175
ns3::Ipv4Interface::GetAddress
Ipv4InterfaceAddress GetAddress(uint32_t index) const
Definition:
ipv4-interface.cc:303
ns3::Ipv4Interface::~Ipv4Interface
virtual ~Ipv4Interface()
Definition:
ipv4-interface.cc:71
ns3::Ipv4Interface::IsDown
bool IsDown(void) const
Definition:
ipv4-interface.cc:165
ns3::Ipv4Interface::Ipv4InterfaceAddressListI
std::list< Ipv4InterfaceAddress >::iterator Ipv4InterfaceAddressListI
Definition:
ipv4-interface.h:170
ns3::Ipv4Interface::SetArpCache
void SetArpCache(Ptr< ArpCache >)
Definition:
ipv4-interface.cc:139
ns3::Ipv4Interface::m_node
Ptr< Node > m_node
Definition:
ipv4-interface.h:176
ns3::Ipv4Interface::GetMetric
uint16_t GetMetric(void) const
Definition:
ipv4-interface.cc:132
ns3::Ipv4Interface::m_metric
uint16_t m_metric
Definition:
ipv4-interface.h:174
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:38
ns3::Ipv4InterfaceAddress
a class to store IPv4 address information on an interface
Definition:
ipv4-interface-address.h:42
ns3::Ipv4Interface::GetDevice
Ptr< NetDevice > GetDevice(void) const
Definition:
ipv4-interface.cc:118
ns3::Ipv4Interface::m_ifup
bool m_ifup
Definition:
ipv4-interface.h:172
ns3::Ipv4Interface::SetMetric
void SetMetric(uint16_t metric)
Definition:
ipv4-interface.cc:125
ns3::Object
a base class which provides memory management and object aggregation
Definition:
object.h:63
first.address
tuple address
Definition:
first.py:37
ns3::Ipv4Interface::DoSetup
void DoSetup(void)
Definition:
ipv4-interface.cc:102
ns3::Ipv4Interface::DoDispose
virtual void DoDispose(void)
Definition:
ipv4-interface.cc:77
ns3::Ipv4Interface::GetNAddresses
uint32_t GetNAddresses(void) const
Definition:
ipv4-interface.cc:288
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::Ipv4Interface::IsForwarding
bool IsForwarding(void) const
Definition:
ipv4-interface.cc:186
ns3::Ipv4Interface::IsUp
bool IsUp(void) const
Definition:
ipv4-interface.cc:158
ns3::Ipv4Interface::SetUp
void SetUp(void)
Definition:
ipv4-interface.cc:172
src
internet
model
ipv4-interface.h
Generated on Sat Nov 16 2013 16:17:41 for ns-3 by
1.8.5