Stun Server  Compliant with the latest RFCs including 5389, 5769, and 5780
discover the local host's own external IP address
CStunMessageBuilder Class Reference

#include <stunbuilder.h>

Collaboration diagram for CStunMessageBuilder:

Public Member Functions

 CStunMessageBuilder ()
 
void SetLegacyMode (bool fLegacyMode)
 
HRESULT AddHeader (StunMessageType msgType, StunMessageClass msgClass)
 
HRESULT AddBindingRequestHeader ()
 
HRESULT AddBindingResponseHeader (bool fSuccess)
 
HRESULT AddTransactionId (const StunTransactionId &transid)
 
HRESULT AddRandomTransactionId (StunTransactionId *pTransId)
 
HRESULT AddAttributeHeader (uint16_t attribType, uint16_t size)
 
HRESULT AddAttribute (uint16_t attribType, const void *data, uint16_t size)
 
HRESULT AddStringAttribute (uint16_t attribType, const char *pstr)
 
HRESULT AddXorMappedAddress (const CSocketAddress &addr)
 
HRESULT AddMappedAddress (const CSocketAddress &addr)
 
HRESULT AddResponseOriginAddress (const CSocketAddress &other)
 
HRESULT AddOtherAddress (const CSocketAddress &other)
 
HRESULT AddResponsePort (uint16_t port)
 
HRESULT AddPaddingAttribute (uint16_t paddingSize)
 
HRESULT AddChangeRequest (const StunChangeRequestAttribute &changeAttrib)
 
HRESULT AddErrorCode (uint16_t errorNumber, const char *pszReason)
 
HRESULT AddUnknownAttributes (const uint16_t *arrAttributeIds, size_t count)
 
HRESULT AddFingerprintAttribute ()
 
HRESULT AddUserName (const char *pszUserName)
 
HRESULT AddRealm (const char *pszRealm)
 
HRESULT AddNonce (const char *pszNonce)
 
HRESULT AddMessageIntegrityShortTerm (const char *pszPassword)
 
HRESULT AddMessageIntegrityLongTerm (const char *pszUserName, const char *pszRealm, const char *pszPassword)
 
HRESULT FixLengthField ()
 
HRESULT GetResult (CRefCountedBuffer *pspBuffer)
 
CDataStreamGetStream ()
 

Private Member Functions

HRESULT AddMappedAddressImpl (uint16_t attribute, const CSocketAddress &addr)
 
HRESULT AddMessageIntegrityImpl (uint8_t *key, size_t keysize)
 

Private Attributes

CDataStream _stream
 
StunTransactionId _transactionid
 
bool _fLegacyMode
 

Detailed Description

Definition at line 29 of file stunbuilder.h.

Constructor & Destructor Documentation

CStunMessageBuilder::CStunMessageBuilder ( )

Definition at line 42 of file stunbuilder.cpp.

Member Function Documentation

HRESULT CStunMessageBuilder::AddAttribute ( uint16_t  attribType,
const void *  data,
uint16_t  size 
)

Definition at line 165 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddAttributeHeader ( uint16_t  attribType,
uint16_t  size 
)

Definition at line 154 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddBindingRequestHeader ( )

Definition at line 76 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddBindingResponseHeader ( bool  fSuccess)

Definition at line 81 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddChangeRequest ( const StunChangeRequestAttribute changeAttrib)

Definition at line 400 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddErrorCode ( uint16_t  errorNumber,
const char *  pszReason 
)

Definition at line 219 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddFingerprintAttribute ( )

Definition at line 420 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddHeader ( StunMessageType  msgType,
StunMessageClass  msgClass 
)

Definition at line 55 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddMappedAddress ( const CSocketAddress addr)

Definition at line 319 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddMappedAddressImpl ( uint16_t  attribute,
const CSocketAddress addr 
)
private

Definition at line 373 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddMessageIntegrityImpl ( uint8_t *  key,
size_t  keysize 
)
private

Definition at line 476 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddMessageIntegrityLongTerm ( const char *  pszUserName,
const char *  pszRealm,
const char *  pszPassword 
)

Definition at line 527 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddMessageIntegrityShortTerm ( const char *  pszPassword)

Definition at line 522 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddNonce ( const char *  pszNonce)

Definition at line 465 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddOtherAddress ( const CSocketAddress other)

Definition at line 331 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddPaddingAttribute ( uint16_t  paddingSize)

Definition at line 345 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddRandomTransactionId ( StunTransactionId pTransId)

Definition at line 93 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddRealm ( const char *  pszRealm)

Definition at line 470 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddResponseOriginAddress ( const CSocketAddress other)

Definition at line 324 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddResponsePort ( uint16_t  port)

Definition at line 337 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddStringAttribute ( uint16_t  attribType,
const char *  pstr 
)

Definition at line 205 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddTransactionId ( const StunTransactionId transid)

Definition at line 86 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddUnknownAttributes ( const uint16_t *  arrAttributeIds,
size_t  count 
)

Definition at line 272 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddUserName ( const char *  pszUserName)

Definition at line 460 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::AddXorMappedAddress ( const CSocketAddress addr)

Definition at line 309 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::FixLengthField ( )

Definition at line 588 of file stunbuilder.cpp.

HRESULT CStunMessageBuilder::GetResult ( CRefCountedBuffer pspBuffer)

Definition at line 613 of file stunbuilder.cpp.

CDataStream & CStunMessageBuilder::GetStream ( )

Definition at line 625 of file stunbuilder.cpp.

void CStunMessageBuilder::SetLegacyMode ( bool  fLegacyMode)

Definition at line 49 of file stunbuilder.cpp.

Member Data Documentation

bool CStunMessageBuilder::_fLegacyMode
private

Definition at line 36 of file stunbuilder.h.

CDataStream CStunMessageBuilder::_stream
private

Definition at line 34 of file stunbuilder.h.

StunTransactionId CStunMessageBuilder::_transactionid
private

Definition at line 35 of file stunbuilder.h.


The documentation for this class was generated from the following files: