mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-16 09:51:38 +02:00
[ONOS-3374] Create arp_sha selector to onos
Change-Id: I82f29e24c5fe57d3e23e4e41a6e86c165456e901
This commit is contained in:
parent
20856ec0a3
commit
e330cf009f
@ -357,6 +357,11 @@ public final class DefaultTrafficSelector implements TrafficSelector {
|
||||
return add(Criteria.matchArpTha(addr));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Builder matchArpSha(MacAddress addr) {
|
||||
return add(Criteria.matchArpSha(addr));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrafficSelector build() {
|
||||
return new DefaultTrafficSelector(ImmutableSet.copyOf(selector.values()));
|
||||
|
@ -393,6 +393,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.
|
||||
*
|
||||
|
@ -510,23 +510,33 @@ 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) {
|
||||
return new ArpPaCriterion(ip, Type.ARP_TPA);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a match on MAC destination field using the specified 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 matchArpTha(MacAddress mac) {
|
||||
return new ArpHaCriterion(mac, Type.ARP_THA);
|
||||
public static Criterion matchArpSha(MacAddress mac) {
|
||||
return new ArpHaCriterion(mac, Type.ARP_SHA);
|
||||
}
|
||||
|
||||
public static Criterion dummy() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user