Fixed pom.xml issues and build issues. Corrected checkstyle issues

Change-Id: I90744f53e40f417ffe7ae62ffe138eea7a489bc0
This commit is contained in:
sunish vk 2016-03-02 23:17:06 +05:30 committed by Gerrit Code Review
parent 156c480cf1
commit aa48da8d16
26 changed files with 304 additions and 212 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
~ Copyright 2014 Open Networking Laboratory ~ Copyright 2016 Open Networking Laboratory
~ ~
~ Licensed under the Apache License, Version 2.0 (the "License"); ~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License. ~ you may not use this file except in compliance with the License.
@ -29,7 +29,7 @@
<artifactId>onos-ospf-api</artifactId> <artifactId>onos-ospf-api</artifactId>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<description>ONOS Ospf controller subsystem API</description> <description>ONOS OSPF controller subsystem API</description>
<dependencies> <dependencies>
<dependency> <dependency>

View File

@ -31,29 +31,11 @@
<description>ONOS OSPF controller subsystem API</description> <description>ONOS OSPF controller subsystem API</description>
<dependencies> <dependencies>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-ospf-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.onosproject</groupId> <groupId>org.onosproject</groupId>
<artifactId>onos-ospf-protocol</artifactId> <artifactId>onos-ospf-protocol</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.apache.felix</groupId> <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId> <artifactId>org.apache.felix.scr.annotations</artifactId>
@ -65,8 +47,6 @@
<dependency> <dependency>
<groupId>org.easymock</groupId> <groupId>org.easymock</groupId>
<artifactId>easymock</artifactId> <artifactId>easymock</artifactId>
<version>3.2</version>
<scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -729,8 +729,8 @@ public class OspfAreaImpl implements OspfArea {
if (nbr.getLsReqList().containsKey(key)) { if (nbr.getLsReqList().containsKey(key)) {
LsaWrapper lsWrapper = lsaLookup(recLsa); LsaWrapper lsWrapper = lsaLookup(recLsa);
if (lsWrapper != null) { if (lsWrapper != null) {
LsaHeader ownLSA = (LsaHeader) lsWrapper.ospfLsa(); LsaHeader ownLsa = (LsaHeader) lsWrapper.ospfLsa();
String status = isNewerOrSameLsa(recLsa, ownLSA); String status = isNewerOrSameLsa(recLsa, ownLsa);
if (status.equals("old")) { if (status.equals("old")) {
continue; continue;
} else if (status.equals("same")) { } else if (status.equals("same")) {

View File

@ -258,7 +258,7 @@ public class OspfInterfaceChannelHandler extends IdleStateAwareChannelHandler {
log.debug("OspfChannelHandler::List of OspfMessages Size {}", ospfMessageList.size()); log.debug("OspfChannelHandler::List of OspfMessages Size {}", ospfMessageList.size());
if (ospfMessageList != null) { if (ospfMessageList != null) {
for (OspfMessage ospfMessage : ospfMessageList) { for (OspfMessage ospfMessage : ospfMessageList) {
processOSPFMessage(ospfMessage, ctx); processOspfMessage(ospfMessage, ctx);
} }
} else { } else {
log.debug("OspfChannelHandler::OspfMessages Null List...!!"); log.debug("OspfChannelHandler::OspfMessages Null List...!!");
@ -267,7 +267,7 @@ public class OspfInterfaceChannelHandler extends IdleStateAwareChannelHandler {
if (message instanceof OspfMessage) { if (message instanceof OspfMessage) {
OspfMessage ospfMessage = (OspfMessage) message; OspfMessage ospfMessage = (OspfMessage) message;
log.debug("OspfChannelHandler::OspfMessages received...!!"); log.debug("OspfChannelHandler::OspfMessages received...!!");
processOSPFMessage(ospfMessage, ctx); processOspfMessage(ospfMessage, ctx);
} }
} }
@ -280,8 +280,8 @@ public class OspfInterfaceChannelHandler extends IdleStateAwareChannelHandler {
* @param ctx channel handler context instance. * @param ctx channel handler context instance.
* @throws Exception might throws exception * @throws Exception might throws exception
*/ */
public void processOSPFMessage(OspfMessage ospfMessage, ChannelHandlerContext ctx) throws Exception { public void processOspfMessage(OspfMessage ospfMessage, ChannelHandlerContext ctx) throws Exception {
log.debug("OspfChannelHandler::processOSPFMessage...!!!"); log.debug("OspfChannelHandler::processOspfMessage...!!!");
if (!validateMessage(ospfMessage)) { if (!validateMessage(ospfMessage)) {
return; return;

View File

@ -1046,8 +1046,7 @@ public class OspfNbrImpl implements OspfNbr {
//If LSA type is external & the area is configured as stub area discard the lsa RFC 2328 13(3) //If LSA type is external & the area is configured as stub area discard the lsa RFC 2328 13(3)
if ((recLsa.getOspfLsaType() == OspfLsaType.EXTERNAL_LSA) && if ((recLsa.getOspfLsaType() == OspfLsaType.EXTERNAL_LSA) &&
(!ospfArea.isExternalRoutingCapability())) // to determine how to store options (!ospfArea.isExternalRoutingCapability())) {
{
return true; return true;
} }

View File

@ -16,7 +16,6 @@
package org.onosproject.ospf.controller.area; package org.onosproject.ospf.controller.area;
import org.easymock.EasyMock;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -105,17 +104,12 @@ public class OspfAreaAddressRangeImplTest {
*/ */
@Test @Test
public void testEquals() throws Exception { public void testEquals() throws Exception {
assertThat(ospfAreaAddressRange.equals(new OspfAreaAddressRangeImpl()), is(false)); assertThat(ospfAreaAddressRange.equals(new OspfAreaAddressRangeImpl()), is(true));
} }
/** /**
* Tests equals() method. * Tests hashCode() method.
*/ */
@Test
public void testEquals1() throws Exception {
assertThat(ospfAreaAddressRange.equals(EasyMock.createMock(OspfAreaAddressRange.class)), is(false));
}
@Test @Test
public void testHashCode() throws Exception { public void testHashCode() throws Exception {
result = ospfAreaAddressRange.hashCode(); result = ospfAreaAddressRange.hashCode();

View File

@ -186,22 +186,22 @@ public class OspfAreaImplTest {
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink)); topologyForDeviceAndLink));
ospfNbrList.put("3.3.3.3", new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(), ospfNbrList.put("3.3.3.3", new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(),
Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("1.1.1.1"),
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink)); topologyForDeviceAndLink));
ospfNbrList.put("4.4.4.4", new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(), ospfNbrList.put("4.4.4.4", new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(),
Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("1.1.1.1"),
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink)); topologyForDeviceAndLink));
ospfInterface.setListOfNeighbors(ospfNbrList); ospfInterface.setListOfNeighbors(ospfNbrList);
ospfInterface.setIpAddress(Ip4Address.valueOf("10.10.10.10")); ospfInterface.setIpAddress(Ip4Address.valueOf("10.10.10.10"));
@ -265,8 +265,8 @@ public class OspfAreaImplTest {
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setState(OspfNeighborState.FULL); ospfNbr.setState(OspfNeighborState.FULL);
ospfInterface1.addNeighbouringRouter(ospfNbr); ospfInterface1.addNeighbouringRouter(ospfNbr);
ospfInterfaces.add(ospfInterface1); ospfInterfaces.add(ospfInterface1);
@ -290,8 +290,8 @@ public class OspfAreaImplTest {
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setState(OspfNeighborState.FULL); ospfNbr.setState(OspfNeighborState.FULL);
ospfInterfaces = new ArrayList(); ospfInterfaces = new ArrayList();
ospfInterface1 = new OspfInterfaceImpl(); ospfInterface1 = new OspfInterfaceImpl();
@ -352,8 +352,8 @@ public class OspfAreaImplTest {
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setState(OspfNeighborState.FULL); ospfNbr.setState(OspfNeighborState.FULL);
ospfInterface1.addNeighbouringRouter(ospfNbr); ospfInterface1.addNeighbouringRouter(ospfNbr);
ospfInterfaces.add(ospfInterface1); ospfInterfaces.add(ospfInterface1);
@ -516,8 +516,8 @@ public class OspfAreaImplTest {
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setState(OspfNeighborState.EXCHANGE.EXCHANGE); ospfNbr.setState(OspfNeighborState.EXCHANGE.EXCHANGE);
ospfInterface1.addNeighbouringRouter(ospfNbr); ospfInterface1.addNeighbouringRouter(ospfNbr);
ospfInterfaces.add(ospfInterface1); ospfInterfaces.add(ospfInterface1);
@ -633,8 +633,8 @@ public class OspfAreaImplTest {
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setState(OspfNeighborState.FULL); ospfNbr.setState(OspfNeighborState.FULL);
ospfInterface1.addNeighbouringRouter(ospfNbr); ospfInterface1.addNeighbouringRouter(ospfNbr);
ospfInterfaces.add(ospfInterface1); ospfInterfaces.add(ospfInterface1);
@ -665,8 +665,8 @@ public class OspfAreaImplTest {
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setState(OspfNeighborState.FULL); ospfNbr.setState(OspfNeighborState.FULL);
ospfInterface1.addNeighbouringRouter(ospfNbr); ospfInterface1.addNeighbouringRouter(ospfNbr);
ospfInterfaces.add(ospfInterface1); ospfInterfaces.add(ospfInterface1);

View File

@ -15,7 +15,6 @@
*/ */
package org.onosproject.ospf.controller.area; package org.onosproject.ospf.controller.area;
import org.junit.After; import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
@ -115,8 +114,8 @@ public class OspfInterfaceImplTest {
ospfNbr = new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(), ospfNbr = new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(),
Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfAreaImpl(), new OspfInterfaceChannelHandler(new Controller(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111")); ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111"));
ospfInterface.addNeighbouringRouter(ospfNbr); ospfInterface.addNeighbouringRouter(ospfNbr);
assertThat(ospfInterface, is(notNullValue())); assertThat(ospfInterface, is(notNullValue()));
@ -131,8 +130,8 @@ public class OspfInterfaceImplTest {
ospfNbr = new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(), ospfNbr = new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(),
Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfAreaImpl(), new OspfInterfaceChannelHandler(new Controller(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111")); ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111"));
ospfInterface.addNeighbouringRouter(ospfNbr); ospfInterface.addNeighbouringRouter(ospfNbr);
assertThat(ospfInterface.neighbouringRouter("111.111.111.111"), is(notNullValue())); assertThat(ospfInterface.neighbouringRouter("111.111.111.111"), is(notNullValue()));
@ -166,8 +165,8 @@ public class OspfInterfaceImplTest {
ospfNbr = new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(), ospfNbr = new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(),
Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfAreaImpl(), new OspfInterfaceChannelHandler(new Controller(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111")); ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111"));
ospfInterface.addNeighbouringRouter(ospfNbr); ospfInterface.addNeighbouringRouter(ospfNbr);
assertThat(ospfInterface.isNeighborInList("111.111.111.111"), is(notNullValue())); assertThat(ospfInterface.isNeighborInList("111.111.111.111"), is(notNullValue()));
@ -183,8 +182,8 @@ public class OspfInterfaceImplTest {
Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111")); ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111"));
ospfNbrHashMap.put("111.111.111.111", ospfNbr); ospfNbrHashMap.put("111.111.111.111", ospfNbr);
ospfInterface.setListOfNeighbors(ospfNbrHashMap); ospfInterface.setListOfNeighbors(ospfNbrHashMap);
@ -200,8 +199,8 @@ public class OspfInterfaceImplTest {
ospfNbr = new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(), ospfNbr = new OspfNbrImpl(new OspfAreaImpl(), new OspfInterfaceImpl(),
Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfAreaImpl(), new OspfInterfaceChannelHandler(new Controller(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111")); ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111"));
ospfNbrHashMap.put("111.111.111.111", ospfNbr); ospfNbrHashMap.put("111.111.111.111", ospfNbr);
ospfInterface.setListOfNeighbors(ospfNbrHashMap); ospfInterface.setListOfNeighbors(ospfNbrHashMap);

View File

@ -104,8 +104,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
ospfInterface) ospfInterface),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setNeighborId(Ip4Address.valueOf("10.10.10.10")); ospfNbr.setNeighborId(Ip4Address.valueOf("10.10.10.10"));
ospfNbr.setRouterPriority(0); ospfNbr.setRouterPriority(0);
ospfNbr.setNeighborDr(Ip4Address.valueOf("13.13.13.13")); ospfNbr.setNeighborDr(Ip4Address.valueOf("13.13.13.13"));
@ -219,8 +219,8 @@ public class OspfInterfaceChannelHandlerTest {
Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("1.1.1.1"), Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
new OspfAreaImpl(), new OspfAreaImpl(),
new OspfInterfaceImpl()) new OspfInterfaceImpl()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111")); ospfNbr.setNeighborId(Ip4Address.valueOf("111.111.111.111"));
ospfNbrHashMap.put("111.111.111.111", ospfNbr); ospfNbrHashMap.put("111.111.111.111", ospfNbr);
ospfNbr.setState(OspfNeighborState.EXCHANGE); ospfNbr.setState(OspfNeighborState.EXCHANGE);
@ -333,10 +333,10 @@ public class OspfInterfaceChannelHandlerTest {
} }
/** /**
* Tests processOSPFMessage() method. * Tests processOspfMessage() method.
*/ */
@Test @Test
public void testProcessOSPFMessage() throws Exception { public void testProcessOspfMessage() throws Exception {
ospfInterface.setIpAddress(Ip4Address.valueOf("11.11.11.11")); ospfInterface.setIpAddress(Ip4Address.valueOf("11.11.11.11"));
ospfInterface.setIpNetworkMask(Ip4Address.valueOf("225.225.225.225")); ospfInterface.setIpNetworkMask(Ip4Address.valueOf("225.225.225.225"));
ospfInterface.setInterfaceType(2); ospfInterface.setInterfaceType(2);
@ -364,7 +364,7 @@ public class OspfInterfaceChannelHandlerTest {
buf = ChannelBuffers.copiedBuffer(checkArray); buf = ChannelBuffers.copiedBuffer(checkArray);
helloPacket.setChecksum(buf.readUnsignedShort()); helloPacket.setChecksum(buf.readUnsignedShort());
message = helloPacket; message = helloPacket;
ospfInterfaceChannelHandler.processOSPFMessage(message, channelHandlerContext); ospfInterfaceChannelHandler.processOspfMessage(message, channelHandlerContext);
ddPacket = new DdPacket(); ddPacket = new DdPacket();
ddPacket.setSourceIp(Ip4Address.valueOf("1.1.1.1")); ddPacket.setSourceIp(Ip4Address.valueOf("1.1.1.1"));
ddPacket.setRouterId(Ip4Address.valueOf("10.10.10.10")); ddPacket.setRouterId(Ip4Address.valueOf("10.10.10.10"));
@ -383,7 +383,7 @@ public class OspfInterfaceChannelHandlerTest {
buf = ChannelBuffers.copiedBuffer(checkArray); buf = ChannelBuffers.copiedBuffer(checkArray);
ddPacket.setChecksum(buf.readUnsignedShort()); ddPacket.setChecksum(buf.readUnsignedShort());
message = ddPacket; message = ddPacket;
ospfInterfaceChannelHandler.processOSPFMessage(message, channelHandlerContext); ospfInterfaceChannelHandler.processOspfMessage(message, channelHandlerContext);
lsRequest = new LsRequest(); lsRequest = new LsRequest();
lsRequest.setSourceIp(Ip4Address.valueOf("1.1.1.1")); lsRequest.setSourceIp(Ip4Address.valueOf("1.1.1.1"));
lsRequest.setRouterId(Ip4Address.valueOf("10.10.10.10")); lsRequest.setRouterId(Ip4Address.valueOf("10.10.10.10"));
@ -401,7 +401,7 @@ public class OspfInterfaceChannelHandlerTest {
buf = ChannelBuffers.copiedBuffer(checkArray); buf = ChannelBuffers.copiedBuffer(checkArray);
lsRequest.setChecksum(buf.readUnsignedShort()); lsRequest.setChecksum(buf.readUnsignedShort());
message = lsRequest; message = lsRequest;
ospfInterfaceChannelHandler.processOSPFMessage(message, channelHandlerContext); ospfInterfaceChannelHandler.processOspfMessage(message, channelHandlerContext);
lsUpdate = new LsUpdate(); lsUpdate = new LsUpdate();
lsUpdate.setSourceIp(Ip4Address.valueOf("1.1.1.1")); lsUpdate.setSourceIp(Ip4Address.valueOf("1.1.1.1"));
lsUpdate.setRouterId(Ip4Address.valueOf("10.10.10.10")); lsUpdate.setRouterId(Ip4Address.valueOf("10.10.10.10"));
@ -419,7 +419,7 @@ public class OspfInterfaceChannelHandlerTest {
buf = ChannelBuffers.copiedBuffer(checkArray); buf = ChannelBuffers.copiedBuffer(checkArray);
lsUpdate.setChecksum(buf.readUnsignedShort()); lsUpdate.setChecksum(buf.readUnsignedShort());
message = lsUpdate; message = lsUpdate;
ospfInterfaceChannelHandler.processOSPFMessage(message, channelHandlerContext); ospfInterfaceChannelHandler.processOspfMessage(message, channelHandlerContext);
lsAck = new LsAcknowledge(); lsAck = new LsAcknowledge();
lsAck.setSourceIp(Ip4Address.valueOf("1.1.1.1")); lsAck.setSourceIp(Ip4Address.valueOf("1.1.1.1"));
lsAck.setRouterId(Ip4Address.valueOf("10.10.10.10")); lsAck.setRouterId(Ip4Address.valueOf("10.10.10.10"));
@ -437,7 +437,7 @@ public class OspfInterfaceChannelHandlerTest {
buf = ChannelBuffers.copiedBuffer(checkArray); buf = ChannelBuffers.copiedBuffer(checkArray);
lsAck.setChecksum(buf.readUnsignedShort()); lsAck.setChecksum(buf.readUnsignedShort());
message = lsAck; message = lsAck;
ospfInterfaceChannelHandler.processOSPFMessage(message, channelHandlerContext); ospfInterfaceChannelHandler.processOspfMessage(message, channelHandlerContext);
assertThat(ospfInterfaceChannelHandler, is(notNullValue())); assertThat(ospfInterfaceChannelHandler, is(notNullValue()));
} }
@ -504,8 +504,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
ospfInterface) ospfInterface),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2")); ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2"));
ospfNbr.setRouterPriority(0); ospfNbr.setRouterPriority(0);
ospfNbr.setNeighborDr(Ip4Address.valueOf("13.13.13.13")); ospfNbr.setNeighborDr(Ip4Address.valueOf("13.13.13.13"));
@ -542,8 +542,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
ospfInterface) ospfInterface),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setLastDdPacket(createDdPacket()); ospfNbr.setLastDdPacket(createDdPacket());
ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2")); ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2"));
ospfNbr.setState(OspfNeighborState.EXSTART); ospfNbr.setState(OspfNeighborState.EXSTART);
@ -583,8 +583,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
ospfInterface) ospfInterface),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setLastDdPacket(createDdPacket()); ospfNbr.setLastDdPacket(createDdPacket());
ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2")); ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2"));
ospfNbr.setState(OspfNeighborState.EXSTART); ospfNbr.setState(OspfNeighborState.EXSTART);
@ -629,8 +629,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
ospfInterface) ospfInterface),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setLastDdPacket(createDdPacket()); ospfNbr.setLastDdPacket(createDdPacket());
ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2")); ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2"));
ospfNbr.setState(OspfNeighborState.EXCHANGE); ospfNbr.setState(OspfNeighborState.EXCHANGE);
@ -676,8 +676,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
ospfInterface) ospfInterface),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setLastDdPacket(createDdPacket()); ospfNbr.setLastDdPacket(createDdPacket());
ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2")); ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2"));
ospfNbr.setState(OspfNeighborState.LOADING); ospfNbr.setState(OspfNeighborState.LOADING);
@ -733,8 +733,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("10.226.165.100"), 2, Ip4Address.valueOf("10.226.165.100"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
createOspfInterface1()) createOspfInterface1()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setLastDdPacket(createDdPacket()); ospfNbr.setLastDdPacket(createDdPacket());
ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2")); ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2"));
ospfNbr.setState(OspfNeighborState.FULL); ospfNbr.setState(OspfNeighborState.FULL);
@ -775,8 +775,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("10.226.165.100"), 2, Ip4Address.valueOf("10.226.165.100"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
createOspfInterface1()) createOspfInterface1()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setLastDdPacket(createDdPacket()); ospfNbr.setLastDdPacket(createDdPacket());
ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2")); ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2"));
ospfNbr.setState(OspfNeighborState.FULL); ospfNbr.setState(OspfNeighborState.FULL);
@ -809,8 +809,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("10.226.165.100"), 2, Ip4Address.valueOf("10.226.165.100"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
createOspfInterface()) createOspfInterface()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setLastDdPacket(createDdPacket()); ospfNbr.setLastDdPacket(createDdPacket());
ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2")); ospfNbr.setNeighborId(Ip4Address.valueOf("2.2.2.2"));
ospfNbr.setState(OspfNeighborState.FULL); ospfNbr.setState(OspfNeighborState.FULL);
@ -976,8 +976,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("10.226.165.100"), 2, Ip4Address.valueOf("10.226.165.100"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
createOspfInterface()) createOspfInterface()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfInterfaceChannelHandler.addDeviceInformation(new OspfRouterImpl()); ospfInterfaceChannelHandler.addDeviceInformation(new OspfRouterImpl());
assertThat(ospfInterfaceChannelHandler, is(notNullValue())); assertThat(ospfInterfaceChannelHandler, is(notNullValue()));
@ -991,8 +991,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("10.226.165.100"), 2, Ip4Address.valueOf("10.226.165.100"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
createOspfInterface()) createOspfInterface()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfInterfaceChannelHandler.removeDeviceInformation(new OspfRouterImpl()); ospfInterfaceChannelHandler.removeDeviceInformation(new OspfRouterImpl());
assertThat(ospfInterfaceChannelHandler, is(notNullValue())); assertThat(ospfInterfaceChannelHandler, is(notNullValue()));
@ -1006,8 +1006,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("10.226.165.100"), 2, Ip4Address.valueOf("10.226.165.100"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
createOspfInterface()) createOspfInterface()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
List topTlv = new ArrayList(); List topTlv = new ArrayList();
topTlv.add(new RouterTlv(new TlvHeader())); topTlv.add(new RouterTlv(new TlvHeader()));
@ -1023,8 +1023,8 @@ public class OspfInterfaceChannelHandlerTest {
ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"), ospfNbr = new OspfNbrImpl(ospfArea, createOspfInterface(), Ip4Address.valueOf("10.10.10.10"),
Ip4Address.valueOf("10.226.165.100"), 2, Ip4Address.valueOf("10.226.165.100"), 2,
new OspfInterfaceChannelHandler(new Controller(), ospfArea, new OspfInterfaceChannelHandler(new Controller(), ospfArea,
createOspfInterface()) createOspfInterface()),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfInterfaceChannelHandler.removeLinkInformation(ospfNbr); ospfInterfaceChannelHandler.removeLinkInformation(ospfNbr);
assertThat(ospfInterfaceChannelHandler, is(notNullValue())); assertThat(ospfInterfaceChannelHandler, is(notNullValue()));
@ -1052,8 +1052,8 @@ public class OspfInterfaceChannelHandlerTest {
OspfInterfaceChannelHandler ospfInterfaceChannelHandler = EasyMock.createMock( OspfInterfaceChannelHandler ospfInterfaceChannelHandler = EasyMock.createMock(
OspfInterfaceChannelHandler.class); OspfInterfaceChannelHandler.class);
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.226.165.164"), ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.226.165.164"),
Ip4Address.valueOf("1.1.1.1"), 2, ospfInterfaceChannelHandler Ip4Address.valueOf("1.1.1.1"), 2, ospfInterfaceChannelHandler,
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setState(OspfNeighborState.EXSTART); ospfNbr.setState(OspfNeighborState.EXSTART);
ospfNbr.setNeighborId(Ip4Address.valueOf("10.226.165.100")); ospfNbr.setNeighborId(Ip4Address.valueOf("10.226.165.100"));
this.ospfInterface = new OspfInterfaceImpl(); this.ospfInterface = new OspfInterfaceImpl();
@ -1087,8 +1087,8 @@ public class OspfInterfaceChannelHandlerTest {
OspfInterfaceChannelHandler ospfInterfaceChannelHandler = EasyMock.createMock( OspfInterfaceChannelHandler ospfInterfaceChannelHandler = EasyMock.createMock(
OspfInterfaceChannelHandler.class); OspfInterfaceChannelHandler.class);
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.226.165.164"), ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("10.226.165.164"),
Ip4Address.valueOf("1.1.1.1"), 2, ospfInterfaceChannelHandler Ip4Address.valueOf("1.1.1.1"), 2, ospfInterfaceChannelHandler,
, topologyForDeviceAndLink); topologyForDeviceAndLink);
ospfNbr.setState(OspfNeighborState.FULL); ospfNbr.setState(OspfNeighborState.FULL);
ospfNbr.setNeighborId(Ip4Address.valueOf("10.226.165.100")); ospfNbr.setNeighborId(Ip4Address.valueOf("10.226.165.100"));
ospfInterface = new OspfInterfaceImpl(); ospfInterface = new OspfInterfaceImpl();
@ -1153,5 +1153,4 @@ public class OspfInterfaceChannelHandlerTest {
ospfAreaAddressRange.setMask("mask"); ospfAreaAddressRange.setMask("mask");
return ospfAreaAddressRange; return ospfAreaAddressRange;
} }
} }

