utilnet_h

/*
**	Copyright 1991-2017, Fermi Research Alliance, LLC.  All rights reserved.
*/
/******************************************************************************/
/* utilnet.h
**
**	Defines the data structures used in the network communications
**	to and from the utility process
**
*/
/******************************************************************************/

#ifndef UTILNET_DEFINED				/* do this only once */
#define	UTILNET_DEFINED

#include "cnsparam.h"
#include "cns_data_structs.h"
#include "cbslib.h"
#include "dpmlib.h"
#include "diolib.h"

extern void (*util_save_gif_func)(
    struct GIF    *snr_request,   /* network request structure */
    struct SNR_UL_CLIB_UTILNET_H    *snr_reply      /* network reply structure */
    );

#define NET_TC_CLAP		1	/* Circular Logging records */
#define NET_TC_LOCKS		2	/* Set or Clear Settings Lock */
#define	NET_STC_CLAPGET		1	/* Get CLAP record */
#define NET_TC_CHGPGM_UL_CLIB_UTILNET_H	5	/* Change program request */
#define NET_TC_GSSET		6	/* GAS setting log request */
#define NET_TC_SET4READ 	7	/* Set for read request */
#define NET_TC_COPIES		9	/* support copies menu */
#define NET_TC_GETTIME		10	/* return RSX time of day */
#define NET_TC_SETTIME		11	/* set RSX time of day */
#define NET_TC_CLAPUP		12	/* query if clap open */
#define NET_TC_CLAPDOWN		13	/* close clap if open */
#define NET_TC_CLAPADD		14	/* add a log record; instance not 0 */
#define NET_TC_IMAGE		15	/* display an image */
#define NET_TC_BEEP		16	/* ring the keyboard bell */
#define NET_TC_RAISEUTIL	17	/* raise the utility window */
#define NET_TC_IPADDR		18	/* get IP address and transport */
#define NET_TC_PANICMAIL	19	/* send PANIC mail */
#define NET_TC_SAVEGIF  	20	/* save a GIF file */
#define NET_TC_SAVEGIFI 	21	/* save a GIF file, immediate reply */
#define NET_TC_COPIESI		22	/* support copies menu immediate reply */
#define	NET_TC_VERIFY		23	/* request user name/password verification */
#define	NET_TC_WINS		24	/* raise/lower a window */
#define	NET_TC_UPNOW		25	/* return info on tasks running */
#define	NET_TC_TITLES		26	/* screen titles */
#define	NET_TC_ICONALL		27	/* iconify all (SNR_UL_CLIB_UTILNET_H request/reply) */
#define	NET_TC_PIXSIZE		28	/* toggle pix size SNR_UL_CLIB_UTILNET_H (request/reply)*/
#define	NET_TC_PUTCMD		29	/* stuff a command buffer */
#define	NET_TC_START_XVDSP	30	/* start XVDSPx (SNR_UL_CLIB_UTILNET_H request/reply) */
#define NET_TC_REDIRECT 	31	/* redirect request */
#define NET_TC_DEF_DIR  	33	/* user default directory request */
#define NET_TC_CNSINFO  	34	/* console information (CNS_STUFF data) request */
#define NET_TC_ASBINFO  	35	/* Application Status Block information (CNS_ASB data) request */
#define NET_TC_JAVAKILL		36	/* kill Java apps */
#define NET_TC_WIN_SIZE		37	/* set window size */
#define NET_TC_WIN_POS		38	/* set window position */
#define NET_TC_WIN_HOME		39	/* position a window at the origin */
#define NET_TC_WIN_CENTER	40	/* center a window */
#define	NET_TC_ICONIFY		41	/* iconify a window */
#define	NET_TC_DRAW_IMAGE	42	/* draw an image on a graphic window */
#define	NET_TC_RUN_ACL		43	/* execute an ACL file */
#define	NET_TC_DISPLAY_URL	44	/* display a web page */
#define NET_TC_SYSTEM		46
#define NET_TC_FIND_PROGRAM	47	/* find program instances */
#define	NET_TC_PASA_TIMEOUT	49	/* read/set PA/SA timeout */
#define	NET_TC_READ_LOCKS	50	/* read settings lock status */
#define	NET_TC_PIXEL_SIZE	51	/* read/set window pixel size */
#define NET_TC_UTIL_REDIRECT	52	/* read/set utility window redirect info */
#define NET_TC_REDIRECT_FULL	53	/* read/set redirection */
#define NET_TC_WIN_WRITE_TIME	54	/* read window read time */
#define NET_TC_WIN_INFO		55	/* read window information */
#define	NET_TC_CONSOLE_MODE	56	/* read the current console mode */
#define	NET_TC_SET_WIN_TITLE	57	/* set the title for a window */
#define	NET_TC_CONSOLE_MESSAGE	58	/* display a message in the utility window */
#define	NET_TC_CONSOLE_INFO	59	/* read console status information */
#define	NET_TC_PASTE_ADD	60	/* add a string to the console paste buffer */
#define	NET_TC_PASTE_END	61	/* end an addition to the console paste buffer */
#define	NET_TC_SPAWN_ACL	62	/* spawn an ACL script */
#define	NET_TC_SLOT_TASK_STATE	63	/* retrieve a console slot task state */
#define	NET_TC_VALIDATE_PID	64	/* validate a pid */
#define	NET_TC_READ_LOGICAL	65	/* read a logical name value */
#define	NET_TC_GET_DEFAULT_NODE	66	/* retrieve default ACNET node */
#define	NET_TC_DPM_INFO		67	/* read console DPM information */
#define	NET_TC_WINDOW_PIXEL_SIZES	68	/* read console window pixel sizes */
#define	NET_TC_GETENV		69	/* read an environment variable value */
#define	NET_TC_CONSOLE_USER	70	/* read the console user value */
#define	NET_TC_CONSOLE_DISPLAY	71	/* read the console display value */
#define	NET_TC_CONSOLE_MESSAGE_DELETE	72	/* delete a previously displayed console message */
#define NET_TC_CNSCOM_REDIRECT	73	/* read/set console common redirection info */
#define NET_TC_ANNOUNCE_REDIRECT	74	/* announce that console has been redirected */
#define NET_TC_RESTART_CONSOLE	75	/* restart the console */
#define NET_TC_GET_CLOCK_TYPE	76	/* retrieve the current clock type */
#define	NET_TC_SET_LOGICAL	77	/* set a logical name value */
#define	NET_TC_DELETE_LOGICAL	78	/* delete a logical name value */
#define NET_TC_PID_SIGNAL	79	/* send a signal to a process by pid */
#define NET_TC_PING_UTIL	80	/* ping the utility process */
#define NET_TC_GET_DATE		81	/* retrieve the current date/time */
#define NET_TC_NAME_TO_PID	82	/* get the pid corresponding to a process name */
#define NET_TC_PROCESS_SIGNAL	83	/* send a signal to a process by name */
#define NET_TC_PID_TO_NAME	84	/* get the process name corresponding to a pid */
#define NET_TC_FIND_PROCESSES	85	/* find processes matching a search parameter */
#define NET_TC_PROCESS_INFO	86	/* retrieve process information by pid */
#define NET_TC_RESTART_UTIL	87	/* restart the utility window */
#define NET_TC_RESTART_ALARM_DAEMON	88	/* restart the alarms daemon */
#define NET_TC_RESTART_ALARM_DISPLAY	89	/* restart the alarms display */

#define VERIFY_HASH_TC	1		/* typecode for adcalc verify hash */


/*
 SNR_UL_CLIB_UTILNET_H defines a simple network request or reply.
*/
struct SNR_UL_CLIB_UTILNET_H {
	unsigned short	snr_w_tc_or_status;	/* request typecode or status return */
	unsigned short	snr_w_stc;		/* request subtypecode */
	char		snr_b_buf[1];		/* additional request or reply */
	} __attribute__((packed));

/*
  CLP defines a network request/reply for a CLAP circular log message
*/
struct CLP {
	unsigned short	clp_w_tc;		/* request typecode & status return */
	unsigned short	clp_w_stc;		/* request subtypecode */
	int		clp_l_recordnum;	/* relative record number */
	char		clp_b_recordbuf[100];	/* record buffer */
	char		clp_b_recordtime[28];	/* time */
	} __attribute__((packed));

