Jonathan Hart | 382623d | 2014-04-03 09:48:11 -0700 | [diff] [blame] | 1 | package net.onrc.onos.apps.bgproute; |
Jonathan Hart | 309889c | 2013-08-13 23:26:24 +1200 | [diff] [blame] | 2 | |
| 3 | import org.openflow.protocol.OFFlowMod; |
| 4 | |
Jonathan Hart | 08ee852 | 2013-09-22 17:34:43 +1200 | [diff] [blame] | 5 | /** |
| 6 | * Wraps up a DPID and a OFFlowMod so we know how to delete |
| 7 | * the flow if we have to. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 8 | * <p/> |
Jonathan Hart | 08ee852 | 2013-09-22 17:34:43 +1200 | [diff] [blame] | 9 | * TODO This functionality should be handled by ONOS's flow layer in future. |
Jonathan Hart | 08ee852 | 2013-09-22 17:34:43 +1200 | [diff] [blame] | 10 | */ |
Jonathan Hart | 309889c | 2013-08-13 23:26:24 +1200 | [diff] [blame] | 11 | public class PushedFlowMod { |
Jonathan Hart | 738980f | 2014-04-04 10:11:15 -0700 | [diff] [blame^] | 12 | private final long dpid; |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 13 | private OFFlowMod flowMod; |
| 14 | |
| 15 | public PushedFlowMod(long dpid, OFFlowMod flowMod) { |
| 16 | this.dpid = dpid; |
| 17 | try { |
| 18 | this.flowMod = flowMod.clone(); |
| 19 | } catch (CloneNotSupportedException e) { |
| 20 | this.flowMod = flowMod; |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | public long getDpid() { |
| 25 | return dpid; |
| 26 | } |
| 27 | |
| 28 | public OFFlowMod getFlowMod() { |
| 29 | return flowMod; |
| 30 | } |
Jonathan Hart | 309889c | 2013-08-13 23:26:24 +1200 | [diff] [blame] | 31 | } |