Logo Search packages:      
Sourcecode: wicd version File versions

def wicd::wnettools::WirelessInterface::ValidateAuthentication (   self,
  auth_time 
)

Validate WPA authentication.

    Validate that the wpa_supplicant authentication
    process was successful.

    NOTE: It's possible this could return False,
    though in reality wpa_supplicant just isn't
    finished yet.
    
    Keyword arguments:
    auth_time -- The time at which authentication began.
    
    Returns:
    True if wpa_supplicant authenticated succesfully,
    False otherwise.

Definition at line 978 of file wnettools.py.

00978                                                :
        """ Validate WPA authentication.

            Validate that the wpa_supplicant authentication
            process was successful.

            NOTE: It's possible this could return False,
            though in reality wpa_supplicant just isn't
            finished yet.
            
            Keyword arguments:
            auth_time -- The time at which authentication began.
            
            Returns:
            True if wpa_supplicant authenticated succesfully,
            False otherwise.

        """
        # Right now there's no way to do this for ralink drivers
        if self.wpa_driver == RALINK_DRIVER or not self.WPA_CLI_FOUND:
            return True

        MAX_TIME = 15
        MAX_DISCONNECTED_TIME = 3
        while (time.time() - auth_time) < MAX_TIME:
            cmd = 'wpa_cli -i ' + self.iface + ' status'
            output = misc.Run(cmd)
            result = misc.RunRegex(auth_pattern, output)
            if self.verbose:
                print 'WPA_CLI RESULT IS', result

            if not result:
                return False
            if result == "COMPLETED":
                return True
            elif result == "DISCONNECTED" and \
                 (time.time() - auth_time) > MAX_DISCONNECTED_TIME:
                # Force a rescan to get wpa_supplicant moving again.
                self._ForceSupplicantScan()
                MAX_TIME += 5
            time.sleep(1)

        print 'wpa_supplicant authentication may have failed.'
        return False
        

    def _ForceSupplicantScan(self):


Generated by  Doxygen 1.6.0   Back to index