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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
7
*/
8
9
#ifndef INET6_SOCKET_ADDRESS_H
10
#define INET6_SOCKET_ADDRESS_H
11
12
#include "
ipv6-address.h
"
13
14
#include "ns3/address.h"
15
16
#include <stdint.h>
17
18
namespace
ns3
19
{
20
21
/**
22
* @ingroup address
23
* @class Inet6SocketAddress
24
* @brief An Inet6 address class.
25
*/
26
class
Inet6SocketAddress
27
{
28
public
:
29
/**
30
* @brief Constructor.
31
* @param ipv6 the IPv6 address
32
* @param port the port
33
*/
34
Inet6SocketAddress
(
Ipv6Address
ipv6, uint16_t
port
);
35
36
/**
37
* @brief Constructor (the port is set to zero).
38
* @param ipv6 the IPv6 address
39
*/
40
Inet6SocketAddress
(
Ipv6Address
ipv6);
41
42
/**
43
* @brief Constructor (the address is set to "any").
44
* @param port the port
45
*/
46
Inet6SocketAddress
(uint16_t
port
);
47
48
/**
49
* @brief Constructor.
50
* @param ipv6 string which represents an IPv6 address
51
* @param port the port
52
*/
53
Inet6SocketAddress
(
const
char
* ipv6, uint16_t
port
);
54
55
/**
56
* @brief Constructor.
57
* @param ipv6 string which represents an IPv6 address
58
*/
59
Inet6SocketAddress
(
const
char
* ipv6);
60
61
/**
62
* @brief Get the port.
63
* @return the port
64
*/
65
uint16_t
GetPort
()
const
;
66
67
/**
68
* @brief Set the port
69
* @param port the port
70
*/
71
void
SetPort
(uint16_t
port
);
72
73
/**
74
* @brief Get the IPv6 address.
75
* @return the IPv6 address
76
*/
77
Ipv6Address
GetIpv6
()
const
;
78
79
/**
80
* @brief Set the IPv6 address.
81
* @param ipv6 the address
82
*/
83
void
SetIpv6
(
Ipv6Address
ipv6);
84
85
/**
86
* @brief If the address match.
87
* @param addr the address to test
88
* @return true if the address match, false otherwise
89
*/
90
static
bool
IsMatchingType
(
const
Address
& addr);
91
92
/**
93
* @brief Get an Address instance which represents this
94
* Inet6SocketAddress instance.
95
*/
96
operator
Address
()
const
;
97
98
/**
99
* @brief Convert the address to a InetSocketAddress.
100
* @param addr the address to convert
101
* @return an Inet6SocketAddress instance corresponding to address
102
*/
103
static
Inet6SocketAddress
ConvertFrom
(
const
Address
& addr);
104
105
/**
106
* @brief Convert to Address.
107
* @return Address instance
108
*/
109
Address
ConvertTo
()
const
;
110
111
private
:
112
/**
113
* @brief Get the type.
114
* @return the type of Inet6SocketAddress
115
*/
116
static
uint8_t
GetType
();
117
118
/**
119
* @brief The IPv6 address.
120
*/
121
Ipv6Address
m_ipv6
;
122
123
/**
124
* @brief The port.
125
*/
126
uint16_t
m_port
;
127
};
128
129
}
/* namespace ns3 */
130
131
#endif
/* INET6_SOCKET_ADDRESS_H */
ns3::Address
a polymophic address class
Definition
address.h:90
ns3::Inet6SocketAddress
An Inet6 address class.
Definition
inet6-socket-address.h:27
ns3::Inet6SocketAddress::GetType
static uint8_t GetType()
Get the type.
Definition
inet6-socket-address.cc:118
ns3::Inet6SocketAddress::SetPort
void SetPort(uint16_t port)
Set the port.
Definition
inet6-socket-address.cc:62
ns3::Inet6SocketAddress::ConvertFrom
static Inet6SocketAddress ConvertFrom(const Address &addr)
Convert the address to a InetSocketAddress.
Definition
inet6-socket-address.cc:106
ns3::Inet6SocketAddress::GetPort
uint16_t GetPort() const
Get the port.
Definition
inet6-socket-address.cc:55
ns3::Inet6SocketAddress::Inet6SocketAddress
Inet6SocketAddress(Ipv6Address ipv6, uint16_t port)
Constructor.
Definition
inet6-socket-address.cc:19
ns3::Inet6SocketAddress::SetIpv6
void SetIpv6(Ipv6Address ipv6)
Set the IPv6 address.
Definition
inet6-socket-address.cc:76
ns3::Inet6SocketAddress::IsMatchingType
static bool IsMatchingType(const Address &addr)
If the address match.
Definition
inet6-socket-address.cc:83
ns3::Inet6SocketAddress::m_port
uint16_t m_port
The port.
Definition
inet6-socket-address.h:126
ns3::Inet6SocketAddress::GetIpv6
Ipv6Address GetIpv6() const
Get the IPv6 address.
Definition
inet6-socket-address.cc:69
ns3::Inet6SocketAddress::ConvertTo
Address ConvertTo() const
Convert to Address.
Definition
inet6-socket-address.cc:95
ns3::Inet6SocketAddress::m_ipv6
Ipv6Address m_ipv6
The IPv6 address.
Definition
inet6-socket-address.h:121
ns3::Ipv6Address
Describes an IPv6 address.
Definition
ipv6-address.h:38
port
uint16_t port
Definition
dsdv-manet.cc:33
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 Wed Dec 4 2024 09:20:48 for ns-3 by
1.11.0