#!BOURNESHELL
#	program:	netname and gw (same code for both tools)
#	input:		network address in normal format ("134.114.64").
#	output:		network-name domain record,
#			or the word "ERROR" (distinguishable from a real
#			record because it has no period on the end).
#	exit value:	0 if succeeds, 1 if fails (and "ERROR" output).

AWK=DOMLIB/digoutany.awk

if test $# -ne 1; then
	echo "usage: $0 net-IP-addr" >&2
	echo 'ERROR'
	exit 1
fi

# Force network number into host-zero, in-addr format:
addr=`DOMBIN/netwithzeros $1`
net=`DOMBIN/f2iaddr $addr`

DOMBIN/ptr $net
status=$?
if test $status -ne 0; then
#	echo 'ERROR'		already generated by ptr tool
	exit 1
fi

exit $status
