A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
cs-parameters.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 INRIA, UDcast
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
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
18
*
19
*/
20
#include "
cs-parameters.h
"
21
22
#include "
wimax-tlv.h
"
23
24
namespace
ns3
25
{
26
CsParameters::CsParameters
()
27
{
28
m_classifierDscAction
=
CsParameters::ADD
;
29
}
30
31
CsParameters::~CsParameters
()
32
{
33
}
34
35
CsParameters::CsParameters
(
Tlv
tlv)
36
{
37
NS_ASSERT_MSG
(tlv.
GetType
() ==
SfVectorTlvValue::IPV4_CS_Parameters
,
"Invalid TLV"
);
38
CsParamVectorTlvValue
* param = ((
CsParamVectorTlvValue
*)(tlv.
PeekValue
()));
39
40
for
(
auto
iter = param->
Begin
(); iter != param->
End
(); ++iter)
41
{
42
switch
((*iter)->GetType())
43
{
44
case
CsParamVectorTlvValue::Classifier_DSC_Action
: {
45
m_classifierDscAction
=
46
(
CsParameters::Action
)((
U8TlvValue
*)((*iter)->PeekValue()))->GetValue();
47
break
;
48
}
49
case
CsParamVectorTlvValue::Packet_Classification_Rule
: {
50
m_packetClassifierRule
=
IpcsClassifierRecord
(*(*iter));
51
break
;
52
}
53
}
54
}
55
}
56
57
CsParameters::CsParameters
(
CsParameters::Action
classifierDscAction,
58
IpcsClassifierRecord
classifier)
59
{
60
m_classifierDscAction
= classifierDscAction;
61
m_packetClassifierRule
= classifier;
62
}
63
64
void
65
CsParameters::SetClassifierDscAction
(
CsParameters::Action
action
)
66
{
67
m_classifierDscAction
=
action
;
68
}
69
70
void
71
CsParameters::SetPacketClassifierRule
(
IpcsClassifierRecord
packetClassifierRule)
72
{
73
m_packetClassifierRule
= packetClassifierRule;
74
}
75
76
CsParameters::Action
77
CsParameters::GetClassifierDscAction
()
const
78
{
79
return
m_classifierDscAction
;
80
}
81
82
IpcsClassifierRecord
83
CsParameters::GetPacketClassifierRule
()
const
84
{
85
return
m_packetClassifierRule
;
86
}
87
88
Tlv
89
CsParameters::ToTlv
()
const
90
{
91
CsParamVectorTlvValue
tmp;
92
tmp.
Add
(
93
Tlv
(
CsParamVectorTlvValue::Classifier_DSC_Action
, 1,
U8TlvValue
(
m_classifierDscAction
)));
94
tmp.
Add
(
m_packetClassifierRule
.
ToTlv
());
95
return
Tlv
(
SfVectorTlvValue::IPV4_CS_Parameters
, tmp.
GetSerializedSize
(), tmp);
96
}
97
}
// namespace ns3
ns3::CsParamVectorTlvValue
this class implements the convergence sub-layer descriptor as a tlv vector
Definition:
wimax-tlv.h:385
ns3::CsParamVectorTlvValue::Packet_Classification_Rule
@ Packet_Classification_Rule
Definition:
wimax-tlv.h:391
ns3::CsParamVectorTlvValue::Classifier_DSC_Action
@ Classifier_DSC_Action
Definition:
wimax-tlv.h:390
ns3::CsParameters::SetClassifierDscAction
void SetClassifierDscAction(Action action)
sets the dynamic service classifier action to ADD, Change or delete.
Definition:
cs-parameters.cc:65
ns3::CsParameters::Action
Action
Action enumeration.
Definition:
cs-parameters.h:40
ns3::CsParameters::ADD
@ ADD
Definition:
cs-parameters.h:41
ns3::CsParameters::ToTlv
Tlv ToTlv() const
creates a tlv from the classifier record
Definition:
cs-parameters.cc:89
ns3::CsParameters::GetClassifierDscAction
Action GetClassifierDscAction() const
Definition:
cs-parameters.cc:77
ns3::CsParameters::GetPacketClassifierRule
IpcsClassifierRecord GetPacketClassifierRule() const
Definition:
cs-parameters.cc:83
ns3::CsParameters::m_classifierDscAction
Action m_classifierDscAction
classifier DSC action
Definition:
cs-parameters.h:85
ns3::CsParameters::m_packetClassifierRule
IpcsClassifierRecord m_packetClassifierRule
packet classifier rule
Definition:
cs-parameters.h:86
ns3::CsParameters::SetPacketClassifierRule
void SetPacketClassifierRule(IpcsClassifierRecord packetClassifierRule)
sets the packet classifier rules
Definition:
cs-parameters.cc:71
ns3::CsParameters::~CsParameters
~CsParameters()
Definition:
cs-parameters.cc:31
ns3::CsParameters::CsParameters
CsParameters()
Definition:
cs-parameters.cc:26
ns3::IpcsClassifierRecord
IpcsClassifierRecord class.
Definition:
ipcs-classifier-record.h:38
ns3::IpcsClassifierRecord::ToTlv
Tlv ToTlv() const
Creates a TLV from this classifier.
Definition:
ipcs-classifier-record.cc:318
ns3::SfVectorTlvValue::IPV4_CS_Parameters
@ IPV4_CS_Parameters
Definition:
wimax-tlv.h:370
ns3::Tlv
This class implements the Type-Len-Value structure channel encodings as described by "IEEE Standard f...
Definition:
wimax-tlv.h:87
ns3::Tlv::GetType
uint8_t GetType() const
Get type value.
Definition:
wimax-tlv.cc:211
ns3::Tlv::PeekValue
TlvValue * PeekValue()
Peek value.
Definition:
wimax-tlv.cc:223
ns3::U8TlvValue
U8TlvValue class.
Definition:
wimax-tlv.h:175
ns3::VectorTlvValue::GetSerializedSize
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
Definition:
wimax-tlv.cc:251
ns3::VectorTlvValue::End
Iterator End() const
End iterator.
Definition:
wimax-tlv.cc:278
ns3::VectorTlvValue::Begin
Iterator Begin() const
Begin iterator.
Definition:
wimax-tlv.cc:272
ns3::VectorTlvValue::Add
void Add(const Tlv &val)
Add a TLV.
Definition:
wimax-tlv.cc:284
cs-parameters.h
NS_ASSERT_MSG
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition:
assert.h:86
check-style-clang-format.action
action
Definition:
check-style-clang-format.py:703
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
wimax-tlv.h
src
wimax
model
cs-parameters.cc
Generated on Sun Mar 3 2024 17:11:13 for ns-3 by
1.9.1