/* Return detailed network/device statistics. May be called after 'dev->close' is called.  */
int pcap_stats_ex(pcap_t *p, struct pcap_stat_ex *se)
/* Return detailed network/device statistics. May be called after 'dev->close' is called.  */
int pcap_stats_ex(pcap_t *p, struct pcap_stat_ex *se)
{
  struct device *dev = p ? get_device (p->fd) : NULL;
  if (!dev || !dev->get_stats)
  {
    pcap_strlcpy (p->errbuf, "detailed device statistics not available",
             PCAP_ERRBUF_SIZE);
    return (-1);
  }
  if (!strnicmp(dev->name,"pkt",3))
  {
    pcap_strlcpy (p->errbuf, "pktdrvr doesn't have detailed statistics",
             PCAP_ERRBUF_SIZE);
    return (-1);
  }
  memcpy (se, (*dev->get_stats)(dev), sizeof(*se));
  return (0);
}