A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
mac64-address.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 INRIA
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
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
*/
19
#ifndef MAC64_ADDRESS_H
20
#define MAC64_ADDRESS_H
21
22
#include "
ipv4-address.h
"
23
#include "
ipv6-address.h
"
24
25
#include "ns3/attribute-helper.h"
26
#include "ns3/attribute.h"
27
28
#include <ostream>
29
#include <stdint.h>
30
31
namespace
ns3
32
{
33
34
class
Address;
35
45
class
Mac64Address
46
{
47
public
:
48
Mac64Address
();
54
Mac64Address
(
const
char
* str);
55
61
void
CopyFrom
(
const
uint8_t buffer[8]);
67
void
CopyTo
(uint8_t buffer[8])
const
;
73
operator
Address
()
const
;
82
static
Mac64Address
ConvertFrom
(
const
Address
&
address
);
88
Address
ConvertTo
()
const
;
89
94
static
bool
IsMatchingType
(
const
Address
&
address
);
99
static
Mac64Address
Allocate
();
100
114
static
void
ResetAllocationIndex
();
115
116
private
:
121
static
uint8_t
GetType
();
122
130
friend
bool
operator==
(
const
Mac64Address
& a,
const
Mac64Address
& b);
131
139
friend
bool
operator!=
(
const
Mac64Address
& a,
const
Mac64Address
& b);
140
148
friend
bool
operator<
(
const
Mac64Address
& a,
const
Mac64Address
& b);
149
157
friend
std::ostream&
operator<<
(std::ostream& os,
const
Mac64Address
&
address
);
158
166
friend
std::istream&
operator>>
(std::istream& is,
Mac64Address
&
address
);
167
168
static
uint64_t
m_allocationIndex
;
169
uint8_t
m_address
[8];
170
};
171
177
ATTRIBUTE_HELPER_HEADER
(
Mac64Address
);
178
179
inline
bool
180
operator==
(
const
Mac64Address
& a,
const
Mac64Address
& b)
181
{
182
return
memcmp(a.
m_address
, b.
m_address
, 8) == 0;
183
}
184
185
inline
bool
186
operator!=
(
const
Mac64Address
& a,
const
Mac64Address
& b)
187
{
188
return
memcmp(a.
m_address
, b.
m_address
, 8) != 0;
189
}
190
191
inline
bool
192
operator<
(
const
Mac64Address
& a,
const
Mac64Address
& b)
193
{
194
return
memcmp(a.
m_address
, b.
m_address
, 8) < 0;
195
}
196
197
std::ostream&
operator<<
(std::ostream& os,
const
Mac64Address
&
address
);
198
std::istream&
operator>>
(std::istream& is,
Mac64Address
&
address
);
199
200
}
// namespace ns3
201
202
#endif
/* MAC64_ADDRESS_H */
ns3::Address
a polymophic address class
Definition:
address.h:100
ns3::Mac64Address
an EUI-64 address
Definition:
mac64-address.h:46
ns3::Mac64Address::m_address
uint8_t m_address[8]
address value
Definition:
mac64-address.h:169
ns3::Mac64Address::operator>>
friend std::istream & operator>>(std::istream &is, Mac64Address &address)
Stream extraction operator.
Definition:
mac64-address.cc:208
ns3::Mac64Address::ConvertTo
Address ConvertTo() const
Definition:
mac64-address.cc:144
ns3::Mac64Address::IsMatchingType
static bool IsMatchingType(const Address &address)
Definition:
mac64-address.cc:122
ns3::Mac64Address::Allocate
static Mac64Address Allocate()
Allocate a new Mac64Address.
Definition:
mac64-address.cc:151
ns3::Mac64Address::CopyFrom
void CopyFrom(const uint8_t buffer[8])
Definition:
mac64-address.cc:108
ns3::Mac64Address::operator!=
friend bool operator!=(const Mac64Address &a, const Mac64Address &b)
Not equal to operator.
Definition:
mac64-address.h:186
ns3::Mac64Address::operator==
friend bool operator==(const Mac64Address &a, const Mac64Address &b)
Equal to operator.
Definition:
mac64-address.h:180
ns3::Mac64Address::operator<<
friend std::ostream & operator<<(std::ostream &os, const Mac64Address &address)
Stream insertion operator.
Definition:
mac64-address.cc:189
ns3::Mac64Address::Mac64Address
Mac64Address()
Definition:
mac64-address.cc:69
ns3::Mac64Address::CopyTo
void CopyTo(uint8_t buffer[8]) const
Definition:
mac64-address.cc:115
ns3::Mac64Address::ConvertFrom
static Mac64Address ConvertFrom(const Address &address)
Definition:
mac64-address.cc:134
ns3::Mac64Address::ResetAllocationIndex
static void ResetAllocationIndex()
Reset the Mac64Address allocation index.
Definition:
mac64-address.cc:174
ns3::Mac64Address::GetType
static uint8_t GetType()
Return the Type of address.
Definition:
mac64-address.cc:181
ns3::Mac64Address::operator<
friend bool operator<(const Mac64Address &a, const Mac64Address &b)
Less than operator.
Definition:
mac64-address.h:192
ns3::Mac64Address::m_allocationIndex
static uint64_t m_allocationIndex
Address allocation index.
Definition:
mac64-address.h:168
ipv4-address.h
ipv6-address.h
first.address
address
Definition:
first.py:40
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:681
ns3::operator==
bool operator==(const EventId &a, const EventId &b)
Definition:
event-id.h:157
ns3::ATTRIBUTE_HELPER_HEADER
ATTRIBUTE_HELPER_HEADER(ValueClassTest)
ns3::operator<
bool operator<(const EventId &a, const EventId &b)
Definition:
event-id.h:170
ns3::operator>>
std::istream & operator>>(std::istream &is, Angles &a)
Definition:
angles.cc:153
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:129
src
network
utils
mac64-address.h
Generated on Fri Mar 31 2023 13:30:49 for ns-3 by
1.9.1