home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / src_1218.zip / MAILBOX.H < prev    next >
C/C++ Source or Header  |  1991-06-01  |  4KB  |  112 lines

  1. #ifndef _MAILBOX_H
  2. #define _MAILBOX_H
  3. /* Defines for the ax.25 mailbox facility */
  4. #define NUMMBX        10        /* max number of mailbox sessions */
  5. #ifndef _TIMER_H
  6. #include "timer.h"
  7. #endif
  8.  
  9. /* a mailbox list entry */
  10. struct let {
  11.     long    start;
  12.     long    size;
  13.     int    status;
  14. };
  15.  
  16. #define MBXLINE        128        /* max length of line */
  17. struct mbx {
  18.     int state ;                /* mailbox state */
  19. #define MBX_LOGIN    0        /* trying to log in */
  20. #define MBX_CMD        1        /* in command mode */
  21. #define MBX_SUBJ    2        /* waiting for a subject line */
  22. #define MBX_DATA    3        /* collecting the message */
  23. #define MBX_REVFWD    4        /* reverse forwarding in progress */
  24. #define MBX_TRYING    5        /* pending forwarding connection */
  25. #define MBX_FORWARD    6        /* established forwarding connection */
  26.     char name[20] ;            /* Name of remote station */
  27.     char *to ;            /* To-address in form user or user@host */
  28.     char *origto ;            /* Original To-address, if rewritten */
  29.     char *tofrom ;            /* Optional <from in to-address */
  30.     char *tomsgid ;            /* Optional $msgid in to-address */
  31.     FILE *tfile ;            /* Temporary file for message, or */
  32.                     /* forwarding file. */
  33.     char line[MBXLINE+1] ;    /* Room for null at end */
  34.     int mbnum ;        /* which mailbox session is this? */
  35.     int sid ;        /* Characteristics indicated by the SID */
  36.                 /* banner of the attaching station.  If */
  37.                 /* no SID was sent, this is zero.  If an */
  38.                 /* SID of any kind was received, it is */
  39.                 /* assumed that the station supports */
  40.                 /* abbreviated mail forwarding mode. */
  41. #define    MBX_SID        0x01    /* Got any SID */
  42. #define    MBX_RLI_SID    0x02    /* This is an RLI BBS, disconnect after F> */
  43. #define MBX_HIER_SID    0x04    /* The BBS supports "hierarchical routing */
  44.                 /* designators." */
  45.                 /* Space here for others, currently not of */
  46.                 /* interest to us. */
  47.     char stype ;        /* BBS send command type (B,P,T, etc.) */
  48.     int type ;        /* Type of session when invoking "chat" */
  49.     int user;        /* User linkage area */
  50.     char escape;        /* Escape character */
  51.     int privs;        /* Privileges (taken from Ftpusers file) */
  52. #define AX25_CMD    8    /* AX.25 gateway operation allowed */
  53. #define TELNET_CMD    16    /* Telnet gateway operation allowed */
  54. #define NETROM_CMD    32    /* NET/ROM gateway operation allowed */
  55. #define SYSOP_CMD    64    /* Remote sysop access allowed */
  56. #define EXCLUDED_CMD    128    /* This user is banned from the BBS */
  57.     char *path;        /* Directory path */
  58.     char *startmsg;        /* Message to be sent at connect through any
  59.                 /* of the gateways */
  60.     int current;        /* the current message number */
  61.     int nmsgs;        /* number of messages in this mail box */
  62.     int newmsgs;        /* number of new messages in mail box */
  63.     int change;        /* mail file changed */
  64.     int anyread;        /* true if any message has been read */
  65.     FILE *mfile;        /* mail data file pointer */
  66.     char area[64];        /* name of current mail area */
  67.     long mboxsize;        /* size of mailbox when opened */
  68.     long mysize;        /* size of my private mailbox */
  69.     struct let *mbox;
  70.     char *stdinbuf;        /* the stdio buffer for the mail file */
  71.     char *stdoutbuf;    /* the stdio file io buffer for the temp file */
  72. } ;
  73. #define     NULLMBX        (struct mbx *)0
  74.  
  75. /* Structure used for automatic flushing of gateway sockets */
  76. struct gwalarm {
  77.     int s1;
  78.     int s2;
  79.     struct timer t;
  80. };
  81.  
  82. /* In mailbox.c: */
  83. extern struct mbx *Mbox[NUMMBX] ;
  84. extern char Noperm[];
  85. extern char Nosock[];
  86. extern void (*Listusers) __ARGS((int s));
  87.  
  88. int dombescape __ARGS((int argc,char *argv[],void *p));
  89. int mbxrecvline __ARGS((int s,char *buf,int len,int escape));
  90. int gw_connect __ARGS((struct mbx *m,int s,char *fsocket,int len));
  91.  
  92. void mbx_incom __ARGS((int s,void *t,void *p));
  93. int domboxdisplay __ARGS((int argc,char *argv[],void *p));
  94. struct mbx *newmbx __ARGS((void));
  95. void exitbbs __ARGS((struct mbx *m));
  96. int domboxbye __ARGS((int argc,char *argv[],void *p));
  97. int mbx_parse __ARGS((struct mbx *m));
  98. void changearea __ARGS((struct mbx *m,char *area));
  99. char *rewrite_address __ARGS((char *addr));
  100. void listusers __ARGS((int s));
  101.  
  102. /* In forward.c: */
  103. int dorevfwd __ARGS((int argc,char *argv[],void *p));
  104. int dombtimer __ARGS((int argc,char *argv[],void *p));
  105. int dombkick __ARGS((int argc,char *argv[],void *p));
  106.  
  107. /* In tipmail.c */
  108. extern unsigned Tiptimeout;
  109.  
  110. #endif    /* _MAILBOX_H */
  111.  
  112.