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
ipv6-option-demux.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007-2009 Strasbourg University
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: David Gross <gdavid.devel@gmail.com>
7
*/
8
9
#include "
ipv6-option-demux.h
"
10
11
#include "
ipv6-option.h
"
12
13
#include "ns3/node.h"
14
#include "ns3/object-vector.h"
15
#include "ns3/ptr.h"
16
17
#include <sstream>
18
19
namespace
ns3
20
{
21
22
NS_OBJECT_ENSURE_REGISTERED
(Ipv6OptionDemux);
23
24
TypeId
25
Ipv6OptionDemux::GetTypeId
()
26
{
27
static
TypeId
tid =
TypeId
(
"ns3::Ipv6OptionDemux"
)
28
.
SetParent
<
Object
>()
29
.SetGroupName(
"Internet"
)
30
.AddAttribute(
"Options"
,
31
"The set of IPv6 options registered with this demux."
,
32
ObjectVectorValue
(),
33
MakeObjectVectorAccessor
(&
Ipv6OptionDemux::m_options
),
34
MakeObjectVectorChecker<Ipv6Option>
());
35
return
tid;
36
}
37
38
Ipv6OptionDemux::Ipv6OptionDemux
()
39
{
40
}
41
42
Ipv6OptionDemux::~Ipv6OptionDemux
()
43
{
44
}
45
46
void
47
Ipv6OptionDemux::DoDispose
()
48
{
49
for
(
auto
it =
m_options
.begin(); it !=
m_options
.end(); it++)
50
{
51
(*it)->Dispose();
52
*it =
nullptr
;
53
}
54
m_options
.clear();
55
m_node
=
nullptr
;
56
Object::DoDispose
();
57
}
58
59
void
60
Ipv6OptionDemux::SetNode
(
Ptr<Node>
node)
61
{
62
m_node
= node;
63
}
64
65
void
66
Ipv6OptionDemux::Insert
(
Ptr<Ipv6Option>
option)
67
{
68
m_options
.push_back(option);
69
}
70
71
Ptr<Ipv6Option>
72
Ipv6OptionDemux::GetOption
(
int
optionNumber)
73
{
74
for
(
auto
i =
m_options
.begin(); i !=
m_options
.end(); ++i)
75
{
76
if
((*i)->GetOptionNumber() == optionNumber)
77
{
78
return
*i;
79
}
80
}
81
return
nullptr
;
82
}
83
84
void
85
Ipv6OptionDemux::Remove
(
Ptr<Ipv6Option>
option)
86
{
87
m_options
.remove(option);
88
}
89
90
}
/* namespace ns3 */
ns3::Ipv6OptionDemux::Ipv6OptionDemux
Ipv6OptionDemux()
Constructor.
Definition
ipv6-option-demux.cc:38
ns3::Ipv6OptionDemux::Insert
void Insert(Ptr< Ipv6Option > option)
Insert a new IPv6 Option.
Definition
ipv6-option-demux.cc:66
ns3::Ipv6OptionDemux::m_node
Ptr< Node > m_node
The node.
Definition
ipv6-option-demux.h:92
ns3::Ipv6OptionDemux::SetNode
void SetNode(Ptr< Node > node)
Set the node.
Definition
ipv6-option-demux.cc:60
ns3::Ipv6OptionDemux::GetTypeId
static TypeId GetTypeId()
The interface ID.
Definition
ipv6-option-demux.cc:25
ns3::Ipv6OptionDemux::~Ipv6OptionDemux
~Ipv6OptionDemux() override
Destructor.
Definition
ipv6-option-demux.cc:42
ns3::Ipv6OptionDemux::Remove
void Remove(Ptr< Ipv6Option > option)
Remove an option from this demux.
Definition
ipv6-option-demux.cc:85
ns3::Ipv6OptionDemux::m_options
Ipv6OptionList_t m_options
List of IPv6 Options supported.
Definition
ipv6-option-demux.h:87
ns3::Ipv6OptionDemux::DoDispose
void DoDispose() override
Dispose this object.
Definition
ipv6-option-demux.cc:47
ns3::Ipv6OptionDemux::GetOption
Ptr< Ipv6Option > GetOption(int optionNumber)
Get the option corresponding to optionNumber.
Definition
ipv6-option-demux.cc:72
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Object::DoDispose
virtual void DoDispose()
Destructor implementation.
Definition
object.cc:433
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ipv6-option-demux.h
ipv6-option.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MakeObjectVectorChecker
Ptr< const AttributeChecker > MakeObjectVectorChecker()
Definition
object-vector.h:110
ns3::ObjectVectorValue
ObjectPtrContainerValue ObjectVectorValue
ObjectVectorValue is an alias for ObjectPtrContainerValue.
Definition
object-vector.h:29
ns3::MakeObjectVectorAccessor
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition
object-vector.h:65
src
internet
model
ipv6-option-demux.cc
Generated on Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0