On Mon, Oct 29, 2001 at 06:10:20PM +0330, Mehdi Kianpour wrote:
> Is there any option to find out the number of errors occuring in the
> network using winpcap?

I.e., link-layer errors such as CRC errors on Ethernet?

WinPcap has libpcap's not-very-powerful "pcap_stats()" call, which gives
only counts of packets received, packets dropped because they didn't
pass the filter, and packets dropped by the interface, but the "packets
dropped by the interface" count isn't supported on any platform other
than Digital UNIX, and doesn't give counts for *particular* reasons for
packets being dropped.

However, if you use the raw "packet.dll" interface:

        http://netgroup-serv.polito.it/winpcap/docs/dll.htm

the "PacketRequest()" call could be used to fetch various counters. 
You'd have to look at the information on developing NDIS network drivers
in the Microsoft device driver development kit (DDK) - it may be
available online under

        http://msdn.microsoft.com/

(that site might require Internet Explorer).

Unfortunately, there's no way in WinPcap to get at the LPPACKET pointer
in the "pcap_t" structure, so your program would either have to include
the "pcap-int.h" header file from the WinPcap source or declare a
structure that looks like the beginning of a "struct pcap" and cast a
"pcap_t *" pointer to a pointer to that structure.

We should probably, at some point, add a better API for getting
interface statistics; it should allow you to fetch, on platforms that
support it, lower-level statistics such as error statistics, and should
indicate which statistics are supported (on some platforms, you can't
find out, for example, how many packets were accepted by the interface
but didn't pass the packet filter).

If you mean higher-level errors such as IP datagrams dropped due to a
bad header checksum, I don't even think there's any way to get that with
"packet.dll".
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to