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
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
address.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007 INRIA
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
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
21
#ifndef ADDRESS_H
22
#define ADDRESS_H
23
24
#include <stdint.h>
25
#include <ostream>
26
#include "ns3/attribute.h"
27
#include "ns3/attribute-helper.h"
28
#include "ns3/tag-buffer.h"
29
30
namespace
ns3 {
31
86
class
Address
87
{
88
public
:
93
enum
MaxSize_e
{
94
MAX_SIZE
= 20
95
};
96
100
Address
();
113
Address
(uint8_t type,
const
uint8_t *buffer, uint8_t len);
114
Address
(
const
Address
& address);
115
Address
&
operator =
(
const
Address
&address);
116
124
bool
IsInvalid
(
void
)
const
;
128
uint8_t
GetLength
(
void
)
const
;
133
uint32_t
CopyTo
(uint8_t buffer[
MAX_SIZE
])
const
;
144
uint32_t
CopyAllTo
(uint8_t *buffer, uint8_t len)
const
;
155
uint32_t
CopyFrom
(
const
uint8_t *buffer, uint8_t len);
166
uint32_t
CopyAllFrom
(
const
uint8_t *buffer, uint8_t len);
174
bool
CheckCompatible
(uint8_t type, uint8_t len)
const
;
185
bool
IsMatchingType
(uint8_t type)
const
;
190
static
uint8_t
Register
(
void
);
197
uint32_t
GetSerializedSize
(
void
)
const
;
203
void
Serialize
(
TagBuffer
buffer)
const
;
209
void
Deserialize
(
TagBuffer
buffer);
210
211
private
:
212
friend
bool
operator ==
(
const
Address
&a,
const
Address
&b);
213
friend
bool
operator <
(
const
Address
&a,
const
Address
&b);
214
friend
std::ostream&
operator<<
(std::ostream& os,
const
Address
& address);
215
friend
std::istream&
operator>>
(std::istream& is,
Address
& address);
216
217
uint8_t
m_type
;
218
uint8_t
m_len
;
219
uint8_t
m_data
[
MAX_SIZE
];
220
};
221
227
ATTRIBUTE_HELPER_HEADER
(
Address
);
228
229
bool
operator ==
(
const
Address
&a,
const
Address
&b);
230
bool
operator !=
(
const
Address
&a,
const
Address
&b);
231
bool
operator <
(
const
Address
&a,
const
Address
&b);
232
std::ostream&
operator<<
(std::ostream& os,
const
Address
& address);
233
std::istream&
operator>>
(std::istream& is,
Address
& address);
234
235
236
}
// namespace ns3
237
238
#endif
/* ADDRESS_H */
src
network
model
address.h
Generated on Tue Nov 13 2012 10:32:19 for ns-3 by
1.8.1.2