tcpdump mailing list archives
Re: libpcap on Mac Os X 10.6 Snow Leopard
From: Carter Bullard <carter () qosient com>
Date: Tue, 9 Feb 2010 12:41:19 -0500
Hey Marco, This may help you if you are not doing it. It seemed to help me on Snow Leopard. Just after the call to pcap_open_live(), I set this ioctl. You may not need the pcap_setnonblock() for your application. if ((pd = pcap_open_live(device->name, snaplen, !pflag, 100, errbuf)) != NULL) { pcap_setnonblock(pd, 1, errbuf); #if defined(__APPLE_CC__) || defined(__APPLE__) int v = 1; ioctl(pcap_fileno(pd), BIOCIMMEDIATE, &v); #endif Carter On Feb 9, 2010, at 5:15 AM, Marco De Angelis wrote:
Guy Harris <guy <at> alum.mit.edu> writes:Good question. Do you know how could I verify the buffer they stay in? Is there some printout I could add before calling pcap_dispatch to see what's in the kernel buffer and what in the userland buffer?Yes, but you'd have to add it to libpcap.I made an interesting test. By collecting pcap_stats() after every call to pcap_dispatch and printing the pcap_stat values out, I could verify that the packets are received. E.g. if I filter for ICMP packets, by launching "ping" commands I can see "ps_recv" increase rapidly. Now, I don't know what "received" means (in userland? in kernel buffer?), but maybe you do :) Thanks, Marco - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Attachment:
smime.p7s
Description:
Current thread:
- Re: libpcap on Mac Os X 10.6 Snow Leopard, (continued)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Marco De Angelis (Feb 01)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Carter Bullard (Feb 01)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Feb 01)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Marco De Angelis (Feb 01)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Jan 31)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Marco De Angelis (Feb 01)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Feb 01)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Marco De Angelis (Feb 03)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Feb 03)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Marco De Angelis (Feb 03)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Marco De Angelis (Feb 09)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Carter Bullard (Feb 09)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Feb 09)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Marco De Angelis (Feb 10)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Feb 10)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Marco De Angelis (Feb 10)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Feb 11)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Marco De Angelis (Feb 12)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Feb 12)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Feb 13)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Marco De Angelis (Feb 19)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Feb 19)
- Re: libpcap on Mac Os X 10.6 Snow Leopard Guy Harris (Feb 01)