A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
mesh
model
flame
flame-header.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 IITP RAS
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: Kirill Andreev <andreev@iitp.ru>
19
*/
20
21
#ifndef FLAME_HEADER_H
22
#define FLAME_HEADER_H
23
24
#include "ns3/header.h"
25
#include "ns3/mac48-address.h"
26
27
namespace
ns3
{
28
namespace
flame {
37
class
FlameHeader
:
public
Header
38
{
39
public
:
40
41
FlameHeader
();
42
~FlameHeader
();
43
48
static
TypeId
GetTypeId
(
void
);
49
// Inherited from Header class:
50
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
51
virtual
void
Print
(std::ostream &os)
const
;
52
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
53
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
54
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
55
56
// Seeters/Getters for fields:
61
void
AddCost
(uint8_t cost);
66
uint8_t
GetCost
()
const
;
71
void
SetSeqno
(uint16_t seqno);
76
uint16_t
GetSeqno
()
const
;
81
void
SetOrigDst
(
Mac48Address
dst);
86
Mac48Address
GetOrigDst
()
const
;
91
void
SetOrigSrc
(
Mac48Address
OrigSrc);
96
Mac48Address
GetOrigSrc
()
const
;
101
void
SetProtocol
(uint16_t protocol);
106
uint16_t
GetProtocol
()
const
;
107
108
private
:
109
uint8_t
m_cost
;
110
uint16_t
m_seqno
;
111
Mac48Address
m_origDst
;
112
Mac48Address
m_origSrc
;
113
uint16_t
m_protocol
;
114
121
friend
bool
operator==
(
const
FlameHeader
& a,
const
FlameHeader
& b);
122
};
123
bool
operator==
(
const
FlameHeader
& a,
const
FlameHeader
& b);
124
}
// namespace flame
125
}
// namespace ns3
126
#endif
/* FLAME_HEADER_H */
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::flame::FlameHeader::GetOrigDst
Mac48Address GetOrigDst() const
Get origin destination address.
Definition:
flame-header.cc:118
ns3::flame::operator==
bool operator==(const FlameHeader &a, const FlameHeader &b)
Definition:
flame-header.cc:143
ns3::flame::FlameHeader::SetSeqno
void SetSeqno(uint16_t seqno)
Set sequence number value.
Definition:
flame-header.cc:103
ns3::flame::FlameHeader::SetOrigDst
void SetOrigDst(Mac48Address dst)
Set origin destination address.
Definition:
flame-header.cc:113
visualizer.core.start
def start()
Definition:
core.py:1844
ns3::flame::FlameHeader::m_origDst
Mac48Address m_origDst
origin destination
Definition:
flame-header.h:111
ns3::flame::FlameHeader::GetCost
uint8_t GetCost() const
Get cost value.
Definition:
flame-header.cc:98
ns3::flame::FlameHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
flame-header.cc:59
ns3::flame::FlameHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
flame-header.cc:39
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::flame::FlameHeader::GetSeqno
uint16_t GetSeqno() const
Get sequence number value.
Definition:
flame-header.cc:108
ns3::flame::FlameHeader::SetProtocol
void SetProtocol(uint16_t protocol)
Set protocol value.
Definition:
flame-header.cc:133
ns3::flame::FlameHeader::~FlameHeader
~FlameHeader()
Definition:
flame-header.cc:35
ns3::flame::FlameHeader::m_cost
uint8_t m_cost
cost
Definition:
flame-header.h:109
ns3::flame::FlameHeader::AddCost
void AddCost(uint8_t cost)
Add cost value.
Definition:
flame-header.cc:93
ns3::flame::FlameHeader::Print
virtual void Print(std::ostream &os) const
Definition:
flame-header.cc:53
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::flame::FlameHeader::operator==
friend bool operator==(const FlameHeader &a, const FlameHeader &b)
equality operator
Definition:
flame-header.cc:143
ns3::flame::FlameHeader::SetOrigSrc
void SetOrigSrc(Mac48Address OrigSrc)
Set origin source function.
Definition:
flame-header.cc:123
ns3::flame::FlameHeader::GetProtocol
uint16_t GetProtocol() const
Get protocol value.
Definition:
flame-header.cc:138
ns3::flame::FlameHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
flame-header.cc:48
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:43
ns3::flame::FlameHeader::m_seqno
uint16_t m_seqno
sequence number
Definition:
flame-header.h:110
ns3::flame::FlameHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
flame-header.cc:70
ns3::flame::FlameHeader::m_protocol
uint16_t m_protocol
protocol
Definition:
flame-header.h:113
ns3::flame::FlameHeader::m_origSrc
Mac48Address m_origSrc
origin source
Definition:
flame-header.h:112
ns3::flame::FlameHeader::FlameHeader
FlameHeader()
Definition:
flame-header.cc:31
ns3::flame::FlameHeader::GetOrigSrc
Mac48Address GetOrigSrc() const
Get origin source address.
Definition:
flame-header.cc:128
ns3::flame::FlameHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
flame-header.cc:81
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::flame::FlameHeader
Flame header.
Definition:
flame-header.h:37
Generated on Wed Nov 7 2018 10:02:05 for ns-3 by
1.8.14