1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/networking/vjcomp.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,53 @@
1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#if !defined(__VJCOMP_INL_)
1.20 +#define __VJCOMP_INL_
1.21 +
1.22 +/**
1.23 +Tests if the delta value is compressible into the 16 bit VJ delta format.
1.24 +The aDelta value actually needs a 33 bit signed integer to hold the entire
1.25 +possible range, but the twos complement math works out if it's just
1.26 +stored as a 32 bit unsigned integer.
1.27 +
1.28 +@param aDelta Delta value to test
1.29 +
1.30 +@return ETrue if the value is compressible
1.31 +*/
1.32 +inline TBool CVJCompressor::IsDeltaCompressible(TUint32 aDelta) const
1.33 + {
1.34 + // This test is a faster equivalent to:
1.35 + // (aDelta >= 0) && (aDelta <= 0xffff)
1.36 + // if aDelta were signed
1.37 + return !(aDelta & 0xffff0000);
1.38 + }
1.39 +
1.40 +
1.41 +inline TUint8* CVJCompressor::GetTCPOpts(ThdrTCP* aTCPHeader) const
1.42 +/**
1.43 +Returns a pointer to the start of the TCP options (if there are any).
1.44 +
1.45 +@param aTCPHeader TCP header
1.46 +
1.47 +@return Start of the TCP options
1.48 +*/
1.49 + {
1.50 + TUint8* aPtr = (TUint8*)aTCPHeader+KTCPHeaderSize;
1.51 + return aPtr;
1.52 + }
1.53 +
1.54 +
1.55 +
1.56 +#endif // __VJCOMP_INL_