home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / h / auth.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-18  |  2.7 KB  |  148 lines

  1. /* auth.h: authorisation */
  2.  
  3. /*
  4.  * @(#) $Header: /xtel/pp/pp-beta/h/RCS/auth.h,v 6.0 1991/12/18 20:42:44 jpo Rel $
  5.  *
  6.  * $Log: auth.h,v $
  7.  * Revision 6.0  1991/12/18  20:42:44  jpo
  8.  * Release 6.0
  9.  *
  10.  *
  11.  */
  12.  
  13.  
  14.  
  15. #ifndef _H_AUTH
  16. #define _H_AUTH
  17.  
  18. #include "list_bpt.h"
  19.  
  20.  
  21. #define MAX_AUTH_ARGS            100
  22. #define AUTH_SEPERATOR            '|'
  23.  
  24.  
  25. /* command table values */
  26. #define    AUTH_LOGLEVEL_LOW    1
  27. #define    AUTH_LOGLEVEL_MEDIUM    2
  28. #define    AUTH_LOGLEVEL_HIGH    3
  29.  
  30.  
  31. typedef    struct    list_regex {
  32.     char            *li_regex;
  33.     struct list_regex    *li_next;
  34.     } LIST_REGEX;
  35.  
  36. #define NULLIST_REGEX        (LIST_REGEX *)0
  37.  
  38.  
  39.  
  40. typedef    struct    list_chan_rights {
  41.     CHAN                *li_chan;
  42.     int                li_rights;
  43.     struct list_chan_rights        *li_next;
  44.     } LIST_CHAN_RIGHTS;
  45.  
  46. #define NULLIST_CHAN_RIGHTS        (LIST_CHAN_RIGHTS *)0
  47.  
  48.  
  49.  
  50.  
  51. typedef    struct    list_auth_chan {
  52.     CHAN                *li_chan;
  53.     int                li_found;
  54.  
  55.     int                policy;
  56. #define AUTH_CHAN_FREE              1
  57. #define AUTH_CHAN_NEGATIVE          2
  58. #define AUTH_CHAN_BLOCK             3
  59. #define AUTH_CHAN_NONE              4
  60. #define AUTH_CHAN_WARNS             5
  61. #define AUTH_CHAN_WARNR             6
  62. #define AUTH_CHAN_SIZELIMIT         7
  63. #define AUTH_CHAN_TEST            8
  64.  
  65.     char                *warnsender;
  66.     char                *warnrecipient;
  67.     long                sizelimit;
  68.     int                test; 
  69.     struct     list_auth_chan        *li_next;
  70.  
  71.     } LIST_AUTH_CHAN;
  72.  
  73.  
  74. #define NULLIST_AUTHCHAN        (LIST_AUTH_CHAN *)0
  75.  
  76.  
  77.  
  78.  
  79.  
  80. typedef    struct    list_auth_mta {
  81.     char                *li_mta;
  82.     int                li_found;
  83.     int                rights;
  84.     LIST_REGEX            *requires;
  85.     LIST_REGEX            *excludes;
  86.     LIST_BPT            *content_excludes;
  87.     LIST_CHAN_RIGHTS        *li_cr;
  88.     long                sizelimit;
  89.     struct     list_auth_mta        *li_next;
  90.     } LIST_AUTH_MTA;
  91.  
  92. #define NULLIST_AUTHMTA            (LIST_AUTH_MTA *)0
  93.  
  94.  
  95.  
  96. typedef    struct    auth_user {
  97.     int                found;
  98.     int                rights;
  99.     LIST_BPT            *content_excludes;
  100.     LIST_CHAN_RIGHTS        *li_cr;
  101.     long                sizelimit;
  102.     } AUTH_USER;
  103.  
  104. #define NULL_AUTHUSR            (AUTH_USER *)0
  105.  
  106.  
  107.  
  108. typedef    struct    auth {   /* holds all details for each channel, mta and user */
  109.  
  110.     int            status;
  111. #define    AUTH_OK            0
  112. #define AUTH_FAILED        1
  113. #define AUTH_DR_OK        2
  114. #define AUTH_DR_FAILED        3
  115. #define AUTH_FAILED_TEST    4
  116.  
  117.     int            stage;
  118. #define AUTH_STAGE_1        1    /* stage 1 tests performed */
  119. #define AUTH_STAGE_2        2    /* stage 2 tests performed */
  120.  
  121.     int            warnings;
  122. #define AUTH_NOTWARNED        0    /* msg not generated yet */
  123. #define AUTH_WARNED        1    /* msg has been generated */
  124. #define AUTH_WARNERROR        2    /* msg could not be generated */
  125.  
  126.     char            *reason;
  127.  
  128.     LIST_AUTH_CHAN        *chan;
  129.     LIST_AUTH_MTA        *mta;
  130.     AUTH_USER        *user;
  131.  
  132.  
  133.     int            mta_inrights;
  134.     int            mta_outrights;
  135.     int            user_inrights;
  136.     int            user_outrights;
  137. #define AUTH_RIGHTS_IN          1
  138. #define AUTH_RIGHTS_OUT         2
  139. #define AUTH_RIGHTS_BOTH        3
  140. #define AUTH_RIGHTS_NONE        4
  141. #define AUTH_RIGHTS_UNSET       5
  142.                 
  143.     } AUTH;
  144.  
  145. #define NULL_AUTH        (AUTH *)0
  146.  
  147. #endif
  148.