delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/01/06/17:04:24

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.3 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: <4B44EEB7.7000700@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> <53b627ea1001061149l102ce517y5b7c3797c70e6284 AT mail DOT gmail DOT com> <4B44EEB7 DOT 7000700 AT cygwin DOT com>
Date: Thu, 7 Jan 2010 03:34:11 +0530
Message-ID: <53b627ea1001061404m3a9f199bibee12fbd1858cf02@mail.gmail.com>
Subject: Re: Cygwin and raw sockets - Windows XP with SP2 , Vista and later
From: Karthik Balaguru <karthikbalaguru79 AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

On Thu, Jan 7, 2010 at 1:42 AM, Larry Hall (Cygwin) wrote:
> On 01/06/2010 02:49 PM, Karthik Balaguru wrote:
>>
>> I got the below link that conveys the problems with winpcap usage with
>> cygwin
>> 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).
>
> True.
>
>> 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
>
> There is the real potential for conflicts if you just blindly link against
> Winpcap and use it in some Cygwin app.
>
>> 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.
>
> I think you missed something key in your reading if you *really* need
> raw *socket* support above and beyond what you get from Winsock.
> Re-read your last sentence above again carefully.
>

Okay, i will try to elaborate the understanding. Lemme know if there
is anything missed out.

- Cygwin uses winsock V2 for raw socket and so basic restrictions
imposed by Winsock will constrain Cygwin as well.

- For pure Windows applications(Windows Native approach) that require
raw sockets, we can use winpcap. The purpose of WinPcap is to provide
facilities like capture/transmit/filter raw packets for Win32
applications. Although the name WinPcap indicates clearly that the
purpose of the library is packet capture, other useful features for
raw networking are provided. Among them, the user can find a complete
set of functions to send packets. WinPcap receives and sends the
packets independently from the host protocols, like TCP-IP. (Reference
- http://www.mirrorservice.org/sites/ftp.wiretapped.net/pub/security/packet-capture/winpcap/docs/docs_40_2/html/group__wpcap__tut8.html)
So, this method can be used to use raw sockets in Windows as there are
restrictions imposed on Winsocks.

- WinPcap can be used from within a cygwin environment if it is
carefully integrated with cygwin.
The link http://en.wikipedia.org/wiki/MinGW#Comparison_with_Cygwin
seem to convey that Win32 programs written with cygwin can work fine .
So, if WinPcap is carefully integrated with cygwin and WinPcap's
facilities are utilized properly by the Win32 programs written with
cygwin, raw socket usage is feasible.

>> 2.For raw socket usage in a linux based application on cygwin
>> environment, libpcap would be the right choice
>
> Right.
>

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

- Raw text -


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