<div dir="ltr">Hi,<br><br>While working on Pcap.Net (<a href="http://pcapdotnet.codeplex.com" target="_blank">http://pcapdotnet.codeplex.com</a>), I've encountered a problem freeing the allocated memory that was allocated using pcap_list_datalinks().<br>
<br>I saw the 2008 issue - so I'm replying to it.<br><br>There is a function<br>void pcap_free_datalinks(int *);<br>in pcap.h, but I couldn't resolve it using the .lib file (while I have no problem with pcap_list_datalinks) and there is no documentation about it in<br>
<a href="http://www.winpcap.org/docs/docs_411/html/group__wpcapfunc.html">http://www.winpcap.org/docs/docs_411/html/group__wpcapfunc.html</a><br><br>What should I do in order to use this function?<br><br>Thank you.<br><br>
Boaz.<br><br>-----------------------------------------------------------<br><br>Guy Harris guy at <a href="http://alum.mit.edu">alum.mit.edu</a><br>Mon May 26 20:00:05 GMT 2008<br><br>Previous message: [Winpcap-users] pcap_list_datalinks() - how to free<br>
Next message: [Winpcap-users] Wincap and fake packages<br>Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]<br><br>________________________________<br><br>Gianluca Varenni wrote:<br><br>> In the next days I will try to commit an implementation of <br>
> pcap_free_datalinks() in the libpcap source tree.<br><br>I've checked one into the main and 1.0 branches (along with a man page).<br><br><br>----- Original Message ----- <br>From: "Esmond Pitt" <esmond.pitt at <a href="http://bigpond.com" target="_blank">bigpond.com</a>><br>
To: <winpcap-users at <a href="http://winpcap.org" target="_blank">winpcap.org</a>><br>Sent: Tuesday, May 20, 2008 11:35 PM<br>
Subject: [Winpcap-users] pcap_list_datalinks() - how to free<br><br><br>> The documentation for the pcap_list_datalinks() function says that the <br>> user<br>> is responsible for freeing the array of integers allocated by the <br>
> function.<br>><br>> As no specific function to do that is provided, presumably we are supposed<br>> to use free(3). But in a DLL environment this is of course most <br>> problematic,<br>> and indeed causes SEGVs when I do it.<br>
><br>> I think you need to add a pcap_free_datalinks() function. Or is there some<br>> other solution?<br><br>No other solution. This function was created within the linux/unix <br>environment, where it's safe to call malloc/free from across DLLs/shared <br>
object boundaries (while it's not under Windows with the MS CRT).<br><br>In the next days I will try to commit an implementation of <br>pcap_free_datalinks() in the libpcap source tree.<br><br>Have a nice day<br>GV<br>
<br>><br>> EJP<br>><br>> _______________________________________________<br>> Winpcap-users mailing list<br>> Winpcap-users at <a href="http://winpcap.org" target="_blank">winpcap.org</a><br>> <a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a> <br>
</div>