FMLiveSwitchStunMessage Class Reference

A STUN message. More...

Instance Methods

(NSMutableArray *) - attributes
 Gets the message attributes. More...
 
(FMLiveSwitchStunAlternateServerAttribute *) - getAlternateServer
 Gets the alternate-server attribute. More...
 
(FMLiveSwitchStunTurnChannelNumberAttribute *) - getChannelNumber
 Gets the channel-number attribute. More...
 
(FMLiveSwitchStunTurnConnectionIdAttribute *) - getConnectionId
 Gets the connection-id attribute. More...
 
(FMLiveSwitchStunTurnDataAttribute *) - getData
 Gets the data attribute. More...
 
(FMLiveSwitchStunTurnDontFragmentAttribute *) - getDontFragment
 Gets the don't-fragment attribute. More...
 
(FMLiveSwitchStunErrorCodeAttribute *) - getErrorCode
 Gets the error-code attribute. More...
 
(FMLiveSwitchStunTurnEvenPortAttribute *) - getEvenPort
 Gets the even-port attribute. More...
 
(FMLiveSwitchStunFingerprintAttribute *) - getFingerprint
 Gets the fingerprint attribute. More...
 
(FMLiveSwitchStunIceControlledAttribute *) - getIceControlled
 Gets the ICE-controlled attribute. More...
 
(FMLiveSwitchStunIceControllingAttribute *) - getIceControlling
 Gets the ICE-controlling attribute. More...
 
(int) - getLength
 Gets the length of the message. More...
 
(FMLiveSwitchStunTurnLifetimeAttribute *) - getLifetime
 Gets the lifetime attribute. More...
 
(FMLiveSwitchStunMappedAddressAttribute *) - getMappedAddress
 Gets the mapped-address attribute. More...
 
(FMLiveSwitchStunMessageIntegrityAttribute *) - getMessageIntegrity
 Gets the message-integrity attribute. More...
 
(FMLiveSwitchStunNonceAttribute *) - getNonce
 Gets the nonce attribute. More...
 
(int) - getPayloadLength
 Gets the length of the payload. More...
 
(FMLiveSwitchStunIcePriorityAttribute *) - getPriority
 Gets the priority attribute. More...
 
(FMLiveSwitchStunRealmAttribute *) - getRealm
 Gets the realm attribute. More...
 
(FMLiveSwitchStunTurnRequestedAddressFamilyAttribute *) - getRequestedAddressFamily
 Gets the requested-address-family attribute. More...
 
(FMLiveSwitchStunTurnRequestedTransportAttribute *) - getRequestedTransport
 Gets the requested-transport attribute. More...
 
(FMLiveSwitchStunTurnReservationTokenAttribute *) - getReservationToken
 Gets the reservation-token attribute. More...
 
(FMLiveSwitchStunSoftwareAttribute *) - getSoftware
 Gets the software attribute. More...
 
(FMLiveSwitchStunTransactionTransmitCounterAttribute *) - getTransactionTransmitCounter
 Gets the transaction-transmit-counter attribute. More...
 
(FMLiveSwitchStunUnknownAttributesAttribute *) - getUnknownAttributes
 Gets the unknown-attributes attribute. More...
 
(FMLiveSwitchStunIceUseCandidateAttribute *) - getUseCandidate
 Gets the use-candidate attribute. More...
 
(FMLiveSwitchStunUsernameAttribute *) - getUsername
 Gets the username attribute. More...
 
(FMLiveSwitchStunXorMappedAddressAttribute *) - getXorMappedAddress
 Gets the XOR-mapped-address attribute. More...
 
(FMLiveSwitchStunTurnXorPeerAddressAttribute *) - getXorPeerAddress
 Gets the XOR-peer-address attribute. More...
 
(FMLiveSwitchStunTurnXorRelayedAddressAttribute *) - getXorRelayedAddress
 Gets the XOR-relayed-address attribute. More...
 
(instancetype) - initWithMessageType:transactionId:
 Initializes a new instance of the FMLiveSwitchStunMessage class. More...
 
(FMLiveSwitchStunMessageType) - messageType
 Gets the message type. More...
 
(int) - method
 Gets the method. More...
 
(void) - setAlternateServerWithAttribute:
 Set the alternate-server attribute. More...
 
(void) - setChannelNumberWithAttribute:
 Sets the channel-number attribute. More...
 
(void) - setConnectionIdWithAttribute:
 Sets the connection-id attribute. More...
 
(void) - setDataWithAttribute:
 Sets the data attribute. More...
 
(void) - setDontFragmentWithAttribute:
 Sets the don't-fragment attribute. More...
 
(void) - setErrorCodeWithAttribute:
 Set the error-code attribute. More...
 
(void) - setEvenPortWithAttribute:
 Sets the even-port attribute. More...
 
(void) - setFingerprintWithAttribute:
 Set the fingerprint attribute. More...
 
(void) - setIceControlledWithAttribute:
 Sets the ICE-controlled attribute. More...
 
(void) - setIceControllingWithAttribute:
 Sets the ICE-controlling attribute. More...
 
(void) - setLifetimeWithAttribute:
 Sets the lifetime attribute. More...
 
(void) - setMappedAddressWithAttribute:
 Set the mapped-address attribute. More...
 
(void) - setMessageIntegrityWithAttribute:
 Set the message-integrity attribute. More...
 
(void) - setNonceWithAttribute:
 Set the nonce attribute. More...
 
(void) - setPriorityWithAttribute:
 Sets the priority attribute. More...
 
(void) - setRealmWithAttribute:
 Set the realm attribute. More...
 
(void) - setRequestedAddressFamilyWithAttribute:
 Sets the requested-address-family attribute. More...
 
(void) - setRequestedTransportWithAttribute:
 Sets the requested-transport attribute. More...
 
(void) - setReservationTokenWithAttribute:
 Sets the reservation-token attribute. More...
 
(void) - setSoftwareWithAttribute:
 Set the software attribute. More...
 
(void) - setTransactionTransmitCounterWithAttribute:
 Set the transaction-transmit-counter attribute. More...
 
(void) - setUnknownAttributesWithAttribute:
 Set the unknown-attributes attribute. More...
 
(void) - setUseCandidateWithAttribute:
 Sets the use-candidate attribute. More...
 
(void) - setUsernameWithAttribute:
 Set the username attribute. More...
 
(void) - setXorMappedAddressWithAttribute:
 Set the XOR-mapped-address attribute. More...
 
(void) - setXorPeerAddressWithAttribute:
 Sets the XOR-peer-address attribute. More...
 
(void) - setXorRelayedAddressWithAttribute:
 Sets the XOR-relayed-address attribute. More...
 
(FMLiveSwitchDataBuffer *) - transactionId
 Gets the transaction ID. More...
 
(void) - writeToWithBuffer:
 Writes the message to a data buffer. More...
 
(void) - writeToWithBuffer:offset:
 Writes the message to a data buffer. More...
 
(void) - writeToWithBuffer:offset:offsetPlus:
 Writes the message to a data buffer. More...
 

Class Methods

(int) + allocateMethod
 Gets the allocate method. More...
 
(int) + bindingMethod
 Gets the binding method. More...
 
(int) + channelBindMethod
 Gets the channel-bind method. More...
 
(int) + connectionAttemptMethod
 Gets the connection-attempt method. More...
 
(int) + connectionBindMethod
 Gets the connection-bind method. More...
 
(int) + connectMethod
 Gets the connect method. More...
 
(FMLiveSwitchStunMessage *) + createMessageWithMethod:messageType:transactionId:
 Creates a message. More...
 
(int) + createPermissionMethod
 Gets the create-permission method. More...
 
(int) + dataMethod
 Gets the data method. More...
 
(FMLiveSwitchDataBuffer *) + generateTransactionId
 Generates a random transaction ID. More...
 
(NSMutableData *) + magicCookieBytes
 Gets the "magic cookie" bytes. More...
 
(long long) + magicCookieValue
 Gets the "magic cookie" value. More...
 
(FMLiveSwitchStunMessage *) + messageWithMessageType:transactionId:
 Initializes a new instance of the FMLiveSwitchStunMessage class. More...
 
(FMLiveSwitchStunMessage *) + readFromWithBuffer:
 Reads a FMLiveSwitchStunMessage instance from a buffer. More...
 
(FMLiveSwitchStunMessage *) + readFromWithBuffer:offset:
 Reads a FMLiveSwitchStunMessage instance from a buffer. More...
 
(FMLiveSwitchStunMessage *) + readFromWithBuffer:offset:length:
 Reads an FMLiveSwitchStunMessage instance from a buffer. More...
 
(int) + refreshMethod
 Gets the refresh method. More...
 
(int) + sendMethod
 Gets the send method. More...
 

Detailed Description

A STUN message.

Method Documentation

◆ allocateMethod

+ (int) allocateMethod

Gets the allocate method.

◆ attributes

- (NSMutableArray*) attributes

Gets the message attributes.

◆ bindingMethod

+ (int) bindingMethod

Gets the binding method.

◆ channelBindMethod

+ (int) channelBindMethod

Gets the channel-bind method.

◆ connectionAttemptMethod

+ (int) connectionAttemptMethod

Gets the connection-attempt method.

◆ connectionBindMethod

+ (int) connectionBindMethod

Gets the connection-bind method.

◆ connectMethod

+ (int) connectMethod

Gets the connect method.

◆ createMessageWithMethod:messageType:transactionId:

+ (FMLiveSwitchStunMessage*) createMessageWithMethod: (int)  method
messageType: (FMLiveSwitchStunMessageType)  messageType
transactionId: (FMLiveSwitchDataBuffer *)  transactionId 

Creates a message.

Parameters
methodThe method.
messageTypeType of the message.
transactionIdThe transaction ID.

◆ createPermissionMethod

+ (int) createPermissionMethod

Gets the create-permission method.

◆ dataMethod

+ (int) dataMethod

Gets the data method.

◆ generateTransactionId

+ (FMLiveSwitchDataBuffer*) generateTransactionId

Generates a random transaction ID.

◆ getAlternateServer

Gets the alternate-server attribute.

◆ getChannelNumber

Gets the channel-number attribute.

◆ getConnectionId

Gets the connection-id attribute.

◆ getData

Gets the data attribute.

◆ getDontFragment

Gets the don't-fragment attribute.

◆ getErrorCode

Gets the error-code attribute.

◆ getEvenPort

Gets the even-port attribute.

◆ getFingerprint

Gets the fingerprint attribute.

◆ getIceControlled

Gets the ICE-controlled attribute.

◆ getIceControlling

Gets the ICE-controlling attribute.

◆ getLength

- (int) getLength

Gets the length of the message.

◆ getLifetime

Gets the lifetime attribute.

◆ getMappedAddress

Gets the mapped-address attribute.

◆ getMessageIntegrity

Gets the message-integrity attribute.

◆ getNonce

Gets the nonce attribute.

◆ getPayloadLength

- (int) getPayloadLength

Gets the length of the payload.

◆ getPriority

Gets the priority attribute.

◆ getRealm

Gets the realm attribute.

◆ getRequestedAddressFamily

Gets the requested-address-family attribute.

◆ getRequestedTransport

Gets the requested-transport attribute.

◆ getReservationToken

Gets the reservation-token attribute.

◆ getSoftware

Gets the software attribute.

◆ getTransactionTransmitCounter

- (FMLiveSwitchStunTransactionTransmitCounterAttribute*) getTransactionTransmitCounter

Gets the transaction-transmit-counter attribute.

◆ getUnknownAttributes

- (FMLiveSwitchStunUnknownAttributesAttribute*) getUnknownAttributes

Gets the unknown-attributes attribute.

◆ getUseCandidate

Gets the use-candidate attribute.

◆ getUsername

Gets the username attribute.

◆ getXorMappedAddress

Gets the XOR-mapped-address attribute.

◆ getXorPeerAddress

Gets the XOR-peer-address attribute.

◆ getXorRelayedAddress

Gets the XOR-relayed-address attribute.

◆ initWithMessageType:transactionId:

- (instancetype) initWithMessageType: (FMLiveSwitchStunMessageType)  messageType
transactionId: (FMLiveSwitchDataBuffer *)  transactionId 

◆ magicCookieBytes

+ (NSMutableData*) magicCookieBytes

Gets the "magic cookie" bytes.

◆ magicCookieValue

+ (long long) magicCookieValue

Gets the "magic cookie" value.

◆ messageType

- (FMLiveSwitchStunMessageType) messageType

Gets the message type.

◆ messageWithMessageType:transactionId:

+ (FMLiveSwitchStunMessage*) messageWithMessageType: (FMLiveSwitchStunMessageType)  messageType
transactionId: (FMLiveSwitchDataBuffer *)  transactionId 

Initializes a new instance of the FMLiveSwitchStunMessage class.

Parameters
messageTypeThe type of the message.
transactionIdThe transaction ID.

◆ method

◆ readFromWithBuffer:

