pcaprub 0.13.1 → 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 +4 -4
- data/Gemfile +1 -1
- data/README.rdoc +0 -1
- data/Rakefile +0 -1
- data/ext/pcaprub_c/extconf.rb +5 -5
- data/ext/pcaprub_c/pcaprub.c +0 -8
- data/lib/pcaprub/version.rb +1 -1
- data/test/test_pcaprub_unit.rb +7 -3
- metadata +3 -4
- data/.travis.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
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
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]
|
data/Rakefile
CHANGED
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,8 +17,8 @@ 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
|
-
|
21
|
-
if /x64-mingw32/ =~ RUBY_PLATFORM
|
20
|
+
|
21
|
+
if /x64-mingw32/ =~ RUBY_PLATFORM || /x64-mingw-ucrt/ =~ RUBY_PLATFORM
|
22
22
|
pcap_libdir += "/x64"
|
23
23
|
end
|
24
24
|
|
@@ -26,7 +26,7 @@ if /i386-mingw32/ =~ RUBY_PLATFORM || /x64-mingw32/ =~ RUBY_PLATFORM
|
|
26
26
|
$CFLAGS += " -g" if with_config("debug")
|
27
27
|
$LDFLAGS = "-L#{pcap_libdir}"
|
28
28
|
$LDFLAGS += " -g" if with_config("debug")
|
29
|
-
|
29
|
+
|
30
30
|
have_header("ruby/thread.h")
|
31
31
|
have_func("rb_thread_blocking_region") # Pre ruby 2.2
|
32
32
|
have_func("rb_thread_call_without_gvl") # Post ruby 2.2
|
@@ -85,7 +85,7 @@ else
|
|
85
85
|
|
86
86
|
have_library("pcap", "pcap_open_live", ["pcap.h"])
|
87
87
|
have_library("pcap", "pcap_setnonblock", ["pcap.h"])
|
88
|
-
|
88
|
+
|
89
89
|
$CFLAGS = "-g" if with_config("debug")
|
90
90
|
$LDFLAGS = "-g" if with_config("debug")
|
91
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_pcaprub_unit.rb
CHANGED
@@ -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
|
@@ -159,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
158
|
version: '0'
|
160
159
|
requirements:
|
161
160
|
- libpcap
|
162
|
-
rubygems_version: 3.
|
161
|
+
rubygems_version: 3.4.19
|
163
162
|
signing_key:
|
164
163
|
specification_version: 4
|
165
164
|
summary: libpcap bindings for ruby
|
data/.travis.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
before_install:
|
3
|
-
- sudo apt-get install libpcap-dev -qq
|
4
|
-
before_script:
|
5
|
-
- travis_retry gem update bundler
|
6
|
-
rvm:
|
7
|
-
- 2.5
|
8
|
-
- 2.6
|
9
|
-
- 2.7
|
10
|
-
- 3.0
|
11
|
-
- ruby-head
|
12
|
-
env:
|
13
|
-
rvmsudo_secure_path: 1
|
14
|
-
cache: bundler
|
15
|
-
matrix:
|
16
|
-
allow_failures:
|
17
|
-
- rvm: ruby-head
|
18
|
-
fast_finish: true
|
19
|
-
script:
|
20
|
-
- rvmsudo bundle exec rake
|