#include "../Include_i.h"
Macros | |
| #define | LOG_CLASS "Stun" |
Functions | |
| STATUS | stunPackageIpAddr (PStunHeader pStunHeader, STUN_ATTRIBUTE_TYPE type, PKvsIpAddress pAddress, PBYTE pBuffer, PUINT32 pDataLen) |
| STATUS | serializeStunPacket (PStunPacket pStunPacket, PBYTE password, UINT32 passwordLen, BOOL generateMessageIntegrity, BOOL generateFingerprint, PBYTE pBuffer, PUINT32 pSize) |
| STATUS | deserializeStunPacket (PBYTE pStunBuffer, UINT32 bufferSize, PBYTE password, UINT32 passwordLen, PStunPacket *ppStunPacket) |
| STATUS | freeStunPacket (PStunPacket *ppStunPacket) |
| STATUS | createStunPacket (STUN_PACKET_TYPE stunPacketType, PBYTE transactionId, PStunPacket *ppStunPacket) |
| STATUS | appendStunAddressAttribute (PStunPacket pStunPacket, STUN_ATTRIBUTE_TYPE addressAttributeType, PKvsIpAddress pAddress) |
| STATUS | appendStunUsernameAttribute (PStunPacket pStunPacket, PCHAR userName) |
| STATUS | getStunAttribute (PStunPacket pStunPacket, STUN_ATTRIBUTE_TYPE attributeType, PStunAttributeHeader *ppStunAttribute) |
| STATUS | xorIpAddress (PKvsIpAddress pAddress, PBYTE pTransactionId) |
| STATUS | appendStunPriorityAttribute (PStunPacket pStunPacket, UINT32 priority) |
| STATUS | appendStunFlagAttribute (PStunPacket pStunPacket, STUN_ATTRIBUTE_TYPE attrType) |
| STATUS | appendStunLifetimeAttribute (PStunPacket pStunPacket, UINT32 lifetime) |
| STATUS | appendStunChangeRequestAttribute (PStunPacket pStunPacket, UINT32 changeFlag) |
| STATUS | appendStunRequestedTransportAttribute (PStunPacket pStunPacket, UINT8 protocol) |
| STATUS | appendStunRealmAttribute (PStunPacket pStunPacket, PCHAR realm) |
| STATUS | appendStunAllocationAddressFamily (PStunPacket pStunPacket, KVS_IP_FAMILY_TYPE ipFamily) |
| STATUS | appendStunNonceAttribute (PStunPacket pStunPacket, PBYTE nonce, UINT16 nonceLen) |
| STATUS | updateStunNonceAttribute (PStunPacket pStunPacket, PBYTE nonce, UINT16 nonceLen) |
| STATUS | appendStunErrorCodeAttribute (PStunPacket pStunPacket, PCHAR errorPhrase, UINT16 errorCode) |
| STATUS | appendStunIceControllAttribute (PStunPacket pStunPacket, STUN_ATTRIBUTE_TYPE attributeType, UINT64 tieBreaker) |
| STATUS | appendStunDataAttribute (PStunPacket pStunPacket, PBYTE data, UINT16 dataLen) |
| STATUS | appendStunChannelNumberAttribute (PStunPacket pStunPacket, UINT16 channelNumber) |
| UINT16 | getPackagedStunAttributeSize (PStunAttributeHeader pStunAttributeHeader) |
| STATUS | getFirstAvailableStunAttribute (PStunPacket pStunPacket, PStunAttributeHeader *ppStunAttribute) |
| #define LOG_CLASS "Stun" |
| STATUS appendStunAddressAttribute | ( | PStunPacket | pStunPacket, |
| STUN_ATTRIBUTE_TYPE | addressAttributeType, | ||
| PKvsIpAddress | pAddress ) |


| STATUS appendStunAllocationAddressFamily | ( | PStunPacket | pStunPacket, |
| KVS_IP_FAMILY_TYPE | ipFamily ) |


