common/vpnxprtproxy.c
//  This routine will get called whenever any kIOGeneralInterest notification happens.  We are
//  interested in the kIOMessageServiceIsTerminated message so that's what we look for.  Other
//  messages are defined in IOMessage.h.
//
This routine will get called whenever any kIOGeneralInterest notification happens.  We are
interested in the kIOMessageServiceIsTerminated message so that's what we look for.  Other
messages are defined in IOMessage.h.
This routine will get called whenever any kIOGeneralInterest notification happens . We are interested in the kIOMessageServiceIsTerminated message so that ' s what we look for . Other messages are defined in IOMessage . h .
void DeviceNotification(void *refCon, io_service_t service, natural_t messageType, void *messageArgument)
{
    kern_return_t kr;
    usb_desc_t *privateDataRef = (usb_desc_t *)refCon;
    if (messageType == kIOMessageServiceIsTerminated)
    {
        vpnx_log(0, "Device removed.\n");
        vpnx_log(0, "privateDataRef->deviceName: ");
        CFShow(privateDataRef->deviceName);
        vpnx_log(0, "privateDataRef->locationID: 0x%lx.\n\n", (unsigned long)privateDataRef->locationID);
        CFRelease(privateDataRef->deviceName);
        if (privateDataRef->deviceInterface)
        {
            kr = (*privateDataRef->deviceInterface)->Release(privateDataRef->deviceInterface);
        }
        kr = IOObjectRelease(privateDataRef->notification);
        free(privateDataRef);
    }
}
void DeviceNotification ( void * refCon , io_service_t service , natural_t messageType , void * messageArgument ) { kern_return_t kr ; usb_desc_t * privateDataRef = ( usb_desc_t * ) refCon ; if ( messageType == kIOMessageServiceIsTerminated ) { vpnx_log ( 0 , " \n " ) ; vpnx_log ( 0 , " " ) ; CFShow ( privateDataRef -> deviceName ) ; vpnx_log ( 0 , " \n \n " , ( unsigned long ) privateDataRef -> locationID ) ; CFRelease ( privateDataRef -> deviceName ) ; if ( privateDataRef -> deviceInterface ) { kr = ( * privateDataRef -> deviceInterface ) -> Release ( privateDataRef -> deviceInterface ) ; } kr = IOObjectRelease ( privateDataRef -> notification ) ; free ( privateDataRef ) ; } }
This routine will get called whenever any kIOGeneralInterest notification happens.
This routine will get called whenever any kIOGeneralInterest notification happens .
// Dump our private data to stderr just to see what it looks like. // Free the data we're no longer using now that the device is going away