def pcapname(dev):
 if (type(dev) is NetworkInterface):
  if dev.is_invalid():
   return None
  return dev.pcap_name
 try:
  return IFACES.dev_from_name(dev).pcap_name
 except ValueError:
  if conf.use_pcap:
   return None
  raise

def pcapname ( dev ) : if ( type ( dev ) is NetworkInterface ) : if dev . is_invalid ( ) : return None return dev . pcap_name try : return IFACES . dev_from_name ( dev ) . pcap_name except ValueError : if conf . use_pcap : return None raise
return pypcap device name for given interface or libdnet/scapy device name .