home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume30 / log_tcp / part02 / log_tcp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-20  |  1.4 KB  |  45 lines

  1. /* @(#) log_tcp.h 1.2 92/06/11 22:21:30 */
  2.  
  3. /* Location of the access control files. */
  4.  
  5. #define HOSTS_ALLOW    "/etc/hosts.allow"
  6. #define HOSTS_DENY    "/etc/hosts.deny"
  7.  
  8.  /*
  9.   * Structure filled in by the fromhost() routine. Prerequisites:
  10.   * <sys/types.h> and <sys/param.h>.
  11.   */
  12.  
  13. #ifndef MAXHOSTNAMELEN
  14. #define MAXHOSTNAMELEN    1024        /* string with host name */
  15. #endif
  16.  
  17. #define FROM_ADDRLEN    (4*3+3+1)    /* string with IP address */
  18.  
  19. struct from_host {
  20.     int     sock_type;            /* socket type, see below */
  21.     char   *name;            /* host name */
  22.     char   *addr;            /* host address */
  23.     char   *user;            /* user name */
  24. };
  25.  
  26. #define FROM_UNKNOWN    "unknown"    /* name or address lookup failed */
  27. #define FROM_HOST(f) \
  28.     (((f)->name[0] && strcmp((f)->name, FROM_UNKNOWN)) ? (f)->name : (f)->addr)
  29.  
  30. /* Socket types: 0 means unknown. */
  31.  
  32. #define FROM_CONNECTED        1    /* connection-oriented */
  33. #define FROM_UNCONNECTED    2    /* non connection-oriented */
  34.  
  35. /* Global functions. */
  36.  
  37. extern int fromhost();            /* get/validate remote host info */
  38. extern int hosts_access();        /* access control */
  39. extern void refuse();            /* refuse request */
  40. extern void shell_cmd();        /* execute shell command */
  41. extern void percent_x();        /* do %<char> expansion */
  42. extern char *rfc931_name();        /* remote name from RFC 931 daemon */
  43. extern char *hosts_info();        /* show origin of connection */
  44. extern void clean_exit();        /* clean up and exit */
  45.