diff -ur --new-file old/atm/BUGS new/atm/BUGS --- old/atm/BUGS Wed Jul 31 11:24:48 1996 +++ new/atm/BUGS Mon Sep 2 20:19:59 1996 @@ -1,18 +1,16 @@ -Known bugs and restrictions in version 0.15 +Known bugs and restrictions in version 0.17 =========================================== IP over ATM ----------- - - atmarpd seems to leak memory - kernel crashes badly if (remote) ARP server is set to local machine - clients don't always refresh their entry at ARP server (fixed ?) - - ARP timers are too short and should be different for client and server - IP interfaces must not be reconfigured while up - - requires local ATM address to be set on interface 0 on startup + - requires local ATM address to be set on interface 0 on startup (fixed ?) - encapsulation is broken (but works good enough for now) - atmarpd may not recover properly from link failures (but a resolution - request or such usually cures that) + request or such usually cures that) (fixed ?) - atmarpd shouldn't invalidate entries on the first timeout in valid state but rather try one revalidation request first - CLIP (the old way of doing IP over ATM) isn't tested @@ -22,7 +20,6 @@ Signaling --------- - - atmsigd appears to leak memory - never initiates a RESTART procedure - doesn't implement T322 (i.e. STATUS ENQUIRY is not retried) - atmsigd sometimes terminates ungracefully when encountering errors in @@ -30,9 +27,8 @@ - no support for repeated information elements - there's currently no way to obtain SVC traffic parameters indicated by the remote party - - atmsigd is reported to leak memory - SSCOP doesn't update the window properly - - data retrieval is broken in SSCOP + - data retrieval is broken in SSCOP (but that doesn't affect the UNI) ENI-155p driver --------------- @@ -74,7 +70,6 @@ - polled devices are broken as designed (and will eventually go away ...) - some system calls don't return full SVC SAP information - poor integration with other network code - - buffer quotas/limits don't work yet Miscellaneous ------------- diff -ur --new-file old/atm/CHANGES new/atm/CHANGES --- old/atm/CHANGES Thu Aug 29 17:14:02 1996 +++ new/atm/CHANGES Mon Sep 2 19:01:44 1996 @@ -1,3 +1,49 @@ +Version 0.16 to 0.17 (2-SEP-1996) +==================== + +Bug fixes +--------- + + - lib/diag.c didn't fflush when logging to a file + - arequipad didn't accept the -l option + - qgen: possible weird crashes because second.c:find_required accessed + value->tag even if vt_id + - qgen: fixed wrong PC indication in one error message in _q_parse + - make spotless didn't know about new $(*PGMS) targets + - atmsigd: fixed memory leak when sending messages to the kernel + - atmarpd: fixed memory leak when sending messages to the network + - atmsigd: didn't send final as_close when kernel closed connection + immediately after requesting it (as_connect) + - several minor corrections + +New features +------------ + + - added make target "uninstall" to remove all files installed by + make install + - atmsigd has two new options: -D dump_dir to set the dump directory and + -t trace_length to set the length of the trace buffer + - wrote a few man pages: atmarp.8, atmarpd.8, atmsigd.8, atmsigd.conf.4 + - added automatic support for memory debugging if MPR is installed (and + included a patch to make MPR 1.1 work with ELF). atmarpd and atmsigd + currently use this feature. + +Other changes +------------- + + - changed "class" to "traffic_class" everywhere + - make install is now implemented in a more elegant way + - q.dump is now much better at finding symbolic names for numbers + - q.dump no longer prints zero-length fields + - qgen no longer includes constructor "microcode" in dumper + - atmarp now gives more informative error messages on ioctl failure + - removed obsolete ioctls SIOCGIFATMADDR and SIOCSIFATMADDR + - added hack to allow ilmid to be less hostile to locally configured addresses + (by Gerald Hanusch; with slight modifications) + - atmarpd now automatically sets ATF_PERM of PVC entries with NULL + encapsulation + + Version 0.15 to 0.16 (29-AUG-1996) ==================== diff -ur --new-file old/atm/Makefile new/atm/Makefile --- old/atm/Makefile Wed Aug 28 11:48:46 1996 +++ new/atm/Makefile Fri Aug 30 19:57:49 1996 @@ -9,6 +9,9 @@ install: for n in $(DIRS); do $(MAKE) -C $$n install || exit; done +uninstall: + for n in $(DIRS); do $(MAKE) -C $$n uninstall || exit; done + depend: for n in $(DIRS); do $(MAKE) -C $$n depend || exit; done diff -ur --new-file old/atm/README new/atm/README --- old/atm/README Wed Aug 21 11:32:26 1996 +++ new/atm/README Mon Sep 2 17:44:17 1996 @@ -1,4 +1,4 @@ -ATM on Linux, release 0.16 (pre-alpha) by Werner Almesberger, EPFL LRC +ATM on Linux, release 0.17 (pre-alpha) by Werner Almesberger, EPFL LRC ====================================== werner.almesberger@lrc.di.epfl.ch This is experimental software. There are known major bugs and certainly diff -ur --new-file old/atm/Rules.make new/atm/Rules.make --- old/atm/Rules.make Mon Aug 5 14:16:39 1996 +++ new/atm/Rules.make Mon Sep 2 19:42:16 1996 @@ -27,7 +27,18 @@ INSTSYSBIN=$(INSTPREFIX)/sbin INSTLIB=$(INSTROOT)/usr/lib INSTHDR=$(INSTROOT)/usr/include -INSTMAN=$(INSTPREFIX)/man/man8 +INSTMAN=$(INSTPREFIX)/man +INSTMAN1=$(INSTMAN)/man1 +INSTMAN4=$(INSTMAN)/man4 +INSTMAN8=$(INSTMAN)/man8 + +# +# Enable memory debugging if MPR is installed +# +ifeq (/usr/lib/libmpr.a,$(wildcard /usr/lib/libmpr.a)) +CFLAGS += -DMEM_DEBUG +LDLIBS += -lmpr +endif LINK.c = $(CC) $(LDFLAGS) @@ -46,24 +57,30 @@ touch .checker install: - @for n in $(BOOTPGMS); do \ - echo install -c -m 0755 $$n $(INSTBOOTBIN); \ - install -c -m 0755 $$n $(INSTBOOTBIN) || exit; done - @for n in $(SYSPGMS); do \ - echo install -c -m 0755 $$n $(INSTSYSBIN); \ - install -c -m 0755 $$n $(INSTSYSBIN) || exit; done - @for n in $(USRPGMS); do \ - echo install -c -m 0755 $$n $(INSTUSRBIN); \ - install -c -m 0755 $$n $(INSTUSRBIN) || exit; done - @for n in $(GENLIBS); do \ - echo install -c -m 0644 $$n $(INSTLIB); \ - install -c -m 0644 $$n $(INSTLIB) || exit; done - @for n in $(SYSHDR); do \ - echo install -c -m 0644 $$n $(INSTHDR); \ - install -c -m 0644 $$n $(INSTHDR) || exit; done - @for n in $(MANS); do \ - echo install -c -m 0644 $$n $(INSTMAN); \ - install -c -m 0644 $$n $(INSTMAN) || exit; done + @process() { if [ ! -z "$$3" ]; then mode=$$1; dir=$$2; \ + shift 2; echo "install -c -m $$mode $$* $$dir"; \ + install -c -m $$mode $$* $$dir; fi }; \ + process 0755 $(INSTBOOTBIN) $(BOOTPGMS); \ + process 0755 $(INSTSYSBIN) $(SYSPGMS); \ + process 0755 $(INSTUSRBIN) $(USRPGMS); \ + process 0644 $(INSTLIB) $(GENLIBS); \ + process 0644 $(INSTHDR) $(SYSHDR); \ + process 0644 $(INSTMAN1) $(MAN1); \ + process 0644 $(INSTMAN4) $(MAN4); \ + process 0644 $(INSTMAN8) $(MAN8) + +uninstall: + @process() { if [ ! -z "$$2" ]; then dir=$$1; shift; \ + echo "cd $$dir; rm -f $$*"; \ + cd $$dir; echo rm -f $$*; fi }; \ + process $(INSTBOOTBIN) $(BOOTPGMS); \ + process $(INSTSYSBIN) $(SYSPGMS); \ + process $(INSTUSRBIN) $(USRPGMS); \ + process $(INSTLIB) $(GENLIBS); \ + process $(INSTHDR) $(SYSHDR); \ + process $(INSTMAN1) $(MAN1); \ + process $(INSTMAN4) $(MAN4); \ + process $(INSTMAN8) $(MAN8) depend: $(CPP) -M *.c $(INCLUDES) -I../lib >.tmpdepend @@ -73,7 +90,7 @@ rm -f *.o core .checker y.tab.h y.tab.c lex.yy.c $(TRASH) spotless: clean - rm -f $(PGMS) *.a .depend + rm -f $(BOOTPGMS) $(SYSPGMS) $(USRPGMS) $(PGMS) *.a .depend lex.yy.o: lex.yy.c y.tab.h $(CC) -c $(CFLAGS_LEX) lex.yy.c diff -ur --new-file old/atm/USAGE new/atm/USAGE --- old/atm/USAGE Thu Aug 29 16:17:44 1996 +++ new/atm/USAGE Mon Sep 2 18:39:11 1996 @@ -1,4 +1,4 @@ -Usage instructions - ATM on Linux, release 0.16 (pre-alpha) +Usage instructions - ATM on Linux, release 0.17 (pre-alpha) ------------------------------------------------------------- For updates of ATM on Linux, please check the Web page at @@ -17,10 +17,12 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.16.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.17.tar.gz - the Linux kernel, version 2.0.14, e.g. from ftp://ftp.cs.helsinki.fi/pub/Software/Linux/Kernel/v2.0/linux-2.0.14.tar.gz - Perl, version 4 or 5 + - if you want memory debugging: MPR version 1.1, e.g. from + ftp://sunsite.unc.edu/pub/Linux/devel/lang/c/mpr-1.1.tar.gz The source tree @@ -31,7 +33,7 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.16.tar.gz +tar xfz atm-0.17.tar.gz and the kernel source: @@ -130,6 +132,29 @@ to use it in a Triton-based system. +Memory debugging +---------------- + +If you want to enable debugging for options for memory allocations, you +need to install MPR before compiling the ATM tools. Extract mpr-1.1.tar.gz +into a directory at the same level as linux and atm. Then do: + +cd mpr-1.1 +patch -p1 -s <../atm/mpr.patch +make +install -c -m 0644 libmpr.a /usr/lib +install -c -m 0755 mpr mprcc mprhi mprlk mprsz /usr/local/bin +install -c -m 0755 mprfl mprnm mprpc /usr/local/bin + +Detection of some general mis-use of malloc and free is enabled by +setting the environment variable MCHECK . Tracing of allocations is +enabled by setting MPRPC and MPRFI . See mpr.doc in the MPR distribution +for details. + +No run-time overhead is incurred if memory debugging is included, but those +environment variables are not set. + + ATM tools --------- @@ -440,13 +465,17 @@ The signaling demon is started as follows - # atmsigd [-b] [-c ] [-d] [-l ] [-n] [-N] + # atmsigd [-b] [-c ] [-d] [-D ] [-l ] + [-n] [-N] [-P ] [-t ] -b background. Run in a forked child process after initializing. -c use the specified configuration file instead of /etc/atmsigd.conf -d enables (lots of) debugging output. By default, atmsigd is comparably quiet. + -D specifies the directory to which atmsigd will write + status and trace dumps. If tracing is not yet enabled, the trace size + is automatically set to a (small) default value. -l write diagnostic messages to the specified file instead of to standard error. The special name syslog is used to send diagnostics to the system logger. @@ -454,6 +483,10 @@ translation is attempted. -N makes atmsigd behave like the network side of the UNI (useful if you have two PCs but no switch). Normally, it acts as the user side. + -P configures the signaling VC to use CBR at the specified peak + cell rate. By default, UBR is used on the signaling VC. + -t enables tracing and sets the number of entries that + should be kept in the trace buffer. omitted. If atmsigd is killed, all system calls requiring interaction with it will return with an error and set errno to EUNATCH. diff -ur --new-file old/atm/VERSION new/atm/VERSION --- old/atm/VERSION Wed Aug 21 09:54:15 1996 +++ new/atm/VERSION Fri Aug 30 20:13:25 1996 @@ -1 +1 @@ -0.16 +0.17 diff -ur --new-file old/atm/aqd/Makefile new/atm/aqd/Makefile --- old/atm/aqd/Makefile Thu Jul 18 21:35:25 1996 +++ new/atm/aqd/Makefile Mon Sep 2 19:41:05 1996 @@ -3,7 +3,7 @@ #INCLUDES= OBJS=arequipad.o io.o BOOTPGMS=arequipad -MANS= +MAN8= include ../Rules.make diff -ur --new-file old/atm/aqd/arequipad.c new/atm/aqd/arequipad.c --- old/atm/aqd/arequipad.c Thu Aug 29 16:01:52 1996 +++ new/atm/aqd/arequipad.c Thu Aug 29 21:36:03 1996 @@ -41,7 +41,7 @@ set_application("arequipad"); set_verbosity(NULL,DIAG_INFO); background = 0; - while ((c = getopt(argc,argv,"bdn")) != EOF) + while ((c = getopt(argc,argv,"bdl:n")) != EOF) switch (c) { case 'b': background = 1; diff -ur --new-file old/atm/aqd/io.c new/atm/aqd/io.c --- old/atm/aqd/io.c Wed Jul 31 16:31:44 1996 +++ new/atm/aqd/io.c Sat Aug 31 14:16:22 1996 @@ -44,7 +44,7 @@ if ((incoming = socket(PF_ATMSVC,SOCK_DGRAM,ATM_AAL5)) < 0) diag(COMPONENT,DIAG_FATAL,"socket: %s",strerror(errno)); memset(&qos,0,sizeof(qos)); - qos.txtp.class = qos.rxtp.class = ATM_ANYCLASS; + qos.txtp.traffic_class = qos.rxtp.traffic_class = ATM_ANYCLASS; /* compatible with everything else */ if (setsockopt(incoming,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) diag(COMPONENT,DIAG_FATAL,"setsockopt SO_ATMQOS: %s",strerror(errno)); diff -ur --new-file old/atm/arpd/Makefile new/atm/arpd/Makefile --- old/atm/arpd/Makefile Thu Jul 18 21:35:38 1996 +++ new/atm/arpd/Makefile Mon Sep 2 19:41:09 1996 @@ -3,7 +3,7 @@ #INCLUDES= OBJS=atmarpd.o arp.o io.o itf.o table.o BOOTPGMS=atmarpd -MANS= +MAN8=atmarpd.8 include ../Rules.make diff -ur --new-file old/atm/arpd/arp.c new/atm/arpd/arp.c --- old/atm/arpd/arp.c Tue Aug 27 10:37:47 1996 +++ new/atm/arpd/arp.c Mon Sep 2 18:51:51 1996 @@ -204,6 +204,7 @@ put_addr(&here,remote_addr,&hdr->ar_thtl,&hdr->ar_tstl); put_ip(&here,remote_ip,&hdr->ar_tpln); send_packet(fd,buffer,here-buffer); + free(buffer); } @@ -467,7 +468,7 @@ *entry->addr = *addr; /* need to revise this policy if we get user-settable QOS @@@ */ memset(&entry->qos,0,sizeof(entry->qos)); - entry->qos.txtp.class = ATM_UBR; + entry->qos.txtp.traffic_class = ATM_UBR; entry->qos.txtp.max_sdu = RFC1483LLC_LEN+RFC1626_MTU; entry->qos.rxtp = entry->qos.txtp; for (walk = entry->vccs; walk; walk = walk->next) @@ -688,8 +689,10 @@ if (lookup_ip(itf,ip)) return -EEXIST; if ((fd = connect_vcc((struct sockaddr *) addr,qos,0)) < 0) return fd; if ((result = set_ip(fd,ip)) < 0) return result; - if (flags & ATF_NULL) + if (flags & ATF_NULL) { if ((result = set_encap(fd,0)) < 0) return result; + flags |= ATF_PERM; + } entry = alloc_entry(0); entry->state = as_valid; entry->ip = ip; diff -ur --new-file old/atm/arpd/atmarpd.8 new/atm/arpd/atmarpd.8 --- old/atm/arpd/atmarpd.8 Thu Jan 1 01:00:00 1970 +++ new/atm/arpd/atmarpd.8 Mon Sep 2 19:38:17 1996 @@ -0,0 +1,59 @@ +.TH ATMARPD 8 "Sep 2, 1996" "Linux" "Maintenance Commands" +.SH NAME +atmarpd \- ATMARP demon +.SH SYNOPSIS +.B atmsigd +.RB [ \-b ] +.RB [ \-d ] +.RB [ \-D\ \fIdirectory\fP ] +.RB [ \-l\ \fIlogfile\fP ] +.RB [ \-n ] +.SH DESCRIPTION +\fBatmarpd\fP implements the ATMARP protocol as specified in RFC1577 and +RFC1755. Address resolution requests are sent from the kernel (using a +comparably simple protocol) to the ATMARP demon, which then performs +the dialog with the network. +.P +\fBatmarpd\fP can operate as an ATMARP client and as an ATMARP server. +If also supports the concurrent use of several IP over ATM interfaces. +.P +\fBatmarpd\fP is configured from the command line using the \fBatmarp\fP +program. Unless debugging is enabled, the ATMARP table is written after +every change to the file \fB/var/run/atmarpd.table\fP (or to a file with +the same name in a different directory, if the \fB\-D\fP option is +used). +.P +Note that \fBatmarpd\fP disables support for SVCs if signaling is not +available at start time, i.e. if \fBatmsigd\fP is not running. +.SH OPTIONS +.IP \fB\-b\fP +Run in background (i.e. in a forked child process) after initializing. +.IP \fB\-d\fP +Enables (lots of) debugging output. By default, \fBatmarpd\fP is comparably +quiet. +.IP \fB\-D\ \fIdump_dir\fP +Changes the directory where \fBatmarpd\fP writes its table +(\fBatmarpd.table\fP). By default, \fB/var/run\fP is used. +.IP \fB\-l\ \fIlogfile\fP +Write diagnostic messages to the specified file instead of to standard +error. The special name \fBsyslog\fP is used to send diagnostics to the +system logger. +.IP \fB\-n\fP +Prints addresses in numeric format only, i.e. no address to name translation +is attempted. +.SH FILES +.PD 0 +.TP 25 +.B /var/run/atmarpd.table +ATMARP table +.B /proc/atm/arp +table of currently active IP over ATM VCs +.PD +.SH BUGS +\fBatmarpd\fP removes ATMARP entries from the kernel table while refreshing +them. +.SH AUTHOR +Werner Almesberger, EPFL LRC +.SH "SEE ALSO" +atmarp(8), atmsigd(8) +.\"{{{}}} diff -ur --new-file old/atm/arpd/atmarpd.c new/atm/arpd/atmarpd.c --- old/atm/arpd/atmarpd.c Thu May 9 16:00:24 1996 +++ new/atm/arpd/atmarpd.c Mon Sep 2 15:31:58 1996 @@ -3,6 +3,7 @@ /* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +#include #include #include #include @@ -25,6 +26,12 @@ #define COMPONENT "ARPD" +#ifdef MEM_DEBUG +extern int mpr(void); +extern int mcheck (void (*)(int)); +#endif + + ITF *itfs = NULL; ENTRY *unknown_incoming = NULL; int debug; @@ -43,6 +50,10 @@ const char *dump_dir; int c,background; +#ifdef MEM_DEBUG + if (getenv("MCHECK")) mcheck(0); + if (mpr() < 0) return 1; +#endif set_application("atmarpd"); set_verbosity(NULL,DIAG_INFO); dump_dir = DUMP_DIR; diff -ur --new-file old/atm/arpd/io.c new/atm/arpd/io.c --- old/atm/arpd/io.c Thu Jul 18 20:15:49 1996 +++ new/atm/arpd/io.c Mon Sep 2 18:28:50 1996 @@ -52,7 +52,7 @@ if ((incoming = socket(PF_ATMSVC,SOCK_DGRAM,ATM_AAL5)) < 0) diag(COMPONENT,DIAG_FATAL,"socket: %s",strerror(errno)); memset(&qos,0,sizeof(qos)); - qos.rxtp.class = qos.txtp.class = ATM_ANYCLASS; + qos.rxtp.traffic_class = qos.txtp.traffic_class = ATM_ANYCLASS; if (setsockopt(incoming,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) diag(COMPONENT,DIAG_FATAL,"setsockopt SO_ATMQOS: %s",strerror(errno)); memset(&addr,0,sizeof(addr)); @@ -167,7 +167,7 @@ unsigned char buffer[MAX_BUFFER]; int size; - size = read(vcc->fd,buffer,KERNEL_BUFFER_SIZE); + size = read(vcc->fd,buffer,MAX_BUFFER); if (!size) { disconnect_vcc(vcc); return; diff -ur --new-file old/atm/atm.patch new/atm/atm.patch --- old/atm/atm.patch Thu Aug 29 17:14:24 1996 +++ new/atm/atm.patch Mon Sep 2 20:21:43 1996 @@ -215,7 +215,7 @@ endif ifeq ($(CONFIG_AP1000),y) ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/Config.in Wed Aug 21 10:55:36 1996 @@ -0,0 +1,21 @@ +# @@ -259,7 +259,7 @@ + bool ' LANE support' CONFIG_ATM_LANE y +fi endmenu ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/Makefile Thu Aug 29 13:50:20 1996 @@ -0,0 +1,47 @@ +# File: drivers/atm/Makefile @@ -309,7 +309,7 @@ +EXTRA_CFLAGS=-g + +include $(TOPDIR)/Rules.make ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/atmdev_init.c Wed Aug 21 10:55:36 1996 @@ -0,0 +1,47 @@ +/* drivers/atm/atmdev_init.c - ATM device driver initialization */ @@ -359,7 +359,7 @@ +#endif + return devs; +} ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/atmtcp.c Wed Aug 21 10:55:37 1996 @@ -0,0 +1,316 @@ +/* drivers/atm/atmtcp.c - ATM over TCP "device" driver */ @@ -678,7 +678,7 @@ +} + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/eni.c Thu Aug 29 13:41:36 1996 @@ -0,0 +1,1954 @@ +/* drivers/atm/eni.c - Efficient Networks ENI155P device driver */ @@ -2635,8 +2635,8 @@ +} + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/drivers/atm/eni.h Thu Aug 29 14:08:38 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/drivers/atm/eni.h Mon Sep 2 19:21:23 1996 @@ -0,0 +1,113 @@ +/* drivers/atm/eni.h - Efficient Networks ENI155P device driver declarations */ + @@ -2751,7 +2751,7 @@ +#endif /* __KERNEL__ */ + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/midway.h Wed Aug 21 10:55:38 1996 @@ -0,0 +1,265 @@ +/* drivers/atm/midway.h - Efficient Networks Midway (SAR) description */ @@ -3019,7 +3019,7 @@ +#define MID_DT_HWORD 0x2 + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/suni.c Thu Aug 29 15:21:02 1996 @@ -0,0 +1,298 @@ +/* drivers/atm/suni.c - PMC SUNI (PHY) driver */ @@ -3320,8 +3320,8 @@ +} + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/drivers/atm/suni.h Thu Aug 29 14:08:38 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/drivers/atm/suni.h Mon Sep 2 19:21:23 1996 @@ -0,0 +1,219 @@ +/* drivers/atm/suni.h - PMC SUNI (PHY) declarations */ + @@ -3542,7 +3542,7 @@ +#endif + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/tonga.h Wed Aug 21 10:55:39 1996 @@ -0,0 +1,20 @@ +/* drivers/atm/tonga.h - Efficient Networks Tonga (PCI bridge) declarations */ @@ -3565,7 +3565,7 @@ +#define SEPROM_ESI_BASE 64 /* start of ESI in serial EEPROM */ + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/uPD98401.h Wed Aug 21 10:55:39 1996 @@ -0,0 +1,292 @@ +/* drivers/atm/uPD98401.h - NEC uPD98401 (SAR) declarations */ @@ -3860,7 +3860,7 @@ +#define uPD98401_RXLT_ENBL 0x8000 /* Enable */ + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/uPD98402.h Wed Aug 21 10:55:39 1996 @@ -0,0 +1,106 @@ +/* drivers/atm/uPD98402.h - NEC uPD98402 (PHY) declarations */ @@ -3969,7 +3969,7 @@ +int uPD98402_init(struct atm_dev *dev); + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/uPD98402.c Thu Aug 29 15:19:33 1996 @@ -0,0 +1,228 @@ +/* drivers/atm/uPD98402.c - NEC uPD98402 (PHY) declarations */ @@ -4200,7 +4200,7 @@ +} + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/zatm.c Thu Aug 29 13:41:42 1996 @@ -0,0 +1,1659 @@ +/* drivers/atm/zatm.c - ZeitNet ZN122x device driver */ @@ -5862,8 +5862,8 @@ +} + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/drivers/atm/zatm.h Thu Aug 29 14:09:07 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/drivers/atm/zatm.h Mon Sep 2 19:21:23 1996 @@ -0,0 +1,128 @@ +/* drivers/atm/zatm.h - ZeitNet ZN122x device driver declarations */ + @@ -5993,7 +5993,7 @@ + +#endif __KERNEL__ +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/zeprom.h Wed Aug 21 10:55:41 1996 @@ -0,0 +1,34 @@ +/* drivers/atm/zeprom.h - ZeitNet ZN122x EEPROM (NM93C46) declarations */ @@ -6030,7 +6030,7 @@ +/* No other commands are needed. */ + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/tneta1570.h Wed Aug 21 10:55:41 1996 @@ -0,0 +1,310 @@ +/* drivers/atm/tneta1570.h - TI TNETA1570 (SAR) declarations */ @@ -6343,7 +6343,7 @@ + +#endif __KERNEL__ +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/tneta1570.c Wed Aug 21 10:55:42 1996 @@ -0,0 +1,1479 @@ +/* drivers/atm/tneta1570.c - ti tneta1570 atm driver */ @@ -7825,7 +7825,7 @@ + } + return index; +} ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/drivers/atm/fore200.c Wed Aug 21 10:55:43 1996 @@ -0,0 +1,26 @@ +/* drivers/atm/fore200.c - This is just a test, not a real driver */ @@ -7854,9 +7854,9 @@ + } + return 0; +} ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/include/linux/atm.h Wed Aug 21 11:13:55 1996 -@@ -0,0 +1,225 @@ +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/include/linux/atm.h Mon Sep 2 11:44:50 1996 +@@ -0,0 +1,217 @@ +/* atm.h - general ATM declarations */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -8062,14 +8062,6 @@ + +#define SIOCSIFATMTCP _IO('a',ATMIOC_ITF) /* set ATMTCP mode */ + -+/* -+ * The following ioctls are obsolete and will be removed in a later release -+ */ -+ -+#define SIOCGIFATMADDR _IOR('a',ATMIOC_ITF+1,struct atmif_sioc) -+ /* get local ATM address */ -+#define SIOCSIFATMADDR _IOR('a',ATMIOC_ITF+2,struct atmif_sioc) -+ /* set local ATM address */ + +#ifdef __KERNEL__ + @@ -8082,8 +8074,8 @@ +#endif /* __KERNEL__ */ + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/include/linux/atmclip.h Thu Aug 29 13:59:47 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/include/linux/atmclip.h Mon Sep 2 19:21:54 1996 @@ -0,0 +1,37 @@ +/* atmclip.h - Classical IP over ATM */ + @@ -8122,8 +8114,8 @@ +#endif /* __KERNEL__ */ + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/include/linux/atmdev.h Thu Aug 29 13:41:21 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/include/linux/atmdev.h Mon Sep 2 19:24:59 1996 @@ -0,0 +1,242 @@ +/* atmdev.h - ATM device driver declarations */ + @@ -8367,7 +8359,7 @@ +#endif /* __KERNEL__ */ + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/include/linux/atmsap.h Wed Aug 21 10:55:44 1996 @@ -0,0 +1,129 @@ +/* atmsap.h - ATM Service Access Point addressing definitions */ @@ -8500,7 +8492,7 @@ + +#endif --- ref/include/linux/skbuff.h Tue Aug 20 17:09:42 1996 -+++ work/include/linux/skbuff.h Thu Aug 29 13:41:21 1996 ++++ work/include/linux/skbuff.h Mon Sep 2 19:25:06 1996 @@ -112,6 +112,16 @@ unsigned char *end; /* End pointer */ void (*destructor)(struct sk_buff *); /* Destruct function */ @@ -8518,7 +8510,7 @@ }; #ifdef CONFIG_SKB_LARGE ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/include/linux/sonet.h Wed Aug 21 10:55:45 1996 @@ -0,0 +1,52 @@ +/* sonet.h - SONET/SHD physical layer control */ @@ -8573,8 +8565,8 @@ +#define SONET_FRSENSE_SIZE 6 /* C1[3],H1[3] (0xff for unknown) */ + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/include/linux/atmsvc.h Wed Aug 21 11:13:56 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/include/linux/atmsvc.h Mon Sep 2 19:12:44 1996 @@ -0,0 +1,75 @@ +/* atmsvc.h - ATM signaling kernel-demon interface definitions */ + @@ -8651,7 +8643,7 @@ + (tp).max_pcr : (tp).min_pcr) + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/include/linux/atmioc.h Wed Aug 21 10:55:45 1996 @@ -0,0 +1,32 @@ +/* atmioc.h - ranges for ATM-related ioctl numbers */ @@ -8709,7 +8701,7 @@ endif ifeq ($(CONFIG_INET),y) ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/Makefile Wed Aug 21 10:55:46 1996 @@ -0,0 +1,54 @@ +# @@ -8766,7 +8758,7 @@ + + +include $(TOPDIR)/Rules.make ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/clip.c Wed Aug 21 10:55:46 1996 @@ -0,0 +1,115 @@ +/* net/atm/clip.c - Classical IP over ATM */ @@ -8884,8 +8876,8 @@ + DPRINTK("registered %s,0x%lx\n",dev->name,(unsigned long) vcc); + return number; +} ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/net/atm/common.c Wed Aug 21 11:07:21 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/net/atm/common.c Sat Aug 31 14:34:48 1996 @@ -0,0 +1,900 @@ +/* net/atm/common.c - ATM sockets (common part for PVC and SVC) */ + @@ -9044,8 +9036,8 @@ +{ + int max_sdu; + -+ if (!tp->class) return 0; -+ if (tp->class != ATM_UBR && !tp->min_pcr && !tp->max_pcr) ++ if (!tp->traffic_class) return 0; ++ if (tp->traffic_class != ATM_UBR && !tp->min_pcr && !tp->max_pcr) + return -EINVAL; + switch (aal) { + case ATM_AAL0: @@ -9159,7 +9151,7 @@ + DPRINTK("VCC %d.%d, AAL %d\n",vpi,vci,vcc->aal); + DPRINTK(" TX: %d, PCR %d..%d, SDU %d\n",vcc->qos.txtp.traffic_class, + vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu); -+ DPRINTK(" RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.class, ++ DPRINTK(" RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.traffic_class, + vcc->qos.rxtp.min_pcr,vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu); + if (dev->ops->open) { + error = dev->ops->open(vcc,vpi,vci); @@ -9787,7 +9779,7 @@ + if (!vcc->dev || !vcc->dev->ops->getsockopt) return -EINVAL; + return vcc->dev->ops->getsockopt(vcc,level,optname,optval,optlen); +} ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/common.h Wed Aug 21 10:55:47 1996 @@ -0,0 +1,32 @@ +/* net/atm/common.h - ATM sockets (common part for PVC and SVC) */ @@ -9822,7 +9814,7 @@ +void svc_callback(struct atm_vcc *vcc); + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/dev.c Wed Aug 21 10:55:47 1996 @@ -0,0 +1,38 @@ +/* net/atm/dev.c - ATM device registeration */ @@ -9863,7 +9855,7 @@ +{ + free_atm_dev(dev); +} ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/pvc.c Wed Aug 21 10:55:47 1996 @@ -0,0 +1,162 @@ +/* net/atm/pvc.c - ATM PVC sockets */ @@ -10028,7 +10020,7 @@ + (void) atm_init_arequipa(); +#endif +} ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/static.c Wed Aug 21 10:55:47 1996 @@ -0,0 +1,114 @@ +/* net/atm/static.c - Staticly allocated resources */ @@ -10145,8 +10137,8 @@ + for (i = 0; i < MAX_ATM_VCC; i++) + if (atm_vcc[i].family) fn(atm_vcc+i); +} ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/net/atm/static.h Thu Aug 29 13:59:48 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/net/atm/static.h Mon Sep 2 19:21:54 1996 @@ -0,0 +1,29 @@ +/* net/atm/static.h - Staticly allocated resources */ + @@ -10177,9 +10169,9 @@ +void for_all_vccs(void (*fn)(struct atm_vcc *vcc)); + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/net/atm/svc.c Wed Aug 21 10:55:48 1996 -@@ -0,0 +1,618 @@ +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/net/atm/svc.c Mon Sep 2 20:17:27 1996 +@@ -0,0 +1,598 @@ +/* net/atm/svc.c - ATM SVC sockets */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -10666,10 +10658,6 @@ + + rsize = wsize = 0; + switch (cmd) { -+ case SIOCGIFATMADDR: -+ wsize = sizeof(struct sockaddr_atmsvc); -+ break; -+ case SIOCSIFATMADDR: + case ATM_ADDADDR: + case ATM_DELADDR: + rsize = sizeof(struct sockaddr_atmsvc); @@ -10694,7 +10682,6 @@ + number)))) return -ENODEV; + len = get_fs_long(&((struct atmif_sioc *) arg)->length); + buf = (void *) get_fs_long(&((struct atmif_sioc *) arg)->arg); -+ if (cmd == SIOCSIFATMADDR && !buf) rsize = 0; /* @@@ */ + if (!buf && (rsize || wsize)) return -EINVAL; + if (rsize > 0) { + if (len != rsize) return -EINVAL; @@ -10708,24 +10695,9 @@ + put_fs_long(wsize,&((struct atmif_sioc *) arg)->length); + } + switch (cmd) { -+ case SIOCGIFATMADDR: -+ { -+ struct sockaddr_atmsvc addr; -+ -+ memset(&addr,0,sizeof(addr)); -+ memcpy_tofs((struct sockaddr_atmsvc *) buf, -+ dev->local ? &dev->local->addr : &addr, -+ sizeof(struct sockaddr_atmsvc)); -+ return wsize; -+ } + case ATM_RSTADDR: + reset_addr(dev); + return 0; -+ case SIOCSIFATMADDR: /* OBSOLETE - REMOVE WHEN ILMID UPDATED */ -+ reset_addr(dev); -+ if (!buf) return 0; -+ cmd = ATM_ADDADDR; -+ /* fall through */ + case ATM_ADDADDR: + case ATM_DELADDR: + { @@ -10798,7 +10770,7 @@ + return; + } +} ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/signaling.c Wed Aug 21 11:42:32 1996 @@ -0,0 +1,219 @@ +/* net/atm/signaling.c - ATM signaling */ @@ -11020,8 +10992,8 @@ + wake_up(&sigd_sleep); + return 0; +} ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/net/atm/signaling.h Thu Aug 29 13:59:48 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/net/atm/signaling.h Mon Sep 2 19:21:54 1996 @@ -0,0 +1,25 @@ +/* net/atm/signaling.h - ATM signaling */ + @@ -11048,7 +11020,7 @@ +int sigd_attach(struct atm_vcc *vcc); + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/atmarp.c Wed Aug 21 11:42:49 1996 @@ -0,0 +1,608 @@ +/* atmarp.c - RFC1577 ATM ARP */ @@ -11659,8 +11631,8 @@ + register_netdevice_notifier(&clip_dev_notifier); + return 0; +} ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/net/atm/atmarp.h Thu Aug 29 13:59:48 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/net/atm/atmarp.h Mon Sep 2 19:21:54 1996 @@ -0,0 +1,54 @@ +/* net/atm/atmarp.h - RFC1577 ATM ARP */ + @@ -11716,8 +11688,8 @@ +int atmarp_encap(struct atm_vcc *vcc,int mode); + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/net/atm/ipcommon.h Thu Aug 29 14:00:41 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/net/atm/ipcommon.h Mon Sep 2 19:22:13 1996 @@ -0,0 +1,66 @@ +/* net/atm/ipcommon.h - Common items for all ways of doing IP over ATM */ + @@ -11785,8 +11757,8 @@ + unsigned short extra_flags); + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/net/atm/ipcommon.c Wed Aug 21 10:55:49 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/net/atm/ipcommon.c Mon Sep 2 20:21:21 1996 @@ -0,0 +1,181 @@ +/* net/atm/ipcommon.c - Common items for all ways of doing IP over ATM */ + @@ -11885,7 +11857,7 @@ + +void atm_pop_clip(struct atm_vcc *vcc,struct sk_buff *skb) +{ -+#ifdef CONFIG_MMU_HACKS ++#if 0 && defined(CONFIG_MMU_HACKS) + if (skb->atm.iovcnt) + unlock_user(skb->atm.iovcnt-1,(struct iovec *) skb->data+1); +#endif @@ -11969,7 +11941,7 @@ + memset(&CLIP(dev)->stats,0,sizeof(struct enet_statistics)); + +} ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/arequipa.c Wed Aug 21 10:55:50 1996 @@ -0,0 +1,367 @@ +/* net/atm/arequipa.c - Application requested IP over ATM */ @@ -12339,7 +12311,7 @@ + return 0; + +} ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/tunable.h Wed Aug 21 10:55:50 1996 @@ -0,0 +1,26 @@ +/* net/atm/tunable.h - Tunable parameters of ATM support */ @@ -12451,7 +12423,7 @@ #endif { NULL, NULL } /* End marker */ }; ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/mmuio.c Wed Aug 21 10:55:51 1996 @@ -0,0 +1,455 @@ +/* net/atm/mmuio.c - MMU-supported high-speed I/O */ @@ -12909,8 +12881,8 @@ +} + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/include/linux/mmuio.h Thu Aug 29 13:59:48 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/include/linux/mmuio.h Mon Sep 2 19:21:54 1996 @@ -0,0 +1,25 @@ +/* mmuio.h - MMU-supported high-speed I/O */ + @@ -12937,7 +12909,7 @@ +#endif + +#endif ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/raw.c Wed Aug 21 10:55:52 1996 @@ -0,0 +1,139 @@ +/* net/atm/raw.c - Raw AAL0 and AAL5 transports */ @@ -13079,7 +13051,7 @@ + vcc->push_oam = NULL; + return 0; +} ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/protocols.h Wed Aug 21 10:55:52 1996 @@ -0,0 +1,17 @@ +/* net/atm/protocols.h - ATM protocol handler entry points */ @@ -13100,7 +13072,7 @@ + +#endif --- ref/include/linux/netdevice.h Tue Aug 20 17:11:35 1996 -+++ work/include/linux/netdevice.h Thu Aug 29 13:41:21 1996 ++++ work/include/linux/netdevice.h Mon Sep 2 19:25:06 1996 @@ -185,6 +185,8 @@ int (*set_mac_address)(struct device *dev, void *addr); #define HAVE_PRIVATE_IOCTL @@ -13119,8 +13091,8 @@ extern void tr_setup(struct device *dev); extern int ether_config(struct device *dev, struct ifmap *map); /* Support for loadable net-drivers */ ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/include/linux/atmarp.h Wed Aug 21 11:13:56 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/include/linux/atmarp.h Mon Sep 2 19:12:43 1996 @@ -0,0 +1,98 @@ +/* atmarp.h - ATM ARP protocol and kernel-demon interface definitions */ + @@ -13271,7 +13243,7 @@ IPPROTO_TCP, sk->opt, MAX_SYN_SIZE,sk->ip_tos,sk->ip_ttl,&sk->ip_route_cache); if (tmp < 0) --- ref/include/linux/proc_fs.h Tue Aug 20 17:09:42 1996 -+++ work/include/linux/proc_fs.h Thu Aug 29 13:41:21 1996 ++++ work/include/linux/proc_fs.h Mon Sep 2 19:25:10 1996 @@ -34,6 +34,7 @@ PROC_KSYMS, PROC_DMA, @@ -13393,7 +13365,7 @@ case PROC_KCORE: inode->i_mode = S_IFREG | S_IRUSR; inode->i_op = &proc_kcore_inode_operations; ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/proc.c Wed Aug 21 10:55:56 1996 @@ -0,0 +1,484 @@ +/* net/atm/proc.c - ATM /proc interface */ @@ -14089,8 +14061,8 @@ /* * Called once on startup. */ ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/include/linux/atmlec.h Wed Aug 21 11:13:56 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/include/linux/atmlec.h Mon Sep 2 19:12:44 1996 @@ -0,0 +1,58 @@ +/* + * @@ -14150,7 +14122,7 @@ + unsigned char receive; /* 1= receive vcc, 0 = send_vcc */ +}; +#endif /* _ATMLEC_H_ */ ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/lec.c Wed Aug 21 11:42:09 1996 @@ -0,0 +1,612 @@ +/* @@ -14765,8 +14737,8 @@ + + return 0; +} ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/net/atm/lec.h Thu Aug 29 13:59:48 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/net/atm/lec.h Mon Sep 2 19:21:54 1996 @@ -0,0 +1,53 @@ +/* + * @@ -14821,7 +14793,7 @@ +void lec_push(struct atm_vcc *vcc, struct sk_buff *skb); +#endif _LEC_H_ + ---- /dev/null Thu Aug 29 17:08:20 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 +++ work/net/atm/lec_arpc.c Wed Aug 21 11:06:48 1996 @@ -0,0 +1,1116 @@ +#include @@ -15940,8 +15912,8 @@ + lec_arp_unlock(); +} + ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/net/atm/lec_arpc.h Thu Aug 29 13:59:48 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/net/atm/lec_arpc.h Mon Sep 2 19:21:54 1996 @@ -0,0 +1,104 @@ +/* + * Lec arp cache @@ -16048,7 +16020,7 @@ + +#endif --- ref/include/net/route.h Tue Aug 20 17:14:55 1996 -+++ work/include/net/route.h Thu Aug 29 13:58:43 1996 ++++ work/include/net/route.h Mon Sep 2 19:24:10 1996 @@ -26,6 +26,7 @@ #define _ROUTE_H @@ -16112,7 +16084,7 @@ #endif /* _ROUTE_H */ --- ref/include/net/sock.h Tue Aug 20 17:11:40 1996 -+++ work/include/net/sock.h Thu Aug 29 13:41:21 1996 ++++ work/include/net/sock.h Mon Sep 2 19:25:06 1996 @@ -301,7 +301,13 @@ int ip_mc_loop; /* Loopback */ char ip_mc_name[MAX_ADDR_LEN];/* Multicast device name */ @@ -16128,8 +16100,8 @@ /* * This part is used for the timeout functions (timer.c). ---- /dev/null Thu Aug 29 17:08:20 1996 -+++ work/include/linux/arequipa.h Thu Aug 29 13:59:48 1996 +--- /dev/null Mon Sep 2 20:10:22 1996 ++++ work/include/linux/arequipa.h Mon Sep 2 19:21:54 1996 @@ -0,0 +1,45 @@ +/* arequipa.h - Arequipa interface definitions */ + diff -ur --new-file old/atm/debug/Makefile new/atm/debug/Makefile --- old/atm/debug/Makefile Thu Jul 18 21:35:48 1996 +++ new/atm/debug/Makefile Mon Sep 2 19:41:13 1996 @@ -1,5 +1,5 @@ SYSPGMS=ed encopy endump zndump -MANS= +MAN8= include ../Rules.make diff -ur --new-file old/atm/doc/usage.tex new/atm/doc/usage.tex --- old/atm/doc/usage.tex Thu Aug 29 16:01:44 1996 +++ new/atm/doc/usage.tex Mon Sep 2 18:38:51 1996 @@ -1,7 +1,7 @@ %%def%:= %:\begin{verbatim} -%:Usage instructions - ATM on Linux, release 0.16 (pre-alpha) +%:Usage instructions - ATM on Linux, release 0.17 (pre-alpha) %:------------------------------------------------------------- %: %:\end{verbatim} @@ -38,7 +38,7 @@ \title{ATM on Linux \\ User's guide \\ - Release 0.16 (pre-alpha)} + Release 0.17 (pre-alpha)} \author{Werner Almesberger \\ {\tt werner.almesberger@lrc.di.epfl.ch} \\ \\ @@ -81,10 +81,12 @@ In order to install this package, you need \begin{itemize} \item the package itself - \url{ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.16.tar.gz} + \url{ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.17.tar.gz} \item the Linux kernel, version 2.0.14, e.g. from \url{ftp://ftp.cs.helsinki.fi/pub/Software/Linux/Kernel/v2.0/linux-2.0.14.tar.gz} \item Perl, version 4 or 5 + \item if you want memory debugging: MPR version 1.1, e.g. from + \url{ftp://sunsite.unc.edu/pub/Linux/devel/lang/c/mpr-1.1.tar.gz} \end{itemize} @@ -96,7 +98,7 @@ distribution: \begin{verbatim} -tar xfz atm-0.16.tar.gz +tar xfz atm-0.17.tar.gz \end{verbatim} and the kernel source: @@ -213,6 +215,31 @@ to use it in a Triton-based system. +\subsection{Memory debugging} + +If you want to enable debugging for options for memory allocations, you +need to install MPR before compiling the ATM tools. Extract +\path{mpr-1.1.tar.gz} into a directory at the same level as \path{linux} +and \path{atm}. Then do: + +\begin{verbatim} +cd mpr-1.1 +patch -p1 -s <../atm/mpr.patch +make +install -c -m 0644 libmpr.a /usr/lib +install -c -m 0755 mpr mprcc mprhi mprlk mprsz /usr/local/bin +install -c -m 0755 mprfl mprnm mprpc /usr/local/bin +\end{verbatim} + +Detection of some general mis-use of \raw{malloc} and \raw{free} is enabled +by setting the environment variable \raw{MCHECK}. Tracing of allocations +is enabled by setting \raw{MPRPC} and \raw{MPRFI}. See \path{mpr.doc} in +the MPR distribution for details. + +No run-time overhead is incurred if memory debugging is included, but those +environment variables are not set. + + \subsection{ATM tools} Now, as the final step, build the ATM tools: @@ -558,8 +585,9 @@ The signaling demon is started as follows \begin{command} -\# atmsigd \[-b\] \[-c \meta{config\_file}\] \[-d\] \[-l \meta{logfile}\] - \[-n\] \[-N\] +\# atmsigd \[-b\] \[-c \meta{config\_file}\] \[-d\] \[-D \meta{dump\_dir}\] + \[-l \meta{logfile}\] \[-n\] \[-N\] \[-P \meta{pcr}\] + \[-t \meta{trace\_length}\] \end{command} \begin{description} @@ -568,6 +596,9 @@ instead of \path{/etc/atmsigd.conf} \item[\raw{-d}] enables (lots of) debugging output. By default, \name{atmsigd} is comparably quiet. + \item[\raw{-D \meta{dump\_dir}}] specifies the directory to which + \name{atmsigd} will write status and trace dumps. If tracing is not yet + enabled, the trace size is automatically set to a (small) default value. \item[\raw{-l \meta{logfile}}] write diagnostic messages to the specified file instead of to standard error. The special name \raw{syslog} is used to send diagnostics to the system logger. @@ -576,6 +607,12 @@ \item[\raw{-N}] makes \name{atmsigd} behave like the network side of the UNI (useful if you have two PCs but no switch). Normally, it acts as the user side. + \item[\raw{-P \meta{pcr}}] configures the signaling VC to use CBR at the + specified peak cell rate. By default, UBR is used on the signaling VC. + \item[\raw{-t \meta{trace\_length}}] enables tracing and sets the number + of entries that should be kept in the trace buffer. +omitted. + \end{description} If \name{atmsigd} is killed, all system calls requiring interaction with it diff -ur --new-file old/atm/doc/usage.txt new/atm/doc/usage.txt --- old/atm/doc/usage.txt Thu Aug 29 16:17:44 1996 +++ new/atm/doc/usage.txt Mon Sep 2 18:39:11 1996 @@ -1,4 +1,4 @@ -Usage instructions - ATM on Linux, release 0.16 (pre-alpha) +Usage instructions - ATM on Linux, release 0.17 (pre-alpha) ------------------------------------------------------------- For updates of ATM on Linux, please check the Web page at @@ -17,10 +17,12 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.16.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.17.tar.gz - the Linux kernel, version 2.0.14, e.g. from ftp://ftp.cs.helsinki.fi/pub/Software/Linux/Kernel/v2.0/linux-2.0.14.tar.gz - Perl, version 4 or 5 + - if you want memory debugging: MPR version 1.1, e.g. from + ftp://sunsite.unc.edu/pub/Linux/devel/lang/c/mpr-1.1.tar.gz The source tree @@ -31,7 +33,7 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.16.tar.gz +tar xfz atm-0.17.tar.gz and the kernel source: @@ -130,6 +132,29 @@ to use it in a Triton-based system. +Memory debugging +---------------- + +If you want to enable debugging for options for memory allocations, you +need to install MPR before compiling the ATM tools. Extract mpr-1.1.tar.gz +into a directory at the same level as linux and atm. Then do: + +cd mpr-1.1 +patch -p1 -s <../atm/mpr.patch +make +install -c -m 0644 libmpr.a /usr/lib +install -c -m 0755 mpr mprcc mprhi mprlk mprsz /usr/local/bin +install -c -m 0755 mprfl mprnm mprpc /usr/local/bin + +Detection of some general mis-use of malloc and free is enabled by +setting the environment variable MCHECK . Tracing of allocations is +enabled by setting MPRPC and MPRFI . See mpr.doc in the MPR distribution +for details. + +No run-time overhead is incurred if memory debugging is included, but those +environment variables are not set. + + ATM tools --------- @@ -440,13 +465,17 @@ The signaling demon is started as follows - # atmsigd [-b] [-c ] [-d] [-l ] [-n] [-N] + # atmsigd [-b] [-c ] [-d] [-D ] [-l ] + [-n] [-N] [-P ] [-t ] -b background. Run in a forked child process after initializing. -c use the specified configuration file instead of /etc/atmsigd.conf -d enables (lots of) debugging output. By default, atmsigd is comparably quiet. + -D specifies the directory to which atmsigd will write + status and trace dumps. If tracing is not yet enabled, the trace size + is automatically set to a (small) default value. -l write diagnostic messages to the specified file instead of to standard error. The special name syslog is used to send diagnostics to the system logger. @@ -454,6 +483,10 @@ translation is attempted. -N makes atmsigd behave like the network side of the UNI (useful if you have two PCs but no switch). Normally, it acts as the user side. + -P configures the signaling VC to use CBR at the specified peak + cell rate. By default, UBR is used on the signaling VC. + -t enables tracing and sets the number of entries that + should be kept in the trace buffer. omitted. If atmsigd is killed, all system calls requiring interaction with it will return with an error and set errno to EUNATCH. diff -ur --new-file old/atm/ilmid/io.c new/atm/ilmid/io.c --- old/atm/ilmid/io.c Wed Aug 21 11:34:06 1996 +++ new/atm/ilmid/io.c Mon Sep 2 11:48:32 1996 @@ -46,7 +46,9 @@ #define SNMP_VCI 16 #define COMPONENT "IO" - +#define MAX_EXTRA_ADDRS 4 /* maximum number of additional addresses that can + be manually configured (after ilmid has + registered the "official" address) - HACK */ static short atm_itf = -1; /* bad value */ @@ -88,7 +90,7 @@ void update_nsap(int itf, AsnOid *netprefix, AsnOid *esi) { struct atmif_sioc req; - struct sockaddr_atmsvc addr, ouraddr; + struct sockaddr_atmsvc addr, ouraddr[MAX_EXTRA_ADDRS+1]; int fd, m, n; addr.sas_family = AF_ATMSVC; @@ -125,7 +127,7 @@ n = 1; for(m = 0; m < netprefix->octetLen; m++) - if(addr.sas_addr.prv[m] != ouraddr.sas_addr.prv[m]) + if(addr.sas_addr.prv[m] != ouraddr[0].sas_addr.prv[m]) { n = 0; break; } @@ -235,8 +237,8 @@ diag(COMPONENT, DIAG_FATAL, "socket: %s", strerror(errno)); memset(&qos, 0, sizeof(qos)); - qos.rxtp.class = ATM_UBR; - qos.txtp.class = ATM_UBR; + qos.rxtp.traffic_class = ATM_UBR; + qos.txtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = MAX_ILMI_MSG; qos.txtp.max_sdu = MAX_ILMI_MSG; if (setsockopt(fd, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0) diff -ur --new-file old/atm/ip/Makefile new/atm/ip/Makefile --- old/atm/ip/Makefile Thu Jul 18 21:38:24 1996 +++ new/atm/ip/Makefile Mon Sep 2 19:41:18 1996 @@ -1,5 +1,5 @@ BOOTPGMS=clip atmarp -MANS=clip.8 +MAN8=clip.8 atmarp.8 include ../Rules.make diff -ur --new-file old/atm/ip/atmarp.8 new/atm/ip/atmarp.8 --- old/atm/ip/atmarp.8 Thu Jan 1 01:00:00 1970 +++ new/atm/ip/atmarp.8 Mon Sep 2 19:38:24 1996 @@ -0,0 +1,82 @@ +.TH ATMARP 8 "Sep 2, 1996" "Linux" "Maintenance Commands" +.SH NAME +atmarp \- administer classical IP over ATM connections +.SH SYNOPSIS +.ad l +.B atmarp +.RB \-a +.br +.B atmarp +.RB \-c +.RB [[atm]\fInumber\fP] +.br +.B atmarp +.RB \-s +.RB \fIip_addr\fP +.RB [\fIitf\fP.]\fIvpi\fP.\fIvci\fP +.RB [ pcr\ \fIvalue\fP ] +.RB [ temp ] +.RB [ null ] +.br +.B atmarp +.RB \-s +.RB \fIip_addr\fP +.RB \fIatm_addr\fP +.RB [ pcr\ \fIvalue\fP ] +.RB [ temp ] +.RB [ arpsrv ] +.br +.B atmarp +.RB \-d +.RB \fIip_addr\fP +.RB [ arpsrv ] +.ad b +.SH DESCRIPTION +\fBatmarp\fP is used to maintain the ATMARP table of the ATMARP demon. +The table can be listed, new PVC and SVC entries can be added, and existing +entries can be deleted. In addition to that, \fBatmarp\fP is also used to +create new IP over ATM interfaces. +.P +Note that the kernel has its own ATMARP table containing only entries +for destinations to which a connection exists. The table of \fBatmarpd\fP +can also contain currently unused entries. +.SH OPTIONS +.IP \fB\-a\fP +list the current ATMARP table. +.IP \fB\-c\fP +create the specified IP interface. If the interface number is omitted, +the operating system assigns the next free number and \fBatmarp\fP +prints the resulting interface name (e.g. `atm0') on standard output. +.IP \fB\-s\fP +set up a PVC or create an SVC entry. The following options are recognized: +.RS +.IP \fBpcr\fP\ \fIvalue\fP +uses CBR with the specified peak cell rate. UBR is used +by default. +.IP \fBtemp\fP +does not mark the entry as permanent, i.e. it will time out and then be +removed. +.IP \fBnull\fP +uses NULL encapsulation instead of LLC/SNAP encapsulation on the PVC. This +option is not available for SVCs, because the LLC/SNAP header is required +to identify ATMARP packets. \fBnull\fP also implies that the entry is +permanent. +.IP \fBarpsrv\fP +identifies the entry pointing to the ATMARP server. Note that the node +acting as the ATMARP server must have no ATMARP server entry in its ATMARP +table. +.RE +.IP \fB\-d\fP +delete the specified ARP entry. In order to prevent accidental deletion of +the ATMARP server entry, the \fBarpsrv\fP flag must be specified when +deleting it. +.SH FILES +.PD 0 +.TP 25 +.B /var/run/atmarpd.table +ATMARP table +.SH AUTHOR +Werner Almesberger, EPFL LRC +.SH "SEE ALSO" +atmarpd(8), clip(8) +.\"{{{}}} diff -ur --new-file old/atm/ip/atmarp.c new/atm/ip/atmarp.c --- old/atm/ip/atmarp.c Thu Aug 29 11:43:36 1996 +++ new/atm/ip/atmarp.c Sat Aug 31 20:29:38 1996 @@ -55,7 +55,7 @@ static void usage(const char *name) { fprintf(stderr,"usage: %s -a\n",name); - fprintf(stderr,"%6s %s -c [atmN]\n","",name); + fprintf(stderr,"%6s %s -c [[atm]N]\n","",name); fprintf(stderr,"%6s %s -s ip_addr [itf.]vpi.vci [pcr value] [temp] [null]" "\n","",name); fprintf(stderr,"%6s %s -s ip_addr atm_addr [pcr value] [temp] [arpsrv]\n", @@ -112,7 +112,7 @@ return 1; } if ((num = ioctl(s,op,req_num)) < 0) { - perror("ioctl"); + perror("ioctl SIOCMKCLIP"); return 1; } if (req_num == -1) printf("atm%d\n",num); @@ -149,7 +149,7 @@ req.arp_flags = ATF_PERM; if (op == SIOCSARP) { memset(&req.arp_qos,0,sizeof(req.arp_qos)); - req.arp_qos.txtp.class = ATM_UBR; + req.arp_qos.txtp.traffic_class = ATM_UBR; for (i = optind+2; i < argc; i++) if (!strcmp(argv[i],"temp")) req.arp_flags &= ~ATF_PERM; else if (!strcmp(argv[i],"null")) req.arp_flags |= ATF_NULL; @@ -177,7 +177,7 @@ return 1; } if (ioctl(s,op,&req) < 0) { - perror("ioctl"); + perror("ioctl SIOCxARP"); return 1; } return 0; diff -ur --new-file old/atm/ip/clip.c new/atm/ip/clip.c --- old/atm/ip/clip.c Mon Jul 29 13:34:00 1996 +++ new/atm/ip/clip.c Sat Aug 31 14:17:07 1996 @@ -48,13 +48,13 @@ if (text2atm(argv[1],(struct sockaddr *) &addr,sizeof(addr),T2A_PVC) < 0) usage(argv[0]); memset(&qos,0,sizeof(qos)); - if (argc != 3) qos.txtp.class = ATM_UBR; + if (argc != 3) qos.txtp.traffic_class = ATM_UBR; else { - qos.txtp.class = ATM_CBR; + qos.txtp.traffic_class = ATM_CBR; qos.txtp.min_pcr = atoi(argv[2]); qos.txtp.max_sdu = RFC1626_MTU; } - qos.rxtp.class = ATM_UBR; + qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = RFC1626_MTU; if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { perror("setsockopt SO_ATMQOS"); diff -ur --new-file old/atm/lane/atm.c new/atm/lane/atm.c --- old/atm/lane/atm.c Thu Aug 8 23:22:10 1996 +++ new/atm/lane/atm.c Sat Aug 31 14:17:24 1996 @@ -81,9 +81,9 @@ server.sas_family = AF_ATMSVC; memcpy(server.sas_addr.prv, our_addr, ATM_ESA_LEN); server.sas_addr.blli = &blli; - qos.txtp.class = ATM_UBR; + qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = 1516; - qos.rxtp.class = ATM_UBR; + qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = 1516; blli.l3_proto = ATM_L3_TR9577; @@ -132,9 +132,9 @@ } memset(&qos, 0, sizeof(qos)); - qos.txtp.class = ATM_UBR; + qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = 1516; - qos.rxtp.class = ATM_UBR; + qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = 1516; if (setsockopt(fd, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0) { diff -ur --new-file old/atm/lane/atm_lecs.c new/atm/lane/atm_lecs.c --- old/atm/lane/atm_lecs.c Sun Aug 18 22:19:47 1996 +++ new/atm/lane/atm_lecs.c Sat Aug 31 14:17:33 1996 @@ -42,9 +42,9 @@ if (our_addr) memcpy(server.sas_addr.prv, our_addr, ATM_ESA_LEN); server.sas_addr.blli = &blli; - qos.txtp.class = ATM_UBR; + qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = 1516; - qos.rxtp.class = ATM_UBR; + qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = 1516; blli.l3_proto = ATM_L3_TR9577; diff -ur --new-file old/atm/led/Makefile new/atm/led/Makefile --- old/atm/led/Makefile Tue Aug 20 20:39:17 1996 +++ new/atm/led/Makefile Mon Sep 2 19:41:25 1996 @@ -2,7 +2,7 @@ OBJS=lec_arp.o lec_ctrl.o le_disp.o g_event.o \ utils.o timers.o address.o conn.o main.o kernel_itf.o BOOTPGMS=zeppelin -MANS= +MAN8= CFLAGS_PRIVATE=-ansi -pedantic include ../Rules.make diff -ur --new-file old/atm/led/conn.c new/atm/led/conn.c --- old/atm/led/conn.c Tue Aug 20 20:41:30 1996 +++ new/atm/led/conn.c Sat Aug 31 14:18:21 1996 @@ -887,8 +887,8 @@ memset(conn_info , 0, sizeof(CONN_INFO)); - conn_info->conqos.txtp.class = ATM_UBR; - conn_info->conqos.rxtp.class = ATM_UBR; + conn_info->conqos.txtp.traffic_class = ATM_UBR; + conn_info->conqos.rxtp.traffic_class = ATM_UBR; conn_info->conqos.txtp.max_pcr = max_cell_rate; conn_info->conqos.rxtp.max_pcr = max_cell_rate; diff -ur --new-file old/atm/led/lec_ctrl.c new/atm/led/lec_ctrl.c --- old/atm/led/lec_ctrl.c Tue Aug 20 20:39:49 1996 +++ new/atm/led/lec_ctrl.c Sat Aug 31 14:18:27 1996 @@ -426,8 +426,8 @@ EVENT(EM_ASSERT,("Unknown BLLI codepoint %x\n",blli_codepoint)); } /* ATM User Cell Rate/ATM Traffic Descriptor. */ - p_conn_info->conqos.txtp.class = ATM_UBR; - p_conn_info->conqos.rxtp.class = ATM_UBR; + p_conn_info->conqos.txtp.traffic_class = ATM_UBR; + p_conn_info->conqos.rxtp.traffic_class = ATM_UBR; /* Set the peak cell rate to p_elan->max_cell_rate */ p_conn_info->conqos.txtp.max_pcr = p_elan->max_cell_rate; diff -ur --new-file old/atm/lib/diag.c new/atm/lib/diag.c --- old/atm/lib/diag.c Thu May 9 20:24:14 1996 +++ new/atm/lib/diag.c Thu Aug 29 18:31:14 1996 @@ -100,6 +100,7 @@ else fprintf(log_to,"%s: ",component); vfprintf(log_to,fmt,ap); fputc('\n',log_to); + fflush(log_to); } if (severity == DIAG_FATAL) { fprintf(stderr,"Fatal error - Terminating\n"); diff -ur --new-file old/atm/maint/Makefile new/atm/maint/Makefile --- old/atm/maint/Makefile Thu Jul 18 21:40:23 1996 +++ new/atm/maint/Makefile Mon Sep 2 19:41:30 1996 @@ -1,7 +1,7 @@ BOOTPGMS=atmaddr SYSPGMS=atmtcp zntune USRPGMS=atmdiag atmdump sonetdiag -MANS=atmaddr.8 atmdiag.8 atmdump.8 atmtcp.8 +MAN8=atmaddr.8 atmdiag.8 atmdump.8 atmtcp.8 include ../Rules.make diff -ur --new-file old/atm/maint/atmdump.c new/atm/maint/atmdump.c --- old/atm/maint/atmdump.c Tue Jun 11 12:03:58 1996 +++ new/atm/maint/atmdump.c Sat Aug 31 14:18:32 1996 @@ -90,11 +90,11 @@ < 0) usage(name); memset(&qos,0,sizeof(qos)); if (type == -1) { - qos.rxtp.class = ATM_UBR; + qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = 52; } else { - qos.txtp.class = ATM_UBR; + qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = 52; } if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { diff -ur --new-file old/atm/mkdist new/atm/mkdist --- old/atm/mkdist Thu Aug 29 16:20:32 1996 +++ new/atm/mkdist Mon Sep 2 19:39:40 1996 @@ -22,17 +22,17 @@ atm/sigd/io.h atm/sigd/io.c atm/sigd/kernel.c atm/sigd/proto.h \ atm/sigd/proto.c atm/sigd/q2931.c atm/sigd/timeout.c atm/sigd/timeout.h \ atm/sigd/sap.h atm/sigd/sap.c atm/sigd/trace.c atm/sigd/trace.h \ - atm/sigd/mkmess.pl \ + atm/sigd/mkmess.pl atm/sigd/atmsigd.8 atm/sigd/atmsigd.conf.4 \ atm/saal/Makefile atm/saal/saal.h atm/saal/saal.c atm/saal/sscf.h \ atm/saal/sscf.c atm/saal/sscop.h atm/saal/sscop.c \ - atm/qgen/TODO atm/qgen/Makefile atm/qgen/common.h \ + atm/qgen/TODO atm/qgen/Makefile atm/qgen/mknl.pl atm/qgen/common.h \ atm/qgen/common.c atm/qgen/file.h atm/qgen/file.c atm/qgen/first.c \ atm/qgen/second.c atm/qgen/third.c atm/qgen/op.h atm/qgen/qgen.h \ atm/qgen/qgen.c atm/qgen/ql.l atm/qgen/ql.y atm/qgen/qlib.h \ atm/qgen/qlib.c atm/qgen/q2931.h atm/qgen/qtest.c atm/qgen/uni3x \ atm/arpd/Makefile atm/arpd/arp.c atm/arpd/arp.h atm/arpd/atmarpd.c \ atm/arpd/io.c atm/arpd/io.h atm/arpd/itf.c atm/arpd/itf.h \ - atm/arpd/table.c atm/arpd/table.h \ + atm/arpd/table.c atm/arpd/table.h atm/arpd/atmarpd.8 \ atm/ilmid/README atm/ilmid/COPYRIGHT atm/ilmid/Makefile \ atm/ilmid/rfc1155_smi.c atm/ilmid/rfc1155_smi.h \ atm/ilmid/rfc1157_snmp.c atm/ilmid/rfc1157_snmp.h \ @@ -60,7 +60,7 @@ atm/maint/atmtcp.8 atm/maint/zntune.c \ atm/test/Makefile atm/test/aread.c atm/test/awrite.c atm/test/br.c \ atm/test/bw.c atm/test/ttcp.c atm/test/aping.c \ - atm/ip/Makefile atm/ip/atmarp.c atm/ip/clip.c atm/ip/clip.8 \ + atm/ip/Makefile atm/ip/atmarp.c atm/ip/clip.c atm/ip/clip.8 atm/ip/atmarp.8 \ atm/debug/Makefile atm/debug/ed.c atm/debug/encopy.c atm/debug/endump.c \ atm/debug/peek.pl atm/debug/zndump.c \ atm/lib/Makefile atm/lib/atm2text.c atm/lib/atm.h atm/lib/text2atm.c \ @@ -91,4 +91,4 @@ atm/lane/packet.h atm/lane/timers.h atm/lane/timers.c atm/lane/units.c \ atm/lane/units.h \ atm/aqd/Makefile atm/aqd/arequipad.c atm/aqd/io.h atm/aqd/io.c \ - atm/atm.patch | gzip -9 >$ARCHDIR/atm-$VERSION.tar.gz + atm/atm.patch atm/mpr.patch | gzip -9 >$ARCHDIR/atm-$VERSION.tar.gz diff -ur --new-file old/atm/mpr.patch new/atm/mpr.patch --- old/atm/mpr.patch Thu Jan 1 01:00:00 1970 +++ new/atm/mpr.patch Mon Sep 2 15:51:39 1996 @@ -0,0 +1,60 @@ +diff -ur mpr-1.1/config/mprnm.linux mpr-1.1-elf/config/mprnm.linux +--- mpr-1.1/config/mprnm.linux Tue May 7 02:45:49 1996 ++++ mpr-1.1-elf/config/mprnm.linux Mon Sep 2 13:12:56 1996 +@@ -1,10 +1,16 @@ + #!/bin/sh + + if test $# -ne 1; then +- echo "usage: mprnm a.out" >&2 ++ echo "usage: mprnm a.out_or_elf" >&2 + exit 1 + fi + ++if file $1 | grep ELF >/dev/null 2>&1; then ++ offset=1 ++else ++ offset=2 ++fi ++ + nm -n $1 | + + awk ' +@@ -21,7 +27,7 @@ + } + + NF==3 && $2 ~ /T|t/ && $3 !~ /(\.o$)|(g(nu|cc).*compiled)/ { +- print hex($1), substr($3, 2) ++ print hex($1), substr($3, '$offset') + }' + + exit 0 +diff -ur mpr-1.1/config/mprpc.linux mpr-1.1-elf/config/mprpc.linux +--- mpr-1.1/config/mprpc.linux Tue May 7 02:46:11 1996 ++++ mpr-1.1-elf/config/mprpc.linux Mon Sep 2 13:11:34 1996 +@@ -1,10 +1,16 @@ + #!/bin/sh + + if test $# -ne 1; then +- echo "usage: mprpc a.out" >&2 ++ echo "usage: mprpc a.out_or_elf" >&2 + exit 1 + fi + ++if file $1 | grep ELF >/dev/null 2>&1; then ++ start=_start ++else ++ start=__entry ++fi ++ + nm -n $1 | + + awk ' +@@ -20,7 +26,7 @@ + return d + } + +- NF==3 && $2 ~ /T|t/ && $3 ~ /^__entry$/ { ++ NF==3 && $2 ~ /T|t/ && $3 ~ /^'$start'$/ { + a=$1 + getline + printf "%d:%d", hex(a), hex($1)-1 diff -ur --new-file old/atm/qgen/Makefile new/atm/qgen/Makefile --- old/atm/qgen/Makefile Thu Aug 29 13:40:34 1996 +++ new/atm/qgen/Makefile Sat Aug 31 14:52:39 1996 @@ -2,16 +2,22 @@ OBJS=common.o file.o first.o lex.yy.o qgen.o second.o third.o y.tab.o TRASH=q.out.h q.out.c qd.out.c qd.dump.c PGMS=qgen q.out.o qd.dump.o #qtest +NLS=atm_ai_msg atm_ai_ie atm_loc atm_cv atm_pu atm_na atm_cond atm_ie qmsg \ + atm_np atm_ton atm_sat atm_prs atm_scrn atm_vpa atm_poe q2931_cs atm_td \ + atm_bc atm_tt atm_tr atm_stc atm_upcc q2931_proto atm_flag atm_aalp atm_tag \ + atm_l2 atm_l3 atm_hl atm_imd +SYMFILES=q2931.h /usr/include/linux/atmsap.h +TRASH=default.nl include ../Rules.make qgen: $(OBJS) $(CC) $(LDFLAGS) -o qgen $(OBJS) $(LIBS) -q.out.h q.out.c q.test.c: qgen uni3x +q.out.h q.out.c q.test.c: qgen uni3x default.nl $(CC) $(STANDARDS) -E - default.nl + q.out.o: q.out.c q.out.h qlib.c qlib.h $(CC) $(CFLAGS) -c $(STANDARDS) q.out.c diff -ur --new-file old/atm/qgen/mknl.pl new/atm/qgen/mknl.pl --- old/atm/qgen/mknl.pl Thu Jan 1 01:00:00 1970 +++ new/atm/qgen/mknl.pl Sat Aug 31 13:47:31 1996 @@ -0,0 +1,29 @@ +#!/usr/bin/perl +print "# THIS IS A MACHINE-GENERATED FILE. DO NOT EDIT !\n" || die "write: $!"; +while ($line = ) { + chop($line); + next unless $line =~ /^#define\s/; + while ($line =~ m|/\*| && $line !~ m|\*/|) { $line .= ; } + $line =~ s/\s+/ /g; + if (!defined($curr) || $line !~ /^#define ${curr}_/) { + undef $curr; + for (@ARGV) { + ($tmp = $_) =~ tr/a-z/A-Z/; + next unless $line =~ /^#define ${tmp}_/; + $curr = $tmp; + print "\n:$_\n" || die "write: $!"; + last; + } + } + next unless defined $curr; + next unless $line =~ m|^#define (\S+) (\S+)( (/\*\s*(.*\S)\s*\*/))?|; +# if (defined $3) { +# print "$2=$1 $4\n" || die "write: $!"; +# } + if (defined $3) { + print "$2=$2 \\\"$5\\\"\n" || die "write: $!"; + } + else { + print "$2=$1\n" || die "write: $!"; + } +} diff -ur --new-file old/atm/qgen/q2931.h new/atm/qgen/q2931.h --- old/atm/qgen/q2931.h Thu Feb 8 13:48:09 1996 +++ new/atm/qgen/q2931.h Sat Aug 31 14:27:33 1996 @@ -1,3 +1,11 @@ +/* q2931.h - Various Q.2931 constants */ + +/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ + +/* + * Note: some values don't appear in UNI 3.0 or 3.1 but are taken from Q.2931 + */ + #ifndef Q2931_H #define Q2931_H @@ -5,6 +13,11 @@ #define MAX_Q_MSG 500 +/* Protocol discriminator */ + +#define Q2931_PROTO_DSC 9 /* Q.2931 user-network call/connection + control message */ + /* Coding Standards */ #define Q2931_CS_ITU 0 /* ITU-T standardized */ @@ -12,21 +25,21 @@ /* Message types */ -#define QMSG_SETUP 0x05 -#define QMSG_CALL_PROC 0x02 -#define QMSG_CONNECT 0x07 -#define QMSG_CONN_ACK 0x0f -#define QMSG_RELEASE 0x4d -#define QMSG_REL_COMP 0x5a -#define QMSG_RESTART 0x46 -#define QMSG_REST_ACK 0x4e -#define QMSG_STATUS 0x7d -#define QMSG_STATUS_ENQ 0x75 -#define QMSG_ADD_PARTY 0x80 -#define QMSG_ADD_PARTY_ACK 0x81 -#define QMSG_ADD_PARTY_REJ 0x82 -#define QMSG_DROP_PARTY 0x83 -#define QMSG_DROP_PARTY_ACK 0x84 +#define QMSG_SETUP 0x05 /* SETUP */ +#define QMSG_CALL_PROC 0x02 /* CALL PROCEEDING */ +#define QMSG_CONNECT 0x07 /* CONNECT */ +#define QMSG_CONN_ACK 0x0f /* CONNECT ACKNOWLEDGE */ +#define QMSG_RELEASE 0x4d /* RELEASE */ +#define QMSG_REL_COMP 0x5a /* RELEASE COMPLETE */ +#define QMSG_RESTART 0x46 /* RESTART */ +#define QMSG_REST_ACK 0x4e /* RESTART ACKNOWLEDGE */ +#define QMSG_STATUS 0x7d /* STATUS */ +#define QMSG_STATUS_ENQ 0x75 /* STATUS ENQUIRY */ +#define QMSG_ADD_PARTY 0x80 /* ADD PARTY */ +#define QMSG_ADD_PARTY_ACK 0x81 /* ADD PARTY ACKNOWLEDGE */ +#define QMSG_ADD_PARTY_REJ 0x82 /* ADD PART REJECT */ +#define QMSG_DROP_PARTY 0x83 /* DROP PARTY */ +#define QMSG_DROP_PARTY_ACK 0x84 /* DROP PARTY ACKNOWLEDGE */ /* Information element identifiers */ @@ -165,5 +178,127 @@ #define ATM_RST_ALL_VC 2 /* All virtual channels controlled by the Layer 3 entity which sends the RESTART message */ + +/* Action Indicator for messages */ + +#define ATM_AI_MSG_CLEAR 0 /* clear call */ +#define ATM_AI_MSG_DSC_IGN 1 /* discard and ignore */ +#define ATM_AI_MSG_DSC_STAT 2 /* discard and report status */ +#define ATM_AI_MSG_RSV 3 /* reserved */ + +/* Action Indicator for IEs */ + +#define ATM_AI_IE_CLEAR 0 /* clear call */ +#define ATM_AI_IE_DSCIE_PRC 1 /* discard IE and proceed */ +#define ATM_AI_IE_DSCIE_STAT 2 /* discard IE, procees, and report status */ +#define ATM_AI_IE_DSCMSG_IGN 5 /* discard message, and ignore */ +#define ATM_AI_IE_DSCMSG_STAT 6 /* discard message, and report status */ + +/* Type of number */ + +#define ATM_TON_UNKNOWN 0 /* unknown */ +#define ATM_TON_INTRNTNL 1 /* international number */ +#define ATM_TON_NATIONAL 2 /* national number */ +#define ATM_TON_NETWORK 3 /* network specific number */ +#define ATM_TON_SUBSCRIBER 4 /* subscriber number */ +#define ATM_TON_ABBRV 6 /* abbreviated number */ + +/* Numbering/addressing plan */ + +#define ATM_NP_UNKNOWN 0 /* unknown */ +#define ATM_NP_E164 1 /* ISDN numbering plan (E.164) */ +#define ATM_NP_NSAP 2 /* NSAP addressing (ISO/IEC 8348) */ +#define ATM_NP_PRIVATE 9 /* private numbering plan */ + +/* Type of sub-address */ + +#define ATM_SAT_NSAP 0 /* NSAP (Rec. X.213 ISO/IEC 8348) */ +#define ATM_SAT_USER_AES 1 /* user-specified ATM endsystem address */ +#define ATM_SAT_USER 2 /* user-specified */ + +/* Presentation indicator */ + +#define ATM_PRS_ALLOW 0 /* presentation allowed */ +#define ATM_PRS_RESTRICT 1 /* presentation restricted */ +#define ATM_PRS_NOTAVL 2 /* number not available */ + +/* Screening indicator */ + +#define ATM_SCRN_UP_NS 0 /* user-provided, not screened */ +#define ATM_SCRN_UP_VP 1 /* user-provided, verified and passed */ +#define ATM_SCRN_UP_VF 2 /* user-provided, verified and failed */ +#define ATM_SCRN_NP 3 /* network provided */ + +/* VP-associated signalling */ + +#define ATM_VPA_VPA 0 /* VP-associated signalling */ +#define ATM_VPA_EXPL 1 /* explicit indication of VPCI */ + +/* Preferred/exclusive */ + +#define ATM_POE_EXC_EXC 0 /* exclusive VPCI; exclusive VCI */ +#define ATM_POE_EXC_ANY 1 /* exclusive VPCI; any VCI */ + +/* Traffic descriptor tags */ + +#define ATM_TD_FW_PCR_0 0x82 /* Forward peak cell rate (CLP=0) */ +#define ATM_TD_BW_PCR_0 0x83 /* Backward peak cell rate (CLP=0) */ +#define ATM_TD_FW_PCR_01 0x84 /* Forward peak cell rate (CLP=0+1) */ +#define ATM_TD_BW_PCR_01 0x85 /* Backward peak cell rate (CLP=0+1) */ +#define ATM_TD_FW_SCR_0 0x88 /* Forward sustained cell rate (CLP=0) */ +#define ATM_TD_BW_SCR_0 0x89 /* Backward sustained cell rate (CLP=0) */ +#define ATM_TD_FW_SCR_01 0x90 /* Forward sustained cell rate (CLP=0+1) */ +#define ATM_TD_BW_SCR_01 0x91 /* Backward sustained cell rate (CLP=0+1)*/ +#define ATM_TD_FW_MBS_0 0xa0 /* Forward maximum burst size (CLP=0) */ +#define ATM_TD_BW_MBS_0 0xa1 /* Backward maximum burst size (CLP=0) */ +#define ATM_TD_FW_MBS_01 0xb0 /* Forward maximum burst size (CLP=0+1) */ +#define ATM_TD_BW_MBS_01 0xb1 /* Backward maximum burst size (CLP=0+1) */ +#define ATM_TD_BEST_EFFORT 0xbe /* Best effort indicator */ +#define ATM_TD_TM_OPT 0xbf /* Traffic management options */ + +/* Tagging forward/backward */ + +#define ATM_TAG_NO 0 /* Tagging not requested */ +#define ATM_TAG_YES 1 /* Tagging requested */ + +/* Bearer class */ + +#define ATM_BC_BCOB_A 1 /* BCOB-A */ +#define ATM_BC_BCOB_C 3 /* BCOB-C */ +#define ATM_BC_BCOB_X 16 /* BCOB-X */ + +/* Traffic type */ + +#define ATM_TT_NO_IND 0 /* no indication */ +#define ATM_TT_CBR 1 /* constant bit rate */ +#define ATM_TT_VBR 2 /* variable bit rate */ + +/* Timing requirements */ + +#define ATM_TR_NO_IND 0 /* no indication */ +#define ATM_TR_E2E_REQ 1 /* end-to-end timing required */ +#define ATM_TR_E2E_NRQ 2 /* end-to-end timing not required */ + +/* Susceptibility to clipping */ + +#define ATM_STC_NO 0 /* not susceptible to clipping */ +#define ATM_STC_YES 1 /* susceptible to clipping */ + +/* User-plane connection configuration */ + +#define ATM_UPCC_P2P 0 /* point-to-point */ +#define ATM_UPCC_P2M 1 /* point-to-multipoint */ + +/* Instruction field flags */ + +#define ATM_FLAG_NO 0 /* instruction field not significant */ +#define ATM_FLAG_YES 1 /* follow explicit instructions */ + +/* AAL parameter tags */ + +#define ATM_AALP_FW_MAX_SDU 0x8c /* Forward maximum CPCS-SDU size */ +#define ATM_AALP_BW_MAX_SDU 0x81 /* Backward maximum CPCS-SDU size */ +#define ATM_AALP_AAL_MODE 0x83 /* AAL mode (UNI 3.0 only) */ +#define ATM_AALP_SSCS 0x84 /* SSCS type */ #endif diff -ur --new-file old/atm/qgen/qgen.c new/atm/qgen/qgen.c --- old/atm/qgen/qgen.c Tue Jan 30 21:17:58 1996 +++ new/atm/qgen/qgen.c Sat Aug 31 14:44:15 1996 @@ -16,6 +16,7 @@ extern FIELD *def; extern int group,field,offset,varlen_fields; extern int constr_size,parser_size; +extern sym_tables,symbols; int debug = 0; @@ -61,7 +62,10 @@ close_files(); fprintf(stderr," %d groups, %d fields (%d var-len), construction area is " "%d bytes,\n",group,field,varlen_fields,(offset+7)/8); - fprintf(stderr," %d words in constructor, %d words in parser.\n", + fprintf(stderr," %d words in constructor, %d words in parser", constr_size,parser_size); + if (!dump) fprintf(stderr,".\n"); + else fprintf(stderr,",\n %d symbolic names in %d tables.\n",symbols, + sym_tables); return 0; } diff -ur --new-file old/atm/qgen/qgen.h new/atm/qgen/qgen.h --- old/atm/qgen/qgen.h Tue Jan 30 21:26:01 1996 +++ new/atm/qgen/qgen.h Sat Aug 31 13:41:35 1996 @@ -8,6 +8,20 @@ typedef enum { vt_id,vt_case,vt_multi,vt_length } VALUE_TYPE; +typedef struct _name { + const char *value; + const char *name; + struct _name *next; +} NAME; + +typedef struct _name_list { + /* --- the following fields are initialized by the parser */ + const char *list_name; + NAME *list; + int id; /* initialized to -1 = unassigned */ + struct _name_list *next; +} NAME_LIST; + typedef struct { /* --- the following fields are initialized by the parser */ VALUE_TYPE type; @@ -21,6 +35,7 @@ typedef struct _field { /* --- the following fields are initialized by the parser */ const char *id; + NAME_LIST *name_list; int size; int var_len; int pos; /* modified in the first phase */ diff -ur --new-file old/atm/qgen/ql.l new/atm/qgen/ql.l --- old/atm/qgen/ql.l Tue Apr 30 11:00:14 1996 +++ new/atm/qgen/ql.l Sat Aug 31 13:35:39 1996 @@ -55,6 +55,9 @@ include[\ \t]+\"[^\"\n\t]+\" | include[\ \t]+\<[^\<\>\n\t]+\> { yylval.str = ident(yytext); return TOK_INCLUDE; } +\"[^\"\n\t]+\" { *strrchr(yytext,'"') = 0; + yylval.str = ident(yytext+1); + return TOK_STRING; } [#;][^\n]*\n lineno++; . return *yytext; diff -ur --new-file old/atm/qgen/ql.y new/atm/qgen/ql.y --- old/atm/qgen/ql.y Thu May 9 15:47:34 1996 +++ new/atm/qgen/ql.y Sat Aug 31 14:51:56 1996 @@ -5,12 +5,20 @@ #include +#include +#include +#include +#include #include "common.h" #include "qgen.h" #include "file.h" +#define MAX_TOKEN 256 +#define DEFAULT_NAMELIST_FILE "default.nl" + + typedef struct _macro { const char *id; FIELD *block; @@ -24,6 +32,62 @@ static int repeated = 0; /* current macro contains repeatitions */ static int repeating = 0; /* ancestor is repeated */ + +static NAME_LIST *get_name_list(const char *name) +{ + static NAME_LIST *name_lists = NULL; + FILE *file; + NAME_LIST *list; + NAME *last,*this; + char line[MAX_TOKEN+1]; + char path[PATH_MAX+1]; + char *start,*here,*walk; + int searching,found; + + for (list = name_lists; list; list = list->next) + if (list->list_name == name) return list; + sprintf(path,"%s.nl",name); + if (!(file = fopen(path,"r")) && !(file = fopen(strcpy(path, + DEFAULT_NAMELIST_FILE),"r"))) yyerror("can't open list file"); + list = alloc_t(NAME_LIST); + list->list_name = name; + list->list = last = NULL; + list->id = -1; + list->next = name_lists; + name_lists = list; + searching = 1; + found = 0; + while (fgets(line,MAX_TOKEN,file)) { + for (start = line; *start && isspace(*start); start++); + if (!*start || *start == '#') continue; + if ((here = strchr(start,'\n'))) *here = 0; + for (walk = strchr(start,0)-1; walk > start && isspace(*walk); walk--) + *walk = 0; + if (*start == ':') { + if (!(searching = strcmp(start+1,name))) + if (found) yyerror("multiple entries"); + else found = 1; + continue; + } + if (searching) continue; + if (!(here = strchr(start,'='))) yyerror("invalid name list"); + *here++ = 0; + for (walk = here-2; walk > start && isspace(*walk); walk--) + *walk = 0; + while (*here && isspace(*here)) here++; + this = alloc_t(NAME); + this->value = stralloc(start); + this->name = stralloc(here); + this->next = NULL; + if (last) last->next = this; + else list->list = this; + last = this; + } + (void) fclose(file); + if (!found) yyerror("no symbol list entry found"); + return list; +} + %} %union { @@ -33,11 +97,12 @@ VALUE *value; VALUE_LIST *list; TAG *tag; + NAME_LIST *nlist; }; %token TOK_BREAK TOK_CASE TOK_DEF TOK_DEFAULT TOK_LENGTH TOK_MULTI %token TOK_RECOVER -%token TOK_ID TOK_INCLUDE +%token TOK_ID TOK_INCLUDE TOK_STRING %type rep_block block fields field field_cont %type repetition opt_break opt_pos decimal opt_more opt_recover @@ -45,6 +110,7 @@ %type tags rep_tags %type list %type opt_id +%type opt_name_list %% @@ -149,11 +215,12 @@ ; field: - opt_break TOK_ID '<' field_cont + opt_break TOK_ID opt_name_list '<' field_cont { TAG *walk; - $$ = $4; + $$ = $5; + $$->name_list = $3; $$->brk = $1; $$->id = $2; if ($$->var_len == -2) { @@ -286,6 +353,17 @@ $$ = 1; } ; + +opt_name_list: + { + $$ = NULL; + } + | TOK_STRING + { + $$ = get_name_list($1); + } + ; + tags: { $$ = NULL; diff -ur --new-file old/atm/qgen/qlib.c new/atm/qgen/qlib.c --- old/atm/qgen/qlib.c Thu Aug 29 13:42:45 1996 +++ new/atm/qgen/qlib.c Sat Aug 31 14:27:16 1996 @@ -9,8 +9,10 @@ int q_dump = 0; #endif - -#ifdef STANDALONE +#ifndef STANDALONE +#define DUMP qd_dump +#else +#define DUMP printf #include #include @@ -39,6 +41,15 @@ #endif +#define LENGTH_STACK 10 + + +typedef struct { + int pos,size; + unsigned char *start; +} LEN_BUF; + + static int q_test(unsigned char *table,int pos) { return !!(table[pos >> 3] & (1 << (pos & 7))); @@ -297,17 +308,6 @@ return len; } -#endif - - -#define LENGTH_STACK 10 - - -typedef struct { - int pos,size; - unsigned char *start; -} LEN_BUF; - static int q_compose(Q_DSC *dsc,unsigned char *buf,int size) { @@ -416,6 +416,8 @@ } } +#endif + static int _q_parse(Q_DSC *dsc,unsigned char *buf,int size) { @@ -437,27 +439,27 @@ unsigned long value; int len; - for (i = dump_fields[*pc].level; i; i--) printf(" "); - printf("%s =",dump_fields[*pc++].name); + for (i = dump_fields[*pc].level; i; i--) DUMP(" "); + DUMP("%s =",dump_fields[*pc++].name); len = *pc == OP_COPYVAR ? (end-pos)*8 : pc[3]; if (len <= 32) { const SYM_NAME *sym; value = q_get(pos,pc[2] & 7,pc[3]); if (!(sym = dump_fields[pc[-1]].sym)) - printf(" %ld (0x%lx)\n",value,value); + DUMP(" %ld (0x%lx)\n",value,value); else { while (sym->name) if (sym->value == value) break; else sym++; - if (sym->name) printf(" %s\n",sym->name); - else printf(" %ld (0x%lx)\n",value,value); + if (sym->name) DUMP(" %s\n",sym->name); + else DUMP(" %ld (0x%lx)\n",value,value); } } else { for (i = 0; i < len/8; i++) - printf(" %02x",pos[pc[1]/8+i]); - putchar('\n'); + DUMP(" %02x",pos[pc[1]/8+i]); + DUMP("\n"); } } break; @@ -539,7 +541,7 @@ break; } if (!len) { - q_report(Q_ERROR,"case failed (pc %d)",pc-construct); + q_report(Q_ERROR,"case failed (pc %d)",pc-parse); return -1; } } @@ -619,8 +621,10 @@ { int size; +#ifndef DUMP_MODE if (dsc->buffer && !dsc->error) size = q_compose(dsc,dsc->buffer,dsc->buf_size); +#endif free(dsc->data); free(dsc->required); free(dsc->field_present); diff -ur --new-file old/atm/qgen/qlib.h new/atm/qgen/qlib.h --- old/atm/qgen/qlib.h Thu Aug 29 13:31:05 1996 +++ new/atm/qgen/qlib.h Fri Aug 30 21:04:20 1996 @@ -29,6 +29,10 @@ extern int q_dump; extern void q_report(int severity,const char *msg,...); +#if defined(DUMP_MODE) && !defined(STANDALONE) +extern void qd_dump(const char *fmt,...); +#endif + typedef struct { unsigned char *data; diff -ur --new-file old/atm/qgen/second.c new/atm/qgen/second.c --- old/atm/qgen/second.c Wed Mar 6 19:25:44 1996 +++ new/atm/qgen/second.c Sat Aug 31 14:42:19 1996 @@ -10,6 +10,7 @@ #include "file.h" +int sym_tables = 0,symbols = 0; static int unique; @@ -43,6 +44,7 @@ if (walk->value) switch (walk->value->type) { case vt_id: + break; case vt_case: case vt_multi: for (scan = walk->value->tags; scan; scan = scan->next) @@ -175,34 +177,55 @@ static void symbolic_names(FIELD *start) { FIELD *walk; + NAME *name; TAG *scan; VALUE_LIST *tag; for (walk = start; walk; walk = walk->next) { - if (walk->value) { - to_dump("static SYM_NAME dump_sym_%d[] = {\n",walk->seq); - switch (walk->value->type) { - case vt_id: - to_dump(" { %s, \"%s\" },\n",walk->value->id, - walk->value->id); - break; - case vt_case: - case vt_multi: - for (scan = walk->value->tags; scan; scan = scan->next) { - to_dump(" { %s, \"%s\" },\n",scan->value, - scan->value); - for (tag = scan->more; tag; tag = tag->next) - to_dump(" { %s, \"%s\" },\n",tag->value, - tag->value); - } - break; - case vt_length: - break; - default: - abort(); + if (walk->name_list ? walk->name_list->id == -1 : !!walk->value) { + if (walk->name_list) { + to_dump("static SYM_NAME dump_sym_%d[] = { /* %s */\n", + walk->seq,walk->name_list->list_name); + sym_tables++; + walk->name_list->id = walk->seq; + for (name = walk->name_list->list; name; name = name->next) { + to_dump(" { %s, \"%s\" },\n",name->value,name->name); + symbols++; + } + } + else { + to_dump("static SYM_NAME dump_sym_%d[] = {\n",walk->seq); + sym_tables++; + switch (walk->value->type) { + case vt_id: + to_dump(" { %s, \"%s\" },\n",walk->value->id, + walk->value->id); + symbols++; + break; + case vt_case: + case vt_multi: + for (scan = walk->value->tags; scan; scan = scan->next) + { + to_dump(" { %s, \"%s\" },\n",scan->value, + scan->value); + symbols++; + for (tag = scan->more; tag; tag = tag->next) { + to_dump(" { %s, \"%s\" },\n",tag->value, + tag->value); + symbols++; + } + } + break; + case vt_length: + break; + default: + abort(); + } } to_dump(" { 0, NULL }\n};\n\n"); - switch (walk->value->type) { + } + if (walk->value) + switch (walk->value->type) { case vt_id: break; case vt_case: @@ -216,7 +239,6 @@ default: abort(); } - } } } diff -ur --new-file old/atm/qgen/third.c new/atm/qgen/third.c --- old/atm/qgen/third.c Fri Mar 1 15:38:25 1996 +++ new/atm/qgen/third.c Sat Aug 31 14:23:15 1996 @@ -109,11 +109,11 @@ brks = brk; } if (dump) { - if (!walk->value || walk->value->type != vt_multi) + if ((!walk->value || walk->value->type != vt_multi) && walk->size) code("%s%d\n","OP_DUMP",walk->seq); - if (walk->value) - to_dump(" { %d, dump_sym_%d, \"%s\" },\n",level,walk->seq, - walk->id); + if (walk->value || walk->name_list) + to_dump(" { %d, dump_sym_%d, \"%s\" },\n",level, + walk->name_list ? walk->name_list->id : walk->seq,walk->id); else to_dump(" { %d, NULL, \"%s\" },\n",level,walk->id); } if (!walk->value) { @@ -195,15 +195,18 @@ void third(FIELD *def) { - to_c("\n/*\n"); - to_c(" * \"Microcode\" used to construct messages. It copies all\n"); - to_c(" * fields from the construction area to the resulting message.\n"); - to_c(" */\n\n"); - to_c("static int construct[] = {\n"); - begin_code(); - construct(def); - constr_size = end_code()+1; - to_c(" OP_END\n};\n\n"); + if (dump) constr_size = 0; + else { + to_c("\n/*\n"); + to_c(" * \"Microcode\" used to construct messages. It copies all\n"); + to_c(" * fields from the construction area to the resulting message."); + to_c("\n */\n\n"); + to_c("static int construct[] = {\n"); + begin_code(); + construct(def); + constr_size = end_code()+1; + to_c(" OP_END\n};\n\n"); + } to_c("\n/*\n * \"Microcode\" used to parse messages. It detects the\n"); to_c(" * presence of fields and copies them from the message to the\n"); to_c(" * construction area.\n */\n\n"); diff -ur --new-file old/atm/qgen/uni3x new/atm/qgen/uni3x --- old/atm/qgen/uni3x Wed Jul 31 19:51:22 1996 +++ new/atm/qgen/uni3x Sat Aug 31 14:49:07 1996 @@ -13,13 +13,11 @@ include "q2931.h" -#define Q2931_PROTO_DSC 9 - #define VAR_STD_HDR(name,defl) \ _ext <1@8,more> = 1 \ - name##_cs <2@6,more> = defl \ - _flag <1@5,more> = 0 \ - _action_ind <3@1> = 0 /* only 2 bits in UNI 3.0 */ \ + name##_cs "q2931_cs" <2@6,more> = defl \ + _flag "atm_flag" <1@5,more> = ATM_FLAG_NO \ + _action_ind "atm_ai_ie" <3@1> = 0 /* only 2 bits in UNI 3.0 */ \ _ie_len <16> = recover length #define ITU_STD_HDR VAR_STD_HDR(,Q2931_CS_ITU) @@ -30,19 +28,19 @@ ITU_STD_HDR { aal_type <8> = case { 5 { - _id <8> = multi { - 0x8c { + _id "atm_aalp" <8> = multi { + ATM_AALP_FW_MAX_SDU { fw_max_sdu <16> } - 0x81 { + ATM_AALP_BW_MAX_SDU { bw_max_sdu <16> } #if defined(UNI30) || defined(ALLOW_UNI30) - 0x83 { + ATM_AALP_AAL_MODE { aal_mode <8> # UNI 3.0 only } #endif - 0x84 { + ATM_AALP_SSCS { sscs_type <8> } } @@ -54,49 +52,49 @@ def ie_td = { # UNI 3.0 calls this "User Cell Rate" ITU_STD_HDR { - _id <8> = multi { - 0x82 { + _id "atm_td" <8> = multi { + ATM_TD_FW_PCR_0 { fw_pcr_0 <24> } - 0x83 { + ATM_TD_BW_PCR_0 { bw_pcr_0 <24> } - 0x84 { + ATM_TD_FW_PCR_01 { fw_pcr_01 <24> } - 0x85 { + ATM_TD_BW_PCR_01 { bw_pcr_01 <24> } - 0x88 { + ATM_TD_FW_SCR_0 { fw_scr_0 <24> } - 0x89 { + ATM_TD_BW_SCR_0 { bw_scr_0 <24> } - 0x90 { + ATM_TD_FW_SCR_01 { fw_scr_01 <24> } - 0x91 { + ATM_TD_BW_SCR_01 { bw_scr_01 <24> } - 0xa0 { + ATM_TD_FW_MBS_0 { fw_mbs_0 <24> } - 0xa1 { + ATM_TD_BW_MBS_0 { bw_mbs_0 <24> } - 0xb0 { + ATM_TD_FW_MBS_01 { fw_mbs_01 <24> } - 0xb1 { + ATM_TD_BW_MBS_01 { bw_mbs_01 <24> } - 0xbe { + ATM_TD_BEST_EFFORT { best_effort <0> } - 0xbf { - bw_tag <1@2,more> - fw_tag <1@1> + ATM_TD_TM_OPT { + bw_tag "atm_tag" <1@2,more> + fw_tag "atm_tag" <1@1> } } } @@ -105,18 +103,18 @@ def ie_bbcap = { ITU_STD_HDR { - bearer_class <5@1,more> + bearer_class "atm_bc" <5@1,more> _ext <1@8> = case { 0 { _ext <1@8,more> = 1 - traf_type <3@3,more> = 0 - tim_req <2@1> = 0 + traf_type "atm_tt" <3@3,more> = ATM_TT_NO_IND + tim_req "atm_tr" <2@1> = ATM_TR_NO_IND } default 1 {} } _ext <1@8,more> = 1 - susc_clip <2@6,more> = 0 - upcc <2@1> = 0 + susc_clip "atm_stc" <2@6,more> = ATM_STC_NO + upcc "atm_upcc" <2@1> = ATM_UPCC_P2P } } @@ -152,13 +150,13 @@ uil1_proto <5@1> } 2 { - uil2_proto <5@1,more> = case { + uil2_proto "atm_l2" <5@1,more> = case { ATM_L2_X25_LL,ATM_L2_X25_ML,ATM_L2_HDLC_ARM, ATM_L2_HDLC_NRM,ATM_L2_HDLC_ABM,ATM_L2_Q922, ATM_L2_ISO7776 { # CCITT encoding _ext <1@8> = case { 0 { - l2_mode <2@6,more> = ATM_IMD_NORMAL + l2_mode "atm_imd" <2@6,more> = ATM_IMD_NORMAL q933 <2@1,more> = 0 _ext <1@8> = case { 0 { @@ -182,11 +180,11 @@ } } 3 { - uil3_proto <5@1,more> = case { + uil3_proto "atm_l3" <5@1,more> = case { ATM_L3_X25,ATM_L3_ISO8208,ATM_L3_X223 { # CCITT coding _ext <1@8> = case { 0 { - l3_mode <2@6,more> = ATM_IMD_NORMAL + l3_mode "atm_imd" <2@6,more> = ATM_IMD_NORMAL _ext <1@8> = case { 0 { def_pck_size <4@1> @@ -251,13 +249,13 @@ def ie_cdpn = { ITU_STD_HDR { _ext <1@8,more> = 1 - _plan <4@1,more> = case { - 1 { # E.164 - _type <3@5> = 1 + _plan "atm_np" <4@1,more> = case { + ATM_NP_E164 { + _type "atm_ton" <3@5> = ATM_TON_INTRNTNL cdpn_e164 <-40> # @@@ fix this } - 2 { # ATM Endsystem Address - _type <3@5> = 0 + ATM_NP_NSAP { # ATM Endsystem Address + _type "atm_ton" <3@5> = ATM_TON_UNKNOWN cdpn_esa <-160> } } @@ -269,10 +267,10 @@ ITU_STD_HDR { _ext <1@8,more> = 1 #ifdef UNI30 - _type <3@5,more> = 0 + _type "atm_sat" <3@5,more> = ATM_SAT_NSAP #endif #ifdef UNI31 - cdps_type <3@5,more> = 0 + cdps_type "atm_sat" <3@5,more> = ATM_SAT_NSAP #endif _oddeven <1@4> = 0 cdps <-160> @@ -282,13 +280,13 @@ def ie_cgpn = { # @@@ extend language to allow same trick as for cdpn ITU_STD_HDR { - cgpn_plan <4@1,more> - cgpn_type <2@6,more> + cgpn_plan "atm_np" <4@1,more> + cgpn_type "atm_ton" <2@6,more> _ext <1@8> = case { 0 { _ext <1@8,more> = 1 - pres_ind <2@6,more> = 0 - scr_ind <2@1> = 0 + pres_ind "atm_prs" <2@6,more> = ATM_PRS_ALLOW + scr_ind "atm_scrn" <2@1> = ATM_SCRN_UP_NS } default 1 {} } @@ -301,10 +299,10 @@ ITU_STD_HDR { _ext <1@8,more> = 1 #ifdef UNI30 - _type <3@5,more> = 0 + _type "atm_sat" <3@5,more> = ATM_SAT_NSAP #endif #ifdef UNI31 - cgps_type <3@5,more> = 0 + cgps_type "atm_sat" <3@5,more> = ATM_SAT_NSAP #endif _oddeven <1@4> = 0 cgps <-160> @@ -315,26 +313,26 @@ def ie_cause = { VAR_STD_HDR(cause,Q2931_CS_ITU) { _ext <1@8,more> = 1 - location <4@1> = ATM_LOC_USER + location "atm_loc" <4@1> = ATM_LOC_USER _ext <1@8,more> = 1 - cause <7@1> = case { + cause "atm_cv" <7@1> = case { ATM_CV_UNALLOC,ATM_CV_NO_ROUTE_DEST,ATM_CV_QOS_UNAVAIL { # Note 2 break _ext <1@8,more> = 1 - pu <1@4,more> = ATM_PU_USER - na <1@3,more> = ATM_NA_NORMAL - cond2 <2@1> = ATM_COND_UNKNOWN + pu "atm_pu" <1@4,more> = ATM_PU_USER + na "atm_na" <1@3,more> = ATM_NA_NORMAL + cond2 "atm_cond" <2@1> = ATM_COND_UNKNOWN } ATM_CV_CALL_REJ { # Note 3 break _ext <1@8,more> = 1 - cond3 <2@1,more> = ATM_COND_UNKNOWN + cond3 "atm_cond" <2@1,more> = ATM_COND_UNKNOWN reason <5@3> = case { ATM_RSN_USER { user_diag <-216> } ATM_RSN_IE_MISS,ATM_RSN_IE_INSUFF { - ie_id3 <8> + ie_id3 "atm_ie" <8> } } } @@ -362,7 +360,7 @@ } ATM_CV_UNKNOWN_MSG_TYPE,ATM_CV_INCOMP_MSG { # Note 10 break - bad_msg_type <8> + bad_msg_type "qmsg" <8> } ATM_CV_TIMER_EXP { # Note 11 break @@ -377,8 +375,8 @@ def ie_conn_id = { ITU_STD_HDR { _ext <1@8,more> = 1 - _vp_ass <2@4,more> = 1 /* explicit */ - _pref_exc <3@1> = 0 + _vp_ass "atm_vpa" <2@4,more> = 1 /* explicit */ + _pref_exc "atm_poe" <3@1> = 0 vpi <16> vci <16> } @@ -455,15 +453,15 @@ { - _pdsc <8> = Q2931_PROTO_DSC + _pdsc "q2931_proto" <8> = Q2931_PROTO_DSC _cr_len <8> = 3 call_ref <24> - msg_type <8> + msg_type "qmsg" <8> _ext <1@8,more> = 1 - _flag <1@5,more> = 0 # Message instruction field not significant - _action_ind <2@1> = 0 + _flag "atm_flag" <1@5,more> = ATM_FLAG_NO + _action_ind "atm_ai_msg" <2@1> = 0 msg_len <16> = length { - _ie_id <8> = multi { + _ie_id "atm_ie" <8> = multi { aal: ATM_IE_AAL ie_aal td: ATM_IE_TD ie_td bbcap: ATM_IE_BBCAP ie_bbcap diff -ur --new-file old/atm/sigd/Makefile new/atm/sigd/Makefile --- old/atm/sigd/Makefile Thu Aug 29 14:01:08 1996 +++ new/atm/sigd/Makefile Mon Sep 2 19:41:43 1996 @@ -4,7 +4,8 @@ q.out.o qd.dump.o lex.yy.o y.tab.o BOOTPGMS=atmsigd TRASH=q.out.h q.out.o qd.dump.o mess.c -MANS= +MAN4=atmsigd.conf.4 +MAN8=atmsigd.8 include ../Rules.make CFLAGS += $(STANDARDS) diff -ur --new-file old/atm/sigd/atmsigd.8 new/atm/sigd/atmsigd.8 --- old/atm/sigd/atmsigd.8 Thu Jan 1 01:00:00 1970 +++ new/atm/sigd/atmsigd.8 Sun Sep 1 11:26:05 1996 @@ -0,0 +1,78 @@ +.TH ATMSIGD 8 "Sep 1, 1996" "Linux" "Maintenance Commands" +.SH NAME +atmsigd \- ATM signaling demon +.SH SYNOPSIS +.B atmsigd +.RB [ \-b ] +.RB [ \-c\ \fIconfig_file\fP ] +.RB [ \-d ] +.RB [ \-D\ \fIdump_dir\fP ] +.RB [ \-l\ \fIlogfile\fP ] +.RB [ \-n ] +.RB [ \-N ] +.RB [ \-P\ \fIpcr\fP ] +.RB [ \-t\ \fItrace_length\fP ] +.SH DESCRIPTION +\fBatmsigd\fP implements the ATM UNI signaling protocol. Requests to +establish, accept, or close ATM SVCs are sent from the kernel (using a +comparably simple protocol) to the signaling demon, which then performs +the dialog with the network. +.P +Note that \fBatmsigd\fP is not able to accept or establish connections +until the local ATM address of the interface is configured by \fBilmid\fP +or manually using \fBatmaddr\fP. +.SH OPTIONS +.IP \fB\-b\fP +Run in background (i.e. in a forked child process) after initializing. +.IP \fB\-c\ \fIconfig_file\fP +Use the specified configuration file instead of \fB/etc/atmsigd.conf\fP +.IP \fB\-d\fP +Enables (lots of) debugging output. By default, \fBatmsigd\fP is comparably +quiet. +.IP \fB\-D\ \fIdump_dir\fP +Specifies the directory to which \fBatmsigd\fP will write status and trace +dumps. If tracing is not yet enabled, the trace size is automatically +set to a (small) default value. +.IP \fB\-l\ \fIlogfile\fP +Write diagnostic messages to the specified file instead of to standard +error. The special name \fBsyslog\fP is used to send diagnostics to the +system logger. +.IP \fB\-n\fP +Prints addresses in numeric format only, i.e. no address to name translation +is attempted. +.IP \fB\-N\fP +Makes \fPatmsigd\fB behave like the network side of the UNI (useful if you +have two PCs but no switch). Normally, it acts as the user side. +.IP \fB\-P\ \fIpcr\fP +Configures the signaling VC to use CBR at the specified peak cell rate. +By default, UBR is used on the signaling VC +.IP \fB\-t\ \fItrace_length\fP +Enables tracing and sets the number +of entries that should be kept in the trace buffer. +.SH FILES +.PD 0 +.TP 25 +.B /etc/atmsigd.conf +configuration file +.PD +.SH DEBUGGING +When receiving a \fBSIGUSR1\fP signals, \fBatmsigd\fP dumps the list of all +internal socket descriptors. With \fBSIGUSR2\fP, it dumps the contents of +the trace buffer. If a dump directory was set, dumps are written to files +called \fBatmsigd.\fIpid\fB.status.\fInumber\fP and +\fBatmsigd.\fIpid\fB.trace.\fInumber\fP, respectively, with \fInumber\fP +starting at zero and being incremented for every dump. If no dump directory +is set, dumps are written to standard error. +.P +Dumps are also generated whenever \fBatmsigd\fP detects a fatal error and +terminates. No attempt is made to catch signals like \fBSIGSEGV\fP. +.SH BUGS +The generation of traces is a comparably slow +process which may already take several seconds for only 100 trace entries. +To generate a trace dump, \fBatmsigd\fP therefore forks a child process that +runs in parallel to the signaling demon. +.SH AUTHOR +Werner Almesberger, EPFL LRC +.SH "SEE ALSO" +atmaddr(8), atmsigd.conf(4), ilmid(8) +.\"{{{}}} diff -ur --new-file old/atm/sigd/atmsigd.c new/atm/sigd/atmsigd.c --- old/atm/sigd/atmsigd.c Thu Aug 29 14:07:41 1996 +++ new/atm/sigd/atmsigd.c Mon Sep 2 17:50:58 1996 @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -26,6 +27,11 @@ #define CONFIG_FILE "/etc/atmsigd.conf" +#ifdef MEM_DEBUG +extern int mpr(void); +extern int mcheck (void (*)(int)); +#endif + extern int yyparse(void); extern FILE *yyin; @@ -33,16 +39,13 @@ int debug = 0; int pretty = A2T_PRETTY | A2T_NAME; int sig_pcr = -1; +const char *dump_dir = NULL; -static SAAL_DSC saal; +/* ------------------------------ SAAL relays ------------------------------ */ -static void usage(const char *name) -{ - fprintf(stderr,"usage: %s [ -b ] [ -c config_file ] [ -d ] [ -l logfile ] " - "[ -n ] [ -N ] [ -P pcr ]\n",name); - exit(1); -} + +static SAAL_DSC saal; static void q_estab_conf(void *user_data,void *uu_data,int uu_length) @@ -103,20 +106,26 @@ }; -static void dump_sap(const char *label,struct sockaddr_atmsvc *sap) +/* -------------------------------- signals -------------------------------- */ + + +static volatile int got_usr1 = 0,got_usr2 = 0; + + +static void dump_sap(FILE *file,const char *label,struct sockaddr_atmsvc *sap) { struct atm_blli *blli; int i,length; if (!sap) return; - fprintf(stderr," %s ",label); + fprintf(file," %s ",label); if (*sap->sas_addr.pub) - fprintf(stderr,"%s%s",sap->sas_addr.pub,*sap->sas_addr.prv ? "+": + fprintf(file,"%s%s",sap->sas_addr.pub,*sap->sas_addr.prv ? "+": "\n "); if (*sap->sas_addr.prv) { for (i = 0; i < ATM_ESA_LEN; i++) - fprintf(stderr,"%02X",sap->sas_addr.prv[i]); - fprintf(stderr,"\n "); + fprintf(file,"%02X",sap->sas_addr.prv[i]); + fprintf(file,"\n "); } if (sap->sas_addr.bhli.hl_type) { length = @@ -125,15 +134,15 @@ #endif sap->sas_addr.bhli.hl_type == ATM_HL_VENDOR ? 7 : sap->sas_addr.bhli.hl_length; - fprintf(stderr,"BHLI %d[%d] = { ",sap->sas_addr.bhli.hl_type,length); + fprintf(file,"BHLI %d[%d] = { ",sap->sas_addr.bhli.hl_type,length); for (i = 0; i < length; i++) - fprintf(stderr,"%s%02X",i ? "," : "",sap->sas_addr.bhli.hl_info[i]); - fprintf(stderr," }\n "); + fprintf(file,"%s%02X",i ? "," : "",sap->sas_addr.bhli.hl_info[i]); + fprintf(file," }\n "); } for (blli = sap->sas_addr.blli; blli; blli = blli->next) { - fprintf(stderr,"BLLI"); + fprintf(file,"BLLI"); if (blli->l2_proto) { - fprintf(stderr," L2 %d",blli->l2_proto); + fprintf(file," L2 %d",blli->l2_proto); switch (blli->l2_proto) { case ATM_L2_X25_LL: case ATM_L2_X25_ML: @@ -142,60 +151,134 @@ case ATM_L2_HDLC_ABM: case ATM_L2_Q922: case ATM_L2_ISO7776: - fprintf(stderr," mode=%d, window=%d\n ", + fprintf(file," mode=%d, window=%d\n ", blli->l2.itu.mode,blli->l2.itu.window); break; case ATM_L2_USER: - fprintf(stderr," user=0x%x\n ",blli->l2.user); + fprintf(file," user=0x%x\n ",blli->l2.user); break; default: - fprintf(stderr,"\n "); + fprintf(file,"\n "); } } if (blli->l3_proto) { - fprintf(stderr," L3 %d",blli->l3_proto); + fprintf(file," L3 %d",blli->l3_proto); switch (blli->l3_proto) { case ATM_L3_X25: case ATM_L3_ISO8208: case ATM_L3_X223: - fprintf(stderr," mode=%d, def=%d, pack=%d\n ", + fprintf(file," mode=%d, def=%d, pack=%d\n ", blli->l3.itu.mode,blli->l3.itu.def_size, blli->l3.itu.window); break; case ATM_L3_TR9577: - fprintf(stderr," ipi=0x%x",blli->l3.tr9577.ipi); + fprintf(file," ipi=0x%x",blli->l3.tr9577.ipi); if (blli->l3.tr9577.ipi != NLPID_IEEE802_1_SNAP) - fprintf(stderr,"\n "); + fprintf(file,"\n "); else { for (i = 0; i < 5; i++) - fprintf(stderr,"%s%02X",i ? "," : " ", + fprintf(file,"%s%02X",i ? "," : " ", blli->l3.tr9577.snap[i]); - fprintf(stderr,"\n "); + fprintf(file,"\n "); } break; case ATM_L3_USER: - fprintf(stderr," user=0x%x\n ",blli->l3.user); + fprintf(file," user=0x%x\n ",blli->l3.user); break; default: - fprintf(stderr,"\n "); + fprintf(file,"\n "); } } } - fprintf(stderr,"\r"); + fprintf(file,"\n"); } -static void dump_status(int sig) +static void dump_status(FILE *file,const char *banner) { SOCKET *walk; - fprintf(stderr,"Status dump (on SIGUSR1)\n"); + if (sockets) fprintf(file,"%s\n\n",banner); for (walk = sockets; walk; walk = walk->next) { - fprintf(stderr,"0x%lx: %s, CR 0x%06lX, PVC %d.%d.%d\n",(unsigned long) + fprintf(file,"0x%lx: %s, CR 0x%06lX, PVC %d.%d.%d\n",(unsigned long) walk->id,state_name[walk->state],walk->call_ref, walk->pvc.sap_addr.itf,walk->pvc.sap_addr.vpi,walk->pvc.sap_addr.vci); - dump_sap("local ",walk->local); - dump_sap("remote",walk->remote); + dump_sap(file,"local ",walk->local); + dump_sap(file,"remote",walk->remote); + } +} + + +static void dump_trace(FILE *file,const char *banner) +{ + static int busy = 0; + char *trace; + + if (busy++) abort(); + trace = get_trace(); + if (trace) { + fprintf(file,"%s\n\n",banner); + fprintf(file,"%s",trace); + } + busy--; +} + + +void poll_signals(void) +{ + static status_num = 0,trace_num = 0; + char path[PATH_MAX+1]; + FILE *file; + + if (got_usr1) { + got_usr1 = 0; + if (!dump_dir) file = stderr; + else { + sprintf(path,"atmsigd.%d.status.%d",getpid(),status_num++); + if ((file = fopen(path,"w"))) + diag(COMPONENT,DIAG_INFO,"Dumping to %s",path); + else { + perror(path); + file = stderr; + } + } + dump_status(file,"Status dump (on SIGUSR1)"); + if (file != stderr) (void) fclose(file); + } + if (got_usr2) { + pid_t pid; + + got_usr2 = 0; + if (!dump_dir) file = stderr; + else { + sprintf(path,"atmsigd.%d.trace.%d",getpid(),trace_num++); + if ((file = fopen(path,"w"))) + diag(COMPONENT,DIAG_INFO,"Dumping to %s",path); + else { + perror(path); + file = stderr; + } + } + if (!(pid = fork())) + dump_trace(file,"Message trace (on SIGUSR2)"); + else if (pid < 0) perror("fork"); + if (file != stderr) (void) fclose(file); + if (!pid) exit(0); + } +} + + +static void handle_signal(int sig) +{ + switch (sig) { + case SIGUSR1: + got_usr1 = 1; + break; + case SIGUSR2: + got_usr2 = 1; + break; + default: + break; } } @@ -204,13 +287,48 @@ { struct sigaction act; - act.sa_handler = dump_status; + (void) signal(SIGCHLD,SIG_IGN); /* reap children automatially */ + act.sa_handler = handle_signal; sigemptyset(&act.sa_mask); act.sa_flags = 0; if (sigaction(SIGUSR1,&act,NULL) < 0) { perror("sigaction"); exit(1); } + if (sigaction(SIGUSR2,&act,NULL) < 0) { + perror("sigaction"); + exit(1); + } +} + + +/* ------------------------------- main ... ------------------------------- */ + + +static void trace_on_exit(int status,void *dummy) +{ + char path[PATH_MAX+1]; + FILE *file; + + if (!status) return; + if (dump_dir) file = stderr; + else { + sprintf(path,"atmsigd.%d.trace.exit",getpid()); + if (!(file = fopen(path,"w"))) { + perror(path); + file = stderr; + } + } + dump_trace(file,"Message trace (after error exit)"); + if (file != stderr) (void) fclose(file); +} + + +static void usage(const char *name) +{ + fprintf(stderr,"usage: %s [ -b ] [ -c config_file ] [ -d ] [ -D dump_dir ]" + " [ -l logfile ] [ -n ] [ -N ] [ -P pcr ] [ -t trace_length ]\n",name); + exit(1); } @@ -220,12 +338,17 @@ char *end; int c,background; +#ifdef MEM_DEBUG + if (getenv("MCHECK")) mcheck(0); + if (mpr() < 0) return 1; +#endif set_application("atmsigd"); config_file = CONFIG_FILE; + dump_dir = NULL; background = 0; memset(&signaling_pvc,0,sizeof(signaling_pvc)); signaling_pvc.sap_addr.vci = 5; - while ((c = getopt(argc,argv,"bc:dl:nNP:")) != EOF) + while ((c = getopt(argc,argv,"bc:dD:l:nNP:t:")) != EOF) switch (c) { case 'b': background = 1; @@ -240,6 +363,10 @@ debug = 1; /*q_dump = 1;*/ break; + case 'D': + dump_dir = optarg; + if (!trace_size) trace_size = DEFAULT_TRACE_SIZE; + break; case 'l': set_logfile(optarg); break; @@ -253,6 +380,10 @@ sig_pcr = strtol(optarg,&end,0); if (*end) usage(argv[0]); break; + case 't': + trace_size = strtol(optarg,&end,0); + if (*end) usage(argv[0]); + break; default: usage(argv[0]); } @@ -274,6 +405,9 @@ diag(COMPONENT,DIAG_FATAL,"Error in config file. - Aborting."); return 1; } + if (dump_dir) + if (chdir(dump_dir) < 0) + diag(COMPONENT,DIAG_ERROR,"chdir %s: %s",dump_dir,strerror(errno)); diag(COMPONENT,DIAG_INFO,"Acting as %s side",net ? "NETWORK" : "USER"); if (open_all()) return 1; init_addr(); @@ -292,6 +426,7 @@ exit(0); } } + (void) on_exit(trace_on_exit,NULL); poll_loop(); close_all(); stop_saal(&saal); diff -ur --new-file old/atm/sigd/atmsigd.conf.4 new/atm/sigd/atmsigd.conf.4 --- old/atm/sigd/atmsigd.conf.4 Thu Jan 1 01:00:00 1970 +++ new/atm/sigd/atmsigd.conf.4 Sat Aug 31 19:24:24 1996 @@ -0,0 +1,97 @@ +.TH ATMSIGD.CONF 4 "Aug 31, 1996" "Linux" "File Formats" +.SH NAME +atmsigd.conf \- configuration file for the ATM signaling demon +.SH SYNOPSIS +.B /etc/atmsigd.conf +.SH DESCRIPTION +\fBatmsigd.conf\fP contains configuration data for \fBatmsigd\fP. +\fBatmsigd\fP reads \fBatmsigd.conf\fP after parsing the command +line options, before connecting to the ATM network. +.P +Configuration parameters are arranged in functional groups. In order to +set a parameter, the name of the group, the name of the parameter, and +the parameter value(s) have to be specified, e.g. +.nf +.sp + sig level debug +.sp +.fi +decreases the logging threshold for messages related to signaling to the +\fBdebug\fP level. The following options are recognized: +.IP \fBdebug\ dump\ \fIpath\fP +Specifies the directory to which \fBatmsigd\fP will write status and trace +dumps. If tracing is not yet enabled, the trace size is automatically +set to a (small) default value. +.IP \fBdebug\ level\ \fIlevel\fP +Sets the default debug level to \fIlevel\fP. \fIlevel\fP can be any of +\fBdebug\fP, \fBinfo\fP, \fBwarn\fP, \fBerror\fP, and \fBfatal\fP. Only +messages with a higher priority than the debug level are printed. +.IP \fBdebug\ log\ \fIpath\fP +Specifies the file to which \fBatmsigd\fP writes logging messages. When +using the special file name \fBsyslog\fP, messages are send to the +system logger instead. Log messages are written to standard output if no log +file is specified. +.IP \fBdebug\ trace\ \fP[\fInumber\fP] +Enables tracing and optionally sets the number of entries that should be +kept in the trace buffer. A (small) default is used if the number is +omitted. +.IP \fBio\ level\ \fIlevel\fP +Sets the debug level for IO-related messages to \fIlevel\fP. +.IP \fBio\ pcr\ \fIpcr\fP +Configures the signaling VC to use CBR at the specified peak cell rate. +By default, UBR is used on the signaling VC. +.IP \fBio\ vc\ \fP[\fIitf\fP]\fB.\fIvpi\fB.\fIvci\fP +Uses the specified VC for signaling messages instead of the usual 0.0.5. +.IP \fBsaal\ level\ \fIlevel\fP +Sets the debug level for messages related to SAAL (i.e. SSCF and SSCOP) to +\fIlevel\fP. +.IP \fBsig\ level\ \fIlevel\fP +Sets the debug level for messages related to signaling (Q.2931 or ISP) to +\fIlevel\fP. +.IP \fBsig\ network\fP +Assume the role of the network side of the UNI. +.IP \fBsig\ uni30\fP +Use UNI 3.0 signaling. This option is not implemented. The signaling mode +must be configured at compile time. +.IP \fBsig\ uni31\fP +Use UNI 3.1 signaling. This option is not implemented. The signaling mode +must be configured at compile time. +.IP \fBsig\ vpci\ \fIvpci\fB\ itf\ \fIitf\fP +Sets up a very simplistic type of routing. All calls with VPCI values +equal to or greater than \fIvpci\fP will be routed to \fIitf\fP, and their +VPI values will be set to the signaled VPCI minus \fIvpci\fP. Multiple +\fBsig vpci\fP entries can be used to support an arbitrary number of +interfaces. +Example: with \fBsig vpci 4 itf 1\fP, a call signaled for +VPCI/VCI 0.x is routed to 0.0.x, a call signaled for 6.y is routed to +1.2.y, etc. +.P +When setting multiple parameters in the same group, the group name doesn't +have to be repeated if it is followed by the parameters in curly braces. +Example: +.nf +.sp + debug { + level warn + dump /var/tmp + log syslog + trace 100 + } +.sp +.fi +.P +Line breaks can be inserted in \fBatmsigd.conf\fP wherever spaces or tabs +are allowed. Everything between a `#' and the end of the line is considered +a comment. The `#' character cannot be escaped. +.SH BUGS +If an option is specified in \fBatmsigd.conf\fP and on the command +line, \fBatmsigd.conf\fP wins. +.COMPATIBILITY +For historical reasons, synonyms (e.g. abbreviated or long forms) exist for +most keywords. Future versions of \fBatmsigd\fP will only recognize the +syntax described on this man page. +.SH AUTHOR +Werner Almesberger, EPFL LRC +.SH "SEE ALSO" +atmsigd(8), syslogd(8) +.\"{{{}}} diff -ur --new-file old/atm/sigd/cfg.l new/atm/sigd/cfg.l --- old/atm/sigd/cfg.l Tue Mar 12 16:03:39 1996 +++ new/atm/sigd/cfg.l Sat Aug 31 18:25:31 1996 @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "atm.h" @@ -15,51 +16,69 @@ static int lineno = 1; +static int token; /* f@#%ing flex doesn't grok return after BEGIN */ void yyerror(const char *s); %} +%s N +%s P + %% + BEGIN(N); -level return TOK_LEVEL; -debug | -debugging return TOK_DEBUG; -info | -information | -informational return TOK_INFO; -warn | -warning return TOK_WARN; -error return TOK_ERROR; -fatal return TOK_FATAL; -sig | -signaling | -signalling return TOK_SIG; -uni30 return TOK_UNI30; -uni31 return TOK_UNI31; -net | -network return TOK_NET; -saal return TOK_SAAL; -vc | -svc return TOK_SVC; -io return TOK_IO; -itf | -interface return TOK_ITF; -vpci return TOK_VPCI; -[0-9]+ { char *end; +level return TOK_LEVEL; +debug | +debugging return TOK_DEBUG; /* obsolete */ +info | +information | /* obsolete */ +informational return TOK_INFO; +warn | +warning return TOK_WARN; /* obsolete */ +error return TOK_ERROR; +fatal return TOK_FATAL; +sig | +signaling | /* obsolete */ +signalling return TOK_SIG; /* obsolete */ +uni30 return TOK_UNI30; +uni31 return TOK_UNI31; +net | /* obsolete */ +network return TOK_NET; +saal return TOK_SAAL; +vc | +svc return TOK_VC; /* obsolete */ +io return TOK_IO; +itf | +interface return TOK_ITF; /* obsolete */ +vpci return TOK_VPCI; +pcr return TOK_PCR; +dump { BEGIN(P); + token = TOK_DUMP_DIR; } +log { BEGIN(P); + token = TOK_LOGFILE; } +trace return TOK_TRACE; +[0-9]+ { char *end; yylval.num = strtoul(yytext,&end,10); if (*end) yyerror("invalid number"); return TOK_NUMBER; } -[0-9]+\.[0-9]+(\.[0-9]+)? { +[0-9]+\.[0-9]+(\.[0-9]+)? { if (text2atm(yytext,(struct sockaddr *) &yylval.pvc, sizeof(yylval.pvc),T2A_PVC) < 0) yyerror("invalid signaling channel"); return TOK_PVC; } +

[^\t\n ]+ { BEGIN(N); + yylval.str = strdup(yytext); /* tiny leak ... */ + if (!yylval.str) { + perror("strdup"); + exit(1); + } + return token; } \n?[\t ]* lineno += *yytext && *yytext == '\n'; #[^\n]*\n lineno++; -. return *yytext; +. return *yytext; %% diff -ur --new-file old/atm/sigd/cfg.y new/atm/sigd/cfg.y --- old/atm/sigd/cfg.y Tue Apr 30 19:03:01 1996 +++ new/atm/sigd/cfg.y Sat Aug 31 18:23:54 1996 @@ -12,6 +12,7 @@ #include "proto.h" #include "io.h" +#include "trace.h" extern int net; @@ -28,17 +29,19 @@ %union { int num; + char *str; struct sockaddr_atmpvc pvc; }; %token TOK_LEVEL TOK_DEBUG TOK_INFO TOK_WARN TOK_ERROR TOK_FATAL -%token TOK_SIG TOK_UNI30 TOK_UNI31 TOK_SAAL TOK_SVC -%token TOK_IO TOK_NET TOK_VPCI TOK_ITF +%token TOK_SIG TOK_UNI30 TOK_UNI31 TOK_SAAL TOK_VC +%token TOK_IO TOK_NET TOK_VPCI TOK_ITF TOK_PCR TOK_TRACE %token TOK_NUMBER +%token TOK_DUMP_DIR TOK_LOGFILE %token TOK_PVC -%type level +%type level opt_trace_size %% @@ -54,6 +57,7 @@ | TOK_SIG sig | TOK_SAAL saal | TOK_IO io + | TOK_DEBUG debug ; sig: @@ -83,6 +87,15 @@ | io_item io_items ; +debug: + debug_item + | '{' debug_items '}' + ; + +debug_items: + | debug_item debug_items + ; + sig_item: TOK_LEVEL level { @@ -96,11 +109,15 @@ } | TOK_UNI30 { - /* that's the default anyway */ +#ifndef UNI30 + yyerror("Sorry, not supported yet"); +#endif } | TOK_UNI31 { +#ifndef UNI31 yyerror("Sorry, not supported yet"); +#endif } | TOK_NET { @@ -121,9 +138,43 @@ { set_verbosity("IO",$2); } - | TOK_SVC TOK_PVC + | TOK_VC TOK_PVC { signaling_pvc = $2; + } + | TOK_PCR TOK_NUMBER + { + sig_pcr = $2; + } + ; + +debug_item: + TOK_LEVEL level + { + set_verbosity(NULL,$2); + } + | TOK_DUMP_DIR + { + dump_dir = $1; + if (!trace_size) trace_size = DEFAULT_TRACE_SIZE; + } + | TOK_LOGFILE + { + set_logfile($1); + } + | TOK_TRACE opt_trace_size + { + trace_size = $2; + } + ; + +opt_trace_size: + { + $$ = DEFAULT_TRACE_SIZE; + } + | TOK_NUMBER + { + $$ = $1; } ; diff -ur --new-file old/atm/sigd/io.c new/atm/sigd/io.c --- old/atm/sigd/io.c Thu Aug 29 14:33:41 1996 +++ new/atm/sigd/io.c Sat Aug 31 02:19:28 1996 @@ -277,6 +277,14 @@ gettimeofday(&now,NULL); while (1) { set = perm; + poll_signals(); + /* + * Here we have a small race condition: if a signal is delivered after + * poll_signals tests for it but before select sleeps, we miss that + * signal. If it is sent again, we're of course likely to get it. This + * isn't worth fixing, because those signals are only used for + * debugging anyway. + */ ret = select(fds,&set,NULL,NULL,next_timer()); if (ret < 0) { if (errno != EINTR) perror("select"); diff -ur --new-file old/atm/sigd/kernel.c new/atm/sigd/kernel.c --- old/atm/sigd/kernel.c Wed Aug 7 14:22:25 1996 +++ new/atm/sigd/kernel.c Mon Sep 2 16:58:32 1996 @@ -69,8 +69,8 @@ if (!error) error = -EADDRNOTAVAIL; } else { - q_assign(&dsc,QF_cgpn_plan,2); - q_assign(&dsc,QF_cgpn_type,0); + q_assign(&dsc,QF_cgpn_plan,ATM_NP_NSAP); + q_assign(&dsc,QF_cgpn_type,ATM_TON_UNKNOWN); q_write(&dsc,QF_cgpn,(void *) local->sas_addr.prv,ATM_ESA_LEN); } if (net) { @@ -266,8 +266,8 @@ #endif ); START_TIMER(sock,T308_1); - new_state(sock,sock->state == ss_connected ? ss_rel_req : - ss_wait_rel); + new_state(sock,sock->state == ss_connecting || + sock->state == ss_connected ? ss_rel_req : ss_wait_rel); return; case ss_rel_ind: send_release_complete(sock->call_ref,0); /* @@@ */ diff -ur --new-file old/atm/sigd/proto.c new/atm/sigd/proto.c --- old/atm/sigd/proto.c Tue Jul 30 18:10:59 1996 +++ new/atm/sigd/proto.c Mon Sep 2 14:37:53 1996 @@ -196,6 +196,7 @@ msg->blli[i++] = *walk; } to_kernel(msg); + free(msg); } diff -ur --new-file old/atm/sigd/proto.h new/atm/sigd/proto.h --- old/atm/sigd/proto.h Tue Aug 20 17:21:19 1996 +++ new/atm/sigd/proto.h Sat Aug 31 16:10:50 1996 @@ -59,9 +59,12 @@ extern SOCKET *sockets; extern unsigned char q_buffer[]; +#define DEFAULT_TRACE_SIZE 20 + extern int net; extern int pretty; extern int sig_pcr; +extern const char *dump_dir; #define msg2bllis(s) (((int) (s)-(int) sizeof(struct atmsvc_msg))/ \ @@ -71,6 +74,8 @@ #define SEND_ERROR(vcc,code) \ send_kernel(vcc,0L,as_error,code,NULL,NULL,NULL,NULL) + +void poll_signals(void); void from_kernel(struct atmsvc_msg *msg,int size); void itf_load(int itf); diff -ur --new-file old/atm/sigd/q2931.c new/atm/sigd/q2931.c --- old/atm/sigd/q2931.c Thu Aug 8 13:37:35 1996 +++ new/atm/sigd/q2931.c Sat Aug 31 14:19:39 1996 @@ -490,10 +490,10 @@ mid = q_fetch(&in_dsc,QF_msg_type); if (mid == QMSG_REST_ACK) return; if (mid == QMSG_RESTART) { /* 5.5.5.2 */ - int class; + int rst_class; - class = q_fetch(&in_dsc,QF_rst_class); - switch (class) { + rst_class = q_fetch(&in_dsc,QF_rst_class); + switch (rst_class) { case ATM_RST_IND_VC: { int vpi,vci; diff -ur --new-file old/atm/sigd/trace.c new/atm/sigd/trace.c --- old/atm/sigd/trace.c Thu Aug 29 14:36:26 1996 +++ new/atm/sigd/trace.c Mon Sep 2 17:41:48 1996 @@ -4,17 +4,29 @@ #include +#include #include +#include +#include #include -#include "atmd.h" +#include +#include +#include +#include "atm.h" +#include "atmd.h" #include "trace.h" +#define DUMP_MODE +#include "qlib.h" + + typedef struct _entry { + int number; struct timeval time; - void (*parse)(void *msg,int size); + void (*print)(void *msg,int size); const char *comment; void *msg; int size; @@ -23,48 +35,186 @@ int trace_size = 0; -static int current = 0; -ENTRY *first = NULL,*last = NULL; + +static int current_size = 0; +static int sequence = 0; +static ENTRY *first = NULL,*last = NULL; +static char *string = NULL; +static int curr_len; +static int new_line; + + +static inline void append_chunk(const char *str,int len) +{ + if (!string) curr_len = 0; + if (!(string = realloc(string,curr_len+len+1))) { + perror("realloc"); + exit(1); + } + memcpy(string+curr_len,str,len); + curr_len += len; + string[curr_len] = 0; +} + + +static void vappend(const char *fmt,va_list ap) +{ + const char *walk,*next; + + for (walk = next = fmt; *walk; walk++) + if (*walk == '%') { + if (walk != next) append_chunk(next,walk-next); + if (*++walk == 's') { + const char *str; + + str = va_arg(ap,const char *); + append_chunk(str,strlen(str)); + } + else { + char buf[21]; /* big enough for 64 bits */ + int num; + + while (isdigit(*walk) || *walk == 'l') walk++; /* @@@ FIXME */ + if (*walk != 'd' && *walk != 'x') { + fprintf(stderr,"bad format character %c (%d)\n",*walk, + *walk); + exit(1); + } + num = va_arg(ap,int); + sprintf(buf,*walk == 'd' ? "%d" : "%x",num); + append_chunk(buf,strlen(buf)); + } + next = walk+1; + } + if (walk != next) append_chunk(next,walk-next); +} static void append(const char *fmt,...) { - /* append to a growing string */ + va_list ap; + + va_start(ap,fmt); + vappend(fmt,ap); + va_end(ap); +} + + +static void print_text(void *msg,int size) +{ + append(" %s\n",msg); +} + + +static void append_svc(const struct sockaddr_atmsvc *svc) +{ + char buffer[MAX_ATM_ADDR_LEN+1]; + + if (atm2text(buffer,MAX_ATM_ADDR_LEN+1,(struct sockaddr *) svc, + A2T_NAME | A2T_PRETTY) < 0) strcpy(buffer,""); + append("%s\n",buffer); } -static void parse_text(void *msg,int size) +static void append_tp(const struct atm_trafprm *tp) { - append("%s\n",msg); + static const char *name[] = { "NONE","UBR","CBR","VBR","ABR","ANYCLASS" }; + + append("%s, PCR %d..%d, CVD %d, SDU %d\n",tp->traffic_class < + sizeof(name)/sizeof(*name) ? name[tp->traffic_class] : "???", + tp->min_pcr,tp->max_pcr,tp->max_cdv,tp->max_sdu); } -static void parse_q2931(void *msg,int size) +void qd_dump(const char *msg,...) { - /* set q_report and let qd_open do the work */ + const char *prev,*end; + va_list ap; + + if (new_line) append(" "); + prev = string; + va_start(ap,msg); + vappend(msg,ap); + va_end(ap); + if (!prev) prev = string; + if (!prev) new_line = 1; + else { + if (!(end = strrchr(prev,'\n'))) end = prev; + else end++; + new_line = !*end; + } } -static void parse_kernel(void *msg,int size) +static void print_q2931(void *msg,int size) { - /* print the message */ + Q_DSC dsc; + + (void) qd_open(&dsc,msg,size); + qd_close(&dsc); } -static void store(void (*parse)(void *msg,int size),const char *comment, +static void print_kernel(void *msg,int size) +{ + static const char *type[] = { "as_catch_null","as_bind","as_connect", + "as_accept","as_listen","as_okay","as_error","as_indicate","as_close", + "as_itf_notify" }; + static const char *bhli[] = { "NONE","ISO","USER","HLP","VENDOR" }; + struct atmsvc_msg *m = msg; + int i; + + append(" %s (vcc 0x%x, listen_vcc 0x%x)\n",m->type < sizeof(type)/ + sizeof(*type) ? type[m->type] : "???",m->vcc,m->listen_vcc); + append(" reply %d",m->reply); + if (m->reply) { + const char *error; + + error = strerror(m->reply > 0 ? m->reply : -m->reply); + append(" (%s)",error ? error : "???"); + } + append(", aal %d\n",m->aal); + append(" pvc %d.%d.%d\n",m->pvc.sap_addr.itf,m->pvc.sap_addr.vpi, + m->pvc.sap_addr.vci); + append(" local "); + append_svc(&m->local); + append(" txtp: "); + append_tp(&m->qos.txtp); + append(" rxtp: "); + append_tp(&m->qos.rxtp); + append(" svc "); + append_svc(&m->svc); + append(" bhli %s",m->svc.sas_addr.bhli.hl_type < sizeof(bhli)/ + sizeof(*bhli) ? bhli[m->svc.sas_addr.bhli.hl_type] : "???"); + if (m->svc.sas_addr.bhli.hl_type == ATM_HL_USER || + m->svc.sas_addr.bhli.hl_type == ATM_HL_ISO) + for (i = 0; i < m->svc.sas_addr.bhli.hl_type; i++) + append(" %02x",m->svc.sas_addr.bhli.hl_info[i]); + append("\n"); + for (i = 0; i <= (size-(int) sizeof(struct atmsvc_msg))/ + (int) sizeof(struct atm_blli); i++) { + append(" blli[%d]\n",i+1); + append(" l2 %d, l3 %d, ...\n",m->blli[i].l2_proto, + m->blli[i].l3_proto); + } +} + + +static void store(void (*print)(void *msg,int size),const char *comment, void *msg,int size) { ENTRY *entry; - if (!trace_size) return; entry = alloc_t(ENTRY); (void) gettimeofday(&entry->time,NULL); - entry->parse = parse; + entry->number = sequence++; + entry->print = print; entry->comment = comment; entry->msg = msg; entry->size = size; entry->next = NULL; - if (current >= trace_size) { /* handle trace_size < 1 (actually < 0) too */ + if (current_size < trace_size) current_size++; + else { /* handle trace_size < 1 (< 0) too */ ENTRY *next; next = first->next; @@ -83,9 +233,10 @@ { char *buf; + if (!trace_size) return; buf = alloc(strlen(msg)+1); strcpy(buf,msg); - store(&parse_text,"MESSAGE",buf,strlen(msg)); + store(&print_text,"MESSAGE",buf,strlen(msg)); } @@ -93,9 +244,10 @@ { void *buf; + if (!trace_size) return; buf = alloc(size); memcpy(buf,msg,size); - store(&parse_q2931,comment,buf,size); + store(&print_q2931,comment,buf,size); } @@ -103,15 +255,26 @@ { struct atmsvc_msg *buf; + if (!trace_size) return; buf = alloc(size); memcpy(buf,msg,size); /* DON'T use *buf = *msg; */ - store(&parse_kernel,comment,buf,size); + store(&print_kernel,comment,buf,size); } char *get_trace(void) { - static char msg[] = "Trace generation isn't implemented yet\n"; + ENTRY *walk; - return msg; + if (string) { + free(string); + string = NULL; + new_line = 1; + } + for (walk = first; walk; walk = walk->next) { + append("%6d (%d.%06d) %s:\n",walk->number,walk->time.tv_sec, + walk->time.tv_usec,walk->comment); + walk->print(walk->msg,walk->size); + } + return string; } diff -ur --new-file old/atm/test/Makefile new/atm/test/Makefile --- old/atm/test/Makefile Thu Jul 18 21:42:17 1996 +++ new/atm/test/Makefile Mon Sep 2 19:41:52 1996 @@ -1,5 +1,5 @@ USRPGMS=aping aread awrite br bw ttcp_atm -MANS= +MAN1= include ../Rules.make diff -ur --new-file old/atm/test/aping.c new/atm/test/aping.c --- old/atm/test/aping.c Tue Jun 11 12:24:50 1996 +++ new/atm/test/aping.c Sat Aug 31 14:20:41 1996 @@ -46,8 +46,8 @@ if (text2atm(argv[1],(struct sockaddr *) &addr,sizeof(addr), T2A_PVC | T2A_UNSPEC | T2A_WILDCARD) < 0) usage(argv[0]); memset(&qos,0,sizeof(qos)); - qos.txtp.class = ATM_UBR; - qos.txtp.class = ATM_UBR; + qos.txtp.traffic_class = ATM_UBR; + qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = 1; qos.rxtp = qos.txtp; if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { diff -ur --new-file old/atm/test/aread.c new/atm/test/aread.c --- old/atm/test/aread.c Tue Jun 11 12:24:54 1996 +++ new/atm/test/aread.c Sat Aug 31 14:20:46 1996 @@ -39,7 +39,7 @@ if (text2atm(argv[1],(struct sockaddr *) &addr,sizeof(addr), T2A_PVC | T2A_UNSPEC | T2A_WILDCARD) < 0) usage(argv[0]); memset(&qos,0,sizeof(qos)); - qos.rxtp.class = ATM_UBR; + qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = BSIZE; if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { perror("setsockopt SO_ATMQOS"); diff -ur --new-file old/atm/test/awrite.c new/atm/test/awrite.c --- old/atm/test/awrite.c Thu Jul 11 18:50:01 1996 +++ new/atm/test/awrite.c Sat Aug 31 14:20:48 1996 @@ -37,7 +37,7 @@ usage(argv[0]); offset = argc == 3 ? 0 : atoi(argv[3]); memset(&qos,0,sizeof(qos)); - qos.txtp.class = ATM_UBR; + qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = strlen(argv[2])-offset; if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { perror("setsockopt SO_ATMQOS"); diff -ur --new-file old/atm/test/br.c new/atm/test/br.c --- old/atm/test/br.c Tue Jun 11 12:25:00 1996 +++ new/atm/test/br.c Sat Aug 31 14:20:52 1996 @@ -39,7 +39,7 @@ if (text2atm(argv[1],(struct sockaddr *) &addr,sizeof(addr),T2A_PVC) < 0) usage(argv[0]); memset(&qos,0,sizeof(qos)); - qos.rxtp.class = ATM_UBR; + qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = BSIZE; if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { perror("setsockopt SO_ATMQOS"); diff -ur --new-file old/atm/test/bw.c new/atm/test/bw.c --- old/atm/test/bw.c Tue Jun 11 12:25:04 1996 +++ new/atm/test/bw.c Sat Aug 31 14:20:56 1996 @@ -43,7 +43,7 @@ if (text2atm(argv[1],(struct sockaddr *) &addr,sizeof(addr),T2A_PVC) < 0) usage(argv[0]); memset(&qos,0,sizeof(qos)); - qos.txtp.class = ATM_UBR; + qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = BSIZE; if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { perror("setsockopt SO_ATMQOS"); diff -ur --new-file old/atm/test/ttcp.c new/atm/test/ttcp.c --- old/atm/test/ttcp.c Wed Jul 31 18:47:25 1996 +++ new/atm/test/ttcp.c Sat Aug 31 14:21:05 1996 @@ -295,10 +295,10 @@ exit(1); } memset(&qos,0,sizeof(qos)); - if (!trans) qos.rxtp.class = ATM_UBR; - else if (!pcr) qos.txtp.class = ATM_UBR; + if (!trans) qos.rxtp.traffic_class = ATM_UBR; + else if (!pcr) qos.txtp.traffic_class = ATM_UBR; else { - qos.txtp.class = ATM_CBR; + qos.txtp.traffic_class = ATM_CBR; qos.txtp.max_pcr = pcr; } qos.rxtp.max_sdu = qos.txtp.max_sdu = buflen; .