;----------------------------------------------------------------------------
;File name:	GLOBDEFS.SH			Revision date:	1997.07.27
;C->S Port by:	Ulf Ronald Andersson		Port begun:	1996.08.13
;Original C by:	Dan Ackerman & Steve Adam
;----------------------------------------------------------------------------
;
;/*  globdefs.h          (c) Steve Adam 1995         steve@netinfo.com.au
; *
; *  Various global definitions.
; *
; *  Should probably be first header included after the <standard> stuff
; *
; *  I decided to put the various header data structures in here too
; */
;
;;;TCP_DRIVER_VERSION	=	"01.11"
;
;/*
; *  A sensible concession to portability and clarity.
; */
;
;typedef char int8;
;typedef unsigned char uint8, octet;
;typedef int int16;
;typedef unsigned int uint16;
;typedef long int32;
;typedef unsigned long uint32;
;
;
;	/* TCP defines */
;
MAXINT16	equ    65535
MSL2		equ       30	;/* Guess at two maximum-segment lifetimes   */
TWAIT_DEF	equ       15	;/* Default wait time for TTIME_WAIT state   */
MIN_RTO		equ      500	;/* Minimum timeout, milliseconds            */
;
MAX_STATES	equ	12 	;/* was 16 must be > 2 and < 256 */
MAX_HDR		equ	128	;/* XXX 4bsd-ism: should really be 128 */
;
;
;	/* IP defines */
;
IP_MAXOPT	equ	40	/* Largest option field, bytes */
;
;
;	/* Fields in option type byte */
;
OPT_COPIED	equ	$80	/* Copied-on-fragmentation flag */
OPT_CLASS	equ	$60	/* Option class */
OPT_NUMBER	equ	$1f	/* Option number */
;
;
;	/* IP option numbers */
;
IP_EOL		equ	0	/* End of options list */
IP_NOOP		equ	1	/* No Operation */
IP_SECURITY	equ	2	/* Security parameters */
IP_LSROUTE	equ	3	/* Loose Source Routing */
IP_TIMESTAMP	equ	4	/* Internet Timestamp */
IP_RROUTE	equ	7	/* Record Route */
IP_STREAMID	equ	8	/* Stream ID */
IP_SSROUTE	equ	9	/* Strict Source Routing */
;
;
;	/* Timestamp option flags */
;
TS_ONLY		equ	0	/* Time stamps only */
TS_ADDRESS	equ	1	/* Addresses + Time stamps */
TS_PRESPEC	equ	3	/* Prespecified addresses only */
;
;
;	/*  Atari standard Bios devices */
;
CON		equ	2   /* Console keyboard/display, output, and input */
;
;
;	/*  It is taken for granted that my C compiler creates these structures
;	 *  in exactly the order shown.  Other compilers *probably* do too.
;	 */
;
;	/* The minimum IP header */
;
;In C this was struct ip_header and typedef... IP_HDR
;For assembly each offset gets the prefix iph_
;
	struct	iph
	d_alias	iph_ver
	d_field	iph_ihl,8
	d_bits	iph_ver_bs,4	;ubit 7..4 = IP version
	d_bits	iph_ihl_bs,4	;ubit 3..0 = IP Header Length
	uint8	iph_tos		;ub = Type of Service
	uint16	iph_len		;sw = Total length, 16 bits
	uint16	iph_id		;uw = Identification, 16 bits
	uint16	iph_ofst	;sw = Fragment offset, 16 bits, includes Flags
	uint8	iph_ttl		;ub = Time to live, 8 bits
	uint8	iph_ptcl	;ub = Protocol, 8 bits
	uint16	iph_sum		;uw = Header checksum, 16 bits
	uint32	iph_s_ip	;ul = Source Address, 32 bits
	uint32	iph_d_ip	;ul = Destination Address, 32 bits                */
;   	/*char optlen;		 Length of options field, bytes */
;	/*char options[IP_MAXOPT]; Options field */
	d_end	iph
;
;/* len and ofst used to be uint16 */
;
;
;	/*  IP version number.  */
;
IP_VERSION	equ	  4
;
;
SLF_ESC		equ	$01		;/* next char is escaped */
SLF_DROP	equ	$02		;/* drop this packet */
SLF_LINKED	equ	$04		;/* interface is linked to device */
SLF_COMPRESS	equ	$08		;/* turn on VJ compression */
SLF_AUTOCOMP	equ	$10		;/* enable comp. on TCP_UNCOMP. frame */
SLF_COMPCID	equ	$20		;/* enable CID compression */
SLF_USRMASK	equ	(SLF_COMPRESS|SLF_AUTOCOMP|SLF_COMPCID)
;
;
;	/*  Values for IP header Protocol field    */
;
P_ICMP		equ	   1
P_TCP		equ	   6
P_UDP		equ	  17
;
;
;	/* packet types */
;
TYPE_IP			equ	$40
TYPE_UNCOMPRESSED_TCP	equ	$70
TYPE_COMPRESSED_TCP	equ	$80
TYPE_ERROR		equ	$00
;
;
;	/* well-defined IP protocols */
;
IPPROTO_IP		equ	0
IPPROTO_ICMP		equ	1
IPPROTO_TCP		equ	6
IPPROTO_UDP		equ	17
IPPROTO_RAW		equ	255
IPPROTO_MAX		equ	IPPROTO_RAW
;
;;;#define IS_INET_PROTO(p) \
;;;	((p) == IPPROTO_ICMP || (p) == IPPROTO_TCP || (p) == IPPROTO_UDP)
;
;
;	/* well-known IP ports */
;
IPPORT_RESERVED		equ	1024
IPPORT_USERRESERVED	equ	5000
;
;
;	/*  Fragment flags  (or'd with fragment field) */
;
FLAG_LF 	equ	$0000
FLAG_DF 	equ	$4000
FLAG_MF 	equ	$2000
;
;
;	/* flag values */
;
SLF_TOSS 	equ	1	;/* tossing rcvd frames because of input err */
;
;
;/*  ICMP Subheader structure.
; *
; *      Note that the Second half of the ICMP header has different
; *  meaning depending on circumstance.  I have labelled it as
; *  Identifier and Sequence because they are the only uses I
; *  intend to make of it.
; */
;
;In C this was struct icmp_header and typedef... ICMP_HDR
;For assembly each offset gets the prefix icmph_
;
	struct	icmph
	uint8	icmph_type	;ub = Icmp message type
	uint8	icmph_code	;ub = Various meanings depending on Type
	uint16	icmph_sum	;uw = Checksum of the ICMP header and data
	uint16	icmph_id	;uw = Packet identifier (For ping etc.)
	uint16	icmph_seq	;uw = Packet sequence (For ping etc.)
	d_end	icmph
;
;
;In C this was struct tcp_header and typedef... TCP_HDR
;For assembly each offset gets the prefix tcph_
;
	struct	tcph
	uint16	tcph_sport	;uw = Source Port
	uint16	tcph_dport	;uw = Destination Port
;;;URAn NB: I changed 'seq' & 'ack' below back to signed long
	int32	tcph_seq	;sl = Sequence Number
	int32	tcph_ack	;sl = Acknowledge Number
	d_field	tcph_ofst,8	;ubit 7..4 = Offset to TCP data in longs
	d_bits	tcph_ofst_bs,4
;-------------------------------; bit 3..0 = Filler bits (reserved)
	d_alias	tcph_f_urg
	d_alias	tcph_f_ack
	d_alias	tcph_f_psh
	d_alias	tcph_f_rst
	d_alias	tcph_f_syn
	d_alias	tcph_f_fin
	d_field	tcph_flags,8	;URAn addition for combined flag tests
	d_bits	tcph_f_free,2	; bit 7..6 = Filler bits (reserved)
	d_bits	tcph_f_urg_bs,1	;ubit 5 = URG flag
	d_bits	tcph_f_ack_bs,1	;ubit 4 = ACK flag
	d_bits	tcph_f_psh_bs,1	;ubit 3 = PSH flag
	d_bits	tcph_f_rst_bs,1	;ubit 2 = RST flag
	d_bits	tcph_f_syn_bs,1	;ubit 1 = SYN flag
	d_bits	tcph_f_fin_bs,1	;ubit 0 = FIN flag
	uint16	tcph_window	;uw = Current Window Size
	uint16	tcph_sum	;uw = Checksum Field
	uint16	tcph_urgent	;uw = Urgent Pointer
	d_end	tcph
;
;
;In C this was struct udp_header and typedef... UDP_HDR
;For assembly each offset gets the prefix udph_
;
	struct	udph
	uint16	udph_sport	;uw = Udp Source Port
	uint16	udph_dport	;uw = Udp Destination Port
	uint16	udph_length	;uw = Udp header + data length
	uint16	udph_sum	;uw = Checksum incl. pseudo hdr
	d_end	udph
;
;
;	/* Pseudo header for TCP and UDP checksum calculations      */
;
;In C this was struct pseudo_header and typedef... PH
;For assembly each offset gets the prefix pseh_
;
	struct	pseh
	uint32	pseh_s_ip	;ul = Source IP address
	uint32	pseh_d_ip	;ul = Destination IP address
	uint16	pseh_ptcl	;uw = Protocol (P_UDP, P_TCP)
	uint16	pseh_len	;uw = Message + hdr size
	d_end	pseh
;
;
;/* Generic Packet structure
; *  *Every* packet processed by this system will
; *  will reside in a GPKT structure.
; *  Some of the elements of this structure will be specific
; *  to particular parts of the code.  Other code will ignore
; *  them entirely.
; *
; *  If this changes, update initialiser packet in packet.c
; */
;
;In C this was struct gpkt and typedef... GPKT
;For assembly each offset gets the prefix gpkt_
;
	struct	gpkt
	char_p	gpkt_fp		;->char = Pointer to start of packet for KRfree()
	struc_p	gpkt_pip	;->pkt  = Points to an IP pkt or NULL  (ie: base of pkt)
	struc_p	gpkt_mp		;->mess = Points to message. (ie: Following IP header)
	char_p	gpkt_data	;->data = Points actual data (ie: After all headers)
	int16	gpkt_ip_len	;sw = Length of the IP packet.  (Including header)
	int16	gpkt_mlen	;sw = Generic message contents size
	int16	gpkt_dlen	;sw = Size of data space that follows all headers.
	struc_p	gpkt_next	;->gpkt = Points to next gpkt in queue or NULL
	d_end	gpkt
;
GPNULL		equ	0
;
;
;In C this was struct output_queue and typedef... OUTQ
;For assembly each offset gets the prefix outq_
;
	struct	outq
	uint16	outq_size	;uw = Size of buffer
	uint16	outq_cnt	;uw = Count of bytes in buffer
	uint16	outq_nw		;uw = Next pos to write into buf
	uint16	outq_nr		;uw = Next pos to read from buf
	d_alias	outq_buf	;char	buf[0]; /* Ptr to the actual buffer     */
	d_end	outq
;
;NB: The above assumes buffer follows immediately after outq_nr
;
;
;	/*  The TCP TCB and related structures  */
;
;In C this was struct tcp_tcb and typedef... TCB
;For assembly each offset gets the prefix tcb_
;
	struct	tcb
	struc_p	tcb_pq		;->queue = The pend queue (For incoming out of order)
	struc_p	tcb_outq	;->queue = TCP output queue
	uint16	tcb_rmss	;uw = Remote Max segment size.  Default 536
	uint16	tcb_tos		;uw = Type of service for this connection
	uint8	tcb_type	;ub = Type of ICMP error packet
	uint8	tcb_code	;ub = Code of ICMP error packet
;
	d_alias	tcb_snd		;substructure snd
	uint32	tcb_snd_una	;ul = Send unacknowledged
	uint32	tcb_snd_nxt	;ul = Send next
	uint32	tcb_snd_ptr	;ul = 
	uint32	tcb_snd_wl1	;ul = Sequence number used for last window update
	uint32	tcb_snd_wl2	;ul = Ack number used for last window update
	uint16	tcb_snd_wnd	;uw = Send Window
	uint16	tcb_snd_up	;uw = Send Urgent Pointer
;
	uint32	tcb_iss		;ul = Initial Send sequence number
;
	d_alias	tcb_rcv		;substructure rcv
	uint32	tcb_rcv_nxt	;ul = Receive next
	uint16	tcb_rcv_wnd	;uw = Receive window
	uint16	tcb_rcv_up	;uw = Receive Urgent Pointer
;
	uint32	tcb_irs		;ul = Initial receive sequence number
	int16	tcb_backoff	;sw = Powers of two to multiply RTO by.
	uint16	tcb_prc		;uw = Precedence value.
	int16	tcb_dupacks	;sw = Duplicate Ack count
	int16	tcb_cwind	;sw = Congestion window
	int16	tcb_ssthresh	;sw = Slow-start threshold
	int32	tcb_rttseq	;sl = Sequence number being timed
	int16	tcb_sndcnt	;sw = Number of unack'd seq numbers on send queue
	int32	tcb_resent	;sl = Count of retransmitted bytes
	int8	tcb_state	;sb = Current TCB state
	int8	tcb_send_ack	;sb = TRUE if an ACK is required to be sent
	int8	tcb_retran	;sb = Retransmission flag
	int8	tcb_rtt_run	;sb = Retransmit timer flag
	int8	tcb_synack	;sb = Our SYN has been acked
	int32	tcb_rtt_time	;sl = Stored clock values for RTT
	int32	tcb_srtt	;sl = Smoothed Round Trip Timer, in 200hz ticks
	int32	tcb_mdev	;sl = RTT deviation.  From Phil Karn's KA9Q
	int32	tcb_wt		;sl = Timer for TIME_WAIT state
	int32	tcb_lastactive	;sl = ?
	int32	tcb_timer_d	;sl = Timer Duration.
	int32	tcb_timer_e	;sl = Expiration.  RTT or TIME_WAIT time or zero
	d_end	tcb
;
;
TCPDUPACKS	equ	3
;
AGAIN		equ	8	;/* From KA9Q..  Thanks Phil..   */
LAGAIN		equ	3
DGAIN		equ	4
LDGAIN		equ	2
;
;;;#define abs(x)      (x>=0?x:-x)
;;;#define min(x,y)    (x<=y?x:y)
;;;#define max(x,y)    (x<y?y:x)
;
;
;	/* TCP connection states    */
;
TCLOSED		equ  0   ;No connection.  Null, void, absent, .....        */
TLISTEN		equ  1   ;Wait for remote request.  Not used here.         */
TSYN_SENT	equ  2   ;Connect request sent.  Await matching request    */
TSYN_RECV	equ  3   ;Wait for connection ACK.  (Listener only??)      */
TESTABLISH	equ  4   ;Connection is established.  Handshake completed  */
TFIN_WAIT1	equ  5   ;Await termination request or acknowledgement     */
TFIN_WAIT2	equ  6   ;Await termination request.                       */
TCLOSE_WAIT	equ  7   ;Await termination request from local user        */
TCLOSING	equ  8   ;Await termination acknowledge from remote TCP    */
TLAST_ACK	equ  9   ;Await acknowledgement of terminate request sent  */
TTIME_WAIT	equ 10   ;Delay to ensure remote has received term' ACK    */
;
;
;	/* TCP and connection ERROR states. */
;
E_NORMAL	equ  0	;No error occured...
E_OBUFFULL	equ -1	;Output buffer is full
E_NODATA	equ -2	;No data available.
E_EOF		equ -3	;EOF from remote..
E_RRESET	equ -4	;RST received from remote.
E_UA		equ -5	;RST.  Other end sent unacceptable pkt
E_NOMEM		equ -6	;Something failed due to lack of memory
E_REFUSE	equ -7	;Connection refused by remote
E_BADSYN	equ -8	;A SYN was received in the window
E_BADHANDLE	equ -9	;Bad connection handle used.
E_LISTEN	equ -10	;The connection is in LISTEN state
E_NOCCB		equ -11	;No free CCB's available
E_NOCONNECTION	equ -12	;No connection matches this packet. (TCP)
E_CONNECTFAIL	equ -13	;Failure to connect to remote port. (TCP)
E_BADCLOSE	equ -14	;Invalid TCP_close() requested
E_USERTIMEOUT	equ -15	;A user function timed out
E_CNTIMEOUT	equ -16	;A the connection timed out
E_CANTRESOLVE	equ -17	;Can't resolve the hostname
E_BADDNAME	equ -18	;Domain name or Dotted Dec.  bad format
E_LOSTCARRIER	equ -19	;The modem disconnected
E_NOHOSTNAME	equ -20	;Hostname does not exist
E_DNSWORKLIMIT	equ -21	;Resolver Work limit reached
E_NONAMESERVER	equ -22	;No nameservers could be found for query
E_DNSBADFORMAT	equ -23	;Bad format of DS query
E_UNREACHABLE	equ -24	;Destination unreachable
E_DNSNOADDR	equ -25	;No address records exist for host
E_LASTERROR	equ  25	;ABS of last error code in this list
;
;
;	/* Input queue structures   */
;
;In C this was struct ndb and typedef... NDB for 'Network Data Block'
;For assembly each offset gets the prefix ndb_
;
	struct	ndb
	void_p	ndb_ptr		;->base = Pointer to base of block. (For free();)
	char_p	ndb_ndata	;->data = Pointer to next data to deliver
	uint16	ndb_len		;uw = Length of remaining data.
	struc_p	ndb_next	;->ndb  = Next NDB in chain or NULL
	d_end	ndb
;
;
;In C this was struct ccb and typedef... CCB for 'Connection Control Block'
;For assembly each offset gets the prefix ccb_
;
	struct	ccb
	uint16	ccb_protocol	;uw = TCP or UDP or ... 0 means CCB not in use
	uint16	ccb_lport	;uw = TCP client port.  (ie: At this machine)
	uint16	ccb_rport	;uw = TCP server port.  (ie: remote machine)
	uint32	ccb_rhost	;ul = TCP server IP addr. (ie: remote machine)
	struc_p	ccb_ndq		;->ndb  = Start of stream data queue or NULL
	struc_p	ccb_tcb		;->tcb  = The TCB for a TCP connection only...
	int16	ccb_error	;sw = Is the connection in error?
	d_end	ccb
;
;
;/*
; * "state" data for each active tcp conversation on the wire.  This is
; * basically a copy of the entire IP/TCP header from the last packet
; * we saw from the conversation together with a small identifier
; * the transmit & receive ends of the line use to locate saved header.
; */
;
;In C this was struct cstate and used a prefix cs_
;For assembly each offset gets the same prefix cs_
;
	struct	cs
	struc_p	cs_next		;->cstate = next most recently used cstate (xmit only)
	uint16	cs_hlen		;uw = size of hdr (receive only)
	uint8	cs_id		;ub = connection # associated with this state
	uint8	cs_filler	;ub
;
	d_w	cs_slcs_u	;;;
;;;	d_s	cs_slcs_u,MAXHDR	;subunion slcs_u
csu_hdr		equ 0
csu_ip		equ 0
cs_hdr	 	equ cs_slcs_u+csu_hdr
cs_ip		equ cs_slcs_u+csu_ip	;ip/tcp hdr struct from most recent packet
	d_end	cs
;
;
;/*
; *  Serial line state - we need one per line 
; *
; */
;
;In C this was struct slcompress
;For assembly each offset gets the prefix slcm_
;
	struct	slcm
	struc_p	slcm_last_cs	;->cstate = most recently used tstate
	uint8	slcm_last_recv	;ub = last rcvd conn. id
	uint8	slcm_last_xmit	;ub = last sent conn. id
	int16	slcm_flags	;sw = was unsigned - Dan
	d_s	slcm_tstate,4*MAX_STATES	;[]->cstate = xmit connection states
	d_s	slcm_rstate,4*MAX_STATES	;[]->cstate = receive connection states
	d_end	slcm
;
;
;In C this was struct slip
;For assembly each offset gets the prefix slip_
;
	struct	slip
	struc_p	slip_bdev	;->DEV_LIST = backlink to interface
	int16	slip_flags	;sw = misc flags
	struc_p	slip_comp	;->slcm = states for VJ compression
	d_end	slip
;
;
CNMAX		equ	100		/* Maximum connections at any time.			*/
DFMAX		equ	20    		/* Max number of reassembly buffers.		*/
MAX_QUERY	equ	20		/* Max number of DNS queries.				*/
;
;
;/* These are not always defined anywhere else,
; *  In particular not in MWC standard headers.
; */
;
TRUE	equ	1
FALSE	equ	0
;
;
;/*  The elog[] array is a total count of various things that
; *  happen during a session.  The counts are usually, but
; *  not necessarily errors.  For example, a count is kept
; *  of the total number of packets created, and another of
; *  the total number deleted.  If these don't match at the
; *  end of the program, then some have been left hanging
; *  hanging around somewhere.  This could have implications
; *  for memory usage (ie: wastage).
; */
;
NS_SENT		equ  0	;Packet sent normally
EI_VERSION	equ  1	;Bad IP version
EI_SUM		equ  2	;IP header checksum failure
EI_ADDRESS	equ  3	;Not addressed to us
EI_PROTOCOL	equ  4	;Unsupported protocol
EI_ICMPTYPE	equ  5	;Unsupported ICMP message type
EI_ICMPSUM	equ  6	;ICMP Checksum failure
EI_SNDPROTO	equ  7	;Sending unknown protocol
NI_REPLYPING	equ  8	;Normal ping response discarded
EU_UDPSUM	equ  9	;UDP header checksum failure
EI_NOLISTEN	equ 10	;ICMP no ping listener
TOT_CREATED	equ 11	;Count of packets created
TOT_DELETED	equ 12	;Count of packets deleted
NI_FRAGMENT	equ 13	;Number of fragments received
EU_NOPORT	equ 14	;No active UDP port
NT_QUEUEDOK	equ 15	;TCP input packet queued OK
EF_LISTFULL	equ 16	;Refrag descriptor list full
EA_NOMEMORY	equ 17	;Block creation fail.  No memory?
EI_URNET	equ 18	;ICMP in, net unreachable
NOT_CREATED	equ 19	;Couldn't create packet
NF_ADDFRAG	equ 20	;Fragment was copied OK
EI_URHOST	equ 21	;ICMP in, host unreachable
EI_TTLZERO	equ 22	;Packet discarded due to TTL = 0
NU_QUEUEDOK	equ 23	;UDP input packet queued OK
ET_TCPSUM	equ 24	;TCP header checksum failure
ET_NOCONNECT	equ 25	;No connection for packet
EI_URPROTO	equ 26	;ICMP in, protocol unreachable
NT_SYNRECV	equ 27	;A SYN has been received
NT_PKTEMPTY	equ 28	;A packet with no data received
EI_URPORT	equ 29	;ICMP in, port unreachable
NT_RETRANSMIT	equ 30	;TCP retransmissions
ET_PQDROP	equ 31	;Closing, Pending packet dropped
CI_LOCALIN	equ 32	;Bytes in from provider
CI_LOCALOUT	equ 33	;Bytes out to provider
ET_LISTEN	equ 34	;Listen state (not possible!)
ET_RMRESET	equ 35	;Remote RESET the connection
CI_FOREIGNIN	equ 36	;Bytes in from other hosts
ET_NOSYNRST	equ 37	;Unsynch'd pkt has no SYN or RST
CI_FOREIGNOUT	equ 38	;Bytes out to other hosts
ET_NOACK	equ 39	;Packet has no ACK
ET_NODATASTATE	equ 40	;Data ignored due to TCP state
ET_DUPDATA	equ 41	;Duplicate data discarded
EI_TCPICMP	equ 42	;A tcp icmp message was delivered
NT_CLOSING	equ 43	;Session is closing. Fin acked
EI_TTLTRANS	equ 44	;TTL exceeded in transit
EI_TTLFRAG	equ 45	;Frag TTL reassembled
EI_BADPARAM	equ 46	;Parameter problem
EI_QUENCH	equ 47	;Source quench message received
EI_ECHOREQUEST	equ 48	;Echo Request received
EI_ECHOREPLY	equ 49	;Echo reply received
EI_DFBEXCEEDED	equ 50	;Defrag buffer size exceeded
E_REASONS	equ 51	;Size of elog array
;
;
;/*  The global configuration data structure.  Contains *ALL*
; *  relevant configurable values.  Defined in config.c
; */
;
;In C this was struct config and typedef... CONFIG
;For assembly each offset gets the prefix cfg_
;
	struct	cfg
	uint32	cfg_client_ip	;ul = IP address of client (local) machine
	uint32	cfg_provider	;ul = IP address of provider, or 0L
	uint16	cfg_ttl		;uw = Default TTL for normal packets
	uint16	cfg_ping_ttl	;uw = Default TTL for `ping'ing
	uint16	cfg_mtu		;uw = Default MTU (Maximum Transmission Unit)
	uint16	cfg_mss		;uw = Default MSS (Maximum Segment Size)
	uint16	cfg_df_bufsize	;uw = Size of defragmentation buffer to use
	uint16	cfg_rcv_window	;uw = TCP receive window
	uint16	cfg_def_rtt	;uw = Initial RTT time in ms
	int16	cfg_time_wait_time	;sw = How long to wait in `TIME_WAIT' state
	int16	cfg_unreach_resp	;sw = Response to unreachable local ports
	int32	cfg_cn_time	;sl = Time connection was made
	int16	cfg_cd_valid	;sw = Is Modem CD a valid signal??
	int16	cfg_tcp_protocol	;sw = What type of connection is this
	func_p	cfg_old_vec	;->code = void (*old_vec)(void);  Old vector address
	struc_p	cfg_slp		;->slip = struct slip *slp;  Slip structure for happiness
	d_end	cfg
;
;
;	/* Screen control defines, for functions in skio.c    */
;
SCRE_BOLD	equ   1
SCRE_LIGHT	equ   2
SCRE_ITALIC	equ   4
SCRE_UNDERLINE	equ   8
SCRE_OUTLINE	equ  16
SCRE_SHADOW	equ  32
SCRE_REVERSE	equ 256   /* This is NOT a VDI attribute  */
;
;
;	/* Unreachable port responses   */
;
UP_IGNORE	equ 0	;Ignore the incoming packet (delete it)
UP_RESET	equ 1	;Send a TCP RST segment
UP_ICMP		equ 2	;Send an ICMP message (The `Right' thing)
;
RTTCACHE	equ 16	;# of TCP round-trip-time cache entries
;
;
;In C this was struct tcp_rtt
;For assembly each offset gets the prefix rtt_
;
	struct	rtt
	uint32	rtt_addr	;ul = Destination IP address
	int32	rtt_srtt	;sl = Most recent SRTT
	int32	rtt_mdev	;sl = Most recent mean deviation
	d_end	rtt
;
;
	XREF	Tcp_rtt		;extern struct tcp_rtt Tcp_rtt[RTTCACHE];
;
;
;	/* FLagbox Flag definitions	*/
;
FL_do_resolve	equ	0
FL_housekeep	equ	1
;
;
;	/* Also declared here for convenience...    */
;
	XREF	cfg		;extern CONFIG cfg;
	XREF	bios_port
	XREF	io_port		;extern int16 bios_port, io_port;  bios_port is for DTR and CD
	XREF	elog		;extern long elog[E_REASONS];
	XREF	cdir		;extern char cdir[100];	/* Config directory	*/
	XREF	myslip		;extern struct slip *myslip;
	XREF	comp		;extern struct slcompress *comp;
	XREF	mytstate	;extern struct cstate mytstate[MAX_STATES];
	XREF	myrstate	;extern struct cstate myrstate[MAX_STATES];
;
;----------------------------------------------------------------------------
;End of file:	GLOBDEFS.SH
;----------------------------------------------------------------------------
