Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
BUG-2218: Keep existing link augmentations during discovery process
[controller.git]
/
opendaylight
/
sal
/
api
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
packet
/
Ethernet.java
diff --git
a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/Ethernet.java
b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/Ethernet.java
index 7f151c9502d22f936f2dbb25f24cda9fcdb14585..235e71a760faa01eb9cf9d2acf92a73c8acf00ce 100644
(file)
--- a/
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/Ethernet.java
+++ b/
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/Ethernet.java
@@
-15,7
+15,10
@@
import java.util.Map;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
+import org.opendaylight.controller.sal.match.Match;
+import org.opendaylight.controller.sal.match.MatchType;
import org.opendaylight.controller.sal.utils.EtherTypes;
import org.opendaylight.controller.sal.utils.EtherTypes;
+import org.opendaylight.controller.sal.utils.NetUtils;
/**
* Class that represents the Ethernet frame objects
/**
* Class that represents the Ethernet frame objects
@@
-102,6
+105,14
@@
public class Ethernet extends Packet {
return BitBufferHelper.getShort(fieldValues.get(ETHT));
}
return BitBufferHelper.getShort(fieldValues.get(ETHT));
}
+ public boolean isBroadcast(){
+ return NetUtils.isBroadcastMACAddr(getDestinationMACAddress());
+ }
+
+ public boolean isMulticast(){
+ return NetUtils.isMulticastMACAddr(getDestinationMACAddress());
+ }
+
/**
* Sets the destination MAC address for the current Ethernet object instance
* @param byte[] - the destinationMACAddress to set
/**
* Sets the destination MAC address for the current Ethernet object instance
* @param byte[] - the destinationMACAddress to set
@@
-130,4
+141,10
@@
public class Ethernet extends Packet {
return this;
}
return this;
}
+ @Override
+ public void populateMatch(Match match) {
+ match.setField(MatchType.DL_SRC, this.getSourceMACAddress());
+ match.setField(MatchType.DL_DST, this.getDestinationMACAddress());
+ match.setField(MatchType.DL_TYPE, this.getEtherType());
+ }
}
}