X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <4B44CF10.4040707@cygwin.com> References: <53b627ea1001060651u9dc16ddqbc3a38c7fb3f453c AT mail DOT gmail DOT com> <4B44BB7A DOT 5040003 AT cygwin DOT com> <53b627ea1001060921l1c54580akc03f09f4f50e8e07 AT mail DOT gmail DOT com> <4B44CF10 DOT 4040707 AT cygwin DOT com> Date: Thu, 7 Jan 2010 01:19:59 +0530 Message-ID: <53b627ea1001061149l102ce517y5b7c3797c70e6284@mail.gmail.com> Subject: Re: Cygwin and raw sockets - Windows XP with SP2 , Vista and later From: Karthik Balaguru To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Wed, Jan 6, 2010 at 11:27 PM, Larry Hall (Cygwin) wrote: > On 01/06/2010 12:21 PM, Karthik Balaguru wrote: >> >> On Wed, Jan 6, 2010 at 10:04 PM, Larry Hall (Cygwin) >> =A0wrote: > > =A0 =A0^^^^^^^^^^^^^^^^^^^ > =A0Don't feed the spammers. > Okay, Taken care ! >>> On 01/06/2010 09:51 AM, Karthik Balaguru wrote: >>>> >>>> I got the below info from >>>> http://www.cygwin.com/cygwin-ug-net/highlights.html#ov-hi-sockets =A0- >>>> 'Socket-related calls in Cygwin basically call the functions by the >>>> same name in Winsock, Microsoft's implementation of Berkeley sockets, >>>> but with lots of tweaks.' >>>> But, It does not clearly convey whether cygwin uses Microsoft's >>>> winsock . Does cygwin use winsock ? >>>> If cygwin uses winsock, then i think the raw socket usage restrictions >>>> applied for further releases from 'Windows XP with SP2' is applicable >>>> for cygwin also.:-( >>> >>> Cygwin does not provide its own implementation for sockets. =A0It uses >>> Winsock V2 so basic restrictions imposed by Winsock will constrain >>> Cygwin as well. >>> >> >> Larry, Thx for the clarification. >> >> But, I came across the below link that conveys that the network >> support in Cygwin is supposed to provide the POSIX API, not the >> Winsock API - >> http://www.cygwin.com/faq/faq.api.html#faq.api.net-functions >> What does the above link refer to ? > > Right. It's a layer over Winsock that provides an API such that programs > using the POSIX API will build. =A0That's largely syntax compatibility. = =A0The > semantics are also there for the most part but are limited by Winsock. > >> Interestingly ,the below link conveys that raw sockets is supported >> unofficially ! Strange ! >> http://sourceware.org/ml/cygwin/2005-10/msg00753.html >> But, how& =A0why is it supported unofficially ? > > It uses Winsock and is limited by it. Okay ! >> The below link seems to convey the problems of using the Raw sockets >> with Winsock and it also about the restrictions w.r.t various windows >> releases =A0- >> http://tangentsoft.net/wskfaq/advanced.html#rawsocket >> So, is the method of usage of winpcap is the only way to use raw >> sockets in cygwin environment ? >> >> =A0From http://www.winpcap.org/docs/docs_41b5/html/main.html , I find >> that the purpose of WinPcap is to give this kind of access to Win32 >> applications that it provides facilities to: >> 1. transmit raw packets 2. capture raw packets and 3. filter the packets >> Any other ideas/ways apart from winpcap to use raw sockets in cygwin >> environment ? > > Winpcap isn't a Cygwin package so this would be a Windows native approach. > If you're developing a purely Windows app, then this would be a better way > to go. > Okay, Thx for the clarification. I got the below link that conveys the problems with winpcap usage with cygw= in http://www.mail-archive.com/winpcap-users AT winpcap DOT polito DOT it/msg02534.html It seems to convey that winpcap can also easily be used with gcc using the MinGW compile environment (www.mingw.org). It also conveys that winpcap cannot be used from within a cygwin environment as it depends on the MSVCRT.dll which, innately conflicts with the cygwin1.dll So, it can be put as below in brief - 1.For raw socket usage in a purely windows based application, winpcap is the right choice. WinPcap is an open source library for packet capture and network analysis for the Win32 platforms. 2.For raw socket usage in a linux based application on cygwin environment, libpcap would be the right choice Thx, Karthik Balaguru -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple