-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlinuxvars.h
More file actions
494 lines (446 loc) · 23.7 KB
/
linuxvars.h
File metadata and controls
494 lines (446 loc) · 23.7 KB
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
#pragma pack(push, 1)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <stdarg.h>
#include <time.h>
#include <ctype.h>
#include <sys/stat.h>
#include "/home/xenos/wwv/github/wwiv/sdk/net.h"
#define MT_DESQVIEW 0x01
#define MT_WINDOWS 0x02
#define MT_OS2 0x04
#define MT_NB 0x40
#define MSGPRIVATE 0x0001 /* Private message */
#define MSGCRASH 0x0002 /* High priority */
#define MSGREAD 0x0004 /* Read by addressee */
#define MSGSENT 0x0008 /* Has been sent */
#define MSGFILE 0x0010 /* File attached to msg */
#define MSGTRANSIT 0x0020 /* In transit */
#define MSGORPHAN 0x0040 /* Unknown node */
#define MSGKILL 0x0080 /* Kill after mailing */
#define MSGLOCAL 0x0100 /* Message was entered here */
#define MSGHOLD 0x0200 /* Hold for pickup */
#define MSGUNUSED 0x0400 /* Unused */
#define MSGFREQ 0x0800 /* File request */
#define MSGRRREQ 0x1000 /* Return receipt request !! */
#define MSGISRR 0x2000 /* Is return receipt !! */
#define MSGAREQ 0x4000 /* Audit request !! */
#define MSGFUPDREQ 0x8000 /* File update request !! */
#define VERSION "1.50" /* WWIVToss Version, Verbose */
#define VERSION1 1 /* WWIVToss Version, Major */
#define VERSION2 50 /* WWIVToss Version, Minor */
//#define BETA /* Beta or Release? */
#define DATE "05/22/11" /* Release Date */
#define PROGRAM "WWIVTOSS" /* Program Name ID */
#define MAX_MSG_SIZE 32000 /* Maximum Message Size */
const char *suffixes[8] = {
"SU", "MO", "TU", "WE", "TH", "FR", "SA", NULL
};
extern char fido_title[81], /* limited to 72 chars */
fido_to_user[81], /* limited to 36 chars */
fido_from_user[81], /* limited to 36 chars */
curr_conf_name[81], /* current conference fido-name */
fido_date_line[81], /* the date in ASCII */
origi_node[80], /* origin node */
temp_dest[40], /* destination node of packet */
outbound_packet_name[80]; /* Name of outbound packet for this session */
typedef struct /* Stoneage Type 2.0 */
{
unsigned short int orig_node, /* Originating node */
dest_node, /* Destination node */
year, /* Year created (1993-nnnn) */
month, /* Month created (0-11) */
day, /* Day created (1-31) */
hour, /* Hour created (0-23) */
minute, /* Minute created (0-59) */
second, /* Second created (0-59) */
baud, /* Baudrate (unused) */
packet_type, /* Packet version (2) */
orig_net, /* Originating net */
dest_net; /* Destination net */
unsigned char PCodeLo, /* Product code (low-order) */
PRevMajor, /* Major version */
Password[8]; /* Packet password */
unsigned short int QMOrigZone, /* Originating zone (QMail) */
QMDestZone; /* Destination zone (QMail) */
char domain[8]; /* Network Domain */
unsigned short int OrigZone, /* Originating zone (FSC-39) */
DestZone, /* Destination zone (FSC-39) */
OrigPoint, /* Originating point (FSC-39) */
DestPoint; /* Destination point (FSC-39) */
unsigned long LongData; /* Product dependent information*/
} packet_header_struct;
typedef struct { /* FSC-0045 Type 2.2 */
unsigned int onode,
dnode,
opoint,
dpoint;
char zeros[8];
unsigned int subver, /* 2 */
version, /* 2 */
onet,
dnet;
char product,
rev_lev,
password[8];
unsigned int ozone,
dzone;
char odomain[8],
ddomain[8];
long specific;
} FSC45_header_struct;
typedef struct { /* FSC-0039 Type 2.+ */
unsigned int orig_node, /* originating node */
dest_node, /* destination node */
year, /* 1989 - nnnnn */
month,
day,
hour,
minute,
second,
rate, /* unused */
ver, /* 2 */
orig_net, /* originating net */
dest_net; /* destination net */
char product,
rev_lev, /* revision level */
password[8];
unsigned int qm_orig_zone,
qm_dest_zone;
char filler[2];
unsigned int capword2;
char product2,
rev_lev2;
unsigned int capword,
orig_zone, /* originating zone */
dest_zone, /* destination zone */
orig_point, /* originating point */
dest_point; /* destination point */
long pr_data;
} FSC39_header_struct;
typedef struct { /* FSC-0048 Type 2.N */
unsigned int orig_node, /* originating node */
dest_node, /* destination node */
year, /* 1989 - nnnnn */
month,
day,
hour,
minute,
second,
rate, /* unused */
ver, /* 2 */
orig_net, /* originating net */
dest_net; /* destination net */
char product,
rev_lev, /* revision level */
password[8];
unsigned int qm_orig_zone,
qm_dest_zone,
aux_net;
unsigned int capword2;
char product2,
rev_lev2;
unsigned int capword,
orig_zone, /* originating zone */
dest_zone, /* destination zone */
orig_point, /* originating point */
dest_point; /* destination point */
long pr_data;
} FSC48_header_struct;
typedef struct {
int id;
int orig_node;
int dest_node;
int orig_net;
int dest_net;
int attribute;
int cost;
char datetime[20];
} message_header_struct;
typedef struct
{
char FromUser[36], /*Name in By: field */
ToUser[36], /*Name in To: field */
Subject[72], /*Name in Re: field */
Date[20]; /*ASCIIz creation date */
unsigned short int
TimesRead, /*Number of times message read */
DestNode, /*Destination node */
OrigNode, /*Originating node */
Cost, /*Cost to send message */
OrigNet, /*Originating net */
DestNet; /*Destination net */
unsigned long
DateWritten, /*Date message was written */
DateArrived; /*Date message was read/sent */
unsigned short int
ReplyTo, /*This is a reply to "ReplyTo" */
Attr, /*Attribute bits, see above */
ReplyNext; /*Next reply in thread */
} FIDOMSG;
typedef struct {
char msg_id[10],
address[20];
} msgdupe;
typedef struct {
char bbs_name[81],
sysop_name[81],
system_address[20],
network[20],
version[10];
unsigned long date_installed,
date_notified;
unsigned int node,
registered;
} notify_rec;
#define MAX_NODES 20
#define NUM_ARCHIVERS 8 /* 1+Number of archivers (0=.PKT) */
/* ------------------------------------------------------------ */
/* Structure for nodes - Distribution, connects, etc. */
/* ------------------------------------------------------------ */
typedef struct {
short int zone, /* Zone of Node */
net, /* Net of Node */
node, /* Node of Node */
point; /* Point of Node */
} netnode;
/* ------------------------------------------------------------ */
/* Structure for Archivers */
/* ------------------------------------------------------------ */
typedef struct {
char name[10], /* Program ID */
archive_file[15], /* Archive Program */
unarchive_file[15], /* Unarchive Program */
archive_switches[30], /* Archive Switches */
unarchive_switches[30]; /* Unarchive Switches */
char reserved[50]; /* Reserved */
} arc_dat;
/* ------------------------------------------------------------ */
/* Structure for determining where to route netmail */
/* Stored in WWIVTOSS.DAT */
/* ------------------------------------------------------------ */
typedef struct {
int16_t zone, /* Zone of Node */
net, /* Net of Node */
node, /* Node of Node */
point; /* Point of Node */
int16_t route_zone; /* Zone to route on */
} route_mail;
/* ------------------------------------------------------------ */
/* Structure for areas */
/* Saved in AREAS.DAT */
/* ------------------------------------------------------------ */
typedef struct
{
char name[81], /* Area Name */
comment[81], /* Comment on Area */
origin[64], /* Origin to use for this area */
subtype[9], /* WWIV Subtype To Use */
directory[81]; /* Directory to .MSG section */
char res_char[50]; /* Reserved Strings */
netnode feed[MAX_NODES];/* Feed Structure */
short int type; /* Passthru, local, regular */
short int alias_ok, /* Ok to pass aliases? */
pass_color, /* Ok to pass WWIV Colors? */
high_ascii, /* Ok to pass High ASCII? */
net_num, /* WWIV Network Number */
group, /* Area Group # */
count, /* Count of messages */
active, /* If 0, marks end of list */
keep_tag, /* Keep tagline? */
def_origin, /* Using Default Origin? */
count_out, /* Export Count */
translate, /* Use Translation Tables */
val_incoming; /* Validate Incoming Messages? */
unsigned char res_byte[18]; /* Reserved Bytes */
} arearec;
/* ------------------------------------------------------------ */
/* Structure of nodes for connect/feed data */
/* Saved in NODES.DAT */
/* ------------------------------------------------------------ */
struct
{
char address[40], /* Network Address of Node */
sysop_name[81], /* Sysop of Node */
pkt_pw[30], /* Packet Password to Use */
sysop_phone[15],/* Sysop's Voice Phone */
domain[10], /* Node's Domain Name */
res_char[75]; /* Reserved Bytes */
unsigned char compression; /* Compression to use */
unsigned short daynum, /* Day Of The Year */
counter; /* Counter of sent packets */
char areafix_pw[12]; /* Areafix Password */
short archive_status; /* Packet Archive Status */
short direct; /* Direct Flag */
short allow_areafix; /* Can this node Areafix? */
unsigned short groups; /* Groups this node is allowed */
short packet_type; /* Packet Type To Send */
char res_bytes[24]; /* Reserved bytes */
} nodes [20];
/* ------------------------------------ */
/* Structure for the Uplink Manager */
/* ------------------------------------ */
struct
{
char address[40], /* Address of Uplink */
areafix_prog[30], /* Areafix Program */
areafix_pw[30], /* Areafix Password */
areas_filename[81], /* Areas Filename */
origin_address[40], /* Origin AKA To Use */
res_char[80]; /* Reserved Characters */
short add_plus, /* Use '+' to add areas */
areas_file_type, /* Areas File Type */
unconditional, /* Send Unconditioanlly */
res_int[20]; /* Reserved Integers */
unsigned short groups; /* Groups Useable */
} uplink[20];
/* ------------------------------------------------------------ */
/* Translation Table Structure. Stored in XLAT.DAT */
/* ------------------------------------------------------------ */
struct
{
unsigned char in, /* Character to change to - Incoming */
out; /* Character to change to - Outgoing */
} xlat[225];
/* ------------------------------------------------------------ */
/* Structure for this system's AKA information. */
/* Saved in WWIVTOSS.DAT as tosser_cfg.akas */
/* ------------------------------------------------------------ */
typedef struct {
int16_t zone, /* Zone of Node */
net, /* Net of Node */
node, /* Node of Node */
point; /* Point of Node */
int16_t wwiv_node, /* WWIV Network Node */
wwiv_netnum; /* WWIV Network Number */
} akas;
/* ------------------------------------------------------------ */
/* Structure for area group names */
/* Stored in tosser_cfg */
/* ------------------------------------------------------------ */
typedef struct {
char group_id[2], /* Group I.D. (A-Z) */
group_name[21]; /* Group Name */
} groups;
/* ------------------------------------------------------------ */
/* Structure for main WWIVTOSS Configuration Data */
/* Saved as WWIVTOSS.DAT */
/* ------------------------------------------------------------ */
typedef struct
{
char bbs_name[81], /* BBS Name */
sysop_name[81], /* SysOp Name */
password[20], /* WTSETUP Password */
system_address[20], /* Main Network Address */
inbound_path[64], /* Inbound Packet Dir */
outbound_path[64], /* Outbound Packet Dir */
outbound_temp_path[64], /* Temp Outbound Dir */
netmail_path[64], /* NetMail Dir */
temp_path[64], /* Temporary Path */
badecho_path[64], /* Where Bad Echos Go */
origin_line[64], /* Default Origin Line */
log_file[81], /* Path of log file */
registration[80], /* Registration Key */
location[40]; /* Site Location */
char reserved[100]; /* Reserved Bytes */
akas aka_list[11]; /* List of AKAs */
route_mail route_to[11]; /* Where to Route Mail */
arc_dat archive[10]; /* Archive Information */
groups group[26]; /* Group Information */
unsigned char crash, /* Crash Mail Flag */
direct, /* Direct Mail Flag */
center, /* Allow centering? */
delete_sent, /* Delete SENT Mail? */
import_recd, /* Import Rec'd Mail? */
use_areafix, /* Use AREAFIX? */
skip_mail, /* Skip Importing Mail */
notify, /* Notify Author Flag */
default_compression, /* Default Compression */
registered, /* Registered Flag */
mailer, /* Mailer Type */
installed, /* Installed! */
cleanup, /* Cleanup Nets */
kill_recd, /* Delete Rec'd Mail? */
num_areas, /* Number of Areas */
num_nodes, /* Number of Nodes */
set_immediate; /* Use IMMEDIATE Flag? */
// unsigned long date_installed; /* Date installed */
time_t date_installed;
int auto_add, /* Auto Add Areas? */
log_feeds, /* Log Feed Echos? */
add_hard_cr, /* Add Hard C/R */
add_line_feed, /* Add Line Feed */
high_ascii, /* Pass High ASCII Mail */
soft_to_hard, /* Soft To Hard C/R */
hard_to_soft, /* Hard To Soft C/R */
add_soft_cr, /* Add Soft C/R */
route_me, /* Route Mail? */
log_days, /* Days To Keep Log */
color_to, /* Colorize TO: Line? */
initial_quote, /* Initial Quote? */
num_uplinks, /* Number of uplinks */
bounce_mail, /* Bounce Bad Mail? */
check_dupes, /* Check Dupe Messages? */
pass_origin; /* Use Existing Origin? */
char res_byte[46]; /* Reserved Bytes */
} tosser_config;
/* ------------------------------------------------------------ */
/* Tracking structure for keeping track of incoming/outgoing */
/* number of bytes for writing to NET.LOG */
/* ------------------------------------------------------------ */
struct
{
int wwiv_node, /* Fake WWIV Node */
used, /* Did any traffic flow */
out_used, /* Any Outbound? */
in_used; /* Any Inbound */
long in_k, /* Amount Coming In */
out_k; /* Amount Going Out */
char net_name[30]; /* Network Name */
} track[12];
/* ------------------------------------------------------------ */
/* Miscellaneous Global Options */
/* ------------------------------------------------------------ */
int filelength(FILE *f){
int len;
fseek(f, 0L, SEEK_END);
len=ftell(f);
return(len);
};
// copied from dos.h by dj delorie
struct date {
short da_year;
char da_day;
char da_mon;
};
struct time {
unsigned char ti_min;
unsigned char ti_hour;
unsigned char ti_hund;
unsigned char ti_sec;
};
struct tm *
getdateSystem (const char *d)
{
//#warning If warning messages about getdate appear, ignore them.
return (getdate (d));
}
time_t
dostounix (struct date *d, struct time *t)
{
struct tm utm, *ptm;
time_t the_time = time (0);
ptm = localtime (&the_time);
memset (&utm, '\0', sizeof (struct tm));
memcpy ((void *) &utm, (void *) ptm, sizeof (struct tm));
utm.tm_sec = t->ti_sec;
utm.tm_min = t->ti_min;
utm.tm_hour = t->ti_hour;
utm.tm_mday = d->da_day;
utm.tm_mon = d->da_mon - 1;
utm.tm_year = d->da_year - 1900;
return (mktime (&utm));
}
#pragma pack(pop)