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

📄 ospf_mib_wrn_helper.c

📁 vxworks下ospf协议栈
💻 C
📖 第 1 页 / 共 5 页
字号:
            wrnOspf_mApi_flushAllLsas( resetAllToDefault );            /* remove all the area associated with Type-10 Opaque LSA from the              * wrnOspfAreaTable              */            wrnOspf2Mapi_area_flush();        }        /* opaque lsa capability has changed. Regardless if ospf is now opaque capable,         * reinitialize all the interfaces so that adjancencies can be re-established         * and all routes can be relearned correctly. Tell 'em don't have to lock the          * ospf's mutex since we are locking it now. Notice that it is not necessary to          * update the management database operational status for the interfaces. This is          * because ospf will turn around to send the update request to MIB API each time          * there is a change to the interface operational state.         */        mApi2Ospf_forceIfInit( EmApiOspf_false );    }    /* configure the ospf distribution options (if any).     * SPR#88309: tell 'em that there is no changed to the ospfASBdrRtrStatus       */    mApi2Ospf_configRedistributeOpts( pGenParams, FALSE );    /* unlock the ospf mutex */    semGive (ospf_global_mutex );    return OK;}/***************************************************************************************** wrnOspf_mApi_gobalParmGet - retrieve the value of an WRN OSPF General Parameter object** This routine retrieve the value of the General Parameter scalar object from the WRN* OSPF Enterprise MIB. The routine checks the given buffer length before copying the object* value to the given buffer. If it is too short, the actual data length will be returned.** RETURNS: OK or ERROR** ERRNO: N/A*/STATUS wrnOspf_mApi_globalParmGet( mApiWrnOspfGenGroup_t *thisGenGroup,                                   mApiRequest_t *pRequest,  mApiObject_t *pObject ){    switch( pObject->oidPrefixEnum )    {       case mApiWrnOspfRFC1583Compatibility:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf =                      (ulong_t)thisGenGroup->wrnOspfRFC1583Compatibility;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfOpaqueLsaSupport:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf =                       (ulong_t)thisGenGroup->wrnOspfOpaqueLsaSupport;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfOriginateNewOpaqueLsas:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf = thisGenGroup->wrnOspfOriginateNewOpaqueLsas;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfRxNewOpaqueLsas:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf = thisGenGroup->wrnOspfRxNewOpaqueLsas;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfType9LsaCount:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf = thisGenGroup->wrnOspfType9LsaCount;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfType9LsaCksumSum:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf = thisGenGroup->wrnOspfType9LsaCksumSum;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfType11LsaCount:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf = thisGenGroup->wrnOspfType11LsaCount;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfType11LsaCksumSum:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf = thisGenGroup->wrnOspfType11LsaCksumSum;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfRedistributeDefaultRoutes:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf = thisGenGroup->wrnOspfRedistributeDefaultRoutes;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfRedistributeStaticRoutes:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf = thisGenGroup->wrnOspfRedistributeStaticRoutes;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfRedistributeRIPRoutes:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf = thisGenGroup->wrnOspfRedistributeRIPRoutes;            pObject->valueLen = sizeof(ulong_t);            break;        case mApiWrnOspfRedistributeBGPRoutes:            /* sanity check the given buflen */            OSPF_MIB_BUFLEN_CHECK( pRequest, pObject, sizeof(ulong_t) );            *(ulong_t *)pObject->pValueBuf = thisGenGroup->wrnOspfRedistributeBGPRoutes;            pObject->valueLen = sizeof(ulong_t);            break;        default:            OSPF_MIB_ERROR_SET( pRequest, MAPI_GEN_ERROR, pObject->oidPrefixEnum );            pObject->valueLen = 0;            return ERROR;    }    return OK;}/***************************************************************************************** wrnOspf_mApi_globalParmSet - Set the value of an General Group object in WRN OSPF MIB** This routine sets the value of the WRN OSPF General Group scalar object. The* routine performs the value and consistency check before reconfiguring the OSPF* protocol with the specified value.** RETURNS: OK or ERROR** ERRNO: N/A*/STATUS wrnOspf_mApi_globalParmSet( mApiRequest_t *pRequest, mApiObject_t *pObject,                                   mApiReqType_t reqType ){    mApiWrnOspfGenGroup_t *pMapiWrnOspfGenGroup;    mApiOspfGenGroup_t    *pMapiOspfGenGroup;    ulong_t               valueBuf;    pMapiWrnOspfGenGroup = (mApiWrnOspfGenGroup_t *)thisMapi->pMapiWrnOspfGenGroup;    pMapiOspfGenGroup = (mApiOspfGenGroup_t *)thisMapi->pMapiOspfGenGroup;    valueBuf = *(ulong_t *)pObject->pValueBuf;    switch( pObject->oidPrefixEnum )    {        case mApiWrnOspfRFC1583Compatibility:            if ( reqType == MAPI_TEST )            {                switch( valueBuf )                {                   case EmApiOspf_true:                   case EmApiOspf_false:                       break;                   default:                       OSPF_MIB_ERROR_SET( pRequest, MAPI_WRONG_VALUE,                                           pObject->oidPrefixEnum );                       return ERROR;                }            }            else            {                /* allow the OSPF administrative status to be set regardless if there                 * is any active area that has one or more operational interface                 * attaches to the area                 */                if ( pMapiWrnOspfGenGroup->wrnOspfRFC1583Compatibility !=                                                         (mApiOspfTrueValue_t)valueBuf )                {                    pMapiWrnOspfGenGroup->wrnOspfRFC1583Compatibility =                                                        (mApiOspfTrueValue_t)valueBuf;                    /* make sure the protocol is enabled before we allow dynamic                      * configuration to take place. This way, we still allow the                      * configuration via the mib interface even if the ospf protocol                     * is not running                     */                    if ( pMapiOspfGenGroup->ospfAdminStat == EmApiOspf_enabled )                        thisMapi->dynamicConfig = TRUE;                }            }            break;        case mApiWrnOspfOpaqueLsaSupport:            if ( reqType == MAPI_TEST )            {                switch( valueBuf )                {                    case EmApiOspf_true:                    case EmApiOspf_false:                        break;                    default:                        OSPF_MIB_ERROR_SET( pRequest, MAPI_WRONG_VALUE,                                            pObject->oidPrefixEnum );                        return ERROR;                }            }            else            {                if ( pMapiWrnOspfGenGroup->wrnOspfOpaqueLsaSupport !=                                                          (mApiOspfTrueValue_t)valueBuf )                {                    pMapiWrnOspfGenGroup->wrnOspfOpaqueLsaSupport =                                                          (mApiOspfTrueValue_t)valueBuf;                    if ( pMapiOspfGenGroup->ospfAdminStat == EmApiOspf_enabled )                        thisMapi->dynamicConfig = TRUE;                 }            }            break;        case mApiWrnOspfRedistributeDefaultRoutes:            if ( reqType == MAPI_TEST )            {                switch( valueBuf )                {                    case EmApiOspf_true:                    case EmApiOspf_false:                        break;                    default:                        OSPF_MIB_ERROR_SET( pRequest, MAPI_WRONG_VALUE,                                            pObject->oidPrefixEnum );                        return ERROR;                }            }            else            {                if ( pMapiWrnOspfGenGroup->wrnOspfRedistributeDefaultRoutes !=                                                       (mApiOspfTrueValue_t)valueBuf )                {                    pMapiWrnOspfGenGroup->wrnOspfRedistributeDefaultRoutes =                                                          (mApiOspfTrueValue_t)valueBuf;                    /* to allow the redistribute option changes to take effert, the                     * ospf protocol must be enabled and the router must be configured                     * as an ASBR. OSPF will not redistribute any external routes if                     * the router is not an ASBR.                     */                    if ( (pMapiOspfGenGroup->ospfAdminStat == EmApiOspf_enabled) &&                         (pMapiOspfGenGroup->ospfASBdrRtrStatus == EmApiOspf_true) )                        thisMapi->dynamicConfig = TRUE;                }            }            break;        case mApiWrnOspfRedistributeStaticRoutes:            if ( reqType == MAPI_TEST )            {                switch( valueBuf )                {                    case EmApiOspf_true:                    case EmApiOspf_false:                        break;                    default:                        OSPF_MIB_ERROR_SET( pRequest, MAPI_WRONG_VALUE,                                            pObject->oidPrefixEnum );                        return ERROR;                }            }            else            {                if ( pMapiWrnOspfGenGroup->wrnOspfRedistributeStaticRoutes !=                                                          (mApiOspfTrueValue_t)valueBuf )                {                    pMapiWrnOspfGenGroup->wrnOspfRedistributeStaticRoutes =                                                         (mApiOspfTrueValue_t)valueBuf;                    /* to allow the redistribute option changes to take effert, the                     * ospf protocol must be enabled and the router must be configured                     * as an ASBR. OSPF will not redistribute any external routes if                     * the router is not an ASBR.                     */                    if ( (pMapiOspfGenGroup->ospfAdminStat == EmApiOspf_enabled ) &&                         (pMapiOspfGenGroup->ospfASBdrRtrStatus == EmApiOspf_true) )                        thisMapi->dynamicConfig = TRUE;                    

⌨️ 快捷键说明

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