A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
inet6-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) 2007-2008 Louis Pasteur University
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: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
19  */
20 
21 #ifndef INET6_SOCKET_ADDRESS_H
22 #define INET6_SOCKET_ADDRESS_H
23 
24 #include <stdint.h>
25 
26 #include "ns3/address.h"
27 #include "ipv6-address.h"
28 
29 namespace ns3 {
30 
37 {
38 public:
44  Inet6SocketAddress (Ipv6Address ipv6, uint16_t port);
45 
51 
56  Inet6SocketAddress (uint16_t port);
57 
63  Inet6SocketAddress (const char* ipv6, uint16_t port);
64 
69  Inet6SocketAddress (const char* ipv6);
70 
75  uint16_t GetPort (void) const;
76 
81  void SetPort (uint16_t port);
82 
87  Ipv6Address GetIpv6 (void) const;
88 
93  void SetIpv6 (Ipv6Address ipv6);
94 
100  static bool IsMatchingType (const Address &addr);
101 
106  operator Address (void) const;
107 
113  static Inet6SocketAddress ConvertFrom (const Address &addr);
114 
115 private:
120  Address ConvertTo (void) const;
121 
126  static uint8_t GetType (void);
127 
132 
136  uint16_t m_port;
137 };
138 
139 } /* namespace ns3 */
140 
141 #endif /* INET6_SOCKET_ADDRESS_H */
Ipv6Address GetIpv6(void) const
Get the IPv6 address.
Address ConvertTo(void) const
Convert to Address.
void SetIpv6(Ipv6Address ipv6)
Set the IPv6 address.
uint16_t port
Definition: dsdv-manet.cc:44
a polymophic address class
Definition: address.h:86
Ipv6Address m_ipv6
The IPv6 address.
Inet6SocketAddress(Ipv6Address ipv6, uint16_t port)
Constructor.
static uint8_t GetType(void)
Get the type.
An Inet6 address class.
Describes an IPv6 address.
Definition: ipv6-address.h:46
static Inet6SocketAddress ConvertFrom(const Address &addr)
Convert the address to a InetSocketAddress.
static bool IsMatchingType(const Address &addr)
If the address match.
uint16_t GetPort(void) const
Get the port.
void SetPort(uint16_t port)
Set the port.