reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
UserAuthInfo.hxx
Go to the documentation of this file.
1#if !defined(RESIP_USER_AUTH_INFO_HXX)
2#define RESIP_USER_AUTH_INFO_HXX
3
4#include "rutil/Data.hxx"
5#include "rutil/compat.hxx"
7
8namespace resip
9{
10
12{
13 public:
14
16 {
17 UserUnknown, // the user/realm is not known
18 RetrievedA1, // the A1 string has been retrieved
19 Stale, // the nonce is stale, challenge again
20 DigestAccepted, // the digest was accepted, no A1 returned
21 DigestNotAccepted, // the digest was wrong, challenge again/deny
22 Error // some error occurred
23 };
24
25 UserAuthInfo( const resip::Data& user,
26 const resip::Data& realm,
27 InfoMode mode,
28 const resip::Data& transactionId);
29
30 UserAuthInfo( const resip::Data& user,
31 const resip::Data& realm,
32 const resip::Data& a1,
33 const resip::Data& transactionId);
34
35 UserAuthInfo( const resip::Data& user,
36 const resip::Data& realm,
37 const resip::Data& transactionId,
38 resip::TransactionUser* transactionUser);
40
41 InfoMode getMode() const;
42
43 // returns a blank Data("") if (mode != RetrievedA1)
44 const resip::Data& getA1() const;
45 const resip::Data& getRealm() const;
46 const resip::Data& getUser() const;
47
48 const void getErrorInfo(int32_t & errorCode, resip::Data & errorStatusText) const;
49
50 void setMode(InfoMode mode, int32_t errorCode = 0, const resip::Data & statusText = resip::Data::Empty);
51 void setA1(const resip::Data& a1);
52
53 virtual resip::Message* clone() const;
54
55 virtual EncodeStream& encode(EncodeStream& strm) const;
56 virtual EncodeStream& encodeBrief(EncodeStream& strm) const;
57
58 private:
59 InfoMode mMode;
60 resip::Data mUser;
61 resip::Data mRealm;
62 resip::Data mA1;
63 int32_t mErrorCode;
64 resip::Data mErrorStatusText;
65};
66
68operator<<(EncodeStream& strm, const UserAuthInfo& msg);
69
70}
71#endif
72
73/* ====================================================================
74 * The Vovida Software License, Version 1.0
75 *
76 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
77 *
78 * Redistribution and use in source and binary forms, with or without
79 * modification, are permitted provided that the following conditions
80 * are met:
81 *
82 * 1. Redistributions of source code must retain the above copyright
83 * notice, this list of conditions and the following disclaimer.
84 *
85 * 2. Redistributions in binary form must reproduce the above copyright
86 * notice, this list of conditions and the following disclaimer in
87 * the documentation and/or other materials provided with the
88 * distribution.
89 *
90 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
91 * and "Vovida Open Communication Application Library (VOCAL)" must
92 * not be used to endorse or promote products derived from this
93 * software without prior written permission. For written
94 * permission, please contact vocal@vovida.org.
95 *
96 * 4. Products derived from this software may not be called "VOCAL", nor
97 * may "VOCAL" appear in their name, without prior written
98 * permission of Vovida Networks, Inc.
99 *
100 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
101 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
102 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
103 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
104 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
105 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
106 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
107 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
108 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
109 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
110 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
111 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
112 * DAMAGE.
113 *
114 * ====================================================================
115 *
116 * This software consists of voluntary contributions made by Vovida
117 * Networks, Inc. and many individuals on behalf of Vovida Networks,
118 * Inc. For more information on Vovida Networks, Inc., please see
119 * <http://www.vovida.org/>.
120 *
121 */
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
dcm! – what is the intent of ApplicationMessage, especially as used in
The base-class used for message-passing.
Definition Message.hxx:21
The base-class for an RFC 3261 Transaction User.
const void getErrorInfo(int32_t &errorCode, resip::Data &errorStatusText) const
void setMode(InfoMode mode, int32_t errorCode=0, const resip::Data &statusText=resip::Data::Empty)
virtual resip::Message * clone() const
virtual EncodeStream & encode(EncodeStream &strm) const
output the entire message to stream
const resip::Data & getUser() const
const resip::Data & getRealm() const
void setA1(const resip::Data &a1)
virtual EncodeStream & encodeBrief(EncodeStream &strm) const
output a brief description to stream
InfoMode getMode() const
const resip::Data & getA1() const
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
dcm! – add UnusedChecking(_enum) below;
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)
#define EncodeStream
signed int int32_t
Definition stdint.h:82