Rewrote from scratch.
[cnetworkmanager.git] / ap07.py
blob59429f9d74273c1b7080da13937d29d3b24e096a
1 from device import cDevice, cDeviceEth
2 from ap import cAP
3 from util import *
5 class cAP_07(cAP):
6 def Mbr(self):
7 return self.get_property("MaxBitrate")
9 def PrivS(self):
10 priv = self.get_property("Flags") != 0
11 wpa = self.get_property("WpaFlags") != 0
12 wpa2 = self.get_property("RsnFlags") != 0
13 priv_s = ""
14 if priv:
15 if not wpa and not wpa2:
16 priv_s = priv_s + " WEP"
17 if wpa:
18 priv_s = priv_s + " WPA"
19 if wpa2:
20 priv_s = priv_s + " WPA2"
21 return priv_s
23 def Strength(self):
24 return int(self.get_property("Strength"))
26 def Ssid(self):
27 return ssid_str(self.get_property("Ssid"))
29 def Dump(self):
30 print " AP:", self.opath
31 print " Ssid:", self.Ssid()
32 self.dump_props(["Frequency", "HwAddress", "MaxBitrate"], indent=" ")
33 print " Strength:", self.Strength()
34 print " AP Mode:", cDevice.IW_MODE[self.get_property("Mode")]
35 print " AP Flags:", bitmask_str(self.NM_802_11_AP_FLAGS,
36 self.get_property("Flags"))
37 print " AP WPA Flags:", bitmask_str(self.NM_802_11_AP_SEC,
38 self.get_property("WpaFlags"))
39 print " AP RSN Flags:", bitmask_str(self.NM_802_11_AP_SEC,
40 self.get_property("RsnFlags"))