rping 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README +10 -3
  2. data/lib/rping.rb +1 -1
  3. metadata +3 -3
data/README CHANGED
@@ -4,21 +4,23 @@
4
4
 
5
5
  rping is a ruby implementation of ping.
6
6
 
7
+ * rping use 'raw socket'.
8
+ * root authority is required.
9
+
7
10
  == Source Code
8
11
 
9
12
  https://bitbucket.org/winebarrel/rping
10
13
 
11
-
12
14
  == Example
13
15
  === Command
14
16
 
15
- shell> rping
17
+ root> rping
16
18
  Usage: rping [options]
17
19
  -c COUNT
18
20
  -i INTERVAL
19
21
  -w TIMEOUT
20
22
  -d DESTINATION
21
- shell> rping -c 3 -d localhost
23
+ root> rping -c 3 -d localhost
22
24
  PING localhost
23
25
  36 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=128 time=1.0 ms
24
26
  36 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=128 time=0.0 ms
@@ -36,3 +38,8 @@ https://bitbucket.org/winebarrel/rping
36
38
  #=> {:time=>0.0, :src=>"127.0.0.1", :dest=>"127.0.0.1", :ttl=>128, :size=>36, :seq=>1}
37
39
  end
38
40
 
41
+ == Reference Documents
42
+
43
+ * http://www.notwork.org/ipr/article/serial08.html
44
+ * http://www.faqs.org/rfcs/rfc792.html
45
+
@@ -8,7 +8,7 @@ class RPing
8
8
  @count = options.fetch(:count, 1)
9
9
  @interval = options.fetch(:interval, 1)
10
10
  @timeout = options.fetch(:timeout, 4)
11
- @icmp_id = Process.pid & 0xffff
11
+ @icmp_id = (self.object_id ^ Process.pid) & 0xffff
12
12
  @seq_num = 1
13
13
  end
14
14
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rping
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - winebarrel