/[resiprocate]/main/reTurn/TurnAllocation.hxx
ViewVC logotype

Diff of /main/reTurn/TurnAllocation.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7417 by sgodin, Sun Nov 18 19:40:48 2007 UTC revision 7418 by sgodin, Wed Nov 21 22:28:22 2007 UTC
# Line 8  Line 8 
8  #include "StunTuple.hxx"  #include "StunTuple.hxx"
9  #include "StunAuth.hxx"  #include "StunAuth.hxx"
10  #include "TurnAllocationKey.hxx"  #include "TurnAllocationKey.hxx"
11  #include "TurnTransportHandler.hxx"  #include "AsyncSocketBaseHandler.hxx"
12  #include "ChannelManager.hxx"  #include "ChannelManager.hxx"
13    
14  namespace reTurn {  namespace reTurn {
15    
16  class TurnPermission;  class TurnPermission;
17  class TurnManager;  class TurnManager;
18  class TurnTransportBase;  class AsyncSocketBase;
19  class UdpRelayServer;  class UdpRelayServer;
20    
21  class TurnAllocation  class TurnAllocation
22    : public TurnTransportHandler,    : public AsyncSocketBaseDestroyedHandler,
23      private boost::noncopyable      private boost::noncopyable
24  {  {
25  public:  public:
26     explicit TurnAllocation(TurnManager& turnManager,     explicit TurnAllocation(TurnManager& turnManager,
27                             TurnTransportBase* localTurnTransport,                             AsyncSocketBase* localTurnSocket,
28                             const StunTuple& clientLocalTuple,                             const StunTuple& clientLocalTuple,
29                             const StunTuple& clientRemoteTuple,                             const StunTuple& clientRemoteTuple,
30                             const StunAuth& clientAuth,                             const StunAuth& clientAuth,
# Line 45  Line 45 
45     // create Permission if not present, otherwise refresh permission timer     // create Permission if not present, otherwise refresh permission timer
46     void refreshPermission(const asio::ip::address& address);     void refreshPermission(const asio::ip::address& address);
47    
48     // this get's called when being notified that the transport that the allocation came from     // this get's called when being notified that the socket that the allocation came from
49     // has been destroyed     // has been destroyed
50     void onTransportDestroyed();     void onSocketDestroyed();
51    
52     // Used when framed data is received from client, to forward data to peer     // Used when framed data is received from client, to forward data to peer
53     void sendDataToPeer(unsigned short channelNumber, const resip::Data& data);     void sendDataToPeer(unsigned short channelNumber, resip::SharedPtr<resip::Data> data, bool framed);
54     // Used when Send Indication is received from client, to forward data to peer     // Used when Send Indication is received from client, to forward data to peer
55     void sendDataToPeer(unsigned short channelNumber, const StunTuple& peerAddress, const resip::Data& data);       void sendDataToPeer(unsigned short channelNumber, const StunTuple& peerAddress, resip::SharedPtr<resip::Data> data, bool framed);  
56     // Used when Data is received from peer, to forward data to client     // Used when Data is received from peer, to forward data to client
57     void sendDataToClient(const StunTuple& peerAddress, const resip::Data& data);     void sendDataToClient(const StunTuple& peerAddress, resip::SharedPtr<resip::Data> data);
58    
59     // Called when a ChannelConfirmed Indication is received     // Called when a ChannelConfirmed Indication is received
60     void serverToClientChannelConfirmed(unsigned short channelNumber, const StunTuple& peerAddress);     void serverToClientChannelConfirmed(unsigned short channelNumber, const StunTuple& peerAddress);
# Line 65  Line 65 
65    
66  private:  private:
67     // Used when there is any data to send to the peer, after channel has been identified     // Used when there is any data to send to the peer, after channel has been identified
68     void sendDataToPeer(const StunTuple& peerAddress, const resip::Data& data);       void sendDataToPeer(const StunTuple& peerAddress, resip::SharedPtr<resip::Data> data, bool framed);  
69    
70     TurnAllocationKey mKey;  // contains ClientLocalTuple and clientRemoteTuple     TurnAllocationKey mKey;  // contains ClientLocalTuple and clientRemoteTuple
71     StunAuth  mClientAuth;     StunAuth  mClientAuth;
# Line 83  Line 83 
83     TurnManager& mTurnManager;     TurnManager& mTurnManager;
84     asio::deadline_timer mAllocationTimer;     asio::deadline_timer mAllocationTimer;
85    
86     TurnTransportBase* mLocalTurnTransport;     AsyncSocketBase* mLocalTurnSocket;
87     boost::shared_ptr<UdpRelayServer> mUdpRelayServer;     boost::shared_ptr<UdpRelayServer> mUdpRelayServer;
88    
89     ChannelManager mChannelManager;     ChannelManager mChannelManager;

Legend:
Removed from v.7417  
changed lines
  Added in v.7418

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27