Skip to content

Commit 87a1555

Browse files
committed
Remove excessive whitespace
1 parent ac2abdb commit 87a1555

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

lib/truffle/socket/addrinfo.rb

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -297,94 +297,73 @@ def ip_unpack
297297

298298
def ipv4_loopback?
299299
return false unless ipv4?
300-
301300
Truffle::Socket::Foreign.inet_network(ip_address) & 0xff000000 == 0x7f000000
302301
end
303302

304303
def ipv4_multicast?
305304
return false unless ipv4?
306-
307305
Truffle::Socket::Foreign.inet_network(ip_address) & 0xf0000000 == 0xe0000000
308306
end
309307

310308
def ipv4_private?
311309
return false unless ipv4?
312-
313310
num = Truffle::Socket::Foreign.inet_network(ip_address)
314-
315311
num & 0xff000000 == 0x0a000000 ||
316312
num & 0xfff00000 == 0xac100000 ||
317313
num & 0xffff0000 == 0xc0a80000
318314
end
319315

320316
def ipv6_loopback?
321317
return false unless ipv6?
322-
323318
Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address) ==
324319
Truffle::Socket::IPv6::LOOPBACK
325320
end
326321

327322
def ipv6_linklocal?
328323
return false unless ipv6?
329-
330324
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
331-
332325
bytes[0] == 0xfe && bytes[1] >= 0x80
333326
end
334327

335328
def ipv6_multicast?
336329
return false unless ipv6?
337-
338330
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
339-
340331
bytes[0] == 0xff
341332
end
342333

343334
def ipv6_sitelocal?
344335
return false unless ipv6?
345-
346336
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
347-
348337
bytes[0] == 0xfe && bytes[1] >= 0xe0
349338
end
350339

351340
def ipv6_mc_global?
352341
return false unless ipv6?
353-
354342
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
355-
356343
bytes[0] == 0xff && bytes[1] & 0xf == 0xe
357344
end
358345

359346
def ipv6_mc_linklocal?
360347
return false unless ipv6?
361-
362348
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
363-
364349
bytes[0] == 0xff && bytes[1] & 0xf == 0x2
365350
end
366351

367352
def ipv6_mc_nodelocal?
368353
return false unless ipv6?
369-
370354
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
371-
372355
bytes[0] == 0xff && bytes[1] & 0xf == 0x1
373356
end
374357

375358
def ipv6_mc_orglocal?
376359
return false unless ipv6?
377-
378360
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
379-
380361
bytes[0] == 0xff && bytes[1] & 0xf == 0x8
381362
end
382363

383364
def ipv6_mc_sitelocal?
384365
return false unless ipv6?
385-
386366
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
387-
388367
bytes[0] == 0xff && bytes[1] & 0xf == 0x5
389368
end
390369

@@ -402,33 +381,25 @@ def ipv6_to_ipv4
402381

403382
def ipv6_unspecified?
404383
return false unless ipv6?
405-
406384
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
407-
408385
bytes == Truffle::Socket::IPv6::UNSPECIFIED
409386
end
410387

411388
def ipv6_v4compat?
412389
return false unless ipv6?
413-
414390
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
415-
416391
Truffle::Socket::IPv6.ipv4_compatible?(bytes)
417392
end
418393

419394
def ipv6_v4mapped?
420395
return false unless ipv6?
421-
422396
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
423-
424397
Truffle::Socket::IPv6.ipv4_mapped?(bytes)
425398
end
426399

427400
def ipv6_unique_local?
428401
return false unless ipv6?
429-
430402
bytes = Truffle::Socket::Foreign.ip_to_bytes(afamily, ip_address)
431-
432403
bytes[0] == 0xfc || bytes[0] == 0xfd
433404
end
434405

0 commit comments

Comments
 (0)