home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / in4wjcxu / other / irc / include / res.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-14  |  1.3 KB  |  64 lines

  1. /*
  2.  * irc2.7.2/ircd/res.h (C)opyright 1992 Darren Reed.
  3.  */
  4. #ifndef    __res_include__
  5. #define    __res_include__
  6.  
  7. #define    RES_INITLIST    1
  8. #define    RES_CALLINIT    2
  9. #define RES_INITSOCK    4
  10. #define RES_INITDEBG    8
  11. #define RES_INITCACH    16
  12.  
  13. #define MAXPACKET    1024
  14. #define MAXALIASES    35
  15. #define MAXADDRS    35
  16.  
  17. #define    AR_TTL        600    /* TTL in seconds for dns cache entries */
  18.  
  19. struct    hent {
  20.     char    *h_name;    /* official name of host */
  21.     char    *h_aliases[MAXALIASES];    /* alias list */
  22.     int    h_addrtype;    /* host address type */
  23.     int    h_length;    /* length of address */
  24.     /* list of addresses from name server */
  25.     struct    in_addr    h_addr_list[MAXADDRS];
  26. #define    h_addr    h_addr_list[0]    /* address, for backward compatiblity */
  27. };
  28.  
  29. typedef    struct    reslist {
  30.     int    id;
  31.     int    sent;    /* number of requests sent */
  32.     int    srch;
  33.     time_t    ttl;
  34.     char    type;
  35.     char    retries; /* retry counter */
  36.     char    sends;    /* number of sends (>1 means resent) */
  37.     char    resend;    /* send flag. 0 == dont resend */
  38.     time_t    sentat;
  39.     time_t    timeout;
  40.     struct    in_addr    addr;
  41.     char    *name;
  42.     struct    reslist    *next;
  43.     Link    cinfo;
  44.     struct    hent he;
  45.     } ResRQ;
  46.  
  47. typedef    struct    cache {
  48.     time_t    expireat;
  49.     time_t    ttl;
  50.     struct    hostent    he;
  51.     struct    cache    *hname_next, *hnum_next, *list_next;
  52.     } aCache;
  53.  
  54. typedef struct    cachetable {
  55.     aCache    *num_list;
  56.     aCache    *name_list;
  57.     } CacheTable;
  58.  
  59. #define ARES_CACSIZE    101
  60.  
  61. #define    MAXCACHED    81
  62.  
  63. #endif /* __res_include__ */
  64.