CVJDeCompressor Class Reference

class CVJDeCompressor : public CVJDeCompressorIf

Van Jacobson TCP/IP header decompressor (RFC 1144)

Inherits from

Public Member Functions
CVJDeCompressor ()
~CVJDeCompressor ()
void CRCError ()
void ConstructL ( CVJCompFactory *, TUint )
TBool DecompVJComp ( RMBufChain &)
TBool DecompVJUncomp ( RMBufChain &)
Private Member Functions
TBool CheckStoredRxHeader (const TUint )
void ClearFlag (const TUint )
void CopyInNewHeaderL ( RMBufChain *, ThdrIP *, ThdrTCP *, TUint , TUint16 , TUint16 )
void CopyRecvHeader (const TUint , ThdrIP *)
TUint16 DecodeDelta ( TUint8 **)
void DecompAck ( TUint8 **, ThdrTCP *)
void DecompIPId (const TUint , TUint8 **, ThdrIP *)
void DecompPushFlag (const TUint , ThdrTCP *)
void DecompSWAU (const TUint , TUint8 **, ThdrTCP *, TUint16 )
void DecompSeq ( TUint8 **, ThdrTCP *)
void DecompUrgent ( TUint8 **, ThdrTCP *, TUint )
void DecompWindow ( TUint8 **, ThdrTCP *)
void DecompressFrameL ( RMBufChain &, TUint8 , TUint8 , TUint8 *const , TUint , TUint16 )
void DoIPChecksum ( ThdrIP *, TUint16 )
void EncodeDelta ( TUint8 **, TUint16 )
ThdrIP * GetIPHeader ( RMBufChain &)
void GetStoredRxHeader (const TUint , ThdrIP *, ThdrTCP *)
TUint8 * GetVJPtr ( RMBufChain &, TUint16 *)
void SetFlag (const TUint )
TBool TestFlag (const TUint )
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CObject::AccessCount()const
CObject::CObject()
CObject::Close()
CObject::Dec()
CObject::Extension_(TUint,TAny *&,TAny *)
CObject::FullName()const
CObject::Inc()
CObject::Name()const
CObject::Open()
CObject::Owner()const
CObject::SetName(const TDesC *)
CObject::SetNameL(const TDesC *)
CObject::SetOwner(CObject *)
CObject::UniqueID()const
CObject::~CObject()
CVJDeCompressorIf::CVJDeCompressorIf()
CVJDeCompressorIf::~CVJDeCompressorIf()
Private Attributes
TUint iFlags
TUint iLastRxConn
TUint iNumVJSlots
TVJCompHdr * iRxStates
Inherited Attributes
CVJDeCompressorIf::iFactory

Constructor & Destructor Documentation

CVJDeCompressor()

CVJDeCompressor ( )

~CVJDeCompressor()

~CVJDeCompressor ( )

Member Functions Documentation

CRCError()

void CRCError ( ) [virtual]

Sets the discard flag after receiving a bad frame so that future decompressed packets don't get out of sync.

CheckStoredRxHeader(const TUint)

TBool CheckStoredRxHeader ( const TUint aConnection ) const [private]

Checks if the given VJ connection number has previously been filled in.

Parameters

const TUint aConnection Valid VJ connection number to check

ClearFlag(const TUint)

void ClearFlag ( const TUint aFlag ) [private, inline]

Clear an internal flag.

Parameters

const TUint aFlag Flag value to clear

ConstructL(CVJCompFactory *, TUint)

void ConstructL ( CVJCompFactory * aFactory,
TUint aSlots
)

Construct the CVJDeCompressor object.

Parameters

CVJCompFactory * aFactory Factory that created this object
TUint aSlots Value of the highest VJ connection number to be received

CopyInNewHeaderL(RMBufChain *, ThdrIP *, ThdrTCP *, TUint, TUint16, TUint16)

void CopyInNewHeaderL ( RMBufChain * aPacket,
ThdrIP * aIPHeader,
ThdrTCP * aTCPHeader,
TUint aCompressedHeaderLength,
TUint16 aIPHeaderLength,
TUint16 aTCPHeaderLength
) [private]

Copy the uncompressed header into the proper location in the packet.

Parameters

RMBufChain * aPacket MBuf chain containing packet to be updated
ThdrIP * aIPHeader IP packet header
ThdrTCP * aTCPHeader TCP header
TUint aCompressedHeaderLength Length of VJ compression header
TUint16 aIPHeaderLength Length of IP header
TUint16 aTCPHeaderLength Length of TCP header

CopyRecvHeader(const TUint, ThdrIP *)

void CopyRecvHeader ( const TUint aConnectionNumber,
ThdrIP * aHeader
) [private]

Caches a TCP/IP Header to be used as a reference to reconstruct future compressed headers.

Parameters

const TUint aConnectionNumber Valid VJ connection number
ThdrIP * aHeader TCP/IP header

DecodeDelta(TUint8 **)

TUint16 DecodeDelta ( TUint8 ** aVJCompHeader ) [private]

Decodes a compressed delta value.

Parameters

TUint8 ** aVJCompHeader Pointer to pointer into VJ header buffer holding encoded value; returns with pointer incremented one past end of value

DecompAck(TUint8 **, ThdrTCP *)

void DecompAck ( TUint8 ** aVJCompHeader,
ThdrTCP * aTCPHeader
) [private]

Decompresses the Acknowledgement Number field.

Parameters

TUint8 ** aVJCompHeader Pointer to the pointer to the VJ compressed header
ThdrTCP * aTCPHeader TCP header to be updated

DecompIPId(const TUint, TUint8 **, ThdrIP *)

void DecompIPId ( const TUint aChanges,
TUint8 ** aVJCompHeader,
ThdrIP * aIPHeader
) [private]

Decompresses the IP Identification field.

Parameters

const TUint aChanges The VJ change mask
TUint8 ** aVJCompHeader Pointer to the pointer to the VJ compressed header
ThdrIP * aIPHeader IP packet header to be updated

DecompPushFlag(const TUint, ThdrTCP *)

void DecompPushFlag ( const TUint aChanges,
ThdrTCP * aHeader
) [private]

Decompresses the Push flag.

Parameters

const TUint aChanges The VJ change mask
ThdrTCP * aHeader TCP header to be updated

DecompSWAU(const TUint, TUint8 **, ThdrTCP *, TUint16)

void DecompSWAU ( const TUint aChanges,
TUint8 ** aVJCompHeader,
ThdrTCP * aTCPHeader,
TUint16 aPreviousFrameLength
) [private]

Decompresses the special case SWAU type packet.

Parameters

const TUint aChanges The VJ change mask
TUint8 ** aVJCompHeader Pointer to the pointer to the VJ compressed header
ThdrTCP * aTCPHeader TCP header to be updated
TUint16 aPreviousFrameLength Length of cached packet for this VJ connection

DecompSeq(TUint8 **, ThdrTCP *)

void DecompSeq ( TUint8 ** aVJCompHeader,
ThdrTCP * aTCPHeader
) [private]

Decompresses the Sequence Number field.

Parameters

TUint8 ** aVJCompHeader Pointer to the pointer to the VJ compressed header
ThdrTCP * aTCPHeader TCP header to be updated

DecompUrgent(TUint8 **, ThdrTCP *, TUint)

void DecompUrgent ( TUint8 ** aVJCompHeader,
ThdrTCP * aTCPHeader,
TUint aChanges
) [private]

Decompresses the Urgent field.

Parameters

TUint8 ** aVJCompHeader Pointer to the pointer to the VJ compressed header
ThdrTCP * aTCPHeader TCP header to be updated
TUint aChanges The VJ change mask

DecompVJComp(RMBufChain &)

TBool DecompVJComp ( RMBufChain & aPacket ) [virtual]

Decompresses a VJ compressed packet in place.

DecompVJUncomp

Parameters

RMBufChain & aPacket MBuf chain containing packet

DecompVJUncomp(RMBufChain &)

TBool DecompVJUncomp ( RMBufChain & aPacket ) [virtual]

