From 75b6ca7f79905fbf2a8fc8f3fc7adde6345eb29b Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Wed, 11 Dec 1996 14:18:33 +0100 Subject: [PATCH] isdn-44 --- Make.config | 16 +++--- Make.rules | 8 +-- alaw/alaw.c | 6 +-- buffer/buffer.c | 6 +-- cards/arnet/arnet.c | 7 +-- cards/capi/bintec.c | 6 +-- cards/dumb/shell.c | 3 +- compat/compat.h | 2 +- config/Makefile | 3 +- config/files.list | 2 + config/subst.c | 4 +- fakecept/fakecept.c | 6 +-- fakeh/fakeh.c | 6 +-- include/Makefile | 2 +- include/config.h | 4 +- include/dump.h | 2 +- include/isdn_12.h | 4 ++ include/isdn_2.h | 5 ++ include/isdn_23.h | 4 ++ include/isdn_3.h | 5 ++ include/isdn_34.h | 5 ++ include/kernel.h | 17 +++++++ include/port_m.h | 3 +- include/primitives.h | 5 ++ include/q_data.h | 3 +- include/smallq.h | 2 +- include/streamlib.h | 5 +- include/streams.h | 3 +- include/sys/callout.h | 2 + include/timeout.h | 4 +- ip_mon/ip_mon.c | 21 ++++---- ip_mon/tools/monitor.c | 4 +- isdn_2/isdn_2.c | 19 ++++--- isdn_3/capi.c | 5 +- isdn_3/fixed.c | 4 +- isdn_3/isdn_3.c | 6 +-- isdn_3/phone.c | 3 +- isdn_3/prot_1TR6_0.c | 3 +- isdn_3/prot_1TR6_1.c | 3 +- isdn_3/prot_1TR6_common.h | 2 +- isdn_3/prot_ETS.c | 4 +- isdn_3/tei.c | 4 +- isdn_4/Makefile | 2 +- isdn_4/cf.c | 2 + isdn_4/master.c | 14 +++-- isdn_4/master.h | 2 +- ksupport/count.c | 5 +- ksupport/log.c | 9 ++-- ksupport/logh.c | 6 ++- ksupport/proto.c | 8 +-- ksupport/qinfo.c | 7 +-- ksupport/smallq.c | 3 -- ksupport/streamlib.c | 104 ++++++++++++++++++++++++++++++++------ ksupport/x75lib.c | 2 +- pr_on/pr_on.c | 6 +-- rate/rate.c | 6 +-- reconnect/reconnect.c | 6 +-- str_if/str_if.h | 3 +- str_if/str_in.c | 5 +- str_if/str_linux.c | 11 ++-- str_if/tools/slipto.c | 4 +- streams/stream.h | 3 +- strslip/strslip.c | 6 +-- support/malloc.o | Bin 12252 -> 0 bytes support/sioctl.c | 2 +- support/streams.c | 5 +- t70/t70.c | 6 +-- timer/timer.c | 6 +-- tools/Makefile | 32 +++++++----- tools/d_insmod | 3 +- tools/insmod | 3 +- tools/isdn.conf | 10 ---- tools/rc.isdn | 83 +++++++++++++++++++++--------- v110/v110.c | 6 +-- van_j/compress.h | 5 +- van_j/van_j.c | 6 +-- x75/x75.c | 6 +-- 77 files changed, 338 insertions(+), 277 deletions(-) delete mode 100644 support/malloc.o diff --git a/Make.config b/Make.config index d079584..15facab 100644 --- a/Make.config +++ b/Make.config @@ -4,14 +4,14 @@ SHELL = /bin/sh ## =()@>()= -CARDS = teles +CARDS = teles bintec ## =()@>()= -PROTOCOLS = phone tei +PROTOCOLS = phone tei capi fixed ## =()@>()= -SUBPROTOCOLS = euro +SUBPROTOCOLS = euro german ## =()@>()= -KERNELSRC := /usr/src/kernel/linux-work +KERNELSRC := /usr/src/kernel/linux-pci ifeq ($(wildcard $(KERNELSRC)/.config),$(KERNELSRC)/.config) include $(KERNELSRC)/.config @@ -21,21 +21,21 @@ ifdef KERNEL ## =()@>()= CC = gcc ## =()@ >()= -CFLAGS = -g -O -Wall -DKERNEL -D__KERNEL__ -DMODULE +CFLAGS = -g -O2 -fomit-frame-pointer -Wall -DKERNEL -D__KERNEL__ -DMODULE else ## =()@>()= CC = gcc ## =()@ >()= -CFLAGS = -g -Wall +CFLAGS = -g -O2 -Wall ## =()@>()= -LIBS = -lbsd +LIBS = -lbsd-compat endif ## =()@>()= -DESTDIR = /usr/local/isdn +DESTDIR = /usr/lib/isdn ## =()@>()= LD = ld ## =()@>()= diff --git a/Make.rules b/Make.rules index e410703..6b59f9d 100644 --- a/Make.rules +++ b/Make.rules @@ -229,10 +229,6 @@ endif depend:: rm -f .depend -ifneq ($(strip $(PSOURCES)),) -depend:: Makefile $(PSOURCES) $(HEADERS) - $(CC) -M $(CFLAGS) $(INCLUDES) $(EXTRA_CFLAGS) $(PSOURCES) >> .depend -endif ifneq ($(strip $(SOURCES)),) ifneq ($(strip $(REALSOURCE)),) @@ -253,3 +249,7 @@ endif endif endif +ifneq ($(strip $(PSOURCES)),) +depend:: Makefile $(PSOURCES) $(HEADERS) + $(CC) -M $(CFLAGS) $(INCLUDES) $(EXTRA_CFLAGS) $(PSOURCES) >> .depend +endif diff --git a/alaw/alaw.c b/alaw/alaw.c index 93fdcd0..00e4fe2 100644 --- a/alaw/alaw.c +++ b/alaw/alaw.c @@ -9,16 +9,12 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" /* #include */ -#include #include "streamlib.h" #include "alaw.h" #include "isdn_proto.h" diff --git a/buffer/buffer.c b/buffer/buffer.c index 13e937c..f91aeb9 100644 --- a/buffer/buffer.c +++ b/buffer/buffer.c @@ -4,18 +4,14 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "streamlib.h" #include "buffer.h" #include "isdn_proto.h" diff --git a/cards/arnet/arnet.c b/cards/arnet/arnet.c index c047849..0529440 100644 --- a/cards/arnet/arnet.c +++ b/cards/arnet/arnet.c @@ -9,21 +9,18 @@ #include "f_module.h" #include "primitives.h" -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include #include "streams.h" #include "stropts.h" /* #ifdef DONT_ADDERROR */ #include "f_user.h" /* #endif */ -#include -#include #include #include #include "streamlib.h" -#include +#include #include "loader.h" #include diff --git a/cards/capi/bintec.c b/cards/capi/bintec.c index c1edab9..937903a 100644 --- a/cards/capi/bintec.c +++ b/cards/capi/bintec.c @@ -28,11 +28,9 @@ #include "isdn_limits.h" #include "stream.h" #include "streamlib.h" -#include -#include -#include -#include "loader.h" #include "kernel.h" +#include "loader.h" +#include #ifdef linux #include /* htons and friends */ diff --git a/cards/dumb/shell.c b/cards/dumb/shell.c index 3bfac93..82008a9 100644 --- a/cards/dumb/shell.c +++ b/cards/dumb/shell.c @@ -18,11 +18,10 @@ #include "isdn_proto.h" #include "stream.h" #include "streamlib.h" -#include +#include "kernel.h" #ifdef SCO #include #endif -#include #include #include "loader.h" diff --git a/compat/compat.h b/compat/compat.h index a0533e8..621b4f5 100644 --- a/compat/compat.h +++ b/compat/compat.h @@ -2,7 +2,7 @@ #define _LINUX_SYSCOMPAT_H_ #include "config.h" -#include +#include "kernel.h" #ifdef DO_DEBUGGING #define CONFIG_DEBUG_STREAMS diff --git a/config/Makefile b/config/Makefile index 3c29e56..116ee1e 100644 --- a/config/Makefile +++ b/config/Makefile @@ -42,8 +42,7 @@ config.data: subst config.dist cp config.dist config.new ./subst $(SED) -f subst.tmp config.new -@rm -f subst.tmp - @echo "Check config.new, then rename it to config.data, and re-make!" - @false + mv config.new config.data subst: subst.c subst.sh -make c || make sh || rm -f subst diff --git a/config/files.list b/config/files.list index d54b6c7..a1a8988 100644 --- a/config/files.list +++ b/config/files.list @@ -4,4 +4,6 @@ ../include/f_strings.h ../include/f_termio.h ../include/msgtype.h +../tools/rc.isdn +../tools/rc.isdnmon ../Make.config diff --git a/config/subst.c b/config/subst.c index 670d8b8..fe8af0e 100644 --- a/config/subst.c +++ b/config/subst.c @@ -1,6 +1,6 @@ /* This is from INN. */ -/* $Revision: 1.10 $ +/* $Revision: 1.1.1.1 $ ** ** A C version of Henry Spencer's "subst" script. */ @@ -51,8 +51,6 @@ extern char *strcpy(); static char * xstrerror() { - extern int sys_nerr; - extern char *sys_errlist[]; extern int errno; static char buff[30]; diff --git a/fakecept/fakecept.c b/fakecept/fakecept.c index 115fb14..55d8606 100644 --- a/fakecept/fakecept.c +++ b/fakecept/fakecept.c @@ -4,18 +4,14 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "streamlib.h" #include "fakecept.h" #include "isdn_proto.h" diff --git a/fakeh/fakeh.c b/fakeh/fakeh.c index c462f08..21ff30a 100644 --- a/fakeh/fakeh.c +++ b/fakeh/fakeh.c @@ -6,19 +6,15 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif #include "f_ip.h" -#include #include "streamlib.h" #include "fakeh.h" #include "isdn_proto.h" diff --git a/include/Makefile b/include/Makefile index 929c70a..b8eb3ea 100644 --- a/include/Makefile +++ b/include/Makefile @@ -18,7 +18,7 @@ $(KERNELSRC)/include/linux/autoconf.h $(KERNELSRC)/include/linux/version.h: @exit 1 install:: - -mkdir -p /lib/modules/$(shell ../tools/getversion)/isdn + -mkdir -p $${MODDIR:-/lib/modules}/$(shell ../tools/getversion)/isdn -mkdir -p $(DESTDIR)/bin-$(shell ../tools/getversion) cp /dev/null /lib/modules/modules.isdn.all diff --git a/include/config.h b/include/config.h index 2dc3663..2ca9925 100644 --- a/include/config.h +++ b/include/config.h @@ -82,9 +82,9 @@ extern int writev(int fd, struct iovec *vp, int vpcount); #define ROUTE_PATH "/sbin/route" /* =()<#define LOCKNAME "@@">()= */ -#define LOCKNAME "/var/lock/uucp/LCK..%s" +#define LOCKNAME "/var/lock/LCK..%s" /* =()<#define ROOTUSER "@@">()= */ -#define ROOTUSER "isdnmaster" +#define ROOTUSER "smurf" #endif /* _CONFIG_H */ diff --git a/include/dump.h b/include/dump.h index f3d0f6f..7f19279 100644 --- a/include/dump.h +++ b/include/dump.h @@ -1,7 +1,7 @@ #ifndef _DUMP_H_ #define _DUMP_H_ -#include +#include "kernel.h" #include "isdn_23.h" #ifdef DEBUG diff --git a/include/isdn_12.h b/include/isdn_12.h index d6b85f8..ea80314 100644 --- a/include/isdn_12.h +++ b/include/isdn_12.h @@ -1,7 +1,11 @@ #ifndef _ISDN_12 #define _ISDN_12 +#ifdef __KERNEL__ +#include +#else #include +#endif #include "streams.h" /* diff --git a/include/isdn_2.h b/include/isdn_2.h index d5396f4..9d0cf59 100644 --- a/include/isdn_2.h +++ b/include/isdn_2.h @@ -2,8 +2,13 @@ #define _ISDN_2 #include "config.h" +#ifdef __KERNEL__ +#include +#include +#else #include #include +#endif #include "x75lib.h" #include "smallq.h" #include "isdn_limits.h" diff --git a/include/isdn_23.h b/include/isdn_23.h index f192417..cef4e95 100644 --- a/include/isdn_23.h +++ b/include/isdn_23.h @@ -1,7 +1,11 @@ #ifndef _ISDN_23 #define _ISDN_23 +#ifdef __KERNEL__ +#include +#else #include +#endif #include "config.h" /** diff --git a/include/isdn_3.h b/include/isdn_3.h index b716dd9..75ae439 100644 --- a/include/isdn_3.h +++ b/include/isdn_3.h @@ -1,8 +1,13 @@ #ifndef _ISDN_3 #define _ISDN_3 +#ifdef __KERNEL__ +#include +#include +#else #include #include +#endif #include "streams.h" #include "isdn_limits.h" #include "config.h" diff --git a/include/isdn_34.h b/include/isdn_34.h index 8a14b84..03d7a7d 100644 --- a/include/isdn_34.h +++ b/include/isdn_34.h @@ -1,8 +1,13 @@ #ifndef _ISDN_34 #define _ISDN_34 +#ifdef __KERNEL__ +#include +#include +#else #include #include +#endif #include "config.h" extern int log_34; diff --git a/include/kernel.h b/include/kernel.h index 319bade..3f073f6 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -7,7 +7,13 @@ #ifndef KERNEL #include #include +#include +#include +#include #include +#include +#include +#include extern int spl6 (void); extern int spl1 (void); @@ -45,6 +51,12 @@ extern void panic(const char *x, ...); #endif #include #include +#include +#include +#include +#include +#include + char *loghdr(char level); #undef KERN_EMERG #undef KERN_ALERT @@ -64,4 +76,9 @@ char *loghdr(char level); #define KERN_DEBUG loghdr(7) #endif + +#ifndef minor +#define minor(a) ((a)&0xFF) +#endif + #endif diff --git a/include/port_m.h b/include/port_m.h index f2de01f..4f1fddb 100644 --- a/include/port_m.h +++ b/include/port_m.h @@ -1,8 +1,7 @@ #ifndef _PORT_M #define _PORT_M -#include -#include +#include "kernel.h" #include "isdn_limits.h" #include "smallq.h" #include "msgtype.h" diff --git a/include/primitives.h b/include/primitives.h index aa49a99..ebe060b 100644 --- a/include/primitives.h +++ b/include/primitives.h @@ -7,8 +7,13 @@ #include "kernel.h" #include "msgtype.h" +#ifdef __KERNEL__ +#include +#include +#else #include #include +#endif #ifdef linux #include #ifdef KERNEL diff --git a/include/q_data.h b/include/q_data.h index f2a42fa..a48d995 100644 --- a/include/q_data.h +++ b/include/q_data.h @@ -1,8 +1,7 @@ #ifndef _Q_DATA #define _Q_DATA -#include -#include +#include "kernel.h" /** ** This module handles the data structure of additional information elements, diff --git a/include/smallq.h b/include/smallq.h index 15a0528..3d9e8d5 100644 --- a/include/smallq.h +++ b/include/smallq.h @@ -1,7 +1,7 @@ #ifndef __SMALLQ__ #define __SMALLQ__ -#include +#include "kernel.h" #include "streams.h" #include "config.h" diff --git a/include/streamlib.h b/include/streamlib.h index eb95b7e..5cc5fc2 100644 --- a/include/streamlib.h +++ b/include/streamlib.h @@ -13,11 +13,8 @@ * key-parameter-argument list for a nested command. */ -#include -#include +#include "kernel.h" #include "f_signal.h" -#include -#include #include "stropts.h" #include "streams.h" diff --git a/include/streams.h b/include/streams.h index f0a46a9..c8f02b2 100644 --- a/include/streams.h +++ b/include/streams.h @@ -1,8 +1,7 @@ #ifndef __STREAMS_H #define __STREAMS_H -#include -#include +#include "kernel.h" #if !(defined(__sys_stream_h) || defined(_SYS_STREAM_H) || defined(_LINUX_STREAM_H)) diff --git a/include/sys/callout.h b/include/sys/callout.h index 70797d5..d92cbab 100644 --- a/include/sys/callout.h +++ b/include/sys/callout.h @@ -1,7 +1,9 @@ #if !defined(__sys_callout_h) #define __sys_callout_h +#ifndef __KERNEL__ #include +#endif struct callout { int c_time; /* incremental time */ diff --git a/include/timeout.h b/include/timeout.h index 67290af..20f3a04 100644 --- a/include/timeout.h +++ b/include/timeout.h @@ -1,9 +1,7 @@ #ifndef __TIMEOUT #define __TIMEOUT -#include -#include -#include +#include "kernel.h" extern struct timeval callout_time; diff --git a/ip_mon/ip_mon.c b/ip_mon/ip_mon.c index 66e5578..ee9e14c 100644 --- a/ip_mon/ip_mon.c +++ b/ip_mon/ip_mon.c @@ -6,18 +6,14 @@ #include "f_module.h" #include "primitives.h" #include "f_ip.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "ip_mon.h" #include "streamlib.h" #include "isdn_proto.h" @@ -244,10 +240,14 @@ ip_mon_timer (struct _ip_mon *ipmon) { long s; - if (ipmon->timer == 0) + if (!ipmon->hastimer) return; if (ip_mon.qptr == NULL) { - ipmon->timer = 0; + ipmon->hastimer = 0; + return; + } + if (!ipmon->timer) { + ipmon->hastimer = 0; return; } @@ -268,7 +268,6 @@ ip_mon_open (queue_t * q, dev_t dev, int flag, int sflag ERR_DECL) { struct _ip_mon *ipmon; static int nr = 1; - int do_timeout = 1; dev = minor (dev); if (sflag == MODOPEN) { @@ -283,7 +282,6 @@ ip_mon_open (queue_t * q, dev_t dev, int flag, int sflag ERR_DECL) ERR_RETURN(-ENXIO); } else { ipmon = &ip_mon; - do_timeout = (ip_mon.qptr == NULL); } memset(ipmon,0,sizeof (*ipmon)); if (ipmon != &ip_mon) @@ -292,9 +290,9 @@ ip_mon_open (queue_t * q, dev_t dev, int flag, int sflag ERR_DECL) q->q_ptr = (char *) ipmon; ipmon->qptr = q; - ipmon->timer = 10; + ipmon->timer = dev ? 10 : 0; ipmon->each = 1; - if(do_timeout) { + if(ipmon->timer) { ipmon->hastimer = 1; #ifdef NEW_TIMEOUT ipmon->timeout = @@ -485,6 +483,7 @@ ip_mon_close (queue_t * q, int dummy) flushq (WR (q), FLUSHALL); printf ("IP_MON driver %d closed.\n", ipmon->nr); if (ipmon->hastimer) { + ipmon->hastimer = 0; #ifdef NEW_TIMEOUT untimeout (ipmon->timeout); #else diff --git a/ip_mon/tools/monitor.c b/ip_mon/tools/monitor.c index a098ac2..8f86dbb 100644 --- a/ip_mon/tools/monitor.c +++ b/ip_mon/tools/monitor.c @@ -6,9 +6,11 @@ #include #include "f_strings.h" #include +#if __GNU_LIBRARY__ - 0 < 6 #include -#include #include +#endif +#include #include #include #include diff --git a/isdn_2/isdn_2.c b/isdn_2/isdn_2.c index 6f60e39..966de49 100644 --- a/isdn_2/isdn_2.c +++ b/isdn_2/isdn_2.c @@ -17,23 +17,22 @@ #include "kernel.h" #include "primitives.h" #include "isdn_2.h" -#include #include "f_signal.h" #include "f_malloc.h" -#include #include "streams.h" #include "stropts.h" /* #ifdef DONT_ADDERROR */ #include "f_user.h" /* #endif */ -#include #ifndef __linux__ #include #include #endif -#include +#if 0 +#include #include #include +#endif #include "streamlib.h" #include "isdn_23.h" #include "isdn_12.h" @@ -43,7 +42,6 @@ #include "sapi.h" #include "isdn_limits.h" #include "isdn_proto.h" -#include ushort_t hdrseq = 1; @@ -1425,7 +1423,8 @@ do_chprot (isdn2_card ctl, short channel, mblk_t * proto, int flags) int err = 0; if (isdn2_debug & 0x4) - printf ("%sdo_chprot %d %d 0%o\n",KERN_DEBUG, ctl ? ctl->nr : -1, channel, flags); + printf ("%sdo_chprot %d %d 0%o: %p %d %p\n",KERN_DEBUG, ctl ? ctl->nr : -1, channel, flags, + ctl, channel, isdn_chan.qptr); if (ctl == NULL || (channel == 0 && isdn_chan.qptr == NULL)) return -ENXIO; if(flags & CHP_TOCARD) { @@ -1479,8 +1478,12 @@ do_chprot (isdn2_card ctl, short channel, mblk_t * proto, int flags) if(canput(isdn_chan.qptr->q_next)) { putnext (isdn_chan.qptr, mb); err = 0; - } else + } else { + if(isdn2_debug & 0x4) + printf("%sdo_chprot: MasterUpqueue full\n",KERN_DEBUG); + freeb(mb); err = -ENXIO; + } } else err = -EAGAIN; return err; @@ -2603,6 +2606,8 @@ isdn2_wsrv (queue_t *q) ismodlist = (id == PROTO_MODLIST); minor = hdr.hdr_protocmd.minor; + if (isdn2_debug & 0x10) + printk("%sMinorSet %d -> %d %d\n",KERN_DEBUG,minor,(isdnchan[minor]&&isdnchan[minor]->card)?isdnchan[minor]->card->nr:-1,isdnchan[minor]?isdnchan[minor]->channel:-1); if ((minor != 0) && (isdnchan[minor] != NULL) && (isdnchan[minor]->card != NULL)) { /* This is a temporary kludge */ hdr.hdr_protocmd.card = isdnchan[minor]->card->nr; diff --git a/isdn_3/capi.c b/isdn_3/capi.c index 73b95b5..08f4bbf 100644 --- a/isdn_3/capi.c +++ b/isdn_3/capi.c @@ -8,8 +8,7 @@ #include "q_data.h" #include "isdn_23.h" #include "isdn3_phone.h" -#include -#include +#include "kernel.h" #include "prot_1TR6_0.h" #include "prot_1TR6_1.h" #include "prot_ETS.h" @@ -19,7 +18,9 @@ #include "isdn_12.h" #include "asm/byteorder.h" #include "sapi.h" +#ifndef __KERNEL__ #include +#endif #define PPP_IP_VANJ CHAR2('i','v') #define PPP_IP CHAR2('i','n') diff --git a/isdn_3/fixed.c b/isdn_3/fixed.c index 6f25a35..a0f4e85 100644 --- a/isdn_3/fixed.c +++ b/isdn_3/fixed.c @@ -6,9 +6,7 @@ #include "isdn_proto.h" #include "lap.h" #include "dump.h" -#include -#include -#include +#include "kernel.h" #include "sapi.h" #define ST_up 01 diff --git a/isdn_3/isdn_3.c b/isdn_3/isdn_3.c index abdb96e..027b265 100644 --- a/isdn_3/isdn_3.c +++ b/isdn_3/isdn_3.c @@ -4,18 +4,14 @@ **/ #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "kernel.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "streamlib.h" #include "isdn_23.h" #include "isdn_3.h" diff --git a/isdn_3/phone.c b/isdn_3/phone.c index 84bfa78..0878189 100644 --- a/isdn_3/phone.c +++ b/isdn_3/phone.c @@ -8,8 +8,7 @@ #include "q_data.h" #include "isdn_23.h" #include "isdn3_phone.h" -#include -#include +#include "kernel.h" #include "prot_1TR6_0.h" #include "prot_1TR6_1.h" #include "prot_ETS.h" diff --git a/isdn_3/prot_1TR6_0.c b/isdn_3/prot_1TR6_0.c index 5b3d167..c04c544 100644 --- a/isdn_3/prot_1TR6_0.c +++ b/isdn_3/prot_1TR6_0.c @@ -5,8 +5,7 @@ #include "q_data.h" #include "isdn_23.h" #include "isdn3_phone.h" -#include -#include +#include "kernel.h" #include "prot_1TR6_0.h" #include "prot_1TR6_common.h" #include "sapi.h" diff --git a/isdn_3/prot_1TR6_1.c b/isdn_3/prot_1TR6_1.c index 383964a..de1bd8c 100644 --- a/isdn_3/prot_1TR6_1.c +++ b/isdn_3/prot_1TR6_1.c @@ -6,8 +6,7 @@ #include "isdn_23.h" #include "isdn3_phone.h" #include "isdn_34.h" -#include -#include +#include "kernel.h" #include "prot_1TR6_1.h" #include "prot_1TR6_common.h" #include "sapi.h" diff --git a/isdn_3/prot_1TR6_common.h b/isdn_3/prot_1TR6_common.h index 050e97b..6c3d0fa 100644 --- a/isdn_3/prot_1TR6_common.h +++ b/isdn_3/prot_1TR6_common.h @@ -1,6 +1,6 @@ #ifndef _1TR6_COMMON #define _1TR6_COMMON -#include +#include "kernel.h" #include "streams.h" #include "phone_1TR6.h" #include "q_data.h" diff --git a/isdn_3/prot_ETS.c b/isdn_3/prot_ETS.c index 2521de7..f7bef40 100644 --- a/isdn_3/prot_ETS.c +++ b/isdn_3/prot_ETS.c @@ -6,9 +6,7 @@ #include "isdn_23.h" #include "isdn3_phone.h" #include "isdn_34.h" -#include -#include -#include +#include "kernel.h" #include "q_data.h" #include "phone_ETSI.h" #include "sapi.h" diff --git a/isdn_3/tei.c b/isdn_3/tei.c index 645ebc5..3a678bd 100644 --- a/isdn_3/tei.c +++ b/isdn_3/tei.c @@ -5,9 +5,7 @@ #include "isdn_34.h" #include "lap.h" #include "dump.h" -#include -#include -#include +#include "kernel.h" #include #include "sapi.h" diff --git a/isdn_4/Makefile b/isdn_4/Makefile index c6c1d7b..76903e4 100644 --- a/isdn_4/Makefile +++ b/isdn_4/Makefile @@ -1,7 +1,7 @@ PROGRAM = master EXTRA_LIBS=../isdn_3.a ../support.a EXTRA_CFLAGS=$(addsuffix _,$(addprefix -D_,$(PROTOCOLS) $(SUBPROTOCOLS))) -EXTRA_LDFLAGS=-static +#EXTRA_LDFLAGS=-static TOPDIR=.. include $(TOPDIR)/Make.rules diff --git a/isdn_4/cf.c b/isdn_4/cf.c index 3eadec9..dfe714c 100644 --- a/isdn_4/cf.c +++ b/isdn_4/cf.c @@ -140,6 +140,8 @@ read_file (FILE * ffile, char *errf) char *li = (char *) (c + 1); switch (CHAR2 (li[0], li[1])) { + case CHAR2 ('M', 'O'): + continue; case CHAR2 ('P', ' '): case CHAR2 ('P', '_'): case CHAR2 ('P', '\t'): diff --git a/isdn_4/master.c b/isdn_4/master.c index 9064296..a517e2c 100644 --- a/isdn_4/master.c +++ b/isdn_4/master.c @@ -8,6 +8,12 @@ #define MASTER_MAIN #include "master.h" +#include + +#if __GNU_LIBRARY__ - 0 == 6 /* NOCH notwendig, fehlt in glibc */ +#include +_syscall1(int,mlockall,int,what); +#endif int main (int argc, char *argv[]) @@ -19,11 +25,9 @@ main (int argc, char *argv[]) int pushlog = 0; int debug = 0; int x; + + mlockall(MCL_CURRENT | MCL_FUTURE); -#ifdef linux - reboot(0xfee1dead,0x17392634,1); /* Magic to make me nonswappable */ - /* TODO: 1.3.xx kernel / libc: use appropriate system call */ -#endif #ifdef DO_DEBUG_MALLOC mcheck(NULL); mmtrace(); @@ -233,6 +237,8 @@ main (int argc, char *argv[]) xquit ("Open Dev", devnam); if (ioctl (fd_mon, I_SRDOPT, RMSGN) < 0) /* Message mode */ xquit ("SetStrOpt", ""); + if (ioctl (fd_mon, I_PUSH, "buffer") < 0) + syslog(LOG_WARNING,"Buffer module not found -- unreliable"); if (pushlog & 2) if (ioctl (fd_mon, I_PUSH, "strlog") < 0) diff --git a/isdn_4/master.h b/isdn_4/master.h index 64a3ad4..c81ff15 100644 --- a/isdn_4/master.h +++ b/isdn_4/master.h @@ -45,7 +45,7 @@ #include "isdn_proto.h" #include "wildmat.h" #include "vectcmp.h" -#ifdef linux +#if 0 /* def linux */ #include #endif #if LEVEL < 4 diff --git a/ksupport/count.c b/ksupport/count.c index 108f378..f8a47c6 100644 --- a/ksupport/count.c +++ b/ksupport/count.c @@ -3,16 +3,13 @@ #include "f_module.h" #include "primitives.h" -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "streams.h" #include "streamlib.h" diff --git a/ksupport/log.c b/ksupport/log.c index 4a8e0ab..519fb05 100644 --- a/ksupport/log.c +++ b/ksupport/log.c @@ -3,22 +3,19 @@ #include "f_module.h" #include "primitives.h" -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include #include "stropts.h" #ifdef DO_ADDUSER #include "f_user.h" #endif -#include #include "streams.h" #include "streamlib.h" #ifdef AUX #include #endif -#include #ifndef linux #include #include @@ -26,8 +23,10 @@ #include #endif #endif +#ifndef __KERNEL__ +#include #include -#include "kernel.h" +#endif #define MAXB 100 diff --git a/ksupport/logh.c b/ksupport/logh.c index 0ad5115..255555c 100644 --- a/ksupport/logh.c +++ b/ksupport/logh.c @@ -3,10 +3,14 @@ #include "f_module.h" #include "primitives.h" +#ifdef __KERNEL__ +#include +#else #include +#include +#endif #include "f_signal.h" #include "f_malloc.h" -#include #include "streams.h" #include "stropts.h" #include "streamlib.h" diff --git a/ksupport/proto.c b/ksupport/proto.c index 964f967..7863d4f 100644 --- a/ksupport/proto.c +++ b/ksupport/proto.c @@ -3,15 +3,11 @@ #include "f_module.h" #include "primitives.h" #include "f_malloc.h" -#include -#include +#include "kernel.h" #include "f_signal.h" -#include -#include #include "stropts.h" #include "f_user.h" -#include -#include +#include "f_termio.h" #ifndef linux #include #endif diff --git a/ksupport/qinfo.c b/ksupport/qinfo.c index ec35d86..1e8767e 100644 --- a/ksupport/qinfo.c +++ b/ksupport/qinfo.c @@ -3,19 +3,14 @@ #include "f_module.h" #include "primitives.h" -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include #include "streams.h" #include "stropts.h" #include "f_user.h" -#include #include "streamlib.h" #include "isdn_proto.h" -#ifndef KERNEL -#include "kernel.h" -#endif #define MAXB 10 diff --git a/ksupport/smallq.c b/ksupport/smallq.c index 72015c3..903a55d 100644 --- a/ksupport/smallq.c +++ b/ksupport/smallq.c @@ -1,12 +1,9 @@ #include "f_module.h" #include "primitives.h" -#include #include "smallq.h" #include "streams.h" #include "streamlib.h" -#ifndef KERNEL #include "kernel.h" -#endif /**** extremely simple queue handling ****/ #define LI 0 diff --git a/ksupport/streamlib.c b/ksupport/streamlib.c index 0eb5b30..53cf6e3 100644 --- a/ksupport/streamlib.c +++ b/ksupport/streamlib.c @@ -5,9 +5,9 @@ #include "primitives.h" #include "kernel.h" #include "streamlib.h" -#include +#ifndef __KERNEL__ #include -#include +#endif #include "isdn_proto.h" #include "isdn_limits.h" #include "msgtype.h" @@ -155,13 +155,10 @@ dsize (mblk_t * mp) /** - * pullupmsg + * pullupm * * Concatenate the first n bytes of a message. * - * Note that the caller is responsible for checking that a long-enough - * message is returned. - * * This code returns NULL if the length is zero and the message is empty. */ #ifdef CONFIG_DEBUG_STREAMS @@ -171,6 +168,7 @@ mblk_t *pullupm(mblk_t *p_msg, short length) #endif { mblk_t *p_newmsg; + short offset = 0; if(p_msg == NULL) return NULL; @@ -188,22 +186,26 @@ mblk_t *pullupm(mblk_t *p_msg, short length) return NULL; #endif } - if(length == 0 && p_msg->b_cont == NULL && p_msg->b_rptr >= p_msg->b_wptr) { - freeb(p_msg); - return NULL; - } - if (length == 0 || p_msg->b_cont == NULL) + if((length == 0) && (p_msg->b_cont == NULL)) { + if (p_msg->b_rptr >= p_msg->b_wptr) { + freeb(p_msg); + return NULL; + } return p_msg; - if(length < 0) + } + if(length < 0) { + offset = -length; length = msgsize(p_msg); - if (p_msg->b_wptr - p_msg->b_rptr >= length) + } + if ((p_msg->b_wptr - p_msg->b_rptr >= length) && (DATA_START(p_msg)+offset <= p_msg->b_rptr)) return p_msg; - if ((p_newmsg = allocb(length, BPRI_MED)) == NULL) { - return p_msg; - } + if ((p_newmsg = allocb(offset+length, BPRI_MED)) == NULL) + return NULL; DATA_TYPE(p_newmsg) = DATA_TYPE(p_msg); + p_newmsg->b_rptr += offset; + p_newmsg->b_wptr = p_newmsg->b_rptr; /* * Copy the data. @@ -241,6 +243,76 @@ mblk_t *pullupm(mblk_t *p_msg, short length) +/** + * embedm + * + * Concatenate the first n bytes of a message. + * + * This code returns NULL if the length is zero and the message is empty. + */ +#ifdef CONFIG_DEBUG_STREAMS +mblk_t *deb_embedm(const char *deb_file, unsigned int deb_line, mblk_t *p_msg, short offstart, short offend) +#else +mblk_t *embedm(mblk_t *p_msg, short offstart, short offend) +#endif +{ + mblk_t *p_newmsg; + int length; + + if(p_msg == NULL) + return NULL; + +#ifdef CONFIG_DEBUG_STREAMS + if(deb_msgdsize(deb_file,deb_line,p_msg) < 0) + return NULL; +#endif + while(p_msg != NULL && p_msg->b_rptr >= p_msg->b_wptr && p_msg->b_cont != NULL) { + mblk_t *p_temp = p_msg->b_cont; + freeb(p_msg); + p_msg = p_temp; +#ifdef CONFIG_DEBUG_STREAMS + if(msgdsize(p_msg) < 0) + return NULL; +#endif + } + length = msgsize(p_msg); + + if ((p_newmsg = allocb(offstart+length+offend, BPRI_MED)) == NULL) + return NULL; + + DATA_TYPE(p_newmsg) = DATA_TYPE(p_msg); + p_newmsg->b_rptr += offstart; + p_newmsg->b_wptr = p_newmsg->b_rptr; + + /* + * Copy the data. + */ + while (length > 0 && p_msg != NULL) { +#ifdef CONFIG_DEBUG_STREAMS + if(msgdsize(p_msg) < 0) + return NULL; +#endif + if(p_msg->b_wptr > p_msg->b_rptr) { + short n = min(p_msg->b_wptr - p_msg->b_rptr, length); + memcpy(p_newmsg->b_wptr, p_msg->b_rptr, n); + p_newmsg->b_wptr += n; + p_msg->b_rptr += n; + length -= n; + if (p_msg->b_rptr != p_msg->b_wptr) + break; + } + { mblk_t *p_cont; + p_cont = p_msg->b_cont; + freeb(p_msg); + p_msg = p_cont; + } + } + freeb(p_msg); + return p_newmsg; +} + + + #ifdef CONFIG_DEBUG_STREAMS void deb_putbqff(const char *deb_file,unsigned int deb_line, queue_t * q, mblk_t * mp) diff --git a/ksupport/x75lib.c b/ksupport/x75lib.c index 4eb3553..e9f279b 100644 --- a/ksupport/x75lib.c +++ b/ksupport/x75lib.c @@ -1,7 +1,7 @@ #include "f_module.h" #include "primitives.h" #include "streams.h" -#include +#include "kernel.h" #ifndef linux #include #endif diff --git a/pr_on/pr_on.c b/pr_on/pr_on.c index 04dca85..18cef78 100644 --- a/pr_on/pr_on.c +++ b/pr_on/pr_on.c @@ -3,15 +3,11 @@ #include "f_module.h" #include "primitives.h" -#include -#include -#include -#include +#include "kernel.h" #include "streams.h" #include "stropts.h" #include "f_user.h" #include "f_malloc.h" -#include #include "streamlib.h" #include "isdn_proto.h" #include "msgtype.h" diff --git a/rate/rate.c b/rate/rate.c index f024e75..9d5e17c 100644 --- a/rate/rate.c +++ b/rate/rate.c @@ -4,18 +4,14 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "streamlib.h" #include "rate.h" #include "isdn_proto.h" diff --git a/reconnect/reconnect.c b/reconnect/reconnect.c index d566546..4fa4f0a 100644 --- a/reconnect/reconnect.c +++ b/reconnect/reconnect.c @@ -4,18 +4,14 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "streamlib.h" #include "reconnect.h" #include "isdn_proto.h" diff --git a/str_if/str_if.h b/str_if/str_if.h index 30f2de3..26cad62 100644 --- a/str_if/str_if.h +++ b/str_if/str_if.h @@ -1,8 +1,7 @@ #ifndef _STR_IF_H #define _STR_IF_H -#include -#include +#include "kernel.h" #include "primitives.h" #ifndef SIOCGETU diff --git a/str_if/str_in.c b/str_if/str_in.c index 222cca6..df698bf 100644 --- a/str_if/str_in.c +++ b/str_if/str_in.c @@ -15,7 +15,7 @@ #define DOT -> #endif -#include +#include "kernel.h" #define NSTR 8 @@ -25,7 +25,6 @@ #include #endif -#include #ifdef DONT_ADDERROR #include "f_user.h" #endif @@ -45,10 +44,8 @@ #endif #include #include -#include #include "f_ioctl.h" #include -#include #include "str_if.h" #include "streamlib.h" diff --git a/str_if/str_linux.c b/str_if/str_linux.c index 2234cf5..33b620e 100644 --- a/str_if/str_linux.c +++ b/str_if/str_linux.c @@ -15,33 +15,28 @@ #include "f_module.h" -#define UNREGISTER /* does seem to work */ +#undef UNREGISTER /* not! */ #include "primitives.h" #include "f_ip.h" #include "f_malloc.h" #include "ppp.h" -#include +#include "kernel.h" #define NSTR 8 #include "primitives.h" #include "streams.h" #include "stropts.h" -#include +#include #include #include -#include #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include -#include #include "f_ioctl.h" -#include -#include #include "str_if.h" #include "streamlib.h" diff --git a/str_if/tools/slipto.c b/str_if/tools/slipto.c index aaf2395..596d2ce 100644 --- a/str_if/tools/slipto.c +++ b/str_if/tools/slipto.c @@ -159,8 +159,8 @@ enable (void) #ifdef ROUTE_IF if(!dontroutemyhost) - sprintf(makeroute+strlen(makeroute), "%s add -host %s metric 2 dev lo; ", ROUTE_PATH,ichaddr); - sprintf(makeroute+strlen(makeroute), "%s add -host %s metric 2 gw %s dev %s; ", ROUTE_PATH,duaddr,ichaddr,ifname); + sprintf(makeroute+strlen(makeroute), "%s add -host %s metric 2 dev %s; ", ROUTE_PATH,ichaddr,ifname); + sprintf(makeroute+strlen(makeroute), "%s add -host %s metric 2 " /* "gw %s" */ " dev %s; ", ROUTE_PATH,duaddr, /* ichaddr, */ ifname); if(arpaddr != NULL) sprintf(makeroute+strlen(makeroute), "%s -s %s %s pub; ", ARP_PATH,duaddr,arpaddr); diff --git a/streams/stream.h b/streams/stream.h index 584fd74..c50b2d4 100644 --- a/streams/stream.h +++ b/streams/stream.h @@ -1,8 +1,7 @@ #if !defined(_LINUX_STREAMS_H) #define _LINUX_STREAMS_H -#include -#include +#include "kernel.h" #include "compat.h" #include "stropts.h" #ifdef __KERNEL__ diff --git a/strslip/strslip.c b/strslip/strslip.c index def1653..c24616b 100644 --- a/strslip/strslip.c +++ b/strslip/strslip.c @@ -3,16 +3,12 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" /* #include */ -#include #include "streamlib.h" #include "alaw.h" #include "isdn_proto.h" diff --git a/support/malloc.o b/support/malloc.o deleted file mode 100644 index 7ccdc336a8d66ee889c3d9076440eb7ae14e251e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12252 zcma)?3v^pYnaAhKPH;Qvlvn4h2L|Bg~Z{p3rvJ9qT!f1Mhvs|;Q^d`@71vBkqzqQ&WNLwWLh zwNvdECTEscPEP*u!gR;{lc#H}OVD=Plc%-vxykDv^S{J5UHWc>6tyPES@uzA&d#QDGfA4S?RH_CJk5Y?wqQz8ArIvd;5v!fAyz>731&8O!!tpCI zQ-c>WmHvfiF6W-)f0>i9g+iQ+)eRy+;beSOJ>hh$emXt(p4-jJOSe7c(#QNU`KfZ9 zGmWK3zJ#H7OLHs7*Ui`Pl#a|;%f2CMh1l?9h7$W-cd8%_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include "kernel.h" #ifdef linux #include #endif diff --git a/support/streams.c b/support/streams.c index 0751617..dff0515 100644 --- a/support/streams.c +++ b/support/streams.c @@ -1,17 +1,14 @@ #include "primitives.h" #include "kernel.h" -#include -#include #include "f_signal.h" #include "stropts.h" #include "f_termio.h" #include "f_user.h" -#include -#include #include "streams.h" #include "streamlib.h" #include "string.h" #define NDEBUG +#include #include #ifndef ASSERT #define ASSERT(x) assert(x) diff --git a/t70/t70.c b/t70/t70.c index 4c1387a..0ee6975 100644 --- a/t70/t70.c +++ b/t70/t70.c @@ -4,18 +4,14 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "streamlib.h" #include "t70.h" #include "isdn_proto.h" diff --git a/timer/timer.c b/timer/timer.c index f251b44..6a1fb08 100644 --- a/timer/timer.c +++ b/timer/timer.c @@ -4,18 +4,14 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "streamlib.h" #include "timer.h" #include "isdn_proto.h" diff --git a/tools/Makefile b/tools/Makefile index 43cc808..71cae3d 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -6,20 +6,26 @@ NOCLEAN = catfone all:: install:: - @if test ! -f /etc/isdn.conf; then \ - echo install isdn.conf /etc ; \ - install isdn.conf /etc ; \ + @if test ! -f /etc/isdn.conf; then \ + echo install isdn.conf /etc ; \ + install isdn.conf /etc ; \ fi - @if test -d /etc/rc.d ; then \ - if test ! -f /etc/rc.d/rc.isdn ; then \ - echo install rc.isdn /etc/rc.d ; \ - install rc.isdn /etc/rc.d; \ - fi; \ - else \ - if test ! -f /etc/rc.isdn ; then \ - echo install rc.isdn /etc ; \ - install rc.isdn /etc; \ - fi; \ + @if test -d /sbin/init.d/scripts ; then \ + echo "*** /sbin/init.d/scripts/uisdn ***"; \ + install rc.isdn /sbin/init.d/scripts/uisdn ; \ + install rc.isdnmon /sbin/init.d/scripts/uisdnmon ; \ + elif test -d /sbin/init.d; then \ + echo "*** /sbin/init.d/isdn ***"; \ + install rc.isdn /sbin/init.d/isdn ; \ + install rc.isdnmon /sbin/init.d/isdnmon ; \ + elif test -d /etc/rc.d ; then \ + echo "*** /etc/rc.d/rc.isdn ***"; \ + install rc.isdn /etc/rc.d; \ + install rc.isdnmon /etc/rc.d; \ + else \ + echo "*** /etc/rc.isdn ***"; \ + install rc.isdn /etc; \ + install rc.isdnmon /etc; \ fi include $(TOPDIR)/Make.rules diff --git a/tools/d_insmod b/tools/d_insmod index 974d7bb..d565649 100644 --- a/tools/d_insmod +++ b/tools/d_insmod @@ -6,7 +6,8 @@ FILE=$1 VERSION=${VERSION:-$(${TOPDIR}/tools/getversion)} -dir=/lib/modules/$VERSION +MODDIR=${MODDIR:-/lib/modules} +dir=${MODDIR}/$VERSION echo isdn/d_$FILE >>$dir/../modules.isdn.all rm -f $dir/isdn/d_$FILE ( diff --git a/tools/insmod b/tools/insmod index f827c30..27ce03d 100755 --- a/tools/insmod +++ b/tools/insmod @@ -6,7 +6,8 @@ FILE=$1 VERSION=${VERSION:-$(${TOPDIR}/tools/getversion)} -dir=/lib/modules/$VERSION +MODDIR=${MODDIR:-/lib/modules} +dir=${MODDIR}/$VERSION echo isdn/$FILE >>$dir/../modules.isdn.all rm -f $dir/isdn/$FILE ( diff --git a/tools/isdn.conf b/tools/isdn.conf index 22ff832..cb0a465 100644 --- a/tools/isdn.conf +++ b/tools/isdn.conf @@ -127,16 +127,6 @@ LF Bin? 4000 3 /etc/isdn/bri.68k #DL * Tel0 - :pr 64 -## The following is a complete example on how to do a leased line. -# -#P tcp foo * Tel0 RXf :dI :bc 1 :Ft -#ML tcp foo * Tel0 -,3 frame xstrlog fakeh reconn str_if -#MP tcp foo * Tel0 - proto :sg 1 :ca 1 :bk 0 :on -#R tcp foo * Tel0 root RUBf slipto -d 10.1.1.1 10.1.1.2 -#D * foo * Tel0 f - -#DL * Tel0 - :pr 64 - - ### Tarifzonen sind was Doofes... # Um diese Daten zu nutzen, muss in der betreffenden P-Zeile # als Key mindestens ein A bis J stehen (Entfernung des Rechners) diff --git a/tools/rc.isdn b/tools/rc.isdn index 93e7f36..1374482 100755 --- a/tools/rc.isdn +++ b/tools/rc.isdn @@ -1,22 +1,57 @@ #!/bin/sh -set -e -PATH=/usr/local/isdn/bin-$(uname -r):/usr/local/isdn/bin:/usr/sbin:/sbin:/usr/lcoal/bin:/usr/bin:/bin +## =()@>()= +DESTDIR=/usr/lib/isdn +## =()@>()= +LOCKNAME=/var/lock -if [ "$1" = "off" ] ; then +set -e + +. /etc/rc.config + +if [ "$1" = "config" ] ; then # smurfsche Spezialitäten + cat <<'END' >/tmp/cf.$$ +# +## welcher ISDN-Treiber? uisdn, i4l, off +# +ISDN=uisdn +END + fillup /etc/rc.config /tmp/cf.$$ + rm /tmp/cf.$$ + cd /sbin/init.d/rc2.d + ln -sf ../scripts/uisdn S18uisdn + ln -sf ../scripts/uisdn K18uisdn + cd /sbin/init.d/rc3.d + ln -sf ../scripts/uisdn S18uisdn + ln -sf ../scripts/uisdn K18uisdn + exit 0 +fi + +if [ "$ISDN" != "uisdn" ] ; then exit 0; fi + +PATH=${DESTDIR}/bin-$(uname -r):${DESTDIR}/bin:$PATH + +if [ "$1" = "off" -o "$1" = "stop" ] ; then trap '' 1 2 15 - killall rc.isdn || true echo -n "Killing the ISDN server ... " - if killall master ; then - sleep 10 - killall -9 master || true + if test -f /var/run/isdn.pid ; then + read pid < /var/run/isdn.pid + rm /var/run/isdn.pid + fi + pf=$(echo $LOCKNAME | sed -e 's/%s/isdn0/') + if test -f $pf ; then + read pid <$pf + if kill $pid ; then + sleep 10 + kill -9 $pid || true + fi + rm -f $pf fi echo -n "find modules ..." - while read a b c d ; do - case "$a" in - \#*) ;; - *) + while read x a b c d ; do + case "$x" in + MO*) if [ "x$a" = "x-o" ] ; then mod=$b elif [ "x$b" = "x-o" ] ; then @@ -27,40 +62,40 @@ if [ "$1" = "off" ] ; then mods="$mod $mods" ;; esac - done < /lib/modules/modules.isdn + done < /etc/isdn.conf echo "" echo rmmod $mods exec rmmod $mods exit 0 fi +if test -d /lib/gnu; then + export LD_LIBRARY_PATH=/lib/gnu +fi + +echo $$ > /var/run/isdn.pid if lsmod | grep isdn_2 >/dev/null 2>&1 ; then : ; else cd /lib/modules/$(uname -r) - if test -f symbols.isdn ; then mv symbols.isdn symbols.isdn.old ; fi - while read a ; do - case "$a" in - \#*) ;; - *) + if test -f /tmp/symbols.isdn ; then mv /tmp/symbols.isdn /tmp/symbols.isdn.old ; fi + while read x a ; do + case "$x" in + MO*) /bin/echo -n "\rISDN Modules: " >&2 /bin/echo -n "\rISDN Modules: $a: " >&2 eval "insmod -m $a" ## wegen name=$(cardname Foo0) in $a ;; esac - done < ../modules.isdn > symbols.isdn + done < /etc/isdn.conf > /tmp/symbols.isdn /bin/echo "\rISDN Modules...done. " fi -cd /var/tmp -## /usr might be write protected and the debugging person -# might want to have coredumps. So I provide them. +cd /var/tmp # for coredumps... ulimit -c 40000 # ulimit -d 20000 -# monitor -b >>/var/log/acct/ip & - set +e -while : ; do +while test -f /var/run/isdn.pid ; do master -wd /etc/isdn.conf 2>>/tmp/isdn.log >>/var/log/isdn sleep 5 done & diff --git a/v110/v110.c b/v110/v110.c index f9794ec..1c88354 100644 --- a/v110/v110.c +++ b/v110/v110.c @@ -8,18 +8,14 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "streamlib.h" #include "v110.h" #include "isdn_proto.h" diff --git a/van_j/compress.h b/van_j/compress.h index 3676f61..18defa0 100644 --- a/van_j/compress.h +++ b/van_j/compress.h @@ -3,8 +3,7 @@ #ifndef _COMPRESS #define _COMPRESS -#include -#include +#include "kernel.h" #include "streams.h" #include "f_ip.h" #include "vanj.h" @@ -13,7 +12,7 @@ /* * Definitions for tcp compression routines. * - * $Header: slcompress.h,v 1.10 89/12/31 08:53:02 van Exp $ + * $Header: /usr/src/cvs/kernel/isdn/van_j/compress.h,v 1.1.1.1 1996/07/29 07:09:09 smurf Exp $ * * Copyright (c) 1989 Regents of the University of California. All rights * reserved. diff --git a/van_j/van_j.c b/van_j/van_j.c index 8379a81..64d2b1e 100644 --- a/van_j/van_j.c +++ b/van_j/van_j.c @@ -5,17 +5,13 @@ #include "f_ip.h" #include "f_malloc.h" #include "ppp.h" -#include -#include +#include "kernel.h" #include "f_signal.h" -#include -#include #include "streams.h" #include "stropts.h" #ifdef DONT_ADDERROR #include "f_user.h" #endif -#include #include "vanj.h" #include "van_j.h" #include "compress.h" diff --git a/x75/x75.c b/x75/x75.c index 7144c9b..070140c 100644 --- a/x75/x75.c +++ b/x75/x75.c @@ -10,14 +10,10 @@ #include "f_module.h" #include "primitives.h" -#include -#include +#include "kernel.h" #include "f_signal.h" #include "f_malloc.h" -#include -#include #include "streams.h" -#include #ifdef DONT_ADDERROR #include "f_user.h" #endif