; ---------------------------------------------------------------------------
; NETWORK.ASM - Serial and network card routines  (c) 1996 - 2005 Chris Evans
; ---------------------------------------------------------------------------

majver		equ	10		;version number of the infrastructure.
MAX_ADDR_LEN	equ	16		;maximum number of bytes in our address.
MAX_HANDLE	equ	10		;maximum number of handles.
MAX_P_LEN	equ	8		;maximum type length
MAX_MULTICAST	equ	8		;maximum number of multicast addresses.
;  Packet Driver Error numbers
NO_PKT_ERROR    equ     0               ;no error at all.
BAD_HANDLE	equ	1		;invalid handle number
NO_CLASS	equ	2		;no interfaces of specified class found
NO_TYPE		equ	3		;no interfaces of specified type found
NO_NUMBER	equ	4		;no interfaces of specified number found
BAD_TYPE	equ	5		;bad packet type specified
NO_MULTICAST	equ	6		;this interface does not support
					;multicast
CANT_TERMINATE	equ	7		;this packet driver cannot terminate
BAD_MODE	equ	8		;an invalid receiver mode was specified
NO_SPACE	equ	9		;operation failed because of
					;insufficient space
TYPE_INUSE	equ	10		;the type had previously been accessed,
					;and not released.
BAD_COMMAND	equ	11		;the command was out of range, or not
					;implemented
CANT_SEND	equ	12		;the packet couldn't be sent (usually
					;hardware error)
CANT_SET	equ	13		;hardware address couldn't be changed
					;(more than 1 handle open)
BAD_ADDRESS	equ	14		;hardware address has bad length or
					;format
CANT_RESET	equ	15		;Couldn't reset interface (more than
					;1 handle open).
BAD_IOCB	equ	16		;an invalid iocb was specified

;a few useful Ethernet definitions.
RUNT		equ	60		;smallest legal size packet, no fcs
GIANT		equ	1514		;largest legal size packet, no fcs
EADDR_LEN	equ	6		;Ethernet address length.
ARCADDR_LEN	equ	1
BLUEBOOK	equ	1
IEEE8023	equ	11

next_packet             dw ?
pktlen                  dw ?
receivebuffer           dw ?
MAC         db  6 dup(2eh)             ; OS default MAC addess

include ethframe.asm

; Device names

ethernet_prefix db 'ETH', 0
network_prefix  db 'NET', 0
NetworkID       dw 2e2eh
hostname        db 'localhost      ',0
hsnsize         EQU 20                  ; HOSTNAME= should be a env. variable

include 3c50x.asm 
include NE2000.asm





