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
inet6-socket-address.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007-2008 Louis Pasteur University
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: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
18
*/
19
20
#ifndef INET6_SOCKET_ADDRESS_H
21
#define INET6_SOCKET_ADDRESS_H
22
23
#include "
ipv6-address.h
"
24
25
#include "ns3/address.h"
26
27
#include <stdint.h>
28
29
namespace
ns3
30
{
31
32
/**
33
* \ingroup address
34
* \class Inet6SocketAddress
35
* \brief An Inet6 address class.
36
*/
37
class
Inet6SocketAddress
38
{
39
public
:
40
/**
41
* \brief Constructor.
42
* \param ipv6 the IPv6 address
43
* \param port the port
44
*/
45
Inet6SocketAddress
(
Ipv6Address
ipv6, uint16_t
port
);
46
47
/**
48
* \brief Constructor (the port is set to zero).
49
* \param ipv6 the IPv6 address
50
*/
51
Inet6SocketAddress
(
Ipv6Address
ipv6);
52
53
/**
54
* \brief Constructor (the address is set to "any").
55
* \param port the port
56
*/
57
Inet6SocketAddress
(uint16_t
port
);
58
59
/**
60
* \brief Constructor.
61
* \param ipv6 string which represents an IPv6 address
62
* \param port the port
63
*/
64
Inet6SocketAddress
(
const
char
* ipv6, uint16_t
port
);
65
66
/**
67
* \brief Constructor.
68
* \param ipv6 string which represents an IPv6 address
69
*/
70
Inet6SocketAddress
(
const
char
* ipv6);
71
72
/**
73
* \brief Get the port.
74
* \return the port
75
*/
76
uint16_t
GetPort
()
const
;
77
78
/**
79
* \brief Set the port
80
* \param port the port
81
*/
82
void
SetPort
(uint16_t
port
);
83
84
/**
85
* \brief Get the IPv6 address.
86
* \return the IPv6 address
87
*/
88
Ipv6Address
GetIpv6
()
const
;
89
90
/**
91
* \brief Set the IPv6 address.
92
* \param ipv6 the address
93
*/
94
void
SetIpv6
(
Ipv6Address
ipv6);
95
96
/**
97
* \brief If the address match.
98
* \param addr the address to test
99
* \return true if the address match, false otherwise
100
*/
101
static
bool
IsMatchingType
(
const
Address
& addr);
102
103
/**
104
* \brief Get an Address instance which represents this
105
* Inet6SocketAddress instance.
106
*/
107
operator
Address
()
const
;
108
109
/**
110
* \brief Convert the address to a InetSocketAddress.
111
* \param addr the address to convert
112
* \return an Inet6SocketAddress instance corresponding to address
113
*/
114
static
Inet6SocketAddress
ConvertFrom
(
const
Address
& addr);
115
116
/**
117
* \brief Convert to Address.
118
* \return Address instance
119
*/
120
Address
ConvertTo
()
const
;
121
122
private
:
123
/**
124
* \brief Get the type.
125
* \return the type of Inet6SocketAddress
126
*/
127
static
uint8_t
GetType
();
128
129
/**
130
* \brief The IPv6 address.
131
*/
132
Ipv6Address
m_ipv6
;
133
134
/**
135
* \brief The port.
136
*/
137
uint16_t
m_port
;
138
};
139
140
}
/* namespace ns3 */
141
142
#endif
/* INET6_SOCKET_ADDRESS_H */
ns3::Address
a polymophic address class
Definition:
address.h:101
ns3::Inet6SocketAddress
An Inet6 address class.
Definition:
inet6-socket-address.h:38
ns3::Inet6SocketAddress::GetType
static uint8_t GetType()
Get the type.
Definition:
inet6-socket-address.cc:129
ns3::Inet6SocketAddress::SetPort
void SetPort(uint16_t port)
Set the port.
Definition:
inet6-socket-address.cc:73
ns3::Inet6SocketAddress::ConvertFrom
static Inet6SocketAddress ConvertFrom(const Address &addr)
Convert the address to a InetSocketAddress.
Definition:
inet6-socket-address.cc:117
ns3::Inet6SocketAddress::GetPort
uint16_t GetPort() const
Get the port.
Definition:
inet6-socket-address.cc:66
ns3::Inet6SocketAddress::SetIpv6
void SetIpv6(Ipv6Address ipv6)
Set the IPv6 address.
Definition:
inet6-socket-address.cc:87
ns3::Inet6SocketAddress::IsMatchingType
static bool IsMatchingType(const Address &addr)
If the address match.
Definition:
inet6-socket-address.cc:94
ns3::Inet6SocketAddress::m_port
uint16_t m_port
The port.
Definition:
inet6-socket-address.h:137
ns3::Inet6SocketAddress::GetIpv6
Ipv6Address GetIpv6() const
Get the IPv6 address.
Definition:
inet6-socket-address.cc:80
ns3::Inet6SocketAddress::ConvertTo
Address ConvertTo() const
Convert to Address.
Definition:
inet6-socket-address.cc:106
ns3::Inet6SocketAddress::m_ipv6
Ipv6Address m_ipv6
The IPv6 address.
Definition:
inet6-socket-address.h:132
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:49
port
uint16_t port
Definition:
dsdv-manet.cc:44
ipv6-address.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
utils
inet6-socket-address.h
Generated on Tue May 28 2024 23:38:43 for ns-3 by
1.9.6