$NetBSD$ --- cdpr.c.orig 2003-02-14 04:58:07.000000000 +0000 +++ cdpr.c @@ -459,6 +459,8 @@ main(int argc, char *argv[]) /* Get a pcap capable device */ if(dev == NULL) { + +#ifdef HAVE_PCAP_IF_T int i = 0; int inum; pcap_if_t *d; @@ -505,6 +507,15 @@ main(int argc, char *argv[]) } dev = d->name; +#else + dev = pcap_lookupdev(errbuf); + if (dev == NULL) { + printf("%s", errbuf); + exit(1); + } +#endif + + } printf("Using Device: %s\n", dev); @@ -528,8 +539,9 @@ main(int argc, char *argv[]) /* Activate the pcap filter */ pcap_setfilter(handle, &filter); +#ifdef HAVE_PCAP_FREECODE pcap_freecode(&filter); - +#endif /* Get the next packet that comes in, we only need one */ printf("Waiting for CDP advertisement:\n"); printf("(default config is to transmit CDP packets every 60 seconds)\n");