An attribute that holds on ip AddressFamily an for use in allocation requests More...
Inherits NobleConnect.Stun.Attribute.
Public Member Functions | |
AttributeAddressFamily (AttributeType attributeType, AddressFamily family) | |
Construct an AttributeAddressFamily of the provided AttributeType using the provided AddressFamily More... | |
override void | SerializeValues (BufferView buffer, ReadOnlyByteArray transactionID) |
Serializing values to payload as byte array More... | |
override ushort | GetValueSize () |
Get the serialized size of the attribute values More... | |
![]() | |
Attribute (AttributeType type) | |
Construct an Attribute of the provided AttributeType More... | |
Attribute (AttributeType type, ref int offset) | |
void | Serialize (BufferView buffer, ReadOnlyByteArray transactionID) |
Convert this attribute to a bunch of bytes and add them to the provided buffer More... | |
ushort | GetSize () |
Public Attributes | |
readonly AddressFamily | family = 0 |
The transfer protocol More... | |
![]() | |
readonly AttributeType | attributeType |
The AttributeType of this Attribute More... | |
Additional Inherited Members | |
![]() | |
static ushort | DeserializeLength (byte[] buffer, ref int offset) |
Read the Attribute length from a byte array. More... | |
static ushort | GetNumPaddingBytes (int length) |
Calculate padding based on length More... | |
![]() | |
const int | HEADER_SIZE = 4 |
An attribute that holds on ip AddressFamily an for use in allocation requests
The REQUESTED-ADDRESS-FAMILY attribute is used by clients to request the allocation of a specific address type from a server.
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Family | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Family: there are two values defined for this field 0x01 for IPv4 addresses and 0x02 for IPv6 addresses. Reserved: the 24 bits in the Reserved field MUST be set to zero
NobleConnect.Turn.AttributeAddressFamily.AttributeAddressFamily | ( | AttributeType | attributeType, |
AddressFamily | family | ||
) |
Construct an AttributeAddressFamily of the provided AttributeType using the provided AddressFamily
This is called when constructing an Attribute to send to a Stun server.
attributeType | |
protocol |
|
virtual |
Get the serialized size of the attribute values
Reimplemented from NobleConnect.Stun.Attribute.
|
virtual |
Serializing values to payload as byte array
Four bytes long. First byte is the encoded address damily. The rest are 0.
Reimplemented from NobleConnect.Stun.Attribute.
readonly AddressFamily NobleConnect.Turn.AttributeAddressFamily.family = 0 |
The transfer protocol