#! /usr/bin/env python import sys import dbus import shlex import subprocess from signal import SIGTERM from os import kill from time import sleep # dbus constants. WPAS_DBUS_SERVICE = "fi.epitest.hostap.WPASupplicant" WPAS_DBUS_INTERFACE = "fi.epitest.hostap.WPASupplicant" WPAS_DBUS_OPATH = "/fi/epitest/hostap/WPASupplicant" WPAS_DBUS_INTERFACES_INTERFACE = "fi.epitest.hostap.WPASupplicant.Interface" WPAS_DBUS_INTERFACES_OPATH = "/fi/epitest/hostap/WPASupplicant/Interfaces" WPAS_DBUS_BSSID_INTERFACE = "fi.epitest.hostap.WPASupplicant.BSSID" WPAS_DBUS_NETWORKS_INTERFACE = "fi.epitest.hostap.WPASupplicant.Network" def read_config(config): cfg = shlex.split(open(config, "r").read()) options = {} for line in cfg: (var, delim, value) = line.partition('=') if delim and var.lstrip()[0] != "#": options[var] = value return options def wep_hex2dec(key): if len(key) not in [10, 26]: print "Bad key" raise SyntaxError x=0 new_key=[] while x