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

📄 ospf_mib_helper_show.c

📁 vxworks下ospf协议栈
💻 C
📖 第 1 页 / 共 5 页
字号:
/* ospf_mib_helper_show.c - show routines for OSPF version 2.0 (RFC1850) Management Interface *//* Copyright 1998-2003 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02o,09may03,kc  Fixed SPR#88389 - modified ospfMapiExtLsaPrint() to also print                the ospfExtLsdbProtoId.02n,06may03,mwv Fixed SPR#88210 - added mib display strings (moved from                 ospf_mib_helper_show.h) to resolve linker errors when including                ospf_mib_helper_show.h from multiple files.02m,28feb03,kc  Fixed SPR#86502 - compile this file only if the component                INCLUDE_OSPF_MIB_SHOW_ROUTINES is defined.02l,19nov02,mwv Merge TMS code SPR 8428402k,21nov02,kc  Fixed SPR#75884 - modified ospfMapiAreaIfShow() to display the number                of neighbors attached to the given interface.02j,12nov02,kc  Added OSPF_MAPI_SHOW_INIT_CHECK macro and simplified all show routines                to use this macro to determine if the management facilities are                 properly initialized.02i,08oct02,agi Fixed compiler warnings02h,18aug02,kc  Modified ospfMapiLsdbShow() and ospfMapiExtLsdbShow() to also display                the sequence number in hex format.02g,25may02,kc  Fixed PR #2767 - Added the ospfMapiIfConfigShow() and                ospfMapiIfConfigPrint() routines.02f,15apr02,kc  Modified ospfMapiIfPrint() and ospfMapiVirtIfPrint() to display                the simplePasswd and md5 authentication key only if the                authentication length is not zero.02e,14apr02,kc  Renamed EmapiOspfAuthType_simplePasswd mApiOspfAuthType_t to                EmApiOspfAuthType_simplePasswd. Display md5 authentication key and                id in ospfMapiIfPrint().02d,13apr02,kc  Display all checksum values in hex format too.02c,01apr02,kc  Renamed ospfMapiOpaqueType10LsaShow() to ospfMapiType10LsaShow(),                ospfMapiOpaqueType9LsaShow() to ospfMapiType9LsaShow(), and                ospfMapiOpaqueType11LsaShow() to ospfMapiType11LsaShow().02b,29mar02,kc  Also diplayed transit area status, row status value and number of                interface, host interface and virtual interface attached to an                area in ospfMapiAreaIfPrint().02a,27mar02,kc  Added ospfMapiAreaIfPrint() and ospfMapiAreaIfShow() routines.                Added missing ospfHostAreaId display to ospfMapiHostPrint().01z,09mar02,kc  Display ospfBackboneExist status in ospfMapiPrint().01y,25feb02,kc  Fixed documentation for refgen.01x,22feb02,kc  Renamed all functions using WRS naming convention.01w,07feb02,kc  Display mApiNvmSetReqFailedCnt in ospf_mApi_print().01v,04feb02,kc  Added ospf_mApi_wrnLsdbShow(), ospf_mApi_wrnLocalLsdbShow() and                ospf_mApi_wrnExtLsdbShow() wrapper routines for consistency.o1u,04feb02,kc  Modified wrnOspf_mApi_genGroupPrint() to display object info for                wrnOspfRedistributeDefaultRoutes, wrnOspfRedistributeStaticRoutes,                wrnOspfRedistributeRIPRoutes and wrnOspfRedistributeBGPRoutes.01t,04feb02,kc  Renamed wrnOspf_mApi_genGroupShow() to ospf_mApi_wrnGenGroupShow().01s,15dec01,kc  Modified ospf_mApi_print() to prints number of free nodes on each                lstList. Also added missing ospfAreaAggregationTable info.01r,04dec01,kc  Localize all ospf_mApi_xxxPrint() routines.01q,01dec01,kc  Moved all dispaly strings to ospf_mib_mapi_show.h.01p,16nov01,kc  Modifed all lsdb show routines to print checksum in hex. Also removed                the print statement for lsdb.01o,10nov01,kc  Modified ospf_mApi_ifShow() and ospf_mApi_virtIfShow() to diplayed                the authentication key (was diplaying null string).01n,25oct01,kc  Uncomment ospf_mApi_areaAggregateShow() routine.01m,24oct01,kc  Fixed printf statements after changing lsdb age and checksum for                link-state database from ushort_t to ulong_t.01l,20oct01,kc  Show protocol information in ospf_mApi_print().01k,20oct01,kc  Zero out mibIndex array before using it.01j,16oct01,kc  Added NULL pointer check.01i,16oct01,kc  Removed __WRN_OSPF_MIB__ preproc.01h,13oct01,kc  Added ospf_mApi_errorShow() show routine.01g,08oct01,kc  Added show routines for wrn-ospf enterprise mib.01f,07oct01,kc  Added ospf_mApi_helper.h include.01e,28sep01,kc  Added missing ospf_mApi_extLsdbShow() routine.01d,22sep01,kc  Changed show routines output to use format similar to MIB Browser01c,12sep01,kc  Added ospf_mApi_showInit() routine so that this module can be                included/excluded using Tornado Project Facility.01b,11sep01,kc  Added show routines (moved from ospf_mib_api.c)01a,04sep01,kc  Initial file creation.*//*DESCRIPTIONThis module contains OSPF RFC1850 MIB and WRN OSPF Enterprise MIB display routines.To use this facility, it must first be installed using ospfMapiShowInit(), whichis called automatically when the MIB API show facility is configured into VxWorksusing either of the following methods:If you use the configuration header files, defineINCLUDE_OSPF_SHOW_ROUTINES in ospf_mib_api.h.If you use the Tornado project facility, select INCLUDE_OSPF_SHOW.*//* This include is here to get rid of the "empty file" compiler warning */#include <vxWorks.h>#if defined(__OSPF_MIB__)/* VxWorks standard includes */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <netinet/in.h>#include <semLib.h>#include <lstLib.h>#include <avlLib.h>#include <inetLib.h>/* management interface includes */#include "rowStatusLib.h"#include "mibApi.h"#include "ospf_mib_helper.h"#include "ospf_mib_helper_update.h"#include "ospf_mib_api.h"#include "ospf_mib_wrn_helper.h"#include "ospf_mib_helper_show.h"#if defined(INCLUDE_OSPF_MIB_SHOW_ROUTINES)/* row status display strings */char *rowStatus[] = {      "unknown", "active", "notInService", "notReady", "createAndGo", "createAndWait",      "destroy"};/* true value display strings */char *trueValue[] = { "unknown", "true", "false" };/* status display strings */char *status[] = { "unknown", "enabled", "disabled" };/* display strings for authentication type */char *authType[] = { "none", "simplePasswd", "md5" };char *ifState[] = {     "unknown", "down", "loopback", "waiting", "pointToPoint", "DR", "backupDR",     "otherDR"};/* display strings for OSPF interface type */char *ifType[] = {     "unknown", "broadcast", "nbma", "pointToPoint", "unknown", "pointToMultipoint"};/* display strings for OSPF LSDB type *//* SRR 83797 -- Begin */char *lsdbType[] = {     "unknown", "routerLink", "networkLink", "summaryLink", "asSummaryLink",     "asExternalLink", "multicastLink", "nssaExternalLink"};/* SPR 83797 -- End *//* display strings for OSPF Neighbor state */char *nbrState[] = {     "unknown", "down", "attempt", "init", "twoWay", "exchangeStart", "exchange",     "loading", "full"};/* display strings for OSPF AS Type state */char *asType[] = {     "unknown", "importExternal", "importNoExternal", "importNssa"}; /* display strings for OSPF Area Summary option */char *summaryType[] = { "unknown", "noAreaSummary", "sendAreaSummary" };/* display strings for OSPF Stub Metric Type */char *stubMetricType[] = { "unknown", "ospfMetric", "comparableCost", "nonComparable"};/* display strings for OSPF Interface multicast option */char *mcastType[] = { "unknown", "blocked", "multicast", "unicast" };/* display strings for OSPF Neighbor Discovery method */char *permanence[] = { "unknown", "dynamic", "permanent" };/* display strings for OSPF AS-External LSA */char *extType = "asExternalLink";/* display strings for OSPF Address Aggregate type */char *agType[] = { "unknown", "summaryLink", "nssaExternalLink" };    /* display strings for OSPF Area Aggregate Effect */char *agEffect[] = { "unknown", "advertiseMatching", "doNotAdvertiseMatching"};/* display string for Opque LSA type */char *opaqueLsa[] = {     "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown",    "unknown", "Type9-OpaqueLSA", "Type10-OpaqueLsa", "Type11-OpaqueLSA" };/* display string for M2 route proto type */char *extLsdbM2ProtoId[] = {    "none", "M2_ipRouteProto_other", "M2_ipRouteProto_local", "M2_ipRouteProto_netmgmt",    "M2_ipRouteProto_icmp", "M2_ipRouteProto_egp", "M2_ipRouteProto_ggp",    "M2_ipRouteProto_hello", "M2_ipRouteProto_rip", "M2_ipRouteProto_is_is",    "M2_ipRouteProto_es_is", "M2_ipRouteProto_ciscoIgrp",     "M2_ipRouteProto_bbnSpfIgp", "M2_ipRouteProto_ospf", "M2_ipRouteProto_bgp"};/* public data *//* private data *//* boolean falg to check if the ospf mib show facility is installed */LOCAL BOOL ospfMapiShowRtnInited = FALSE;/* macro to determine if both the mApi show facility and mApi management facility are * initialized. The ospf show facility will not work if the ospf management facility * is not initialized. */#define OSPF_MAPI_SHOW_INIT_CHECK()  \        { \            if ( (ospfMapiShowRtnInited == FALSE ) || (ospfMapiIsInited() == FALSE ) )\            { \                printf("%s\n", ospfMapiShowRtnInited == FALSE ? \                        "OSPF mApi Show Facility not initialized!\n" : \                        ospfMapiIsInited() == FALSE ? \                        "OSPF MIB API not inited\n" : ""); \                return ERROR; \            }  \        }/**************************************************************************************** ospfMapiShowInit - initialize ospf show facility** This routine links the ospf show facility into the vxWorks system. These routines* are included automatically when this show facility is configured into VxWorks using* either of the following methods:** .iP* If you use the configuration header files, define* INCLUDE_OSPF_SHOW_ROUTINES in ospf_mib_api.h.* .iP* If you use the Tornado project facility, select INCLUDE_OSPF_SHOW.** RETURNS: N/A*/void ospfMapiShowInit(void){    ospfMapiShowRtnInited = TRUE;    return;}/*************************************************************************************** ospfMapiPrint - display management API configurations and statistics** This routine display the OSPF Management API configurations and statistics. To* display the AVL tree for each table in the OSPF MIB, use the appropriate show* routine.** RETURNS: OK or ERROR** ERRNO: N/A** NOMANUAL*/LOCAL STATUS ospfMapiPrint( mApiOspfClass_t *thisMapi ){    char *ospfProtoType[] = { "Unknown", "RFC1583", "RFC2178", "RFC2328" };    /* lock semaphore for mutual exclusion access to mApiOspfClass_t */    semTake( thisMapi->semMapiMutex, WAIT_FOREVER );    printf("OSPF Protocol Information:\n");    printf("OSPF Protocol is %s\n", thisMapi->ospfProtoInit == TRUE ? "UP" : "DOWN");    printf("OSPF RFC number:%s\n", ospfProtoType[thisMapi->ospfRfcProto]);    printf("OSPF Database Overflow support: %s\n",            thisMapi->ospfDbOverflow == TRUE ? "TRUE" : "FALSE" );    printf("OSPF Opaque LSA support: %s\n",            thisMapi->ospfOpaqueEnable == TRUE ? "TRUE" : "FALSE" );    printf("OSPF NSSA support: %s\n",            thisMapi->ospfNssaEnabled == TRUE ? "TRUE" : "FALSE" );    printf("OSPF Backbone Area: %s\n",             thisMapi->ospfBackboneExist == TRUE ? "Configured" : "Not Configured" );    printf("Number of OSPF Area with active interfaces = %i\n", thisMapi->numActiveArea);    printf("\n\n");    printf("System-dependent MIB Database Configuration:\n");    printf("--------------------------------------------\n");    printf("ospfAreaTable:max instances=%i\n", thisMapi->mApiOspfMaxArea);    printf("ospfStubTable:max instances=%i\n", thisMapi->mApiOspfMaxStub);    printf("ospfLsdbTable:max instances=%i\n", thisMapi->mApiOspfMaxLsdb);    printf("ospfHostTable:max instances=%i\n", thisMapi->mApiOspfMaxHost);    printf("ospfIfTable:max instances=%i\n", thisMapi->mApiOspfMaxIf);    printf("ospfIfMetricTable:max instances=%i\n", thisMapi->mApiOspfMaxIfMetric);    printf("ospfVirtIfTable:max instances=%i\n", thisMapi->mApiOspfMaxVirtIf);    printf("ospfNbrTable:max instances=%i\n", thisMapi->mApiOspfMaxNbr);    printf("ospfVirtNbrTable:max instances=%i\n", thisMapi->mApiOspfMaxVirtNbr);    printf("ospfExtLsdbTable:max instances=%i\n", thisMapi->mApiOspfMaxExtLsdb);    printf("ospfAreaAggregationTable:max instances=%i\n", thisMapi->mApiOspfMaxAreaAg );#if defined(__OPAQUE_LSA__)    printf("wrnOspfAreaTable:max instance=%i\n", thisMapi->mApiWrnOspfMaxArea);    printf("wrnOspfLsdbTable:max instance=%i\n", thisMapi->mApiWrnOspfMaxLsdb);    printf("wrnOspfLocalLsdbTable:max instance=%i\n", thisMapi->mApiWrnOspfMaxLocalLsdb);    printf("wrnOspfExtLsdbTable:max instance=%i\n", thisMapi->mApiWrnOspfMaxExtLsdb);#endif /* __OPAQUE_LSA__ */    printf("\n\n");

⌨️ 快捷键说明

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