1 /*
2  *  FECFG146.H
3  *
4  *  'C' Structures of FastEcho 1.46
5  *  Copyright (c) 1995 by Tobias Burchhardt.  Last update: 30 Jun 1995.
6  *  Modified by Aleksandar Ivanisevic 30 Oct 1996.
7  *  Minor alterations by Andrew Clarke 22 Dec 1996.
8  *  Modfications by Tobias Ernst 04 Oct 1998
9  *  Merged changes from fecfg146.h from T. Burchhardt 04 Oct 2000
10  */
11 
12 #ifndef __FECFG146_H__
13 #define __FECFG146_H__
14 
15 /*
16 We don't set pragma pack anymore. The result is that the structures below
17 are probably larger than their pendants in the binary file. You need to write
18 portable reader functions for reading them from file. For those structures
19 that are used by MsgEd, such reader functions can be found in fecfg145.c.
20 
21 #if defined(PACIFIC) || defined(MSC) || defined(__EMX__) || defined(__IBMC__) || defined(__HIGHC__) || defined(UNIX) || defined(__DJGPP__)
22 #pragma pack(1)
23 #endif
24 
25 */
26 
27 /********************************************************
28  * FASTECHO.CFG = <CONFIG>                              *
29  *                + <optional extensions>               *
30  *                + <CONFIG.NodeCnt * Node>             *
31  *                + <CONFIG.AreaCnt * Area>             *
32  ********************************************************/
33 
34 #define REVISION        6       /* current revision     */
35 
36 /*
37  *  Note: there is a major change in this revision - the Node records
38  *  have no longer a fixed length!
39  */
40 
41 #define MAX_AREAS       4096    /* max # of areas          */
42 #define MAX_NODES       1024    /* max # of nodes          */
43 #define MAX_GROUPS      32      /* max # of groups         */
44 #define MAX_AKAS        32      /* max # of akas           */
45 #define MAX_ROUTE       15      /* max # of 'vias'         */
46 #define MAX_ORIGINS     20      /* max # of origins        */
47 #define MAX_GATES	10	/* max # of Internet gates */
48 
49 /*
50  *  Note: The MAX_AREAS and MAX_NODES are only the absolute maximums as the
51  *  handling is flexible. To get the maximums which are used for the config
52  *  file you read, you have to examine the CONFIG.MaxAreas and
53  *  CONFIG.MaxNodes variables!
54  *
55  *  Note: The MAX_AREAS and MAX_NODES maximums are subject to change with
56  *  any new version, therefore - if possible - make handling as flexible as
57  *  possible and use CONFIG.MaxAreas and .MaxNodes whereever possible. But
58  *  be aware that you might (under normal DOS and depending on the way you
59  *  handle it) hit the 64kB segment limit pretty quickly!
60  *
61  *  Same goes for the # of AKAs and Groups - use the values found in
62  *  CONFIG.AkaCnt and CONFIG.GroupCnt!
63  *
64  *  Note: Define INC_FE_TYPES, INC_FE_BAMPROCS  and  INC_FE_DATETYPE
65  *  to include the typedefs if necessary.
66  */
67 
68 /********************************************************
69  * CONFIG.flags                                         *
70  ********************************************************/
71 
72 #define RETEAR                  0x00000001l
73 #define AUTOCREATE              0x00000002l
74 #define KILLEMPTY               0x00000004l
75 #define KILLDUPES               0x00000008l
76 #define CLEANTEARLINE           0x00001000l
77 #define IMPORT_INCLUDEUSERSBBS  0x00002000l
78 #define KILLSTRAYATTACHES       0x00004000l
79 #define PURGE_PROCESSDATE       0x00008000l
80 #define MAILER_RESCAN           0x00010000l
81 #define EXCLUDE_USERS           0x00020000l
82 #define EXCLUDE_SYSOPS          0x00040000l
83 #define CHECK_DESTINATION       0x00080000l
84 #define UPDATE_BBS_CONFIG       0x00100000l
85 #define KILL_GRUNGED_DATE       0x00200000l
86 #define NOT_BUFFER_EMS          0x00400000l
87 #define KEEP_NETMAILS           0x00800000l
88 #define NOT_UPDATE_MAILER       0x01000000l
89 #define NOT_CHECK_SEMAPHORES    0x02000000l
90 #define CREATE_SEMAPHORES       0x04000000l
91 #define CHECK_COMPLETE          0x08000000l
92 #define RESPOND_TO_RRQ          0x10000000l
93 #define TEMP_OUTB_HARDDISK      0x20000000l
94 #define FORWARD_PACKETS         0x40000000l
95 #define UNPACK_UNPROTECTED      0x80000000l
96 
97 /********************************************************
98  * CONFIG.mailer                                        *
99  ********************************************************/
100 
101 #define FrontDoor               0x0001
102 #define InterMail               0x0002
103 #define DBridge                 0x0004
104 #define Binkley                 0x0010
105 #define PortalOfPower           0x0020
106 #define McMail                  0x0040
107 
108 /********************************************************
109  * CONFIG.BBSSoftware                                   *
110  ********************************************************/
111 
112 enum BBSSoft
113 {
114     NoBBSSoft = 0,
115     RemoteAccess111,
116     QuickBBS,
117     SuperBBS,
118     ProBoard122 /* Unused */,
119     TagBBS,
120     RemoteAccess200,
121     ProBoard130 /* Unused */,
122     ProBoard200,
123     ProBoard202,
124     Maximus202,
125     Maximus300
126 };
127 
128 /********************************************************
129  * CONFIG.CC.what                                       *
130  ********************************************************/
131 
132 #define CC_FROM                 1
133 #define CC_TO                   2
134 #define CC_SUBJECT              3
135 #define CC_KLUDGE               4
136 
137 /********************************************************
138  * CONFIG.QuietLevel                                    *
139  ********************************************************/
140 
141 #define QUIET_PACK              0x0001
142 #define QUIET_UNPACK            0x0002
143 #define QUIET_EXTERN            0x0004
144 
145 /********************************************************
146  * CONFIG.Swapping                                      *
147  ********************************************************/
148 
149 #define SWAP_TO_XMS             0x0001
150 #define SWAP_TO_EMS             0x0002
151 #define SWAP_TO_DISK            0x0004
152 
153 /********************************************************
154  * CONFIG.Buffers                                       *
155  ********************************************************/
156 
157 #define BUF_LARGE               0x0000
158 #define BUF_MEDIUM              0x0001
159 #define BUF_SMALL               0x0002
160 
161 /********************************************************
162  * CONFIG.arcext.inb/outb                               *
163  ********************************************************/
164 
165 enum ARCmailExt
166 {
167     ARCDigits = 0, ARCHex, ARCAlpha
168 };
169 
170 /********************************************************
171  * CONFIG.AreaFixFlags                                  *
172  ********************************************************/
173 
174 #define ALLOWRESCAN             0x0001
175 #define KEEPREQUEST             0x0002
176 #define KEEPRECEIPT             0x0004
177 #define ALLOWREMOTE             0x0008
178 #define DETAILEDLIST            0x0010
179 #define ALLOWPASSWORD           0x0020
180 #define ALLOWPKTPWD             0x0040
181 #define ALLOWCOMPRESS           0x0080
182 #define SCANBEFORE              0x0100
183 #define ADDRECEIPTLIST          0x0200
184 #define NOTIFYPASSWORDS         0x0400
185 
186 /********************************************************
187  * Area.board (1-200 = Hudson)                          *
188  ********************************************************/
189 
190 #define NO_BOARD        0x4000u /* JAM/Sq/Passthru etc. */
191 #define AREA_DELETED    0x8000u /* usually never written */
192 
193 /********************************************************
194  * Area.flags.storage                                   *
195  ********************************************************/
196 
197 #define FE_QBBS                 0
198 #define FE_FIDO                 1  /* to avoid confusion with Msged's defs */
199 #define FE_SQUISH               2
200 #define FE_JAM                  3
201 #define FE_PASSTHRU             7
202 
203 /********************************************************
204  * Area.flags.atype                                     *
205  ********************************************************/
206 
207 #define AREA_ECHOMAIL           0
208 #define AREA_NETMAIL            1
209 #define AREA_LOCAL              2
210 #define AREA_BADMAILBOARD       3
211 #define AREA_DUPEBOARD          4
212 
213 /********************************************************
214  * GateDef.flags                                        *
215  ********************************************************/
216 #define GATE_KEEPMAILS	0x0001
217 
218 /********************************************************
219  * Types and other definitions                          *
220  ********************************************************/
221 
222 enum ARCers
223 {
224     ARC_Unknown = -1, ARC_SeaArc, ARC_PkArc, ARC_Pak,
225     ARC_ArcPlus, ARC_Zoo, ARC_PkZip, ARC_Lha, ARC_Arj,
226     ARC_Sqz, ARC_RAR, ARC_UC2
227 };  /* for Unpackers */
228 
229 enum NetmailStatus
230 {
231     NetNormal = 0, NetHold, NetCrash /* , NetImm */
232 };
233 
234 enum AreaFixType
235 {
236     NoAreaFix = 0, NormalAreaFix, FSC57AreaFix
237 };
238 enum AreaFixSendTo
239 {
240     AreaFix = 0, AreaMgr, AreaLink, EchoMgr
241 };
242 
243 /********************************************************
244  * Structures                                           *
245  ********************************************************/
246 
247 typedef struct
248 {
249     unsigned short zone, net, node, point;
250 }
251 FEAddress;
252 #define FE_ADDRESS_SIZE 8
253 
254 #define _MAXPATH 56
255 
256 typedef struct CONFIGURATION
257 {
258     unsigned short revision;
259     unsigned long flags;
260     unsigned short NodeCnt, AreaCnt, unused1;
261     char NetMPath[_MAXPATH];
262     char MsgBase[_MAXPATH];
263     char InBound[_MAXPATH];
264     char OutBound[_MAXPATH];
265     char Unpacker[_MAXPATH];    /* DOS default decompression program */
266     char LogFile[_MAXPATH];
267     char unused2[336];
268     char Unpacker2[_MAXPATH];   /* OS/2 default decompression program */
269     char UnprotInBound[_MAXPATH];
270     char StatFile[_MAXPATH];
271     char SwapPath[_MAXPATH];
272     char SemaphorePath[_MAXPATH];
273     char BBSConfigPath[_MAXPATH];
274     char QueuePath[_MAXPATH];   /* DBQueuePath */
275     char RulesPrefix[32];
276     char RetearTo[40];
277     char LocalInBound[_MAXPATH];
278     char ExtAfter[_MAXPATH - 4];
279     char ExtBefore[_MAXPATH - 4];
280     unsigned char unused3[480];
281     struct
282     {
283         unsigned char what;
284         char object[31];
285         unsigned short conference;
286     }
287     CC[10];
288     unsigned char security, loglevel;
289     unsigned short def_days, def_messages;
290     unsigned char unused4[462];
291     unsigned short autorenum;
292     unsigned short def_recvdays;
293     unsigned char openQQQs, Swapping;
294     unsigned short compressafter;
295     unsigned short afixmaxmsglen;
296     unsigned short compressfree;
297     char TempPath[_MAXPATH];
298     unsigned char graphics, BBSSoftware;
299     char AreaFixHelp[_MAXPATH];
300     unsigned char unused5[504];
301     unsigned short AreaFixFlags;
302     unsigned char QuietLevel, Buffers;
303     unsigned char FWACnt;  /* # of ForwardAreaFix records */
304     unsigned char GDCnt;   /* # of Group Default records */
305     struct
306     {
307         unsigned short flags;
308         unsigned short days[2];
309         unsigned short msgs[2];
310     }
311     rescan_def;
312     unsigned long duperecords;
313     struct
314     {
315         unsigned char inb;
316         unsigned char outb;
317     }
318     arcext;
319     unsigned short AFixRcptLen;
320     unsigned char AkaCnt, resv;  /* # of Aka records stored */
321     unsigned short maxPKT;
322     unsigned char sharing, sorting;
323     struct
324     {
325         char name[36];
326         unsigned long resv;
327     }
328     sysops[11];
329     char AreaFixLog[_MAXPATH];
330     char TempInBound[_MAXPATH];
331     unsigned short maxPKTmsgs;
332     unsigned short RouteCnt;              /* # of PackRoute records */
333     unsigned char maxPACKratio;
334     unsigned char SemaphoreTimer;
335     unsigned char PackerCnt, UnpackerCnt; /* # of Packer + Unpacker records */
336     unsigned char GroupCnt, OriginCnt;    /* # of GroupName + Origin records */
337     unsigned short mailer;
338     unsigned short maxarcsize, maxarcdays;
339     unsigned short minInbPKTSize;
340     char reserved[804];
341 
342     unsigned short AreaRecSize, GrpDefRecSize;
343                                        /*
344                                         *  Size of Area and GroupDefaults
345                                         *  records stored in this file
346                                         */
347 
348     unsigned short MaxAreas, MaxNodes; /* Current max values for this config */
349     unsigned short NodeRecSize;        /* Size of each stored Node record */
350 
351     unsigned long offset;              /*
352                                         *  This is the offset from the current
353                                         *  file-pointer to the 1st Node
354                                         */
355 }
356 CONFIG;
357 #define FE_CONFIG_SIZE 4644
358 
359 /*
360  *  To directly access the 'Nodes' and/or 'Areas' while bypassing the
361  *  Extensions, perform an absolute (from beginning of file) seek to
362  *  sizeof(CONFIG) + CONFIG.offset.
363  *
364  *  If you want to access the 'Areas', you have to add the following value
365  *  to the above formula: CONFIG.NodeCnt * CONFIG.NodeRecSize.
366  */
367 
368 typedef struct
369 {
370     FEAddress addr;               /* Main address */
371     FEAddress arcdest;            /* ARCmail fileattach address */
372     unsigned char aka, autopassive, newgroup, resv1;
373     struct
374     {
375         unsigned passive          : 1;
376         unsigned dddd             : 1; /*Type 2+/4D */
377         unsigned arcmail060       : 1;
378         unsigned tosscan          : 1;
379         unsigned umlautnet        : 1;
380         unsigned exportbyname     : 1;
381         unsigned allowareacreate  : 1;
382         unsigned disablerescan    : 1;
383         unsigned arc_status       : 2; /*NetmailStatus for ARCmail attaches */
384         unsigned arc_direct       : 1; /*Direct flag for ARCmail attaches   */
385         unsigned noattach         : 1; /*don't create a ARCmail file attach */
386         unsigned mgr_status       : 2; /*NetMailStatus for AreaFix receipts */
387         unsigned mgr_direct       : 1; /*Direct flag for ... */
388         unsigned not_help         : 1;
389         unsigned not_notify       : 1;
390         unsigned packer           : 4;
391         unsigned packpriority     : 1;
392         unsigned resv             : 2;
393     }
394     flags;                      /* 24 bits total! */
395     struct
396     {
397 /*
398         unsigned type             : 2;     Type of AreaFix: None (human),
399                                            Normal or Advanced (FSC-57)
400         unsigned noforward        : 1;     Don't forward AFix requests
401         unsigned allowremote      : 1;
402         unsigned allowdelete      : 1;     flags for different FSC-57 requests
403         unsigned allowrename      : 1;     all 3 reserved for future use
404         unsigned binarylist       : 1;
405         unsigned addplus          : 1;     add '+' when requesting new area
406         unsigned addtear          : 1;     add tearline to the end of requests
407         unsigned sendto           : 3;     name of this systems's AreaFix robot
408         unsigned resv             : 4;
409 */
410         unsigned short afixflags;
411     }
412     afixflags;
413     unsigned short resv2;
414     char password[9];          /* .PKT password */
415     char areafixpw[9];         /* AreaFix password */
416     unsigned short sec_level;
417     unsigned long groups;      /* Bit-field, UCHAR 0/Bit 7 = 'A' etc. */
418     /* FALSE means group is active */
419     unsigned long resv3;
420     unsigned short resv4;
421     unsigned short maxarcsize;
422     char name[36];             /* Name of sysop */
423     unsigned char *areas;      /*
424                                 *  Bit-field with CONFIG.MaxAreas / 8
425                                 *  bits, Unsigned Char 0/Bit 7 is conference #0
426                                 *
427                                 *  Pointer will be alloc'ed by read_fe_node;
428                                 *  call free_fe_node to release it!
429                                 */
430 }
431 Node;                          /*
432                                 *  Total size of each record is stored in
433                                 *  CONFIG.NodeRecSize.
434                                 */
435 #define FE_NODE_SIZE (79 + (2 * FE_ADDRESS_SIZE))
436                                 /* FE_NODE_SIZE is size of the record except
437                                    for the variable length "areas" field */
438 
439 
440 typedef struct
441 {
442     char name[52];
443     unsigned short board;        /* 1-200 Hudson, others reserved/special */
444     unsigned short conference;   /* 0 ... CONFIG.MaxAreas-1 */
445     unsigned short read_sec, write_sec;
446     struct
447     {
448         unsigned aka    : 8;     /* 0 ... CONFIG.AkaCnt */
449         unsigned group  : 8;     /* 0 ... CONFIG.GroupCnt */
450     }
451     info;
452     struct
453     {
454         unsigned storage: 4;
455         unsigned atype  : 4;
456         unsigned origin : 5;     /* # of origin line */
457         unsigned resv   : 3;
458     }
459     flags;
460     struct
461     {
462         unsigned autoadded  : 1;
463         unsigned tinyseen   : 1;
464         unsigned cpd        : 1;
465         unsigned passive    : 1;
466         unsigned keepseen   : 1;
467         unsigned mandatory  : 1;
468         unsigned keepsysop  : 1;
469         unsigned killread   : 1;
470         unsigned disablepsv : 1;
471         unsigned keepmails  : 1;
472         unsigned hide       : 1;
473         unsigned nomanual   : 1;
474         unsigned umlaut     : 1;
475         unsigned resv       : 3;
476     }
477     advflags;
478     unsigned short resv1;
479     unsigned long seenbys;              /* LSB = Aka0, MSB = Aka31        */
480     unsigned long resv2;
481     short days;
482     short messages;
483     short recvdays;
484     char path[_MAXPATH];
485     char desc[52];
486 }
487 Area;
488 
489 #define FE_AREA_SIZE 190
490 
491 /********************************************************
492  * Optional Extensions                                  *
493  ********************************************************
494  *
495  *  These are the variable length extensions between CONFIG and the first
496  *  Node record. Each extension has a header which contains the info about
497  *  the type and the length of the extension. You can read the fields using
498  *  the following algorithm:
499  *
500  *    offset = 0;
501  *    while (offset < CONFIG.offset)
502  *    {
503  *        read_header();
504  *        if (header.type == EH_abc)
505  *        {
506  *            read_and_process_data();
507  *        }
508  *        else if (header.type == EH_xyz)
509  *        {
510  *            read_and_process_data();
511  *        }
512  *        else if (header.type == ...)
513  *        {
514  *            ...
515  *        }
516  *        else
517  *        {
518  *            // unknown or unwanted extension found
519  *        }
520  *        seek_forward(header.offset);  // Seek to next header
521  *        offset += header.offset + sizeof(header);
522  *    }
523  *
524  */
525 
526 typedef struct
527 {
528     unsigned short type;                /* EH_...                           */
529     unsigned long offset;               /* length of field excluding header */
530 }
531 ExtensionHeader;
532 #define FE_EXTHEADER_SIZE 6
533 
534                                 /* note: original .h file defined this constant
535                                    to 0x0001, but this obviously did not work
536                                  */
537 #define EH_AREAFIX      0x000d          /* CONFIG.FWACnt * <ForwardAreaFix> */
538 
539 enum AreaFixAreaListFormat
540 {
541     Areas_BBS = 0, Area_List
542 };
543 
544 typedef struct
545 {
546     unsigned short nodenr;
547     struct
548     {
549 /*
550         unsigned newgroup : 8;
551         unsigned active   : 1;
552         unsigned valid    : 1;
553         unsigned uncond   : 1;
554         unsigned format   : 3;
555         unsigned resv     : 2;
556 */
557         unsigned short flags;
558     }
559     flags;
560     char file[_MAXPATH];
561     char resv0[56];
562     unsigned short sec_level;
563     unsigned short resv1;
564     unsigned char resv3[3];
565     unsigned long groups;
566     char resv2[33];              /* THIS LOOKS LIKE BULLSHIT FIXME */
567 }
568 ForwardAreaFix;
569 
570 #define FE_FORWARD_AREAFIX_SIZE 160
571 
572 #define EH_GROUPS       0x000C  /* CONFIG.GroupCnt * <GroupNames> */
573 
574 typedef struct
575 {
576     char name[36];
577 }
578 GroupNames;
579 #define FE_GROUPNAMES_LEN 36
580 
581 #define EH_GRPDEFAULTS  0x0006  /* CONFIG.GDCnt * <GroupDefaults> */
582 
583 /* Size of each full GroupDefault record is CONFIG.GrpDefResSize */
584 
585 typedef struct
586 {
587     unsigned char group;
588     unsigned char resv[15];
589     Area area;
590     unsigned char *nodes;       /*
591                                  * variable, c.MaxNodes / 8 bytes
592                                  *
593                                  *  Pointer will be malloc'ed by
594                                  *  read_fe_groupdefaults,
595                                  *  call free_fe_groupdefaults to release it!
596                                  */
597 
598 }
599 GroupDefaults;
600 #define FE_GROUPDEFAULTS_SIZE (16 + FE_AREA_SIZE)
601                                 /* This is the length of the record except for
602                                    the variable length "nodes" field */
603 
604 #define EH_AKAS         0x0007  /* CONFIG.AkaCnt * <SysAddress> */
605 
606 typedef struct
607 {
608     FEAddress main;
609     char domain[28];
610     unsigned short pointnet;
611     unsigned long flags;        /* unused */
612 }
613 SysAddress;
614 #define FE_SYS_ADDRESS_SIZE (FE_ADDRESS_SIZE + 34)
615 
616 #define EH_ORIGINS      0x0008  /* CONFIG.OriginCnt * <OriginLines> */
617 
618 typedef struct
619 {
620     char line[62];
621 }
622 OriginLines;
623 
624 #define EH_PACKROUTE    0x0009  /* CONFIG.RouteCnt * <PackRoute> */
625 
626 typedef struct
627 {
628     FEAddress dest;
629     FEAddress routes[MAX_ROUTE];
630 }
631 PackRoute;
632 
633 #define EH_PACKERS      0x000A  /* CONFIG.Packers * <Packers> (DOS)  */
634 #define EH_PACKERS2     0x100A  /* CONFIG.Packers * <Packers> (OS/2) */
635 
636 typedef struct
637 {
638     char tag[6];
639     char command[_MAXPATH];
640     char list[4];
641     unsigned char ratio;
642     unsigned char resv[7];
643 }
644 Packers;
645 #define FE_PACKERS_SIZE 74
646 
647 #define EH_UNPACKERS    0x000B  /* CONFIG.Unpackers * <Unpackers> (DOS)  */
648 #define EH_UNPACKERS2   0x100B  /* CONFIG.Unpackers * <Unpackers> (OS/2) */
649 
650 /* Calling convention:                                      *
651  * 0 = change path to inbound directory, 1 = <path> *.PKT,  *
652  * 2 = *.PKT <path>, 3 = *.PKT #<path>, 4 = *.PKT -d <path> */
653 
654 typedef struct
655 {
656     char command[_MAXPATH];
657     unsigned char callingconvention;
658     unsigned char resv[7];
659 }
660 Unpackers;
661 
662 #define EH_RA111_MSG    0x0100  /* Original records of BBS systems */
663 #define EH_QBBS_MSG     0x0101
664 #define EH_SBBS_MSG     0x0102
665 #define EH_TAG_MSG      0x0104
666 #define EH_RA200_MSG    0x0105
667 #define EH_PB200_MSG    0x0106  /* See BBS package's documentation */
668 #define EH_PB202_MSG    0x0107  /* for details                     */
669 #define EH_MAX202_MSG   0x0108
670 
671 
672 /********************************************************
673  * Routines to access Node.areas, Node.groups           *
674  ********************************************************/
675 
676 #ifdef INC_FE_BAMPROCS
677 
AddBam(unsigned char * bam,unsigned short nr)678 unsigned short AddBam(unsigned char * bam, unsigned short nr)
679 {
680     unsigned char c, d;
681     c = 1 << (7 - (nr & 7));
682     d = bam[nr / 8] & c;
683     bam[nr / 8] |= c;
684     return d;
685 }
686 
FreeBam(unsigned char * bam,unsigned short nr)687 void FreeBam(unsigned char * bam, unsigned short nr)
688 {
689     bam[nr / 8] &= ~(1 << (7 - (nr & 7)));
690 }
691 
GetBam(unsigned char * bam,unsigned short nr)692 unsigned short GetBam(unsigned char * bam, unsigned short nr)
693 {
694     if (bam[nr / 8] & (1 << (7 - (nr & 7))))
695     {
696         return TRUE;
697     }
698     return FALSE;
699 }
700 
701 #define IsActive(nr,area)      GetBam(Node[nr].areas,area)
702 #define SetActive(nr,area)     AddBam(Node[nr].areas,area)
703 #define SetDeActive(nr,area)   FreeBam(Node[nr].areas,area)
704 
705 #endif
706 
707 /********************************************************
708  * FASTECHO.DAT = <STATHEADER>                          *
709  *                + <STATHEADER.NodeCnt * StatNode>     *
710  *                + <STATHEADER.AreaCnt * StatArea>     *
711  ********************************************************/
712 
713 #define STAT_REVISION       3   /* current revision */
714 
715 struct fe_date                  /* Used in FASTECHO.DAT */
716 {
717     unsigned short year;
718     unsigned char day;
719     unsigned char month;
720 };
721 
722 typedef struct
723 {
724     char signature[10];                /* contains 'FASTECHO\0^Z' */
725     unsigned short revision;
726     struct fe_date lastupdate;         /* last time file was updated */
727     unsigned short NodeCnt, AreaCnt;
728     unsigned long startnode, startarea;/* unix timestamp of last reset */
729     unsigned short NodeSize, AreaSize; /* size of StatNode and StatArea records */
730     char resv[32];
731 }
732 STATHEADER;
733 
734 typedef struct
735 {
736     FEAddress adr;
737     unsigned long import_i, export_i;
738     struct fe_date lastimport, lastexport;
739     unsigned long dupes;
740     unsigned long importbytes, exprotbytes;
741 }
742 StatNode;
743 
744 typedef struct
745 {
746     unsigned short conference;         /* conference # of area */
747     unsigned long tagcrc;              /* CRC32 of area tag    */
748     unsigned long import_i, export_i;
749     struct fe_date lastimport, lastexport;
750     unsigned long dupes;
751 }
752 StatArea;
753 
754 /* ======================================================================= */
755 /* Functions for reading some of these structs in a portable manner        */
756 /* ======================================================================= */
757 
758 #ifdef __cplusplus
759 extern "C" {
760 #endif
761 
762 int read_fe_config(CONFIG *c, FILE *fp);
763 int read_fe_extension_header(ExtensionHeader *h, FILE *fp);
764 int read_fe_sysaddress(SysAddress *a, FILE *fp);
765 int read_fe_area(Area *a, FILE *fp);
766 
767                                 /* length is the length as announced by the
768                                    extension header */
769 int read_fe_node(Node *n, FILE *fp, size_t length);
770 void free_fe_node(Node *n);
771 int read_fe_groupdefaults(GroupDefaults *g, FILE *fp, size_t length);
772 void free_fe_groupdefaults(GroupDefaults *g);
773 
774 int read_fe_packers(Packers *p, FILE *fp);
775 int read_fe_frequest(ForwardAreaFix *f, FILE *fp);
776 
777 #ifdef __cplusplus
778 }
779 #endif
780 
781 #endif
782