[ONOS-3374] Create arp_sha selector to onos
Change-Id: I82f29e24c5fe57d3e23e4e41a6e86c165456e901
Showing
3 changed files
with
27 additions
and
4 deletions
| ... | @@ -358,6 +358,11 @@ public final class DefaultTrafficSelector implements TrafficSelector { | ... | @@ -358,6 +358,11 @@ public final class DefaultTrafficSelector implements TrafficSelector { |
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | @Override | 360 | @Override |
| 361 | + public Builder matchArpSha(MacAddress addr) { | ||
| 362 | + return add(Criteria.matchArpSha(addr)); | ||
| 363 | + } | ||
| 364 | + | ||
| 365 | + @Override | ||
| 361 | public TrafficSelector build() { | 366 | public TrafficSelector build() { |
| 362 | return new DefaultTrafficSelector(ImmutableSet.copyOf(selector.values())); | 367 | return new DefaultTrafficSelector(ImmutableSet.copyOf(selector.values())); |
| 363 | } | 368 | } | ... | ... |
| ... | @@ -394,6 +394,14 @@ public interface TrafficSelector { | ... | @@ -394,6 +394,14 @@ public interface TrafficSelector { |
| 394 | Builder matchArpTha(MacAddress addr); | 394 | Builder matchArpTha(MacAddress addr); |
| 395 | 395 | ||
| 396 | /** | 396 | /** |
| 397 | + * Matches a arp_eth_src address. | ||
| 398 | + * | ||
| 399 | + * @param addr a arp_eth_src address | ||
| 400 | + * @return a selection builder | ||
| 401 | + */ | ||
| 402 | + Builder matchArpSha(MacAddress addr); | ||
| 403 | + | ||
| 404 | + /** | ||
| 397 | * Builds an immutable traffic selector. | 405 | * Builds an immutable traffic selector. |
| 398 | * | 406 | * |
| 399 | * @return traffic selector | 407 | * @return traffic selector | ... | ... |
| ... | @@ -510,9 +510,9 @@ public final class Criteria { | ... | @@ -510,9 +510,9 @@ public final class Criteria { |
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | /** | 512 | /** |
| 513 | - * Creates a match on IPv4 source field using the specified value. | 513 | + * Creates a match on IPv4 destination field using the specified value. |
| 514 | * | 514 | * |
| 515 | - * @param ip ipv4 source value | 515 | + * @param ip ipv4 destination value |
| 516 | * @return match criterion | 516 | * @return match criterion |
| 517 | */ | 517 | */ |
| 518 | public static Criterion matchArpTpa(Ip4Address ip) { | 518 | public static Criterion matchArpTpa(Ip4Address ip) { |
| ... | @@ -520,15 +520,25 @@ public final class Criteria { | ... | @@ -520,15 +520,25 @@ public final class Criteria { |
| 520 | } | 520 | } |
| 521 | 521 | ||
| 522 | /** | 522 | /** |
| 523 | - * Creates a match on MAC source field using the specified value. | 523 | + * Creates a match on MAC destination field using the specified value. |
| 524 | * | 524 | * |
| 525 | - * @param mac MAC source value | 525 | + * @param mac MAC destination value |
| 526 | * @return match criterion | 526 | * @return match criterion |
| 527 | */ | 527 | */ |
| 528 | public static Criterion matchArpTha(MacAddress mac) { | 528 | public static Criterion matchArpTha(MacAddress mac) { |
| 529 | return new ArpHaCriterion(mac, Type.ARP_THA); | 529 | return new ArpHaCriterion(mac, Type.ARP_THA); |
| 530 | } | 530 | } |
| 531 | 531 | ||
| 532 | + /** | ||
| 533 | + * Creates a match on MAC source field using the specified value. | ||
| 534 | + * | ||
| 535 | + * @param mac MAC source value | ||
| 536 | + * @return match criterion | ||
| 537 | + */ | ||
| 538 | + public static Criterion matchArpSha(MacAddress mac) { | ||
| 539 | + return new ArpHaCriterion(mac, Type.ARP_SHA); | ||
| 540 | + } | ||
| 541 | + | ||
| 532 | public static Criterion dummy() { | 542 | public static Criterion dummy() { |
| 533 | return new DummyCriterion(); | 543 | return new DummyCriterion(); |
| 534 | } | 544 | } | ... | ... |
-
Please register or login to post a comment