Skip to content

Latest commit

 

History

History
83 lines (68 loc) · 2 KB

File metadata and controls

83 lines (68 loc) · 2 KB

MacAddress

Represents MAC address

Instance attributes

isBroadcast: bool

TRUE if is broadcst address

isMulticast: bool

TRUE if multicast address

isValid: bool

TRUE if is valid MAC address

Instance methods

equals(mac): bool

Compares two MAC addresses

Table 1. Parameters

mac

MacAddress

MAC address to compare to

Return

TRUE if MAC addresses are equal

toString(notation): String

Returns MAC address string representation

Table 2. Parameters

notation

Constant

Optional. Notation of MAC address, one of MAC address notation options. MacAddressNotation::COLON_SEPARATED will be used by default if this parameter is not provided.

Return

MAC address as a string

Constructors

MacAddress(mac)

Creates new MAC address object.

Table 3. Parameters

mac

String

Optional. String represenation of MAC address to parse to object

Return

MacAddress object

Constants

Table 4. MAC address notation
Constant Description

MacAddressNotation::FLAT_STRING

Without separator, e.g. 123456789ABC

MacAddressNotation::COLON_SEPARATED

Separated by colon, e.g. 12:34:56:78:9A:BC

MacAddressNotation::BYTEPAIR_COLON_SEPARATED

Bytepairs separated by colon, e.g. 1234:5678:9ABC

MacAddressNotation::HYPHEN_SEPARATED

Separated by hyphen, e.g. 12-34-56-78-9A-BC

MacAddressNotation::DOT_SEPARATED

Separated by dot, e.g. 123.456.789.ABC

MacAddressNotation::BYTEPAIR_DOT_SEPARATED

Bytepairs separated by dot, e.g. 1234.5678.9ABC

MacAddressNotation::DECIMAL_DOT_SEPARATED

Decimal, separated by dot, e.g. 18.52.86.120.154.188