def add_header(header, previous_header: nil, parsing: false)
      prev_header = previous_header || last_header
      if prev_header
        bindings = prev_header.class.known_headers[header.class]
        bindings = prev_header.class.known_headers[header.class.superclass] if bindings.nil?
        if bindings.nil?
          msg = "#{prev_header.class} knowns no layer association with #{header.protocol_name}. ".dup
          msg << "Try #{prev_header.class}.bind_layer(#{header.class}, "
          msg << "#{prev_header.method_name}_proto_field: "
          msg << "value_for_#{header.method_name})"
          raise ArgumentError, msg
        end

        bindings.set(prev_header) if !bindings.empty? && !parsing
        prev_header[:body] = header
      end
      header.packet = self
      headers << header unless previous_header

      return if respond_to? header.method_name

      add_magic_header_method header
    end
def add_header(header, previous_header: nil, parsing: false)
      prev_header = previous_header || last_header
      if prev_header
        bindings = prev_header.class.known_headers[header.class]
        bindings = prev_header.class.known_headers[header.class.superclass] if bindings.nil?
        if bindings.nil?
          msg = "#{prev_header.class} knowns no layer association with #{header.protocol_name}. ".dup
          msg << "Try #{prev_header.class}.bind_layer(#{header.class}, "
          msg << "#{prev_header.method_name}_proto_field: "
          msg << "value_for_#{header.method_name})"
          raise ArgumentError, msg
        end

        bindings.set(prev_header) if !bindings.empty? && !parsing
        prev_header[:body] = header
      end
      header.packet = self
      headers << header unless previous_header

      return if respond_to? header.method_name

      add_magic_header_method header
    end
Add a header to packet
 @param [Header::Base] header
 @param [Header::Base] previous_header
 @param [Boolean] parsing
 @return [void]