Amazon Kinesis Webrtc C SDK
Stun.h File Reference
#include "kvsstun/stun_data_types.h"
Include dependency graph for Stun.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StunHeader
 
struct  StunAttributeHeader
 
struct  StunAttributeAddress
 
struct  StunAttributeUsername
 
struct  StunAttributeFingerprint
 
struct  StunAttributePriority
 
struct  StunAttributeFlag
 
struct  StunAttributeMessageIntegrity
 
struct  StunAttributeLifetime
 
struct  StunAttributeRequestedTransport
 
struct  StunAttributeRealm
 
struct  StunAttributeNonce
 
struct  StunAttributeErrorCode
 
struct  StunAttributeIceControl
 
struct  StunAttributeData
 
struct  StunAttributeChannelNumber
 
struct  StunAttributeChangeRequest
 
struct  StunPacket
 

Macros

#define STUN_HEADER_LEN   (UINT16) 20
 
#define STUN_HEADER_TYPE_LEN   (UINT16) 2
 
#define STUN_HEADER_DATA_LEN   (UINT16) 2
 
#define STUN_HEADER_TRANSACTION_ID_LEN   (UINT16) 12
 
#define STUN_ATTRIBUTE_HEADER_TYPE_LEN   (UINT16) 2
 
#define STUN_ATTRIBUTE_HEADER_DATA_LEN   (UINT16) 2
 
#define STUN_ATTRIBUTE_HEADER_LEN   (UINT16)(STUN_ATTRIBUTE_HEADER_TYPE_LEN + STUN_ATTRIBUTE_HEADER_DATA_LEN)
 
#define STUN_ATTRIBUTE_ADDRESS_FAMILY_LEN   (UINT16) 2
 
#define STUN_ATTRIBUTE_ADDRESS_PORT_LEN   (UINT16) 2
 
#define STUN_ATTRIBUTE_ADDRESS_HEADER_LEN   (UINT16)(STUN_ATTRIBUTE_ADDRESS_FAMILY_LEN + STUN_ATTRIBUTE_ADDRESS_PORT_LEN)
 
#define STUN_ATTRIBUTE_FINGERPRINT_LEN   (UINT16) 4
 
#define STUN_ATTRIBUTE_PRIORITY_LEN   (UINT16) 4
 
#define STUN_ATTRIBUTE_LIFETIME_LEN   (UINT16) 4
 
#define STUN_ATTRIBUTE_CHANNEL_NUMBER_LEN   (UINT16) 4
 
#define STUN_ATTRIBUTE_CHANGE_REQUEST_FLAG_LEN   (UINT16) 4
 
#define STUN_ATTRIBUTE_ICE_CONTROL_LEN   (UINT16) 8
 
#define STUN_ATTRIBUTE_REQUESTED_TRANSPORT_PROTOCOL_LEN   (UINT16) 4
 
#define STUN_ATTRIBUTE_FLAG_LEN   (UINT16) 0
 
#define STUN_TRANSACTION_ID_LEN   (UINT16) 12
 
#define STUN_HMAC_VALUE_LEN   KVS_SHA1_DIGEST_LENGTH
 
#define STUN_ATTRIBUTE_MAX_COUNT   20
 
#define STUN_PACKET_ALLOCATION_SIZE   2048
 
#define STUN_SEND_INDICATION_OVERHEAD_SIZE   36
 
#define STUN_SEND_INDICATION_APPLICATION_DATA_OFFSET   36
 
#define STUN_SEND_INDICATION_APPLICATION_DATA_LEN_OFFSET   34
 
#define STUN_SEND_INDICATION_XOR_PEER_ADDRESS_OFFSET   28
 
#define STUN_SEND_INDICATION_XOR_PEER_ADDRESS_PORT_OFFSET   26
 
#define STUN_ERROR_CODE_PACKET_ERROR_CLASS_OFFSET   2
 
#define STUN_ERROR_CODE_PACKET_ERROR_CODE_OFFSET   3
 
#define STUN_ERROR_CODE_PACKET_ERROR_PHRASE_OFFSET   4
 
#define STUN_PACKET_TRANSACTION_ID_OFFSET   8
 
#define STUN_ATTRIBUTE_CHANGE_REQUEST_FLAG_CHANGE_IP   4
 
#define STUN_ATTRIBUTE_CHANGE_REQUEST_FLAG_CHANGE_PORT   2
 
#define GET_STUN_ERROR_CODE(pClass, pCode)   ((UINT16) ((*(PUINT8) (pClass)) * 100 + *(PUINT8) (pCode)))
 
#define PACKAGE_STUN_ATTR_HEADER(pBuf, type, dataLen)
 
#define STUN_ATTRIBUTE_TYPE   StunAttributeType_t
 
#define STUN_PACKET_IS_TYPE_ERROR(pPacketBuffer)
 

Typedefs

typedef struct StunHeaderPStunHeader
 
typedef struct StunAttributeHeaderPStunAttributeHeader
 
typedef struct StunAttributeAddressPStunAttributeAddress
 
typedef struct StunAttributeUsernamePStunAttributeUsername
 
typedef struct StunAttributeFingerprintPStunAttributeFingerprint
 
typedef struct StunAttributePriorityPStunAttributePriority
 
typedef struct StunAttributeFlagPStunAttributeFlag
 
typedef struct StunAttributeMessageIntegrityPStunAttributeMessageIntegrity
 
typedef struct StunAttributeLifetimePStunAttributeLifetime
 
typedef struct StunAttributeRequestedTransportPStunAttributeRequestedTransport
 
typedef struct StunAttributeRealmPStunAttributeRealm
 
typedef struct StunAttributeNoncePStunAttributeNonce
 
typedef struct StunAttributeErrorCodePStunAttributeErrorCode
 
typedef struct StunAttributeIceControlPStunAttributeIceControl
 
typedef struct StunAttributeDataPStunAttributeData
 
typedef struct StunAttributeChannelNumberPStunAttributeChannelNumber
 
typedef struct StunAttributeChangeRequestPStunAttributeChangeRequest
 
typedef struct StunPacketPStunPacket
 

Enumerations

enum  STUN_PACKET_TYPE {
  STUN_PACKET_TYPE_BINDING_REQUEST = (UINT16) 0x0001 , STUN_PACKET_TYPE_SHARED_SECRET_REQUEST = (UINT16) 0x0002 , STUN_PACKET_TYPE_ALLOCATE = (UINT16) 0x0003 , STUN_PACKET_TYPE_REFRESH = (UINT16) 0x0004 ,
  STUN_PACKET_TYPE_SEND = (UINT16) 0x0006 , STUN_PACKET_TYPE_DATA = (UINT16) 0x0007 , STUN_PACKET_TYPE_CREATE_PERMISSION = (UINT16) 0x0008 , STUN_PACKET_TYPE_CHANNEL_BIND_REQUEST = (UINT16) 0x0009 ,
  STUN_PACKET_TYPE_BINDING_INDICATION = (UINT16) 0x0011 , STUN_PACKET_TYPE_SEND_INDICATION = (UINT16) 0x0016 , STUN_PACKET_TYPE_DATA_INDICATION = (UINT16) 0x0017 , STUN_PACKET_TYPE_BINDING_RESPONSE_SUCCESS = (UINT16) 0x0101 ,
  STUN_PACKET_TYPE_SHARED_SECRET_RESPONSE = (UINT16) 0x0102 , STUN_PACKET_TYPE_ALLOCATE_SUCCESS_RESPONSE = (UINT16) 0x0103 , STUN_PACKET_TYPE_REFRESH_SUCCESS_RESPONSE = (UINT16) 0x0104 , STUN_PACKET_TYPE_CREATE_PERMISSION_SUCCESS_RESPONSE = (UINT16) 0x0108 ,
  STUN_PACKET_TYPE_CHANNEL_BIND_SUCCESS_RESPONSE = (UINT16) 0x0109 , STUN_PACKET_TYPE_BINDING_RESPONSE_ERROR = (UINT16) 0x0111 , STUN_PACKET_TYPE_SHARED_SECRET_ERROR_RESPONSE = (UINT16) 0x0112 , STUN_PACKET_TYPE_ALLOCATE_ERROR_RESPONSE = (UINT16) 0x0113 ,
  STUN_PACKET_TYPE_REFRESH_ERROR_RESPONSE = (UINT16) 0x0114 , STUN_PACKET_TYPE_CREATE_PERMISSION_ERROR_RESPONSE = (UINT16) 0x0118 , STUN_PACKET_TYPE_CHANNEL_BIND_ERROR_RESPONSE = (UINT16) 0x0119
}
 
