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.NetUtils;
/**
* Class that represents the Ethernet frame objects
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
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());
+ }
}