xtrn_sec.cpp 51.1 KB
Newer Older
1
2
3
4
5
6
/* Synchronet external program/door section and drop file routines */

/****************************************************************************
 * @format.tab-size 4		(Plain Text/Source Code File Header)			*
 * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
 *																			*
7
 * Copyright Rob Swindell - http://www.synchro.net/copyright.html			*
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 *																			*
 * This program is free software; you can redistribute it and/or			*
 * modify it under the terms of the GNU General Public License				*
 * as published by the Free Software Foundation; either version 2			*
 * of the License, or (at your option) any later version.					*
 * See the GNU General Public License for more details: gpl.txt or			*
 * http://www.fsf.org/copyleft/gpl.html										*
 *																			*
 * For Synchronet coding style and modification guidelines, see				*
 * http://www.synchro.net/source.html										*
 *																			*
 * Note: If this box doesn't appear square, then you need to fix your tabs.	*
 ****************************************************************************/

#include "sbbs.h"
23
#include "qbbsdefs.hpp"
24
25
26
27
28

/****************************************************************************/
/* This is the external programs (doors) section of the bbs                 */
/* Return 1 if no externals available, 0 otherwise. 						*/
/****************************************************************************/
29
int sbbs_t::xtrn_sec(const char* section)
30
{
31
	char	str[MAX_PATH+1];
32

33
34
35
	if(cfg.xtrnsec_mod[0] == '\0') {
		errormsg(WHERE, ERR_CHK, "xtrnsec_mod", 0);
		return 1;
36
	}
37
38
	SAFEPRINTF2(str, "%s %s", cfg.xtrnsec_mod, section);
	return exec_bin(str, &main_csi);
39
40
}

41
const char *hungupstr="\1n\1h%s\1n hung up on \1h%s\1n %s\r\n";
42
43
44
45

/****************************************************************************/
/* Convert from unix time (seconds since 1/70) to julian (days since 1900)	*/
/****************************************************************************/
46
int unixtojulian(time_t unix_time)
47
48
49
{
	int days[12]={0,31,59,90,120,151,181,212,243,273,304,334};
	long j;
50
	struct tm tm;
51

52
	if(localtime_r(&unix_time,&tm)==NULL)
53
		return(0);
54
55
	j=36525L*(1900+tm.tm_year);
	if(!(j%100) && (tm.tm_mon+1)<3)
56
57
		j--;
	j=(j-(1900*36525))/100;
58
	j+=tm.tm_mday+days[tm.tm_mon];
59
60
61
62
63
64
	return(j);
}

/****************************************************************************/
/* Convert julian date into unix format 									*/
/****************************************************************************/
65
66
67
#ifdef __BORLANDC__
#pragma argsused
#endif
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
time_t juliantounix(ulong j)
{
#if 0 /* julian time */
    int days[2][12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,
                       0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
    long temp;
	int leap,counter;
	struct tm tm;

	if(!j) return(0L);

	tm.tm_year=((100L*j)/36525L)-1900;
	temp=(long)date.da_year*36525L;
	date.da_year+=1900;
	j-=temp/100L;

	if (!(temp%100)) {
		j++;
86
87
		leap=1; 
	}
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
	else leap=0;

	for(date.da_mon=counter=0;counter<12;counter++)
		if(days[leap][counter]<j)
			date.da_mon=counter;

	date.da_day=j-days[leap][date.da_mon];
	date.da_mon++;	/* go from 0 to 1 based */

	curtime.ti_hour=curtime.ti_min=curtime.ti_sec=0;
	return(dostounix(&date,&curtime));
#else
	return((time_t)-1);
#endif
}

104
105
106
107
108
#ifdef __unix__
static void lfexpand(char *str, ulong misc)
{
	char *p;
	char newstr[1024];
rswindell's avatar
rswindell committed
109
	size_t len=0;
110
111
112
113

	if(misc&XTRN_NATIVE)
		return;

rswindell's avatar
rswindell committed
114
	for(p=str;*p && len < sizeof(newstr)-2;p++) {
115
116
117
118
119
120
121
122
123
124
125
126
		if(*p=='\n')
			newstr[len++]='\r';
		newstr[len++]=*p;
	}

	newstr[len]=0;
	strcpy(str,newstr);
}
#else
	#define lfexpand(str, misc)
#endif

127
128
129
/****************************************************************************/
/* Creates various types of xtrn (Doors, Chains, etc.) data (drop) files.	*/
/****************************************************************************/
130
void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tleft
131
132
					,ulong misc)
{
133
134
	char	str[1024],tmp2[128],c,*p;
	char 	tmp[512];
deuce's avatar
64-bit    
deuce committed
135
136
137
138
	/* TODO: 16-bit i */
	int16_t	i;
	int		file;
	int32_t	l;
139
140
	struct tm tm;
	struct tm tl;
141
	stats_t stats;
142
	long term = term_supports();
143

144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
	char	node_dir[MAX_PATH+1];
	char	ctrl_dir[MAX_PATH+1];
	char	data_dir[MAX_PATH+1];
	char	exec_dir[MAX_PATH+1];
	char	text_dir[MAX_PATH+1];
	char	temp_dir[MAX_PATH+1];

	SAFECOPY(node_dir,cfg.node_dir);
	SAFECOPY(ctrl_dir,cfg.ctrl_dir);
	SAFECOPY(data_dir,cfg.data_dir);
	SAFECOPY(exec_dir,cfg.exec_dir);
	SAFECOPY(text_dir,cfg.text_dir);
	SAFECOPY(temp_dir,cfg.temp_dir);

	if(!(misc&XTRN_NATIVE)) {
159
#ifdef _WIN32
160
161
		/* Put Micros~1 shortened paths in drop files when running 16-bit DOS programs */
		GetShortPathName(cfg.node_dir,node_dir,sizeof(node_dir));
162
		GetShortPathName(cfg.ctrl_dir,ctrl_dir,sizeof(ctrl_dir));
163
164
165
166
		GetShortPathName(cfg.data_dir,data_dir,sizeof(data_dir));
		GetShortPathName(cfg.exec_dir,exec_dir,sizeof(exec_dir));
		GetShortPathName(cfg.text_dir,text_dir,sizeof(text_dir));
		GetShortPathName(cfg.temp_dir,temp_dir,sizeof(temp_dir));
167
168
#elif defined(__linux__) && defined(USE_DOSEMU)
		/* These drive mappings must match the Linux/DOSEMU patch in xtrn.cpp: */
169
170
171
172
173
174
		SAFECOPY(node_dir, DOSEMU_NODE_DIR);
		SAFECOPY(ctrl_dir, DOSEMU_CTRL_DIR);
		SAFECOPY(data_dir, DOSEMU_DATA_DIR);
		SAFECOPY(exec_dir, DOSEMU_EXEC_DIR);
		SAFECOPY(text_dir, DOSEMU_TEXT_DIR);
		SAFECOPY(temp_dir, DOSEMU_TEMP_DIR);
175
#endif
176
177
178
	}


179
	if(type==XTRN_SBBS) {	/* SBBS XTRN.DAT file */
Rob Swindell's avatar
Rob Swindell committed
180
		SAFECOPY(tmp,"XTRN.DAT");
181
182
		if(misc&XTRN_LWRCASE)
			strlwr(tmp);
Rob Swindell's avatar
Rob Swindell committed
183
		SAFEPRINTF2(str,"%s%s",dropdir,tmp);
184
		(void)removecase(str);
185
186
		if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT))==-1) {
			errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT);
187
188
			return; 
		}
189

190
		safe_snprintf(str, sizeof(str), "%s\n%s\n%s\n%s\n"
191
192
193
194
			,name								/* User name */
			,cfg.sys_name						/* System name */
			,cfg.sys_op 						/* Sysop name */
			,cfg.sys_guru); 					/* Guru name */
195
		lfexpand(str,misc);
196
197
		write(file,str,strlen(str));

198
		safe_snprintf(str, sizeof(str), "%s\n%s\n%u\n%u\n%lu\n%s\n%lu\n%lu\n"
199
200
			,ctrl_dir							/* Ctrl dir */
			,data_dir							/* Data dir */
201
202
203
			,cfg.sys_nodes						/* Total system nodes */
			,cfg.node_num						/* Current node */
			,tleft								/* User Timeleft in seconds */
204
205
			,(term & ANSI)						/* User ANSI ? (Yes/Mono/No) */
				? (term & COLOR)
206
207
208
				? "Yes":"Mono":"No"
			,rows								/* User Screen lines */
			,useron.cdt+useron.freecdt);		/* User Credits */
209
		lfexpand(str,misc);
210
211
		write(file,str,strlen(str));

212
		safe_snprintf(str, sizeof(str), "%u\n%u\n%s\n%c\n%u\n%s\n"
213
214
			,useron.level						/* User main level */
			,useron.level						/* User transfer level */
215
			,getbirthmmddyy(&cfg, useron.birth, tmp, sizeof(tmp)) /* User birthday (MM/DD/YY) */
216
			,useron.sex ? useron.sex : '?'		/* User sex (M/F) */
217
218
			,useron.number						/* User number */
			,useron.phone); 					/* User phone number */
219
		lfexpand(str,misc);
220
221
		write(file,str,strlen(str));

222
		safe_snprintf(str, sizeof(str), "%u\n%u\n%x\n%lu\n%s\n%s\n"
223
			"%s\n%s\n%s\n%s\n%s\n%s\n%lu\n"
224
			,misc&(XTRN_STDIO|XTRN_CONIO) ? 0:cfg.com_port		/* Com port or 0 if !FOSSIL */
225
226
227
228
229
230
231
232
233
234
235
			,cfg.com_irq						/* Com IRQ */
			,cfg.com_base						/* Com base in hex */
			,dte_rate							/* Com rate */
			,"Yes"								/* Hardware flow ctrl Y/N */
			,"Yes"								/* Locked DTE rate Y/N */
			,cfg.mdm_init						/* Modem initialization string */
			,cfg.mdm_spec						/* Modem special init string */
			,cfg.mdm_term						/* Modem terminal mode init str */
			,cfg.mdm_dial						/* Modem dial string */
			,cfg.mdm_offh						/* Modem off-hook string */
			,cfg.mdm_answ						/* Modem answer string */
236
			,0L
237
			);
238
		lfexpand(str,misc);
239
240
		write(file,str,strlen(str));

Rob Swindell's avatar
Rob Swindell committed
241
		SAFEPRINTF(str,"%u\n",cfg.total_xtrns);
242
		lfexpand(str,misc);
243
244
245
		write(file,str,strlen(str));			/* Total external programs */

		for(i=0;i<cfg.total_xtrns;i++) {		/* Each program's name */
Rob Swindell's avatar
Rob Swindell committed
246
247
248
			if(SYSOP || chk_ar(cfg.xtrn[i]->ar,&useron,&client)) {
				SAFECOPY(str,cfg.xtrn[i]->name);
			} else
249
				str[0]=0;						/* Blank if no access */
rswindell's avatar
rswindell committed
250
			SAFECAT(str,"\n");
251
			lfexpand(str,misc);
252
253
			write(file,str,strlen(str)); 
		}
254

Rob Swindell's avatar
Rob Swindell committed
255
		SAFEPRINTF2(str,"%s\n%s\n"
256
257
258
			,ltoaf(useron.flags1,tmp)			/* Main flags */
			,ltoaf(useron.flags2,tmp2)			/* Transfer flags */
			);
259
		lfexpand(str,misc);
260
261
		write(file,str,strlen(str));

Rob Swindell's avatar
Rob Swindell committed
262
		safe_snprintf(str, sizeof(str), "%s\n%s\n%lx\n%s\n%s\n%s\n"
263
264
			,ltoaf(useron.exempt,tmp)			/* Exemptions */
			,ltoaf(useron.rest,tmp2)			/* Restrictions */
265
			,(long)useron.expire				/* Expiration date in unix form */
266
267
268
269
			,useron.address 					/* Address */
			,useron.location					/* City/State */
			,useron.zipcode 					/* Zip/Postal code */
			);
