Class Attribute
A STUN attribute.
Inheritance
Inherited Members
Namespace: FM.LiveSwitch.Stun
Assembly: FM.LiveSwitch.dll
Syntax
public abstract class Attribute
  Properties
AlternateServerType
Gets the ALTERNATE-SERVER type.
Declaration
public static int AlternateServerType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
ChannelNumberType
Gets the CHANNEL-NUMBER type.
Declaration
public static int ChannelNumberType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
ConnectionIdType
Gets the CONNECTION-ID type.
Declaration
public static int ConnectionIdType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
ControlledType
Gets the CONTROLLED type.
Declaration
public static int ControlledType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
ControllingType
Gets the CONTROLLING type.
Declaration
public static int ControllingType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
DataType
Gets the DATA type.
Declaration
public static int DataType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
DontFragmentType
Gets the DONT-FRAGMENT type.
Declaration
public static int DontFragmentType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
ErrorCodeType
Gets the ERROR-CODE type.
Declaration
public static int ErrorCodeType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
EvenPortType
Gets the EVEN-PORT type.
Declaration
public static int EvenPortType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
FingerprintType
Gets the FINGERPRINT type.
Declaration
public static int FingerprintType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
LifetimeType
Gets the LIFETIME type.
Declaration
public static int LifetimeType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
MappedAddressType
Gets the MAPPED-ADDRESS type.
Declaration
public static int MappedAddressType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
MessageIntegrityType
Gets the MESSAGE-INTEGRITY type.
Declaration
public static int MessageIntegrityType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
NonceType
Gets the NONCE type.
Declaration
public static int NonceType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
PriorityType
Gets the PRIORITY type.
Declaration
public static int PriorityType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
RealmType
Gets the REALM type.
Declaration
public static int RealmType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
RequestedAddressFamilyType
Gets the REQUESTED-ADDRESS-FAMILY type.
Declaration
public static int RequestedAddressFamilyType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
RequestedTransportType
Gets the REQUESTED-TRANSPORT type.
Declaration
public static int RequestedTransportType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
ReservationTokenType
Gets the RESERVATION-TOKEN type.
Declaration
public static int ReservationTokenType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
SoftwareType
Gets the SOFTWARE type.
Declaration
public static int SoftwareType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
TransactionTransmitCounterType
Gets the comprehension-optional TRANSACTION_TRANSMIT_COUNTER type defined in RFC 7982.
Declaration
public static int TransactionTransmitCounterType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
TypeValue
Gets the type value.
Declaration
public abstract int TypeValue { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
UnknownAttributesType
Gets the UNKNOWN-ATTRIBUTES type.
Declaration
public static int UnknownAttributesType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
UseCandidateType
Gets the USE-CANDIDATE type.
Declaration
public static int UseCandidateType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
UsernameType
Gets the USERNAME type.
Declaration
public static int UsernameType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
XorMappedAddressType
Gets the XOR-MAPPED-ADDRESS type.
Declaration
public static int XorMappedAddressType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
XorPeerAddressType
Gets the XOR-PEER-ADDRESS type.
Declaration
public static int XorPeerAddressType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
XorRelayedAddressType
Gets the XOR-RELAYED-ADDRESS type.
Declaration
public static int XorRelayedAddressType { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Methods
GetLength()
Gets the length of the attribute, including header and padding.
Declaration
public int GetLength()
  Returns
| Type | Description | 
|---|---|
| System.Int32 | 
GetPaddingLength(Int32)
Gets the length of the padding.
Declaration
public int GetPaddingLength(int valueLength)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | valueLength | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | 
GetValueLength()
Gets the length of the attribute value.
Declaration
protected abstract int GetValueLength()
  Returns
| Type | Description | 
|---|---|
| System.Int32 | 
NextLength(DataBuffer, Int32)
Reads the length of the next attribute from a data buffer, including header and padding.
Declaration
public static int NextLength(DataBuffer buffer, int offset)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Int32 | 
ReadAddressType(DataBuffer, Int32)
Reads an address type.
Declaration
protected static AddressType ReadAddressType(DataBuffer buffer, int offset)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
Returns
| Type | Description | 
|---|---|
| AddressType | 
ReadFrom(DataBuffer, Int32, DataBuffer, DataBuffer)
Reads an Attribute from a data buffer.
Declaration
public static Attribute ReadFrom(DataBuffer buffer, int offset, DataBuffer transactionId, DataBuffer messageBuffer)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| DataBuffer | transactionId | The STUN message transaction ID.  | 
      
| DataBuffer | messageBuffer | The STUN message thus far as a byte array.  | 
      
Returns
| Type | Description | 
|---|---|
| Attribute | 
ReadFrom(DataBuffer, Int32, out Int32, DataBuffer, DataBuffer)
Reads an Attribute from a data buffer.
Declaration
public static Attribute ReadFrom(DataBuffer buffer, int offset, out int offsetPlus, DataBuffer transactionId, DataBuffer messageBuffer)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| System.Int32 | offsetPlus | The offset plus the attribute length.  | 
      
| DataBuffer | transactionId | The STUN message transaction ID.  | 
      
| DataBuffer | messageBuffer | The STUN message thus far as a byte array.  | 
      
Returns
| Type | Description | 
|---|---|
| Attribute | 
ReadIPAddress(DataBuffer, Int32, AddressType)
Reads an IP address.
Declaration
protected static string ReadIPAddress(DataBuffer buffer, int offset, AddressType addressType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| AddressType | addressType | The address type.  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | 
ReadPort(DataBuffer, Int32)
Reads a port.
Declaration
protected static int ReadPort(DataBuffer buffer, int offset)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Int32 | 
ReadXorIPAddress(DataBuffer, Int32, AddressType, DataBuffer)
Reads an XOR'd IP address.
Declaration
protected static string ReadXorIPAddress(DataBuffer buffer, int offset, AddressType addressType, DataBuffer transactionId)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| AddressType | addressType | The address type.  | 
      
| DataBuffer | transactionId | The transaction identifier.  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | 
ReadXorPort(DataBuffer, Int32, DataBuffer)
Reads an XOR'd port.
Declaration
protected static int ReadXorPort(DataBuffer buffer, int offset, DataBuffer transactionId)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| DataBuffer | transactionId | The transaction identifier.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Int32 | 
WriteAddressType(DataBuffer, Int32, AddressType)
Writes an address type.
Declaration
protected static void WriteAddressType(DataBuffer buffer, int offset, AddressType addressType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| AddressType | addressType | The address type.  | 
      
WriteIPAddress(DataBuffer, Int32, AddressType, String)
Writes an IP address.
Declaration
protected void WriteIPAddress(DataBuffer buffer, int offset, AddressType addressType, string ipAddress)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| AddressType | addressType | The address type.  | 
      
| System.String | ipAddress | The IP address.  | 
      
WritePort(DataBuffer, Int32, Int32)
Writes a port.
Declaration
protected void WritePort(DataBuffer buffer, int offset, int port)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| System.Int32 | port | The port.  | 
      
WriteTo(DataBuffer, Int32)
Writes the attribute to a data buffer.
Declaration
public void WriteTo(DataBuffer buffer, int offset)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
WriteTo(DataBuffer, Int32, out Int32)
Writes the attribute to a data buffer.
Declaration
public void WriteTo(DataBuffer buffer, int offset, out int offsetPlus)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| System.Int32 | offsetPlus | The offset plus the value length.  | 
      
WriteValueTo(DataBuffer, Int32)
Writes the attribute value to a data buffer.
Declaration
protected abstract void WriteValueTo(DataBuffer buffer, int offset)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
WriteXorIPAddress(DataBuffer, Int32, AddressType, String, DataBuffer)
Writes an XOR'd IP address.
Declaration
protected void WriteXorIPAddress(DataBuffer buffer, int offset, AddressType addressType, string ipAddress, DataBuffer transactionId)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| AddressType | addressType | The address type.  | 
      
| System.String | ipAddress | The IP address.  | 
      
| DataBuffer | transactionId | The transaction identifier.  | 
      
WriteXorPort(DataBuffer, Int32, Int32, DataBuffer)
Writes an XOR'd port.
Declaration
protected void WriteXorPort(DataBuffer buffer, int offset, int port, DataBuffer transactionId)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBuffer | buffer | The buffer.  | 
      
| System.Int32 | offset | The offset.  | 
      
| System.Int32 | port | The port.  | 
      
| DataBuffer | transactionId | The transaction identifier.  |