A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
flame-header.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 IITP RAS
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Kirill Andreev <andreev@iitp.ru>
7
*/
8
9
#ifndef FLAME_HEADER_H
10
#define FLAME_HEADER_H
11
12
#include "ns3/header.h"
13
#include "ns3/mac48-address.h"
14
15
namespace
ns3
16
{
17
namespace
flame
18
{
19
/**
20
* \ingroup flame
21
*
22
* \brief Flame header
23
*
24
* Header format: | Reserved: 1 | cost: 1 | Sequence number: 2 | OrigDst: 6 | OrigSrc: 6 | Flame
25
* port : 2 |
26
*/
27
28
class
FlameHeader
:
public
Header
29
{
30
public
:
31
FlameHeader
();
32
~FlameHeader
()
override
;
33
34
/**
35
* \brief Get the type ID.
36
* \return the object TypeId
37
*/
38
static
TypeId
GetTypeId
();
39
// Inherited from Header class:
40
TypeId
GetInstanceTypeId
()
const override
;
41
void
Print
(std::ostream& os)
const override
;
42
uint32_t
GetSerializedSize
()
const override
;
43
void
Serialize
(
Buffer::Iterator
start)
const override
;
44
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
45
46
// Seeters/Getters for fields:
47
/**
48
* Add cost value
49
* \param cost the cost
50
*/
51
void
AddCost
(uint8_t cost);
52
/**
53
* Get cost value
54
* \returns the cost
55
*/
56
uint8_t
GetCost
()
const
;
57
/**
58
* Set sequence number value
59
* \param seqno the sequence number
60
*/
61
void
SetSeqno
(uint16_t seqno);
62
/**
63
* Get sequence number value
64
* \returns the sequence number
65
*/
66
uint16_t
GetSeqno
()
const
;
67
/**
68
* Set origin destination address
69
* \param dst the MAC address of the destination
70
*/
71
void
SetOrigDst
(
Mac48Address
dst);
72
/**
73
* Get origin destination address
74
* \returns the MAC address of the destination
75
*/
76
Mac48Address
GetOrigDst
()
const
;
77
/**
78
* Set origin source function
79
* \param OrigSrc the MAC address of the origina source
80
*/
81
void
SetOrigSrc
(
Mac48Address
OrigSrc);
82
/**
83
* Get origin source address
84
* \returns the MAC address of the origin source
85
*/
86
Mac48Address
GetOrigSrc
()
const
;
87
/**
88
* Set protocol value
89
* \param protocol the protocol
90
*/
91
void
SetProtocol
(uint16_t protocol);
92
/**
93
* Get protocol value
94
* \returns the protocol
95
*/
96
uint16_t
GetProtocol
()
const
;
97
98
private
:
99
uint8_t
m_cost
;
///< cost
100
uint16_t
m_seqno
;
///< sequence number
101
Mac48Address
m_origDst
;
///< origin destination
102
Mac48Address
m_origSrc
;
///< origin source
103
uint16_t
m_protocol
;
///< protocol
104
/**
105
* equality operator
106
*
107
* \param a lhs
108
* \param b rhs
109
* \returns true if equal
110
*/
111
friend
bool
operator==
(
const
FlameHeader
& a,
const
FlameHeader
& b);
112
};
113
114
bool
operator==
(
const
FlameHeader
& a,
const
FlameHeader
& b);
115
}
// namespace flame
116
}
// namespace ns3
117
#endif
/* FLAME_HEADER_H */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Header
Protocol header serialization and deserialization.
Definition
header.h:33
ns3::Mac48Address
an EUI-48 address
Definition
mac48-address.h:35
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::flame::FlameHeader
Flame header.
Definition
flame-header.h:29
ns3::flame::FlameHeader::m_cost
uint8_t m_cost
cost
Definition
flame-header.h:99
ns3::flame::FlameHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
flame-header.cc:57
ns3::flame::FlameHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
flame-header.cc:81
ns3::flame::FlameHeader::m_origDst
Mac48Address m_origDst
origin destination
Definition
flame-header.h:101
ns3::flame::FlameHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
flame-header.cc:34
ns3::flame::FlameHeader::m_protocol
uint16_t m_protocol
protocol
Definition
flame-header.h:103
ns3::flame::FlameHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
flame-header.cc:44
ns3::flame::FlameHeader::GetCost
uint8_t GetCost() const
Get cost value.
Definition
flame-header.cc:100
ns3::flame::FlameHeader::m_seqno
uint16_t m_seqno
sequence number
Definition
flame-header.h:100
ns3::flame::FlameHeader::FlameHeader
FlameHeader()
Definition
flame-header.cc:21
ns3::flame::FlameHeader::GetOrigDst
Mac48Address GetOrigDst() const
Get origin destination address.
Definition
flame-header.cc:124
ns3::flame::FlameHeader::GetOrigSrc
Mac48Address GetOrigSrc() const
Get origin source address.
Definition
flame-header.cc:136
ns3::flame::FlameHeader::SetOrigSrc
void SetOrigSrc(Mac48Address OrigSrc)
Set origin source function.
Definition
flame-header.cc:130
ns3::flame::FlameHeader::AddCost
void AddCost(uint8_t cost)
Add cost value.
Definition
flame-header.cc:94
ns3::flame::FlameHeader::Print
void Print(std::ostream &os) const override
Definition
flame-header.cc:50
ns3::flame::FlameHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
flame-header.cc:69
ns3::flame::FlameHeader::operator==
friend bool operator==(const FlameHeader &a, const FlameHeader &b)
equality operator
Definition
flame-header.cc:154
ns3::flame::FlameHeader::GetSeqno
uint16_t GetSeqno() const
Get sequence number value.
Definition
flame-header.cc:112
ns3::flame::FlameHeader::SetOrigDst
void SetOrigDst(Mac48Address dst)
Set origin destination address.
Definition
flame-header.cc:118
ns3::flame::FlameHeader::SetProtocol
void SetProtocol(uint16_t protocol)
Set protocol value.
Definition
flame-header.cc:142
ns3::flame::FlameHeader::~FlameHeader
~FlameHeader() override
Definition
flame-header.cc:29
ns3::flame::FlameHeader::m_origSrc
Mac48Address m_origSrc
origin source
Definition
flame-header.h:102
ns3::flame::FlameHeader::GetProtocol
uint16_t GetProtocol() const
Get protocol value.
Definition
flame-header.cc:148
ns3::flame::FlameHeader::SetSeqno
void SetSeqno(uint16_t seqno)
Set sequence number value.
Definition
flame-header.cc:106
uint32_t
ns3::flame::operator==
bool operator==(const FlameHeader &a, const FlameHeader &b)
Definition
flame-header.cc:154
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mesh
model
flame
flame-header.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0