BitOhenry

[ONOS-3374] Create arp_sha selector to onos

Change-Id: I82f29e24c5fe57d3e23e4e41a6e86c165456e901
......@@ -358,6 +358,11 @@ public final class DefaultTrafficSelector implements TrafficSelector {
}
@Override
public Builder matchArpSha(MacAddress addr) {
return add(Criteria.matchArpSha(addr));
}
@Override
public TrafficSelector build() {
return new DefaultTrafficSelector(ImmutableSet.copyOf(selector.values()));
}
......
......@@ -394,6 +394,14 @@ public interface TrafficSelector {
Builder matchArpTha(MacAddress addr);
/**
* Matches a arp_eth_src address.
*
* @param addr a arp_eth_src address
* @return a selection builder
*/
Builder matchArpSha(MacAddress addr);
/**
* Builds an immutable traffic selector.
*
* @return traffic selector
......
......@@ -510,9 +510,9 @@ public final class Criteria {
}
/**
* Creates a match on IPv4 source field using the specified value.
* Creates a match on IPv4 destination field using the specified value.
*
* @param ip ipv4 source value
* @param ip ipv4 destination value
* @return match criterion
*/
public static Criterion matchArpTpa(Ip4Address ip) {
......@@ -520,15 +520,25 @@ public final class Criteria {
}
/**
* Creates a match on MAC source field using the specified value.
* Creates a match on MAC destination field using the specified value.
*
* @param mac MAC source value
* @param mac MAC destination value
* @return match criterion
*/
public static Criterion matchArpTha(MacAddress mac) {
return new ArpHaCriterion(mac, Type.ARP_THA);
}
/**
* Creates a match on MAC source field using the specified value.
*
* @param mac MAC source value
* @return match criterion
*/
public static Criterion matchArpSha(MacAddress mac) {
return new ArpHaCriterion(mac, Type.ARP_SHA);
}
public static Criterion dummy() {
return new DummyCriterion();
}
......