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
status-code.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2006 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
9
#include "
status-code.h
"
10
11
namespace
ns3
12
{
13
14
StatusCode::StatusCode
()
15
{
16
}
17
18
void
19
StatusCode::SetSuccess
()
20
{
21
m_code
= 0;
22
}
23
24
void
25
StatusCode::SetFailure
()
26
{
27
m_code
= 1;
28
}
29
30
bool
31
StatusCode::IsSuccess
()
const
32
{
33
return
(
m_code
== 0);
34
}
35
36
uint32_t
37
StatusCode::GetSerializedSize
()
const
38
{
39
return
2;
40
}
41
42
Buffer::Iterator
43
StatusCode::Serialize
(
Buffer::Iterator
start)
const
44
{
45
start.
WriteHtolsbU16
(
m_code
);
46
return
start;
47
}
48
49
Buffer::Iterator
50
StatusCode::Deserialize
(
Buffer::Iterator
start)
51
{
52
m_code
= start.ReadLsbtohU16();
53
return
start;
54
}
55
56
std::ostream&
57
operator<<
(std::ostream& os,
const
StatusCode
& code)
58
{
59
if
(code.
IsSuccess
())
60
{
61
os <<
"success"
;
62
}
63
else
64
{
65
os <<
"failure"
;
66
}
67
return
os;
68
}
69
70
}
// namespace ns3
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Buffer::Iterator::WriteHtolsbU16
void WriteHtolsbU16(uint16_t data)
Definition
buffer.cc:891
ns3::StatusCode
Status code for association response.
Definition
status-code.h:21
ns3::StatusCode::IsSuccess
bool IsSuccess() const
Return whether the status code is success.
Definition
status-code.cc:31
ns3::StatusCode::StatusCode
StatusCode()
Definition
status-code.cc:14
ns3::StatusCode::Serialize
Buffer::Iterator Serialize(Buffer::Iterator start) const
Definition
status-code.cc:43
ns3::StatusCode::SetFailure
void SetFailure()
Set success bit to 1 (failure).
Definition
status-code.cc:25
ns3::StatusCode::Deserialize
Buffer::Iterator Deserialize(Buffer::Iterator start)
Definition
status-code.cc:50
ns3::StatusCode::m_code
uint16_t m_code
status code
Definition
status-code.h:70
ns3::StatusCode::GetSerializedSize
uint32_t GetSerializedSize() const
Definition
status-code.cc:37
ns3::StatusCode::SetSuccess
void SetSuccess()
Set success bit to 0 (success).
Definition
status-code.cc:19
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition
angles.cc:148
status-code.h
src
wifi
model
status-code.cc
Generated on Fri Nov 8 2024 13:59:08 for ns-3 by
1.11.0