class Pio::Lldp::Options

User options for creating an LLDP frame.

Constants

DEFAULT_DESTINATION_MAC
DEFAULT_SOURCE_MAC

Public Class Methods

new(options) click to toggle source
# File lib/pio/lldp/options.rb, line 17
def initialize(options)
  validate options
  @dpid = options[:dpid].freeze
  @port_id = options[:port_number].freeze
  @destination_mac =
    Mac.new(options[:destination_mac] || DEFAULT_DESTINATION_MAC).freeze
  @source_mac =
    Mac.new(options[:source_mac] || DEFAULT_SOURCE_MAC).freeze
end

Public Instance Methods

to_hash() click to toggle source
# File lib/pio/lldp/options.rb, line 27
def to_hash
  {
    chassis_id: @dpid,
    port_id: @port_id,
    destination_mac: @destination_mac,
    source_mac: @source_mac
  }.freeze
end