This repository was archived by the owner on Sep 4, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 1919UBNT_MAC = '01'
2020UBNT_MAC_AND_IP = '02'
2121UBNT_FIRMWARE = '03'
22- UBNT_UNKNOWN_2 = '0a'
22+ UBNT_UPTIME = '0a'
2323UBNT_RADIONAME = '0b'
2424UBNT_MODEL_SHORT = '0c'
2525UBNT_ESSID = '0d'
26- UBNT_UNKNOWN_3 = '0e'
26+ UBNT_WLAN_MODE = '0e'
2727UBNT_UNKNOWN_1 = '10'
2828UBNT_MODEL_FULL = '14'
2929
3030# UBNT discovery packet payload and reply signature
3131UBNT_REQUEST_PAYLOAD = '01000000'
3232UBNT_REPLY_SIGNATURE = '010000'
3333
34+
35+ # Wirelss modes
36+ UBNT_WIRELESS_MODES = {
37+ '\x00 ' : "Auto" ,
38+ '\x01 ' : "adhoc" ,
39+ '\x02 ' : "Station" ,
40+ '\x03 ' : "AP" ,
41+ '\x04 ' : "Repeater" ,
42+ '\x05 ' : "Secondary" ,
43+ '\x06 ' : "Monitor" ,
44+ };
45+
3446# Offset within the payload that contains the amount of bytes remaining
3547offset_PayloadRemainingBytes = 3
3648
@@ -121,8 +133,12 @@ def ubntDiscovery():
121133 RadioModelShort = fieldData
122134 elif fieldType == UBNT_FIRMWARE :
123135 RadioFirmware = fieldData
136+ elif fieldType == UBNT_UPTIME :
137+ RadioUptime = int (fieldData .encode ('hex' ), 16 )
124138 elif fieldType == UBNT_ESSID :
125139 RadioEssid = fieldData
140+ elif fieldType == UBNT_WLAN_MODE :
141+ RadioWlanMode = UBNT_WIRELESS_MODES [fieldData ]
126142 # We don't know or care about other field types. Continue walking the payload.
127143 pointer += fieldLen
128144 remaining_bytes -= fieldLen
You can’t perform that action at this time.
0 commit comments