summaryrefslogtreecommitdiffstats
path: root/abs/core/tweaker/bin/LocalIPCheck.pl
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-12-01 18:26:09 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-12-01 18:26:22 (GMT)
commite2c33b0fae1fa4af8bbbfc917eb8e13a3ac0cb37 (patch)
treebee3fe89f2988dd244e11791755e129aa8c03b14 /abs/core/tweaker/bin/LocalIPCheck.pl
parent8132c218cfc1f1acb1c6d12154e0d4ca075e77f2 (diff)
downloadlinhes_pkgbuild-e2c33b0fae1fa4af8bbbfc917eb8e13a3ac0cb37.zip
linhes_pkgbuild-e2c33b0fae1fa4af8bbbfc917eb8e13a3ac0cb37.tar.gz
linhes_pkgbuild-e2c33b0fae1fa4af8bbbfc917eb8e13a3ac0cb37.tar.bz2
Mass move of uncompiled packages to abs_not_built.
The will sit here for a bit, and then will be removed completely if no one claims them.
Diffstat (limited to 'abs/core/tweaker/bin/LocalIPCheck.pl')
-rwxr-xr-xabs/core/tweaker/bin/LocalIPCheck.pl47
1 files changed, 0 insertions, 47 deletions
diff --git a/abs/core/tweaker/bin/LocalIPCheck.pl b/abs/core/tweaker/bin/LocalIPCheck.pl
deleted file mode 100755
index b744fb6..0000000
--- a/abs/core/tweaker/bin/LocalIPCheck.pl
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/perl
-
-# Valid private IP ranges
-
-my @LOCAL_IP_RANGES = ("10.0.0.0", "10.255.255.255",
- "172.16.0.0", "172.31.255.255",
- "192.168.0.0", "192.168.255.255");
-
-# input: A dotted quad IP address.
-
-# output: 0 if a public (internet) address
-# : 8 if a class A private (LAN) address
-# : 12 if a class B private (LAN) address
-# : 16 if a class C private (LAN) address
-
-sub get_IP_number () {
- my ($dotted_quad) = @_;
- my $IP_number=0;
-
- split(/\./, $dotted_quad);
-
- for (my $i=0; $i < 4; $i++) {
- $IP_number=$IP_number+@_[3-$i]*(2**(8*$i));
- }
- return $IP_number;
-}
-
-while(<>) {
- chop;
- my $IPnumber=&get_IP_number($_);
- my $class=16;
-
- while (@LOCAL_IP_RANGES) {
- my $highIPnumber = &get_IP_number(pop(@LOCAL_IP_RANGES));
- my $lowIPnumber = &get_IP_number(pop(@LOCAL_IP_RANGES));
-
- if (($lowIPnumber <= $IPnumber) && ($highIPnumber >= $IPnumber)) {
- exit($class); # PRIVATE IP
- } else {
- $class += 4;
- }
- }
-}
-
-exit(0); # PUBLIC IP
-
-