* inetrq.h
 *
 * DRH	920801	Initial.
 *
 * Structures and other odds and ends needed to implement a request based 
 * interface to InternetCT.  Used mostly by servers.
 *

	* Codes for the tcp_open call *
define	TCP_PASSIVE		0
define	TCP_ACTIVE		1

	* All of these are defined so that when the InternetCT.h is processed
	 * the associated definitions will be compiled by the preprocessor.
	 *
define SET_REQUEST							1
define SET_RQ_OPEN_TCP_CONNECTION			1
define SET_RQ_OPEN_TCP_CONNECTION_NO_WAIT	1
define SET_RQ_CLOSE_TCP_CONNECTION			1
define SET_RQ_ABORT_TCP_CONNECTION			1
define SET_RQ_SEND_TCP_MESSAGE				1
define SET_RQ_RECEIVE_TCP_MESSAGE			1
define SET_RQ_GET_TCB						1
include InternetCT.h

define INETCT_OPEN_WAIT					0
define INETCT_OPEN_NO_WAIT					1

define INETCT_ABORT						TRUE
define INETCT_CLOSE						FALSE

*.< Structures >*

* This structure contains each of the InternetCT request types and additional
 * fields for general use.  The fields are:
 *
 * user_cb		can be used to point to any user data.  It is most frequently 
 *				used to point to a user control block of some type.  As each 
 *				of the requests is returned from InternetCT the user_cb field 
 *				associated with each request can be recovered.
 * exch			user response exchange for the requests.
 * index		is any user data.  It can be used for any purpose.
 * handle		is the handle returned by the OPEN_TCP_CONNECTION or 
 *				OPEN_TCP_CONNECTION_NO_WAIT requests.
 * push, urgent	are flags used with TCP.  See the manual for a more complete 
 * 				discussion.
 * smsgret		contains the actual size of the TCP message returned from a 
 * 				RECEIVE_TCP_MESSAGE request.
 * tcb			is the TCB structure returned from the GET_TCB request.
 * stcbret		contains the actual size of the TCB returned from a GET_TCB 
 *				request.
 * send_release can be used by the user as desired.  It is normally used with 
 *				the SEND_TCP_MESSAGE request to define some allocated memory 
 *				which must be freed at the completion of the SEND_TCP_MESSAGE 
 *				request.
 * RQ_???		are the various InternetCT TCP request blocks.
 * self_ref		is used to recover the address of the entire IRCB structure
 *				from each of the requests as they are returned.
 *

typedef struct inetct_request_type {				* Size  Offsets *
	char						* user_cb;			*   4    0    0 *
	unsigned int				rqs_out;			*   2    4    4 *
	unsigned int				exch;				*   2    6    6 *
	unsigned int				index;				*   2    8    8 *
	unsigned int				handle;				*   2   10   0A *
	unsigned char				push;				*   1   12   0C *
	unsigned char				urgent;				*   1   13   0D *
	unsigned int				smsgret;			*   2   14   0E *
	TCB_RETURNED				tcb;				*  26   16   10 *
	unsigned int				stcbret;			*   2   42   2A *
	char						* send_release;		*   4   44   2C *
	RQ_OPEN_TCP_CONNECTION		rq_open;			*  44   48   30 *
	RQ_CLOSE_TCP_CONNECTION		rq_close;			*  16   92   5C *
	RQ_SEND_TCP_MESSAGE			rq_send;			*  24  108   6C *
	RQ_RECEIVE_TCP_MESSAGE		rq_receive;			*  40  132   84 *
	RQ_GET_TCB					rq_get_tcb;			*  28  172  0AC *
	struct inetct_request_type	* self_ref;			*   4  200  0C8 *
} IRCB;												* 204 Total 0CC *
define NULLIRCB			(IRCB *)0

define SIRCB			sizeof( IRCB)

* OFFsets are used to locate the IRCB selfreference at the end of the 
 * IRCB control block.  The request (rq) address plus the size of the 
 * requests between it and the selfreference yield the address of the 
 * selfreference.  Used because addresses which are sent off board on 
 * SRP's are converted to a linear address style and converted back 
 * to segmentoffset.  However, the addresses will probably have a
 * different seg.off pair.
 *
define OFF_GET_TCB		sizeof( RQ_GET_TCB)
define OFF_RECEIVE		OFF_GET_TCB + sizeof( RQ_RECEIVE_TCP_MESSAGE)
define OFF_SEND		OFF_RECEIVE + sizeof( RQ_SEND_TCP_MESSAGE)
define OFF_CLOSE		OFF_SEND    + sizeof( RQ_CLOSE_TCP_CONNECTION)
define OFF_OPEN		OFF_CLOSE   + sizeof( RQ_OPEN_TCP_CONNECTION)

7
define ERC_CLOSE_ROUTE_FAIL			ERC_BASE + ERC_CLOSE + 8
define ERC_CLOSE_DEST_UNREACH			ERC_BASE + ERC_CLOSE + 9
define ERC_CLOSE_TTL_EXCEED			ERC_BASE + ERC_CLOSE + 10
define ERC_CLOSE_FRAG_EXCEED			ERC_BASE + ERC_CLOSE + 11
define ERC_CLOSE_TIME_EXCEED			ERC_BASE + ERC_CLOSE + 12
define ERC_CLOSE_NETWORK				ERC_BASE + ERC_CLOSE + 13
define ERC_CLOSE_LAST_ERC				ERC_BASE + ERC_CLOSE + 13

endif
int			sttl;
		char					* name;			* returned *	
		unsigned int			snamemax;
		unsigned int			*