当前位置: 首页>>代码示例>>Java>>正文


Java LsaWrapper.setBinNumber方法代码示例

本文整理汇总了Java中org.onosproject.ospf.controller.LsaWrapper.setBinNumber方法的典型用法代码示例。如果您正苦于以下问题:Java LsaWrapper.setBinNumber方法的具体用法?Java LsaWrapper.setBinNumber怎么用?Java LsaWrapper.setBinNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onosproject.ospf.controller.LsaWrapper的用法示例。


在下文中一共展示了LsaWrapper.setBinNumber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addOspfLsa

import org.onosproject.ospf.controller.LsaWrapper; //导入方法依赖的package包/类
/**
 * Adds the LSA to this bin with the given key.
 *
 * @param lsaKey     key of the LSA
 * @param lsaWrapper wrapper instance to store
 */
public void addOspfLsa(String lsaKey, LsaWrapper lsaWrapper) {
    if (!listOfLsa.containsKey(lsaKey)) {
        listOfLsa.put(lsaKey, lsaWrapper);
        lsaWrapper.setBinNumber(this.binNumber);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:13,代码来源:LsaBinImpl.java

示例2: addLsa

import org.onosproject.ospf.controller.LsaWrapper; //导入方法依赖的package包/类
/**
 * Installs a new self-originated LSA if possible.
 * Return true if installing was successful else false.
 * Adding LSA In cases
 * 1) New Self Originated LSA based on change in topology
 * 2) New Self Originated LSA because of LSRefresh
 * 2) New LSA received via Link State Update Packet
 *
 * @param newLsa LSA wrapper instance
 * @return true if added successfully
 */
private boolean addLsa(LsaWrapper newLsa) {
    // adding an LSA - verify if it's old or new
    // verify min failed
    // to verify if it's a new LSA or updating the old LSA .
    // fetch the LSA Type
    // verify if the LSA age is ! Max Age
    // a) it is  received during the flooding process (Section 13)
    // b) it is originated by the router itself (Section 12.4)
    // start aging .
    String key = getLsaKey(((LsaWrapperImpl) newLsa).lsaHeader());
    //Remove the lsa from bin if exist. we will be adding it in new bin based on the current age.
    removeLsaFromBin(lsaLookup(((LsaWrapperImpl) newLsa).lsaHeader()));

    switch (((LsaWrapperImpl) newLsa).lsaHeader().lsType()) {

        case OspfParameters.LINK_LOCAL_OPAQUE_LSA:
            opaque9Lsas.put(key, newLsa);
            break;
        case OspfParameters.AREA_LOCAL_OPAQUE_LSA:
            opaque10Lsas.put(key, newLsa);
            break;
        case OspfParameters.AS_OPAQUE_LSA:
            opaque11Lsas.put(key, newLsa);
            break;
        case OspfParameters.ROUTER:
            routerLsas.put(key, newLsa);
            break;
        case OspfParameters.NETWORK:
            networkLsas.put(key, newLsa);
            break;
        case OspfParameters.ASBR_SUMMARY:
            asbrSummaryLSAs.put(key, newLsa);
            break;
        case OspfParameters.SUMMARY:
            summaryLsas.put(key, newLsa);
            break;
        case OspfParameters.EXTERNAL_LSA:
            externalLsas.put(key, newLsa);
            break;
        default:
            log.debug("Unknown LSA type to add..!!!");
            break;
    }
    //add it to bin
    Integer binNumber = lsdbAge.age2Bin(((LsaWrapperImpl) newLsa).lsaHeader().age());
    LsaBin lsaBin = lsdbAge.getLsaBin(binNumber);
    if (lsaBin != null) {
        //remove from existing
        newLsa.setBinNumber(binNumber);
        lsaBin.addOspfLsa(key, newLsa);
        lsdbAge.addLsaBin(binNumber, lsaBin);
        log.debug("Added Type {} LSA to LSDB and LSABin[{}], Age of LSA {}", newLsa.lsaType(),
                  binNumber, ((LsaWrapperImpl) newLsa).lsaHeader().age());
    }

    return false;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:69,代码来源:OspfLsdbImpl.java


注:本文中的org.onosproject.ospf.controller.LsaWrapper.setBinNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。