enum  STUN_ERROR_CODE { STUN_ERROR_UNAUTHORIZED = (UINT16) 401 , STUN_ERROR_STALE_NONCE = (UINT16) 438 }
 

Functions

STATUS serializeStunPacket (PStunPacket, PBYTE, UINT32, BOOL, BOOL, PBYTE, PUINT32)
 
STATUS deserializeStunPacket (PBYTE, UINT32, PBYTE, UINT32, PStunPacket *)
 
STATUS freeStunPacket (PStunPacket *)
 
STATUS createStunPacket (STUN_PACKET_TYPE, PBYTE, PStunPacket *)
 
STATUS appendStunAddressAttribute (PStunPacket, StunAttributeType_t, PKvsIpAddress)
 
STATUS appendStunUsernameAttribute (PStunPacket, PCHAR)
 
STATUS appendStunFlagAttribute (PStunPacket, StunAttributeType_t)
 
STATUS appendStunPriorityAttribute (PStunPacket, UINT32)
 
STATUS appendStunLifetimeAttribute (PStunPacket, UINT32)
 
STATUS appendStunRequestedTransportAttribute (PStunPacket, UINT8)
 
STATUS appendStunRealmAttribute (PStunPacket, PCHAR)
 
STATUS appendStunNonceAttribute (PStunPacket, PBYTE, UINT16)
 
STATUS updateStunNonceAttribute (PStunPacket, PBYTE, UINT16)
 
STATUS appendStunErrorCodeAttribute (PStunPacket, PCHAR, UINT16)
 
STATUS appendStunIceControllAttribute (PStunPacket, StunAttributeType_t, UINT64)
 
STATUS appendStunDataAttribute (PStunPacket, PBYTE, UINT16)
 
STATUS appendStunChannelNumberAttribute (PStunPacket, UINT16)
 
STATUS appendStunChangeRequestAttribute (PStunPacket, UINT32)
 
STATUS getStunAttribute (PStunPacket, StunAttributeType_t, PStunAttributeHeader *)
 
STATUS xorIpAddress (PKvsIpAddress, PBYTE)
 
STATUS stunPackageIpAddr (PStunHeader, StunAttributeType_t, PKvsIpAddress, PBYTE, PUINT32)
 
UINT16 getPackagedStunAttributeSize (PStunAttributeHeader)
 
STATUS getFirstAvailableStunAttribute (PStunPacket, PStunAttributeHeader *)
 

Macro Definition Documentation

◆ GET_STUN_ERROR_CODE

#define GET_STUN_ERROR_CODE (   pClass,
  pCode 
)    ((UINT16) ((*(PUINT8) (pClass)) * 100 + *(PUINT8) (pCode)))

Taking a PBYTE pointing to stun error packet's error code attribute's error class location and another PBYTE pointing to the error code location, return stun error code as UINT16

◆ PACKAGE_STUN_ATTR_HEADER

#define PACKAGE_STUN_ATTR_HEADER (   pBuf,
  type,
  dataLen 
)
Value:
putInt16((PINT16) (pBuf), (UINT16) (type)); \
putInt16((PINT16) ((pBuf) + STUN_ATTRIBUTE_HEADER_TYPE_LEN), (UINT16) (dataLen));
#define STUN_ATTRIBUTE_HEADER_TYPE_LEN
Definition: Stun.h:34

Packages the attribute header into a specified buffer

◆ STUN_ATTRIBUTE_ADDRESS_FAMILY_LEN

