📄 cippd_error.c
字号:
* maximum size of an event log record. * * Processing of CI PPD path and remote port specific events is for the * most port identical. Even that portion of the event log record reserved * for identifying specific CI PPD paths is initialized for remote port * specific events( step 6 ). This is because while the event may be * remote port specific it is discovered only during the course of * attempting to establish a CI PPD path. The only notable difference * between logging of these two types of events is the event type passed to * cippd_conlog(), the routine responsible for logging CI PPD events to the * console terminal( Step 1 ). * * NOTE: The new path information fields( structure cippd_newpath ) are * assummed to match up 1:1 with their corresponding SB system * information fields( SIB ). * * NOTE: Currently all events of remote error severity logged by this * routine are remote port specific events. All other events logged * by this routine are path specific events. */ ( void )cippd_conlog( pccb, pb, sb, event, (( Eseverity( event ) != ES_RE ) ? PATH_EVENT : RPORT_EVENT )); if( Eseverity( event ) >= ES_E ) { Event_counter( pccb->lpinfo.nerrs ) } if( cippd_errlog > severity && !Test_cloverride( event ) && cippd_errlog < SCA_ERRLOG3 ) { return; } size = sizeof( struct cippd_common ) + sizeof( struct cippd_pcommon ); if( cippdbp ) { opt_size = sizeof( struct cippd_ppacket ) + Appl_size( cippdbp ); if(( size += opt_size ) > EL_MAXAPPSIZE ) { opt_size += ( EL_MAXAPPSIZE - size ); size = EL_MAXAPPSIZE; } } else { switch( Mask_esevmod( event )) { case I_NEW_PATH: size += sizeof( struct cippd_newpath ); break; case E_SYSAP: size += NAME_SIZE; break; case RE_DBCONFLICT: size += sizeof( struct cippd_dbcoll ); break; } } if(( elp = ealloc( size, EL_PRIHIGH )) == EL_FULL ) { return; } LSUBID( elp, ELSW_CIPPD, EL_UNDEF, pccb->lpinfo.type.hwtype, Ctrl_from_name( pccb->lpinfo.name ), EL_UNDEF, event ) Elcippdcommon( elp )->cippd_optfmask1 = ( CIPPD_CLTDEVTYP | CIPPD_CLTDEVNUM | CIPPD_PCOMMON ); Elcippdcommon( elp )->cippd_optfmask2 = 0; Elcippdcommon( elp )->cippd_evpktver = CIPPD_EVPKTVER; Elcippdcommon( elp )->cippd_nerrs = pccb->lpinfo.nerrs; Move_scaaddr( lscs.system.sysid, *Elcippdcommon( elp )->cippd_lsysid ) Move_node( lscs.system.node_name, Elcippdcommon( elp )->cippd_lname ) if( sb ) { Elcippdcommon( elp )->cippd_npaths = sb->sinfo.npaths; Move_scaaddr( sb->sinfo.sysid, *Elcippdcommon( elp )->cippd_rsysid ) Move_node( sb->sinfo.node_name, Elcippdcommon( elp )->cippd_rname ) } else { Elcippdcommon( elp )->cippd_npaths = EL_UNDEF; U_short( Elcippdcommon( elp )->cippd_rsysid[ 0 ]) = EL_UNDEF; U_short( Elcippdcommon( elp )->cippd_rsysid[ 2 ]) = EL_UNDEF; U_short( Elcippdcommon( elp )->cippd_rsysid[ 4 ]) = EL_UNDEF; U_long( Elcippdcommon( elp )->cippd_rname[ 0 ]) = EL_UNDEF; U_long( Elcippdcommon( elp )->cippd_rname[ 4 ]) = EL_UNDEF; } U_long( *Elcippdpcommon( elp )->cippd_lpname ) = pccb->lpinfo.name; Move_scaaddr( pccb->lpinfo.addr, *Elcippdpcommon( elp )->cippd_lsaddr ) if( pb ) { Elcippdpcommon( elp )->cippd_pstate = pb->pinfo.state; Move_scaaddr( pb->pinfo.rport_addr, *Elcippdpcommon( elp )->cippd_rsaddr ) } else { Elcippdpcommon( elp )->cippd_pstate = EL_UNDEF; if(( U_short( Elcippdpcommon( elp )->cippd_rsaddr[ 0 ]) = pccb->Elogopt.port_num ) != EL_UNDEF ) { U_short( Elcippdpcommon( elp )->cippd_rsaddr[ 2 ]) = 0; U_short( Elcippdpcommon( elp )->cippd_rsaddr[ 4 ]) = 0; } else { U_short( Elcippdpcommon( elp )->cippd_rsaddr[ 2 ]) = EL_UNDEF; U_short( Elcippdpcommon( elp )->cippd_rsaddr[ 4 ]) = EL_UNDEF; } } if( cippdbp ) { ( void )bcopy(( u_char * )&cippdbp->mtype, ( u_char * )&Elcippdppacket( elp )->cippd_mtype, opt_size ); Elcippdcommon( elp )->cippd_optfmask1 |= CIPPD_PPACKET; } else { switch( Mask_esevmod( event )) { case I_NEW_PATH: Elcippdcommon( elp )->cippd_optfmask1 |= CIPPD_NEWPATH; if( sb ) { ( void )bcopy(( u_char * )&sb->sinfo.max_dg, ( u_char * )Elcippdnewpath( elp ), sizeof( struct cippd_newpath )); } else { Elcippdnewpath( elp )->cippd_max_dg = EL_UNDEF; Elcippdnewpath( elp )->cippd_max_msg = EL_UNDEF; U_long( *Elcippdnewpath( elp )->cippd_swtype ) = EL_UNDEF; U_long( *Elcippdnewpath( elp )->cippd_swver ) = EL_UNDEF; U_long( Elcippdnewpath( elp )->cippd_swincrn[ 0 ]) = EL_UNDEF; U_long( Elcippdnewpath( elp )->cippd_swincrn[ 4 ]) = EL_UNDEF; U_long( *Elcippdnewpath( elp )->cippd_hwtype ) = EL_UNDEF; U_long( Elcippdnewpath( elp )->cippd_hwver[ 0 ]) = EL_UNDEF; U_long( Elcippdnewpath( elp )->cippd_hwver[ 4 ]) = EL_UNDEF; U_long( Elcippdnewpath( elp )->cippd_hwver[ 8 ]) = EL_UNDEF; } break; case E_SYSAP: Move_name( pccb->Elogopt.sysapname, Elcippdsysapnam( elp )) Elcippdcommon( elp )->cippd_optfmask1 |= CIPPD_SYSAP; break; case RE_DBCONFLICT: *Elcippddbcoll( elp ) = pccb->Elogopt.dbcoll; Elcippdcommon( elp )->cippd_optfmask1 |= CIPPD_DBCOLL; break; } } EVALID( elp )}/* Name: cippd_log_sys - Event Log CI PPD System Specific Events * * Abstract: This routine logs CI PPD system specific events. Such events * are associated with specific remote systems and not with * specific ports on those systems. They are normally ascertained * indirectly from a received CI PPD datagram or message. The * event is also optionally logged to the console. * * Three classes of events are currently logged by this routine: * * 1. CI PPD protocol mismatches. * 2. Remote system error log packets. * 3. Software detected unsupported remote system software types. * * Some of these events represent serious errors and are logged to * save relevant information before drastic steps are attempted to * resolve them. Others are less serious and are logged only to * give a warning or for informational purposes only. * * NOTE: While all events logged therein arise indirectly from CI * PPD packets, the logging of each event does not * necessarily involve logging of the packet itself. * * NOTE: Only packets with CI PPD headers( CI PPD datagrams or * messages ) may be passed to this routine. * * NOTE: This routine does NOT log events arising external to the * CI PPD. It also does NOT log any CI PPD event which is a * candidate for application of either the path( ESM_PC ) or * local port( ESM_LPC ) crash severity modifier. * * NOTE: System specific events never increment the counter of * errors associated with any local port even when their * severity is error( ES_E ) or higher. This is because the * event is not associated with a specific path to a remote * system; and therefore, can not be associated with any * specific local port. * * Inputs: * * IPL_SCS - Interrupt processor level * cippdbp - Address of CI PPD header( OPTIONAL ) * event - Event code * lscs - Local system permanent information * sb - System Block pointer * pccb - Port Command and Control Block pointer * ppd.cippd - CI PPD specific PCCB fields * elogopt.protocol - CI PPD protocol information * elogopt.rswtype - Remote system software type * * Outputs: * * IPL_SCS - Interrupt processor level * * SMP: The PCCB is locked( EXTERNALLY ) to synchronize access. * * SBs NEVER require locking however they must EXTERNALLY be * prevented from deletion by means of some other lock( such as a * lock on the SCA database or on a PB representing a path to the * system ). */voidcippd_log_sys( pccb, sb, cippdbp, event ) PCCB *pccb; register SB *sb; register GVPPPDH *cippdbp; register u_long event;{ register struct el_rec *elp; register u_long opt_size, size; register u_long severity = Eseverity( event ); /* The steps involved in logging system specific 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 CI PPD events. * 5. Initializing the portion of the record common to all CI PPD system * specific events. * 6. Moving any optional information into the record. * 7. Validating the event log record. * * The ability of the CI PPD to log the event is validated during console * logging( Step 1 ). A panic occurs whenever the CI PPD is not prepared * to log the reported event. Note that console logging only validates the * ability of the CI PPD to log the event, NOT the ability of this routine * to correctly log it. Therefore, while all attempts by this routine to * log events more properly logged by cippd_log_path() are successful, * important information may be loss due to this routine's unpreparedness * to deal with it. * * 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 6 ). The following types of mutually * exclusive optional information may be logged: * * 1. A CI PPD datagram/message. * 2. Remote and local CI PPD mismatched protocol versions. * * The last type of optional information is associated with only certain * specific events( W_TALKUP and E_TALKDOWN ). Optional CI PPD datagrams * and messages may be associated with many different events. They also * vary widely in size unlike other types of optional information whose * size is fixed. Logged CI PPD packets are truncated whenever logging * their full size would exceed the maximum size of an event log record. * * NOTE: The common system level information fields( structure * cippd_scommon ) are assummed to match up 1:1 with their * corresponding SB system information fields( SIB ). */ ( void )cippd_conlog( pccb, NULL, sb, event, SYSTEM_EVENT ); if( cippd_errlog > severity && !Test_cloverride( event ) && cippd_errlog < SCA_ERRLOG3 ) { return; } size = sizeof( struct cippd_common ) + sizeof( struct cippd_scommon ); if( cippdbp ) { opt_size = sizeof( struct cippd_spacket ) + Appl_size( cippdbp ); if(( size += opt_size ) > EL_MAXAPPSIZE ) { opt_size += ( EL_MAXAPPSIZE - size ); size = EL_MAXAPPSIZE; } } else { switch( Mask_esevmod( event )) { case W_TALKUP: case E_TALKDOWN: size += sizeof( struct cippd_protocol ); break; } } if(( elp = ealloc( size, EL_PRIHIGH )) == EL_FULL ) { return; } LSUBID( elp, ELSW_CIPPD, EL_UNDEF, EL_UNDEF, EL_UNDEF, EL_UNDEF, event ) Elcippdcommon( elp )->cippd_optfmask1 = CIPPD_SCOMMON; Elcippdcommon( elp )->cippd_optfmask2 = 0; Elcippdcommon( elp )->cippd_evpktver = CIPPD_EVPKTVER; Elcippdcommon( elp )->cippd_nerrs = pccb->lpinfo.nerrs; Move_scaaddr( lscs.system.sysid, *Elcippdcommon( elp )->cippd_lsysid ) Move_node( lscs.system.node_name, Elcippdcommon( elp )->cippd_lname ) if( sb ) { Elcippdcommon( elp )->cippd_npaths = sb->sinfo.npaths; Move_scaaddr( sb->sinfo.sysid, *Elcippdcommon( elp )->cippd_rsysid ) Move_node( sb->sinfo.node_name, Elcippdcommon( elp )->cippd_rname ) ( void )bcopy(( u_char * )&sb->sinfo.swtype, Elcippdscommon( elp )->cippd_rswtype, sizeof( struct cippd_scommon )); } else { Elcippdcommon( elp )->cippd_npaths = EL_UNDEF; U_short( Elcippdcommon( elp )->cippd_rsysid[ 0 ]) = EL_UNDEF; U_short( Elcippdcommon( elp )->cippd_rsysid[ 2 ]) = EL_UNDEF; U_short( Elcippdcommon( elp )->cippd_rsysid[ 4 ]) = EL_UNDEF; U_long( Elcippdcommon( elp )->cippd_rname[ 0 ]) = EL_UNDEF; U_long( Elcippdcommon( elp )->cippd_rname[ 4 ]) = EL_UNDEF; U_long( *Elcippdscommon( elp )->cippd_rswtype ) = EL_UNDEF; U_long( *Elcippdscommon( elp )->cippd_rswver ) = EL_UNDEF; U_long( Elcippdscommon( elp )->cippd_rswincrn[ 0 ]) = EL_UNDEF; U_long( Elcippdscommon( elp )->cippd_rswincrn[ 4 ]) = EL_UNDEF; U_long( *Elcippdscommon( elp )->cippd_rhwtype ) = EL_UNDEF; U_long( Elcippdscommon( elp )->cippd_rhwver[ 0 ]) = EL_UNDEF; U_long( Elcippdscommon( elp )->cippd_rhwver[ 4 ]) = EL_UNDEF; U_long( Elcippdscommon( elp )->cippd_rhwver[ 8 ]) = EL_UNDEF; } if( cippdbp ) { ( void )bcopy(( u_char * )&cippdbp->mtype, ( u_char * )&Elcippdspacket( elp )->cippd_mtype, opt_size ); Elcippdcommon( elp )->cippd_optfmask1 |= CIPPD_SPACKET; } else { switch( Mask_esevmod( event )) { case W_TALKUP: case E_TALKDOWN: *Elcippdprotocol( elp ) = pccb->Elogopt.protocol; Elcippdcommon( elp )->cippd_optfmask1 |= CIPPD_PROTOCOL; } } EVALID( elp )}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -