lib/packetgen/header/base.rb in packetgen-3.1.3 vs lib/packetgen/header/base.rb in packetgen-3.1.4
- old
+ new
@@ -1,12 +1,12 @@
+# frozen_string_literal: true
+
# This file is part of PacketGen
# See https://github.com/sdaubert/packetgen for more informations
# Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
# This program is published under MIT license.
-# frozen_string_literal: true
-
module PacketGen
module Header
# @abstract Base class for all header types.
# Subclasses may define magic methods:
# * +#calc_checksum+, which computes header checksum,
@@ -191,11 +191,10 @@
Binding.new(key, value)
end
end
end
-
# Helper method to calculate length of +hdr+ and set its +length+ field.
# To be used by +#calc_length+ in Base subclasses.
# @param [Base] hdr
# @param [Boolean] header_in_size if +true+ header is included in length,
# if +false+, only +body+ is taken into account
@@ -218,10 +217,9 @@
# @see Types::Fields#initialize
def initialize(options={})
@packet = options.delete(:packet) if options.key?(:packet)
super
end
-
# @api private
# Get +header+ id in {Packet#headers} array
# @param [Header] header
# @return [Integer]