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
cid.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007,2008,2009 INRIA, UDcast
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19
* <amine.ismail@UDcast.com>
20
*/
21
22
#include "
cid.h
"
23
24
// 0 will match IR CID, -1 will match broadcast CID 0xFFFF, hence 60000
25
#define CID_UNINITIALIZED 60000
26
27
namespace
ns3
28
{
29
30
Cid::Cid
()
31
{
32
m_identifier
=
CID_UNINITIALIZED
;
33
}
34
35
Cid::Cid
(uint16_t identifier)
36
{
37
m_identifier
= identifier;
38
}
39
40
Cid::~Cid
()
41
{
42
}
43
44
uint16_t
45
Cid::GetIdentifier
()
const
46
{
47
return
m_identifier
;
48
}
49
50
bool
51
Cid::IsMulticast
()
const
52
{
53
return
m_identifier
>= 0xff00 &&
m_identifier
<= 0xfffd;
54
}
55
56
bool
57
Cid::IsBroadcast
()
const
58
{
59
return
*
this
==
Broadcast
();
60
}
61
62
bool
63
Cid::IsPadding
()
const
64
{
65
return
*
this
==
Padding
();
66
}
67
68
bool
69
Cid::IsInitialRanging
()
const
70
{
71
return
*
this
==
InitialRanging
();
72
}
73
74
Cid
75
Cid::Broadcast
()
76
{
77
return
0xffff;
78
}
79
80
Cid
81
Cid::Padding
()
82
{
83
return
0xfffe;
84
}
85
86
Cid
87
Cid::InitialRanging
()
88
{
89
return
0;
90
}
91
98
bool
99
operator==
(
const
Cid
& lhs,
const
Cid
& rhs)
100
{
101
return
lhs.
m_identifier
== rhs.
m_identifier
;
102
}
103
110
bool
111
operator!=
(
const
Cid
& lhs,
const
Cid
& rhs)
112
{
113
return
!(lhs == rhs);
114
}
115
122
std::ostream&
123
operator<<
(std::ostream& os,
const
Cid
& cid)
124
{
125
os << cid.
GetIdentifier
();
126
return
os;
127
}
128
129
}
// namespace ns3
CID_UNINITIALIZED
#define CID_UNINITIALIZED
Definition:
cid.cc:25
cid.h
ns3::Cid
Cid class.
Definition:
cid.h:37
ns3::Cid::GetIdentifier
uint16_t GetIdentifier() const
Definition:
cid.cc:45
ns3::Cid::IsInitialRanging
bool IsInitialRanging() const
Definition:
cid.cc:69
ns3::Cid::~Cid
~Cid()
Definition:
cid.cc:40
ns3::Cid::Cid
Cid()
Create a cid of unknown type.
Definition:
cid.cc:30
ns3::Cid::InitialRanging
static Cid InitialRanging()
Definition:
cid.cc:87
ns3::Cid::IsPadding
bool IsPadding() const
Definition:
cid.cc:63
ns3::Cid::Padding
static Cid Padding()
Definition:
cid.cc:81
ns3::Cid::IsMulticast
bool IsMulticast() const
Definition:
cid.cc:51
ns3::Cid::IsBroadcast
bool IsBroadcast() const
Definition:
cid.cc:57
ns3::Cid::Broadcast
static Cid Broadcast()
Definition:
cid.cc:75
ns3::Cid::m_identifier
uint16_t m_identifier
identiifier
Definition:
cid.h:98
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator!=
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
Definition:
callback.h:676
ns3::operator==
bool operator==(const EventId &a, const EventId &b)
Definition:
event-id.h:157
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:129
src
wimax
model
cid.cc
Generated on Sun Jul 2 2023 18:22:19 for ns-3 by
1.9.6