/[resiprocate]/branches/b-directory-reorg/sip/resiprocate/TransactionController.hxx
ViewVC logotype

Contents of /branches/b-directory-reorg/sip/resiprocate/TransactionController.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5271 - (show annotations) (download)
Thu Aug 18 23:43:07 2005 UTC (14 years, 3 months ago) by jason
File size: 5748 byte(s)
new directory reorg proposal
1 #if !defined(RESIP_TRANSACTION_CONTROLLER_HXX)
2 #define RESIP_TRANSACTION_CONTROLLER_HXX
3
4 #include "resiprocate/TuSelector.hxx"
5 #include "resiprocate/TransactionMap.hxx"
6 #include "resiprocate/TransportSelector.hxx"
7 #include "resiprocate/TimerQueue.hxx"
8 #include "resiprocate/Security.hxx"
9
10 namespace resip
11 {
12
13 class TransactionMessage;
14 class ApplicationMessage;
15 class StatisticsManager;
16 class SipStack;
17
18 class TransactionController
19 {
20 public:
21 // set after starting at your peril
22 static unsigned int MaxTUFifoSize;
23 static unsigned int MaxTUFifoTimeDepthSecs;
24
25 TransactionController(SipStack& stack);
26 ~TransactionController();
27
28 void process(FdSet& fdset);
29 unsigned int getTimeTillNextProcessMS();
30 void buildFdSet(FdSet& fdset);
31
32 // graceful shutdown (eventually)
33 void shutdown();
34
35 TransportSelector& transportSelector() { return mTransportSelector; }
36 const TransportSelector& transportSelector() const { return mTransportSelector; }
37
38 bool isTUOverloaded() const;
39
40 void send(SipMessage* msg);
41
42 // Inform the TU that whenever a transaction has been terminated.
43 void registerForTransactionTermination();
44
45 unsigned int getTuFifoSize() const;
46 unsigned int sumTransportFifoSizes() const;
47 unsigned int getTransactionFifoSize() const;
48 unsigned int getNumClientTransactions() const;
49 unsigned int getNumServerTransactions() const;
50 unsigned int getTimerQueueSize() const;
51 //void setStatisticsInterval(unsigned long seconds) const;
52
53 void registerBlacklistListener(int rrType, DnsStub::BlacklistListener*);
54 void unregisterBlacklistListener(int rrType, DnsStub::BlacklistListener*);
55
56 private:
57 TransactionController(const TransactionController& rhs);
58 TransactionController& operator=(const TransactionController& rhs);
59 SipStack& mStack;
60
61 bool mMultiThreaded;
62 bool mRegisteredForTransactionTermination;
63
64 // If true, indicate to the Transaction to ignore responses for which
65 // there is no transaction.
66 // !jf! Probably should transmit stray responses statelessly. see RFC3261
67 bool mDiscardStrayResponses;
68
69 // fifo used to communicate to the transaction state machine within the
70 // stack. Not for external use by the application. May contain, sip
71 // messages (requests and responses), timers (used by state machines),
72 // asynchronous dns responses, transport errors from the underlying
73 // transports, etc.
74 Fifo<TransactionMessage> mStateMacFifo;
75
76 // from the sipstack (for convenience)
77 TuSelector& mTuSelector;
78
79 // Used to decide which transport to send a sip message on.
80 TransportSelector mTransportSelector;
81
82 // stores all of the transactions that are currently active in this stack
83 TransactionMap mClientTransactionMap;
84 TransactionMap mServerTransactionMap;
85
86 // timers associated with the transactions. When a timer fires, it is
87 // placed in the mStateMacFifo
88 TimerQueue mTimers;
89
90 bool mShuttingDown;
91
92 StatisticsManager& mStatsManager;
93
94 friend class SipStack; // for debug only
95 friend class TransactionState;
96 friend class TransportSelector;
97
98 friend class TestDnsResolver;
99 friend class TestFSM;
100 };
101
102
103 }
104
105
106 #endif
107 /* ====================================================================
108 * The Vovida Software License, Version 1.0
109 *
110 * Copyright (c) 2004 Vovida Networks, Inc. All rights reserved.
111 *
112 * Redistribution and use in source and binary forms, with or without
113 * modification, are permitted provided that the following conditions
114 * are met:
115 *
116 * 1. Redistributions of source code must retain the above copyright
117 * notice, this list of conditions and the following disclaimer.
118 *
119 * 2. Redistributions in binary form must reproduce the above copyright
120 * notice, this list of conditions and the following disclaimer in
121 * the documentation and/or other materials provided with the
122 * distribution.
123 *
124 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
125 * and "Vovida Open Communication Application Library (VOCAL)" must
126 * not be used to endorse or promote products derived from this
127 * software without prior written permission. For written
128 * permission, please contact vocal@vovida.org.
129 *
130 * 4. Products derived from this software may not be called "VOCAL", nor
131 * may "VOCAL" appear in their name, without prior written
132 * permission of Vovida Networks, Inc.
133 *
134 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
135 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
136 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
137 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
138 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
139 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
140 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
141 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
142 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
143 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
144 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
145 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
146 * DAMAGE.
147 *
148 * ====================================================================
149 *
150 * This software consists of voluntary contributions made by Vovida
151 * Networks, Inc. and many individuals on behalf of Vovida Networks,
152 * Inc. For more information on Vovida Networks, Inc., please see
153 * <http://www.vovida.org/>.
154 *
155 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27