+ (FMLiveSwitchStunMessage*) readFromWithBuffer: (FMLiveSwitchDataBuffer *)  buffer

Reads a FMLiveSwitchStunMessage instance from a buffer.

Parameters
bufferThe buffer.

◆ readFromWithBuffer:offset:

+ (FMLiveSwitchStunMessage*) readFromWithBuffer: (FMLiveSwitchDataBuffer *)  buffer
offset: (int)  offset 

Reads a FMLiveSwitchStunMessage instance from a buffer.

Parameters
bufferThe buffer.
offsetThe offset.

◆ readFromWithBuffer:offset:length:

+ (FMLiveSwitchStunMessage*) readFromWithBuffer: (FMLiveSwitchDataBuffer *)  buffer
offset: (int)  offset
length: (int *)  length 

Reads an FMLiveSwitchStunMessage instance from a buffer.

Parameters
bufferThe buffer.
offsetThe offset.
lengthThe length of the parsed segment.

◆ refreshMethod

+ (int) refreshMethod

Gets the refresh method.

◆ sendMethod

+ (int) sendMethod

Gets the send method.

◆ setAlternateServerWithAttribute:

- (void) setAlternateServerWithAttribute: (FMLiveSwitchStunAlternateServerAttribute *)  attribute

Set the alternate-server attribute.

Parameters
attributeThe alternate-server attribute.

◆ setChannelNumberWithAttribute:

- (void) setChannelNumberWithAttribute: (FMLiveSwitchStunTurnChannelNumberAttribute *)  attribute

Sets the channel-number attribute.

Parameters
attributeThe channel-number attribute.

◆ setConnectionIdWithAttribute:

- (void) setConnectionIdWithAttribute: (FMLiveSwitchStunTurnConnectionIdAttribute *)  attribute

Sets the connection-id attribute.

Parameters
attributeThe connection-id attribute.

◆ setDataWithAttribute:

- (void) setDataWithAttribute: (FMLiveSwitchStunTurnDataAttribute *)  attribute

Sets the data attribute.

Parameters
attributeThe data attribute.

◆ setDontFragmentWithAttribute:

- (void) setDontFragmentWithAttribute: (FMLiveSwitchStunTurnDontFragmentAttribute *)  attribute

Sets the don't-fragment attribute.

Parameters
attributeThe don't-fragment attribute.

◆ setErrorCodeWithAttribute:

- (void) setErrorCodeWithAttribute: (FMLiveSwitchStunErrorCodeAttribute *)  attribute

Set the error-code attribute.

Parameters
attributeThe error-code attribute.

◆ setEvenPortWithAttribute:

- (void) setEvenPortWithAttribute: (FMLiveSwitchStunTurnEvenPortAttribute *)  attribute

Sets the even-port attribute.

Parameters
attributeThe even-port attribute.

◆ setFingerprintWithAttribute:

- (void) setFingerprintWithAttribute: (FMLiveSwitchStunFingerprintAttribute *)  attribute

Set the fingerprint attribute.

Parameters
attributeThe fingerprint attribute.

◆ setIceControlledWithAttribute:

- (void) setIceControlledWithAttribute: (FMLiveSwitchStunIceControlledAttribute *)  attribute

Sets the ICE-controlled attribute.

Parameters
attributeThe ICE-controlled attribute.

◆ setIceControllingWithAttribute:

- (void) setIceControllingWithAttribute: (FMLiveSwitchStunIceControllingAttribute *)  attribute

Sets the ICE-controlling attribute.

Parameters
attributeThe ICE-controlling attribute.

◆ setLifetimeWithAttribute:

- (void) setLifetimeWithAttribute: (FMLiveSwitchStunTurnLifetimeAttribute *)  attribute

Sets the lifetime attribute.

Parameters
attributeThe lifetime attribute.

◆ setMappedAddressWithAttribute:

- (void) setMappedAddressWithAttribute: (FMLiveSwitchStunMappedAddressAttribute *)  attribute

Set the mapped-address attribute.

Parameters
attributeThe mapped-address attribute.

◆ setMessageIntegrityWithAttribute:

- (void) setMessageIntegrityWithAttribute: (FMLiveSwitchStunMessageIntegrityAttribute *)  attribute

Set the message-integrity attribute.

Parameters
attributeThe message-integrity attribute.

◆ setNonceWithAttribute:

- (void) setNonceWithAttribute: (FMLiveSwitchStunNonceAttribute *)  attribute

