rtp/srtpstack/inc/srtppacketrtcp.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004 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:    SRTP packet class (RTCP)
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __SRTP_PACKET_RTCP_H__
       
    22 #define __SRTP_PACKET_RTCP_H__
       
    23 
       
    24 // INCLUDES
       
    25 #include <in_sock.h>
       
    26 #include "srtppacket.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CSRTPCryptoHandler;
       
    30 
       
    31 /**
       
    32 * Contains general RTCP-specific packet routines
       
    33 */
       
    34 class CSRTPPacketRTCP : public CSRTPPacket
       
    35     {
       
    36     public:
       
    37     	static CSRTPPacketRTCP* NewL(const TDesC8& aPacket,
       
    38                       CSRTPCryptoHandler& aHandler);
       
    39                               
       
    40         /**
       
    41         * Create encrypted packet.
       
    42         * @param aEncryptedPayloadPtr  encrypted payload to be copied
       
    43         * @leave KErrNone if success, system-wide error code otherwise        
       
    44         * @return HBufC8* encrypted packet
       
    45         */                              
       
    46         HBufC8* CreateEncryptedPacketL(TUint8* aEncryptedPayloadPtr);
       
    47         
       
    48         /**
       
    49         * virtual function for creating decrypted packet.
       
    50         * @param aDecryptedPayloadPtr  decrypted payload to be copied
       
    51         * @leave KErrNone if success, system-wide error code otherwise        
       
    52         * @return HBufC8* decrypted packet
       
    53         * implemented in CSRTPPacketSRTCP.
       
    54         */                              
       
    55         virtual HBufC8* CreateDecryptedPacketL(TUint8* aDecryptedPayloadPtr);
       
    56         
       
    57         /**
       
    58         * virtual function for getting the authentication tag
       
    59         * implemented in CSRTPPacketSRTCP.
       
    60         */                                      
       
    61         virtual TPtrC8 AuthenticationTag();
       
    62         
       
    63         /**
       
    64         * virtual function for getting the master key identifier
       
    65         * implemented in CSRTPPacketSRTP.
       
    66         */                              
       
    67         virtual TPtrC8 MasterKeyIdentifier();
       
    68         /**
       
    69         * Get packet index.
       
    70         * @return TUint64 packet index.
       
    71         */                              
       
    72         TUint64 PacketIndex();
       
    73         
       
    74        /**
       
    75         * Set packet index.
       
    76         * @param aPacketIndex  new packet index
       
    77         * @return void
       
    78         */                              
       
    79         void SetPacketIndex(TUint64 aPacketIndex);
       
    80         
       
    81 		/*
       
    82         * Update header length member
       
    83         * @leave KErrNone if success, system-wide error code otherwise        
       
    84         * @return void
       
    85         */
       
    86         void UpdateHeaderLengthL();        
       
    87                 
       
    88     protected: //methods        
       
    89         CSRTPPacketRTCP (const TDesC8& aPacket,
       
    90                       CSRTPCryptoHandler& aHandler);
       
    91         ~CSRTPPacketRTCP(); 
       
    92 
       
    93         /**
       
    94         * Update payload length information
       
    95         * @return void
       
    96         */                              
       
    97         void UpdatePayloadLength();
       
    98         void ConstructL();     
       
    99                 
       
   100     private: //methods
       
   101 
       
   102        /**
       
   103         * Count size of the encrypted packet
       
   104         * @return TUint size of the encrypted packet
       
   105         */                                  
       
   106         TUint CountEncryptedPacketSizeL();        
       
   107 
       
   108        /**
       
   109         * Count size of the decrypted packet
       
   110         * @return TUint size of the decrypted packet
       
   111         */                              
       
   112         TUint CountDecryptedPacketSize();                
       
   113             
       
   114     protected: //data    
       
   115         TUint32                     iPacketIndex;       // packet index                      
       
   116     };
       
   117 
       
   118 #endif // __SRTP_PACKET_RTCP_H__
       
   119