270
		lfexpand(str,misc);
271
272
		write(file,str,strlen(str));

273
		safe_snprintf(str, sizeof(str), "%s\n%s\n%d\n%s\n%lu\n%s\n%s\n%s\n%s\n"
274
			"%" PRIx32 "\n%d\n"
275
276
			,ltoaf(useron.flags3,tmp)			/* Flag set #3 */
			,ltoaf(useron.flags4,tmp2)			/* Flag set #4 */
277
			,0									/* Time-slice type */
278
279
			,useron.name						/* Real name/company */
			,cur_rate							/* DCE rate */
280
281
282
			,exec_dir
			,text_dir
			,temp_dir
283
284
			,cfg.sys_id
			,cfg.node_misc
285
			,misc&(XTRN_STDIO|XTRN_CONIO) ? INVALID_SOCKET : client_socket_dup
286
			);
287
		lfexpand(str,misc);
288
289
		write(file,str,strlen(str));

290
291
		close(file); 
	}
292
293

	else if(type==XTRN_WWIV) {	/*	WWIV CHAIN.TXT File */
Rob Swindell's avatar
Rob Swindell committed
294
		SAFECOPY(tmp,"CHAIN.TXT");
295
296
		if(misc&XTRN_LWRCASE)
			strlwr(tmp);
Rob Swindell's avatar
Rob Swindell committed
297
		SAFEPRINTF2(str,"%s%s",dropdir,tmp);
298
		(void)removecase(str);
299
300
		if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT))==-1) {
			errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT);
301
302
			return; 
		}
303

304
305
306
		if(tleft>0x7fff)	/* Reduce time-left for broken 16-bit doors		*/
			tleft=0x7fff;	/* That interpret this value as a signed short	*/

307
		safe_snprintf(str, sizeof(str), "%u\n%s\n%s\n%s\n%u\n%c\n"
308
309
310
311
312
			,useron.number						/* User number */
			,name								/* User name */
			,useron.name						/* User real name */
			,nulstr 							/* User call sign */
			,getage(&cfg,useron.birth)			/* User age */
313
			,useron.sex ? useron.sex : '?');	/* User sex (M/F) */
314
		strupr(str);
315
		lfexpand(str,misc);
316
317
		write(file,str,strlen(str));

318
		safe_snprintf(str, sizeof(str), "%lu\n%s\n%lu\n%ld\n%u\n%u\n%u\n%d\n%u\n"
319
320
			,useron.cdt+useron.freecdt			/* Gold */
			,unixtodstr(&cfg,useron.laston,tmp)	/* User last on date */
321
			,cols 								/* User screen width */
322
323
324
325
			,rows								/* User screen length */
			,useron.level						/* User SL */
			,0									/* Cosysop? */
			,SYSOP								/* Sysop? (1/0) */
326
			,INT_TO_BOOL(term & ANSI)			/* ANSI ? (1/0) */
327
			,online==ON_REMOTE);				/* Remote (1/0) */
328
		lfexpand(str,misc);
329
330
		write(file,str,strlen(str));

331
		safe_snprintf(str, sizeof(str), "%lu\n%s\n%s\n%s\n%lu\n%d\n%s\n%s\n"
332
			"%u\n%u\n%lu\n%u\n%lu\n%u\n%s\n"
333
			,tleft								/* Time left in seconds */
334
335
			,node_dir							/* Gfiles dir (log dir) */
			,data_dir							/* Data dir */
336
			,"node.log"                         /* Name of log file */
337
338
339
340
341
342
343
344
345
346
347
			,dte_rate							/* DTE rate */
			,cfg.com_port						/* COM port number */
			,cfg.sys_name						/* System name */
			,cfg.sys_op 						/* Sysop name */
			,0									/* Logon time (sec past 12am) */
			,0									/* Current time (sec past 12am) */
			,useron.ulb/1024UL					/* User uploaded kbytes */
			,useron.uls 						/* User uploaded files */
			,useron.dlb/1024UL					/* User downloaded kbytes */
			,useron.dls 						/* User downloaded files */
			,"8N1");                            /* Data, parity, stop bits */
348
		lfexpand(str,misc);
349
350
		write(file,str,strlen(str));

351
352
		close(file); 
	}
353
354

	else if(type==XTRN_GAP) {	/* Gap DOOR.SYS File */
Rob Swindell's avatar
Rob Swindell committed
355
		SAFECOPY(tmp,"DOOR.SYS");
356
357
		if(misc&XTRN_LWRCASE)
			strlwr(tmp);
Rob Swindell's avatar
Rob Swindell committed
358
		SAFEPRINTF2(str,"%s%s",dropdir,tmp);
359
		(void)removecase(str);
360
361
		if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT))==-1) {
			errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT);
362
363
			return; 
		}
364

365
366
367
		if(tleft>0x7fff)	/* Reduce time-left for broken 16-bit doors		*/
			tleft=0x7fff;	/* That interpret this value as a signed short	*/

Rob Swindell's avatar
Rob Swindell committed
368
		SAFEPRINTF(str,"COM%d:\n"
369
			,online==ON_REMOTE ? cfg.com_port:0);	/* 01: COM port - 0 if Local */
Rob Swindell's avatar
Rob Swindell committed
370

371
372
		lfexpand(str,misc);
		write(file,str,strlen(str));
373
374
375
376
377
378
379
380
		/* Note about door.sys, line 2 (April-24-2005):
		   It *should* be the DCE rate (any number, including the popular modem
		   DCE rates of 14400, 28800, and 33600).  However, according to Deuce,
		   doors created with the DMlib door kit choke with "Error -25: Illegal
		   baud rate" if this isn't a valid FOSSIL baud (DTE) rate, so we're
		   changing this value to the DTE rate until/unless some other doors
		   have an issue with that. <sigh>
		*/
Rob Swindell's avatar
Rob Swindell committed
381
		safe_snprintf(str, sizeof(str), "%lu\n%u\n%u\n%lu\n%c\n%c\n%c\n%c\n"
382
			,dte_rate /* was cur_rate */		/* 02: DCE rate, see note above */
383
384
385
			,8									/* 03: Data bits */
			,cfg.node_num						/* 04: Node number */
			,dte_rate							/* 05: DTE rate */
386
			,'Y'								/* 06: Screen display */
387
388
389
			,'Y'                                /* 07: Printer toggle */
			,'Y'                                /* 08: Page bell */
			,'Y');                              /* 09: Caller alarm */
