Implemented global packet-out functionality in the PacketModule.
Updated with javadoc for the interfaces, and fixes to bugs pointed out by
Pavlin and Yuta regarding the implementation of calculateOutPorts in
BroadcastPacketOutNotification.
Change-Id: I6174d27877972cf437955ef8d82e9a02b36d0b5f
diff --git a/src/main/java/net/onrc/onos/core/util/SwitchPort.java b/src/main/java/net/onrc/onos/core/util/SwitchPort.java
index 9178267..edb9f77 100644
--- a/src/main/java/net/onrc/onos/core/util/SwitchPort.java
+++ b/src/main/java/net/onrc/onos/core/util/SwitchPort.java
@@ -30,6 +30,17 @@
}
/**
+ * Constructor for the specified primitive values of a DPID and port.
+ *
+ * @param dpid the long DPID to use
+ * @param port the short port number to use
+ */
+ public SwitchPort(long dpid, short port) {
+ this.dpid = new Dpid(dpid);
+ this.port = new Port(port);
+ }
+
+ /**
* Get the DPID value of the Switch-Port.
*
* @return the DPID value of the Switch-Port.
diff --git a/src/main/java/net/onrc/onos/core/util/serializers/KryoFactory.java b/src/main/java/net/onrc/onos/core/util/serializers/KryoFactory.java
index d1794d1..a1c4728 100644
--- a/src/main/java/net/onrc/onos/core/util/serializers/KryoFactory.java
+++ b/src/main/java/net/onrc/onos/core/util/serializers/KryoFactory.java
@@ -19,6 +19,7 @@
import net.onrc.onos.core.intent.ShortestPathIntent;
import net.onrc.onos.core.intent.runtime.IntentStateList;
import net.onrc.onos.core.packetservice.BroadcastPacketOutNotification;
+import net.onrc.onos.core.packetservice.PacketOutNotification;
import net.onrc.onos.core.packetservice.SinglePacketOutNotification;
import net.onrc.onos.core.topology.DeviceEvent;
import net.onrc.onos.core.topology.LinkEvent;
@@ -51,7 +52,6 @@
import net.onrc.onos.core.util.Switch;
// import net.onrc.onos.core.util.SwitchPort;
-
import com.esotericsoftware.kryo.Kryo;
/**
@@ -217,6 +217,7 @@
kryo.register(Date.class);
// ProxyArp-related classes
+ kryo.register(PacketOutNotification.class);
kryo.register(BroadcastPacketOutNotification.class);
kryo.register(SinglePacketOutNotification.class);
kryo.register(ArpReplyNotification.class);