A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
wimax
model
cs-parameters.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 INRIA, UDcast
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19
*
20
*/
21
#include "
wimax-tlv.h
"
22
#include "
cs-parameters.h
"
23
24
namespace
ns3
{
25
CsParameters::CsParameters
()
26
{
27
m_classifierDscAction
=
CsParameters::ADD
;
28
}
29
CsParameters::~CsParameters
()
30
{
31
32
}
33
34
CsParameters::CsParameters
(
Tlv
tlv)
35
{
36
NS_ASSERT_MSG
(tlv.
GetType
() ==
SfVectorTlvValue::IPV4_CS_Parameters
,
37
"Invalid TLV"
);
38
CsParamVectorTlvValue
* param = ((
CsParamVectorTlvValue
*)(tlv.
PeekValue
()));
39
40
for
(std::vector<Tlv*>::const_iterator iter = param->Begin (); iter
41
!= param->End (); ++iter)
42
{
43
switch
((*iter)->GetType ())
44
{
45
case
CsParamVectorTlvValue::Classifier_DSC_Action
:
46
{
47
m_classifierDscAction
48
= (
enum
CsParameters::Action
)((
U8TlvValue
*)((*iter)->PeekValue ()))->GetValue ();
49
break
;
50
}
51
case
CsParamVectorTlvValue::Packet_Classification_Rule
:
52
{
53
m_packetClassifierRule
54
=
IpcsClassifierRecord
(*(*iter));
55
break
;
56
}
57
}
58
}
59
}
60
61
CsParameters::CsParameters
(
enum
CsParameters::Action
classifierDscAction,
62
IpcsClassifierRecord
classifier)
63
{
64
m_classifierDscAction
= classifierDscAction;
65
m_packetClassifierRule
= classifier;
66
}
67
void
68
CsParameters::SetClassifierDscAction
(
enum
CsParameters::Action
action)
69
{
70
m_classifierDscAction
= action;
71
}
72
void
73
CsParameters::SetPacketClassifierRule
(
IpcsClassifierRecord
packetClassifierRule)
74
{
75
m_packetClassifierRule
= packetClassifierRule;
76
}
77
enum
CsParameters::Action
78
CsParameters::GetClassifierDscAction
(
void
)
const
79
{
80
return
m_classifierDscAction
;
81
}
82
IpcsClassifierRecord
83
CsParameters::GetPacketClassifierRule
(
void
)
const
84
{
85
return
m_packetClassifierRule
;
86
}
87
Tlv
88
CsParameters::ToTlv
(
void
)
const
89
{
90
CsParamVectorTlvValue
tmp;
91
tmp.
Add
(
Tlv
(
CsParamVectorTlvValue::Classifier_DSC_Action
,1,
U8TlvValue
(
m_classifierDscAction
)));
92
tmp.
Add
(
m_packetClassifierRule
.
ToTlv
());
93
return
Tlv
(
SfVectorTlvValue::IPV4_CS_Parameters
, tmp.
GetSerializedSize
(), tmp);
94
}
95
}
ns3::CsParameters::m_classifierDscAction
enum Action m_classifierDscAction
classifier DSC action
Definition:
cs-parameters.h:83
cs-parameters.h
ns3::IpcsClassifierRecord::ToTlv
Tlv ToTlv(void) const
Creates a TLV from this classifier.
Definition:
ipcs-classifier-record.cc:307
ns3::CsParameters::Action
Action
Action enumeration.
Definition:
cs-parameters.h:39
NS_ASSERT_MSG
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
ns3::CsParameters::ADD
Definition:
cs-parameters.h:41
ns3::CsParameters::SetClassifierDscAction
void SetClassifierDscAction(enum Action action)
sets the dynamic service classifier action to ADD, Change or delete.
Definition:
cs-parameters.cc:68
ns3::CsParamVectorTlvValue
this class implements the convergence sub-layer descriptor as a tlv vector
Definition:
wimax-tlv.h:376
ns3::SfVectorTlvValue::IPV4_CS_Parameters
Definition:
wimax-tlv.h:363
ns3::VectorTlvValue::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Get serialized size in bytes.
Definition:
wimax-tlv.cc:251
ns3::Tlv
This class implements the Type-Len-Value structure channel encodings as described by "IEEE Standard f...
Definition:
wimax-tlv.h:83
ns3::CsParameters::SetPacketClassifierRule
void SetPacketClassifierRule(IpcsClassifierRecord packetClassifierRule)
sets the packet classifier rules
Definition:
cs-parameters.cc:73
ns3::IpcsClassifierRecord
IpcsClassifierRecord class.
Definition:
ipcs-classifier-record.h:35
ns3::VectorTlvValue::Add
void Add(const Tlv &val)
Add a TLV.
Definition:
wimax-tlv.cc:284
ns3::CsParameters::m_packetClassifierRule
IpcsClassifierRecord m_packetClassifierRule
packet classifier rule
Definition:
cs-parameters.h:84
ns3::CsParameters::~CsParameters
~CsParameters()
Definition:
cs-parameters.cc:29
ns3::CsParameters::GetPacketClassifierRule
IpcsClassifierRecord GetPacketClassifierRule(void) const
Definition:
cs-parameters.cc:83
ns3::U8TlvValue
U8TlvValue class.
Definition:
wimax-tlv.h:170
ns3::Tlv::GetType
uint8_t GetType(void) const
Get type value.
Definition:
wimax-tlv.cc:214
wimax-tlv.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::CsParamVectorTlvValue::Classifier_DSC_Action
Definition:
wimax-tlv.h:382
ns3::Tlv::PeekValue
TlvValue * PeekValue(void)
Peek value.
Definition:
wimax-tlv.cc:224
ns3::CsParameters::GetClassifierDscAction
enum Action GetClassifierDscAction(void) const
Definition:
cs-parameters.cc:78
ns3::CsParameters::CsParameters
CsParameters()
Definition:
cs-parameters.cc:25
ns3::CsParamVectorTlvValue::Packet_Classification_Rule
Definition:
wimax-tlv.h:383
ns3::CsParameters::ToTlv
Tlv ToTlv(void) const
creates a tlv from the classifier record
Definition:
cs-parameters.cc:88
Generated on Wed Nov 7 2018 10:02:16 for ns-3 by
1.8.14