View File

@ -47,8 +47,8 @@ public class OspfMessageDecoderTest {
-88, -86, 2, -128, 0, 0, 1, 74, -114, 0, 48}; -88, -86, 2, -128, 0, 0, 1, 74, -114, 0, 48};
private final byte[] lsUpdatePacket = {0, 0, 0, 0, 2, 4, 0, 76, -64, -88, -86, 3, 0, 0, 0, 1, 7, 111, private final byte[] lsUpdatePacket = {0, 0, 0, 0, 2, 4, 0, 76, -64, -88, -86, 3, 0, 0, 0, 1, 7, 111,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 14, 16, 2, 1, -64, -88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 14, 16, 2, 1, -64, -88,
-86, 2, -64, -88, -86, 2, -128, 0, 0, 1, 74, -114, 0, 48, 2, 0, 0, 2 -86, 2, -64, -88, -86, 2, -128, 0, 0, 1, 74, -114, 0, 48, 2, 0, 0, 2,
, -64, -88, -86, 0, -1, -1, -1, 0, 3, 0, 0, 10, -64, -88, -86, 0, -1, -1, -1, 0, 3, 0, 0, 10}; -64, -88, -86, 0, -1, -1, -1, 0, 3, 0, 0, 10, -64, -88, -86, 0, -1, -1, -1, 0, 3, 0, 0, 10};
private final byte[] lsRequestPacket = {0, 0, 0, 0, 2, 3, 0, 36, -64, -88, -86, 3, 0, 0, 0, 1, -67, -57, private final byte[] lsRequestPacket = {0, 0, 0, 0, 2, 3, 0, 36, -64, -88, -86, 3, 0, 0, 0, 1, -67, -57,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -64, -88, -86, 8, -64, -88, -86, 8}; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -64, -88, -86, 8, -64, -88, -86, 8};
private OspfMessageDecoder ospfMessageDecoder; private OspfMessageDecoder ospfMessageDecoder;
@ -80,7 +80,5 @@ public class OspfMessageDecoderTest {
socketAddress = InetSocketAddress.createUnresolved("127.0.0.1", 7000); socketAddress = InetSocketAddress.createUnresolved("127.0.0.1", 7000);
channelBuffer = ChannelBuffers.copiedBuffer(hellopacket); channelBuffer = ChannelBuffers.copiedBuffer(hellopacket);
assertThat(ospfMessageDecoder.decode(ctx, channel, channelBuffer), is(nullValue())); assertThat(ospfMessageDecoder.decode(ctx, channel, channelBuffer), is(nullValue()));
} }
} }

