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