A Discrete-Event Network Simulator
API
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 #include "ns3/warnings.h"
27 
28 namespace ns3
29 {
30 
32 
34 
35 TypeId
37 {
39  static TypeId tid =
40  TypeId("ns3::Ipv4")
41  .SetParent<Object>()
42  .SetGroupName("Internet")
43  .AddAttribute(
44  "IpForward",
45  "Globally enable or disable IP forwarding for all current and future Ipv4 devices.",
46  BooleanValue(true),
49  .AddAttribute("WeakEsModel",
50  "RFC1122 term for whether host accepts datagram with a dest. address on "
51  "another interface",
52  BooleanValue(true),
56  "DEPRECATED since ns-3.41. Use the StrongEndSystemModel attribute.")
57  .AddAttribute(
58  "StrongEndSystemModel",
59  "Reject packets for an address not configured on the interface they're "
60  "coming from (RFC1122, section 3.3.4.2).",
61  BooleanValue(false),
64 #if 0
65  .AddAttribute ("MtuDiscover", "If enabled, every outgoing ip packet will have the DF flag set.",
66  BooleanValue (false),
70 #endif
71  ;
73  return tid;
74 }
75 
77 {
78  NS_LOG_FUNCTION(this);
79 }
80 
82 {
83  NS_LOG_FUNCTION(this);
84 }
85 
86 } // namespace ns3
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:76
virtual void SetWeakEsModel(bool model)=0
Set or unset the Weak Es Model.
virtual bool GetWeakEsModel() const =0
Get the Weak Es Model status.
static TypeId GetTypeId()
Get the type ID.
Definition: ipv4.cc:36
~Ipv4() override
Definition: ipv4.cc:81
A base class which provides memory management and object aggregation.
Definition: object.h:89
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:931
@ DEPRECATED
Attribute or trace source is deprecated; user is warned.
Definition: type-id.h:75
virtual bool GetMtuDiscover() const =0
Get the MTU discover capability.
virtual void SetMtuDiscover(bool discover)=0
Set the MTU discover capability.
#define NS_WARNING_POP
Pops the diagnostic warning list from the stack, restoring it to the previous state.
Definition: warnings.h:78
#define NS_WARNING_PUSH_DEPRECATED
Save the current warning list and disables the ones about deprecated functions and classes.
Definition: warnings.h:82
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#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:46
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition: boolean.cc:124
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition: boolean.h:86