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
sixlowpan-nd-context.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Università di Firenze, Italy
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*
7
*
8
* Author: Alessio Bonadio <alessio.bonadio@gmail.com>
9
* Tommaso Pecorella <tommaso.pecorella@unifi.it>
10
* Adnan Rashid <adnanrashidpk@gmail.com>
11
*/
12
13
#ifndef SIXLOW_ND_CONTEXT_H
14
#define SIXLOW_ND_CONTEXT_H
15
16
#include "ns3/ipv6-address.h"
17
#include "ns3/nstime.h"
18
#include "ns3/output-stream-wrapper.h"
19
#include "ns3/simple-ref-count.h"
20
21
#include <stdint.h>
22
23
namespace
ns3
24
{
25
26
/**
27
* @ingroup sixlowpan
28
* @brief 6LoWPAN context container for 6LoWPAN ND.
29
*/
30
class
SixLowPanNdContext
:
public
SimpleRefCount
<SixLowPanNdContext>
31
{
32
public
:
33
/**
34
* @brief Constructor.
35
*/
36
SixLowPanNdContext
();
37
38
/**
39
* @brief Constructor.
40
* @param flagC compression flag
41
* @param cid context identifier ( 0 <= x <= 15)
42
* @param time valid lifetime of context
43
* @param context 6LoWPAN context advertised
44
*/
45
SixLowPanNdContext
(
bool
flagC, uint8_t cid,
Time
time,
Ipv6Prefix
context);
46
47
/**
48
* @brief Destructor.
49
*/
50
~SixLowPanNdContext
();
51
52
/**
53
* @brief Get the context length.
54
* @return context length value
55
*/
56
uint8_t
GetContextLen
()
const
;
57
58
/**
59
* @brief Is compression flag ?
60
* @return true if context is valid for use in compression, false otherwise
61
*/
62
bool
IsFlagC
()
const
;
63
64
/**
65
* @brief Set the compression flag.
66
* @param c the compression flag
67
*/
68
void
SetFlagC
(
bool
c);
69
70
/**
71
* @brief Get the context identifier.
72
* @return context identifier value
73
*/
74
uint8_t
GetCid
()
const
;
75
76
/**
77
* @brief Set the context identifier.
78
* @param cid the context identifier value
79
*/
80
void
SetCid
(uint8_t cid);
81
82
/**
83
* @brief Get the valid lifetime.
84
* @return valid lifetime value
85
*/
86
Time
GetValidTime
()
const
;
87
88
/**
89
* @brief Set the valid lifetime.
90
* @param time the valid lifetime value
91
*/
92
void
SetValidTime
(
Time
time);
93
94
/**
95
* @brief Set the last update time.
96
* @param time the last update time
97
*/
98
void
SetLastUpdateTime
(
Time
time);
99
100
/**
101
* @brief Get the last update time.
102
* @return the last update time
103
*/
104
Time
GetLastUpdateTime
();
105
106
/**
107
* @brief Get the 6LoWPAN context prefix.
108
* @return context prefix value
109
*/
110
Ipv6Prefix
GetContextPrefix
()
const
;
111
112
/**
113
* @brief Set the 6LoWPAN context prefix.
114
* @param context the context prefix value
115
*/
116
void
SetContextPrefix
(
Ipv6Prefix
context);
117
118
/**
119
* @brief Print the 6LoWPAN context.
120
* @param stream the ostream the 6LoWPAN context is printed to
121
*/
122
void
PrintContext
(
Ptr<OutputStreamWrapper>
stream);
123
124
private
:
125
/**
126
* @brief The compression flag, indicates that this context is valid for use in compression.
127
*/
128
bool
m_c
;
129
130
/**
131
* @brief The context identifier value.
132
*/
133
uint8_t
m_cid
;
134
135
/**
136
* @brief The valid lifetime value.
137
*/
138
Time
m_validTime
;
139
140
/**
141
* @brief The context last update time.
142
*/
143
Time
m_lastUpdateTime
;
144
145
/**
146
* @brief The context prefix value.
147
*/
148
Ipv6Prefix
m_context
;
149
};
150
151
}
/* namespace ns3 */
152
153
#endif
/* SIXLOW_ND_CONTEXT_H */
ns3::Ipv6Prefix
Describes an IPv6 prefix.
Definition
ipv6-address.h:469
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::SimpleRefCount< SixLowPanNdContext >::SimpleRefCount
SimpleRefCount()
Definition
simple-ref-count.h:79
ns3::SixLowPanNdContext::GetCid
uint8_t GetCid() const
Get the context identifier.
Definition
sixlowpan-nd-context.cc:68
ns3::SixLowPanNdContext::IsFlagC
bool IsFlagC() const
Is compression flag ?
Definition
sixlowpan-nd-context.cc:54
ns3::SixLowPanNdContext::m_validTime
Time m_validTime
The valid lifetime value.
Definition
sixlowpan-nd-context.h:138
ns3::SixLowPanNdContext::SixLowPanNdContext
SixLowPanNdContext()
Constructor.
Definition
sixlowpan-nd-context.cc:23
ns3::SixLowPanNdContext::~SixLowPanNdContext
~SixLowPanNdContext()
Destructor.
Definition
sixlowpan-nd-context.cc:41
ns3::SixLowPanNdContext::GetValidTime
Time GetValidTime() const
Get the valid lifetime.
Definition
sixlowpan-nd-context.cc:83
ns3::SixLowPanNdContext::m_context
Ipv6Prefix m_context
The context prefix value.
Definition
sixlowpan-nd-context.h:148
ns3::SixLowPanNdContext::SetFlagC
void SetFlagC(bool c)
Set the compression flag.
Definition
sixlowpan-nd-context.cc:61
ns3::SixLowPanNdContext::SetValidTime
void SetValidTime(Time time)
Set the valid lifetime.
Definition
sixlowpan-nd-context.cc:91
ns3::SixLowPanNdContext::GetContextLen
uint8_t GetContextLen() const
Get the context length.
Definition
sixlowpan-nd-context.cc:47
ns3::SixLowPanNdContext::m_lastUpdateTime
Time m_lastUpdateTime
The context last update time.
Definition
sixlowpan-nd-context.h:143
ns3::SixLowPanNdContext::PrintContext
void PrintContext(Ptr< OutputStreamWrapper > stream)
Print the 6LoWPAN context.
Definition
sixlowpan-nd-context.cc:138
ns3::SixLowPanNdContext::m_c
bool m_c
The compression flag, indicates that this context is valid for use in compression.
Definition
sixlowpan-nd-context.h:128
ns3::SixLowPanNdContext::SetCid
void SetCid(uint8_t cid)
Set the context identifier.
Definition
sixlowpan-nd-context.cc:75
ns3::SixLowPanNdContext::GetLastUpdateTime
Time GetLastUpdateTime()
Get the last update time.
Definition
sixlowpan-nd-context.cc:117
ns3::SixLowPanNdContext::SetContextPrefix
void SetContextPrefix(Ipv6Prefix context)
Set the 6LoWPAN context prefix.
Definition
sixlowpan-nd-context.cc:131
ns3::SixLowPanNdContext::SetLastUpdateTime
void SetLastUpdateTime(Time time)
Set the last update time.
Definition
sixlowpan-nd-context.cc:110
ns3::SixLowPanNdContext::GetContextPrefix
Ipv6Prefix GetContextPrefix() const
Get the 6LoWPAN context prefix.
Definition
sixlowpan-nd-context.cc:124
ns3::SixLowPanNdContext::m_cid
uint8_t m_cid
The context identifier value.
Definition
sixlowpan-nd-context.h:133
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:95
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
sixlowpan
model
sixlowpan-nd-context.h
Generated on
for ns-3 by
1.15.0