delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/17/16:46:22

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 17 Oct 2003 16:46:02 -0400
From: Steve Coleman <Steve DOT Coleman AT jhuapl DOT edu>
Subject: Re: linux/*.h include files
In-reply-to: <6.0.0.22.2.20031017154449.02788008@localhost>
To: Flavio Rabello de Souza <rabello AT escelsa DOT com DOT br>
Cc: cygwin AT cygwin DOT com
Message-id: <3F90550A.8040202@jhuapl.edu>
MIME-version: 1.0
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 DOT 0 DOT 0 DOT 22 DOT 2 DOT 20031017154449 DOT 02788008 AT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019