def _npcap_set(self, key, val): """Internal function. Set a [key] parameter to [value]""" res = not _exec_cmd( _encapsulate_admin(" ".join( [_WlanHelper, self.guid[1:-1], key, val]))) _windows_title() # Reset title of the window return res
def _npcap_set(self, key, val): """Internal function. Set a [key] parameter to [value]""" res, code = _exec_cmd( _encapsulate_admin(" ".join( [_WlanHelper, self.guid[1:-1], key, val]))) _windows_title() # Reset title of the window if code != 0: raise OSError(res.decode("utf8", errors="ignore")) return (code == 0)
def test_windump_npcap(): """Return whether windump version is correct or not""" try: p_test_windump = sp.Popen([conf.prog.tcpdump, "-help"], stdout=sp.PIPE, stderr=sp.STDOUT) # noqa: E501 stdout, err = p_test_windump.communicate() _windows_title() _output = stdout.lower() return b"npcap" in _output and b"winpcap" not in _output except Exception: return False
def _npcap_get(self, key): res, code = _exec_cmd(" ".join([_WlanHelper, self.guid[1:-1], key])) _windows_title() # Reset title of the window if code != 0: raise OSError(res.decode("utf8", errors="ignore")) return plain_str(res.strip())
def _npcap_get(self, key): data = _exec_cmd(" ".join([_WlanHelper, self.guid[1:-1], key])) _windows_title() # Reset title of the window return data.strip()