def scapy_iface(os_name): if platform.system() == "Linux": return os_name elif platform.system() == "Windows": for x, y in ifaces.items(): if y.pcap_name is not None: if get_ifname(os_name) == ('{' + y.pcap_name.split('{')[1]): return x else: pass
def get_ipv6_address(ifname): return ifaddresses(get_ifname(ifname))[AF_INET6][0]['addr']
def get_mac_address(ifname): # print(netifaces.ifaddresses(get_ifname(ifname))[netifaces.AF_LINK]) return netifaces.ifaddresses( get_ifname(ifname))[netifaces.AF_LINK][0]['addr']