/* <snapevtdef.h>
 *
 *	Snapshot event definitions
 */
#ifndef _SNAPEVTDEF_H
#define _SNAPEVTDEF_H

#ifdef NO_VMS_V6
#define SNAPEVT$_SNAPSHOT    1	/* a system snapshot is pending in a non-VAXcluster environment */
#define SNAPEVT$_CLUPEND     2	/* a system snapshot is pending in a VAXcluster environment */
#define SNAPEVT$_RESTART     3	/* the system has just booted from a snapshot into a non-VAXcluster environment */
#define SNAPEVT$_CLU_RESTART 4	/* the system has just booted from a snapshot into a VAXcluster environment */
#define SNAPEVT$_ABORT	     5	/* a fatal error occurred during the taking of a snapshot */
#define SNAPEVT$_CLUEXIT     6	/* the system is resynchronizing after a loss of communications with the remainder of the cluster */
#define SNAPEVT$_ROLLOUT     7	/* a system roll-out is pending */
#define SNAPEVT$_ROLLIN      8	/* a system roll-in has been completed */
#else

/* Event codes */
#define SNAPEVT$_SNAPSHOT    1	/* a system snapshot is pending */
#define SNAPEVT$C_SNAPSHOT   1
#define SNAPEVT$_RESTART     3	/* the system is booting from a snapshot */
#define SNAPEVT$C_RESTART    3
#define SNAPEVT$_ABORT	     5	/* an attempt to take a snapshot as aborted */
#define SNAPEVT$C_ABORT      5
#define SNAPEVT$_CLUEXIT     6	/* the system is resynchronizing after loss of communication */
#define SNAPEVT$C_CLUEXIT    6	/* with the rest of the cluster */
#ifndef ONLY_VMS_V6
#define SNAPEVT$_CLUPEND     2
#define SNAPEVT$_CLU_RESTART 4
#define SNAPEVT$_ROLLOUT     7
#define SNAPEVT$_ROLLIN      8
#endif