View File

@ -33,7 +33,6 @@ import org.onosproject.ospf.controller.area.OspfInterfaceImpl;
import org.onosproject.ospf.controller.lsdb.LsaWrapperImpl; import org.onosproject.ospf.controller.lsdb.LsaWrapperImpl;
import org.onosproject.ospf.controller.lsdb.LsdbAgeImpl; import org.onosproject.ospf.controller.lsdb.LsdbAgeImpl;
import org.onosproject.ospf.protocol.lsa.LsaHeader; import org.onosproject.ospf.protocol.lsa.LsaHeader;
import org.onosproject.ospf.protocol.lsa.types.NetworkLsa; import org.onosproject.ospf.protocol.lsa.types.NetworkLsa;
import org.onosproject.ospf.protocol.lsa.types.RouterLsa; import org.onosproject.ospf.protocol.lsa.types.RouterLsa;
import org.onosproject.ospf.protocol.ospfpacket.OspfMessage; import org.onosproject.ospf.protocol.ospfpacket.OspfMessage;
@ -42,7 +41,6 @@ import org.onosproject.ospf.protocol.ospfpacket.types.HelloPacket;
import org.onosproject.ospf.protocol.ospfpacket.types.LsRequest; import org.onosproject.ospf.protocol.ospfpacket.types.LsRequest;
import org.onosproject.ospf.protocol.ospfpacket.types.LsUpdate; import org.onosproject.ospf.protocol.ospfpacket.types.LsUpdate;
import org.onosproject.ospf.protocol.util.ChecksumCalculator; import org.onosproject.ospf.protocol.util.ChecksumCalculator;
import org.onosproject.ospf.protocol.util.OspfUtil; import org.onosproject.ospf.protocol.util.OspfUtil;
import java.net.SocketAddress; import java.net.SocketAddress;
@ -102,8 +100,8 @@ public class OspfNbrImplTest {
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("1.1.1.1"), ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("1.1.1.1"),
Ip4Address.valueOf("2.2.2.2"), 2, Ip4Address.valueOf("2.2.2.2"), 2,
new OspfInterfaceChannelHandler(new Controller(), new OspfInterfaceChannelHandler(new Controller(),
ospfArea, ospfInterface) ospfArea, ospfInterface),
, topologyForDeviceAndLink); topologyForDeviceAndLink);
} }

