A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
qos-tag.cc
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 MIRKO BANCHI
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
* Author: Mirko Banchi <mk.banchi@gmail.com>
19
*/
20
#include "qos-tag.h"
21
#include "ns3/tag.h"
22
#include "ns3/uinteger.h"
23
24
namespace
ns3 {
25
26
NS_OBJECT_ENSURE_REGISTERED (QosTag);
27
28
TypeId
29
QosTag::GetTypeId (
void
)
30
{
31
static
TypeId tid = TypeId (
"ns3::QosTag"
)
32
.SetParent<Tag> ()
33
.AddConstructor<QosTag> ()
34
.AddAttribute (
"tid"
,
"The tid that indicates AC which packet belongs"
,
35
UintegerValue (0),
36
MakeUintegerAccessor (&QosTag::GetTid),
37
MakeUintegerChecker<uint8_t> ())
38
;
39
return
tid;
40
}
41
42
TypeId
43
QosTag::GetInstanceTypeId
(
void
)
const
44
{
45
return
GetTypeId ();
46
}
47
48
QosTag::QosTag
()
49
: m_tid (0)
50
{
51
}
52
QosTag::QosTag
(uint8_t tid)
53
: m_tid (tid)
54
{
55
}
56
57
void
58
QosTag::SetTid
(uint8_t tid)
59
{
60
m_tid = tid;
61
}
62
63
void
64
QosTag::SetUserPriority
(
UserPriority
up)
65
{
66
m_tid = up;
67
}
68
69
uint32_t
70
QosTag::GetSerializedSize
(
void
)
const
71
{
72
return
1;
73
}
74
75
void
76
QosTag::Serialize
(
TagBuffer
i)
const
77
{
78
i.
WriteU8
(m_tid);
79
}
80
81
void
82
QosTag::Deserialize
(
TagBuffer
i)
83
{
84
m_tid = (
UserPriority
) i.
ReadU8
();
85
}
86
87
uint8_t
88
QosTag::GetTid ()
const
89
{
90
return
m_tid;
91
}
92
93
void
94
QosTag::Print
(std::ostream &os)
const
95
{
96
os <<
"Tid="
<< m_tid;
97
}
98
99
}
// namespace ns3
ns3::QosTag::SetUserPriority
void SetUserPriority(UserPriority up)
Definition:
qos-tag.cc:64
ns3::QosTag::Deserialize
virtual void Deserialize(TagBuffer i)
Definition:
qos-tag.cc:82
ns3::TagBuffer::ReadU8
TAG_BUFFER_INLINE uint8_t ReadU8(void)
Definition:
tag-buffer.h:179
ns3::QosTag::SetTid
void SetTid(uint8_t tid)
Definition:
qos-tag.cc:58
ns3::QosTag::GetSerializedSize
virtual uint32_t GetSerializedSize() const
Definition:
qos-tag.cc:70
ns3::QosTag::Serialize
virtual void Serialize(TagBuffer i) const
Definition:
qos-tag.cc:76
ns3::QosTag::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
qos-tag.cc:43
ns3::QosTag::Print
virtual void Print(std::ostream &os) const
Definition:
qos-tag.cc:94
ns3::UserPriority
UserPriority
Definition:
qos-tag.h:39
ns3::TagBuffer::WriteU8
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Definition:
tag-buffer.h:156
ns3::QosTag::QosTag
QosTag()
Definition:
qos-tag.cc:48
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:51
src
wifi
model
qos-tag.cc
Generated on Sun Mar 16 2014 11:25:12 for ns-3 by
1.8.6