A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
network
utils
inet-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) 2005 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 INET_SOCKET_ADDRESS_H
22
#define INET_SOCKET_ADDRESS_H
23
24
#include "ns3/address.h"
25
#include "
ipv4-address.h
"
26
#include <stdint.h>
27
28
namespace
ns3
{
29
30
40
class
InetSocketAddress
41
{
42
public
:
47
InetSocketAddress
(
Ipv4Address
ipv4, uint16_t
port
);
53
InetSocketAddress
(
Ipv4Address
ipv4);
59
InetSocketAddress
(uint16_t
port
);
64
InetSocketAddress
(
const
char
*ipv4, uint16_t
port
);
70
InetSocketAddress
(
const
char
*ipv4);
74
uint16_t
GetPort
(
void
)
const
;
78
Ipv4Address
GetIpv4
(
void
)
const
;
82
uint8_t
GetTos
(
void
)
const
;
83
87
void
SetPort
(uint16_t
port
);
91
void
SetIpv4
(
Ipv4Address
address
);
95
void
SetTos
(uint8_t tos);
96
101
static
bool
IsMatchingType
(
const
Address
&
address
);
102
107
operator
Address
()
const
;
108
116
static
InetSocketAddress
ConvertFrom
(
const
Address
&
address
);
117
private
:
122
Address
ConvertTo
(
void
)
const
;
123
129
static
uint8_t
GetType
(
void
);
130
Ipv4Address
m_ipv4
;
131
uint16_t
m_port
;
132
uint8_t
m_tos
;
133
};
134
135
}
// namespace ns3
136
137
138
#endif
/* INET_SOCKET_ADDRESS_H */
ns3::InetSocketAddress::InetSocketAddress
InetSocketAddress(Ipv4Address ipv4, uint16_t port)
Definition:
inet-socket-address.cc:29
ns3::InetSocketAddress
an Inet address class
Definition:
inet-socket-address.h:40
ns3::InetSocketAddress::m_port
uint16_t m_port
the port
Definition:
inet-socket-address.h:131
ns3::InetSocketAddress::GetTos
uint8_t GetTos(void) const
Definition:
inet-socket-address.cc:77
ns3::InetSocketAddress::ConvertTo
Address ConvertTo(void) const
Convert to an Address type.
Definition:
inet-socket-address.cc:115
ns3::InetSocketAddress::m_tos
uint8_t m_tos
the ToS
Definition:
inet-socket-address.h:132
port
uint16_t port
Definition:
dsdv-manet.cc:45
ns3::Address
a polymophic address class
Definition:
address.h:90
ipv4-address.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::InetSocketAddress::ConvertFrom
static InetSocketAddress ConvertFrom(const Address &address)
Returns an InetSocketAddress which corresponds to the input Address.
Definition:
inet-socket-address.cc:126
first.address
address
Definition:
first.py:37
ns3::InetSocketAddress::SetTos
void SetTos(uint8_t tos)
Definition:
inet-socket-address.cc:96
ns3::InetSocketAddress::SetPort
void SetPort(uint16_t port)
Definition:
inet-socket-address.cc:84
ns3::InetSocketAddress::GetPort
uint16_t GetPort(void) const
Definition:
inet-socket-address.cc:65
ns3::InetSocketAddress::SetIpv4
void SetIpv4(Ipv4Address address)
Definition:
inet-socket-address.cc:90
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:40
ns3::InetSocketAddress::m_ipv4
Ipv4Address m_ipv4
the IPv4 address
Definition:
inet-socket-address.h:130
ns3::InetSocketAddress::IsMatchingType
static bool IsMatchingType(const Address &address)
Definition:
inet-socket-address.cc:103
ns3::InetSocketAddress::GetType
static uint8_t GetType(void)
Get the underlying address type (automatically assigned).
Definition:
inet-socket-address.cc:140
ns3::InetSocketAddress::GetIpv4
Ipv4Address GetIpv4(void) const
Definition:
inet-socket-address.cc:71
Generated on Wed Nov 7 2018 10:02:07 for ns-3 by
1.8.14