A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
uan
model
uan-header-common.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 University of Washington
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: Leonard Tracy <lentracy@gmail.com>
19
*/
20
21
#ifndef UAN_HEADER_COMMON_H
22
#define UAN_HEADER_COMMON_H
23
24
#include "ns3/header.h"
25
#include "ns3/nstime.h"
26
#include "ns3/simulator.h"
27
#include "ns3/mac8-address.h"
28
29
namespace
ns3
{
30
31
struct
UanProtocolBits
32
{
33
uint8_t
m_type
: 4;
34
uint8_t
m_protocolNumber
: 4;
35
};
36
59
class
UanHeaderCommon
:
public
Header
60
{
61
public
:
63
UanHeaderCommon
();
73
UanHeaderCommon
(
const
Mac8Address
src,
const
Mac8Address
dest, uint8_t type, uint8_t protocolNumber);
75
virtual
~UanHeaderCommon
();
76
81
static
TypeId
GetTypeId
(
void
);
82
88
void
SetDest
(
Mac8Address
dest);
94
void
SetSrc
(
Mac8Address
src);
101
void
SetType
(uint8_t type);
108
void
SetProtocolNumber
(uint16_t protocolNumber);
109
115
Mac8Address
GetDest
(
void
)
const
;
121
Mac8Address
GetSrc
(
void
)
const
;
127
uint8_t
GetType
(
void
)
const
;
133
uint16_t
GetProtocolNumber
(
void
)
const
;
134
135
// Inherited methods
136
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
137
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
138
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
139
virtual
void
Print
(std::ostream &os)
const
;
140
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
141
private
:
142
Mac8Address
m_dest
;
143
Mac8Address
m_src
;
144
UanProtocolBits
m_uanProtocolBits
{0};
145
146
};
// class UanHeaderCommon
147
148
}
// namespace ns3
149
150
#endif
/* UAN_HEADER_COMMON_H */
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::UanHeaderCommon::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
uan-header-common.cc:129
ns3::UanHeaderCommon::SetSrc
void SetSrc(Mac8Address src)
Set the source address.
Definition:
uan-header-common.cc:72
visualizer.core.start
def start()
Definition:
core.py:1844
ns3::UanProtocolBits::m_protocolNumber
uint8_t m_protocolNumber
Definition:
uan-header-common.h:34
ns3::UanHeaderCommon::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
uan-header-common.cc:149
ns3::UanHeaderCommon::GetType
uint8_t GetType(void) const
Get the header type value.
Definition:
uan-header-common.cc:109
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::UanHeaderCommon::SetProtocolNumber
void SetProtocolNumber(uint16_t protocolNumber)
Set the packet type.
Definition:
uan-header-common.cc:84
ns3::UanHeaderCommon::GetDest
Mac8Address GetDest(void) const
Get the destination address.
Definition:
uan-header-common.cc:99
ns3::UanHeaderCommon::~UanHeaderCommon
virtual ~UanHeaderCommon()
Destructor.
Definition:
uan-header-common.cc:61
ns3::Mac8Address
A class used for addressing MAC8 MAC's.
Definition:
mac8-address.h:42
ns3::UanHeaderCommon::UanHeaderCommon
UanHeaderCommon()
Default constructor.
Definition:
uan-header-common.cc:32
ns3::UanHeaderCommon::GetTypeId
static TypeId GetTypeId(void)
Register this type.
Definition:
uan-header-common.cc:46
ns3::UanHeaderCommon::GetSrc
Mac8Address GetSrc(void) const
Get the source address.
Definition:
uan-header-common.cc:104
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::UanHeaderCommon
Common packet header fields.
Definition:
uan-header-common.h:59
ns3::UanHeaderCommon::m_dest
Mac8Address m_dest
The destination address.
Definition:
uan-header-common.h:142
ns3::UanProtocolBits
Definition:
uan-header-common.h:31
ns3::UanHeaderCommon::m_uanProtocolBits
UanProtocolBits m_uanProtocolBits
The type and protocol bits.
Definition:
uan-header-common.h:144
ns3::UanHeaderCommon::SetDest
void SetDest(Mac8Address dest)
Set the destination address.
Definition:
uan-header-common.cc:67
ns3::UanHeaderCommon::GetProtocolNumber
uint16_t GetProtocolNumber(void) const
Get the packet type value.
Definition:
uan-header-common.cc:115
ns3::UanHeaderCommon::Print
virtual void Print(std::ostream &os) const
Definition:
uan-header-common.cc:163
ns3::UanHeaderCommon::SetType
void SetType(uint8_t type)
Set the header type.
Definition:
uan-header-common.cc:78
ns3::UanProtocolBits::m_type
uint8_t m_type
Definition:
uan-header-common.h:33
ns3::UanHeaderCommon::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
uan-header-common.cc:135
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::UanHeaderCommon::m_src
Mac8Address m_src
The source address.
Definition:
uan-header-common.h:143
ns3::UanHeaderCommon::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
uan-header-common.cc:57
Generated on Wed Nov 7 2018 10:02:11 for ns-3 by
1.8.14