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
src
internet
model
ipv4-interface.h
Generated on Fri Aug 30 2013 01:42:51 for ns-3 by
1.8.1.2