1 from device
import cDevice
, cDeviceEth
3 class cDevice_06(cDevice
):
6 self
.dt
= self
.devi
.getProperties()[2]
8 self
.__class
__ = cDeviceEth_06
10 self
.__class
__ = cDeviceWifi_06
14 "UNKNOWN", "DEVICE_PREPARE", "DEVICE_CONFIG", "NEED_USER_KEY",
15 "IP_CONFIG_START", "IP_CONFIG_GET", "IP_CONFIG_COMMIT",
16 "ACTIVATED", "FAILED", "CANCELLED", ]
20 print " Driver:", self
.devi
.getDriver()
21 props
= self
.devi
.getProperties() # osusb ussss sssii biuus as
22 print " Self:", props
[0] # o
23 print " Interface:", props
[1] # s
24 print " Type:", self
.DEVICE_TYPE
[props
[2]] # u
25 print " UDI:", props
[3] # s
26 print " Active:", bool(props
[4]) # b
27 print " Activation Stage:", self
.NM_ACT_STAGE
[props
[5]] # u
28 print " IP:", props
[6] # s
29 print " Mask:", props
[7] # s
30 print " Bcast:", props
[8] # s
31 print " HwAddress:", props
[9] # s
32 print " GW:", props
[10] # s
33 print " NS1:", props
[11] # s
34 print " NS2:", props
[12] # s
38 print " (unknown device type, not dumping more)"
40 class cDeviceEth_06(cDevice_06
, cDeviceEth
):
42 props
= self
.devi
.getProperties() # osusb ussss sssii biuus as
43 print " Link Active:", bool(props
[15]) # b
44 print " Speed:", props
[16] # i
45 print " Generic Capabilities:", bitmask_str(self
.NM_DEVICE_CAP
, props
[17]) # u
47 class cDeviceWifi_06(cDevice_06
):
49 0x00000001: "PROTO_NONE",
50 0x00000002: "PROTO_WEP",
51 0x00000004: "PROTO_WPA",
52 0x00000008: "PROTO_WPA2",
53 0x00000010: "RESERVED1",
54 0x00000020: "RESERVED2",
55 0x00000040: "KEY_MGMT_PSK",
56 0x00000080: "KEY_MGMT_802_1X",
57 0x00000100: "RESERVED3",
58 0x00000200: "RESERVED4",
59 0x00000400: "RESERVED5",
60 0x00000800: "RESERVED6",
61 0x00001000: "CIPHER_WEP40",
62 0x00002000: "CIPHER_WEP104",
63 0x00004000: "CIPHER_TKIP",
64 0x00008000: "CIPHER_CCMP",
68 self
.wdevi
= dbus
.Interface(self
.devo
, NMI
+ ".Device.Wireless")
69 aps
= self
.devi
.getProperties()[20]
70 return map(cAP_06
, aps
)
73 props
= self
.devi
.getProperties() # osusb ussss sssii biuus as
74 print " Mode:", self
.IW_MODE
[props
[13]] # i
75 print " Strength:", props
[14] # i
76 print " Link Active:", bool(props
[15]) # b
77 print " Speed:", props
[16] # i
78 print " Generic Capabilities:", bitmask_str(self
.NM_DEVICE_CAP
, props
[17]) # u
79 print " Capabilities:", bitmask_str(self
.NM_802_11_CAP
, props
[18]) # u
80 print " Current net:", props
[19] # s
82 print " Seen nets:", " ".join(nets
)
84 print " Access Points"