A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
packet-socket-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 PACKET_SOCKET_ADDRESS_H
20
#define PACKET_SOCKET_ADDRESS_H
21
22
#include "
mac48-address.h
"
23
#include "
mac64-address.h
"
24
25
#include "ns3/address.h"
26
#include "ns3/net-device.h"
27
#include "ns3/ptr.h"
28
29
namespace
ns3
30
{
31
32
class
NetDevice;
33
39
class
PacketSocketAddress
40
{
41
public
:
42
PacketSocketAddress
();
43
48
void
SetProtocol
(uint16_t protocol);
49
53
void
SetAllDevices
();
54
59
void
SetSingleDevice
(uint32_t device);
60
65
void
SetPhysicalAddress
(
const
Address
address
);
66
71
uint16_t
GetProtocol
()
const
;
72
77
uint32_t
GetSingleDevice
()
const
;
78
83
bool
IsSingleDevice
()
const
;
84
89
Address
GetPhysicalAddress
()
const
;
90
96
operator
Address
()
const
;
97
104
static
PacketSocketAddress
ConvertFrom
(
const
Address
&
address
);
105
110
Address
ConvertTo
()
const
;
111
116
static
bool
IsMatchingType
(
const
Address
&
address
);
117
118
private
:
123
static
uint8_t
GetType
();
124
125
uint16_t
m_protocol
;
126
bool
m_isSingleDevice
;
127
uint32_t
m_device
;
128
Address
m_address
;
129
};
130
131
}
// namespace ns3
132
133
#endif
/* PACKET_SOCKET_ADDRESS_H */
ns3::Address
a polymophic address class
Definition:
address.h:101
ns3::PacketSocketAddress
an address for a packet socket
Definition:
packet-socket-address.h:40
ns3::PacketSocketAddress::PacketSocketAddress
PacketSocketAddress()
Definition:
packet-socket-address.cc:29
ns3::PacketSocketAddress::ConvertTo
Address ConvertTo() const
Convert an instance of this class to a polymorphic Address instance.
Definition:
packet-socket-address.cc:98
ns3::PacketSocketAddress::GetSingleDevice
uint32_t GetSingleDevice() const
Get the device this address is bound to.
Definition:
packet-socket-address.cc:79
ns3::PacketSocketAddress::IsSingleDevice
bool IsSingleDevice() const
Checks if the address is bound to a specified NetDevice.
Definition:
packet-socket-address.cc:72
ns3::PacketSocketAddress::GetPhysicalAddress
Address GetPhysicalAddress() const
Get the destination address.
Definition:
packet-socket-address.cc:86
ns3::PacketSocketAddress::m_address
Address m_address
Destination address.
Definition:
packet-socket-address.h:128
ns3::PacketSocketAddress::m_device
uint32_t m_device
Outgoing NetDevice index.
Definition:
packet-socket-address.h:127
ns3::PacketSocketAddress::SetProtocol
void SetProtocol(uint16_t protocol)
Set the protocol.
Definition:
packet-socket-address.cc:35
ns3::PacketSocketAddress::IsMatchingType
static bool IsMatchingType(const Address &address)
Definition:
packet-socket-address.cc:148
ns3::PacketSocketAddress::SetPhysicalAddress
void SetPhysicalAddress(const Address address)
Set the destination address.
Definition:
packet-socket-address.cc:58
ns3::PacketSocketAddress::m_isSingleDevice
bool m_isSingleDevice
True if directed to a specific outgoing NetDevice.
Definition:
packet-socket-address.h:126
ns3::PacketSocketAddress::ConvertFrom
static PacketSocketAddress ConvertFrom(const Address &address)
Definition:
packet-socket-address.cc:115
ns3::PacketSocketAddress::SetSingleDevice
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Definition:
packet-socket-address.cc:50
ns3::PacketSocketAddress::GetType
static uint8_t GetType()
Return the Type of address.
Definition:
packet-socket-address.cc:155
ns3::PacketSocketAddress::m_protocol
uint16_t m_protocol
Protocol.
Definition:
packet-socket-address.h:125
ns3::PacketSocketAddress::SetAllDevices
void SetAllDevices()
Set the address to match all the outgoing NetDevice.
Definition:
packet-socket-address.cc:42
ns3::PacketSocketAddress::GetProtocol
uint16_t GetProtocol() const
Get the protocol.
Definition:
packet-socket-address.cc:65
mac48-address.h
mac64-address.h
first.address
address
Definition:
first.py:47
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
utils
packet-socket-address.h
Generated on Sun Mar 3 2024 17:11:06 for ns-3 by
1.9.1