/*
 * ASCEND: @(#)protos.h	1.3 (95/07/25 00:55:32)
 *
 *      Copyright (c) 1995 Ascend Communications, Inc.
 *      All rights reserved.
 *
 *	Permission to copy all or part of this material for any purpose is
 *	granted provided that the above copyright notice and this paragraph
 *	are duplicated in all copies.  THIS SOFTWARE IS PROVIDED ``AS IS''
 *	AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
 *	LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 *	FOR A PARTICULAR PURPOSE.
 */

#if defined(__STDC__) && (__STDC__ == 1)
#	define	P__(s)	s
#	define	CONST	const
#else
#	define	P__(s)	(/* s */)
#	define	CONST	/* const */
#endif

	/* function prototypes */
#if defined(SOLARIS)
	extern int getopt P__((int, char *CONST *, CONST char *));
	extern int gettimeofday P__((struct timeval *tp));
#else
	extern int gettimeofday P__((struct timeval *tp, struct timezone *tzp));
#endif
extern void radversion P__((void));
extern char *get_errmsg P__((int errcode));
extern AUTH_REQ *authenticateAcctReq P__((AUTH_REQ *authreq, AUTH_HDR *auth));
#if(0)	/* parameter promotion due to old-style function definition */
extern AUTH_REQ *radrecv P__((UINT4 host, u_short udp_port, u_char *buffer, int length, char *isAcctPkt));
#else
extern AUTH_REQ *radrecv P__((UINT4 host, int udp_port, u_char *buffer, int length, char *isAcctPkt));
#endif
extern DICT_ATTR *dict_attrfind P__((char *attrname));
extern DICT_ATTR *dict_attrget P__((int attribute));
extern DICT_VALUE *dict_valfind P__((char *valname));
extern DICT_VALUE *dict_valget P__((UINT4 value, char *attrname));
extern UINT4 get_ipaddr P__((char *host));
extern UINT4 ipstr2long P__((char *ip_str));
extern char *ip_hostname P__((UINT4 ipaddr));
extern int get_client_info P__((UINT4 rqstIpAddr, UINT4 *ipaddr, u_char *secret, char *hostnm));
extern int calc_digest P__((u_char *digest, AUTH_REQ *authreq));
extern int config_init P__((void));
extern int dict_init P__((void));
extern int filterBinary P__((VALUE_PAIR *pair, char *valstr));
extern int good_ipaddr P__((char *addr));
extern int kill P__((pid_t pid, int sig));
extern int log_err P__((char *msg));
extern int pw_expired P__((UINT4 exptime, UINT4 usr_exp_days, UINT4 usr_warn_days));
extern int rad_spawn_child P__((AUTH_REQ *authreq, int activefd));
#if(0)	/* parameter promotion due to old-style function definition */
extern int radrespond P__((AUTH_REQ *authreq, int activefd, char isAcctPkt));
#else
extern int radrespond P__((AUTH_REQ *authreq, int activefd, int isAcctPkt));
#endif
extern int set_expiration P__((VALUE_PAIR *user_check, UINT4 expiration));
extern int unix_pass P__((char *name, char *passwd));
extern int user_find P__((char *name, VALUE_PAIR **check_pairs, VALUE_PAIR **reply_pairs));
extern int user_update P__((char *name, VALUE_PAIR *user_check, VALUE_PAIR *user_reply));
extern void debug_pair P__((FILE *fd, VALUE_PAIR *pair));
extern void fprint_attr_val P__((FILE *fd, VALUE_PAIR *pair));
extern void ipaddr2str P__((char *buffer, UINT4 ipaddr));
extern void md5_calc P__((unsigned char *output, unsigned char *input, unsigned int inlen));
extern void pairfree P__((VALUE_PAIR *pair));
extern void rad_accounting P__((AUTH_REQ *authreq, int activefd));
extern void rad_authenticate P__((AUTH_REQ *authreq, int activefd));
extern void rad_passchange P__((AUTH_REQ *authreq, int activefd));
extern void send_accept P__((AUTH_REQ *authreq, VALUE_PAIR *reply, char *msg, int activefd));
extern void send_accounting_response P__((AUTH_REQ *authreq, int activefd, char *msg));
extern PasswordType getPasswordType P__((char *pwd));
extern UINT4 get_attr_lvalue P__((VALUE_PAIR *list, int attribute));
extern char *get_attr_strvalue P__((VALUE_PAIR *list, int attribute));
extern void send_acct_reply P__((AUTH_REQ *authreq, VALUE_PAIR *reply, char *msg, int activefd));
extern void send_challenge P__((AUTH_REQ *authreq, char *msg, int msgLen, char *state, int stateLen, int activefd));
extern void send_newpin P__((AUTH_REQ *authreq, char *state, int stateLen, int activefd));
extern void send_nextcode P__((AUTH_REQ *authreq, char *msg, int msgLen, char *state, int stateLen, int activefd));
extern void send_pwack P__((AUTH_REQ *authreq, int activefd));
extern void send_pwexpired P__((AUTH_REQ *authreq, char *msg, int activefd));
extern void make_secret P__((u_char *digest, u_char *vector, u_char *secret, char *value));
extern void send_reject P__((AUTH_REQ *authreq, char *msg, int activefd));
extern void sig_cleanup P__((int sig));
extern void sig_fatal P__((int sig));
extern void sig_hup P__((int sig));
extern int user_read P__((FILE **userfd, char *name, char *content));
extern void warn P__((char *msg));
