alternative Standard Libary  0.29.8
std::net::ip_address6 Klassenreferenz

#include <address.hpp>

+ Klassendiagramm für std::net::ip_address6:
+ Zusammengehörigkeiten von std::net::ip_address6:

Öffentliche Methoden

 ip_address6 ()
 
 ip_address6 (unsigned short addr[16], long scopid)
 
 ip_address6 (unsigned short addr[16])
 
 ip_address6 (const ip_address6 &v)
 
 ip_address6 (const ip_address4 &v)
 
void getaddress (unsigned short b[16])
 
long getscopid ()
 
void setscopid (long id)
 
ip_address6operator= (const ip_address6 &v)
 
unsigned short * get ()
 
const ip_address4to_ip4 ()
 
bool is_multicast ()
 
bool is_linklocal ()
 
bool is_sitelocal ()
 
bool is_teredo ()
 
bool is_ipv4mapped ()
 
virtual AddrFamily getFamily ()
 

Öffentliche, statische Methoden

static ip_address6 parse (std::string ip)
 

Statische öffentliche Attribute

static const ip_address6 Any = ip_address6( new short[16]{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },0)
 
static const ip_address6 Loopback = ip_address6( new short[16]{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 },0)
 
static const ip_address6 None = ip_address6( new short[16]{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },0)
 

Geschützte Attribute

AddrFamily m_addr
 

Ausführliche Beschreibung

Beschreibung der Konstruktoren und Destruktoren

◆ ip_address6() [1/5]

std::net::ip_address6::ip_address6 ( )
inline

◆ ip_address6() [2/5]

std::net::ip_address6::ip_address6 ( unsigned short  addr[16],
long  scopid 
)
88  : ip_address_base(AddrFamily::InternetV6), m_scopid(0) {
89  if(addr == 0) throw;
90 
91  for (int i = 0; i < 8; i++) {
92  m_numbers[i] = (unsigned short)(addr[i * 2] * 256 + addr[i * 2 + 1]);
93  }
94  m_scopid = scopid;
95  }
ip_address_base()
Definition: address.hpp:43

◆ ip_address6() [3/5]

std::net::ip_address6::ip_address6 ( unsigned short  addr[16])
97  : ip_address_base(AddrFamily::InternetV6), m_scopid(0) {
98  for (int i = 0; i < 8; i++) {
99  m_numbers[i] = (unsigned short)(addr[i * 2] * 256 + addr[i * 2 + 1]);
100  }
101  }
ip_address_base()
Definition: address.hpp:43

◆ ip_address6() [4/5]

std::net::ip_address6::ip_address6 ( const ip_address6 v)
103  : ip_address_base(v.getFamily()), m_scopid(v.m_scopid) {
104  for(int i =0; i < 8; i++)
105  m_numbers[i] = v.m_numbers[i];
106  }
ip_address_base()
Definition: address.hpp:43

◆ ip_address6() [5/5]

std::net::ip_address6::ip_address6 ( const ip_address4 v)
127  {
128  m_numbers[0] = m_numbers[1] = m_numbers[2] = m_numbers[3] = m_numbers[4] = 0;
129  m_numbers[5] = 0xFFFF;
130  m_numbers[6] = (unsigned short)(((v.get() & 0x0000FF00) >> 8) | ((v.get() & 0x000000FF) << 8));
131  m_numbers[7] = (unsigned short)(((v.get() & 0xFF000000) >> 24) | ((v.get() & 0x00FF0000) >> 8));
132 
133  m_scopid = 0;
134  }

Dokumentation der Elementfunktionen

◆ get()

unsigned short* std::net::ip_address6::get ( )
inline
106 { return m_numbers; }

◆ getaddress()

void std::net::ip_address6::getaddress ( unsigned short  b[16])
115  {
116  for(int i=0, j =0; i < 8; i++){
117  b[j++] = (unsigned char)((m_numbers[i] >> 8) & 0xFF);
118  b[j++] = (unsigned char)((m_numbers[i] ) & 0xFF);
119  }
120  }

◆ getFamily()

virtual AddrFamily std::net::ip_address_base::getFamily ( )
inlinevirtualinherited
46  {
47  return m_addr;
48  }
AddrFamily m_addr
Definition: address.hpp:51

◆ getscopid()

long std::net::ip_address6::getscopid ( )
107  {
108  return m_scopid;
109  }

◆ is_ipv4mapped()

bool std::net::ip_address6::is_ipv4mapped ( )
inline
114  {
115  for (int i = 0; i < 5; i++) {
116  if (m_numbers[i] != 0) {
117  return false;
118  }
119  }
120  return (m_numbers[5] == 0xFFFF);
121  }

◆ is_linklocal()

bool std::net::ip_address6::is_linklocal ( )
inline
111 { return ((m_numbers[0] & 0xFFC0 ) == 0xFE80 ); }

◆ is_multicast()

bool std::net::ip_address6::is_multicast ( )
inline
110 { return ((m_numbers[0] & 0xFF00 ) == 0xFF00 ); }

◆ is_sitelocal()

bool std::net::ip_address6::is_sitelocal ( )
inline
112 { return ((m_numbers[0] & 0xFFC0 ) == 0xFEC0 ); }

◆ is_teredo()

bool std::net::ip_address6::is_teredo ( )
inline
113 { return (m_numbers[0] == 0x2001 ) && ( m_numbers[1] == 0 ); }

◆ operator=()

ip_address6 & std::net::ip_address6::operator= ( const ip_address6 v)
121  {
122  for(int i =0; i < 8; i++)
123  m_numbers[i] = v.m_numbers[i];
124  m_scopid = v.m_scopid;
125  return *this;
126  }

◆ parse()

static ip_address6 std::net::ip_address6::parse ( std::string  ip)
inlinestatic
102 { return ip_address6(); }
ip_address6()
Definition: address.hpp:91

◆ setscopid()

void std::net::ip_address6::setscopid ( long  id)
110  {
111  if(m_scopid != id) {
112  m_scopid = id;
113  }
114  }

◆ to_ip4()

const ip_address4 & std::net::ip_address6::to_ip4 ( )
135  {
136  long address = ((((uint32_t)m_numbers[6] & 0x0000FF00u) >> 8) | (((uint32_t)m_numbers[6] & 0x000000FFu) << 8)) |
137  (((((uint32_t)m_numbers[7] & 0x0000FF00u) >> 8) | (((uint32_t)m_numbers[7] & 0x000000FFu) << 8)) << 16);
138 
139  return ip_address4(address);
140  }

Dokumentation der Datenelemente

◆ Any

const ip_address6 std::net::ip_address6::Any = ip_address6( new short[16]{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },0)
static

◆ Loopback

const ip_address6 std::net::ip_address6::Loopback = ip_address6( new short[16]{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 },0)
static

◆ m_addr

AddrFamily std::net::ip_address_base::m_addr
protectedinherited

◆ None

const ip_address6 std::net::ip_address6::None = ip_address6( new short[16]{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },0)
static

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien: