A Discrete-Event Network Simulator
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
18namespace ns3
19{
20
21/**
22 * @ingroup address
23 * @class Inet6SocketAddress
24 * @brief An Inet6 address class.
25 */
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 */
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 */
122
123 /**
124 * @brief The port.
125 */
126 uint16_t m_port;
127};
128
129} /* namespace ns3 */
130
131#endif /* INET6_SOCKET_ADDRESS_H */
a polymophic address class
Definition address.h:90
An Inet6 address class.
static uint8_t GetType()
Get the type.
void SetPort(uint16_t port)
Set the port.
static Inet6SocketAddress ConvertFrom(const Address &addr)
Convert the address to a InetSocketAddress.
uint16_t GetPort() const
Get the port.
Inet6SocketAddress(Ipv6Address ipv6, uint16_t port)
Constructor.
void SetIpv6(Ipv6Address ipv6)
Set the IPv6 address.
static bool IsMatchingType(const Address &addr)
If the address match.
Ipv6Address GetIpv6() const
Get the IPv6 address.
Address ConvertTo() const
Convert to Address.
Ipv6Address m_ipv6
The IPv6 address.
Describes an IPv6 address.
uint16_t port
Definition dsdv-manet.cc:33
Every class exported by the ns3 library is enclosed in the ns3 namespace.