Handles a VJ uncompressed packet. Stores the packet header in the appropriate VJ connection slot.

DecompVJComp

Parameters

RMBufChain & aPacket MBuf chain containing packet

DecompWindow(TUint8 **, ThdrTCP *)

void DecompWindow ( TUint8 ** aVJCompHeader,
ThdrTCP * aTCPHeader
) [private]

Decompresses the Window field.

Parameters

TUint8 ** aVJCompHeader Pointer to the pointer to the VJ compressed header
ThdrTCP * aTCPHeader TCP header to be updated

DecompressFrameL(RMBufChain &, TUint8, TUint8, TUint8 *const, TUint, TUint16)

void DecompressFrameL ( RMBufChain & aPacket,
TUint8 aConnection,
TUint8 aChanges,
TUint8 *const aInitialHeaderPtr,
TUint Offset,
TUint16 aCurrentFrameLength
) [private]

Uncompresses a VJ compressed TCP/IP header.

leave
KErrCorrupt if aPacket is corrupt

Parameters

RMBufChain & aPacket MBuf chain containing packet to be updated
TUint8 aConnection VJ connection number
TUint8 aChanges The VJ change mask
TUint8 *const aInitialHeaderPtr Beginning of the compressed VJ header
TUint Offset Offset from start of packet to TCP checksum field
TUint16 aCurrentFrameLength Length of the compressed packet

DoIPChecksum(ThdrIP *, TUint16)

void DoIPChecksum ( ThdrIP * aIPHeader,
TUint16 aIPHeaderLength
) [private]

Calculate the IP checksum and store it in the given IP packet header. See RFC 1071.

Parameters

ThdrIP * aIPHeader IP packet header
TUint16 aIPHeaderLength Length of IP header in bytes (must be even)

EncodeDelta(TUint8 **, TUint16)

void EncodeDelta ( TUint8 ** aVJCompHeader,
TUint16 aValue
) [private]

Parameters

TUint8 ** aVJCompHeader
TUint16 aValue

GetIPHeader(RMBufChain &)

ThdrIP * GetIPHeader ( RMBufChain & aChain ) [private]

Extracts the IP Header from the packet even though there is a buffer of Info on the front. This is used in VJ, to avoid the awful hack in the main receive path. PRR 20-11-97

Parameters

RMBufChain & aChain MBuf chain containing packet

GetStoredRxHeader(const TUint, ThdrIP *, ThdrTCP *)

void GetStoredRxHeader ( const TUint aConnectionNumber,
ThdrIP * aIPHeader,
ThdrTCP * aTCPHeader
) [private]

Retrieves a packet header from the VJ connection cache.

Parameters

const TUint aConnectionNumber Valid VJ connection number to retrieve
ThdrIP * aIPHeader IP packet header
ThdrTCP * aTCPHeader TCP header

GetVJPtr(RMBufChain &, TUint16 *)

TUint8 * GetVJPtr ( RMBufChain & aChain,
TUint16 * aCurrentFrameLength
) [private]

Gets a pointer to the VJ Header even though there is a pseudo (Adam) buffer of Info on the front.

Parameters

RMBufChain & aChain MBuf chain containing packet
TUint16 * aCurrentFrameLength Returns the length of the packet

SetFlag(const TUint)

void SetFlag ( const TUint aFlag ) [private, inline]

Set an internal flag.

Parameters

const TUint aFlag Flag value to set

TestFlag(const TUint)

TBool TestFlag ( const TUint aFlag ) [private, inline]

Test if an internal flag is set.

Parameters

const TUint aFlag Flag value to test

Member Data Documentation

TUint iFlags

TUint iFlags [private]

Set to KVJDiscard while discarding received packets due to lost synchronization

TUint iLastRxConn

TUint iLastRxConn [private]

VJ connection number of the last valid packet received

TUint iNumVJSlots

TUint iNumVJSlots [private]

Index of the highest-numbered VJ connection

TVJCompHdr * iRxStates

TVJCompHdr * iRxStates [private]

Pointer to start of array of VJ connections