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


Java OspfRouter.setInterfaceId方法代碼示例

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


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

示例1: neighborDown

import org.onosproject.ospf.controller.OspfRouter; //導入方法依賴的package包/類
/**
 * Called when neighbor is down.
 *
 * @throws Exception might throws exception
 */
public void neighborDown() throws Exception {
    log.debug("Neighbor Down {} and NeighborId {}", neighborIpAddr,
              neighborId);
    stopInactivityTimeCheck();
    stopRxMtDdTimer();
    stopRxMtLsrTimer();

    if (floodingTimerScheduled) {
        stopFloodingTimer();
        floodingTimerScheduled = false;
    }

    state = OspfNeighborState.DOWN;
    ospfArea.refreshArea(ospfInterface);
    lsReqList.clear();
    ddSummaryList.clear();
    if (neighborIpAddr.equals(neighborBdr) ||
            neighborIpAddr.equals(neighborDr)) {
        ((OspfInterfaceImpl) ospfInterface).neighborChange();
    }
    log.debug("Neighbor Went Down : "
                      + this.neighborIpAddr + " , " + this.neighborId);
    removeDeviceDetails(this.neighborId);
    OspfRouter ospfRouter = new OspfRouterImpl();
    ospfRouter.setRouterIp(this.neighborId());
    ospfRouter.setInterfaceId(ospfInterface.ipAddress());
    ospfRouter.setAreaIdOfInterface(ospfArea.areaId());
    ospfRouter.setDeviceTed(new OspfDeviceTedImpl());
    ((OspfInterfaceImpl) ospfInterface).removeDeviceInformation(ospfRouter);
    removeDeviceDetails(this.neighborIpAddr);
    OspfRouter ospfRouter1 = new OspfRouterImpl();
    ospfRouter1.setRouterIp(this.neighborIpAddr);
    ospfRouter1.setInterfaceId(ospfInterface.ipAddress());
    ospfRouter1.setAreaIdOfInterface(ospfArea.areaId());
    ospfRouter1.setDeviceTed(new OspfDeviceTedImpl());
    ((OspfInterfaceImpl) ospfInterface).removeDeviceInformation(ospfRouter1);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:43,代碼來源:OspfNbrImpl.java

示例2: ospfTopologyProviderTestAddDevice2

import org.onosproject.ospf.controller.OspfRouter; //導入方法依賴的package包/類
@Test
public void ospfTopologyProviderTestAddDevice2() {
    int deviceAddCount = 0;
    OspfRouter ospfRouter = new OspfRouterImpl();
    ospfRouter.setDr(true);
    ospfRouter.setOpaque(true);
    ospfRouter.setNeighborRouterId(Ip4Address.valueOf("3.3.3.3"));
    ospfRouter.setInterfaceId(Ip4Address.valueOf("10.10.10.3"));
    ospfRouter.setAreaIdOfInterface(Ip4Address.valueOf("6.6.6.6"));
    ospfRouter.setRouterIp(Ip4Address.valueOf("7.7.7.7"));
    OspfDeviceTed ospfDeviceTed = new OspfDeviceTedImpl();
    ospfDeviceTed.setAbr(true);
    ospfDeviceTed.setAsbr(true);
    ospfRouter.setDeviceTed(ospfDeviceTed);
    OspfLinkTed ospfLinkTed = new OspfLinkTedImpl();
    ospfLinkTed.setMaximumLink(Bandwidth.bps(30));
    ospfLinkTed.setMaxReserved(Bandwidth.bps(40));
    ospfLinkTed.setTeMetric(50);
    for (OspfRouterListener l : controller.nodeListener) {
        l.routerAdded(ospfRouter);
        deviceAddCount = nodeRegistry.connected.size();
        assertTrue(deviceAddCount == 1);
        l.routerRemoved(ospfRouter);
        deviceAddCount = nodeRegistry.connected.size();
        assertTrue(deviceAddCount == 0);
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:28,代碼來源:OspfTopologyProviderTest.java

示例3: neighborDown

import org.onosproject.ospf.controller.OspfRouter; //導入方法依賴的package包/類
/**
 * Called when neighbor is down.
 */
public void neighborDown() {
    log.debug("Neighbor Down {} and NeighborId {}", neighborIpAddr,
              neighborId);
    stopInactivityTimeCheck();
    stopRxMtDdTimer();
    stopRxMtLsrTimer();

    if (floodingTimerScheduled) {
        stopFloodingTimer();
        floodingTimerScheduled = false;
    }

    state = OspfNeighborState.DOWN;
    ospfArea.refreshArea(ospfInterface);
    lsReqList.clear();
    ddSummaryList.clear();
    if (neighborIpAddr.equals(neighborBdr) ||
            neighborIpAddr.equals(neighborDr)) {
        ((OspfInterfaceImpl) ospfInterface).neighborChange();
    }
    log.debug("Neighbor Went Down : "
                      + this.neighborIpAddr + " , " + this.neighborId);
    removeDeviceDetails(this.neighborId);
    OspfRouter ospfRouter = new OspfRouterImpl();
    ospfRouter.setRouterIp(this.neighborId());
    ospfRouter.setInterfaceId(ospfInterface.ipAddress());
    ospfRouter.setAreaIdOfInterface(ospfArea.areaId());
    ospfRouter.setDeviceTed(new OspfDeviceTedImpl());
    ((OspfInterfaceImpl) ospfInterface).removeDeviceInformation(ospfRouter);
    removeDeviceDetails(this.neighborIpAddr);
    OspfRouter ospfRouter1 = new OspfRouterImpl();
    ospfRouter1.setRouterIp(this.neighborIpAddr);
    ospfRouter1.setInterfaceId(ospfInterface.ipAddress());
    ospfRouter1.setAreaIdOfInterface(ospfArea.areaId());
    ospfRouter1.setDeviceTed(new OspfDeviceTedImpl());
    ((OspfInterfaceImpl) ospfInterface).removeDeviceInformation(ospfRouter1);
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:41,代碼來源:OspfNbrImpl.java


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