tcpdump mailing list archives
Re: How to set my device name with pcap_platform_finddevs()
From: "Varuna De Silva" <varunax () gmail com>
Date: Thu, 27 Sep 2007 14:44:27 +0530
On 9/26/07, Guy Harris <guy () alum mit edu> wrote:
On Sep 25, 2007, at 4:33 AM, Varuna De Silva wrote:1. How should I work around so that pcap_findalldevs() will add my device in the list?
Then add a routine to your pcap-xxx.c that, similarly to
septel_platform_finddevs(), adds your device to the list of devices, and then add a routine to pcap-win32.c called "pcap_platform_finddevs()" that calls your routine, similarly to the Linux pcap_platform_finddevs() in pcap-linux.c. If you're doing this on some form of UN*X, e.g. Linux, just add the routine to your pcap-xxx.c and find the appropriate pcap-yyy.c and modify its pcap_platform_finddevs() to call your routine.
I didso but when compiled after having add the pcap_platform_finddevs() to
pcap-win32.c I get this compilation error,
Error 32 error C2065: 'any_descr' : undeclared identifier
d:\winpcap\winpcap\wpcap\libpcap\pcap-win32.c 883
This is because of the following part in the pcap_platform_finddevs(),
any_descr
int
pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
{
if (pcap_add_if(alldevsp, "any", 0, any_descr, errbuf) < 0)
return (-1);
#ifdef HAVE_USB
if (muwis_platform_finddevs(alldevsp, errbuf) < 0)
return (-1);
#endif /* HAVE_USB */
return (0);
}
I copied this function from pcap-linux.c and removed the definitions for dag
and
septel cards.
my device name is muwis.
Next I removed the following part from the above code, and the build
succeeded.
if (pcap_add_if(alldevsp, "any", 0, any_descr, errbuf) < 0)
return (-1);
Is this process acceptable of me removing the above part?
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- How to set my device name with pcap_platform_finddevs() Varuna De Silva (Sep 25)
- Re: How to set my device name with pcap_platform_finddevs() Guy Harris (Sep 25)
- Announce: tcpdump 3.9.8 and libpcap 0.9.8 released Ken Bantoft (Sep 25)
- Re: Announce: tcpdump 3.9.8 and libpcap 0.9.8 released Max Laier (Sep 29)
- Re: How to set my device name with pcap_platform_finddevs() Varuna De Silva (Sep 27)
- Re: How to set my device name with Guy Harris (Sep 27)
- Announce: tcpdump 3.9.8 and libpcap 0.9.8 released Ken Bantoft (Sep 25)
- Re: How to set my device name with pcap_platform_finddevs() Guy Harris (Sep 25)
