Sha256: 42a94f9ff3fcea23c7b38f242512dcc1fdb45e12a2ec037e3e84d62e325d611e
Contents?: true
Size: 1.07 KB
Versions: 17
Compression:
Stored size: 1.07 KB
Contents
# http://www.mudynamics.com # http://labs.mudynamics.com # http://www.pcapr.net module Mu class Pcap class IP < Packet IPPROTO_TCP = 6 IPPROTO_UDP = 17 IPPROTO_HOPOPTS = 0 IPPROTO_ROUTING = 43 IPPROTO_FRAGMENT = 44 IPPROTO_AH = 51 IPPROTO_NONE = 59 IPPROTO_DSTOPTS = 60 IPPROTO_SCTP = 132 attr_accessor :src, :dst def initialize src=nil, dst=nil super() @src = src @dst = dst end def v4? return false end def v6? return false end def proto raise NotImplementedError end def pseudo_header payload_length raise NotImplementedError end def == other return super && self.src == other.src && self.dst == other.dst end def self.checksum bytes if bytes.size & 1 == 1 bytes = bytes + "\0" end sum = 0 bytes.unpack("n*").each {|n| sum += n } sum = (sum & 0xffff) + (sum >> 16 & 0xffff) ~sum & 0xffff end end end end
Version data entries
17 entries across 17 versions & 2 rubygems