linklayerprotocols/pppnif/INC/vjcomp.inl
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #if !defined(__VJCOMP_INL_)
       
    17 #define __VJCOMP_INL_
       
    18 
       
    19 /**
       
    20 Tests if the delta value is compressible into the 16 bit VJ delta format.
       
    21 The aDelta value actually needs a 33 bit signed integer to hold the entire
       
    22 possible range, but the twos complement math works out if it's just
       
    23 stored as a 32 bit unsigned integer.
       
    24 
       
    25 @param aDelta Delta value to test
       
    26 
       
    27 @return ETrue if the value is compressible
       
    28 */
       
    29 inline TBool CVJCompressor::IsDeltaCompressible(TUint32 aDelta) const
       
    30 	{
       
    31 	// This test is a faster equivalent to:
       
    32 	//    (aDelta >= 0) && (aDelta <= 0xffff)
       
    33 	// if aDelta were signed
       
    34 	return !(aDelta & 0xffff0000);
       
    35 	}
       
    36 
       
    37 
       
    38 inline TUint8* CVJCompressor::GetTCPOpts(ThdrTCP* aTCPHeader) const
       
    39 /**
       
    40 Returns a pointer to the start of the TCP options (if there are any).
       
    41 
       
    42 @param aTCPHeader TCP header
       
    43 
       
    44 @return Start of the TCP options
       
    45 */
       
    46 	{
       
    47 	TUint8* aPtr = (TUint8*)aTCPHeader+KTCPHeaderSize;
       
    48 	return aPtr;
       
    49 	}
       
    50 
       
    51 
       
    52 
       
    53 #endif // __VJCOMP_INL_
       
    54