senf::INet6SocketAddress Class Reference
[Addressing classes]

IPv6 socket address. More...

#include <senf/Socket/Protocols/INet/INetAddressing.hh>

Inheritance diagram for senf::INet6SocketAddress:
Inheritance graph
[legend]

List of all members.


Detailed Description

IPv6 socket address.

This class wraps the standard sockaddr_in6 structure. INet6SocketAddress provides access to all members of the sockaddr_in6 structure. Additionally, INet6SocketAddress supports the string representations

[ address [ % zone-id ] ]: port
hostname : port
Where address is an arbitrary numeric IPv6 address, zone-id is an optional network interface name and port is the port number. So some example addresses are
[2001:db8:1::1]:80
www.go6.net:80
[fe80::1%eth0]:443
Implementation note:
The sockaddr_in6 structure has an sin6_flowinfo member. However RFC3493 does not give the use of this field and specifies, that the field should be ignored ... so that's what we do. Furthermore, the GNU libc reference states, that this field is not implemented in the library.
Idea:
Implement a INet6Address_ref class which has an interface identical to INet6Address and is convertible to INet6Address (the latter has a conversion constructor taking the former as arg). This class however references an external in6_addr instead of containing one itself. This can be used in INet6SocketAddress to increase the performance of some operations.

Definition at line 141 of file INetAddressing.hh.


Public Member Functions

INet6Address  address () const
  Get printable address representation.
void  address (INet6Address const &addr)
  Change address.
unsigned  port () const
  Get port number.
void  port (unsigned port)
  Change port number.
std::string  iface () const
  Get interface name.
void  iface (std::string const &iface)
  Change interface.

Static Public Attributes

static short const  addressFamily = AF_INET6

Related Functions

(Note that these are not member functions.)

std::ostream &  operator<< (std::ostream &os, INet6SocketAddress const &addr)
  Output INet6SocketAddress instance as it's string representation.

Structors and default members

  INet6SocketAddress ()
  Create empty instance.
  INet6SocketAddress (std::string const &addr, INet6Address::Resolve_t resolve=INet6Address::ResolveINet6)
  Initialize/convert from string representation.
  INet6SocketAddress (INet6Address const &addr, unsigned port)
  Initialize from address and port.
  INet6SocketAddress (INet6Address const &addr, unsigned port, std::string const &iface)
  Initialize explicitly from given parameters.
  INet6SocketAddress (unsigned port)
  Initialize from port and set to 'unspecified' addr.
  INet6SocketAddress (const INet6SocketAddress &other)
INet6SocketAddress operator= (const INet6SocketAddress &other)

Constructor & Destructor Documentation

senf::INet6SocketAddress::
INet6SocketAddress ()

Create empty instance.

Definition at line 76 of file INetAddressing.cci.

senf::INet6SocketAddress::
INet6SocketAddress ( std::string const &  addr,
INet6Address::Resolve_t  resolve = INet6Address::ResolveINet6 )

Initialize/convert from string representation.

Exceptions:
AddressSyntaxException  if the address syntax is invalid
UnknownHostnameException  if the address cannot be resolved.
Parameters:
[in]  addr  Address to parse
[in]  resolve  If this is INet6Address::ResolveINet4, support IPv4 addresses. See INet6Address.

Definition at line 98 of file INetAddressing.cc.

senf::INet6SocketAddress::
INet6SocketAddress ( INet6Address const &  addr,
unsigned  port )

Initialize from address and port.

Definition at line 80 of file INetAddressing.cci.

senf::INet6SocketAddress::
INet6SocketAddress ( INet6Address const &  addr,
unsigned  port,
std::string const &  iface )

Initialize explicitly from given parameters.

Exceptions:
AddressSyntaxException  if the given iface cannot be resolved.

Definition at line 87 of file INetAddressing.cci.

senf::INet6SocketAddress::
INet6SocketAddress ( unsigned  port )

Initialize from port and set to 'unspecified' addr.

The address is set to [::]

Parameters:
[in]  port  port number

Definition at line 96 of file INetAddressing.cci.

senf::INet6SocketAddress::
INet6SocketAddress ( const INet6SocketAddress other )

Definition at line 102 of file INetAddressing.cci.


Member Function Documentation

void senf::INet6SocketAddress::
address ( INet6Address const &  addr )

Change address.

Definition at line 119 of file INetAddressing.cci.

senf::INet6Address senf::INet6SocketAddress::
address ()

Get printable address representation.

Definition at line 113 of file INetAddressing.cci.

void senf::INet6SocketAddress::
iface ( std::string const &  iface )

Change interface.

Exceptions:
AddressSyntaxException  if the given iface cannot be resolved.

Definition at line 135 of file INetAddressing.cci.

std::string senf::INet6SocketAddress::
iface ()

Get interface name.

Definition at line 130 of file INetAddressing.cc.

senf::INet6SocketAddress & senf::INet6SocketAddress::
operator= ( const INet6SocketAddress other )

Definition at line 107 of file INetAddressing.cci.

void senf::INet6SocketAddress::
port ( unsigned  port )

Change port number.

Definition at line 130 of file INetAddressing.cci.

unsigned senf::INet6SocketAddress::
port ()

Get port number.

Definition at line 124 of file INetAddressing.cci.


Friends And Related Function Documentation

std::ostream &
operator<< ( std::ostream &  os,
INet6SocketAddress const &  addr )

Output INet6SocketAddress instance as it's string representation.


Member Data Documentation

short const senf::INet6SocketAddress::addressFamily = AF_INET6
[static]

Definition at line 145 of file INetAddressing.hh.


The documentation for this class was generated from the following files: