## $Id: rewrite,v 1.7 2001/05/11 11:42:00 gray Exp $
##

## This is a minimum rewrite file. It contains only functions
## needed for checrad. Should you need other functions,
## please copy them here from file raddb/rewrite.full. 
##
## Also, should you write any new useful functions, please let
## me know.

############################################################################
# Checkrad functions. Do not remove them
#
integer
check_snmp_u(string str, string name, integer pid, string sid)
{
	logit("check_snmp_u: got " + str);
	return str == name;
}

integer
check_snmp_s(string str, string name, integer pid, string sid)
{
	logit("check_snmp_s: got " + str);
	return str == sid;
}

integer
decimal(string s)
{
	return (integer)("0x" + s);
}

integer
check_max_finger(string str, string name, integer pid, string sid)
{
	logit("check_snmp_s: got " + str + " " + (string)pid + " " + sid);
	return (integer) field(str, 2) == decimal(sid) &&
	       field(str, 9) == name;
}	

integer
check_unix(string str, string name, integer pid, string sid)
{
        logit("check_unix: got " + str + " " + (string)pid + " " + sid);

        return field(str, 1) == name &&
               field(str, 2) == sid; /* &&
               (integer)field(str, 4) == pid; */
}
