Class: Ifconf::EthernetLinkLayer

Inherits:
LinkLayer show all
Defined in:
lib/ifconf/ethernet_link_layer.rb

Overview

Link layer for Ethernet interfaces, requiring a hardware (MAC) address.

Instance Attribute Summary

Attributes inherited from LinkLayer

#encapsulation, #hardware_addr, #tx_queue_len

Instance Method Summary collapse

Methods inherited from LinkLayer

#==, build, #hash, #to_s

Constructor Details

#initialize(hardware_addr:, tx_queue_len:) ⇒ EthernetLinkLayer

Returns a new instance of EthernetLinkLayer.

Raises:



4
5
6
7
8
# File 'lib/ifconf/ethernet_link_layer.rb', line 4

def initialize(hardware_addr:, tx_queue_len:)
  raise Ifconf::Error, "ethernet requires hardware address" unless hardware_addr

  super(encapsulation: :ethernet, hardware_addr: hardware_addr, tx_queue_len: tx_queue_len)
end