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