netaddr 1.5.0 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of netaddr might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/README.md +9 -0
- data/changelog +18 -17
- data/lib/cidr.rb +17 -192
- data/lib/cidr_shortcuts.rb +1 -40
- data/lib/eui.rb +3 -64
- data/lib/ip_math.rb +0 -32
- data/lib/methods.rb +1 -67
- data/lib/netaddr.rb +6 -12
- data/lib/tree.rb +2 -107
- data/lib/validation_shortcuts.rb +0 -18
- data/license +13 -0
- data/{tests → test}/cidr_test.rb +2 -1
- data/{tests → test}/eui_test.rb +1 -1
- data/{tests → test}/methods_test.rb +4 -1
- data/{tests → test}/tree_test.rb +1 -1
- metadata +36 -42
- data/README +0 -17
data/lib/cidr_shortcuts.rb
CHANGED
@@ -3,10 +3,6 @@ private
|
|
3
3
|
|
4
4
|
# CIDR METHODS
|
5
5
|
|
6
|
-
#==============================================================================#
|
7
|
-
# cidr_build()
|
8
|
-
#==============================================================================#
|
9
|
-
|
10
6
|
# create either a CIDRv4 or CIDRv6 object
|
11
7
|
#
|
12
8
|
def cidr_build(version, ip, netmask=nil, tag={}, wildcard_mask=nil, wildcard_mask_bit_flipped=false)
|
@@ -15,9 +11,6 @@ def cidr_build(version, ip, netmask=nil, tag={}, wildcard_mask=nil, wildcard_mas
|
|
15
11
|
end
|
16
12
|
module_function :cidr_build
|
17
13
|
|
18
|
-
#==============================================================================#
|
19
|
-
# cidr_compare()
|
20
|
-
#==============================================================================#
|
21
14
|
|
22
15
|
# compare 2 CIDR objects
|
23
16
|
#
|
@@ -52,10 +45,6 @@ def cidr_compare(cidr1,cidr2)
|
|
52
45
|
end
|
53
46
|
module_function :cidr_compare
|
54
47
|
|
55
|
-
#==============================================================================#
|
56
|
-
# cidr_gt_lt()
|
57
|
-
#==============================================================================#
|
58
|
-
|
59
48
|
# given a pair of CIDRs, determine if first is greater than or less than the second
|
60
49
|
#
|
61
50
|
# return 1 if cidr1 > cidr2
|
@@ -78,10 +67,6 @@ def cidr_gt_lt(cidr1,cidr2)
|
|
78
67
|
end
|
79
68
|
module_function :cidr_gt_lt
|
80
69
|
|
81
|
-
#==============================================================================#
|
82
|
-
# cidr_fill_in()
|
83
|
-
#==============================================================================#
|
84
|
-
|
85
70
|
#Given a list of subnets of supernet, return a new list with any
|
86
71
|
#holes (missing subnets) filled in.
|
87
72
|
#
|
@@ -120,10 +105,6 @@ def cidr_fill_in(supernet,list)
|
|
120
105
|
end
|
121
106
|
module_function :cidr_fill_in
|
122
107
|
|
123
|
-
#==============================================================================#
|
124
|
-
# cidr_find_in_list()
|
125
|
-
#==============================================================================#
|
126
|
-
|
127
108
|
# evaluate cidr against list of cidrs.
|
128
109
|
#
|
129
110
|
# return entry from list if entry is supernet of cidr (first matching entry)
|
@@ -159,10 +140,6 @@ def cidr_find_in_list(cidr,list)
|
|
159
140
|
end
|
160
141
|
module_function :cidr_find_in_list
|
161
142
|
|
162
|
-
#==============================================================================#
|
163
|
-
# cidr_make_subnets_from_base_and_ip_count()
|
164
|
-
#==============================================================================#
|
165
|
-
|
166
143
|
# Make CIDR addresses from a base addr and an number of ip's to encapsulate.
|
167
144
|
#
|
168
145
|
#===Arguments:
|
@@ -204,10 +181,6 @@ module_function :cidr_find_in_list
|
|
204
181
|
end
|
205
182
|
module_function :cidr_make_subnets_from_base_and_ip_count
|
206
183
|
|
207
|
-
#==============================================================================#
|
208
|
-
# cidr_sort()
|
209
|
-
#==============================================================================#
|
210
|
-
|
211
184
|
# given a list of NetAddr::CIDRs, return them as a sorted list
|
212
185
|
#
|
213
186
|
def cidr_sort(list, desc=false)
|
@@ -258,10 +231,6 @@ def cidr_sort(list, desc=false)
|
|
258
231
|
end
|
259
232
|
module_function :cidr_sort
|
260
233
|
|
261
|
-
#==============================================================================#
|
262
|
-
# cidr_summarize()
|
263
|
-
#==============================================================================#
|
264
|
-
|
265
234
|
# given a list of NetAddr::CIDRs (of the same version) summarize them
|
266
235
|
#
|
267
236
|
# return a hash, with the key = summary address and val = array of original cidrs
|
@@ -322,7 +291,7 @@ def cidr_summarize(subnet_list)
|
|
322
291
|
until (index >= summarized_list.length)
|
323
292
|
subnet = summarized_list[index]
|
324
293
|
if (subnet && cidr_compare(supernet,subnet) == 1 )
|
325
|
-
|
294
|
+
unique_list.delete(subnet.desc)
|
326
295
|
end
|
327
296
|
index += 1
|
328
297
|
end
|
@@ -347,10 +316,6 @@ def cidr_summarize(subnet_list)
|
|
347
316
|
end
|
348
317
|
module_function :cidr_summarize
|
349
318
|
|
350
|
-
#==============================================================================#
|
351
|
-
# cidr_supernets()
|
352
|
-
#==============================================================================#
|
353
|
-
|
354
319
|
# given a list of NetAddr::CIDRs (of the same version), return only the 'top level' blocks (i.e. blocks not
|
355
320
|
# contained by other blocks
|
356
321
|
|
@@ -376,10 +341,6 @@ def cidr_supernets(subnet_list)
|
|
376
341
|
end
|
377
342
|
module_function :cidr_supernets
|
378
343
|
|
379
|
-
#==============================================================================#
|
380
|
-
# netmask_sort()
|
381
|
-
#==============================================================================#
|
382
|
-
|
383
344
|
# given a list of NetAddr::CIDRs, return them as a sorted (by netmask) list
|
384
345
|
#
|
385
346
|
def netmask_sort(list, desc=false)
|
data/lib/eui.rb
CHANGED
@@ -1,9 +1,3 @@
|
|
1
|
-
=begin rdoc
|
2
|
-
Copyleft (c) 2006 Dustin Spinhirne
|
3
|
-
|
4
|
-
Licensed under the same terms as Ruby, No Warranty is provided.
|
5
|
-
=end
|
6
|
-
|
7
1
|
module NetAddr
|
8
2
|
|
9
3
|
#=EUI - Extended Unique Identifier
|
@@ -27,10 +21,6 @@ class EUI
|
|
27
21
|
|
28
22
|
private_class_method :new
|
29
23
|
|
30
|
-
#==============================================================================#
|
31
|
-
# initialize()
|
32
|
-
#==============================================================================#
|
33
|
-
|
34
24
|
#===Synopsis
|
35
25
|
# This method performs absolutely no error checking, and is meant to be used only by
|
36
26
|
# other internal methods for the sake of the speedier creation of EUI objects.
|
@@ -71,10 +61,6 @@ private_class_method :new
|
|
71
61
|
|
72
62
|
end
|
73
63
|
|
74
|
-
#==============================================================================#
|
75
|
-
# create()
|
76
|
-
#==============================================================================#
|
77
|
-
|
78
64
|
#===Synopsis
|
79
65
|
#Create a new EUI48 or EUI64 object.
|
80
66
|
#
|
@@ -95,7 +81,8 @@ private_class_method :new
|
|
95
81
|
raise ArgumentError, "Expected String, but #{eui.class} provided."
|
96
82
|
end
|
97
83
|
|
98
|
-
# validate
|
84
|
+
# create local copy & validate
|
85
|
+
eui = eui.dup
|
99
86
|
NetAddr.validate_eui(eui)
|
100
87
|
|
101
88
|
# remove formatting characters
|
@@ -110,10 +97,6 @@ private_class_method :new
|
|
110
97
|
return(eui)
|
111
98
|
end
|
112
99
|
|
113
|
-
#==============================================================================#
|
114
|
-
# address()
|
115
|
-
#==============================================================================#
|
116
|
-
|
117
100
|
#===Synopsis
|
118
101
|
# Returns EUI address. The default address format is xxxx.xxxx.xxxx
|
119
102
|
#
|
@@ -148,28 +131,12 @@ private_class_method :new
|
|
148
131
|
if (delimiter == '-' || delimiter == ':')
|
149
132
|
addr = octets.join(delimiter)
|
150
133
|
elsif (delimiter == '.')
|
151
|
-
|
152
|
-
octets.each do |x|
|
153
|
-
if (!addr)
|
154
|
-
addr = x
|
155
|
-
toggle = 1
|
156
|
-
elsif (toggle == 0)
|
157
|
-
addr = addr << '.' << x
|
158
|
-
toggle = 1
|
159
|
-
else
|
160
|
-
addr = addr << x
|
161
|
-
toggle = 0
|
162
|
-
end
|
163
|
-
end
|
134
|
+
addr = octets.each_slice(2).to_a.map(&:join).join('.')
|
164
135
|
end
|
165
136
|
|
166
137
|
return(addr)
|
167
138
|
end
|
168
139
|
|
169
|
-
#==============================================================================#
|
170
|
-
# ei()
|
171
|
-
#==============================================================================#
|
172
|
-
|
173
140
|
#===Synopsis
|
174
141
|
#Returns Extended Identifier portion of an EUI address (the vendor assigned ID).
|
175
142
|
#The default address format is xx-xx-xx
|
@@ -211,10 +178,6 @@ private_class_method :new
|
|
211
178
|
return(ei)
|
212
179
|
end
|
213
180
|
|
214
|
-
#==============================================================================#
|
215
|
-
# link_local()
|
216
|
-
#==============================================================================#
|
217
|
-
|
218
181
|
#===Synopsis
|
219
182
|
# Provide an IPv6 Link Local address based on the current EUI address.
|
220
183
|
#
|
@@ -234,10 +197,6 @@ private_class_method :new
|
|
234
197
|
return( self.to_ipv6('fe80::/64', options) )
|
235
198
|
end
|
236
199
|
|
237
|
-
#==============================================================================#
|
238
|
-
# oui()
|
239
|
-
#==============================================================================#
|
240
|
-
|
241
200
|
#===Synopsis
|
242
201
|
#Returns Organizationally Unique Identifier portion of an EUI address (the vendor ID).
|
243
202
|
#The default address format is xx-xx-xx.
|
@@ -274,10 +233,6 @@ private_class_method :new
|
|
274
233
|
return(oui)
|
275
234
|
end
|
276
235
|
|
277
|
-
#==============================================================================#
|
278
|
-
# to_i()
|
279
|
-
#==============================================================================#
|
280
|
-
|
281
236
|
#===Synopsis
|
282
237
|
#Returns the EUI as an Integer.
|
283
238
|
#
|
@@ -295,10 +250,6 @@ private_class_method :new
|
|
295
250
|
return(@eui_i)
|
296
251
|
end
|
297
252
|
|
298
|
-
#==============================================================================#
|
299
|
-
# to_ipv6
|
300
|
-
#==============================================================================#
|
301
|
-
|
302
253
|
#===Synopsis
|
303
254
|
# Given a valid IPv6 subnet, return an IPv6 address based on the current EUI.
|
304
255
|
#
|
@@ -371,10 +322,6 @@ private_class_method :new
|
|
371
322
|
return(ipv6)
|
372
323
|
end
|
373
324
|
|
374
|
-
#==============================================================================#
|
375
|
-
# to_s()
|
376
|
-
#==============================================================================#
|
377
|
-
|
378
325
|
#===Synopsis
|
379
326
|
#Returns the EUI as an unformatted String.
|
380
327
|
#
|
@@ -394,10 +341,6 @@ private_class_method :new
|
|
394
341
|
|
395
342
|
private
|
396
343
|
|
397
|
-
#==============================================================================#
|
398
|
-
# octets()
|
399
|
-
#==============================================================================#
|
400
|
-
|
401
344
|
#Returns array with each element representing a single octet of the eui.
|
402
345
|
#
|
403
346
|
def octets()
|
@@ -426,10 +369,6 @@ class EUI48 < EUI
|
|
426
369
|
|
427
370
|
public_class_method :new
|
428
371
|
|
429
|
-
#==============================================================================#
|
430
|
-
# to_eui64()
|
431
|
-
#==============================================================================#
|
432
|
-
|
433
372
|
#===Synopsis
|
434
373
|
#Return an EUI64 address based on the current EUI48 address.
|
435
374
|
#
|
data/lib/ip_math.rb
CHANGED
@@ -4,10 +4,6 @@ private
|
|
4
4
|
|
5
5
|
# IP MATH METHODS
|
6
6
|
|
7
|
-
#==============================================================================#
|
8
|
-
# binary_mirror()
|
9
|
-
#==============================================================================#
|
10
|
-
|
11
7
|
# given an integer and number of bits to consider, return its binary mirror
|
12
8
|
#
|
13
9
|
def binary_mirror(num, bit_count)
|
@@ -22,10 +18,6 @@ def binary_mirror(num, bit_count)
|
|
22
18
|
end
|
23
19
|
module_function :binary_mirror
|
24
20
|
|
25
|
-
#==============================================================================#
|
26
|
-
# bits_to_mask()
|
27
|
-
#==============================================================================#
|
28
|
-
|
29
21
|
# convert a netmask (in bits) to an integer mask
|
30
22
|
#
|
31
23
|
def bits_to_mask(netmask,version)
|
@@ -36,10 +28,6 @@ def bits_to_mask(netmask,version)
|
|
36
28
|
end
|
37
29
|
module_function :bits_to_mask
|
38
30
|
|
39
|
-
#==============================================================================#
|
40
|
-
# detect_ip_version()
|
41
|
-
#==============================================================================#
|
42
|
-
|
43
31
|
# determine the ip version from ip address string.
|
44
32
|
#
|
45
33
|
# return 4, 6, or nil
|
@@ -57,10 +45,6 @@ def detect_ip_version(ip)
|
|
57
45
|
end
|
58
46
|
module_function :detect_ip_version
|
59
47
|
|
60
|
-
#==============================================================================#
|
61
|
-
# ip_count_to_size()
|
62
|
-
#==============================================================================#
|
63
|
-
|
64
48
|
# given an ip count, determine the most appropriate mask (in bits)
|
65
49
|
#
|
66
50
|
def ip_count_to_size(ipcount,version,extended=false)
|
@@ -83,10 +67,6 @@ def ip_count_to_size(ipcount,version,extended=false)
|
|
83
67
|
end
|
84
68
|
module_function :ip_count_to_size
|
85
69
|
|
86
|
-
#==============================================================================#
|
87
|
-
# ip_int_to_str()
|
88
|
-
#==============================================================================#
|
89
|
-
|
90
70
|
# unpack an int into an ip address string
|
91
71
|
#
|
92
72
|
def ip_int_to_str(ip_int, version, ipv4_mapped=nil)
|
@@ -129,10 +109,6 @@ def ip_int_to_str(ip_int, version, ipv4_mapped=nil)
|
|
129
109
|
end
|
130
110
|
module_function :ip_int_to_str
|
131
111
|
|
132
|
-
#==============================================================================#
|
133
|
-
# ip_str_to_int()
|
134
|
-
#==============================================================================#
|
135
|
-
|
136
112
|
# convert an ip string into an int
|
137
113
|
#
|
138
114
|
def ip_str_to_int(ip,version)
|
@@ -197,10 +173,6 @@ def ip_str_to_int(ip,version)
|
|
197
173
|
end
|
198
174
|
module_function :ip_str_to_int
|
199
175
|
|
200
|
-
#==============================================================================#
|
201
|
-
# mask_to_bits()
|
202
|
-
#==============================================================================#
|
203
|
-
|
204
176
|
# convert integer into a cidr formatted netmask (bits)
|
205
177
|
#
|
206
178
|
def mask_to_bits(netmask_int)
|
@@ -226,10 +198,6 @@ def mask_to_bits(netmask_int)
|
|
226
198
|
end
|
227
199
|
module_function :mask_to_bits
|
228
200
|
|
229
|
-
#==============================================================================#
|
230
|
-
# netmask_str_to_int()
|
231
|
-
#==============================================================================#
|
232
|
-
|
233
201
|
# convert string into integer mask
|
234
202
|
#
|
235
203
|
def netmask_str_to_int(netmask,version)
|
data/lib/methods.rb
CHANGED
@@ -1,15 +1,5 @@
|
|
1
|
-
=begin rdoc
|
2
|
-
Copyleft (c) 2006 Dustin Spinhirne
|
3
|
-
|
4
|
-
Licensed under the same terms as Ruby, No Warranty is provided.
|
5
|
-
=end
|
6
|
-
|
7
1
|
module NetAddr
|
8
2
|
|
9
|
-
#==============================================================================#
|
10
|
-
# i_to_bits()
|
11
|
-
#==============================================================================#
|
12
|
-
|
13
3
|
#===Synopsis
|
14
4
|
#Convert an Integer representing a binary netmask into an Integer representing
|
15
5
|
#the number of bits in that netmask.
|
@@ -35,10 +25,6 @@ def i_to_bits(netmask_int)
|
|
35
25
|
end
|
36
26
|
module_function :i_to_bits
|
37
27
|
|
38
|
-
#==============================================================================#
|
39
|
-
# i_to_ip()
|
40
|
-
#==============================================================================#
|
41
|
-
|
42
28
|
#===Synopsis
|
43
29
|
#Convert an Integer into an IP address. This method will attempt to auto-detect the IP version
|
44
30
|
#if not provided, however, a slight speed increase is realized if version is provided.
|
@@ -88,10 +74,6 @@ def i_to_ip(ip_int, options=nil)
|
|
88
74
|
end
|
89
75
|
module_function :i_to_ip
|
90
76
|
|
91
|
-
#==============================================================================#
|
92
|
-
# ip_to_i()
|
93
|
-
#==============================================================================#
|
94
|
-
|
95
77
|
#===Synopsis
|
96
78
|
#Convert IP addresses into an Integer. This method will attempt to auto-detect the IP version
|
97
79
|
#if not provided, however a slight speed increase is realized if version is provided.
|
@@ -141,10 +123,6 @@ def ip_to_i(ip, options=nil)
|
|
141
123
|
end
|
142
124
|
module_function :ip_to_i
|
143
125
|
|
144
|
-
#==============================================================================#
|
145
|
-
# merge()
|
146
|
-
#==============================================================================#
|
147
|
-
|
148
126
|
#===Synopsis
|
149
127
|
#Given a list of CIDR addresses or NetAddr::CIDR objects,
|
150
128
|
#merge (summarize) them in the most efficient way possible. Summarization
|
@@ -253,10 +231,6 @@ def merge(list,options=nil)
|
|
253
231
|
end
|
254
232
|
module_function :merge
|
255
233
|
|
256
|
-
#==============================================================================#
|
257
|
-
# minimum_size()
|
258
|
-
#==============================================================================#
|
259
|
-
|
260
234
|
#===Synopsis
|
261
235
|
#Given the number of IP addresses required in a subnet, return the minimum
|
262
236
|
#netmask (bits by default) required for that subnet. IP version is assumed to be 4 unless specified otherwise.
|
@@ -301,10 +275,6 @@ def minimum_size(ipcount, options=nil)
|
|
301
275
|
end
|
302
276
|
module_function :minimum_size
|
303
277
|
|
304
|
-
#==============================================================================#
|
305
|
-
# netmask_to_i()
|
306
|
-
#==============================================================================#
|
307
|
-
|
308
278
|
#===Synopsis
|
309
279
|
#Convert IP netmask into an Integer. Netmask may be in either CIDR (/yy) or
|
310
280
|
#extended (y.y.y.y) format. CIDR formatted netmasks may either
|
@@ -361,10 +331,6 @@ def netmask_to_i(netmask, options=nil)
|
|
361
331
|
end
|
362
332
|
module_function :netmask_to_i
|
363
333
|
|
364
|
-
#==============================================================================#
|
365
|
-
# range()
|
366
|
-
#==============================================================================#
|
367
|
-
|
368
334
|
#===Synopsis
|
369
335
|
#Given two CIDR addresses or NetAddr::CIDR objects of the same version,
|
370
336
|
#return all IP addresses between them. NetAddr.range will use the original IP
|
@@ -492,7 +458,7 @@ def range(lower, upper, options=nil)
|
|
492
458
|
|
493
459
|
my_ip = my_ip + bitstep
|
494
460
|
if (limit)
|
495
|
-
limit = limit -1
|
461
|
+
limit = limit - 1
|
496
462
|
break if (limit == 0)
|
497
463
|
end
|
498
464
|
end
|
@@ -504,10 +470,6 @@ def range(lower, upper, options=nil)
|
|
504
470
|
end
|
505
471
|
module_function :range
|
506
472
|
|
507
|
-
#==============================================================================#
|
508
|
-
# shorten()
|
509
|
-
#==============================================================================#
|
510
|
-
|
511
473
|
#===Synopsis
|
512
474
|
#Take a standard IPv6 address and format it in short-hand notation.
|
513
475
|
#The address should not contain a netmask.
|
@@ -596,10 +558,6 @@ def shorten(addr)
|
|
596
558
|
end
|
597
559
|
module_function :shorten
|
598
560
|
|
599
|
-
#==============================================================================#
|
600
|
-
# sort()
|
601
|
-
#==============================================================================#
|
602
|
-
|
603
561
|
#===Synopsis
|
604
562
|
#Sort a list of CIDR addresses or NetAddr::CIDR objects,
|
605
563
|
#
|
@@ -680,10 +638,6 @@ def sort(list, options=nil)
|
|
680
638
|
end
|
681
639
|
module_function :sort
|
682
640
|
|
683
|
-
#==============================================================================#
|
684
|
-
# supernets()
|
685
|
-
#==============================================================================#
|
686
|
-
|
687
641
|
#===Synopsis
|
688
642
|
#Given a list of CIDR addresses or NetAddr::CIDR objects,
|
689
643
|
#return only the top-level supernet CIDR addresses.
|
@@ -780,10 +734,6 @@ def supernets(list,options=nil)
|
|
780
734
|
end
|
781
735
|
module_function :supernets
|
782
736
|
|
783
|
-
#==============================================================================#
|
784
|
-
# unshorten()
|
785
|
-
#==============================================================================#
|
786
|
-
|
787
737
|
#===Synopsis
|
788
738
|
#Take an IPv6 address in short-hand format, and expand it into standard
|
789
739
|
#notation. The address should not contain a netmask.
|
@@ -818,10 +768,6 @@ def unshorten(ip)
|
|
818
768
|
end
|
819
769
|
module_function :unshorten
|
820
770
|
|
821
|
-
#==============================================================================#
|
822
|
-
# validate_eui()
|
823
|
-
#==============================================================================#
|
824
|
-
|
825
771
|
#===Synopsis
|
826
772
|
#Validate an EUI-48 or EUI-64 address. Raises NetAddr::ValidationError on validation failure.
|
827
773
|
#
|
@@ -871,10 +817,6 @@ def validate_eui(eui)
|
|
871
817
|
end
|
872
818
|
module_function :validate_eui
|
873
819
|
|
874
|
-
#==============================================================================#
|
875
|
-
# validate_ip_addr()
|
876
|
-
#==============================================================================#
|
877
|
-
|
878
820
|
#===Synopsis
|
879
821
|
#Validate an IP address. The address should not contain a netmask.
|
880
822
|
#This method will attempt to auto-detect the IP version
|
@@ -930,10 +872,6 @@ def validate_ip_addr(ip, options=nil)
|
|
930
872
|
end
|
931
873
|
module_function :validate_ip_addr
|
932
874
|
|
933
|
-
#==============================================================================#
|
934
|
-
# validate_ip_netmask()
|
935
|
-
#==============================================================================#
|
936
|
-
|
937
875
|
#===Synopsis
|
938
876
|
#Validate IP Netmask. Version defaults to 4 if not specified.
|
939
877
|
#Raises NetAddr::ValidationError on validation failure.
|
@@ -988,10 +926,6 @@ def validate_ip_netmask(netmask, options=nil)
|
|
988
926
|
end
|
989
927
|
module_function :validate_ip_netmask
|
990
928
|
|
991
|
-
#==============================================================================#
|
992
|
-
# wildcard()
|
993
|
-
#==============================================================================#
|
994
|
-
|
995
929
|
#===Synopsis
|
996
930
|
#Convert a wildcard IP into a valid CIDR address. Wildcards must always be at
|
997
931
|
#the end of the address. Any data located after the first wildcard will be lost.
|
data/lib/netaddr.rb
CHANGED
@@ -1,9 +1,3 @@
|
|
1
|
-
=begin rdoc
|
2
|
-
Copyleft (c) 2006 Dustin Spinhirne
|
3
|
-
|
4
|
-
Licensed under the same terms as Ruby, No Warranty is provided.
|
5
|
-
=end
|
6
|
-
|
7
1
|
require 'time'
|
8
2
|
require 'digest/sha1'
|
9
3
|
require File.join(File.dirname(__FILE__), 'validation_shortcuts.rb')
|
@@ -16,14 +10,14 @@ require File.join(File.dirname(__FILE__), 'eui.rb')
|
|
16
10
|
|
17
11
|
module NetAddr
|
18
12
|
|
19
|
-
class BoundaryError < StandardError #:nodoc:
|
20
|
-
end
|
13
|
+
class BoundaryError < StandardError #:nodoc:
|
14
|
+
end
|
21
15
|
|
22
|
-
class ValidationError < StandardError #:nodoc:
|
23
|
-
end
|
16
|
+
class ValidationError < StandardError #:nodoc:
|
17
|
+
end
|
24
18
|
|
25
|
-
class VersionError < StandardError #:nodoc:
|
26
|
-
end
|
19
|
+
class VersionError < StandardError #:nodoc:
|
20
|
+
end
|
27
21
|
|
28
22
|
end # module NetAddr
|
29
23
|
|