3 # This file is part of the aMule project.
5 # Copyright (c) 2003-2011 aMule Team ( admin@amule.org / http://www.amule.org )
6 # Copyright (c) 2004-2011 xmb ( http://xmb.ath.cx )
7 # Copyright (c) 2004-2011 Jacobo Vilella (Jacobo221)
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License
11 # as published by the Free Software Foundation; either
12 # version 2 of the License, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 ##########################################
26 # Convert eD2k HighID numbers to IPs #
28 ##########################################
30 # Original code: xmb #
31 # Further code improvements: Jacobo221 #
33 # Contact: IRC @ irc.freenode.net/#awk #
34 # jacobo221 at @amule dot org #
36 ##########################################
38 # This code is distributed under terms #
39 # of the GPL license #
40 # http://www.gnu.org/copyleft/gpl.html #
42 ##########################################
44 # Usage: id2ip.awk ID <...> #
46 ##########################################
51 printf "Usage: id2ip.awk ID <...>\n"
55 while (num =
ARGV[++i
]) {
57 if (ARGV[i
] < 16777216) {
58 printf "%s -> LowID\n",ARGV[i
]
59 } else if (ARGV[i
] > 256*256*256*256) {
60 printf "%s -> Invalid IP\n",ARGV[i
]
65 for (c =
0; m
> 0; c
++ ) {
71 printf "%s -> %d.%d.%d.%d\n", ARGV[i
], IP
[3], IP
[2], IP
[1], IP
[0]