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() .
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.
Public Member Functions | |
---|---|
TInt | ApplyL ( RMBufSendPacket &, RMBufSendInfo &) |
void | Close () |
void | Open () |
TInt | ReadyL ( TPacketHead &) |
Inherited Functions | |
---|---|
MInetBase::GetApiL(const TDesC8 &,TUint *) | |
MInetBase::GetApiL(const TDesC8 &,TUint) |
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 ).
if |
ApplyL leaves, the packet is dropped. |
RMBufSendPacket & aPacket | a complete packet to be processed (if needed) by the hook. The packet includes the IP header. |
RMBufSendInfo & aInfo | information block associated with the packet (a hook must not break this association!) |
void | Open | ( | ) | [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.
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.
If |
the ReadyL leaves, the leave status will become the flow status (the leave status must be negative, or KErrGeneral is substituted for it) |
TPacketHead & aHead | Address information of the flow. |
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.