當前位置: 首頁>>代碼示例>>Java>>正文


Java LsaHeader.setAge方法代碼示例

本文整理匯總了Java中org.onosproject.ospf.protocol.lsa.LsaHeader.setAge方法的典型用法代碼示例。如果您正苦於以下問題:Java LsaHeader.setAge方法的具體用法?Java LsaHeader.setAge怎麽用?Java LsaHeader.setAge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.onosproject.ospf.protocol.lsa.LsaHeader的用法示例。


在下文中一共展示了LsaHeader.setAge方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processMaxAgeLsa

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Process max age LSA.
 *
 * @param wrapper LSA wrapper instance
 */
private void processMaxAgeLsa(LsaWrapper wrapper) {
    //set the destination
    OspfInterface ospfInterface = wrapper.ospfInterface();
    if (ospfInterface != null) {
        LsaHeader header = (LsaHeader) wrapper.ospfLsa().lsaHeader();
        header.setAge(OspfParameters.MAXAGE);
        ((LsaWrapperImpl) wrapper).lsaHeader().setAge(OspfParameters.MAXAGE);
        if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.DR ||
                ((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.POINT2POINT) {
            //remove from db
            ((OspfAreaImpl) ospfArea).addToOtherNeighborLsaTxList(((LsaWrapperImpl) wrapper).lsaHeader());
            ((OspfAreaImpl) ospfArea).deleteLsa(((LsaWrapperImpl) wrapper).lsaHeader());
        } else {
            ((OspfAreaImpl) ospfArea).deleteLsa(((LsaWrapperImpl) wrapper).lsaHeader());
        }
        log.debug("LSAQueueConsumer: processMaxAgeLsa - Flooded SelfOriginated-Max Age LSA {}",
                  ((LsaWrapperImpl) wrapper).lsaHeader());
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:25,代碼來源:LsaQueueConsumer.java

示例2: createLsaHeader

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Utility method used by junit methods.
 */
private LsaHeader createLsaHeader() {
    lsaHeader = new LsaHeader();
    lsaHeader.setAge(10);
    lsaHeader.setLinkStateId("10.226.165.164");
    lsaHeader.setLsCheckSum(222);
    lsaHeader.setLsPacketLen(48);
    lsaHeader.setLsSequenceNo(2020);
    lsaHeader.setLsType(5);
    lsaHeader.setOptions(2);
    lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("10.226.165.165"));
    return lsaHeader;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:16,代碼來源:LsAcknowledgeTest.java

示例3: createLsaHeader

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Utility method used by junit methods.
 */
private LsaHeader createLsaHeader() {
    lsaHeader = new LsaHeader();
    lsaHeader.setAge(10);
    lsaHeader.setLinkStateId("10.226.165.164");
    lsaHeader.setLsCheckSum(222);
    lsaHeader.setLsPacketLen(48);
    lsaHeader.setLsSequenceNo(2020);
    lsaHeader.setLsType(2);
    lsaHeader.setOptions(2);
    lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("10.226.165.165"));
    return lsaHeader;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:16,代碼來源:DdPacketTest.java

示例4: createLsaHeader

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Utility method used by junit methods.
 */
private LsaHeader createLsaHeader() {
    lsaHeader = new LsaHeader();
    lsaHeader.setLsType(1);
    lsaHeader.setLsPacketLen(48);
    lsaHeader.setLsCheckSum(10);
    lsaHeader.setAge(4);
    lsaHeader.setLinkStateId("10.226.165.164");
    lsaHeader.setLsSequenceNo(250);
    lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("100.226.165.165"));
    lsaHeader.setOptions(2);
    return lsaHeader;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:16,代碼來源:ExternalLsaTest.java

示例5: createLsaHeader

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Utility method used by junit methods.
 */
private LsaHeader createLsaHeader() {
    lsaHeader = new LsaHeader();
    lsaHeader.setLsType(3);
    lsaHeader.setLsPacketLen(48);
    lsaHeader.setLsCheckSum(10);
    lsaHeader.setAge(4);
    lsaHeader.setLinkStateId("10.226.165.164");
    lsaHeader.setLsSequenceNo(250);
    lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("100.226.165.165"));
    lsaHeader.setOptions(2);
    return lsaHeader;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:16,代碼來源:SummaryLsaTest.java

示例6: createLsaHeader

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Utility method used by junit methods.
 */
private LsaHeader createLsaHeader() {
    lsaHeader = new LsaHeader();
    lsaHeader.setLsType(2);
    lsaHeader.setLsPacketLen(48);
    lsaHeader.setLsCheckSum(10);
    lsaHeader.setAge(4);
    lsaHeader.setLinkStateId("10.226.165.164");
    lsaHeader.setLsSequenceNo(250);
    lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("100.226.165.165"));
    lsaHeader.setOptions(2);
    return lsaHeader;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:16,代碼來源:NetworkLsaTest.java

示例7: ospfLsa

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Gets the LSA.
 *
 * @return LSA instance
 */
public OspfLsa ospfLsa() {
    LsaHeader lsaHeader = (LsaHeader) ospfLsa;
    lsaHeader.setAge(currentAge());

    return lsaHeader;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:12,代碼來源:LsaWrapperImpl.java

示例8: processRefreshLsa

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Process refresh LSA.
 *
 * @param wrapper LSA wrapper instance
 */
private void processRefreshLsa(LsaWrapper wrapper) throws Exception {
    if (wrapper.isSelfOriginated()) { //self originated
        //set the destination
        OspfInterface ospfInterface = wrapper.ospfInterface();
        if (ospfInterface != null) {
            LsaHeader header = ((LsaWrapperImpl) wrapper).lsaHeader();
            header.setAge(wrapper.currentAge());
            if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.DR) {
                if (header.lsType() == OspfLsaType.ROUTER.value()) {
                    RouterLsa routerLsa = ((OspfAreaImpl) ospfArea).buildRouterLsa(ospfInterface);
                    ((OspfAreaImpl) ospfArea).addLsa(routerLsa, true, ospfInterface);
                    ((OspfAreaImpl) ospfArea).addToOtherNeighborLsaTxList(routerLsa);
                } else if (header.lsType() == OspfLsaType.NETWORK.value()) {
                    if (ospfInterface.listOfNeighbors().size() > 0) {
                        NetworkLsa networkLsa = ((OspfAreaImpl) ospfArea).buildNetworkLsa(
                                ospfInterface.ipAddress(), ospfInterface.ipNetworkMask());
                        ospfArea.addLsa(networkLsa, true, ospfInterface);
                        ((OspfAreaImpl) ospfArea).addToOtherNeighborLsaTxList(networkLsa);
                    }
                }
            }

            if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.BDR ||
                    ((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.POINT2POINT ||
                    ((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.DROTHER) {
                ospfArea.refreshArea(ospfInterface);
            }
            log.debug("LSAQueueConsumer: processRefreshLsa - Flooded SelfOriginated LSA {}",
                      ((LsaWrapperImpl) wrapper).lsaHeader());
        }
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:38,代碼來源:LsaQueueConsumer.java

示例9: addToList

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Adds the LSWrapper to summary list.
 *
 * @param wrapper  LSA wrapper instance
 * @param summList LSA summary list
 */
private void addToList(LsaWrapper wrapper, List summList) {
    LsaHeader header = (LsaHeader) wrapper.ospfLsa();
    //set the current age
    header.setAge(wrapper.currentAge());
    summList.add(header);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:13,代碼來源:OspfLsdbImpl.java

示例10: processRefreshLsa

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Process refresh LSA.
 *
 * @param wrapper LSA wrapper instance
 */
private void processRefreshLsa(LsaWrapper wrapper) throws OspfParseException {
    if (wrapper.isSelfOriginated()) { //self originated
        //set the destination
        OspfInterface ospfInterface = wrapper.ospfInterface();
        if (ospfInterface != null) {
            LsaHeader header = ((LsaWrapperImpl) wrapper).lsaHeader();
            header.setAge(wrapper.currentAge());
            if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.DR) {
                if (header.lsType() == OspfLsaType.ROUTER.value()) {
                    RouterLsa routerLsa = ((OspfAreaImpl) ospfArea).buildRouterLsa(ospfInterface);
                    ((OspfAreaImpl) ospfArea).addLsa(routerLsa, true, ospfInterface);
                    ((OspfAreaImpl) ospfArea).addToOtherNeighborLsaTxList(routerLsa);
                } else if (header.lsType() == OspfLsaType.NETWORK.value()) {
                    if (ospfInterface.listOfNeighbors().size() > 0) {
                        NetworkLsa networkLsa = ((OspfAreaImpl) ospfArea).buildNetworkLsa(
                                ospfInterface.ipAddress(), ospfInterface.ipNetworkMask());
                        ospfArea.addLsa(networkLsa, true, ospfInterface);
                        ((OspfAreaImpl) ospfArea).addToOtherNeighborLsaTxList(networkLsa);
                    }
                }
            }

            if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.BDR ||
                    ((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.POINT2POINT ||
                    ((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.DROTHER) {
                ospfArea.refreshArea(ospfInterface);
            }
            log.debug("LSAQueueConsumer: processRefreshLsa - Flooded SelfOriginated LSA {}",
                      ((LsaWrapperImpl) wrapper).lsaHeader());
        }
    }
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:38,代碼來源:LsaQueueConsumer.java

示例11: setUp

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {
    ospflsa1 = new LsaHeader();
    ospflsa1.setAge(20);
    lsaBin = new LsaBinImpl(1);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:7,代碼來源:LsaBinImplTest.java


注:本文中的org.onosproject.ospf.protocol.lsa.LsaHeader.setAge方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。