def read_wifi_dongle_mode(interface): '''Read the mode of a Wireless device's interface. ARGS: @interface -- The name of the interface inquired about. RETURNS: @mode -- The mode of the Wireless device. Ex Mangaged ''' from parse_iwconfig import parse_iwconfig interface = parse_iwconfig() for intrfc in interfaces: if intrfc['interface'] == interface: return interface['mode']
def read_essid(interface): '''Read the name of the network a Wireless device is attached to. ARGS: @interface -- The interface inquired about. Ex wlan0 RETURNS: @essid -- The name of the wireless network the device is configured on. ''' from parse_iwconfig import parse_iwconfig interfaces = parse_iwconfig() for intrfc in interfaces: if intrfc['interface'] == interface: return interface['essid']
def read_access_point(interface): '''Read the MAC address of the access point associated with the network that @interface is on. ARGS: @interface -- The interface inquired about. RETURNS: @ap -- The MAC address of the interface's network access point. ''' from parse_iwconfig import parse_iwconfig interfaces = parse_iwconfig() for intrfc in interfaces: if intrfc['interface'] == interface: return interface['ap']