RMBufHookPacket Class Reference

class RMBufHookPacket

Extends the received packet buffer class for hook processing.

The extension provides a packet context (MPacketContext) for the duration of the hook processing.

This extension has been created to solve the following problem:

  1. The default option header handlers need to return ICMP error message on some unimplemented options,

  2. The basic design idea of the stack is that functionality can be dynamically added. Thus, if a dynamically loaded module adds support for some new option type, the default handler should not report error for such options.

The rules of the context use are:

  1. While the incoming packet is processed with hooks, the IP layer maintains a packet specific context, which can store values (32 bits) associated with a key (32 bits).

  2. The low 8 bits of the key is defined to be the protocol number of the header, and interpretation of the rest of the key bits is up to protocol/header specific definitions.

  3. For destination and hop by hop headers, to solve the problem, the additional specification is used: the default handlers will look a value from packet context with the following key:
    • (optiontype << 8) | (protocol)

    and if the returned value is non-ZERO, the default handler will assume someone implemented the option in question and does not generate an error.
Note:

The packet context is only available during "hook processing". It is not available for upper layer prototocols!

Since
v7.0
Public Member Functions
RMBufHookPacket(MPacketContext *const )
TInt HookValue(const TUint32)
TInt SetHookValue(const TUint32, const TUint32)
Private Attributes
MPacketContext *constiContext

Constructor & Destructor Documentation

RMBufHookPacket(MPacketContext *const)

RMBufHookPacket(MPacketContext *const aContext)[inline]

Constructor

Parameters

MPacketContext *const aContextPacket context

Member Functions Documentation

HookValue(const TUint32)

TInt HookValue(const TUint32aId)const [inline]

Gets the value associated with the specified key.

Note: There is no way to distinquish between 'no stored value' and 'stored value = 0'.

Parameters

const TUint32 aIdKey

SetHookValue(const TUint32, const TUint32)

TInt SetHookValue(const TUint32aId,
const TUint32aValue
)[inline]

Sets a (key,value) pair.

If a setting already exists for the key, the value is just replaced.

Parameters

const TUint32 aIdKey
const TUint32 aValueValue associated with the key

Member Data Documentation

MPacketContext *const iContext

MPacketContext *constiContext[private]