struct CLP_REPLY {
	unsigned short	clp_w_tc;		/* request typecode & status return */
	unsigned short	clp_w_stc;		/* request subtypecode */
	} __attribute__((packed));

/*
  GETIP defines a network reply to return IP addr
*/
struct GETIP {
	unsigned short	getip_w_tc;		/* request typecode & status return */
	unsigned short	getip_w_stc;		/* request subtypecode */
	char	 	getip_c_ip[16];		/* IP address (null terminated) */
	char		getip_c_transport[16];	/* transport (null terminated) */
	} __attribute__((packed));

/*
  GSSETLOG defines a network request for a GSSET setting log message
*/
struct GSSETLOG {
	short		gs_w_tc;		/* request typecode */
	short		gs_w_node;		/* NODE */
	short		gs_w_house;		/* HOUSE */
	short	 	gs_w_modtype;		/* MODTY */
	int 		gs_l_stanc[2];		/* STANC */
	int		gs_r50_name;		/* taskname */
	} __attribute__((packed));

/*
  PRVI4READ defines a network request for a SET4RD setting request
*/
struct PRIV4READ {
	short		prv4_w_tc;		/* request typecode */
	short		prv4_w_slot;		/* slot task running in */
	int 		prv4_l_task;		/* taskname in rad50 */
	short		prv4_w_action;		/* action: 0-OFF, else-ON */
	} __attribute__((packed));

/*
  CNSBEEP defines a network request for a XBELL setting request
*/
struct CNSBEEP {
	short		beep_w_tc;		/* request typecode */
	int		beep_l_percent;		/* -100 to 100 percent of base */
	} __attribute__((packed));

/*
  PMAIL defines a network request for a PANIC mail send request
*/
struct PMAIL {
	short		pm_tc;			/* typecode: NET_TC_PANICMAIL */
	char		pm_user[256];		/* user to send mail to */
	char		pm_subject[256];	/* subject */
	char		pm_message[1024];	/* message */
        } __attribute__((packed));

/*
  COPIES defines a network request/reply for a COPIES menu request
*/

#define	UTIL_COPIES_TITLE_LEN	40		/* maximum length of a title */

struct COPIES {
	unsigned short	copies_w_tc;		/* request typecode & status return */
	unsigned short	copies_w_winid;		/* source window id */
	short		copies_w_queuenum;	/* queue number */
	unsigned short 	copies_w_options;	/* options bits */
	char		copies_c_title[UTIL_COPIES_TITLE_LEN];	/* optional title if 1st char non-null */
	} __attribute__((packed));

/*
  GIF defines a network request/reply for a GIF request
*/
/* these are macro's are in cnsparm.h */
#ifndef LEN_GIF_DIRECT
#define	LEN_GIF_DIRECT	80
#define	LEN_GIF_FILE	80
#endif

#define	UTIL_IMAGE_OPT_NONE		0
#define UTIL_IMAGE_OPT_APPEND_DATE	1	/* append date/time stamp to filename */
#define	UTIL_IMAGE_OPT_INVERT_COLORS	4	/* invert colors when saving image */
#define	UTIL_IMAGE_OPT_WAIT_FOR_SAVE	0x100	/* wait for image save completion */

struct GIF {
	unsigned short	gif_w_tc;		/* request typecode & status return */
	unsigned short	gif_w_winid;		/* source window id */
	unsigned short 	gif_w_options;		/* options bits */
	char	gif_c_directory[LEN_GIF_DIRECT];	/*   directory */
	char	gif_c_filename[LEN_GIF_FILE];		/* file name */
#define	GIF_INVERT_COLORS	4	/* invert colors when saving image */
#define JAVA_DONE	2		/* notify tvmgr when done for JAVA */
#define GIF_DATE	1		/* append date/time stamp to filename */
#define NO_GIF_DATE	0		/* don't append date/time stamp to filename */
#define NO_GIF_OPTIONS	0		/* no options when saving GIF image */
	} __attribute__((packed));

/*
  JAVA defines a network request to tvmgr from the utility window
  signifying a GIF request is done
*/
#define JAVA_GIFTC		1		/* utility window sends */
#define JAVA_PLD_PAINTOFF 	2		/* pld sends */
#define JAVA_PLD_PAINTON  	3		/* pld sends */
#define JAVA_COPIESTC		4		/* utility window sends */
#define JAVA_D5IMAGE		5		/* utility window sends */

struct GIF_JAVA {
	unsigned short	gj_w_tc;		/* gif copy is done */
	char		gj_c_filename[80]; /* filename */
	} __attribute__((packed));

struct COPIES_JAVA {
	unsigned short	cj_w_tc;		/* no hardcopies from Java */
	char		cj_c_msgid;		/* message id */
	char		cj_c_unused;		/* unused */
	} __attribute__((packed));

/*
  IMG defines a network request/reply to display an image
*/
struct IMG {
	unsigned short	img_w_tc;		/* request typecode & status return */
	char		img_b_lxindex;		/* graphics index */
#define IMG_DEFAULT_COLORMAP 	0 /* use default colormap */
#define IMG_GREYSCALE_COLORMAP 	1 /* use greyscale colormap */
#define IMG_PRIVATE_COLORMAP	2 /* use private colormap */
	char 		img_b_cmap;		/* colormap argument */
	char		img_b_filename[132];	/* filename */
	short		img_w_x;		/* x position */
	short 		img_w_y;		/* y position */
#define IMG_CREATE_WINDOW	0 /* create window to fit (x,y are ignored) */
#define IMG_USE_WINDOW		1 /* use existing window */
	short		img_w_orders;		/* how to handle windows */
	} __attribute__((packed));

/*
  WINS defines a network request/reply for manipulating windows
*/
#define WINS_RAISE	0
#define WINS_LOWER	1

struct WINS {
	unsigned short	wins_w_tc;		/* typecode(NET_TC_WINS) & sts return */
	unsigned short	wins_w_winid;		/* source window id */
	unsigned short 	wins_w_command;		/* command: raise or lower */
	} __attribute__((packed));

/*
  VERIFY defines a network request/reply to verify user name/password
*/
struct VERIFY
    {
    unsigned short	verify_w_tc;		/* request typecode and status return */
    char		verify_c_username[33];	/* null terminated user name */
    char 		verify_c_password[33];	/* null terminated password */
    } __attribute__((packed));

/*
  HASH defines a network request/reply to hash user name/password
*/
struct HASH
    {
    unsigned short	hash_w_tc;		/* request typecode and status return */
    char	 	hash_c_username[33];	/* null terminated password */
    unsigned char 	hash_c_alg;		/* algorithm */
    unsigned short	hash_w_salt;		/* salt key */
    int			hash_q_hash[2];		/* null terminated user name */
    } __attribute__((packed));

/*	 
**  UPNOW defines a network reply for info on tasks running
**  for request use SNR_UL_CLIB_UTILNET_H struct with snr_w_tc_or_status = NET_TC_UPNOW
*/	 
typedef struct UPNOW				/* task list */
    {
    short	upnow_sts;			/* status return */
    short	upnow_id[MAX_PLD_SLOTS];	/* slot numbers */
    int		upnow_time[MAX_PLD_SLOTS];	/* time of initialize intype */
    int 	upnow_r50name[MAX_PLD_SLOTS];	/* taskname in rad50 */
    } __attribute__((packed)) upnow_t;

/*	 
**  TITLES defines a network reply for screen titles
**  for request use SNR_UL_CLIB_UTILNET_H struct with snr_w_tc_or_status = NET_TC_TITLES
*/	 
#define	UTIL_NUM_TITLES	(LX2_SUM_WINDOWS)	/* number of titles returned */
#define	UTIL_TITLE_LEN	80			/* returned title length */

typedef struct TITLES				/* title list */
    {
    short	titles_sts;			/* status return */
    short	titles_id[UTIL_NUM_TITLES];	/* screen 'LX2_' ID */
    char	titles_text[UTIL_NUM_TITLES][UTIL_TITLE_LEN];	/* title text */
    } __attribute__((packed)) titles_t;