390
		lfexpand(str,misc);
391
392
		write(file,str,strlen(str));

Rob Swindell's avatar
Rob Swindell committed
393
		safe_snprintf(str, sizeof(str), "%s\n%s\n%s\n%s\n%s\n"
394
395
396
397
398
			,name								/* 10: User name */
			,useron.location					/* 11: User location */
			,useron.phone						/* 12: User home phone */
			,useron.phone						/* 13: User work/data phone */
			,useron.pass);						/* 14: User password */
399
		lfexpand(str,misc);
400
401
		write(file,str,strlen(str));

Rob Swindell's avatar
Rob Swindell committed
402
		safe_snprintf(str, sizeof(str), "%u\n%u\n%s\n%lu\n%lu\n%s\n"
403
404
405
406
407
			,useron.level						/* 15: User security level */
			,useron.logons						/* 16: User total logons */
			,unixtodstr(&cfg,useron.laston,tmp)	/* 17: User last on date */
			,tleft								/* 18: User time left in sec */
			,tleft/60							/* 19: User time left in min */
408
409
			,(term & NO_EXASCII)				/* 20: GR if COLOR ANSI */
				? "7E" : (term & (ANSI|COLOR)) == (ANSI|COLOR) ? "GR" : "NG");
410
		lfexpand(str,misc);
411
412
		write(file,str,strlen(str));

Rob Swindell's avatar
Rob Swindell committed
413
		safe_snprintf(str, sizeof(str), "%lu\n%c\n%s\n%u\n%s\n%u\n%c\n%u\n%u\n"
414
			,rows								/* 21: User screen length */
415
			,(useron.misc&EXPERT) ? 'Y':'N'     /* 22: Expert? (Y/N) */
416
417
418
419
			,ltoaf(useron.flags1,tmp2)			/* 23: Registered conferences */
			,0									/* 24: Conference came from */
			,unixtodstr(&cfg,useron.expire,tmp)	/* 25: User expiration date */
			,useron.number						/* 26: User number */
420
			,useron.prot                        /* 27: Default protocol */
421
422
			,useron.uls 						/* 28: User total uploads */
			,useron.dls);						/* 29: User total downloads */
423
		lfexpand(str,misc);
424
425
		write(file,str,strlen(str));

426
		safe_snprintf(str, sizeof(str), "%u\n%lu\n%s\n%s\n%s\n%s"
427
			"\n%s\n%02d:%02d\n%c\n"
428
429
			,0									/* 30: Kbytes downloaded today */
			,(useron.cdt+useron.freecdt)/1024UL /* 31: Max Kbytes to download today */
430
			,getbirthmmddyy(&cfg, useron.birth, tmp, sizeof(tmp))	/* 32: User birthday (MM/DD/YY) */
431
432
			,node_dir							/* 33: Path to MAIN directory */
			,data_dir							/* 34: Path to GEN directory */
433
434
435
436
437
			,cfg.sys_op 						/* 35: Sysop name */
			,nulstr 							/* 36: Alias name */
			,0 // sys_eventtime/60				/* 37: Event time HH:MM */
			,0 // sys_eventtime%60
			,'Y');                              /* 38: Error correcting connection */
438
		lfexpand(str,misc);
439
440
		write(file,str,strlen(str));

441
		localtime_r(&ns_time,&tm);
Rob Swindell's avatar
Rob Swindell committed
442
		safe_snprintf(str, sizeof(str), "%c\n%c\n%u\n%lu\n%02d/%02d/%02d\n"
443
			,(term & (NO_EXASCII|ANSI|COLOR)) == ANSI
444
445
				? 'Y':'N'                       /* 39: ANSI supported but NG mode */
			,'Y'                                /* 40: Use record locking */
446
			,cfg.color[clr_external]			/* 41: BBS default color */
447
			,useron.min 						/* 42: Time credits in minutes */
448
449
450
			,tm.tm_mon+1						/* 43: File new-scan date */
			,tm.tm_mday
			,TM_YEAR(tm.tm_year));
451
		lfexpand(str,misc);
452
453
		write(file,str,strlen(str));

deuce's avatar
deuce committed
454
		localtime_r(&logontime,&tm);
455
		localtime32(&useron.laston,&tl);
Rob Swindell's avatar
Rob Swindell committed
456
		safe_snprintf(str, sizeof(str), "%02d:%02d\n%02d:%02d\n%u\n%u\n%lu\n"
457
			"%lu\n%s\n%u\n%u\n"
458
			,tm.tm_hour							/* 44: Time of this call */
459
			,tm.tm_min
460
			,tl.tm_hour							/* 45: Time of last call */
461
			,tl.tm_min
462
463
464
465
466
467
468
			,999								/* 46: Max daily files available */
			,0									/* 47: Files downloaded so far today */
			,useron.ulb/1024UL					/* 48: Total Kbytes uploaded */
			,useron.dlb/1024UL					/* 49: Total Kbytes downloaded */
			,useron.comment 					/* 50: User comment */
			,0									/* 51: Total doors opened */
			,useron.posts); 					/* 52: User message left */
469
		lfexpand(str,misc);
470
471
		write(file,str,strlen(str));

472
473
		close(file); 
	}
474
475

	else if(type==XTRN_RBBS || type==XTRN_RBBS1) {
Rob Swindell's avatar
Rob Swindell committed
476
477
478
479
480
		if(type==XTRN_RBBS) {
			SAFEPRINTF(tmp,"DORINFO%X.DEF",cfg.node_num);   /* support 1-F */
		} else {
			SAFECOPY(tmp,"DORINFO1.DEF");
		}
481
482
		if(misc&XTRN_LWRCASE)
			strlwr(tmp);
Rob Swindell's avatar
Rob Swindell committed
483
		SAFEPRINTF2(str,"%s%s",dropdir,tmp);
484
		(void)removecase(str);
485
486
		if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT))==-1) {
			errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT);
487
488
			return; 
		}
489

Rob Swindell's avatar
Rob Swindell committed
490
		SAFECOPY(tmp,cfg.sys_op);
491
		p=strchr(tmp,' ');
492
493
494
		if(p)
			*(p++)=0;
		else
495
			p=(char*)nulstr;
496

Rob Swindell's avatar
Rob Swindell committed
497
		safe_snprintf(str, sizeof(str), "%s\n%s\n%s\nCOM%d\n%lu BAUD,N,8,1\n%u\n"
498
499
500
501
502
503
504
			,cfg.sys_name						/* Name of BBS */
			,tmp								/* Sysop's firstname */
			,p									/* Sysop's lastname */
			,online==ON_REMOTE ? cfg.com_port:0 /* COM port number, 0 if local */
			,dte_rate							/* DTE rate */
			,0);								/* Network type */
		strupr(str);
505
		lfexpand(str,misc);
506
507
		write(file,str,strlen(str));

Rob Swindell's avatar
Rob Swindell committed
508
		SAFECOPY(tmp,name);
509
		p=strchr(tmp,' ');
510
511
512
		if(p)
			*(p++)=0;
		else
513
			p=(char*)nulstr;
514
		safe_snprintf(str, sizeof(str), "%s\n%s\n%s\n%d\n%u\n%lu\n"
515
516
517
			,tmp								/* User's firstname */
			,p									/* User's lastname */
			,useron.location					/* User's city */
518
			,INT_TO_BOOL(term & ANSI)			/* 1=ANSI 0=ASCII */
519
520
521
			,useron.level						/* Security level */
			,tleft/60); 						/* Time left in minutes */
		strupr(str);
522
		lfexpand(str,misc);
523
524
525
526
		write(file,str,strlen(str));

		close(file);

Rob Swindell's avatar
Rob Swindell committed
527
		SAFECOPY(tmp,"EXITINFO.BBS");
528
529
		if(misc&XTRN_LWRCASE)
			strlwr(tmp);
Rob Swindell's avatar
Rob Swindell committed
530
		SAFEPRINTF2(str,"%s%s",dropdir,tmp);
531
		(void)removecase(str);
532
533
		if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC))==-1) {
			errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC);
534
535
			return; 
		}
536
		getstats(&cfg,0,&stats);
537
538
539
540
541
542
543
		QBBS::exitinfo exitinfo{};
		exitinfo.BaudRate = (uint16_t)dte_rate;
		exitinfo.SysInfo.CallCount = stats.logons;
		exitinfo.UserInfo.Name = name;
		exitinfo.UserInfo.Location = useron.location;
		exitinfo.UserInfo.DataPhone = useron.phone;
		exitinfo.UserInfo.HomePhone = useron.phone;
544
		localtime32(&useron.laston,&tm);
Rob Swindell's avatar
Rob Swindell committed
545
		SAFEPRINTF2(tmp,"%02d:%02d",tm.tm_hour,tm.tm_min);
546
		exitinfo.UserInfo.LastTime = tmp;
547
		unixtodstr(&cfg,useron.laston,tmp);
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
		exitinfo.UserInfo.LastDate = tmp;
		if(useron.misc&DELETED) exitinfo.UserInfo.Attrib |= QBBS::USER_ATTRIB_DELETED;
		if(useron.misc&CLRSCRN) exitinfo.UserInfo.Attrib |= QBBS::USER_ATTRIB_CLRSCRN;
		if(useron.misc&UPAUSE)	exitinfo.UserInfo.Attrib |= QBBS::USER_ATTRIB_MORE;
		if(term & ANSI)			exitinfo.UserInfo.Attrib |= QBBS::USER_ATTRIB_ANSI;
		if(useron.sex=='F')     exitinfo.UserInfo.Attrib |= QBBS::USER_ATTRIB_FEMALE;
		exitinfo.UserInfo.Flags = useron.flags1;
		exitinfo.UserInfo.TimesPosted = useron.posts;
		exitinfo.UserInfo.SecLvl = useron.level;
		exitinfo.UserInfo.Ups = useron.uls;
		exitinfo.UserInfo.Downs = useron.dls;
		exitinfo.UserInfo.UpK = (uint16_t)(useron.ulb/1024UL);
		exitinfo.UserInfo.DownK = (uint16_t)(useron.dlb/1024UL);
		exitinfo.UserInfo.TodayK = (uint16_t)(logon_dlb/1024UL);
		exitinfo.UserInfo.ScreenLength = (int16_t)rows;
deuce's avatar
deuce committed
563
		localtime_r(&logontime,&tm);
Rob Swindell's avatar
Rob Swindell committed
564
		SAFEPRINTF2(tmp,"%02d:%02d",tm.tm_hour,tm.tm_min);
565
		exitinfo.LoginTime = tmp;
566
		unixtodstr(&cfg,(time32_t)logontime,tmp);
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
		exitinfo.LoginDate = tmp;
		exitinfo.TimeLimit = cfg.level_timepercall[useron.level];
		exitinfo.Credit = useron.cdt;
		exitinfo.UserRecNum = useron.number;
		exitinfo.WantChat = (sys_status & SS_SYSPAGE);
		exitinfo.ScreenClear = (useron.misc & CLRSCRN);
		exitinfo.MorePrompts = (useron.misc & UPAUSE);
		exitinfo.GraphicsMode = !(term & NO_EXASCII);
		exitinfo.ExternEdit = (useron.xedit);
		exitinfo.ScreenLength = (int16_t)rows;
		exitinfo.MNP_Connect = true;
		exitinfo.ANSI_Capable = (term & ANSI);
		exitinfo.RIP_Active = (term & RIP);

		write(file, &exitinfo, sizeof(exitinfo));
582
		close(file);
583
	}
