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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
9
#include "
ipv4.h
"
10
11
#include "ns3/assert.h"
12
#include "ns3/boolean.h"
13
#include "ns3/log.h"
14
#include "ns3/node.h"
15
#include "ns3/warnings.h"
16
17
namespace
ns3
18
{
19
20
NS_LOG_COMPONENT_DEFINE
(
"Ipv4"
);
21
22
NS_OBJECT_ENSURE_REGISTERED
(
Ipv4
);
23
24
TypeId
25
Ipv4::GetTypeId
()
26
{
27
NS_WARNING_PUSH_DEPRECATED
;
28
static
TypeId
tid =
29
TypeId
(
"ns3::Ipv4"
)
30
.
SetParent
<
Object
>()
31
.SetGroupName(
"Internet"
)
32
.AddAttribute(
33
"IpForward"
,
34
"Globally enable or disable IP forwarding for all current and future Ipv4 devices."
,
35
BooleanValue
(
true
),
36
MakeBooleanAccessor
(&
Ipv4::SetIpForward
, &
Ipv4::GetIpForward
),
37
MakeBooleanChecker
())
38
.AddAttribute(
39
"StrongEndSystemModel"
,
40
"Reject packets for an address not configured on the interface they're "
41
"coming from (RFC1122, section 3.3.4.2)."
,
42
BooleanValue
(
false
),
43
MakeBooleanAccessor
(&
Ipv4::SetStrongEndSystemModel
, &
Ipv4::GetStrongEndSystemModel
),
44
MakeBooleanChecker
())
45
#if 0
46
.AddAttribute (
"MtuDiscover"
,
"If enabled, every outgoing ip packet will have the DF flag set."
,
47
BooleanValue
(
false
),
48
MakeBooleanAccessor
(&
UdpSocket::SetMtuDiscover
,
49
&
UdpSocket::GetMtuDiscover
),
50
MakeBooleanChecker
())
51
#endif
52
;
53
NS_WARNING_POP
;
54
return
tid;
55
}
56
57
Ipv4::Ipv4
()
58
{
59
NS_LOG_FUNCTION
(
this
);
60
}
61
62
Ipv4::~Ipv4
()
63
{
64
NS_LOG_FUNCTION
(
this
);
65
}
66
67
}
// namespace ns3
ns3::BooleanValue
Definition
boolean.h:26
ns3::Ipv4
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition
ipv4.h:69
ns3::Ipv4::GetIpForward
virtual bool GetIpForward() const =0
Get the IP forwarding state.
ns3::Ipv4::GetStrongEndSystemModel
virtual bool GetStrongEndSystemModel() const =0
Get the Strong End System Model status.
ns3::Ipv4::SetIpForward
virtual void SetIpForward(bool forward)=0
Set or unset the IP forwarding state.
ns3::Ipv4::SetStrongEndSystemModel
virtual void SetStrongEndSystemModel(bool model)=0
Set or unset the Strong End System Model.
ns3::Ipv4::Ipv4
Ipv4()
Definition
ipv4.cc:57
ns3::Ipv4::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
ipv4.cc:25
ns3::Ipv4::~Ipv4
~Ipv4() override
Definition
ipv4.cc:62
ns3::Object::Object
Object()
Constructor.
Definition
object.cc:96
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
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.
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
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:229
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
NS_WARNING_POP
#define NS_WARNING_POP
Pops the diagnostic warning list from the stack, restoring it to the previous state.
Definition
warnings.h:102
NS_WARNING_PUSH_DEPRECATED
#define NS_WARNING_PUSH_DEPRECATED
Save the current warning list and disables the ones about deprecated functions and classes.
Definition
warnings.h:114
ipv4.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MakeBooleanChecker
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition
boolean.cc:114
ns3::MakeBooleanAccessor
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition
boolean.h:70
src
internet
model
ipv4.cc
Generated on
for ns-3 by
1.15.0