Set the nonce attribute.

Parameters
attributeThe nonce attribute.

◆ setPriorityWithAttribute:

- (void) setPriorityWithAttribute: (FMLiveSwitchStunIcePriorityAttribute *)  attribute

Sets the priority attribute.

Parameters
attributeThe priority attribute.

◆ setRealmWithAttribute:

- (void) setRealmWithAttribute: (FMLiveSwitchStunRealmAttribute *)  attribute

Set the realm attribute.

Parameters
attributeThe realm attribute.

◆ setRequestedAddressFamilyWithAttribute:

- (void) setRequestedAddressFamilyWithAttribute: (FMLiveSwitchStunTurnRequestedAddressFamilyAttribute *)  attribute

Sets the requested-address-family attribute.

Parameters
attributeThe requested-address-family attribute.

◆ setRequestedTransportWithAttribute:

- (void) setRequestedTransportWithAttribute: (FMLiveSwitchStunTurnRequestedTransportAttribute *)  attribute

Sets the requested-transport attribute.

Parameters
attributeThe requested-transport attribute.

◆ setReservationTokenWithAttribute:

- (void) setReservationTokenWithAttribute: (FMLiveSwitchStunTurnReservationTokenAttribute *)  attribute

Sets the reservation-token attribute.

Parameters
attributeThe reservation-token attribute.

◆ setSoftwareWithAttribute:

- (void) setSoftwareWithAttribute: (FMLiveSwitchStunSoftwareAttribute *)  attribute

Set the software attribute.

Parameters
attributeThe software attribute.

◆ setTransactionTransmitCounterWithAttribute:

- (void) setTransactionTransmitCounterWithAttribute: (FMLiveSwitchStunTransactionTransmitCounterAttribute *)  attribute

Set the transaction-transmit-counter attribute.

Parameters
attributeThe transaction-transmit-counter attribute.

◆ setUnknownAttributesWithAttribute:

- (void) setUnknownAttributesWithAttribute: (FMLiveSwitchStunUnknownAttributesAttribute *)  attribute

Set the unknown-attributes attribute.

Parameters
attributeThe unknown-attributes attribute.

◆ setUseCandidateWithAttribute:

- (void) setUseCandidateWithAttribute: (FMLiveSwitchStunIceUseCandidateAttribute *)  attribute

Sets the use-candidate attribute.

Parameters
attributeThe use-candidate attribute.

◆ setUsernameWithAttribute:

- (void) setUsernameWithAttribute: (FMLiveSwitchStunUsernameAttribute *)  attribute

Set the username attribute.

Parameters
attributeThe username attribute.

◆ setXorMappedAddressWithAttribute:

- (void) setXorMappedAddressWithAttribute: (FMLiveSwitchStunXorMappedAddressAttribute *)  attribute

Set the XOR-mapped-address attribute.

Parameters
attributeThe XOR-mapped-address attribute.

◆ setXorPeerAddressWithAttribute:

- (void) setXorPeerAddressWithAttribute: (FMLiveSwitchStunTurnXorPeerAddressAttribute *)  attribute

Sets the XOR-peer-address attribute.

Parameters
attributeThe XOR-peer-address attribute.

◆ setXorRelayedAddressWithAttribute:

- (void) setXorRelayedAddressWithAttribute: (FMLiveSwitchStunTurnXorRelayedAddressAttribute *)  attribute

Sets the XOR-relayed-address attribute.

Parameters
attributeThe XOR-relayed-address attribute.

◆ transactionId

- (FMLiveSwitchDataBuffer*) transactionId

Gets the transaction ID.

◆ writeToWithBuffer:

- (void) writeToWithBuffer: (FMLiveSwitchDataBuffer *)  buffer

Writes the message to a data buffer.

Parameters
bufferThe buffer.

◆ writeToWithBuffer:offset:

- (void) writeToWithBuffer: (FMLiveSwitchDataBuffer *)  buffer
offset: (int)  offset 

Writes the message to a data buffer.

Parameters
bufferThe buffer.
offsetThe offset.

◆ writeToWithBuffer:offset:offsetPlus:

- (void) writeToWithBuffer: (FMLiveSwitchDataBuffer *)  buffer
offset: (int)  offset
offsetPlus: (int *)  offsetPlus 

Writes the message to a data buffer.

Parameters
bufferThe buffer.
offsetThe offset.
offsetPlusThe offset plus the value length.