📄 ospf_mib_helper_show.c
字号:
printf("Current OSPF MIB Database Statistics:\n"); printf("------------------------------------------\n"); printf("ospfAreaTable:instances allocated=%i\n", thisMapi->mApiOspfCurrAreaCnt); printf("ospfStubTable:instances allocated=%i\n", thisMapi->mApiOspfCurrStubCnt); printf("ospfLsdbTable:instances allocated=%i\n", thisMapi->mApiOspfCurrLsdbCnt); printf("ospfHostTable:instances allocated=%i\n", thisMapi->mApiOspfCurrHostCnt); printf("ospfIfTable:instances allocated=%i\n", thisMapi->mApiOspfCurrIfCnt); printf("ospfIfMetricTable:instances allocated=%i\n", thisMapi->mApiOspfCurrIfMetricCnt); printf("ospfVirtIfTable:instances allocated=%i\n", thisMapi->mApiOspfCurrVirtIfCnt); printf("ospfNbrTable:instances allocated=%i\n", thisMapi->mApiOspfCurrNbrCnt); printf("ospfExtLsdbTable:instances allocated=%i\n", thisMapi->mApiOspfCurrExtLsdbCnt); printf("ospfAreaAggregationTable:instances allocated=%i\n", thisMapi->mApiOspfCurrAreaAgCnt );#if defined(__OPAQUE_LSA__) printf("wrnOspfAreaTable:instances allocated=%i\n", thisMapi->mApiWrnOspfCurrAreaCnt); printf("wrnOspfLsdbTable:instances allocated=%i\n", thisMapi->mApiWrnOspfCurrLsdbCnt); printf("wrnOspfLocalLsdbTable:instances allocated=%i\n", thisMapi->mApiWrnOspfCurrLocalLsdbCnt); printf("wrnOspfExtLsdbTable:instances allocated=%i\n", thisMapi->mApiWrnOspfCurrExtLsdbCnt);#endif /* __OPAQUE_LSA__ */ printf("\n\n"); printf("Current OSPF MIB Free Memory Statistics\n"); printf("------------------------------------------\n"); printf("ospfAreaTable:free memory nodes=%i\n", lstCount(&thisMapi->ospfAreaAvl.ospfFreePoolList)); printf("ospfStubTable:free memory nodes:%i\n", lstCount(&thisMapi->ospfStubAvl.ospfFreePoolList)); printf("ospfLsdbTable:free memory nodes=%i\n", lstCount(&thisMapi->ospfLsdbAvl.ospfFreePoolList)); printf("ospfHostTable:free memory nodes=%i\n", lstCount(&thisMapi->ospfHostAvl.ospfFreePoolList)); printf("ospfIfTable:free memory nodes=%i\n", lstCount(&thisMapi->ospfIfAvl.ospfFreePoolList)); printf("ospfIfMetricTable:free memory nodes=%i\n", lstCount(&thisMapi->ospfIfMetricAvl.ospfFreePoolList)); printf("ospfVirtIfTable:free memory nodes=%i\n", lstCount(&thisMapi->ospfVirtIfAvl.ospfFreePoolList)); printf("ospfNbrTable:free memory nodes=%i\n", lstCount(&thisMapi->ospfNbrAvl.ospfFreePoolList)); printf("ospfExtLsdbTable:free memory nodes=%i\n", lstCount(&thisMapi->ospfExtLsdbAvl.ospfFreePoolList)); printf("ospfAreaAggregationTable:free memory nodes=%i\n", lstCount(&thisMapi->ospfAreaAgAvl.ospfFreePoolList));#if defined(__OPAQUE_LSA__) printf("wrnOspfAreaTable:free memory nodes=%i\n", lstCount(&thisMapi->wrnOspfAreaAvl.ospfFreePoolList)); printf("wrnOspfLsdbTable:free memory nodes=%i\n", lstCount(&thisMapi->wrnOspfLsdbAvl.ospfFreePoolList)); printf("wrnOspfLocalLsdbTable:free memory nodes=%i\n", lstCount(&thisMapi->wrnOspfLocalLsdbAvl.ospfFreePoolList)); printf("wrnOspfExtLsdbTable:free memory nodes=%i\n", lstCount(&thisMapi->wrnOspfExtLsdbAvl.ospfFreePoolList));#endif /* __OPAQUE_LSA__ */ printf("\n\n"); printf("SNMP TEST & COMMIT Statistics\n"); printf("------------------------------------------\n"); printf("number of SNMP COMMIT requests succeed:%i\n", thisMapi->mApiCompleteReqCnt); printf("number of SNMP TEST requests failed:%i\n", thisMapi->mApiTestReqFailedCnt); printf("number of SNMP COMMIT requests failed:%i\n", thisMapi->mApiCommitReqFailedCnt); printf("number of NVM SET requests failed:%i\n", thisMapi->mApiNvmSetReqFailedCnt); printf("number of requests out of sync:%i\n", thisMapi->mApiBogusReqCnt); printf("\n"); semGive( thisMapi->semMapiMutex ); return OK;}/*************************************************************************************** ospfMapiShow - display configurations and statistics for Management Interface** This routine display the configurations and statistics for the Management Interface.* To display the AVL tree for each table in the OSPF MIB, use the appropriate show* routine.** RETURNS: OK or ERROR** ERRNO: N/A*/STATUS ospfMapiShow( void ){ /* make sure the facility is properly initialized */ OSPF_MAPI_SHOW_INIT_CHECK(); semTake( thisMapi->semMapiMutex, WAIT_FOREVER ); ospfMapiPrint( thisMapi ); semGive( thisMapi->semMapiMutex ); return OK;}/***************************************************************************************** ospfMapiErrorShow - display operational error statistics for Management Interface** This routine display the Management Interface operational error statistics for* debugging and diagnostic purposes. Three types of error are displayed:* - max number of concurrent rows that can be configured/displayed has reached* - system resources unavailable* - any other type of failures** RETURNS: OK, always** ERRNO: N/A*/STATUS ospfMapiErrorShow( void ){ /* make sure the facility is properly initialized */ OSPF_MAPI_SHOW_INIT_CHECK(); semTake( thisMapi->semMapiMutex, WAIT_FOREVER ); printf("ERROR due to max number of table row has reached\n"); printf("------------------------------------------------------------------------\n"); printf("ospfAreaTable:%i\n", thisMapi->mApiOspfAreaMaxReached); printf("ospfStubTable:%i\n", thisMapi->mApiOspfStubMaxReached); printf("ospfLsdbTable:%i\n", thisMapi->mApiOspfLsdbMaxReached); printf("ospfHostTable:%i\n", thisMapi->mApiOspfHostMaxReached); printf("ospfIfTable=%i\n", thisMapi->mApiOspfIfMaxReached); printf("ospfIfMetricTable:%i\n", thisMapi->mApiOspfIfMetricMaxReached); printf("ospfVirtIfTable:%i\n", thisMapi->mApiOspfVirtIfMaxReached); printf("ospfNbrTable:%i\n", thisMapi->mApiOspfNbrMaxReached); printf("ospfVirtNbrTable:%i\n", thisMapi->mApiOspfVirtNbrMaxReached); printf("ospfExtLsdbTable:%i\n", thisMapi->mApiOspfExtLsdbMaxReached);#if defined(__OPAQUE_LSA__) printf("wrnOspfAreaTable:%i\n", thisMapi->mApiWrnOspfAreaMaxReached); printf("wrnOspfLsdbTable:%i\n", thisMapi->mApiWrnOspfLsdbMaxReached); printf("wrnOspfLocalLsdbTable:%i\n", thisMapi->mApiWrnOspfLocalLsdbMaxReached); printf("wrnOspfExtTable:%i\n", thisMapi->mApiWrnOspfExtLsdMaxReached);#endif /* __OPAQUE_LSA__ */ printf("ERROR due to resources unavailable\n"); printf("-----------------------------------\n"); printf("ospfAreaTable:%i\n", thisMapi->ospfAreaAvl.memReqFailedCnt); printf("ospfStubTable:%i\n", thisMapi->ospfStubAvl.memReqFailedCnt); printf("ospfLsdbTable:%i\n", thisMapi->ospfLsdbAvl.memReqFailedCnt); printf("ospfHostTable:%i\n", thisMapi->ospfHostAvl.memReqFailedCnt); printf("ospfIfTable=%i\n", thisMapi->ospfIfAvl.memReqFailedCnt); printf("ospfIfMetricTable:%i\n", thisMapi->ospfIfMetricAvl.memReqFailedCnt); printf("ospfVirtIfTable:%i\n", thisMapi->ospfVirtIfAvl.memReqFailedCnt); printf("ospfNbrTable:%i\n", thisMapi->ospfNbrAvl.memReqFailedCnt); printf("ospfVirtNbrTable:%i\n", thisMapi->ospfVirtNbrAvl.memReqFailedCnt); printf("ospfExtLsdbTable:%i\n", thisMapi->ospfExtLsdbAvl.memReqFailedCnt);#if defined(__OPAQUE_LSA__) printf("wrnOspfAreaTable:%i\n", thisMapi->wrnOspfAreaAvl.memReqFailedCnt); printf("wrnOspfLsdbTable:%i\n", thisMapi->wrnOspfLsdbAvl.memReqFailedCnt); printf("wrnOspfLocalLsdbTable:%i\n", thisMapi->wrnOspfLocalLsdbAvl.memReqFailedCnt); printf("wrnOspfExtTable:%i\n", thisMapi->wrnOspfExtLsdbAvl.memReqFailedCnt);#endif /* __OPAQUE_LSA__ */ printf("ERROR due to any other failures:\n"); printf("--------------------------------\n"); printf("ospfAreaTable:%i\n", thisMapi->mApiOspfAreaFailedCnt); printf("ospfStubTable:%i\n", thisMapi->mApiOspfStubFailedCnt); printf("ospfLsdbTable:%i\n", thisMapi->mApiOspfLsdbFailedCnt); printf("ospfHostTable:%i\n", thisMapi->mApiOspfHostFailedCnt); printf("ospfIfTable=%i\n", thisMapi->mApiOspfIfFailedCnt); printf("ospfIfMetricTable:%i\n", thisMapi->mApiOspfIfMetricFailedCnt); printf("ospfVirtIfTable:%i\n", thisMapi->mApiOspfVirtIfFailedCnt); printf("ospfNbrTable:%i\n", thisMapi->mApiOspfNbrFailedCnt); printf("ospfVirtNbrTable:%i\n", thisMapi->mApiOspfVirtNbrFailedCnt); printf("ospfExtLsdbTable:%i\n", thisMapi->mApiOspfExtLsdbFailedCnt);#if defined(__OPAQUE_LSA__) printf("wrnOspfAreaTable:%i\n", thisMapi->mApiWrnOspfAreaFailedCnt); printf("wrnOspfLsdbTable:%i\n", thisMapi->mApiWrnOspfLsdbFailedCnt); printf("wrnOspfLocalLsdbTable:%i\n", thisMapi->mApiWrnOspfLocalLsdbFailedCnt); printf("wrnOspfExtTable:%i\n", thisMapi->mApiWrnOspfExtLsdbFailedCnt);#endif /* __OPAQUE_LSA__ */ semGive( thisMapi->semMapiMutex ); return OK;}/***************************************************************************************** ospfMapiGenGroupPrint - debug print routine for ospfMapiGenGroupShow** This routine is invoke by ospfMapiGenGroupShow.** RETURNS: N/A** NOMANUAL*/LOCAL void ospfMapiGenGroupPrint( void ){ mApiOspfGenGroup_t *pOspfGenGroup; uchar_t ipStr[4]; pOspfGenGroup = (mApiOspfGenGroup_t *)thisMapi->pMapiOspfGenGroup; ospf_mApi_ipAddr2OctetString( pOspfGenGroup->ospfRouterId, ipStr ); printf("ospfRouterId.0[ipaddress] %i.%i.%i.%i\n", ipStr[0], ipStr[1], ipStr[2], ipStr[3] ); printf("ospfAdminStat.0 [integer] %s(%i)\n", status[pOspfGenGroup->ospfAdminStat], (int)pOspfGenGroup->ospfAdminStat); printf("ospfVersionNumber.0 [integer] %ld\n", pOspfGenGroup->ospfVersionNumber); printf("ospfAreaBdrRtrStatus.0 [integer] %s(%i)\n", trueValue[pOspfGenGroup->ospfAreaBdrRtrStatus], (int)pOspfGenGroup->ospfAreaBdrRtrStatus); printf("ospfASBdrRtrStatus.0 [integer] %s(%i)\n", trueValue[pOspfGenGroup->ospfASBdrRtrStatus], (int)pOspfGenGroup->ospfASBdrRtrStatus); printf("ospfExternLsaCount.0 [gauge] %ld\n", pOspfGenGroup->ospfExternLsaCount); printf("ospfExternLsaCksumSum.0 [integer] %ld(0x%X)\n", pOspfGenGroup->ospfExternLsaCksumSum, (unsigned)pOspfGenGroup->ospfExternLsaCksumSum ); printf("ospfTOSSupport.0 [integer] %s(%i)\n", trueValue[pOspfGenGroup->ospfTOSSupport], (int)pOspfGenGroup->ospfTOSSupport); printf("ospfOriginateNewLsas.0 [counter] %ld\n", pOspfGenGroup->ospfOriginateNewLsas); printf("ospfRxNewLsas.0 [counter] %ld\n", pOspfGenGroup->ospfRxNewLsas); printf("ospfExtLsdbLimit.0 [integer] %ld\n", pOspfGenGroup->ospfExtLsdbLimit); printf("ospfMulticastExtensions.0 [integer] %ld\n", pOspfGenGroup->ospfMulticastExtensions); printf("ospfExitOverflowInterval.0 [integer] %ld\n", pOspfGenGroup->ospfExitOverflowInterval); printf("ospfDemandExtensions.0 [integer] %s(%i)\n", trueValue[pOspfGenGroup->ospfDemandExtensions], (int)pOspfGenGroup->ospfDemandExtensions); printf("\n"); return;}/*************************************************************************************** ospfMapiGenGroupShow - display the OSPF MIB General Group Parameters** This routine display the OSPF MIB General Group Parameters.** RETURNS: OK or ERROR** ERRNO: N/A*/STATUS ospfMapiGenGroupShow( void ){ /* make sure the facility is properly initialized */ OSPF_MAPI_SHOW_INIT_CHECK(); semTake( thisMapi->semMapiMutex, WAIT_FOREVER ); ospfMapiGenGroupPrint(); semGive( thisMapi->semMapiMutex ); return OK;}/***************************************************************************************** ospfMapiAreaPrint - debug print routine for ospfMapiAreaShow.** This routine is invoke by ospfMapiAreaShow from the AVL Tree walk routine.** RETURNS: N/A** NOMANUAL*/LOCAL void ospfMapiAreaPrint( void *pNode ){ uchar_t ipIndex[4]; mApiOspfArea_t *pArea; pArea = (mApiOspfArea_t *)pNode; if ( pArea == NULL ) return; ospf_mApi_ipAddr2OctetString( pArea->ospfAreaId, ipIndex ); printf("ospfAreaId.%i.%i.%i.%i [ipaddress] %i.%i.%i.%i\n", ipIndex[0], ipIndex[1], ipIndex[2], ipIndex[3], ipIndex[0], ipIndex[1], ipIndex[2], ipIndex[3]); printf("ospfImportAsExtern.%i.%i.%i.%i [integer] %s(%i)\n", ipIndex[0], ipIndex[1], ipIndex[2], ipIndex[3], asType[pArea->ospfImportAsExtern], (int)pArea->ospfImportAsExtern); printf("ospfSpfRuns.%i.%i.%i.%i [counter32] %ld\n", ipIndex[0], ipIndex[1], ipIndex[2], ipIndex[3], pArea->ospfSpfRuns); printf("ospfAreaBdrRtrCount.%i.%i.%i.%i [gauge32] %ld\n", ipIndex[0], ipIndex[1], ipIndex[2], ipIndex[3], pArea->ospfAreaBdrRtrCount); printf("ospfAsBdrRtrCount.%i.%i.%i.%i [gauge32] %ld\n", ipIndex[0], ipIndex[1], ipIndex[2], ipIndex[3], pArea->ospfAsBdrRtrCount); printf("ospfAreaLsaCount.%i.%i.%i.%i [gauge32] %ld\n", ipIndex[0], ipIndex[1], ipIndex[2], ipIndex[3], pArea->ospfAreaLsaCount); printf("ospfAreaLsaCksumSum.%i.%i.%i.%i [integer] %ld(0x%X)\n", ipIndex[0], ipIndex[1], ipIndex[2], ipIndex[3], pArea->ospfAreaLsaCksumSum, (unsigned)pArea->ospfAreaLsaCksumSum ); printf("ospfAreaSummary.%i.%i.%i.%i [integer] %s(%i)\n", ipIndex[0], ipIndex[1], ipIndex[2], ipIndex[3], summaryType[pArea->ospfAreaSummary], (int)pArea->ospfAreaSummary); printf("ospfAreaStatus.%i.%i.%i.%i [integer] %s(%i)\n", ipIndex[0], ipIndex[1], ipIndex[2], ipIndex[3], rowStatus[pArea->ospfAreaStatus], (int)pArea->ospfAreaStatus); printf("\n"); return;}/***************************************************************************************** ospfMapiAreaShow - show routine for ospfAreaTable** This routine displays all area instances found in the ospfAreaTable for debugging* and diagnostic purposes.** RETURNS: OK or ERROR** ERRNO: N/A
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -