reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::Auth Class Reference

Represents the "credentials" and "challenge" elements in the SIP grammar. More...

#include <Auth.hxx>

Inheritance diagram for resip::Auth:
[legend]

Public Member Functions

 Auth ()
 
 Auth (const HeaderFieldValue &hfv, Headers::Type type, PoolBase *pool=0)
 
 Auth (const Auth &orig, PoolBase *pool=0)
 
Auth & operator= (const Auth &)
 
virtual void parse (ParseBuffer &pb)
 
virtual EncodeStream & encodeParsed (EncodeStream &str) const
 
virtual ParserCategory * clone () const
 
virtual ParserCategory * clone (void *location) const
 
virtual ParserCategory * clone (PoolBase *pool) const
 
void parseAuthParameters (ParseBuffer &pb)
 
EncodeStream & encodeAuthParameters (EncodeStream &str) const
 
Data & scheme ()
 
const Data & scheme () const
 
virtual Parameter * createParam (ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
 
bool exists (const Param< Auth > &paramType) const
 
void remove (const Param< Auth > &paramType)
 
 defineParam (algorithm, "algorithm", DataParameter, "RFC 2617")
 
 defineParam (cnonce, "cnonce", QuotedDataParameter, "RFC 2617")
 
 defineParam (domain, "domain", QuotedDataParameter, "RFC 3261")
 
 defineParam (nc, "nc", DataParameter, "RFC 2617")
 
 defineParam (nonce, "nonce", QuotedDataParameter, "RFC 2617")
 
 defineParam (opaque, "opaque", QuotedDataParameter, "RFC 2617")
 
 defineParam (realm, "realm", QuotedDataParameter, "RFC 2617")
 
 defineParam (response, "response", QuotedDataParameter, "RFC 3261")
 
 defineParam (stale, "stale", DataParameter, "RFC 2617")
 
 defineParam (uri, "uri", QuotedDataParameter, "RFC 3261")
 
 defineParam (username, "username", QuotedDataParameter, "RFC 3261")
 
 defineParam (qop,"qop", DataParameter, "RFC 3261")
 
 defineParam (qopOptions,"qop", DataParameter, "RFC 3261")
 
bool exists (const ParamBase &paramType) const
 Checks for the existence of a natively supported parameter.
 
bool exists (const ExtensionParameter &param) const
 Checks for the existence of a non-natively-supported parameter.
 
void remove (const ParamBase &paramType)
 Removes a natively supported parameter, if the parameter is present.
 
void remove (const ExtensionParameter &param)
 Removes a non-natively-supported parameter, if the parameter is present.
 
const Data & param (const ExtensionParameter &param) const
 Const accessor for non-natively-supported parameter types.
 
Data & param (const ExtensionParameter &param)
 Accessor for non-natively-supported parameter types.
 
- Public Member Functions inherited from resip::ParserCategory
 ParserCategory (const HeaderFieldValue &headerFieldValue, Headers::Type type, PoolBase *pool=0)
 
 ParserCategory (const char *buf, int length, Headers::Type type, PoolBase *pool=0)
 
 ParserCategory (const ParserCategory &rhs, PoolBase *pool=0)
 
ParserCategory & operator= (const ParserCategory &rhs)
 
virtual ~ParserCategory ()
 
bool exists (const ParamBase &paramType) const
 Checks for the existence of a natively supported parameter.
 
void remove (const ParamBase &paramType)
 Removes a natively supported parameter, if the parameter is present.
 
const Data & param (const ExtensionParameter &param) const
 Const accessor for non-natively-supported parameter types.
 
Data & param (const ExtensionParameter &param)
 Accessor for non-natively-supported parameter types.
 
void remove (const ExtensionParameter &param)
 Removes a non-natively-supported parameter, if the parameter is present.
 
bool exists (const ExtensionParameter &param) const
 Checks for the existence of a non-natively-supported parameter.
 
void removeParametersExcept (const ParameterTypeSet &set=EmptyParameterTypeSet)
 Removes all known parameters except those that are specified in set.
 
void clearUnknownParameters ()
 
void parseParameters (ParseBuffer &pb)
 
EncodeStream & encodeParameters (EncodeStream &str) const
 Encodes parameters as they should appear on the wire.
 
Data commutativeParameterHash () const
 
Parameter * getParameterByEnum (ParameterTypes::Type type) const
 
void removeParameterByEnum (ParameterTypes::Type type)
 
void setParameter (const Parameter *parameter)
 
int numKnownParams () const
 Returns the number of known (natively supported) parameters.
 
int numUnknownParams () const
 Returns the number of unknown parameters.
 
- Public Member Functions inherited from resip::LazyParser
 LazyParser (const HeaderFieldValue &headerFieldValue)
 
 LazyParser (const char *buf, int length)
 
 LazyParser (const HeaderFieldValue &headerFieldValue, HeaderFieldValue::CopyPaddingEnum e)
 
 LazyParser (const LazyParser &rhs)
 
 LazyParser (const LazyParser &rhs, HeaderFieldValue::CopyPaddingEnum e)
 
LazyParser & operator= (const LazyParser &rhs)
 
virtual ~LazyParser ()
 
EncodeStream & encode (EncodeStream &str) const
 Encodes this element to a stream, in the fashion it should be represented on the wire.
 
bool isParsed () const
 Returns true iff a parse has been attempted.
 
HeaderFieldValue & getHeaderField ()
 
void checkParsed () const
 
void checkParsed ()
 
void doParse () const
 
void markDirty () const
 
bool isWellFormed () const
 Returns true iff this element was parsed successfully, according to the implementation of parse().
 

Static Public Attributes

static constexpr CommaHandlingMode commaHandling = NoCommaTokenizing
 
- Static Public Attributes inherited from resip::ParserCategory
static const ParameterTypeSet EmptyParameterTypeSet
 

Additional Inherited Members

- Public Types inherited from resip::ParserCategory
enum  { UnknownParserCategory = -1 }
 
enum  CommaHandlingMode { NoCommaTokenizing = 0 , CommasAllowedOutputMulti = 1 , CommasAllowedOutputCommas = 3 }
 
typedef std::set< ParameterTypes::Type > ParameterTypeSet
 
- Protected Types inherited from resip::ParserCategory
typedef std::vector< Parameter *, StlPoolAllocator< Parameter *, PoolBase > > ParameterList
 
- Protected Member Functions inherited from resip::ParserCategory
 ParserCategory (PoolBase *pool=0)
 
bool addParameter (Parameter *param)
 
bool addParameter (UnknownParameter *unknownParam)
 
Parameter * getParameterByData (const Data &data) const
 
void removeParameterByData (const Data &data)
 
PoolBase * getPool ()
 
void freeParameter (Parameter *p)
 
virtual const Data & errorContext () const
 
- Protected Member Functions inherited from resip::LazyParser
 LazyParser ()
 
void clear ()
 
- Protected Attributes inherited from resip::ParserCategory
ParameterList mParameters
 
ParameterList mUnknownParameters
 
PoolBase * mPool
 
Headers::Type mHeaderType
 

Detailed Description

Represents the "credentials" and "challenge" elements in the SIP grammar.

Definition at line 17 of file Auth.hxx.

Constructor & Destructor Documentation

◆ Auth() [1/3]

Auth::Auth ( )

Definition at line 21 of file Auth.cxx.

◆ Auth() [2/3]

Auth::Auth ( const HeaderFieldValue &  hfv,
Headers::Type  type,
PoolBase *  pool = 0 
)

Definition at line 25 of file Auth.cxx.

◆ Auth() [3/3]

Auth::Auth ( const Auth &  orig,
PoolBase *  pool = 0 
)

Definition at line 29 of file Auth.cxx.

Member Function Documentation

◆ clone() [1/3]

ParserCategory * Auth::clone ( ) const
virtual

Implements resip::ParserCategory.

Definition at line 98 of file Auth.cxx.

◆ clone() [2/3]

ParserCategory * Auth::clone ( PoolBase *  pool) const
virtual

Implements resip::ParserCategory.

Definition at line 110 of file Auth.cxx.

◆ clone() [3/3]

ParserCategory * Auth::clone ( void *  location) const
virtual

Implements resip::ParserCategory.

Definition at line 104 of file Auth.cxx.

◆ createParam()

Parameter * Auth::createParam ( ParameterTypes::Type  type,
ParseBuffer &  pb,
const std::bitset< 256 > &  terminators,
PoolBase *  pool 
)
virtual

Reimplemented from resip::ParserCategory.

Definition at line 195 of file Auth.cxx.

◆ defineParam() [1/13]

resip::Auth::defineParam ( algorithm  ,
"algorithm"  ,
DataParameter  ,
"RFC 2617"   
)

◆ defineParam() [2/13]

resip::Auth::defineParam ( cnonce  ,
"cnonce"  ,
QuotedDataParameter  ,
"RFC 2617"   
)

◆ defineParam() [3/13]

resip::Auth::defineParam ( domain  ,
"domain"  ,
QuotedDataParameter  ,
"RFC 3261"   
)

◆ defineParam() [4/13]

resip::Auth::defineParam ( nc  ,
"nc"  ,
DataParameter  ,
"RFC 2617"   
)

◆ defineParam() [5/13]

resip::Auth::defineParam ( nonce  ,
"nonce"  ,
QuotedDataParameter  ,
"RFC 2617"   
)

◆ defineParam() [6/13]

resip::Auth::defineParam ( opaque  ,
"opaque"  ,
QuotedDataParameter  ,
"RFC 2617"   
)

◆ defineParam() [7/13]

resip::Auth::defineParam ( qop  ,
"qop"  ,
DataParameter  ,
"RFC 3261"   
)

◆ defineParam() [8/13]

resip::Auth::defineParam ( qopOptions  ,
"qop"  ,
DataParameter  ,
"RFC 3261"   
)

◆ defineParam() [9/13]

resip::Auth::defineParam ( realm  ,
"realm"  ,
QuotedDataParameter  ,
"RFC 2617"   
)

◆ defineParam() [10/13]

resip::Auth::defineParam ( response  ,
"response"  ,
QuotedDataParameter  ,
"RFC 3261"   
)

◆ defineParam() [11/13]

resip::Auth::defineParam ( stale  ,
"stale"  ,
DataParameter  ,
"RFC 2617"   
)

◆ defineParam() [12/13]

resip::Auth::defineParam ( uri  ,
"uri"  ,
QuotedDataParameter  ,
"RFC 3261"   
)

◆ defineParam() [13/13]

resip::Auth::defineParam ( username  ,
"username"  ,
QuotedDataParameter  ,
"RFC 3261"   
)

◆ encodeAuthParameters()

EncodeStream & Auth::encodeAuthParameters ( EncodeStream &  str) const

Definition at line 165 of file Auth.cxx.

◆ encodeParsed()

EncodeStream & Auth::encodeParsed ( EncodeStream &  str) const
virtual

Implements resip::LazyParser.

Definition at line 85 of file Auth.cxx.

◆ exists() [1/3]

bool ParserCategory::exists ( const ExtensionParameter &  param) const

Checks for the existence of a non-natively-supported parameter.

Parameters
paramThe runtime constructed accessor token.
Returns
true iff the parameter is present.

Definition at line 187 of file ParserCategory.cxx.

◆ exists() [2/3]

bool Auth::exists ( const Param< Auth > &  paramType) const

Definition at line 225 of file Auth.cxx.

◆ exists() [3/3]

bool resip::ParserCategory::exists ( const ParamBase &  paramType) const
inline

Checks for the existence of a natively supported parameter.

Parameters
paramTypeThe accessor token for the parameter.
Returns
true iff the parameter is present.

Definition at line 145 of file ParserCategory.hxx.

◆ operator=()

Auth & Auth::operator= ( const Auth &  rhs)

Definition at line 35 of file Auth.cxx.

◆ param() [1/2]

Data & ParserCategory::param ( const ExtensionParameter &  param)

Accessor for non-natively-supported parameter types.

Will create the parameter if it does not exist.

Parameters
paramThe runtime constructed parameter accessor.
Returns
The parameter, as a raw Data.

Definition at line 173 of file ParserCategory.cxx.

◆ param() [2/2]

const Data & ParserCategory::param ( const ExtensionParameter &  param) const

Const accessor for non-natively-supported parameter types.

Exceptions
ParserCategory::Exceptionif this parameter doesn't exist.
Parameters
paramThe runtime constructed parameter accessor.
Returns
The parameter, as a raw Data.

Definition at line 165 of file ParserCategory.cxx.

◆ parse()

void Auth::parse ( ParseBuffer &  pb)
virtual

Implements resip::LazyParser.

Definition at line 60 of file Auth.cxx.

◆ parseAuthParameters()

void Auth::parseAuthParameters ( ParseBuffer &  pb)

Definition at line 116 of file Auth.cxx.

◆ remove() [1/3]

void ParserCategory::remove ( const ExtensionParameter &  param)

Removes a non-natively-supported parameter, if the parameter is present.

Parameters
paramThe accessor token for the parameter.

Definition at line 180 of file ParserCategory.cxx.

◆ remove() [2/3]

void Auth::remove ( const Param< Auth > &  paramType)

Definition at line 233 of file Auth.cxx.

◆ remove() [3/3]

void ParserCategory::remove ( const ParamBase &  paramType)

Removes a natively supported parameter, if the parameter is present.

Parameters
paramTypeThe accessor token for the parameter.

Definition at line 156 of file ParserCategory.cxx.

◆ scheme() [1/2]

Data & Auth::scheme ( )

Definition at line 46 of file Auth.cxx.

◆ scheme() [2/2]

const Data & Auth::scheme ( ) const

Definition at line 53 of file Auth.cxx.

Member Data Documentation

◆ commaHandling

constexpr CommaHandlingMode resip::Auth::commaHandling = NoCommaTokenizing
staticconstexpr

Definition at line 20 of file Auth.hxx.


The documentation for this class was generated from the following files: