<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial>gai_strerror: This stuff is ripped straight from
Microsoft's Platform SDK then modified slightly to get it to compile correctly.
Given the size and content of the functions, it should be easy to rework them
enough to fit them under the BSD license. Ultimately, it really should be
included in MingW's w32api headers, thus making it a moot point. (I'm working on
it, but it'll probably be at least 6 months before it shows up in the MingW
releases.)</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>3. This was to fix a warning that was crashing
gcc for me. The warning was that the bpf_stat structure was being defined
inline. As far as I can tell, it's one of the bpf_* structures that's only
defined in Packet32.h (some are defined again in bpf-pcap.h) and even then it's
defined only when BPF_MAJOR_VERSION is NOT defined. There should be only one
place where the bpf_* structures (or any structure) are defined, really,
but this works just as well as the other bpf_* structures in bpf_pcap.h
work.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>5. Given your comment on this, this step should be instead
to fixup the GNUmakefile to use wpcap.def instead of wpcap_no_extensions.def as
pcap_findalldevs_ex is already included in the former. Doing this may cause
issues with other functions that are included in one def and not the other. I'll
test this later today.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>As for Cygnus, I have no idea. If somebody out there could
test this stuff under Cygnus and report on it, that would be great.</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=gianluca.varenni@cacetech.com
href="mailto:gianluca.varenni@cacetech.com">Gianluca Varenni</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, December 16, 2005 10:15
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [spam] Re: [Winpcap-users]
Various fixups (was: libpcap.a)</DIV>
<DIV><BR></DIV>
<DIV><FONT size=2>Hi Ouroborus.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Some comments about your patches</FONT></DIV>
<DIV><FONT size=2>1. Ok.</FONT></DIV>
<DIV><FONT size=2>2. and 7. Sounds reasonable. Where did you take
the implementation of gai_strerrorA/W from? If we want to include it into the
main WinPcap source code, its license should be compatible with the WinPcap
one (i.e. BSD).</FONT></DIV>
<DIV><FONT size=2>3. Uhm, sounds quite strange. What's the problem if you
don't perform this patch?</FONT></DIV>
<DIV><FONT size=2>4. It's right. I knew about this issue (it generates a
compilation warning) but I was quite lazy in fixing it...</FONT></DIV>
<DIV><FONT size=2>5. You should probably use wpcap.def
(wpcap_no_extensions.def was created to remove some of the exports from the
standard wpcap.def)</FONT></DIV>
<DIV><FONT size=2>6. It seems reasonable. I need to check if this file is used
by libpcap on the other supported OSes.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Will this patch work on cygnus, as well?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Have a nice day</FONT></DIV>
<DIV><FONT size=2>GV</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=ouroborus@softhome.net
href="mailto:ouroborus@softhome.net">Ouroborus</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, December 16, 2005 9:46
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users] Various fixups
(was: libpcap.a)</DIV>
<DIV><BR></DIV>
<DIV><FONT face="Courier New">I finally got the first step of the tutorial
to compile with MingW. This took a number (7) of fixes:<BR></FONT></DIV>
<DIV><BR><FONT face="Courier New">1. Add "-DHAVE_REMOTE" to "CFLAGS" in the
relevant make files<BR><BR><BR>2. Add "../libpcap/Win32/Src/gai_strerror.o"
to the object list in wpcapsrc_3_1\wpcap\PRJ\GNUmakefile<BR><BR><BR>3. Copy
"struct bpf_stat {...};" from wpcapsrc_3_1\Common\Packet32.h to
wpcapsrc_3_1\wpcap\libpcap\pcap-bpf.h<BR><BR><BR>4. Comment out "#define
IN_MULTICAST..." from wpcap\libpcap\Win32\Include\ip6_misc.h<BR><BR><BR>5.
Add 'pcap_findalldevs_ex' to Wpcap_no_extensions.def'<BR><BR><BR>6. Change
line 678 in wpcapsrc_3_1\wpcap\libpcap\inet.c as per:<BR>### Begin
###<BR>678c678,679<BR>< (char*)tUstr += strlen(tAstr) +
1;;<BR>---<BR>> // (char*)tUstr += strlen(tAstr) +
1;;<BR>> tUstr = (WCHAR*)(((char*)tUstr) +
strlen(tAstr) + 1);<BR>### End ###<BR><BR><BR>7. Add file
wpcapsrc_3_1\wpcap\libpcap\Win32\Src\gai_strerror.c:<BR>### Begin
###<BR>#define WIN32_LEAN_AND_MEAN<BR>#include
<windows.h><BR><BR>#define GAI_STRERROR_BUFFER_SIZE 1024<BR>//#define
WS2TCPIP_INLINE extern inline<BR>#define WS2TCPIP_INLINE
__stdcall<BR><BR>WS2TCPIP_INLINE<BR>char
*<BR>gai_strerrorA(<BR> IN int
ecode)<BR>{<BR> DWORD dwMsgLen;<BR>
static char buff[GAI_STRERROR_BUFFER_SIZE + 1];<BR><BR>
dwMsgLen =
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM<BR>
|FORMAT_MESSAGE_IGNORE_INSERTS<BR>
|FORMAT_MESSAGE_MAX_WIDTH_MASK,<BR>
NULL,<BR>
ecode,<BR>
MAKELANGID(LANG_NEUTRAL,
SUBLANG_DEFAULT),<BR>
(LPSTR)buff,<BR>
GAI_STRERROR_BUFFER_SIZE,<BR>
NULL);<BR><BR> return
buff;<BR>}<BR><BR>WS2TCPIP_INLINE<BR>WCHAR
*<BR>gai_strerrorW(<BR> IN int ecode<BR>
)<BR>{<BR> DWORD dwMsgLen;<BR> static
WCHAR buff[GAI_STRERROR_BUFFER_SIZE + 1];<BR><BR> dwMsgLen
=
FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM<BR>
|FORMAT_MESSAGE_IGNORE_INSERTS<BR>
|FORMAT_MESSAGE_MAX_WIDTH_MASK,<BR>
NULL,<BR>
ecode,<BR>
MAKELANGID(LANG_NEUTRAL,
SUBLANG_DEFAULT),<BR>
(LPWSTR)buff,<BR>
GAI_STRERROR_BUFFER_SIZE,<BR>
NULL);<BR><BR> return buff;<BR>}<BR>### End ###
<BR></FONT></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE></BODY></HTML>