NETNOW.H 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /****************************************************************************
  2. *
  3. * File : netnow.h
  4. * Date Created : 1/18/95
  5. * Description : NETNOW! support library header file
  6. *
  7. * Programmer(s) : Nick Skrepetos
  8. * Last Modification : 9/11/95 - 2:40:57 PM
  9. * Additional Notes :
  10. *
  11. *****************************************************************************
  12. * Copyright (c) 1994-95, HMI, Inc. All Rights Reserved *
  13. ****************************************************************************/
  14. #ifndef _HMI_NET_DEFINED
  15. #define _HMI_NET_DEFINED
  16. // equates
  17. #define _DPMI_INT 0x31
  18. // maximum number of allowable nodes
  19. #define _NETNOW_MAX_NODES 20
  20. // broadcast command
  21. #define _NETNOW_BROADCAST _NETNOW_MAX_NODES + 1
  22. // maximum number of packet in send/listen queue
  23. #define _NETNOW_MAX_SEND_PACKETS 64
  24. #define _NETNOW_MAX_LISTEN_PACKETS 64
  25. // size of data packet for transmission
  26. #define _NETNOW_DATA_PACKET 512
  27. // filler for alignment
  28. #define __HMI_FILL(a) unsigned short a;
  29. // real mode interrupt structure
  30. typedef struct _tagRMI_REGS
  31. {
  32. // system registers
  33. long EDI;
  34. long ESI;
  35. long EBP;
  36. // reserved
  37. long reserved_by_system;
  38. long EBX;
  39. long EDX;
  40. long ECX;
  41. long EAX;
  42. // system flags
  43. short flags;
  44. // segment registers
  45. short ES,DS,FS,GS,IP,CS,SP,SS;
  46. } _RMI_REGS;
  47. // set structure packing to byte alignment
  48. #pragma pack(1)
  49. // byte registers
  50. typedef struct _tagBREGS
  51. {
  52. char al, ah; unsigned short _1;
  53. char bl, bh; unsigned short _2;
  54. char cl, ch; unsigned short _3;
  55. char dl, dh; unsigned short _4;
  56. } _HMI_BREGS;
  57. // word registers
  58. typedef struct _tagWREGS
  59. {
  60. unsigned short ax; unsigned short _1;
  61. unsigned short bx; unsigned short _2;
  62. unsigned short cx; unsigned short _3;
  63. unsigned short dx; unsigned short _4;
  64. unsigned short si; unsigned short _5;
  65. unsigned short di; unsigned short _6;
  66. } _HMI_WREGS;
  67. // dword registers
  68. typedef struct _tagDREGS
  69. {
  70. unsigned int eax;
  71. unsigned int ebx;
  72. unsigned int ecx;
  73. unsigned int edx;
  74. unsigned int esi;
  75. unsigned int edi;
  76. unsigned int cflags;
  77. } _HMI_DREGS;
  78. // segment registers
  79. typedef struct _tagSREGS
  80. {
  81. unsigned short es;
  82. unsigned short cs;
  83. unsigned short ss;
  84. unsigned short ds;
  85. unsigned short fs;
  86. unsigned short gs;
  87. } _HMI_SREGS;
  88. // general register packet
  89. typedef union
  90. {
  91. _HMI_DREGS x;
  92. _HMI_WREGS w;
  93. _HMI_BREGS h;
  94. } _HMI_REGS;
  95. // reset structure packing
  96. #pragma pack()
  97. // equates for node addition
  98. enum
  99. {
  100. _NETNOW_ADD_COMPLETE,
  101. _NETNOW_ADD_DUPLICATE,
  102. _NETNOW_ADD_LIST_FULL
  103. };
  104. // equates for node deletion
  105. enum
  106. {
  107. _NETNOW_DELETE_COMPLETE,
  108. _NETNOW_DELETE_INVALID,
  109. };
  110. // error code enumerations
  111. enum
  112. {
  113. _NETNOW_NO_ERROR,
  114. _NETNOW_NO_NETWORK,
  115. _NETNOW_INIT_ERROR,
  116. _NETNOW_NO_REALMEM,
  117. _NETNOW_IPX,
  118. _NETNOW_NETBIOS,
  119. };
  120. // no node found error code
  121. #define _NETNOW_NODE_NOT_FOUND (W32)-1
  122. #include "hmiipx.h"
  123. #include "hminetb.h"
  124. #include "hmixfer.h"
  125. // set structure packing to byte alignment
  126. #pragma pack(1)
  127. // generic network address
  128. typedef union
  129. {
  130. _IPX_LOCAL_TARGET sIPX;
  131. _NETBIOS_LOCAL_TARGET sNETBIOS;
  132. } _NETNOW_NODE_ADDR;
  133. // reset structure packing
  134. #pragma pack()
  135. #endif
  136. // function prototypes from IPX/NETBIOS
  137. BOOL cdecl hmiIPXGetNetworkAddr ( _NETNOW_NODE_ADDR * sNode );
  138. W32 cdecl hmiIPXAddNode ( _NETNOW_NODE_ADDR * sNewNetwork );
  139. W32 cdecl hmiIPXNetAddrToNode ( _NETNOW_NODE_ADDR * sNetworkAddr );
  140. BOOL cdecl hmiIPXSendDataDirect ( PSTR pHeader, W32 wHSize,
  141. PSTR pData, W32 wDSize,
  142. _NETNOW_NODE_ADDR * sNode );
  143. BOOL cdecl hmiNETBIOSGetNetworkAddr ( _NETNOW_NODE_ADDR * sNode );
  144. W32 cdecl hmiNETBIOSAddNode ( _NETNOW_NODE_ADDR * sNewNetwork );
  145. W32 cdecl hmiNETBIOSNetAddrToNode ( _NETNOW_NODE_ADDR * sNetworkAddr );
  146. BOOL cdecl hmiNETBIOSSendDataDirect ( PSTR pHeader, W32 wHSize,
  147. PSTR pData, W32 wDSize,
  148. _NETNOW_NODE_ADDR * sNode );
  149. // function protoypes from netasm.asm
  150. #ifdef __cplusplus
  151. extern "C" {
  152. #endif
  153. VOID cdecl hmiINT386x ( W32 wInterrupt, _HMI_REGS * sIn, _HMI_REGS * sOut,
  154. _HMI_SREGS * sRegs );
  155. USHORT cdecl hmiGetDS ( VOID );
  156. USHORT cdecl hmiGetCS ( VOID );
  157. W32 cdecl hmiAllocateLinearMem ( W32 wSize, W32 * wAddress, W32 * wHandle );
  158. W32 cdecl hmiMapPhysicalToLinear ( W32 wHandle, W32 wPhysical, W32 wSize );
  159. #ifdef __cplusplus
  160. }
  161. #endif
  162. // function prototypes
  163. BOOL cdecl hmiNETNOWInitSystem ( W32 wNodes );
  164. BOOL cdecl hmiNETNOWUnInitSystem ( VOID );
  165. BOOL cdecl hmiNETNOWAllocateRealMem ( W32 wSize, PSTR * pPtr, W32 * wSegment );
  166. BOOL cdecl hmiNETNOWFindNodes ( W32 wNodes );
  167. W32 cdecl hmiNETNOWGetConsoleNode ( VOID );
  168. W32 cdecl hmiNETNOWGetActiveNodes ( VOID );
  169. BOOL cdecl hmiNETNOWSendData ( PSTR pHeader, W32 wHSize,
  170. PSTR pData, W32 wDSize,
  171. W32 wNode );
  172. BOOL cdecl hmiNETNOWSendDataDirect ( PSTR pHeader, W32 wHSize,
  173. PSTR pData, W32 wDSize,
  174. _NETNOW_NODE_ADDR * sNode );
  175. BOOL cdecl hmiNETNOWGetData ( PSTR pHeader, W32 wHSize,
  176. PSTR pData, W32 wDSize );
  177. W32 cdecl hmiNETNOWAddNode ( _NETNOW_NODE_ADDR * sNode );
  178. W32 cdecl hmiNETNOWDeleteNode ( W32 wNode );
  179. W32 cdecl hmiNETNOWNetAddrToNode ( _NETNOW_NODE_ADDR * sNodeAddr );
  180. VOID cdecl hmiNETNOWSortNodes ( VOID );
  181. BOOL cdecl hmiNETNOWPostListen ( VOID );
  182. BOOL cdecl hmiNETNOWGetNetworkAddr ( _NETNOW_NODE_ADDR * sNode );
  183. W32 cdecl hmiNETNOWGetNetworkType ( VOID );
  184. BOOL cdecl hmiNETNOWGetHeader ( PSTR pHeader, W32 wHSize,
  185. PSTR * pPacket );
  186. VOID cdecl hmiNETNOWGetBlock ( PSTR pPacket, PSTR pData, W32 wDSize );
  187.