home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / uucp / auucp+-1.02 / fuucp_plus_src.lzh / sendmail / addr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-19  |  5.6 KB  |  136 lines

  1. /* @(#)addr.h    3.13 2/4/89 15:16:00 */
  2.  
  3. /*
  4.  *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  5.  *
  6.  * See the file COPYING, distributed with smail, for restriction
  7.  * and warranty information.
  8.  */
  9.  
  10. /*
  11.  * addr.h:
  12.  *    interface file for routines in addr.c
  13.  */
  14.  
  15. /* types used in addr.h */
  16. /*
  17.  * addr - Everything needed to understand an address is stored in
  18.  *      here somewhere.
  19.  */
  20. struct addr {
  21.     struct addr *succ;        /* next addr in queue */
  22.     long flags;            /* miscellaneous flags */
  23.     struct addr *parent;    /* addr from which this one is derived */
  24.     struct addr *true_addr;    /* point to addr which had an error */
  25.     char *in_addr;        /* address from header or args */
  26.     char *target;        /* next explicit destination */
  27.     char *remainder;        /* address beyond explicit site */
  28.     char *work_addr;        /* working area */
  29.     int match_count;        /* chars of target matched by router */
  30.     char *route;        /* the route to the target */
  31.     struct router *router;    /* router used for route and next_host */
  32.     struct director *director;    /* director which matched address */
  33.     char *next_host;        /* next-hop host to receive message */
  34.     char *next_addr;        /* address to give next-hop host */
  35.     struct transport *transport; /* transport to use for remote delivery */
  36.     char *home;            /* home directory associated with login */
  37.     int uid;            /* user for pipes/files perms or BOGUS_USER */
  38.     int gid;            /* gid for pipes/files perms or BOGUS_GROUP */
  39.     struct error *error;    /* error message associated */
  40. };
  41.  
  42. /* structure for errors stored in the addr structure */
  43. struct error {
  44.     long info;                /* info associated with error */
  45.     char *message;            /* error message */
  46. };
  47.  
  48. /*
  49.  * The identify_addr structure is used to uniquely identify specific addr
  50.  * structures produced by resolve_addr_list().  The in_addr value in an
  51.  * addr structure is insufficient, by itself, to identify an addr structure,
  52.  * when that structure is a file or pipe form address.  It is, however,
  53.  * sufficient to give the parent address as well, if one exists.
  54.  */
  55. struct identify_addr {
  56.     struct identify_addr *succ;        /* this will be a linked list */
  57.     char *address;            /* the address of interest */
  58.     char *parent;            /* the parent of that address */
  59. };
  60.  
  61. /*
  62.  * The defer_addr structure is used to form a list of previously defer'd
  63.  * addresses.  This list is formed from the per-message logfile data, and
  64.  * is used to filter out redundant deferal messages.
  65.  */
  66. struct defer_addr {
  67.     struct defer_addr *succ;        /* this will be a linked list */
  68.     long error;                /* error number */
  69.     char *message;            /* deferal message */
  70.     char *address;            /* address defered */
  71.     char *parent;            /* parent of defered address */
  72. };
  73.  
  74. /*
  75.  * bits used in addr.flag
  76.  */
  77. #define ADDR_CAUTION    0x00000010    /* be cautious of this address */
  78. #define ADDR_UNSECURE    0x00000200    /* address from an unsecure source */
  79. #define ADDR_PUTDOT    0x00000400    /* dot removed from end of target */
  80. #define ADDR_MOVEDOT    0x00000800    /* end dot moved to front of target */
  81. #define ADDR_ERROR    0x00001000    /* error in resolving address */
  82. #define ADDR_FINISHED    0x00002000    /* address fully resolved */
  83. #define ADDR_FULLMATCH    0x00004000    /* router fully matched target */
  84. #define ADDR_DONTHASH    0x00008000    /* addr states should not be hashed */
  85. #define ADDR_SMARTUSER    0x00010000    /* smart user director already used */
  86. #define ADDR_SMARTHOST    0x00020000    /* smart host router already used */
  87. #define ADDR_NOTUSER    0x00040000    /* address is not a local user */
  88. #define ADDR_ISUSER    0x00080000    /* address is a local user */
  89. #define ADDR_FWDTYPE    0x00100000    /* director used was forwarding type */
  90. #define ADDR_ALIASTYPE    0x00200000    /* director used was aliasing type */
  91. #define ADDR_LISTTYPE    0x00400000    /* director was mailinglist type */
  92. #define ADDR_SHADOW    0x00800000    /* using shadow transport */
  93. #define ADDR_PARTLOCAL    0x01000000    /* partially matched local host */
  94. #define ADDR_FORM_MASK    0x0000000f    /* form from parse_address */
  95. /*
  96.  * NOTE:
  97.  *    Routers can set ADDR_SMARTHOST if the smarthost router should
  98.  *    not be used.  For example, if the local host is a gateway for
  99.  *    a domain and a hostname within that domain cannot be resolved,
  100.  *    then the router can set ADDR_SMARTHOST to prevent an incorrect
  101.  *    usage of the smarthost router.
  102.  *    Directors can set ADDR_SMARTUSER in a similar manner if this
  103.  *    ever proves useful.
  104.  *
  105.  * The ADDR_PARTLOCAL should also be set for partial matches to the local
  106.  * host.  If ADDR_PARTLOCAL is set for an address and ADDR_FULLMATCH
  107.  * is not set, the target is not considered to be resolved.
  108.  */
  109.  
  110. /* bits stored in error.info */
  111. #define ERR_MASK    0x0000ffffL    /* mask for the error number */
  112. #define ERR_NSENDER    0x00010000L    /* notify sender of message */
  113. #define ERR_NPOSTMAST    0x00020000L    /* notify postmaster */
  114. #define ERR_NSOWNER    0x00040000L    /* notify address owner or sender */
  115. #define ERR_NPOWNER    0x00080000L    /* notify owner or postmaster */
  116. #define ERR_CONFERR    0x00100000L    /* configuration error encountered */
  117.  
  118. /*
  119.  * user and group ids are preset to BOGUS_USER and BOGUS_GROUP in order
  120.  * to prevent them from being mistaken for root and wheel
  121.  */
  122. #define BOGUS_USER (-1)            /* not a valid user id */
  123. #define BOGUS_GROUP (-1)        /* not a valid group id */
  124.  
  125. /* return values from parse_address */
  126. #define PARSE_ERROR    0        /* error in parsing */
  127. #define RFC_ROUTE    1        /* route part of a route-addr */
  128. #define RFC_ENDROUTE    2        /* last component of a route */
  129. #define MAILBOX        3        /* standard user@foo mailbox */
  130. #define UUCP_ROUTE    4        /* uucp !-route */
  131. #define PCT_MAILBOX    5        /* non-standard user%foo mailbox */
  132. #define LOCAL        6        /* local address */
  133. #define BERKENET    7        /* berkenet host:user form */
  134. #define DECNET        8        /* decnet host::user form */
  135.  
  136.