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
hwmp-tag.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008,2009 IITP RAS
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Kirill Andreev <andreev@iitp.ru>
7
* Aleksey Kovalenko <kovalenko@iitp.ru>
8
* Pavel Boyko <boyko@iitp.ru>
9
*/
10
11
#ifndef HWMP_TAG_H
12
#define HWMP_TAG_H
13
14
#include "ns3/mac48-address.h"
15
#include "ns3/object.h"
16
#include "ns3/tag.h"
17
18
namespace
ns3
19
{
20
namespace
dot11s
21
{
22
/**
23
* \ingroup dot11s
24
*
25
* \brief Hwmp tag implements interaction between HWMP
26
* protocol and MeshWifiMac
27
*
28
* Hwmp tag keeps the following:
29
* 1. When packet is passed from Hwmp to 11sMAC:
30
* - retransmitter address,
31
* - TTL value,
32
* 2. When packet is passed to Hwmp from 11sMAC:
33
* - lasthop address,
34
* - TTL value,
35
* - metric value (metric of link is recalculated
36
* at each packet, but routing table stores metric
37
* obtained during path discovery procedure)
38
*/
39
class
HwmpTag
:
public
Tag
40
{
41
public
:
42
HwmpTag
();
43
~HwmpTag
()
override
;
44
/**
45
* Set address
46
* \param retransmitter the MAC address of the retransmitter
47
*/
48
void
SetAddress
(
Mac48Address
retransmitter);
49
/**
50
* Get address from tag
51
* \return the MAC address
52
*/
53
Mac48Address
GetAddress
();
54
/**
55
* Set the TTL value
56
* \param ttl
57
*/
58
void
SetTtl
(uint8_t ttl);
59
/**
60
* Get the TTL value
61
* \returns the TTL
62
*/
63
uint8_t
GetTtl
()
const
;
64
/**
65
* Set the metric value
66
* \param metric the metric
67
*/
68
void
SetMetric
(
uint32_t
metric);
69
/**
70
* Get the metric value
71
* \returns the metric
72
*/
73
uint32_t
GetMetric
()
const
;
74
/**
75
* Set sequence number
76
* \param seqno the sequence number
77
*/
78
void
SetSeqno
(
uint32_t
seqno);
79
/**
80
* Get the sequence number
81
* \returns the sequence number
82
*/
83
uint32_t
GetSeqno
()
const
;
84
/// Decrement TTL
85
void
DecrementTtl
();
86
87
/**
88
* \brief Get the type ID.
89
* \return the object TypeId
90
*/
91
static
TypeId
GetTypeId
();
92
TypeId
GetInstanceTypeId
()
const override
;
93
uint32_t
GetSerializedSize
()
const override
;
94
void
Serialize
(
TagBuffer
i)
const override
;
95
void
Deserialize
(
TagBuffer
i)
override
;
96
void
Print
(std::ostream& os)
const override
;
97
98
private
:
99
Mac48Address
m_address
;
///< address
100
uint8_t
m_ttl
;
///< TTL
101
uint32_t
m_metric
;
///< metric
102
uint32_t
m_seqno
;
///< sequence no
103
};
104
}
// namespace dot11s
105
}
// namespace ns3
106
#endif
ns3::Mac48Address
an EUI-48 address
Definition
mac48-address.h:35
ns3::TagBuffer
read and write tag data
Definition
tag-buffer.h:41
ns3::Tag
tag a set of bytes in a packet
Definition
tag.h:28
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::dot11s::HwmpTag
Hwmp tag implements interaction between HWMP protocol and MeshWifiMac.
Definition
hwmp-tag.h:40
ns3::dot11s::HwmpTag::SetTtl
void SetTtl(uint8_t ttl)
Set the TTL value.
Definition
hwmp-tag.cc:44
ns3::dot11s::HwmpTag::GetSeqno
uint32_t GetSeqno() const
Get the sequence number.
Definition
hwmp-tag.cc:74
ns3::dot11s::HwmpTag::SetMetric
void SetMetric(uint32_t metric)
Set the metric value.
Definition
hwmp-tag.cc:56
ns3::dot11s::HwmpTag::SetSeqno
void SetSeqno(uint32_t seqno)
Set sequence number.
Definition
hwmp-tag.cc:68
ns3::dot11s::HwmpTag::GetTtl
uint8_t GetTtl() const
Get the TTL value.
Definition
hwmp-tag.cc:50
ns3::dot11s::HwmpTag::GetAddress
Mac48Address GetAddress()
Get address from tag.
Definition
hwmp-tag.cc:38
ns3::dot11s::HwmpTag::~HwmpTag
~HwmpTag() override
Definition
hwmp-tag.cc:27
ns3::dot11s::HwmpTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
hwmp-tag.cc:94
ns3::dot11s::HwmpTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
hwmp-tag.cc:84
ns3::dot11s::HwmpTag::Serialize
void Serialize(TagBuffer i) const override
Definition
hwmp-tag.cc:109
ns3::dot11s::HwmpTag::m_address
Mac48Address m_address
address
Definition
hwmp-tag.h:99
ns3::dot11s::HwmpTag::m_ttl
uint8_t m_ttl
TTL.
Definition
hwmp-tag.h:100
ns3::dot11s::HwmpTag::Deserialize
void Deserialize(TagBuffer i) override
Definition
hwmp-tag.cc:124
ns3::dot11s::HwmpTag::m_metric
uint32_t m_metric
metric
Definition
hwmp-tag.h:101
ns3::dot11s::HwmpTag::HwmpTag
HwmpTag()
Definition
hwmp-tag.cc:19
ns3::dot11s::HwmpTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
hwmp-tag.cc:100
ns3::dot11s::HwmpTag::Print
void Print(std::ostream &os) const override
Definition
hwmp-tag.cc:139
ns3::dot11s::HwmpTag::SetAddress
void SetAddress(Mac48Address retransmitter)
Set address.
Definition
hwmp-tag.cc:32
ns3::dot11s::HwmpTag::m_seqno
uint32_t m_seqno
sequence no
Definition
hwmp-tag.h:102
ns3::dot11s::HwmpTag::GetMetric
uint32_t GetMetric() const
Get the metric value.
Definition
hwmp-tag.cc:62
ns3::dot11s::HwmpTag::DecrementTtl
void DecrementTtl()
Decrement TTL.
Definition
hwmp-tag.cc:148
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mesh
model
dot11s
hwmp-tag.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0