584
585

	else if(type==XTRN_WILDCAT) { /* WildCat CALLINFO.BBS File */
Rob Swindell's avatar
Rob Swindell committed
586
		SAFECOPY(tmp,"CALLINFO.BBS");
587
588
		if(misc&XTRN_LWRCASE)
			strlwr(tmp);
Rob Swindell's avatar
Rob Swindell committed
589
		SAFEPRINTF2(str,"%s%s",dropdir,tmp);
590
		(void)removecase(str);
591
592
		if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT))==-1) {
			errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT);
593
594
			return; 
		}
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618

		if(online==ON_LOCAL) i=5;
		else
			switch(dte_rate) {
				case 300:
					i=1;
					break;
				case 1200:
					i=2;
					break;
				case 2400:
					i=0;
					break;
				case 9600:
					i=3;
					break;
				case 19200:
					i=4;
					break;
				case 38400:
					i=6;
					break;
				default:
					i=7;
619
620
					break; 
		}
Rob Swindell's avatar
Rob Swindell committed
621
		safe_snprintf(str, sizeof(str), "%s\n%u\n%s\n%u\n%lu\n%s\n%s\n%u\n"
622
623
624
625
626
			,name								/* User name */
			,i									/* DTE rate */
			,useron.location					/* User location */
			,useron.level						/* Security level */
			,tleft/60							/* Time left in min */
627
			,(term & ANSI) ? "COLOR":"MONO"		/* ANSI ??? */
628
629
			,useron.pass						/* Password */
			,useron.number);					/* User number */
630
		lfexpand(str,misc);
631
632
		write(file,str,strlen(str));

633
		localtime_r(&now,&tm);
Rob Swindell's avatar
Rob Swindell committed
634
		safe_snprintf(str, sizeof(str), "%lu\n%02d:%02d\n%02d:%02d %02d/%02d/%02d\n%s\n"
635
			,tleft								/* Time left in seconds */
636
637
638
639
			,tm.tm_hour,tm.tm_min 			/* Current time HH:MM */
			,tm.tm_hour,tm.tm_min 			/* Current time and date HH:MM */
			,tm.tm_mon+1,tm.tm_mday			/* MM/DD/YY */
			,TM_YEAR(tm.tm_year)
640
			,nulstr);							/* Conferences with access */
641
		lfexpand(str,misc);
642
643
		write(file,str,strlen(str));

644
		localtime32(&useron.laston,&tm);
Rob Swindell's avatar
Rob Swindell committed
645
		safe_snprintf(str, sizeof(str), "%u\n%u\n%u\n%u\n%s\n%s %02u:%02u\n"
646
647
648
649
650
651
			,0									/* Daily download total */
			,0									/* Max download files */
			,0									/* Daily download k total */
			,0									/* Max download k total */
			,useron.phone						/* User phone number */
			,unixtodstr(&cfg,useron.laston,tmp)	/* Last on date and time */
652
653
			,tm.tm_hour						/* MM/DD/YY  HH:MM */
			,tm.tm_min);
654
		lfexpand(str,misc);
655
656
		write(file,str,strlen(str));

657
		localtime_r(&ns_time,&tm);
Rob Swindell's avatar
Rob Swindell committed
658
		safe_snprintf(str, sizeof(str), "%s\n%s\n%02d/%02d/%02d\n%u\n%lu\n%u"
659
			"\n%u\n%u\n"
660
661
662
			,useron.misc&EXPERT 				/* Expert or Novice mode */
				? "EXPERT":"NOVICE"
			,"All"                              /* Transfer Protocol */
663
664
			,tm.tm_mon+1,tm.tm_mday			/* File new-scan date */
			,TM_YEAR(tm.tm_year)				/* in MM/DD/YY */
665
666
667
668
669
			,useron.logons						/* Total logons */
			,rows								/* Screen length */
			,0									/* Highest message read */
			,useron.uls 						/* Total files uploaded */
			,useron.dls);						/* Total files downloaded */
670
		lfexpand(str,misc);
671
672
		write(file,str,strlen(str));

Rob Swindell's avatar
Rob Swindell committed
673
		safe_snprintf(str, sizeof(str), "%u\n%s\nCOM%u\n%s\n%lu\n%s\n%s\n"
674
675
676
			,8									/* Data bits */
			,online==ON_LOCAL?"LOCAL":"REMOTE"  /* Online local or remote */
			,cfg.com_port						/* COMx port */
677
			,getbirthmmddyy(&cfg, useron.birth, tmp, sizeof(tmp))	/* User birthday (MM/DD/YY) */
678
679
680
			,dte_rate							/* DTE rate */
			,"FALSE"                            /* Already connected? */
			,"Normal Connection");              /* Normal or ARQ connect */
681
		lfexpand(str,misc);
682
683
		write(file,str,strlen(str));

684
		localtime_r(&now,&tm);
Rob Swindell's avatar
Rob Swindell committed
685
		safe_snprintf(str, sizeof(str), "%02d/%02d/%02d %02d:%02d\n%u\n%u\n"
686
687
688
			,tm.tm_mon+1,tm.tm_mday			/* Current date MM/DD/YY */
			,TM_YEAR(tm.tm_year)
			,tm.tm_hour,tm.tm_min 			/* Current time HH:MM */
689
690
			,cfg.node_num						/* Node number */
			,0);								/* Door number */
691
		lfexpand(str,misc);
692
693
		write(file,str,strlen(str));

694
695
		close(file); 
	}
696
697

	else if(type==XTRN_PCBOARD) { /* PCBoard Files */
Rob Swindell's avatar
Rob Swindell committed
698
		SAFECOPY(tmp,"PCBOARD.SYS");
699
700
		if(misc&XTRN_LWRCASE)
			strlwr(tmp);
Rob Swindell's avatar
Rob Swindell committed
701
		SAFEPRINTF2(str,"%s%s",dropdir,tmp);
702
		(void)removecase(str);
703
704
		if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC))==-1) {
			errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC);
705
706
			return; 
		}
707

Rob Swindell's avatar
Rob Swindell committed
708
		safe_snprintf(str, sizeof(str), "%2d%2d%2d%2d%c%2d%c%c%5u%-5.5s"
709
710
711
			,-1 								/* Display on/off */
			,0									/* Printer on/off */
			,sys_status&SS_SYSPAGE ? -1:0		/* Page Bell on/off */
712
			,startup->sound.answer[0] ? -1:0	/* Caller Alarm on/off */
713
			,' ' 								/* Sysop next flag */
714
			,0									/* Error corrected */
715
716
			,(term & NO_EXASCII) ? '7'			/* Graphics mode */
				: (term & (COLOR|ANSI)) == (COLOR|ANSI) ? 'Y':'N'
717
718
719
720
721
722
723
724
			,'A'                                /* Node chat status */
			,(uint)dte_rate 					/* DTE Port Speed */
			,connection 						/* Connection description */
			);
		write(file,str,23);

		write(file,&useron.number,2);			/* User record number */

Rob Swindell's avatar
Rob Swindell committed
725
		SAFECOPY(tmp,name);
726
		p=strchr(tmp,' ');
727
		if(p) *p=0;
Rob Swindell's avatar
Rob Swindell committed
728
		SAFEPRINTF2(str,"%-15.15s%-12s"
729
730
731
732
			,tmp								/* User's first name */
			,useron.pass);						/* User's password */
		write(file,str,27);

deuce's avatar
deuce committed
733
		if(localtime_r(&logontime,&tm)==NULL)
734
735
			i=0;
		else
736
			i=(tm.tm_hour*60)+tm.tm_min;
737
738
739
		write(file,&i,2);						/* Logon time in min since mid */

		now=time(NULL);
740
		i=-(int16_t)(((now-starttime)/60)+(time_t)useron.ttoday);/* Negative minutes used */
741
742
		write(file,&i,2);

Rob Swindell's avatar
Rob Swindell committed
743
		SAFEPRINTF2(str,"%02d:%02d",tm.tm_hour,tm.tm_min);
744
745
746
747
748
		write(file,str,5);

		i=cfg.level_timepercall[useron.level];	/* Time allowed on */
		write(file,&i,2);

749
		c=0;
750
751
		i=0;									/* Allowed K-bytes for D/L */
		write(file,&i,2);
752
		write(file,&c,1);						/* Conference user was in */
753
754
755
756
757
758
759
760
		write(file,&i,2);						/* Conferences joined */
		write(file,&i,2);						/* "" */
		write(file,&i,2);						/* "" */
		write(file,&i,2);						/* Conferences scanned */
		write(file,&i,2);						/* "" */
		write(file,&i,2);						/* Conference add time */
		write(file,&i,2);						/* Upload/Sysop Chat time min */

Rob Swindell's avatar
Rob Swindell committed
761
		SAFECOPY(str,"    ");
762
763
		write(file,str,4);						/* Language extension */

Rob Swindell's avatar
Rob Swindell committed
764
		SAFEPRINTF(str,"%-25.25s",name);           /* User's full name */
765
766
		write(file,str,25);

767
		i=(int16_t)(tleft/60);
768
769
770
771
		write(file,&i,2);						/* Minutes remaining */

		write(file,&cfg.node_num,1);			/* Node number */

Rob Swindell's avatar
Rob Swindell committed
772
		safe_snprintf(str, sizeof(str), "%02d:%02d%2d%2d"           /* Scheduled Event time */
773
774
775
776
777
778
779
780
781
782
			,0 // sys_eventtime/60
			,0 // sys_eventtime%60
			,0 // sys_timed[0] ? -1:0				 /* Event active ? */
			,0									/* Slide event ? */
			);
		write(file,str,9);

		l=0L;
		write(file,&l,4);						/* Memorized message number */

783
		safe_snprintf(str, sizeof(str), "%d%c%c%d%s%c%c%d%d%d%c%c"
784
			,cfg.com_port						/* COM Port number */
785
786
			,' ' 								/* Reserved */
			,' ' 								/* "" */
787
			,INT_TO_BOOL(term & ANSI)			/* 1=ANSI 0=NO ANSI */
788
789
790
791
792
793
794
795
796
797
798
			,"01-01-80"                         /* last event date */
			,0,0								/* last event minute */
			,0									/* caller exited to dos */
			,sys_status&SS_EVENT ? 1:0			/* event up coming */
			,0									/* stop uploads */
			,0,0								/* conference user was in */
			);
		write(file,str,19);

		close(file);			/* End of PCBOARD.SYS creation */

Rob Swindell's avatar
Rob Swindell committed
799
		SAFECOPY(tmp,"USERS.SYS");
800
801
		if(misc&XTRN_LWRCASE)
			strlwr(tmp);
Rob Swindell's avatar
Rob Swindell committed
802
		safe_snprintf(str, sizeof(str), "%s%s",dropdir,tmp);
803
		(void)removecase(str);
804
805
		if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC))==-1) {
			errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC);
806
807
			return; 
		}
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830

		/* Write goof-ball header */

		i=145;
		write(file,&i,2);		/* PCBoard version number (i.e. 145) */
		l=useron.number;
		write(file,&l,4);		/* Record number for USER's file */
		i=218;
		write(file,&i,2);		/* Size of "fixed" user record */
		i=1;
		write(file,&i,2);		/* Number of conference areas */
		i=7;
		write(file,&i,2);		/* Number of bit map fields for conferences */
		i=5;
		write(file,&i,2);		/* Size of each bit map field */
		memset(str,0,15);
		write(file,str,15); 	/* Name of Third Party Application (if any) */
		i=0;
		write(file,&i,2);		/* Version number for application (if any) */
		write(file,&i,2);		/* Size of a "fixed length" record (if any) */
		write(file,&i,2);		/* Size of conference record (if any) */
		l=0;
		write(file,&l,4);		/* Offset of AppRec into USERS.INF (if any) */
831
832
		c=0;
		write(file,&c,1);		/* 1, if USERS.SYS file has been updated */
833
834
835
836

		/* Write fixed record portion */

		write(file,name,26);			/* Name */
Rob Swindell's avatar
Rob Swindell committed
837
		SAFEPRINTF(str,"%.24s",useron.location);
838
		write(file,str,25); 			/* Location */
