alshabib

renamed OF packet context to OpenFlowPacketContext

1 package org.onlab.onos.net.packet; 1 package org.onlab.onos.net.packet;
2 2
3 3
4 +
4 /** 5 /**
5 * Abstraction of an inbound packet processor. 6 * Abstraction of an inbound packet processor.
6 */ 7 */
......
...@@ -11,7 +11,7 @@ import org.projectfloodlight.openflow.protocol.match.MatchField; ...@@ -11,7 +11,7 @@ import org.projectfloodlight.openflow.protocol.match.MatchField;
11 import org.projectfloodlight.openflow.types.OFBufferId; 11 import org.projectfloodlight.openflow.types.OFBufferId;
12 import org.projectfloodlight.openflow.types.OFPort; 12 import org.projectfloodlight.openflow.types.OFPort;
13 13
14 -public final class DefaultPacketContext implements PacketContext { 14 +public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext {
15 15
16 private boolean free = true; 16 private boolean free = true;
17 private boolean isBuilt = false; 17 private boolean isBuilt = false;
...@@ -19,7 +19,7 @@ public final class DefaultPacketContext implements PacketContext { ...@@ -19,7 +19,7 @@ public final class DefaultPacketContext implements PacketContext {
19 private final OFPacketIn pktin; 19 private final OFPacketIn pktin;
20 private OFPacketOut pktout = null; 20 private OFPacketOut pktout = null;
21 21
22 - private DefaultPacketContext(OpenFlowSwitch s, OFPacketIn pkt) { 22 + private DefaultOpenFlowPacketContext(OpenFlowSwitch s, OFPacketIn pkt) {
23 this.sw = s; 23 this.sw = s;
24 this.pktin = pkt; 24 this.pktin = pkt;
25 } 25 }
...@@ -78,8 +78,8 @@ public final class DefaultPacketContext implements PacketContext { ...@@ -78,8 +78,8 @@ public final class DefaultPacketContext implements PacketContext {
78 return new Dpid(sw.getId()); 78 return new Dpid(sw.getId());
79 } 79 }
80 80
81 - public static PacketContext packetContextFromPacketIn(OpenFlowSwitch s, OFPacketIn pkt) { 81 + public static OpenFlowPacketContext packetContextFromPacketIn(OpenFlowSwitch s, OFPacketIn pkt) {
82 - return new DefaultPacketContext(s, pkt); 82 + return new DefaultOpenFlowPacketContext(s, pkt);
83 } 83 }
84 84
85 @Override 85 @Override
......
...@@ -8,7 +8,7 @@ import org.projectfloodlight.openflow.types.OFPort; ...@@ -8,7 +8,7 @@ import org.projectfloodlight.openflow.types.OFPort;
8 * to view the packet in event but may block the response to the 8 * to view the packet in event but may block the response to the
9 * event if blocked has been called. 9 * event if blocked has been called.
10 */ 10 */
11 -public interface PacketContext { 11 +public interface OpenFlowPacketContext {
12 12
13 //TODO: may want to support sending packet out other switches than 13 //TODO: may want to support sending packet out other switches than
14 // the one it came in on. 14 // the one it came in on.
......
...@@ -10,5 +10,5 @@ public interface PacketListener { ...@@ -10,5 +10,5 @@ public interface PacketListener {
10 * 10 *
11 * @param pktCtx the packet context 11 * @param pktCtx the packet context
12 */ 12 */
13 - public void handlePacket(PacketContext pktCtx); 13 + public void handlePacket(OpenFlowPacketContext pktCtx);
14 } 14 }
......
...@@ -12,7 +12,7 @@ import org.apache.felix.scr.annotations.Activate; ...@@ -12,7 +12,7 @@ import org.apache.felix.scr.annotations.Activate;
12 import org.apache.felix.scr.annotations.Component; 12 import org.apache.felix.scr.annotations.Component;
13 import org.apache.felix.scr.annotations.Deactivate; 13 import org.apache.felix.scr.annotations.Deactivate;
14 import org.apache.felix.scr.annotations.Service; 14 import org.apache.felix.scr.annotations.Service;
15 -import org.onlab.onos.of.controller.DefaultPacketContext; 15 +import org.onlab.onos.of.controller.DefaultOpenFlowPacketContext;
16 import org.onlab.onos.of.controller.Dpid; 16 import org.onlab.onos.of.controller.Dpid;
17 import org.onlab.onos.of.controller.OpenFlowController; 17 import org.onlab.onos.of.controller.OpenFlowController;
18 import org.onlab.onos.of.controller.OpenFlowSwitch; 18 import org.onlab.onos.of.controller.OpenFlowSwitch;
...@@ -124,7 +124,7 @@ public class OpenFlowControllerImpl implements OpenFlowController { ...@@ -124,7 +124,7 @@ public class OpenFlowControllerImpl implements OpenFlowController {
124 break; 124 break;
125 case PACKET_IN: 125 case PACKET_IN:
126 for (PacketListener p : ofPacketListener) { 126 for (PacketListener p : ofPacketListener) {
127 - p.handlePacket(DefaultPacketContext 127 + p.handlePacket(DefaultOpenFlowPacketContext
128 .packetContextFromPacketIn(this.getSwitch(dpid), 128 .packetContextFromPacketIn(this.getSwitch(dpid),
129 (OFPacketIn) msg)); 129 (OFPacketIn) msg));
130 } 130 }
......
...@@ -15,7 +15,7 @@ import org.onlab.onos.of.controller.Dpid; ...@@ -15,7 +15,7 @@ import org.onlab.onos.of.controller.Dpid;
15 import org.onlab.onos.of.controller.OpenFlowController; 15 import org.onlab.onos.of.controller.OpenFlowController;
16 import org.onlab.onos.of.controller.OpenFlowSwitch; 16 import org.onlab.onos.of.controller.OpenFlowSwitch;
17 import org.onlab.onos.of.controller.OpenFlowSwitchListener; 17 import org.onlab.onos.of.controller.OpenFlowSwitchListener;
18 -import org.onlab.onos.of.controller.PacketContext; 18 +import org.onlab.onos.of.controller.OpenFlowPacketContext;
19 import org.onlab.onos.of.controller.PacketListener; 19 import org.onlab.onos.of.controller.PacketListener;
20 import org.projectfloodlight.openflow.protocol.OFPortConfig; 20 import org.projectfloodlight.openflow.protocol.OFPortConfig;
21 import org.projectfloodlight.openflow.protocol.OFPortDesc; 21 import org.projectfloodlight.openflow.protocol.OFPortDesc;
...@@ -87,7 +87,7 @@ public class OpenFlowLinkProvider extends AbstractProvider implements LinkProvid ...@@ -87,7 +87,7 @@ public class OpenFlowLinkProvider extends AbstractProvider implements LinkProvid
87 87
88 88
89 @Override 89 @Override
90 - public void handlePacket(PacketContext pktCtx) { 90 + public void handlePacket(OpenFlowPacketContext pktCtx) {
91 LinkDiscovery ld = discoverers.get(pktCtx.dpid()); 91 LinkDiscovery ld = discoverers.get(pktCtx.dpid());
92 if (ld == null) { 92 if (ld == null) {
93 return; 93 return;
......