<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi again! yes, I read the winpcap FAQ and in this says that I have to convert wpcap.lib and packet.lib from coff format to omf format to use in Builder c++, and I think I obtain this.<BR>
<BR>
But when I compile a example, It appear this warning, and the content of line 786 in wspiapi.h is:<BR>
<BR>
if ((iFlags & NI_NOFQDN) && (pc = strchr(pszNode, '.')))<BR>
<BR>
With this warning I can build the .exe file I don't know very well what's the meaning of the example, because when a run this .exe file, a ms-dos windows is opened and in a second it's closed, and I don't know what's is happened.<BR>
<BR>
this is the example:<BR>
<BR>
void dispatcher_handler(u_char *, const struct pcap_pkthdr *, const u_char *);<BR>
main(int argc, char **argv)<BR>{<BR> pcap_t *fp;<BR> char errbuf[PCAP_ERRBUF_SIZE];<BR> <BR> if(argc != 2)<BR> {<BR> printf("usage: %s filename", argv[0]);<BR> return -1;<BR>
}<BR> <BR> /* Open the capture file */<BR> if ((fp = pcap_open_offline(argv[1], // name of the device<BR> errbuf // error buffer<BR> )) == NULL)<BR> {<BR> fprintf(stderr,"\nUnable to open the file %s.\n", argv[1]);<BR> return -1;<BR> }<BR>
/* read and dispatch packets until EOF is reached */<BR> pcap_loop(fp, 0, dispatcher_handler, NULL);<BR>
pcap_close(fp);<BR> system("pause");<BR>
<BR> return 0;<BR>}<BR>
<BR>
void dispatcher_handler(u_char *temp1,<BR> const struct pcap_pkthdr *header,<BR> const u_char *pkt_data)<BR>{<BR> u_int i=0;<BR>
/* print pkt timestamp and pkt len */<BR> printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len);<BR>
/* Print the packet */<BR> for (i=1; (i < header->caplen + 1 ) ; i++)<BR> {<BR> printf("%.2x ", pkt_data[i-1]);<BR> if ( (i % LINE_LEN) == 0) printf("\n");<BR> }<BR>
printf("\n\n");<BR>
}<BR>
<BR>
<BR>
<BR><BR> <BR>
<BLOCKQUOTE>
<HR>
From: gianluca.varenni@cacetech.com<BR>To: winpcap-users@winpcap.org<BR>Subject: Re: RE:[Winpcap-users] unexpected warning<BR>Date: Fri, 23 Nov 2007 09:00:57 -0800<BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<DIV><FONT face="Courier New" size=2>The WinPcap developer's pack doesn't official support the Borland C++ environment, so I'm just trying to guess what's going on.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>What's the content of line 786 in wspiapi.h? That header file is a system include file (i.e. it doesn't come with WinPcap), so it's quite weird that the compiler spits out a warning on that file.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>Have a nice day</FONT></DIV>
<DIV><FONT face="Courier New" size=2>GV</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New" size=2></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=nechoe_cn@sina.com href="mailto:nechoe_cn@sina.com">nechoe_cn@sina.com</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> Thursday, November 22, 2007 4:34 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE:[Winpcap-users] unexpected warning</DIV>
<DIV><BR></DIV>
<BR>----- Original Message -----<BR>From:Ziara . <BR>To:<BR>Subject:[Winpcap-users] unexpected warning<BR>Date:07-11-23 02:15:39<BR><BR>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding-right:0px;padding-left:0px;padding-bottom:0px;padding-top:0px;}
.ExternalClass EC_BODY.hmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>
Hello, I'm now in this.. I'm using winpcap with builder c++ and when I build one example, it appear one warning said: <BR> <BR>(C++ Warning) wspiapi.h(786): W8060 Possibly incorrect assignment<BR> <BR>and, I don't know why??<BR> <BR> <BR><BR>
<HR>
Express yourself instantly with MSN Messenger! <A href="http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/" target=_blank>MSN Messenger</A> _______________________________________________ Winpcap-users mailing list Winpcap-users@winpcap.org <A href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A>
<P><BR>
<BR>
sorry,i did not study builder c++~<BR><BR><BR>-------------------------------------------------------------------<BR>贺金山上市 毒霸历史最低价 25元半年( <A href="http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2007/mail_zhuiyu_20071112.html" target=_blank>http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2007/mail_zhuiyu_20071112.html</A> )<BR><BR>===================================================================<BR>看股票最新行情,与大家分享讨论,新浪财经吧火热上线!( <A href="http://bar.sina.com.cn/channel.php?chid=1" target=_blank>http://bar.sina.com.cn/channel.php?chid=1</A> )
<HR>
<P><BR>_______________________________________________<BR>Winpcap-users mailing list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE></BLOCKQUOTE><br /><hr />Tecnología, moda, motor, viajes,…suscríbete a nuestros boletines para estar a la última <a href='http://newsletters.msn.com/hm/maintenanceeses.asp?L=ES&C=ES&P=WCMaintenance&Brand=WL&RU=http%3a%2f%2fmail.live.com' target='_new'>MSN Newsletters</a></body>
</html>