Class: Pio::Lldp
- Inherits:
-
Object
- Object
- Pio::Lldp
- Extended by:
- Forwardable
- Defined in:
- lib/pio/lldp.rb,
lib/pio/lldp/frame.rb,
lib/pio/lldp/options.rb,
lib/pio/lldp/ttl_tlv.rb,
lib/pio/lldp/port_id_tlv.rb,
lib/pio/lldp/optional_tlv.rb,
lib/pio/lldp/chassis_id_tlv.rb,
lib/pio/lldp/system_name_value.rb,
lib/pio/lldp/end_of_lldpdu_value.rb,
lib/pio/lldp/port_description_value.rb,
lib/pio/lldp/management_address_value.rb,
lib/pio/lldp/system_description_value.rb,
lib/pio/lldp/system_capabilities_value.rb,
lib/pio/lldp/organizationally_specific_value.rb
Overview
LLDP frame parser and generator.
Defined Under Namespace
Classes: ChassisIdTlv, EndOfLldpduValue, Frame, ManagementAddressValue, OptionalTlv, Options, OrganizationallySpecificValue, PortDescriptionValue, PortIdTlv, SystemCapabilitiesValue, SystemDescriptionValue, SystemNameValue, TtlTlv
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Lldp
constructor
A new instance of Lldp.
- #to_binary ⇒ Object
Constructor Details
Class Method Details
.read(raw_data) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/pio/lldp.rb', line 31 def self.read(raw_data) begin frame = Frame.read(raw_data) rescue raise Pio::ParseError, $ERROR_INFO. end lldp = allocate lldp.instance_variable_set :@frame, frame lldp end |
Instance Method Details
#to_binary ⇒ Object
47 48 49 |
# File 'lib/pio/lldp.rb', line 47 def to_binary @frame.to_binary_s + "\000" * (64 - @frame.num_bytes) end |