home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / KA9QTCPP / NNTP4NOS.ZIP / AX_MBX.H next >
Encoding:
C/C++ Source or Header  |  1990-04-30  |  2.6 KB  |  75 lines

  1. /* Defines for the ax.25 mailbox facility */
  2. #ifndef    NUMMBX
  3. #define NUMMBX        10        /* max number of mailbox sessions */
  4. #include "timer.h"
  5.  
  6. #define MBXLINE        128        /* max length of line */
  7. struct mbx {
  8.     int state ;                /* mailbox state */
  9. #define MBX_LOGIN    0        /* trying to log in */
  10. #define MBX_CMD        1        /* in command mode */
  11. #define MBX_SUBJ    2        /* waiting for a subject line */
  12. #define MBX_DATA    3        /* collecting the message */
  13.     char name[20] ;            /* Name of remote station */
  14.     char *to ;            /* To-address in form user or user@host */
  15.     char *origto ;            /* Original To-address, if rewritten */
  16.     char *tofrom ;            /* Optional <from in to-address */
  17.     char *tomsgid ;            /* Optional $msgid in to-address */
  18.     FILE *tfile ;            /* Temporary file for message */
  19.     char line[MBXLINE+1] ;    /* Room for null at end */
  20.     int mbnum ;        /* which mailbox session is this? */
  21.     int sid ;        /* Characteristics indicated by the SID */
  22.                 /* banner of the attaching station.  If */
  23.                 /* no SID was sent, this is zero.  If an */
  24.                 /* SID of any kind was received, it is */
  25.                 /* assumed that the station supports */
  26.                 /* abbreviated mail forwarding mode. */
  27. #define    MBX_SID        0x01    /* Got any SID */
  28. #define    MBX_SID_RLI    0x02    /* This is an RLI BBS, disconnect after F> */
  29.                 /* Space here for others, currently not of */
  30.                 /* interest to us. */
  31.     char stype ;        /* BBS send command type (B,P,T, etc.) */
  32.     int type ;        /* Type of session when invoking "chat" */
  33.     int user;        /* User linkage area */
  34.     char escape;        /* Escape character */
  35.     int privs;        /* Privileges */
  36.     char *path;        /* Directory path */
  37.     char *startmsg;        /* Message to be sent at connect through any
  38.                 /* of the gateways */
  39.     int current;        /* the current message number */
  40.     int nmsgs;        /* number of messages in this mail box */
  41.     int newmsgs;        /* number of new messages in mail box */
  42.     int change;        /* mail file changed */
  43.     int anyread;        /* true if any message has been read */
  44.     FILE *mfile;        /* mail data file pointer */
  45.     char area[64];        /* name of current mail area */
  46.     long mboxsize;        /* size of mailbox when opened */
  47.     long mysize;        /* size of my private mailbox */
  48.     struct let *mbox;
  49. } ;
  50. #define     NULLMBX        (struct mbx *)0
  51.  
  52. /* privilege codes in the userfile that are not needed by ftp */
  53. #define AX25_CMD    8
  54. #define TELNET_CMD    16
  55. #define NETROM_CMD    32
  56. #define SYSOP_CMD    64
  57.  
  58. /* Structure used for automatic flushing of gateway sockets */
  59. struct gwalarm {
  60.     int s1;
  61.     int s2;
  62.     struct timer t;
  63. };
  64.  
  65. extern struct mbx *mbox[NUMMBX] ;
  66. extern int ax25mbox ;
  67. extern char Noperm[];
  68.  
  69. /* In ax_mbx.c: */
  70. void mbx_incom __ARGS((int s,void *t,void *p));
  71. void domboxdisplay __ARGS((void));
  72.  
  73. #endif    /* NUMMBX */
  74.  
  75.