Class: PacketGen::Header::IP

Inherits:
Object
  • Object
show all
Defined in:
lib/pcap2json/packetgen_extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_hObject



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/pcap2json/packetgen_extensions.rb', line 102

def to_h
  { 
    "u8" =>  self.u8, 
    "version" =>  self.version, 
    "ihl" =>  self.ihl,
    "tos" =>  self.tos,
    "length" =>  self.length,
    "frag" =>  self.frag,
    # flags =>  self.flags,
    # frag_offset =>  self.frag_offset,
    "ttl" =>  self.ttl,
    "protocol" =>  self.protocol,
    "checksum" =>  self.checksum,
    "src" =>  self.src,
    "dst" =>  self.dst
  } 
end