Home
STUN module (rfc5389)

UInt16ListAttribute

Implements a STUN/TURN attribute that holds a list of attribute type codes.

UInt16ListAttribute

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

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

Inherits: Attribute

Implements a STUN/TURN attribute that holds a list of attribute type codes. Used by the UNKNOWN-ATTRIBUTES attribute (RFC 5389 section 15.9).

List of all members

NameKindOwner
UInt16ListAttributefunctionDeclared here
UInt16ListAttributefunctionDeclared here
~UInt16ListAttributefunctionDeclared here
clonefunctionDeclared here
sizefunctionDeclared here
getTypefunctionDeclared here
setTypefunctionDeclared here
addTypefunctionDeclared here
readfunctionDeclared here
writefunctionDeclared here
_attrTypesvariableDeclared 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
UInt16ListAttribute
UInt16ListAttributeCopy constructor; duplicates the type list.
std::unique_ptr< Attribute >clone virtual overrideReturns a deep copy of this attribute.
size_tsize const
uint16_tgetType constReturns the type code at the given list position.
voidsetTypeOverwrites the type code at the given list position.
voidaddTypeAppends a type code to the list and updates the attribute size.
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.

UInt16ListAttribute

UInt16ListAttribute(uint16_t type, uint16_t size)

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

Parameters

  • type Wire type code for the concrete attribute.

  • size Initial body length in bytes.


UInt16ListAttribute

UInt16ListAttribute(const UInt16ListAttribute & r)

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

Copy constructor; duplicates the type list.


clone

virtual override

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

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

Returns a deep copy of this attribute.

Reimplements

size

const

size_t size() const

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

Returns

Number of attribute type codes in the list.


getType

const

uint16_t getType(int index) const

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

Returns the type code at the given list position.

Parameters

  • index Zero-based list index.

Returns

Attribute type code at index.


setType

void setType(int index, uint16_t value)

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

Overwrites the type code at the given list position.

Parameters

  • index Zero-based list index.

  • value New attribute type code.


addType

void addType(uint16_t value)

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

Appends a type code to the list and updates the attribute size.

Parameters


read

virtual override

virtual void read(BitReader & reader) override

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

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:457

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

Parameters

  • writer Destination bit writer.
Reimplements

Private Attributes

ReturnNameDescription
std::vector< uint16_t >_attrTypes

_attrTypes

std::vector< uint16_t > _attrTypes

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