Class: MachineIpAddr

Inherits:
Object
  • Object
show all
Defined in:
lib/uri_scanner/ip_address.rb

Overview

Ruby Class goes here

Instance Method Summary collapse

Constructor Details

#initializeMachineIpAddr

Returns a new instance of MachineIpAddr.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/uri_scanner/ip_address.rb', line 15

def initialize
  
# line 18 "lib/uri_scanner/ip_address.rb"
class << self
	attr_accessor :_m_ipaddr_key_offsets
	private :_m_ipaddr_key_offsets, :_m_ipaddr_key_offsets=
end
self._m_ipaddr_key_offsets = [
	0, 0, 10, 18, 23, 26, 31, 34, 
	39, 42, 43, 49, 52, 55, 56, 62, 
	65, 73, 81, 82, 89, 96, 103, 110, 
	111, 118, 125, 132, 139, 140, 147, 154, 
	161, 168, 169, 176, 183, 190, 197, 198, 
	205, 212, 219, 226, 227, 237, 245, 253, 
	261, 262, 269, 276, 283, 294, 304, 312, 
	320, 327, 333, 342, 351, 360, 369, 376, 
	383, 394, 404, 412, 420, 421, 427, 433, 
	440, 447, 454, 455, 461, 468, 475, 482, 
	483, 489, 496, 503, 510, 511, 517, 524, 
	531, 538, 539, 548, 556, 564, 572, 573, 
	580, 587, 598, 608, 616, 624, 631, 638, 
	640, 642, 642, 647, 649, 655, 661, 667, 
	673, 682, 690, 698, 706, 707, 714, 721, 
	732, 742, 750, 758, 765, 774, 782, 790, 
	798, 799, 806, 813, 824, 834, 842, 850, 
	857, 866, 874, 882, 890, 891, 898, 905, 
	916, 926, 934, 942, 949, 958, 966, 974, 
	982, 983, 990, 997, 1008, 1018, 1026, 1034, 
	1041, 1050, 1058, 1066, 1074, 1075, 1082, 1089, 
	1100, 1110, 1118, 1126, 1133, 1140, 1147, 1154
]

class << self
	attr_accessor :_m_ipaddr_trans_keys
	private :_m_ipaddr_trans_keys, :_m_ipaddr_trans_keys=
