Sha256: 3e83515cc570f061c14c57d06ef06a33d54c5dc80faae33dd55f30c2126dc875
Contents?: true
Size: 486 Bytes
Versions: 6
Compression:
Stored size: 486 Bytes
Contents
#!/usr/bin/env ruby require 'rubygems' require 'pcaplet' include Pcap class Time # tcpdump style format def to_s sprintf "%0.2d:%0.2d:%0.2d.%0.6d", hour, min, sec, tv_usec end end pcaplet = Pcaplet.new pcaplet.each_packet { |pkt| print "#{pkt.time} #{pkt}" if pkt.tcp? print " (#{pkt.tcp_data_len})" print " ack #{pkt.tcp_ack}" if pkt.tcp_ack? print " win #{pkt.tcp_win}" end if pkt.ip? print " (DF)" if pkt.ip_df? end print "\n" } pcaplet.close
Version data entries
6 entries across 6 versions & 3 rubygems