31 _fRequestHasResponsePort(false),
86 uint16_t responseport = 0;
101 if (responseport != 0)
195 ASSERT(spBuffer->GetSize() != 0);
206 bool fRequestHasPaddingAttribute =
false;
209 bool fSendOtherAddress =
false;
210 bool fSendOriginAddress =
false;
215 uint16_t paddingSize = 0;
235 fRequestHasPaddingAttribute =
true;
290 if (fSendOtherAddress)
297 if (fSendOtherAddress)
333 if (fSendOriginAddress)
338 if (fSendOtherAddress)
381 memset(&authattributes,
'\0',
sizeof(authattributes));
382 memset(&authresponse,
'\0',
sizeof(authresponse));
const uint32_t MAX_STUN_MESSAGE_SIZE
TransportAddressSet * _pAddrSet
AuthResponseType responseType
const uint16_t STUN_ATTRIBUTE_USERNAME
bool IsValidSocketRole(SocketRole sr)
char szUser[MAX_STUN_AUTH_STRING_SIZE+1]
HRESULT AddUnknownAttributes(const uint16_t *arrAttributeIds, size_t count)
HRESULT GetChangeRequest(StunChangeRequestAttribute *pChangeRequest)
HRESULT AddStringAttribute(uint16_t attribType, const char *pstr)
uint16_t GetMessageType()
const uint16_t STUN_ERROR_STALENONCE
const uint16_t STUN_ERROR_UNAUTHORIZED
StunMessageIntegrity _integrity
HRESULT ValidateMessageIntegrityLong(const char *pszUser, const char *pszRealm, const char *pszPassword)
char szNonce[MAX_STUN_AUTH_STRING_SIZE+1]
bool fMessageIntegrityPresent
HRESULT AddXorMappedAddress(const CSocketAddress &addr)
void GetTransactionId(StunTransactionId *pTransId)
const uint16_t STUN_ATTRIBUTE_REALM
AuthCredentialMechanism authCredMech
bool _fRequestHasResponsePort
const uint16_t STUN_ATTRIBUTE_NONCE
char szRealm[MAX_STUN_AUTH_STRING_SIZE+1]
#define ChkIf(expr, hrerror)
const uint16_t STUN_ERROR_BADREQUEST
bool IsMessageLegacyFormat()
HRESULT AddMappedAddress(const CSocketAddress &addr)
StunTransactionId _transid
char szRealm[MAX_STUN_AUTH_STRING_SIZE+1]
CSocketAddress addrRemote
What local IP address the message was received on (useful if the socket binded to INADDR_ANY) ...
void SetLegacyMode(bool fLegacyMode)
char szUser[MAX_STUN_AUTH_STRING_SIZE+1]
CSocketAddress addrLocal
which socket id did the message arrive on
char szPassword[MAX_STUN_AUTH_STRING_SIZE+1]
HRESULT AddHeader(StunMessageType msgType, StunMessageClass msgClass)
HRESULT AddTransactionId(const StunTransactionId &transid)
ReaderParseState GetState()
HRESULT ProcessRequestImpl()
HRESULT AddResponseOriginAddress(const CSocketAddress &other)
HRESULT AddMessageIntegrityLongTerm(const char *pszUserName, const char *pszRealm, const char *pszPassword)
void BuildErrorResponse()
HRESULT ValidateMessageIntegrityShort(const char *pszPassword)
StunMessageClass msgclass
char szNonce[MAX_STUN_AUTH_STRING_SIZE+1]
#define COMPILE_TIME_ASSERT(x)
SocketRole SocketRoleSwapPort(SocketRole sr)
HRESULT GetResponsePort(uint16_t *pPort)
HRESULT GetPaddingAttributeSize(uint16_t *pSizePadding)
HRESULT ProcessBindingRequest()
const uint16_t STUN_ERROR_UNKNOWNATTRIB
HRESULT GetResult(CRefCountedBuffer *pspBuffer)
HRESULT AddErrorCode(uint16_t errorNumber, const char *pszReason)
HRESULT AddMessageIntegrityShortTerm(const char *pszPassword)
char szPassword[MAX_STUN_AUTH_STRING_SIZE+1]
char szNonce[MAX_STUN_AUTH_STRING_SIZE+1]
StunMessageOut * _pMsgOut
CStunMessageReader * pReader
the address of the node that sent us the message
char szRealm[MAX_STUN_AUTH_STRING_SIZE+1]
StunMessageClass GetMessageClass()
static HRESULT ProcessRequest(const StunMessageIn &msgIn, StunMessageOut &msgOut, TransportAddressSet *pAddressSet, IStunAuth *pAuth)
SocketRole SocketRoleSwapIP(SocketRole sr)
bool HasMessageIntegrityAttribute()
bool HasAddress(SocketRole role)
bool IsIPAddressZeroOrInvalid(SocketRole role)
const uint16_t STUN_ATTRIBUTE_LEGACY_PASSWORD
CRefCountedBuffer spBufferOut
char szRealm[MAX_STUN_AUTH_STRING_SIZE+1]
boost::shared_ptr< CBuffer > CRefCountedBuffer
HRESULT GetStringAttributeByType(uint16_t attributeType, char *pszValue, size_t size)
const StunMessageIn * _pMsgIn
void Attach(CRefCountedBuffer &buffer, bool fForWriting)
bool IsIPAddressZero() const
virtual HRESULT DoAuthCheck(AuthAttributes *pAuthAttributes, AuthResponse *pResponse)=0
#define ChkIfA(expr, hrerror)
CDataStream & GetStream()
bool fConnectionOriented
reader containing a valid stun message
char szLegacyPassword[MAX_STUN_AUTH_STRING_SIZE+1]
HRESULT AddOtherAddress(const CSocketAddress &other)