A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
cid.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007,2008,2009 INRIA, UDcast
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
20
* <amine.ismail@UDcast.com>
21
*/
22
23
#include "
cid.h
"
24
25
// 0 will match IR CID, -1 will match broadcast CID 0xFFFF, hence 60000
26
#define CID_UNINITIALIZED 60000
27
28
namespace
ns3
{
29
30
Cid::Cid
(
void
)
31
{
32
m_identifier
=
CID_UNINITIALIZED
;
33
}
34
35
Cid::Cid
(uint16_t identifier)
36
{
37
m_identifier
= identifier;
38
}
39
40
Cid::~Cid
(
void
)
41
{
42
}
43
44
uint16_t
45
Cid::GetIdentifier
(
void
)
const
46
{
47
return
m_identifier
;
48
}
49
50
bool
51
Cid::IsMulticast
(
void
)
const
52
{
53
return
m_identifier
>= 0xff00 &&
m_identifier
<= 0xfffd;
54
}
55
bool
56
Cid::IsBroadcast
(
void
)
const
57
{
58
return
*
this
==
Broadcast
();
59
}
60
bool
61
Cid::IsPadding
(
void
)
const
62
{
63
return
*
this
==
Padding
();
64
}
65
bool
66
Cid::IsInitialRanging
(
void
)
const
67
{
68
return
*
this
==
InitialRanging
();
69
}
70
71
Cid
72
Cid::Broadcast
(
void
)
73
{
74
return
0xffff;
75
}
76
Cid
77
Cid::Padding
(
void
)
78
{
79
return
0xfffe;
80
}
81
Cid
82
Cid::InitialRanging
(
void
)
83
{
84
return
0;
85
}
86
93
bool
operator ==
(
const
Cid
&lhs,
94
const
Cid
&rhs)
95
{
96
return
lhs.
m_identifier
== rhs.
m_identifier
;
97
}
98
105
bool
operator !=
(
const
Cid
&lhs,
106
const
Cid
&rhs)
107
{
108
return
!(lhs == rhs);
109
}
110
117
std::ostream &
operator <<
(std::ostream &os,
const
Cid
&cid)
118
{
119
os << cid.
GetIdentifier
();
120
return
os;
121
}
122
123
}
// namespace ns3
CID_UNINITIALIZED
#define CID_UNINITIALIZED
Definition:
cid.cc:26
cid.h
ns3::Cid
Cid class.
Definition:
cid.h:38
ns3::Cid::GetIdentifier
uint16_t GetIdentifier(void) const
Definition:
cid.cc:45
ns3::Cid::~Cid
~Cid(void)
Definition:
cid.cc:40
ns3::Cid::InitialRanging
static Cid InitialRanging(void)
Definition:
cid.cc:82
ns3::Cid::IsInitialRanging
bool IsInitialRanging(void) const
Definition:
cid.cc:66
ns3::Cid::IsPadding
bool IsPadding(void) const
Definition:
cid.cc:61
ns3::Cid::IsMulticast
bool IsMulticast(void) const
Definition:
cid.cc:51
ns3::Cid::Cid
Cid(void)
Create a cid of unknown type.
Definition:
cid.cc:30
ns3::Cid::Padding
static Cid Padding(void)
Definition:
cid.cc:77
ns3::Cid::Broadcast
static Cid Broadcast(void)
Definition:
cid.cc:72
ns3::Cid::IsBroadcast
bool IsBroadcast(void) const
Definition:
cid.cc:56
ns3::Cid::m_identifier
uint16_t m_identifier
identiifier
Definition:
cid.h:99
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator==
bool operator==(const EventId &a, const EventId &b)
Definition:
event-id.h:158
ns3::operator!=
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
Definition:
callback.h:1612
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:139
src
wimax
model
cid.cc
Generated on Tue Feb 6 2024 19:21:30 for ns-3 by
1.9.1