Increased terminal ports
This commit is contained in:
parent
d15a905fa9
commit
139ec0d628
@ -49,6 +49,11 @@ v0.71.1 28-Nov-2004
|
|||||||
Changed X-JAM kludges to X-FTN kludges to make it compatible
|
Changed X-JAM kludges to X-FTN kludges to make it compatible
|
||||||
with the rest of the gates.
|
with the rest of the gates.
|
||||||
|
|
||||||
|
mbsetup:
|
||||||
|
Added support for XxxxBSD console port.
|
||||||
|
For new systems, there will now be 20 terminal ports created
|
||||||
|
instead of 10.
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
Removed bbs list items from the English menus and txtfiles and
|
Removed bbs list items from the English menus and txtfiles and
|
||||||
the Spanish menus and txtfiles.
|
the Spanish menus and txtfiles.
|
||||||
|
@ -51,7 +51,7 @@ int CountTtyinfo(void)
|
|||||||
{
|
{
|
||||||
FILE *fil;
|
FILE *fil;
|
||||||
char ffile[PATH_MAX];
|
char ffile[PATH_MAX];
|
||||||
int count, i;
|
int count = 0, i;
|
||||||
|
|
||||||
sprintf(ffile, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT"));
|
sprintf(ffile, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT"));
|
||||||
if ((fil = fopen(ffile, "r")) == NULL) {
|
if ((fil = fopen(ffile, "r")) == NULL) {
|
||||||
@ -61,7 +61,7 @@ int CountTtyinfo(void)
|
|||||||
ttyinfohdr.recsize = sizeof(ttyinfo);
|
ttyinfohdr.recsize = sizeof(ttyinfo);
|
||||||
fwrite(&ttyinfohdr, sizeof(ttyinfohdr), 1, fil);
|
fwrite(&ttyinfohdr, sizeof(ttyinfohdr), 1, fil);
|
||||||
|
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
memset(&ttyinfo, 0, sizeof(ttyinfo));
|
memset(&ttyinfo, 0, sizeof(ttyinfo));
|
||||||
sprintf(ttyinfo.comment, "Network port %d", i+11);
|
sprintf(ttyinfo.comment, "Network port %d", i+11);
|
||||||
sprintf(ttyinfo.tty, "pts/%d", i);
|
sprintf(ttyinfo.tty, "pts/%d", i);
|
||||||
@ -71,9 +71,10 @@ int CountTtyinfo(void)
|
|||||||
ttyinfo.available = TRUE;
|
ttyinfo.available = TRUE;
|
||||||
sprintf(ttyinfo.name, "Network port #%d", i+11);
|
sprintf(ttyinfo.name, "Network port #%d", i+11);
|
||||||
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
memset(&ttyinfo, 0, sizeof(ttyinfo));
|
memset(&ttyinfo, 0, sizeof(ttyinfo));
|
||||||
sprintf(ttyinfo.comment, "Network port %d", i+1);
|
sprintf(ttyinfo.comment, "Network port %d", i+1);
|
||||||
sprintf(ttyinfo.tty, "ttyp%d", i);
|
sprintf(ttyinfo.tty, "ttyp%d", i);
|
||||||
@ -83,8 +84,13 @@ int CountTtyinfo(void)
|
|||||||
ttyinfo.available = TRUE;
|
ttyinfo.available = TRUE;
|
||||||
sprintf(ttyinfo.name, "Network port #%d", i+1);
|
sprintf(ttyinfo.name, "Network port #%d", i+1);
|
||||||
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
/*
|
||||||
|
* Linux has 6 virtual consoles
|
||||||
|
*/
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
memset(&ttyinfo, 0, sizeof(ttyinfo));
|
memset(&ttyinfo, 0, sizeof(ttyinfo));
|
||||||
sprintf(ttyinfo.comment, "Console port %d", i+1);
|
sprintf(ttyinfo.comment, "Console port %d", i+1);
|
||||||
@ -93,7 +99,23 @@ int CountTtyinfo(void)
|
|||||||
ttyinfo.type = LOCAL;
|
ttyinfo.type = LOCAL;
|
||||||
ttyinfo.available = TRUE;
|
ttyinfo.available = TRUE;
|
||||||
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
|
||||||
|
/*
|
||||||
|
* By default, xxxBSD systems have only one console
|
||||||
|
*/
|
||||||
|
memset(&ttyinfo, 0, sizeof(ttyinfo));
|
||||||
|
sprintf(ttyinfo.comment, "Console port 1");
|
||||||
|
sprintf(ttyinfo.tty, "console");
|
||||||
|
sprintf(ttyinfo.speed, "10 mbit");
|
||||||
|
ttyinfo.type = LOCAL;
|
||||||
|
ttyinfo.available = TRUE;
|
||||||
|
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
||||||
|
count++;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
memset(&ttyinfo, 0, sizeof(ttyinfo));
|
memset(&ttyinfo, 0, sizeof(ttyinfo));
|
||||||
@ -118,6 +140,7 @@ int CountTtyinfo(void)
|
|||||||
ttyinfo.honor_zmh = TRUE;
|
ttyinfo.honor_zmh = TRUE;
|
||||||
sprintf(ttyinfo.name, "ISDN line #%d", i+1);
|
sprintf(ttyinfo.name, "ISDN line #%d", i+1);
|
||||||
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
@ -148,11 +171,12 @@ int CountTtyinfo(void)
|
|||||||
#endif
|
#endif
|
||||||
sprintf(ttyinfo.name, "Modem line #%d", i+1);
|
sprintf(ttyinfo.name, "Modem line #%d", i+1);
|
||||||
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fil);
|
fclose(fil);
|
||||||
chmod(ffile, 0640);
|
chmod(ffile, 0640);
|
||||||
return 34;
|
return count;
|
||||||
} else
|
} else
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user