end
self._m_ipaddr_trans_keys = [
	50, 58, 48, 49, 51, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 50, 48, 49, 51, 57, 46, 
	48, 57, 50, 48, 49, 51, 57, 46, 
	48, 57, 50, 48, 49, 51, 57, 46, 
	48, 57, 46, 46, 53, 48, 52, 54, 
	57, 46, 48, 53, 46, 48, 57, 46, 
	46, 53, 48, 52, 54, 57, 46, 48, 
	53, 46, 58, 48, 57, 65, 70, 97, 
	102, 46, 58, 48, 57, 65, 70, 97, 
	102, 58, 58, 48, 57, 65, 70, 97, 
	102, 58, 48, 57, 65, 70, 97, 102, 
	58, 48, 57, 65, 70, 97, 102, 58, 
	48, 57, 65, 70, 97, 102, 58, 58, 
	48, 57, 65, 70, 97, 102, 58, 48, 
	57, 65, 70, 97, 102, 58, 48, 57, 
	65, 70, 97, 102, 58, 48, 57, 65, 
	70, 97, 102, 58, 58, 48, 57, 65, 
	70, 97, 102, 58, 48, 57, 65, 70, 
	97, 102, 58, 48, 57, 65, 70, 97, 
	102, 58, 48, 57, 65, 70, 97, 102, 
	58, 58, 48, 57, 65, 70, 97, 102, 
	58, 48, 57, 65, 70, 97, 102, 58, 
	48, 57, 65, 70, 97, 102, 58, 48, 
	57, 65, 70, 97, 102, 58, 58, 48, 
	57, 65, 70, 97, 102, 58, 48, 57, 
	65, 70, 97, 102, 58, 48, 57, 65, 
	70, 97, 102, 58, 48, 57, 65, 70, 
	97, 102, 58, 50, 58, 48, 49, 51, 
	57, 65, 70, 97, 102, 46, 58, 48, 
	57, 65, 70, 97, 102, 46, 58, 48, 
	57, 65, 70, 97, 102, 46, 58, 48, 
	57, 65, 70, 97, 102, 58, 58, 48, 
	57, 65, 70, 97, 102, 58, 48, 57, 
	65, 70, 97, 102, 58, 48, 57, 65, 
	70, 97, 102, 46, 53, 58, 48, 52, 
	54, 57, 65, 70, 97, 102, 46, 58, 
	48, 53, 54, 57, 65, 70, 97, 102, 
	46, 58, 48, 57, 65, 70, 97, 102, 
	46, 58, 48, 57, 65, 70, 97, 102, 
	58, 48, 57, 65, 70, 97, 102, 48, 
	57, 65, 70, 97, 102, 50, 48, 49, 
	51, 57, 65, 70, 97, 102, 50, 48, 
	49, 51, 57, 65, 70, 97, 102, 50, 
	48, 49, 51, 57, 65, 70, 97, 102, 
	50, 48, 49, 51, 57, 65, 70, 97, 
	102, 58, 48, 57, 65, 70, 97, 102, 
	58, 48, 57, 65, 70, 97, 102, 46, 
	53, 58, 48, 52, 54, 57, 65, 70, 
	97, 102, 46, 58, 48, 53, 54, 57, 
	65, 70, 97, 102, 46, 58, 48, 57, 
	65, 70, 97, 102, 46, 58, 48, 57, 
	65, 70, 97, 102, 58, 48, 57, 65, 
	70, 97, 102, 48, 57, 65, 70, 97, 
	102, 58, 48, 57, 65, 70, 97, 102, 
	58, 48, 57, 65, 70, 97, 102, 58, 
	48, 57, 65, 70, 97, 102, 58, 48, 
	57, 65, 70, 97, 102, 58, 48, 57, 
	65, 70, 97, 102, 58, 48, 57, 65, 
	70, 97, 102, 58, 48, 57, 65, 70, 
	97, 102, 58, 48, 57, 65, 70, 97, 
	102, 58, 48, 57, 65, 70, 97, 102, 
	58, 48, 57, 65, 70, 97, 102, 58, 
	48, 57, 65, 70, 97, 102, 58, 48, 
	57, 65, 70, 97, 102, 58, 48, 57, 
	65, 70, 97, 102, 58, 48, 57, 65, 
	70, 97, 102, 58, 48, 57, 65, 70, 
	97, 102, 58, 50, 48, 49, 51, 57, 
	65, 70, 97, 102, 46, 58, 48, 57, 
	65, 70, 97, 102, 46, 58, 48, 57, 
	65, 70, 97, 102, 46, 58, 48, 57, 
	65, 70, 97, 102, 58, 58, 48, 57, 
	65, 70, 97, 102, 58, 48, 57, 65, 
	70, 97, 102, 46, 53, 58, 48, 52, 
	54, 57, 65, 70, 97, 102, 46, 58, 
	48, 53, 54, 57, 65, 70, 97, 102, 
	46, 58, 48, 57, 65, 70, 97, 102, 
	46, 58, 48, 57, 65, 70, 97, 102, 
	58, 48, 57, 65, 70, 97, 102, 58, 
	48, 57, 65, 70, 97, 102, 48, 57, 
	48, 57, 53, 48, 52, 54, 57, 48, 
	53, 48, 57, 65, 70, 97, 102, 48, 
	57, 65, 70, 97, 102, 48, 57, 65, 
	70, 97, 102, 48, 57, 65, 70, 97, 
	102, 50, 48, 49, 51, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 58, 58, 48, 57, 65, 70, 
	97, 102, 58, 48, 57, 65, 70, 97, 
	102, 46, 53, 58, 48, 52, 54, 57, 
	65, 70, 97, 102, 46, 58, 48, 53, 
	54, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 58, 48, 
	57, 65, 70, 97, 102, 50, 48, 49, 
	51, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 58, 58, 
	48, 57, 65, 70, 97, 102, 58, 48, 
	57, 65, 70, 97, 102, 46, 53, 58, 
	48, 52, 54, 57, 65, 70, 97, 102, 
	46, 58, 48, 53, 54, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 58, 48, 57, 65, 70, 97, 
	102, 50, 48, 49, 51, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 58, 58, 48, 57, 65, 70, 
	97, 102, 58, 48, 57, 65, 70, 97, 
	102, 46, 53, 58, 48, 52, 54, 57, 
	65, 70, 97, 102, 46, 58, 48, 53, 
	54, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 58, 48, 
	57, 65, 70, 97, 102, 50, 48, 49, 
	51, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 58, 58, 
	48, 57, 65, 70, 97, 102, 58, 48, 
	57, 65, 70, 97, 102, 46, 53, 58, 
	48, 52, 54, 57, 65, 70, 97, 102, 
	46, 58, 48, 53, 54, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 58, 48, 57, 65, 70, 97, 
	102, 50, 48, 49, 51, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 46, 58, 48, 57, 65, 70, 
	97, 102, 58, 58, 48, 57, 65, 70, 
	97, 102, 58, 48, 57, 65, 70, 97, 
	102, 46, 53, 58, 48, 52, 54, 57, 
	65, 70, 97, 102, 46, 58, 48, 53, 
	54, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 46, 58, 
	48, 57, 65, 70, 97, 102, 58, 48, 
	57, 65, 70, 97, 102, 58, 48, 57, 
	65, 70, 97, 102, 58, 48, 57, 65, 
	70, 97, 102, 58, 48, 57, 65, 70, 
	97, 102, 58, 0
]

