This is the mail archive of the
mailing list for the Cygwin project.
Re: linux/*.h include files
- From: Steve Coleman <Steve dot Coleman at jhuapl dot edu>
- To: Flavio Rabello de Souza <rabello at escelsa dot com dot br>
- Cc: cygwin at cygwin dot com
- Date: Fri, 17 Oct 2003 16:46:02 -0400
- Subject: Re: linux/*.h include files
- References: <188.8.131.52.2.20031017154449.02788008@localhost>
Flavio Rabello de Souza wrote:
But i still getting an error :(
Looks like its not completelly implements the linux/if_ether.h and
the error message i got:
$ gcc -o sniffer sniffer.c
sniffer.c: In function `main':
sniffer.c:14: error: `PF_PACKET' undeclared (first use in this function)
sniffer.c:14: error: (Each undeclared identifier is reported only once
sniffer.c:14: error: for each function it appears in.)
sniffer.c:15: error: `ETH_P_IP' undeclared (first use in this function)
do you have any suggestion?
Well you have not given enough information for us to guess what you are
doing, and it's probably a little off topic here, but I'll try anyway... ;-)
First I will say that I am not an expert in using raw sockets so I can
not help you very much beyond this point with finding the definitions
you need on cygwin, unless I find a little extra spare time on my hands
(lol). But, if you are trying to compile the same "sniffer.c" program
that I located on the web, which btw *IS* linux specific such as your
errors indicate, then I would have to suggest that instead you look into
using the libpcap library (for windows libwpcap
http://winpcap.polito.it/default.htm). It impliments most of the
functionality of raw sockets, and then some! It is designed for network
diagnostics and security monitoring in mind, and it's supposed to be
portable as well. If you are just trying to learn about networks and
security it will be time well invested.
There are many Unix/Windows networking and security applications that
use this library. Personally I just use windump from the cygwin command
line, or ethereal via a windows gui. Windump is not a "cygwin"
application. A little time invested in learning it may help you design
your network applications faster, more portable, and more robust. Just
do a quick google for libpcap and see for yourself! And while you are at
it, google for libwpcap, which is the windows version.
I hope this helps.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html