#define STUN_ATTRIBUTE_ADDRESS_FAMILY_LEN   (UINT16) 2

◆ STUN_ATTRIBUTE_ADDRESS_HEADER_LEN

#define STUN_ATTRIBUTE_ADDRESS_HEADER_LEN   (UINT16)(STUN_ATTRIBUTE_ADDRESS_FAMILY_LEN + STUN_ATTRIBUTE_ADDRESS_PORT_LEN)

◆ STUN_ATTRIBUTE_ADDRESS_PORT_LEN

#define STUN_ATTRIBUTE_ADDRESS_PORT_LEN   (UINT16) 2

◆ STUN_ATTRIBUTE_CHANGE_REQUEST_FLAG_CHANGE_IP

#define STUN_ATTRIBUTE_CHANGE_REQUEST_FLAG_CHANGE_IP   4

◆ STUN_ATTRIBUTE_CHANGE_REQUEST_FLAG_CHANGE_PORT

#define STUN_ATTRIBUTE_CHANGE_REQUEST_FLAG_CHANGE_PORT   2

◆ STUN_ATTRIBUTE_CHANGE_REQUEST_FLAG_LEN

#define STUN_ATTRIBUTE_CHANGE_REQUEST_FLAG_LEN   (UINT16) 4

The flag is 32 bit long but only 2 bits are used

◆ STUN_ATTRIBUTE_CHANNEL_NUMBER_LEN

#define STUN_ATTRIBUTE_CHANNEL_NUMBER_LEN   (UINT16) 4

◆ STUN_ATTRIBUTE_FINGERPRINT_LEN

#define STUN_ATTRIBUTE_FINGERPRINT_LEN   (UINT16) 4

Fingerprint attribute value length = 4 bytes = 32 bits

◆ STUN_ATTRIBUTE_FLAG_LEN

#define STUN_ATTRIBUTE_FLAG_LEN   (UINT16) 0

Candidate attribute has no size

◆ STUN_ATTRIBUTE_HEADER_DATA_LEN

#define STUN_ATTRIBUTE_HEADER_DATA_LEN   (UINT16) 2

◆ STUN_ATTRIBUTE_HEADER_LEN

#define STUN_ATTRIBUTE_HEADER_LEN   (UINT16)(STUN_ATTRIBUTE_HEADER_TYPE_LEN + STUN_ATTRIBUTE_HEADER_DATA_LEN)

◆ STUN_ATTRIBUTE_HEADER_TYPE_LEN

#define STUN_ATTRIBUTE_HEADER_TYPE_LEN   (UINT16) 2

Stun attribute header structure

  • 2 UINT16 type len
  • 2 UINT16 attribute data len
  • attribute specific data

◆ STUN_ATTRIBUTE_ICE_CONTROL_LEN

#define STUN_ATTRIBUTE_ICE_CONTROL_LEN   (UINT16) 8

Ice-controll and Ice-controlling attribute value length = 8 bytes = 64 bits for a UINT64 tie breaker

◆ STUN_ATTRIBUTE_LIFETIME_LEN

#define STUN_ATTRIBUTE_LIFETIME_LEN   (UINT16) 4

Lifetime attribute value length = 4 bytes = 32 bits representing number of seconds until expiration

◆ STUN_ATTRIBUTE_MAX_COUNT

#define STUN_ATTRIBUTE_MAX_COUNT   20

Max number of attributes allowed

◆ STUN_ATTRIBUTE_PRIORITY_LEN

#define STUN_ATTRIBUTE_PRIORITY_LEN   (UINT16) 4

Priority attribute value length = 4 bytes = 32 bits

◆ STUN_ATTRIBUTE_REQUESTED_TRANSPORT_PROTOCOL_LEN

#define STUN_ATTRIBUTE_REQUESTED_TRANSPORT_PROTOCOL_LEN   (UINT16) 4

Requested transport protocol attribute value length = 4 bytes = 32 bits

◆ STUN_ATTRIBUTE_TYPE

#define STUN_ATTRIBUTE_TYPE   StunAttributeType_t