| STATUS appendStunChangeRequestAttribute | ( | PStunPacket | pStunPacket, |
| UINT32 | changeFlag ) |


| STATUS appendStunChannelNumberAttribute | ( | PStunPacket | pStunPacket, |
| UINT16 | channelNumber ) |


| STATUS appendStunDataAttribute | ( | PStunPacket | pStunPacket, |
| PBYTE | data, | ||
| UINT16 | dataLen ) |

| STATUS appendStunErrorCodeAttribute | ( | PStunPacket | pStunPacket, |
| PCHAR | errorPhrase, | ||
| UINT16 | errorCode ) |

| STATUS appendStunFlagAttribute | ( | PStunPacket | pStunPacket, |
| STUN_ATTRIBUTE_TYPE | attrType ) |


| STATUS appendStunIceControllAttribute | ( | PStunPacket | pStunPacket, |
| STUN_ATTRIBUTE_TYPE | attributeType, | ||
| UINT64 | tieBreaker ) |


| STATUS appendStunLifetimeAttribute | ( | PStunPacket | pStunPacket, |
| UINT32 | lifetime ) |


| STATUS appendStunNonceAttribute | ( | PStunPacket | pStunPacket, |
| PBYTE | nonce, | ||
| UINT16 | nonceLen ) |


| STATUS appendStunPriorityAttribute | ( | PStunPacket | pStunPacket, |
| UINT32 | priority ) |


| STATUS appendStunRealmAttribute | ( | PStunPacket | pStunPacket, |
| PCHAR | realm ) |


| STATUS appendStunRequestedTransportAttribute | ( | PStunPacket | pStunPacket, |
| UINT8 | protocol ) |


| STATUS appendStunUsernameAttribute | ( | PStunPacket | pStunPacket, |
| PCHAR | userName ) |


| STATUS createStunPacket | ( | STUN_PACKET_TYPE | stunPacketType, |
| PBYTE | transactionId, | ||
| PStunPacket * | ppStunPacket ) |


| STATUS deserializeStunPacket | ( | PBYTE | pStunBuffer, |
| UINT32 | bufferSize, | ||
| PBYTE | password, | ||
| UINT32 | passwordLen, | ||
| PStunPacket * | ppStunPacket ) |


| STATUS freeStunPacket | ( | PStunPacket * | ppStunPacket | ) |

| STATUS getFirstAvailableStunAttribute | ( | PStunPacket | pStunPacket, |
| PStunAttributeHeader * | ppStunAttribute ) |


| UINT16 getPackagedStunAttributeSize | ( | PStunAttributeHeader | pStunAttributeHeader | ) |

| STATUS getStunAttribute | ( | PStunPacket | pStunPacket, |
| STUN_ATTRIBUTE_TYPE | attributeType, | ||
| PStunAttributeHeader * | ppStunAttribute ) |
check if PStunPacket has an attribute of type STUN_ATTRIBUTE_TYPE. If so, return the first occurrence through PStunAttributeHeader*

| STATUS serializeStunPacket | ( | PStunPacket | pStunPacket, |
| PBYTE | password, | ||
| UINT32 | passwordLen, | ||
| BOOL | generateMessageIntegrity, | ||
| BOOL | generateFingerprint, | ||
| PBYTE | pBuffer, | ||
| PUINT32 | pSize ) |


| STATUS stunPackageIpAddr | ( | PStunHeader | pStunHeader, |
| STUN_ATTRIBUTE_TYPE | type, | ||
| PKvsIpAddress | pAddress, | ||
| PBYTE | pBuffer, | ||
| PUINT32 | pDataLen ) |
Mapped address attribute structure https://tools.ietf.org/html/rfc5389#section-15.1


| STATUS updateStunNonceAttribute | ( | PStunPacket | pStunPacket, |
| PBYTE | nonce, | ||
| UINT16 | nonceLen ) |


| STATUS xorIpAddress | ( | PKvsIpAddress | pAddress, |
| PBYTE | pTransactionId ) |
xor an IP address in place
