public class MacAddress extends Object
Modifier and Type | Field and Description |
---|---|
static MacAddress |
BROADCAST
Broadcast MAC address.
|
static MacAddress |
EXACT_MASK
Mask that indicates exact match on the MacAddress.
|
static MacAddress |
IPV4_MULTICAST
IPv4 multicast MAC address.
|
static MacAddress |
IPV4_MULTICAST_MASK
IPv4 multicast MAC mask.
|
static MacAddress |
IPV6_MULTICAST
IPv6 multicast MAC address.
|
static MacAddress |
IPV6_MULTICAST_MASK
IPv6 multicast MAC mask.
|
static MacAddress |
LACP
LACP MAC address.
|
static Set<MacAddress> |
LLDP
A set of LLDP MAC addresses.
|
static int |
MAC_ADDRESS_LENGTH |
static MacAddress |
NONE
Dummy MAC address.
|
static MacAddress |
ONOS
First MAC address in ONOS OUI range.
|
static MacAddress |
ONOS_LLDP
ONOS LLDP MAC address with slow protocol destination address.
|
static MacAddress |
ZERO
All-zero MAC address.
|
Constructor and Description |
---|
MacAddress(byte[] address) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isBroadcast()
Returns
true if the MAC address is the broadcast address. |
boolean |
isLldp()
Returns true if this MAC address is used by link layer discovery protocol.
|
boolean |
isMulticast()
Returns
true if the MAC address is the multicast address. |
boolean |
isOnos()
Returns true if the Organizationally Unique Identifier (OUI) of this MAC
address matches ONOS OUI.
|
int |
length()
Returns the length of the
MACAddress . |
byte[] |
oui()
Returns the Organizationally Unique Identifier (OUI) of this MAC address.
|
byte[] |
toBytes()
Returns the value of the
MACAddress as a byte array. |
long |
toLong()
Returns the value of the
MACAddress as a long . |
String |
toString() |
String |
toStringNoColon() |
static MacAddress |
valueOf(byte[] address)
Returns a MAC address instance representing the specified
byte
array. |
static MacAddress |
valueOf(long address)
Returns a MAC address instance representing the specified
long
value. |
static MacAddress |
valueOf(String address)
Returns a MAC address instance representing the value of the specified
String . |
public static final MacAddress ONOS
public static final MacAddress NONE
public static final MacAddress ONOS_LLDP
public static final MacAddress ZERO
public static final MacAddress BROADCAST
public static final MacAddress EXACT_MASK
public static final MacAddress IPV4_MULTICAST
public static final MacAddress IPV4_MULTICAST_MASK
public static final MacAddress IPV6_MULTICAST
public static final MacAddress IPV6_MULTICAST_MASK
public static final Set<MacAddress> LLDP
public static final MacAddress LACP
public static final int MAC_ADDRESS_LENGTH
public static MacAddress valueOf(String address)
String
.address
- the String representation of the MAC Address to be parsed.String
.IllegalArgumentException
- if the string cannot be parsed as a MAC address.public static MacAddress valueOf(byte[] address)
byte
array.address
- the byte array to be parsed.byte
array.IllegalArgumentException
- if the byte array cannot be parsed as a MAC address.public static MacAddress valueOf(long address)
long
value. The lower 48 bits of the long value are used to parse as a MAC
address.address
- the long value to be parsed. The lower 48 bits are used for a
MAC address.long
value.IllegalArgumentException
- if the long value cannot be parsed as a MAC address.public int length()
MACAddress
.MACAddress
.public byte[] toBytes()
MACAddress
as a byte
array.byte
array.public long toLong()
MACAddress
as a long
.long
.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 the multicast address.true
if the MAC address is the multicast address.public boolean isLldp()
public boolean isOnos()
public byte[] oui()
public String toStringNoColon()