/*
 
 
NetSock.h : WinSock interface declaration
 
 
*/
 
#if !defined(__NET_SOCKDLL_TYPES__)
#define __NET_SOCKDLL_TYPES__
 
#if !defined(ONLY_TYPES)
#define NET_SOCKDLL_UNDEF
#define ONLY_TYPES
#endif /* !ONLY_TYPES */
 
/*
 * include here any other include files you need
 */
#include "PrivNetDef.h"
#include "winsock.h"
 
#if defined(NET_SOCKDLL_UNDEF)
#undef ONLY_TYPES
#undef NET_SOCKDLL_UNDEF
#endif /* !NET_SOCKDLL_UNDEF */
 
#ifdef __cplusplus
extern "C" {
#endif
typedef  SOCKET (__stdcall*tdp_fn_ui_accept)(SOCKET,struct sockaddr*,int*);
typedef  int (__stdcall*tdp_fn_i_bind)(SOCKET,const struct sockaddr*,int);
typedef  int (__stdcall*tdp_fn_i_closesocket)(SOCKET);
typedef  int (__stdcall*tdp_fn_i_connect)(SOCKET, const struct sockaddr*,int);
typedef  int (__stdcall*tdp_fn_i_ioctlsocket)(SOCKET,long,u_long*);
typedef  int (__stdcall*tdp_fn_i_getpeername)(SOCKET,struct sockaddr*,int*);
typedef  int (__stdcall*tdp_fn_i_getsockname) (SOCKET, struct sockaddr*,int*);
typedef  int (__stdcall*tdp_fn_i_getsockopt)(SOCKET,int,int,char*,int*);
typedef  u_long (__stdcall*tdp_fn_ul_htonl)(u_long);
typedef  u_short (__stdcall*tdp_fn_uw_htons)(u_short);
typedef  unsigned long (__stdcall*tdp_fn_ul_inet_addr)(const char*);
typedef  char  * (__stdcall*tdp_fn_pc_inet_ntoa)(struct in_addr);
typedef  int (__stdcall*tdp_fn_i_listen)(SOCKET,int);
typedef  u_long (__stdcall*tdp_fn_ul_ntohl)(u_long);
typedef  u_short (__stdcall*tdp_fn_uw_ntohs)(u_short);
typedef  int (__stdcall*tdp_fn_i_recv)(SOCKET,char*,int,int);
typedef  int (__stdcall*tdp_fn_i_recvfrom)(SOCKET,char*,int,int,struct sockaddr*,int*);
typedef  int (__stdcall*tdp_fn_i_select)(int,fd_set*,fd_set*,fd_set*,const struct timeval*);
typedef  int (__stdcall*tdp_fn_i_send)(SOCKET,const char*,int,int);
typedef  int (__stdcall*tdp_fn_i_sendto)(SOCKET,const char*,int,int,const struct sockaddr*,int);
typedef  int (__stdcall*tdp_fn_i_setsockopt)(SOCKET,int,int,const char*,int);
typedef  int (__stdcall*tdp_fn_i_shutdown)(SOCKET,int);
typedef  SOCKET (__stdcall*tdp_fn_ui_socket)(int,int,int);
typedef  struct hostent  *(__stdcall*tdp_fn_pst_gethostbyaddr)(const char*,int,int);
typedef  struct hostent  *(__stdcall*tdp_fn_pst_gethostbyname)(const char*);
typedef  int (__stdcall*tdp_fn_i_gethostname)(char*,int);
typedef  struct servent*(__stdcall*tdp_fn_pst_getservbyport)(int,const char*);
typedef  struct servent*(__stdcall*tdp_fn_pst_getservbyname)(const char*,const char*);
typedef  struct protoent*(__stdcall*tdp_fn_pst_getprotobynumber)(int);
typedef  struct protoent*(__stdcall*tdp_fn_pst_getprotobyname)(const char*);
typedef  int (__stdcall*tdp_fn_i_WSAStartup)(WORD,LPWSADATA);
typedef  int (__stdcall*tdp_fn_i_WSACleanup)(void);
typedef  void (__stdcall*tdp_fn_v_WSASetLastError)(int);
typedef  int (__stdcall*tdp_fn_i_WSAGetLastError)(void);
typedef  BOOL (__stdcall*tdp_fn_b_WSAIsBlocking)(void);
typedef  int (__stdcall*tdp_fn_i_WSAUnhookBlockingHook)(void);
typedef  PROC (__stdcall*tdp_fn_pfn_WSASetBlockingHook)(PROC);
typedef  int (__stdcall*tdp_fn_i_WSACancelBlockingCall)(void);
typedef  HANDLE (__stdcall*tdp_fn_h_WSAAsyncGetServByName)(HWND,u_int,const char*,const char*,char*,int);
typedef  HANDLE (__stdcall*tdp_fn_h_WSAAsyncGetServByPort)(HWND,u_int,int,const char*,char*,int);
typedef  HANDLE (__stdcall*tdp_fn_h_WSAAsyncGetProtoByName)(HWND,u_int,const char*,char*,int);
typedef  HANDLE (__stdcall*tdp_fn_h_WSAAsyncGetProtoByNumber)(HWND,u_int,int,char*,int);
typedef  HANDLE (__stdcall*tdp_fn_h_WSAAsyncGetHostByName)(HWND,u_int,const char*,char*,int);
typedef  HANDLE (__stdcall*tdp_fn_h_WSAAsyncGetHostByAddr)(HWND,u_int,const char*,int,int,char*,int);
typedef  int (__stdcall*tdp_fn_i_WSACancelAsyncRequest)(HANDLE);
typedef  int (__stdcall*tdp_fn_i_WSAAsyncSelect)(SOCKET,HWND,u_int,long);
typedef  int (__stdcall*tdp_fn_i_WSARecvEx )(SOCKET,char*,int,int*);
typedef  int (__stdcall*tdp_fn_i_WSAFDIsSet)(SOCKET, fd_set*);
#ifdef __cplusplus
}
#endif
 
