proxygen
folly::IPAddressV6::AddressStorage Union Reference

Public Member Functions

 AddressStorage ()
 
 AddressStorage (const ByteArray16 &bytes)
 
 AddressStorage (const in6_addr &addr)
 
 AddressStorage (MacAddress mac)
 

Public Attributes

in6_addr in6Addr_
 
ByteArray16 bytes_
 

Detailed Description

Definition at line 404 of file IPAddressV6.h.

Constructor & Destructor Documentation

folly::IPAddressV6::AddressStorage::AddressStorage ( )
inline

Definition at line 407 of file IPAddressV6.h.

Referenced by AddressStorage().

407  {
408  std::memset(this, 0, sizeof(AddressStorage));
409  }
folly::IPAddressV6::AddressStorage::AddressStorage ( const ByteArray16 bytes)
inlineexplicit

Definition at line 410 of file IPAddressV6.h.

410 : bytes_(bytes) {}
const unsigned char * bytes() const
Definition: IPAddressV6.h:367
folly::IPAddressV6::AddressStorage::AddressStorage ( const in6_addr &  addr)
inlineexplicit

Definition at line 411 of file IPAddressV6.h.

References folly::IPAddressV6::addr_, and AddressStorage().

411 : in6Addr_(addr) {}
ThreadPoolListHook * addr
folly::IPAddressV6::AddressStorage::AddressStorage ( MacAddress  mac)
explicit

Definition at line 124 of file IPAddressV6.cpp.

References folly::MacAddress::bytes(), and uint8_t.

124  {
125  // The link-local address uses modified EUI-64 format,
126  // See RFC 4291 sections 2.5.1, 2.5.6, and Appendix A
127  const auto* macBytes = mac.bytes();
128  memcpy(&bytes_.front(), "\xfe\x80\x00\x00\x00\x00\x00\x00", 8);
129  bytes_[8] = uint8_t(macBytes[0] ^ 0x02);
130  bytes_[9] = macBytes[1];
131  bytes_[10] = macBytes[2];
132  bytes_[11] = 0xff;
133  bytes_[12] = 0xfe;
134  bytes_[13] = macBytes[3];
135  bytes_[14] = macBytes[4];
136  bytes_[15] = macBytes[5];
137 }

Member Data Documentation


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