[Winpcap-users] unexpected warning

Gianluca Varenni gianluca.varenni at cacetech.com
Wed Nov 28 17:37:28 GMT 2007


That line doesn't have anything to do with WinPcap (that file is part of either the Microsoft Platform SDK or the Builder C++ header files). I'm actually quite surprised that a system include file spits out such a warning.

Regarding the issue of the application opening and closing immediately, have you debugged it? If you read the code, it needs a trace file name as first command line parameter. And then the sample reads the packets from the trace file and prints the length and timestamp of each packet in the file.

Have a nice day
GV

  ----- Original Message ----- 
  From: Ziara . 
  To: winpcap-users at winpcap.org 
  Sent: Monday, November 26, 2007 6:56 AM
  Subject: RE: [Winpcap-users] unexpected warning


  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.
   
  But when I compile a example, It appear this warning, and the content of line 786 in wspiapi.h is:
   
  if ((iFlags & NI_NOFQDN) && (pc = strchr(pszNode, '.')))
   
  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.
   
  this is the example:
   
  void dispatcher_handler(u_char *, const struct pcap_pkthdr *, const u_char *);
  main(int argc, char **argv)
  {
   pcap_t *fp;
   char errbuf[PCAP_ERRBUF_SIZE];
   
   if(argc != 2)
   {
    printf("usage: %s filename", argv[0]);
    return -1;
   }
   
   /* Open the capture file */
   if ((fp = pcap_open_offline(argv[1],   // name of the device
         errbuf     // error buffer
         )) == NULL)
   {
    fprintf(stderr,"\nUnable to open the file %s.\n", argv[1]);
    return -1;
   }
   /* read and dispatch packets until EOF is reached */
   pcap_loop(fp, 0, dispatcher_handler, NULL);
   pcap_close(fp);
    system("pause");

   return 0;
  }
   
  void dispatcher_handler(u_char *temp1,
        const struct pcap_pkthdr *header,
        const u_char *pkt_data)
  {
   u_int i=0;
   /* print pkt timestamp and pkt len */
   printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len);
   /* Print the packet */
   for (i=1; (i < header->caplen + 1 ) ; i++)
   {
    printf("%.2x ", pkt_data[i-1]);
    if ( (i % LINE_LEN) == 0) printf("\n");
   }
   printf("\n\n");
  }
   
   


   


----------------------------------------------------------------------------
    From: gianluca.varenni at cacetech.com
    To: winpcap-users at winpcap.org
    Subject: Re: RE:[Winpcap-users] unexpected warning
    Date: Fri, 23 Nov 2007 09:00:57 -0800


    The WinPcap developer's pack doesn't official support the Borland C++ environment, so I'm just trying to guess what's going on.

    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.

    Have a nice day
    GV


      ----- Original Message ----- 
      From: nechoe_cn at sina.com 
      To: winpcap-users at winpcap.org 
      Sent: Thursday, November 22, 2007 4:34 PM
      Subject: RE:[Winpcap-users] unexpected warning



      ----- Original Message -----
      From:Ziara . 
      To:
      Subject:[Winpcap-users] unexpected warning
      Date:07-11-23 02:15:39

      Hello, I'm now in this.. I'm using winpcap with builder c++ and when I build one example, it appear one warning said: 
       
      (C++ Warning) wspiapi.h(786): W8060 Possibly incorrect assignment
       
      and, I don't know why??
       
       


--------------------------------------------------------------------------
      Express yourself instantly with MSN Messenger! MSN Messenger _______________________________________________ Winpcap-users mailing list Winpcap-users at winpcap.org https://www.winpcap.org/mailman/listinfo/winpcap-users 

       
      sorry,i did not study builder c++~


      -------------------------------------------------------------------
      贺金山上市 毒霸历史最低价 25元半年( http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2007/mail_zhuiyu_20071112.html )

      ===================================================================
      看股票最新行情,与大家分享讨论,新浪财经吧火热上线!( http://bar.sina.com.cn/channel.php?chid=1 ) 


--------------------------------------------------------------------------


      _______________________________________________
      Winpcap-users mailing list
      Winpcap-users at winpcap.org
      https://www.winpcap.org/mailman/listinfo/winpcap-users




------------------------------------------------------------------------------
  Tecnología, moda, motor, viajes,…suscríbete a nuestros boletines para estar a la última MSN Newsletters 


------------------------------------------------------------------------------


  _______________________________________________
  Winpcap-users mailing list
  Winpcap-users at winpcap.org
  https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20071128/78b58c84/attachment.htm


More information about the Winpcap-users mailing list