X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.9 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: <53b627ea1001060651u9dc16ddqbc3a38c7fb3f453c@mail.gmail.com> References: <53b627ea1001060651u9dc16ddqbc3a38c7fb3f453c AT mail DOT gmail DOT com> Date: Wed, 6 Jan 2010 22:09:28 +0530 Message-ID: <53b627ea1001060839r6164be69s715e4b0cae26ca58@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 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 8:21 PM, Karthik Balaguru wrote: > Hi, > I am looking for raw socket usage from cygwin environment. > In Windows, the releases after 'Windows XP with SP2' have the ability > to send traffic over raw sockets but has been restricted in following > ways: > 1. A call to the bind function with a raw socket is not allowed > 2. TCP data cannot be sent over raw sockets. > 3. UDP datagrams with invalid source addresses cannot be sent over raw > sockets. The IP source address for any outgoing UDP datagram must > exist on a network interface or the datagram is dropped. > > I got the below info from > http://www.cygwin.com/cygwin-ug-net/highlights.html#ov-hi-sockets - > '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 ? I walked through the archives & searched on the internet to find information w.r.t this. I came across the below link that clarifies regd the earlier lines. It seems 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 The below link seems to convey the problems of using the Raw sockets with Winsock and it also the restrictions info w.r.t various windows releases - http://tangentsoft.net/wskfaq/advanced.html#rawsocket Interestingly ,the below link conveys that raw sockets is supported unofficially ! http://sourceware.org/ml/cygwin/2005-10/msg00753.html But, how & why is it supported unofficially ? > 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. :-( > > But, i need raw socket for an application that i am trying to execute > from cygwin in 'Windows XP with SP2' & Vista . > How can this be achieved ? Any ideas ? > I checked with windows support in - http://www.pcbanter.net/showthread.php?t=1064624 Lemme know a workaround for using raw sockets in cygwin environment ! Is the method of usage of winpcap is the only way to use raw sockets in cygwin environment ? From 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 to use raw sockets in cygwin environment ? Thx in advans, 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