home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / EXTRAS / UUCODE / UUPC / TEST / UPC12ES1.ZIP / LIB / hostable.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-11  |  6.5 KB  |  138 lines

  1. /*--------------------------------------------------------------------*/
  2. /*    h  o s t a b l e . h                                            */
  3. /*                                                                    */
  4. /*    Routines included in hostable.c                                 */
  5. /*--------------------------------------------------------------------*/
  6.  
  7. /*--------------------------------------------------------------------*/
  8. /*    Changes Copyright (c) 1990-1993 by Kendra Electronic            */
  9. /*    Wonderworks.                                                    */
  10. /*                                                                    */
  11. /*    All rights reserved except those explicitly granted by the      */
  12. /*    UUPC/extended license agreement.                                */
  13. /*--------------------------------------------------------------------*/
  14.  
  15. /*--------------------------------------------------------------------*/
  16. /*                          RCS Information                           */
  17. /*--------------------------------------------------------------------*/
  18.  
  19.  /*
  20.   *   $Id: hostable.h 1.4 1993/10/12 01:21:25 ahd Exp $
  21.   *
  22.   *   $Log: hostable.h $
  23.  *     Revision 1.4  1993/10/12  01:21:25  ahd
  24.  *     Normalize comments to PL/I style
  25.  *
  26.  *     Revision 1.3  1993/07/06  10:57:42  ahd
  27.  *     Under Windows/NT pack structure to insure proper alignment
  28.  *
  29.   *    Revision 1.2  1992/12/30  12:52:31  dmwatt
  30.   *    Use shorts for table to insure compatiablity across 32 bit/16 bit OSes
  31.   *
  32.   *
  33.   *   18Mar90     Create from router.c
  34.   *   21Dec92     Make all "enum hostatus"'s into unsigned shorts for
  35.   *               NT portability
  36.   */
  37.  
  38. #ifndef __HOSTABLE
  39. #define __HOSTABLE
  40.  
  41. #ifndef __LIB
  42. #error Need "LIB.H"
  43. #endif
  44.  
  45. #define UUCPSHELL "uucp"         /* Shell for UUCP users               */
  46. #define ANONYMOUS_HOST "*anonymous" /* Anonymous systems               */
  47.  
  48. #define BADHOST NULL
  49.  
  50. #define HOSTLEN   8           /* max length of host name without '\0'  */
  51.  
  52. /*--------------------------------------------------------------------*/
  53. /*    Note in the following table that "fake" hosts must precede      */
  54. /*    "nocall" and "real" hosts must follow it.                       */
  55. /*--------------------------------------------------------------------*/
  56.  
  57. typedef enum
  58.                 { phantom = 0,      /* Entry not fully initialized     */
  59.                   localhost,        /* This entry is for ourselves     */
  60.                   gatewayed,        /* This entry is delivered to via  */
  61.                                     /* an external program on local sys */
  62.                   nocall,           /* real host, never called         */
  63.                   autodial,         /* Dialing the phone now           */
  64.                   invalid_device,   /* Invalid systems file            */
  65.                   nodevice,         /* Could not open device           */
  66.                   startup_failed,   /* Determined system, start failed */
  67.                   inprogress,       /* Call now active                 */
  68.                   callback_req,     /* System must call us back        */
  69.                   dial_script_failed,
  70.                                     /* Modem initialize failed         */
  71.                   dial_failed,      /* Hardcoded auto-dial failed      */
  72.                   script_failed,    /* script in L.SYS failed          */
  73.                   max_retry,        /* Have given up calling this sys  */
  74.                   too_soon,         /* In retry mode, too soon to call */
  75.                   succeeded,        /* self-explanatory                */
  76.                   wrong_host,       /* Call out failed, wrong system   */
  77.                   unknown_host,     /* Call in failed, unknown system  */
  78.                   call_failed,      /* Connection aborted for various
  79.                                        reasons                         */
  80.                   wrong_time,       /* Unable to call because of time  */
  81.                   called,           /* success this run of UUCICO      */
  82.                   last_status }
  83.                         hostatus;
  84.  
  85. /*--------------------------------------------------------------------*/
  86. /*                          Status information                        */
  87. /*--------------------------------------------------------------------*/
  88.  
  89. #if defined(WIN32)
  90. #pragma pack(1)
  91. #endif
  92.  
  93. struct HostStats {
  94.       time_t ltime;              /* Last time this host was called     */
  95.       time_t lconnect;           /* Last time we actually connected    */
  96.       unsigned long calls;       /* Total number of calls to host      */
  97.       unsigned long connect;     /* Total length of connections to host */
  98.       unsigned long fsent;       /* Total files sent to this host      */
  99.       unsigned long freceived;   /* Total files received from this host */
  100.       unsigned long bsent;       /* Total bytes sent to this host      */
  101.       unsigned long breceived;   /* Total bytes received from this host */
  102.       unsigned long errors;      /* Total transmission errors noted    */
  103.       unsigned long packets;     /* Total packets exchanged            */
  104.       unsigned short save_hstatus;
  105.    };
  106.  
  107. #if defined(WIN32)
  108. #pragma pack()
  109. #endif
  110.  
  111. /*--------------------------------------------------------------------*/
  112. /*                          Master hostable                           */
  113. /*--------------------------------------------------------------------*/
  114.  
  115. struct  HostTable {
  116.       char  *hostname;           /* Name of the host in question       */
  117.       char  *via;                /* Host hostname is routed via        */
  118.       char  *realname;           /* Alias of this host name            */
  119.       struct HostStats *hstats;  /* Point to stats for real hosts only */
  120.       struct HostSecurity *hsecure; /* Security Information, real hosts
  121.                                        only                            */
  122.       boolean anylogin;          /* TRUE = Can login with any generic
  123.                                     user id                            */
  124.       boolean  aliased;          /* TRUE = alias has been optimized    */
  125.       boolean  routed;           /* TRUE = route has been optimized    */
  126.       unsigned short hstatus;          /* host status, as defined by hostatus */
  127.    };
  128.  
  129. struct HostTable *searchname(const char *name, const size_t namel);
  130.  
  131. struct HostTable *checkname(const char *name);
  132.  
  133. struct HostTable *checkreal(const char *name);
  134.  
  135. struct HostTable *nexthost( const boolean start );
  136.  
  137. #endif
  138.