<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Yes that's the right link.</div>

<div> </div>

<div>I didn't add new function pointers. I added it e.g. <em>PacketOpenAdapter(). </em>I added an additional flag for the device and then the appropriate function is called.</div>

<div>Do you mean <em> pcap_read_win32_npf() </em>with the "read" routine?</div>

<div>There I don't have any options to set a specific error massage; it can just return -1 if an error occurs. </div>

<div> </div>

<div>The device is used for finding errors in the network traffic. By this it would be very bad if some packets would just discarded without any hint because the buffer can't handle the amount of traffic.</div>

<div>I'll watch your hint with pcap_stats().</div>

<div> </div>

<div> </div>

<div>
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Dienstag, 23. Juli 2013 um 09:53 Uhr<br/>
<b>Von:</b> "Guy Harris" <guy@alum.mit.edu><br/>
<b>An:</b> winpcap-users@winpcap.org<br/>
<b>Betreff:</b> Re: [Winpcap-users] Help with the WinPCap error handling</div>

<div><br/>
On Jul 23, 2013, at 12:14 AM, "Sebastian Klein" <Klein_Sebastian@gmx.de> wrote:<br/>
<br/>
> I'm currently adding a new device to WinPCap which is called netANALYZER.<br/>
<br/>
netANALYZER as in<br/>
<br/>
<a href="http://www.hilscher.com/products_group_kits_NANL.html" target="_blank">http://www.hilscher.com/products_group_kits_NANL.html</a><br/>
<br/>
?<br/>
<br/>
Where are you adding the device? Are you adding it to pcap_create() in pcap-win32.c, so that a device with a name that looks like a netANALYZER device causes a create routine for netANALYZER devices to be called, setting the function pointers in the pcap_t to routines for that device? That's more or less the standard way to add devices to newer versions of {libpcap,WinPcap}.<br/>
<br/>
> It has a status callback where it receives errors such as internal buffer is full. I would like to write these errors into the error buffer of WinPCap (errbuff).<br/>
> In this way the error massages would pop up in e.g. Wireshark if something happens. For me it seems like it isn't possible. Currently I can only show these errors in the debug mode. Are there any other ways to create an error massage which could be read by the application which uses WinPCap?<br/>
<br/>
When capturing, errors are returned by the "read" routine for the device. Have the "read" routine<br/>
<br/>
1) if "p" is the pcap_t pointer for the device, do<br/>
<br/>
snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "error message format string", arguments to the format string);<br/>
<br/>
to set errbuf;<br/>
<br/>
2) return PCAP_ERROR.<br/>
<br/>
> You wrote: "If the buffer is full when a new packet arrives, the packet is discarded and hence it's lost."<br/>
> (<a href="http://www.winpcap.org/docs/docs_40_2/html/group__NPF.html" target="_blank">http://www.winpcap.org/docs/docs_40_2/html/group__NPF.html</a> - Packet Capture)<br/>
> Do you create an error massage if packets are discarded?<br/>
<br/>
No. That's not treated as an "error" in the sense of a malfunction; if the application can't keep up with packet capture, it just won't get all the packets.<br/>
<br/>
However, for most devices on most OSes, the application can call pcap_stats(), and the ps_drop member of the structure it fills in is a count of packets dropped because the buffer filled up. You would have to arrange that your device's "stats" routine do that.<br/>
_______________________________________________<br/>
Winpcap-users mailing list<br/>
Winpcap-users@winpcap.org<br/>
<a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a></div>
</div>
</div>
</div></div></body></html>