/*
  PUTCMD defines a network request to stuff a command buffer
  the reply is a single word of status
*/
struct PUTCMD
    {
    unsigned short	putcmd_w_tc;		/* request typecode and status return */
    int			putcmd_l_r50name;	/* rad50 taskname */
    short		putcmd_w_len;		/* length of command line */
    char 		putcmd_c_slot;		/* slot */
    char		putcmd_c_unused;	/* spare */
    char		putcmd_c_cmd[CMD_LIN_SIZ];	/* command buffer */
    } __attribute__((packed));

/*
  REQCHG defines a network request for a chgpgm request: NET_TC_CHGPGM
  The size of the command buffer, CMD_LIN_SIZ, is defined in cns_misc.h.
*/

#define CHGNET_COMMAND	1		/* command buffer present */
#define CHGNET_SCRIPT	2		/* command is script */

typedef	struct	REQCHG			/* chgpgm request buffer */
    {
    unsigned short	chg_tc;				/* request tc */
    int			chg_task;			/* target task name */
    unsigned char	chg_slot;			/* target slot # */
    unsigned char	chg_flags;			/* request flags */
    char		chg_combuf[CMD_LIN_SIZ];    	/* command buffer */
    } __attribute__((packed)) reqchg_t;

/*
*  This defines a network request to copy a file to a user's scratch area.
*  (The reply is a single word of status.)
*/

#define	COPY_FILE_NAME_LEN	128			/* length of a file name */

typedef struct COPY_FILE
    {
    unsigned short	cpy_w_tc;			/* request typecode */
    unsigned short	cpy_w_stc;			/* request subtypecode */
    char		cpy_c_user[USER_NAME_LEN+2];	/* user name */
    char		cpy_c_file[COPY_FILE_NAME_LEN+2];	/* file name to copy */
    char		cpy_c_newfile[COPY_FILE_NAME_LEN+2];	/* name of copied file */
    } __attribute__((packed)) copy_file_t;

typedef struct COPY_FILE_REPLY
    {
    short		cpy_w_status;			/* returned status */
    } __attribute__((packed)) copy_file_reply_t;

typedef struct COPY_FILE_2
    {
    unsigned short	cpy_w_tc;			/* request typecode */
    unsigned short	cpy_w_stc;			/* request subtypecode */
    char		cpy_c_file[COPY_FILE_NAME_LEN+2];	/* file name to copy */
    char		cpy_c_newfile[COPY_FILE_NAME_LEN+2];	/* name of copied file */
    int			cpy_l_delete_old_file;
    } __attribute__((packed)) copy_file_2_t;

typedef struct COPY_FILE_2_REPLY
    {
    short		cpy_w_status;			/* returned status */
    } __attribute__((packed)) copy_file_2_reply_t;

/*
*  UTIL_WIN_SIZE defines a network request/reply for resizing windows
*/
typedef struct UTIL_WIN_SIZE
    {
    unsigned short	wins_w_tc;		/* typecode (NET_TC_WIN_SIZE) and sts return */
    unsigned short	wins_w_winid;		/* window ID */
    short	 	wins_w_size;		/* desired size */
    } __attribute__((packed)) UTIL_WIN_SIZE;

/*
*  UTIL_WIN_POS defines a network request/reply for repositioning windows
*/
typedef struct UTIL_WIN_POS
    {
    unsigned short	wins_w_tc;		/* typecode (NET_TC_WIN_POS) and sts return */
    unsigned short	wins_w_winid;		/* window ID */
    unsigned short 	wins_w_x_pos;		/* desired X position */
    unsigned short 	wins_w_y_pos;		/* desired Y position */
    } __attribute__((packed)) UTIL_WIN_POS;

/*
*  UTIL_WIN_HOME defines a network request/reply for homing windows
*/
typedef struct UTIL_WIN_HOME
    {
    unsigned short	wins_w_tc;		/* typecode (NET_TC_WIN_HOME) and sts return */
    unsigned short	wins_w_winid;		/* window ID */
    } __attribute__((packed)) UTIL_WIN_HOME;

/*
*  UTIL_WIN_CENTER defines a network request/reply for centering windows
*/
typedef struct UTIL_WIN_CENTER
    {
    unsigned short	wins_w_tc;		/* typecode (NET_TC_WIN_CENTER) and sts return */
    unsigned short	wins_w_winid;		/* window ID */
    } __attribute__((packed)) UTIL_WIN_CENTER;

/*
*  UTIL_ICONIFY defines a network request/reply for iconifying windows
*/
typedef struct UTIL_ICONIFY
    {
    unsigned short	wins_w_tc;		/* typecode (NET_TC_ICONIFY) and sts return */
    unsigned short	wins_w_winid;		/* window ID */
    } __attribute__((packed)) UTIL_ICONIFY;

/*
*  UTIL_DRAW_IMAGE defines a network request/reply for drawing graphic images
*/
#define	UTIL_IMAGE_LEX_DRAW	1		/* Lex Draw image */
#define	UTIL_IMAGE_LXI		2		/* LXI image */
#define	UTIL_IMAGE_GIF		3		/* GIF image */
#define	UTIL_IMAGE_D5		4		/* D5 image */

#define	UTIL_IMAGE_NAME_LEN	132		/* maximum length of an image name */

#define	UTIL_OPT_LEAVE_WINDOW		0	/* leave host window size the same (LXI image only) */
#define	UTIL_OPT_RESIZE_WINDOW		1	/* resize host window (LXI image or console display only) */
#define	UTIL_OPT_CONSOLE_DISPLAY	2	/* display in a console window */

typedef struct UTIL_DRAW_IMAGE
    {
    unsigned short	img_w_tc;		/* typecode (NET_TC_DRAW_IMAGE) and sts return */
    unsigned short	img_w_winid;		/* window ID */
    int		img_l_type;			/* type of image */
    char	img_c_name[UTIL_IMAGE_NAME_LEN];	/* image name */
    int		img_l_number;			/* image number (Lex Draw images) */
    int		img_l_display_type;		/* display type (Lex Draw images) */
    int		img_l_x;			/* X position (LXI images) */
    int		img_l_y;			/* Y position (LXI images) */
    int		img_l_colormap;			/* colormap argument (LXI images) */
    unsigned int	img_l_options;		/* option flags */
    char	img_c_request_process[PROCESS_NAME_LEN];
    int	img_l_request_node;
    } __attribute__((packed)) UTIL_DRAW_IMAGE;

typedef struct UTIL_DRAW_IMAGE_REPLY
    {
    unsigned short	img_w_tc;		/* typecode (NET_TC_DRAW_IMAGE) */
    int		img_l_status;			/* drawing status */
    int		img_l_console;			/* drawing console */
    int		img_l_type;			/* type of image */
    char	img_c_name[UTIL_IMAGE_NAME_LEN];	/* image name */
    int		img_l_number;			/* image number (Lex Draw images) */
    } __attribute__((packed)) UTIL_DRAW_IMAGE_REPLY;

/*
*  UTIL_RUN_ACL defines a network request/reply for executing ACL scripts
*/
#define	UTIL_ACL_MAX_DEVICES		20	/* maximum substitute devices */
#define	UTIL_ACL_MAX_STRINGS		20	/* maximum substitute strings */
#define	UTIL_ACL_MAX_VALUES		10	/* maximum substitute values */

#define	UTIL_ACL_SUBST_STRING_LEN	64	/* maximum length of an ACL substitute string */

#define	UTIL_ACL_NAME_LEN		132	/* maximum length of an ACL script name */
#define	UTIL_ACL_ERROR_STRING_LEN	256	/* maximum length of an ACL error string */

#define	UTIL_ACL_MAX_LOG_FILE_NAME_LEN	132	/* maximum length of an ACL log file */

