Stun Server  Compliant with the latest RFCs including 5389, 5769, and 5780
discover the local host's own external IP address
testclientlogic.h
Go to the documentation of this file.
1 /*
2  Copyright 2011 John Selbie
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 
18 #ifndef TESTCLIENTLOGIC_H
19 #define TESTCLIENTLOGIC_H
20 
21 #include "unittest.h"
22 
23 
24 #include "testmessagehandler.h"
25 
26 
28 {
29 private:
30 
35 
37 
38  CSocketAddress _addrMappedPP; // what PP returns
39  CSocketAddress _addrMappedPA; // what PA returns
40  CSocketAddress _addrMappedAP; // what AP returns
41  CSocketAddress _addrMappedAA; // what AA returns
42 
45 
47 
48 
49  boost::shared_ptr<CStunClientLogic> _spClientLogic;
50 
51 
52 
55 
56  HRESULT Test1();
57 
58 
59  HRESULT TestBehaviorAndFiltering(bool fBehaviorTest, NatBehavior behavior, bool fFilteringTest, NatFiltering filtering);
60 
61  HRESULT CommonInit(NatBehavior behavior, NatFiltering filtering);
62 
63 
66 
67 public:
68 
71 
72  HRESULT Run();
73 
74  UT_DECLARE_TEST_NAME("CTestClientLogic");
75 
76 };
77 
78 
79 
80 #endif /* TESTCLIENTLOGIC_H */
81 
CSocketAddress _addrMappedAP
CSocketAddress _addrMappedPA
CSocketAddress _addrServerAA
HRESULT TestBehaviorAndFiltering(bool fBehaviorTest, NatBehavior behavior, bool fFilteringTest, NatFiltering filtering)
TransportAddressSet _tsa
CSocketAddress _addrServerAP
UT_DECLARE_TEST_NAME("CTestClientLogic")
SocketRole GetSocketRoleForDestinationAddress(const CSocketAddress &addrDest)
SocketRole
Definition: socketrole.h:22
int32_t HRESULT
Definition: hresult.h:22
boost::shared_ptr< CStunClientLogic > _spClientLogic
CSocketAddress _addrServerPP
CSocketAddress _addrMappedPP
CSocketAddress _addrLocal
CSocketAddress _addrServerPA
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)
NatBehavior
boost::shared_ptr< CBuffer > CRefCountedBuffer
Definition: buffer.h:65
NatFiltering
HRESULT ValidateBindingRequest(CRefCountedBuffer &spMsg, StunTransactionId *pTransId)