From 13e894ef170a21f7bf1a5f89b5fe60ecfa398ecc Mon Sep 17 00:00:00 2001 From: Dirk Loss <mail@dirk-loss.de> Date: Mon, 20 Jul 2009 19:48:27 +0200 Subject: [PATCH] Added Windows-specific get_if_list() and get_working_if() --- scapy/arch/windows/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scapy/arch/windows/__init__.py b/scapy/arch/windows/__init__.py index eea7f0cc..7318a407 100644 --- a/scapy/arch/windows/__init__.py +++ b/scapy/arch/windows/__init__.py @@ -452,3 +452,12 @@ def sndrcv(pks, pkt, timeout = 2, inter = 0, verbose=None, chainCC=0, retry=0, m import scapy.sendrecv scapy.sendrecv.sndrcv = sndrcv + +def get_if_list(): + return sorted(ifaces.keys()) + +def get_working_if(): + try: + return devname(pcap.lookupdev()) + except Exception: + return 'lo0' -- GitLab