BitOhenry
Committed by Gerrit Code Review

[ONOS-3441] Add arp_tpa operation to provider of openflow

Change-Id: I94949f4b536bbaa3f5999f8584674bbe44cb2c6b
......@@ -513,6 +513,7 @@ public class FlowEntryBuilder {
Ip4Prefix ip4Prefix;
Ip6Address ip6Address;
Ip6Prefix ip6Prefix;
Ip4Address ip;
TrafficSelector.Builder builder = DefaultTrafficSelector.builder();
for (MatchField<?> field : match.getMatchFields()) {
......@@ -715,9 +716,12 @@ public class FlowEntryBuilder {
mac = MacAddress.valueOf(match.get(MatchField.ARP_THA).getLong());
builder.matchArpTha(mac);
break;
case ARP_TPA:
ip = Ip4Address.valueOf(match.get(MatchField.ARP_TPA).getInt());
builder.matchArpTpa(ip);
break;
case ARP_OP:
case ARP_SPA:
case ARP_TPA:
case MPLS_TC:
default:
log.warn("Match type {} not yet implemented.", field.id);
......
......@@ -25,6 +25,7 @@ import org.onosproject.net.driver.DriverService;
import org.onosproject.net.flow.FlowRule;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.criteria.ArpHaCriterion;
import org.onosproject.net.flow.criteria.ArpPaCriterion;
import org.onosproject.net.flow.criteria.Criterion;
import org.onosproject.net.flow.criteria.EthCriterion;
import org.onosproject.net.flow.criteria.EthTypeCriterion;
......@@ -180,6 +181,7 @@ public abstract class FlowModBuilder {
SctpPortCriterion sctpPortCriterion;
IPv6NDLinkLayerAddressCriterion llAddressCriterion;
ArpHaCriterion arpHaCriterion;
ArpPaCriterion arpPaCriterion;
for (Criterion c : selector.criteria()) {
switch (c.type()) {
......@@ -427,9 +429,13 @@ public abstract class FlowModBuilder {
mBuilder.setExact(MatchField.ARP_THA,
MacAddress.of(arpHaCriterion.mac().toLong()));
break;
case ARP_TPA:
arpPaCriterion = (ArpPaCriterion) c;
mBuilder.setExact(MatchField.ARP_TPA,
IPv4Address.of(arpPaCriterion.ip().toInt()));
break;
case ARP_OP:
case ARP_SPA:
case ARP_TPA:
case MPLS_TC:
case PBB_ISID:
default:
......