Noble Connect
Add relays and punchthrough to Mirror or UNet
NobleConnect.Turn.AttributeType Class Reference

Turn Attribute Types are defined in RFC 5766 Section 14 More...

Inherits NobleConnect.Stun.AttributeType.

Public Member Functions

 AttributeType (ushort value)
 Construct an AttributeType with the provided value More...
 
- Public Member Functions inherited from NobleConnect.Stun.AttributeType
 AttributeType (ushort value)
 Construct an AttributeType with the provided value More...
 
override bool Equals (object obj)
 Compare two AttributeTypes objects using their values More...
 
override int GetHashCode ()
 Calculate a hash for this AttributeType using the value. More...
 

Static Public Member Functions

static implicit operator ushort (AttributeType a)
 Converts an AttributeType to an unsigned short by returning the value More...
 
static operator AttributeType (ushort a)
 Convert an unsigned short to an AttributeType by constructing a new AttributeType and passing in the value More...
 
new static Stun.Attribute CreateAttribute (byte[] buffer, int bufferIndex, ReadOnlyByteArray transactionID)
 Construct an Attribute from the provided byte array. More...
 
- Static Public Member Functions inherited from NobleConnect.Stun.AttributeType
static Attribute CreateAttribute (byte[] buffer, int bufferIndex, ReadOnlyByteArray transactionID)
 Construct an Attribute from the provided byte array. More...
 
static implicit operator ushort (AttributeType a)
 Converts an AttributeType to an unsigned short by returning the value More...
 
static operator AttributeType (ushort a)
 Convert an unsigned short to an AttributeType by constructing a new AttributeType and passing in the value More...
 
static bool operator== (AttributeType a, AttributeType b)
 Compare two AttributeTypes using their values More...
 
static bool operator!= (AttributeType a, AttributeType b)
 Compare two AttributeTypes using their values More...
 

Static Public Attributes

static readonly AttributeType ChannelNumber = new AttributeType(CHANNEL_NUMBER)
 
static readonly AttributeType Lifetime = new AttributeType(LIFETIME)
 
static readonly AttributeType XORPeerAddress = new AttributeType(XOR_PEER_ADDRESS)
 This attribute type is used to hold a peer's server reflexive ip address and port. More...
 
static readonly AttributeType Data = new AttributeType(DATA)
 This attribute type is used to hold some data arriving from a peer over a Turn relay. More...
 
static readonly AttributeType XORRelayedAddress = new AttributeType(XOR_RELAYED_ADDRESS)
 This attribute type is used to hold a the allocated relay address on the Turn server More...
 
static readonly AttributeType EvenPort = new AttributeType(EVEN_PORT)
 
static readonly AttributeType RequestedTransport = new AttributeType(REQUESTED_TRANSPORT)
 This attribute type is used to request that the server use a particular transport protocol. More...
 
static readonly AttributeType DontFragment = new AttributeType(DONT_FRAGMENT)
 
static readonly AttributeType ReservationToken = new AttributeType(RESERVATION_TOKEN)
 
static readonly AttributeType SessionGUID = new AttributeType(SESSION_GUID)
 Optional GUID used to identity the session that a peer belongs to. More...
 
static readonly AttributeType AdditionalAddressFamily = new AttributeType(ADDITIONAL_ADDRESS_FAMILY)
 
- Static Public Attributes inherited from NobleConnect.Stun.AttributeType
const ushort SIZE = 2
 Serialiazed size in bytes More...
 
static readonly AttributeType MappedAddress = new AttributeType(MAPPED_ADDRESS)
 This attribute type is used to hold an ip address and port. It is returned in response to a Bind Request and probably for other things. More...
 
static readonly AttributeType Username = new AttributeType(USERNAME)
 This attribute type is used to hold the Stun username used for authentication. More...
 
static readonly AttributeType MessageIntegrity = new AttributeType(MESSAGE_INTEGRITY)
 This attribute type is used to hold an array of bytes that is used to confirm the integrity of messages. More...
 
static readonly AttributeType ErrorCode = new AttributeType(ERROR_CODE)
 This attribute type is used to hold an error code and message. More...
 
static readonly AttributeType UnknownAttributes = new AttributeType(UNKNOWN_ATTRIBUTES)
 This attribute type is used to hold a list of unknown attributes so the server can let us know if it didn't recognize something we sent. More...
 
static readonly AttributeType Realm = new AttributeType(REALM)
 This attribute type is used to hold a string representing the "realm" the server is in. This is can be used as a hint to let us know which credentials to use. More...
 
static readonly AttributeType Nonce = new AttributeType(NONCE)
 This attribute type is used to hold nonce value that is used as part of message validation. More...
 
static readonly AttributeType XORMappedAddress = new AttributeType(XOR_MAPPED_ADDRESS)
 This attribute type is used to hold an ip address and port. It is returned in response to a Bind Request and probably for other things. More...
 
static readonly AttributeType ChangeRequest = new AttributeType(CHANGE_REQUEST)
 This attribute type is used in Bind Requests as part of NAT Behaviour Discovery. More...
 