rswindell's avatar
rswindell committed
839
840
841
842
843
844
845
846
		write(file,useron.pass, 9); 	/* Password */
		l=0;
		write(file, &l, 4);	/* more password bytes */
		c=0;
		write(file,useron.phone, 13);	/* Business or Data Phone */
		write(file, &c, 1);	/* more phone number bytes */
		write(file,useron.phone, 13);	/* Home or Voice Phone */
		write(file, &c, 1);	/* more phone number bytes */
847
848
		i=unixtojulian(useron.laston);
		write(file,&i,2);				/* Date last on */
849
		localtime32(&useron.laston,&tm);
Rob Swindell's avatar
Rob Swindell committed
850
		SAFEPRINTF2(str,"%02d:%02d",tm.tm_hour,tm.tm_min);
851
852
		write(file,str,6);				/* Last time on */
		if(useron.misc&EXPERT)
853
			c=1;
854
		else
855
856
857
858
			c=0;
		write(file,&c,1);				/* Expert mode */
		c='Z';
		write(file,&c,1);				/* Protocol (A-Z) */
859
		if(useron.misc&CLRSCRN)
860
			c=2;
861
		else
862
863
			c=0;
		write(file,&c,1);				/* bit packed flags */
864
865
866
867
868
869
870
871
872
873
874
875
876
		i=0;
		write(file,&i,2);				/* DOS date for last DIR Scan */
		i=useron.level;
		write(file,&i,2);				/* Security level */
		write(file,&useron.logons,2);	/* Number of times caller has connected */
		c=(char)rows;
		write(file,&c,1);				/* Page length */
		write(file,&useron.uls,2);		/* Number of uploads */
		write(file,&useron.dls,2);		/* Number of downloads */
		l=0;
		write(file,&l,4);				/* Number of download bytes today */
		write(file,&useron.note,31);	/* Comment #1 */
		write(file,&useron.comp,31);	/* Comment #2 */
877
		i=(int16_t)(now-starttime)/60;
878
879
880
881
882
883
884
885
886
887
		write(file,&i,2);				/* Minutes online (this logon?) */
		i=unixtojulian(useron.expire);
		write(file,&i,2);				/* Expiration date */
		i=cfg.expired_level;
		write(file,&i,2);				/* Expired security level */
		i=1;
		write(file,&i,2);				/* Current conference */
		write(file,&useron.dlb,4);		/* Bytes downloaded */
		write(file,&useron.ulb,4);		/* Bytes uploaded */
		if(useron.misc&DELETED)
888
			c=1;
889
		else
890
891
			c=0;
		write(file,&c,1);				/* Deleted? */
892
893
894
895
896
897
898
899
900
901
902
		l=useron.number;
		write(file,&l,4);				/* Record number in USERS.INF file */
		l=0;
		memset(str,0,9);
		write(file,str,9);				/* Reserved */
		write(file,&l,4);				/* Number of messages read */
		l=useron.posts+useron.emails+useron.fbacks;
		write(file,&l,4);				/* Number of messages left */
		close(file);

		/* End of USERS.SYS creation */
903
	}
904
905

	else if(type==XTRN_SPITFIRE) {	 /* SpitFire SFDOORS.DAT File */
Rob Swindell's avatar
Rob Swindell committed
906
		SAFECOPY(tmp,"SFDOORS.DAT");
907
908
		if(misc&XTRN_LWRCASE)
			strlwr(tmp);
Rob Swindell's avatar
Rob Swindell committed
909
		SAFEPRINTF2(str,"%s%s",dropdir,tmp);
910
		(void)removecase(str);
911
912
		if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT))==-1) {
			errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC|O_TEXT);
913
914
			return; 
		}
915
916

		now=time(NULL);
917
		if(localtime_r(&now,&tm)==NULL)
918
919
			l=0;
		else
920
921
			l=((((long)tm.tm_hour*60L)+(long)tm.tm_min)*60L)
				+(long)tm.tm_sec;
922

Rob Swindell's avatar
Rob Swindell committed
923
		SAFECOPY(tmp,name);
924
		if((p=strchr(tmp,' '))!=NULL)
925
926
			*p=0;

Rob Swindell's avatar
Rob Swindell committed
927
		safe_snprintf(str, sizeof(str), "%u\n%s\n%s\n%s\n%lu\n%u\n%lu\n%" PRId32 "\n"
928
929
930
931
932
933
934
935
936
			,useron.number						/* User number */
			,name								/* User name */
			,useron.pass						/* Password */
			,tmp								/* User's first name */
			,dte_rate							/* DTE Rate */
			,cfg.com_port						/* COM Port */
			,tleft/60							/* Time left in minutes */
			,l									/* Seconds since midnight (now) */
			);
937
		lfexpand(str,misc);
938
939
		write(file,str,strlen(str));

deuce's avatar
deuce committed
940
		if(localtime_r(&logontime,&tm)==NULL)
941
942
			l=0;
		else
943
944
			l=((((long)tm.tm_hour*60L)+(long)tm.tm_min)*60L)
				+(long)tm.tm_sec;
945

Rob Swindell's avatar
Rob Swindell committed
946
		safe_snprintf(str, sizeof(str), "%s\n%s\n%u\n%u\n%u\n%u\n%" PRId32 "\n%lu\n%s\n"
947
948
			"%s\n%s\n%lu\n%s\n%u\n%u\n%u\n%u\n%u\n%lu\n%u\n"
			"%lu\n%lu\n%s\n%s\n"
949
			,dropdir
950
			,(term & ANSI) ? "TRUE":"FALSE"		/* ANSI ? True or False */
951
952
953
954
955
			,useron.level						/* Security level */
			,useron.uls 						/* Total uploads */
			,useron.dls 						/* Total downloads */
			,cfg.level_timepercall[useron.level]/* Minutes allowed this call */
			,l									/* Secs since midnight (logon) */
956
			,(long)(starttime-logontime)		/* Extra time in seconds */
957
958
959
960
961
962
963
964
965
966
			,"FALSE"                            /* Sysop next? */
			,"FALSE"                            /* From Front-end? */
			,"FALSE"                            /* Software Flow Control? */
			,dte_rate							/* DTE Rate */
			,"FALSE"                            /* Error correcting connection? */
			,0									/* Current conference */
			,0