◆ STUN_ERROR_CODE_PACKET_ERROR_CLASS_OFFSET

#define STUN_ERROR_CODE_PACKET_ERROR_CLASS_OFFSET   2

◆ STUN_ERROR_CODE_PACKET_ERROR_CODE_OFFSET

#define STUN_ERROR_CODE_PACKET_ERROR_CODE_OFFSET   3

◆ STUN_ERROR_CODE_PACKET_ERROR_PHRASE_OFFSET

#define STUN_ERROR_CODE_PACKET_ERROR_PHRASE_OFFSET   4

◆ STUN_HEADER_DATA_LEN

#define STUN_HEADER_DATA_LEN   (UINT16) 2

◆ STUN_HEADER_LEN

#define STUN_HEADER_LEN   (UINT16) 20

Stun header structure

  • 2 UINT16 type len
  • 2 UINT16 packet data len
  • 4 UINT16 magic cookie
  • 12 UINT16 transaction id
  • data

◆ STUN_HEADER_TRANSACTION_ID_LEN

#define STUN_HEADER_TRANSACTION_ID_LEN   (UINT16) 12

◆ STUN_HEADER_TYPE_LEN

#define STUN_HEADER_TYPE_LEN   (UINT16) 2

◆ STUN_HMAC_VALUE_LEN

#define STUN_HMAC_VALUE_LEN   KVS_SHA1_DIGEST_LENGTH

STUN HMAC attribute value length

◆ STUN_PACKET_ALLOCATION_SIZE

#define STUN_PACKET_ALLOCATION_SIZE   2048

Default allocation size for a STUN packet

◆ STUN_PACKET_IS_TYPE_ERROR

#define STUN_PACKET_IS_TYPE_ERROR (   pPacketBuffer)
Value:
((getInt16(*(PINT16) pPacketBuffer) == STUN_PACKET_TYPE_BINDING_RESPONSE_ERROR) || \
(getInt16(*(PINT16) pPacketBuffer) == STUN_PACKET_TYPE_SHARED_SECRET_ERROR_RESPONSE) || \
(getInt16(*(PINT16) pPacketBuffer) == STUN_PACKET_TYPE_ALLOCATE_ERROR_RESPONSE) || \
(getInt16(*(PINT16) pPacketBuffer) == STUN_PACKET_TYPE_REFRESH_ERROR_RESPONSE) || \
(getInt16(*(PINT16) pPacketBuffer) == STUN_PACKET_TYPE_CREATE_PERMISSION_ERROR_RESPONSE) || \
(getInt16(*(PINT16) pPacketBuffer) == STUN_PACKET_TYPE_CHANNEL_BIND_ERROR_RESPONSE))
@ STUN_PACKET_TYPE_ALLOCATE_ERROR_RESPONSE
Definition: Stun.h:153
@ STUN_PACKET_TYPE_BINDING_RESPONSE_ERROR
Definition: Stun.h:151
@ STUN_PACKET_TYPE_CREATE_PERMISSION_ERROR_RESPONSE
Definition: Stun.h:155
@ STUN_PACKET_TYPE_SHARED_SECRET_ERROR_RESPONSE
Definition: Stun.h:152
@ STUN_PACKET_TYPE_CHANNEL_BIND_ERROR_RESPONSE
Definition: Stun.h:156
@ STUN_PACKET_TYPE_REFRESH_ERROR_RESPONSE
Definition: Stun.h:154

◆ STUN_PACKET_TRANSACTION_ID_OFFSET

#define STUN_PACKET_TRANSACTION_ID_OFFSET   8

◆ STUN_SEND_INDICATION_APPLICATION_DATA_LEN_OFFSET

#define STUN_SEND_INDICATION_APPLICATION_DATA_LEN_OFFSET   34

◆ STUN_SEND_INDICATION_APPLICATION_DATA_OFFSET

#define STUN_SEND_INDICATION_APPLICATION_DATA_OFFSET   36

◆ STUN_SEND_INDICATION_OVERHEAD_SIZE

#define STUN_SEND_INDICATION_OVERHEAD_SIZE   36