class << self
	attr_accessor :_m_ipaddr_single_lengths
	private :_m_ipaddr_single_lengths, :_m_ipaddr_single_lengths=
end
self._m_ipaddr_single_lengths = [
	0, 2, 2, 1, 1, 1, 1, 1, 
	1, 1, 2, 1, 1, 1, 2, 1, 
	2, 2, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 2, 2, 2, 2, 
	1, 1, 1, 1, 3, 2, 2, 2, 
	1, 0, 1, 1, 1, 1, 1, 1, 
	3, 2, 2, 2, 1, 0, 0, 1, 
	1, 1, 1, 0, 1, 1, 1, 1, 
	0, 1, 1, 1, 1, 0, 1, 1, 
	1, 1, 1, 2, 2, 2, 1, 1, 
	1, 3, 2, 2, 2, 1, 1, 0, 
	0, 0, 1, 0, 0, 0, 0, 0, 
	1, 2, 2, 2, 1, 1, 1, 3, 
	2, 2, 2, 1, 1, 2, 2, 2, 
	1, 1, 1, 3, 2, 2, 2, 1, 
	1, 2, 2, 2, 1, 1, 1, 3, 
	2, 2, 2, 1, 1, 2, 2, 2, 
	1, 1, 1, 3, 2, 2, 2, 1, 
	1, 2, 2, 2, 1, 1, 1, 3, 
	2, 2, 2, 1, 1, 1, 1, 1
]

class << self
	attr_accessor :_m_ipaddr_range_lengths
	private :_m_ipaddr_range_lengths, :_m_ipaddr_range_lengths=
end
self._m_ipaddr_range_lengths = [
	0, 4, 3, 2, 1, 2, 1, 2, 
	1, 0, 2, 1, 1, 0, 2, 1, 
	3, 3, 0, 3, 3, 3, 3, 0, 
	3, 3, 3, 3, 0, 3, 3, 3, 
	3, 0, 3, 3, 3, 3, 0, 3, 
	3, 3, 3, 0, 4, 3, 3, 3, 
	0, 3, 3, 3, 4, 4, 3, 3, 
	3, 3, 4, 4, 4, 4, 3, 3, 
	4, 4, 3, 3, 0, 3, 3, 3, 
	3, 3, 0, 3, 3, 3, 3, 0, 
	3, 3, 3, 3, 0, 3, 3, 3, 
	3, 0, 4, 3, 3, 3, 0, 3, 
	3, 4, 4, 3, 3, 3, 3, 1, 
	1, 0, 2, 1, 3, 3, 3, 3, 
	4, 3, 3, 3, 0, 3, 3, 4, 
	4, 3, 3, 3, 4, 3, 3, 3, 
	0, 3, 3, 4, 4, 3, 3, 3, 
	4, 3, 3, 3, 0, 3, 3, 4, 
	4, 3, 3, 3, 4, 3, 3, 3, 
	0, 3, 3, 4, 4, 3, 3, 3, 
	4, 3, 3, 3, 0, 3, 3, 4, 
	4, 3, 3, 3, 3, 3, 3, 0
]

