2010-03-07 5 views
3

J'essayais d'installer libpcap sous cygwin sur Windows 7 mais j'avais cette erreur: $ ./configure . . . . . configure: erreur: voir l'INSTALL pour plus d'informationsaide à l'installation de libpcap sur cygwin

Comment puis-je résoudre ce problème? J'utilise libpcap-1.0.0 qui est la dernière version.

Répondre

4

Je sais que c'est une réponse tardive, mais je suis passé par les mêmes problèmes d'installation sous Windows 7.

Sous Windows, vous devez utiliser Winpcap: http://www.winpcap.org/

8

http://mathieu.carbou.free.fr/wiki/index.php?title=How_to_install_Winpcap_/_Libpcap_under_Cygwin

libpcap développer Pack Vous trouverez de http://www.winpcap.org/devel.htm

étapes en détail comme suit:

Setup Winpcap

  1. Download and unzip the pack. We will use for this example WpdPack_4_0_1.zip.

  2. Copy libraries like this:

    • WpdPack\Lib\libpacket.a to cygwin\lib\
    • WpdPack\Lib\libwpcap.a to cygwin\lib\
  3. Create a folder cygwin\usr\include\pcap\

  4. Copy all headers from WpdPack\Include to cygwin\usr\include\winpcap\

  5. Be sure you have installed Winpcap libraries and that they are in your path by typing:

    which packet.dll 
    which wpcap.dll 
    

For me they are in /cygdrive/c/WINDOWS/system32/

Building example using Cygwin

Open a cygwin prompt to WpdPack\Examples-pcap\basic_dump\ and execute:

basic_dump:

CFLAGS="-g -Wall -mno-cygwin -I /usr/include/pcap" 
LIBS="-lwpcap" 
PROG="basic_dump" 
gcc $CFLAGS -c $PROG.c 
gcc $CFLAGS -o $PROG.exe $PROG.o $LIBS 
./$PROG.exe 

basic_dump_ex:

CFLAGS="-g -Wall -mno-cygwin -I /usr/include/pcap" 
LIBS="-lwpcap" 
PROG="basic_dump_ex" 
gcc $CFLAGS -c $PROG.c 
gcc $CFLAGS -o $PROG.exe $PROG.o $LIBS 
./$PROG.exe 

iflist:

CFLAGS="-g -Wall -mno-cygwin -I /usr/include/pcap" 
LIBS="-lwpcap" 
PROG="iflist" 
gcc $CFLAGS -c $PROG.c 
gcc $CFLAGS -o $PROG.exe $PROG.o $LIBS 
./$PROG.exe 

pcap_filter (and others):

I think you can catch the pattern ;) Only replace PROG=... by the program name and it should compile. 

UDPdump:

CFLAGS="-g -Wall -mno-cygwin -I /usr/include/pcap" 
LIBS="-lwpcap -lwsock32" 
PROG="UDPdump" 
gcc $CFLAGS -c $PROG.c 
gcc $CFLAGS -o $PROG.exe $PROG.o $LIBS 
./$PROG.exe 

You can test by doing a Time Synchronization with pool.ntp.org for example.

4

La source libpcap inclut une partie, mais pas tous, du support Windows. Les mécanismes utilisés pour capturer le trafic réseau sont très dépendants du système d'exploitation (ce qui explique pourquoi libpcap existe) pour cacher ce détail aux applications.

sur l'ONU * Xes, le mécanisme fait partie du système d'exploitation, donc libpcap ne doit pas fournir ce mécanisme. Sur Windows, il n'y a pas de mécanisme dans le système d'exploitation. WinPcap combine un pilote en mode noyau, une bibliothèque de bas niveau qui parle au pilote et un module pour libpcap qui utilise la bibliothèque de bas niveau.

La source libpcap ne comprend pas le conducteur ou la bibliothèque de bas niveau, il ne suffit pas de construire une version de libpcap pour Windows. Comme l'indiquent les autres réponses, vous avez besoin de WinPcap.