A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
network
utils
packet-socket-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
#ifndef PACKET_SOCKET_ADDRESS_H
21
#define PACKET_SOCKET_ADDRESS_H
22
23
#include "ns3/ptr.h"
24
#include "ns3/address.h"
25
#include "
mac48-address.h
"
26
#include "
mac64-address.h
"
27
#include "ns3/net-device.h"
28
29
namespace
ns3
{
30
31
class
NetDevice;
32
38
class
PacketSocketAddress
39
{
40
public
:
41
PacketSocketAddress
();
42
47
void
SetProtocol
(uint16_t protocol);
48
52
void
SetAllDevices
(
void
);
53
58
void
SetSingleDevice
(uint32_t device);
59
64
void
SetPhysicalAddress
(
const
Address
address
);
65
70
uint16_t
GetProtocol
(
void
)
const
;
71
76
uint32_t
GetSingleDevice
(
void
)
const
;
77
82
bool
IsSingleDevice
(
void
)
const
;
83
88
Address
GetPhysicalAddress
(
void
)
const
;
89
95
operator
Address
()
const
;
96
103
static
PacketSocketAddress
ConvertFrom
(
const
Address
&
address
);
104
109
static
bool
IsMatchingType
(
const
Address
&
address
);
110
private
:
111
116
static
uint8_t
GetType
(
void
);
117
122
Address
ConvertTo
(
void
)
const
;
123
124
uint16_t
m_protocol
;
125
bool
m_isSingleDevice
;
126
uint32_t
m_device
;
127
Address
m_address
;
128
};
129
130
131
}
// namespace ns3
132
133
#endif
/* PACKET_SOCKET_ADDRESS_H */
ns3::PacketSocketAddress::ConvertTo
Address ConvertTo(void) const
Convert an instance of this class to a polymorphic Address instance.
Definition:
packet-socket-address.cc:90
ns3::PacketSocketAddress
an address for a packet socket
Definition:
packet-socket-address.h:38
mac64-address.h
ns3::PacketSocketAddress::IsMatchingType
static bool IsMatchingType(const Address &address)
Definition:
packet-socket-address.cc:138
ns3::PacketSocketAddress::SetAllDevices
void SetAllDevices(void)
Set the address to match all the outgoing NetDevice.
Definition:
packet-socket-address.cc:39
ns3::PacketSocketAddress::SetSingleDevice
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Definition:
packet-socket-address.cc:46
ns3::Address
a polymophic address class
Definition:
address.h:90
ns3::PacketSocketAddress::PacketSocketAddress
PacketSocketAddress()
Definition:
packet-socket-address.cc:28
ns3::PacketSocketAddress::IsSingleDevice
bool IsSingleDevice(void) const
Checks if the address is bound to a specified NetDevice.
Definition:
packet-socket-address.cc:66
ns3::PacketSocketAddress::GetProtocol
uint16_t GetProtocol(void) const
Get the protocol.
Definition:
packet-socket-address.cc:60
ns3::PacketSocketAddress::m_device
uint32_t m_device
Outgoing NetDevice index.
Definition:
packet-socket-address.h:126
ns3::PacketSocketAddress::GetType
static uint8_t GetType(void)
Return the Type of address.
Definition:
packet-socket-address.cc:144
ns3::PacketSocketAddress::GetSingleDevice
uint32_t GetSingleDevice(void) const
Get the device this address is bound to.
Definition:
packet-socket-address.cc:72
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::PacketSocketAddress::SetPhysicalAddress
void SetPhysicalAddress(const Address address)
Set the destination address.
Definition:
packet-socket-address.cc:53
first.address
address
Definition:
first.py:37
ns3::PacketSocketAddress::m_protocol
uint16_t m_protocol
Protocol.
Definition:
packet-socket-address.h:124
ns3::PacketSocketAddress::m_address
Address m_address
Destination address.
Definition:
packet-socket-address.h:127
mac48-address.h
ns3::PacketSocketAddress::SetProtocol
void SetProtocol(uint16_t protocol)
Set the protocol.
Definition:
packet-socket-address.cc:33
ns3::PacketSocketAddress::ConvertFrom
static PacketSocketAddress ConvertFrom(const Address &address)
Definition:
packet-socket-address.cc:106
ns3::PacketSocketAddress::GetPhysicalAddress
Address GetPhysicalAddress(void) const
Get the destination address.
Definition:
packet-socket-address.cc:78
ns3::PacketSocketAddress::m_isSingleDevice
bool m_isSingleDevice
True if directed to a specific outgoing NetDevice.
Definition:
packet-socket-address.h:125
Generated on Wed Nov 7 2018 10:02:07 for ns-3 by
1.8.14