typedef struct UTIL_RUN_ACL
    {
    unsigned short	acl_w_tc;		/* typecode (NET_TC_RUN_ACL) and sts return */
    char	acl_c_request_process[PROCESS_NAME_LEN];
    int		acl_l_request_node;
    int		acl_l_type;			/* type of ACL script */
    char	acl_c_name[UTIL_ACL_NAME_LEN+2];	/* script name */
    int		acl_l_ftd;			/* data acquisition FTD */
    char	acl_c_data_event[DIO_DATA_EVENT_MAX_LEN+2];	/* data acquisition data event */
    unsigned int	acl_l_options;		/* option flags */
    int		acl_l_num_values;		/* number of substitute values */
    float	acl_f_values[UTIL_ACL_MAX_VALUES];
    int		acl_l_num_devices;		/* number of substitute devices */
    char	acl_c_devices[UTIL_ACL_MAX_DEVICES][C_STYLE_DEVICE_NAME_LEN];
    int		acl_l_num_subst_strings;	/* number of substitute strings */
    char	acl_c_subst_strings[UTIL_ACL_MAX_STRINGS][UTIL_ACL_SUBST_STRING_LEN+2];
    char	acl_c_shared_log_name[LOG_NAMLEN+2];	/* shared log to update */
    char	acl_c_log_file[UTIL_ACL_MAX_LOG_FILE_NAME_LEN+2];	/* log file name */
    char	acl_c_lock_name[LOCK_MAX_NAME_LEN+2];	/* lock name */
    } __attribute__((packed)) UTIL_RUN_ACL;

typedef struct UTIL_RUN_ACL_REPLY
    {
    unsigned short	acl_w_tc;		/* typecode (NET_TC_RUN_ACL) and sts return */
    int		acl_l_status;			/* ACL execution status */
    char	acl_c_error_string[UTIL_ACL_ERROR_STRING_LEN+2];	/* error string */
    int		acl_l_node;			/* execution node */
    int		acl_l_console;			/* execution console */
    char	acl_c_name[UTIL_ACL_NAME_LEN+2];	/* script name */
    } __attribute__((packed)) UTIL_RUN_ACL_REPLY;

/*
*  UTIL_SPAWN_ACL defines a network request/reply for spawning ACL scripts
*/

typedef struct UTIL_SPAWN_ACL
    {
    unsigned short	acl_w_tc;		/* typecode (NET_TC_SPAWN_ACL) and sts return */
    char	acl_c_request_process[PROCESS_NAME_LEN];
    int		acl_l_request_node;
    int		acl_l_type;			/* type of ACL script */
    char	acl_c_name[UTIL_ACL_NAME_LEN+2];	/* script name */
    int		acl_l_ftd;			/* data acquisition FTD */
    char	acl_c_data_event[DIO_DATA_EVENT_MAX_LEN+2];	/* data acquisition data event */
    unsigned int	acl_l_options;		/* ACL option flags */
    unsigned int	acl_l_spawn_options;	/* spawned execution option flags */
    int		acl_l_num_subst_strings;	/* number of substitute strings */
    char	acl_c_subst_strings[UTIL_ACL_MAX_STRINGS][UTIL_ACL_SUBST_STRING_LEN+2];
    int		acl_l_num_devices;		/* number of substitute devices */
    char	acl_c_devices[UTIL_ACL_MAX_DEVICES][C_STYLE_DEVICE_NAME_LEN];
    char	acl_c_shared_log_name[LOG_NAMLEN+2];	/* shared log file name */
    char	acl_c_log_file[UTIL_ACL_MAX_LOG_FILE_NAME_LEN+2];	/* log file name */
    char	acl_c_lock_name[LOCK_MAX_NAME_LEN+2];	/* lock name */
    } __attribute__((packed)) UTIL_SPAWN_ACL;

typedef struct UTIL_SPAWN_ACL_REPLY
    {
    unsigned short	acl_w_tc;		/* typecode (NET_TC_SPAWN_ACL) and sts return */
    int		acl_l_status;			/* ACL spawn status */
    char	acl_c_error_string[UTIL_ACL_ERROR_STRING_LEN+2];	/* error string */
    char	acl_c_spawned_process[PROCESS_NAME_LEN+2];	/* actual spawned process name */
    int		acl_l_node;			/* execution node */
    int		acl_l_console;			/* execution console */
    char	acl_c_name[UTIL_ACL_NAME_LEN+2];	/* script name */
    } __attribute__((packed)) UTIL_SPAWN_ACL_REPLY;

/*
*  UTIL_DISPLAY_URL defines a network request/reply for displaying a web page
*/
#define	UTIL_URL_NAME_LEN	256		/* maximum length of a URL */

typedef struct UTIL_DISPLAY_URL
    {
    unsigned short	url_w_tc;		/* typecode (NET_TC_DISPLAY_URL) and sts return */
    char		url_c_url[UTIL_URL_NAME_LEN];	/* URL */
    } __attribute__((packed)) UTIL_DISPLAY_URL;

/*
*  This defines a network request to determine the default directory
*  for a given user
*/

#define	DEFAULT_PATH_LEN	32			/* length of a default directory path */
#define	DEFAULT_DIR_LEN		64			/* length of a default directory name */

typedef struct DEFAULT_DIR
    {
    unsigned short	ddir_w_tc;			/* request typecode */
    unsigned short	ddir_w_stc;			/* request subtypecode */
    char		ddir_c_user[USER_NAME_LEN+2];	/* user name */
    } __attribute__((packed)) default_dir_t;

typedef struct DEFAULT_DIR_REPLY
    {
    short		ddir_w_status;			/* returned status */
    char		ddir_c_path[DEFAULT_PATH_LEN+2];	/* default directory path */
    char		ddir_c_dir[DEFAULT_DIR_LEN+2];	/* default directory name */
    } __attribute__((packed)) default_dir_reply_t;

/*
*  This defines a network request to retrieve information about the
*  console on which the utility window is running
*/

typedef struct CNSINFO_REQUEST
    {
    unsigned short	cns_w_tc;			/* request typecode */
    unsigned short	cns_w_stc;			/* request subtypecode */
    } __attribute__((packed)) cnsinfo_request_t;

typedef struct CNSINFO_REPLY
    {
    short		cns_w_status;			/* returned status */
    short		cns_w_console_number;		/* our console number */
    short 		cns_w_knob_count;		/* knob count */
    unsigned int	cns_l_console_privs;		/* console privilege mask */
    unsigned int	cns_l_setting_lock;		/* settings lock */
    unsigned int	cns_l_activity_time;		/* time of last user activity in clinks */
    int			cns_l_lxmgr_raise_mask;		/* mask of ids to raise */
    int			cns_l_lxmgr_lower_mask;		/* mask of ids to lower */
    int			cns_l_lxmgr_iconify_mask;	/* mask of ids to iconify */
    int			cns_l_console_classes;		/* mask of console classes for runs */
    int			cns_l_lxmgr_big_pixels_mask;	/* mask of ids to big/small pixels */
    char		cns_c_copies_cpy_to[MAX_PLD_SLOTS];	/* Copy to value for each slot */
    short		cns_w_copies_bw_print_sets;	/* use default or saved options */
    short		cns_w_copies_clr_print_sets;	/* use default or saved options */
    short		cns_w_copies_bw_qnum;		/* queue number */
    short		cns_w_copies_clr_qnum;		/* queue number */
    short		cns_w_copies_bw_hditem;		/* heading item selected */
    short		cns_w_copies_bw_bwitem;		/* Black/White item selected */
    short		cns_w_copies_bw_byitem;		/* Blue/Yellow item selected */
    short		cns_w_copies_bw_szitem;		/* Size item selected */
    short		cns_w_copies_bw_bditem;		/* Bold item selected */
    short		cns_w_copies_clr_hditem;	/* Heading item selected */
    short		cns_w_copies_clr_bwitem;	/* Black/White item selected */
    short		cns_w_copies_clr_bditem;	/* Bold item selected */
    short		cns_w_copies_clr_byitem;	/* Blue/Yellow item selected */
    short		cns_w_copies_clr_szitem;	/* Size item selected */
    int			cns_l_chgpgm_redirect;		/* Rad50 taskname of redirect */
    short		cns_w_mouse_focus;		/* srv_inx+1 to warp knob box focus */
    short		cns_w_dpm_redirect_ok;		/* allow data acquistion whack when T */
    short		cns_w_mouse_server;		/* current srv_inx of cibox mouse focus */
    char		cns_c_username[USER_NAME_LEN];	/* console instance VMS username */
    char		cns_c_device_copy_name[16];	/* Device Copy/Paste name */
    } __attribute__((packed)) cnsinfo_reply_t;

/*
*  This defines a network request to retrieve information about
*  a slot on the console on which the utility window is running
*/

typedef struct ASBINFO_REQUEST
    {
    unsigned short	asb_w_tc;			/* request typecode */
    unsigned short	asb_w_stc;			/* request subtypecode */
    short		asb_w_slot;			/* requested slot */
    } __attribute__((packed)) asbinfo_request_t;

typedef struct ASBINFO_REPLY
    {
    short		asb_w_status;			/* returned status */
    int			asb_l_timechgpgm[2];		/* time of CHGPGM */
    int			asb_l_timepld0[2];		/* time of PLD wakeup */
    int			asb_l_timepldcpld[2];		/* time of CPLD reply */
    int			asb_l_timepldterm0[2];		/* time PLD tells ap to terminate */
    int			asb_l_timepldterm1[2];		/* time PLD sees ap gone */
    int			asb_l_timeplddone[2];		/* time PLD done */
    int			asb_l_timeapterm0[2];		/* time of AP INTYPE terminate */
    int			asb_l_timeapterm1[2];		/* time of termination complete */
    int			asb_l_timeapinit0[2];		/* time of AP initialization intype */
    int			asb_l_timeapinit1[2];		/* time of AP ntv_connect */
    int			asb_l_timeapinit2[2];		/* time of AP intype init done */
    int			asb_l_timeintype2[2];		/* time of AP user init done */
    int			asb_l_atn;			/* active task name(RAD-50) */
    int			asb_l_wtn;			/* waiting task name(RAD-50) */
    short		asb_w_tkv;			/* (unused) VAX task version # */
    short		asb_w_tks;			/* (unused) VAX task image size in blocks */
    short		asb_w_spn;			/* PA subpage number */
    short		asb_w_tvmx[10];			/* TVMX line 2 repair area */
    int			asb_l_pid;			/* Process ID */
    unsigned int	asb_l_activity;			/* time of last user activity in clinks */
    short		asb_w_setlock;			/* user/library settings lock */
    short		asb_w_fslock;			/* user/library filesharing lock */
    short		asb_w_pldterm;			/* countdown forcexit suspension */
							/* set to 1 by script record 
							   set to 2 by index page when debugging */
    short		asb_w_scriptstate;		/* script state: PLD, replayer, task_slot */
    short		asb_w_znum;			/* generic PA number when Z loads */
    short		asb_w_whacked;			/* slot whacked when TRUE */
    char		asb_c_atnascii[PROCESS_NAME_LEN];	/* active task name in ASCII */
    char		asb_c_clb[80];			/* command line buffer from CHGPGM */
    short		asb_w_clbf;			/* command line buffer flag */
    short		asb_w_terminate;		/* terminate state */
    short		asb_w_pgm_type;			/* program type */
    short		asb_w_state;			/* state of process */
    unsigned int	asb_l_sets;			/* mask of console classes for sets */
    } __attribute__((packed)) asbinfo_reply_t;

typedef struct UTIL_SYSTEM
    {
    unsigned short	sys_w_tc;			/* request typecode */
    unsigned short	sys_w_stc;			/* request subtypecode */
    char		sys_c_command[258];
    } __attribute__((packed)) util_system_t;

typedef struct UTIL_SYSTEM_REPLY
    {
    short		sys_w_status;		/* returned status */
    } __attribute__((packed)) util_system_reply_t;

/*
*  UTIL_FIND_PROGRAM defines a network request/reply for finding program instances
*/

typedef struct UTIL_FIND_PROGRAM
    {
    unsigned short	fndpgm_w_tc;		/* typecode (NET_TC_FIND_PROGRAM) and sts return */
    char	fndpgm_c_request_process[PROCESS_NAME_LEN];
    int	fndpgm_l_max_return;		/* maximum number of instances to return */
    } __attribute__((packed)) UTIL_FIND_PROGRAM;

typedef struct UTIL_FIND_PROGRAM_REPLY
    {
    unsigned short	fndpgm_w_tc;		/* typecode (NET_TC_FIND_PROGRAM) and sts return */
    int	fndpgm_l_status;			/* program search status */
    int	fndpgm_l_count;				/* program instance count */
    PROGRAM_LOCATION	location[1];		/* program locations */
    } __attribute__((packed)) UTIL_FIND_PROGRAM_REPLY;

/*
*  UTIL_PASA_TIMEOUT defines a simple network request/reply for reading and
*  setting the PA/SA timeout value.
*/
#define	UTIL_PASA_TIMEOUT_READ	0
#define	UTIL_PASA_TIMEOUT_SET	1

typedef struct UTIL_PASA_TIMEOUT
    {
    unsigned short	pasa_w_tc_or_status;	/* request typecode or status return */
    unsigned short	pasa_w_stc;		/* request subtypecode */
    int			pasa_l_timeout;		/* PA/SA timeout value */
    } __attribute__((packed)) UTIL_PASA_TIMEOUT;

/*
*  UTIL_READ_LOCKS defines a simple network request/reply for reading
*  the settings lock status.
*/
typedef struct UTIL_READ_LOCKS
    {
    unsigned short	rdlk_w_tc_or_status;	/* request typecode or status return */
    unsigned short	rdlk_w_stc;		/* request subtypecode */
    int			rdlk_l_unlocked;	/* setting lock status (1 -> unlocked, 0 -> locked) */
    int			rdlk_l_value;		/* setting lock value */
    int			rdlk_l_time_left;	/* setting lock remaining time in minutes */
    unsigned int	rdlk_l_timestamp;	/* setting lock setting timestamp */
    } __attribute__((packed)) UTIL_READ_LOCKS;

/*
*  UTIL_PIXEL_SIZE defines a simple network request/reply for reading and
*  setting the pixel size for a window.
*/
#define	UTIL_PIXEL_SIZE_READ	0
#define	UTIL_PIXEL_SIZE_SET	1
#define	UTIL_PIXEL_SIZE_FORWARD_SET	2

#define	UTIL_PIXEL_SIZE_NORMAL	0
#define	UTIL_PIXEL_SIZE_FAT	1
#define	UTIL_PIXEL_SIZE_HEFTY	2

typedef struct UTIL_PIXEL_SIZE
    {
    unsigned short	pixsiz_w_tc_or_status;	/* request typecode or status return */
    unsigned short	pixsiz_w_stc;		/* request subtypecode */
    int			pixsiz_l_window_id;	/* window ID */
    int			pixsiz_l_size;		/* window pixel size */
    } __attribute__((packed)) UTIL_PIXEL_SIZE;

/*
*  UTIL_UTIL_REDIRECT defines a simple network request/reply for reading and
*  setting the utility window redirection information.
*/
#define	UTIL_UTIL_REDIRECT_READ	0
#define	UTIL_UTIL_REDIRECT_SET	1
#define	UTIL_UTIL_REDIRECT_FORWARD_SET	2

#define	NUM_UTIL_REDIRECT_SLOTS	13

#define	UTIL_REDIRECT_NONE	0
#define	UTIL_REDIRECT_SR	1
#define	UTIL_REDIRECT_SDA	2
#define	UTIL_REDIRECT_LJ	3
#define	UTIL_REDIRECT_MODEL	4
#define	UTIL_REDIRECT_TEST_OAC	5

typedef struct UTIL_REDIRECT_SR_DATA
    {
    int		file_number;
    } __attribute__((packed)) UTIL_REDIRECT_SR_DATA;

typedef struct UTIL_REDIRECT_SDA_DATA
    {
    int		usage_number;
    int		file_number;
    int		case_number;
    int		subcase_number;
    } __attribute__((packed)) UTIL_REDIRECT_SDA_DATA;

typedef struct UTIL_REDIRECT_LJ_DATA
    {
    int		node;
    unsigned int	start_time;
    unsigned int	accuracy;
    } __attribute__((packed)) UTIL_REDIRECT_LJ_DATA;

typedef struct UTIL_REDIRECT_TEST_OAC_DATA
    {
    int		node;
    int		redirect_node;
    } __attribute__((packed)) UTIL_REDIRECT_TEST_OAC_DATA;

#define	UTIL_REDIRECTION_MODEL_NAME_LEN	16

typedef struct UTIL_REDIRECT_MODEL_DATA
    {
    char	model_name[UTIL_REDIRECTION_MODEL_NAME_LEN];
    int		model_node;
    int		model_class;
    } __attribute__((packed)) UTIL_REDIRECT_MODEL_DATA;

typedef struct UTIL_UTIL_REDIRECT
    {
    unsigned short	urd_w_tc_or_status;	/* request typecode or status return */
    unsigned short	urd_w_stc;		/* request subtypecode */
    int			urd_l_redirect_type;	/* redirection type */
    int			urd_l_slots[NUM_UTIL_REDIRECT_SLOTS];	/* slot redirection status */
    union
	{
	UTIL_REDIRECT_SR_DATA	sr_data;
	UTIL_REDIRECT_SDA_DATA	sda_data;
	UTIL_REDIRECT_LJ_DATA	lj_data;
	UTIL_REDIRECT_TEST_OAC_DATA	test_oac_data;
	UTIL_REDIRECT_MODEL_DATA	model_data;
	} urd_s_data;
    } __attribute__((packed)) UTIL_UTIL_REDIRECT;

/*
*  UTIL_REDIRECT_FULL defines a simple network request/reply for reading and
*  setting redirection information.
*/
#define	UTIL_REDIRECT_FULL_READ	0
#define	UTIL_REDIRECT_FULL_SET	1

#define	NUM_REDIRECT_FULL_ENTRIES	MAX_PLD_SLOTS

typedef struct UTIL_REDIRECT_FULL
    {
    unsigned short	urd_w_tc_or_status;	/* request typecode or status return */
    unsigned short	urd_w_stc;		/* request subtypecode */
    int			urd_l_num_entries;	/* number of redirection entries */
    union
	{
	struct DPM_WHACK_LIST	read[NUM_REDIRECT_FULL_ENTRIES];	/* redirection status information */
	struct DPM_WHACK_REQUEST	set[NUM_REDIRECT_FULL_ENTRIES];	/* redirection request information */
	} urd_l_entries;
    } __attribute__((packed)) UTIL_REDIRECT_FULL;

/*
*  UTIL_WIN_WRITE_TIME defines a simple network request/reply for reading
*  the last time that a window was written to
*/

typedef struct UTIL_WIN_WRITE_TIME
    {
    unsigned short	winwrt_w_tc_or_status;	/* request typecode or status return */
    unsigned short	winwrt_w_stc;		/* request subtypecode */
    int			winwrt_l_window_id;	/* window ID */
    unsigned int	winwrt_l_time;		/* last window write time (UTC) */
    } __attribute__((packed)) UTIL_WIN_WRITE_TIME;

/*
*  UTIL_WIN_INFO defines a simple network request/reply for reading
*  console window X information
*/

typedef struct UTIL_WIN_INFO
    {
    unsigned short	wininf_w_tc_or_status;	/* request typecode or status return */
    unsigned short	wininf_w_stc;		/* request subtypecode */
    int			wininf_l_window_id;	/* window ID */
    int			wininf_l_x_win_id;	/* X window ID */
    int			wininf_l_xpos;		/* x position on screen */	
    int			wininf_l_ypos;		/* y position on screen */	
    int			wininf_l_width;		/* width of window (LX only) */
    int			wininf_l_height;	/* height of window (LX only) */
    } __attribute__((packed)) UTIL_WIN_INFO;

/*
*  UTIL_CONSOLE_MODE defines a simple network request/reply for reading
*  the console mode value.
*/
#define	UTIL_CONSOLE_MODE_READ	0
#define	UTIL_CONSOLE_MODE_SET	1

typedef struct UTIL_CONSOLE_MODE
    {
    unsigned short	cnsmd_w_tc_or_status;	/* request typecode or status return */
    unsigned short	cnsmd_w_stc;		/* request subtypecode */
    int			cnsmd_l_mode;		/* console mode value */
    } __attribute__((packed)) UTIL_CONSOLE_MODE;

/*
*  UTIL_SET_WIN_TITLE defines a network request/reply for setting window titles
*/
typedef struct UTIL_SET_WIN_TITLE
    {
    unsigned short	wins_w_tc_or_status;	/* request typecode (NET_TC_SET_WIN_TITLE) or status return */
    unsigned short	wins_w_winid;		/* window ID */
    char	 	wins_c_title[UTIL_TITLE_LEN];	/* desired title */
    } __attribute__((packed)) UTIL_SET_WIN_TITLE;

/*
*  UTIL_CONSOLE_MESSAGE defines a network request/reply for displaying a message
*/

#define	UTIL_MAX_MESSAGE_LEN	8192

typedef struct UTIL_CONSOLE_MESSAGE
    {
    unsigned short	mess_w_tc_or_status;	/* request typecode (NET_TC_CONSOLE_MESSAGE) or status return */
    unsigned short	mess_w_beep;		/* beep flag */
    unsigned short	mess_w_text_color;	/* text color */
    unsigned short	mess_w_text_length;	/* text length */
    char	 	mess_c_text[UTIL_MAX_MESSAGE_LEN];	/* text message */
    } UTIL_CONSOLE_MESSAGE;

typedef struct UTIL_CONSOLE_MESSAGE_DELETE
    {
    unsigned short	mess_w_tc_or_status;	/* request typecode (NET_TC_CONSOLE_MESSAGE_DELETE) or status return */
    } UTIL_CONSOLE_MESSAGE_DELETE;

/*
*  UTIL_CONSOLE_INFO defines a simple network request/reply for reading
*  console status information
*/

typedef struct UTIL_CONSOLE_INFO
    {
    unsigned short	cnsinf_w_tc_or_status;		/* request typecode or status return */
    unsigned short	cnsinf_w_stc;			/* request subtypecode */
    int			cnsinf_l_settings_enabled;	/* settings enable flag */
    int			cnsinf_l_settings_timeout;	/* time till settings timeout */
    int			cnsinf_l_fshare_writes_enabled;	/* Filesharing writes enable flag */	
    int			cnsinf_l_database_type;		/* database selected */
    int			cnsinf_l_pa_sa_timeout;		/* PA/SA timeout */
    int			cnsinf_l_remote_redirect_allowed;	/* remote redirection allowed */
    int			cnsinf_l_data_source[NUM_CONSOLE_TASKS];	/* task data sources */
    } __attribute__((packed)) UTIL_CONSOLE_INFO;

/*
*  UTIL_PASTE_ADD(/END) defines a network request/reply for adding text
*  to the console paste buffer
*/

typedef struct UTIL_PASTE_ADD
    {
    unsigned short	paste_w_tc;		/* typecode (NET_TC_PASTE_ADD) */
    int		paste_l_console;
    int		paste_l_slot;
    char	paste_c_process_name[PROCESS_NAME_LEN];
    int		paste_l_end_of_paste;
    int		paste_l_buffer_length;
    char	paste_c_text_buffer[1];
    } __attribute__((packed)) UTIL_PASTE_ADD;

typedef struct UTIL_PASTE_ADD_REPLY
    {
    unsigned short	paste_w_tc;		/* typecode (NET_TC_PASTE_ADD) and sts return */
    int		paste_l_status;			/* paste status */
    } __attribute__((packed)) UTIL_PASTE_ADD_REPLY;

typedef struct UTIL_PASTE_END
    {
    unsigned short	paste_w_tc;		/* typecode (NET_TC_PASTE_END) */
    int		paste_l_console;
    int		paste_l_slot;
    char	paste_c_process_name[PROCESS_NAME_LEN];
    } __attribute__((packed)) UTIL_PASTE_END;

typedef struct UTIL_PASTE_END_REPLY
    {
    unsigned short	paste_w_tc;		/* typecode (NET_TC_PASTE_END) and sts return */
    int		paste_l_status;			/* paste status */
    } __attribute__((packed)) UTIL_PASTE_END_REPLY;

/*
*  UTIL_SLOT_TASK_STATE defines a simple network request/reply for reading
*  the state of a task running in a console slot.
*/
typedef struct UTIL_SLOT_TASK_STATE
    {
    unsigned short	sltst_w_tc_or_status;	/* request typecode or status return */
    unsigned short	sltst_w_stc;		/* request subtypecode */
    int			sltst_l_slot;		/* console slot */
    char		sltst_c_process_name[PROCESS_NAME_LEN+2];	/* name of process */
    char		sltst_c_generic_name[PROCESS_NAME_LEN+2];	/* generic name of process */
    int			sltst_l_state;		/* program state (see help for task_slot) */
    int			sltst_l_script_state;	/* program scripting state (see help for task_slot) */
    } __attribute__((packed)) UTIL_SLOT_TASK_STATE;

/*
*  UTIL_VALIDATE_PID defines a simple network request/reply for
*  validating a process ID.
*/
typedef struct UTIL_VALIDATE_PID
    {
    unsigned short	vpid_w_tc_or_status;	/* request typecode or status return */
    unsigned short	vpid_w_stc;		/* request subtypecode */
    int			vpid_l_pid;		/* pid */
    int			vpid_l_is_valid;	/* flag indicating whether or not the requested pid is valid */
    } __attribute__((packed)) UTIL_VALIDATE_PID;

/*
*  UTIL_READ_LOGICAL defines a network request/reply for retrieving
*  a logical name value
*/

#define	UTIL_MAX_LOGICAL_NAME_LEN	256
#define	UTIL_MAX_LOGICAL_VALUE_LEN	1024

typedef struct UTIL_READ_LOGICAL
    {
    unsigned short	log_w_tc_or_status;	/* request typecode (NET_TC_READ_LOGICAL) or status return */
    char		log_c_logical_name[UTIL_MAX_LOGICAL_NAME_LEN+2];	/* logical name */
    char		log_c_value[UTIL_MAX_LOGICAL_VALUE_LEN+2];		/* logical value */
    } __attribute__((packed)) UTIL_READ_LOGICAL;

/*
*  UTIL_SET_LOGICAL defines a network request/reply for setting
*  a logical name value
*/

typedef struct UTIL_SET_LOGICAL
    {
    unsigned short	log_w_tc_or_status;	/* request typecode (NET_TC_SET_LOGICAL) or status return */
    char		log_c_logical_name[UTIL_MAX_LOGICAL_NAME_LEN+2];	/* logical name */
    char		log_c_value[UTIL_MAX_LOGICAL_VALUE_LEN+2];		/* logical value */
    } __attribute__((packed)) UTIL_SET_LOGICAL;

/*
*  UTIL_DELETE_LOGICAL defines a network request/reply for deleting
*  a logical name value
*/

typedef struct UTIL_DELETE_LOGICAL
    {
    unsigned short	log_w_tc_or_status;	/* request typecode (NET_TC_DELETE_LOGICAL) or status return */
    char		log_c_logical_name[UTIL_MAX_LOGICAL_NAME_LEN+2];	/* logical name */
    } __attribute__((packed)) UTIL_DELETE_LOGICAL;

/*
*  UTIL_DEFAULT_NODE defines a network request/reply for retrieving
*  the default ACNET node
*/

typedef struct UTIL_DEFAULT_NODE
    {
    unsigned short	defnod_w_tc_or_status;	/* request typecode (NET_TC_GET_DEFAULT_NODE) or status return */
    int			defnod_l_node;		/* default ACNET node */
    } __attribute__((packed)) UTIL_DEFAULT_NODE;

/*
*  UTIL_DPM_INFO defines a simple network request/reply for reading
*  console DPM information
*/

typedef struct UTIL_DPM_INFO
    {
    unsigned short	dpminf_w_tc_or_status;		/* request typecode or status return */
    unsigned short	dpminf_w_stc;			/* request subtypecode */
    int			dpminf_l_dpm_type;		/* DPM type selected */
    } __attribute__((packed)) UTIL_DPM_INFO;

/*
*  UTIL_WINDOW_PIXEL_SIZES defines a simple network request/reply for reading
*  console window pixel size information
*/

typedef struct UTIL_WINDOW_PIXEL_SIZES
    {
    unsigned short	pixsiz_w_tc_or_status;		/* request typecode or status return */
    unsigned short	pixsiz_w_stc;			/* request subtypecode */
    int			pixsiz_l_window_id[NUM_CONSOLE_WINDOWS];	/* window IDs */
    int			pixsiz_l_pixel_size[NUM_CONSOLE_WINDOWS];	/* window pixel sizes */
    } __attribute__((packed)) UTIL_WINDOW_PIXEL_SIZES;

/*
*  UTIL_GETENV defines a network request/reply for retrieving
*  an environment variable value
*/

#define	UTIL_MAX_ENV_VAR_NAME_LEN	256
#define	UTIL_MAX_ENV_VALUE_LEN		1024

typedef struct UTIL_GETENV
    {
    unsigned short	env_w_tc_or_status;	/* request typecode (NET_TC_GETENV) or status return */
    char		env_c_variable_name[UTIL_MAX_ENV_VAR_NAME_LEN+2];	/* environment variable name */
    char		env_c_value[UTIL_MAX_ENV_VALUE_LEN+2];			/* environment variable value */
    } __attribute__((packed)) UTIL_GETENV;

/*
*  UTIL_CONSOLE_USER defines a network request/reply for retrieving
*  the console user value
*/

#define	UTIL_MAX_USER_NAME_LEN	(USER_NAME_LEN)

typedef struct UTIL_CONSOLE_USER
    {
    unsigned short	user_w_tc_or_status;	/* request typecode (NET_TC_CONSOLE_USER) or status return */
    char		user_c_user_name[UTIL_MAX_USER_NAME_LEN+2];	/* console user name */
    } __attribute__((packed)) UTIL_CONSOLE_USER;

/*
*  UTIL_CONSOLE_DISPLAY defines a network request/reply for retrieving
*  the console display value
*/

#define	UTIL_MAX_CONSOLE_DISPLAY_NAME_LEN	256

typedef struct UTIL_CONSOLE_DISPLAY
    {
    unsigned short	disp_w_tc_or_status;	/* request typecode (NET_TC_CONSOLE_DISPLAY) or status return */
    char		disp_c_display_name[UTIL_MAX_CONSOLE_DISPLAY_NAME_LEN+2];	/* console display name */
    } __attribute__((packed)) UTIL_CONSOLE_DISPLAY;

/*
*  UTIL_ANNOUNCE_CONSOLE_REDIRECTION defines a network request/reply for
*  announcing that the console has had a redirection change
*/

#define	UTIL_MODEL_NAME_LEN	(DIO_MODEL_NAME_LEN)

typedef struct UTIL_ANNOUNCE_CONSOLE_REDIRECTION
    {
    unsigned short	annred_w_tc_or_status;		/* request typecode (NET_TC_ANNOUNCE_REDIRECTION) or status return */
    int			annred_l_was_redirected;	/* was redirected (TRUE) or returned to normal (FALSE) */
    char		annred_c_model_name[NODE_NAME_LEN+2];	/* model name or "none" */
    int			annred_l_redirect_type;		/* redirection type */
    union
	{
	DIO_SR_SPEC	sr_data;			/* save/restore redirection data */
	DIO_SDA_SPEC	sda_data;			/* SDA redirection data */
	DIO_DL_SPEC	logger_data;			/* data logger redirection data */
	DIO_MEMORY_SPEC	memory_data;			/* memory redirection data */
	} annred_u_data_source_data;
    } __attribute__((packed)) UTIL_ANNOUNCE_CONSOLE_REDIRECTION;

/*
*  UTIL_RESTART_CONSOLE defines a network request/reply for
*  requesting that the console be restarted
*/

typedef struct UTIL_RESTART_CONSOLE
    {
    unsigned short	cnsrun_w_tc_or_status;		/* request typecode (NET_TC_RESTART_CONSOLE) or status return */
    unsigned short	cnsrun_w_stc;			/* request subtypecode */
    int			cnsrun_l_requestor_console;	/* requesting console */
    int			cnsrun_l_requestor_node;	/* requesting node */
    int			cnsrun_l_instance;		/* instance to restart */
    } __attribute__((packed)) UTIL_RESTART_CONSOLE;

