forked from oe5hpm/openBCM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mail.h
3102 lines (2901 loc) · 107 KB
/
mail.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/***************************************************************
BayCom(R) Packet-Radio fuer IBM PC
OpenBayCom-Mailbox
-------------------------------------------
Definitionen und Deklarationen fuer Mailbox
-------------------------------------------
Copyright (c) Florian Radlherr
Taubenbergstr. 32
D-83627 Warngau
Alle Rechte vorbehalten / All Rights Reserved
***************************************************************/
//19980115 OE3DZW removed obsolete defines, changed fbb-fwd-path
// added ad_timezone()
//19980124 OE3DZW added define for REJECTLOGNAME
//19980202 OE3DZW added option for new callcheck (from hrx), id for cb-mode
//19980208 OE3DZW defined BETREFFLEN
//19980211 OE3DZW added bytes/connects to fwdpara_t
//19980215 OE3DZW added define for syslog_r.bcm
//19980218 OE3DZW added msgty(pe) to mailflags
//19980301 OE3DZW added ax25_set_pid (mbflex.cpp)
//19980226 hrx added taskwin to functions (interfac.cpp)
//19980301 OE3DZW added killforwarded, add_hold
//19980311 DG9MHZ changes for Linux-Kernel AX25
//19980324 DH3MB support for md2/5
//19980408 hrx cbmodeid changed (from /cb to cb)
// autotrcwin added to mailpara_t
// mbcheckcount added to functions, section check.cpp
// trcwin added to functions, section interfac.cpp
//19980411 hrx changed type of mbcheckcount() to long
// added autofwd as part of hrx_opt
// added fwd_afwd.cpp to function section, currently
// autofwd() and fwdlist() are used
//19980613 hrx added _paclen conditional to hrx_opt
// added _asklogin conditional tp hrx_opt
// added _cfwd conditional tp hrx_opt
// added CHECKNUMNAME "checknum.bcm" and
// CHECKNUMTMP "checknum.$$$". used for autofwd.
// added paclen int to user_t, mailpara_t. added
// structures hadr_t, hadr_old_t, used for autofwd.
// added uclose(), hadr_tryopen(), loadhadr() to functions,
// section mbhadr.cpp. added createboardfwd to mailpara_t
// added autofwdtime to mailpara_t
//19980619 OE3DZW moved defines for options to baycom.h
//19980913 OE3DZW added savebroken
//19981015 OE3DZW added parameters for wxstation
//19990111 OE3DZW added dirformat to user-database
//19990714 DH3MB Changed declarations for fwd.cpp and fwd_rli.cpp
//19991028 Jan added defines for AX25K_ONLY
//20000624 DK2UI changed size of struct reject_t for regular expressions
//20020724 DH8YMB name changed from "BCM" to "OpenBCM"
//20021130 DH8YMB HRX_OPT Optionen fest eingebaut
//20030102 hpk added minpaclen, maxpaclen, defrea to mailpara_t
//20030102 hpk added pwonly for the CB-BCMNET login-concept to mailpara_t
//20030102 hpk added logintype for the CB-BCMNET login-concept to t_var_t
//20030109 DH8YMB defpaclen hinzu
//20030706 DB1RAS added CB-BCMNET modeid and support message
//20030706 DB1RAS added dospreexec and dospostexec in mailpara_t
//20030809 DB1RAS added CB-BCMNET gateway functions
//20030821 DH8YMB added fwd_file.cpp
//20031010 DH8YMB Userdatenbank neues Format in users4.bcm
//20031226 DH6BB FTP-Server fuer den Filesurf
//20121226 DG4MFN added comment to AUTHOR_ID about modification for Linux GCC 4.x.x
/*---------------------------------------------------------------------------*/
#undef VNUMMER
#define VNUMMER "1.07b12"
#define STD_BOXHEADER "OpenBCM"
#define LOGINSIGN STD_BOXHEADER" V"VNUMMER" ("OPSYSTEM")"
#ifdef __LINUX__
#define AUTHOR_ID "(c) GNU GPL 1992-"YEAR" F. Radlherr, DL8MBT et al.\n" \
"OpenBCM is maintained by Markus Baumann, DH8YMB\n" \
"Sourcecode modified for GCC 4.x compilers by DG4MFN\n"
#else
#define AUTHOR_ID "(c) GNU GPL 1992-"YEAR" F. Radlherr, DL8MBT et al.\n" \
"OpenBCM is maintained by Markus Baumann, DH8YMB\n"
#endif
#if ! defined _BCMNET || ! defined _BCMNET_FWD || ! defined _BCMNET_LOGIN
#define CBMODEID "(CB)"
#define CBSUPPORT "CB-Version, Support by DJJ812/DO1MJJ\n"
#define WEBSITE_CB "http://www.juerging.net/projekte/dbo812"
#else
#define CBMODEID "*CB-BCMNET*"
#define CBSUPPORT "CB-BCMNET Version, Support by AS1GBF/AT5HPK/HF1BKM\n"
#define WEBSITE_CB "http://www.afulinux.de/afulinux/cb-bcmnet"
#endif
#define WEBSITE "http://dnx274.org/baybox"
#ifdef __MSDOS__
#ifdef __FLAT__
#ifdef _WIN32
#define OPSYSTEM "WIN32"
#define BCMLOGO "OBcm"
#else
#define OPSYSTEM "DOS32"
#define BCMLOGO "OBCm"
#endif
#else
#define OPSYSTEM "DOS"
#define BCMLOGO "OBCM"
#endif
#else
#ifdef __LINUX__
#ifndef __sparc__
#define OPSYSTEM "Linux"
#else
#define OPSYSTEM "Slink" //Sparc-Linux is 'Slink' - F1ULQ
#endif
#ifndef __sparc__
#define BCMLOGO "obcm"
#else
#define BCMLOGO "Sobcm"
#endif
#endif
#endif
//*************************************************************************
// path and file names
//*************************************************************************
#define MSGPATH "msg"
#define SYSTEMPATH "system"
#define LOGPATH "log"
#define TRACEPATH "trace"
#define TEMPPATH "temp"
#define FWDPATH "fwd"
#define FBBPATH "fwd/fbb"
#define FWDEXPATH "fwd/export"
#define FWDIMPATH "fwd/import"
#define WLOGPATH "fwd/wlog"
#ifdef __FLAT__
#define HTTPPATH "http"
#endif
#define CRONTABNAME "crontab.bcm"
#define VIDNAME "dosvid.bcm"
#define FWDLISTNAME "fwd.bcm"
#define FWDLISTNAMEBAK "fwd.bak"
#ifdef _AUTOFWD
#define AFWDLISTNAME "afwd.bcm"
#define AFWDTMP "temp/afwd1.tmp"
#endif
#define BEACONNAME "beacon.bcm"
#define CONVFILENAME "convert.bcm"
#define CONVTMPNAME "convname.$$$"
#ifdef __MSDOS__
#define USERNAMEOLD "users.bcm"
#else
#define USERNAMEOLD "users3.bcm"
#endif
#define USERNAME "users4.bcm"
#define USERNAMEBAK "users4.bak"
#define USERNAMETMP "users4.$$$"
#define UTMP "users.$$$"
#ifdef __MSDOS__
#define HADROLDNAME "hadr2.bcm"
#define BIDNAME "bids2.bcm"
#define BIDNAME_L "bids3.bcm"
#else
#define HADROLDNAME "hadr3.bcm"
#define BIDNAME "bids3.bcm"
#endif
#define HADRNAME "hadr4.bcm"
#define HADRHASHNAME "hadrhash.bcm"
#define USERHASHNAME_OLD "userhash.bcm"
#define UHTMP "userhash.$$$"
#define USERHASHNAME "userh2.bcm"
#define USERHASHNAMEBAK "userh2.bak"
#define BIDHASHNAME "bidh2.bcm"
#define BTMP "bids2.$$$"
#define BHTMP "bidh2.$$$"
#define BBAK "bids2.bak"
#define BHBAK "bidh2.bak"
#define DIRLISTNAME "list.bcm"
#define DIRTMPNAME "list.$$$"
#define MBINITNAME "init.bcm"
#define MBINITOLDNAME "bcm.ini"
#define INITTMPNAME "init.$$$"
#define INITBAKNAME "init.bak"
//#define LOGNAME "log.bcm"
#define CHECKNAME "check.bcm"
#define CHECKTMPNAME "check.$$$"
#define CHECKNUMNAME "checknum.bcm"
#define CHECKNUMTMP "checknum.$$$"
#define PASSWDNAME "passwd.bcm"
#define PRIVNAME "pwlist.bcm"
#define TREENAME "bulletin.bcm"
#define TREETMPNAME "bulletin.$$$"
#define TREEBAKNAME "bulletin.bak"
#define SYSLOGNAME "syslog.bcm"
#define SYSLOGRNAME "syslog_r.bcm"
#define CMDLOGNAME "cmdlog.bcm"
#define PWLOGNAME "pwlog.bcm"
#ifdef __FLAT__
#define NNTPLOGNAME "nntplog.bcm"
#define HTTPLOGNAME "httplog.bcm"
#define POP3LOGNAME "pop3log.bcm"
#define SMTPLOGNAME "smtplog.bcm"
#define FTPLOGNAME "ftplog.bcm"
#endif
#define ERASELOGNAME "eraselog.bcm"
#define UNKNOWNNAME "unknown.bcm"
#define SFHOLDNAME "sfhold.bcm"
#define SWAPLOGNAME "swap.bcm"
#define MFILTERLOGNAME "m_filter.bcm"
#define RUNDATNAME "rundat.bcm"
#define BIDNAME_OLD "bids.bcm"
#define BIDHASHNAME_OLD "bidhash.bcm"
#define RUNNAME "runutil.bcm"
#define MAILLISTNAME "mailserv.bcm"
#define MAILLISTTMPNAME "mailserv.$$$"
#ifdef DF3VI_POCSAG
#define POCSAGLISTNAME "pocsag.bcm"
#define POCSAGLISTTMP "pocsag.$$$"
#endif
#define OLDUMAILLOGNAME "oldumail.bcm"
#define REJECTLOGNAME "rejlog.bcm"
#define REJECTNAME "reject.bcm"
#ifdef DF3VI_REJ_EDIT
#define REJECTTMPNAME "reject.bak"
#endif
#define POPDBNAME "popstate.bcm"
#define POPDBTMPNAME "popstate.$$$"
#define BEACONHEADNAME "beachead.bcm" //header for beacon
#define ISSUENAME "issue.bcm" //telnet pre-login infotext
#define BOARDINFO "boardinf.bcm"
#define CONVATNAME "convat.bcm"
#define RHOSTSNAME "rhosts.bcm"
#define L2INITNAME "init.l2"
#define L2PATHNAME "netpath.bcm"
#define HTMP "hadrs.$$$"
#define HHTMP "hadrhash.$$$"
#ifdef _TELEPHONE // JJ
#define INITTTYNAME "inittty.bcm"
#define INITTTYTMPNAME "inittty.$$$"
#define INITTTYBAKNAME "inittty.bak"
#endif
#ifdef MACRO
#define EVENTNAME "macro.bcm"
#endif
#ifdef _TELEPHONE
#define conlogintext "ctextcon"
#define ttylogintext "ctexttty"
#endif
/*---------------------------------------------------------------------------*/
// HTML-defines and tcpip ports
#define HTMLSTARTTAG "<HTML>"
#ifdef __FLAT__
#define MIME_JPG "image/jpeg"
#define MIME_GIF "image/gif"
#define MIME_TXT "text/html"
#define MIME_BIN "application/x-binary"
#define MIME_WAV "audio/wav"
#define DEFFTPPORT 8021
#define DEFSMTPPORT 8025
#define DEFPOP3PORT 8110
#define DEFNNTPPORT 8119
#define DEFHTTPPORT 8080
#define DEFTELNPORT 4719
#define DEFSERVPORT 8123
#define DEFRADIOPORT 8124
#endif
/*---------------------------------------------------------------------------*/
// flags of "7plus" by dg1bbq
#define START7PFLAG " go_7+. "
#define STOP7PFLAG " stop_7+. "
#define STARTINFOFLAG " go_info. "
#define STOPINFOFLAG " stop_info."
#define STARTTEXTFLAG " go_text. "
#define STOPTEXTFLAG " stop_text."
/*---------------------------------------------------------------------------*/
#define FWDOK 0
#define FWDNO 1
#define FWDREJ 2
#define FWDERR 3
#define BINMODE_AUTOBIN 0
#define BINMODE_YAPP 1
#define BINMODE_DIDADIT 2
#define BINMODE_BINSPLIT 3
#define SEPLINE "-------------------------------------------------------------------------------"
/*---------------------------------------------------------------------------*/
// Betriebssystemabhaengige Definitionen
#ifdef __FLAT__
#define US_CACHESZ 128 // user database cache
#define biosminuten ad_minutes()
#define TASKS 250
#define MAXTNCPORTS 220
#define MAXBLKS 400
#define MAXHELP 60
#define MAXUSERMAILS 60000U
#define MAXDIRENTRIES 300000U
#define MAXTREEENTRIES 10000 // Anzahl der Boards
#define MAXTREELENGTH 18 // Laenge eines vollen Boardnamen
#define MAXCONVNAME 5000
#define MAXFWD 50 // Anzahl der Boxen, zu denen geforwardet wird, nicht aendern!
#define BUFLEN 500
#define MAXDEST 1000 // Maximum number of destinations
#define MAXDESTLEN MAXDEST * HADRESSLEN // Groesse des Arrays fuer die Zieladressen
#define FNAMELEN 50 //not more than 50 for BIN header, 120 needed for filesurf
#define TASKSTACK 32000
#define LOCK_MAX 200
#define SEMA_MAX 150
#else
#define US_CACHESZ 1 // for DOS reduced because of DGROUP > 64k
#define biosminuten ((unsigned) (*((long far *) MK_FP(0x40, 0x6c)) / 1092))
#define coldstart() ((void far (*)(void)) MK_FP(0xffff, 0x0000))()
#define TASKS 80
#define MAXTNCPORTS 73
#define MAXBLKS 150
#define MAXHELP 60
#define MAXUSERMAILS 2000U
#define MAXDIRENTRIES 4000U
#define MAXTREEENTRIES 800 // Anzahl der Boards
#define MAXTREELENGTH 18 // Laenge eines vollen Boardnamen
#define MAXCONVNAME 1000
#define MAXFWD 24 // Anzahl der Forwardpartner, nicht aendern!
#define BUFLEN 300
#define MAXDEST 250
#define MAXDESTLEN 3000 // Groesse des Arrays fuer die Zieladressen
#define FNAMELEN 50
#ifdef MACRO
#define TASKSTACK 5000
#else
#ifdef _FILEFWD // Fileforward need more stack (db1ras)
#define TASKSTACK 3250
#else
#define TASKSTACK 3000
#endif
#endif
#define LOCK_MAX 60
#define SEMA_MAX 40
#endif
/*---------------------------------------------------------------------------*/
// Bits fuer die Optionen
#define o_a (0x00000001L)
#define o_b (0x00000002L)
#define o_c (0x00000004L)
#define o_d (0x00000008L)
#define o_e (0x00000010L)
#define o_f (0x00000020L)
#define o_g (0x00000040L)
#define o_h (0x00000080L)
#define o_i (0x00000100L)
#define o_j (0x00000200L)
#define o_k (0x00000400L)
#define o_l (0x00000800L)
#define o_m (0x00001000L)
#define o_n (0x00002000L)
#define o_o (0x00004000L)
#define o_p (0x00008000L)
#define o_q (0x00010000L)
#define o_r (0x00020000L)
#define o_s (0x00040000L)
#define o_t (0x00080000L)
#define o_u (0x00100000L)
#define o_v (0x00200000L)
#define o_w (0x00400000L)
#define o_x (0x00800000L)
#define o_y (0x01000000L)
#define o_z (0x02000000L)
//oe3dzw Neue Flags
#define o_0 (0x04000000L)
#define o_b1 (0x04000000L)
#define o_1 (0x08000000L)
#define o_d1 (0x08000000L)
#define o_2 (0x20000000L)
#define o_3 (0x40000000L)
#define o_4 (0x80000000L)
/*---------------------------------------------------------------------------*/
//*************************************************************************
// Defines of special strings
//*************************************************************************
#define CALLEN 6
#define DIRLEN 8 // boardname
#define CALLSSID 9 // call with SSID
#define BIDLEN 12
#define NAMELEN 14
#define MYBBSLEN 39 // length of complete MyBBS incl. H-Route
#define OLDMYBBSLEN 24 // for compatibility with the old mybbs field
#define PROMPTLEN 20
#define FIRSTCMDLEN 20
#define QTHLEN 30
#define ZIPLEN 8
#define HADRESSLEN 39 // complete H-Route
#define MAXPARSE 40
#define BINCMDLEN 80 // fix size of BIN-header within mail files
#define BETREFFLEN 80 // max. length of title
#define LINELEN 80 // standard line length
#define FSPATHLEN 100
#define BLEN 128 // line len of most binary files
#define LBLEN 128L
#define CMDBUFLEN 130
#define DESTBOXLEN (MAXFWD*7)
#define CBUFLEN 8192 // copy buffer size (1L << 13)
#define ADJNUM 20
#define HEADERLEN 60
#define BSTATUSLEN 20
#define BHWADDRESSLEN 49
#define BPROTOLEN 10
#define BVERSION 10 // Version 1.0
#define BSTATUS "0" // Allow DFWD, 0=inactive, 1=active
#define WPSUBJECT "WP Update"
#define WPROTSUBJECT "WPROT Update"
#define BPROTMAX 10 // max. WPROT protocol version accepted
#define WPBUFSIZE 255
#define FBBMSGNUMOFFSET 100000L // Unterscheidung von FBB-Check-Nr.+DIR/LIST-Nr.
#define LOGLEN 20
#define MAXLOGSUM 1000
#define USERDBREST 88
#ifdef RUNUTILS
#define RUN_CMDLEN 11
#define RUN_EXELEN 19
#define RUN_COMLEN 65
#define RUN_PARAMLEN 130 // max. length of parameters for run-util
#endif
/*---------------------------------------------------------------------------*/
#define BOARDLEER (-1)
#define MAXBEREICH (ULONG_MAX)
#define HASH16 (65536L) // (1L << 16)
#define HASH32 (65536L*2) // (1L << 17)
#define MAXCOMPFILESIZE 80000000L // 80 MB max. FBB-compressed maillength
#define HOUR 3600L // 60 * 60
#define DAY 86400L // 60 * 60 * 24
#define MAXAGE 2529000L // 60 * 60 * 24 * 30 max. age of incomimg mybbs
#ifdef _BCMNET
#define USERPROTECT 183L * DAY // Zeitspanne für den Userschutz
#define BCMNETID ".BCMNET"
#endif
/*---------------------------------------------------------------------------*/
// Min. available diskspace in kbytes
#define USERDISKFULL 500L
#define INFODISKFULL 1000L
#define HOMEDISKFULL 1000L
/*---------------------------------------------------------------------------*/
//*************************************************************************
// Characters used in YAPP-file-transfer and FBB-forwarding (DH3MB)
//*************************************************************************
#define NUL 0x00 // End of string / Separator
#define SOH 0x01 // Start of header
#define STX 0x02 // Start of transmission
#define ETX 0x03 // End of transmission
#define EOT 0x04 // End of Transfer
#define ENQ 0x05 //
#define ACK 0x06 // Acknowledgement
#define DLE 0x10 //
#define NAK 0x15 // Negative Acknowledgenment
#define CTRLX 0x18 // Cancel
#define CTRLZ 0x1a
#define ESC 0x1b
/*---------------------------------------------------------------------------*/
//*************************************************************************
// Use THIS!
//*************************************************************************
#define safe_strncpy(a, b, n) { strncpy(a, b, n-1); a[n-1] = 0; }
#define safe_strcpy(a, b) safe_strncpy(a, b, sizeof(a))
/*---------------------------------------------------------------------------*/
#define ltell(fh) lseek(fh, 0L, SEEK_CUR)
#define leof(fh) (lseek(fh, 0L, SEEK_CUR) == filelength(fh))
/*---------------------------------------------------------------------------*/
typedef unsigned long bitfeld;
#pragma pack(1) // Alignment auf 1 Byte setzen
typedef struct user_t
//*************************************************************************
//
// Struktur fuer die users4.bcm Userdatenbank
//
//*************************************************************************
{ char call[CALLEN+1]; // 7 Rufzeichen des Users
char name[NAMELEN+1]; // 15 A NAME
char qth[QTHLEN+1]; // 31 QTH (DH8YMB)
char qthok; // 1 QTH selbst eingegeben
char zip[ZIPLEN+1]; // 9 ZIP-Code (Postleitzahl) (DH8YMB)
char zipok; // 1 Zip-Code selbst eingegeben
char mybbs[MYBBSLEN+1]; // 40 A FORWARD
char mybbsok; // 1 MYBBS selbst eingegeben
time_t mybbstime; // 4 Datum des letzten MYBBS (UNIX)
char uplink[CALLSSID+1]; // 10 uplink-Digi
char newcall[CALLEN+1]; // 7 New callsign (license update)
char prompt[PROMPTLEN+1]; // 21 A PROMPT
char sprache[4]; // 4 A SPEECH
char password[40]; // 40 A PW (pw off = 0x01 0x00 ...)
char notvisible[LINELEN]; // 80 A REJECT
char firstcmd[FIRSTCMDLEN+1]; // 21 A COMMAND
short unsigned helplevel; // 2 A HELPLEVEL
long unsigned logins; // 4 Anzahl an Logins
short unsigned lf; // 2 A LF
short unsigned zeilen; // 2 A LINES
char nopurge; // 1 Board wird nicht geputzt
char nameok; // 1 Name selbst eingegeben
time_t lastboxlogin; // 4 letzter Login (UNIX)
time_t lastdirnews; // 4 letztes DIR NEWS / Check (UNIX)
time_t lastquit; // 4 letztes QUIT
time_t lastload; // 4 interner Merker für Verwaltung
long mailsent; // 4 gesendete Nachrichten
long mailgot; // 4 erhaltene Nachrichten
long mailread; // 4 gelesene Nachrichten
long unsigned daybytes; // 4 gelesene Bytes heute
bitfeld opt[8]; // 32 eingestellte Optionen
char ufwd[HADRESSLEN+1]; // 40 Connect-Path fuer User-forwarding
char loginpwtype; // 1 Password-type for ax-login (DH3MB)
// 0..BayCom-Password
// 1..MD2
// 2..MD5
// 100..disabled
char sfpwtype; // 1 Password-type for S&F (DH3MB)
// 0..BayCom-Password
// 1..MD2
// 2..MD5
// 100..disabled
char ttypw[9]; // 9 A TTYPW (TTY-Password)
short unsigned fdelay; // 2 Verzoegerung für eigene Nachrichten
short unsigned fhold; // 2 Verzoegerung für Nachrichten
short unsigned status; // 2 A STATUS (Bit-field)
// 0..default
// 1..no quota-limits
// 2..access denied
// 4..access denied, sysop informed
// 8..my not use transfer command
char readlock; // 1 Privatmails nicht lesbar
char rlimit; // 1 fremde Privatmails nicht lesbar
char pwline; // 1 Leerzeile beim Login
char echo; // 1 Eigene Eingaben zurückschicken
short unsigned paclen; // 2 Packetlength
char dirformat; // 1 Dir/Check/List in new format
char binmode; // 1 AutoBIN/YAPP/DIDADIT bei BIN-Mails
char unsecure_smtp; // 1 0=>needs to pop before smtp
// 1=>smtp without pop allowed
char away; // 1 AWAY-Funktion aktiv/deaktiv (DH8YMB)
time_t awayendtime; // 4 AWAY Endtime (UNIX)
char awaytext[LINELEN]; // 80 AWAY Text
char charset; // 1 A CHARSET (nicht implementiert)
char ttycharset; // 1 TTY-Charset (nicht implementiert)
char fbbcheckmode; // 1 FBB-Check/Read-Mode
char notification[CALLEN+1]; // 7 Mailbenachrichtigung
char linuxpw[9]; // 9 A LINUXPW (Linux-System-Passwort)
char comp; // 1 Huffman-COMP aktiv/deaktiv
char httpsurface; // 1 Aussehen der HTTP-Oberflaeche
// 0=>Sysopvoreinstellung (defhttpsurface wird genutzt)
// 1=>alte Oberflaeche mit Frames und ohne CSS-Support
// 2=>neue Oberflaeche ohne Frames und mit CSS-Support
// 3=>alte Oberflaeche ohne Frames und ohne CSS-Support
char restplatz[USERDBREST]; // 88 Restplatz -> USERDBREST definieren!!
short unsigned filepos_old; // 2 Position im Userfile (altes Format)
short unsigned nextsamehash_old; // 2 Link Hashliste (altes Format)
long unsigned filepos; // 4 Position im Userfile
long unsigned nextsamehash; // 4 Link Hashliste
// = 640 Bytes
} user_t ;
#pragma pack() // Alignment zurueck auf Default
/*---------------------------------------------------------------------------*/
#ifdef _USERS4CONVERT
#ifdef __MSDOS__
typedef struct userold_t
//*************************************************************************
//
// Struktur fuer die alten Userdaten users.bcm (DOS)
//
//*************************************************************************
{ char call[CALLEN+1]; // 7 Rufzeichen des Users
char name[NAMELEN+1]; // 15 A NAME
char oldmybbs[OLDMYBBSLEN+1]; // 25 for compatibility with old mybbs field
char prompt[PROMPTLEN+1]; // 21 A PROMPT
char sprache[4]; // 4 A SPEECH
char password[40]; // 40 A PW ; pw off = 0x01 0x00 ..
char notvisible[LINELEN]; // 80 A REJECT
char firstcmd[FIRSTCMDLEN+1]; // 21 A COMMAND
short unsigned helplevel; // 2 A HELPLEVEL
short unsigned zeilen; // 2 A LINES
char nopurge; // 1 Board wird nicht geputzt
char nameok; // 1 Name selbst eingegeben
time_t lastboxlogin; // 4 letzter Login (UNIX)
time_t lastdirnews; // 4 letztes DIR NEWS / Check (UNIX)
time_t lastquit; // 4 letztes QUIT
long mailsent; // 4 gesendete Nachrichten
long mailgot; // 4 erhaltene Nachrichten
long mailread; // 4 gelesene Nachrichten
long unsigned logins; // 4 logins
char mybbsok; // 1 MYBBS selbst eingegeben (1)
bitfeld opt[8]; // 32 eingestellte Optionen
short unsigned lf; // 2 A LF
char charset; // 1 A CHARSET (nicht impl)
time_t mybbstime; // 4 Datum des letzten MYBBS (UNIX)
char ttypw[9]; // 9 A TTYPW (TTY-Password)
time_t lastload; // 4 interner Merker für Verwaltung
long unsigned daybytes; // 4 gelesene Bytes heute
short unsigned status; // 2 A STATUS (Bit-field)
// 0..default
// 1..no quota-limits
// 2..access denied
// 4..access denied, sysop informed
// 8..my not use transfer command
char uplink[CALLSSID+1]; // 10 uplink-Digi
char readlock; // 1 Privatmails nicht lesbar (")
char pwline; // 1 Leerzeile beim Login
char echo; // 1 Eigene Eingaben zurückschicken
short unsigned fdelay; // 2 Verzoegerung für eigene Nachrichten
short unsigned fhold; // 2 Verzoegerung für Nachrichten
char rlimit; // 1 fremde Privatmails nicht lesbar
char ufwd[40]; // 40 Connect-Path fuer User-forwarding
char loginpwtype; // 1 Password-type for ax-login (DH3MB)
// 0..BayCom-Password
// 1..MD2
// 2..MD5
// 100..disabled
char sfpwtype; // 1 Password-type for S&F (DH3MB)
// 0..BayCom-Password
// 1..MD2
// 2..MD5
// 100..disabled
char newcall[CALLEN+1]; // 7 New callsign (license update)
short unsigned paclen; // 2 Packetlength
char dirformat; // 1 Dir/Check/List in new format
char binmode; // 1 AutoBIN/YAPP/DIDADIT bei BIN-Mails
char unsecure_smtp; // 1 0=>needs to pop before smtp
// 1=>smtp without pop allowed
char mybbs[MYBBSLEN+1]; // 40 A FORWARD
char away; // 1 AWAY-Funktion aktiv (DH8YMB)
char restplatz[81]; // 81 ist noch frei (definiert 0)
long unsigned filepos; // 4 Position im Userfile
long unsigned nextsamehash; // 4 hash list link
short unsigned filepos_old; // 2 (obsolete) Position im Userfile
short unsigned nextsamehash_old; // 2 (obsolete) hash list link
// = 512 Bytes
} userold_t;
#else
typedef struct userold_t
//*************************************************************************
//
// Struktur fuer die alten Userdaten users3.bcm der WinNT/Linux-Version,
// beruecksichtigt Alignment vom GCC (mind. 4 Byte)
//
//*************************************************************************
{ time_t lastboxlogin; // 4 letzter Login (UNIX)
time_t lastdirnews; // 4 letztes DIR NEWS / Check (UNIX)
time_t lastquit; // 4 letztes QUIT
time_t mybbstime; // 4 Datum des letzten MYBBS (UNIX)
time_t lastload; // 4 interner Merker für Verwaltung
long unsigned daybytes; // 4 gelesene Bytes heute
long mailsent; // 4 gesendete Nachrichten
long mailgot; // 4 erhaltene Nachrichten
long mailread; // 4 gelesene Nachrichten
long unsigned logins; // 4 logins
bitfeld opt[8]; // 32 eingestellte Optionen
long spare_long[10]; //
short unsigned helplevel; // 2 A HELPLEVEL
short unsigned zeilen; // 2 A LINES
short unsigned lf; // 2 A LF
short unsigned status; // 2 A STATUS (Bit-Field)
short unsigned filepos_old; // 2 (obsolete)Position im Userfile
short unsigned nextsamehash_old; // 2 (obsolete)hash list link
short unsigned fdelay; // 2 Verzoegerung für eigene Nachrichten
short unsigned fhold; // 2 Verzoegerung für Nachrichten
short unsigned paclen; // 2 packet length
short unsigned spare_short[19]; //
char call[CALLEN+1]; // 7 Rufzeichen des Users
char name[NAMELEN+1]; // 15 A NAME
char oldmybbs[OLDMYBBSLEN+1]; // 25 for compatibility with old mybbs field
char prompt[PROMPTLEN+1]; // 21 A PROMPT
char sprache[4]; // 4 A SPEECH
char password[40]; // 40 A PW
char notvisible[LINELEN]; // 80 A REJECT
char firstcmd[FIRSTCMDLEN+1]; // 21 A COMMAND
char nopurge; // 1 Board wird nicht geputzt
char nameok; // 1 Name selbst eingegeben
char mybbsok; // 1 MYBBS selbst eingegeben (1)
char charset; // 1 A CHARSET (nicht impl)
char ttypw[9]; // 9 A TTYPW (TTY-Password)
char uplink[CALLSSID+1]; // 10 uplink-Digi
char readlock; // 1 Privatmails "nicht lesbar"
char pwline; // 1 Leerzeile beim Login
char echo; // 1 Eigene Eingaben zurückschicken
char rlimit; // 1 fremde Privatmails nicht lesbar
char ufwd[40]; // 40 Connect-Path fuer User-forwarding
char loginpwtype; // 1 Password-type for ax-login (DH3MB)
char sfpwtype; // 1 Password-type for S&F (DH3MB)
char newcall[CALLEN+1]; // 7 New callsign (lizence update)
char dirformat; // 1 Dir/Check/List in new format
char unsecure_smtp; // 1 0=>needs to pop before smtp
// 1=>smtp without pop allowed
char binmode; // 1 AutoBIN/YAPP/DIDADIT bei BIN-Mails
char ttycharset; // 1 A TTYCHARSET (nicht impl)
char mybbs[MYBBSLEN+1]; // 40 A FORWARD
char away; // 1 AWAY-Funktion aktiv (DH8YMB)
char restplatz[2]; // 2 ist noch frei (definiert 0)
unsigned long filepos; // 4 position within file
unsigned long nextsamehash; // 4 hash to next record
// = 512 Bytes (473)
} userold_t;
#endif
#endif
/*---------------------------------------------------------------------------*/
typedef enum
{ j_idle,
j_fwdlink,
j_fwdsend,
j_fwdsendf,
j_fwdrecv,
j_fwdrecvf,
j_fbb_send_propose,
j_fbb_send_mail,
j_fbb_send_delay,
j_fbb_recv_propose,
j_fbb_recv_mail,
j_fbb_end,
j_fbb_error,
j_send,
j_read,
j_cmd,
j_search,
j_purge,
j_reorg,
j_tell,
j_node,
j_ftrans,
j_router,
j_convers
} job_typ;
typedef int handle;
#define NOTASK (-1)
// Flags fuer laufenden Prozess (wird in t->processkind hinterlegt)
// Die Flags koennen beliebig kombiniert werden
//
#define P_MAIL 1 // hat einen Mailbox-Kontrollblock
#define P_WIND 2 // hat einen Editor-Kontrollblock
#define P_KEYB 4 // benutzt Tastatureingaben
#define P_BACK 8 // laeuft im Hintergrund (keinerlei Ein- und Ausgabe)
#define P_CLON 16 // DH3MB: Mailbox-Kontrollblock wird in die neue
// Task uebernommen
#define P_AX25K 0x100
#define P_TELNET 0x200
typedef unsigned long bitfeld;
/*---------------------------------------------------------------------------*/
typedef enum event_t
{ e_nothing,
e_ticsfull,
e_reschedule,
e_delay,
e_kbhit
} event_t;
/*---------------------------------------------------------------------------*/
typedef enum io_t
{ io_dummy,
io_window,
io_editwin,
io_tnc,
io_tty,
io_file,
io_socket,
io_memory,
io_comp // DH3MB: Online-COMP
} io_t;
/*---------------------------------------------------------------------------*/
#define MONBUFLEN 2048
typedef struct monbuf_t
{ int tid;
bitfeld opt;
unsigned in;
unsigned out;
int congested;
char buf[MONBUFLEN];
} monbuf_t;
/*---------------------------------------------------------------------------*/
#ifdef _AX25K
/*
#define TXLEN 512
#define RXLEN 512
#define MAXSOCK 256
typedef struct sock_t
{
char rxbuf[RXLEN];
char txbuf[TXLEN];
char mycall[16];
int handle;
int rxc;
int txc;
int rxlen;
int wasput;
int wasda;
char dasda;
time_t lastflush;
}
sock_t;
extern sock_t so[MAXSOCK];
extern int ax25k_ok ;
*/
#endif
/*---------------------------------------------------------------------------*/
typedef void (* atkill_t)(void);
typedef void (* atkill2_t)(void *);
#define MAX_ATKILL 4
/*---------------------------------------------------------------------------*/
typedef struct task_t
{ event_t event;
int taskid;
int port;
int lock; // >0 avoids re-scheduling
int socket;
int childpid;
io_t input;
io_t output;
monbuf_t *monitor;
unsigned lastdelay;
unsigned begintic;
long cputics;
jmp_buf j;
unsigned processkind;
time_t created;
time_t last_input;
time_t kill_time;
time_t warn_time;
int kill_warn;
unsigned keybuffer[32];
int keybufin;
int keybufout;
void *e;
void *b;
atkill2_t atkill[MAX_ATKILL];
void *atkill_p[MAX_ATKILL];
unsigned atkillcnt;
char name[20];
// the sequence of lastcmd, lastfunc and stack is important for the stack
// overflow detection verify_stack(), don't change it! (db1ras)
char lastcmd[60]; // letztes eingegebenes Kommando
char lastfunc[40]; // letzte aufgerufene Funktion
char stack[TASKSTACK+4]; // Stack
char downlink[10]; // letztes Digirufzeichen
} task_t;
/*---------------------------------------------------------------------------*/
#define _s_report 0
#define _s_replog 1
#define _s_serious 2
#define _s_fatal 3
#define _s_tr_abbruch 4
#ifdef __FLAT__
#define report _s_report, __LINE__, __FILE__
#define replog _s_replog, __LINE__, __FILE__
#define serious _s_serious, __LINE__, __FILE__
#define fatal _s_fatal, __LINE__, __FILE__
#define tr_abbruch _s_tr_abbruch, __LINE__, __FILE__
#else
#define report _s_report, 0, ""
#define replog _s_replog, 0, ""
#define serious _s_serious, 0, ""
#define fatal _s_fatal, 0, ""
#define tr_abbruch _s_tr_abbruch, 0, ""
#endif
extern int newkeywin;
extern int keytaskid;
extern int deskkey;
extern int init_off;
extern task_t *t; // Zeiger auf aktuellen TCB
extern long systic;
void call_l2 (int off);
/*---------------------------------------------------------------------------*/
#ifdef _WXSTN
// for wx-station
typedef struct
{ int data_valid;
long
dayoyear,
minuteofday,
wind_beaufort;
double
sat_sp, // saturation steam pressure
rainltt, // rain long term total
steam_pressure,
wind_chill,
windspeed,
outdoort,
snowfall_limit,
air_pres_qnh,
air_pres_qfe,
abs_humidity,
dew_point,
kond_niveau,
indoort, // indoor temperature
humidity,
hum_indoor, // humidity indoor
wind_direction; // 0..360 degrees
char *winddir_str;
time_t t;
} wxdata_t;
#endif
/*---------------------------------------------------------------------------*/
typedef enum option_index_t
//*************************************************************************
//
// Index für das Feld mit den Optionen
//
//*************************************************************************
{ o_id=0, // info-dir
o_ud, // user-dir
o_il, // info-list
o_ul, // user-list
o_ir, // info-read
o_ur, // user-read
o_ch, // check
o_ps // ps
} option_index_t;
/*---------------------------------------------------------------------------*/
typedef enum umlaut_t
{ um_none, // keine Umlautwandlung
um_ibm, // IBM-Umlaute
um_din, // DIN-Umlaute (statt [\]{|}~)
um_aeoeue, // Wandlung nach AE OE UE
um_iso // Wandlung nach ISO (Linux,Windows)
} umlaut_t;
/*---------------------------------------------------------------------------*/
typedef enum fwdtype_t
{ fwd_none,
fwd_standard,
fwd_user,
fwd_file
} fwdtype_t;
/*---------------------------------------------------------------------------*/
typedef enum loginmode_t
{ login_silent,
login_standard,
login_ufwd,
login_fwd,
login_nofwd
} loginmode_t;
/*---------------------------------------------------------------------------*/