def getProfilesJSON(): ''' returns a JSON-string with the wlan-profiles saved on this computer ''' out = executeAndGetLines("netsh wlan show profiles") OutStructure = __buildProfileStructure(out) return OutStructure
def IPv4_globalParameters(): ''' returns the global parameters encoded in JSON of the IPv4 ''' output = executeAndGetLines("netsh interface ipv4 show global")[ 1:] #skip first return json.dumps(__abstractDeconstruct(output))
def Teredo_showState(): ''' returns a JSON-string with the state of the Teredo Client ''' output = executeAndGetLines("netsh interface teredo show state") outStructure = {} for line in output: key, value = __getValuePairFromLine(line) if key != None and value != None: outStructure[key] = value return json.dumps(outStructure)
def getAvilableNetworksJSON(): ''' returns an JSON-encoded list of Strings containing information of available Networks ''' output = executeAndGetLines("netsh wlan show networks") Wifis = [] output = output[1:] #Skip interface name while output[0].find(":") < 0: output = output[1:] while len(output) >= 4: key, name = __getValuePairFromLine(output[0]) if key != None: Structure = {key:{}} Structure[key]["name"] = name for x in range(1,4): attr, value = __getValuePairFromLine(output[x]) Structure[key][attr] = value Wifis.append(json.dumps(Structure)) output = output[4:] return Wifis
def getInterfacesJSON(): ''' returns a JSON-string with the interfaces-profiles and their current status ''' output = executeAndGetLines("netsh interface show interface") return __buildProfileStructure(output)