1
0
mirror of https://github.com/gryf/wicd.git synced 2026-03-14 13:45:51 +01:00

Adding available auth methods

This commit is contained in:
Dario Freddi
2009-03-01 20:19:16 +01:00
parent 9213c7c333
commit 23cb084036
3 changed files with 29 additions and 1 deletions

View File

@@ -63,6 +63,7 @@ ip_pattern = re.compile(r'inet [Aa]d?dr[^.]*:([^.]*\.[^.]*\.[^.]*\.[0-9]*)',re.S
bssid_pattern = re.compile('.*Access Point: (([0-9A-Z]{2}:){5}[0-9A-Z]{2})', __re_mode)
bitrate_pattern = re.compile('.*Bit Rate=(.*?)s', __re_mode)
opmode_pattern = re.compile('.*Mode:(.*?) ', __re_mode)
authmethods_pattern = re.compile('.*Authentication capabilities :\n(.*?)Current', __re_mode)
# Regular expressions for wpa_cli output
auth_pattern = re.compile('.*wpa_state=(.*?)\n', __re_mode)
@@ -1211,6 +1212,18 @@ class BaseWirelessInterface(BaseInterface):
opmode = misc.RunRegex(opmode_pattern, output)
return opmode
def GetAvailableAuthMethods(self, iwlistauth=None):
""" Get the MAC address for the interface. """
if not iwlistauth:
cmd = 'iwlist ' + self.iface + ' auth'
if self.verbose: print cmd
output = misc.Run(cmd)
else:
output = iwlistauth
authm = misc.RunRegex(authmethods_pattern, output).replace(' ', '').replace('\t', '').replace('\n', '; ')[:-2]
return authm
def _get_link_quality(self, output):
""" Parse out the link quality from iwlist scan or iwconfig output. """
try: