1#if defined(HAVE_CONFIG_H)
16#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
40 mScheme = rhs.mScheme;
64 static const std::bitset<256> schemeDelimiter(
Data::toBitset(
"\r\n\t ="));
77 pb.
data(mScheme, start);
100 return new Auth(*
this);
106 return new (location)
Auth(*
this);
112 return new (pool)
Auth(*
this, pool);
120 const char* keyStart = pb.
position();
124 if((
int)(keyEnd-keyStart) != 0)
131 int((keyEnd - keyStart)),
168 for (ParameterList::const_iterator it =
mParameters.begin();
197 if(type==ParameterTypes::qop)
202 case Headers::ProxyAuthenticate:
203 case Headers::WWWAuthenticate:
204 qop =
new (pool)
DataParameter(ParameterTypes::qopOptions,pb,terminators);
207 case Headers::ProxyAuthorization:
208 case Headers::Authorization:
209 case Headers::AuthenticationInfo:
211 qop =
new (pool)
DataParameter(ParameterTypes::qop,pb,terminators);
219 return ParameterFactories[type](type, pb, terminators, pool);
239#define defineParam(_enum, _name, _type, _RFC_ref_ignored) \
240_enum##_Param::DType& \
241Auth::param(const _enum##_Param& paramType) \
244 _enum##_Param::Type* p = static_cast<_enum##_Param::Type*>(getParameterByEnum(paramType.getTypeNum())); \
247 p = new _enum##_Param::Type(paramType.getTypeNum()); \
248 mParameters.push_back(p); \
252const _enum##_Param::DType& \
253Auth::param(const _enum##_Param& paramType) const \
256 _enum##_Param::Type* p = static_cast<_enum##_Param::Type*>(getParameterByEnum(paramType.getTypeNum())); \
259 InfoLog(<< "Missing parameter " << ParameterTypes::ParameterNames[paramType.getTypeNum()]); \
260 DebugLog(<< *this); \
261 throw Exception("Missing parameter", __FILE__, __LINE__); \
300 throw Exception(
"Missing parameter", __FILE__, __LINE__);
319Auth::param(
const qopOptions_Param& paramType)
const
327 throw Exception(
"Missing parameter", __FILE__, __LINE__);
#define defineParam(_enum, _name, _type, _RFC_ref_ignored)
Represents the "credentials" and "challenge" elements in the SIP grammar.
bool exists(const Param< Auth > ¶mType) const
virtual void parse(ParseBuffer &pb)
virtual EncodeStream & encodeParsed(EncodeStream &str) const
virtual ParserCategory * clone() const
void parseAuthParameters(ParseBuffer &pb)
EncodeStream & encodeAuthParameters(EncodeStream &str) const
virtual Parameter * createParam(ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
Auth & operator=(const Auth &)
void remove(const Param< Auth > ¶mType)
const Data & param(const ExtensionParameter ¶m) const
Const accessor for non-natively-supported parameter types.
Generically represents miscellaneous parameter data.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
bool empty() const noexcept
Checks whether the Data is empty.
static std::bitset< 256 > toBitset(const resip::Data &chars)
Creates a bitset reflecting the contents of this data (as a set) ie.
virtual ParameterTypes::Type getTypeNum() const =0
Parameter *(* Factory)(ParameterTypes::Type, ParseBuffer &, const std::bitset< 256 > &terminators, PoolBase *pool)
static Type getType(const char *start, size_t length)
does a convert to enum from a pointer into the HFV raw buffer
static Data ParameterNames[MAX_PARAMETER]
static array of ParameterNames indexed by the 2nd element in defineParam(...)
Provides string-parsing functionality with protection from buffer overflow.
CurrentPosition skipWhitespace()
CurrentPosition position() const
void reset(const char *pos)
CurrentPosition skipToOneOf(const char *cs)
CurrentPosition skipChar()
void data(Data &data, const char *start) const
make the passed in data share memory with the buffer (uses Data::Share)
Base class for all SIP grammar elements that can have parameters.
Parameter * getParameterByEnum(ParameterTypes::Type type) const
ParameterList mUnknownParameters
ParserCategory & operator=(const ParserCategory &rhs)
void removeParameterByEnum(ParameterTypes::Type type)
bool addParameter(Parameter *param)
ParameterList mParameters
Headers::Type mHeaderType
void freeParameter(Parameter *p)
Generically represents miscellaneous parameter data that is encoded using double quotes.
static const char * SPACE
static const char * COMMA
static const char * EQUALS
Generically used to represent any parameter that is not known by the implmentation.
dcm! – add UnusedChecking(_enum) below;