Sha256: dd98c9fa7a834cc24b6d974e15494cd2f120519412ca8b0d6318b865ffe9d4c4
Contents?: true
Size: 725 Bytes
Versions: 39
Compression:
Stored size: 725 Bytes
Contents
require 'bindata' module Pio class Lldp # Port ID TLV class PortIdTlv < BinData::Primitive endian :big bit7 :tlv_type, value: 2 bit9 :tlv_info_length, initial_value: -> { port_id.num_bytes + 1 } uint8 :subtype, initial_value: 7 string :port_id, read_length: -> { tlv_info_length - 1 } def get tmp_id = port_id if subtype == 7 BinData::Uint32be.read tmp_id else tmp_id end end def set(value) self.port_id = if subtype == 7 BinData::Uint32be.new(value).to_binary_s else value end end end end end
Version data entries
39 entries across 39 versions & 1 rubygems