home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume30 / log_tcp / part02 / rfc931_option < prev    next >
Encoding:
Text File  |  1992-06-20  |  2.0 KB  |  70 lines

  1. *** fromhost.c.orig    Tue Jun  9 19:38:26 1992
  2. --- fromhost.c    Thu Jun 11 20:39:31 1992
  3. ***************
  4. *** 90,96 ****
  5.   int     fromhost(f)
  6.   struct from_host *f;
  7.   {
  8. !     struct sockaddr sa;
  9.       struct sockaddr_in *sin = (struct sockaddr_in *) (&sa);
  10.       struct hostent *hp;
  11.       int     length = sizeof(sa);
  12. --- 90,96 ----
  13.   int     fromhost(f)
  14.   struct from_host *f;
  15.   {
  16. !     static struct sockaddr sa;
  17.       struct sockaddr_in *sin = (struct sockaddr_in *) (&sa);
  18.       struct hostent *hp;
  19.       int     length = sizeof(sa);
  20. ***************
  21. *** 143,156 ****
  22.       }
  23.       /* Save the host address. A later inet_ntoa() call may clobber it. */
  24.   
  25.       f->addr = strcpy(addr_buf, inet_ntoa(sin->sin_addr));
  26. -     /* Look up the remote user name. Does not work for UDP services. */
  27. - #ifdef RFC931
  28. -     if (f->sock_type == FROM_CONNECTED)
  29. -     f->user = rfc931_name(sin);
  30. - #endif
  31.   
  32.       /* Look up the remote host name. */
  33.   
  34. --- 143,150 ----
  35.       }
  36.       /* Save the host address. A later inet_ntoa() call may clobber it. */
  37.   
  38. +     f->sin = sin;
  39.       f->addr = strcpy(addr_buf, inet_ntoa(sin->sin_addr));
  40.   
  41.       /* Look up the remote host name. */
  42.   
  43. *** log_tcp.h.orig    Thu Jun 11 19:16:27 1992
  44. --- log_tcp.h    Thu Jun 11 20:39:30 1992
  45. ***************
  46. *** 21,26 ****
  47. --- 21,27 ----
  48.       char   *name;            /* host name */
  49.       char   *addr;            /* host address */
  50.       char   *user;            /* user name */
  51. +     struct sockaddr_in *sin;        /* remote link info */
  52.   };
  53.   
  54.   #define FROM_UNKNOWN    "unknown"    /* name or address lookup failed */
  55. *** options.c.orig    Thu Jun 11 19:15:58 1992
  56. --- options.c    Thu Jun 11 20:39:31 1992
  57. ***************
  58. *** 86,91 ****
  59. --- 86,93 ----
  60.   
  61.   /* List of functions that implement the options. Add yours here. */
  62.   
  63. + #define RFC931_OPTION            /* rfc 931 is a run-time option */
  64.   static void user_option();        /* execute "user=name" option */
  65.   static void group_option();        /* execute "group=name" option */
  66.   static void twist_option();        /* execute "twist=command" option */
  67.