5bfc13fc6791c0b123d4f4400ab284103cf0ffaf
5 OUIDIR
=/var
/cache
/mac-to-devinfo
10 echo "Usage: $0 IP-Range [-r ratelimit] [-i interface] [-x] [port,port,...]"
12 if [ "$1" == "-h" ] ||
[ "$2" == "-h" ] ||
[ "$3" == "-h" ] ||
[ -z "$1" ]; then
20 if [ "$1" == "-r" ]; then
22 if [ -z "$RATELIMIT" ]; then
23 echo "-r without a ratelimit"
31 if [ "$1" == "-i" ]; then
33 if [ -z "$INTERFACE" ]; then
34 echo "-i without interface"
42 if [ "$1" == "-x" ]; then
50 if [ -z "$(echo $PORTLIST | grep ',')" ]; then
55 curport
="$(echo $PORTLIST | cut -f$FIELD -d, )"
56 while [ "$curport" != "$oldcurport" ]; do
57 PORTS
="$curport $PORTS"
59 oldcurport
="$(echo $PORTLIST | cut -f$FIELD -d, )"
60 curport
="$(echo $PORTLIST | cut -f$FIELD -d, )"
67 if [ -z "$PORTS" ]; then
71 for port
in $PORTS; do
73 if [ "$XIP_SCANS" == "TRUE" ]; then
76 for sip_device
in $
($SMAP $RATELIMIT -p $port $IPRANGE |
grep -E -v 'host.? scanned' |
grep 'SIP enabled' | cut
-f1 -d: ); do
77 if [ -x "$(which httping)" ]; then
78 if httping
-G -q -o 401,200 -c 2 -h $sip_device; then
79 echo "$sip_device"" | ""$($IPTODEV $INTERFACE $XIP_PORT $sip_device)"" | ""http://$sip_device/"
83 echo "$sip_device"" | ""$(IPTODEV $XIP_PORT $sip_device)"" | "" - "