- Ported "imontty", "isdnctrl", "isdnlog", "xmonisdn" and "hisaxctrl" to

Linux-2.4 "devfs" ("/dev/isdnctrl" -> "/dev/isdn/isdnctrl")
This commit is contained in:
akool 2000-06-29 17:38:26 +00:00
parent 05f3e1f769
commit 1c0a68c4e8
10 changed files with 84 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $Id: hisaxctrl.c,v 1.1 2000/06/20 10:16:16 keil Exp $
/* $Id: hisaxctrl.c,v 1.2 2000/06/29 17:38:26 akool Exp $
*
* Configuration tool for HiSax ISDN cards
*
@ -92,7 +92,9 @@ main(int argc, char *argv[])
ioctl_s.arg = 0;
cmd = 0;
}
fd = open("/dev/isdnctrl", O_RDWR);
fd = open("/dev/isdn/isdnctrl", O_RDWR);
if (fd < 0)
fd = open("/dev/isdnctrl", O_RDWR);
if (fd < 0) {
perror("/dev/isdnctrl");
exit(-1);

View File

@ -3,7 +3,7 @@
* (c) 1995-97 Volker Götz
* (c) 2000 Paul Slootman <paul@isdn4linux.de>
*
* $Id: imontty.c,v 1.4 2000/03/13 16:31:49 paul Exp $
* $Id: imontty.c,v 1.5 2000/06/29 17:38:26 akool Exp $
*/
#include <stdlib.h>
@ -180,10 +180,11 @@ int main(int argc, char **argv) {
int i, lines;
if (!(isdninfo = fopen(PATH_ISDNINFO, "r"))) {
char tmp[200];
sprintf(tmp, "imontty: can't open `%.170s'", PATH_ISDNINFO);
perror(tmp);
isdninfo = fopen("/dev/isdn/isdninfo", "r");
if (!isdninfo)
isdninfo = fopen("/dev/isdninfo", "r");
if (!isdninfo) {
perror("imontty: can't open /dev/isdninfo");
exit(1);
}

View File

@ -2,9 +2,8 @@
*
* (c) 1995-97 Volker Götz
*
* $Id: imontty.h,v 1.1 1997/03/03 04:10:12 fritz Exp $
* $Id: imontty.h,v 1.2 2000/06/29 17:38:26 akool Exp $
*/
#define PATH_ISDNINFO "/dev/isdninfo"
#define IM_BUFSIZE 10 + (22 * ISDN_MAX_CHANNELS)
#define IM_VERSION "0.5"

View File

@ -1,4 +1,4 @@
/* $Id: isdnctrl.c,v 1.42 2000/04/27 06:32:28 calle Exp $
/* $Id: isdnctrl.c,v 1.43 2000/06/29 17:38:26 akool Exp $
* ISDN driver for Linux. (Control-Utility)
*
* Copyright 1994,95 by Fritz Elfert (fritz@isdn4linux.de)
@ -21,6 +21,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: isdnctrl.c,v $
* Revision 1.43 2000/06/29 17:38:26 akool
* - Ported "imontty", "isdnctrl", "isdnlog", "xmonisdn" and "hisaxctrl" to
* Linux-2.4 "devfs" ("/dev/isdnctrl" -> "/dev/isdn/isdnctrl")
*
* Revision 1.42 2000/04/27 06:32:28 calle
* DriverId can be longer than 8 for "mapping" and "busreject".
*
@ -613,7 +617,9 @@ static void statusif(int isdnctrl, char *name, int errexit)
static int isdninfo = -1;
if (isdninfo < 0) {
isdninfo = open("/dev/isdninfo", O_RDONLY);
isdninfo = open("/dev/isdn/isdninfo", O_RDONLY);
if (isdninfo < 0)
isdninfo = open("/dev/isdninfo", O_RDONLY);
if (isdninfo < 0) {
perror("Can't open /dev/isdninfo");
exit(-1);
@ -1745,7 +1751,9 @@ void check_version(int report) {
printf("isdnctrl's view of API-Versions:\n");
printf("ttyI: %d, net: %d, info: %d\n", TTY_DV, NET_DV, INF_DV);
}
fd = open("/dev/isdninfo", O_RDWR);
fd = open("/dev/isdn/isdninfo", O_RDWR);
if (fd < 0)
fd = open("/dev/isdninfo", O_RDONLY);
if (fd < 0) {
perror("/dev/isdninfo");
exit(-1);
@ -1913,7 +1921,9 @@ int main(int argc, char **argv)
#endif
check_version(0);
fd = open("/dev/isdnctrl", O_RDWR);
fd = open("/dev/isdn/isdnctrl", O_RDWR);
if (fd < 0)
fd = open("/dev/isdnctrl", O_RDWR);
if (fd < 0) {
perror("/dev/isdnctrl");
exit(-1);

View File

@ -1,4 +1,4 @@
/* $Id: isdnlog.c,v 1.62 2000/06/20 17:09:59 akool Exp $
/* $Id: isdnlog.c,v 1.63 2000/06/29 17:38:27 akool Exp $
*
* ISDN accounting for isdn4linux. (log-module)
*
@ -19,6 +19,10 @@
* along with this program; if not, write to the Free Software
*
* $Log: isdnlog.c,v $
* Revision 1.63 2000/06/29 17:38:27 akool
* - Ported "imontty", "isdnctrl", "isdnlog", "xmonisdn" and "hisaxctrl" to
* Linux-2.4 "devfs" ("/dev/isdnctrl" -> "/dev/isdn/isdnctrl")
*
* Revision 1.62 2000/06/20 17:09:59 akool
* isdnlog-4.29
* - better ASN.1 display
@ -1497,7 +1501,14 @@ int main(int argc, char *argv[], char *envp[])
} /* switch */
} /* if */
if (replay || ((sockets[ISDNINFO].descriptor = open(INFO, O_RDONLY | O_NONBLOCK)) >= 0)) {
if (!replay) {
sockets[ISDNINFO].descriptor = open("/dev/isdn/isdninfo", O_RDONLY | O_NONBLOCK);
if (sockets[ISDNINFO].descriptor<0)
sockets[ISDNINFO].descriptor = open("/dev/isdninfo", O_RDONLY | O_NONBLOCK);
}
if (replay || (sockets[ISDNINFO].descriptor >= 0)) {
if (readkeyboard) {
raw_mode(1);
@ -1555,7 +1566,7 @@ int main(int argc, char *argv[], char *envp[])
for (i = 0; i < knowns; i++) {
p1 = known[i]->num;
while (p2 = strchr(p1, ',')) {
while ((p2 = strchr(p1, ','))) {
*p2 = 0;
fprintf(fo, "INSERT INTO conf VALUES('%s',%d,'%s');\n",
p1, known[i]->si, known[i]->who);
@ -1579,7 +1590,7 @@ int main(int argc, char *argv[], char *envp[])
close(sockets[ISDNINFO].descriptor);
}
else {
print_msg(PRT_ERR, msg1, myshortname, INFO, strerror(errno));
print_msg(PRT_ERR, msg1, myshortname, "/dev/isdninfo", strerror(errno));
res = 7;
} /* else */

View File

@ -1,4 +1,4 @@
/* $Id: processor.c,v 1.107 2000/06/20 17:09:59 akool Exp $
/* $Id: processor.c,v 1.108 2000/06/29 17:38:27 akool Exp $
*
* ISDN accounting for isdn4linux. (log-module)
*
@ -19,6 +19,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: processor.c,v $
* Revision 1.108 2000/06/29 17:38:27 akool
* - Ported "imontty", "isdnctrl", "isdnlog", "xmonisdn" and "hisaxctrl" to
* Linux-2.4 "devfs" ("/dev/isdnctrl" -> "/dev/isdn/isdnctrl")
*
* Revision 1.107 2000/06/20 17:09:59 akool
* isdnlog-4.29
* - better ASN.1 display
@ -1508,7 +1512,7 @@ static int detach()
return(1);
}
else {
print_msg(PRT_DEBUG_CS, "cannot close \"%s\": %s\n", INFO, strerror(errno));
print_msg(PRT_DEBUG_CS, "cannot close /dev/isdninfo: %s\n",strerror(errno));
Exit(33);
} /* else */
}
@ -1542,8 +1546,11 @@ static int attach()
Exit(38); /* cannot (re)open "/dev/isdnctrl2" */
} /* if */
if ((sockets[ISDNINFO].descriptor = open(INFO, O_RDONLY | O_NONBLOCK)) < 0) {
print_msg(PRT_DEBUG_CS, "cannot open \"%s\": %s\n", INFO, strerror(errno));
sockets[ISDNINFO].descriptor = open("/dev/isdn/isdninfo", O_RDONLY | O_NONBLOCK);
if (sockets[ISDNINFO].descriptor < 0)
sockets[ISDNINFO].descriptor = open("/dev/isdninfo", O_RDONLY | O_NONBLOCK);
if (sockets[ISDNINFO].descriptor < 0) {
print_msg(PRT_DEBUG_CS, "cannot open /dev/isdninfo: %s\n", strerror(errno));
Exit(32);
} /* if */

View File

@ -1,4 +1,4 @@
/* $Id: tools.c,v 1.48 2000/04/02 17:35:07 akool Exp $
/* $Id: tools.c,v 1.49 2000/06/29 17:38:28 akool Exp $
*
* ISDN accounting for isdn4linux. (Utilities)
*
@ -19,6 +19,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: tools.c,v $
* Revision 1.49 2000/06/29 17:38:28 akool
* - Ported "imontty", "isdnctrl", "isdnlog", "xmonisdn" and "hisaxctrl" to
* Linux-2.4 "devfs" ("/dev/isdnctrl" -> "/dev/isdn/isdnctrl")
*
* Revision 1.48 2000/04/02 17:35:07 akool
* isdnlog-4.18
* - isdnlog/isdnlog/isdnlog.8.in ... documented hup3
@ -1043,10 +1047,22 @@ int iprintf(char *obuf, int chan, register char *fmt, ...)
} /* if */
if (c != '%') {
*op++ = c;
if (c == '\\') {
c = *fmt++;
switch (c) {
case 't':
*op++ = '\t';
break;
default:
*op++ = '\\';
*op++ = c;
}
} else {
*op++ = c;
}
continue;
} /* if */
p = s = buf;
ljust = 0;

View File

@ -1,4 +1,4 @@
/* $Id: tools.h,v 1.54 2000/03/09 18:50:03 akool Exp $
/* $Id: tools.h,v 1.55 2000/06/29 17:38:28 akool Exp $
*
* ISDN accounting for isdn4linux.
*
@ -20,6 +20,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: tools.h,v $
* Revision 1.55 2000/06/29 17:38:28 akool
* - Ported "imontty", "isdnctrl", "isdnlog", "xmonisdn" and "hisaxctrl" to
* Linux-2.4 "devfs" ("/dev/isdnctrl" -> "/dev/isdn/isdnctrl")
*
* Revision 1.54 2000/03/09 18:50:03 akool
* isdnlog-4.16
* - isdnlog/samples/isdn.conf.no ... changed VBN
@ -722,7 +726,6 @@
#if 0 /* Fixme: remove */
#define AVON "avon"
#endif
#define INFO "/dev/isdninfo"
#define BIGBUFSIZ 2048

View File

@ -625,8 +625,15 @@ static int parse_info()
static void GetNetinfoFile (w)
NetstatWidget w;
{
w->netstat.filename = (String) XtMalloc (strlen (NETINFO_FILE) + 1);
strcpy (w->netstat.filename, NETINFO_FILE);
char *netinfo_file;
struct stat stbuf;
netinfo_file="/dev/isdn/isdninfo";
if (stat(netinfo_file, &stbuf)<0)
netinfo_file="/dev/isdninfo";
w->netstat.filename = (String) XtMalloc (strlen (netinfo_file) + 1);
strcpy (w->netstat.filename, netinfo_file);
return;
}

View File

@ -4,7 +4,6 @@
#include "Net.h"
#include <X11/Xaw/SimpleP.h>
#define NETINFO_FILE "/dev/isdninfo"
#ifndef NETUP_COMMAND
#define NETUP_COMMAND "/sbin/isdnnet start &"
#endif