/*
*  UTIL_CLOCK_TYPE defines a network request/reply for retrieving
*  the current clock event type
*/

typedef struct UTIL_CLOCK_TYPE
    {
    unsigned short	clktyp_w_tc_or_status;		/* request typecode (NET_TC_GET_CLOCK_TYPE) or status return */
    int			clktyp_l_type;			/* clock type */
    } __attribute__((packed)) UTIL_CLOCK_TYPE;

/*
*  UTIL_PID_SIGNAL defines a network request/reply for sending a signal to
*  a process by PID
*/

typedef struct UTIL_PID_SIGNAL
    {
    unsigned short	pidsig_w_tc_or_status;		/* request typecode (NET_TC_PID_SIGNAL) or status return */
    int			pidsig_l_pid;			/* PID */
    int			pidsig_l_signal;		/* signal value */
    } __attribute__((packed)) UTIL_PID_SIGNAL;

/*
*  UTIL_GET_DATE defines a network request/reply for retrieving
*  the current date/time
*/

typedef struct UTIL_GET_DATE
    {
    unsigned short	getdat_w_tc_or_status;		/* request typecode (NET_TC_GET_DATE) or status return */
    unsigned short	getdat_w_stc;			/* request subtypecode */
    unsigned int	getdat_l_clinks;		/* date/time in clinks */
    unsigned long long	getdat_ll_milliseconds;		/* date/time in milliseconds */
    } __attribute__((packed)) UTIL_GET_DATE;

/*
*  UTIL_NAME_TO_PID defines a network request/reply for retrieving
*  the pid corresponding to a process name
*/

#define	UTIL_OS_PROCESS_NAME_LEN	16

typedef struct UTIL_NAME_TO_PID
    {
    unsigned short	nam2pid_w_tc_or_status;		/* request typecode (NET_TC_NAME_TO_PID) or status return */
    char		nam2pid_c_process_name[UTIL_OS_PROCESS_NAME_LEN+2];	/* process name */
    int			nam2pid_l_pid;			/* returned pid */
    } __attribute__((packed)) UTIL_NAME_TO_PID;

/*
*  UTIL_PID_TO_NAME defines a network request/reply for retrieving
*  the process name corresponding to a pid
*/

typedef struct UTIL_PID_TO_NAME
    {
    unsigned short	pid2nam_w_tc_or_status;		/* request typecode (NET_TC_PID_TO_NAME) or status return */
    int			pid2nam_l_pid;			/* pid */
    char		pid2nam_c_process_name[UTIL_OS_PROCESS_NAME_LEN+2];	/* returned process name */
    } __attribute__((packed)) UTIL_PID_TO_NAME;

/*
*  UTIL_PID_SIGNAL defines a network request/reply for sending a signal to
*  a process by name
*/

typedef struct UTIL_PROCESS_SIGNAL
    {
    unsigned short	prcsig_w_tc_or_status;		/* request typecode (NET_TC_PID_SIGNAL) or status return */
    char		prcsig_c_process_name[UTIL_OS_PROCESS_NAME_LEN+2];	/* process name */
    int			prcsig_l_signal;		/* signal value */
    int			prcsig_l_pid;			/* returned PID */
    } __attribute__((packed)) UTIL_PROCESS_SIGNAL;

/*
*  UTIL_FIND_PROCESSES defines a network request/reply for retrieving
*  the processes matching a search criteria
*/

typedef struct UTIL_FIND_PROCESS_ENTRY
    {
    int			pid;				/* pid */
    char		process_name[UTIL_OS_PROCESS_NAME_LEN+2];	/* process name */
    } __attribute__((packed)) UTIL_FIND_PROCESS_ENTRY;

#define	UTIL_FIND_PROCESS_SEARCH_LEN	256
#define	UTIL_FIND_PROCESS_MAX_ENTRIES	2800

typedef struct UTIL_FIND_PROCESSES
    {
    unsigned short	fndprc_w_tc_or_status;		/* request typecode (NET_TC_FIND_PROCESSES) or status return */
    int			fndprc_l_search_type;		/* search type */
    char		fndprc_c_search_value[UTIL_FIND_PROCESS_SEARCH_LEN+2];	/* search value */
    int			fndprc_l_num_processes;		/* number of matching processes */
    int			fndprc_l_num_ret_processes;	/* number of returned processes */
    UTIL_FIND_PROCESS_ENTRY	fndprc_s_entries[UTIL_FIND_PROCESS_MAX_ENTRIES];	/* returned processes */
    } __attribute__((packed)) UTIL_FIND_PROCESSES;

/*
*  UTIL_PROCESS_INFO defines a network request/reply for retrieving
*  the process information corresponding to a pid
*/

#define	UTIL_OS_PROCESS_COMMAND_LINE_LEN	256
#define	UTIL_OS_PROCESS_STATE_LEN		16

typedef struct UTIL_PROCESS_INFO
    {
    unsigned short	prcinfo_w_tc_or_status;		/* request typecode (NET_TC_PID_TO_NAME) or status return */
    int			prcinfo_l_pid;			/* pid */
    char		prcinfo_c_process_name[UTIL_OS_PROCESS_NAME_LEN+2];	/* returned process name */
    char		prcinfo_c_command_line[UTIL_OS_PROCESS_COMMAND_LINE_LEN+2];	/* returned process command line */
    char		prcinfo_c_state[UTIL_OS_PROCESS_STATE_LEN+2];	/* returned process state */
    int			prcinfo_l_user_id;		/* returned user ID */
    int			prcinfo_l_group_id;		/* returned group ID */
    int			prcinfo_l_parent_pid;		/* returned parent pid */
    int			prcinfo_l_tracer_pid;		/* returned tracer pid */
    unsigned int	prcinfo_l_memory_size;		/* returned memory size */
    unsigned int	prcinfo_l_resident_set_size;	/* returned resident set size */
    unsigned int	prcinfo_l_cpu_time;		/* returned CPU time */
    unsigned int	prcinfo_l_num_threads;		/* returned number of threads */
    unsigned int	prcinfo_l_start_time_in_jiffies;	/* returned start time in jiffies */
    time_t		prcinfo_l_start_time;		/* returned start time */
    } __attribute__((packed)) UTIL_PROCESS_INFO;

/*
*  UTIL_RESTART_UTIL defines a network request/reply for restarting
*  the utility window
*/

#define	UTIL_RESTART_ALL_INSTANCES	(-2)		/* restart all instances on this machine */
#define	UTIL_RESTART_LOCAL		(-1)		/* restart this instance */

typedef struct UTIL_RESTART_UTIL
    {
    unsigned short	resutl_w_tc_or_status;		/* request typecode (NET_TC_RESTART_UTIL) or status return */
    int			resutl_l_requestor_console;	/* requesting console */
    int			resutl_l_requestor_node;	/* requesting node */
    int			resutl_l_instance;		/* instance to restart */
    } __attribute__((packed)) UTIL_RESTART_UTIL;

/*
*  UTIL_RESTART_ALARM_DAEMON defines a network request/reply for restarting
*  the alarms daemon
*/

typedef struct UTIL_RESTART_ALARM_DAEMON
    {
    unsigned short	resadmn_w_tc_or_status;		/* request typecode (NET_TC_RESTART_ALARM_DAEMON) or status return */
    int			resadmn_l_requestor_console;	/* requesting console */
    int			resadmn_l_requestor_node;	/* requesting node */
    } __attribute__((packed)) UTIL_RESTART_ALARM_DAEMON;

/*
*  UTIL_RESTART_ALARM_DISPLAY defines a network request/reply for restarting
*  alarm displays
*/

typedef struct UTIL_RESTART_ALARM_DISPLAY
    {
    unsigned short	resadisp_w_tc_or_status;	/* request typecode (NET_TC_RESTART_ALARM_DISPLAY) or status return */
    int			resadisp_l_requestor_console;	/* requesting console */
    int			resadisp_l_requestor_node;	/* requesting node */
    int			resadisp_l_instance;		/* instance to restart */
    } __attribute__((packed)) UTIL_RESTART_ALARM_DISPLAY;

#endif