static readonly AttributeType Padding = new AttributeType(PADDING)
 This attribute type is used for padding messages to force fragmentation as part of NAT Behaviour discovery. More...
 
static readonly AttributeType ResponsePort = new AttributeType(RESPONSE_PORT)
 This attribute type is used for binding lifetime discovery and maybe other things. More...
 
static readonly AttributeType Software = new AttributeType(SOFTWARE)
 This attribute type has no impact on operation of the protocol, and serves only as a tool for diagnostic and debugging purposes More...
 
static readonly AttributeType AlternateServer = new AttributeType(ALTERNATE_SERVER)
 This attribute type is used to handle redirects to another Stun server. Maybe useful for load balancing. More...
 
static readonly AttributeType Fingerprint = new AttributeType(FINGERPRINT)
 This attribute type contains a string that is used to identify this message as a Stun message. More...
 
static readonly AttributeType ResponseOrigin = new AttributeType(RESPONSE_ORIGIN)
 This attribute type is used for detecting double-NAT configurations More...
 
static readonly AttributeType OtherAddress = new AttributeType(OTHER_ADDRESS)
 This attribute type is returned in Bind Responses as part of NAT Behaviour Discovery. More...
 
static readonly AttributeType Origin = new AttributeType(ORIGIN)
 Origin address used so that the server knows which realm to authenticate with. More...
 

Additional Inherited Members

- Public Attributes inherited from NobleConnect.Stun.AttributeType
readonly ushort value
 The actual integer value of this AttributeType as defined in the relavent RFC's More...
 

Detailed Description

Turn Attribute Types are defined in RFC 5766 Section 14

I would have preferred this to be an enum, but it needs to be extendable for Turn and Ice. So instead it is this weird enum-like class that exposes static instances of itself for each different AttributeType.

Constructor & Destructor Documentation

◆ AttributeType()

NobleConnect.Turn.AttributeType.AttributeType ( ushort  value)

Construct an AttributeType with the provided value

Parameters
value

Member Function Documentation

◆ CreateAttribute()

new static Stun.Attribute NobleConnect.Turn.AttributeType.CreateAttribute ( byte[]  buffer,
int  bufferIndex,
ReadOnlyByteArray  transactionID 
)
static

Construct an Attribute from the provided byte array.

First the AttributeType is read from the byte buffer and then an Attribute of the appropriate class is created via a giant ugly switch statement. Attribute values are deserialized from the remainder of the byte array.

Parameters
buffer
bufferIndex
Returns

◆ operator AttributeType()

static NobleConnect.Turn.AttributeType.operator AttributeType ( ushort  a)
explicitstatic

Convert an unsigned short to an AttributeType by constructing a new AttributeType and passing in the value

Parameters
a

◆ operator ushort()

static implicit NobleConnect.Turn.AttributeType.operator ushort ( AttributeType  a)
static

Converts an AttributeType to an unsigned short by returning the value

Parameters
a

Member Data Documentation

◆ AdditionalAddressFamily

readonly AttributeType NobleConnect.Turn.AttributeType.AdditionalAddressFamily = new AttributeType(ADDITIONAL_ADDRESS_FAMILY)
static

◆ ChannelNumber

readonly AttributeType NobleConnect.Turn.AttributeType.ChannelNumber = new AttributeType(CHANNEL_NUMBER)
static

◆ Data

readonly AttributeType NobleConnect.Turn.AttributeType.Data = new AttributeType(DATA)
static

This attribute type is used to hold some data arriving from a peer over a Turn relay.

◆ DontFragment

readonly AttributeType NobleConnect.Turn.AttributeType.DontFragment = new AttributeType(DONT_FRAGMENT)
static

◆ EvenPort

readonly AttributeType NobleConnect.Turn.AttributeType.EvenPort = new AttributeType(EVEN_PORT)
static

◆ Lifetime

readonly AttributeType NobleConnect.Turn.AttributeType.Lifetime = new AttributeType(LIFETIME)
static

◆ RequestedTransport

readonly AttributeType NobleConnect.Turn.AttributeType.RequestedTransport = new AttributeType(REQUESTED_TRANSPORT)
static

This attribute type is used to request that the server use a particular transport protocol.

It is sent with Allocation Requests and it always UDP

◆ ReservationToken

readonly AttributeType NobleConnect.Turn.AttributeType.ReservationToken = new AttributeType(RESERVATION_TOKEN)
static

◆ SessionGUID

readonly AttributeType NobleConnect.Turn.AttributeType.SessionGUID = new AttributeType(SESSION_GUID)
static

Optional GUID used to identity the session that a peer belongs to.

◆ XORPeerAddress

readonly AttributeType NobleConnect.Turn.AttributeType.XORPeerAddress = new AttributeType(XOR_PEER_ADDRESS)
static

This attribute type is used to hold a peer's server reflexive ip address and port.

It is used to send a peer's address to the Turn server as part of a Permission Request.

◆ XORRelayedAddress

readonly AttributeType NobleConnect.Turn.AttributeType.XORRelayedAddress = new AttributeType(XOR_RELAYED_ADDRESS)
static

This attribute type is used to hold a the allocated relay address on the Turn server

It is received from the Turn server in response to an Allocation Request