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-extension-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-extension-demux.h
"
10
11
#include "
ipv6-extension.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
(Ipv6ExtensionDemux);
23
24
TypeId
25
Ipv6ExtensionDemux::GetTypeId
()
26
{
27
static
TypeId
tid =
28
TypeId
(
"ns3::Ipv6ExtensionDemux"
)
29
.
SetParent
<
Object
>()
30
.SetGroupName(
"Internet"
)
31
.AddAttribute(
"Extensions"
,
32
"The set of IPv6 extensions registered with this demux."
,
33
ObjectVectorValue
(),
34
MakeObjectVectorAccessor
(&
Ipv6ExtensionDemux::m_extensions
),
35
MakeObjectVectorChecker<Ipv6Extension>
());
36
return
tid;
37
}
38
39
Ipv6ExtensionDemux::Ipv6ExtensionDemux
()
40
{
41
}
42
43
Ipv6ExtensionDemux::~Ipv6ExtensionDemux
()
44
{
45
}
46
47
void
48
Ipv6ExtensionDemux::DoDispose
()
49
{
50
for
(
auto
it =
m_extensions
.begin(); it !=
m_extensions
.end(); it++)
51
{
52
(*it)->Dispose();
53
*it =
nullptr
;
54
}
55
m_extensions
.clear();
56
m_node
=
nullptr
;
57
Object::DoDispose
();
58
}
59
60
void
61
Ipv6ExtensionDemux::SetNode
(
Ptr<Node>
node)
62
{
63
m_node
= node;
64
}
65
66
void
67
Ipv6ExtensionDemux::Insert
(
Ptr<Ipv6Extension>
extension)
68
{
69
m_extensions
.push_back(extension);
70
}
71
72
Ptr<Ipv6Extension>
73
Ipv6ExtensionDemux::GetExtension
(uint8_t extensionNumber)
74
{
75
for
(
auto
i =
m_extensions
.begin(); i !=
m_extensions
.end(); ++i)
76
{
77
if
((*i)->GetExtensionNumber() == extensionNumber)
78
{
79
return
*i;
80
}
81
}
82
return
nullptr
;
83
}
84
85
void
86
Ipv6ExtensionDemux::Remove
(
Ptr<Ipv6Extension>
extension)
87
{
88
m_extensions
.remove(extension);
89
}
90
91
}
/* namespace ns3 */
ns3::Ipv6ExtensionDemux::Ipv6ExtensionDemux
Ipv6ExtensionDemux()
Constructor.
Definition
ipv6-extension-demux.cc:39
ns3::Ipv6ExtensionDemux::m_extensions
Ipv6ExtensionList_t m_extensions
List of IPv6 Extensions supported.
Definition
ipv6-extension-demux.h:87
ns3::Ipv6ExtensionDemux::SetNode
void SetNode(Ptr< Node > node)
Set the node.
Definition
ipv6-extension-demux.cc:61
ns3::Ipv6ExtensionDemux::DoDispose
void DoDispose() override
Dispose object.
Definition
ipv6-extension-demux.cc:48
ns3::Ipv6ExtensionDemux::GetTypeId
static TypeId GetTypeId()
The interface ID.
Definition
ipv6-extension-demux.cc:25
ns3::Ipv6ExtensionDemux::~Ipv6ExtensionDemux
~Ipv6ExtensionDemux() override
Destructor.
Definition
ipv6-extension-demux.cc:43
ns3::Ipv6ExtensionDemux::m_node
Ptr< Node > m_node
The node.
Definition
ipv6-extension-demux.h:92
ns3::Ipv6ExtensionDemux::Remove
void Remove(Ptr< Ipv6Extension > extension)
Remove an extension from this demux.
Definition
ipv6-extension-demux.cc:86
ns3::Ipv6ExtensionDemux::GetExtension
Ptr< Ipv6Extension > GetExtension(uint8_t extensionNumber)
Get the extension corresponding to extensionNumber.
Definition
ipv6-extension-demux.cc:73
ns3::Ipv6ExtensionDemux::Insert
void Insert(Ptr< Ipv6Extension > extension)
Insert a new IPv6 Extension.
Definition
ipv6-extension-demux.cc:67
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-extension-demux.h
ipv6-extension.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-extension-demux.cc
Generated on Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0