◆ STUN_SEND_INDICATION_XOR_PEER_ADDRESS_OFFSET

#define STUN_SEND_INDICATION_XOR_PEER_ADDRESS_OFFSET   28

◆ STUN_SEND_INDICATION_XOR_PEER_ADDRESS_PORT_OFFSET

#define STUN_SEND_INDICATION_XOR_PEER_ADDRESS_PORT_OFFSET   26

◆ STUN_TRANSACTION_ID_LEN

#define STUN_TRANSACTION_ID_LEN   (UINT16) 12

STUN packet transaction id = 96 bits

Typedef Documentation

◆ PStunAttributeAddress

◆ PStunAttributeChangeRequest

◆ PStunAttributeChannelNumber

◆ PStunAttributeData

◆ PStunAttributeErrorCode

◆ PStunAttributeFingerprint

◆ PStunAttributeFlag

◆ PStunAttributeHeader

◆ PStunAttributeIceControl

◆ PStunAttributeLifetime

◆ PStunAttributeMessageIntegrity

◆ PStunAttributeNonce

◆ PStunAttributePriority

◆ PStunAttributeRealm

◆ PStunAttributeRequestedTransport

◆ PStunAttributeUsername

◆ PStunHeader

typedef struct StunHeader * PStunHeader

◆ PStunPacket

typedef struct StunPacket * PStunPacket

Enumeration Type Documentation

◆ STUN_ERROR_CODE

STUN error codes

Enumerator
STUN_ERROR_UNAUTHORIZED 
STUN_ERROR_STALE_NONCE 

◆ STUN_PACKET_TYPE

STUN packet types

Enumerator
STUN_PACKET_TYPE_BINDING_REQUEST 
STUN_PACKET_TYPE_SHARED_SECRET_REQUEST 
STUN_PACKET_TYPE_ALLOCATE 
STUN_PACKET_TYPE_REFRESH 
STUN_PACKET_TYPE_SEND 
STUN_PACKET_TYPE_DATA 
STUN_PACKET_TYPE_CREATE_PERMISSION 
STUN_PACKET_TYPE_CHANNEL_BIND_REQUEST 
STUN_PACKET_TYPE_BINDING_INDICATION 
STUN_PACKET_TYPE_SEND_INDICATION 
STUN_PACKET_TYPE_DATA_INDICATION 
STUN_PACKET_TYPE_BINDING_RESPONSE_SUCCESS 
STUN_PACKET_TYPE_SHARED_SECRET_RESPONSE 
STUN_PACKET_TYPE_ALLOCATE_SUCCESS_RESPONSE 
STUN_PACKET_TYPE_REFRESH_SUCCESS_RESPONSE 
STUN_PACKET_TYPE_CREATE_PERMISSION_SUCCESS_RESPONSE 
STUN_PACKET_TYPE_CHANNEL_BIND_SUCCESS_RESPONSE 
STUN_PACKET_TYPE_BINDING_RESPONSE_ERROR 
STUN_PACKET_TYPE_SHARED_SECRET_ERROR_RESPONSE 
STUN_PACKET_TYPE_ALLOCATE_ERROR_RESPONSE 
STUN_PACKET_TYPE_REFRESH_ERROR_RESPONSE 
STUN_PACKET_TYPE_CREATE_PERMISSION_ERROR_RESPONSE 
STUN_PACKET_TYPE_CHANNEL_BIND_ERROR_RESPONSE 

Function Documentation

◆ appendStunAddressAttribute()

