Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Fri, 17 Oct 2003 16:46:02 -0400
From: Steve Coleman <Steve.Coleman@jhuapl.edu>
Subject: Re: linux/*.h include files
In-reply-to: <6.0.0.22.2.20031017154449.02788008@localhost>
To: Flavio Rabello de Souza <rabello@escelsa.com.br>
Cc: cygwin@cygwin.com
Message-id: <3F90550A.8040202@jhuapl.edu>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7BIT
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5)
 Gecko/20031007
X-Accept-Language: en-us, en
References: <6.0.0.22.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 
> 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/