/* Bugcheck codes; these appear on the stack whenever a SNAPSHOT bugcheck is executed */
#define SNAPBUG$C_CONUTIL_SLOTOCCUP	1	/* Our desired slot is occupied (CSID on stack) */
#define SNAPBUG$C_CONUTIL_OLDCOORD	2	/* Old coordinator assigned a bad CSID (CSID on stack) */
#define SNAPBUG$C_CONUTIL_BAD_MAX_NODES 3	/* INCRNDEF doesn't agree with MAXINDEX (SPR) */
#define SNAPBUG$C_CONUTIL_SAME_CSID	4	/* Two nodes have the same CSID (SPR) */
#define SNAPBUG$C_MSCP_NOWAIT		5	/* MSCP server did not complete initialization (SPR) */
#define SNAPBUG$C_SHDSNAP_BADEVT	6	/* Shadow driver called with unknown event type (SPR) */
#define SNAPBUG$C_SHDSNAP_PENDING_PRE	7	/* Shadow driver called twice for pending snapshot before restart (SPR) */
#define SNAPBUG$C_SHDSNAP_PENDING_POST	8	/* Shadow driver called twice for pending snapshot after restart(SPR) */
#define SNAPBUG$C_SHDSNAP_UNEXP_PENDING 9	/* Shadow driver saw an unexpected pending state */
#define SNAPBUG$C_SHDSNAP_SHUTDWN_FAIL	10	/* Shadow driver shutdown failed (SPR, POOL) */
#define SNAPBUG$C_SHDSNAP_NO_MERGE_AST	11	/* Shadow driver merge assist is unsupported (UNSUPPORTED) */
#define SNAPBUG$C_SHDSNAP_BAD_RWAITCNT	12	/* Shadow driver saw an unexpected resource wait count (SPR) */
#define SNAPBUG$C_SHDSNAP_NOCANDIDATE	13	/* Shadow driver could not find shadow set candidates (SPR) */
#define SNAPBUG$C_SHDSNAP_TOOMANYCAND	14	/* Shadow driver found too many candidates (SPR) */
#define SNAPBUG$C_SHDSNAP_NOMNTVERIP	15	/* Shadow driver unexpectedly found mount verify clear (SPR) */
#define SNAPBUG$C_SHDSNAP_BAD_RETURN	16	/* Shadow driver unexpectedly returned from sh$shadow_processing (SPR) */
#define SNAPBUG$C_SHDSNAP_BAD_MASTERUCB 17	/* Shadow driver could not find the new master's UCB (BAD FILE) */
#define SNAPBUG$C_SHDSNAP_MOUNTEDELSEWH 18	/* Shadow driver needs a disk mounted in another volume set (BAD FILE) */
#define SNAPBUG$C_SNAPSHOT_LOCKPAGE	19	/* All pages locked in memory were not unlocked (SPR) */
#define SNAPBUG$C_BROADCAST_BADMSG	20	/* Bad broadcast message format (SPR) */
#define SNAPBUG$C_CLUSTER_QF_WIP	21	/* Unexpected quorum file write in progress (SPR) */
#define SNAPBUG$C_CLUSTER_FLAGS		22	/* Unexpected cluster flags state (SPR) */
#define SNAPBUG$C_CLUSTER_LK_FLAGS	23	/* Unexpected cluster lock flags (SPR) */
#define SNAPBUG$C_CLUSTER_FAILOVER	24	/* Unexpected cluster failover state (SPR) */
#define SNAPBUG$C_CLUSTER_NOLONG_BREAK	25	/* Cluster system block not in long break state (SPR) */
#define SNAPBUG$C_CLUSTER_NONMEM_REFC	26	/* Unexpected cluster non-member reference count (SPR) */
#define SNAPBUG$C_CLUSTER_MEMBER_REFC	27	/* Unexpected cluster member reference count (SPR) */
#define SNAPBUG$C_CLUSTER_LOCK_STATE	28	/* Unexpected lock state (SPR) */
#define SNAPBUG$C_CLUSTER_FKB_BUSY	29	/* Cluster fork block found on fork queue (SPR) */
#define SNAPBUG$C_CLUSTRLOA_INPROG	30	/* Snapshot event processing already in progress (SPR) */
#define SNAPBUG$C_CLUSTRLOA_UNSUPFUNC	31	/* Unsupported cluster snapshot function (SPR) */
#define SNAPBUG$C_CLUSTRLOA_ALRINPROG	32	/* Snapshot shutdown already in progress (SPR) */
#define SNAPBUG$C_CLUSTRLOA_UNSUPRST	33	/* Unsupported cluster restart function (SPR) */
#define SNAPBUG$C_CLUSTRLOA_BADINIT	34	/* Connection manager restart failure (POOL) */
#define SNAPBUG$C_CLUSTRLOA_BADREFCNT	35	/* Bad Cluster System Block reference count (SPR) */
#define SNAPBUG$C_CLUSTRLOA_LOCKDB	36	/* Unexpected stale lock database entries (SPR) */
#define SNAPBUG$C_CLUSTRLOA_MSTCOPY	37	/* Unexpected lock master copy still present (SPR) */
#define SNAPBUG$C_CLUSTRLOA_LOCK_STATE	38	/* Unexpected lock state (SPR) */
#define SNAPBUG$C_CLUSTRLOA_DBSIZE	39	/* Stale lock database is too small (SPR) */
#define SNAPBUG$C_CLUSTRLOA_LKBREFNEG	40	/* Lock reference count went negative (SPR) */
#define SNAPBUG$C_CLUSTRLOA_LOCKMGRERR	41	/* Unexpected lock context flags state (SPR) */
#define SNAPBUG$C_CLUSTRLOA_LOCKLOOP	42	/* Lock rundown infinite loop in progress (SPR) */
#define SNAPBUG$C_FILES_NOVOLVCB	43	/* No volume set VCB found (SPR) */
#define SNAPBUG$C_FILES_NOPROCVCB	44	/* No VCB found during disk processing (SPR) */
#define SNAPBUG$C_FILES_P1EXPANDED	45	/* The snapshot process p1 space expanded unexpectedly (SPR) */
#define SNAPBUG$C_FILES_NOAQB		46	/* No AQB found for a mounted volume (SPR) */
#define SNAPBUG$C_MEMORY_BADBUFFER	47	/* Buffer found in the wrong address space (SPR) */
#define SNAPBUG$C_MEMORY_PAGEDEAL	48	/* Not all pagefile pages correctly deallocated (SPR) */
#define SNAPBUG$C_MEMORY_BADBITMAP	49	/* Illegal memory bitmap reference (SPR) */
#define SNAPBUG$C_MEMORY_BADFREEBIT	50	/* Illegal free page bitmap reference (SPR) */
#define SNAPBUG$C_MEMORY_BADFREEBIT2	51	/* Illegal free page bitmap reference (SPR) */
#define SNAPBUG$C_MEMORY_BADMODBIT	52	/* Illegal modify bitmap refereence (SPR) */
#define SNAPBUG$C_MEMORY_NOSTORETBL	53	/* No place to store pfn references (SPR) */
#define SNAPBUG$C_MEMORY_NOTFREELIST	54	/* Expected free page not on free page list (SPR) */
#define SNAPBUG$C_MEMORY_BADDALCBAKSTOR 55	/* Illegal call to mmg$dalcbakstore (SPR) */
#define SNAPBUG$C_MEMORY_BADRELPFN	56	/* Illegal call to mmg$relpfn (SPR) */
#define SNAPBUG$C_MEMORY_BADMFYPAG	57	/* Unexpected modified page (SPR) */
#define SNAPBUG$C_MEMORY_BADFREEPAG	58	/* Unexpected free page (SPR) */
#define SNAPBUG$C_MEMORY_BADCOPYPFN	59	/* Unexpected copy pfn (SPR) */
#define SNAPBUG$C_MEMORY_BADCOPYSTATE	60	/* Unexpected copy state (SPR) */
#define SNAPBUG$C_MEMORY_NOTFREELST	61	/* Page isn't on the free list (SPR) */
#define SNAPBUG$C_MEMORY_NOPIC		62	/* Bad page list could not be located (SPR) */
#define SNAPBUG$C_MEMORY_BADFREELST	63	/* Free list is corrupt (SPR) */
#define SNAPBUG$C_MEMORY_BADFREELST2	64	/* Free list is corrupt (SPR) */
#define SNAPBUG$C_MEMORY_NOFAULT	65	/* Failure to fault in system page (SPR) */
#define SNAPBUG$C_MEMORY_NOFAULT2	66	/* Failure to fault in system page (SPR) */
#define SNAPBUG$C_MEMORY_BADWORKPFN	67	/* Bad working set PFN reference (SPR) */
#define SNAPBUG$C_FORK_NOTIFY_BADFRKBLK 68	/* exe$dclrstfork called with bad fork block (SPR) */
#define SNAPBUG$C_FORK_NOTIFY_BADQUEUE	69	/* corrupted exe$gq_snap_fork_list queue (SPR) */
#define SNAPBUG$C_FORK_NOTIFY_BADQLOCK	70	/* corrupted exe$gq_snap_fork_list queue (SPR) */
#define SNAPBUG$C_FORK_NOTIFY_BADREFCNT 71	/* bad fork reference count (SPR) */
#define SNAPBUG$C_PROC_NOTIFY_UNEXPCALL 72	/* unexpected call sequence (SPR) */
#define SNAPBUG$C_PROC_NOTIFY_BADMODE	73	/* unexpected call mode (SPR) */
#define SNAPBUG$C_SYNCHRONIZE_BADSTUB	74	/* notification vector is not a stub (SPR) */
#define SNAPBUG$C_SYNCHRONIZE_NOVECTOR	75	/* notification AST did not find the notification vector (SPR) */
#define SNAPBUG$C_SYNCHRONIZE_BADSEQ	76	/* unknown notification sequence (SPR) */
#define SNAPBUG$C_SYNCHRONIZE_NOMAINWCB 77	/* No main image wcb (SPR) */
#define SNAPBUG$C_SYNCHRONIZE_NOACB	78	/* No valid AST control block found (SPR) */
#define SNAPBUG$C_SYNCHRONIZE_NOVECTOR2 79	/* notification AST did not find the notification vector (SPR) */
#define SNAPBUG$C_SYNCHRONIZE_INVRPT	80	/* invalid report format (SPR) */
#define SNAPBUG$C_SYNCHRONIZE_NOVECTOR3 81	/* notification code did not find the notification vector (SPR) */
#define SNAPBUG$C_SYSLICENSE_BADPCKLEN	82	/* bad license packed data length (SPR) */
#define SNAPBUG$C_SYSLICENSE_ERRCNTEXC	83	/* license error count exceeded (BAD FILE) */
#define SNAPBUG$C_SYSLICENSE_BADLMFNAME 84	/* illegal lmf logical name format (SPR) */
#define SNAPBUG$C_SYSLICENSE_NOBUFFER	85	/* no p1 buffers available (SPR) */
#define SNAPBUG$C_SYSLICENSE_NOBUFFER2	86	/* no p1 buffers available (SPR) */
#define SNAPBUG$C_SYSLICENSE_NOBUFFER3	87	/* no p1 buffers available (SPR) */
#define SNAPBUG$C_SYSLICENSE_UNEXPTRAN	88	/* unexpected lmf logical name translation (SPR) */
#define SNAPBUG$C_SYSLICENSE_BADLMFNAM2 89	/* illegal lmf logical name format (SPR) */
#define SNAPBUG$C_TAKE_SNAP_NOTIFYFORK	90	/* Error (on stack) returned from fork notification (SPR) */
#define SNAPBUG$C_TAKE_SNAP_CLUSTER	91	/* Cluster verification failed (SPR) */
#define SNAPBUG$C_TAKE_SNAP_POOLEXP	92	/* Unexpected pool expansion (SPR) */
#define SNAPBUG$C_TAKE_SNAP_NOTIFYFORK2 93	/* Error (on stack) returned from fork notification (SPR) */
#define SNAPBUG$C_TAKE_SNAP_PAGRESTORE	94	/* Page file restoration error (SPR) */
#define SNAPBUG$C_TAKE_SNAP_BADSTATUS	95	/* Unexpected erroneous status (on stack) (SPR) */
#define SNAPBUG$C_TAKE_SNAP_NODEBUG	96	/* System crashed because of previously broadcast error */
#define SNAPBUG$C_TAKE_SNAP_NOPIC	97	/* Failed to locate the PIC code (SPR) */
#define SNAPBUG$C_VALIDATE_VBNPURGE	98	/* Unexpected VBN cache purge failure (SPR) */
#define SNAPBUG$C_VALIDATE_DISK_DEQ	99	/* Unexpected lock dequeue failure (SPR) */
#define SNAPBUG$C_FILES_DISKERR		100	/* Mount verify abort on a disk (SPR) */
#define SNAPBUG$C_CLUSTRLOA_BADLCKCNT	101	/* Bad count of total locks in the system (SPR) */
#define SNAPBUG$C_CLUSTRLOA_BADRSBCNT	102	/* Bad count of total resources in the system (SPR) */
#define SNAPBUG$C_VCC_BADEVT		103	/* Bad snapshot event code (SPR) */
#define SNAPBUG$C_VCC_NOTRUNC		104	/* Cache not in a truncated state (SPR) */
#define SNAPBUG$C_VCC_LIMBO		105	/* Limbo files are present (SPR) */
#define SNAPBUG$C_VCC_LIMBO2		106	/* Limbo files are present (SPR) */
#define SNAPBUG$C_VCC_LIMBO3		107	/* Limbo files are present (SPR) */
#define SNAPBUG$C_VCC_WRITER		108	/* All files should be read-only (SPR) */
#define SNAPBUG$C_VCC_WRITER2		109	/* All files should be read-only (SPR) */
#define SNAPBUG$C_VCC_BADCMLOCK		110	/* Error on file lock queue (SPR) */
#define SNAPBUG$C_CLUSTRLOA_BADCLUVEC	111	/* Snapshot event processing already in progress (SPR) */
#define SNAPBUG$C_MEMORY_BADFREECNT	112	/* Bad free list count (SPR) */
#define SNAPBUG$C_PAGEFAULT		113	/* Unexpected Pagefault (Appears only with test software) */
#define SNAPBUG$C_FILES_NOUCBCTX	114	/* UCB lock context not saved (SPR) */
#define SNAPBUG$C_SNAPSHOT_STALEORB	115	/* Failure to update volume orb (SPR) */
/* End of bugcheck codes. */

