Implementing the Uplink Authorization Notifier Plug-in

The Uplink Authorization Notifier requests permission for an RNDIS connection to access an external uplink.

The Uplink Authorization Notifier requests permission for a RNDIS connection to access an external uplink. When a RNDIS enabled mobile device connects to a PC, the notifier is activated to get uplink authorisation.

The Uplink Authorization Notifier is a notifier plug-in that device creators need to implement. Device creators can implement this notifier either by providing a dialog asking the mobile device user for permission or by providing a policy specifying when to give permission.

If the Uplink Authorization Notifier is refused permission, the RNDIS connection can only access services local to the phone.

The uplink authorization notifier UID is defined in the RNDIS header file rndisuiinterfaces.h.
const TUid KUidRndisUplinkAuthorizationNotifier = {0x10286A44};

Responses to the request are defined in the RNDIS header file rndisuiinterfaces.h. The plug-in will receive one of the following responses: ERndisAllowUplinkAccess or ERndisDisallowUplinkAccess as a result of requesting permission for an RNDIS connection.

The plug-in needs to:

  1. Implement the MEikSrvNotifierBase2 interface.

  2. Implement the StartL() function of the MEikSrvNotifierBase2 interface to start the notifier. The RNDIS agent calls the asynchronous function RNotifier::StartNotifierAndGetResponse(), which starts the notifier. The RNDIS agent waits, asynchronously, for the notifier to tell the RNDIS agent that it has finished its work. Therefore it is important to return from this function as soon as possible. Remember to call Complete() on the RMessage2 object to deactivate the notifier. The aBuffer parameter is an array with six TUint8 integers containing the MAC address of the network interface resident on the PC.
    Parameter Description

    aBuffer

    Data that is passed from the RNDIS agent. In which contains the IAP ID used for RNDIS network interface.

    aReplySlot

    The offset within the message arguments for the reply. This message argument will refer to a modifiable descriptor, a TDes8 type, into which data can be returned.

    aMessage

    Encapsulates the RNDIS agent’s request.

        virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, 
    const RMessagePtr2& aMessage)
    {
            TRndisUplinkAuthorizationResult result;
    
            // The result below is set according to the device creator's implementation. Set 
      // either from mobile device, user input or a policy file.
            result =     ERndisAllowUplinkAccess or ERndisDisallowUplinkAccess; 
            TRndisUplinkAuthorizationResultPckg pckgResult = result;
            TInt err = aMessage.Write(aReplySlot, pckgResult);
            aMessage.Complete(err);
    }    
    

Related information