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


Java OspfInterface.setDr方法代码示例

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


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

示例1: initializeInterfaceMap

import org.onosproject.ospf.controller.OspfInterface; //导入方法依赖的package包/类
/**
 * Initializes the interface map with interface details.
 *
 * @throws Exception might throws exception
 */
public void initializeInterfaceMap() throws Exception {
    for (OspfProcess process : processes) {
        for (OspfArea area : process.areas()) {
            for (OspfInterface ospfInterface : area.ospfInterfaceList()) {
                OspfInterface anInterface = ospfInterfaceMap.get(ospfInterface.interfaceIndex());
                if (anInterface == null) {
                    ospfInterface.setOspfArea(area);
                    ((OspfInterfaceImpl) ospfInterface).setController(controller);
                    ((OspfInterfaceImpl) ospfInterface).setState(OspfInterfaceState.DOWN);
                    ospfInterface.setDr(Ip4Address.valueOf("0.0.0.0"));
                    ospfInterface.setBdr(Ip4Address.valueOf("0.0.0.0"));
                    ospfInterfaceMap.put(ospfInterface.interfaceIndex(), ospfInterface);
                }
                ((OspfInterfaceImpl) ospfInterface).setChannel(channel);
                ospfInterface.interfaceUp();
                ospfInterface.startDelayedAckTimer();
            }
            //Initialize the LSDB and aging process
            area.initializeDb();
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:28,代码来源:OspfInterfaceChannelHandler.java

示例2: initializeInterfaceMap

import org.onosproject.ospf.controller.OspfInterface; //导入方法依赖的package包/类
/**
 * Initializes the interface map with interface details.
 */
public void initializeInterfaceMap()  {
    for (OspfProcess process : processes) {
        for (OspfArea area : process.areas()) {
            for (OspfInterface ospfInterface : area.ospfInterfaceList()) {
                OspfInterface anInterface = ospfInterfaceMap.get(ospfInterface.interfaceIndex());
                if (anInterface == null) {
                    ospfInterface.setOspfArea(area);
                    ((OspfInterfaceImpl) ospfInterface).setController(controller);
                    ((OspfInterfaceImpl) ospfInterface).setState(OspfInterfaceState.DOWN);
                    ospfInterface.setDr(Ip4Address.valueOf("0.0.0.0"));
                    ospfInterface.setBdr(Ip4Address.valueOf("0.0.0.0"));
                    ospfInterfaceMap.put(ospfInterface.interfaceIndex(), ospfInterface);
                }
                ((OspfInterfaceImpl) ospfInterface).setChannel(channel);
                ospfInterface.interfaceUp();
                ospfInterface.startDelayedAckTimer();
            }
            //Initialize the LSDB and aging process
            area.initializeDb();
        }
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:26,代码来源:OspfInterfaceChannelHandler.java

示例3: interfaceDetails

import org.onosproject.ospf.controller.OspfInterface; //导入方法依赖的package包/类
/**
 * Returns OSPF interface instance from configuration.
 *
 * @param interfaceNode interface configuration
 * @return OSPF interface instance
 */
private static OspfInterface interfaceDetails(JsonNode interfaceNode) {
    OspfInterface ospfInterface = new OspfInterfaceImpl();
    String index = interfaceNode.path(INTERFACEINDEX).asText();
    if (isValidDigit(index)) {
        ospfInterface.setInterfaceIndex(Integer.parseInt(index));
    } else {
        log.debug("Wrong interface index: {}", index);
        return null;
    }
    Ip4Address interfaceIp = getInterfaceIp(ospfInterface.interfaceIndex());
    if (interfaceIp.equals(OspfUtil.DEFAULTIP)) {
        return null;
    }
    ospfInterface.setIpAddress(interfaceIp);
    ospfInterface.setIpNetworkMask(Ip4Address.valueOf(getInterfaceMask(
            ospfInterface.interfaceIndex())));
    ospfInterface.setBdr(OspfUtil.DEFAULTIP);
    ospfInterface.setDr(OspfUtil.DEFAULTIP);
    String helloInterval = interfaceNode.path(HELLOINTERVAL).asText();
    if (isValidDigit(helloInterval)) {
        ospfInterface.setHelloIntervalTime(Integer.parseInt(helloInterval));
    } else {
        log.debug("Wrong hello interval: {}", helloInterval);
        return null;
    }
    String routerDeadInterval = interfaceNode.path(ROUTERDEADINTERVAL).asText();
    if (isValidDigit(routerDeadInterval)) {
        ospfInterface.setRouterDeadIntervalTime(Integer.parseInt(routerDeadInterval));
    } else {
        log.debug("Wrong routerDeadInterval: {}", routerDeadInterval);
        return null;
    }
    String interfaceType = interfaceNode.path(INTERFACETYPE).asText();
    if (isValidDigit(interfaceType)) {
        ospfInterface.setInterfaceType(Integer.parseInt(interfaceType));
    } else {
        log.debug("Wrong interfaceType: {}", interfaceType);
        return null;
    }
    ospfInterface.setReTransmitInterval(OspfUtil.RETRANSMITINTERVAL);
    ospfInterface.setMtu(OspfUtil.MTU);
    ospfInterface.setRouterPriority(OspfUtil.ROUTER_PRIORITY);

    return ospfInterface;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:52,代码来源:OspfConfigUtil.java

示例4: updateInterfaceMap

import org.onosproject.ospf.controller.OspfInterface; //导入方法依赖的package包/类
/**
 * Updates the interface map with interface details.
 *
 * @param ospfProcesses updated process instances
 * @throws Exception might throws exception
 */
public void updateInterfaceMap(List<OspfProcess> ospfProcesses) throws Exception {
    for (OspfProcess ospfUpdatedProcess : ospfProcesses) {
        for (OspfArea updatedArea : ospfUpdatedProcess.areas()) {
            for (OspfInterface ospfUpdatedInterface : updatedArea.ospfInterfaceList()) {
                OspfInterface ospfInterface = ospfInterfaceMap.get(ospfUpdatedInterface.interfaceIndex());
                if (ospfInterface == null) {
                    ospfUpdatedInterface.setOspfArea(updatedArea);
                    ((OspfInterfaceImpl) ospfUpdatedInterface).setController(controller);
                    ((OspfInterfaceImpl) ospfUpdatedInterface).setState(OspfInterfaceState.DOWN);
                    ospfUpdatedInterface.setDr(Ip4Address.valueOf("0.0.0.0"));
                    ospfUpdatedInterface.setBdr(Ip4Address.valueOf("0.0.0.0"));
                    ospfInterfaceMap.put(ospfUpdatedInterface.interfaceIndex(), ospfUpdatedInterface);
                    ((OspfInterfaceImpl) ospfUpdatedInterface).setChannel(channel);
                    ospfUpdatedInterface.interfaceUp();
                    ospfUpdatedInterface.startDelayedAckTimer();
                } else {
                    ospfInterface.setOspfArea(updatedArea);

                    if (ospfInterface.routerDeadIntervalTime() != ospfUpdatedInterface.routerDeadIntervalTime()) {
                        ospfInterface.setRouterDeadIntervalTime(ospfUpdatedInterface.routerDeadIntervalTime());
                        Map<String, OspfNbr> neighbors = ospfInterface.listOfNeighbors();
                        for (String key : neighbors.keySet()) {
                            OspfNbr ospfNbr = ospfInterface.neighbouringRouter(key);
                            ospfNbr.setRouterDeadInterval(ospfInterface.routerDeadIntervalTime());
                            ospfNbr.stopInactivityTimeCheck();
                            ospfNbr.startInactivityTimeCheck();
                        }
                    }
                    if (ospfInterface.interfaceType() != ospfUpdatedInterface.interfaceType()) {
                        ospfInterface.setInterfaceType(ospfUpdatedInterface.interfaceType());
                        if (ospfInterface.interfaceType() == OspfInterfaceType.POINT_TO_POINT.value()) {
                            ospfInterface.setDr(Ip4Address.valueOf("0.0.0.0"));
                            ospfInterface.setBdr(Ip4Address.valueOf("0.0.0.0"));
                        }
                        ospfInterface.removeNeighbors();
                    }
                    if (ospfInterface.helloIntervalTime() != ospfUpdatedInterface.helloIntervalTime()) {
                        ospfInterface.setHelloIntervalTime(ospfUpdatedInterface.helloIntervalTime());
                        ospfInterface.stopHelloTimer();
                        ospfInterface.startHelloTimer();
                    }
                    ospfInterfaceMap.put(ospfInterface.interfaceIndex(), ospfInterface);
                }
            }
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:54,代码来源:OspfInterfaceChannelHandler.java

示例5: updateInterfaceMap

import org.onosproject.ospf.controller.OspfInterface; //导入方法依赖的package包/类
/**
 * Updates the interface map with interface details.
 *
 * @param ospfProcesses updated process instances
 */
public void updateInterfaceMap(List<OspfProcess> ospfProcesses) {
    for (OspfProcess ospfUpdatedProcess : ospfProcesses) {
        for (OspfArea updatedArea : ospfUpdatedProcess.areas()) {
            for (OspfInterface ospfUpdatedInterface : updatedArea.ospfInterfaceList()) {
                OspfInterface ospfInterface = ospfInterfaceMap.get(ospfUpdatedInterface.interfaceIndex());
                if (ospfInterface == null) {
                    ospfUpdatedInterface.setOspfArea(updatedArea);
                    ((OspfInterfaceImpl) ospfUpdatedInterface).setController(controller);
                    ((OspfInterfaceImpl) ospfUpdatedInterface).setState(OspfInterfaceState.DOWN);
                    ospfUpdatedInterface.setDr(Ip4Address.valueOf("0.0.0.0"));
                    ospfUpdatedInterface.setBdr(Ip4Address.valueOf("0.0.0.0"));
                    ospfInterfaceMap.put(ospfUpdatedInterface.interfaceIndex(), ospfUpdatedInterface);
                    ((OspfInterfaceImpl) ospfUpdatedInterface).setChannel(channel);
                    ospfUpdatedInterface.interfaceUp();
                    ospfUpdatedInterface.startDelayedAckTimer();
                } else {
                    ospfInterface.setOspfArea(updatedArea);

                    if (ospfInterface.routerDeadIntervalTime() != ospfUpdatedInterface.routerDeadIntervalTime()) {
                        ospfInterface.setRouterDeadIntervalTime(ospfUpdatedInterface.routerDeadIntervalTime());
                        Map<String, OspfNbr> neighbors = ospfInterface.listOfNeighbors();
                        for (String key : neighbors.keySet()) {
                            OspfNbr ospfNbr = ospfInterface.neighbouringRouter(key);
                            ospfNbr.setRouterDeadInterval(ospfInterface.routerDeadIntervalTime());
                            ospfNbr.stopInactivityTimeCheck();
                            ospfNbr.startInactivityTimeCheck();
                        }
                    }
                    if (ospfInterface.interfaceType() != ospfUpdatedInterface.interfaceType()) {
                        ospfInterface.setInterfaceType(ospfUpdatedInterface.interfaceType());
                        if (ospfInterface.interfaceType() == OspfInterfaceType.POINT_TO_POINT.value()) {
                            ospfInterface.setDr(Ip4Address.valueOf("0.0.0.0"));
                            ospfInterface.setBdr(Ip4Address.valueOf("0.0.0.0"));
                        }
                        ospfInterface.removeNeighbors();
                    }
                    if (ospfInterface.helloIntervalTime() != ospfUpdatedInterface.helloIntervalTime()) {
                        ospfInterface.setHelloIntervalTime(ospfUpdatedInterface.helloIntervalTime());
                        ospfInterface.stopHelloTimer();
                        ospfInterface.startHelloTimer();
                    }
                    ospfInterfaceMap.put(ospfInterface.interfaceIndex(), ospfInterface);
                }
            }
        }
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:53,代码来源:OspfInterfaceChannelHandler.java


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