#define SNAPEVT$V_ROLLINOUT	0
#define SNAPEVT$V_FILESYS	1
#define SNAPEVT$V_CLUSTER	2
#define SNAPEVT$V_DEBUG		3
#define SNAPEVT$V_DISCONNECT	4
#define SNAPEVT$V_NEW_CPU	5
#define SNAPEVT$V_NOQUIET	6
#define SNAPEVT$V_NOSECURE	7
#define SNAPEVT$M_ROLLINOUT	(1<<SNAPEVT$V_ROLLINOUT)	/* 0x01 */
#define SNAPEVT$M_FILESYS	(1<<SNAPEVT$V_FILESYS)		/* 0x02 */
#define SNAPEVT$M_CLUSTER	(1<<SNAPEVT$V_CLUSTER)		/* 0x04 */
#define SNAPEVT$M_DEBUG		(1<<SNAPEVT$V_DEBUG)		/* 0x08 */
#define SNAPEVT$M_DISCONNECT	(1<<SNAPEVT$V_DISCONNECT)	/* 0x10 */
#define SNAPEVT$M_NEW_CPU	(1<<SNAPEVT$V_NEW_CPU)		/* 0x20 */
#define SNAPEVT$M_NOQUIET	(1<<SNAPEVT$V_NOQUIET)		/* 0x40 */
#define SNAPEVT$M_NOSECURE	(1<<SNAPEVT$V_NOSECURE)		/* 0x80 */
struct snapevtcode {
    unsigned short snapevt$w_event;
    union {
	unsigned short snapevt$w_modifier;
	struct {
	    unsigned snapevt$v_rollinout  : 1;	/* rollinout system checkpoint */
	    unsigned snapevt$v_filesys	  : 1;	/* file system validation */
	    unsigned snapevt$v_cluster	  : 1;	/* VAXcluster fastboot */
	    unsigned snapevt$v_debug	  : 1;	/* Debug mode in effect */
	    unsigned snapevt$v_disconnect : 1;	/* disconnect all interactive terminals */
	    unsigned snapevt$v_new_cpu	  : 1;	/* boot on a different CPU */
	    unsigned snapevt$v_noquiet	  : 1;	/* broadcast informational messages to opa0: */
	    unsigned snapevt$v_nosecure   : 1;	/* allow access to interactive sessions */
	    unsigned			  : 8;
	} snapevt$r_modifier_bits;
    } snapevt$r_modifier_union;
};

#endif	/*?NO_VMS_V6*/

#endif	/*_SNAPEVTDEF_H*/
