[comp.sys.novell] IPX / SPX Functions structure

tgaffney@dit.ie (06/14/91)

;-----------------------------------------------------------------------------
;  Program      IPXSTRUC.ASM
;  Author	Mario Brazil
;  Function	Data Structures for Novell IPX / SPX Functions.
;               List of function and parameters used.
;  Contact:
;              Phone : +353-1-283-1166 
;              FAX   : +353-1-283-1232
;
;  Reference:
;	The following information was produced from various sources. For a
;	general Overview and introduction to IPX/SPX techniques the following
;	book contains most the info required.
;
;	NETWORKING PROGRAMMING IN by Barry Nance ( QUE ) ISBN 0-88022-569-6
;
;       It is also a good reference guide to Novell Advance DOS Calls
;       NetBIOS and general Network calls
;
;  (c) Copyright 1991, East Coast Software, Dublin, Ireland.
;
;-----------------------------------------------------------------------------
;IPXFunctionList:
; No    Name              Function
; 00	IPX_OpenSocket ;  IPX Open Socket
; 01	IPX_CloseSocket;  IPX Close Socket
; 02	IPX_GetTarget  ;  IPX Get Local Target
; 03	IPX_ECB_Send   ;  IPX Send Packet
; 04	IPX_ECB_Listen ;  IPX Listen For Packet
; 05	IPX_ScheduleIPX;  IPX Schedule IPX Event
; 06	IPX_Cancel_ECB ;  IPX Cancel Event
; 07	IPX_ScheduleSpl;  IPX Schedule Special Event
; 08	IPX_GetTimer   ;  IPX Get Time Marker
; 09	IPX_GetAddr    ;  IPX Get Internetwork Address
; 0a	IPX_RelCTRL    ;  IPX Relinquish Control
; 0b	IPX_Disconnect ;  IPX Disconnect From Host
; 0c	IPX_Unknown0C  ;  IPX Fun 0C		   <
; 0d	IPX_GetPackSize;  IPX Get Max Packet Size  < Novell
; 0e	IPX_Reg_Fun    ;  IPX Fun 0E		   < Extensions
; 0f	IPX_SendNCP    ;  IPX Send Netware request <

; 10	SPX_Initialize ;  SPX Initialize
; 11	SPX_EstConn    ;  SPX Establish Connection
; 12	SPX_SendConn   ;  SPX Listen For Connection
; 13	SPX_ListenConn ;  SPX Terminate Connection
; 14	SPX_AbortConn  ;  SPX Abort Connection
; 15	SPX_GetStatus  ;  SPX Get Connection Status
; 16	SPX_SendSeq    ;  SPX Send Sequenced Packet
; 17	SPX_ListenSeq  ;  SPX Listen for Sequenced Packet
; 18	SPX_Unknown18  ;  SPX Fun 18	   < Novell Extensions
; 19	SPX_Unknown19  ;  SPX Fun 19	   < Novell v3.01
; 1a	SPX_Unknown1A  ;  SPX Fun 1A	   < Novell v3.01
;
;---------------------------------------------------------------------
; Define IPX/SPX Structures
;---------------------------------------------------------------------

IPXHEADER       STRUC
checksum		DW	0		; FF FF - OK
msg_length		DW	0		; Hi Low Order
transport_control	DB      0
packet_type             DB      0
dest_network_number     DB      4 DUP (0)
dest_network_node       DB      6 DUP (0)
dest_network_socket	DW	0		; Hi Low Order
source_network_number   DB      4 DUP (0)
source_network_node     DB      6 DUP (0)
source_network_socket   DW      0
IPXHEADER       ENDS

SPXHEADER       STRUC
ipx_header              IPXHEADER ?
connection_control      DB      0
datastream_type         DB      0
source_connection_id    DW      0
dest_connection_id      DW      0
sequence_number         DW      0
acknowledge_number      DW      0
allocation_number       DW      0
SPXHEADER       ENDS

ECB             STRUC
link_address		DD	0		; FAR Pointer used after Submit
event_service_routine	DD	0		; FAR Ponter routine to run on completion
in_use			DB	0		; 00 - Finished
completion_code 	DB	0		; 00 - Success Else Error
socket_number		DW	0		; Hi Low Order
ipx_workspace		DB	4 DUP (0)	; Used by IPX
driver_workspace	DB     12 DUP (0)	; Used By IPX
immediate_address       DB      6 DUP (0)
fragment_count		DW	0		; Low Hi Order
header_address		DD	0		; FAR Pointer
header_length		DW	0		; Low Hi Order
data_address            DD      0
data_length             DW      0
data_address2		DD	0		; NCP may use more fragments
data_length2            DW      0
ECB             ENDS

SPXMSGPKT       STRUC
spx_header              SPXHEADER ?
spx_data                DB    534 DUP (?)
SPXMSGPKT       ENDS        

IPXMSGPKT       STRUC
ipx_header              IPXHEADER ?
ipx_data                DB    546 DUP (?)
IPXMSGPKT       ENDS

; Header used for FUBCTION 0F
IPXNCPHeader	STRUC
ipx_header	        IPXHEADER ?
service 		DB	2 DUP (?)	; ?? '22' WORKSTATION
msg_seq		     	DB	?
connection_id           DB      ?
service_Funct		DB	3 DUP (?)	; ??
IPXNCPHeader	ENDS

TARGET_REQ      STRUC
target_network_number   DB   4 dup (?)
target_node_address     DB   6 dup (?)
target_socket           DW   ?
TARGET_REQ      ENDS

DISCONNECT_REQ  STRUC
target_network_number   DB    4 dup (?)
target_node_address     DB    6 dup (?)
target_socket           DW    ?
DISCONNECT_REQ  ENDS

TARGET_REPLY    STRUC
immediate_node_address	DB   6 dup (?)
TARGET_REPLY    ENDS

ADDR_REPLY      STRUC
network_number          DB    4 dup (?)
node_address            DB    6 dup (?)
ADDR_REPLY      ENDS

STATUS_REPLY    STRUC
connection_status       DB      0
watchdog                DB      0
local_connection_id     DW      0
remote_connection_id    DW      0
sequence_num            DW      0
local_acknowledge_num   DW      0
local_allocation_num    DW      0
remote_acknowledge_num  DW      0
remote_allocation_num   DW      0
local_socket            DB      2 DUP (0)
SPXimmediate_address    DB      6 DUP (0)
remote_network          DB      4 DUP (0)
remote_node             DB      6 DUP (0)
remote_socket           DB      2 DUP (0)
retransmit_count        DW      0
est_roundtrip_time      DW      0
retransmitted_packets   DW      0
suppressed_packets      DW      0
STATUS_REPLY    ENDS

;
; --- IPX Function Calls

;   All Function
;       Input   : BX    - Function Number
;   Completion Code                           Function No
;       00      Success                         ( All )
;       EE      No Such Connection              ( 12 )
;       EF      Local connection table is Full  ( 11 )
;       F9      ECB cannot be canceled          ( 06 )
;       FA      No Path to Destination          ( 02 )
;       FE      Socket Table is Full            ( 00 )
;       FD      Error in ECB                    ( 11 )
;       FF      Socket Already Open             ( 00 )
;       FF      Listening Socket does not exist ( 04 )
;       FF      ECB is not in Use               ( 06 )
;       FF      Sending Socket is not Open      ( 11 )

IPXOpenSocket           EQU     00h
;	Input	: DX	- Socket No ( 00 - System Define ) ( Hi-Low Order )
;		  AL	- Socket longevity Flag
;			  00 Short-lived ( Automaticly Closed on termination of Prog. )
;			  FF Long-lived
;       Output  : AL    - Completion code
;		  DX	- Assigned Socket	( Hi-Low Order )

IPXCloseSocket	        EQU	01h
;	Input	: DX	- Assigned Socket No.	( Hi-Low Order )
;	Output	: None

IPXGetLocalTarget	EQU	02h
;       Input   : ES:SI - Request_Buffer
;                 ES:DI - Reply_Buffer
;       Output  : AL    - Completion code
;                 ES:DI - Reply_Buffer
;                 CX    - Estimated Transport Time  ( in TICKS )

IPXSendPacket		EQU	03h
;       Input   : ES:SI - ECB
;       Output  : None

IPXListenForPacket      EQU	04h
;       Input   : ES:SI - ECB
;       Output  : AL    - Immediate Completion code

IPXScheduleIPXEvent	EQU	05h
;       Input   : ES:SI - ECB
;                 AX    - Delay ticks
;       Output  : None

IPXCancelEvent		EQU	06h
;       Input   : ES:SI - ECB
;       Output  : AL    - Completion Code

IPXScheduleSpecialEvent	EQU	07h
;       Input   : ES:SI - ECB
;                 AX    - Delay ticks
;       Output  : None

IPXGetIntervalMarker	EQU	08h
;       Input   :  None
;       Output  :  AX   - Interval marker ( in TICKS )

IPXGetInternetworkAddress       EQU	09H
;       Input   : ES:SI - Reply_buffer
;       Output  : ES:SI - Reply_buffer

IPXRelinquishControl	EQU	0Ah
;       Input   : None
;       Output  : None

IPXDisconnectFromTarget	EQU	0Bh
;       Input   : ES:SI - Request_Buffer
;       Output  : None

IPXNovellFun0C		EQU	0Ch
;       Used    :       ES , AX, BX , CX , DX , SI , DI

IPXGetPacketSize        EQU	0Dh
;       Input   : None
;	Output	: AX	- Local IPX Packet Size - Over Bridge/Router 576
;		  CX	- Local IPX Header Size ??

IPXNovellFun0E          EQU     0Eh

IPXSendNetCtrlPkt       EQU     0Fh
;       Input   : ES:SI - ECB
;       Output  : None

SPXInitialize           EQU    10h
;       Input   : AL    - 00h
;       Output  : AL    - 00h     Not Installed
;                       - FFh     Installed
;                 BH    - SPX Major Version
;                 BL    - SPX Minor Version
;                 CX    - Maximun number of connection supported
;                 DX    - Number of connection available

SPXEstablishConnection  EQU     11h
;       Input   : AH    - Watchdog Flag ( 0 Disable , 1 Enable )
;                 AL    - Retry Count   ( 0 Use Default )
;                 ES:SI - ECB Pointer
;       Output  : AL    - Completion Code

SPXListenForCOnnection  EQU     12h
;       Input   : AH    - Watchdog Flag ( 0 Disable , 1 Enable )
;                 AL    - Retry Count   ( 0 Use Default )
;                 ES:SI - ECB Pointer
;       Output  : AL    - Completion Code
;                 DX    - Connection ID

SPXTerminateConnection  EQU     13h
;       Input   : DX    - Connection ID
;                 ES:SI - ECB Pointer
;       Output  : None

SPXAbortConnection      EQU     14h
;       Input   : DX    - Connection ID
;       Output  : None

SPXGetConnectionStatus  EQU     15h
;       Input   : DX    - Connection ID
;                 ES:SI - Reply_Buffer Pointer
;       Output  : AL    - 00  Success
;                       - EE  No Such Connection


SPXSendSequencedPacket  EQU     16h
;       Input   : DX    - Connection ID
;                 ES:SI - ECB Pointer
;       Output  : None

SPXListenForSeqPacket   EQU     17h
;       Input   : ES:SI - ECB Pointer
;       Output  : None

SPXNovellFun18          EQU     18h

SPXNovellFun19          EQU     19h

SPXNovellFun1a          EQU     1Ah