typedef struct tdstWinSockFunc_
{
 tdp_fn_ui_accept m_pfn_ui_accept;
 tdp_fn_i_bind m_pfn_i_bind;
 tdp_fn_i_closesocket m_pfn_i_closesocket;
 tdp_fn_i_connect m_pfn_i_connect;
 tdp_fn_i_ioctlsocket m_pfn_i_ioctlsocket;
 tdp_fn_i_getpeername m_pfn_i_getpeername;
 tdp_fn_i_getsockname m_pfn_i_getsockname;
 tdp_fn_i_getsockopt m_pfn_i_getsockopt;
 tdp_fn_ul_htonl m_pfn_ul_htonl;
 tdp_fn_uw_htons m_pfn_uw_htons;
 tdp_fn_ul_inet_addr m_pfn_ul_inet_addr;
 tdp_fn_pc_inet_ntoa m_pfn_pc_inet_ntoa;
 tdp_fn_i_listen m_pfn_i_listen;
 tdp_fn_ul_ntohl m_pfn_ul_ntohl;
 tdp_fn_uw_ntohs m_pfn_uw_ntohs;
 tdp_fn_i_recv m_pfn_i_recv;
 tdp_fn_i_recvfrom m_pfn_i_recvfrom;
 tdp_fn_i_select m_pfn_i_select;
 tdp_fn_i_send m_pfn_i_send;
 tdp_fn_i_sendto m_pfn_i_sendto;
 tdp_fn_i_setsockopt m_pfn_i_setsockopt;
 tdp_fn_i_shutdown m_pfn_i_shutdown;
 tdp_fn_ui_socket m_pfn_ui_socket;
 tdp_fn_pst_gethostbyaddr m_pfn_pst_gethostbyaddr;
 tdp_fn_pst_gethostbyname m_pfn_pst_gethostbyname;
 tdp_fn_i_gethostname m_pfn_i_gethostname;
 tdp_fn_pst_getservbyport m_pfn_pst_getservbyport;
 tdp_fn_pst_getservbyname m_pfn_pst_getservbyname;
 tdp_fn_pst_getprotobynumber m_pfn_pst_getprotobynumber;
 tdp_fn_pst_getprotobyname m_pfn_pst_getprotobyname;
 tdp_fn_i_WSAStartup m_pfn_i_WSAStartup;
 tdp_fn_i_WSACleanup m_pfn_i_WSACleanup;
 tdp_fn_v_WSASetLastError m_pfn_v_WSASetLastError;
 tdp_fn_i_WSAGetLastError m_pfn_i_WSAGetLastError;
 tdp_fn_b_WSAIsBlocking m_pfn_b_WSAIsBlocking;
 tdp_fn_i_WSAUnhookBlockingHook m_pfn_i_WSAUnhookBlockingHook;
 tdp_fn_pfn_WSASetBlockingHook m_pfn_pfn_WSASetBlockingHook;
 tdp_fn_i_WSACancelBlockingCall m_pfn_i_WSACancelBlockingCall;
 tdp_fn_h_WSAAsyncGetServByName m_pfn_h_WSAAsyncGetServByName;
 tdp_fn_h_WSAAsyncGetServByPort m_pfn_h_WSAAsyncGetServByPort;
 tdp_fn_h_WSAAsyncGetProtoByName m_pfn_h_WSAAsyncGetProtoByName;
 tdp_fn_h_WSAAsyncGetProtoByNumber m_pfn_h_WSAAsyncGetProtoByNumber;
 tdp_fn_h_WSAAsyncGetHostByName m_pfn_h_WSAAsyncGetHostByName;
 tdp_fn_h_WSAAsyncGetHostByAddr m_pfn_h_WSAAsyncGetHostByAddr;
 tdp_fn_i_WSACancelAsyncRequest m_pfn_i_WSACancelAsyncRequest;
 tdp_fn_i_WSAAsyncSelect m_pfn_i_WSAAsyncSelect;
 tdp_fn_i_WSARecvEx m_pfn_i_WSARecvEx;
 tdp_fn_i_WSAFDIsSet m_pfn_i_WSAFDIsSet;
}tdstWinSockFunc;
 
#endif /* !__NET_SOCKDLL_TYPES__ */
 
#if !defined(ONLY_TYPES)
 
#if !defined(__NET_SOCKDLL_VARS__)
#define __NET_SOCKDLL_VARS__
 
#undef EXTERN
#undef extern
#if !defined(GLOBALS)
#define EXTERN extern
#else /* !GLOBALS */
#define EXTERN
#endif /* !GLOBALS */
 
#undef extern
#endif /* !__NET_SOCKDLL_VARS__ */
 
#if !defined (__NET_SOCKDLL_PROTOS__)
#define __NET_SOCKDLL_PROTOS__
 
NetLib_tdeErrorStatus eNetGetWinSockDesc(tdstWinSockFunc **);
NetLib_tdeErrorStatus eNetRestoreWinSock(void);
#endif /* !__NET_SOCKDLL_PROTOS__ */
 
#endif /* !ONLY_TYPES */
 
