public class MacAddress extends Object implements OFValueType<MacAddress>
| Modifier and Type | Field and Description |
|---|---|
static MacAddress |
BROADCAST |
static MacAddress |
FULL_MASK |
static MacAddress |
NO_MASK |
static MacAddress |
NONE |
| Modifier and Type | Method and Description |
|---|---|
MacAddress |
applyMask(MacAddress mask) |
int |
compareTo(MacAddress o) |
boolean |
equals(Object obj) |
byte[] |
getBytes() |
int |
getLength() |
long |
getLong() |
int |
hashCode() |
boolean |
isBroadcast()
Returns
true if the MAC address is the broadcast address. |
boolean |
isLLDPAddress()
Returns
true if the MAC address is an LLDP mac address. |
boolean |
isMulticast()
Returns
true if the MAC address is a multicast address. |
static MacAddress |
of(byte[] address) |
static MacAddress |
of(DatapathId dpid)
Creates a
MacAddress from a DatapathId. |
static MacAddress |
of(long raw) |
static MacAddress |
of(String macString)
Parse a mac adress from the canonical string representation as
6 hex bytes separated by colons (01:02:03:04:05:06).
|
void |
putTo(com.google.common.hash.PrimitiveSink sink) |
static MacAddress |
read6Bytes(org.jboss.netty.buffer.ChannelBuffer c) |
String |
toString() |
void |
write6Bytes(org.jboss.netty.buffer.ChannelBuffer c) |
public static final MacAddress NONE
public static final MacAddress BROADCAST
public static final MacAddress NO_MASK
public static final MacAddress FULL_MASK
public static MacAddress of(byte[] address)
public static MacAddress of(long raw)
@Nonnull public static MacAddress of(@Nonnull String macString) throws IllegalArgumentException
macString - - a mac address in canonical string representationIllegalArgumentException - if macString is not a valid mac adddresspublic static MacAddress of(@Nonnull DatapathId dpid)
MacAddress from a DatapathId. This factory
method assumes that the first two bytes of the DatapathId are 0 bytes.dpid - the DatapathId to create the MacAddress fromMacAddress derived from the supplied DatapathIdpublic byte[] getBytes()
public boolean isBroadcast()
true if the MAC address is the broadcast address.true if the MAC address is the broadcast address.public boolean isMulticast()
true if the MAC address is a multicast address.true if the MAC address is a multicast address.public boolean isLLDPAddress()
true if the MAC address is an LLDP mac address.true if the MAC address is an LLDP mac address.public int getLength()
getLength in interface OFValueType<MacAddress>public long getLong()
public void write6Bytes(org.jboss.netty.buffer.ChannelBuffer c)
public static MacAddress read6Bytes(org.jboss.netty.buffer.ChannelBuffer c) throws OFParseError
OFParseErrorpublic MacAddress applyMask(MacAddress mask)
applyMask in interface OFValueType<MacAddress>public int compareTo(MacAddress o)
compareTo in interface Comparable<MacAddress>public void putTo(com.google.common.hash.PrimitiveSink sink)
putTo in interface PrimitiveSinkableCopyright © 2016. All rights reserved.