#!usr/bin/env ruby

filename 		= ARGV[0]

src_ip_hash		= {}
dst_ip_hash		= {}
src_port_hash	= {}
dst_port_hash	= {}

File.foreach{filename}	do |line|
	ary			= src.split('.')
	p ary
	p ary[0..3]
	src_ip_hash		= ary[0..3].join('.')
	p src_ip_hash
	p ary[4]
	src_port_hash 	= ary[4].to_i
	p src_port_hash
	
	ary			= dst.split('.')
	p ary
	p ary[0..3]
	dst_ip_hash		= ary[0..3].join('.')
	p dst_ip
	p ary[4]
	p ary[4].chop
	dst_port_hash 	= ary[4].chop.to_i
	p dst_port_hash
end	

#送信元IPアドレス

ARGV.each do |num|
	num = num.to_i
	if src_ip_hash[num].nil?
		src_ip_hash[num] = 0
	end
	src_ip_hash[num] = src_ip_hash[num] + 1
end

#p src_ip_hash

src_ip.keys.sort.each do |ip|
	puts "#{ip} is inputed #{src_ip_hash[ip]} times." 
end
#宛先IPアドレス
#dst_ip.keys.sort.each do |ip|

#end

#送信元ポート番号
#src_port.keys.sort.each do |port|

#end

#宛先ポート番号
#dst_port.keys.sort.each do |port|

#end


