ruby-radix 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/History.txt +8 -0
- data/Manifest.txt +15 -0
- data/PostInstall.txt +3 -0
- data/README.rdoc +160 -0
- data/Rakefile +27 -0
- data/ext/extconf.rb +5 -0
- data/ext/radix.c +859 -0
- data/ext/radixlib.c +677 -0
- data/ext/radixlib.h +161 -0
- data/lib/ruby-radix.rb +6 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/test/test_helper.rb +3 -0
- data/test/test_ruby-radix.rb +127 -0
- metadata +129 -0
data/.gemtest
ADDED
File without changes
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
PostInstall.txt
|
4
|
+
README.rdoc
|
5
|
+
Rakefile
|
6
|
+
lib/ruby-radix.rb
|
7
|
+
script/console
|
8
|
+
script/destroy
|
9
|
+
script/generate
|
10
|
+
test/test_helper.rb
|
11
|
+
test/test_ruby-radix.rb
|
12
|
+
ext/radix.c
|
13
|
+
ext/radixlib.c
|
14
|
+
ext/radixlib.h
|
15
|
+
ext/extconf.rb
|
data/PostInstall.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
= ruby-radix
|
2
|
+
|
3
|
+
* http://github.com/iij/ruby-radix
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
ruby-radix is an implementation of a radix tree data structure for the storage
|
8
|
+
and retrieval of IPv4 and IPv6 network prefixes.
|
9
|
+
|
10
|
+
The radix tree is the data structure most commonly used for routing table
|
11
|
+
lookups. It efficiently stores network prefixes of varying lengths and
|
12
|
+
allows fast lookups of containing networks.
|
13
|
+
|
14
|
+
== FEATURES/PROBLEMS:
|
15
|
+
|
16
|
+
* FIX (list of features or problems)
|
17
|
+
|
18
|
+
== SYNOPSIS:
|
19
|
+
|
20
|
+
require 'radix'
|
21
|
+
r = Radix.new
|
22
|
+
node = r.add("192.168.0.0/24")
|
23
|
+
r.search_best("192.168.0.1/28")
|
24
|
+
r["192.168.0.2"].prefix
|
25
|
+
r["172.31.0.0/16"] = "Hello Message!"
|
26
|
+
r["172.31.0.1/32"].msg
|
27
|
+
|
28
|
+
== REQUIREMENTS:
|
29
|
+
|
30
|
+
* rubygems
|
31
|
+
|
32
|
+
== INSTALL:
|
33
|
+
|
34
|
+
* sudo gem install ruby-radix
|
35
|
+
|
36
|
+
== LICENSE:
|
37
|
+
|
38
|
+
The Ruby binding code is subject to this license:
|
39
|
+
|
40
|
+
/*-
|
41
|
+
* Copyright (c) 2012, Internet Initiative Japan Inc.
|
42
|
+
* All rights reserved.
|
43
|
+
*
|
44
|
+
* Redistribution and use in source and binary forms, with or without
|
45
|
+
* modification, are permitted provided that the following conditions
|
46
|
+
* are met:
|
47
|
+
* 1. Redistributions of source code must retain the above copyright
|
48
|
+
* notice, this list of conditions and the following disclaimer.
|
49
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
50
|
+
* notice, this list of conditions and the following disclaimer in the
|
51
|
+
* documentation and/or other materials provided with the distribution.
|
52
|
+
*
|
53
|
+
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
54
|
+
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
55
|
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
57
|
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
58
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
59
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
60
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
61
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
62
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
63
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
64
|
+
*/
|
65
|
+
|
66
|
+
|
67
|
+
This underlying radix tree code is derived from MRT(http://www.mrtd.net/)
|
68
|
+
and is subject to the following license:
|
69
|
+
|
70
|
+
/*
|
71
|
+
* Copyright (c) 1999-2000
|
72
|
+
*
|
73
|
+
* The Regents of the University of Michigan ("The Regents") and
|
74
|
+
* Merit Network, Inc. All rights reserved. Redistribution and use
|
75
|
+
* in source and binary forms, with or without modification, are
|
76
|
+
* permitted provided that the following conditions are met:
|
77
|
+
*
|
78
|
+
* 1. Redistributions of source code must retain the above
|
79
|
+
* copyright notice, this list of conditions and the
|
80
|
+
* following disclaimer.
|
81
|
+
*
|
82
|
+
* 2. Redistributions in binary form must reproduce the above
|
83
|
+
* copyright notice, this list of conditions and the
|
84
|
+
* following disclaimer in the documentation and/or other
|
85
|
+
* materials provided with the distribution.
|
86
|
+
*
|
87
|
+
* 3. All advertising materials mentioning features or use of
|
88
|
+
* this software must display the following acknowledgement:
|
89
|
+
*
|
90
|
+
* This product includes software developed by the University of
|
91
|
+
* Michigan, Merit Network, Inc., and their contributors.
|
92
|
+
*
|
93
|
+
* 4. Neither the name of the University, Merit Network, nor the
|
94
|
+
* names of their contributors may be used to endorse or
|
95
|
+
* promote products derived from this software without
|
96
|
+
* specific prior written permission.
|
97
|
+
*
|
98
|
+
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS"
|
99
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
100
|
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
101
|
+
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TH E REGENTS
|
102
|
+
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
103
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
104
|
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
105
|
+
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HO WEVER CAUSED
|
106
|
+
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
107
|
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
108
|
+
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
109
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
110
|
+
*/
|
111
|
+
/*
|
112
|
+
* Portions Copyright (c) 2004,2005 Damien Miller <djm@mindrot.org>
|
113
|
+
*
|
114
|
+
* Permission to use, copy, modify, and distribute this software for any
|
115
|
+
* purpose with or without fee is hereby granted, provided that the above
|
116
|
+
* copyright notice and this permission notice appear in all copies.
|
117
|
+
*
|
118
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
119
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
120
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
121
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
122
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
123
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
124
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
125
|
+
*/
|
126
|
+
|
127
|
+
Windows platforms link in code subject the the following licenses:
|
128
|
+
|
129
|
+
/* Copyright (c) 1996 by Internet Software Consortium.
|
130
|
+
*
|
131
|
+
* Permission to use, copy, modify, and distribute this software for any
|
132
|
+
* purpose with or without fee is hereby granted, provided that the above
|
133
|
+
* copyright notice and this permission notice appear in all copies.
|
134
|
+
*
|
135
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
136
|
+
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
137
|
+
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
138
|
+
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
139
|
+
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
140
|
+
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
141
|
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
142
|
+
* SOFTWARE.
|
143
|
+
*/
|
144
|
+
|
145
|
+
/*
|
146
|
+
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
|
147
|
+
*
|
148
|
+
* Permission to use, copy, modify, and distribute this software for any
|
149
|
+
* purpose with or without fee is hereby granted, provided that the above
|
150
|
+
* copyright notice and this permission notice appear in all copies.
|
151
|
+
*
|
152
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
153
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
154
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
155
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
156
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
157
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
158
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
159
|
+
*/
|
160
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
gem 'hoe', '>= 2.1.0'
|
3
|
+
require 'hoe'
|
4
|
+
require 'fileutils'
|
5
|
+
require './lib/ruby-radix'
|
6
|
+
|
7
|
+
Hoe.plugin :newgem
|
8
|
+
# Hoe.plugin :website
|
9
|
+
# Hoe.plugin :cucumberfeatures
|
10
|
+
|
11
|
+
# Generate all the Rake tasks
|
12
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
|
+
$hoe = Hoe.spec 'ruby-radix' do
|
14
|
+
self.developer 'Takashi Sogabe', 'sogabe@iij.ad.jp'
|
15
|
+
self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
16
|
+
self.rubyforge_name = self.name # TODO this is default value
|
17
|
+
self.spec_extras[:extensions] = "ext/extconf.rb"
|
18
|
+
# self.extra_deps = [['activesupport','>= 2.0.2']]
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'newgem/tasks'
|
23
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
24
|
+
|
25
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
26
|
+
# remove_task :default
|
27
|
+
# task :default => [:spec, :features]
|