delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/22/21:13:44

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <20010323021241.5478.qmail@web6404.mail.yahoo.com>
Date: Fri, 23 Mar 2001 14:12:41 +1200 (NZST)
From: =?iso-8859-1?q?Danny=20Smith?= <danny_r_smith_2001 AT yahoo DOT co DOT nz>
Subject: RE: Raw Socket support using Cygwin.
To: Cygwin <cygwin AT cygwin DOT com>
MIME-Version: 1.0

> To: "Prabhune, Abhijeet" <APrabhun at ciena dot com>,<cygwin at cygwin dot
com> 
> Subject: RE: Raw Socket support using Cygwin. 
> From: "Robert Collins" <robert dot collins at itdomain dot com dot au> 
> Date: Fri, 23 Mar 2001 12:08:43 +1100 
> Thread-Index: AcCzNLmWb6XCK3qBQfygxAw1UqdU1wAAJXhw 
> Thread-Topic: Raw Socket support using Cygwin. 
 
>> -----Original Message-----
>> From: Prabhune, Abhijeet [mailto:APrabhun AT ciena DOT com]
>> Sent: Friday, March 23, 2001 12:07 PM
>> To: 'cygwin-apps AT cygwin DOT com'
>> Cc: 'cygwin-developers AT cygwin DOT com'
>> Subject: Raw Socket support using Cygwin.
>>
>>
>> Hi,
>> I am developing a program which requires Raw Ip Sockets on 
>> Windows NT 4.0
>> I know that Winsock2 provided by Microsoft does not provide 
>> this support.


Not quite true. Under NT, both winsock1 and winsock2 do support RAW SOCKETS,
but only to administrators.

The executable from this code (extract from a ping programme) produces error=0
when run by administrator, but error code 10013 (WSAEACCES) when run by
non-admin:

#include <winsock.h>
#include <stdio.h>

SOCKET icmp_open(void) {
  SOCKET s = socket (AF_INET, SOCK_RAW , IPPROTO_ICMP);
  printf("socket(type=SOCK_RAW, protocol=IPROTO_ICMP), Error code: %d \n", 
WSAGetLastError());		
  if (s == SOCKET_ERROR) {
    return (INVALID_SOCKET);
  }
  return (s);
} 

int main(){
  WSADATA wsaData;
  SOCKET a;
  if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0)
     return 255;
  a=icmp_open();
    WSACleanup();
    return 0;
}

Danny

_____________________________________________________________________________
http://calendar.yahoo.com.au - Yahoo! Calendar
- Access your appointments and meetings online.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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