class << self
	attr_accessor :_m_ipaddr_index_offsets
	private :_m_ipaddr_index_offsets, :_m_ipaddr_index_offsets=
end
self._m_ipaddr_index_offsets = [
	0, 0, 7, 13, 17, 20, 24, 27, 
	31, 34, 36, 41, 44, 47, 49, 54, 
	57, 63, 69, 71, 76, 81, 86, 91, 
	93, 98, 103, 108, 113, 115, 120, 125, 
	130, 135, 137, 142, 147, 152, 157, 159, 
	164, 169, 174, 179, 181, 188, 194, 200, 
	206, 208, 213, 218, 223, 231, 238, 244, 
	250, 255, 259, 265, 271, 277, 283, 288, 
	293, 301, 308, 314, 320, 322, 326, 330, 
	335, 340, 345, 347, 351, 356, 361, 366, 
	368, 372, 377, 382, 387, 389, 393, 398, 
	403, 408, 410, 416, 422, 428, 434, 436, 
	441, 446, 454, 461, 467, 473, 478, 483, 
	485, 487, 488, 492, 494, 498, 502, 506, 
	510, 516, 522, 528, 534, 536, 541, 546, 
	554, 561, 567, 573, 578, 584, 590, 596, 
	602, 604, 609, 614, 622, 629, 635, 641, 
	646, 652, 658, 664, 670, 672, 677, 682, 
	690, 697, 703, 709, 714, 720, 726, 732, 
	738, 740, 745, 750, 758, 765, 771, 777, 
	782, 788, 794, 800, 806, 808, 813, 818, 
	826, 833, 839, 845, 850, 855, 860, 865
]

class << self
	attr_accessor :_m_ipaddr_trans_targs
	private :_m_ipaddr_trans_targs, :_m_ipaddr_trans_targs=
