A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
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
;
83
uint8_t
GetTos
()
const
;
84
88
void
SetPort
(uint16_t
port
);
92
void
SetIpv4
(
Ipv4Address
address
);
96
void
SetTos
(uint8_t tos);
97
102
static
bool
IsMatchingType
(
const
Address
&
address
);
103
108
operator
Address
()
const
;
109
117
static
InetSocketAddress
ConvertFrom
(
const
Address
&
address
);
118
123
Address
ConvertTo
()
const
;
124
125
private
:
131
static
uint8_t
GetType
();
132
Ipv4Address
m_ipv4
;
133
uint16_t
m_port
;
134
uint8_t
m_tos
;
135
};
136
137
}
// namespace ns3
138
139
#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:92
ns3::InetSocketAddress::GetType
static uint8_t GetType()
Get the underlying address type (automatically assigned).
Definition:
inet-socket-address.cc:152
ns3::InetSocketAddress::ConvertTo
Address ConvertTo() const
Convert to an Address type.
Definition:
inet-socket-address.cc:125
ns3::InetSocketAddress::GetPort
uint16_t GetPort() const
Definition:
inet-socket-address.cc:71
ns3::InetSocketAddress::SetTos
void SetTos(uint8_t tos)
Definition:
inet-socket-address.cc:106
ns3::InetSocketAddress::m_port
uint16_t m_port
the port
Definition:
inet-socket-address.h:133
ns3::InetSocketAddress::SetIpv4
void SetIpv4(Ipv4Address address)
Definition:
inet-socket-address.cc:99
ns3::InetSocketAddress::IsMatchingType
static bool IsMatchingType(const Address &address)
Definition:
inet-socket-address.cc:113
ns3::InetSocketAddress::InetSocketAddress
InetSocketAddress(Ipv4Address ipv4, uint16_t port)
Definition:
inet-socket-address.cc:30
ns3::InetSocketAddress::m_ipv4
Ipv4Address m_ipv4
the IPv4 address
Definition:
inet-socket-address.h:132
ns3::InetSocketAddress::GetIpv4
Ipv4Address GetIpv4() const
Definition:
inet-socket-address.cc:78
ns3::InetSocketAddress::m_tos
uint8_t m_tos
the ToS
Definition:
inet-socket-address.h:134
ns3::InetSocketAddress::ConvertFrom
static InetSocketAddress ConvertFrom(const Address &address)
Returns an InetSocketAddress which corresponds to the input Address.
Definition:
inet-socket-address.cc:137
ns3::InetSocketAddress::GetTos
uint8_t GetTos() const
Definition:
inet-socket-address.cc:85
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
first.address
address
Definition:
first.py:47
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
nsclick-simple-lan.ipv4
ipv4
Definition:
nsclick-simple-lan.py:57
src
network
utils
inet-socket-address.h
Generated on Sun Mar 3 2024 17:11:06 for ns-3 by
1.9.1