Click here to Skip to main content
15,895,011 members
Articles / Programming Languages / Visual C++ 10.0

SIP Stack (1 of 3)

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
20 Aug 2012CPOL3 min read 30.1K   1.7K   4  
SIP Stack Implementation on the basis of RFC SIP 3261 Specification
#pragma once

#ifndef CSIPWWWAuthenticateParser_h
	#define CSIPWWWAuthenticateParser_h
	
	#include "ASIPParser.h"
	#include "HHCoreInclude\CMessageData.h"
	#include "CSIPParamListParser.h"

	namespace SIPParserFW
	{
		class SIP_PARSER_DLL_DECLARATION_SPECIFIER CSIPWWWAuthenticateParser : public ASIPParser 
		{
			friend class CPoolObject<CSIPWWWAuthenticateParser> ;
			friend class CSIPAuthorizationParser ;

		protected:
			CSIPWWWAuthenticateParser() ;
			CSIPWWWAuthenticateParser( const CSIPWWWAuthenticateParser &SIPWWWAuthenticateParser ) ;
			
			virtual ~CSIPWWWAuthenticateParser() ;

			CSIPWWWAuthenticateParser& operator=( const CSIPWWWAuthenticateParser &SIPWWWAuthenticateParser ) ;

		public:
			void Release() ;
			ASIPParser* Copy() ;

			FW_RETURN_TYPE Parse( const std::string &strStringToParse ) ;
			std::string ToString() const ;

			std::string GetHeaderName() const ;

		public:
			void SetWWWAuthenticateType( const std::string &strWWWAuthenticateType ) ;
			const std::string& GetWWWAuthenticateType() const ;

			void SetRealm( const std::string &strRealm ) ;
			std::string GetRealm() const ;

			void SetDomain( const std::string &strDomain ) ;
			std::string GetDomain() const ;

			void SetNonce( const std::string &strNonce ) ;
			std::string GetNonce() const ;

			void SetOpaque( const std::string &strOpaque ) ;
			std::string GetOpaque() const ;

			void SetStale( const std::string &strStale ) ;
			std::string GetStale() const ;

			void SetAlgorithm( const std::string &strAlgorithm ) ;
			std::string GetAlgorithm() const ;

			void SetQOPOptions( const std::string &strQOPOptions ) ;
			std::string GetQOPOptions() const ;

			FW_RETURN_TYPE QuerySIPOtherChallengeParameters( CSIPParamListParser **pSIPChallengeParameters ) ;

			CSIPParamListParser* GetSIPOtherChallengeParameters() ;
		
		public:
			static CSIPWWWAuthenticateParser* GetAvailable() ;

		protected:
			void ReleaseParameters() ;

		private:
			void ReleaseCSIPWWWAuthenticateParserData() ;
			void CopyCSIPWWWAuthenticateParserData( const CSIPWWWAuthenticateParser &SIPWWWAuthenticateParser ) ;

			FW_RETURN_TYPE ParseSIPWWWAuthenticateChallengeStringList( const std::string &strStringToParse ) ;
			std::string SIPWWWAuthenticateChallengeListToString() const ;
				
		private:
			static std::string m_strSIPChallengeStringDelimiter ;
			static std::string m_strSIPChallengeNameAndValueDelimiter ;

		private:
			std::string m_strWWWAuthenticateType ;
			CMessageData *m_pRealmData ;
			CMessageData *m_pDomainData ;
			CMessageData *m_pNonceData ;
			CMessageData *m_pOpaqueData ;
			CMessageData *m_pStaleData ;
			CMessageData *m_pAlgorithmData ;
			CMessageData *m_pQOPOptionsData ;
			CSIPParamListParser *m_pSIPOtherChallengeParameters ;
		} ;

		inline CSIPParamListParser* CSIPWWWAuthenticateParser::GetSIPOtherChallengeParameters()
		{
			return m_pSIPOtherChallengeParameters ;
		}

		inline void CSIPWWWAuthenticateParser::SetWWWAuthenticateType( const std::string &strWWWAuthenticateType )
		{
			m_strWWWAuthenticateType = strWWWAuthenticateType ;
		}

		inline const std::string& CSIPWWWAuthenticateParser::GetWWWAuthenticateType() const
		{
			return m_strWWWAuthenticateType ;
		}
		
	} // End namespace

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
Hatim Haidry

VC++, Technical Architect

India

haidryhatim@gmail.com

Comments and Discussions