reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ConnectionTerminated.hxx
Go to the documentation of this file.
1#if !defined(RESIP_CONNECTIONTERMINATED_HXX)
2#define RESIP_CONNECTIONTERMINATED_HXX
3
8
9#include <list>
10
11namespace resip
12{
13
15{
16 public:
18
21 int failureSubCode,
22 const Data& failureString,
23 const std::list<Data>& additionalFailureStrings) :
24 mFlow(flow),
25 mFailureReason(failureReason),
26 mFailureSubCode(failureSubCode),
27 mFailureString(failureString),
28 mAdditionalFailureStrings(additionalFailureStrings)
29 {
30 }
31 virtual const Data& getTransactionId() const { resip_assert(0); return Data::Empty; }
32 virtual bool isClientTransaction() const { resip_assert(0); return false; }
33 virtual Message* clone() const { return new ConnectionTerminated(mFlow, mFailureReason, mFailureSubCode, mFailureString, mAdditionalFailureStrings); }
34 virtual EncodeStream& encode(EncodeStream& strm) const
35 {
36 encodeBrief(strm);
37 strm << ", failureString=" << mFailureString;
38 for (std::list<Data>::const_iterator it = mAdditionalFailureStrings.begin(); it != mAdditionalFailureStrings.end(); ++it)
39 {
40 strm << std::endl << " " << *it;
41 }
42 return strm;
43 }
44 virtual EncodeStream& encodeBrief(EncodeStream& strm) const
45 {
46 strm << "ConnectionTerminated: flow=" << mFlow
47 << ", failureReason=" << TransportFailure::failureReasonToString(mFailureReason)
48 << ", failureSubCode=" << mFailureSubCode;
49 return strm;
50 }
51
52 FlowKey getFlowKey() const { return mFlow.mFlowKey; }
53 const Tuple& getFlow() const { return mFlow; }
54 TransportFailure::FailureReason getFailureReason() const { return mFailureReason; }
55 int getFailureSubCode() const { return mFailureSubCode; }
56 const Data& getFailureString() const { return mFailureString; }
57 const std::list<Data>& getAdditionalFailureStrings() const { return mAdditionalFailureStrings; }
58
59 private:
60 const Tuple mFlow;
62 int mFailureSubCode;
63 const Data mFailureString;
64 const std::list<Data> mAdditionalFailureStrings; // Note: SSL certificate validation callback errors end up here
65};
66
67}
68
69#endif
70/* ====================================================================
71 * The Vovida Software License, Version 1.0
72 *
73 * Redistribution and use in source and binary forms, with or without
74 * modification, are permitted provided that the following conditions
75 * are met:
76 *
77 * 1. Redistributions of source code must retain the above copyright
78 * notice, this list of conditions and the following disclaimer.
79 *
80 * 2. Redistributions in binary form must reproduce the above copyright
81 * notice, this list of conditions and the following disclaimer in
82 * the documentation and/or other materials provided with the
83 * distribution.
84 *
85 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
86 * and "Vovida Open Communication Application Library (VOCAL)" must
87 * not be used to endorse or promote products derived from this
88 * software without prior written permission. For written
89 * permission, please contact vocal@vovida.org.
90 *
91 * 4. Products derived from this software may not be called "VOCAL", nor
92 * may "VOCAL" appear in their name, without prior written
93 * permission of Vovida Networks, Inc.
94 *
95 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
96 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
97 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
98 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
99 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
100 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
101 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
102 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
103 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
104 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
105 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
106 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
107 * DAMAGE.
108 *
109 * ====================================================================
110 *
111 * This software consists of voluntary contributions made by Vovida
112 * Networks, Inc. and many individuals on behalf of Vovida Networks,
113 * Inc. For more information on Vovida Networks, Inc., please see
114 * <http://www.vovida.org/>.
115 *
116 */
#define resip_assert(x)
This file needs to work for both C and C++ code.
RESIP_HeapCount(ConnectionTerminated)
const Data & getFailureString() const
const std::list< Data > & getAdditionalFailureStrings() const
virtual EncodeStream & encode(EncodeStream &strm) const
output the entire message to stream
TransportFailure::FailureReason getFailureReason() const
virtual bool isClientTransaction() const
virtual Message * clone() const
virtual const Data & getTransactionId() const
ConnectionTerminated(const Tuple &flow, TransportFailure::FailureReason failureReason, int failureSubCode, const Data &failureString, const std::list< Data > &additionalFailureStrings)
virtual EncodeStream & encodeBrief(EncodeStream &strm) const
output a brief description to stream
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
static const Data Empty
Constant that represents a zero-length data.
Definition Data.hxx:882
The base-class used for message-passing.
Definition Message.hxx:21
static const char * failureReasonToString(FailureReason failureReason)
Represents a network address.
Definition Tuple.hxx:59
FlowKey mFlowKey
This is a (largely) opaque key that subclasses of Transport will use to help record/find flows.
Definition Tuple.hxx:189
dcm! – add UnusedChecking(_enum) below;
unsigned long FlowKey
Definition Tuple.hxx:37
#define EncodeStream