* Include>CallBack.h		Callback server header file.
 *
 * DRH	920914	Initial.
 *

ifndef CTL_D
define CTL_D			0x04
endif

ifndef TELNET_OPT_ESC
define TELNET_OPT_ESC	0xff
endif

define	CALLBACK_PORT			75
define	DISCARD_PORT			9
define SERVER_TIMER_VALUE		5	* Unable to listen retry timer value *
define IDLE_TIMER_VALUE		30	* Close connection, if no input for ... *
define HOSTNAMELEN				64	* Max length for host names. *
define TIMER_GRANULARITY		10	* One second *
define HALF_DAY_SECONDS		43200L
define INDEX_CALLBACK			1

define SPSWD					12	* Passwords are this big, max *

	* A call entry describes is used for each call and a log of the last
	 * NCALL_LOG is kept.  The LIST command will display the currently pending
	 * call backs and the call log.
	 *
typedef struct cb_type {
	struct cb_type		* next;			* next and previous pointers for	*
	struct cb_type		* prev;			* list processing.					*
	unsigned long int	address;		* IP address of caller				*
	SDT					time;			* Time to call.					*
	TIMER				timer;			* Wake up and call timer			*
} CALLBACK;


	* CallBack server control block.  This one is smaller than average, but 
	 * has most of the general things one finds in a control block.
	 *
define SBUF_MAX				256
define SCMD_MAX				128
define SMSG_MAX				128

typedef struct callback_control_block_type {
	unsigned char		state;
define STATE_BANNER	1
define STATE_COMMAND	2
	IRCB				* ircb;
	TIMER				timeout;
	char				buf[SBUF_MAX];
	char				cmd[SCMD_MAX + 1];
	unsigned int		scmd;
	DLSTR				* msg_head;
	char				msg[SMSG_MAX + 1];
	unsigned char		fclosed;
	unsigned int		delay;
} CBCB;
define SCBCB	sizeof(CBCB)
define NULLCBCB	(CBCB *) 0

		* timer.c *
extern void				os_service_timer();
extern unsigned int		os_stop_timer();
extern void				tick();
extern void				start_timer();
extern void				stop_timer();

extern IRCB				* address_of_ircb();	* inetrq.c *
extern unsigned int		inet_rq_open();
extern unsigned int		inet_rq_close();
extern unsigned int		inet_rq_get_tcb();
extern uns