CVJCompressor Class Reference
class CVJCompressor : public CVJCompressorIf |
Van Jacobson TCP/IP header compressor (RFC 1144)
Private Member Functions |
---|
TBool
| CompressAck(TUint8 **, TUint8 *, ThdrTCP *, ThdrTCP *) |
TBool
| CompressFrame(RMBufChain &, ThdrIP *, ThdrTCP *, TUint, ThdrIP *, ThdrTCP *) |
TBool
| CompressIPId(TUint8 **, TUint8 *, ThdrIP *, ThdrIP *) |
TBool
| CompressPush(TUint8 *, ThdrTCP *) |
TBool
| CompressSeq(TUint8 **, TUint8 *, ThdrTCP *, ThdrTCP *) |
TBool
| CompressSpecialCases(TUint8 **, TUint8 *const , TUint8 *, ThdrTCP *, ThdrTCP *, ThdrIP *, ThdrIP *) |
TBool
| CompressUrgentPtr(TUint8 **, TUint8 *, ThdrTCP *, ThdrTCP *) |
TBool
| CompressWindow(TUint8 **, TUint8 *, ThdrTCP *, ThdrTCP *) |
void | ConvertFrameToUncompVJ(ThdrIP *, TUint) |
void | CopyInNewTxHeader(RMBufChain &, TUint8 *, TUint, TUint) |
void | CopyTxHeader(ThdrIP *, TUint) |
void | DecrementPacketLen(RMBufChain &, TUint) |
void | EncodeDelta(TUint8 **, TInt16) |
ThdrIP * | GetIPHeader(RMBufChain &) |
TBool
| GetStoredTxHeader(TUint *, ThdrIP *, ThdrTCP *, ThdrIP *, ThdrTCP *) |
TUint8 * | GetTCPOpts(ThdrTCP *) |
TBool
| IPAddressesMatch(ThdrIP *, ThdrIP *) |
TBool
| IsDeltaCompressible(TUint32) |
TBool
| IsIPCompressible(ThdrIP *, ThdrIP *) |
TBool
| IsSameConnAsLast(TUint *, TUint) |
TBool
| IsTCPCompressible(ThdrTCP *, ThdrTCP *) |
TBool
| SendAsRawIP(ThdrIP *, ThdrTCP *) |
void | SetFirstFewBytes(TUint8 *, TBool, TUint8 **, ThdrTCP *, TUint) |
TBool
| SuitableForVJCompression(ThdrIP *, ThdrTCP *, TUint *, ThdrIP *, ThdrTCP *) |
TBool
| TCPPortsMatch(ThdrTCP *, ThdrTCP *) |
Constructor & Destructor Documentation
Member Functions Documentation
CompressAck(TUint8 **, TUint8 *, ThdrTCP *, ThdrTCP *)
Compresses the TCP Acknowledgement Number field.
Parameters
TUint8 ** aVJPtr | Pointer to the pointer within the VJ header to be modified; returns pointing one past the last header location used |
TUint8 * aChanges | The VJ change mask to be updated |
ThdrTCP * aTCPHeader | TCP header |
ThdrTCP * aRetrievedTCPHdr | Cached TCP header from which to make a delta for aTCPHeader |
CompressFrame(RMBufChain &, ThdrIP *, ThdrTCP *, TUint, ThdrIP *, ThdrTCP *)
Compresses a TCP/IP header if possible.
Parameters
RMBufChain & aPacket | MBuf chain containing packet |
ThdrIP * aIPHeader | IP header |
ThdrTCP * aTCPHeader | TCP header |
TUint aConnection | VJ connection number |
ThdrIP * aRetrievedIPHdr | Cached IP packet header |
ThdrTCP * aRetrievedTCPHdr | Cached TCP packet header |
CompressIPId(TUint8 **, TUint8 *, ThdrIP *, ThdrIP *)
Compresses the IP Packet ID field.
Parameters
TUint8 ** aVJPtr | Pointer to the pointer within the VJ header to be modified; returns pointing one past the last header location used |
TUint8 * aChanges | The VJ change mask to be updated |
ThdrIP * aIPHeader | IP header |
ThdrIP * aRetrievedIPHdr | Cached IP header from which to make a delta for aIPHeader |
CompressPush(TUint8 *, ThdrTCP *)
Compresses the TCP Push flag.
Parameters
TUint8 * aChanges | The VJ change mask to be updated |
ThdrTCP * aTCPHeader | TCP header |
CompressSeq(TUint8 **, TUint8 *, ThdrTCP *, ThdrTCP *)
Compresses the TCP Sequence Number field.
Parameters
TUint8 ** aVJPtr | Pointer to the pointer within the VJ header to be modified; returns pointing one past the last header location used |
TUint8 * aChanges | The VJ change mask to be updated |
ThdrTCP * aTCPHeader | TCP header |
ThdrTCP * aRetrievedTCPHdr | Cached TCP header from which to make a delta for aTCPHeader |
CompressSpecialCases(TUint8 **, TUint8 *const, TUint8 *, ThdrTCP *, ThdrTCP *, ThdrIP *, ThdrIP *)
Compresses special case TCP/IP packets. See RFC 1144 sec. 3.2.3
- Pre-condition
- aChanges must reflect the compressed header except for the KVjCompMaskPush and KVjCompMaskIp bits which must be clear.
Parameters
TUint8 ** aVJPtr | Pointer to the pointer within the VJ header to be modified; returns pointing one past the last header location used |
TUint8 *const aVJInitialDeltaPtr | Beginning of the compressed VJ header |
TUint8 * aChanges | The VJ change mask to be updated |
ThdrTCP * aTCPHeader | TCP header |
ThdrTCP * aRetrievedTCPHdr | Cached TCP header from which to make a delta for aTCPHeader |
ThdrIP * aIPHeader | IP header |
ThdrIP * aRetrievedIPHdr | Cached IP header from which to make a delta for aIPHeader |
CompressUrgentPtr(TUint8 **, TUint8 *, ThdrTCP *, ThdrTCP *)
Compresses the TCP Urgent pointer field.
Parameters
TUint8 ** aVJPtr | Pointer to the pointer within the VJ header to be modified; returns pointing one past the last header location used |
TUint8 * aChanges | The VJ change mask to be updated |
ThdrTCP * aTCPHeader | TCP header |
ThdrTCP * aRetrievedTCPHdr | Cached TCP header from which to make a delta for aTCPHeader |
CompressWindow(TUint8 **, TUint8 *, ThdrTCP *, ThdrTCP *)
Compresses the TCP Window field.
Parameters
TUint8 ** aVJPtr | Pointer to the pointer within the VJ header to be modified; returns pointing one past the last header location used |
TUint8 * aChanges | The VJ change mask to be updated |
ThdrTCP * aTCPHeader | TCP header |
ThdrTCP * aRetrievedTCPHdr | Cached TCP header from which to make a delta for aTCPHeader |
ConstructL(CVJCompFactory *, TUint, TBool)
Parameters
CVJCompFactory * aFactory | Factory that created this object |
TUint aMaxSlot | Value of the highest VJ connection number to be sent |
TBool aCompressConnId | Whether to compress the connection number |
ConvertFrameToUncompVJ(ThdrIP *, TUint)
void | ConvertFrameToUncompVJ | ( | ThdrIP * | aIPHeader, |
| TUint | aConnection |
| ) | [private] |
The frame is to be sent as an Uncompressed VJ frame, so set the connection number in place of the protocol type, and save the header.
Parameters
ThdrIP * aIPHeader | TCP/IP header |
TUint aConnection | VJ connection number |
CopyInNewTxHeader(RMBufChain &, TUint8 *, TUint, TUint)
Copies the compressed header into the packet.
Parameters
RMBufChain & aPacket | MBuf chain containing packet |
TUint8 * aCompressedHdr | VJ compressed header |
TUint aOldHeaderLength | Length of the current TCP/IP header in aPacket |
TUint aNewHeaderLength | Length of VJ compressed header |
CopyTxHeader(ThdrIP *, TUint)
void | CopyTxHeader | ( | ThdrIP * | aIPHeader, |
| TUint | aConnection |
| ) | [private] |
Copies the given TCP/IP header into the storage slot for the given connection number.
Parameters
ThdrIP * aIPHeader | TCP/IP header |
TUint aConnection | VJ connection number |
DecrementPacketLen(RMBufChain &, TUint)
There is a header prepended to the frame, one element is the length which has now changed, so change it
Parameters
RMBufChain & aPacket | MBuf chain containing packet |
TUint SizeDecrease | Amount by which to reduce the length metadata |
EncodeDelta(TUint8 **, TInt16)
void | EncodeDelta | ( | TUint8 ** | aVJCompHeader, |
| TInt16 | aValue |
| ) | [private] |
Encodes a delta value in VJ compressed format.
Parameters
TUint8 ** aVJCompHeader | Pointer to pointer into VJ header buffer to store encoded value; returns with pointer incremented one past end of value |
TInt16 aValue | Value to store |
GetIPHeader(RMBufChain &)
Get the IP Header 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
GetStoredTxHeader(TUint *, ThdrIP *, ThdrTCP *, ThdrIP *, ThdrTCP *)
Retrieves a packet header from the VJ connection cache. The packet must match on the IP source and destination address and on the TCP source and destination port numbers.
Parameters
TUint * aConnection | Returns the matching VJ connection number |
ThdrIP * aIPHeader | IP packet header |
ThdrTCP * aTCPHeader | TCP header |
ThdrIP * aRetrievedIPHdr | Returns the cached IP packet header |
ThdrTCP * aRetrievedTCPHdr | Returns the cached TCP packet header |
GetTCPOpts(ThdrTCP *)
Returns a pointer to the start of the TCP options (if there are any).
IPAddressesMatch(ThdrIP *, ThdrIP *)
Compares the addresses in two IP headers.
Parameters
ThdrIP * aIPHeader | First IP header |
ThdrIP * aNotherIPHdr | Second IP header |
IsDeltaCompressible(TUint32)
TBool
| IsDeltaCompressible | ( | TUint32 | aDelta | ) | const [private, inline] |
Tests if the delta value is compressible into the 16 bit VJ delta format. The aDelta value actually needs a 33 bit signed integer to hold the entire possible range, but the twos complement math works out if it's just stored as a 32 bit unsigned integer.
IsIPCompressible(ThdrIP *, ThdrIP *)
Compares two IP headers to see if the seldom-changing fields match.
Parameters
ThdrIP * aIPHeader | First IP packet header |
ThdrIP * aRetrievedIPHdr | Second IP packet header |
IsSameConnAsLast(TUint *, TUint)
TBool
| IsSameConnAsLast | ( | TUint * | aCompressedHdrLen, |
| TUint | aConnection |
| ) | [private] |
Determines whether the given VJ connection number is the same as that of the last compressed packet sent and returns the size of the compressed header.
Parameters
TUint * aCompressedHdrLen | Returns the length of the compressed header |
TUint aConnection | VJ connection number |
IsTCPCompressible(ThdrTCP *, ThdrTCP *)
Compares two TCP headers to see if the options, ECN & reserved bits match. Everything else in the TCP header is handled specially by the VJ compression algorithm.
Parameters
ThdrTCP * aTCPHeader | First TCP header |
ThdrTCP * aRetrievedTCPHdr | Second TCP header |
SendAsRawIP(ThdrIP *, ThdrTCP *)
Determines if the packet must bypass VJ compression altogether. This happens with fragmented IP packets and certain TCP flags.
Parameters
ThdrIP * aIPHeader | First IP packet header |
ThdrTCP * aTCPHeader | TCP header |
SetFirstFewBytes(TUint8 *, TBool, TUint8 **, ThdrTCP *, TUint)
Sets the change mask, connection number (if necessary) and TCP checksum bytes in the VJ compressed header.
Parameters
TUint8 * aChanges | The VJ change mask to be copied and potentially modified |
TBool aNewConnection | Whether this is a new connection, requiring the number in the header |
TUint8 ** aVJHeader | Pointer to the pointer to the VJ header to be modified |
ThdrTCP * aTCPHeader | TCP header |
TUint aConnection | VJ connection number |
SuitableForVJCompression(ThdrIP *, ThdrTCP *, TUint *, ThdrIP *, ThdrTCP *)
Sees if a packet header is stored in the VJ connection cache.
Parameters
ThdrIP * aIPHeader | IP packet header |
ThdrTCP * aTCPHeader | TCP header |
TUint * aConnection | Returns the matching VJ connection number |
ThdrIP * aRetrievedIPHdr | Returns the cached IP packet header |
ThdrTCP * aRetrievedTCPHdr | Returns the cached TCP packet header |
TCPPortsMatch(ThdrTCP *, ThdrTCP *)
Compares the TCP port numbers TCP headers.
Parameters
ThdrTCP * aHeader | First TCP header |
ThdrTCP * aNotherHdr | Second TCP header |
VJCompressFrame(RMBufChain &)
Takes a packet and transforms it for sending. It may end up VJ compressed, VJ uncompressed or untouched.
Member Data Documentation
TBool
iCompressConnId
TBool
| iCompressConnId | [private] |
Whether VJ was configured to compress the connection number
TUint
iLastTxConn
TUint
| iLastTxConn | [private] |
Connection number of the last packet compressed
TVJCompHdr * iLastTxHdr
Pointer to the last element in the LRU circular list
TUint
iMaxVJSlots
TUint
| iMaxVJSlots | [private] |
Maximum number of VJ connections
TVJCompHdr * iTxStates
Pointer to start of array of VJ connections
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.