Mapped Address Attribute. Holds an IPAddress and port. More...
Inherits NobleConnect.Stun.Attribute.
Inherited by NobleConnect.Stun.AttributeXORMappedAddress.
Public Member Functions | |
AttributeMappedAddress (AttributeType attributeType, ushort port, IPAddress ipAddress) | |
Construct an AttributeMappedAddress of the provided AttributeType using the provided ip address and port More... | |
AttributeMappedAddress (AttributeType type, byte[] buffer, ref int offset, ReadOnlyByteArray transactionID) | |
Construct an AttributeMappedAddress from the provided byte array More... | |
override void | SerializeValues (BufferView buffer, ReadOnlyByteArray transactionID) |
Transform family, ip, and port into ArraySegments of bytes to be sent over the network. More... | |
virtual void | SerializePort (BufferView buffer) |
Serialize the Port value. More... | |
virtual void | SerializeIPAddress (BufferView buffer) |
Serialize the IP Address value. More... | |
virtual void | SerializeIPv6Address (BufferView buffer, ReadOnlyByteArray transactionID) |
Serialize the IPv6 Address value. 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 () |
Static Public Member Functions | |
static ushort | DeserializePort (byte[] buffer, int offset) |
Realize the Port value. More... | |
static IPAddress | DeserializeIP (byte[] buffer, int offset) |
Realize the IP Address value. More... | |
static IPAddress | DeserializeIPv6 (byte[] buffer, int offset, ReadOnlyByteArray transactionID) |
Realize the IPv6 Address value. More... | |
![]() | |
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... | |
Public Attributes | |
readonly ushort | port |
The Port as an unsigned short More... | |
readonly ReadOnlyCollection< byte > | addressBytes |
The IPAddress as bytes More... | |
readonly AddressFamily | addressFamily |
The AddressFamily More... | |
![]() | |
readonly AttributeType | attributeType |
The AttributeType of this Attribute More... | |
Properties | |
IPAddress | IPAddress [get] |
IPEndPoint | IPEndPoint [get] |
Additional Inherited Members | |
![]() | |
const int | HEADER_SIZE = 4 |
Mapped Address Attribute. Holds an IPAddress and port.
See 5389 Section 15.3 for details. 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0 0 0 0 0 0 0 0| Family | Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Address(32 bits or 128 bits) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The address family can take on the following values: 0x01:IPv4 0x02:IPv6
The first 8 bits of the MAPPED-ADDRESS MUST are ignored. These bits are present for aligning on 32-bit boundaries. This attribute is used only by servers for achieving backwards compatibility with RFC 3489 clients.
NobleConnect.Stun.AttributeMappedAddress.AttributeMappedAddress | ( | AttributeType | attributeType, |
ushort | port, | ||
IPAddress | ipAddress | ||
) |
Construct an AttributeMappedAddress of the provided AttributeType using the provided ip address and port
This is called when constructing an Attribute to send to a Stun server.
attributeType | |
ipAddress | |
port |
NobleConnect.Stun.AttributeMappedAddress.AttributeMappedAddress | ( | AttributeType | type, |
byte[] | buffer, | ||
ref int | offset, | ||
ReadOnlyByteArray | transactionID | ||
) |
Construct an AttributeMappedAddress from the provided byte array
This is called when deserializing an AttributeMappedAddress received from a Stun server.
type | |
buffer | |
offset |
|
static |
Realize the IP Address value.
This is virtual because XORMAppedAddress overrides it to perform decoding
|
static |
Realize the IPv6 Address value.
This is virtual because XORMAppedAddress overrides it to perform decoding
|
static |
Realize the Port value.
This is virtual because XORMAppedAddress overrides it to perform decoding
|
virtual |
Get the serialized size of the attribute values
Reimplemented from NobleConnect.Stun.Attribute.
|
virtual |
Serialize the IP Address value.
This is virtual because XORMAppedAddress overrides it to perform decoding
Reimplemented in NobleConnect.Stun.AttributeXORMappedAddress.
|
virtual |
Serialize the IPv6 Address value.
This is virtual because XORMAppedAddress overrides it to perform decoding
Reimplemented in NobleConnect.Stun.AttributeXORMappedAddress.
|
virtual |
Serialize the Port value.
This is virtual because XORMAppedAddress overrides it to perform decoding
Reimplemented in NobleConnect.Stun.AttributeXORMappedAddress.
|
virtual |
Transform family, ip, and port into ArraySegments of bytes to be sent over the network.
Reimplemented from NobleConnect.Stun.Attribute.
readonly ReadOnlyCollection<byte> NobleConnect.Stun.AttributeMappedAddress.addressBytes |
The IPAddress as bytes
readonly AddressFamily NobleConnect.Stun.AttributeMappedAddress.addressFamily |
The AddressFamily
readonly ushort NobleConnect.Stun.AttributeMappedAddress.port |
The Port as an unsigned short
|
get |
|
get |