Merge branch 'master' of ssh://gerrit.onlab.us:29418/onos-next
Showing
2 changed files
with
18 additions
and
11 deletions
1 | package org.onlab.onos.net.trivial.host.impl; | 1 | package org.onlab.onos.net.trivial.host.impl; |
2 | 2 | ||
3 | +import static org.onlab.onos.net.host.HostEvent.Type.HOST_ADDED; | ||
4 | +import static org.onlab.onos.net.host.HostEvent.Type.HOST_MOVED; | ||
5 | +import static org.onlab.onos.net.host.HostEvent.Type.HOST_REMOVED; | ||
6 | +import static org.onlab.onos.net.host.HostEvent.Type.HOST_UPDATED; | ||
7 | + | ||
8 | +import java.util.Collections; | ||
9 | +import java.util.HashSet; | ||
10 | +import java.util.Map; | ||
11 | +import java.util.Set; | ||
12 | +import java.util.concurrent.ConcurrentHashMap; | ||
13 | + | ||
3 | import org.onlab.onos.net.ConnectPoint; | 14 | import org.onlab.onos.net.ConnectPoint; |
4 | import org.onlab.onos.net.DefaultHost; | 15 | import org.onlab.onos.net.DefaultHost; |
5 | import org.onlab.onos.net.DeviceId; | 16 | import org.onlab.onos.net.DeviceId; |
... | @@ -15,17 +26,6 @@ import com.google.common.collect.HashMultimap; | ... | @@ -15,17 +26,6 @@ import com.google.common.collect.HashMultimap; |
15 | import com.google.common.collect.ImmutableSet; | 26 | import com.google.common.collect.ImmutableSet; |
16 | import com.google.common.collect.Multimap; | 27 | import com.google.common.collect.Multimap; |
17 | 28 | ||
18 | -import java.util.Collections; | ||
19 | -import java.util.HashSet; | ||
20 | -import java.util.Map; | ||
21 | -import java.util.Set; | ||
22 | -import java.util.concurrent.ConcurrentHashMap; | ||
23 | - | ||
24 | -import static org.onlab.onos.net.host.HostEvent.Type.HOST_REMOVED; | ||
25 | -import static org.onlab.onos.net.host.HostEvent.Type.HOST_ADDED; | ||
26 | -import static org.onlab.onos.net.host.HostEvent.Type.HOST_UPDATED; | ||
27 | -import static org.onlab.onos.net.host.HostEvent.Type.HOST_MOVED; | ||
28 | - | ||
29 | /** | 29 | /** |
30 | * Manages inventory of end-station hosts using trivial in-memory | 30 | * Manages inventory of end-station hosts using trivial in-memory |
31 | * implementation. | 31 | * implementation. | ... | ... |
... | @@ -7,6 +7,7 @@ import org.projectfloodlight.openflow.protocol.OFPacketIn; | ... | @@ -7,6 +7,7 @@ import org.projectfloodlight.openflow.protocol.OFPacketIn; |
7 | import org.projectfloodlight.openflow.protocol.OFPacketOut; | 7 | import org.projectfloodlight.openflow.protocol.OFPacketOut; |
8 | import org.projectfloodlight.openflow.protocol.action.OFAction; | 8 | import org.projectfloodlight.openflow.protocol.action.OFAction; |
9 | import org.projectfloodlight.openflow.protocol.action.OFActionOutput; | 9 | import org.projectfloodlight.openflow.protocol.action.OFActionOutput; |
10 | +import org.projectfloodlight.openflow.protocol.match.MatchField; | ||
10 | import org.projectfloodlight.openflow.types.OFBufferId; | 11 | import org.projectfloodlight.openflow.types.OFBufferId; |
11 | import org.projectfloodlight.openflow.types.OFPort; | 12 | import org.projectfloodlight.openflow.types.OFPort; |
12 | 13 | ||
... | @@ -83,12 +84,18 @@ public final class DefaultPacketContext implements PacketContext { | ... | @@ -83,12 +84,18 @@ public final class DefaultPacketContext implements PacketContext { |
83 | 84 | ||
84 | @Override | 85 | @Override |
85 | public Integer inPort() { | 86 | public Integer inPort() { |
87 | + try { | ||
86 | return pktin.getInPort().getPortNumber(); | 88 | return pktin.getInPort().getPortNumber(); |
89 | + } catch (UnsupportedOperationException e) { | ||
90 | + return pktin.getMatch().get(MatchField.IN_PORT).getPortNumber(); | ||
91 | + } | ||
87 | } | 92 | } |
88 | 93 | ||
89 | @Override | 94 | @Override |
90 | public byte[] unparsed() { | 95 | public byte[] unparsed() { |
96 | + | ||
91 | return pktin.getData().clone(); | 97 | return pktin.getData().clone(); |
98 | + | ||
92 | } | 99 | } |
93 | 100 | ||
94 | private OFActionOutput buildOutput(Integer port) { | 101 | private OFActionOutput buildOutput(Integer port) { | ... | ... |
-
Please register or login to post a comment