end
self._m_ipaddr_trans_targs = [
	64, 68, 2, 67, 102, 102, 0, 3, 
	19, 16, 63, 63, 0, 14, 4, 12, 
	0, 5, 12, 0, 10, 6, 8, 0, 
	7, 8, 0, 106, 103, 104, 0, 7, 
	9, 0, 7, 0, 7, 11, 8, 9, 
	0, 7, 9, 0, 5, 13, 0, 5, 
	0, 5, 15, 12, 13, 0, 5, 13, 
	0, 3, 19, 17, 62, 62, 0, 3, 
	19, 18, 18, 18, 0, 19, 0, 160, 
	20, 20, 20, 0, 24, 21, 21, 21, 
	0, 24, 22, 22, 22, 0, 24, 23, 
	23, 23, 0, 24, 0, 148, 25, 25, 
	25, 0, 29, 26, 26, 26, 0, 29, 
	27, 27, 27, 0, 29, 28, 28, 28, 
	0, 29, 0, 136, 30, 30, 30, 0, 
	34, 31, 31, 31, 0, 34, 32, 32, 
	32, 0, 34, 33, 33, 33, 0, 34, 
	0, 124, 35, 35, 35, 0, 39, 36, 
	36, 36, 0, 39, 37, 37, 37, 0, 
	39, 38, 38, 38, 0, 39, 0, 112, 
	40, 40, 40, 0, 44, 41, 41, 41, 
	0, 44, 42, 42, 42, 0, 44, 43, 
	43, 43, 0, 44, 0, 52, 111, 45, 
	55, 56, 56, 0, 3, 49, 46, 51, 
	51, 0, 3, 49, 47, 50, 50, 0, 
	3, 49, 48, 48, 48, 0, 49, 0, 
	105, 108, 108, 108, 0, 49, 48, 48, 
	48, 0, 49, 50, 50, 50, 0, 3, 
	53, 49, 46, 54, 51, 51, 0, 3, 
	49, 47, 50, 50, 50, 0, 3, 49, 
	50, 50, 50, 0, 3, 49, 54, 51, 
	51, 0, 49, 51, 51, 51, 0, 108, 
	108, 108, 0, 119, 113, 122, 123, 123, 
	0, 131, 125, 134, 135, 135, 0, 143, 
	137, 146, 147, 147, 0, 155, 149, 158, 
	159, 159, 0, 19, 18, 18, 18, 0, 
	19, 62, 62, 62, 0, 3, 65, 19, 
	16, 66, 63, 63, 0, 3, 19, 17, 
	62, 62, 62, 0, 3, 19, 62, 62, 
	62, 0, 3, 19, 66, 63, 63, 0, 
	69, 0, 172, 172, 172, 0, 71, 71, 
	71, 0, 75, 72, 72, 72, 0, 75, 
	73, 73, 73, 0, 75, 74, 74, 74, 
	0, 75, 0, 76, 76, 76, 0, 80, 
	77, 77, 77, 0, 80, 78, 78, 78, 
	0, 80, 79, 79, 79, 0, 80, 0, 
	81, 81, 81, 0, 85, 82, 82, 82, 
	0, 85, 83, 83, 83, 0, 85, 84, 
	84, 84, 0, 85, 0, 86, 86, 86, 
	0, 90, 87, 87, 87, 0, 90, 88, 
	88, 88, 0, 90, 89, 89, 89, 0, 
	90, 0, 97, 91, 100, 101, 101, 0, 
	3, 57, 92, 96, 96, 0, 3, 57, 
	93, 95, 95, 0, 3, 57, 94, 94, 
	94, 0, 57, 0, 57, 94, 94, 94, 
	0, 57, 95, 95, 95, 0, 3, 98, 
	57, 92, 99, 96, 96, 0, 3, 57, 
	93, 95, 95, 95, 0, 3, 57, 95, 
	95, 95, 0, 3, 57, 99, 96, 96, 
	0, 57, 96, 96, 96, 0, 19, 63, 
	63, 63, 0, 104, 0, 105, 0, 0, 
	107, 104, 105, 0, 105, 0, 109, 109, 
	109, 0, 110, 110, 110, 0, 105, 105, 
	105, 0, 108, 108, 108, 0, 119, 113, 
	122, 123, 123, 0, 3, 57, 114, 118, 
	118, 0, 3, 57, 115, 117, 117, 0, 
	3, 57, 116, 116, 116, 0, 57, 0, 
	57, 116, 116, 116, 0, 57, 117, 117, 
	117, 0, 3, 120, 57, 114, 121, 118, 
	118, 0, 3, 57, 115, 117, 117, 117, 
	0, 3, 57, 117, 117, 117, 0, 3, 
	57, 121, 118, 118, 0, 57, 118, 118, 
	118, 0, 131, 125, 134, 135, 135, 0, 
	3, 58, 126, 130, 130, 0, 3, 58, 
	127, 129, 129, 0, 3, 58, 128, 128, 
	128, 0, 58, 0, 58, 128, 128, 128, 
	0, 58, 129, 129, 129, 0, 3, 132, 
	58, 126, 133, 130, 130, 0, 3, 58, 
	127, 129, 129, 129, 0, 3, 58, 129, 
	129, 129, 0, 3, 58, 133, 130, 130, 
	0, 58, 130, 130, 130, 0, 143, 137, 
	146, 147, 147, 0, 3, 59, 138, 142, 
	142, 0, 3, 59, 139, 141, 141, 0, 
	3, 59, 140, 140, 140, 0, 59, 0, 
	59, 140, 140, 140, 0, 59, 141, 141, 
	141, 0, 3, 144, 59, 138, 145, 142, 
	142, 0, 3, 59, 139, 141, 141, 141, 
	0, 3, 59, 141, 141, 141, 0, 3, 
	59, 145, 142, 142, 0, 59, 142, 142, 
	142, 0, 155, 149, 158, 159, 159, 0, 
	3, 60, 150, 154, 154, 0, 3, 60, 
	151, 153, 153, 0, 3, 60, 152, 152, 
	152, 0, 60, 0, 60, 152, 152, 152, 
	0, 60, 153, 153, 153, 0, 3, 156, 
	60, 150, 157, 154, 154, 0, 3, 60, 
	151, 153, 153, 153, 0, 3, 60, 153, 
	153, 153, 0, 3, 60, 157, 154, 154, 
	0, 60, 154, 154, 154, 0, 167, 161, 
	170, 171, 171, 0, 3, 61, 162, 166, 
	166, 0, 3, 61, 163, 165, 165, 0, 
	3, 61, 164, 164, 164, 0, 61, 0, 
	61, 164, 164, 164, 0, 61, 165, 165, 
	165, 0, 3, 168, 61, 162, 169, 166, 
	166, 0, 3, 61, 163, 165, 165, 165, 
	0, 3, 61, 165, 165, 165, 0, 3, 
	61, 169, 166, 166, 0, 61, 166, 166, 
	166, 0, 70, 173, 173, 173, 0, 70, 
	174, 174, 174, 0, 70, 175, 175, 175, 
	0, 70, 0, 0
]

class << self
	attr_accessor :m_ipaddr_start
end
self.m_ipaddr_start = 1;
class << self
	attr_accessor :m_ipaddr_first_final
end
self.m_ipaddr_first_final = 103;
class << self
	attr_accessor :m_ipaddr_error
end
self.m_ipaddr_error = 0;

class << self
	attr_accessor :m_ipaddr_en_main
end
self.m_ipaddr_en_main = 1;


# line 18 "lib/uri_scanner/ip_address.rl"
end

Instance Method Details

#is_valid?(data) ⇒ Boolean

Returns:

  • (Boolean)


424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/uri_scanner/ip_address.rb', line 424

def is_valid?(data)
  
# line 427 "lib/uri_scanner/ip_address.rb"
begin
	p ||= 0
	pe ||= data.length
	cs = m_ipaddr_start
end

# line 22 "lib/uri_scanner/ip_address.rl"
  
# line 436 "lib/uri_scanner/ip_address.rb"
begin
	_klen, _trans, _keys = nil
	_goto_level = 0
	_resume = 10
	_eof_trans = 15
	_again = 20
	_test_eof = 30
	_out = 40
	while true
	_trigger_goto = false
	if _goto_level <= 0
	if p == pe
_goto_level = _test_eof
next
	end
	if cs == 0
_goto_level = _out
next
	end
	end
	if _goto_level <= _resume
	_keys = _m_ipaddr_key_offsets[cs]
	_trans = _m_ipaddr_index_offsets[cs]
	_klen = _m_ipaddr_single_lengths[cs]
	_break_match = false
	
	begin
 if _klen > 0
    _lower = _keys
    _upper = _keys + _klen - 1

    loop do
       break if _upper < _lower
       _mid = _lower + ( (_upper - _lower) >> 1 )

       if data[p].ord < _m_ipaddr_trans_keys[_mid]
          _upper = _mid - 1
       elsif data[p].ord > _m_ipaddr_trans_keys[_mid]
          _lower = _mid + 1
       else
          _trans += (_mid - _keys)
          _break_match = true
          break
       end
    end # loop
    break if _break_match
    _keys += _klen
    _trans += _klen
 end
 _klen = _m_ipaddr_range_lengths[cs]
 if _klen > 0
    _lower = _keys
    _upper = _keys + (_klen << 1) - 2
    loop do
       break if _upper < _lower
       _mid = _lower + (((_upper-_lower) >> 1) & ~1)
       if data[p].ord < _m_ipaddr_trans_keys[_mid]
         _upper = _mid - 2
       elsif data[p].ord > _m_ipaddr_trans_keys[_mid+1]
         _lower = _mid + 2
       else
         _trans += ((_mid - _keys) >> 1)
         _break_match = true
         break
       end
    end # loop
    break if _break_match
    _trans += _klen
 end
	end while false
	cs = _m_ipaddr_trans_targs[_trans]
	end
	if _goto_level <= _again
	if cs == 0
_goto_level = _out
next
	end
	p += 1
	if p != pe
_goto_level = _resume
next
	end
	end
	if _goto_level <= _test_eof
	end
	if _goto_level <= _out
break
	end
	end
	end

# line 23 "lib/uri_scanner/ip_address.rl"
  cs >= m_ipaddr_first_final
end