reSIProcate/DialogUsageManager  9694
UserAuthInfo.hxx
Go to the documentation of this file.
00001 #if !defined(RESIP_USER_AUTH_INFO_HXX)
00002 #define RESIP_USER_AUTH_INFO_HXX 
00003 
00004 #include "rutil/Data.hxx"
00005 #include "resip/dum/DumFeatureMessage.hxx"
00006 
00007 namespace resip
00008 {
00009 
00010 class UserAuthInfo : public resip::DumFeatureMessage
00011 {
00012    public:
00013 
00014       enum InfoMode 
00015       {
00016         UserUnknown,       // the user/realm is not known
00017         RetrievedA1,       // the A1 string has been retrieved
00018         Stale,             // the nonce is stale, challenge again
00019         DigestAccepted,    // the digest was accepted, no A1 returned
00020         DigestNotAccepted, // the digest was wrong, challenge again/deny
00021         Error              // some error occurred
00022       };
00023 
00024       UserAuthInfo( const resip::Data& user,
00025                     const resip::Data& realm,
00026                     InfoMode mode,
00027                     const resip::Data& transactionId);
00028 
00029       UserAuthInfo( const resip::Data& user,
00030                     const resip::Data& realm,
00031                     const resip::Data& a1,
00032                     const resip::Data& transactionId);
00033 
00034       UserAuthInfo( const resip::Data& user,
00035                     const resip::Data& realm,
00036                     const resip::Data& transactionId,
00037                     resip::TransactionUser* transactionUser);
00038       ~UserAuthInfo();
00039          
00040       InfoMode getMode() const;
00041 
00042       // returns a blank Data("") if (mode != RetrievedA1)
00043       const resip::Data& getA1() const;
00044       const resip::Data& getRealm() const;
00045       const resip::Data& getUser() const;
00046 
00047       void setMode(InfoMode mode);
00048       void setA1(const resip::Data& a1);
00049 
00050       virtual resip::Data brief() const;
00051       virtual resip::Message* clone() const;
00052 
00053       virtual EncodeStream& encode(EncodeStream& strm) const;
00054       virtual EncodeStream& encodeBrief(EncodeStream& strm) const;
00055 
00056    private:
00057       InfoMode mMode;
00058       resip::Data mUser;
00059       resip::Data mRealm;
00060       resip::Data mA1;
00061 };
00062 
00063 EncodeStream& 
00064 operator<<(EncodeStream& strm, const UserAuthInfo& msg);
00065 
00066 }
00067 #endif
00068 
00069 /* ====================================================================
00070  * The Vovida Software License, Version 1.0 
00071  * 
00072  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00073  * 
00074  * Redistribution and use in source and binary forms, with or without
00075  * modification, are permitted provided that the following conditions
00076  * are met:
00077  * 
00078  * 1. Redistributions of source code must retain the above copyright
00079  *    notice, this list of conditions and the following disclaimer.
00080  * 
00081  * 2. Redistributions in binary form must reproduce the above copyright
00082  *    notice, this list of conditions and the following disclaimer in
00083  *    the documentation and/or other materials provided with the
00084  *    distribution.
00085  * 
00086  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00087  *    and "Vovida Open Communication Application Library (VOCAL)" must
00088  *    not be used to endorse or promote products derived from this
00089  *    software without prior written permission. For written
00090  *    permission, please contact vocal@vovida.org.
00091  *
00092  * 4. Products derived from this software may not be called "VOCAL", nor
00093  *    may "VOCAL" appear in their name, without prior written
00094  *    permission of Vovida Networks, Inc.
00095  * 
00096  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00097  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00098  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00099  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00100  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00101  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00102  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00103  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00104  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00105  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00106  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00107  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00108  * DAMAGE.
00109  * 
00110  * ====================================================================
00111  * 
00112  * This software consists of voluntary contributions made by Vovida
00113  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00114  * Inc.  For more information on Vovida Networks, Inc., please see
00115  * <http://www.vovida.org/>.
00116  *
00117  */