本文整理汇总了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();
}
}
}
示例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();
}
}
}
示例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;
}
示例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);
}
}
}
}
}
示例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);
}
}
}
}
}