vpnengine/ikeutils/src/ikesendqueueitem.cpp
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 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:  IKE send queue item
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "ikesendqueueitem.h"
       
    21 
       
    22 // ======== MEMBER FUNCTIONS ========
       
    23 
       
    24 // ---------------------------------------------------------------------------
       
    25 // Constructor
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 EXPORT_C TIkeSendQueueItem::TIkeSendQueueItem( HBufC8* aUdpData, 
       
    29                                                const TInetAddr& aDestAddr, 
       
    30                                                TInt aLocalPort,
       
    31                                                TUint8 aDscp )
       
    32  :  iUdpData( aUdpData ),
       
    33     iDestAddr( aDestAddr ),
       
    34     iLocalPort( aLocalPort ),
       
    35     iDscp( aDscp )
       
    36     {
       
    37     }
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 // Constructor with message identification parameter. Constructs object
       
    41 // which should be used for matching with Match() method.
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 EXPORT_C TIkeSendQueueItem::TIkeSendQueueItem( HBufC8* aUdpData )
       
    45  :  iUdpData( aUdpData ),
       
    46     iDestAddr( TInetAddr() ),
       
    47     iLocalPort( 0 ),
       
    48     iDscp( 0 )
       
    49     {    
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // Determines whether two objects match.
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 EXPORT_C TBool TIkeSendQueueItem::Match( const TIkeSendQueueItem& aItemOne,
       
    57                                          const TIkeSendQueueItem& aItemTwo )
       
    58 	{
       
    59 	if ( aItemOne.iUdpData == aItemTwo.iUdpData )
       
    60 		{
       
    61 		return ETrue;
       
    62 		}
       
    63 	return EFalse;
       
    64 	}
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // Gets UDP data.
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 EXPORT_C HBufC8* TIkeSendQueueItem::UdpData()
       
    71     {
       
    72     return iUdpData;
       
    73     }       
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // Gets destination IP address.
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 EXPORT_C const TInetAddr& TIkeSendQueueItem::DestAddr()
       
    80     {
       
    81     return iDestAddr;
       
    82     }                                
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // Gets local port.
       
    86 // ---------------------------------------------------------------------------
       
    87 //
       
    88 EXPORT_C TInt TIkeSendQueueItem::LocalPort() const
       
    89     {
       
    90     return iLocalPort;
       
    91     }    
       
    92 
       
    93 // ---------------------------------------------------------------------------
       
    94 // Gets DSCP value.
       
    95 // ---------------------------------------------------------------------------
       
    96 //
       
    97 EXPORT_C TUint8 TIkeSendQueueItem::Dscp() const
       
    98     {
       
    99     return iDscp;
       
   100     }