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-us...@winpcap.polito.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