34 printf(
"Testing detection for DirectMapping\n");
37 printf(
"Testing detection for EndpointIndependent mapping\n");
40 printf(
"Testing detection for AddressDependentMapping\n");
43 printf(
"Testing detection for AddressAndPortDependentMapping\n");
46 printf(
"Testing detection for EndpointIndependentFiltering\n");
49 printf(
"Testing detection for AddressDependentFiltering\n");
52 printf(
"Testing detection for AddressAndPortDependentFiltering\n");
67 state = reader.
AddBytes(spMsg->GetData(), spMsg->GetSize());
287 bool fDropMessage =
false;
291 hrRet =
_spClientLogic->GetNextMessage(spMsgOut, &addrDest, time);
316 reader.
AddBytes(spMsgOut->GetData(), spMsgOut->GetSize());
330 spMsgResponse->SetSize(0);
377 if (fDropMessage ==
false)
const uint32_t MAX_STUN_MESSAGE_SIZE
CSocketAddress _addrMappedAP
bool IsValidSocketRole(SocketRole sr)
CSocketAddress _addrMappedPA
CSocketAddress _addrServerAA
uint16_t GetMessageType()
HRESULT Initialize(StunClientLogicConfig &config)
#define E_STUNCLIENT_STILL_WAITING
bool IsSameIP_and_Port(const CSocketAddress &other) const
#define E_STUNCLIENT_RESULTS_READY
HRESULT TestBehaviorAndFiltering(bool fBehaviorTest, NatBehavior behavior, bool fFilteringTest, NatFiltering filtering)
HRESULT AddXorMappedAddress(const CSocketAddress &addr)
void GetTransactionId(StunTransactionId *pTransId)
HRESULT GetNextMessage(CRefCountedBuffer &spMsg, CSocketAddress *pAddrDest, uint32_t timeCurrentMilliseconds)
CSocketAddress _addrServerAP
ReaderParseState AddBytes(const uint8_t *pData, uint32_t size)
CSocketAddress addrRemote
What local IP address the message was received on (useful if the socket binded to INADDR_ANY) ...
CSocketAddress addrLocal
which socket id did the message arrive on
HRESULT AddTransactionId(const StunTransactionId &transid)
SocketRole GetSocketRoleForDestinationAddress(const CSocketAddress &addrDest)
CSocketAddress addrMapped
HRESULT AddBindingResponseHeader(bool fSuccess)
ReaderParseState GetState()
bool _fAllowChangeRequestAA
boost::shared_ptr< CStunClientLogic > _spClientLogic
CSocketAddress _addrServerPP
bool IsTransactionIdValid(StunTransactionId &transid)
CStunMessageReader * pReader
the address of the node that sent us the message
CSocketAddress _addrMappedPP
CSocketAddress _addrLocal
HRESULT ProcessResponse(CRefCountedBuffer &spMsg, CSocketAddress &addrRemote, CSocketAddress &addrLocal)
CSocketAddress _addrServerPA
HRESULT GetResults(StunClientResults *pResults)
static HRESULT ProcessRequest(const StunMessageIn &msgIn, StunMessageOut &msgOut, TransportAddressSet *pAddressSet, IStunAuth *pAuth)
bool _fAllowChangeRequestPA
HRESULT GenerateBindingResponseMessage(const CSocketAddress &addrMapped, const StunTransactionId &transid, CRefCountedBuffer &spMsg)
HRESULT GetMappedAddressForDestinationAddress(const CSocketAddress &addrDest, CSocketAddress *pAddrMapped)
CSocketAddress _addrMappedAA
HRESULT CommonInit(NatBehavior behavior, NatFiltering filtering)
CRefCountedBuffer spBufferOut
boost::shared_ptr< CBuffer > CRefCountedBuffer
void Attach(CRefCountedBuffer &buffer, bool fForWriting)
#define ChkIfA(expr, hrerror)
CDataStream & GetStream()
CSocketAddress addrServer
bool fConnectionOriented
reader containing a valid stun message
HRESULT ValidateBindingRequest(CRefCountedBuffer &spMsg, StunTransactionId *pTransId)