1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
3 * Copyright (c) 2007-2008 Louis Pasteur University
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;
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.
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
18 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
21 #ifndef INET6_SOCKET_ADDRESS_H
22 #define INET6_SOCKET_ADDRESS_H
25 #include "ipv6-address.h"
31 * \class Inet6SocketAddress
32 * \brief An Inet6 address class.
34 class Inet6SocketAddress
39 * \param ipv6 the IPv6 address
40 * \param port the port
42 Inet6SocketAddress (Ipv6Address ipv6, uint16_t port);
45 * \brief Constructor (the port is set to zero).
46 * \param ipv6 the IPv6 address
48 Inet6SocketAddress (Ipv6Address ipv6);
51 * \brief Constructor (the address is set to "any").
52 * \param port the port
54 Inet6SocketAddress (uint16_t port);
58 * \param ipv6 string which represents an IPv6 address
59 * \param port the port
61 Inet6SocketAddress (const char* ipv6, uint16_t port);
65 * \param ipv6 string which represents an IPv6 address
67 Inet6SocketAddress (const char* ipv6);
70 * \brief Get the port.
73 uint16_t GetPort (void) const;
77 * \param port the port
79 void SetPort (uint16_t port);
82 * \brief Get the IPv6 address.
83 * \return the IPv6 address
85 Ipv6Address GetIpv6 (void) const;
88 * \brief Set the IPv6 address.
89 * \param ipv6 the address
91 void SetIpv6 (Ipv6Address ipv6);
94 * \brief If the address match.
95 * \param addr the address to test
96 * \return true if the address match, false otherwise
98 static bool IsMatchingType (const Address &addr);
101 * \brief Get an Address instance which represents this
102 * Inet6SocketAddress instance.
104 operator Address (void) const;
107 * \brief Convert the address to a InetSocketAddress.
108 * \param addr the address to convert
109 * \return an Inet6SocketAddress instance corresponding to address
111 static Inet6SocketAddress ConvertFrom (const Address &addr);
115 * \brief Convert to Address.
116 * \return Address instance
118 Address ConvertTo (void) const;
121 * \brief Get the type.
122 * \return the type of Inet6SocketAddress
124 static uint8_t GetType (void);
127 * \brief The IPv6 address.
137 } /* namespace ns3 */
139 #endif /* INET6_SOCKET_ADDRESS_H */