undns 0.4.0d → 0.4.0f
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/bin/update_origins_dat +183 -0
- data/ext/undns/conventions.c +800 -723
- data/ext/undns/conventions.h +30 -38
- data/ext/undns/conventlex.c +45 -58
- data/ext/undns/earth.c +20 -1
- data/ext/undns/extconf.rb +3 -1
- data/ext/undns/hashtable.c +6 -2
- data/ext/undns/originAS.c +6 -4
- data/ext/undns/originAS.h +3 -0
- data/ext/undns/progress.c +3 -3
- data/ext/undns/ruleset.c +9 -3
- data/ext/undns/ruleset.h +3 -1
- data/ext/undns/swig-undns_wrap-rb.c +140 -103
- data/lib/undns.rb +14 -1
- data/lib/undns/LocationTable +2804 -0
- data/lib/undns/keys/Makefile +90 -91
- data/lib/undns/keys/Makefile.am +2 -2
- data/lib/undns/keys/Makefile.in +29 -30
- data/lib/undns/origins.dat +517715 -0
- data/test/test_undns.rb +80 -0
- metadata +20 -13
data/test/test_undns.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
|
2
|
+
require 'test/unit'
|
3
|
+
require 'undns'
|
4
|
+
|
5
|
+
class UndnsTest < Test::Unit::TestCase
|
6
|
+
class << self
|
7
|
+
def startup
|
8
|
+
puts "startup does not seem to work."
|
9
|
+
puts "if you're seeing this message, test/unit works differently for you"
|
10
|
+
puts "and so this test may look funny through loading the ruleset twice."
|
11
|
+
# Undns.want_conventions_debug = false
|
12
|
+
# specifying a file name overrides the search path, so not clearly useful.
|
13
|
+
# Undns.load_ruleset # ("Conventions.dat")
|
14
|
+
puts "startup complete"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# def setup
|
18
|
+
# unless @setup_complete
|
19
|
+
# puts "setting up once"
|
20
|
+
# # Undns.want_conventions_debug = 1
|
21
|
+
# # Undns.want_debug = 1
|
22
|
+
# # Undns.load_ruleset
|
23
|
+
# end
|
24
|
+
# @s = true
|
25
|
+
# end
|
26
|
+
def test_meth
|
27
|
+
# puts Undns.methods - Object.methods
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_paths
|
31
|
+
# intended path given install location.
|
32
|
+
puts Undns::Path::origins_dat
|
33
|
+
puts Undns::Path::conventions_dat
|
34
|
+
|
35
|
+
# found paths, which may be nearer (. or ..) following the path.
|
36
|
+
r = Undns.get_loc(27, "www.cs.umd.edu")
|
37
|
+
puts Undns.Ruleset_In_Use
|
38
|
+
r = Undns.origin_for_address_str('128.8.126.104')
|
39
|
+
puts Undns.Origins_In_Use
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_basic
|
43
|
+
r = Undns.get_loc(27, "www.cs.umd.edu")
|
44
|
+
assert r
|
45
|
+
assert r == "CollegePark, MD"
|
46
|
+
r = Undns.get_loc(27, "www.cs.umd.edu")
|
47
|
+
assert r
|
48
|
+
assert r == "CollegePark, MD"
|
49
|
+
end
|
50
|
+
def test_quiet
|
51
|
+
r = Undns.get_loc(27, "www.cs.umd.edu")
|
52
|
+
assert r
|
53
|
+
assert r =="CollegePark, MD"
|
54
|
+
r = Undns.get_asn_bydns("www.cs.umd.edu")
|
55
|
+
assert r == 27
|
56
|
+
r = Undns.origin_for_address_str('128.8.126.104')
|
57
|
+
assert r == 27
|
58
|
+
end
|
59
|
+
def test_origin
|
60
|
+
r = Undns.origin_prefix_for_address(IPAddr.new('128.8.126.104'))
|
61
|
+
assert r[0]
|
62
|
+
assert r[1] == 27
|
63
|
+
puts r[2].class
|
64
|
+
assert r[2].to_s == '128.8.0.0'
|
65
|
+
assert r[3] == 16
|
66
|
+
end
|
67
|
+
def test_dump
|
68
|
+
Undns.dump_parsed_conventions_to_file('/tmp/undns_dumped_test_conventions')
|
69
|
+
# File.unlink('/tmp/undns_dumped_test_conventions')
|
70
|
+
end
|
71
|
+
def test_earth
|
72
|
+
test(?e, Undns::Path::location_table) or raise "location table #{Undns::Path::location_table} doesn't exist"
|
73
|
+
Undns.init_earth(Undns::Path::location_table)
|
74
|
+
Undns.min_latency_seconds("SanDiego, CA", "CollegePark, MD")
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Local Variables:
|
79
|
+
# compile-command: "rake test"
|
80
|
+
# End:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: undns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.0f
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neil Spring
|
@@ -12,15 +12,20 @@ date: 2014-06-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
13
13
|
description: Undns parses router host names to extract geographic location and other
|
14
14
|
apparent information within the name. It was initially developed as part of the
|
15
|
-
Rocketfuel project at the University of Washington
|
15
|
+
Rocketfuel project at the University of Washington and is maintained at the University
|
16
|
+
of Maryland.
|
16
17
|
email: nspring@cs.umd.edu
|
17
18
|
executables:
|
18
19
|
- undns_decode
|
20
|
+
- update_origins_dat
|
19
21
|
extensions:
|
20
22
|
- ext/undns/extconf.rb
|
21
23
|
extra_rdoc_files: []
|
22
24
|
files:
|
25
|
+
- lib/undns.rb
|
23
26
|
- bin/undns_decode
|
27
|
+
- lib/undns/Conventions.dat
|
28
|
+
- bin/update_origins_dat
|
24
29
|
- ext/undns/buffer.c
|
25
30
|
- ext/undns/buffer.h
|
26
31
|
- ext/undns/config.h
|
@@ -30,7 +35,6 @@ files:
|
|
30
35
|
- ext/undns/earth.c
|
31
36
|
- ext/undns/earth.h
|
32
37
|
- ext/undns/exception.h
|
33
|
-
- ext/undns/extconf.rb
|
34
38
|
- ext/undns/filetest.c
|
35
39
|
- ext/undns/filetest.h
|
36
40
|
- ext/undns/hashes.c
|
@@ -54,8 +58,7 @@ files:
|
|
54
58
|
- ext/undns/typed_queue.h
|
55
59
|
- ext/undns/xmalloc.c
|
56
60
|
- ext/undns/xmalloc.h
|
57
|
-
-
|
58
|
-
- lib/undns/Conventions.dat
|
61
|
+
- ext/undns/extconf.rb
|
59
62
|
- lib/undns/keys/10910.keys
|
60
63
|
- lib/undns/keys/1221-media.keys
|
61
64
|
- lib/undns/keys/1221.keys
|
@@ -72,9 +75,6 @@ files:
|
|
72
75
|
- lib/undns/keys/5650.keys
|
73
76
|
- lib/undns/keys/6461.keys
|
74
77
|
- lib/undns/keys/7018.keys
|
75
|
-
- lib/undns/keys/Makefile
|
76
|
-
- lib/undns/keys/Makefile.am
|
77
|
-
- lib/undns/keys/Makefile.in
|
78
78
|
- lib/undns/keys/aarnet
|
79
79
|
- lib/undns/keys/aarnet.23654
|
80
80
|
- lib/undns/keys/abilene.11537
|
@@ -234,6 +234,9 @@ files:
|
|
234
234
|
- lib/undns/keys/lincon.6325
|
235
235
|
- lib/undns/keys/localnet.15270
|
236
236
|
- lib/undns/keys/magpi.10466
|
237
|
+
- lib/undns/keys/Makefile
|
238
|
+
- lib/undns/keys/Makefile.am
|
239
|
+
- lib/undns/keys/Makefile.in
|
237
240
|
- lib/undns/keys/marcatel.19332
|
238
241
|
- lib/undns/keys/matav.5483
|
239
242
|
- lib/undns/keys/maxgigapop.10886
|
@@ -382,30 +385,34 @@ files:
|
|
382
385
|
- lib/undns/keys/wiscnet.2381
|
383
386
|
- lib/undns/keys/xo.2828
|
384
387
|
- lib/undns/keys/yipes.6517
|
388
|
+
- test/test_undns.rb
|
389
|
+
- lib/undns/origins.dat
|
390
|
+
- lib/undns/LocationTable
|
385
391
|
homepage: http://www.scriptroute.org/
|
386
392
|
licenses:
|
387
393
|
- GPL
|
388
394
|
metadata: {}
|
389
|
-
post_install_message:
|
395
|
+
post_install_message: "Now run: \n% update_origins_dat\n% undns_decode [router name]"
|
390
396
|
rdoc_options: []
|
391
397
|
require_paths:
|
392
398
|
- lib
|
393
399
|
- ext
|
394
400
|
required_ruby_version: !ruby/object:Gem::Requirement
|
395
401
|
requirements:
|
396
|
-
- -
|
402
|
+
- - '>='
|
397
403
|
- !ruby/object:Gem::Version
|
398
404
|
version: '0'
|
399
405
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
400
406
|
requirements:
|
401
|
-
- -
|
407
|
+
- - '>'
|
402
408
|
- !ruby/object:Gem::Version
|
403
409
|
version: 1.3.1
|
404
410
|
requirements: []
|
405
411
|
rubyforge_project:
|
406
|
-
rubygems_version: 2.
|
412
|
+
rubygems_version: 2.0.14
|
407
413
|
signing_key:
|
408
414
|
specification_version: 4
|
409
415
|
summary: Undns client in ruby
|
410
|
-
test_files:
|
416
|
+
test_files:
|
417
|
+
- test/test_undns.rb
|
411
418
|
has_rdoc:
|