pcaprub 0.13.0 → 0.13.2
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.
- checksums.yaml +5 -5
- data/Gemfile +3 -10
- data/README.rdoc +1 -4
- data/Rakefile +1 -2
- data/ext/pcaprub_c/extconf.rb +12 -4
- data/ext/pcaprub_c/pcaprub.c +0 -8
- data/lib/pcaprub/version.rb +1 -1
- data/test/test_helper.rb +2 -6
- data/test/test_pcaprub_unit.rb +8 -4
- metadata +4 -6
- data/.travis.yml +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 535c4c591e5797f6a4963cf133b0382a078456801918bca13e28afe0b72436b2
|
4
|
+
data.tar.gz: cd18712ab62ecbc51ea710cecedbcf5099922555e6fee5f1e0a3b86a9668264d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58380aee87fe885d6651f4b69934e167166237413dc9790634bd95cd3db13709a7ccb4d3cd89c9db64abc3a04e8f142e29172b7add6d62e82891870d336634e4
|
7
|
+
data.tar.gz: 505f6970e65157340d7bff1f0454ac46fd01dedd64fd00728016713b01e1bafa50cfbba0008324fbbdd65ecf7bc3ed3890f92664865bacf143f51b4f9bc04f19
|
data/Gemfile
CHANGED
@@ -4,15 +4,8 @@ group :development, :test do
|
|
4
4
|
# Prevent occasions where minitest is not bundled in packaged versions of ruby (see #3826)
|
5
5
|
gem 'minitest', '~> 4.7.0'
|
6
6
|
gem 'shoulda-context', '~> 1.1.6'
|
7
|
-
|
8
|
-
|
9
|
-
platforms :ruby_22, :ruby_23 do
|
10
|
-
gem 'test-unit'
|
11
|
-
end
|
12
|
-
|
13
|
-
platforms :ruby_20, :ruby_21, :ruby_22, :ruby_23 do
|
14
|
-
gem 'coveralls', :require => false
|
15
|
-
end
|
7
|
+
gem 'test-unit'
|
8
|
+
gem 'coveralls', :require => false
|
16
9
|
end
|
17
10
|
|
18
11
|
gem 'rake-compiler', '>= 0.6.0'
|
@@ -20,5 +13,5 @@ gem 'rubygems-tasks'
|
|
20
13
|
|
21
14
|
if Bundler.current_ruby.mri? || Bundler.current_ruby.mingw? || Bundler.current_ruby.x64_mingw?
|
22
15
|
gem 'rake', '>= 0.9.2'
|
23
|
-
gem 'git', '~> 1.
|
16
|
+
gem 'git', '~> 1.13.0'
|
24
17
|
end
|
data/README.rdoc
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
{<img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/pcaprub/pcaprub">}[https://gitter.im/pcaprub/pcaprub?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge]
|
4
4
|
|
5
|
-
{<img src="https://travis-ci.org/pcaprub/pcaprub.png" alt="Build Status" />}[https://travis-ci.org/pcaprub/pcaprub]
|
6
5
|
{<img src="https://ci.appveyor.com/api/projects/status/7g3x62y9rgy3twds?svg=true" alt="Windows Builds" />}[https://ci.appveyor.com/project/shadowbq/pcaprub]
|
7
6
|
{<img src="https://codeclimate.com/github/pcaprub/pcaprub.png" />}[https://codeclimate.com/github/pcaprub/pcaprub]
|
8
7
|
{<img src="https://badge.fury.io/rb/pcaprub.png" alt="Gem Version" />}[http://badge.fury.io/rb/pcaprub]
|
@@ -21,9 +20,7 @@ For packet processing capability look at ruby gems PCAPFU, PCAPLET, etc..
|
|
21
20
|
== Requirements
|
22
21
|
|
23
22
|
MRI POSIX Ruby (Native compilation) [Travis-CI Tested]
|
24
|
-
Ruby
|
25
|
-
Ruby 1.9.3
|
26
|
-
~> Ruby 2.x
|
23
|
+
~> Ruby 2.4
|
27
24
|
|
28
25
|
libpcap - http://www.tcpdump.org
|
29
26
|
|
data/Rakefile
CHANGED
@@ -18,11 +18,10 @@ ENV['LANG'] = "en_US.UTF-8"
|
|
18
18
|
spec.homepage = "https://github.com/pcaprub/pcaprub"
|
19
19
|
spec.requirements = "libpcap"
|
20
20
|
spec.license = "LGPL-2.1"
|
21
|
-
spec.required_ruby_version = '
|
21
|
+
spec.required_ruby_version = '>= 2.0'
|
22
22
|
|
23
23
|
spec.files = [
|
24
24
|
".document",
|
25
|
-
".travis.yml",
|
26
25
|
"FAQ.rdoc",
|
27
26
|
"Gemfile",
|
28
27
|
"LICENSE",
|
data/ext/pcaprub_c/extconf.rb
CHANGED
@@ -4,7 +4,7 @@ extension_name = 'pcaprub_c'
|
|
4
4
|
puts "\n[*] Running checks for #{extension_name} code..."
|
5
5
|
puts("platform is #{RUBY_PLATFORM}")
|
6
6
|
|
7
|
-
if /i386-mingw32/ =~ RUBY_PLATFORM || /x64-mingw32/ =~ RUBY_PLATFORM
|
7
|
+
if /i386-mingw32/ =~ RUBY_PLATFORM || /x64-mingw32/ =~ RUBY_PLATFORM || /x64-mingw-ucrt/ =~ RUBY_PLATFORM
|
8
8
|
unless have_library("ws2_32" ) and
|
9
9
|
have_library("iphlpapi") and
|
10
10
|
have_header("windows.h") and
|
@@ -17,12 +17,16 @@ if /i386-mingw32/ =~ RUBY_PLATFORM || /x64-mingw32/ =~ RUBY_PLATFORM
|
|
17
17
|
pcap_dir = with_config("pcap-dir", "C:/WpdPack")
|
18
18
|
pcap_includedir = with_config("pcap-includedir", pcap_dir + "/include")
|
19
19
|
pcap_libdir = with_config("pcap-libdir", pcap_dir + "/lib")
|
20
|
-
|
20
|
+
|
21
|
+
if /x64-mingw32/ =~ RUBY_PLATFORM || /x64-mingw-ucrt/ =~ RUBY_PLATFORM
|
22
|
+
pcap_libdir += "/x64"
|
23
|
+
end
|
24
|
+
|
21
25
|
$CFLAGS = "-DWIN32 -I#{pcap_includedir}"
|
22
26
|
$CFLAGS += " -g" if with_config("debug")
|
23
27
|
$LDFLAGS = "-L#{pcap_libdir}"
|
24
28
|
$LDFLAGS += " -g" if with_config("debug")
|
25
|
-
|
29
|
+
|
26
30
|
have_header("ruby/thread.h")
|
27
31
|
have_func("rb_thread_blocking_region") # Pre ruby 2.2
|
28
32
|
have_func("rb_thread_call_without_gvl") # Post ruby 2.2
|
@@ -33,6 +37,10 @@ elsif /i386-mswin32/ =~ RUBY_PLATFORM || /x64-mswin32/ =~ RUBY_PLATFORM
|
|
33
37
|
pcap_includedir = with_config("pcap-includedir", pcap_dir + "\\include")
|
34
38
|
pcap_libdir = with_config("pcap-libdir", pcap_dir + "\\lib")
|
35
39
|
|
40
|
+
if /x64-mingw32/ =~ RUBY_PLATFORM
|
41
|
+
pcap_libdir += "\\x64"
|
42
|
+
end
|
43
|
+
|
36
44
|
$CFLAGS = "-DWIN32 -I#{pcap_includedir}"
|
37
45
|
$CFLAGS += " -g" if with_config("debug")
|
38
46
|
$LDFLAGS = "/link /LIBPATH:#{pcap_libdir}"
|
@@ -77,7 +85,7 @@ else
|
|
77
85
|
|
78
86
|
have_library("pcap", "pcap_open_live", ["pcap.h"])
|
79
87
|
have_library("pcap", "pcap_setnonblock", ["pcap.h"])
|
80
|
-
|
88
|
+
|
81
89
|
$CFLAGS = "-g" if with_config("debug")
|
82
90
|
$LDFLAGS = "-g" if with_config("debug")
|
83
91
|
end
|
data/ext/pcaprub_c/pcaprub.c
CHANGED
@@ -81,7 +81,6 @@ rbpcap_s_lookupdev(VALUE self)
|
|
81
81
|
char *dev = NULL;
|
82
82
|
char eb[PCAP_ERRBUF_SIZE];
|
83
83
|
VALUE ret_dev; /* device string to return */
|
84
|
-
#if defined(WIN32) /* pcap_lookupdev is broken on windows */
|
85
84
|
pcap_if_t *alldevs;
|
86
85
|
pcap_if_t *d;
|
87
86
|
|
@@ -104,13 +103,6 @@ rbpcap_s_lookupdev(VALUE self)
|
|
104
103
|
ret_dev = rb_str_new2(dev);
|
105
104
|
/* We don't need any more the device list. Free it */
|
106
105
|
pcap_freealldevs(alldevs);
|
107
|
-
#else
|
108
|
-
dev = pcap_lookupdev(eb);
|
109
|
-
if (dev == NULL) {
|
110
|
-
rb_raise(eBindingError, "%s", eb);
|
111
|
-
}
|
112
|
-
ret_dev = rb_str_new2(dev);
|
113
|
-
#endif
|
114
106
|
return ret_dev;
|
115
107
|
}
|
116
108
|
|
data/lib/pcaprub/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
data/test/test_pcaprub_unit.rb
CHANGED
@@ -71,7 +71,7 @@ class Pcap::UnitTest < Test::Unit::TestCase
|
|
71
71
|
d = Pcap.lookupdev
|
72
72
|
o = Pcap.open_live(d, 65535, true, 1)
|
73
73
|
r = o.datalink
|
74
|
-
assert_equal(
|
74
|
+
assert_equal(Integer, r.class)
|
75
75
|
end
|
76
76
|
|
77
77
|
def test_pcap_snapshot
|
@@ -122,7 +122,7 @@ class Pcap::UnitTest < Test::Unit::TestCase
|
|
122
122
|
|
123
123
|
def test_set_datalink
|
124
124
|
d = Pcap.lookupdev
|
125
|
-
o = Pcap.open_live(d, 65535, true,
|
125
|
+
o = Pcap.open_live(d, 65535, true, 1)
|
126
126
|
dls = o.listdatalinks
|
127
127
|
begin
|
128
128
|
assert_equal(o,o.setdatalink(dls.values.first))
|
@@ -133,7 +133,7 @@ class Pcap::UnitTest < Test::Unit::TestCase
|
|
133
133
|
end
|
134
134
|
|
135
135
|
def test_monitor
|
136
|
-
return if RUBY_PLATFORM =~ /mingw
|
136
|
+
return if RUBY_PLATFORM =~ /mingw/
|
137
137
|
d = Pcap.lookupdev
|
138
138
|
o = Pcap.create(d)
|
139
139
|
assert_equal(o, o.setmonitor(true))
|
@@ -164,7 +164,11 @@ class Pcap::UnitTest < Test::Unit::TestCase
|
|
164
164
|
|
165
165
|
def test_lib_version
|
166
166
|
v = Pcap.lib_version.split
|
167
|
-
|
167
|
+
if RUBY_PLATFORM =~ /mingw/
|
168
|
+
assert_equal "WinPcap", v[0]
|
169
|
+
else
|
170
|
+
assert_equal "libpcap", v[0]
|
171
|
+
end
|
168
172
|
assert_equal "version", v[1]
|
169
173
|
assert_equal 3, v[2].split('.').size
|
170
174
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pcaprub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shadowbq
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2024-04-22 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -120,7 +120,6 @@ extra_rdoc_files:
|
|
120
120
|
- ext/pcaprub_c/pcaprub.c
|
121
121
|
files:
|
122
122
|
- ".document"
|
123
|
-
- ".travis.yml"
|
124
123
|
- FAQ.rdoc
|
125
124
|
- Gemfile
|
126
125
|
- LICENSE
|
@@ -149,7 +148,7 @@ require_paths:
|
|
149
148
|
- lib
|
150
149
|
required_ruby_version: !ruby/object:Gem::Requirement
|
151
150
|
requirements:
|
152
|
-
- - "
|
151
|
+
- - ">="
|
153
152
|
- !ruby/object:Gem::Version
|
154
153
|
version: '2.0'
|
155
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -159,8 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
158
|
version: '0'
|
160
159
|
requirements:
|
161
160
|
- libpcap
|
162
|
-
|
163
|
-
rubygems_version: 2.5.2.1
|
161
|
+
rubygems_version: 3.4.19
|
164
162
|
signing_key:
|
165
163
|
specification_version: 4
|
166
164
|
summary: libpcap bindings for ruby
|
data/.travis.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
before_install:
|
3
|
-
- sudo apt-get install libpcap-dev -qq
|
4
|
-
- gem update bundler
|
5
|
-
before_script:
|
6
|
-
- travis_retry gem update bundler
|
7
|
-
rvm:
|
8
|
-
- 2.0.0
|
9
|
-
- 2.1
|
10
|
-
- 2.2
|
11
|
-
- 2.3.0
|
12
|
-
- ruby-head
|
13
|
-
matrix:
|
14
|
-
allow_failures:
|
15
|
-
- rvm: ruby-head
|
16
|
-
fast_finish: true
|
17
|
-
script:
|
18
|
-
- rvmsudo bundle exec rake
|