MFlowHook Class Reference

class MFlowHook : public MInetBase

Abstract base class for flow hooks.

Flow hook providers implement this class. They register the hook using MIp6Hook::BindFlowHook(), and return an instance from MIp6Hook::OpenL().

Note:

The same instance of MFlowHook can be returned for multiple flows, if the logic of the hook does not require unique instance for each flow.

The object can be implemented as reference counted object: last reference removed by Close deletes the object.
Since
v7.0
Example:
 

Inherits from

Member Functions Documentation

ApplyL(RMBufSendPacket &, RMBufSendInfo &)

TInt ApplyL(RMBufSendPacket &aPacket,
RMBufSendInfo &aInfo
)[pure virtual]

Apply send transformations.

The ApplyL is called by IP protocol for outbound packet. The aPacket is in "unpacked" state (RMBufPacketBase::Unpack).

Exceptions
if

ApplyL leaves, the packet is dropped.

Example:
 

Parameters

RMBufSendPacket & aPacketa complete packet to be processed (if needed) by the hook. The packet includes the IP header.
RMBufSendInfo & aInfoinformation block associated with the packet (a hook must not break this association!)

Close()

voidClose()[pure virtual]

Decrement references and destroy if last.

Example:
 

Open()

voidOpen()[pure virtual]

Increment reference count.

The Open and Close functions must implement a reference counting system. The Close function must destroy the current instance, when the last reference is removed.

Non-NULL return from MIp6Hook::OpenL() counts as one reference, and the stack is guaranteed to call the matching Close exactly once.

If a hook creates a new instance for each flow at OpenL, it can leave the reference count as initial ZERO, if it implements a Close, which deletes the object when the count goes negative.

If a hook returns an existing instance at OpenL, it must increment the reference count by one.

Example:
 

ReadyL(TPacketHead &)

TInt ReadyL(TPacketHead &aHead)[pure virtual]

On an interface connecting, asks the hook if a flow is ready.

The ReadyL calls propagate interface ready state up the flow. The calls to hooks are made in reverse order; the closest to interface is called first. The call informs this hook that everything is ready from this hook to the interface. Now it this hooks turn to check the ready state of the flow.

Exceptions
If

the ReadyL leaves, the leave status will become the flow status (the leave status must be negative, or KErrGeneral is substituted for it)

Example:
 

Parameters

TPacketHead & aHeadAddress information of the flow.