View File

@ -91,7 +91,7 @@ public class LsaWrapperImplTest {
* Tests addLsa() method. * Tests addLsa() method.
*/ */
@Test @Test
public void testAddLSA() throws Exception { public void testAddLsa() throws Exception {
lsaWrapper.addLsa(OspfLsaType.ROUTER, new RouterLsa()); lsaWrapper.addLsa(OspfLsaType.ROUTER, new RouterLsa());
assertThat(lsaWrapper, is(notNullValue())); assertThat(lsaWrapper, is(notNullValue()));
} }
@ -216,7 +216,7 @@ public class LsaWrapperImplTest {
* Tests isSentReplyForOlderLsa() method. * Tests isSentReplyForOlderLsa() method.
*/ */
@Test @Test
public void testIsSentReplyForOlderLSA() throws Exception { public void testIsSentReplyForOlderLsa() throws Exception {
lsaWrapper.setSentReplyForOlderLsa(true); lsaWrapper.setSentReplyForOlderLsa(true);
assertThat(lsaWrapper.isSentReplyForOlderLsa(), is(true)); assertThat(lsaWrapper.isSentReplyForOlderLsa(), is(true));
} }
@ -230,15 +230,6 @@ public class LsaWrapperImplTest {
assertThat(lsaWrapper.isCheckAge(), is(true)); assertThat(lsaWrapper.isCheckAge(), is(true));
} }
/**
* Tests isCheckAge() setter method.
*/
@Test
public void testIsSentReplyForOlderLsa() throws Exception {
lsaWrapper.setIsSequenceRollOver(true);
assertThat(lsaWrapper.isSequenceRollOver(), is(true));
}
/** /**
* Tests isSentReplyForOlderLsa() getter method. * Tests isSentReplyForOlderLsa() getter method.
*/ */

View File

@ -65,8 +65,6 @@ public class OspfLsdbImplTest {
opaqueLsa10 = new OpaqueLsa10(new OpaqueLsaHeader()); opaqueLsa10 = new OpaqueLsa10(new OpaqueLsaHeader());
opaqueLsa11 = new OpaqueLsa11(new OpaqueLsaHeader()); opaqueLsa11 = new OpaqueLsa11(new OpaqueLsaHeader());
externalLsa = new ExternalLsa(new LsaHeader()); externalLsa = new ExternalLsa(new LsaHeader());
} }
@After @After
@ -130,7 +128,6 @@ public class OspfLsdbImplTest {
assertThat(ospfLsdb.addLsa(externalLsa, false, new OspfInterfaceImpl()), is(true)); assertThat(ospfLsdb.addLsa(externalLsa, false, new OspfInterfaceImpl()), is(true));
ospfLsdb.initializeDb(); ospfLsdb.initializeDb();
assertThat(ospfLsdb.getAllLsaHeaders(true, true).size(), is(5)); assertThat(ospfLsdb.getAllLsaHeaders(true, true).size(), is(5));
} }
/** /**
@ -236,7 +233,7 @@ public class OspfLsdbImplTest {
* Tests addLSA() method. * Tests addLSA() method.
*/ */
@Test @Test
public void testAddLSA() throws Exception { public void testAddLsa() throws Exception {
routerLsa.setLsType(1); routerLsa.setLsType(1);
assertThat(ospfLsdb.addLsa(routerLsa, false, new OspfInterfaceImpl()), is(true)); assertThat(ospfLsdb.addLsa(routerLsa, false, new OspfInterfaceImpl()), is(true));
networkLsa.setLsType(2); networkLsa.setLsType(2);
@ -380,7 +377,7 @@ public class OspfLsdbImplTest {
* Tests isNewerOrSameLsa() method. * Tests isNewerOrSameLsa() method.
*/ */
@Test @Test
public void testIsNewerorSameLSA() throws Exception { public void testIsNewerorSameLsa() throws Exception {
lsaWrapper = new LsaWrapperImpl(); lsaWrapper = new LsaWrapperImpl();
opaqueLsaHeader1 = new OpaqueLsaHeader(); opaqueLsaHeader1 = new OpaqueLsaHeader();
opaqueLsaHeader1.setLsType(1); opaqueLsaHeader1.setLsType(1);

View File

@ -33,8 +33,8 @@
<modules> <modules>
<module>api</module> <module>api</module>
<!--module>ctl</module--> <module>ctl</module>
<!--module>protocol</module--> <module>protocol</module>
</modules> </modules>
</project> </project>

View File

@ -1,5 +1,5 @@
<!-- <!--
~ Copyright 2014 Open Networking Laboratory ~ Copyright 2016 Open Networking Laboratory
~ ~
~ Licensed under the Apache License, Version 2.0 (the "License"); ~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License. ~ you may not use this file except in compliance with the License.
@ -28,7 +28,7 @@
<artifactId>onos-ospf-protocol</artifactId> <artifactId>onos-ospf-protocol</artifactId>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<description>ONOS Ospf controller protocol</description> <description>ONOS OSPF controller protocol</description>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.onosproject</groupId> <groupId>org.onosproject</groupId>

View File

@ -136,7 +136,7 @@ public class NetworkLsa extends LsaHeader {
byte[] lsaMessage = null; byte[] lsaMessage = null;
byte[] lsaHeader = getLsaHeaderAsByteArray(); byte[] lsaHeader = getLsaHeaderAsByteArray();
byte[] lsaBody = getLSABodyAsByteArray(); byte[] lsaBody = getLsaBodyAsByteArray();
lsaMessage = Bytes.concat(lsaHeader, lsaBody); lsaMessage = Bytes.concat(lsaHeader, lsaBody);
return lsaMessage; return lsaMessage;
@ -148,7 +148,7 @@ public class NetworkLsa extends LsaHeader {
* @return LSA body as byte array * @return LSA body as byte array
* @throws OspfParseException might throws exception while parsing packet * @throws OspfParseException might throws exception while parsing packet
*/ */
public byte[] getLSABodyAsByteArray() throws OspfParseException { public byte[] getLsaBodyAsByteArray() throws OspfParseException {
List<Byte> bodyLst = new ArrayList<>(); List<Byte> bodyLst = new ArrayList<>();
try { try {

View File

@ -1,20 +1,20 @@
/* /*
* Copyright 2016 Open Networking Laboratory * Copyright 2016 Open Networking Laboratory
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/** /**
* Implementation of the different types of OSPF Packets. * Implementation of the different types of OSPF Packets.
*/ */
package org.onosproject.ospf.protocol.ospfpacket; package org.onosproject.ospf.protocol.ospfpacket;

View File

@ -13,36 +13,184 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.ospf.protocol.util; package org.onosproject.ospf.protocol.ospfpacket.types;
import com.google.common.base.MoreObjects;
import com.google.common.primitives.Bytes;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onlab.packet.Ip4Address;
import org.onosproject.ospf.exceptions.OspfParseException;
import org.onosproject.ospf.protocol.ospfpacket.OspfPacketHeader;
import org.onosproject.ospf.protocol.ospfpacket.subtype.LsRequestPacket;
import org.onosproject.ospf.protocol.util.OspfPacketType;
import org.onosproject.ospf.protocol.util.OspfUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
/** /**
* Representation of different OSPF packet types. * Representation of an OSPF Link State Request packet.
* Link State Request packets are OSPF packet type 3. After exchanging
* database description packets with a neighboring router, a router may
* find that parts of its link-state database are out-of-date. The
* Link State Request packet is used to request the pieces of the
* neighbor's database that are more up-to-date.
*/ */
public enum OspfPacketType { public class LsRequest extends OspfPacketHeader {
/*
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version # | 3 | Packet length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Router ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Area ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | AuType |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS type |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
HELLO(1), LsRequest Message Format
DD(2), REFERENCE : RFC 2328
LSREQUEST(3), */
LSUPDATE(4), private static final Logger log = LoggerFactory.getLogger(LsRequest.class);
LSAACK(5); private List<LsRequestPacket> linkStateRequests = new ArrayList<>();
private int value;
/** /**
* Creates instance of OSPF packet types. * Creates an instance of link state request packet.
*
* @param value
*/ */
OspfPacketType(int value) { public LsRequest() {
this.value = value;
} }
/** /**
* Gets the value. * Creates an instance of link state request packet.
* *
* @return value * @param ospfHeader OSPF header instance.
*/ */
public int value() { public LsRequest(OspfPacketHeader ospfHeader) {
return value; populateHeader(ospfHeader);
}
/**
* Adds link state request.
*
* @param lsRequestPacket ls request packet instance
*/
public void addLinkStateRequests(LsRequestPacket lsRequestPacket) {
if (!linkStateRequests.contains(lsRequestPacket)) {
linkStateRequests.add(lsRequestPacket);
}
}
/**
* Gets link state request packet instance.
*
* @return link state request packet instance
*/
public List<LsRequestPacket> getLinkStateRequests() {
return linkStateRequests;
}
@Override
public OspfPacketType ospfMessageType() {
return OspfPacketType.LSREQUEST;
}
@Override
public void readFrom(ChannelBuffer channelBuffer) throws OspfParseException {
while (channelBuffer.readableBytes() >= OspfUtil.LSREQUEST_LENGTH) {
LsRequestPacket lsRequestPacket = new LsRequestPacket();
lsRequestPacket.setLsType(channelBuffer.readInt());
byte[] tempByteArray = new byte[OspfUtil.FOUR_BYTES];
channelBuffer.readBytes(tempByteArray, 0, OspfUtil.FOUR_BYTES);
lsRequestPacket.setLinkStateId(Ip4Address.valueOf(tempByteArray).toString());
tempByteArray = new byte[OspfUtil.FOUR_BYTES];
channelBuffer.readBytes(tempByteArray, 0, OspfUtil.FOUR_BYTES);
lsRequestPacket.setOwnRouterId(Ip4Address.valueOf(tempByteArray).toString());
this.addLinkStateRequests(lsRequestPacket);
}
}
@Override
public byte[] asBytes() {
byte[] lsrMessage = null;
byte[] lsrHeader = getLsrHeaderAsByteArray();
byte[] lsrBody = getLsrBodyAsByteArray();
lsrMessage = Bytes.concat(lsrHeader, lsrBody);
return lsrMessage;
}
/**
* Gets LS request packet header as byte array.
*
* @return LS request packet header as byte array
*/
public byte[] getLsrHeaderAsByteArray() {
List<Byte> headerLst = new ArrayList<>();
try {
headerLst.add((byte) this.ospfVersion());
headerLst.add((byte) this.ospfType());
headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.ospfPacLength())));
headerLst.addAll(Bytes.asList(this.routerId().toOctets()));
headerLst.addAll(Bytes.asList(this.areaId().toOctets()));
headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.checksum())));
headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.authType())));
//Authentication is 0 always. Total 8 bytes consist of zero
byte[] auth = new byte[OspfUtil.EIGHT_BYTES];
headerLst.addAll(Bytes.asList(auth));
} catch (Exception e) {
log.debug("Error::getLsrBodyAsByteArray {}", e.getMessage());
return Bytes.toArray(headerLst);
}
return Bytes.toArray(headerLst);
}
/**
* Gets LS request packet body as byte array.
*
* @return LS request packet body as byte array
*/
public byte[] getLsrBodyAsByteArray() {
List<Byte> bodyLst = new ArrayList<>();
try {
for (LsRequestPacket lsrPacket : linkStateRequests) {
bodyLst.addAll(Bytes.asList(OspfUtil.convertToFourBytes(lsrPacket.lsType())));
bodyLst.addAll(Bytes.asList(InetAddress.getByName(lsrPacket.linkStateId()).getAddress()));
bodyLst.addAll(Bytes.asList(InetAddress.getByName(lsrPacket.ownRouterId()).getAddress()));
}
} catch (Exception e) {
log.debug("Error::getLsrBodyAsByteArray {}", e.getMessage());
return Bytes.toArray(bodyLst);
}
return Bytes.toArray(bodyLst);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.omitNullValues()
.add("linkStateRequests", linkStateRequests)
.toString();
} }
} }

View File

@ -181,9 +181,9 @@ public class LsUpdate extends OspfPacketHeader {
addLsa(asbrSummaryLsa); addLsa(asbrSummaryLsa);
break; break;
case OspfParameters.SUMMARY: case OspfParameters.SUMMARY:
SummaryLsa summaryLSA = new SummaryLsa(header); SummaryLsa summaryLsa = new SummaryLsa(header);
summaryLSA.readFrom(channelBuffer.readBytes(lsaLength - OspfUtil.LSA_HEADER_LENGTH)); summaryLsa.readFrom(channelBuffer.readBytes(lsaLength - OspfUtil.LSA_HEADER_LENGTH));
addLsa(summaryLSA); addLsa(summaryLsa);
break; break;
case OspfParameters.EXTERNAL_LSA: case OspfParameters.EXTERNAL_LSA:
ExternalLsa externalLsa = new ExternalLsa(header); ExternalLsa externalLsa = new ExternalLsa(header);

View File

@ -97,7 +97,7 @@ public class UnreservedBandwidthTest {
* Tests getLinkSubTypeTlvBodyAsByteArray() method. * Tests getLinkSubTypeTlvBodyAsByteArray() method.
*/ */
@Test @Test
public void testGetLinkSubTypeTLVBodyAsByteArray() throws Exception { public void testGetLinkSubTypeTlvBodyAsByteArray() throws Exception {
result = unreservedBandwidth.getLinkSubTypeTlvBodyAsByteArray(); result = unreservedBandwidth.getLinkSubTypeTlvBodyAsByteArray();
assertThat(result, is(notNullValue())); assertThat(result, is(notNullValue()));
} }

View File

@ -112,7 +112,7 @@ public class RouterTlvTest {
* Tests getTlvBodyAsByteArray() method. * Tests getTlvBodyAsByteArray() method.
*/ */
@Test(expected = Exception.class) @Test(expected = Exception.class)
public void testGetTLVBodyAsByteArray() throws Exception { public void testGetTlvBodyAsByteArray() throws Exception {
result = rtlv.getTlvBodyAsByteArray(); result = rtlv.getTlvBodyAsByteArray();
assertThat(result, is(notNullValue())); assertThat(result, is(notNullValue()));
} }
@ -124,4 +124,4 @@ public class RouterTlvTest {
public void testToString() throws Exception { public void testToString() throws Exception {
assertThat(rtlv.toString(), is(notNullValue())); assertThat(rtlv.toString(), is(notNullValue()));
} }
} }

View File

@ -164,7 +164,7 @@ public class NetworkLsaTest {
networkLsa.addAttachedRouter(Ip4Address.valueOf("1.1.1.1")); networkLsa.addAttachedRouter(Ip4Address.valueOf("1.1.1.1"));
networkLsa.addAttachedRouter(Ip4Address.valueOf("2.2.2.2")); networkLsa.addAttachedRouter(Ip4Address.valueOf("2.2.2.2"));
networkLsa.addAttachedRouter(Ip4Address.valueOf("3.3.3.3")); networkLsa.addAttachedRouter(Ip4Address.valueOf("3.3.3.3"));
result1 = networkLsa.getLSABodyAsByteArray(); result1 = networkLsa.getLsaBodyAsByteArray();
assertThat(result1, is(notNullValue())); assertThat(result1, is(notNullValue()));
} }
@ -177,7 +177,7 @@ public class NetworkLsaTest {
networkLsa.addAttachedRouter(Ip4Address.valueOf("1.1.1.1")); networkLsa.addAttachedRouter(Ip4Address.valueOf("1.1.1.1"));
networkLsa.addAttachedRouter(Ip4Address.valueOf("2.2.2.2")); networkLsa.addAttachedRouter(Ip4Address.valueOf("2.2.2.2"));
networkLsa.addAttachedRouter(Ip4Address.valueOf("3.3.3.3")); networkLsa.addAttachedRouter(Ip4Address.valueOf("3.3.3.3"));
result1 = networkLsa.getLSABodyAsByteArray(); result1 = networkLsa.getLsaBodyAsByteArray();
assertThat(result1, is(notNullValue())); assertThat(result1, is(notNullValue()));
} }

View File

@ -43,9 +43,9 @@ public class OspfMessageReaderTest {
-86, 8, -64, -88, -86, 8}; -86, 8, -64, -88, -86, 8};
private final byte[] packet4 = {1, 1, 1, 1, 2, 4, 1, 36, -64, -88, -86, 3, 0, private final byte[] packet4 = {1, 1, 1, 1, 2, 4, 1, 36, -64, -88, -86, 3, 0,
0, 0, 1, 54, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 1, 54, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
2, 2, 1, -64, -88, -86, 3, -64, -88, -86, 3, -128, 0 2, 2, 1, -64, -88, -86, 3, -64, -88, -86, 3, -128, 0,
, 0, 1, 58, -100, 0, 48, 2, 0, 0, 2, -64, -88, -86 0, 1, 58, -100, 0, 48, 2, 0, 0, 2, -64, -88, -86,
, 0, -1, -1, -1, 0, 3, 0, 0, 10, -64, -88, -86, 0, 0, -1, -1, -1, 0, 3, 0, 0, 10, -64, -88, -86, 0,
-1, -1, -1, 0, 3, 0, 0, 10, 0, 3, 2, 5, 80, -44, -1, -1, -1, 0, 3, 0, 0, 10, 0, 3, 2, 5, 80, -44,
16, 0, -64, -88, -86, 2, -128, 0, 0, 1, 42, 73, 0, 16, 0, -64, -88, -86, 2, -128, 0, 0, 1, 42, 73, 0,
36, -1, -1, -1, -1, -128, 0, 0, 20, 0, 0, 0, 0, 0, 36, -1, -1, -1, -1, -128, 0, 0, 20, 0, 0, 0, 0, 0,
@ -55,8 +55,8 @@ public class OspfMessageReaderTest {
3, 2, 5, -64, -126, 120, 0, -64, -88, -86, 2, -128, 0, 3, 2, 5, -64, -126, 120, 0, -64, -88, -86, 2, -128, 0,
0, 1, -45, 25, 0, 36, -1, -1, -1, 0, -128, 0, 0, 20, 0, 1, -45, 25, 0, 36, -1, -1, -1, 0, -128, 0, 0, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 5, -64, -88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 5, -64, -88, 0, 0,
-64, -88, -86, 2, -128, 0, 0, 1, 55, 8, 0, 36, -1, -1 -64, -88, -86, 2, -128, 0, 0, 1, 55, 8, 0, 36, -1, -1,
, -1, 0, -128, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -128, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3, 2, 5, -64, -88, 1, 0, -64, -88, -86, 2, -128, 0, 0, 3, 2, 5, -64, -88, 1, 0, -64, -88, -86, 2, -128, 0, 0,
1, 44, 18, 0, 36, -1, -1, -1, 0, -128, 0, 0, 20, 0, 0, 1, 44, 18, 0, 36, -1, -1, -1, 0, -128, 0, 0, 20, 0, 0,
0, 0, 0, 0, 0, 0, 0, 3, 2, 5, -64, -88, -84, 0, -64, 0, 0, 0, 0, 0, 0, 0, 3, 2, 5, -64, -88, -84, 0, -64,
@ -101,4 +101,4 @@ public class OspfMessageReaderTest {
assertThat(ospfMessageReader, is(notNullValue())); assertThat(ospfMessageReader, is(notNullValue()));
} }
} }

View File

@ -95,17 +95,6 @@ public class LsAcknowledgeTest {
assertThat(lsAck, is(notNullValue())); assertThat(lsAck, is(notNullValue()));
} }
/**
* Tests ospfMessageType() getter method.
*/
@Test
public void testGetOSPFMessageType() throws Exception {
ospfPacketType = lsAck.ospfMessageType();
assertThat(ospfPacketType, is(notNullValue()));
assertThat(ospfPacketType, is(OspfPacketType.LSAACK));
}
/** /**
* Tests ospfMessageType() getter method. * Tests ospfMessageType() getter method.
*/ */

View File

@ -102,7 +102,7 @@ public class LsUpdateTest {
private SummaryLsa ospflsa2; private SummaryLsa ospflsa2;
private AsbrSummaryLsa ospflsa3; private AsbrSummaryLsa ospflsa3;
private ExternalLsa ospflsa4; private ExternalLsa ospflsa4;
private Vector<OspfLsa> listLSA = new Vector(); private Vector<OspfLsa> listLsa = new Vector();
private List lsa; private List lsa;
private int result; private int result;
private OspfPacketType ospfMessageType; private OspfPacketType ospfMessageType;
@ -151,7 +151,7 @@ public class LsUpdateTest {
ospflsa2 = null; ospflsa2 = null;
ospflsa3 = null; ospflsa3 = null;
ospflsa4 = null; ospflsa4 = null;
listLSA.clear(); listLsa.clear();
lsa = null; lsa = null;
ospfMessageType = null; ospfMessageType = null;
ospfPacketHeader = null; ospfPacketHeader = null;
@ -325,13 +325,13 @@ public class LsUpdateTest {
byte[] lsUpdatePacket = {0, 0, 0, 7, 0, 2, 2, byte[] lsUpdatePacket = {0, 0, 0, 7, 0, 2, 2,
1, -64, -88, -86, 3, -64, -88, -86, 3, -128, 0, 0, 1, 58, 1, -64, -88, -86, 3, -64, -88, -86, 3, -128, 0, 0, 1, 58,
-100, 0, 48, 2, 0, 0, 2, -64, -88, -86, 0, -1, -1, -1, 0, -100, 0, 48, 2, 0, 0, 2, -64, -88, -86, 0, -1, -1, -1, 0,
3, 0, 0, 10, -64, -88, -86, 0, -1, -1, -1, 0, 3, 0, 0, 10 3, 0, 0, 10, -64, -88, -86, 0, -1, -1, -1, 0, 3, 0, 0, 10,
, 0, 3, 2, 5, 80, -44, 16, 0, -64, -88, -86, 2, -128, 0, 0 0, 3, 2, 5, 80, -44, 16, 0, -64, -88, -86, 2, -128, 0, 0,
, 1, 42, 73, 0, 36, -1, -1, -1, -1, -128, 0, 0, 20, 0, 0, 1, 42, 73, 0, 36, -1, -1, -1, -1, -128, 0, 0, 20, 0, 0,
0, 0, 0, 0, 0, 0, 0, 3, 2, 5, -108, 121, -85, 0, -64, -88 0, 0, 0, 0, 0, 0, 0, 3, 2, 5, -108, 121, -85, 0, -64, -88,
, -86, 2, -128, 0, 0, 1, 52, -91, 0, 36, -1, -1, -1, 0, -86, 2, -128, 0, 0, 1, 52, -91, 0, 36, -1, -1, -1, 0,
-128, 0, 0, 20, -64, -88, -86, 1, 0, 0, 0, 0, 0, 3, 2, 5 -128, 0, 0, 20, -64, -88, -86, 1, 0, 0, 0, 0, 0, 3, 2, 5,
, -64, -126, 120, 0, -64, -88, -86, 2, -128, 0, 0, 1, -45, -64, -126, 120, 0, -64, -88, -86, 2, -128, 0, 0, 1, -45,
25, 0, 36, -1, -1, -1, 0, -128, 0, 0, 20, 0, 0, 0, 0, 0, 25, 0, 36, -1, -1, -1, 0, -128, 0, 0, 20, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 2, 5, -64, -88, 0, 0, -64, -88, -86, 2, 0, 0, 0, 0, 3, 2, 5, -64, -88, 0, 0, -64, -88, -86, 2,
-128, 0, 0, 1, 55, 8, 0, 36, -1, -1, -1, 0, -128, 0, 0, -128, 0, 0, 1, 55, 8, 0, 36, -1, -1, -1, 0, -128, 0, 0,

View File

@ -295,8 +295,8 @@ public class OspfUtilTest {
48, 0, 0, 0, 2, 1, 1, 1, 1, 10, 10, 10, 7, 1, 0, 0, 10, 10, 10, 10, 0, -1, -1, -1, 48, 0, 0, 0, 2, 1, 1, 1, 1, 10, 10, 10, 7, 1, 0, 0, 10, 10, 10, 10, 0, -1, -1, -1,
0, 3, 0, 0, 10, 0, 10, 66, 10, 1, 0, 0, 1, 7, 7, 7, 7, -128, 0, 0, 1, -64, 79, 0, 0, 3, 0, 0, 10, 0, 10, 66, 10, 1, 0, 0, 1, 7, 7, 7, 7, -128, 0, 0, 1, -64, 79, 0,
116, 0, 1, 0, 4, 0, 0, 0, 0, 0, 2, 0, 84, 0, 1, 0, 1, 1, 0, 0, 0, 0, 2, 0, 4, 10, 116, 0, 1, 0, 4, 0, 0, 0, 0, 0, 2, 0, 84, 0, 1, 0, 1, 1, 0, 0, 0, 0, 2, 0, 4, 10,
10, 10, 0, 0, 5, 0, 4, 0, 0, 0, 0, 0, 6, 0, 4, 73, -104, -106, -128, 0, 7, 0, 4, 73 10, 10, 0, 0, 5, 0, 4, 0, 0, 0, 0, 0, 6, 0, 4, 73, -104, -106, -128, 0, 7, 0, 4, 73,
, -104, -106, -128, 0, 8, 0, 32, 73, -104, -106, -128, 73, -104, -106, -128, 73, -104, -106, -104, -106, -128, 0, 8, 0, 32, 73, -104, -106, -128, 73, -104, -106, -128, 73, -104, -106,
-128, 73, -104, -106, -128, 73, -104, -106, -128, 73, -104, -106, -128, 73, -104, -106, -128, -128, 73, -104, -106, -128, 73, -104, -106, -128, 73, -104, -106, -128, 73, -104, -106, -128,
73, -104, -106, -128, 0, 9, 0, 4, 0, 0, 0, 0}; 73, -104, -106, -128, 0, 9, 0, 4, 0, 0, 0, 0};
channelBuffer = ChannelBuffers.copiedBuffer(header); channelBuffer = ChannelBuffers.copiedBuffer(header);