⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scs_error.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 2 页
字号:
scs_console_log( cb, event, event_type )    register CB		*cb;    register u_long	event;    u_long		event_type;{    register SB		*sb;    register PB		*pb;    register u_long	severity = Eseverity( event );    /* Console messages for connection specific SCS events always display     * the local and remote SYSAP names, local port name, local and remote port     * station addresses, and remote system name by default.  Console messages     * for local SYSAP specific events always display the local SYSAP name by     * default.     *     * A panic occurs whenever SCS is not prepared to log the event due to     * detection of any of the following circumstances:     *     * 1. The event type is unknown.     * 2. The event is not a SCS specific event.     * 3. The severity level of the event is invalid.     * 4. The code of the event exceeds the current maximum known code for the     *	  severity level of the event.     * 5. The event is not represented within the appropriate console logging     *    formatting table( indicating that SCS should never have been asked to     *	  log it in the first place ).     * 6. The class of variable information associated with the event is     *	  unknown.     *     * None of these circumstances should ever occur.     *     * NOTE: Currently all SCS events are logged without displaying any     *	     variable information.     *     * NOTE: Events represented within console logging format tables by NULL     *	     entries are events which are always to be logged only by     *	     individual port drivers and never by SCS.  Currently, no such     *	     warning events fall within this category.     */    if( event_type > LSYSAP_EVENT				||	 !Test_scs_event( event )				||	 severity > ES_W					||	 Ecode( event ) > Scs_clmaxcode( scs_cltab, event )	||	 Scs_cltabmsg( scs_cltab, event ) == NULL ) {	( void )panic( SCSPANIC_UNKCOD );    } else if( Scs_cltabcode( scs_cltab, event ) > CF_NONE ) {	( void )panic( SCSPANIC_UNKCF );    } else if( scs_severity > severity && !Test_cloverride( event )) {	return;    }    ( void )cprintf( "scs\t- %s\n", Scs_cltabmsg( scs_cltab, event ));    switch( event_type ) {	case CONN_EVENT:	    ( void )cprintf( "\t- local/remote sysap: %16s/%16s\n",			     cb->cinfo.lproc_name,			     cb->cinfo.rproc_name );	    if(( pb = cb->pb )) {		sb = pb->sb;		( void )cprintf( "\t- path( local( %4s )/remote port: %u/%u",				 &pb->pccb->lpinfo.name,				 Scaaddr_low( pb->pccb->lpinfo.addr ),				 Scaaddr_low( pb->pinfo.rport_addr ));	    } else {		sb = NULL;		( void )cprintf( "\t- path( local( ? )/remote port: ?/?" );	    }	    if( sb ) {		( void )cprintf( ", remote system: %8s", sb->sinfo.node_name );	    } else {		( void )cprintf( ", remote system: ?" );	    }	    break;	case LSYSAP_EVENT:	    ( void )cprintf( "\t- local sysap: %16s", cb->cinfo.lproc_name );	    break;    }    switch( Scs_cltabcode( scs_cltab, event )) {	case CF_NONE:	    ( void )cprintf( "\n" );	    break;    }}/*   Name:	scs_log_event	- Log Local SYSAP/Connection Specific Events * *   Abstract:	This routine logs SCS local SYSAP and connection specific *		events.  Local SYSAP events are the result of specific SYSAP *		actions.  Connection specific events may result either from *		direct or indirect SYSAP actions; or, as a consequence of *		port driver related events.  The event is also optionally *		logged to the console. * *		Two classes of events are currently logged by this routine: * *		1. Changes in connection state. *		2. Local SYSAP actions. * *		None of these events are serious in nature.  They are logged *		to give a warning or for informational purposes only. * *		NOTE: This routine does not log path specific error or severe *		      error events, all of which are candidates for application *		      of the  path crash severity modifier( ESM_PC ).  Logging *		      of such events is currently the responsibility of the *		      individual port drivers.   * *   Inputs: * *   IPL_SCS			- Interrupt processor level *   cb				- Connection Block pointer *	errlogopt.rreason	-  SYSAP/SCS connection rejection reason *   event			- Event code *   event_type			- CONN_EVENT, LSYSAP_EVENT *   lscs			- Local system permanent information * *   Outputs: * *   IPL_SCS			- Interrupt processor level * *   SMP:	The CB is locked( EXTERNALLY ) to synchronize access and *		prevent premature deletion.  It is locked through its CBVTE. * *		PBs and PCCBs do NOT require locking when provided because only *		static fields are accessed and because PBs are prevented from *		deletion be EXTERNAL CB locks.  SBs NEVER require locking. */voidscs_log_event( cb, event, event_type )    register CB			*cb;    register u_long		event;    u_long			event_type;{    register PCCB		*pccb;    register u_char		*celp;    register struct el_rec	*elp;    register u_long	        severity = Eseverity( event );    /* The steps involved in logging non-path specific SCS events include:     *     * 1. Logging the event to the console.     * 2. Computing the size of the application portion of the event log     *	  record.     * 3. Allocating an event log record and initializing the record's sub id     *	  packet fields.     * 4. Initializing the portion of the record common to all non-path related     *	  SCS events.     * 5. Moving any optional information into the record.     * 6. Validating the event log record.     *     * The ability of SCS to log the event is validated during console logging(     * Step 1 ).  A panic occurs whenever SCS is not prepared to log the     * reported event.     *     * This routine immediately terminates on failure to allocate an event log     * record( Step 3 ).     *     * The size of the application portion of each event log record( Step 2 )     * is dependent upon the presence or absence of optional information to be     * included within the record( Step 5 ).  The following types of optional     * information may be logged:     *     * 1. SCS connection information.     * 2. Local directory identification number.     * 3. Remote SYSAP/SCS connection reject reason.     *     * Sufficient space is reserved within the event record for such optional     * information only for those event which require its logging.  Logging of     * SCS connection information is required by all connection specific     * events.  Logging of the local directory identification number is     * currently required by all local SYSAP specific events.  Logging of the     * remote SYSAP/SCS connection reject reason is required by two events:     * W_REJECT_FCONN and W_TERM_FCONN.     */    ( void )scs_console_log( cb, event, event_type );    if( scs_errlog > severity &&         !Test_cloverride( event ) &&	scs_errlog < SCA_ERRLOG3 ) {	    return;    }    {    register u_long		size;    size = sizeof( struct scs_common );    if( event_type == CONN_EVENT ) {	pccb = cb->pccb;	size += sizeof( struct scs_conn );	if( event == W_TERM_FCONN || event == W_REJECT_FCONN ) {	    size += sizeof( u_long );	}    } else {	pccb = NULL;	size += sizeof( u_short );    }    if(( elp = ealloc( size, EL_PRIHIGH )) == EL_FULL ) {	return;    }    }    LSUBID( elp,	    ELSW_SCS,	    EL_UNDEF,	    (( pccb ) ? pccb->lpinfo.type.hwtype : EL_UNDEF ),	    (( pccb ) ? Ctrl_from_name( pccb->lpinfo.name ) : EL_UNDEF ),	    EL_UNDEF,	    event )    Elscscommon( elp )->scs_optfmask1 = 0;    Elscscommon( elp )->scs_optfmask2 = 0;    Elscscommon( elp )->scs_evpktver = SCS_EVPKTVER;    Move_name( cb->cinfo.lproc_name, Elscscommon( elp )->scs_lsysap )    Move_name( cb->cinfo.lconn_data, Elscscommon( elp )->scs_lconndata )    Move_connid( cb->cinfo.lconnid, Elscscommon( elp )->scs_lconnid )    Move_node( lscs.system.node_name, Elscscommon( elp )->scs_lname )    Move_scaaddr( lscs.system.sysid, *Elscscommon( elp )->scs_lsysid )    Elscscommon( elp )->scs_cstate = cb->cinfo.cstate;    celp = ( u_char * )( Elscscommon( elp ) + 1 );    if( event_type == CONN_EVENT ) {	register PB	*pb = cb->pb;	Elscscommon( elp )->scs_optfmask1 |= ( SCS_CLTDEVTYP |					       SCS_CLTDEVNUM |					       SCS_CONN );	Move_name( cb->cinfo.rproc_name, Elscsconn( celp )->scs_rsysap )	Move_name( cb->cinfo.rconn_data, Elscsconn( celp )->scs_rconndata )	Move_connid( cb->cinfo.rconnid, Elscsconn( celp )->scs_rconnid )	if( pb && pb->sb ) {	    Move_node( pb->sb->sinfo.node_name, Elscsconn( celp )->scs_rname )	    Move_scaaddr( pb->sb->sinfo.sysid, *Elscsconn( celp )->scs_rsysid )	} else {	    U_long( Elscsconn( celp )->scs_rname[ 0 ]) = EL_UNDEF;	    U_long( Elscsconn( celp )->scs_rname[ 4 ]) = EL_UNDEF;	    U_short( Elscsconn( celp )->scs_rsysid[ 0 ]) = EL_UNDEF;	    U_short( Elscsconn( celp )->scs_rsysid[ 2 ]) = EL_UNDEF;	    U_short( Elscsconn( celp )->scs_rsysid[ 4 ]) = EL_UNDEF;	}	if( pb ) {	    Move_scaaddr( pb->pinfo.rport_addr, *Elscsconn( celp )->scs_rsaddr)	    Elscsconn( celp )->scs_nconns = pb->pinfo.nconns;	} else {	    U_short( Elscsconn( celp )->scs_rsaddr[ 0 ]) = EL_UNDEF;	    U_short( Elscsconn( celp )->scs_rsaddr[ 2 ]) = EL_UNDEF;	    U_short( Elscsconn( celp )->scs_rsaddr[ 4 ]) = EL_UNDEF;	    Elscsconn( celp )->scs_nconns = EL_UNDEF;	}	if( pccb ) {	    U_long( *Elscsconn( celp )->scs_lpname ) = pccb->lpinfo.name;	    Move_scaaddr( pccb->lpinfo.addr, *Elscsconn( celp )->scs_lsaddr )	} else {	    U_long( *Elscsconn( celp )->scs_lpname ) = EL_UNDEF;	    U_short( Elscsconn( celp )->scs_lsaddr[ 0 ]) = EL_UNDEF;	    U_short( Elscsconn( celp )->scs_lsaddr[ 2 ]) = EL_UNDEF;	    U_short( Elscsconn( celp )->scs_lsaddr[ 4 ]) = EL_UNDEF;	}	if( event == W_TERM_FCONN || event == W_REJECT_FCONN ) {	    celp += sizeof( struct scs_conn );	    Elscscommon( elp )->scs_optfmask1 |= SCS_RREASON;	    *Elscsrreason( celp ) = cb->errlogopt.rreason;	}    } else {	Elscscommon( elp )->scs_optfmask1 |= SCS_LDIRID;	*Elscsldirid( celp ) = cb->cinfo.Dirid;    }    EVALID( elp )}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -