📄 ospf_mib_utilities.c
字号:
ospfMibAltTag_none, read_only}, {"ospfVirtIfTransitDelay", (int)mApiOspfVirtIfTransitDelay, ospfMibTag_integer, ospfMibAltTag_none, read_create}, {"ospfVirtIfRetransInterval", (int)mApiOspfVirtIfRetransInterval, ospfMibTag_integer, ospfMibAltTag_none, read_create}, {"ospfVirtIfHelloInterval", (int)mApiOspfVirtIfHelloInterval, ospfMibTag_integer, ospfMibAltTag_none, read_create}, {"ospfVirtIfRtrDeadInterval", (int)mApiOspfVirtIfRtrDeadInterval, ospfMibTag_integer, ospfMibAltTag_none, read_create}, {"ospfVirtIfState", (int)mApiOspfVirtIfState, ospfMibTag_integer, ospfMibAltTag_ifState, read_only}, {"ospfVirtIfEvents", (int)mApiOspfVirtIfEvents, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfVirtIfAuthKey", (int)mApiOspfVirtIfAuthKey, ospfMibTag_integer, ospfMibAltTag_none, read_create}, {"ospfVirtIfStatus", (int)mApiOspfVirtIfStatus, ospfMibTag_integer, ospfMibAltTag_rowStatus, read_create}, {"ospfVirtIfAuthType", (int)mApiOspfVirtIfAuthType, ospfMibTag_integer, ospfMibAltTag_authType, read_create}, /* ospfNbrTable */ {"ospfNbrIpAddr", (int)mApiOspfNbrIpAddr, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"ospfNbrAddressLessIndex", (int)mApiOspfNbrAddressLessIndex, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfNbrRtrId", (int)mApiOspfNbrRtrId, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"ospfNbrOptions", (int)mApiOspfNbrOptions, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfNbrPriority", (int)mApiOspfNbrPriority, ospfMibTag_integer, ospfMibAltTag_none, read_create}, {"ospfNbrState", (int)mApiOspfNbrState, ospfMibTag_integer, ospfMibAltTag_nbrState, read_only}, {"ospfNbrEvents", (int)mApiOspfNbrEvents, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfNbrLsRetransQLen", (int)mApiOspfNbrLsRetransQLen, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfNbmaNbrStatus", (int)mApiOspfNbmaNbrStatus, ospfMibTag_integer, ospfMibAltTag_rowStatus, read_create}, {"ospfNbmaNbrPermanence", (int)mApiOspfNbmaNbrPermanence, ospfMibTag_integer, ospfMibAltTag_permanence, read_only}, {"ospfNbrHelloSuppressed", (int)mApiOspfNbrHelloSuppressed, ospfMibTag_integer, ospfMibAltTag_trueValue, read_only}, /* ospfVirtIfTable */ {"ospfVirtNbrArea", (int)mApiOspfVirtNbrArea, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"ospfVirtNbrRtrId", (int)mApiOspfVirtNbrRtrId, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"ospfVirtNbrIpAddr", (int)mApiOspfVirtNbrIpAddr, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"ospfVirtNbrOptions", (int)mApiOspfVirtNbrOptions, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfVirtNbrState", (int)mApiOspfVirtNbrState, ospfMibTag_integer, ospfMibAltTag_nbrState, read_only}, {"ospfVirtNbrEvents", (int)mApiOspfVirtNbrEvents, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfVirtNbrLsRetransQLen", (int)mApiOspfVirtNbrLsRetransQLen, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfVirtNbrHelloSuppressed", (int)mApiOspfVirtNbrHelloSuppressed, ospfMibTag_integer, ospfMibAltTag_trueValue, read_only}, /* ospfExtLsdbTable */ {"ospfExtLsdbType", (int)mApiOspfExtLsdbType, ospfMibTag_integer, ospfMibAltTag_extLsdbType, read_only}, {"ospfExtLsdbLsid", (int)mApiOspfExtLsdbLsid, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"ospfExtLsdbRouterId", (int)mApiOspfExtLsdbRouterId, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"ospfExtLsdbSequence", (int)mApiOspfExtLsdbSequence, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfExtLsdbAge", (int)mApiOspfExtLsdbAge, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfExtLsdbChecksum", (int)mApiOspfExtLsdbChecksum, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"ospfExtLsdbAdvertisement", (int)mApiOspfExtLsdbAdvertisement, ospfMibTag_octetString, ospfMibAltTag_octetString, read_only}, /* ospfAreaAggregateTable */ {"ospfAreaAggregateAreaID", (int)mApiOspfAreaAggregateAreaID, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"ospfAreaAggregateLsdbType", (int)mApiOspfAreaAggregateLsdbType, ospfMibTag_integer, ospfMibAltTag_agType, read_only}, {"ospfAreaAggregateNet", (int)mApiOspfAreaAggregateNet, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"ospfAreaAggregateMask", (int)mApiOspfAreaAggregateMask, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"ospfAreaAggregateStatus", (int)mApiOspfAreaAggregateStatus, ospfMibTag_integer, ospfMibAltTag_rowStatus, read_create}, {"ospfAreaAggregateEffect", (int)mApiOspfAreaAggregateEffect, ospfMibTag_integer, ospfMibAltTag_agEffect, read_create}};/* WRN-OSPF Enterprise MIB lookup table */LOCAL ospfMibList_t wrnOspfMibTableList[] ={ /* wrnOspfGeneralGroup */ {"wrnOspfRFC1583Compatibility", (int)mApiWrnOspfRFC1583Compatibility, ospfMibTag_integer, ospfMibAltTag_trueValue, read_write}, {"wrnOspfOpaqueLsaSupport", (int)mApiWrnOspfOpaqueLsaSupport, ospfMibTag_integer, ospfMibAltTag_trueValue, read_write}, {"wrnOspfOriginateNewOpaqueLsas", (int)mApiWrnOspfOriginateNewOpaqueLsas, ospfMibTag_counter, ospfMibAltTag_none, read_only}, {"wrnOspfRxNewOpaqueLsas", (int)mApiWrnOspfRxNewOpaqueLsas, ospfMibTag_counter, ospfMibAltTag_none, read_only}, {"wrnOspfType9LsaCount", (int)mApiWrnOspfType9LsaCount, ospfMibTag_counter, ospfMibAltTag_none, read_only}, {"wrnOspfType9LsaCksumSum", (int)mApiWrnOspfType9LsaCksumSum, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"wrnOspfType11LsaCount", (int)mApiWrnOspfType11LsaCount, ospfMibTag_counter, ospfMibAltTag_none, read_only}, {"wrnOspfType11LsaCksumSum", (int)mApiWrnOspfType11LsaCksumSum, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"wrnOspfRedistributeDefaultRoutes", (int)mApiWrnOspfRedistributeDefaultRoutes, ospfMibTag_integer, ospfMibAltTag_trueValue, read_write}, {"wrnOspfRedistributeStaticRoutes", (int)mApiWrnOspfRedistributeStaticRoutes, ospfMibTag_integer, ospfMibAltTag_trueValue, read_write}, {"wrnOspfRedistributeRIPRoutes", (int)mApiWrnOspfRedistributeRIPRoutes, ospfMibTag_integer, ospfMibAltTag_trueValue, read_write}, {"wrnOspfRedistributeBGPRoutes", (int)mApiWrnOspfRedistributeBGPRoutes, ospfMibTag_integer, ospfMibAltTag_trueValue, read_write}, /* wrnOspfAreaTable */ {"wrnOspfAreaId", (int)mApiWrnOspfAreaId, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfAreaType10LsaCount", (int)mApiWrnOspfAreaType10LsaCount, ospfMibTag_counter, ospfMibAltTag_none, read_only}, {"wrnOspfAreaType10LsaCksumSum", (int)mApiWrnOspfAreaType10LsaCksumSum, ospfMibTag_integer, ospfMibAltTag_none, read_only}, /* wrnOspfLsdbTable */ {"wrnOspfLsdbAreaId", (int)mApiWrnOspfLsdbAreaId, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfLsdbType", (int)mApiWrnOspfLsdbType, ospfMibTag_integer, ospfMibAltTag_opaqueType, read_only}, {"wrnOspfLsdbLsid", (int)mApiWrnOspfLsdbLsid, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfLsdbRouterId", (int)mApiWrnOspfLsdbRouterId, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfLsdbSequence", (int)mApiWrnOspfLsdbSequence, ospfMibTag_integer, ospfMibAltTag_none, read_only }, {"wrnOspfLsdbAge", (int)mApiWrnOspfLsdbAge, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"wrnOspfLsdbChecksum", (int)mApiWrnOspfLsdbChecksum, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"wrnOspfLsdbAdvertisement", (int)mApiWrnOspfLsdbAdvertisement, ospfMibTag_integer, ospfMibAltTag_octetString, read_only}, /* wrnOspfLocalLsdbTable */ {"wrnOspfLocalLsdbAreaId", (int)mApiWrnOspfLocalLsdbAreaId, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfLocalLsdbIpAddress", (int)mApiWrnOspfLocalLsdbIpAddress, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfLocalLsdbType", (int)mApiWrnOspfLocalLsdbType, ospfMibTag_integer, ospfMibAltTag_opaqueType, read_only}, {"wrnOspfLocalLsdbLsid", (int)mApiWrnOspfLocalLsdbLsid, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfLocalLsdbRouterId", (int)mApiWrnOspfLocalLsdbRouterId, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfLocalLsdbSequence", (int)mApiWrnOspfLocalLsdbSequence, ospfMibTag_integer, ospfMibAltTag_none, read_only }, {"wrnOspfLocalLsdbAge", (int)mApiWrnOspfLocalLsdbAge, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"wrnOspfLocalLsdbChecksum", (int)mApiWrnOspfLocalLsdbChecksum, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"wrnOspfLocalLsdbAdvertisement", (int)mApiWrnOspfLocalLsdbAdvertisement, ospfMibTag_integer, ospfMibAltTag_octetString, read_only}, /* wrnOspfExtLsdbTable */ {"wrnOspfExtLsdbType", (int)mApiWrnOspfExtLsdbType, ospfMibTag_integer, ospfMibAltTag_extLsdbType, read_only}, {"wrnOspfExtLsdbLsid", (int)mApiWrnOspfExtLsdbLsid, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfExtLsdbRouterId", (int)mApiWrnOspfExtLsdbRouterId, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfExtLsdbSequence", (int)mApiWrnOspfExtLsdbSequence, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"wrnOspfExtLsdbAge", (int)mApiWrnOspfExtLsdbAge, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"wrnOspfExtLsdbChecksum", (int)mApiWrnOspfExtLsdbChecksum, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"wrnOspfExtLsdbAdvertisement", (int)mApiWrnOspfExtLsdbAdvertisement, ospfMibTag_octetString, ospfMibAltTag_octetString, read_only}, {"wrnOspfIfDstIpAddress", (int)mApiWrnOspfIfDstIpAddress, ospfMibTag_ipaddress, ospfMibAltTag_none, read_only}, {"wrnOspfIfIndex", (int)mApiWrnOspfIfIndex, ospfMibTag_integer, ospfMibAltTag_none, read_only}, {"wrnOspfIfStatus", (int)mApiWrnOspfIfStatus, ospfMibTag_integer, ospfMibAltTag_rowStatus, read_create}};LOCAL BOOL ospfMapiUtilsInitDone = FALSE;LOCAL SEM_ID mApiUtilBSemId;/* macro to determine if the management facilities are properly initialized */#define MAPI_UTILS_INIT_CHECK() \ { \ if ( (ospfMapiUtilsInitDone == FALSE) || (ospfMapiIsInited() == FALSE) ) \ { \ printf("%s\n", ospfMapiUtilsInitDone == FALSE ? \ "OSPF mApi util facility not inited!\n" : \ ospfMapiIsInited() == FALSE ? \ "OSPF MIB API not inited\n" : ""); \ return ERROR; \ } \ }/********** OSPF MIB API Utilities Private Functions **********//***************************************************************************************** ospf_mApi_getAltTagStr - retrieve the display string for the alternate object tag** This routine retrieve the display string for the alternate object tag. The display* string to return is determined by the type of alternate tag and the valueBuf.** RETURNS: N/A** NOMANUAL*/LOCAL void ospf_mApi_getAltTagStr( ospfMibAltTag_t altTag, char *altStr, ulong_t valueBuf ){ switch( altTag ) { case ospfMibAltTag_none: case ospfMibAltTag_octetString: /* will be handled later */ break; case ospfMibAltTag_rowStatus: strcpy( altStr, rowStatus[valueBuf] ); break; case ospfMibAltTag_trueValue: strcpy( altStr, trueValue[valueBuf] ); break; case ospfMibAltTag_status: strcpy( altStr, status[valueBuf] ); break; case ospfMibAltTag_authType: strcpy( altStr, authType[valueBuf] ); break; case ospfMibAltTag_ifState: strcpy( altStr, ifState[valueBuf] ); break; case ospfMibAltTag_ifType: strcpy( altStr, ifType[valueBuf] ); break; case ospfMibAltTag_lsdbType: strcpy( altStr, lsdbType[valueBuf] ); break; case ospfMibAltTag_nbrState: strcpy( altStr, nbrState[valueBuf] ); break; case ospfMibAltTag_asType: strcpy( altStr, asType[valueBuf] ); break; case ospfMibAltTag_summaryType: strcpy( altStr, summaryType[valueBuf] ); break; case ospfMibAltTag_stubMetricType: strcpy( altStr, stubMetricType[valueBuf] ); break; case ospfMibAltTag_mcastType: strcpy( altStr, mcastType[valueBuf] ); break; case ospfMibAltTag_permanence: strcpy( altStr, permanence[valueBuf] ); break; case ospfMibAltTag_extLsdbType: strcpy( altStr, extType ); break; case ospfMibAltTag_agType: strcpy( altStr, agType[valueBuf] ); break; case ospfMibAltTag_agEffect: strcpy( altStr, agEffect[valueBuf] ); break; case ospfMibAltTag_opaqueType: strcpy( altStr, opaqueLsa[valueBuf] ); break; } return;}/***************************************************************************************** ospf_mApi_printException - print the exception value from the query result** This routine print the exception value for the Get, Get Next, Test and Commit * operations.** RETURNS: N/A** NOMANUAL*/LOCAL void ospf_mApi_printException( ospfMibList_t *pObjInfo, char *pOidStr, mApiException_t exception ){ char *pExcStr; pExcStr = NULL; printf("Response Binding:\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -