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.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 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
20
#include "
ipv4.h
"
21
22
#include "ns3/assert.h"
23
#include "ns3/boolean.h"
24
#include "ns3/log.h"
25
#include "ns3/node.h"
26
27
namespace
ns3
28
{
29
30
NS_LOG_COMPONENT_DEFINE
(
"Ipv4"
);
31
32
NS_OBJECT_ENSURE_REGISTERED
(Ipv4);
33
34
TypeId
35
Ipv4::GetTypeId
()
36
{
37
static
TypeId
tid =
38
TypeId
(
"ns3::Ipv4"
)
39
.
SetParent
<
Object
>()
40
.SetGroupName(
"Internet"
)
41
.AddAttribute(
42
"IpForward"
,
43
"Globally enable or disable IP forwarding for all current and future Ipv4 devices."
,
44
BooleanValue
(
true
),
45
MakeBooleanAccessor
(&
Ipv4::SetIpForward
, &
Ipv4::GetIpForward
),
46
MakeBooleanChecker
())
47
.AddAttribute(
"WeakEsModel"
,
48
"RFC1122 term for whether host accepts datagram with a dest. address on "
49
"another interface"
,
50
BooleanValue
(
true
),
51
MakeBooleanAccessor
(&
Ipv4::SetWeakEsModel
, &
Ipv4::GetWeakEsModel
),
52
MakeBooleanChecker
())
53
#
if
0
54
.AddAttribute (
"MtuDiscover"
,
"If enabled, every outgoing ip packet will have the DF flag set."
,
55
BooleanValue
(
false
),
56
MakeBooleanAccessor
(&
UdpSocket::SetMtuDiscover
,
57
&
UdpSocket::GetMtuDiscover
),
58
MakeBooleanChecker
())
59
#endif
60
;
61
return
tid;
62
}
63
64
Ipv4::Ipv4
()
65
{
66
NS_LOG_FUNCTION
(
this
);
67
}
68
69
Ipv4::~Ipv4
()
70
{
71
NS_LOG_FUNCTION
(
this
);
72
}
73
74
}
// namespace ns3
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition:
boolean.h:37
ns3::Ipv4::GetIpForward
virtual bool GetIpForward() const =0
Get the IP forwarding state.
ns3::Ipv4::SetIpForward
virtual void SetIpForward(bool forward)=0
Set or unset the IP forwarding state.
ns3::Ipv4::Ipv4
Ipv4()
Definition:
ipv4.cc:64
ns3::Ipv4::SetWeakEsModel
virtual void SetWeakEsModel(bool model)=0
Set or unset the Weak Es Model.
ns3::Ipv4::GetWeakEsModel
virtual bool GetWeakEsModel() const =0
Get the Weak Es Model status.
ns3::Ipv4::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
ipv4.cc:35
ns3::Ipv4::~Ipv4
~Ipv4() override
Definition:
ipv4.cc:69
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:936
ns3::UdpSocket::GetMtuDiscover
virtual bool GetMtuDiscover() const =0
Get the MTU discover capability.
ns3::UdpSocket::SetMtuDiscover
virtual void SetMtuDiscover(bool discover)=0
Set the MTU discover capability.
ns3::MakeBooleanAccessor
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition:
boolean.h:86
ns3::MakeBooleanChecker
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition:
boolean.cc:124
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:202
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition:
log-macros-enabled.h:238
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:46
ipv4.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
model
ipv4.cc
Generated on Sun Jul 2 2023 18:21:40 for ns-3 by
1.9.6