Upgrading app to ONOS 1.13
Change-Id: Ib6d780f7b3db7f39ed996ecc5d5b44e67fa067d1
diff --git a/pom.xml b/pom.xml
index f50ebff..f794d95 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos-dependencies</artifactId>
- <version>1.10.9</version>
+ <version>1.13.1</version>
<relativePath></relativePath>
</parent>
@@ -35,7 +35,7 @@
<properties>
<onos.app.name>org.opencord.aaa</onos.app.name>
- <onos.version>1.10.9</onos.version>
+ <onos.version>1.13.1</onos.version>
<onos.app.title>AAA App</onos.app.title>
<onos.app.category>Security</onos.app.category>
<onos.app.url>http://opencord.org</onos.app.url>
@@ -44,8 +44,8 @@
org.onosproject.olt,
org.opencord.sadis
</onos.app.requires>
- <sadis.api.version>2.0.0</sadis.api.version>
- <olt.api.version>1.3.1</olt.api.version>
+ <sadis.api.version>2.1.0-SNAPSHOT</sadis.api.version>
+ <olt.api.version>1.4.0-SNAPSHOT</olt.api.version>
</properties>
<dependencies>
@@ -87,6 +87,17 @@
<version>${onos.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.karaf.shell</groupId>
+ <artifactId>org.apache.karaf.shell.console</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>22.0</version>
+ </dependency>
+
</dependencies>
<build>
@@ -104,6 +115,7 @@
<plugin>
<groupId>org.onosproject</groupId>
<artifactId>onos-maven-plugin</artifactId>
+ <version>1.11</version>
</plugin>
</plugins>
</build>
diff --git a/src/main/java/org/opencord/aaa/AaaManager.java b/src/main/java/org/opencord/aaa/AaaManager.java
index 799064a..4fc0fab 100755
--- a/src/main/java/org/opencord/aaa/AaaManager.java
+++ b/src/main/java/org/opencord/aaa/AaaManager.java
@@ -19,6 +19,7 @@
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.onlab.packet.DeserializationException;
import org.onlab.packet.EAP;
import org.onlab.packet.EAPOL;
import org.onlab.packet.EthType;
@@ -267,8 +268,10 @@
*
* @param radiusPacket RADIUS packet coming from the RADIUS server.
* @throws StateMachineException if an illegal state transition is triggered
+ * @throws DeserializationException if packet deserialization fails
*/
- public void handleRadiusPacket(RADIUS radiusPacket) throws StateMachineException {
+ public void handleRadiusPacket(RADIUS radiusPacket)
+ throws StateMachineException, DeserializationException {
StateMachine stateMachine = StateMachine.lookupStateMachineById(radiusPacket.getIdentifier());
if (stateMachine == null) {
log.error("Invalid session identifier {}, exiting...", radiusPacket.getIdentifier());
@@ -298,8 +301,8 @@
//send an EAPOL - Success to the supplicant.
byte[] eapMessageSuccess =
radiusPacket.getAttribute(RADIUSAttribute.RADIUS_ATTR_EAP_MESSAGE).getValue();
- eapPayload = new EAP();
- eapPayload = (EAP) eapPayload.deserialize(eapMessageSuccess, 0, eapMessageSuccess.length);
+ eapPayload = EAP.deserializer().deserialize(
+ eapMessageSuccess, 0, eapMessageSuccess.length);
eth = buildEapolResponse(stateMachine.supplicantAddress(),
MacAddress.valueOf(nasMacAddress),
stateMachine.vlanId(),
@@ -321,7 +324,8 @@
eapPayload.setLength(EAP.EAP_HDR_LEN_SUC_FAIL);
} else {
eapMessageFailure = radiusAttrEap.getValue();
- eapPayload = (EAP) eapPayload.deserialize(eapMessageFailure, 0, eapMessageFailure.length);
+ eapPayload = EAP.deserializer().deserialize(
+ eapMessageFailure, 0, eapMessageFailure.length);
}
eth = buildEapolResponse(stateMachine.supplicantAddress(),
MacAddress.valueOf(nasMacAddress),
diff --git a/src/main/java/org/opencord/aaa/StateMachine.java b/src/main/java/org/opencord/aaa/StateMachine.java
index 6795c43..a4b46aa 100644
--- a/src/main/java/org/opencord/aaa/StateMachine.java
+++ b/src/main/java/org/opencord/aaa/StateMachine.java
@@ -17,17 +17,14 @@
package org.opencord.aaa;
-import java.util.Map;
-
+import com.google.common.collect.Maps;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import org.onosproject.net.ConnectPoint;
-
import org.opencord.olt.AccessDeviceService;
-
import org.slf4j.Logger;
-import com.google.common.collect.Maps;
+import java.util.Map;
import static org.slf4j.LoggerFactory.getLogger;