#include <icy/stun/attributes.h>Inherits:
Attribute
Implements a STUN/TURN attribute that contains a socket address. Handles XOR encoding/decoding for address and port as required by RFC 5389 section 15.2.
| Return | Name | Description |
|---|---|---|
AddressAttribute | #### Parameters | |
AddressAttribute | Copy constructor; duplicates the stored address. | |
std::unique_ptr< Attribute > | clone virtual | Returns a deep copy of this attribute. |
stun::AddressFamily | family const inline | #### Returns |
net::Address | address virtual const | #### Returns |
void | read virtual | Reads the body (not the type or size) for this type of attribute from the given buffer. |
void | write virtual const | Writes the body (not the type or size) to the given buffer. |
void | setAddress virtual inline | Sets the address to encode into this attribute. |
bool | isXorType const inline | #### Returns |
AddressAttribute(uint16_t type, bool ipv4)type Wire type code (e.g. XorMappedAddress::TypeID).
ipv4 When true, initialises the size for IPv4; otherwise IPv6.
AddressAttribute(const AddressAttribute & r)Copy constructor; duplicates the stored address.
virtual
virtual std::unique_ptr< Attribute > clone()Returns a deep copy of this attribute.
const inline
inline stun::AddressFamily family() constThe STUN address family (IPv4, IPv6, or Undefined) of the stored address.
virtual const
virtual net::Address address() constThe decoded socket address stored in this attribute.
virtual
virtual void read(BitReader & reader)Reads the body (not the type or size) for this type of attribute from the given buffer.
reader Source bit reader positioned at the attribute body.virtual const
virtual void write(BitWriter & writer) constWrites the body (not the type or size) to the given buffer.
writer Destination bit writer.virtual inline
virtual inline void setAddress(const net::Address & addr)Sets the address to encode into this attribute.
addr Address to store.const inline
inline bool isXorType() consttrue if this attribute type uses XOR encoding (RFC 5389).
static
constexpr uint16_t IPv4Size = 8static
constexpr uint16_t IPv6Size = 20| Return | Name | Description |
|---|---|---|
net::Address | _address |
net::Address _address