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.h
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
#ifndef STATUS_CODE_H
10
#define STATUS_CODE_H
11
12
#include "ns3/buffer.h"
13
14
namespace
ns3
15
{
16
17
/**
18
* Status code for association response.
19
*/
20
class
StatusCode
21
{
22
public
:
23
StatusCode
();
24
/**
25
* Set success bit to 0 (success).
26
*/
27
void
SetSuccess
();
28
/**
29
* Set success bit to 1 (failure).
30
*/
31
void
SetFailure
();
32
33
/**
34
* Return whether the status code is success.
35
*
36
* \return true if success,
37
* false otherwise
38
*/
39
bool
IsSuccess
()
const
;
40
41
/**
42
* \returns the expected size of the status code.
43
*
44
* This method should return the number of bytes which are needed to store
45
* the status code data by Serialize.
46
*/
47
uint32_t
GetSerializedSize
()
const
;
48
/**
49
* \param start an iterator which points to where the status code should be written
50
*
51
* \return Buffer::Iterator
52
*
53
* This method is used to store a status code into the byte buffer.
54
* The data written is expected to match bit-for-bit the representation of this
55
* header in a real network.
56
*/
57
Buffer::Iterator
Serialize
(
Buffer::Iterator
start)
const
;
58
/**
59
* \param start an iterator which points to where the status code should be read.
60
*
61
* \returns the number of bytes read.
62
*
63
* This method is used to re-create a status code from the byte buffer.
64
* The data read is expected to match bit-for-bit the representation of this
65
* header in real networks.
66
*/
67
Buffer::Iterator
Deserialize
(
Buffer::Iterator
start);
68
69
private
:
70
uint16_t
m_code
;
///< status code
71
};
72
73
/**
74
* Serialize StatusCode to the given ostream.
75
*
76
* \param os the output stream
77
* \param code the StatusCode
78
*
79
* \return std::ostream
80
*/
81
std::ostream&
operator<<
(std::ostream& os,
const
StatusCode
& code);
82
83
}
// namespace ns3
84
85
#endif
/* STATUS_CODE_H */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
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
src
wifi
model
status-code.h
Generated on Fri Nov 8 2024 13:59:08 for ns-3 by
1.11.0