A Discrete-Event Network Simulator
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
11namespace ns3
12{
13
17
18void
23
24void
29
30bool
32{
33 return (m_code == 0);
34}
35
38{
39 return 2;
40}
41
44{
46 return start;
47}
48
51{
52 m_code = start.ReadLsbtohU16();
53 return start;
54}
55
56std::ostream&
57operator<<(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
iterator in a Buffer instance
Definition buffer.h:89
void WriteHtolsbU16(uint16_t data)
Definition buffer.cc:891
Status code for association response.
Definition status-code.h:21
bool IsSuccess() const
Return whether the status code is success.
Buffer::Iterator Serialize(Buffer::Iterator start) const
void SetFailure()
Set success bit to 1 (failure).
Buffer::Iterator Deserialize(Buffer::Iterator start)
uint16_t m_code
status code
Definition status-code.h:70
uint32_t GetSerializedSize() const
void SetSuccess()
Set success bit to 0 (success).
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148