MInetBase Class Reference

class MInetBase

This interface class provides capability of introducing new interfaces for existing classes in TCP/IP stack to be used by protocol hooks. With this class, protocol hooks can query whether an interface is supported and then use the interface. Backwards compatibility of revised interfaces is allowed by versioning the interfaces. This enables independent developement of protocol hooks and the TCP/IP stack while maintaining the compatibility towards older implementations. This should be used as base class for all interface classes that are visible outside the TCP/IP stack, or that should be prepared to export an API at some time to allow making compatible modifications later on.

There should be a constant definition of form KApiVer_<name> for each API that is exported that identifies the version number of current API.

Public Member Functions
void * GetApiL (const TDesC8 &, TUint *)
void * GetApiL (const TDesC8 &, TUint )

Member Functions Documentation

GetApiL(const TDesC8 &, TUint *)

void * GetApiL ( const TDesC8 & ,
TUint *
) [inline, virtual]

Returns a pointer to object that implements the requested API. If the the class that processes this call does not recognize the API name, it leaves with KErrNotFound. New versions of the same API should maintain binary backwards compatibility. That is, the caller requests a minimal accepted version, and if the implemented API is of the same version or higher, an object should be returned. If the implemented version is smaller than what requested, implementation of GetApiL leaves with KErrInetUnsupportedApi. If API is changed in a way that does not maintain backwards compatibility, a new API name should be allocated for it.

Note: Callers should not use this method directly, but are strongly recommended to use IMPORT_API_L macro, which checks for type safety. Additionally, there is IMPORT_API_VER_L macro which can be used to explicitly request a known version and to return the actual version implemented.

For example:
         * MEventService *es = IMPORT_API_L(NetworkService()->Interfacer(), MEventService);
	*
        

There should be MEventService header somewhere visible to the caller.

Exceptions
KErrInetUnsupportedApi

Name of the API is not supported by the implementing class.

KErrInetUnsupportedApiVersion

The given API is implemented, but the version is incompatible, i.e. older than requested.

Parameters

const TDesC8 &
TUint *

GetApiL(const TDesC8 &, TUint)

void * GetApiL ( const TDesC8 & aApiName,
TUint aVersion
) [inline]

This is similar to GetApiL with returned version, but this function does not return the actual version implemented, so it can be used with constant parameters also.

Parameters

const TDesC8 & aApiName
TUint aVersion