home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / TCPIP / NETKIT-A.06 / NETKIT-A / NetKit-A-0.06 / tcp_wrapper-6.3 / hosts_ctl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-27  |  1.0 KB  |  39 lines

  1.  /*
  2.   * hosts_ctl() combines the most common applications of the host access
  3.   * control library. routine. It bundles its arguments into a client_info
  4.   * structure, then calls the hosts_access() access control checker. The host
  5.   * name and user name arguments should be empty strings, "unknown" or real
  6.   * data. If a match is found, the optional shell command is executed.
  7.   * 
  8.   * Restriction: this interface does not pass enough information to support
  9.   * selective remote username lookups.
  10.   * 
  11.   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
  12.   */
  13.  
  14. #ifndef lint
  15. static char sccsid[] = "@(#) hosts_ctl.c 1.3 93/09/24 19:48:26";
  16. #endif
  17.  
  18. #include <stdio.h>
  19.  
  20. #include "log_tcp.h"
  21.  
  22. /* hosts_ctl - general interface for the hosts_access() routine */
  23.  
  24. int     hosts_ctl(daemon, name, addr, user)
  25. char   *daemon;
  26. char   *name;
  27. char   *addr;
  28. char   *user;
  29. {
  30.     struct client_info client;
  31.  
  32.     init_client (&client);
  33.     client.name = name;
  34.     client.addr = addr;
  35.     client.user = user;
  36.  
  37.     return (hosts_access(daemon, &client));
  38. }
  39.