Exception: PacketGen::BindingError

Inherits:
Error
  • Object
show all
Defined in:
lib/packetgen.rb

Overview

No known binding

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prev_hdr, hdr) ⇒ BindingError

Returns a new instance of BindingError.



35
36
37
38
39
# File 'lib/packetgen.rb', line 35

def initialize(prev_hdr, hdr)
  super()
  @prev_hdr = prev_hdr
  @hdr = hdr
end

Instance Attribute Details

#hdrHeaderable (readonly)

Returns:



33
34
35
# File 'lib/packetgen.rb', line 33

def hdr
  @hdr
end

#prev_hdrHeaderable (readonly)

Returns:



31
32
33
# File 'lib/packetgen.rb', line 31

def prev_hdr
  @prev_hdr
end

Instance Method Details

#messageObject



41
42
43
44
45
46
# File 'lib/packetgen.rb', line 41

def message
  "#{prev_hdr.class} knowns no layer association with #{hdr.protocol_name}. " \
    "Try #{prev_hdr.class}.bind_layer(#{hdr.class}, " \
    "#{prev_hdr.method_name}_proto_field: " \
    "<value_for_#{hdr.method_name}>)"
end