STATUS appendStunAddressAttribute ( PStunPacket  pStunPacket,
StunAttributeType_t  addressAttributeType,
PKvsIpAddress  pAddress 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendStunChangeRequestAttribute()

STATUS appendStunChangeRequestAttribute ( PStunPacket  pStunPacket,
UINT32  changeFlag 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendStunChannelNumberAttribute()

STATUS appendStunChannelNumberAttribute ( PStunPacket  pStunPacket,
UINT16  channelNumber 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendStunDataAttribute()

STATUS appendStunDataAttribute ( PStunPacket  pStunPacket,
PBYTE  data,
UINT16  dataLen 
)
Here is the call graph for this function:

◆ appendStunErrorCodeAttribute()

STATUS appendStunErrorCodeAttribute ( PStunPacket  pStunPacket,
PCHAR  errorPhrase,
UINT16  errorCode 
)
Here is the call graph for this function:

◆ appendStunFlagAttribute()

STATUS appendStunFlagAttribute ( PStunPacket  pStunPacket,
StunAttributeType_t  attrType 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendStunIceControllAttribute()

STATUS appendStunIceControllAttribute ( PStunPacket  pStunPacket,
StunAttributeType_t  attributeType,
UINT64  tieBreaker 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendStunLifetimeAttribute()

STATUS appendStunLifetimeAttribute ( PStunPacket  pStunPacket,
UINT32  lifetime 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendStunNonceAttribute()

STATUS appendStunNonceAttribute ( PStunPacket  pStunPacket,
PBYTE  nonce,
UINT16  nonceLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendStunPriorityAttribute()

STATUS appendStunPriorityAttribute ( PStunPacket  pStunPacket,
UINT32  priority 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendStunRealmAttribute()

STATUS appendStunRealmAttribute ( PStunPacket  pStunPacket,
PCHAR  realm 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendStunRequestedTransportAttribute()

STATUS appendStunRequestedTransportAttribute ( PStunPacket  pStunPacket,
UINT8  protocol 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendStunUsernameAttribute()

STATUS appendStunUsernameAttribute ( PStunPacket  pStunPacket,
PCHAR  userName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createStunPacket()

STATUS createStunPacket ( STUN_PACKET_TYPE  stunPacketType,
PBYTE  transactionId,
PStunPacket ppStunPacket 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deserializeStunPacket()

STATUS deserializeStunPacket ( PBYTE  pStunBuffer,
UINT32  bufferSize,
PBYTE  password,
UINT32  passwordLen,
PStunPacket ppStunPacket 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeStunPacket()

STATUS freeStunPacket ( PStunPacket ppStunPacket)
Here is the caller graph for this function:

◆ getFirstAvailableStunAttribute()

STATUS getFirstAvailableStunAttribute ( PStunPacket  pStunPacket,
PStunAttributeHeader ppStunAttribute 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPackagedStunAttributeSize()

UINT16 getPackagedStunAttributeSize ( PStunAttributeHeader  pStunAttributeHeader)
Here is the caller graph for this function:

◆ getStunAttribute()

STATUS getStunAttribute ( PStunPacket  pStunPacket,
StunAttributeType_t  attributeType,
PStunAttributeHeader ppStunAttribute 
)

check if PStunPacket has an attribute of type STUN_ATTRIBUTE_TYPE. If so, return the first occurrence through PStunAttributeHeader*

Returns
STATUS of operations
Here is the caller graph for this function:

◆ serializeStunPacket()

STATUS serializeStunPacket ( PStunPacket  pStunPacket,
PBYTE  password,
UINT32  passwordLen,
BOOL  generateMessageIntegrity,
BOOL  generateFingerprint,
PBYTE  pBuffer,
PUINT32  pSize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stunPackageIpAddr()

STATUS stunPackageIpAddr ( PStunHeader  pStunHeader,
StunAttributeType_t  type,
PKvsIpAddress  pAddress,
PBYTE  pBuffer,
PUINT32  pDataLen 
)

Mapped address attribute structure https://tools.ietf.org/html/rfc5389#section-15.1

  • 2 byte attribute type
  • 2 byte attribute data len
  • 2 byte address family
  • 2 byte port
  • 4 byte or 16 byte ip address
Here is the call graph for this function:

◆ updateStunNonceAttribute()

STATUS updateStunNonceAttribute ( PStunPacket  pStunPacket,
PBYTE  nonce,
UINT16  nonceLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xorIpAddress()

STATUS xorIpAddress ( PKvsIpAddress  pAddress,
PBYTE  pTransactionId 
)

xor an ip address in place

Here is the caller graph for this function: