Sha256: b705d1af6d23060af95e91e3c940e0deb83ba6ebb272ac9105ce4c85ea3f09d6
Contents?: true
Size: 983 Bytes
Versions: 2
Compression:
Stored size: 983 Bytes
Contents
# frozen_string_literal: true # This file is part of PacketGen # See https://github.com/lemontree55/packetgen for more informations # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net> # Copyright (C) 2024 LemonTree55 <lenontree@proton.me> # This program is published under MIT license. module PacketGen module Header class IP # Class to handle IP options # @author Sylvain Daubert class Options < BinStruct::Array set_of Option HUMAN_SEPARATOR = ';' # Get binary string # @return [String] def to_s str = super str += ([0] * (4 - (str.length % 4))).pack('C*') if str.length % 4 != 0 str end private def record_from_hash(hsh) Option.build(hsh) end def real_type(opt) types = Option.types types.value?(opt.type) ? IP.const_get(types.key(opt.type)) : opt.class end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
packetgen-4.1.0 | lib/packetgen/header/ip/options.rb |
packetgen-4.0.0 | lib/packetgen/header/ip/options.rb |