A Discrete-Event Network Simulator
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
17namespace ns3
18{
19
21
23
24TypeId
26{
28 static TypeId tid =
29 TypeId("ns3::Ipv4")
31 .SetGroupName("Internet")
32 .AddAttribute(
33 "IpForward",
34 "Globally enable or disable IP forwarding for all current and future Ipv4 devices.",
35 BooleanValue(true),
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),
45#if 0
46 .AddAttribute ("MtuDiscover", "If enabled, every outgoing ip packet will have the DF flag set.",
47 BooleanValue (false),
51#endif
52 ;
54 return tid;
55}
56
58{
59 NS_LOG_FUNCTION(this);
60}
61
63{
64 NS_LOG_FUNCTION(this);
65}
66
67} // namespace ns3
AttributeValue implementation for Boolean.
Definition boolean.h:26
virtual bool GetIpForward() const =0
Get the IP forwarding state.
virtual bool GetStrongEndSystemModel() const =0
Get the Strong End System Model status.
virtual void SetIpForward(bool forward)=0
Set or unset the IP forwarding state.
virtual void SetStrongEndSystemModel(bool model)=0
Set or unset the Strong End System Model.
Ipv4()
Definition ipv4.cc:57
static TypeId GetTypeId()
Get the type ID.
Definition ipv4.cc:25
~Ipv4() override
Definition ipv4.cc:62
A base class which provides memory management and object aggregation.
Definition object.h:78
a unique identifier for an interface.
Definition type-id.h:49
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
virtual bool GetMtuDiscover() const =0
Get the MTU discover capability.
virtual void SetMtuDiscover(bool discover)=0
Set the MTU discover capability.
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition boolean.h:70
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
#define NS_WARNING_POP
Pops the diagnostic warning list from the stack, restoring it to the previous state.
Definition warnings.h:102
#define NS_WARNING_PUSH_DEPRECATED
Save the current warning list and disables the ones about deprecated functions and classes.
Definition warnings.h:114
Every class exported by the ns3 library is enclosed in the ns3 namespace.