BitOhenry
Committed by Gerrit Code Review

[ONOS-3391] create arp_spa selector to onos

Change-Id: I2508a3ca7acb95b9792f0b23e085074a5b030a3b
...@@ -359,6 +359,11 @@ public final class DefaultTrafficSelector implements TrafficSelector { ...@@ -359,6 +359,11 @@ public final class DefaultTrafficSelector implements TrafficSelector {
359 } 359 }
360 360
361 @Override 361 @Override
362 + public Builder matchArpSpa(Ip4Address addr) {
363 + return add(Criteria.matchArpSpa(addr));
364 + }
365 +
366 + @Override
362 public Builder matchArpTha(MacAddress addr) { 367 public Builder matchArpTha(MacAddress addr) {
363 return add(Criteria.matchArpTha(addr)); 368 return add(Criteria.matchArpTha(addr));
364 } 369 }
......
...@@ -395,6 +395,14 @@ public interface TrafficSelector { ...@@ -395,6 +395,14 @@ public interface TrafficSelector {
395 Builder matchArpTpa(Ip4Address addr); 395 Builder matchArpTpa(Ip4Address addr);
396 396
397 /** 397 /**
398 + * Matches a arp IPv4 source address.
399 + *
400 + * @param addr a arp IPv4 source address
401 + * @return a selection builder
402 + */
403 + Builder matchArpSpa(Ip4Address addr);
404 +
405 + /**
398 * Matches a arp_eth_dst address. 406 * Matches a arp_eth_dst address.
399 * 407 *
400 * @param addr a arp_eth_dst address 408 * @param addr a arp_eth_dst address
......
...@@ -520,6 +520,16 @@ public final class Criteria { ...@@ -520,6 +520,16 @@ public final class Criteria {
520 } 520 }
521 521
522 /** 522 /**
523 + * Creates a match on IPv4 source field using the specified value.
524 + *
525 + * @param ip ipv4 source value
526 + * @return match criterion
527 + */
528 + public static Criterion matchArpSpa(Ip4Address ip) {
529 + return new ArpPaCriterion(ip, Type.ARP_SPA);
530 + }
531 +
532 + /**
523 * Creates a match on MAC destination field using the specified value. 533 * Creates a match on MAC destination field using the specified value.
524 * 534 *
525 * @param mac MAC destination value 535 * @param mac MAC destination value
......