summaryrefslogtreecommitdiffstats
path: root/gnu/usr.sbin/isdn/misc
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-02-15 00:46:26 +0000
committerjkh <jkh@FreeBSD.org>1995-02-15 00:46:26 +0000
commit0cb129cc755064f31fb42abf2c721a8605381511 (patch)
tree87521af8f33d69817699aec072374bf2d3734e3e /gnu/usr.sbin/isdn/misc
downloadFreeBSD-src-0cb129cc755064f31fb42abf2c721a8605381511.zip
FreeBSD-src-0cb129cc755064f31fb42abf2c721a8605381511.tar.gz
Import the ISDN userland utilities. Just about ready to start shaking
this baby out in earnest..
Diffstat (limited to 'gnu/usr.sbin/isdn/misc')
-rw-r--r--gnu/usr.sbin/isdn/misc/Makefile21
-rw-r--r--gnu/usr.sbin/isdn/misc/isdn.ip3
-rw-r--r--gnu/usr.sbin/isdn/misc/isdn.itt1
-rw-r--r--gnu/usr.sbin/isdn/misc/remote2
-rw-r--r--gnu/usr.sbin/isdn/misc/setnic.sh84
-rw-r--r--gnu/usr.sbin/isdn/misc/sisdn.sh8
-rw-r--r--gnu/usr.sbin/isdn/misc/stime.c44
-rw-r--r--gnu/usr.sbin/isdn/misc/tst.c74
-rw-r--r--gnu/usr.sbin/isdn/misc/ttys2
9 files changed, 239 insertions, 0 deletions
diff --git a/gnu/usr.sbin/isdn/misc/Makefile b/gnu/usr.sbin/isdn/misc/Makefile
new file mode 100644
index 0000000..914fddd
--- /dev/null
+++ b/gnu/usr.sbin/isdn/misc/Makefile
@@ -0,0 +1,21 @@
+CFLAGS+= -DBSD -O
+
+ETCFILES = isdn.ip remote isdn.itt ttys
+CLEANFILES+= tst stime *.o
+
+all: tst stime
+
+tst: tst.c
+ ${CC} $(CFLAGS) -o tst tst.c
+
+stime: stime.c
+ ${CC} $(CFLAGS) -o stime stime.c
+
+install: all
+ ${INSTALL} ${COPY} tst ${BINDIR}/isdn_test
+ ${INSTALL} ${COPY} stime ${BINDIR}/isdn_stime
+ ${INSTALL} ${COPY} -m 755 setnic.sh ${LIBDIR}/setnic
+ ${INSTALL} ${COPY} -m 755 sisdn.sh ${LIBDIR}/sisdn.example
+ ${INSTALL} ${COPY} ${ETCFILES} ${LIBDIR}
+
+.include <bsd.prog.mk>
diff --git a/gnu/usr.sbin/isdn/misc/isdn.ip b/gnu/usr.sbin/isdn/misc/isdn.ip
new file mode 100644
index 0000000..89b7376
--- /dev/null
+++ b/gnu/usr.sbin/isdn/misc/isdn.ip
@@ -0,0 +1,3 @@
+# This is nothing but a first try. Syntax might be completly different soon.
+0:d102:l102:e2:pu:s1502:w10:
+1:d113:l113:e3:pu:s1502:w10:
diff --git a/gnu/usr.sbin/isdn/misc/isdn.itt b/gnu/usr.sbin/isdn/misc/isdn.itt
new file mode 100644
index 0000000..74a58fa
--- /dev/null
+++ b/gnu/usr.sbin/isdn/misc/isdn.itt
@@ -0,0 +1 @@
+0:A8:pr.:w100:
diff --git a/gnu/usr.sbin/isdn/misc/remote b/gnu/usr.sbin/isdn/misc/remote
new file mode 100644
index 0000000..cda70ac
--- /dev/null
+++ b/gnu/usr.sbin/isdn/misc/remote
@@ -0,0 +1,2 @@
+isdn:dv=/dev/ityo0:cm=d123.:pa=none:
+re:dv=/dev/ityo0:cm=d133.:pa=none:
diff --git a/gnu/usr.sbin/isdn/misc/setnic.sh b/gnu/usr.sbin/isdn/misc/setnic.sh
new file mode 100644
index 0000000..9d2e099
--- /dev/null
+++ b/gnu/usr.sbin/isdn/misc/setnic.sh
@@ -0,0 +1,84 @@
+# First Parameter one out of the following:
+# 5000 Niccy 5000
+# 3008 Niccy 3008
+# 3009 Niccy 3009
+# 1000 Niccy 1000
+# tel* , TEL* TELES S0
+#
+# Second Parameter is optional:
+# E* e* Euro ISDN EDSS1
+# 1T* 1t* t* T* 1TR6 (old german protocol) (default for the moment)
+
+PATH=/sbin:/bin/:/usr/bin:/usr/sbin
+SYSTEM=`uname`
+VER=`uname -a | cut -d' ' -f3`
+case $SYSTEM in
+NetBSD)
+ SN=netbsd
+ ;;
+FreeBSD)
+ case $VER in
+ 1.0*|1.1*)
+ SN=386bsd
+ ;;
+ 2.0*)
+ SN=kernel
+ ;;
+ *)
+ echo System $SYSTEM Version $VER not supported
+ exit
+ esac
+ ;;
+*)
+ echo System $SYSTEM not supported
+ exit
+esac
+
+if [ "$2" = "" ]
+then
+ LIB=tr6
+else
+ case $2 in
+ E*|e*)
+ LIB=eds
+ ;;
+ 1t*|1T*|t*|T*)
+ LIB=tr6
+ ;;
+ *)
+ echo library $2 not supported
+ exit
+ esac
+fi
+
+
+case $1 in
+
+5000)
+ rm -f /$SN /isdn/lib/all.nic
+ ln /$SN.5000 /$SN
+ ln /isdn/lib/all.$LIB.5000 /isdn/lib/all.nic
+ /isdn/bin/mkdev 5000
+ ;;
+3008)
+ rm -f /$SN /isdn/lib/all.nic
+ ln /$SN.3008 /$SN
+ ln /isdn/lib/all.$LIB.3008 /isdn/lib/all.nic
+ /isdn/bin/mkdev 3008
+ ;;
+3009)
+ rm -f /$SN /isdn/lib/all.nic
+ ln /$SN.3009 /$SN
+ ln /isdn/lib/all.$LIB.3009 /isdn/lib/all.nic
+ /isdn/bin/mkdev 3009
+ ;;
+1000|tel*|TEL*)
+ rm -f /$SN /isdn/lib/all.nic
+ ln /$SN.1000 /$SN
+ /isdn/bin/mkdev 1000
+ ;;
+esac
+
+ls -l /$SN*
+
+echo please reboot the system by typing: fastboot
diff --git a/gnu/usr.sbin/isdn/misc/sisdn.sh b/gnu/usr.sbin/isdn/misc/sisdn.sh
new file mode 100644
index 0000000..aca1bc7
--- /dev/null
+++ b/gnu/usr.sbin/isdn/misc/sisdn.sh
@@ -0,0 +1,8 @@
+load /isdn/lib/all.nic
+iid
+ittd
+iteld
+ifconfig ii0 inet 192.192.192.2 192.192.192.1
+ifconfig ii1 inet 192.192.193.2 192.192.193.1
+route add ver 192.192.192.2
+route add ver1 192.192.193.2
diff --git a/gnu/usr.sbin/isdn/misc/stime.c b/gnu/usr.sbin/isdn/misc/stime.c
new file mode 100644
index 0000000..5eb21d4
--- /dev/null
+++ b/gnu/usr.sbin/isdn/misc/stime.c
@@ -0,0 +1,44 @@
+static char rcsid[] = "@(#)$Id: stime.c,v 1.1 1995/01/25 14:14:58 jkr Exp jkr $";
+/*******************************************************************************
+ * II - Version 0.1 $Revision: 1.1 $ $State: Exp $
+ *
+ * Copyright 1994 Dietmar Friede
+ *******************************************************************************
+ * Bug reports, patches, comments, suggestions should be sent to:
+ *
+ * jkr@saarlink.de or jkrause@guug.de
+ *
+ *******************************************************************************
+ * $Log: stime.c,v $
+ *
+ ******************************************************************************/
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/ioctl.h>
+#include <sys/file.h>
+#include "../../../../sys/gnu/i386/isa/niccyreg.h"
+
+main()
+{
+ struct tm *t;
+ time_t tt;
+ int f;
+ char buf[16];
+
+ if ((f = open("/dev/nic0", O_RDWR)) < 0)
+ {
+ perror("open");
+ exit(1);
+ }
+ tt = time(NULL);
+ t = localtime(&tt);
+ sprintf(buf, "%.2d%.2d%.2d%.2d%.2d19%.2d", t->tm_hour,
+ t->tm_min, t->tm_sec, t->tm_mday, t->tm_mon + 1, t->tm_year);
+
+ if (ioctl(f, NICCY_SET_CLOCK, buf) < 0)
+ {
+ perror("ioctl");
+ }
+}
diff --git a/gnu/usr.sbin/isdn/misc/tst.c b/gnu/usr.sbin/isdn/misc/tst.c
new file mode 100644
index 0000000..535de1e
--- /dev/null
+++ b/gnu/usr.sbin/isdn/misc/tst.c
@@ -0,0 +1,74 @@
+static char rcsid[] = "@(#)$Id: tst.c,v 1.1 1995/01/25 14:14:58 jkr Exp jkr $";
+/*******************************************************************************
+ * II - Version 0.1 $Revision: 1.1 $ $State: Exp $
+ *
+ * Copyright 1994 Dietmar Friede
+ *******************************************************************************
+ * Bug reports, patches, comments, suggestions should be sent to:
+ *
+ * jkr@saarlink.de or jkrause@guug.de
+ *
+ *******************************************************************************
+ * $Log: tst.c,v $
+ *
+ ******************************************************************************/
+
+/*
+ * This program reads a 3008 or 5000 or ... download file and shows Headers
+ * and statistics
+ */
+
+#include <sys/types.h>
+#include <machine/endian.h>
+#include <stdio.h>
+
+struct head
+{
+ u_long len;
+ u_long sig;
+ char nam[8];
+ char ver[5];
+ u_char typ;
+} head;
+
+void
+main(int argc, char **argv)
+{
+ FILE *f;
+ argv++;
+
+ if (!*argv)
+ {
+ process(stdin);
+ } else
+ while (*argv)
+ {
+ if ((f = fopen(*argv, "r")) == NULL)
+ {
+ perror(*argv);
+ exit(1);
+ } else
+ {
+ process(f);
+ fclose(f);
+ }
+ argv++;
+ }
+ exit(0);
+}
+
+process(FILE * f)
+{
+ long off;
+
+ off = 0;
+
+ while (fread(&head, 1, 0x16, f) == 0x16)
+ {
+ printf("%d\t %x %.8s %.5s %x\n",
+ ntohl(head.len), head.sig, head.nam, head.ver, head.typ);
+ off += ntohl(head.len);
+ fseek(f, off, SEEK_SET);
+ }
+ printf("%d\n", off);
+}
diff --git a/gnu/usr.sbin/isdn/misc/ttys b/gnu/usr.sbin/isdn/misc/ttys
new file mode 100644
index 0000000..9f135c4
--- /dev/null
+++ b/gnu/usr.sbin/isdn/misc/ttys
@@ -0,0 +1,2 @@
+ity00 "/usr/libexec/getty Pc" unknown on secure
+ity01 "/usr/libexec/getty Pc" unknown on secure
OpenPOWER on IntegriCloud