home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / c / ios_src / defs.h < prev    next >
Text File  |  1993-01-31  |  12KB  |  678 lines

  1. #if !defined (__DEFS_H__)
  2. #define __DEFS_H__
  3.  
  4. /*
  5. /*#define BETAVERSION        1*/
  6. */
  7.  
  8. /*
  9. **    Filenames
  10. */
  11.  
  12. #define    CONFIGFILE    "IOSMAIL.CFG"
  13. #define CONFIGBIN    "IOSMAIL.BIN"
  14. #define    HISTORYFILE    "IOSMAIL.HIS"
  15. #define    HISTORYDUP    "IOSMAIL.DUP"
  16. #define    KEYFILE        "IOSMAIL.KEY"
  17. #define    AREAFILE    "AREAS.BBS"
  18. #define    DAREAFILE    "DAREAS.BBS"
  19. #define LANG_FILE    "IOSMAIL.LNG"
  20. #define PRD_FILE    "IOSMAIL.PRD"
  21. #define BIN_AREAS    "AREAS.BIN"
  22. #define DUPESFILE    "IOSDUPES.LOG"
  23.  
  24. /*
  25. **    Version numbers.
  26. */
  27.  
  28. #define V_IOSMAIL    "IOSmail 0.89a m5D"
  29. #define V_INMAIL    "InMail 0.77"
  30. #define V_OUTMAIL    "OutMail 0.70"
  31. #define V_SCANMAIL    "ScanMail 0.70"
  32. #define V_CONSULTANT "IOS areaconsultant"
  33.  
  34. /*
  35. **    Status output
  36. */
  37.  
  38. #define S_ALL        0
  39. #define S_AREA        1
  40. #define S_IMP        2
  41. #define S_EXP        3
  42. #define S_SYSOP        4
  43. #define S_NETMAIL    5
  44. #define S_DELETED    6
  45. #define S_FROM        7
  46. #define S_DEST        8
  47. #define S_COMMENT    9
  48. #define S_TRASH        10
  49.  
  50. #define S_START        7    /*    Einde van statusline    */
  51.  
  52. /*
  53. **    Multitaskers
  54. */
  55.  
  56. #define NOTASK        0
  57. #define MULTIGEM    1
  58. #define MINT        2
  59. #define MULTITOS    3
  60.  
  61. /*
  62. **    Debug switches
  63. */
  64.  
  65. #if defined BETAVERSION
  66.  
  67. /*#define DEBUG        1    */
  68.  
  69. #define EXTERNDEBUG    1        /* Inmail & scanmail debug            */
  70. #define OUTDEBUG    1        /* Outmail debug                    */
  71.  
  72. #endif
  73.  
  74. #define    PATCHLEVEL    "2"
  75.  
  76. /*
  77. **    Product code
  78. */
  79.  
  80. #define    IOSPRDCODE        (UBYTE) 0xB0    /*    own PRDcode            */
  81. #define IOSPKTVERS        (UBYTE) 0x58    /*    Revision Version    */
  82. #define IOSMINOR        (UBYTE)    0x00    /*    Revision Minor        */
  83. #define TOSSCANPRD        (UBYTE) 0x3f    /*    TosScan                */
  84.  
  85. /*
  86. ** Version number
  87. */
  88.  
  89. #define G_VERSION        "IOSmail 0.88bta"
  90.  
  91. /*
  92. **    Packet Types
  93. */
  94.  
  95. #define    STONEAGE        0
  96. #define    TYPE2PLUS    1
  97. #define    TYPE2_2        2
  98. #define    TYPE3            3
  99.  
  100. /*
  101. **    Defines for message header flags
  102. */
  103.  
  104. #define    PRIVATE            0x0001    /* Flag private bit                */
  105. #define CRASH            0x0002    /* Mail: crash message            */
  106. #define RECEIVED        0x0004    /* Flag received bit            */
  107. #define SENT            0x0008    /* Mail: msg has been sent        */
  108. #define FILEATCH        0x0010    /*       msg has file attached    */
  109. #define MSGFWD            0x0020    /*       msg has been send        */
  110. #define ORPHAN            0x0040    /*    unknown destination        */
  111. #define KILLSEND        0x0080    /*       kill/send                */
  112. #define MSGLOCAL        0x0100    /*    message entered here        */
  113. #define MSGHOLD            0x0200    /*    hold message for pickup    */
  114. #define DELETED            0x8000    /* Flag deleted bit                */
  115.  
  116. #define ALLBITS            (CRASH|RECEIVED|SENT|MSGFWD|ORPHAN|KILLSEND|MSGLOCAL|MSGHOLD|DELETED)
  117.  
  118. /*
  119. **    Defines spaces
  120. */
  121.  
  122. #define    N_ALIAS            80            /* Number of max. aliases    */
  123. #define    N_AREAS            500            /* Number of max. areas        */
  124. #define    N_UNAREAS        100            /* Unreg 100 area            */
  125. #define    N_PUNAREAS        15            /* Unreg point 15 areas        */
  126. #define    N_POINTS        75            /* Number of max. points    */
  127. #define    N_DOMAINS        50            /* Number of applications    */
  128. #define    N_SEENS            450
  129. #define    N_PKTFILE        10
  130. #define    N_MAXPKT            100
  131. #define    N_AREAFILE        3
  132. #define    N_MAXAREA        20
  133. #define N_FASTAREAS        10
  134. #define N_FASTTOTAL        20
  135. #define    N_KILL            20
  136. #define N_FDBASE        50
  137. #define N_NODELIST        50
  138.  
  139. #define    SECONDS_PRO_DAY    86400L
  140. #define    QBBSMAXAREAS    200
  141.  
  142. /*
  143. **    Defines for reading netmail
  144. */
  145.  
  146. #define    END_OF_HDR        0            /* End of area reached        */
  147. #define    NEW_MSG            1            /* New message                */
  148.  
  149. /*
  150. ** Defines for area tag
  151. */
  152.  
  153. #define READ_ONLY    0
  154. #define    PUBLIC        1
  155. #define REMOTE_ONLY    2
  156.  
  157. #define    KEEPMSGS    1
  158. #define    KILLMSGS    0
  159.  
  160. /*
  161. **    Defines for LED
  162. */
  163.  
  164. #define    NOTHINGNEW        0x0000
  165. #define    UNREADMSGS        0x0001
  166. #define    NEWMSGS            0x0002
  167. #define    SYSOPMSGS        0x0004
  168.  
  169. /*
  170. **    Do we use ^aREALNAME, and when do we use it
  171. */
  172.  
  173. #define    REALIN            0x01
  174. #define REALOUT            0x02
  175. #define REALAL            0x03
  176.  
  177. /*
  178. **    defines for request
  179. */
  180.  
  181. #define    NOTFOUND        0            /* Area not found            */
  182. #define    CONNECT            1            /* Connect to area            */
  183. #define    DISCONNECT        2            /* Disconnect                */
  184. #define    NOTALLOWED        4            /* Not a public area        */
  185. #define    DIFFZONE        8            /* Other zone                */
  186.  
  187. /*
  188. **    defines for inbounds
  189. */
  190.  
  191. #define    PROTINBOUND        0
  192. #define    KNOWNINBOUND    1
  193. #define    NORMALINBOUND    2
  194.  
  195. /*
  196. **    defines for messageheadertype
  197. */
  198.  
  199. #define    TYPE3d            0
  200. #define    TYPE4d            1
  201. #define    FTS_TYPE        0
  202. #define    FRONTDOOR        1
  203. #define TYPE_2_1        2
  204. #define TYPE_2_2        3
  205.  
  206. /*
  207. **    Defines for extract arcmail
  208. */
  209.  
  210. #define    isARCmail        0
  211. #define    isLZHmail        1
  212. #define    isZIPmail        2
  213. #define    isARJmail        4
  214. #define    isUNKNOWN        3
  215.  
  216. /*
  217. **    Defines for routing table
  218. */
  219.  
  220. #define    SENDARC            0x0001
  221. #define    HOLDMSG            0x0002
  222. #define    ROUTE            0x0004
  223. #define    FILETO            0x0008
  224. #define    KNOWNAS            0x0010
  225. #define    POLLNODE        0x0020
  226. #define    FILEMAX            0x0040
  227. #define    CRASHOK            0x0080
  228. #define    HOLDPOLL        0x0100
  229. #define    HOLDMAX            0x0200
  230. #define    HOLDDEL            0x0400
  231. #define CRASHPOINT        0x0800
  232. #define DENYOK            0x1000
  233. #define MSGTRACK        0x2000
  234. #define    R_TO_HIM        0x8000
  235.  
  236. /*
  237. **    Defines for crunch
  238. */
  239.  
  240. #define    AFTERIMPORT        1
  241. #define    AFTERSCAN        2
  242. #define    CRUNCHALWAYS    3
  243.  
  244. #define    CRUNCHALL        0
  245. #define    CRUNCHSPECIALS    1
  246.  
  247. #define DBFILEIO    0        /* Debug file IO (creation of files)        */
  248. #define SMALLBUF    0        /* use buffers <= 64K?                        */
  249.  
  250.                             /* defines for Aopen                        */
  251. #define AR_OK        0        /* Area is OK to process                    */
  252. #define AR_EMPTY    1        /* Area is empty                            */
  253. #define AR_NOCHANGE    2        /* Area is not changed                        */
  254. #define AR_TOSMALL    3        /* Area contains to little hdrs                */
  255. #define AR_TOBIG    4        /* Area contains to munch hdrs                */
  256. #define AR_DISKFREE    5        /* Not enoug free space on drive            */
  257. #define AR_IOERR    6        /* IO error while opening files                */
  258. #define AR_MSGERR    7        /* No messagebody                            */
  259.  
  260. #define    MAXMSGS        15000    /* this way, an array of ints < 32K            */
  261. #define LBBSRECSIZE    (200 * sizeof(WORD))
  262.  
  263. #define DEF_SAFETY    14        /* default number of -S option days            */
  264. #define DEF_MINHDR    1        /* default numer of -M option headers        */
  265.  
  266. #define TOTPART        (5L)    /* The sum of the following parts!!!    */
  267. #define HDRWRPART    (1L)
  268. #define HDRRDPART    (1L)
  269. #define BODWRPART    (3L)
  270. #define FLAG (0xFFFFFFFFL)
  271.  
  272. #define MAXDRIVES    32
  273.  
  274. #define NOATTRIB    0
  275.  
  276. #define SECSDAY 86400L      /* Number of seconds in 1 day */
  277.  
  278. #define MSGDELETE    0
  279. #define MSGOK        1
  280.  
  281. /*
  282. **    Defines for labels
  283. */
  284.  
  285. #define    NOLABEL            0
  286. #define    USELABEL        1
  287. #define    ENDLABEL        2
  288.  
  289. /*
  290. **    Miscellaneous defines
  291. */
  292.  
  293. #define    SCANNED            0x8000
  294. #define    MDATE            __DATE__
  295.  
  296. #define    FILEclosed        0
  297. #define    FILEopen        1
  298.  
  299. #define NO_CRASH        0
  300. #define AT_CRASH        1
  301.  
  302. #define ARC_PKTS        0
  303. #define NORM_PKTS        1
  304.  
  305. /*
  306. #define    MAXMSGLENGTH    (30 * 1024)
  307. */
  308.  
  309. #define COPYAREA        0
  310. #define MOVEAREA        1
  311.  
  312. #define FD_FROM            0
  313. #define FD_TO            1
  314.  
  315. /*
  316. **    Where we must save the message.
  317. */
  318.  
  319. #define    TONETMAIL        0
  320. #define    TOTRASH            1
  321. #define    TOPACKET        2
  322. #define    TOLOCAL            3
  323. #define    TOPRIVATE        4
  324. #define    NETMAILPACKET    5
  325. #define TODATABASE        6
  326.  
  327. /*
  328. **    Messageheader in local base
  329. */
  330.  
  331. typedef struct
  332. {
  333.     BYTE    from[36],
  334.             to[36],
  335.             topic[72],
  336.             time[20];
  337.     
  338.     LONG    create,
  339.             Mstart;    
  340.     UWORD    up,                /* unused                    */
  341.             parent,
  342.     
  343.             flags,
  344.             mailer[8],
  345.             size,
  346.             reads,
  347.             cost,            /* Cost of message * 100    */
  348.             Ozone,
  349.             Onet,
  350.             Onode,
  351.             Opoint,
  352.             
  353.             Dzone,
  354.             Dnet,
  355.             Dnode,
  356.             Dpoint;
  357. } MSGHEADER;
  358.  
  359.  
  360. /*
  361. **    Header to use in netmail with domain.
  362. */
  363.  
  364. typedef struct
  365. {
  366.     BYTE    from[36],
  367.             to[36],
  368.             topic[72],
  369.             time[20];
  370.     
  371.     LONG    create,
  372.             Mstart;    
  373.     UWORD    up,                /* unused                    */
  374.             parent,
  375.     
  376.             flags;
  377.     BYTE    domain[8];
  378.     UWORD    mailer[4],
  379.             size,
  380.             reads,
  381.             cost,            /* Cost of message * 100    */
  382.             Ozone,
  383.             Onet,
  384.             Onode,
  385.             Opoint,
  386.             
  387.             Dzone,
  388.             Dnet,
  389.             Dnode,
  390.             Dpoint;
  391. } DONAINHEADER;
  392.  
  393. /*
  394. **    Messagebase for small use of database.
  395. */
  396.  
  397. typedef struct {
  398.     BYTE    from[36],
  399.             to[36],
  400.             topic[72],
  401.             time[20],
  402.             area[40];
  403.     LONG    Mstart;
  404.     UWORD    flags,
  405.             size;
  406. } SMALLBASE;
  407.  
  408. /*
  409. **    Alias addresses
  410. */
  411.  
  412. typedef struct
  413. {
  414.     UWORD    zone,
  415.             net,
  416.             node,
  417.             point,
  418.             pointnet;
  419.     BYTE    Domain [10];
  420. } Aliases;
  421.  
  422. /*
  423. **    Key definitions
  424. */
  425.  
  426. typedef struct
  427. {
  428.     UWORD    zone,
  429.             net,
  430.             node,
  431.             point;
  432.             
  433.     BYTE    pwd[8],            /* Mailpasword                */
  434.             Afix[30],        /* Areafix password            */
  435.             Uname[32],        /* Naam van user            */
  436.             Ugroup[63],        /* Area groep                */
  437.             
  438.             mtype,            /* Message type                */
  439.             htype,            /* PKT header type            */
  440.             arctype,        /* Archiver                    */
  441.             intl_type,
  442.             intl_always,    /* Always INTL                */
  443.             crash_to,        /* Only at crash            */
  444.             Send_PKT,        /* With SendAlwaysPKT        */
  445.             TosScan,        /* Use TosScan product code */
  446.             Domain[10];
  447. } Key;
  448.  
  449. /*
  450. **    Routing rules
  451. */
  452.  
  453. struct _RouteDef
  454. {
  455.     WORD    flags;
  456.     BYTE    destnode[30];
  457.     BYTE    fromnode[30];
  458. };
  459.  
  460. /*
  461. **    Readdress buffer.
  462. */
  463.  
  464. typedef struct 
  465. {
  466.     BYTE fname[36],
  467.          tname[36],
  468.          fnode[20],
  469.          tnode[20];
  470. } READDRESS;
  471.  
  472. /*
  473. **    Domain definition
  474. */
  475.  
  476. typedef struct
  477. {
  478.     WORD    zone;
  479.     BYTE    path[128],
  480.             domain[40];
  481. } Dom_;
  482.  
  483. /*
  484. **    Packet header
  485. */
  486.  
  487. struct _pkthdr
  488. {
  489.     UWORD    ph_onode,
  490.             ph_dnode,
  491.             
  492.             ph_yr, ph_mo, ph_dy,
  493.             ph_hr, ph_mn, ph_sc,
  494.             
  495.             ph_rate,
  496.             ph_ver,
  497.             
  498.             ph_onet,
  499.             ph_dnet;
  500.             
  501.     UBYTE    ph_prod,
  502.             ph_rev;
  503.             
  504.     BYTE    ph_pwd[8];
  505.             
  506.     UWORD    ph_qozone,
  507.             ph_qdzone,
  508.             
  509.             ph_auxnet,
  510.             ph_CWcopy;
  511.     
  512.     UBYTE    ph_prodH,
  513.             ph_revMin;
  514.             
  515.     UWORD    ph_capable,
  516.             
  517.             ph_ozone,
  518.             ph_dzone,
  519.             ph_opoint,
  520.             ph_dpoint;
  521.             
  522.     LONG    ph_rsvd;
  523. };
  524.  
  525. /*
  526. **    Type 2.2 packet header as is in FSC-0045.001
  527.  
  528. The proposed packet header structure is as follows:
  529.  
  530.     Offset   Width     Description
  531.     ======   =====     ===========
  532.          0       2     Originating node number
  533.          2       2     Destination node number
  534.          4       2   * Originating point number
  535.          6       2   * Destination point number
  536.          8       8     Reserved, must be zero
  537.         16       2     Packet sub-version (2)
  538.         18       2     Packet version (2)
  539.         20       2     Originating network
  540.         22       2     Destination network
  541.         24       1     Product code
  542.         25       1     Product revision level
  543.         26       8     Password
  544.         34       2   * Originating zone
  545.         36       2   * Destination zone
  546.         38       8   * Originating domain
  547.         46       8   * Destination domain
  548.         54       4     Product specific data
  549.         58     ---     Start of first packed message
  550.  
  551.                      * Field only guaranteed accurate in a type 2.2 header
  552.  
  553. */
  554.  
  555. struct _phdr2
  556. {
  557.     UWORD    ph_onode,
  558.             ph_dnode,
  559.             
  560.             ph_opoint,
  561.             ph_dpoint;
  562.     
  563.     ULONG    ph_res[2];
  564.     
  565.     UWORD    ph_sub,
  566.             ph_ver,
  567.             ph_onet,
  568.             ph_dnet;
  569.     
  570.     BYTE    ph_prod,
  571.             ph_rev,
  572.             ph_pwd[8];
  573.     
  574.     UWORD    ph_ozone,
  575.             ph_dzone;
  576.     
  577.     BYTE    ph_odomain[8],
  578.             ph_ddomain[8];
  579.     UBYTE    ph_spec_data[4];
  580. };
  581.  
  582. /*
  583. **    Messageheader in PKT file
  584. */
  585.  
  586. struct _pktmsg
  587. {
  588.     WORD    pm_ver,                    /* Message version            */
  589.             
  590.             pm_onode,
  591.             pm_dnode,
  592.             pm_onet,
  593.             pm_dnet,
  594.             
  595.             pm_attr,
  596.             pm_cost;
  597. };
  598.  
  599. /*
  600. **    Capture buffers
  601. */
  602.  
  603. typedef struct
  604. {
  605.     BYTE    name[36];
  606.     
  607.     UWORD    zone,
  608.             net,
  609.             node,
  610.             point;
  611. } CAPTUREBUF;
  612.  
  613. /*
  614. **    IOSmail key definitions
  615. */
  616.  
  617. #define    ALPHALEVEL        25
  618. #define    BETALEVEL        66
  619. #define    REGISTEREDLEVEL    23
  620.  
  621. #define    STARTTOKEN        '.'
  622.  
  623. #define    DATE_XOR        0x48
  624. #define    NAME_XOR        0x66
  625. #define    TYPE_XOR        0x48
  626. #define    START_XOR        0x44
  627. #define KTYPE_XOR        0x76
  628.  
  629. #define REG_VERS    240
  630. #define UNR_VERS    104
  631. #define BET_VERS    99
  632. #define NO_KEY        251
  633.  
  634. typedef struct
  635. {
  636.     BYTE    year,
  637.             day,
  638.             month,
  639.             
  640.             type,
  641.             start,
  642.             
  643.             res[215],
  644.             name[36];
  645.     UWORD    reg_num,
  646.             zone;
  647. } IOSKEY;
  648.  
  649. typedef struct
  650. {
  651.     WORD    Qlr[QBBSMAXAREAS];
  652. } QBBSLASTREAD;
  653. /* structure definitions                    */
  654.  
  655. typedef struct {
  656.     long    size;        /* size in bytes                                */
  657.     BYTE     *start;        /* pointer to start                                */
  658.     BYTE    *curpos;    /* pointer to current position                    */
  659.     long    level;        /* no. of items currently in buffer                */
  660.     long    maxitem;    /* max no. of items in buffer                    */
  661. } _filebuf;
  662.  
  663. typedef struct {
  664.     WORD        days;        /* no. of days to keep messages in this area    */
  665.     WORD        min;        /* min no. of messages to keep in this area        */
  666.     WORD        max;        /* max no. of messages to keep in this area        */
  667.     BYTE        *name;        /* name of this area, malloc'd                    */
  668.     BYTE        *path;        /* path to this area, malloc'd                    */
  669. } _area;
  670.  
  671. struct _ndi
  672. {
  673.    WORD node;                                      /* node number  */
  674.    WORD net;                                      /* net number   */
  675. };
  676.  
  677. #endif
  678.