This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: linux/*.h include files


Flavio Rabello de Souza wrote:

But i still getting an error :(

Looks like its not completelly implements the linux/if_ether.h and linux/in.h :)


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.

http://cvs.tcpdump.org/cgi-bin/cvsweb/libpcap/README.Win32?rev=1.1
http://www.mail-archive.com/cgi-bin/htsearch?restrict=;exclude=;config=winpcap-users_winpcap_polito_it;method=and;format=short;words=cygwin;page=2

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.

Steve.







--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]