Home
STUN module (rfc5389)

UInt64Attribute

Implements a STUN/TURN attribute that holds a 64-bit integer.

UInt64Attribute

#include <icy/stun/attributes.h>
class UInt64Attribute

Defined in src/stun/include/icy/stun/attributes.h:309

Inherits: Attribute

Implements a STUN/TURN attribute that holds a 64-bit integer.

List of all members

NameKindOwner
UInt64AttributefunctionDeclared here
UInt64AttributefunctionDeclared here
clonefunctionDeclared here
valuefunctionDeclared here
setValuefunctionDeclared here
getBitfunctionDeclared here
setBitfunctionDeclared here
readfunctionDeclared here
writefunctionDeclared here
SizevariableDeclared here
_bitsvariableDeclared here
~AttributefunctionInherited from Attribute
clonefunctionInherited from Attribute
readfunctionInherited from Attribute
writefunctionInherited from Attribute
typefunctionInherited from Attribute
sizefunctionInherited from Attribute
paddingBytesfunctionInherited from Attribute
paddedBytesfunctionInherited from Attribute
consumePaddingfunctionInherited from Attribute
writePaddingfunctionInherited from Attribute
typeStringfunctionInherited from Attribute
TypeIDvariableInherited from Attribute
createfunctionInherited from Attribute
paddingBytesfunctionInherited from Attribute
paddedBytesfunctionInherited from Attribute
typeStringfunctionInherited from Attribute
_typevariableInherited from Attribute
_sizevariableInherited from Attribute
AttributefunctionInherited from Attribute
setLengthfunctionInherited from Attribute
TypeenumInherited from Attribute

Inherited from Attribute

KindNameDescription
function~Attribute virtual inline
functionclone virtualReturns a deep copy of this attribute.
functionread virtualReads the body (not the type or size) for this type of attribute from the given buffer.
functionwrite virtual constWrites the body (not the type or size) to the given buffer.
functiontype const
functionsize const
functionpaddingBytes const inline
functionpaddedBytes const inline
functionconsumePadding constAdvances the reader past any 4-byte alignment padding that follows this attribute's body.
functionwritePadding constWrites zero-fill padding bytes to align this attribute to a 4-byte boundary.
functiontypeString
variableTypeID static constexpr
functioncreate staticCreates an attribute of the given wire type and body size. Returns nullptr if the type is unknown or the size is invalid.
functionpaddingBytes static inline constexprReturns the 4-byte alignment padding required for a body of size bytes.
functionpaddedBytes static inline constexprReturns the body length including 4-byte alignment padding.
functiontypeString static
variable_type
variable_size
functionAttribute
functionsetLengthUpdates the stored body length.
enumType

Public Methods

ReturnNameDescription
UInt64Attribute
UInt64AttributeCopy constructor.
std::unique_ptr< Attribute >clone virtual overrideReturns a deep copy of this attribute.
uint64_tvalue const inline
voidsetValue inlineSets the stored 64-bit value.
boolgetBit constReturns the state of a single bit within the stored quad-word.
voidsetBitSets or clears a single bit within the stored quad-word.
voidread virtual overrideReads the body (not the type or size) for this type of attribute from the given buffer.
voidwrite virtual const overrideWrites the body (not the type or size) to the given buffer.

UInt64Attribute

UInt64Attribute(uint16_t type)

Defined in src/stun/include/icy/stun/attributes.h:313

Parameters

  • type Wire type code for the concrete attribute.

UInt64Attribute

UInt64Attribute(const UInt64Attribute & r)

Defined in src/stun/include/icy/stun/attributes.h:316

Copy constructor.


clone

virtual override

virtual std::unique_ptr< Attribute > clone() override

Defined in src/stun/include/icy/stun/attributes.h:319

Returns a deep copy of this attribute.

Reimplements

value

const inline

inline uint64_t value() const

Defined in src/stun/include/icy/stun/attributes.h:324

Returns

The stored 64-bit value.


setValue

inline

inline void setValue(uint64_t bits)

Defined in src/stun/include/icy/stun/attributes.h:328

Sets the stored 64-bit value.

Parameters

  • bits Value to store.

getBit

const

bool getBit(int index) const

Defined in src/stun/include/icy/stun/attributes.h:333

Returns the state of a single bit within the stored quad-word.

Parameters

  • index Bit position (0 = LSB, 63 = MSB).

Returns

true if the bit is set.


setBit

void setBit(int index, bool value)

Defined in src/stun/include/icy/stun/attributes.h:338

Sets or clears a single bit within the stored quad-word.

Parameters

  • index Bit position (0 = LSB, 63 = MSB).

  • value true to set, false to clear.


read

virtual override

virtual void read(BitReader & reader) override

Defined in src/stun/include/icy/stun/attributes.h:340

Reads the body (not the type or size) for this type of attribute from the given buffer.

Parameters

  • reader Source bit reader positioned at the attribute body.
Reimplements

write

virtual const override

virtual void write(BitWriter & writer) const override

Defined in src/stun/include/icy/stun/attributes.h:341

Writes the body (not the type or size) to the given buffer.

Parameters

  • writer Destination bit writer.
Reimplements

Public Static Attributes

ReturnNameDescription
constexpr uint16_tSize static constexpr

Size

static constexpr

constexpr uint16_t Size = 8

Defined in src/stun/include/icy/stun/attributes.h:321

Private Attributes

ReturnNameDescription
uint64_t_bits

_bits

uint64_t _bits

Defined in src/stun/include/icy/stun/attributes.h:344