reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Auth.hxx
Go to the documentation of this file.
1#if !defined(RESIP_AUTH_HXX)
2#define RESIP_AUTH_HXX
3
4#include <iosfwd>
5#include "rutil/Data.hxx"
7
8namespace resip
9{
10
11
17class Auth : public ParserCategory
18{
19 public:
21
22 Auth();
23 Auth(const HeaderFieldValue& hfv, Headers::Type type, PoolBase* pool=0);
24 Auth(const Auth& orig, PoolBase* pool=0);
25 Auth& operator=(const Auth&);
26
27 virtual void parse(ParseBuffer& pb);
28 virtual EncodeStream& encodeParsed(EncodeStream& str) const;
29 virtual ParserCategory* clone() const;
30 virtual ParserCategory* clone(void* location) const;
31 virtual ParserCategory* clone(PoolBase* pool) const;
32
35
36 Data& scheme();
37 const Data& scheme() const;
38
39 // Inform the compiler that overloads of these may be found in
40 // ParserCategory, too.
44
45 virtual Parameter* createParam(ParameterTypes::Type type, ParseBuffer& pb, const std::bitset<256>& terminators, PoolBase* pool);
46 bool exists(const Param<Auth>& paramType) const;
47 void remove(const Param<Auth>& paramType);
48
49#define defineParam(_enum, _name, _type, _RFC_ref_ignored) \
50 _enum##_Param::DType& param(const _enum##_Param& paramType); \
51 const _enum##_Param::DType& param(const _enum##_Param& paramType) const; \
52 friend class _enum##_Param
53
54 defineParam(algorithm, "algorithm", DataParameter, "RFC 2617");
55 defineParam(cnonce, "cnonce", QuotedDataParameter, "RFC 2617");
56 defineParam(domain, "domain", QuotedDataParameter, "RFC 3261");
57 defineParam(nc, "nc", DataParameter, "RFC 2617");
58 defineParam(nonce, "nonce", QuotedDataParameter, "RFC 2617");
59 defineParam(opaque, "opaque", QuotedDataParameter, "RFC 2617");
60 defineParam(realm, "realm", QuotedDataParameter, "RFC 2617");
61 defineParam(response, "response", QuotedDataParameter, "RFC 3261");
62 defineParam(stale, "stale", DataParameter, "RFC 2617");
63 defineParam(uri, "uri", QuotedDataParameter, "RFC 3261");
64 defineParam(username, "username", QuotedDataParameter, "RFC 3261");
65 defineParam(qop,"qop",DataParameter, "RFC 3261");
66 // Internal use only
67 defineParam(qopOptions,"qop",DataParameter, "RFC 3261");
68
69#undef defineParam
70
71 private:
72 Data mScheme;
73
75};
76
77}
78
79
80#endif
81
82
83/* ====================================================================
84 * The Vovida Software License, Version 1.0
85 *
86 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
87 *
88 * Redistribution and use in source and binary forms, with or without
89 * modification, are permitted provided that the following conditions
90 * are met:
91 *
92 * 1. Redistributions of source code must retain the above copyright
93 * notice, this list of conditions and the following disclaimer.
94 *
95 * 2. Redistributions in binary form must reproduce the above copyright
96 * notice, this list of conditions and the following disclaimer in
97 * the documentation and/or other materials provided with the
98 * distribution.
99 *
100 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
101 * and "Vovida Open Communication Application Library (VOCAL)" must
102 * not be used to endorse or promote products derived from this
103 * software without prior written permission. For written
104 * permission, please contact vocal@vovida.org.
105 *
106 * 4. Products derived from this software may not be called "VOCAL", nor
107 * may "VOCAL" appear in their name, without prior written
108 * permission of Vovida Networks, Inc.
109 *
110 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
111 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
112 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
113 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
114 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
115 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
116 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
117 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
118 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
119 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
120 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
121 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
122 * DAMAGE.
123 *
124 * ====================================================================
125 *
126 * This software consists of voluntary contributions made by Vovida
127 * Networks, Inc. and many individuals on behalf of Vovida Networks,
128 * Inc. For more information on Vovida Networks, Inc., please see
129 * <http://www.vovida.org/>.
130 *
131 */
Represents the "credentials" and "challenge" elements in the SIP grammar.
Definition Auth.hxx:18
bool exists(const Param< Auth > &paramType) const
Definition Auth.cxx:225
virtual void parse(ParseBuffer &pb)
Definition Auth.cxx:60
defineParam(opaque, "opaque", QuotedDataParameter, "RFC 2617")
defineParam(nonce, "nonce", QuotedDataParameter, "RFC 2617")
virtual EncodeStream & encodeParsed(EncodeStream &str) const
Definition Auth.cxx:85
static constexpr CommaHandlingMode commaHandling
Definition Auth.hxx:20
virtual ParserCategory * clone() const
Definition Auth.cxx:98
void parseAuthParameters(ParseBuffer &pb)
Definition Auth.cxx:116
defineParam(qop,"qop", DataParameter, "RFC 3261")
defineParam(cnonce, "cnonce", QuotedDataParameter, "RFC 2617")
defineParam(username, "username", QuotedDataParameter, "RFC 3261")
defineParam(stale, "stale", DataParameter, "RFC 2617")
EncodeStream & encodeAuthParameters(EncodeStream &str) const
Definition Auth.cxx:165
virtual Parameter * createParam(ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
Definition Auth.cxx:195
defineParam(nc, "nc", DataParameter, "RFC 2617")
defineParam(domain, "domain", QuotedDataParameter, "RFC 3261")
defineParam(qopOptions,"qop", DataParameter, "RFC 3261")
defineParam(response, "response", QuotedDataParameter, "RFC 3261")
Auth & operator=(const Auth &)
Definition Auth.cxx:35
defineParam(realm, "realm", QuotedDataParameter, "RFC 2617")
defineParam(uri, "uri", QuotedDataParameter, "RFC 3261")
Data & scheme()
Definition Auth.cxx:46
void remove(const Param< Auth > &paramType)
Definition Auth.cxx:233
defineParam(algorithm, "algorithm", DataParameter, "RFC 2617")
Generically represents miscellaneous parameter data.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Parameter *(* Factory)(ParameterTypes::Type, ParseBuffer &, const std::bitset< 256 > &terminators, PoolBase *pool)
Provides string-parsing functionality with protection from buffer overflow.
Base class for all SIP grammar elements that can have parameters.
void remove(const ParamBase &paramType)
Removes a natively supported parameter, if the parameter is present.
bool exists(const ParamBase &paramType) const
Checks for the existence of a natively supported parameter.
const Data & param(const ExtensionParameter &param) const
Const accessor for non-natively-supported parameter types.
Generically represents miscellaneous parameter data that is encoded using double quotes.
dcm! – add UnusedChecking(_enum) below;
#define EncodeStream