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
cognitive-packet-tags.h
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2005,2006,2007 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:
19
* Abdulla Al-Ali <al-ali.a@husky.neu.edu>
20
*/
21
22
#ifndef COGNITIVE_PACKET_TAGS_H_
23
#define COGNITIVE_PACKET_TAGS_H_
24
25
#include "ns3/tag.h"
26
27
namespace
ns3 {
28
29
enum
PacketType
30
{
31
CTRL_PACKET = 1,
//for packets destined to ctrl interface
32
DATA_PACKET = 2
//for packets destined to tx interface
33
};
34
35
class
PacketTypePacketTag
:
public
Tag
36
{
37
public
:
38
39
PacketTypePacketTag
(PacketType t = CTRL_PACKET);
40
static
TypeId
GetTypeId (
void
);
41
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
42
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
43
virtual
void
Serialize
(
TagBuffer
i)
const
;
44
virtual
void
Deserialize
(
TagBuffer
i);
45
46
void
Print
(std::ostream &os)
const
;
47
void
Set (PacketType m_type);
48
PacketType Get ()
const
{
return
m_type; }
49
50
private
:
51
PacketType m_type;
52
};
53
54
class
PacketChannelPacketTag
:
public
Tag
55
{
56
public
:
57
58
PacketChannelPacketTag
(uint16_t t = 0);
59
static
TypeId
GetTypeId (
void
);
60
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
61
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
62
virtual
void
Serialize
(
TagBuffer
i)
const
;
63
virtual
void
Deserialize
(
TagBuffer
i);
64
65
void
Print
(std::ostream &os)
const
;
66
uint16_t GetChannel ()
const
{
return
m_channel; }
67
68
private
:
69
uint16_t m_channel;
70
};
71
72
}
73
#endif
/* COGNITIVE_PACKET_TAGS_H_ */
ns3::PacketChannelPacketTag::Deserialize
virtual void Deserialize(TagBuffer i)
Definition:
cognitive-packet-tags.cc:113
ns3::PacketTypePacketTag::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
cognitive-packet-tags.cc:46
ns3::PacketTypePacketTag::Deserialize
virtual void Deserialize(TagBuffer i)
Definition:
cognitive-packet-tags.cc:56
ns3::PacketChannelPacketTag::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
cognitive-packet-tags.cc:97
ns3::PacketChannelPacketTag
Definition:
cognitive-packet-tags.h:54
ns3::PacketChannelPacketTag::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
cognitive-packet-tags.cc:103
ns3::PacketTypePacketTag
Definition:
cognitive-packet-tags.h:35
ns3::Tag
tag a set of bytes in a packet
Definition:
tag.h:36
ns3::PacketChannelPacketTag::Print
void Print(std::ostream &os) const
Definition:
cognitive-packet-tags.cc:119
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:51
ns3::PacketTypePacketTag::Serialize
virtual void Serialize(TagBuffer i) const
Definition:
cognitive-packet-tags.cc:51
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:44
ns3::PacketTypePacketTag::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
cognitive-packet-tags.cc:40
ns3::PacketChannelPacketTag::Serialize
virtual void Serialize(TagBuffer i) const
Definition:
cognitive-packet-tags.cc:108
ns3::PacketTypePacketTag::Print
void Print(std::ostream &os) const
Definition:
cognitive-packet-tags.cc:62
src
cognitive
model
cognitive-packet-tags.h
Generated on Sun Mar 16 2014 11:25:01 for ns-3 by
1.8.6