diff -ur --new-file old/atm/.kernel new/atm/.kernel --- old/atm/.kernel Sat Jun 6 04:23:03 1998 +++ new/atm/.kernel Tue Jun 9 14:47:26 1998 @@ -1,2 +1,2 @@ # this file is used to control automated generation of differences -2.1.104 +2.1.105 diff -ur --new-file old/atm/CHANGES new/atm/CHANGES --- old/atm/CHANGES Sat Jun 6 04:33:08 1998 +++ new/atm/CHANGES Thu Jun 25 14:14:07 1998 @@ -1,3 +1,53 @@ +Version 0.37 to 0.38 (25-JUN-1998) +==================== + +Bug fixes +--------- + + - fixed the remaining few #include + - invoking fcntl() or socketpair() on an ATM socket caused an "Oops" (reported + by Jonathan Chan) + - CLIP PVCs caused an "Oops" when cat'ing /proc/atm/pvc (reported by Marko + Kiiskila and Robert Olsson) + - atm/qgen/default.nl wasn't removed after build failure + - debugging switch (sw_debug) did not stop operations after the first error + - svc_accept returned apparent success instead of -EAGAIN, usually leading to + a later -ENOTCONN + - ttcp.c didn't initialize port_name, leading to erratic behaviour when making + slight changes to the build process + - atm_pdu2truesize diverged from alloc_skb, leading to sudden failure of VCs + or of ATMARP (reported by Robert Olsson) + - corrected use of '~' when applied to unsigned longs representing memory + addresses in aread, ENI, and ZATM (reported by Wai-Sun Chia) + - atmtcp and LANE didn't use bind_vcc when setting up control VCs + - atmtcp got ENOMEM/EBUSY wrong when failing to create an interface + - sig level in atmsigd.conf didn't affect UNI diagnostics + +New features +------------ + + - upgraded to the 2.1.105 kernel + - added ATMTCP "switch" in atm/switch/tcp + - atmtcp: new mode -s to connect to an ATMTCP "switch" + - atmtcp: new option -d for debugging output + - added -b option (the usual "background") to switch/relay.c + +Other changes +------------- + + - changed "PDU" to "SDU" in the atmtcp(8) man page + - atmarpd now includes the interface netmask in ATMARP table dumps + - added ATM devices also to the Alpha architecture, because at least ATMTCP + works (by Wai-Sun Chia) + - added the removal of -Wmissing-prototypes to the 0.37 changes + - removed -Wcast-align from Rules.make because of a conflict with + /usr/include/socketbits.h of glibc 2 on Alphas (reported by Wai-Sun Chia) + - atmsigd.conf.4: documented that debug log stderr works too + - sap_equal now also allows wildcard matches for BHLI (with SXE_COMPATIBLE) + - atmsigd now uses -m instead of -N and -A + - atmsigd.conf now uses sig mode instead of sig net + + Version 0.36 to 0.37 (6-JUN-1998) ==================== @@ -24,6 +74,8 @@ - net/atm/clip.c no longer uses ether_setup (suggested by Alexey Kuznetsov) - more header file cleanup (main change: applications should now #include instead of #include ) + - removed -Wmissing-prototypes from Rules.make because of a conflict with + include/linux/byteorder/swab.h Version 0.35 to 0.36 (23-APR-1998) diff -ur --new-file old/atm/Makefile new/atm/Makefile --- old/atm/Makefile Sat Apr 11 12:45:10 1998 +++ new/atm/Makefile Thu Jun 25 13:23:35 1998 @@ -2,7 +2,8 @@ # "lib" must appear before anything else # "maint" must appear after "qgen" -DIRS=lib test debug qgen saal sigd maint arpd ilmid aqd man led lane #extra +DIRS=lib test debug qgen saal sigd maint arpd ilmid aqd man led lane switch + #extra all: for n in $(DIRS); do $(MAKE) -C $$n || exit; done diff -ur --new-file old/atm/README new/atm/README --- old/atm/README Sat Jun 6 04:18:10 1998 +++ new/atm/README Tue Jun 9 14:47:43 1998 @@ -1,4 +1,4 @@ -ATM on Linux, release 0.37 (alpha) by Werner Almesberger, EPFL ICA +ATM on Linux, release 0.38 (alpha) by Werner Almesberger, EPFL ICA ============================================== Werner.Almesberger@epfl.ch This is experimental software. There are known major bugs and certainly @@ -9,7 +9,7 @@ device drivers, source for demons, management and test tools, and some documentation. -The kernel patch is relative to the "standard" 2.1.104 kernel. +The kernel patch is relative to the "standard" 2.1.105 kernel. The following network devices are supported: ATM over TCP pseudo device for "dry runs" diff -ur --new-file old/atm/Rules.make new/atm/Rules.make --- old/atm/Rules.make Sat Jun 6 03:00:33 1998 +++ new/atm/Rules.make Thu Jun 18 18:33:35 1998 @@ -43,8 +43,9 @@ CC=cc CFLAGS_NOWARN=-g -DVERSION=\"`cat $(TOPDIR)/VERSION`\" \ $(INCLUDES) -I$(TOPDIR)/lib -CFLAGS_NOOPT=$(CFLAGS_NOWARN) -Wall -Wshadow -Wpointer-arith -Wcast-align \ +CFLAGS_NOOPT=$(CFLAGS_NOWARN) -Wall -Wshadow -Wpointer-arith \ -Wwrite-strings -Wstrict-prototypes + # -Wcast-align (clashes with socketbits.h of glibc 2 on Alphas) # -Wmissing-prototypes (linux/byteorder is broken) # -Wmissing-declarations (gcc 2.6.x only) # -Wconversion (breaks inline) diff -ur --new-file old/atm/USAGE new/atm/USAGE --- old/atm/USAGE Sat Jun 6 04:17:28 1998 +++ new/atm/USAGE Thu Jun 25 14:13:40 1998 @@ -1,4 +1,4 @@ -Usage instructions - ATM on Linux, release 0.37 +Usage instructions - ATM on Linux, release 0.38 ------------------------------------------------- For updates of ATM on Linux, please check the Web page at @@ -17,9 +17,9 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.37.tar.gz - - the Linux kernel, version 2.1.104, e.g. from - ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.104.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.38.tar.gz + - the Linux kernel, version 2.1.105, e.g. from + ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.105.tar.gz - Perl, version 4 or 5 - if you want memory debugging: MPR version 1.6, e.g. from ftp://sunsite.unc.edu/pub/Linux/devel/lang/c/mpr-1.6.tar.gz @@ -33,11 +33,11 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.37.tar.gz +tar xfz atm-0.38.tar.gz and the kernel source: -tar xfz linux-2.1.104.tar.gz +tar xfz linux-2.1.105.tar.gz Finally, you can extract the ATM-related patches: @@ -67,6 +67,7 @@ atm/man/ Miscellaneous man pages atm/extra/ Extra packages (tcpdump and ans) atm/config/ Configuration file examples + atm/switch/ Switch fabric control (under construction) Kernel configuration @@ -601,7 +602,7 @@ and the other side should use the normal user version. So here on nestor we start atmsigd with: -atmsigd -b -N +atmsigd -b -m network and on virgil with: diff -ur --new-file old/atm/VERSION new/atm/VERSION --- old/atm/VERSION Wed Jun 3 16:44:15 1998 +++ new/atm/VERSION Tue Jun 9 14:47:22 1998 @@ -1 +1 @@ -0.37 +0.38 diff -ur --new-file old/atm/aqd/io.h new/atm/aqd/io.h --- old/atm/aqd/io.h Mon Jun 3 14:01:54 1996 +++ new/atm/aqd/io.h Tue Jun 9 14:43:01 1998 @@ -1,13 +1,13 @@ /* io.h - I/O operations */ -/* Written 1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1996,1998 by Werner Almesberger, EPFL-LRC/ICA */ #ifndef IO_H #define IO_H #include /* for struct sockaddr */ -#include /* for struct sockaddr_atmsvc */ +#include /* for struct sockaddr_atmsvc */ void open_all(void); diff -ur --new-file old/atm/arpd/arp.c new/atm/arpd/arp.c --- old/atm/arpd/arp.c Sat Jun 6 01:13:53 1998 +++ new/atm/arpd/arp.c Tue Jun 9 14:43:25 1998 @@ -15,11 +15,10 @@ #define _LINUX_NETDEVICE_H /* very crude hack for glibc2 */ #include #include -#include +#include #include #include -#include "atm.h" #include "atmd.h" #include "atmarp.h" #include "atmarpd.h" diff -ur --new-file old/atm/arpd/io.c new/atm/arpd/io.c --- old/atm/arpd/io.c Thu Apr 16 10:27:20 1998 +++ new/atm/arpd/io.c Tue Jun 9 14:43:33 1998 @@ -15,13 +15,12 @@ #include #include #include -#include +#include #include /* for CLIP_DEFAULT_IDLETIMER */ #include #define _LINUX_NETDEVICE_H /* glibc2 */ #include -#include "atm.h" #include "atmd.h" #include "atmarpd.h" diff -ur --new-file old/atm/arpd/io.h new/atm/arpd/io.h --- old/atm/arpd/io.h Fri Feb 27 19:33:51 1998 +++ new/atm/arpd/io.h Tue Jun 9 14:43:40 1998 @@ -8,7 +8,7 @@ #include #include /* for struct sockaddr */ -#include /* for struct sockaddr_atmsvc */ +#include /* for struct sockaddr_atmsvc */ void open_all(void); diff -ur --new-file old/atm/arpd/table.c new/atm/arpd/table.c --- old/atm/arpd/table.c Wed Apr 15 17:26:45 1998 +++ new/atm/arpd/table.c Thu Jun 18 03:20:55 1998 @@ -161,13 +161,14 @@ static void dump_itf(ITF *itf) { - unsigned char *ipp; + unsigned char *ipp,*nmp; char buf[MAX_ATM_QOS_LEN+1]; if (qos2text(buf,sizeof(buf),&itf->qos,0) < 0) strcpy(buf,""); ipp = (unsigned char *) &itf->local_ip; - output("----- Itf %d (%d.%d.%d.%d) -----",itf->number,ipp[0],ipp[1], - ipp[2],ipp[3]); + nmp = (unsigned char *) &itf->netmask; + output("----- Itf %d (%d.%d.%d.%d, netmask %d.%d.%d.%d) -----",itf->number, + ipp[0],ipp[1],ipp[2],ipp[3],nmp[0],nmp[1],nmp[2],nmp[3]); output("Default QOS: %s",buf); dump_entries(itf->table); } diff -ur --new-file old/atm/atm.patch new/atm/atm.patch --- old/atm/atm.patch Sat Jun 6 04:17:11 1998 +++ new/atm/atm.patch Thu Jun 25 14:13:22 1998 @@ -1,23 +1,5 @@ ---- ref/Makefile Thu May 21 04:10:21 1998 -+++ work/Makefile Sat Jun 6 03:32:39 1998 -@@ -11,7 +11,7 @@ - # - # For UP operations COMMENT THIS OUT, simply setting SMP = 0 won't work - # --SMP = 1 -+#SMP = 1 - - .EXPORT_ALL_VARIABLES: - -@@ -85,7 +85,7 @@ - # standard CFLAGS - # - --CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -+CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -g - - ifdef SMP - CFLAGS += -D__SMP__ +--- ref/Makefile Sun Jun 7 19:41:28 1998 ++++ work/Makefile Tue Jun 9 21:33:13 1998 @@ -117,6 +117,10 @@ DRIVERS := $(DRIVERS) drivers/net/net.a @@ -37,8 +19,8 @@ if [ -f SCSI_MODULES ]; then inst_mod SCSI_MODULES scsi; fi; \ if [ -f FS_MODULES ]; then inst_mod FS_MODULES fs; fi; \ if [ -f NLS_MODULES ]; then inst_mod NLS_MODULES fs; fi; \ ---- ref/Documentation/Configure.help Fri May 22 01:42:47 1998 -+++ work/Documentation/Configure.help Sat Jun 6 03:32:39 1998 +--- ref/Documentation/Configure.help Sun Jun 7 19:37:41 1998 ++++ work/Documentation/Configure.help Tue Jun 9 21:32:11 1998 @@ -2657,6 +2657,79 @@ This is a backward compatibility option, choose Y for now. This option will be removed soon. @@ -120,14 +102,14 @@ CONFIG_SCSI If you want to use a SCSI hard disk, SCSI tape drive, SCSI CDROM or --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/Documentation/atm.txt Sat Jun 6 03:32:39 1998 ++++ work/Documentation/atm.txt Tue Jun 9 21:32:11 1998 @@ -0,0 +1,4 @@ +In order to use anything but the most primitive functions of ATM, +several user-mode programs are required to assist the kernel. These +programs and related material can be found via the ATM on Linux Web +page at http://lrcwww.epfl.ch/linux-atm/ --- ref/arch/i386/config.in Wed Apr 29 07:41:33 1998 -+++ work/arch/i386/config.in Sat Jun 6 03:32:39 1998 ++++ work/arch/i386/config.in Tue Jun 9 21:32:11 1998 @@ -93,6 +93,9 @@ bool 'Network device support' CONFIG_NETDEVICES if [ "$CONFIG_NETDEVICES" = "y" ]; then @@ -138,18 +120,30 @@ fi endmenu fi ---- ref/drivers/Makefile Thu Dec 4 00:17:30 1997 -+++ work/drivers/Makefile Sat Jun 6 03:32:39 1998 +--- ref/arch/alpha/config.in Sat May 9 02:54:39 1998 ++++ work/arch/alpha/config.in Thu Jun 18 10:58:45 1998 +@@ -227,6 +227,9 @@ + bool 'Network device support' CONFIG_NETDEVICES + if [ "$CONFIG_NETDEVICES" = "y" ]; then + source drivers/net/Config.in ++ if [ "$CONFIG_ATM" = "y" ]; then ++ source drivers/atm/Config.in ++ fi + fi + endmenu + fi +--- ref/drivers/Makefile Sun Jun 7 19:37:41 1998 ++++ work/drivers/Makefile Tue Jun 9 21:35:26 1998 @@ -9,7 +9,7 @@ - SUB_DIRS := block char net misc #streams + SUB_DIRS := block char net misc sound MOD_SUB_DIRS := $(SUB_DIRS) sbus --ALL_SUB_DIRS := $(SUB_DIRS) pci scsi sbus sound cdrom isdn pnp macintosh -+ALL_SUB_DIRS := $(SUB_DIRS) pci scsi sbus sound cdrom isdn pnp macintosh atm +-ALL_SUB_DIRS := $(SUB_DIRS) pci scsi sbus cdrom isdn pnp macintosh ++ALL_SUB_DIRS := $(SUB_DIRS) pci scsi sbus cdrom isdn pnp macintosh atm ifdef CONFIG_PCI SUB_DIRS += pci -@@ -64,6 +64,11 @@ +@@ -56,6 +56,11 @@ ifeq ($(CONFIG_ISDN),m) MOD_SUB_DIRS += isdn endif @@ -162,7 +156,7 @@ ifeq ($(CONFIG_AP1000),y) --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/Config.in Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/Config.in Tue Jun 9 21:32:11 1998 @@ -0,0 +1,23 @@ +# +# ATM device configuration @@ -188,7 +182,7 @@ +# tristate 'IDT 77201 (NICStAR)' CONFIG_ATM_NICSTAR y +fi --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/Makefile Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/Makefile Tue Jun 9 21:32:11 1998 @@ -0,0 +1,57 @@ +# File: drivers/atm/Makefile +# @@ -248,7 +242,7 @@ + +include $(TOPDIR)/Rules.make --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/atmdev_init.c Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/atmdev_init.c Tue Jun 9 21:32:11 1998 @@ -0,0 +1,48 @@ +/* drivers/atm/atmdev_init.c - ATM device driver initialization */ + @@ -299,7 +293,7 @@ + return devs; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/atmtcp.c Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/atmtcp.c Wed Jun 24 19:27:22 1998 @@ -0,0 +1,226 @@ +/* drivers/atm/atmtcp.c - ATM over TCP "device" driver */ + @@ -516,11 +510,11 @@ + struct atm_dev *dev; + + dev = atm_dev_register(DEV_LABEL,&atmtcp_v_dev_ops,itf,0); -+ if (!dev) return itf == -1 ? -EBUSY : -ENOMEM; ++ if (!dev) return itf == -1 ? -ENOMEM : -EBUSY; + dev->ci_range.vpi_bits = MAX_VPI_BITS; + dev->ci_range.vci_bits = MAX_VCI_BITS; + dev->dev_data = vcc; -+ vcc->dev = &atmtcp_dev; ++ bind_vcc(vcc,&atmtcp_dev); + vcc->flags |= ATM_VF_READY | ATM_VF_META; + vcc->dev_data = dev; + (void) atm_init_aal5(vcc); /* @@@ losing AAL in transit ... */ @@ -528,7 +522,7 @@ + return dev->number; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/eni.c Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/eni.c Thu Jun 18 19:04:24 1998 @@ -0,0 +1,2140 @@ +/* drivers/atm/eni.c - Efficient Networks ENI155P device driver */ + @@ -805,7 +799,7 @@ + DPRINTK("match[%d]: 0x%lx/0x%lx(0x%x), %d/%d\n",i, + list[i].start,start,1 << order,list[i].order,order); + list[i] = list[--len]; -+ start &= ~(1 << order); ++ start &= ~(unsigned long) (1 << order); + order++; + i = -1; + continue; @@ -2671,7 +2665,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/eni.h Sat Jun 6 03:51:07 1998 ++++ work/drivers/atm/eni.h Thu Jun 18 19:01:49 1998 @@ -0,0 +1,114 @@ +/* drivers/atm/eni.h - Efficient Networks ENI155P device driver declarations */ + @@ -2788,7 +2782,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/midway.h Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/midway.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,265 @@ +/* drivers/atm/midway.h - Efficient Networks Midway (SAR) description */ + @@ -3056,7 +3050,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/suni.c Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/suni.c Tue Jun 9 21:32:11 1998 @@ -0,0 +1,301 @@ +/* drivers/atm/suni.c - PMC SUNI (PHY) driver */ + @@ -3360,7 +3354,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/suni.h Sat Jun 6 03:51:05 1998 ++++ work/drivers/atm/suni.h Thu Jun 18 19:01:43 1998 @@ -0,0 +1,219 @@ +/* drivers/atm/suni.h - PMC SUNI (PHY) declarations */ + @@ -3582,7 +3576,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/tonga.h Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/tonga.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,20 @@ +/* drivers/atm/tonga.h - Efficient Networks Tonga (PCI bridge) declarations */ + @@ -3605,7 +3599,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/uPD98401.h Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/uPD98401.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,292 @@ +/* drivers/atm/uPD98401.h - NEC uPD98401 (SAR) declarations */ + @@ -3900,7 +3894,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/uPD98402.c Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/uPD98402.c Tue Jun 9 21:32:11 1998 @@ -0,0 +1,224 @@ +/* drivers/atm/uPD98402.c - NEC uPD98402 (PHY) declarations */ + @@ -4127,7 +4121,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/uPD98402.h Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/uPD98402.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,106 @@ +/* drivers/atm/uPD98402.h - NEC uPD98402 (PHY) declarations */ + @@ -4236,8 +4230,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/zatm.c Sat Jun 6 03:32:39 1998 -@@ -0,0 +1,1865 @@ ++++ work/drivers/atm/zatm.c Thu Jun 18 19:01:26 1998 +@@ -0,0 +1,1866 @@ +/* drivers/atm/zatm.c - ZeitNet ZN122x device driver */ + +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ @@ -4454,7 +4448,8 @@ + break; + } + skb_reserve(skb,(unsigned char *) ((((unsigned long) skb->data+ -+ align+offset-1) & ~(align-1))-offset)-skb->data); ++ align+offset-1) & ~(unsigned long) (align-1))-offset)- ++ skb->data); + head = (struct rx_buffer_head *) skb->data; + skb_reserve(skb,sizeof(struct rx_buffer_head)); + if (!first) first = head; @@ -4779,7 +4774,7 @@ + + EVENT("poll_rx\n",0,0); + zatm_dev = ZATM_DEV(dev); -+ pos = (zatm_dev->mbx_start[mbx] & ~0xffff) | zin(MTA(mbx)); ++ pos = (zatm_dev->mbx_start[mbx] & ~0xffffUL) | zin(MTA(mbx)); + while (x = zin(MWA(mbx)), (pos & 0xffff) != x) { + u32 *here; + struct sk_buff *skb; @@ -5159,7 +5154,7 @@ + + EVENT("poll_tx\n",0,0); + zatm_dev = ZATM_DEV(dev); -+ pos = (zatm_dev->mbx_start[mbx] & ~0xffff) | zin(MTA(mbx)); ++ pos = (zatm_dev->mbx_start[mbx] & ~0xffffUL) | zin(MTA(mbx)); + while (x = zin(MWA(mbx)), (pos & 0xffff) != x) { + int chan; + @@ -5735,8 +5730,8 @@ + here = (unsigned long) kmalloc(2*MBX_SIZE(i), + GFP_KERNEL); + if (!here) return -ENOMEM; -+ if ((here^(here+MBX_SIZE(i))) & ~0xffff) /* paranoia */ -+ here = (here & ~0xffff)+0x10000; ++ if ((here^(here+MBX_SIZE(i))) & ~0xffffUL)/* paranoia */ ++ here = (here & ~0xffffUL)+0x10000; + if ((here^virt_to_bus((void *) here)) & 0xffff) { + printk(KERN_ERR DEV_LABEL "(itf %d): system " + "bus incompatible with driver\n", @@ -6104,7 +6099,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/zatm.h Sat Jun 6 03:51:10 1998 ++++ work/drivers/atm/zatm.h Thu Jun 18 19:01:57 1998 @@ -0,0 +1,136 @@ +/* drivers/atm/zatm.h - ZeitNet ZN122x device driver declarations */ + @@ -6243,7 +6238,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/zeprom.h Sat Jun 6 03:32:39 1998 ++++ work/drivers/atm/zeprom.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,34 @@ +/* drivers/atm/zeprom.h - ZeitNet ZN122x EEPROM (NM93C46) declarations */ + @@ -6280,7 +6275,7 @@ + +#endif --- ref/drivers/block/genhd.c Fri Feb 6 19:29:22 1998 -+++ work/drivers/block/genhd.c Sat Jun 6 03:32:39 1998 ++++ work/drivers/block/genhd.c Tue Jun 9 21:32:11 1998 @@ -58,6 +58,7 @@ extern int blk_dev_init(void); extern int scsi_dev_init(void); @@ -6300,7 +6295,7 @@ #ifdef CONFIG_VT console_map_init(); --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/arequipa.h Sat Jun 6 03:55:27 1998 ++++ work/include/linux/arequipa.h Tue Jun 9 21:50:44 1998 @@ -0,0 +1,63 @@ +/* arequipa.h - Arequipa interface definitions */ + @@ -6366,7 +6361,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atm.h Sat Jun 6 03:32:39 1998 ++++ work/include/linux/atm.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,235 @@ +/* atm.h - general ATM declarations */ + @@ -6604,7 +6599,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atm_eni.h Sat Jun 6 03:32:39 1998 ++++ work/include/linux/atm_eni.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,15 @@ +/* atm_eni.h - Driver-specific declarations of the ENI driver (for use by + driver-specific utilities) */ @@ -6622,7 +6617,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atm_tcp.h Sat Jun 6 03:32:39 1998 ++++ work/include/linux/atm_tcp.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,30 @@ +/* atm_tcp.h - Driver-specific declarations of the ATMTCP driver (for use by + driver-specific utilities) */ @@ -6655,7 +6650,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atm_zatm.h Sat Jun 6 03:32:39 1998 ++++ work/include/linux/atm_zatm.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,54 @@ +/* atm_zatm.h - Driver-specific declarations of the ZATM driver (for use by + driver-specific utilities) */ @@ -6712,7 +6707,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmarp.h Sat Jun 6 03:34:36 1998 ++++ work/include/linux/atmarp.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,42 @@ +/* atmarp.h - ATM ARP protocol and kernel-demon interface definitions */ + @@ -6757,7 +6752,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmclip.h Sat Jun 6 03:32:39 1998 ++++ work/include/linux/atmclip.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,21 @@ +/* atmclip.h - Classical IP over ATM */ + @@ -6781,7 +6776,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmdev.h Sat Jun 6 03:51:05 1998 ++++ work/include/linux/atmdev.h Thu Jun 18 11:15:13 1998 @@ -0,0 +1,304 @@ +/* atmdev.h - ATM device driver declarations */ + @@ -7075,7 +7070,7 @@ + +static __inline__ int atm_pdu2truesize(int pdu_size) +{ -+ return ((pdu_size+15) & ~15)+sizeof(struct sk_buff); ++ return (pdu_size+15) & ~15; +} + + @@ -7088,7 +7083,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmioc.h Sat Jun 6 03:32:39 1998 ++++ work/include/linux/atmioc.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,38 @@ +/* atmioc.h - ranges for ATM-related ioctl numbers */ + @@ -7129,7 +7124,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmlec.h Sat Jun 6 03:32:39 1998 ++++ work/include/linux/atmlec.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,65 @@ +/* + * @@ -7197,7 +7192,7 @@ +}; +#endif /* _ATMLEC_H_ */ --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmsap.h Sat Jun 6 03:32:39 1998 ++++ work/include/linux/atmsap.h Tue Jun 9 21:32:11 1998 @@ -0,0 +1,161 @@ +/* atmsap.h - ATM Service Access Point addressing definitions */ + @@ -7361,11 +7356,11 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmsvc.h Sat Jun 6 03:32:39 1998 ++++ work/include/linux/atmsvc.h Thu Jun 25 14:12:14 1998 @@ -0,0 +1,52 @@ +/* atmsvc.h - ATM signaling kernel-demon interface definitions */ + -+/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ + + +#ifndef _LINUX_ATMSVC_H @@ -7380,7 +7375,7 @@ + +enum atmsvc_msg_type { as_catch_null,as_bind,as_connect,as_accept,as_reject, + as_listen,as_okay,as_error,as_indicate,as_close,as_itf_notify, -+ as_modify,as_identify }; ++ as_modify,as_identify,as_terminate }; + +struct atmsvc_msg { + enum atmsvc_msg_type type; @@ -7415,8 +7410,8 @@ + (tp).max_pcr : (tp).min_pcr ? (tp).min_pcr : ATM_MAX_PCR) + +#endif ---- ref/include/linux/if_arp.h Fri Jun 5 08:31:46 1998 -+++ work/include/linux/if_arp.h Sat Jun 6 03:49:05 1998 +--- ref/include/linux/if_arp.h Sun Jun 7 20:23:23 1998 ++++ work/include/linux/if_arp.h Tue Jun 9 21:45:55 1998 @@ -35,6 +35,7 @@ #define ARPHRD_ARCNET 7 /* ARCnet */ #define ARPHRD_APPLETLK 8 /* APPLEtalk */ @@ -7435,8 +7430,8 @@ /* ARP ioctl request. */ ---- ref/include/linux/skbuff.h Fri Jun 5 08:31:06 1998 -+++ work/include/linux/skbuff.h Sat Jun 6 03:47:40 1998 +--- ref/include/linux/skbuff.h Sun Jun 7 20:22:36 1998 ++++ work/include/linux/skbuff.h Tue Jun 9 21:44:44 1998 @@ -106,6 +106,20 @@ __u32 shapestamp; /* Stamp for shaper */ __u16 shapepend; /* Pending */ @@ -7459,7 +7454,7 @@ /* These are just the default values. This is run time configurable. --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/sonet.h Sat Jun 6 03:32:39 1998 ++++ work/include/linux/sonet.h Tue Jun 9 21:32:12 1998 @@ -0,0 +1,52 @@ +/* sonet.h - SONET/SHD physical layer control */ + @@ -7514,7 +7509,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/net/atmclip.h Sat Jun 6 03:54:41 1998 ++++ work/include/net/atmclip.h Thu Jun 18 19:02:24 1998 @@ -0,0 +1,62 @@ +/* net/atm/atmarp.h - RFC1577 ATM ARP */ + @@ -7579,7 +7574,7 @@ + +#endif --- ref/net/Config.in Tue Apr 28 20:10:10 1998 -+++ work/net/Config.in Sat Jun 6 03:32:39 1998 ++++ work/net/Config.in Tue Jun 9 21:32:12 1998 @@ -23,6 +23,20 @@ fi fi @@ -7602,7 +7597,7 @@ comment ' ' tristate 'The IPX protocol' CONFIG_IPX --- ref/net/Makefile Sun Nov 30 23:00:39 1997 -+++ work/net/Makefile Sat Jun 6 03:32:39 1998 ++++ work/net/Makefile Tue Jun 9 21:32:12 1998 @@ -9,7 +9,8 @@ MOD_SUB_DIRS := ipv4 @@ -7628,7 +7623,7 @@ ifeq ($(CONFIG_DECNET),y) --- ref/net/protocols.c Sun Nov 30 23:00:40 1997 -+++ work/net/protocols.c Sat Jun 6 03:32:39 1998 ++++ work/net/protocols.c Tue Jun 9 21:32:12 1998 @@ -79,6 +79,10 @@ extern void rif_init(struct net_proto *); #endif @@ -7653,7 +7648,7 @@ #ifdef NEED_LLC { "802.2LLC", llc_init }, /* 802.2 LLC */ --- ref/net/ipv4/arp.c Thu May 14 19:26:23 1998 -+++ work/net/ipv4/arp.c Sat Jun 6 03:32:39 1998 ++++ work/net/ipv4/arp.c Tue Jun 9 21:32:12 1998 @@ -115,6 +115,9 @@ #include #endif @@ -7678,7 +7673,7 @@ } --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/Makefile Sat Jun 6 03:32:40 1998 ++++ work/net/atm/Makefile Tue Jun 9 21:32:12 1998 @@ -0,0 +1,52 @@ +# +# Makefile for the ATM Protocol Families. @@ -7733,7 +7728,7 @@ + +include $(TOPDIR)/Rules.make --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/addr.c Sat Jun 6 03:32:40 1998 ++++ work/net/atm/addr.c Tue Jun 9 21:32:12 1998 @@ -0,0 +1,159 @@ +/* net/atm/addr.c - Local ATM address registry */ + @@ -7895,7 +7890,7 @@ + return total; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/addr.h Sat Jun 6 03:55:27 1998 ++++ work/net/atm/addr.h Thu Jun 18 19:02:34 1998 @@ -0,0 +1,18 @@ +/* net/atm/addr.h - Local ATM address registry */ + @@ -7916,7 +7911,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/clip.c Sat Jun 6 03:32:40 1998 ++++ work/net/atm/clip.c Wed Jun 17 02:54:35 1998 @@ -0,0 +1,645 @@ +/* clip.c - RFC1577 Classical IP over ATM */ + @@ -8113,7 +8108,7 @@ + } + atm_return(vcc,skb->truesize); + skb->dev = clip_vcc->entry ? clip_vcc->entry->neigh->dev : clip_devs; -+ /* clip_vcc_entry == NULL if we don't have an IP address yet */ ++ /* clip_vcc->entry == NULL if we don't have an IP address yet */ + if (!skb->dev) { + kfree_skb(skb); + return; @@ -8564,7 +8559,7 @@ + return 0; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/common.c Sat Jun 6 03:32:40 1998 ++++ work/net/atm/common.c Tue Jun 9 21:32:12 1998 @@ -0,0 +1,903 @@ +/* net/atm/common.c - ATM sockets (common part for PVC and SVC) */ + @@ -9470,7 +9465,7 @@ + return atm_do_getsockopt(sock,level,optname,optval,len); +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/common.h Sat Jun 6 03:55:27 1998 ++++ work/net/atm/common.h Tue Jun 9 21:50:44 1998 @@ -0,0 +1,44 @@ +/* net/atm/common.h - ATM sockets (common part for PVC and SVC) */ + @@ -9517,7 +9512,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/ipcommon.c Sat Jun 6 03:32:40 1998 ++++ work/net/atm/ipcommon.c Tue Jun 9 21:32:12 1998 @@ -0,0 +1,52 @@ +/* net/atm/ipcommon.c - Common items for all ways of doing IP over ATM */ + @@ -9572,11 +9567,11 @@ + skb_queue_head_init(from); +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/ipcommon.h Sat Jun 6 03:55:37 1998 -@@ -0,0 +1,23 @@ ++++ work/net/atm/ipcommon.h Thu Jun 18 19:02:55 1998 +@@ -0,0 +1,22 @@ +/* net/atm/ipcommon.h - Common items for all ways of doing IP over ATM */ + -+/* Written 1996,1997 by Werner Almesberger, EPFL LRC */ ++/* Written 1996-1998 by Werner Almesberger, EPFL LRC/ICA */ + + +#ifndef NET_ATM_IPCOMMON_H @@ -9587,7 +9582,6 @@ +#include +#include +#include -+/*#include */ + + +extern const unsigned char llc_oui[6]; @@ -9598,8 +9592,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/misc.c Sat Jun 6 03:32:40 1998 -@@ -0,0 +1,187 @@ ++++ work/net/atm/misc.c Thu Jun 18 19:02:36 1998 +@@ -0,0 +1,182 @@ +/* net/atm/misc.c - Various functions for use by ATM drivers */ + +/* Written 1995-1997 by Werner Almesberger, EPFL ICA */ @@ -9615,11 +9609,6 @@ +#include "tunable.h" + + -+/* This is the algorithm used by alloc_skb */ -+ -+#define ADJUST_SIZE(s) ((((s)+15) & ~15)+sizeof(struct sk_buff)) -+ -+ +int atm_charge(struct atm_vcc *vcc,int truesize) +{ + atomic_add(truesize+ATM_PDU_OVHD,&vcc->rx_inuse); @@ -9788,7 +9777,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/lec.c Sat Jun 6 03:32:40 1998 ++++ work/net/atm/lec.c Wed Jun 24 19:01:47 1998 @@ -0,0 +1,1895 @@ +/* + * lec.c: Lan Emulation driver @@ -10464,7 +10453,7 @@ + } + lec_arp_init(priv); + priv->lecd = vcc; -+ vcc->dev = &lecatm_dev; ++ bind_vcc(vcc,&lecatm_dev); + + vcc->proto_data = dev_lec[i]; + vcc->flags |= ATM_VF_READY | ATM_VF_META; @@ -11686,7 +11675,7 @@ +} + --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/lec.h Sat Jun 6 03:55:27 1998 ++++ work/net/atm/lec.h Thu Jun 18 19:02:33 1998 @@ -0,0 +1,112 @@ +/* + * @@ -11801,7 +11790,7 @@ +#endif _LEC_H_ + --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/lec_arpc.h Sat Jun 6 03:55:27 1998 ++++ work/net/atm/lec_arpc.h Thu Jun 18 19:02:34 1998 @@ -0,0 +1,112 @@ +/* + * Lec arp cache @@ -11916,8 +11905,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/proc.c Sat Jun 6 03:32:40 1998 -@@ -0,0 +1,607 @@ ++++ work/net/atm/proc.c Wed Jun 17 02:59:45 1998 +@@ -0,0 +1,606 @@ +/* net/atm/proc.c - ATM /proc interface */ + +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ @@ -12175,15 +12164,14 @@ + class_name[vcc->qos.txtp.traffic_class]); +#ifdef CONFIG_ATM_CLIP + if (vcc->push == clip_push) { ++ struct clip_vcc *clip_vcc = CLIP_VCC(vcc); + struct device *dev; + -+ dev = (struct device *) vcc->proto_data; -+ off += sprintf(buf+off,"CLIP, Itf:%s, Encap:",dev->name); -+ if (dev->hard_header_len == RFC1483LLC_LEN) -+ off += sprintf(buf+off,"LLC/SNAP"); -+ else if (dev->hard_header_len == 0) -+ off += sprintf(buf+off,"None"); -+ else off += sprintf(buf+off,"Unknown"); ++ dev = clip_vcc->entry ? clip_vcc->entry->neigh->dev : NULL; ++ off += sprintf(buf+off,"CLIP, Itf:%s, Encap:", ++ dev ? dev->name : "none?"); ++ if (clip_vcc->encap) off += sprintf(buf+off,"LLC/SNAP"); ++ else off += sprintf(buf+off,"None"); + } +#endif + strcpy(buf+off,"\n"); @@ -12526,7 +12514,7 @@ + return error; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/protocols.h Sat Jun 6 03:32:40 1998 ++++ work/net/atm/protocols.h Tue Jun 9 21:32:12 1998 @@ -0,0 +1,16 @@ +/* net/atm/protocols.h - ATM protocol handler entry points */ + @@ -12545,8 +12533,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/pvc.c Sat Jun 6 03:32:40 1998 -@@ -0,0 +1,157 @@ ++++ work/net/atm/pvc.c Wed Jun 17 02:46:50 1998 +@@ -0,0 +1,158 @@ +/* net/atm/pvc.c - ATM PVC sockets */ + +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ @@ -12562,6 +12550,7 @@ +#include /* printk */ +#include +#include ++#include /* for sock_no_* */ +#ifdef CONFIG_AREQUIPA +#include +#endif @@ -12651,7 +12640,7 @@ + atm_release, + pvc_bind, + pvc_connect, -+ NULL, /* no socketpair */ ++ sock_no_socketpair, + pvc_accept, + pvc_getname, + atm_poll, @@ -12660,7 +12649,7 @@ + pvc_shutdown, + atm_setsockopt, + atm_getsockopt, -+ NULL, /* no fcntl */ ++ sock_no_fcntl, + atm_sendmsg, + atm_recvmsg +}; @@ -12705,7 +12694,7 @@ +#endif +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/raw.c Sat Jun 6 03:32:40 1998 ++++ work/net/atm/raw.c Tue Jun 9 21:32:12 1998 @@ -0,0 +1,80 @@ +/* net/atm/raw.c - Raw AAL0 and AAL5 transports */ + @@ -12788,7 +12777,7 @@ + return 0; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/resources.c Sat Jun 6 03:32:40 1998 ++++ work/net/atm/resources.c Tue Jun 9 21:32:12 1998 @@ -0,0 +1,183 @@ +/* net/atm/resources.c - Staticly allocated resources */ + @@ -12974,7 +12963,7 @@ + } +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/resources.h Sat Jun 6 03:55:27 1998 ++++ work/net/atm/resources.h Thu Jun 18 19:02:34 1998 @@ -0,0 +1,29 @@ +/* net/atm/resources.h - ATM-related resources */ + @@ -13006,7 +12995,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/signaling.c Sat Jun 6 03:32:40 1998 ++++ work/net/atm/signaling.c Wed Jun 24 18:58:25 1998 @@ -0,0 +1,253 @@ +/* net/atm/signaling.c - ATM signaling */ + @@ -13262,7 +13251,7 @@ + return 0; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/signaling.h Sat Jun 6 03:55:27 1998 ++++ work/net/atm/signaling.h Thu Jun 18 19:02:34 1998 @@ -0,0 +1,25 @@ +/* net/atm/signaling.h - ATM signaling */ + @@ -13290,8 +13279,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/svc.c Sat Jun 6 03:32:40 1998 -@@ -0,0 +1,384 @@ ++++ work/net/atm/svc.c Thu Jun 18 10:14:09 1998 +@@ -0,0 +1,385 @@ +/* net/atm/svc.c - ATM SVC sockets */ + +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ @@ -13311,6 +13300,7 @@ +#include +#include +#include ++#include /* for sock_no_* */ +#include + +#include "resources.h" @@ -13530,7 +13520,7 @@ + while (1) { + while (!(skb = skb_dequeue(&old_vcc->listenq)) && sigd) { + if (old_vcc->flags & ATM_VF_RELEASED) break; -+ if (flags & O_NONBLOCK) return 0; /* not -EAGAIN ? */ ++ if (flags & O_NONBLOCK) return -EAGAIN; + interruptible_sleep_on(&old_vcc->sleep); + if (signal_pending(current)) return -ERESTARTSYS; + } @@ -13627,7 +13617,7 @@ + svc_release, + svc_bind, + svc_connect, -+ NULL, /* no socketpair */ ++ sock_no_socketpair, + svc_accept, + svc_getname, + atm_poll, @@ -13636,7 +13626,7 @@ + svc_shutdown, + svc_setsockopt, + svc_getsockopt, -+ NULL, /* no fcntl */ ++ sock_no_fcntl, + atm_sendmsg, + atm_recvmsg +}; @@ -13677,7 +13667,7 @@ + } +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/tunable.h Sat Jun 6 03:32:40 1998 ++++ work/net/atm/tunable.h Tue Jun 9 21:32:12 1998 @@ -0,0 +1,26 @@ +/* net/atm/tunable.h - Tunable parameters of ATM support */ + @@ -13706,7 +13696,7 @@ + +#endif --- ref/net/core/skbuff.c Thu May 14 19:26:22 1998 -+++ work/net/core/skbuff.c Sat Jun 6 03:32:40 1998 ++++ work/net/core/skbuff.c Tue Jun 9 21:32:12 1998 @@ -149,6 +149,13 @@ skb->is_clone = 0; skb->cloned = 0; diff -ur --new-file old/atm/debug/aqtest.c new/atm/debug/aqtest.c --- old/atm/debug/aqtest.c Mon Oct 20 22:26:19 1997 +++ new/atm/debug/aqtest.c Tue Jun 9 14:43:59 1998 @@ -1,6 +1,6 @@ /* aqtest.c - Simplistic Arequipa tester */ -/* Written 1997 by Werner Almesberger, EPFL-LRC */ +/* Written 1997,1998 by Werner Almesberger, EPFL-LRC/ICA */ /* Based on work by Mehdi Tazi */ @@ -15,7 +15,6 @@ #include #include -#include #define DEFAULT_PORT 1997 diff -ur --new-file old/atm/debug/ed.c new/atm/debug/ed.c --- old/atm/debug/ed.c Fri Apr 4 20:05:37 1997 +++ new/atm/debug/ed.c Tue Jun 9 14:44:08 1998 @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff -ur --new-file old/atm/debug/znth.c new/atm/debug/znth.c --- old/atm/debug/znth.c Tue Nov 18 23:17:34 1997 +++ new/atm/debug/znth.c Tue Jun 9 14:44:17 1998 @@ -1,6 +1,6 @@ /* znth.c - ZN122x timestamp adjustments history */ -/* Written 1996,1997 by Werner Almesberger, EPFL-LRC */ +/* Written 1996-1998 by Werner Almesberger, EPFL-LRC/ICA */ #include @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff -ur --new-file old/atm/doc/usage.tex new/atm/doc/usage.tex --- old/atm/doc/usage.tex Sat Jun 6 01:30:03 1998 +++ new/atm/doc/usage.tex Thu Jun 25 13:29:22 1998 @@ -1,7 +1,7 @@ %%def%:= %:\begin{verbatim} -%:Usage instructions - ATM on Linux, release 0.37 +%:Usage instructions - ATM on Linux, release 0.38 %:------------------------------------------------- %: %:\end{verbatim} @@ -38,14 +38,14 @@ \title{ATM on Linux \\ User's guide \\ - Release 0.37 (alpha)} + Release 0.38 (alpha)} \author{Werner Almesberger \\ {\tt Werner.Almesberger@epfl.ch} \\ \\ Institute for computer Communications and Applications (ICA) \\ EPFL, CH-1015 Lausanne, Switzerland} -\date{March 27, 1997} +\date{June 25, 1998} \begin{document} \maketitle @@ -81,9 +81,9 @@ 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.37.tar.gz} - \item the Linux kernel, version 2.1.104, e.g. from - \url{ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.104.tar.gz} + \url{ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.38.tar.gz} + \item the Linux kernel, version 2.1.105, e.g. from + \url{ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.105.tar.gz} \item Perl, version 4 or 5 \item if you want memory debugging: MPR version 1.6, e.g. from \url{ftp://sunsite.unc.edu/pub/Linux/devel/lang/c/mpr-1.6.tar.gz} @@ -98,13 +98,13 @@ distribution: \begin{verbatim} -tar xfz atm-0.37.tar.gz +tar xfz atm-0.38.tar.gz \end{verbatim} and the kernel source: \begin{verbatim} -tar xfz linux-2.1.104.tar.gz +tar xfz linux-2.1.105.tar.gz \end{verbatim} Finally, you can extract the ATM-related patches: @@ -143,6 +143,7 @@ \item[\path{atm/man/}] Miscellaneous man pages \item[\path{atm/extra/}] Extra packages (\name{tcpdump} and \name{ans}) \item[\path{atm/config/}] Configuration file examples + \item[\path{atm/switch/}] Switch fabric control (under construction) \end{description} @@ -745,7 +746,7 @@ So here on nestor we start \name{atmsigd} with: \begin{verbatim} -atmsigd -b -N +atmsigd -b -m network \end{verbatim} and on virgil with: diff -ur --new-file old/atm/doc/usage.txt new/atm/doc/usage.txt --- old/atm/doc/usage.txt Sat Jun 6 04:17:28 1998 +++ new/atm/doc/usage.txt Thu Jun 25 14:13:40 1998 @@ -1,4 +1,4 @@ -Usage instructions - ATM on Linux, release 0.37 +Usage instructions - ATM on Linux, release 0.38 ------------------------------------------------- For updates of ATM on Linux, please check the Web page at @@ -17,9 +17,9 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.37.tar.gz - - the Linux kernel, version 2.1.104, e.g. from - ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.104.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.38.tar.gz + - the Linux kernel, version 2.1.105, e.g. from + ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.105.tar.gz - Perl, version 4 or 5 - if you want memory debugging: MPR version 1.6, e.g. from ftp://sunsite.unc.edu/pub/Linux/devel/lang/c/mpr-1.6.tar.gz @@ -33,11 +33,11 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.37.tar.gz +tar xfz atm-0.38.tar.gz and the kernel source: -tar xfz linux-2.1.104.tar.gz +tar xfz linux-2.1.105.tar.gz Finally, you can extract the ATM-related patches: @@ -67,6 +67,7 @@ atm/man/ Miscellaneous man pages atm/extra/ Extra packages (tcpdump and ans) atm/config/ Configuration file examples + atm/switch/ Switch fabric control (under construction) Kernel configuration @@ -601,7 +602,7 @@ and the other side should use the normal user version. So here on nestor we start atmsigd with: -atmsigd -b -N +atmsigd -b -m network and on virgil with: diff -ur --new-file old/atm/lane/lecs.c new/atm/lane/lecs.c --- old/atm/lane/lecs.c Wed Mar 18 22:12:17 1998 +++ new/atm/lane/lecs.c Tue Jun 9 14:41:39 1998 @@ -19,7 +19,7 @@ #include /* ATM includes */ -#include +#include /* Local includes */ #include "lecs_load.h" diff -ur --new-file old/atm/led/conn.h new/atm/led/conn.h --- old/atm/led/conn.h Thu Feb 26 21:25:29 1998 +++ new/atm/led/conn.h Tue Jun 9 14:44:36 1998 @@ -8,7 +8,7 @@ #define CONN_H #include -#include +#include #include #include diff -ur --new-file old/atm/led/svc_info.h new/atm/led/svc_info.h --- old/atm/led/svc_info.h Wed Nov 19 12:59:15 1997 +++ new/atm/led/svc_info.h Tue Jun 9 14:45:01 1998 @@ -50,7 +50,7 @@ #ifndef SVC_INFO_H #define SVC_INFO_H -#include +#include /* Cause Values */ diff -ur --new-file old/atm/lib/arequipa.h new/atm/lib/arequipa.h --- old/atm/lib/arequipa.h Fri Feb 27 19:38:16 1998 +++ new/atm/lib/arequipa.h Tue Jun 9 14:45:27 1998 @@ -7,7 +7,7 @@ #ifndef _AREQUIPA_H #define _AREQUIPA_H -#include +#include int arequipa_preset(int sd,const struct sockaddr_atmsvc *addr, const struct atm_qos *qos); diff -ur --new-file old/atm/lib/sapequal.c new/atm/lib/sapequal.c --- old/atm/lib/sapequal.c Thu Mar 5 16:21:10 1998 +++ new/atm/lib/sapequal.c Wed Jun 24 18:50:45 1998 @@ -10,10 +10,12 @@ #include "atmsap.h" -static int bhli_compat(const struct atm_bhli a,const struct atm_bhli b) +static int bhli_compat(const struct atm_bhli a,const struct atm_bhli b, + int flags) { int length; + if (!a.hl_type && (flags & SXE_COMPATIBLE)) return 1; if (a.hl_type != b.hl_type) return 0; switch (a.hl_type) { case ATM_HL_ISO: @@ -122,11 +124,11 @@ va_start(ap,flags); res = flags & SXE_RESULT ? va_arg(ap,struct atm_sap *) : NULL; va_end(ap); - if (!bhli_compat(a->bhli,b->bhli)) return 0; + if (!bhli_compat(a->bhli,b->bhli,flags)) return 0; if (!blli_compat(a->blli,b->blli,flags,res ? res->blli : NULL)) return 0; if (res) { - res->bhli = a->bhli; - memset(res->blli+1,0,sizeof(struct atm_blli)*2); + res->bhli = b->bhli; + memset(res->blli+1,0,sizeof(struct atm_blli)*(ATM_MAX_BLLI-1)); } return 1; } diff -ur --new-file old/atm/maint/atmtcp.8 new/atm/maint/atmtcp.8 --- old/atm/maint/atmtcp.8 Thu Apr 16 11:29:14 1998 +++ new/atm/maint/atmtcp.8 Thu Jun 25 10:42:15 1998 @@ -1,4 +1,4 @@ -.TH ATMTCP 8 "Apr 16, 1998" "Linux" "Maintenance Commands" +.TH ATMTCP 8 "June 25, 1998" "Linux" "Maintenance Commands" .SH NAME atmtcp \- set up ATM over TCP connections .SH SYNOPSIS @@ -15,12 +15,20 @@ .B \-c .I host .RB [ \fIrmtport\fB ] +.br +.B atmtcp +.RB [ -b ] +.RB [ -i \fIitf\fB ] +.B \-s +.I host +.I line +.RB [ \fIrmtport\fB ] .ad b .SH DESCRIPTION .B atmtcp establishes TCP connections and configures them as virtual ATM devices. Such pairs of "ATM over TCP" devices are connected as if they were real -ATM adapters linked by a cable or fiber, i.e. PDUs sent on a given VPI/VCI +ATM adapters linked by a cable or fiber, i.e. SDUs sent on a given VPI/VCI are received at the other end on the same VPI/VCI. .PP The optional port arguments are used to run @@ -36,8 +44,10 @@ listen for an incoming connection. Only one connection is accepted. .IP \fB\-c\ \fIhost\fP connect to an instance of \fBatmtcp\fP running on the specified host. +.IP \fB\-s\ \fIhost\fP\ \fIline\fP +connect to an \fBatmtcp\fP "switch", attaching to the specified virtual line. .SH RESTRICTIONS -Only AAL PDUs are exchanged, no segmentation or reassembly is performed. +Only AAL SDUs are exchanged, no segmentation or reassembly is performed. That implies that using different AALs (e.g. AAL5 and AAL0) on either side will reveal limitations of this emulation. .B atmtcp diff -ur --new-file old/atm/maint/atmtcp.c new/atm/maint/atmtcp.c --- old/atm/maint/atmtcp.c Sat Jun 6 02:42:32 1998 +++ new/atm/maint/atmtcp.c Thu Jun 25 10:43:15 1998 @@ -27,6 +27,24 @@ static int s_tcp,s_krn; +static int debug = 0; + + +static void net_write(void *data,int size) +{ + int wrote; + + wrote = write(s_tcp,data,size); + if (wrote < 0) { + perror("write to TCP"); + exit(1); + } + if (!wrote) exit(0); /* EOF */ + if (wrote != size) { + fprintf(stderr,"bad write (%d != %d)\n",wrote,size); + exit(1); + } +} /* @@ -38,11 +56,12 @@ static void from_tcp(void) { static char buf[MAX_PACKET]; + static struct atmtcp_hdr *hdr = (struct atmtcp_hdr *) buf; static int bytes = 0; int ret,size; size = sizeof(struct atmtcp_hdr)-bytes; - if (size <= 0) size += ntohl(((struct atmtcp_hdr *) buf)->length); + if (size <= 0) size += ntohl(hdr->length); ret = read(s_tcp,buf+bytes,size); if (ret < 0) { perror("read from TCP"); @@ -53,11 +72,13 @@ if (bytes < sizeof(struct atmtcp_hdr)) return; if (ntohl(((struct atmtcp_hdr *) buf)->length) > ATM_MAX_AAL5_PDU) { fprintf(stderr,"giant PDU (length = %d) received\n", - (unsigned int) ntohl(((struct atmtcp_hdr *) buf)->length)); + (unsigned int) ntohl(hdr->length)); exit(1); } - if (bytes < sizeof(struct atmtcp_hdr)+ - ntohl(((struct atmtcp_hdr *) buf)->length)) return; + if (bytes < sizeof(struct atmtcp_hdr)+ntohl(hdr->length)) return; + if (debug) + fprintf(stderr,"TCP %d.%d, %d bytes\n",ntohs(hdr->vpi),ntohs(hdr->vci), + (unsigned int) ntohl(hdr->length)); size = write(s_krn,buf,bytes); if (size < 0) perror("write to kernel"); else if (size != bytes) { @@ -71,7 +92,8 @@ static void to_tcp(void) { char buf[MAX_PACKET]; - int ret,wrote; + struct atmtcp_hdr *hdr = (struct atmtcp_hdr *) buf; + int ret; ret = read(s_krn,buf,MAX_PACKET); if (ret < 0) { @@ -83,69 +105,88 @@ fprintf(stderr,"kernel message too small (%d)\n",ret); exit(1); } - if (ret != sizeof(struct atmtcp_hdr)+ - ntohl(((struct atmtcp_hdr *) buf)->length)) { + if (debug) + fprintf(stderr,"KRN %d.%d, %d bytes\n",ntohs(hdr->vpi),ntohs(hdr->vci), + (unsigned int) ntohl(hdr->length)); + if (ret != sizeof(struct atmtcp_hdr)+ntohl(hdr->length)) { fprintf(stderr,"invalid kernel message\n"); exit(1); } - wrote = write(s_tcp,buf,ret); - if (wrote < 0) { - perror("write to TCP"); - exit(1); - } - if (!wrote) exit(0); /* EOF */ - if (wrote != ret) { - fprintf(stderr,"bad write (%d != %d)\n",wrote,ret); - exit(1); - } + net_write(buf,ret); } static void usage(const char *name) { - fprintf(stderr,"%s [ -b ] [ -i itf ] -l [ ]\n",name); - fprintf(stderr,"%s [ -b ] [ -i itf ] -c [ ]\n",name); + fprintf(stderr,"%s [ -b ] [ -d ] [ -i itf ] -l [ ]\n",name); + fprintf(stderr,"%s [ -b ] [ -d ] [ -i itf ] -c [ ]\n", + name); + fprintf(stderr,"%s [ -b ] [ -d ] [ -i itf ] -s " + "[ ]\n",name); exit(1); } int main(int argc,char **argv) { + enum { m_undefined,m_listen,m_connect,m_switch } mode; struct sockaddr_in addr; const char *name; - int background,listen_mode,port,itf; + char *end; + char *host,*line; + int background,port,itf; int s2; + int c; name = argv[0]; + mode = m_undefined; background = 0; + host = line = NULL; /* for gcc */ itf = -1; - while (argc > 2) { - if (!strcmp(argv[1],"-b")) { - if (background) usage(name); - background = 1; - argc--; - argv++; - } - else if (!strcmp(argv[1],"-i")) { - char *end; - - if (itf != -1) usage(name); - itf = strtoul(argv[2],&end,10); - if (*end) usage(name); - argc -= 2; - argv += 2; + while ((c = getopt(argc,argv,"bdi:lc:s:")) != EOF) + switch (c) { + case 'b': + background = 1; + break; + case 'd': + debug = 1; + break; + case 'i': + if (itf != -1) usage(name); + itf = strtoul(optarg,&end,10); + if (*end) usage(name); + break; + case 'l': + if (mode != m_undefined) usage(name); + mode = m_listen; + break; + case 'c': + if (mode != m_undefined) usage(name); + mode = m_connect; + host = optarg; + break; + case 's': + if (mode != m_undefined) usage(name); + mode = m_switch; + host = optarg; + break; + default: + usage(name); } - else break; - } - if (argc < 2) usage(name); - listen_mode = !strcmp(argv[1],"-l"); - if (listen_mode) { - if (argc > 3) usage(name); - port = argc == 3 ? atoi(argv[2]) : -1; - } - else { - if (argc > 4 || strcmp(argv[1],"-c")) usage(name); - port = argc == 4 ? atoi(argv[3]) : -1; + if (mode == m_undefined) usage(name); + switch (mode) { + case m_switch: + if (argc == optind) usage(name); + line = argv[optind++]; + /* fall through */ + case m_connect: + /* fall through */ + case m_listen: + if (argc > optind+1) usage(name); + port = argc == optind+1 ? atoi(argv[optind]) : -1; + break; + default: + abort(); } if ((s_tcp = socket(PF_INET,SOCK_STREAM,0)) < 0) { perror("socket"); @@ -156,7 +197,7 @@ addr.sin_port = htons(port == -1 ? PORT : port); /* * Create atmtcp interface before setting up the TCP connection in order - * to make assignment of interface numbers a bit more predictable. + * to make the assignment of interface numbers a bit more predictable. */ if ((s_krn = socket(PF_ATMSVC,SOCK_DGRAM,0)) < 0) { perror("socket"); @@ -166,7 +207,7 @@ perror("ioctl SIOCSIFATMTCP"); return 1; } - if (listen_mode) { + if (mode == m_listen) { addr.sin_addr.s_addr = htonl(INADDR_ANY); if (bind(s_tcp,(struct sockaddr *) &addr,sizeof(addr)) < 0) { perror("bind"); @@ -187,11 +228,11 @@ else { struct hostent *h; - h = gethostbyname(argv[2]); + h = gethostbyname(host); if (h) memcpy(&addr.sin_addr.s_addr,h->h_addr, sizeof(addr.sin_addr.s_addr)); - else if ((addr.sin_addr.s_addr = inet_addr(argv[2])) == -1) { + else if ((addr.sin_addr.s_addr = inet_addr(host)) == -1) { herror(argv[2]); return 1; } @@ -199,6 +240,7 @@ perror("connect"); return 1; } + if (mode == m_switch) net_write(line,strlen(line)+1); } printf("Connected, interface %d\n",itf); if (background) { diff -ur --new-file old/atm/mkdist new/atm/mkdist --- old/atm/mkdist Sat Jun 6 04:15:43 1998 +++ new/atm/mkdist Thu Jun 25 13:33:48 1998 @@ -1,7 +1,7 @@ #!/bin/sh [ -r ./VERSION ] || exit 1 VERSION=`cat ./VERSION` -SRCDIR=$HOME/k/2104 +SRCDIR=$HOME/k/2105 ARCHDIR=$HOME/l/arch ( cd $SRCDIR @@ -111,9 +111,10 @@ atm/switch/Makefile atm/switch/Rules.make atm/switch/cfg.l atm/switch/cfg.y \ atm/switch/fab.h atm/switch/proto.h atm/switch/proto.c atm/switch/relay.c \ atm/switch/route.h atm/switch/route.c atm/switch/sig.h atm/switch/sig.c \ - atm/switch/dispatch.h atm/switch/dispatch.c \ + atm/switch/dispatch.h atm/switch/dispatch.c atm/switch/README \ atm/switch/debug/README atm/switch/debug/Makefile atm/switch/debug/debug.c \ atm/switch/debug/demo \ + atm/switch/tcp/README atm/switch/tcp/Makefile atm/switch/tcp/tcpsw.c \ atm/extra/extra.html atm/extra/Makefile atm/extra/tcpdump-3.0.4-1.patch \ atm/extra/bind-4.9.5-REL.patch atm/extra/hosts2ans.pl \ atm/config/README atm/config/Makefile atm/config\ diff -ur --new-file old/atm/qgen/Makefile new/atm/qgen/Makefile --- old/atm/qgen/Makefile Mon Oct 20 17:28:02 1997 +++ new/atm/qgen/Makefile Wed Jun 17 09:18:46 1998 @@ -39,7 +39,8 @@ default.nl: mknl.pl $(SYMFILES) cat $(SYMFILES) | \ - perl mknl.pl $(NLS) >default.nl + perl mknl.pl $(NLS) >default.nl || \ + { rm -f default.nl; echo 1; } 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/sigd/atmsigd.8 new/atm/sigd/atmsigd.8 --- old/atm/sigd/atmsigd.8 Thu Oct 30 22:05:06 1997 +++ new/atm/sigd/atmsigd.8 Thu Jun 25 13:08:40 1998 @@ -1,4 +1,4 @@ -.TH ATMSIGD 8 "Oct 30, 1997" "Linux" "Maintenance Commands" +.TH ATMSIGD 8 "June 25, 1998" "Linux" "Maintenance Commands" .SH NAME atmsigd \- ATM signaling demon .SH SYNOPSIS @@ -8,8 +8,8 @@ .RB [ \-d ] .RB [ \-D\ \fIdump_dir\fP ] .RB [ \-l\ \fIlogfile\fP ] +.RB [ \-m\ \fImode\fP ] .RB [ \-n ] -.RB [ \-N ] .RB [ \-q\ \fIqos\fP ] .RB [ \-t\ \fItrace_length\fP ] .RB [ [\fIitf\fP.]\fIvpi\fP.\fIvci\fP @@ -54,12 +54,14 @@ is used to send diagnostics to standard error. If \fB\-l\fP is absent, the setting in \fBatmsigd.conf\fP is used. If \fBatmsigd\fP doesn't specify a destination either, messages are written to standard error. +.IP \fB\-m\ \fImode\fP +Set the mode of operation. The following modes are available: \fBuser\fP for +the user side (the default), \fBnetwork\fP for the network side (useful if you +have two PCs but no switch), and \fBswitch\fP for operation with a signaling +relay in a switch. .IP \fB\-n\fP Prints addresses in numeric format only, i.e. no address to name translation is attempted. -.IP \fB\-N\fP -Makes \fBatmsigd\fP 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\-q\ \fIqos\fP Configures the signaling VC to use the specified quality of service (see qos(7) for the syntax). @@ -97,7 +99,7 @@ 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 +Werner Almesberger, EPFL ICA .SH "SEE ALSO" atmaddr(8), atmsigd.conf(4), ilmid(8), qos(7) .\"{{{}}} diff -ur --new-file old/atm/sigd/atmsigd.c new/atm/sigd/atmsigd.c --- old/atm/sigd/atmsigd.c Sat Jun 6 02:03:26 1998 +++ new/atm/sigd/atmsigd.c Wed Jun 24 20:44:01 1998 @@ -29,14 +29,16 @@ extern int yyparse(void); extern FILE *yyin; -int net = 0; -int allocate_ci = 1; int debug = 0; int pretty = A2T_PRETTY | A2T_NAME | A2T_LOCAL; int sig_pcr = -1; /* obsolete */ const char *sig_qos = NULL; const char *dump_dir = NULL; +SIGNALING_MODE mode = sm_user; +int net = 0; +int allocate_ci = 1; + /* ------------------------------ SAAL relays ------------------------------ */ @@ -282,8 +284,8 @@ { fprintf(stderr,"usage: %s [ -b ] [ -c config_file ] [ -d ] " "[ -D dump_dir ]\n" - " [ -l logfile ] [ -n ] [ -N [ -A ] ] [ -q qos ] [ -t trace_length ]\n" - " [ [itf.]vpi.vci [ socket_path ] ]\n",name); + " [ -l logfile ] [ -n ] [ -m user|network|switch ] [ -q qos ]\n" + " [ -t trace_length ] [ [itf.]vpi.vci [ socket_path ] ]\n",name); exit(1); } @@ -301,7 +303,7 @@ memset(&signaling_pvc,0,sizeof(signaling_pvc)); signaling_pvc.sap_addr.vci = 5; /* 1st pass to get the -c option */ - while ((c = getopt(argc,argv,"Abc:dD:l:nNP:q:t:")) != EOF) + while ((c = getopt(argc,argv,"Abc:dD:l:m:nNP:q:t:")) != EOF) if (c == 'c') config_file = optarg; if (!(yyin = fopen(config_file,"r"))) diag(COMPONENT,DIAG_WARN,"%s not found. - Using defaults.",config_file); @@ -309,7 +311,7 @@ diag(COMPONENT,DIAG_FATAL,"Error in config file. - Aborting."); /* process all other options but -c */ optind = 0; - while ((c = getopt(argc,argv,"Abc:dD:l:nNP:q:t:")) != EOF) + while ((c = getopt(argc,argv,"Abc:dD:l:m:nNP:q:t:")) != EOF) switch (c) { case 'A': allocate_ci = 0; @@ -334,6 +336,12 @@ case 'l': set_logfile(optarg); break; + case 'm': + if (!strcmp(optarg,"user")) mode = sm_user; + else if (!strcmp(optarg,"network")) mode = sm_net; + else if (!strcmp(optarg,"switch")) mode = sm_switch; + else usage(argv[0]); + break; case 'n': pretty = A2T_PRETTY; break; @@ -356,7 +364,38 @@ default: usage(argv[0]); } - if (!allocate_ci && !net) usage(argv[0]); + switch (mode) { + case sm_unknown: + if (net) { + if (allocate_ci) { + mode = sm_net; + diag(COMPONENT,DIAG_WARN,"option -N is obsolete, " + "please use -m network instead"); + } + else { + mode = sm_switch; + diag(COMPONENT,DIAG_WARN,"options -N -A are obsolete, " + "please use -m switch instead"); + } + } + else if (allocate_ci) mode = sm_user; + else usage(argv[0]); + break; + case sm_user: + allocate_ci = 1; /* should be ignored anyway */ + net = 0; + break; + case sm_net: + allocate_ci = 1; + net = 1; + break; + case sm_switch: + allocate_ci = 0; + net = 1; + break; + default: + abort(); + } if (optind < argc) { if (text2atm(argv[optind],(struct sockaddr *) &signaling_pvc, sizeof(signaling_pvc),T2A_PVC) < 0) @@ -388,10 +427,12 @@ 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"); + diag(COMPONENT,DIAG_INFO,"Acting as %s", + mode == sm_user ? "USER side" : + mode == sm_net ? "NETWORK side" : "SWITCH"); if (open_all()) return 1; init_current_time(); - init_addr(); + if (mode != sm_switch) init_addr(); q_start(); start_saal(&saal,&ops,NULL); saal_estab_req(&saal,NULL,0); diff -ur --new-file old/atm/sigd/atmsigd.conf.4 new/atm/sigd/atmsigd.conf.4 --- old/atm/sigd/atmsigd.conf.4 Thu Mar 5 22:58:37 1998 +++ new/atm/sigd/atmsigd.conf.4 Thu Jun 25 13:08:30 1998 @@ -1,4 +1,4 @@ -.TH ATMSIGD.CONF 4 "Mar 5, 1998" "Linux" "File Formats" +.TH ATMSIGD.CONF 4 "June 25, 1998" "Linux" "File Formats" .SH NAME atmsigd.conf \- configuration file for the ATM signaling demon .SH SYNOPSIS @@ -34,7 +34,8 @@ 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. +file is specified. Writing to standard output can also be explicitly requested +by using the special file name \fBstderr\fP. .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 @@ -52,8 +53,10 @@ .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\ mode\ \fImode\fP +Set the mode of operation. The following modes are available: \fBuser\fP for +the user side, \fBnetwork\fP for the network side, and \fBswitch\fP for +operation in a switch. The default behaviour is \fBuser\fP. .IP \fBsig\ uni30\fP Use UNI 3.0 signaling. This option is not implemented. The signaling mode must be configured at compile time. @@ -104,7 +107,7 @@ most keywords. Future versions of \fBatmsigd\fP will only recognize the syntax described on this man page. .SH AUTHOR -Werner Almesberger, EPFL LRC +Werner Almesberger, EPFL ICA .SH "SEE ALSO" atmsigd(8), qos(7), syslogd(8) .\"{{{}}} diff -ur --new-file old/atm/sigd/cfg.l new/atm/sigd/cfg.l --- old/atm/sigd/cfg.l Sat Jun 6 02:10:04 1998 +++ new/atm/sigd/cfg.l Wed Jun 24 20:50:53 1998 @@ -19,6 +19,7 @@ void yyerror(const char *s); +void yywarn(const char *s); %} @@ -39,7 +40,10 @@ uni31 return TOK_UNI31; uni40 return TOK_UNI40; [qQ].2963.1 return TOK_Q2963_1; +mode return TOK_MODE; +user return TOK_USER; network return TOK_NET; +switch return TOK_SWITCH; saal return TOK_SAAL; vc return TOK_VC; io return TOK_IO; @@ -83,8 +87,14 @@ %% -void yyerror(const char *s) +void yywarn(const char *s) { fprintf(stderr,"line %d: %s near \"%s\"\n",lineno,s,yytext); +} + + +void yyerror(const char *s) +{ + yywarn(s); exit(1); } diff -ur --new-file old/atm/sigd/cfg.y new/atm/sigd/cfg.y --- old/atm/sigd/cfg.y Sat Jun 6 02:10:34 1998 +++ new/atm/sigd/cfg.y Wed Jun 24 20:50:49 1998 @@ -16,8 +16,6 @@ #include "policy.h" -extern int net; - static RULE *rule; @@ -56,8 +54,8 @@ %token TOK_LEVEL TOK_DEBUG TOK_INFO TOK_WARN TOK_ERROR TOK_FATAL %token TOK_SIG TOK_UNI30 TOK_UNI31 TOK_UNI40 TOK_Q2963_1 TOK_SAAL -%token TOK_VC TOK_IO TOK_NET TOK_VPCI TOK_ITF TOK_PCR TOK_TRACE -%token TOK_POLICY TOK_ALLOW TOK_REJECT +%token TOK_VC TOK_IO TOK_MODE TOK_USER TOK_NET TOK_SWITCH TOK_VPCI +%token TOK_ITF TOK_PCR TOK_TRACE TOK_POLICY TOK_ALLOW TOK_REJECT %token TOK_NUMBER %token TOK_DUMP_DIR TOK_LOGFILE TOK_QOS TOK_FROM TOK_TO %token TOK_PVC @@ -130,7 +128,7 @@ sig_item: TOK_LEVEL level { - set_verbosity("Q2931",$2); + set_verbosity("UNI",$2); set_verbosity("KERNEL",$2); set_verbosity("SAP",$2); } @@ -164,8 +162,10 @@ } | TOK_NET { + yywarn("sig net is obsolete, please use sig mode net instead"); net = 1; } + | TOK_MODE mode ; saal_item: @@ -245,6 +245,21 @@ | TOK_FATAL { $$ = DIAG_FATAL; + } + ; + +mode: + TOK_USER + { + mode = sm_user; + } + | TOK_NET + { + mode = sm_net; + } + | TOK_SWITCH + { + mode = sm_switch; } ; diff -ur --new-file old/atm/sigd/io.c new/atm/sigd/io.c --- old/atm/sigd/io.c Sat Jun 6 02:04:50 1998 +++ new/atm/sigd/io.c Thu Jun 25 12:56:48 1998 @@ -33,6 +33,7 @@ struct timeval now; struct sockaddr_atmpvc signaling_pvc; +int stop = 0; static int kernel = -1,signaling; static int need_connect = 0; /* non-zero if connection to kernel isn't @@ -282,7 +283,7 @@ FD_SET(signaling,&perm); fds = kernel > signaling ? kernel+1 : signaling+1; gettimeofday(&now,NULL); - while (1) { + while (!stop) { set = perm; poll_signals(); /* diff -ur --new-file old/atm/sigd/io.h new/atm/sigd/io.h --- old/atm/sigd/io.h Sat Jun 6 02:07:21 1998 +++ new/atm/sigd/io.h Tue Jun 9 14:45:52 1998 @@ -7,7 +7,7 @@ #define IO_H #include -#include +#include #include diff -ur --new-file old/atm/sigd/kernel.c new/atm/sigd/kernel.c --- old/atm/sigd/kernel.c Sat Jun 6 02:05:28 1998 +++ new/atm/sigd/kernel.c Thu Jun 25 13:13:07 1998 @@ -538,6 +538,17 @@ itf_load(msg->pvc.sap_addr.itf); return; } + if (msg->type == as_terminate) { + if (mode != sm_switch) { + diag(COMPONENT,DIAG_ERROR,"Ignoring as_terminate received in %s " + "mode",mode == sm_user ? "USER" : "NETWORK"); + return; + } + clear_all_calls(); + stop = 1; + diag(COMPONENT,DIAG_INFO,"Going down on as_terminate"); + return; + } if (msg->listen_vcc && (msg->type == as_accept || msg->type == as_reject || msg->type == as_identify)) { dispatcher = dispatch_listen; diff -ur --new-file old/atm/sigd/proto.c new/atm/sigd/proto.c --- old/atm/sigd/proto.c Fri Mar 13 20:23:31 1998 +++ new/atm/sigd/proto.c Thu Jun 25 12:54:17 1998 @@ -39,7 +39,7 @@ const char *as_name[] = { "","as_bind","as_connect","as_accept", "as_reject","as_listen","as_okay","as_error","as_indicate","as_close", - "as_itf_notify","as_modify","as_identify" }; + "as_itf_notify","as_modify","as_identify","as_terminate" }; const CALL_STATE state_map[] = { /* formatting aligned with STATE */ cs_null, cs_null, cs_null, cs_call_init, @@ -68,7 +68,7 @@ sock = alloc_t(SOCKET); sock->state = ss_invalid; - sock->pvc.sap_addr.vpi = sock->pvc.sap_addr.vci = 0; + memset(&sock->pvc,0,sizeof(sock->pvc)); sock->qos.txtp.traffic_class = sock->qos.rxtp.traffic_class = ATM_UBR; sock->id = id; memset(&sock->local,0,sizeof(sock->local)); diff -ur --new-file old/atm/sigd/proto.h new/atm/sigd/proto.h --- old/atm/sigd/proto.h Sat Jun 6 02:09:22 1998 +++ new/atm/sigd/proto.h Thu Jun 25 12:56:13 1998 @@ -64,6 +64,7 @@ * stable enough to be useful to test the "real" thing against it. */ +typedef enum { sm_unknown,sm_user,sm_net,sm_switch } SIGNALING_MODE; extern const CALL_STATE state_map[]; extern const PARTY_STATE eps_map[]; @@ -74,13 +75,16 @@ #define DEFAULT_TRACE_SIZE 20 -extern int net; -extern int allocate_ci; +extern SIGNALING_MODE mode; +extern int net; /* @@@ remove soon */ +extern int allocate_ci; /* @@@ remove soon */ extern int pretty; extern int sig_pcr; extern const char *sig_qos; extern const char *dump_dir; +extern int stop; + #define SEND_ERROR(vcc,code) \ send_kernel(vcc,0L,as_error,code,NULL,NULL,NULL,NULL,NULL) @@ -100,6 +104,7 @@ void to_signaling(void *msg,int size); void saal_failure(void); void saal_okay(void); +void clear_all_calls(void); void clear_all_calls_on_T309(void); SOCKET *new_sock(unsigned long id); diff -ur --new-file old/atm/sigd/uni.c new/atm/sigd/uni.c --- old/atm/sigd/uni.c Thu Apr 16 16:13:47 1998 +++ new/atm/sigd/uni.c Thu Jun 25 12:53:42 1998 @@ -600,7 +600,7 @@ } -static void clear_all_calls(void) +void clear_all_calls(void) { SOCKET *curr,*next; diff -ur --new-file old/atm/switch/Makefile new/atm/switch/Makefile --- old/atm/switch/Makefile Thu Apr 16 09:06:13 1998 +++ new/atm/switch/Makefile Thu Jun 25 13:34:24 1998 @@ -1,8 +1,13 @@ SW_OBJS=dispatch.o proto.o relay.o route.o sig.o lex.yy.o y.tab.o +SWITCHES=debug tcp all: libsw.a include ../Rules.make + +do_all: + for n in $(SWITCHES); do \ + $(MAKE) -C $$n || exit; done lex.yy.c: cfg.l y.tab.h ../lib/atm.h $(LEX) cfg.l diff -ur --new-file old/atm/switch/README new/atm/switch/README --- old/atm/switch/README Thu Jan 1 01:00:00 1970 +++ new/atm/switch/README Thu Jun 25 13:35:47 1998 @@ -0,0 +1,7 @@ +Switch fabric control. The actual switch interfaces are in the following +subdirectories: + + debug/ a very simple debugging switch + tcp/ an ATMTCP switch, based on sw_debug + +See the README in the respective directory for further details. diff -ur --new-file old/atm/switch/cfg.l new/atm/switch/cfg.l --- old/atm/switch/cfg.l Wed Apr 15 23:21:32 1998 +++ new/atm/switch/cfg.l Wed Jun 24 12:39:36 1998 @@ -35,7 +35,7 @@ route { BEGIN(P); token = TOK_ROUTE; } default return TOK_DEFAULT; -\"[^"\t\n ]*\" { yylval.str = strdup(yytext+1); +\"[^"\t\n]*\" { yylval.str = strdup(yytext+1); *strrchr(yylval.str,'"') = 0; return TOK_STR; } [0-9]+ { char *end; diff -ur --new-file old/atm/switch/cfg.y new/atm/switch/cfg.y --- old/atm/switch/cfg.y Thu Apr 16 10:31:23 1998 +++ new/atm/switch/cfg.y Wed Jun 24 13:16:32 1998 @@ -4,8 +4,8 @@ /* Written 1998 by Werner Almesberger, EPFL ICA */ -#include #include +#include #include #include "atm.h" @@ -31,6 +31,8 @@ %token TOK_NUM %token TOK_PVC +%type opt_command + %% all: @@ -44,15 +46,24 @@ } opt_itf { - sig = sig_vc($2,itf); + char *tmp; + + tmp = strdup($2); + if (!tmp) yyerror(strerror(errno)); + sig = sig_vc($1,tmp,itf); } + opt_via routes '}' ; opt_command: + { + $$ = NULL; + } | TOK_COMMAND TOK_STR { - if (system($2)) yyerror("command failed"); + $$ = strdup($2); + if (!$$) yyerror(strerror(errno)); } ; @@ -60,6 +71,13 @@ | TOK_ITF TOK_NUM { itf = $2; + } + ; + +opt_via: + | TOK_PVC + { + sig->pvc = $1; } ; diff -ur --new-file old/atm/switch/debug/debug.c new/atm/switch/debug/debug.c --- old/atm/switch/debug/debug.c Sat Jun 6 03:51:50 1998 +++ new/atm/switch/debug/debug.c Wed Jun 24 12:19:27 1998 @@ -25,6 +25,11 @@ static CALL *calls; +void fab_start(void (*port_notify)(int number,int up)) +{ +} + + void fab_init(CALL *call) { PRV(call) = alloc_t(FAB); @@ -47,6 +52,12 @@ } +/* + * This function is rather simple-minded, because it only considers a single + * port. Should go directly to the fabric control. @@@ + */ + + static int vci_exists(int vci,int threshold) { CALL *call; @@ -89,8 +100,14 @@ op & _RM_SHIFT(RM_PATH_TX) ? " PATH_TX" : "", op & _RM_SHIFT(RM_PATH_RX) ? " PATH_RX" : ""); if (op & (RM_RSV(RM_IN) | RM_CLAIM(RM_IN))) - if (!check_ci(&call->in.pvc)) callback(call,0,user); + if (!check_ci(&call->in.pvc)) { + callback(call,0,user); + return; + } if (op & (RM_RSV(RM_OUT) | RM_CLAIM(RM_OUT))) - if (!check_ci(&call->out.pvc)) callback(call,0,user); + if (!check_ci(&call->out.pvc)) { + callback(call,0,user); + return; + } callback(call,1,user); } diff -ur --new-file old/atm/switch/fab.h new/atm/switch/fab.h --- old/atm/switch/fab.h Thu Apr 16 08:25:34 1998 +++ new/atm/switch/fab.h Wed Jun 24 10:28:42 1998 @@ -30,6 +30,15 @@ /* --- Provided by fabric control ------------------------------------------ */ /* + * Initialize the fabric interface. port_notify is invoked whenever a port + * is added to or removed from the switch. fab_start may invoke port_notify + * before returning. port_notify(X,0) is not invoked until all fab_ops on + * that port have completed. + */ + +void fab_start(void (*port_notify)(int number,int up)); + +/* * Initialize the fabric-specific part of a call structure, i.e. allocate a * fab-specific descriptor and attach it to call->fab. This function is called * before the first fab_op or fab_destroy. diff -ur --new-file old/atm/switch/proto.c new/atm/switch/proto.c --- old/atm/switch/proto.c Sat Jun 6 04:05:38 1998 +++ new/atm/switch/proto.c Thu Jun 25 11:06:47 1998 @@ -109,7 +109,9 @@ msg.type = as_connect; msg.vcc = (unsigned long) call | CALLED; /* some kind of magic... */ msg.local = call->in.svc; - msg.qos = call->in.qos; + msg.qos.aal = call->in.qos.aal; /* or should we rather use out.qos ? @@@ */ + msg.qos.txtp = call->in.qos.rxtp; + msg.qos.rxtp = call->in.qos.txtp; msg.svc = call->out.svc; msg.sap = call->sap; /* we have to give VCI/VPI */ diff -ur --new-file old/atm/switch/relay.c new/atm/switch/relay.c --- old/atm/switch/relay.c Sat Jun 6 04:06:08 1998 +++ new/atm/switch/relay.c Thu Jun 25 11:05:21 1998 @@ -36,7 +36,7 @@ switch (call->state) { case cs_indicated: if (okay) { - /* send connect to called and enter state cs_rm_accepted */ + /* send connect to called and enter state cs_rm_accepted */ send_identify(call); send_connect(call); new_state(call,cs_rm_accepted); @@ -58,7 +58,7 @@ /* send reject to caller and close to called */ send_reject(call,-EREMOTEIO); send_close(call,CALLED); - new_state(call, cs_rejected); + new_state(call,cs_rejected); } break; case cs_rejecting: @@ -223,6 +223,11 @@ call->sap = msg->sap; new_state(call,cs_indicated); fab_op(call,RM_RSV(_RM_ANY),&msg->qos,from_fab,NULL); + /* + * This is bogus. txtp and rxtp are exchanged on the input and the output + * side. This can be fixed by defining txtp/rxtp as meaning "forward" and + * "backward", respectively, in the switch. I guess that's what I'll do. + */ } @@ -258,7 +263,7 @@ static void usage(const char *name) { - fprintf(stderr,"usage: %s [ -c config_file ] [ -d ]\n",name); + fprintf(stderr,"usage: %s [ -b ] [ -c config_file ] [ -d ]\n",name); exit(1); } @@ -266,11 +271,16 @@ int main(int argc, char *argv[]) { const char *config_file; + int background; int c; + background = 0; config_file = CONFIG_FILE; - while ((c = getopt(argc,argv,"c:d")) != EOF) + while ((c = getopt(argc,argv,"bc:d")) != EOF) switch (c) { + case 'b': + background = 1; + break; case 'c': config_file = optarg; break; @@ -290,5 +300,17 @@ diag(COMPONENT,DIAG_FATAL,"%s: %s",config_file,strerror(errno)); if (yyparse()) diag(COMPONENT,DIAG_FATAL,"Error in config file. - Aborting."); + fab_start(sig_notify); + if (background) { + pid_t pid; + + pid = fork(); + if (pid < 0) + diag(COMPONENT,DIAG_FATAL,"fork: %s",strerror(errno)); + if (pid) { + diag(COMPONENT,DIAG_DEBUG,"Backgrounding (PID %d)",pid); + exit(0); + } + } while (1) dsp_poll(); } diff -ur --new-file old/atm/switch/sig.c new/atm/switch/sig.c --- old/atm/switch/sig.c Sat Jun 6 04:06:47 1998 +++ new/atm/switch/sig.c Thu Jun 25 12:49:15 1998 @@ -3,6 +3,7 @@ /* Written 1998 by Werner Almesberger, EPFL ICA */ +#include #include #include #include @@ -14,11 +15,15 @@ #include "dispatch.h" #include "proto.h" #include "sig.h" +#include "fab.h" #define COMPONENT "SIG" +static SIGNALING_ENTITY *entities = NULL; + + static int sig_check_listen(SIGNALING_ENTITY *sig,struct atmsvc_msg *msg) { return msg->type == as_okay ? 0 : msg->reply; @@ -48,20 +53,17 @@ } -SIGNALING_ENTITY *sig_vc(const char *path,int itf) +SIGNALING_ENTITY *sig_vc(const char *command,const char *path,int itf) { SIGNALING_ENTITY *sig; - int error; sig = alloc_t(SIGNALING_ENTITY); - sig->s = un_attach(path); - if (sig->s < 0) - diag(COMPONENT,DIAG_FATAL,"un_attach %s: %s",path,strerror(errno)); + sig->command = command; + sig->path = path; + sig->pvc.sap_addr.itf = -1; sig->itf = itf; - send_listen(sig); - error = sig_recv(sig,sig_check_listen); - if (!error) dsp_fd_add(sig->s,sig_data,sig); - else diag(COMPONENT,DIAG_FATAL,"listen failed: %s",strerror(error)); + sig->next = entities; + entities = sig; return sig; } @@ -75,4 +77,74 @@ if (len < 0) diag(COMPONENT,DIAG_ERROR,"write isp msg: %s",strerror(errno)); else diag(COMPONENT,DIAG_ERROR,"bad isp msg write: %d != %d",len, sizeof(*msg)); +} + + +static void up_callback(CALL *call,int okay,void *user) +{ + SIGNALING_ENTITY *sig = user; + int error; + + if (!okay) { + diag(COMPONENT,DIAG_ERROR,"up_callback: error"); + return; + } + if (sig->command) system(sig->command); + sig->s = un_attach(sig->path); + if (sig->s < 0) + diag(COMPONENT,DIAG_FATAL,"un_attach %s: %s",sig->path,strerror(errno)); + send_listen(sig); + error = sig_recv(sig,sig_check_listen); + if (!error) dsp_fd_add(sig->s,sig_data,sig); + else diag(COMPONENT,DIAG_FATAL,"listen failed: %s",strerror(error)); +} + + +static void remove_entity(SIGNALING_ENTITY *sig) +{ + struct atmsvc_msg msg; + + msg.type = as_terminate; + sig_send(sig,&msg); + dsp_fd_remove(sig->s); + (void) close(sig->s); +} + + +static void down_callback(CALL *call,int okay,void *user) +{ + if (!okay) diag(COMPONENT,DIAG_ERROR,"down_callback: error"); +} + + +void sig_notify(int itf,int up) +{ + SIGNALING_ENTITY *sig; + + for (sig = entities; sig; sig = sig->next) + if (sig->itf == itf) break; + if (!sig) { + diag(COMPONENT,DIAG_ERROR,"%s notification for unknown interface %d", + up ? "up" : "down",itf); + return; + } + if (sig->pvc.sap_addr.itf == -1) return; + if (up) { + struct atm_qos qos; + + sig->call = new_call(); + sig->call->in.pvc = sig->pvc; + sig->call->out.pvc.sap_addr.itf = sig->itf; + sig->call->out.pvc.sap_addr.vpi = 0; + sig->call->out.pvc.sap_addr.vci = 5; + memset(&qos,0,sizeof(qos)); + qos.txtp.traffic_class = qos.rxtp.traffic_class = ATM_UBR; + fab_op(sig->call,RM_CLAIM(_RM_ANY),&qos,up_callback,sig); + } + else { + remove_entity(sig); + fab_op(sig->call,RM_FREE,NULL,down_callback,NULL); + free_call(sig->call); + + } } diff -ur --new-file old/atm/switch/sig.h new/atm/switch/sig.h --- old/atm/switch/sig.h Wed Apr 15 20:50:09 1998 +++ new/atm/switch/sig.h Wed Jun 24 13:20:07 1998 @@ -13,12 +13,17 @@ typedef struct _signaling_entity { int s; /* socket */ - /*struct sockaddr_atmpvc pvc; signaling VC; not yet used */ + const char *command; /* command to start sigd; NULL if none */ + const char *path; /* path to the Unix domain socket */ + struct sockaddr_atmpvc pvc; /* signaling VC; itf = -1 if not used */ short itf; /* interface we manage */ + struct _signaling_entity *next; + struct _call *call; /* used to route VCI 5 to signaling */ } SIGNALING_ENTITY; -SIGNALING_ENTITY *sig_vc(const char *path,int itf); +SIGNALING_ENTITY *sig_vc(const char *command,const char *path,int itf); void sig_send(SIGNALING_ENTITY *sig,struct atmsvc_msg *msg); +void sig_notify(int itf,int up); #endif diff -ur --new-file old/atm/switch/tcp/Makefile new/atm/switch/tcp/Makefile --- old/atm/switch/tcp/Makefile Thu Jan 1 01:00:00 1970 +++ new/atm/switch/tcp/Makefile Wed Jun 24 10:35:10 1998 @@ -0,0 +1,9 @@ +LIBS=-lsw -latmd -L.. +LIBDEPS=../../lib/libatmd.a ../libsw.a +OBJS=tcpsw.o +SYSPGMS=sw_tcp + +include ../Rules.make + +sw_tcp: $(OBJS) + $(CC) $(LDFLAGS) -o sw_tcp $(OBJS) $(LIBS) $(LDLIBS) diff -ur --new-file old/atm/switch/tcp/README new/atm/switch/tcp/README --- old/atm/switch/tcp/README Thu Jan 1 01:00:00 1970 +++ new/atm/switch/tcp/README Thu Jun 25 13:54:51 1998 @@ -0,0 +1,107 @@ +The following sequence works. Figuring out why is left as an exercise to +the reader ;-) + +Commands: + +lrcpc4:~/w/atm/switch/tcp# ./sw_tcp -b -d +lrcpc4:~# atmtcp -b -i 1 -s localhost 1 +lrcpc4:~# atmtcp -b -i 2 -s localhost 2 +lrcpc4:~# atmaddr -a 2 +1 +lrcpc4:~/w/atm/switch/tcp# atmsigd -b -c 2.conf +lrcpc15:~# atmtcp -b -i 1 -s lrcpc4 3 +lrcpc15:~# atmaddr -a 1 +2 +lrcpc15:~/w/atm/switch/tcp# atmsigd -b -c 1.conf +lrcpc15:~$ ttcp_atm -r -a +lrcpc4:~$ ttcp_atm -t -a +2 + +--- switch.conf --------------------------------------------------------------- + +command "atmsigd -c s1.conf -b -m switch 1.0.100 /tmp/1" socket /tmp/1 { + itf 2 1.0.100 + route +1 +} +command "atmsigd -c s2.conf -b -m switch 1.0.101 /tmp/2" socket /tmp/2 { + itf 3 1.0.101 + default +} + +--- s1.conf ------------------------------------------------------------------- + +debug log stderr +debug level warn +sig level debug +sig vpci 0 itf 2 + +--- s2.conf ------------------------------------------------------------------- + +debug log stderr +debug level warn +sig level debug +sig vpci 0 itf 3 + +--- 1.conf -------------------------------------------------------------------- + +debug log stderr +debug level warn +sig level debug +io vc 1.0.5 +sig vpci 0 itf 1 + +--- 2.conf -------------------------------------------------------------------- + +debug log stderr +debug level warn +sig level debug +io vc 2.0.5 +sig vpci 0 itf 2 + + + +The following picture shows a simplified view of the configuration. Note +that the command-line options have been choosen for clarity (and minor +details like the vpci settings in the configuration file have been +omitted) and are not identical with the ones given above. + + ++-----------------------------------------------------------------------+ +| ./sw_tcp | +| | +| +---------+ +----------------------------------+ 1.0.100 | +| | |--/tmp/1--| atmsigd -m switch 1.0.100 /tmp/1 |---+ | +| | | +----------------------------------+ | | +| | | +-----+ | +| | | +----------------------------------+ | | | +| | |--/tmp/2--| atmsigd -m switch 1.0.101 /tmp/2 |---+ | | +| +---------+ +----------------------------------+ 1.0.101 | | +| | | | +| | +--------------+ | | +| | | | | | +| | control | | | | +| +----------------------| | itf 1 | +| | | | | +| | | | | +| 2.0.5 <--> 1.0.100 | | | | +| 3.0.5 <--> 1.0.101 | 2 3 1 | | | +| +--------------+ | | +| | | | | | ++-------------------------------|----|-----|------------------------|---+ + | | | | + +----------------------------+ | +----------------------------+ + | atmtcp -i 2 -s localhost 2 | | | atmtcp -i 1 -s localhost 1 | + +----------------------------+ | +----------------------------+ + | | + itf 2 (+1) +----- - - - - -----+ + | | + +---------------+ | on lrcpc15: | + | atmsigd 2.0.5 | | + +---------------+ | | + | + | +-------------------------+ + | atmtcp -i 1 -s lrcpc4 3 | + | +-------------------------+ + | + | itf 1 (+2) + | + | +---------------+ + | atmsigd 1.0.5 | + | +---------------+ diff -ur --new-file old/atm/switch/tcp/tcpsw.c new/atm/switch/tcp/tcpsw.c --- old/atm/switch/tcp/tcpsw.c Thu Jan 1 01:00:00 1970 +++ new/atm/switch/tcp/tcpsw.c Thu Jun 25 13:59:20 1998 @@ -0,0 +1,415 @@ +/* tcpsw.c - ATMTCP switch */ + +/* Written 1998 by Werner Almesberger, EPFL ICA */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "../fab.h" +#include "../dispatch.h" + + +#define COMPONENT "FAB(tcp)" + +#define PRV(call) ((FAB *) (call)->fab) + +#define MAX_VCI 1024 + +#define PORT 8402 /* @@@ should merge with atmtcp.c */ +#define MAX_PACKET (ATM_MAX_AAL5_PDU+sizeof(struct atmtcp_hdr)) +#define BUFFER_SIZE (MAX_PACKET*2) + + +typedef struct _table { + struct _link *out; /* output port */ + uint16_t in_vpi; /* input VPI */ + int in_vci; /* input VCI */ + uint16_t out_vpi; /* output VPI */ + uint16_t out_vci; /* output VCI */ + struct _table *next; +} TABLE; + +typedef struct _link { + enum { id_none,id_set,id_reval } state; + int id; /* switch port ID */ + int fd; + int len; /* length of data in the buffer */ + char buffer[BUFFER_SIZE]; + TABLE *table; /* switching table */ + struct _link *next; +} LINK; + +typedef struct _fab { + int active; /* non-zero if there's an entry in the fabric */ + CALL *next; /* relay.c may not keep track of calls, but WE are */ +} FAB; + + +static CALL *calls = NULL; +static LINK *links = NULL; +static void (*notify)(int number,int up); + + +static LINK *find_link(int id) +{ + LINK *lnk; + + for (lnk = links; lnk; lnk = lnk->next) + if (lnk->state == id_set && lnk->id == id) break; + return lnk; +} + + +static LINK *route(LINK *in,struct atmtcp_hdr *hdr) +{ + TABLE *entry; + + for (entry = in->table; entry; entry = entry->next) + if (ntohs(hdr->vpi) == entry->in_vpi && + (entry->in_vci == ATM_VCI_UNSPEC || + ntohs(hdr->vci) == entry->in_vci)) { + hdr->vpi = htons(entry->out_vpi); + if (entry->in_vci != ATM_VCI_UNSPEC) + hdr->vci = htons(entry->out_vci); + return entry->out; + } + return NULL; +} + + +static int add_entry(struct sockaddr_atmpvc *from,struct sockaddr_atmpvc *to) +{ + LINK *l_from,*l_to; + TABLE *entry; + + l_from = find_link(from->sap_addr.itf); + l_to = find_link(to->sap_addr.itf); + if (!l_from || !l_to) return -ENODEV; + for (entry = l_from->table; entry; entry = entry->next) + if (entry->in_vpi == from->sap_addr.vpi && + (entry->in_vci == ATM_VCI_UNSPEC || + from->sap_addr.vci == ATM_VCI_UNSPEC || + entry->in_vci == from->sap_addr.vci)) return -EEXIST; + entry = alloc_t(TABLE); + entry->out = l_to; + entry->in_vpi = from->sap_addr.vpi; + entry->in_vci = from->sap_addr.vci; + entry->out_vpi = to->sap_addr.vpi; + entry->out_vci = to->sap_addr.vci; + entry->next = l_from->table; + l_from->table = entry; + if (entry->in_vci == ATM_VCI_UNSPEC) + diag(COMPONENT,DIAG_INFO,"added VP %d.%d -> %d.%d",l_from->id, + entry->in_vpi,l_to->id,entry->out_vpi); + else diag(COMPONENT,DIAG_INFO,"added VC %d.%d.%d -> %d.%d.%d",l_from->id, + entry->in_vpi,entry->in_vci,l_to->id,entry->out_vpi,entry->out_vci); + return 0; +} + + +static int del_entry(struct sockaddr_atmpvc *from,struct sockaddr_atmpvc *to) +{ + LINK *l_from,*l_to; + TABLE **entry,*this; + + l_from = find_link(from->sap_addr.itf); + l_to = find_link(to->sap_addr.itf); + if (!l_from || !l_to) return -ENODEV; + for (entry = &l_from->table; *entry; entry = &(*entry)->next) + if ((*entry)->out == l_to && (*entry)->in_vpi == from->sap_addr.vpi && + (*entry)->in_vci == from->sap_addr.vci && + ((*entry)->in_vci == ATM_VCI_UNSPEC || + (*entry)->out_vci == to->sap_addr.vci)) + break; + if (!*entry) return -EHOSTUNREACH; + this = *entry; + *entry = this->next; + if (this->in_vci == ATM_VCI_UNSPEC) + diag(COMPONENT,DIAG_INFO,"deleted VP %d.%d -> %d.%d",l_from->id, + this->in_vpi,l_to->id,this->out_vpi); + else diag(COMPONENT,DIAG_INFO,"deleted VC %d.%d.%d -> %d.%d.%d",l_from->id, + this->in_vpi,this->in_vci,l_to->id,this->out_vpi,this->out_vci); + free(this); + return 0; +} + + +static void drop_link(LINK *lnk) +{ + diag(COMPONENT,DIAG_INFO,"dropped link %d",lnk->id); + if (lnk->state == id_set) { + notify(lnk->id,0); + lnk->state = id_reval; + } + dsp_fd_remove(lnk->fd); +#if 0 + LINK **walk,**next_link,**entry,**next_entry; + + /* remove link from the list and delete all references to link */ + for (walk = &links; *walk; walk = next_link) { + next_link = &(*walk)->next; + if (*walk == lnk) *walk = *next_link; + else for (entry = &(*walk)->table; *entry; entry = next_entry) { + next_entry = &(*entry)->next; + if ((*entry)->out == lnk) { + TABLE *this; + + this = *entry; + *entry = *next_entry; + free(this); + } + } + } + *walk = lnk->next; + /* remove link's switching table */ + while (lnk->table) { + TABLE *next; + + next = lnk->table->next; + free(lnk->table); + lnk->table = next; + } + /* drop memory */ + free(*lnk); +#endif +} + + +static void new_data(int fd,void *user) +{ + LINK *lnk = user; + int got; + + got = read(fd,lnk->buffer+lnk->len,BUFFER_SIZE-lnk->len); + if (got < 0) perror("read"); + if (got <= 0) drop_link(lnk); + lnk->len += got; + if (lnk->state != id_set) { + LINK *walk; + char *end; + int id; + + if (!memchr(lnk->buffer,0,lnk->len)) return; + id = strtol(lnk->buffer,&end,0); + if (*end) { + diag(COMPONENT,DIAG_ERROR,"invalid line id \"%s\"",lnk->buffer); + drop_link(lnk); + return; + } + for (walk = links; walk; walk = walk->next) + if (walk->state != id_none && id == walk->id) break; + if (walk) { + if (walk->state == id_set) { + diag(COMPONENT,DIAG_ERROR,"line state mismatch (id %d)",id); + drop_link(lnk); + return; + } + diag(COMPONENT,DIAG_INFO,"reconnected link %d",id); + walk->state = id_set; + walk->fd = lnk->fd; + walk->len = lnk->len; + memcpy(walk->buffer,lnk->buffer,lnk->len); + drop_link(lnk); + lnk = walk; + dsp_fd_add(lnk->fd,new_data,walk); + } + else { + diag(COMPONENT,DIAG_INFO,"new link %d",id); + lnk->state = id_set; + lnk->id = id; + } + notify(lnk->id,1); + lnk->len -= strlen(lnk->buffer)+1; + memmove(lnk->buffer,lnk->buffer-strlen(lnk->buffer)-1,lnk->len); + } + while (lnk->len >= sizeof(struct atmtcp_hdr)) { + struct atmtcp_hdr *hdr = (struct atmtcp_hdr *) lnk->buffer; + LINK *out; + int size; + + size = sizeof(struct atmtcp_hdr)+ntohl(hdr->length); + if (lnk->len < size) break; + out = route(lnk,hdr); + if (out) { + int sent; + + sent = write(out->fd,lnk->buffer,size); + if (sent < 0) perror("write"); + else if (sent != size) + diag(COMPONENT,DIAG_ERROR,"bad write: %d != %d",sent,size); + if (sent != size) drop_link(out); + } + lnk->len -= size; + memmove(lnk->buffer,lnk->buffer+size,lnk->len); + } +} + + +static void new_link(int sock,void *dummy) +{ + LINK *lnk; + int fd; + + fd = accept(sock,NULL,NULL); + if (fd < 0) { + perror("accept"); + return; + } + lnk = alloc_t(LINK); + lnk->state = id_none; + lnk->id = -1; + lnk->fd = fd; + lnk->len = 0; + lnk->table = NULL; + lnk->next = links; + links = lnk; + dsp_fd_add(fd,new_data,lnk); +} + + +static int vci_exists(LINK *lnk,int vpi,int vci) +{ + TABLE *walk; + + for (walk = lnk->table; walk; walk = walk->next) + if (walk->in_vpi == vpi && walk->in_vci == vci) return 1; + return 0; +} + + +static int check_ci(struct sockaddr_atmpvc *pvc) +{ + LINK *lnk; + TABLE *walk; + int vci; + + lnk = find_link(pvc->sap_addr.itf); + if (!lnk) return 0; + if (pvc->sap_addr.vpi == ATM_VPI_ANY) pvc->sap_addr.vpi = 0; + /* that was easy :-) */ + for (walk = lnk->table; walk; walk = walk->next) + if (walk->in_vpi == pvc->sap_addr.vpi) break; + if (walk && walk->in_vci == ATM_VCI_UNSPEC) return 0; + if (pvc->sap_addr.vci == ATM_VCI_UNSPEC) return !walk; + if (pvc->sap_addr.vci != ATM_VCI_ANY) + return !vci_exists(lnk,pvc->sap_addr.vpi,pvc->sap_addr.vci); + for (vci = ATM_NOT_RSV_VCI; vci < MAX_VCI; vci++) + if (!vci_exists(lnk,pvc->sap_addr.vpi,vci)) { + pvc->sap_addr.vci = vci; + return 1; + } + return 0; +} + + +void fab_start(void (*port_notify)(int number,int up)) +{ + struct sockaddr_in addr; + int s_listen; + + notify = port_notify; + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + addr.sin_addr.s_addr = htonl(INADDR_ANY); + if ((s_listen = socket(PF_INET,SOCK_STREAM,0)) < 0) + diag(COMPONENT,DIAG_FATAL,"socket: %s",strerror(errno)); + if (bind(s_listen,(struct sockaddr *) &addr,sizeof(addr)) < 0) + diag(COMPONENT,DIAG_FATAL,"bind: %s",strerror(errno)); + if (listen(s_listen,5) < 0) + diag(COMPONENT,DIAG_FATAL,"listen: %s",strerror(errno)); + dsp_fd_add(s_listen,new_link,NULL); +} + + +void fab_init(CALL *call) +{ + PRV(call) = alloc_t(FAB); + PRV(call)->active = 0; + PRV(call)->next = calls; + calls = call; +} + + +void fab_destroy(CALL *call) +{ + CALL **walk; + + for (walk = &calls; *walk; walk = &PRV(*walk)->next) + if (*walk == call) break; + if (!*walk) + diag(COMPONENT,DIAG_FATAL,"fab_destroy: call %p not found",call); + *walk = PRV(call)->next; + free(PRV(call)); + PRV(call) = NULL; +} + + +void fab_op(CALL *call,int op,const struct atm_qos *qos, + void (*callback)(CALL *call,int okay,void *user),void *user) +{ + int error,error2; + + diag(COMPONENT,DIAG_INFO,"fab_op%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", + !op ? " FREE" : "",op & RM_RSV(_RM_ANY) ? " RM_RSV:" : "", + op & RM_IN_TX ? " IN_TX" : "",op & RM_IN_RX ? " IN_RX" : "", + op & RM_OUT_TX ? " OUT_TX" : "",op & RM_OUT_RX ? " OUT_RX" : "", + op & RM_PATH_TX ? " PATH_TX" : "",op & RM_PATH_RX ? " PATH_RX" : "", + op & RM_CLAIM(_RM_ANY) ? " RM_CLAIM:" : "", + op & _RM_SHIFT(RM_IN_TX) ? " IN_TX" : "", + op & _RM_SHIFT(RM_IN_RX) ? " IN_RX" : "", + op & _RM_SHIFT(RM_OUT_TX) ? " OUT_TX" : "", + op & _RM_SHIFT(RM_OUT_RX) ? " OUT_RX" : "", + op & _RM_SHIFT(RM_PATH_TX) ? " PATH_TX" : "", + op & _RM_SHIFT(RM_PATH_RX) ? " PATH_RX" : ""); + if (op & (RM_RSV(RM_IN) | RM_CLAIM(RM_IN))) + if (!check_ci(&call->in.pvc)) { + callback(call,0,user); + return; + } + if (op & (RM_RSV(RM_OUT) | RM_CLAIM(RM_OUT))) + if (!check_ci(&call->out.pvc)) { + callback(call,0,user); + return; + } + if (op & RM_CLAIM(RM_PATH)) { + error = add_entry(&call->in.pvc,&call->out.pvc); + if (!error) { + error = add_entry(&call->out.pvc,&call->in.pvc); + if (error) { + error2 = del_entry(&call->in.pvc,&call->out.pvc); + if (error2) + diag(COMPONENT,DIAG_ERROR,"del_entry: %s",strerror(error2)); + } + } + if (error) { + diag(COMPONENT,DIAG_ERROR,"add_entry: %s",strerror(error)); + callback(call,0,user); + return; + } + PRV(call)->active = 1; + } + if (!op && PRV(call)->active) { + error = del_entry(&call->in.pvc,&call->out.pvc); + if (error) + diag(COMPONENT,DIAG_ERROR,"del_entry: %s",strerror(error)); + error2 = del_entry(&call->out.pvc,&call->in.pvc); + if (error2) + diag(COMPONENT,DIAG_ERROR,"del_entry: %s",strerror(error2)); + if (error || error2) { + callback(call,0,user); + return; + } + } + callback(call,1,user); +} diff -ur --new-file old/atm/test/aread.c new/atm/test/aread.c --- old/atm/test/aread.c Sat Jun 6 01:53:08 1998 +++ new/atm/test/aread.c Thu Jun 18 17:12:58 1998 @@ -63,7 +63,7 @@ /* Make sure the buffer is aligned. This can be trivially extended to play with alignments. */ - start = (unsigned char *) (((unsigned long) buf+4095) & ~4095U); + start = (unsigned char *) (((unsigned long) buf+4095) & ~4095UL); size = read(s,start,BSIZE); printf("%d",size); if (size < 0) printf(" (%s)",strerror(errno)); diff -ur --new-file old/atm/test/ttcp.c new/atm/test/ttcp.c --- old/atm/test/ttcp.c Sat Jun 6 01:59:20 1998 +++ new/atm/test/ttcp.c Thu Jun 18 09:27:23 1998 @@ -188,7 +188,7 @@ { struct timeval td; unsigned long addr_tmp; - const char *port_name; + const char *port_name = NULL; int c; double mbps; int no_check = 0; .