realtimenetprots/sipfw/SIP/SigCompController/Common/inc/compressinglogic.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Name          : compressinglogic.h
       
    16 * Part of       : SIP SigComp Controller
       
    17 * Version       : SIP/3.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 
       
    29 #ifndef __COMPRESSINGLOGIC_H__
       
    30 #define __COMPRESSINGLOGIC_H__
       
    31 #include <e32base.h>
       
    32 #include <in_sock.h>
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CSIPResponse;
       
    36 class CSIPRequest;
       
    37 class CSIPMessage;
       
    38 class CSIPURI;
       
    39 class MSigCompOwner;
       
    40 class CSIPViaHeader;
       
    41 class TSIPTransportParams;
       
    42 
       
    43 // CLASS DEFINITION
       
    44 class CSigCompCompressingLogic : public CBase
       
    45 	{
       
    46 public: // Constructors and destructor
       
    47 
       
    48 	static CSigCompCompressingLogic* NewL( MSigCompOwner& aSigCompOwner );
       
    49 	static CSigCompCompressingLogic* NewLC( MSigCompOwner& aSigCompOwner );
       
    50 	
       
    51 	~CSigCompCompressingLogic();
       
    52 
       
    53 public:
       
    54 
       
    55 	CBufBase* EncodeL( const TSIPTransportParams& aTransportParams,
       
    56 	                   CSIPResponse& aResponse,
       
    57                        const TInetAddr& aAddress,
       
    58                        TBool aStreambasedProtocol, 
       
    59                        TBool& aCompressed );
       
    60 	
       
    61 	CBufBase* EncodeL( const TSIPTransportParams& aTransportParams,
       
    62 	                   CSIPRequest& aRequest,
       
    63                        const TInetAddr& aAddress,
       
    64                        TBool aStreambasedProtocol, 
       
    65                        TBool& aCompressed );
       
    66 	
       
    67 
       
    68 private:
       
    69 
       
    70 	CSigCompCompressingLogic( MSigCompOwner& aSigCompOwner );
       
    71 
       
    72 	TBool CompInVia( CSIPMessage& aMessage );
       
    73 	void SetCompToTopViaL( CSIPMessage& aMessage );
       
    74 	void DeleteCompFromTopVia( CSIPMessage& aMessage );
       
    75 	CSIPViaHeader* TopViaHeader( CSIPMessage& aMessage );
       
    76 	
       
    77 	TBool HasSigCompParam( CSIPURI& aURI ) const;
       
    78 	TBool ShouldBeCompressL( const TSIPTransportParams& aTransportParams,
       
    79 	                         CSIPRequest& aRequest );
       
    80 	TBool ShouldBeCompressL( CSIPResponse& aResponse );
       
    81 	void AddSigCompToContactsL( CSIPMessage& aMessage );
       
    82 	void SetCompEqualSigCompL( CSIPURI& aURI );
       
    83 	void RemoveCompEqualSigComp( CSIPURI& aURI );
       
    84 	CSIPURI* SigCompUriFromRequest( CSIPRequest& aRequest );
       
    85 	
       
    86 private: // Data
       
    87 
       
    88 	MSigCompOwner& iSigCompOwner;
       
    89 	
       
    90 	};
       
    91 
       
    92 
       
    93 
       
    94 #endif // end of __COMPRESSINGLOGIC_H__
       
    95 
       
    96 // End of File