144743Smarkm /*
244743Smarkm  * hosts_ctl() combines common applications of the host access control
344743Smarkm  * library routines. It bundles its arguments then calls the hosts_access()
444743Smarkm  * access control checker. The host name and user name arguments should be
544743Smarkm  * empty strings, STRING_UNKNOWN or real data. If a match is found, the
644743Smarkm  * optional shell command is executed.
744743Smarkm  *
844743Smarkm  * Restriction: this interface does not pass enough information to support
944743Smarkm  * selective remote username lookups or selective hostname double checks.
1044743Smarkm  *
1144743Smarkm  * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
1244743Smarkm  */
1344743Smarkm
1444743Smarkm#ifndef lint
1544743Smarkmstatic char sccsid[] = "@(#) hosts_ctl.c 1.4 94/12/28 17:42:27";
1644743Smarkm#endif
1744743Smarkm
1844743Smarkm#include <stdio.h>
1944743Smarkm
2044743Smarkm#include "tcpd.h"
2144743Smarkm
2244743Smarkm/* hosts_ctl - limited interface to the hosts_access() routine */
2344743Smarkm
2444743Smarkmint     hosts_ctl(daemon, name, addr, user)
2544743Smarkmchar   *daemon;
2644743Smarkmchar   *name;
2744743Smarkmchar   *addr;
2844743Smarkmchar   *user;
2944743Smarkm{
3044743Smarkm    struct request_info request;
3144743Smarkm
3244743Smarkm    return (hosts_access(request_init(&request,
3344743Smarkm				      RQ_DAEMON, daemon,
3444743Smarkm				      RQ_CLIENT_NAME, name,
3544743Smarkm				      RQ_CLIENT_ADDR, addr,
3644743Smarkm				      RQ_USER, user,
3744743Smarkm				      0)));
3844743Smarkm}
39