[Dshield] compile with winsock.h in linux

Rohit Dhamankar rohitd at tippingpoint.com
Mon Jun 2 14:04:46 GMT 2003


 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

For some code in the past, I have found these replacements work:

1. Replace 
#include <winsock(2).h>
#include <windows.h>
by
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

2. If see USHORT, SHORT, ULONG etc
define
typedef unsigned short USHORT;

3. Replace Socket s by int s;
4. Remove WSADATA & WORD variable associated with WSAStartup call along
with the function call.

Rohit


- -----Original Message-----
From: Johannes B. Ullrich [mailto:jullrich at sans.org]
Sent: Monday, June 02, 2003 7:14 AM
To: General DShield Discussion List
Subject: Re: [Dshield] compile with winsock.h in linux


Usually, these programs need some rewriting. The closet 
replacement to winsock.h is 'socket.h'. But it works a bit
different than 'winsock.h'


On Tue, 2003-06-03 at 08:37, Nguyen Nhu Hao wrote:
> Hi all,
> I have some code in C and include winsock.h, I don't know install which
> package supports winsock.h in Linux. Could you help me ?
> Thank in advances
> Nguyen Nhu Hao
> 
> 
> 
> _______________________________________________
> list mailing list
> list at dshield.org
> To change your subscription options (or unsubscribe), see:
http://www.dshield.org/mailman/listinfo/list

_______________________________________________
list mailing list
list at dshield.org
To change your subscription options (or unsubscribe), see:
http://www.dshield.org/mailman/listinfo/list

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0

iQA/AwUBPttZs3AfgHNgKPA3EQLgRQCeJRbUshN7vmRHBmqg7l9Yyf2OBNIAn3DF
heVWMgYD7PnL6LRZNLkpVtz1
=oM94
-----END PGP SIGNATURE-----



More information about the list mailing list