|
| | StunMessage (StunMessage *pRequest=NULL, bool bLegacyMode=true) |
| |
| virtual | ~StunMessage () |
| |
| virtual void | reset () |
| |
| virtual bool | parse (const char *pBuf, size_t nBufLength) |
| |
| virtual bool | encode (char *pBuf, size_t nBufLength, size_t &nActualLength) |
| |
| virtual bool | encodeBody (char *pBuf, size_t nBufLength, size_t &nBytesUsed) |
| |
| void | setMagicId (STUN_MAGIC_ID &rMagicId) |
| |
| void | setTransactionId (STUN_TRANSACTION_ID &rTransactionId) |
| |
| void | allocTransactionId () |
| |
| void | setType (uint16_t type) |
| |
| void | setMappedAddress (const char *szIp, const uint16_t port) |
| |
| void | setResponseAddress (const char *szIp, const uint16_t port) |
| |
| void | setChangePort (const bool bChange) |
| |
| void | setChangeIp (const bool bChange) |
| |
| void | setSourceAddress (const char *szIp, const uint16_t port) |
| |
| void | setChangedAddress (const char *szIp, const uint16_t port) |
| |
| void | setUsername (const char *szUsername) |
| |
| void | setPassword (const char *szPassword) |
| |
| void | setRealm (const char *szRealm) |
| |
| void | setNonce (const char *szNonce) |
| |
| void | setError (const uint16_t code, const char *szReason) |
| |
| void | addUnknownAttribute (uint16_t attributeId) |
| |
| void | setReflectedFrom (const char *szIp, const uint16_t port) |
| |
| void | setServer (const char *szServer) |
| |
| void | setRequestXorOnly () |
| |
| void | setSendXorOnly () |
| |
| void | setIncludeMessageIntegrity (bool bInclude) |
| |
| void | setIncludeFingerPrint (bool bInclude) |
| |
| void | setAltServer (const char *szIp, uint16_t port) |
| |
| void | getMagicId (STUN_MAGIC_ID *pMagicId) |
| |
| void | getTransactionId (STUN_TRANSACTION_ID *pTransactionId) |
| |
| uint16_t | getType () |
| |
| bool | getMappedAddress (char *szIp, uint16_t &rPort) |
| |
| bool | getResponseAddress (char *szIp, uint16_t &rPort) |
| |
| bool | getChangePort () |
| |
| bool | getChangeIp () |
| |
| bool | getSourceAddress (char *szIp, uint16_t &rPort) |
| |
| bool | getChangedAddress (char *szIp, uint16_t &rPort) |
| |
| bool | getUsername (char *szUsername) |
| |
| bool | getPassword (char *szPassword) |
| |
| bool | getRealm (char *szRealm) |
| |
| bool | getNonce (char *szNonce) |
| |
| bool | getMessageIntegrity (char *cMessageIntegrity) |
| |
| bool | getError (uint16_t &rCode, char *szReason) |
| |
| bool | getUnknownAttributes (uint16_t *pList, size_t nMaxItems, size_t &nActualItems) |
| |
| bool | getReflectedFrom (char *szIp, uint16_t &rPort) |
| |
| bool | getServer (char *szServer) |
| |
| bool | getUnknownParsedAttributes (uint16_t *pList, size_t nMaxItems, size_t &nActualItems) |
| |
| bool | getRequestXorOnly () |
| |
| bool | getAltServer (char *szIp, uint16_t &rPort) |
| |
| bool | getFingerPrint (bool &bValid) |
| |
| virtual bool | validateMessageType (uint16_t type) |
| |
| virtual bool | isRequestOrNonErrorResponse () |
| |
| virtual bool | isMessageIntegrityValid (const char *cPassword, size_t nPassword) |
| |
| virtual bool | isFingerPrintValid () |
| |
|
| bool | encodeByte (char c, char *&pBuf, size_t &nBytesLeft) |
| |
| bool | encodeShort (uint16_t value, char *&pBuf, size_t &nBytesLeft) |
| |
| bool | encodeLong (uint32_t value, char *&pBuf, size_t &nBytesLeft) |
| |
| bool | encodeRaw (const char *cRaw, size_t length, char *&pBuf, size_t &nBytesLeft) |
| |
| bool | encodeHeader (STUN_MESSAGE_HEADER *pHeader, char *&pBuf, size_t &nBytesLeft) |
| |
| bool | encodeAttributeHeader (int16_t type, int16_t length, char *&pBuf, size_t &nBytesLeft) |
| |
| bool | encodeAttributeAddress (uint16_t type, STUN_ATTRIBUTE_ADDRESS *pAddress, char *&pBuf, size_t &nBytesLeft) |
| |
| bool | encodeXorAttributeAddress (uint16_t type, STUN_ATTRIBUTE_ADDRESS *pAddress, char *&pBuf, size_t &nBytesLeft) |
| |
| bool | encodeString (uint16_t type, const char *szString, char *&pBuf, size_t &nBytesLeft) |
| |
| bool | encodeAttributeError (STUN_ATTRIBUTE_ERROR *pError, char *&pBuf, size_t &nBytesLeft) |
| |
| bool | encodeAttributesUnknown (STUN_ATTRIBUTE_UNKNOWN *pAttributes, char *&pBuf, size_t &nBytesLeft) |
| |
| virtual bool | parseAttribute (STUN_ATTRIBUTE_HEADER *pHeader, char *pBuf) |
| |
| bool | parseAddressAttribute (char *pBuf, size_t nLength, STUN_ATTRIBUTE_ADDRESS *pAddress) |
| |
| bool | parseXorAddressAttribute (char *pBuf, size_t nLength, STUN_ATTRIBUTE_ADDRESS *pAddress) |
| |
| bool | parseShortAttribute (char *pBuf, size_t nLength, uint16_t *pShort) |
| |
| bool | parseLongAttribute (char *pBuf, size_t nLength, uint32_t *pLong) |
| |
| bool | parseStringAttribute (char *pBuf, size_t nLength, char *pString) |
| |
| bool | parseRawAttribute (char *pBuf, size_t nLength, char *pDest, size_t nDest) |
| |
| bool | parseErrorAttribute (char *pBuf, size_t nLength, STUN_ATTRIBUTE_ERROR *pError) |
| |
| bool | parseUnknownAttribute (char *pBuf, size_t nLength, STUN_ATTRIBUTE_UNKNOWN *pAttributes) |
| |
A StunMessage includes all of the parse and encoding for a STUN message as defined by draft-ietf-behave-rfc3489bis-04.txt:
All data is stored internally in host byte order
Error
Error
Attribute Request Response Response Indication
MAPPED-ADDRESS - C - - USERNAME O - - O PASSWORD - C - - MESSAGE-INTEGRITY O O O O ERROR-CODE - - M - ALTERNATE-SERVER - - C - REALM C - C - NONCE C - C - UNKNOWN-ATTRIBUTES - - C - XOR-MAPPED-ADDRESS - C - - SERVER - O O O REFRESH-INTERVAL - O - - FINGERPRINT M M M M
Shared Shared Shared
Secret Secret Secret
Attribute Request Response Error Response
USERNAME O M - PASSWORD - M - MESSAGE-INTEGRITY O O O ERROR-CODE - - M ALTERNATE-SERVER - - C UNKNOWN-ATTRIBUTES - - C SERVER - O O REALM C - C NONCE C - C