class MacAddress::MAC

Defined in:

mac_address/mac.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(address : String) #

[View source]

Instance Method Detail

def bare : String #

Return the bare MAC address without any delimiters. EG: 11aabbcdef33


[View source]
def binary : String #

Return the binary representation for a MAC. EG: 11-aa-bb-cd-ef-33 => 100011010101010111011110011011110111100110011


[View source]
def bits : Array(String) #

Return the MAC address as an array of bits. EG: "11-aa-bb-cd-ef-33" => ["0001", "0001", "1010", "1010", "1011", "1011", "1100", "1101", "1110", "1111", "0011", "0011"]


[View source]
def broadcast? : Bool #

Returns true if MAC is a broadcast address.


[View source]
def dot : String #

Return the MAC address in dot notation. EG: 11aa.bbcd.ef33


[View source]
def eui : String #

Return the MAC address in EUI notation. EG: 11-aa-bb-cd-ef-33


[View source]
def hex : String #

Return the MAC address in hex notation. EG 11:aa:bb:cd:ef:33


[View source]
def int : UInt64 #

Return the MAC address as an integer. EG: 11-aa-bb-cd-ef-33 == 19424992948019


[View source]
def ipv6_link_local : String #

Returns the MAC address as an IPv6 link local address. EG: 11-aa-bb-cd-ef-33 => fe80::13aa:bbff:fecd:ef33

TODO Add description on the conversion process.


[View source]
def multicast? : Bool #

Returns true if MAC is a multicast address.


[View source]
def nic : String #

Return the nic portion of the MAC address. EG: 11-aa-bb-cd-ef-33 => cdef33


[View source]
def octets : Array(String) #

Returns the MAC address in an array of octets. EG: 11-aa-bb-cd-ef-33 => ["11", "aa", "bb", "cd", "ef", "33"]


[View source]
def oui : String #

Return the vendor portion of the MAC address. EG: 11-aa-bb-cd-ef-33 => 11aabb


[View source]
def unicast? : Bool #

Returns true if MAC is a unicast address.


[View source]