A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
cid.cc
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
87
bool
operator == (
const
Cid
&lhs,
88
const
Cid
&rhs)
89
{
90
return
lhs.m_identifier == rhs.m_identifier;
91
}
92
93
bool
operator != (
const
Cid &lhs,
94
const
Cid &rhs)
95
{
96
return
!(lhs == rhs);
97
}
98
99
std::ostream &
operator <<
(std::ostream &os,
const
Cid &cid)
100
{
101
os << cid.GetIdentifier ();
102
return
os;
103
}
104
105
}
// namespace ns3
ns3::Cid::IsMulticast
bool IsMulticast(void) const
Definition:
cid.cc:51
ns3::Cid::IsBroadcast
bool IsBroadcast(void) const
Definition:
cid.cc:56
ns3::Cid::IsPadding
bool IsPadding(void) const
Definition:
cid.cc:61
ns3::Cid::Broadcast
static Cid Broadcast(void)
Definition:
cid.cc:72
ns3::Cid::InitialRanging
static Cid InitialRanging(void)
Definition:
cid.cc:82
ns3::Cid::IsInitialRanging
bool IsInitialRanging(void) const
Definition:
cid.cc:66
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:43
ns3::Cid::Padding
static Cid Padding(void)
Definition:
cid.cc:77
ns3::Cid
Definition:
cid.h:35
ns3::Cid::GetIdentifier
uint16_t GetIdentifier(void) const
Definition:
cid.cc:45
src
wimax
model
cid.cc
Generated on Sun Mar 16 2014 11:25:12 for ns-3 by
1.8.6