[Winpcap-users] Problems with WinPcap Headers

DS bootybox at optonline.net
Tue Apr 12 14:04:05 PDT 2011


I have the following code from the website, I am using notepad to edit this
and Borland C++ compiler.  I can't get past the error can't find sys/time.h
This is for windows.  Is there a find devices code somewhere that works for
windows or is there a way to make this work,  New to all of this so any help
is appreciated.  Thank you.

DS

 

 

 

 

 

_________________________________CODE_______________________________________
________

 

#include "pcap.h"

 

main()

{

    pcap_if_t *alldevs;

    pcap_if_t *d;

    int i=0;

    char errbuf[PCAP_ERRBUF_SIZE];

    

    /* Retrieve the device list from the local machine */

    if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL /* auth is not needed
*/, &alldevs, errbuf) == -1)

    {

        fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf);

        exit(1);

    }

    

    /* Print the list */

    for(d= alldevs; d != NULL; d= d->next)

    {

        printf("%d. %s", ++i, d->name);

        if (d->description)

            printf(" (%s)\n", d->description);

        else

            printf(" (No description available)\n");

    }

    

    if (i == 0)

    {

        printf("\nNo interfaces found! Make sure WinPcap is installed.\n");

        return;

    }

 

    /* We don't need any more the device list. Free it */

    pcap_freealldevs(alldevs);

}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20110412/22c2ed81/attachment.html>


More information about the Winpcap-users mailing list