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
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
byte-tag-list.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
#ifndef BYTE_TAG_LIST_H
21
#define BYTE_TAG_LIST_H
22
23
#include <stdint.h>
24
#include "ns3/type-id.h"
25
#include "
tag-buffer.h
"
26
27
namespace
ns3 {
28
29
struct
ByteTagListData;
30
68
class
ByteTagList
69
{
70
public
:
71
/*
72
* \brief An iterator for iterating through a byte tag list
73
*
74
* An iterator for iterating through a byte tag list
75
*
76
*/
77
class
Iterator
78
{
79
public
:
80
/*
81
* \brief An item specifies an individual tag within a byte buffer
82
*
83
* An item specifies an individual tag within a byte buffer
84
*
85
*/
86
struct
Item
87
{
88
TypeId
tid
;
89
uint32_t
size
;
90
int32_t
start
;
91
int32_t
end
;
92
TagBuffer
buf
;
93
Item
(
TagBuffer
buf
);
94
private
:
95
friend
class
ByteTagList
;
96
friend
class
ByteTagList::Iterator
;
97
};
98
99
/*
100
* \brief Used to determine if the iterator is at the end of the byteTagList
101
*
102
* \returns true if there are more Items in the list
103
*/
104
bool
HasNext
(
void
)
const
;
105
106
/*
107
* \brief Returns the next Item from the ByteTagList
108
*
109
* \returns the next Item in the ByteTagList
110
*/
111
struct
ByteTagList::Iterator::Item
Next
(void);
112
113
/*
114
* \brief Returns the offset from the start of the virtual byte buffer to the ByteTagList
115
*
116
* \returns offset to the start of this ByteTagList
117
*/
118
uint32_t
GetOffsetStart
(
void
)
const
;
119
private
:
120
friend
class
ByteTagList
;
121
Iterator
(uint8_t *
start
, uint8_t *end, int32_t offsetStart, int32_t offsetEnd);
122
void
PrepareForNext
(
void
);
123
uint8_t *
m_current
;
124
uint8_t *
m_end
;
125
int32_t
m_offsetStart
;
126
int32_t
m_offsetEnd
;
127
uint32_t
m_nextTid
;
128
uint32_t
m_nextSize
;
129
int32_t
m_nextStart
;
130
int32_t
m_nextEnd
;
131
};
132
133
ByteTagList
();
134
143
ByteTagList
(
const
ByteTagList
&o);
144
154
ByteTagList
&
operator =
(
const
ByteTagList
&o);
155
~ByteTagList
();
156
167
TagBuffer
Add
(
TypeId
tid, uint32_t bufferSize, int32_t
start
, int32_t end);
168
174
void
Add
(
const
ByteTagList
&o);
175
180
void
RemoveAll
(
void
);
181
193
ByteTagList::Iterator
Begin
(int32_t offsetStart, int32_t offsetEnd)
const
;
194
204
void
AddAtEnd
(int32_t adjustment, int32_t appendOffset);
214
void
AddAtStart
(int32_t adjustment, int32_t prependOffset);
215
216
private
:
217
bool
IsDirtyAtEnd
(int32_t appendOffset);
218
bool
IsDirtyAtStart
(int32_t prependOffset);
219
ByteTagList::Iterator
BeginAll
(
void
)
const
;
220
221
struct
ByteTagListData
*
Allocate
(uint32_t size);
222
void
Deallocate
(
struct
ByteTagListData
*
data
);
223
224
uint16_t
m_used
;
225
struct
ByteTagListData
*
m_data
;
226
};
227
228
}
// namespace ns3
229
230
#endif
/* BYTE_TAG_LIST_H */
ns3::ByteTagList::operator=
ByteTagList & operator=(const ByteTagList &o)
Assignment operator, deallocates current data and assigns value of passed in ByteTagList.
Definition:
byte-tag-list.cc:142
ns3::ByteTagList::Iterator::Iterator
Iterator(uint8_t *start, uint8_t *end, int32_t offsetStart, int32_t offsetEnd)
Definition:
byte-tag-list.cc:107
ns3::ByteTagList::m_data
struct ByteTagListData * m_data
Definition:
byte-tag-list.h:225
ns3::ByteTagList
keep track of the byte tags stored in a packet.
Definition:
byte-tag-list.h:68
ns3::ByteTagList::Iterator::HasNext
bool HasNext(void) const
Definition:
byte-tag-list.cc:67
ns3::ByteTagList::Add
TagBuffer Add(TypeId tid, uint32_t bufferSize, int32_t start, int32_t end)
Definition:
byte-tag-list.cc:167
ns3::ByteTagList::Iterator::m_nextTid
uint32_t m_nextTid
Definition:
byte-tag-list.h:127
visualizer.core.start
def start
Definition:
core.py:1482
ns3::ByteTagList::Deallocate
void Deallocate(struct ByteTagListData *data)
Definition:
byte-tag-list.cc:370
ns3::ByteTagList::Iterator::m_current
uint8_t * m_current
Definition:
byte-tag-list.h:123
tag-buffer.h
ns3::ByteTagList::Iterator::m_offsetEnd
int32_t m_offsetEnd
Definition:
byte-tag-list.h:126
ns3::ByteTagList::Iterator::PrepareForNext
void PrepareForNext(void)
Definition:
byte-tag-list.cc:87
ns3::ByteTagList::RemoveAll
void RemoveAll(void)
Removes all of the tags from the ByteTagList.
Definition:
byte-tag-list.cc:210
ns3::ByteTagListData
Definition:
byte-tag-list.cc:33
ns3::ByteTagList::Iterator::m_nextSize
uint32_t m_nextSize
Definition:
byte-tag-list.h:128
data
uint8_t data[writeSize]
Definition:
socket-bound-tcp-static-routing.cc:53
ns3::ByteTagList::m_used
uint16_t m_used
Definition:
byte-tag-list.h:224
ns3::ByteTagList::Iterator::Item::start
int32_t start
size of tag data
Definition:
byte-tag-list.h:90
ns3::ByteTagList::AddAtEnd
void AddAtEnd(int32_t adjustment, int32_t appendOffset)
Adjust the offsets stored internally by the adjustment delta and make sure that all offsets are small...
Definition:
byte-tag-list.cc:274
ns3::ByteTagList::Iterator::Next
struct ByteTagList::Iterator::Item Next(void)
Definition:
byte-tag-list.cc:73
ns3::ByteTagList::Allocate
struct ByteTagListData * Allocate(uint32_t size)
Definition:
byte-tag-list.cc:344
ns3::ByteTagList::Iterator::m_nextStart
int32_t m_nextStart
Definition:
byte-tag-list.h:129
ns3::ByteTagList::Iterator::GetOffsetStart
uint32_t GetOffsetStart(void) const
Definition:
byte-tag-list.cc:118
ns3::ByteTagList::Iterator::Item::end
int32_t end
offset to the start of the tag from the virtual byte buffer
Definition:
byte-tag-list.h:91
ns3::ByteTagList::BeginAll
ByteTagList::Iterator BeginAll(void) const
Definition:
byte-tag-list.cc:219
ns3::ByteTagList::Iterator::m_offsetStart
int32_t m_offsetStart
Definition:
byte-tag-list.h:125
ns3::ByteTagList::Iterator::Item::tid
TypeId tid
Definition:
byte-tag-list.h:88
ns3::ByteTagList::Iterator::Item::size
uint32_t size
type of the tag
Definition:
byte-tag-list.h:89
ns3::ByteTagList::IsDirtyAtStart
bool IsDirtyAtStart(int32_t prependOffset)
Definition:
byte-tag-list.cc:258
ns3::ByteTagList::ByteTagList
ByteTagList()
Definition:
byte-tag-list.cc:125
ns3::ByteTagList::Begin
ByteTagList::Iterator Begin(int32_t offsetStart, int32_t offsetEnd) const
Definition:
byte-tag-list.cc:228
ns3::ByteTagList::Iterator::Item::buf
TagBuffer buf
offset to the end of the tag from the virtual byte buffer
Definition:
byte-tag-list.h:92
ns3::ByteTagList::Iterator
Definition:
byte-tag-list.h:77
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:51
ns3::ByteTagList::Iterator::m_nextEnd
int32_t m_nextEnd
Definition:
byte-tag-list.h:130
ns3::ByteTagList::Iterator::Item::Item
Item(TagBuffer buf)
the data for the tag as generated by Tag::Serialize
Definition:
byte-tag-list.cc:60
ns3::ByteTagList::~ByteTagList
~ByteTagList()
Definition:
byte-tag-list.cc:158
ns3::ByteTagList::IsDirtyAtEnd
bool IsDirtyAtEnd(int32_t appendOffset)
Definition:
byte-tag-list.cc:242
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::ByteTagList::AddAtStart
void AddAtStart(int32_t adjustment, int32_t prependOffset)
Adjust the offsets stored internally by the adjustment delta and make sure that all offsets are bigge...
Definition:
byte-tag-list.cc:308
ns3::ByteTagList::Iterator::m_end
uint8_t * m_end
Definition:
byte-tag-list.h:124
ns3::ByteTagList::Iterator::Item
Definition:
byte-tag-list.h:86
src
network
model
byte-tag-list.h
Generated on Sat Apr 19 2014 14:07:05 for ns-3 by
1.8.6