4
# Copyright (C) 2002 Thomas Habets <thomas@habets.pp.se>
6
# This library is free software; you can redistribute it and/or
7
# modify it under the terms of the GNU General Public
8
# License as published by the Free Software Foundation; either
9
# version 2 of the License, or (at your option) any later version.
11
# This library is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
# General Public License for more details.
16
# You should have received a copy of the GNU General Public License along
17
# with this program; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23
if [ "$1" = "" ]; then
25
echo "Usage: $0 <mac address>"
27
echo " Sorry, it's not more configurable than that, edit the source"
33
# seq doesnt exist on some retarded boxen, comment out if your box is too
34
# stupid to have bc and/or tr
35
seq() { echo "for (i=$1; i<=$2; i++) i;" | bc | tr "\012" " "; }
38
# first number after 'seq' is range start, second is range end
40
# default is [192-192].[168-168].[0-0].[0-255]
43
# I may put this functionality into ARPing one day if people seem to like it.
45
for a in $(seq 192 192); do
46
for b in $(seq 168 168); do
47
for c in $(seq 0 0); do
48
for d in $(seq 0 255); do
49
sh -c "arping -A -q -c 1 -T $a.$b.$c.$d $TARGET_MAC
51
echo Got answer with address: $a.$b.$c.$d