A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
inet-socket-address.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005 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
20
#ifndef INET_SOCKET_ADDRESS_H
21
#define INET_SOCKET_ADDRESS_H
22
23
#include "
ipv4-address.h
"
24
25
#include "ns3/address.h"
26
27
#include <stdint.h>
28
29
namespace
ns3
30
{
31
41
class
InetSocketAddress
42
{
43
public
:
48
InetSocketAddress
(
Ipv4Address
ipv4, uint16_t
port
);
54
InetSocketAddress
(
Ipv4Address
ipv4);
60
InetSocketAddress
(uint16_t
port
);
65
InetSocketAddress
(
const
char
* ipv4, uint16_t
port
);
71
InetSocketAddress
(
const
char
* ipv4);
75
uint16_t
GetPort
()
const
;
79
Ipv4Address
GetIpv4
()
const
;
80
84
void
SetPort
(uint16_t
port
);
88
void
SetIpv4
(
Ipv4Address
address);
89
94
static
bool
IsMatchingType
(
const
Address
& address);
95
100
operator
Address
()
const
;
101
109
static
InetSocketAddress
ConvertFrom
(
const
Address
& address);
110
115
Address
ConvertTo
()
const
;
116
117
private
:
123
static
uint8_t
GetType
();
124
Ipv4Address
m_ipv4
;
125
uint16_t
m_port
;
126
};
127
128
}
// namespace ns3
129
130
#endif
/* INET_SOCKET_ADDRESS_H */
ns3::Address
a polymophic address class
Definition:
address.h:101
ns3::InetSocketAddress
an Inet address class
Definition:
inet-socket-address.h:42
ns3::InetSocketAddress::SetPort
void SetPort(uint16_t port)
Definition:
inet-socket-address.cc:80
ns3::InetSocketAddress::GetType
static uint8_t GetType()
Get the underlying address type (automatically assigned).
Definition:
inet-socket-address.cc:130
ns3::InetSocketAddress::ConvertTo
Address ConvertTo() const
Convert to an Address type.
Definition:
inet-socket-address.cc:106
ns3::InetSocketAddress::GetPort
uint16_t GetPort() const
Definition:
inet-socket-address.cc:66
ns3::InetSocketAddress::m_port
uint16_t m_port
the port
Definition:
inet-socket-address.h:125
ns3::InetSocketAddress::SetIpv4
void SetIpv4(Ipv4Address address)
Definition:
inet-socket-address.cc:87
ns3::InetSocketAddress::IsMatchingType
static bool IsMatchingType(const Address &address)
Definition:
inet-socket-address.cc:94
ns3::InetSocketAddress::m_ipv4
Ipv4Address m_ipv4
the IPv4 address
Definition:
inet-socket-address.h:124
ns3::InetSocketAddress::GetIpv4
Ipv4Address GetIpv4() const
Definition:
inet-socket-address.cc:73
ns3::InetSocketAddress::ConvertFrom
static InetSocketAddress ConvertFrom(const Address &address)
Returns an InetSocketAddress which corresponds to the input Address.
Definition:
inet-socket-address.cc:117
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
port
uint16_t port
Definition:
dsdv-manet.cc:44
ipv4-address.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
utils
inet-socket-address.h
Generated on Thu Mar 21 2024 09:24:21 for ns-3 by
1.9.6