| 1 | /* $Id: wsock32.h,v 1.9 1999-12-07 20:25:48 achimha Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /* WSOCK32.H--definitions & conversions for Odin's wsock32.dll.
|
|---|
| 4 | * Unused/unneeded Microsoft declarations removed.
|
|---|
| 5 | *
|
|---|
| 6 | * This header file corresponds to version 1.1 of the Windows Sockets specification.
|
|---|
| 7 | *
|
|---|
| 8 | * This file includes parts which are Copyright (c) 1982-1986 Regents
|
|---|
| 9 | * of the University of California. All rights reserved. The
|
|---|
| 10 | * Berkeley Software License Agreement specifies the terms and
|
|---|
| 11 | * conditions for redistribution.
|
|---|
| 12 | *
|
|---|
| 13 | */
|
|---|
| 14 |
|
|---|
| 15 | #ifndef _WINSOCK32CONST_
|
|---|
| 16 | #define _WINSOCK32CONST_
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 | /*
|
|---|
| 20 | * Structure used for manipulating linger option.
|
|---|
| 21 | */
|
|---|
| 22 | struct Wlinger {
|
|---|
| 23 | u_short l_onoff; /* option on/off */
|
|---|
| 24 | u_short l_linger; /* linger time */
|
|---|
| 25 | };
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 | /*
|
|---|
| 29 | * Structures returned by network data base library, taken from the
|
|---|
| 30 | * BSD file netdb.h. All addresses are supplied in host order, and
|
|---|
| 31 | * returned in network order (suitable for use in system calls).
|
|---|
| 32 | */
|
|---|
| 33 |
|
|---|
| 34 | struct Whostent {
|
|---|
| 35 | char * h_name; /* official name of host */
|
|---|
| 36 | char * * h_aliases; /* alias list */
|
|---|
| 37 | short h_addrtype; /* host address type */
|
|---|
| 38 | short h_length; /* length of address */
|
|---|
| 39 | char * * h_addr_list; /* list of addresses */
|
|---|
| 40 | #define h_addr h_addr_list[0] /* address, for backward compat */
|
|---|
| 41 | };
|
|---|
| 42 |
|
|---|
| 43 | /*
|
|---|
| 44 | * It is assumed here that a network number
|
|---|
| 45 | * fits in 32 bits.
|
|---|
| 46 | */
|
|---|
| 47 | struct Wnetent {
|
|---|
| 48 | char * n_name; /* official name of net */
|
|---|
| 49 | char * * n_aliases; /* alias list */
|
|---|
| 50 | short n_addrtype; /* net address type */
|
|---|
| 51 | u_long n_net; /* network # */
|
|---|
| 52 | };
|
|---|
| 53 | typedef struct Whostent WHOSTENT;
|
|---|
| 54 | typedef WHOSTENT *PWHOSTENT;
|
|---|
| 55 |
|
|---|
| 56 | struct Wservent {
|
|---|
| 57 | char * s_name; /* official service name */
|
|---|
| 58 | char * * s_aliases; /* alias list */
|
|---|
| 59 | short s_port; /* port # */
|
|---|
| 60 | char * s_proto; /* protocol to use */
|
|---|
| 61 | };
|
|---|
| 62 | typedef struct Wservent WSERVENT;
|
|---|
| 63 | typedef WSERVENT *PWSERVENT;
|
|---|
| 64 |
|
|---|
| 65 | struct Wprotoent {
|
|---|
| 66 | char * p_name; /* official protocol name */
|
|---|
| 67 | char * * p_aliases; /* alias list */
|
|---|
| 68 | short p_proto; /* protocol # */
|
|---|
| 69 | };
|
|---|
| 70 | typedef struct Wprotoent WPROTOENT;
|
|---|
| 71 | typedef WPROTOENT *PWPROTOENT;
|
|---|
| 72 |
|
|---|
| 73 | typedef struct tagWsockThreadData
|
|---|
| 74 | {
|
|---|
| 75 | int dwLastError; // Get/SetLastError
|
|---|
| 76 | struct Whostent whsnt; // database conversion buffers
|
|---|
| 77 | struct Wservent wsvnt;
|
|---|
| 78 | struct Wprotoent wptnt;
|
|---|
| 79 | struct Wnetent wntnt;
|
|---|
| 80 | struct Wlinger wlinger;
|
|---|
| 81 | } WSOCKTHREADDATA, *PWSOCKTHREADDATA;
|
|---|
| 82 |
|
|---|
| 83 | // internal prototype
|
|---|
| 84 | PWSOCKTHREADDATA iQueryWsockThreadData(void);
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 | #endif /* _WINSOCK32CONST_ */
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|