pcap_tools 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,19 +98,22 @@ module PcapTools
98
98
  accepted_protocols += options[:accepted_protocols] if options[:accepted_protocols]
99
99
  profile_name = "pcap_tools"
100
100
  profile_dir = "#{ENV['HOME']}/.wireshark/profiles/#{profile_name}"
101
+ status = POpen4::popen4("#{tshark_executable} -v") do |stdout, stderr, stdin, pid|
102
+ end
103
+ raise "#{tshark_executable} not found" unless status
101
104
  unless File.exist? "#{profile_dir}/disabled_protos"
102
105
  status = POpen4::popen4("#{tshark_executable} -G protocols") do |stdout, stderr, stdin, pid|
103
106
  list = stdout.read.split("\n").map { |x| x.split(" ").last }.reject { |x| accepted_protocols.include? x }
104
107
  FileUtils.mkdir_p profile_dir
105
108
  File.open("#{profile_dir}/disabled_protos", "w") { |io| io.write(list.join("\n") + "\n") }
106
109
  end
107
- raise "Tshark execution error when listing protocols" unless status.exitstatus == 0
110
+ raise "#{tshark_executable} execution error when listing protocols" unless status.exitstatus == 0
108
111
  end
109
112
  status = POpen4::popen4("#{tshark_executable} -n -C #{profile_name} -T pdml -r #{f}") do |stdout, stderr, stdin, pid|
110
113
  Ox.sax_parse(MyParser.new(block), stdout)
111
114
  $stderr.puts stderr.read
112
115
  end
113
- raise "Tshark execution error with file #{f}" unless status.exitstatus == 0
116
+ raise "#{tshark_executable} execution error with file #{f}" unless status.exitstatus == 0
114
117
  end
115
118
 
116
119
  end
data/pcap_tools.gemspec CHANGED
@@ -2,7 +2,7 @@ require 'rake'
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'pcap_tools'
5
- s.version = '0.0.7'
5
+ s.version = '0.0.8'
6
6
  s.authors = ['Bertrand Paquet']
7
7
  s.email = 'bertrand.paquet@gmail.com'
8
8
  s.summary = 'Tools for extracting data from pcap files'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pcap_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-06 00:00:00.000000000 Z
12
+ date: 2014-11-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: popen4