compile insert msWin_WinSock_Equates
/*
   ** Copyright (C) 2012-2022 Revelation Software Inc. All Rights Reserved **
   
   Author   Mr C
   Date     Feb 2022
   Purpose  Equates for use with Windows WinSock functions
   
   Comments
   ========
   
   Amended  Date       Reason
   =======  ====       ======
   
*/
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSWIN_WINSOCK_EQUATES_
#define _MSWIN_WINSOCK_EQUATES_
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

   declare function msWin_WSAStartup, msWin_WSACleanUp, msWin_GetLastError
   declare function msWin_GetHostByName, msWin_IcmpCreateFile
   declare function msWin_IcmpCloseHandle, msWin_IcmpSendEcho

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
   
   $uses @APPID*DLLSTRUCT**MSWIN_WSADATA
   $uses @APPID*DLLSTRUCT**MSWIN_HOSTENT
   $uses @APPID*DLLSTRUCT**MSWIN_ICMP_ECHO_REPLY
   $uses @APPID*DLLSTRUCT**MSWIN_IP_OPTION_INFORMATION
   
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

   // Address families.
   
   equ AF_UNSPEC$                to 0        ; // unspecified
   equ AF_UNIX$                  to 1        ; // local to host (pipes, portals)
   equ AF_INET$                  to 2        ; // internetwork: UDP, TCP, etc.
   equ AF_IMPLINK$               to 3        ; // arpanet imp addresses
   equ AF_PUP$                   to 4        ; // pup protocols: e.g. BSP
   equ AF_CHAOS$                 to 5        ; // mit CHAOS protocols
   equ AF_IPX$                   to 6        ; // IPX and SPX
   equ AF_NS$                    to 6        ; // XEROX NS protocols
   equ AF_ISO$                   to 7        ; // ISO protocols
   equ AF_OSI$                   to AF_ISO$  ; // OSI is ISO
   equ AF_ECMA$                  to 8        ; // european computer manufacturers
   equ AF_DATAKIT$               to 9        ; // datakit protocols
   equ AF_CCITT$                 to 10       ; // CCITT protocols, X.25 etc
   equ AF_SNA$                   to 11       ; // IBM SNA
   equ AF_DECnet$                to 12       ; // DECnet
   equ AF_DLI$                   to 13       ; // Direct data link interface
   equ AF_LAT$                   to 14       ; // LAT
   equ AF_HYLINK$                to 15       ; // NSC Hyperchannel
   equ AF_APPLETALK$             to 16       ; // AppleTalk
   equ AF_NETBIOS$               to 17       ; // NetBios-style addresses
   equ AF_VOICEVIEW$             to 18       ; // VoiceView
   equ AF_FIREFOX$               to 19       ; // FireFox
   equ AF_UNKNOWN1$              to 20       ; // Somebody is using this!
   equ AF_BAN$                   to 21       ; // Banyan

   equ AF_MAX$                   to 22

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

   equ WSADESCRIPTION_LEN$      to 256
   equ WSASYS_STATUS_LEN$       to 128
   
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

   // WSADATA Structure equates - this structure is defined in the Windows
   // API as:
   //
   // typedef struct WSAData {
   //     WORD                    wVersion;
   //     WORD                    wHighVersion;
   //     unsigned short          iMaxSockets;
   //     unsigned short          iMaxUdpDg;
   //     char FAR *              lpVendorInfo;
   //     char                    szDescription[WSADESCRIPTION_LEN+1];
   //     char                    szSystemStatus[WSASYS_STATUS_LEN+1];
   // } WSADATA;
      
   equ WSADATA$            to "MSWIN_WSADATA" 
     
   equ WSADATA_POS_VERSION$         to 1
   equ WSADATA_POS_WHIGHVERSION$    to 2
   equ WSADATA_POS_IMAXSOCKETS$     to 3
   equ WSADATA_POS_IMAXUDPDG$       to 4
   equ WSADATA_POS_LPVENDORINFO$    to 5
   equ WSADATA_POS_SZDESCRIPTION$   to 6
   equ WSADATA_POS_SZSYSTEMSTATUS$  to 7   
   
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////   
   
   // HOSTENT Structure equates:
   // 
   // typedef struct hostent {
   //   char  *h_name;
   //   char  **h_aliases;
   //  short h_addrtype;
   //  short h_length;
   //  char  **h_addr_list;
   // } HOSTENT, *PHOSTENT, *LPHOSTENT;
   
   equ HOSTENT$                     to "MSWIN_HOSTENT" 
   
   equ HOSTENT_POS_H_HAME$          to 1
   equ HOSTENT_POS_H_ALIASES$       to 2
   equ HOSTENT_POS_H_ADDRTYPE$      to 3
   equ HOSTENT_POS_H_LENGTH$        to 4
   equ HOSTENT_POS_H_ADDR_LIST$     to 5
   
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

   equ ICMP_INVALID_HANDLE_VALUE$   to -1

   // IP_OPTION_INFORMATION is defined as:
   // 
   // typedef struct ip_option_information {
   //  UCHAR  Ttl;
   //  UCHAR  Tos;
   //  UCHAR  Flags;
   //  UCHAR  OptionsSize;
   //  PUCHAR OptionsData;
   // } IP_OPTION_INFORMATION, *PIP_OPTION_INFORMATION;
   
   equ IP_OPTION_INFORMATION$      to "MSWIN_IP_OPTION_INFORMATION"
   
   equ IPOI_POS_TTL$               to 1
   equ IPOI_POS_TOS$               to 2
   equ IPOI_POS_FLAGS$             to 3
   equ IPOI_POS_OPTIONSSIZE$       to 4
   equ IPOI_POS_OPTIONSDATA$       to 5
   
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

   // ICMP_ECHO_REPLY is defined as:
   // 
   // typedef struct icmp_echo_reply {
   //  IPAddr                       Address;
   //  ULONG                        Status;
   //  ULONG                        RoundTripTime;
   //  USHORT                       DataSize;
   //  USHORT                       Reserved;
   //  PVOID                        Data;
   //  struct ip_option_information Options;
   // } ICMP_ECHO_REPLY, *PICMP_ECHO_REPLY;
   
   equ ICMP_ECHO_REPLY$             to "MSWIN_ICMP_ECHO_REPLY"
   
   equ ICMPER_POS_ADDRESS$          to 1
   equ ICMPER_POS_STATUS$           to 2
   equ ICMPER_POS_ROUNDTRIPTIME$    to 3
   equ ICMPER_POS_DATASIZE$         to 4
   equ ICMPER_POS_RESERVED$         to 5
   equ ICMPER_POS_DATA$             to 6
   
   
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#endif
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////


