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
cs-parameters.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 INRIA, UDcast
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
7
*
8
*/
9
#include "
cs-parameters.h
"
10
11
#include "
wimax-tlv.h
"
12
13
namespace
ns3
14
{
15
CsParameters::CsParameters
()
16
{
17
m_classifierDscAction
=
CsParameters::ADD
;
18
}
19
20
CsParameters::~CsParameters
()
21
{
22
}
23
24
CsParameters::CsParameters
(
Tlv
tlv)
25
{
26
NS_ASSERT_MSG
(tlv.
GetType
() ==
SfVectorTlvValue::IPV4_CS_Parameters
,
"Invalid TLV"
);
27
CsParamVectorTlvValue
* param = ((
CsParamVectorTlvValue
*)(tlv.
PeekValue
()));
28
29
for
(
auto
iter = param->
Begin
(); iter != param->
End
(); ++iter)
30
{
31
switch
((*iter)->GetType())
32
{
33
case
CsParamVectorTlvValue::Classifier_DSC_Action
: {
34
m_classifierDscAction
=
35
(
CsParameters::Action
)((
U8TlvValue
*)((*iter)->PeekValue()))->GetValue();
36
break
;
37
}
38
case
CsParamVectorTlvValue::Packet_Classification_Rule
: {
39
m_packetClassifierRule
=
IpcsClassifierRecord
(*(*iter));
40
break
;
41
}
42
}
43
}
44
}
45
46
CsParameters::CsParameters
(
CsParameters::Action
classifierDscAction,
47
IpcsClassifierRecord
classifier)
48
{
49
m_classifierDscAction
= classifierDscAction;
50
m_packetClassifierRule
= classifier;
51
}
52
53
void
54
CsParameters::SetClassifierDscAction
(
CsParameters::Action
action)
55
{
56
m_classifierDscAction
= action;
57
}
58
59
void
60
CsParameters::SetPacketClassifierRule
(
IpcsClassifierRecord
packetClassifierRule)
61
{
62
m_packetClassifierRule
= packetClassifierRule;
63
}
64
65
CsParameters::Action
66
CsParameters::GetClassifierDscAction
()
const
67
{
68
return
m_classifierDscAction
;
69
}
70
71
IpcsClassifierRecord
72
CsParameters::GetPacketClassifierRule
()
const
73
{
74
return
m_packetClassifierRule
;
75
}
76
77
Tlv
78
CsParameters::ToTlv
()
const
79
{
80
CsParamVectorTlvValue
tmp;
81
tmp.
Add
(
82
Tlv
(
CsParamVectorTlvValue::Classifier_DSC_Action
, 1,
U8TlvValue
(
m_classifierDscAction
)));
83
tmp.
Add
(
m_packetClassifierRule
.
ToTlv
());
84
return
Tlv
(
SfVectorTlvValue::IPV4_CS_Parameters
, tmp.
GetSerializedSize
(), tmp);
85
}
86
}
// namespace ns3
ns3::CsParamVectorTlvValue
this class implements the convergence sub-layer descriptor as a tlv vector
Definition
wimax-tlv.h:374
ns3::CsParamVectorTlvValue::Packet_Classification_Rule
@ Packet_Classification_Rule
Definition
wimax-tlv.h:380
ns3::CsParamVectorTlvValue::Classifier_DSC_Action
@ Classifier_DSC_Action
Definition
wimax-tlv.h:379
ns3::CsParameters::SetClassifierDscAction
void SetClassifierDscAction(Action action)
sets the dynamic service classifier action to ADD, Change or delete.
Definition
cs-parameters.cc:54
ns3::CsParameters::Action
Action
Action enumeration.
Definition
cs-parameters.h:29
ns3::CsParameters::ADD
@ ADD
Definition
cs-parameters.h:30
ns3::CsParameters::ToTlv
Tlv ToTlv() const
creates a tlv from the classifier record
Definition
cs-parameters.cc:78
ns3::CsParameters::GetClassifierDscAction
Action GetClassifierDscAction() const
Definition
cs-parameters.cc:66
ns3::CsParameters::GetPacketClassifierRule
IpcsClassifierRecord GetPacketClassifierRule() const
Definition
cs-parameters.cc:72
ns3::CsParameters::m_classifierDscAction
Action m_classifierDscAction
classifier DSC action
Definition
cs-parameters.h:74
ns3::CsParameters::m_packetClassifierRule
IpcsClassifierRecord m_packetClassifierRule
packet classifier rule
Definition
cs-parameters.h:75
ns3::CsParameters::SetPacketClassifierRule
void SetPacketClassifierRule(IpcsClassifierRecord packetClassifierRule)
sets the packet classifier rules
Definition
cs-parameters.cc:60
ns3::CsParameters::~CsParameters
~CsParameters()
Definition
cs-parameters.cc:20
ns3::CsParameters::CsParameters
CsParameters()
Definition
cs-parameters.cc:15
ns3::IpcsClassifierRecord
IpcsClassifierRecord class.
Definition
ipcs-classifier-record.h:27
ns3::IpcsClassifierRecord::ToTlv
Tlv ToTlv() const
Creates a TLV from this classifier.
Definition
ipcs-classifier-record.cc:307
ns3::SfVectorTlvValue::IPV4_CS_Parameters
@ IPV4_CS_Parameters
Definition
wimax-tlv.h:359
ns3::Tlv
This class implements the Type-Len-Value structure channel encodings as described by "IEEEStandard fo...
Definition
wimax-tlv.h:76
ns3::Tlv::GetType
uint8_t GetType() const
Get type value.
Definition
wimax-tlv.cc:200
ns3::Tlv::PeekValue
TlvValue * PeekValue()
Peek value.
Definition
wimax-tlv.cc:212
ns3::U8TlvValue
U8TlvValue class.
Definition
wimax-tlv.h:164
ns3::VectorTlvValue::GetSerializedSize
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
Definition
wimax-tlv.cc:240
ns3::VectorTlvValue::End
Iterator End() const
End iterator.
Definition
wimax-tlv.cc:267
ns3::VectorTlvValue::Begin
Iterator Begin() const
Begin iterator.
Definition
wimax-tlv.cc:261
ns3::VectorTlvValue::Add
void Add(const Tlv &val)
Add a TLV.
Definition
wimax-tlv.cc:273
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:75
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 Fri Nov 8 2024 13:59:09 for ns-3 by
1.11.0