An attribute that holds a socket ProtocolType More...
Inherits NobleConnect.Stun.Attribute.
Public Member Functions | |
AttributeProtocol (AttributeType attributeType, ProtocolType protocol) | |
Construct an AttributeProtocol of the provided AttributeType using the provided ProtocolType More... | |
AttributeProtocol (AttributeType type, byte[] buffer, ref int offset) | |
Construct an AttributeProtocol from the provided byte array 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 ProtocolType | protocol = ProtocolType.Udp |
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 a socket ProtocolType
This will hold any ProtocolType but as per RFC 5766 Section 14.7 only UDP is ever actually used by the StunController.
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Protocol | RFFU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The Protocol field specifies the desired protocol. The codepoints used in this field are taken from those allowed in the Protocol field This specification only allows the use of codepoint 17 (User Datagram Protocol). The RFFU field MUST be set to zero on transmission and MUST be ignored on reception. It is reserved for future uses.
NobleConnect.Turn.AttributeProtocol.AttributeProtocol | ( | AttributeType | attributeType, |
ProtocolType | protocol | ||
) |
Construct an AttributeProtocol of the provided AttributeType using the provided ProtocolType
This is called when constructing an Attribute to send to a Stun server.
attributeType | |
protocol |
NobleConnect.Turn.AttributeProtocol.AttributeProtocol | ( | AttributeType | type, |
byte[] | buffer, | ||
ref int | offset | ||
) |
Construct an AttributeProtocol from the provided byte array
This is called when deserializing an AttributeProtocol received from a Stun server.
type | |
buffer | |
offset |
|
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 protocol. The rest are 0.
Reimplemented from NobleConnect.Stun.Attribute.
readonly ProtocolType NobleConnect.Turn.AttributeProtocol.protocol = ProtocolType.Udp |
The transfer protocol