diff -ur --new-file old/atm/BUGS new/atm/BUGS --- old/atm/BUGS Fri Sep 27 15:15:27 1996 +++ new/atm/BUGS Tue Mar 11 23:58:24 1997 @@ -1,3 +1,14 @@ +Known bugs and restrictions in version 0.27 +=========================================== + + - the AAL changes probably broke LANE + - ENI driver should be more tolerant about data alignment when sending + - libresolve conflicts with libc on some systems + - atmarpd sometimes loses the VC to the ATMARP server + - qgen is said to exhibit memory leak on q_open/q_close (need to verify) + - atmarp is said to break proxy ARP + + Known bugs and restrictions in version 0.19 =========================================== diff -ur --new-file old/atm/CHANGES new/atm/CHANGES --- old/atm/CHANGES Wed Jan 29 22:12:10 1997 +++ new/atm/CHANGES Tue Mar 11 23:43:18 1997 @@ -1,3 +1,55 @@ +Version 0.26 to 0.27 (11-MAR-1997) +==================== + +Bug fixes +--------- + + - oops, forgot to include atm/lib/rtf2e164_cc.pl in the distribution + - atmsigd's VCI allocation in -N mode was too simplistic and failed after some + signaling activity (reported by Richard Jones) + - atm_connect was rejecting ATM_{VPI,VCI}_ANY + - aq_prev in the list of Arequipa connections wasn't set properly, leading to + random crashes when using Arequipa (found and fixed by Richard Jones, after + weeks of tearing his hair out) + - arequipa_close didn't remove the Arequipa route, which kept the upper layer + protocol connection alive for a rather long time (reported by Richard Jones) + +New features +------------ + + - ilmid enhancements: vastly improved retry mechanism, workaround for a bug in + the ATML Virata switch, -v option for very detailed debug output (Scott + Shumate) + - atmsigd now also accepts the signaling VC as a command line argument + - qos2text appended colon to traffic type even if nothing else followed + - new program debug/aqtest to test Arequipa (based on work by Mehdi Tazi) + +Other changes +------------- + + - added a few missing NULLs to struct atmdev_ops initialization in various + drivers (this change does not alter any semantics) + - changed printk ...%lx... (unsigned long) ptr to ...%p... ptr at many + places + - removed atm/lib/rtf2cc.pl and atm/lib/cc.inc (they were only used by an + interim version of cc_len) + - atmarp's usage no longer contains lines longer than 80 characters + - added get_logfile() and get_verbosity() to libatm (for ilmid, by Scott + Shumate) + - select() consumed CPU time unnecessarily if testing for one direction while + there's a lot of activity in the other direction (e.g. atmarpd wasted cycles + in select() for each outbound packet while waiting for ARP messages) + - the value of ATM_AAL0 has changed (from zero to 13), so all programs using + AAL0 need to be recompiled + - MAX_ATM_QOS_LEN has changed, so most programs using qos2text need to be + recompiled + - the AAL can now also be set along with the QoS parameters. This approach + should be used instead of specifying it in the socket() call. + - if no AAL is specified, the kernel now defaults to AAL5 (was AAL0) + - updated most demons, tools, and library functions to set the AAL along with + the QoS parameters + + Version 0.25 to 0.26 (29-JAN-1997) ==================== @@ -96,7 +148,7 @@ Hanusch, fixed by Marko Kiiskila) - LANE: le_flush_request was sent too early when establishing connection (by Marko Kiiskila) - - zeppelin stooped operation (unwantedly) in random cases when LANE servers + - zeppelin stopped operation (unwantedly) in random cases when LANE servers were down (by Marko Kiiskila) - LANE: non-blocking connections, VCC and LE ARP timeouts, and TLV fields in LE_CONFIG_RESPONSE fixed (by Marko Kiiskila) diff -ur --new-file old/atm/README new/atm/README --- old/atm/README Wed Jan 29 22:06:57 1997 +++ new/atm/README Mon Mar 10 16:59:49 1997 @@ -1,4 +1,4 @@ -ATM on Linux, release 0.26 (pre-alpha) by Werner Almesberger, EPFL LRC +ATM on Linux, release 0.27 (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/USAGE new/atm/USAGE --- old/atm/USAGE Wed Jan 29 22:19:00 1997 +++ new/atm/USAGE Tue Mar 11 23:23:36 1997 @@ -530,7 +530,7 @@ The ILMI demon is started as follows: - # ilmid [-b] [-d] [-l ] [-x] [] + # ilmid [-b] [-d] [-l ] [-v] [-x] [] -b background. Run in a forked child process after initializing. -d enables debugging output. By default, ilmid is very quiet. @@ -539,6 +539,7 @@ diagnostics to the system logger. -q configures the ILMI VC to use the specified quality of service. By default, UBR at link speed is used on the ILMI VC. + -v enables extensive debugging output. -x disable inclusion of variable bindings in the ColdstartTrap. Some switches (e.g. the LS100) only work if this option is set. diff -ur --new-file old/atm/VERSION new/atm/VERSION --- old/atm/VERSION Tue Jan 14 12:57:35 1997 +++ new/atm/VERSION Wed Feb 26 17:19:30 1997 @@ -1 +1 @@ -0.26 +0.27 diff -ur --new-file old/atm/aqd/io.c new/atm/aqd/io.c --- old/atm/aqd/io.c Tue Oct 1 17:29:45 1996 +++ new/atm/aqd/io.c Tue Mar 11 11:52:03 1997 @@ -1,6 +1,6 @@ /* io.c - I/O operations */ -/* Written 1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1996-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -42,11 +42,12 @@ diag(COMPONENT,DIAG_FATAL,"socket: %s",strerror(errno)); if (ioctl(kernel,AREQUIPA_CTRL,0) < 0) diag(COMPONENT,DIAG_FATAL,"ioctl AREQUIPA_CTRL: %s",strerror(errno)); - if ((incoming = socket(PF_ATMSVC,SOCK_DGRAM,ATM_AAL5)) < 0) + if ((incoming = socket(PF_ATMSVC,SOCK_DGRAM,0)) < 0) diag(COMPONENT,DIAG_FATAL,"socket: %s",strerror(errno)); memset(&qos,0,sizeof(qos)); qos.txtp.traffic_class = qos.rxtp.traffic_class = ATM_ANYCLASS; /* compatible with everything else */ + qos.aal = ATM_AAL5; 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)); diff -ur --new-file old/atm/arpd/io.c new/atm/arpd/io.c --- old/atm/arpd/io.c Mon Jan 13 21:25:07 1997 +++ new/atm/arpd/io.c Tue Mar 11 22:34:17 1997 @@ -49,9 +49,10 @@ diag(COMPONENT,DIAG_FATAL,"socket: %s",strerror(errno)); if (ioctl(kernel,ATMARPD_CTRL,0) < 0) diag(COMPONENT,DIAG_FATAL,"ioctl ATMARPD_CTRL: %s",strerror(errno)); - if ((incoming = socket(PF_ATMSVC,SOCK_DGRAM,ATM_AAL5)) < 0) + if ((incoming = socket(PF_ATMSVC,SOCK_DGRAM,0)) < 0) diag(COMPONENT,DIAG_FATAL,"socket: %s",strerror(errno)); memset(&qos,0,sizeof(qos)); + qos.aal = ATM_AAL5; 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)); @@ -220,6 +221,7 @@ diag(COMPONENT,DIAG_DEBUG,"Incoming call from %s",buffer); if (merge) { ITF *itf; + for (itf = itfs; itf; itf = itf->next) { entry = lookup_addr(itf,&addr); if (entry) { @@ -249,7 +251,7 @@ int fd,flags; if (remote->sa_family == AF_ATMSVC && incoming < 0) return -EUNATCH; - if ((fd = socket(remote->sa_family,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((fd = socket(remote->sa_family,SOCK_DGRAM,0)) < 0) { diag(COMPONENT,DIAG_ERROR,"socket: %s",strerror(errno)); return -errno; } @@ -292,11 +294,13 @@ } /* PVC connect never blocks */ if (connect(fd,remote,remote->sa_family == AF_ATMPVC ? - sizeof(struct sockaddr_atmpvc) : sizeof(struct sockaddr_atmsvc)) < 0) + sizeof(struct sockaddr_atmpvc) : sizeof(struct sockaddr_atmsvc)) < 0) { if (errno != EINPROGRESS) { diag(COMPONENT,DIAG_ERROR,"[1]connect: %s",strerror(errno)); return -errno; } + return fd; + } if (ioctl(fd,ATMARP_MKIP,timeout) < 0) { diag(COMPONENT,DIAG_ERROR,"ioctl ATMARP_MKIP: %s",strerror(errno)); (void) do_close(fd); @@ -332,8 +336,14 @@ diag(COMPONENT,DIAG_FATAL,"connecting non-connecting VCC 0x%08x", (unsigned long) vcc); memset(&dummy,0,sizeof(dummy)); - if (!connect(vcc->fd,(struct sockaddr *) &dummy,sizeof(dummy))) + if (!connect(vcc->fd,(struct sockaddr *) &dummy,sizeof(dummy))) { + if (ioctl(vcc->fd,ATMARP_MKIP,CLIP_DEFAULT_IDLETIMER) < 0) { + diag(COMPONENT,DIAG_ERROR,"ioctl ATMARP_MKIP: %s",strerror(errno)); + (void) do_close(vcc->fd); + vcc_failed(vcc); + } vcc_connected(vcc); + } else { diag(COMPONENT,DIAG_INFO,"[2]connect: %s",strerror(errno)); (void) do_close(vcc->fd); diff -ur --new-file old/atm/arpd/itf.c new/atm/arpd/itf.c --- old/atm/arpd/itf.c Thu Oct 10 23:29:40 1996 +++ new/atm/arpd/itf.c Tue Mar 11 21:10:08 1997 @@ -1,6 +1,6 @@ /* itf.c - IP interface registry */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -62,6 +62,7 @@ } itf->number = number; memset(&itf->qos,0,sizeof(struct atm_qos)); + itf->qos.aal = ATM_AAL5; itf->qos.txtp.traffic_class = ATM_UBR; itf->qos.txtp.max_sdu = RFC1483LLC_LEN+RFC1626_MTU; itf->qos.rxtp = itf->qos.txtp; diff -ur --new-file old/atm/atm-0.26-1.spec new/atm/atm-0.26-1.spec --- old/atm/atm-0.26-1.spec Tue Jan 14 16:03:13 1997 +++ new/atm/atm-0.26-1.spec Thu Jan 1 01:00:00 1970 @@ -1,135 +0,0 @@ -Summary: ATM (Asynchronous Transfer Mode) -Name: atm -Version: 0.26 -Release: 1 -Source: atm-0.26.tar.gz -Source: lrcftp.epfl.ch:/pub/linux/atm/dist/atm-0.26.tar.gz -Copyright: distributable -Group: Networking/ATM -ExclusiveArch: i386 -ExclusiveOS: Linux - -%description -Programs, libraries, and configuration files required for using ATM -on Linux. Note that you still need to patch your kernel. - -%package ans -Summary: ANS (ATM Name Server) -Group: Networking/ATM - -%description ans -ANS is a version of BIND with extensions for ATM. This package contains -the complete BIND distribution, including tools like nslookup and dig. - -%prep - -%setup -n atm - -%build -make -cd extra -make tcpdump -make ans - -%install -INSTPREFIX=/usr make -e -cd config/redhat-4.0 -make install -cd ../../extra -INSTPREFIX=/usr make -e install - -%files ans -/usr/lib/libresolv.a -/usr/include/arpa/inet.h -/usr/include/arpa/nameser.h -/usr/include/netdb.h -/usr/include/resolv.h -/usr/include/sys/bitypes.h -/usr/lib/lib44bsd.a -/usr/sbin/named -/usr/sbin/named-xfer -/usr/sbin/named.restart -/usr/sbin/named.reload -/usr/sbin/ndc -/usr/bin/nslookup -/usr/lib/nslookup.help -/usr/bin/host -/usr/bin/dig -/usr/bin/dnsquery -/usr/bin/addr -/usr/man/man1/dig.1 -/usr/man/man1/host.1 -/usr/man/man1/dnsquery.1 -/usr/man/man8/named.8 -/usr/man/man8/named.reload.8 -/usr/man/man8/named.restart.8 -/usr/man/man8/ndc.8 -/usr/man/man8/named-xfer.8 -/usr/man/man8/nslookup.8 -/usr/man/man3/gethostbyname.3 -/usr/man/man3/resolver.3 -/usr/man/man3/getnetent.3 -/usr/man/man5/resolver.5 -/usr/man/man7/hostname.7 -/usr/man/man7/mailaddr.7 - -%files -%doc README -%doc USAGE -%config /etc/sysconfig/atm -%config /etc/atmsigd.conf -%config /etc/sysconfig/network-scripts/ifcfg-atm0 -%config /etc/sysconfig/network-scripts/ifup-atm -%config /etc/hosts.atm -/usr/sbin/tcpdump -/usr/lib/libatm.a -/usr/lib/libatmd.a -/usr/lib/libarequipa.a -/usr/include/atm.h -/usr/include/atmd.h -/usr/include/atmsap.h -/usr/include/arequipa.h -/usr/sbin/atmaddr -/usr/sbin/atmtcp -/usr/sbin/zntune -/usr/bin/atmdiag -/usr/bin/atmdump -/usr/bin/sonetdiag -/usr/man/man8/atmaddr.8 -/usr/man/man8/atmdiag.8 -/usr/man/man8/atmdump.8 -/usr/man/man8/atmtcp.8 -/usr/sbin/clip -/usr/sbin/atmarp -/usr/man/man8/clip.8 -/usr/man/man8/atmarp.8 -/usr/bin/aping -/usr/bin/aread -/usr/bin/awrite -/usr/bin/br -/usr/bin/bw -/usr/bin/ttcp_atm -/usr/bin/window -/usr/sbin/delay -/usr/sbin/ed -/usr/sbin/encopy -/usr/sbin/endump -/usr/sbin/zndump -/usr/sbin/znth -/usr/sbin/atmsigd -/usr/man/man4/atmsigd.conf.4 -/usr/man/man8/atmsigd.8 -/usr/sbin/atmarpd -/usr/man/man8/atmarpd.8 -/usr/sbin/ilmid -/usr/sbin/zeppelin -/usr/man/man8/zeppelin.8 -/usr/sbin/les -/usr/sbin/bus -/usr/sbin/lecs -/usr/man/man8/les.8 -/usr/man/man8/lecs.8 -/usr/man/man8/bus.8 -/usr/sbin/arequipad -/usr/man/man8/arequipad.8 -/usr/man/man7/qos.7 diff -ur --new-file old/atm/atm-0.27-1.spec new/atm/atm-0.27-1.spec --- old/atm/atm-0.27-1.spec Thu Jan 1 01:00:00 1970 +++ new/atm/atm-0.27-1.spec Tue Mar 11 23:28:35 1997 @@ -0,0 +1,136 @@ +Summary: ATM (Asynchronous Transfer Mode) +Name: atm +Version: 0.27 +Release: 1 +Source: atm-0.27.tar.gz +Source: lrcftp.epfl.ch:/pub/linux/atm/dist/atm-0.27.tar.gz +Copyright: distributable +Group: Networking/ATM +ExclusiveArch: i386 +ExclusiveOS: Linux + +%description +Programs, libraries, and configuration files required for using ATM +on Linux. Note that you still need to patch your kernel. + +%package ans +Summary: ANS (ATM Name Server) +Group: Networking/ATM + +%description ans +ANS is a version of BIND with extensions for ATM. This package contains +the complete BIND distribution, including tools like nslookup and dig. + +%prep + +%setup -n atm + +%build +make +cd extra +make tcpdump +make ans + +%install +INSTPREFIX=/usr make -e +cd config/redhat-4.0 +make install +cd ../../extra +INSTPREFIX=/usr make -e install + +%files ans +/usr/lib/libresolv.a +/usr/include/arpa/inet.h +/usr/include/arpa/nameser.h +/usr/include/netdb.h +/usr/include/resolv.h +/usr/include/sys/bitypes.h +/usr/lib/lib44bsd.a +/usr/sbin/named +/usr/sbin/named-xfer +/usr/sbin/named.restart +/usr/sbin/named.reload +/usr/sbin/ndc +/usr/bin/nslookup +/usr/lib/nslookup.help +/usr/bin/host +/usr/bin/dig +/usr/bin/dnsquery +/usr/bin/addr +/usr/man/man1/dig.1 +/usr/man/man1/host.1 +/usr/man/man1/dnsquery.1 +/usr/man/man8/named.8 +/usr/man/man8/named.reload.8 +/usr/man/man8/named.restart.8 +/usr/man/man8/ndc.8 +/usr/man/man8/named-xfer.8 +/usr/man/man8/nslookup.8 +/usr/man/man3/gethostbyname.3 +/usr/man/man3/resolver.3 +/usr/man/man3/getnetent.3 +/usr/man/man5/resolver.5 +/usr/man/man7/hostname.7 +/usr/man/man7/mailaddr.7 + +%files +%doc README +%doc USAGE +%config /etc/sysconfig/atm +%config /etc/atmsigd.conf +%config /etc/sysconfig/network-scripts/ifcfg-atm0 +%config /etc/sysconfig/network-scripts/ifup-atm +%config /etc/hosts.atm +/usr/sbin/tcpdump +/usr/lib/libatm.a +/usr/lib/libatmd.a +/usr/lib/libarequipa.a +/usr/include/atm.h +/usr/include/atmd.h +/usr/include/atmsap.h +/usr/include/arequipa.h +/usr/sbin/atmaddr +/usr/sbin/atmtcp +/usr/sbin/zntune +/usr/bin/atmdiag +/usr/bin/atmdump +/usr/bin/sonetdiag +/usr/man/man8/atmaddr.8 +/usr/man/man8/atmdiag.8 +/usr/man/man8/atmdump.8 +/usr/man/man8/atmtcp.8 +/usr/sbin/clip +/usr/sbin/atmarp +/usr/man/man8/clip.8 +/usr/man/man8/atmarp.8 +/usr/bin/aping +/usr/bin/aread +/usr/bin/awrite +/usr/bin/br +/usr/bin/bw +/usr/bin/ttcp_atm +/usr/bin/window +/usr/sbin/delay +/usr/sbin/aqtest +/usr/sbin/ed +/usr/sbin/encopy +/usr/sbin/endump +/usr/sbin/zndump +/usr/sbin/znth +/usr/sbin/atmsigd +/usr/man/man4/atmsigd.conf.4 +/usr/man/man8/atmsigd.8 +/usr/sbin/atmarpd +/usr/man/man8/atmarpd.8 +/usr/sbin/ilmid +/usr/sbin/zeppelin +/usr/man/man8/zeppelin.8 +/usr/sbin/les +/usr/sbin/bus +/usr/sbin/lecs +/usr/man/man8/les.8 +/usr/man/man8/lecs.8 +/usr/man/man8/bus.8 +/usr/sbin/arequipad +/usr/man/man8/arequipad.8 +/usr/man/man7/qos.7 diff -ur --new-file old/atm/atm.patch new/atm/atm.patch --- old/atm/atm.patch Wed Jan 29 22:21:25 1997 +++ new/atm/atm.patch Tue Mar 11 23:58:51 1997 @@ -432,8 +432,8 @@ + return devs; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/atmtcp.c Fri Nov 15 22:00:47 1996 -@@ -0,0 +1,316 @@ ++++ work/drivers/atm/atmtcp.c Thu Feb 6 19:27:13 1997 +@@ -0,0 +1,317 @@ +/* drivers/atm/atmtcp.c - ATM over TCP "device" driver */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -695,7 +695,8 @@ + NULL, /* no phy_put */ + NULL, /* no phy_get */ + NULL, /* no feedback */ -+ NULL /* no change_qos */ ++ NULL, /* no change_qos */ ++ NULL /* no free_rx_skb */ +}; + + @@ -751,11 +752,11 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/eni.c Fri Dec 20 20:53:53 1996 -@@ -0,0 +1,1959 @@ ++++ work/drivers/atm/eni.c Tue Mar 11 11:52:44 1997 +@@ -0,0 +1,1952 @@ +/* drivers/atm/eni.c - Efficient Networks ENI155P device driver */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#include @@ -929,14 +930,13 @@ + printk(KERN_NOTICE "TX buffers\n"); + for (i = 0; i < NR_CHAN; i++) + if (eni_dev->tx[i].send) -+ printk(KERN_NOTICE " TX %d @ 0x%08lx: %ld\n",i, -+ (unsigned long) eni_dev->tx[i].send, -+ eni_dev->tx[i].words*4); ++ printk(KERN_NOTICE " TX %d @ 0x%p: %ld\n",i, ++ eni_dev->tx[i].send,eni_dev->tx[i].words*4); + printk(KERN_NOTICE "RX buffers\n"); + for (i = 0; i < 1024; i++) + if (eni_dev->rx_map[i] && ENI_VCC(eni_dev->rx_map[i])->rx) -+ printk(KERN_NOTICE " RX %d @ 0x%08lx: %ld\n",i, -+ (unsigned long) ENI_VCC(eni_dev->rx_map[i])->recv, ++ printk(KERN_NOTICE " RX %d @ 0x%p: %ld\n",i, ++ ENI_VCC(eni_dev->rx_map[i])->recv, + ENI_VCC(eni_dev->rx_map[i])->words*4); + printk(KERN_NOTICE "----\n"); +} @@ -1078,8 +1078,8 @@ + printk(KERN_ALERT " host descr 0x%08lx, rx pos 0x%08lx, descr value " + "0x%08lx\n",eni_vcc->descr,eni_vcc->rx_pos, + eni_vcc->recv[eni_vcc->descr]); -+ printk(KERN_ALERT " last 0x%08lx, servicing %d\n", -+ (unsigned long) eni_vcc->last,eni_vcc->servicing); ++ printk(KERN_ALERT " last 0x%p, servicing %d\n",eni_vcc->last, ++ eni_vcc->servicing); + EVENT("---dump ends here---\n",0,0); + printk(KERN_NOTICE "---recent events---\n"); + event_dump(); @@ -1313,11 +1313,6 @@ + printk(KERN_ERR DEV_LABEL "(itf %d): bad AAL5 PDU " + "(VCI=%d,length=%ld,size=%ld (descr 0x%lx))\n", + vcc->dev->number,vcc->vci,length,size << 2,descr); -+#if 0 -+printk("0x%lx[0x%lx] (0x%lx,%ld) size %ld len %ld\n", -+ (unsigned long) eni_vcc->recv,eni_vcc->descr,(unsigned long) eni_vcc, -+ eni_vcc->words,size << 2,length); -+#endif + length = eff = 0; + vcc->stats->rx_err++; + } @@ -1513,7 +1508,7 @@ + if (vcc->qos.rxtp.traffic_class == ATM_NONE) return 0; + size = vcc->qos.rxtp.max_sdu*3; /* @@@ improve this */ + eni_vcc->recv = (volatile unsigned long *) eni_alloc_mem(eni_dev,&size); -+ DPRINTK("rx at 0x%lx\n",(unsigned long) eni_vcc->recv); ++ DPRINTK("rx at 0x%p\n",eni_vcc->recv); + eni_vcc->words = size >> 2; + if (!eni_vcc->recv) return -ENOBUFS; + eni_vcc->rx = vcc->aal == ATM_AAL5 ? rx_aal5 : rx_aal0; @@ -1686,7 +1681,7 @@ + + DPRINTK(">do_tx\n"); + NULLCHECK(skb); -+ EVENT("do_tx: skb=0x%lx, %d bytes\n",(unsigned long) skb,skb->len); ++ EVENT("do_tx: skb=0x%p, %d bytes\n",skb,skb->len); + vcc = skb->atm.vcc; + NULLCHECK(vcc); + eni_dev = ENI_DEV(vcc->dev); @@ -1947,8 +1942,6 @@ + ((eni_dev->tx[tx_ind].send-eni_dev->ram) >> MID_LOC_SKIP); + eni_dev->tx[tx_ind].tx_pos = eni_dev->reg[MID_TX_DESCRSTART(tx_ind)] & + MID_DESCR_START; -+/*printk("mp 0x%lx tp 0x%lx\n",(unsigned long) eni_dev->tx[tx_ind].send, -+ eni_dev->tx[tx_ind].tx_pos);*/ + eni_vcc->tx = &eni_dev->tx[tx_ind]; + return 0; +} @@ -1974,6 +1967,7 @@ + save_flags(flags); + cli(); + while (skb_peek(&eni_vcc->tx->backlog) || eni_vcc->txing) { ++ printk("%d TX left\n",eni_vcc->txing); + DPRINTK("%d TX left\n",eni_vcc->txing); + sleep_on(&eni_dev->tx_wait); + } @@ -2366,10 +2360,9 @@ + eni_dev->tx_dma = eni_dev->rx_dma+NR_DMA_RX*2; + eni_dev->service = eni_dev->tx_dma+NR_DMA_TX*2; + buf = eni_dev->service+NR_SERVICE; -+ DPRINTK("vci 0x%lx,rx 0x%lx, tx 0x%lx,srv 0x%lx,buf 0x%lx\n", -+ (unsigned long) eni_dev->vci,(unsigned long) eni_dev->rx_dma, -+ (unsigned long) eni_dev->tx_dma,(unsigned long) eni_dev->service, -+ buf); ++ DPRINTK("vci 0x%p,rx 0x%p, tx 0x%p,srv 0x%p,buf 0x%lx\n", ++ eni_dev->vci,eni_dev->rx_dma,eni_dev->tx_dma,eni_dev->service, ++ buf); + /* initialize memory management */ + buffer_mem = eni_dev->mem-((unsigned long) buf- + (unsigned long) eni_dev->ram); @@ -2646,7 +2639,8 @@ + eni_phy_put, + eni_phy_get, + NULL, /* no feedback */ -+ NULL /* no change_qos */ ++ NULL, /* no change_qos */ ++ NULL /* no free_rx_skb */ +}; + + @@ -2713,7 +2707,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/eni.h Wed Jan 29 19:28:19 1997 ++++ work/drivers/atm/eni.h Tue Mar 11 11:55:18 1997 @@ -0,0 +1,114 @@ +/* drivers/atm/eni.h - Efficient Networks ENI155P device driver declarations */ + @@ -3399,7 +3393,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/suni.h Wed Jan 29 19:28:19 1997 ++++ work/drivers/atm/suni.h Tue Mar 11 11:55:18 1997 @@ -0,0 +1,219 @@ +/* drivers/atm/suni.h - PMC SUNI (PHY) declarations */ + @@ -4279,11 +4273,11 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/zatm.c Fri Nov 29 20:01:52 1996 -@@ -0,0 +1,1846 @@ ++++ work/drivers/atm/zatm.c Thu Feb 6 19:40:59 1997 +@@ -0,0 +1,1847 @@ +/* drivers/atm/zatm.c - ZeitNet ZN122x device driver */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#include @@ -4862,7 +4856,7 @@ +#endif + size = error ? 0 : ntohs(((unsigned short *) skb->data)[cells* + ATM_CELL_PAYLOAD/sizeof(unsigned short)-3]); -+ EVENT("got skb 0x%lx, size %d\n",(unsigned long) skb,size); ++ EVENT("got skb 0x%p, size %d\n",skb,size); + chan = (here[3] & uPD98401_AAL5_CHAN) >> + uPD98401_AAL5_CHAN_SHIFT; + if (chan < zatm_dev->chans && zatm_dev->rx_map[chan]) { @@ -6061,7 +6055,8 @@ + zatm_phy_put, + zatm_phy_get, + zatm_feedback, -+ NULL /* no change_qos */ ++ NULL, /* no change_qos */ ++ NULL /* no free_rx_skb */ +}; + + @@ -6128,7 +6123,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/zatm.h Wed Jan 29 19:28:56 1997 ++++ work/drivers/atm/zatm.h Tue Mar 11 11:56:58 1997 @@ -0,0 +1,172 @@ +/* drivers/atm/zatm.h - ZeitNet ZN122x device driver declarations */ + @@ -6340,7 +6335,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/tneta1570.h Wed Jan 29 19:29:23 1997 ++++ work/drivers/atm/tneta1570.h Tue Mar 11 11:59:43 1997 @@ -0,0 +1,390 @@ +/* drivers/atm/tneta1570.h - TI TNETA1570 (SAR) declarations */ + @@ -6733,8 +6728,8 @@ +#endif __KERNEL__ +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/tneta1570.c Fri Nov 15 19:06:28 1996 -@@ -0,0 +1,1625 @@ ++++ work/drivers/atm/tneta1570.c Thu Feb 6 19:26:48 1997 +@@ -0,0 +1,1626 @@ +/* drivers/atm/tneta1570.c - ti tneta1570 atm driver + * + * Copyright (c) 1996 University of Technology Chemnitz @@ -8296,7 +8291,8 @@ + tneta1570_phy_put, + tneta1570_phy_get, + NULL, /* no feedback */ -+ NULL /* no change_qos */ ++ NULL, /* no change_qos */ ++ NULL /* no free_rx_skb */ +}; + + @@ -8712,7 +8708,7 @@ + +#endif /* _LINUX_NICSTAR_H_ */ --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/nicstar.c Wed Jan 29 19:25:00 1997 ++++ work/drivers/atm/nicstar.c Tue Mar 11 12:21:57 1997 @@ -0,0 +1,2074 @@ +/* nicstar.c, M. Welsh (matt.welsh@cl.cam.ac.uk) + * @@ -10751,7 +10747,7 @@ + } + if (i >= NUM_LG_BUFS) { + /* should probably copy instead */ -+ printk("nicstar%d: Corresponding large buffer not found! dropping packet. i %d vcc %x skb %x data %x\n", ++ printk("nicstar%d: Corresponding large buffer not found! dropping packet. i %d vcc %p skb %p data %p\n", + node->index, i,vcc,skb,skb->data); + nicstar_free_rx_skb(vcc,skb); + return 0; @@ -10801,11 +10797,11 @@ #define PCI_DEVICE_ID_ADL_2301 0x2301 --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atm.h Fri Nov 15 20:55:15 1996 -@@ -0,0 +1,216 @@ ++++ work/include/linux/atm.h Tue Mar 11 23:23:29 1997 +@@ -0,0 +1,218 @@ +/* atm.h - general ATM declarations */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#ifndef _LINUX_ATM_H @@ -10843,7 +10839,8 @@ +#define AF_ATMSVC 7 /* ATM SVCs */ + +/* "protcol" values for the socket system call */ -+#define ATM_AAL0 0 /* "raw" ATM cells */ ++#define ATM_NO_AAL 0 /* AAL not specified */ ++#define ATM_AAL0 13 /* "raw" ATM cells */ +#define ATM_AAL1 1 /* AAL1 (CBR) */ +#define ATM_AAL2 2 /* AAL2 (VBR) */ +#define ATM_AAL34 3 /* AAL3/4 (data) */ @@ -10951,6 +10948,7 @@ +struct atm_qos { + struct atm_trafprm txtp; /* parameters in TX direction */ + struct atm_trafprm rxtp; /* parameters in RX direction */ ++ unsigned char aal; +}; + +/* PVC addressing */ @@ -11020,7 +11018,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmclip.h Wed Jan 29 19:35:20 1997 ++++ work/include/linux/atmclip.h Tue Mar 11 12:00:40 1997 @@ -0,0 +1,37 @@ +/* atmclip.h - Classical IP over ATM */ + @@ -11060,8 +11058,8 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmdev.h Wed Jan 29 19:27:24 1997 -@@ -0,0 +1,257 @@ ++++ work/include/linux/atmdev.h Tue Mar 11 11:54:53 1997 +@@ -0,0 +1,258 @@ +/* atmdev.h - ATM device driver declarations */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -11223,6 +11221,7 @@ + struct sk_buff_head recvq; /* receive queue */ + struct atm_aal_stats *stats; /* pointer to AAL stats group */ + struct wait_queue *sleep; /* if socket is busy */ ++ struct wait_queue *wsleep; /* if waiting for write buffer space */ + struct atm_vcc *prev,*next; + /* SVC part --- may move later */ + short itf; /* interface number */ @@ -11447,7 +11446,7 @@ + +#endif --- ref/include/linux/skbuff.h Thu Oct 31 11:06:31 1996 -+++ work/include/linux/skbuff.h Wed Jan 29 18:47:57 1997 ++++ work/include/linux/skbuff.h Fri Feb 28 14:29:29 1997 @@ -112,6 +112,25 @@ unsigned char *end; /* End pointer */ void (*destructor)(struct sk_buff *); /* Destruct function */ @@ -11530,11 +11529,11 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmsvc.h Fri Nov 15 21:36:38 1996 -@@ -0,0 +1,51 @@ ++++ work/include/linux/atmsvc.h Tue Mar 11 23:23:43 1997 +@@ -0,0 +1,50 @@ +/* atmsvc.h - ATM signaling kernel-demon interface definitions */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#ifndef _LINUX_ATMSVC_H @@ -11560,7 +11559,6 @@ + /* ==0: success */ + /* > 0: error when active (still */ + /* need to close) */ -+ unsigned char aal; /* AAL */ + struct sockaddr_atmpvc pvc; /* indicate, okay (connect) */ + struct sockaddr_atmsvc local; /* local SVC address */ + struct atm_qos qos; /* QOS parameters */ @@ -11699,11 +11697,11 @@ + +include $(TOPDIR)/Rules.make --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/clip.c Fri Nov 15 19:06:31 1996 -@@ -0,0 +1,116 @@ ++++ work/net/atm/clip.c Thu Feb 6 19:42:00 1997 +@@ -0,0 +1,115 @@ +/* net/atm/clip.c - Classical IP over ATM */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#include @@ -11770,8 +11768,7 @@ + +iov = (struct iovec *) skb->data; +for (i = 0; i < skb->atm.iovcnt; i++) -+ printk("[%d] 0x%lx + %d\n",i,(unsigned long) iov[i].iov_base, -+ iov[i].iov_len); ++ printk("[%d] 0x%p + %d\n",i,iov[i].iov_base,iov[i].iov_len); + + printk("clip *DIRECT* xmit (iovcnt: %d)\n",skb->atm.iovcnt); +*/ @@ -11814,15 +11811,15 @@ + /* if register_netdev can sleep, we race on ->number */ + CLIP(dev)->next = old_clip_devs; + old_clip_devs = CLIP(dev); -+ DPRINTK("registered %s,0x%lx\n",dev->name,(unsigned long) vcc); ++ DPRINTK("registered %s,0x%p\n",dev->name,vcc); + return CLIP(dev)->number; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/common.c Wed Jan 29 18:47:27 1997 -@@ -0,0 +1,954 @@ ++++ work/net/atm/common.c Tue Mar 11 22:47:15 1997 +@@ -0,0 +1,949 @@ +/* net/atm/common.c - ATM sockets (common part for PVC and SVC) */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#include @@ -11884,7 +11881,6 @@ +int atm_create(struct socket *sock,int protocol) +{ + struct atm_vcc *vcc; -+ int error; + + ATM_SD(sock) = NULL; + if (sock->type == SOCK_STREAM) return -EINVAL; @@ -11903,31 +11899,15 @@ + vcc->tx_quota = ATM_TXBQ_DEF; + vcc->rx_quota = ATM_RXBQ_DEF; + vcc->tx_inuse = vcc->rx_inuse = 0; -+ switch (protocol) { -+ /* -+ * Note: ATM_AAL0 also covers the "0 for default" case, -+ * although some people may not like that default ;-) -+ */ -+ case ATM_AAL0: -+ error = atm_init_aal0(vcc); -+ break; -+ case ATM_AAL34: -+ error = atm_init_aal34(vcc); -+ break; -+ case ATM_AAL5: -+ error = atm_init_aal5(vcc); -+ break; -+ default: -+ error = -EPROTOTYPE; -+ } -+ if (error) { -+ free_atm_vcc(vcc); -+ return error; -+ } ++ vcc->aal = protocol; /* temporary @@@ */ ++ vcc->push = NULL; ++ vcc->peek = NULL; ++ vcc->pop = NULL; ++ vcc->push_oam = NULL; + vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */ + vcc->atm_options = vcc->aal_options = 0; + vcc->timestamp.tv_sec = vcc->timestamp.tv_usec = 0; -+ vcc->sleep = NULL; ++ vcc->sleep = vcc->wsleep = NULL; + skb_queue_head_init(&vcc->recvq); + skb_queue_head_init(&vcc->listenq); + ATM_SD(sock) = vcc; @@ -12073,26 +12053,34 @@ + if (itf >= MAX_ATM_ITF) return -EINVAL; + dev = &atm_dev[itf]; + if (!dev->ops) return -ENODEV; -+ if ((vpi != ATM_VPI_UNSPEC && vpi >> dev->ci_range.vpi_bits) || -+ (vci != ATM_VCI_UNSPEC && vci >> dev->ci_range.vci_bits)) ++ if ((vpi != ATM_VPI_UNSPEC && vpi != ATM_VPI_ANY && ++ vpi >> dev->ci_range.vpi_bits) || (vci != ATM_VCI_UNSPEC && ++ vci != ATM_VCI_ANY && vci >> dev->ci_range.vci_bits)) + return -EINVAL; + if (vci > 0 && vci < ATM_NOT_RSV_VCI && !suser()) return -EPERM; ++ if (vcc->qos.aal) vcc->aal = vcc->qos.aal; /* temporary @@@ */ ++ error = 0; + switch (vcc->aal) { + case ATM_AAL0: ++ error = atm_init_aal0(vcc); + vcc->stats = &((struct atm_dev *) dev)->stats.aal0; + break; + case ATM_AAL34: ++ error = atm_init_aal34(vcc); + vcc->stats = &((struct atm_dev *) dev)->stats.aal34; + break; ++ case ATM_NO_AAL: ++ /* ATM_AAL5 is also used in the "0 for default" case */ ++ vcc->aal = ATM_AAL5; ++ /* fall through */ + case ATM_AAL5: ++ error = atm_init_aal5(vcc); + vcc->stats = &((struct atm_dev *) dev)->stats.aal5; + break; + default: -+ printk(KERN_WARNING "%s(itf %d): unsupported AAL " -+ "(%d)\n",vcc->dev->type,vcc->dev->number,vcc->aal); -+ return -EINVAL; ++ error = -EPROTOTYPE; + } -+ error = adjust_tp(&vcc->qos.txtp,vcc->aal); ++ if (!error) error = adjust_tp(&vcc->qos.txtp,vcc->aal); + if (!error) error = adjust_tp(&vcc->qos.rxtp,vcc->aal); + if (error) return error; + vcc->dev = (struct atm_dev *) dev; @@ -12131,10 +12119,11 @@ + vcc->flags &= ~ATM_VF_PARTIAL; + else if (vcc->flags & ATM_VF_PARTIAL) return -EINVAL; + printk("atm_connect (TX: cl %d,bw %d-%d,sdu %d; RX: cl %d,bw %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, ++ "sdu %d,AAL %d)\n",vcc->qos.txtp.traffic_class, ++ vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu, + vcc->qos.rxtp.traffic_class,vcc->qos.rxtp.min_pcr, -+ vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu); ++ vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu,vcc->qos.aal ? ++ vcc->qos.aal : vcc->aal); + if (!vcc->qos.txtp.traffic_class && !vcc->qos.rxtp.traffic_class) + return -EINVAL; + if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS || @@ -12285,7 +12274,7 @@ + while (!(skb = alloc_skb(sizeof(struct iovec)*max_iov, + GFP_KERNEL))) { + if (nonblock) return -EAGAIN; -+ interruptible_sleep_on(&vcc->sleep); ++ interruptible_sleep_on(&vcc->wsleep); + if (current->signal & ~current->blocked) + return -ERESTARTSYS; + } @@ -12312,7 +12301,7 @@ + eff = (size+3) & ~3; /* align to word boundary */ + while (!(skb = vcc->alloc_tx(vcc,eff))) { + if (nonblock) return -EAGAIN; -+ interruptible_sleep_on(&vcc->sleep); ++ interruptible_sleep_on(&vcc->wsleep); + if (current->signal & ~current->blocked) + return -ERESTARTSYS; + if (vcc->flags & ATM_VF_RELEASED) return vcc->reply; @@ -12362,11 +12351,14 @@ + if (vcc->dev && vcc->dev->ops->poll) return 0; + return 1; + case SEL_OUT: -+ if (sock->state == SS_CONNECTING) break; -+ if (vcc->qos.txtp.traffic_class == ATM_NONE) return 1; -+ if (vcc->qos.txtp.max_sdu+vcc->tx_inuse+ATM_PDU_OVHD > -+ vcc->tx_quota) break; -+ return 1; ++ if (sock->state != SS_CONNECTING) { ++ if (vcc->qos.txtp.traffic_class == ATM_NONE) ++ return 1; ++ if (vcc->qos.txtp.max_sdu+vcc->tx_inuse+ ++ ATM_PDU_OVHD <= vcc->tx_quota) return 1; ++ } ++ select_wait(&vcc->wsleep,wait); ++ return 0; + case SEL_EX: + if (sock->state != SS_CONNECTING) return 0; + if (vcc->reply == WAITING) break; @@ -13146,7 +13138,7 @@ + if (atm_vcc[i].family) fn(atm_vcc+i); +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/static.h Wed Jan 29 19:35:20 1997 ++++ work/net/atm/static.h Tue Mar 11 12:00:41 1997 @@ -0,0 +1,29 @@ +/* net/atm/static.h - Staticly allocated resources */ + @@ -13785,11 +13777,11 @@ + } +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/signaling.c Fri Nov 15 19:06:34 1996 -@@ -0,0 +1,215 @@ ++++ work/net/atm/signaling.c Tue Mar 11 20:04:09 1997 +@@ -0,0 +1,217 @@ +/* net/atm/signaling.c - ATM signaling */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#include /* error codes */ @@ -13863,8 +13855,8 @@ + vcc->backlog_quota--; + skb_queue_tail(&vcc->listenq,skb); + if (vcc->callback) { -+ DPRINTK("waking vcc->sleep 0x%lx\n", -+ (unsigned long) &vcc->sleep); ++ DPRINTK("waking vcc->sleep 0x%p\n", ++ &vcc->sleep); + vcc->callback(vcc); + } + return 0; @@ -13896,7 +13888,7 @@ + static unsigned long silence = 0; +#endif + -+ DPRINTK("sigd_enq %d (0x%lx)\n",(int) type,(unsigned long) vcc); ++ DPRINTK("sigd_enq %d (0x%p)\n",(int) type,vcc); + size = sizeof(struct atmsvc_msg)-sizeof(struct atm_blli); + if (svc) + for (walk = svc->sas_addr.blli; walk; walk = walk->next) @@ -13908,8 +13900,10 @@ + msg->type = type; + msg->vcc = (unsigned long) vcc; + msg->listen_vcc = (unsigned long) listen_vcc; -+ msg->aal = vcc ? vcc->aal : 0; -+ if (vcc) msg->qos = vcc->qos; ++ if (vcc) { ++ msg->qos = vcc->qos; ++ if (!msg->qos.aal) msg->qos.aal = vcc->aal; ++ } + if (!svc) msg->svc.sas_family = 0; + else { + msg->svc = *svc; @@ -14003,7 +13997,7 @@ + return 0; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/signaling.h Wed Jan 29 19:35:20 1997 ++++ work/net/atm/signaling.h Tue Mar 11 20:10:54 1997 @@ -0,0 +1,25 @@ +/* net/atm/signaling.h - ATM signaling */ + @@ -14031,11 +14025,11 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/atmarp.c Wed Jan 22 16:25:09 1997 -@@ -0,0 +1,609 @@ ++++ work/net/atm/atmarp.c Tue Mar 11 22:20:59 1997 +@@ -0,0 +1,610 @@ +/* atmarp.c - RFC1577 ATM ARP */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#include @@ -14379,6 +14373,7 @@ + struct atmarp_entry *entry; + + DPRINTK("MKIP\n"); ++ if (!vcc->push) return -EBADFD; + entry = new_entry(timeout); + if (!entry) return -ENOMEM; + attach_entry(vcc,entry); @@ -14643,7 +14638,7 @@ + return 0; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/atmarp.h Wed Jan 29 19:35:20 1997 ++++ work/net/atm/atmarp.h Tue Mar 11 12:00:41 1997 @@ -0,0 +1,53 @@ +/* net/atm/atmarp.h - RFC1577 ATM ARP */ + @@ -14699,7 +14694,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/ipcommon.h Wed Jan 29 19:36:15 1997 ++++ work/net/atm/ipcommon.h Tue Mar 11 12:01:26 1997 @@ -0,0 +1,73 @@ +/* net/atm/ipcommon.h - Common items for all ways of doing IP over ATM */ + @@ -14775,11 +14770,11 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/ipcommon.c Wed Jan 22 16:28:02 1997 -@@ -0,0 +1,215 @@ ++++ work/net/atm/ipcommon.c Thu Feb 6 19:42:25 1997 +@@ -0,0 +1,213 @@ +/* net/atm/ipcommon.c - Common items for all ways of doing IP over ATM */ + -+/* Written 1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1996,1997 by Werner Almesberger, EPFL LRC */ + + +#include @@ -14856,13 +14851,11 @@ + skb = alloc_skb(((pdu_size+3) & ~3)+PAGE_SIZE+header_size-1, + GFP_ATOMIC); + if (skb) { -+ DPRINTK("data before: 0x%lx\n", -+ (unsigned long) skb->data); ++ DPRINTK("data before: 0x%p\n",skb->data); + skb->data = (unsigned char *) (((unsigned long) skb-> + data+header_size+PAGE_SIZE-1) & ~(PAGE_SIZE-1))- + header_size; -+ DPRINTK("data after: 0x%lx\n", -+ (unsigned long) skb->data); ++ DPRINTK("data after: 0x%p\n",skb->data); + } + } + if (!skb) { @@ -14922,7 +14915,7 @@ + +static int clip_stop(struct device *dev) +{ -+ DPRINTK("DOWN! (%s,0x%lx)\n",dev->name,(unsigned long) CLIP(dev)->vcc); ++ DPRINTK("DOWN! (%s,0x%p)\n",dev->name,CLIP(dev)->vcc); + atm_release_vcc(CLIP(dev)->vcc,1); + return 0; +} @@ -14993,8 +14986,8 @@ + return number; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/arequipa.c Wed Jan 29 19:33:39 1997 -@@ -0,0 +1,442 @@ ++++ work/net/atm/arequipa.c Tue Mar 11 23:10:33 1997 +@@ -0,0 +1,445 @@ +/* net/atm/arequipa.c - Application requested IP over ATM */ + +/* Written 1996,1997 by Jean-Michel Pittet and Werner Almesberger, EPFL LRC */ @@ -15117,6 +15110,8 @@ + save_flags(flags); + cli(); + arequipa_unuse(ATM_SD(lower)); ++ ip_rt_put(upper->ip_route_cache); ++ upper->ip_route_cache = NULL; + upper->arequipa = NULL; + ATM_SD(lower)->upper = NULL; + if (!(ATM_SD(lower)->flags & ATM_VF_AQREL)) aqd_enq(ATM_SD(lower)); @@ -15205,6 +15200,7 @@ + vcc->flags |= ATM_VF_AQDANG; + vcc->aq_next = aq_list; + vcc->aq_prev = NULL; ++ if (aq_list) aq_list->aq_prev = vcc; + aq_list = vcc; + } + vcc->generation = aq_generation++; @@ -15560,11 +15556,11 @@ { NULL, NULL } /* End marker */ }; --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/mmuio.c Fri Nov 15 19:06:38 1996 -@@ -0,0 +1,455 @@ ++++ work/net/atm/mmuio.c Thu Feb 6 19:43:29 1997 +@@ -0,0 +1,454 @@ +/* net/atm/mmuio.c - MMU-supported high-speed I/O */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#include @@ -15929,8 +15925,7 @@ + while (1) { + mem_map_t *map; + -+ EVENT("<0x%lx|0x%lx|0x%lx>\n",(unsigned long) pgd, -+ (unsigned long) pmd,(unsigned long) pte); ++ EVENT("<0x%p|0x%p|0x%p>\n",pgd,pmd,pte); + EVENT("0x%lx,0x%lx,%d\n",start,end,iovcnt); + if (pte_none(*pte) || !pte_present(*pte)) { + struct vm_area_struct *vma; @@ -15985,8 +15980,8 @@ + if (start == end) iov->iov_len += PAGE_SIZE; +/* +for (i = 0; i <= iovcnt; i++) -+ printk("iov[%d].iov_base = 0x%lx\niov[%d].iov_len = 0x%lx\n", -+i,(unsigned long) iov[i-iovcnt].iov_base,i,iov[i-iovcnt].iov_len); ++ printk("iov[%d].iov_base = 0x%p\niov[%d].iov_len = 0x%lx\n", ++i,iov[i-iovcnt].iov_base,i,iov[i-iovcnt].iov_len); +*/ + return iovcnt+1; +} @@ -16018,7 +16013,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/mmuio.h Wed Jan 29 19:35:20 1997 ++++ work/include/linux/mmuio.h Fri Feb 28 14:51:54 1997 @@ -0,0 +1,25 @@ +/* mmuio.h - MMU-supported high-speed I/O */ + @@ -16046,11 +16041,11 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/raw.c Fri Nov 15 19:06:39 1996 ++++ work/net/atm/raw.c Fri Mar 7 14:25:00 1997 @@ -0,0 +1,139 @@ +/* net/atm/raw.c - Raw AAL0 and AAL5 transports */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#include @@ -16130,7 +16125,7 @@ + skb->data = (unsigned char *) + (((unsigned long) skb->data+PAGE_SIZE-1) & + ~(PAGE_SIZE-1)); -+DPRINTK("PEEK: data at 0x%lx\n",(unsigned long) skb->data); ++DPRINTK("PEEK: data at 0x%p\n",skb->data); + return skb; + } + } @@ -16152,7 +16147,7 @@ +if (vcc->dev->sending != 1) printk("sending == %d !!!\n",vcc->dev->sending); + vcc->dev->sending--; +#endif -+ wake_up(&vcc->sleep); ++ wake_up(&vcc->wsleep); +} + + @@ -16208,7 +16203,7 @@ + +#endif --- ref/include/linux/netdevice.h Thu Oct 31 11:06:31 1996 -+++ work/include/linux/netdevice.h Wed Jan 29 19:27:24 1997 ++++ work/include/linux/netdevice.h Fri Feb 28 14:29:29 1997 @@ -187,6 +187,8 @@ int (*set_mac_address)(struct device *dev, void *addr); #define HAVE_PRIVATE_IOCTL @@ -16228,7 +16223,7 @@ extern void fddi_setup(struct device *dev); extern int ether_config(struct device *dev, struct ifmap *map); --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmarp.h Fri Nov 15 21:36:38 1996 ++++ work/include/linux/atmarp.h Tue Mar 11 12:00:40 1997 @@ -0,0 +1,99 @@ +/* atmarp.h - ATM ARP protocol and kernel-demon interface definitions */ + @@ -16468,7 +16463,7 @@ /* Tell the sender its packet died... */ icmp_send(skb, ICMP_TIME_EXCEEDED, ICMP_EXC_TTL, 0, dev); --- ref/include/linux/proc_fs.h Wed Oct 30 03:53:15 1996 -+++ work/include/linux/proc_fs.h Fri Nov 15 20:55:15 1996 ++++ work/include/linux/proc_fs.h Fri Feb 28 14:29:29 1997 @@ -34,6 +34,7 @@ PROC_KSYMS, PROC_DMA, @@ -16591,11 +16586,11 @@ inode->i_mode = S_IFREG | S_IRUSR; inode->i_op = &proc_kcore_inode_operations; --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/proc.c Fri Nov 15 19:06:43 1996 ++++ work/net/atm/proc.c Mon Feb 3 23:15:51 1997 @@ -0,0 +1,501 @@ +/* net/atm/proc.c - ATM /proc interface */ + -+/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ + + +#include @@ -16659,7 +16654,7 @@ +#endif +#ifdef CONFIG_AREQUIPA + case PROC_ATM_AREQUIPA: -+ sprintf(buf,"Itf VPI VCI State Socket\n"); ++ sprintf(buf,"Itf VPI VCI State Sock# Inode\n"); + break; +#endif + default: @@ -16847,8 +16842,8 @@ + here = strchr(buf,0); + here += sprintf(here,"%-8s ",arequipa_state(vcc)); + if (vcc->upper) -+ here += sprintf(here,"%ld",vcc->upper->socket && -+ SOCK_INODE(vcc->upper->socket) ? ++ here += sprintf(here,"%5d %ld",vcc->upper->num, ++ vcc->upper->socket && SOCK_INODE(vcc->upper->socket) ? + SOCK_INODE(vcc->upper->socket)->i_ino : 0); + strcat(here,"\n"); +} @@ -17327,7 +17322,7 @@ * Called once on startup. */ --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmlec.h Fri Nov 22 08:03:16 1996 ++++ work/include/linux/atmlec.h Tue Mar 11 12:00:40 1997 @@ -0,0 +1,64 @@ +/* + * @@ -18043,7 +18038,7 @@ + return i; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/lec.h Wed Jan 29 19:35:20 1997 ++++ work/net/atm/lec.h Tue Mar 11 12:00:41 1997 @@ -0,0 +1,107 @@ +/* + * @@ -19200,7 +19195,7 @@ +} + --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/lec_arpc.h Wed Jan 29 19:35:20 1997 ++++ work/net/atm/lec_arpc.h Tue Mar 11 12:00:41 1997 @@ -0,0 +1,101 @@ +/* + * Lec arp cache @@ -19304,7 +19299,7 @@ + +#endif --- ref/include/net/route.h Wed Oct 30 03:58:23 1996 -+++ work/include/net/route.h Wed Jan 29 19:33:42 1997 ++++ work/include/net/route.h Fri Feb 28 14:47:56 1997 @@ -26,6 +26,7 @@ #define _ROUTE_H @@ -19368,7 +19363,7 @@ #endif /* _ROUTE_H */ --- ref/include/net/sock.h Thu Nov 7 10:35:28 1996 -+++ work/include/net/sock.h Wed Jan 29 19:27:24 1997 ++++ work/include/net/sock.h Fri Feb 28 14:29:29 1997 @@ -190,6 +190,9 @@ zapped, /* In ax25 & ipx means not linked */ broadcast, @@ -19421,7 +19416,7 @@ /* * This part is used for the timeout functions (timer.c). --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/arequipa.h Wed Jan 29 19:35:20 1997 ++++ work/include/linux/arequipa.h Fri Feb 28 14:51:54 1997 @@ -0,0 +1,46 @@ +/* arequipa.h - Arequipa interface definitions */ + @@ -19671,7 +19666,7 @@ IS_SKB(n); return n; --- ref/include/net/tcp.h Wed Oct 30 03:58:24 1996 -+++ work/include/net/tcp.h Wed Jan 29 19:34:00 1997 ++++ work/include/net/tcp.h Fri Feb 28 14:50:32 1997 @@ -23,16 +23,26 @@ /* diff -ur --new-file old/atm/debug/Makefile new/atm/debug/Makefile --- old/atm/debug/Makefile Sun Nov 17 15:47:56 1996 +++ new/atm/debug/Makefile Tue Mar 11 23:28:44 1997 @@ -1,4 +1,4 @@ -SYSPGMS=delay ed encopy endump zndump znth +SYSPGMS=aqtest delay ed encopy endump zndump znth MAN8= include ../Rules.make diff -ur --new-file old/atm/debug/aqtest.c new/atm/debug/aqtest.c --- old/atm/debug/aqtest.c Thu Jan 1 01:00:00 1970 +++ new/atm/debug/aqtest.c Tue Mar 11 22:56:17 1997 @@ -0,0 +1,237 @@ +/* aqtest.c - Simplistic Arequipa tester */ + +/* Written 1997 by Werner Almesberger, EPFL-LRC */ +/* Based on work by Mehdi Tazi */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +#define DEFAULT_PORT 1997 +#define MSG "just testing" +#define BUF_SIZE 100 + + +static int verbose = 0; + + +static void say(const char *msg) +{ + if (!verbose) return; + printf("%s\n",msg); + fflush(stdout); +} + + +static void fail(const char *msg) +{ + perror(msg); + exit(1); +} + + +static void mismatch(const char *msg,int size) +{ + fprintf(stderr,"%s %d bytes instead of %d\n",msg,size,strlen(MSG)+1); + exit(1); +} + + +static void usage(const char *name) +{ + fprintf(stderr,"usage: %s [-a atm_host[/qos]] [-p port] [host] sequence\n", + name); + fprintf(stderr,"sequence consists of the following characters:\n"); + fprintf(stderr," a accept (and close listening socket)\n"); + fprintf(stderr," b bind\n"); + fprintf(stderr," c close\n"); + fprintf(stderr," d delay (1 second)\n"); + fprintf(stderr," e arequipa_expect\n"); + fprintf(stderr," f arequipa_close\n"); + fprintf(stderr," h hang (loop forever)\n"); + fprintf(stderr," l listen\n"); + fprintf(stderr," o connect\n"); + fprintf(stderr," p arequipa_preset\n"); + fprintf(stderr," r read\n"); + fprintf(stderr," s socket\n"); + fprintf(stderr," w write\n"); + exit(1); +} + + +int main(int argc,char **argv) +{ + struct sockaddr_atmsvc addr_atm; + struct sockaddr_in addr_in; + struct atm_qos qos; + const char *port; + char *here,*end,*walk; + int opt_a,c,s; + + opt_a = 0; + port = NULL; + while ((c = getopt(argc,argv,"a:p:v")) != EOF) + switch (c) { + case 'a': + memset(&addr_atm,0,sizeof(addr_atm)); + here = strchr(optarg,'/'); + if (!(here = strchr(optarg,'/'))) { + memset(&qos,0,sizeof(qos)); + qos.txtp.traffic_class = qos.rxtp.traffic_class = ATM_UBR; + } + else { + *here++ = 0; + if (text2qos(here,&qos,0) < 0) { + fprintf(stderr,"invalid QOS specification: %s\n",here); + return 1; + } + } + if (text2atm(optarg,(struct sockaddr *) &addr_atm, + sizeof(addr_atm),T2A_SVC | T2A_NAME) < 0) { + fprintf(stderr,"invalid ATM address: %s\n",optarg); + return 1; + } + opt_a = 1; + break; + case 'p': + port = optarg; + break; + case 'v': + verbose = 1; + break; + default: + usage(argv[0]); + } + addr_in.sin_family = AF_INET; + if (argc == optind+1) addr_in.sin_addr.s_addr = htonl(INADDR_ANY); + else { + if (argc != optind+2) usage(argv[0]); + if ((int) (addr_in.sin_addr.s_addr = inet_addr(argv[optind])) == -1) { + struct hostent *he; + + if (!(he = gethostbyname(argv[optind]))) { + herror(argv[optind]); + return 1; + } + memcpy(&addr_in.sin_addr,he->h_addr,he->h_length); + } + } + if (!port) addr_in.sin_port = htons(DEFAULT_PORT); + else { + addr_in.sin_port = htons(strtoul(port,&end,10)); + if (*end) { + struct servent *se; + + if (!(se = getservbyname(port,"tcp"))) { + fprintf(stderr,"invalid port: %s\n",port); + return 1; + } + addr_in.sin_port = se->s_port; + } + } + if (*argv[argc-1] != 's') { + fprintf(stderr,"sequence must start with \"s\"\n"); + return 1; + } + s = -1; + for (walk = argv[argc-1]; *walk; walk++) + switch (*walk) { + case 'a': + { + int s2; + + say("accept"); + if ((s2 = accept(s,NULL,NULL)) < 0) fail("accept"); + if (close(s) < 0) fail("close after accept"); + s = s2; + } + break; + case 'b': + say("bind"); + if (bind(s,(struct sockaddr *) &addr_in,sizeof(addr_in)) < 0) + fail("bind"); + break; + case 'c': + say("close"); + if (close(s) < 0) fail("close"); + break; + case 'd': + say("delay (sleep)"); + sleep(1); + break; + case 'e': + say("arequipa_expect"); + if (arequipa_expect(s,1) < 0) fail("arequipa_expect"); + break; + case 'f': + say("arequipa_close"); + if (arequipa_close(s) < 0) fail("arequipa_close"); + break; + case 'h': + say("hanging"); + while (1) sleep(1); + case 'l': + say("listen"); + if (listen(s,1) < 0) fail("listen"); + break; + case 'o': + say("open (connect)"); + if (connect(s,(struct sockaddr *) &addr_in,sizeof(addr_in)) < 0) + fail("open (connect)"); + break; + case 'p': + if (!opt_a) { + fprintf(stderr,"must specify ATM address for " + "arequipa_preset\n"); + return 1; + } + say("arequipa_preset"); + if (arequipa_preset(s,&addr_atm,&qos) < 0) + fail("arequipa_preset"); + break; + case 'r': + { + char buffer[BUF_SIZE]; + int size; + + say("read"); + size = read(s,buffer,strlen(MSG)+1); + if (size < 0) fail("read"); + if (size != strlen(MSG)+1) mismatch("read",size); + if (strcmp(MSG,buffer)) { + fprintf(stderr,"received string doesn't match sent " + "string\n"); + return 1; + } + } + break; + case 's': + say("socket"); + if ((s = socket(PF_INET,SOCK_STREAM,0)) < 0) fail("socket"); + break; + case 'w': + { + int size; + + say("write"); + size = write(s,MSG,strlen(MSG)+1); + if (size < 0) fail("write"); + if (size != strlen(MSG)+1) mismatch("wrote",size); + } + break; + default: + usage(argv[0]); + } + return 0; +} diff -ur --new-file old/atm/debug/delay.c new/atm/debug/delay.c --- old/atm/debug/delay.c Sun Nov 17 15:35:07 1996 +++ new/atm/debug/delay.c Tue Mar 11 11:54:16 1997 @@ -1,6 +1,6 @@ /* delay.c - Simplistic AAL5-level software delay line */ -/* Written 1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1996,1997 by Werner Almesberger, EPFL-LRC */ /* @@ -162,12 +162,13 @@ } if (tx) qos.rxtp.traffic_class = ATM_NONE; else qos.txtp.traffic_class = ATM_NONE; + qos.aal = ATM_AAL5; if (text2atm(spec,(struct sockaddr *) &addr,sizeof(addr), T2A_PVC | T2A_NAME) < 0) { fprintf(stderr,"invalid PVC: %s\n",spec); exit(1); } - if ((fd = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((fd = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); exit(1); } diff -ur --new-file old/atm/debug/endump.c new/atm/debug/endump.c --- old/atm/debug/endump.c Wed Sep 27 16:33:07 1995 +++ new/atm/debug/endump.c Thu Feb 6 19:45:53 1997 @@ -210,7 +210,7 @@ { int i; - printf("VCI 0x%lx\n",(unsigned long) base); + printf("VCI 0x%p\n",base); for (i = 0; i < NR_VCI; i++) if ((base[i*4] >> MID_VCI_MODE_SHIFT) != MID_MODE_TRASH) { printf("VCI %d\n",i); @@ -223,7 +223,7 @@ { int i; - printf("RX DMA 0x%lx\n",(unsigned long) base); + printf("RX DMA 0x%p\n",base); for (i = 0; i < NR_DMA_RX; i++) { printf("RX DMA %d\n",i); process(base+i*2,rx_dma); @@ -235,7 +235,7 @@ { int i; - printf("TX DMA 0x%lx\n",(unsigned long) base); + printf("TX DMA 0x%p\n",base); for (i = 0; i < NR_DMA_TX; i++) { printf("TX DMA %d\n",i); process(base+i*2,tx_dma); @@ -245,7 +245,7 @@ static void dump_service(unsigned long *base) { - printf("SERV 0x%lx\n",(unsigned long) base); + printf("SERV 0x%p\n",base); } diff -ur --new-file old/atm/doc/usage.tex new/atm/doc/usage.tex --- old/atm/doc/usage.tex Wed Jan 29 22:11:08 1997 +++ new/atm/doc/usage.tex Mon Mar 10 16:40:31 1997 @@ -38,14 +38,14 @@ \title{ATM on Linux \\ User's guide \\ - Release 0.26 (pre-alpha)} + Release 0.27 (pre-alpha)} \author{Werner Almesberger \\ {\tt werner.almesberger@lrc.di.epfl.ch} \\ \\ Laboratoire de R\'eseaux de Communication (LRC) \\ EPFL, CH-1015 Lausanne, Switzerland} -\date{December 20, 1996} +\date{March 10, 1997} \begin{document} \maketitle @@ -644,7 +644,7 @@ The ILMI demon is started as follows: \begin{command} -\# ilmid \[-b\] \[-d\] \[-l \meta{logfile}\] \[-x\] \[\meta{itf}\] +\# ilmid \[-b\] \[-d\] \[-l \meta{logfile}\] \[-v\] \[-x\] \[\meta{itf}\] \end{command} \begin{description} @@ -656,6 +656,7 @@ used to send diagnostics to the system logger. \item[\raw{-q \meta{qos}}] configures the ILMI VC to use the specified quality of service. By default, UBR at link speed is used on the ILMI VC. + \item[\raw{-v}] enables extensive debugging output. \item[\raw{-x}] disable inclusion of variable bindings in the ColdstartTrap. Some switches (e.g. the LS100) only work if this option is set. diff -ur --new-file old/atm/doc/usage.txt new/atm/doc/usage.txt --- old/atm/doc/usage.txt Wed Jan 29 22:19:00 1997 +++ new/atm/doc/usage.txt Tue Mar 11 23:23:36 1997 @@ -530,7 +530,7 @@ The ILMI demon is started as follows: - # ilmid [-b] [-d] [-l ] [-x] [] + # ilmid [-b] [-d] [-l ] [-v] [-x] [] -b background. Run in a forked child process after initializing. -d enables debugging output. By default, ilmid is very quiet. @@ -539,6 +539,7 @@ diagnostics to the system logger. -q configures the ILMI VC to use the specified quality of service. By default, UBR at link speed is used on the ILMI VC. + -v enables extensive debugging output. -x disable inclusion of variable bindings in the ColdstartTrap. Some switches (e.g. the LS100) only work if this option is set. diff -ur --new-file old/atm/ilmid/Makefile new/atm/ilmid/Makefile --- old/atm/ilmid/Makefile Fri Sep 6 16:22:19 1996 +++ new/atm/ilmid/Makefile Fri Jan 31 22:04:17 1997 @@ -1,7 +1,4 @@ -CC = cc -CFLAGS = -O LIBS = -L../lib -latmd -latm -Lasn1 -lasn1 -DEFINES = -DVERSION=\"`cat ../VERSION`\" INCLUDES = -I../lib -Iasn1 SRCS = rfc1157_snmp.c rfc1155_smi.c util.c io.c message.c \ netprefix.c mib.c ilmid.c @@ -9,15 +6,12 @@ BOOTPGMS=ilmid include ../Rules.make -CFLAGS=$(CFLAGS_NOWARN) $(CFLAGS_OPT) $(CFLAGS_PRIVATE) +CFLAGS = $(CFLAGS_NOWARN) $(CFLAGS_OPT) $(CFLAGS_PRIVATE) default: all all: ilmid -.c.o: - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -c $< - asn1/libasn1.a: @cd asn1; make diff -ur --new-file old/atm/ilmid/README new/atm/ilmid/README --- old/atm/ilmid/README Wed Feb 7 20:51:51 1996 +++ new/atm/ilmid/README Thu Jan 1 01:00:00 1970 @@ -1,58 +0,0 @@ -ILMI for ATM on Linux 0.7 by Scott W. Shumate (shumate@tisl.ukans.edu) ----------------------------------------------------------------------- -This distribution contains the ILMI agent for the ATM on Linux effort. -The agent supports only the address registration procedures specified -in section 5.8 of the ATM Forum's UNI 3.1 specification. These -procedures involve the switch registering the network prefix on the -host and the host registering the final ATM address back on the -switch. The host accomplishes this by appending an ESI (End System -Identifier) and a null selector byte to the network prefix registered -by the switch. The ESI is the physical or MAC address of the ATM -interface. - -None of the other MIB objects in the ILMI specification are currently -supported. Additional MIB objects may be added at a later date. - -The agent was tested with several different switches: the Fore -ASX-200BX, the UB Networks GeoSwitch, and the Digital GIGAswitch. In -all cases, an ATM address was successfully registered with the switch -and configured with the atmarp daemon. - -Availability ------------- -The ILMI agent is released as free software under the copyright -restrictions given in the file COPYRIGHT and the code. The ILMI agent -is available via anonymous ftp at: - - tisl.ukans.edu in /pub/software/ilmid - -A HTML version of this document is available at: - - http://www.tisl.ukans.edu/~shumate/ilmi.html - -Usage: ------- -The ILMI agent takes one optional parameter on the command line, the -number of the interface for ilmid to serve. If no interface is -specified, interface 0 is used. - - ilmid [-b] [-d] - -The two optional switches are -b, background the daemon, and -d, debug -mode. The agent registers the host's ATM address with the switch and -configures the atmarp daemon with that address. There is no way to -dynamically configure the ARP server's ATM address. This is a fault -with the standards, not the agent. - -To configure a host with UNI signaling and RFC 1577 support, use the -following commands: - - atmsigd -b - ilmid -b - atmarpd -b - atmarp -c atm0 - ifconfig atm0 - route add -net - atmarp -s arpsrv - - diff -ur --new-file old/atm/ilmid/ilmid.c new/atm/ilmid/ilmid.c --- old/atm/ilmid/ilmid.c Wed Jan 29 20:58:34 1997 +++ new/atm/ilmid/ilmid.c Mon Feb 3 20:15:45 1997 @@ -32,9 +32,19 @@ * and we would like to express our thanks. */ +/* Change Log: + * 1-30-97 Added VERIFY state to allow resending of GetNext + * PDUs after a ColdStart. This addresses a bug that + * some switches have with receiving the GetNext too + * soon after the ColdStart. Also added state IDLE + * for a more configurable poll period. + */ + #include #include #include +#include "asn_incl.h" +#include "rfc1155_smi.h" #include "rfc1157_snmp.h" #include "message.h" #include "util.h" @@ -43,25 +53,28 @@ #include "mib.h" #include "netprefix.h" -#define WAIT_TIMEOUT 5 +#define RESPONSE_TIMEOUT 2 +#define POLL_PERIOD 15 #define COMPONENT "ILMI" -typedef enum IlmiState { NO_CHANGE, RESTART, NET_PREFIX, ADDRESS, POLL } IlmiState; - +typedef enum IlmiState { NO_CHANGE, RESTART, VERIFY, NET_PREFIX, + ADDRESS, POLL, IDLE } IlmiState; +const char *state2text[7] = { "NO_CHANGE", "RESTART", "VERIFY", "NET_PREFIX", + "ADDRESS", "POLL", "IDLE" }; void usage(char *name); void ilmi_loop(int fd, int itf); void usage(char *name) { - fprintf(stderr, "usage: %s [-b] [-d] [-l logfile] [-x] [-q qos] " + fprintf(stderr, "usage: %s [-b] [-d] [-v] [-l logfile] [-x] [-q qos] " "\n", name); exit(1); } void ilmi_loop(int fd, int itf) { - int poll_misses = 0; - long int requestID = 0; + int no_response; + long int requestID; Message *poll_message, *set_message, *coldstart_message, *in_message; AsnOid *set_oid, *netprefix_oid, *esi_oid; VarBind *varbind; @@ -80,34 +93,43 @@ for(;;) { state = new_state; + diag(COMPONENT, DIAG_DEBUG, "entering state %s", state2text[state]); + /* Output for the current state */ switch(state) { case RESTART: deleteNetPrefix(); - diag(COMPONENT, DIAG_DEBUG, "sending cold-start"); - diag(COMPONENT, DIAG_DEBUG, "sending get-next"); - send_message(fd, coldstart_message); - sleep(1); /* @@@@@ HACK */ + diag(COMPONENT, DIAG_INFO, "sending cold-start"); + send_message(fd, coldstart_message); + no_response = 0; + + case VERIFY: + diag(COMPONENT, DIAG_INFO, "sending get-next"); poll_message->data->a.get_next_request->request_id = ++requestID; send_message(fd, poll_message); break; case ADDRESS: - diag(COMPONENT, DIAG_DEBUG, "setting the atm address on the switch"); + diag(COMPONENT, DIAG_INFO, "setting the atm address on the switch"); set_message->data->a.set_request->request_id = ++requestID; send_message(fd, set_message); break; case POLL: - diag(COMPONENT, DIAG_DEBUG, "sending get-next request"); + diag(COMPONENT, DIAG_INFO, "sending get-next request"); poll_message->data->a.get_next_request->request_id = ++requestID; send_message(fd, poll_message); break; } - timeout.tv_sec = WAIT_TIMEOUT; + /* Set the time-out period */ + if(state == IDLE) + timeout.tv_sec = POLL_PERIOD; + else + timeout.tv_sec = RESPONSE_TIMEOUT; timeout.tv_usec = 0; + new_state = NO_CHANGE; /* Input handling loop */ while(new_state == NO_CHANGE) @@ -119,7 +141,7 @@ switch(in_message->data->choiceId) { case PDUS_GET_REQUEST: - diag(COMPONENT, DIAG_DEBUG, "received get request"); + diag(COMPONENT, DIAG_INFO, "received get request"); MIBget(in_message->data->a.get_next_request->variable_bindings, &in_message->data->a.get_next_request->error_status, &in_message->data->a.get_next_request->error_index); @@ -128,7 +150,7 @@ break; case PDUS_GET_NEXT_REQUEST: - diag(COMPONENT, DIAG_DEBUG, "received get-next request"); + diag(COMPONENT, DIAG_INFO, "received get-next request"); MIBgetnext(in_message->data->a.get_next_request->variable_bindings, &in_message->data->a.get_next_request->error_status, &in_message->data->a.get_next_request->error_index); @@ -137,13 +159,14 @@ break; case PDUS_GET_RESPONSE: - diag(COMPONENT, DIAG_DEBUG, "received get response"); + diag(COMPONENT, DIAG_INFO, "received get response"); if(in_message->data->a.get_response->request_id == requestID) { varbind = (VarBind *) FIRST_LIST_ELMT(in_message->data->a.get_response->variable_bindings); switch(state) { case RESTART: + case VERIFY: if(in_message->data->a.get_response->error_status == NOERROR && AsnOidMember(&varbind->name, &atmAddressStatus)) new_state = RESTART; @@ -154,9 +177,9 @@ case ADDRESS: if(in_message->data->a.get_response->error_status == NOERROR) { - diag(COMPONENT, DIAG_INFO, "ATM address registered"); + diag(COMPONENT, DIAG_WARN, "ATM address registered"); update_nsap(itf, netprefix_oid, esi_oid); - poll_misses = 0; + no_response = 0; new_state = POLL; } else @@ -166,7 +189,10 @@ case POLL: if(in_message->data->a.get_response->error_status == NOERROR && AsnOidEqual(&varbind->name, set_oid)) - poll_misses = 0; + { + no_response = 0; + new_state = IDLE; + } else new_state = RESTART; break; @@ -176,7 +202,7 @@ break; case PDUS_SET_REQUEST: - diag(COMPONENT, DIAG_DEBUG, "received set request"); + diag(COMPONENT, DIAG_INFO, "received set request"); MIBset(in_message->data->a.set_request->variable_bindings, &in_message->data->a.set_request->error_status, &in_message->data->a.set_request->error_index); @@ -185,7 +211,7 @@ break; case PDUS_TRAP: - diag(COMPONENT, DIAG_DEBUG, "received trap"); + diag(COMPONENT, DIAG_INFO, "received trap"); if(in_message->data->a.trap->generic_trap == COLDSTART && state != RESTART) new_state = RESTART; @@ -197,8 +223,8 @@ if((state == NET_PREFIX || new_state == NET_PREFIX) && (netprefix_oid = accessNetPrefix()) != NULL) { - diag(COMPONENT, DIAG_DEBUG, "switch registered a network prefix"); - set_oid->octetLen = ADDRESS_LEN + 2; + diag(COMPONENT, DIAG_INFO, "switch registered a network prefix"); + set_oid->octetLen = ADDRESS_LEN + 1; AsnOidAppend(set_oid, netprefix_oid); AsnOidAppend(set_oid, esi_oid); new_state = ADDRESS; @@ -209,26 +235,33 @@ switch(state) { case RESTART: - diag(COMPONENT, DIAG_DEBUG, "switch did not respond to get-next -- resending"); - new_state = RESTART; + case VERIFY: + diag(COMPONENT, DIAG_INFO, "switch did not respond to get-next -- resending"); + if(++no_response == 4) + new_state = RESTART; + else + new_state = VERIFY; break; case NET_PREFIX: - diag(COMPONENT, DIAG_DEBUG, "switch did not register a network prefix -- restarting"); + diag(COMPONENT, DIAG_INFO, "switch did not register a network prefix -- restarting"); new_state = RESTART; break; case ADDRESS: - diag(COMPONENT, DIAG_DEBUG, "switch did not respond to set request -- resending"); + diag(COMPONENT, DIAG_INFO, "switch did not respond to set request -- resending"); new_state = ADDRESS; break; case POLL: - if(++poll_misses == 4) + if(++no_response == 4) { new_state = RESTART; - diag(COMPONENT, DIAG_DEBUG, "switch is not responding"); + diag(COMPONENT, DIAG_INFO, "switch is not responding"); } else - new_state = POLL; + new_state = IDLE; break; + case IDLE: + new_state = POLL; + break; } } } @@ -242,14 +275,17 @@ const char *qos; set_application("ilmid"); - set_verbosity(NULL, DIAG_INFO); + set_verbosity(NULL, DIAG_WARN); qos = NULL; - while((opt = getopt(argc, argv, "bdhl:q:x")) != EOF) + while((opt = getopt(argc, argv, "bdhl:q:xv")) != EOF) switch (opt) { case 'd': - set_verbosity(NULL, DIAG_DEBUG); + set_verbosity(NULL, DIAG_INFO); break; + case 'v': + set_verbosity(NULL, DIAG_DEBUG); + break; case 'b': bg = 1; break; @@ -273,7 +309,7 @@ if(argc != optind) usage(argv[0]); - diag(COMPONENT, DIAG_INFO, "Linux ATM ILMI, version %s", VERSION); + diag(COMPONENT, DIAG_WARN, "Linux ATM ILMI, version %s", VERSION); if(bg) { diff -ur --new-file old/atm/ilmid/io.c new/atm/ilmid/io.c --- old/atm/ilmid/io.c Wed Oct 16 16:35:40 1996 +++ new/atm/ilmid/io.c Tue Mar 11 11:54:52 1997 @@ -128,7 +128,7 @@ n = 0; if (req.length && atm_equal(&addr, &ouraddr[0], ATM_ESA_LEN, 0)) { - diag(COMPONENT, DIAG_INFO, "Primary ATM Address did not change"); + diag(COMPONENT, DIAG_WARN, "Primary ATM Address did not change"); n = 1; } @@ -149,7 +149,7 @@ atm2text(buffer,MAX_ATM_ADDR_LEN+1,(struct sockaddr *) &addr, A2T_PRETTY); - diag(COMPONENT, DIAG_INFO, "Primary ATM Address %s added local", buffer); + diag(COMPONENT, DIAG_WARN, "Primary ATM Address %s added local", buffer); for (n = 0; n < m/sizeof(addr); n++) { @@ -164,7 +164,7 @@ if (ioctl(fd, ATM_ADDADDR, &req) < 0) diag(COMPONENT, DIAG_ERROR, "ioctl ATM_ADDADDR: %s", strerror(errno)); else - diag(COMPONENT, DIAG_INFO, "Extra ATM Address %s added local", buffer); + diag(COMPONENT, DIAG_WARN, "Extra ATM Address %s added local", buffer); } } @@ -207,6 +207,10 @@ diag(COMPONENT, DIAG_ERROR, "message decoding error"); return -1; } + + diag(COMPONENT, DIAG_DEBUG, "SNMP message received:"); + if(get_verbosity(NULL) == DIAG_DEBUG) + PrintMessage(get_logfile(), message, 0); if(message->version != VERSION_1) { @@ -235,12 +239,16 @@ if(!(length = BEncMessage(&buffer, message))) { - diag(COMPONENT, DIAG_ERROR, "message encoding error\n"); + diag(COMPONENT, DIAG_ERROR, "message encoding error"); return -1; } - + if(write(fd, SBufDataPtr(&buffer), length) != length) diag(COMPONENT, DIAG_FATAL, "write: %s", strerror(errno)); + + diag(COMPONENT, DIAG_DEBUG, "SNMP message sent:"); + if(get_verbosity(NULL) == DIAG_DEBUG) + PrintMessage(get_logfile(), message, 0); return 0; } @@ -252,12 +260,13 @@ struct atm_qos qos; int fd; - if((fd = socket(PF_ATMPVC, SOCK_DGRAM, ATM_AAL5)) < 0) + if((fd = socket(PF_ATMPVC, SOCK_DGRAM, 0)) < 0) diag(COMPONENT, DIAG_FATAL, "socket: %s", strerror(errno)); memset(&qos, 0, sizeof(qos)); qos.rxtp.max_sdu = MAX_ILMI_MSG; qos.txtp.max_sdu = MAX_ILMI_MSG; + qos.aal = ATM_AAL5; if (!qos_spec) qos.rxtp.traffic_class = qos.txtp.traffic_class = ATM_UBR; else if (text2qos(qos_spec,&qos,T2Q_DEFAULTS) < 0) diag(COMPONENT,DIAG_FATAL,"invalid qos: %s",qos_spec); diff -ur --new-file old/atm/ilmid/io.h new/atm/ilmid/io.h --- old/atm/ilmid/io.h Wed Oct 16 16:21:27 1996 +++ new/atm/ilmid/io.h Fri Jan 31 20:44:41 1997 @@ -36,6 +36,8 @@ #define IO_H #include +#include "asn_incl.h" +#include "rfc1155_smi.h" #include "rfc1157_snmp.h" #define MAX_ILMI_MSG 484 diff -ur --new-file old/atm/ilmid/message.c new/atm/ilmid/message.c --- old/atm/ilmid/message.c Fri Jun 21 13:33:50 1996 +++ new/atm/ilmid/message.c Mon Feb 3 20:14:34 1997 @@ -58,10 +58,9 @@ AsnListInit(poll_message->data->a.get_next_request->variable_bindings, sizeof(VarBind)); entry = AppendVarBind(poll_message->data->a.get_next_request->variable_bindings); - entry->name.octs = alloc(ADDRESS_LEN + 1); - entry->name.octetLen = ADDRESS_LEN + 1; + entry->name.octs = alloc(ADDRESS_LEN); + entry->name.octetLen = ADDRESS_LEN; memcpy(entry->name.octs, ADDRESS_OID, ADDRESS_LEN); - entry->name.octs[ADDRESS_LEN] = '\0'; entry->value = alloc_t(ObjectSyntax); entry->value->choiceId = OBJECTSYNTAX_SIMPLE; entry->value->a.simple = alloc_t(SimpleSyntax); @@ -90,11 +89,10 @@ AsnListInit(set_message->data->a.set_request->variable_bindings, sizeof(VarBind)); entry = AppendVarBind(set_message->data->a.set_request->variable_bindings); /* Allocate enough memory to hold the largest possible address */ - entry->name.octs = alloc(ADDRESS_LEN + 42); - entry->name.octetLen = ADDRESS_LEN + 2; + entry->name.octs = alloc(ADDRESS_LEN + 41); + entry->name.octetLen = ADDRESS_LEN + 1; memcpy(entry->name.octs, ADDRESS_OID, ADDRESS_LEN); - entry->name.octs[ADDRESS_LEN] = '\0'; /* Local UNI */ - entry->name.octs[ADDRESS_LEN + 1] = '\24'; /* 20 octet address */ + entry->name.octs[ADDRESS_LEN] = '\24'; /* 20 octet address */ entry->value = alloc_t(ObjectSyntax); entry->value->choiceId = OBJECTSYNTAX_SIMPLE; entry->value->a.simple = alloc_t(SimpleSyntax); diff -ur --new-file old/atm/ilmid/message.h new/atm/ilmid/message.h --- old/atm/ilmid/message.h Fri Jun 21 13:26:19 1996 +++ new/atm/ilmid/message.h Mon Feb 3 20:10:13 1997 @@ -35,10 +35,12 @@ #ifndef MESSAGE_H #define MESSAGE_H +#include "asn_incl.h" +#include "rfc1155_smi.h" #include "rfc1157_snmp.h" -#define ADDRESS_LEN 12 -#define ADDRESS_OID "\53\06\01\04\01\202\141\02\06\01\01\03" +#define ADDRESS_LEN 13 +#define ADDRESS_OID "\53\06\01\04\01\202\141\02\06\01\01\03\0" extern int no_var_bindings; diff -ur --new-file old/atm/ilmid/mib.h new/atm/ilmid/mib.h --- old/atm/ilmid/mib.h Thu Nov 30 23:19:29 1995 +++ new/atm/ilmid/mib.h Fri Jan 31 20:47:21 1997 @@ -35,6 +35,8 @@ #ifndef MIB_H #define MIB_H +#include "asn_incl.h" +#include "rfc1155_smi.h" #include "rfc1157_snmp.h" typedef struct Variable diff -ur --new-file old/atm/ilmid/netprefix.h new/atm/ilmid/netprefix.h --- old/atm/ilmid/netprefix.h Fri Dec 1 00:04:03 1995 +++ new/atm/ilmid/netprefix.h Fri Jan 31 20:46:50 1997 @@ -35,6 +35,8 @@ #ifndef ACCESS_H #define ACCESS_H +#include "asn_incl.h" +#include "rfc1155_smi.h" #include "rfc1157_snmp.h" #include "mib.h" diff -ur --new-file old/atm/ilmid/rfc1155_smi.c new/atm/ilmid/rfc1155_smi.c --- old/atm/ilmid/rfc1155_smi.c Wed Nov 29 21:05:15 1995 +++ new/atm/ilmid/rfc1155_smi.c Fri Jan 31 20:50:05 1997 @@ -3,7 +3,7 @@ * * "RFC1155-SMI" ASN.1 module encode/decode/print/free C src. * - * This file was generated by snacc on Fri Nov 24 17:10:09 1995 + * This file was generated by snacc on Fri Jan 31 14:49:02 1997 * * UBC snacc written by Mike Sample * @@ -135,6 +135,37 @@ (*bytesDecoded) += totalElmtsLen1; } /* BDecSimpleSyntaxContent */ +void +PrintSimpleSyntax PARAMS((f, v, indent), +FILE* f _AND_ +SimpleSyntax* v _AND_ +unsigned short int indent) +{ + switch(v->choiceId) + { + case(SIMPLESYNTAX_NUMBER): + fprintf(f,"number "); + PrintAsnInt(f, (&v->a.number), indent + stdIndentG); + break; + + case(SIMPLESYNTAX_STRING): + fprintf(f,"string "); + PrintAsnOcts(f, (v->a.string), indent + stdIndentG); + break; + + case(SIMPLESYNTAX_OBJECT): + fprintf(f,"object "); + PrintAsnOid(f, (v->a.object), indent + stdIndentG); + break; + + case(SIMPLESYNTAX_EMPTY): + fprintf(f,"empty "); + PrintAsnNull(f, (&v->a.empty), indent + stdIndentG); + break; + + } +} /* PrintSimpleSyntax */ + @@ -198,6 +229,22 @@ (*bytesDecoded) += totalElmtsLen1; } /* BDecNetworkAddressContent */ +void +PrintNetworkAddress PARAMS((f, v, indent), +FILE* f _AND_ +NetworkAddress* v _AND_ +unsigned short int indent) +{ + switch(v->choiceId) + { + case(NETWORKADDRESS_INTERNET): + fprintf(f,"internet "); + PrintIpAddress(f, (v->a.internet), indent + stdIndentG); + break; + + } +} /* PrintNetworkAddress */ + @@ -324,6 +371,42 @@ (*bytesDecoded) += totalElmtsLen1; } /* BDecApplicationSyntaxContent */ +void +PrintApplicationSyntax PARAMS((f, v, indent), +FILE* f _AND_ +ApplicationSyntax* v _AND_ +unsigned short int indent) +{ + switch(v->choiceId) + { + case(APPLICATIONSYNTAX_ADDRESS): + fprintf(f,"address "); + PrintNetworkAddress(f, (v->a.address), indent + stdIndentG); + break; + + case(APPLICATIONSYNTAX_COUNTER): + fprintf(f,"counter "); + PrintCounter(f, (&v->a.counter), indent + stdIndentG); + break; + + case(APPLICATIONSYNTAX_GAUGE): + fprintf(f,"gauge "); + PrintGauge(f, (&v->a.gauge), indent + stdIndentG); + break; + + case(APPLICATIONSYNTAX_TICKS): + fprintf(f,"ticks "); + PrintTimeTicks(f, (&v->a.ticks), indent + stdIndentG); + break; + + case(APPLICATIONSYNTAX_ARBITRARY): + fprintf(f,"arbitrary "); + PrintOpaque(f, (v->a.arbitrary), indent + stdIndentG); + break; + + } +} /* PrintApplicationSyntax */ + @@ -410,6 +493,27 @@ } /* end switch */ (*bytesDecoded) += totalElmtsLen1; } /* BDecObjectSyntaxContent */ + +void +PrintObjectSyntax PARAMS((f, v, indent), +FILE* f _AND_ +ObjectSyntax* v _AND_ +unsigned short int indent) +{ + switch(v->choiceId) + { + case(OBJECTSYNTAX_SIMPLE): + fprintf(f,"simple "); + PrintSimpleSyntax(f, (v->a.simple), indent + stdIndentG); + break; + + case(OBJECTSYNTAX_APPLICATION_WIDE): + fprintf(f,"application-wide "); + PrintApplicationSyntax(f, (v->a.application_wide), indent + stdIndentG); + break; + + } +} /* PrintObjectSyntax */ diff -ur --new-file old/atm/ilmid/rfc1155_smi.h new/atm/ilmid/rfc1155_smi.h --- old/atm/ilmid/rfc1155_smi.h Wed Nov 29 21:05:16 1995 +++ new/atm/ilmid/rfc1155_smi.h Fri Jan 31 20:50:05 1997 @@ -3,7 +3,7 @@ * * "RFC1155-SMI" ASN.1 module C type definitions and prototypes * - * This .h file was by snacc on Fri Nov 24 17:10:09 1995 + * This .h file was by snacc on Fri Jan 31 14:49:02 1997 * * UBC snacc written compiler by Mike Sample * @@ -23,6 +23,8 @@ #define BDecObjectNameContent BDecAsnOidContent +#define PrintObjectName PrintAsnOid + @@ -32,33 +34,41 @@ #define BDecIpAddressContent BDecAsnOctsContent +#define PrintIpAddress PrintAsnOcts + -typedef AsnInt Counter; /* [APPLICATION 1] IMPLICIT INTEGER (0..-1) */ +typedef AsnInt Counter; /* [APPLICATION 1] IMPLICIT INTEGER (0..2147483647) */ #define BEncCounterContent BEncAsnIntContent #define BDecCounterContent BDecAsnIntContent +#define PrintCounter PrintAsnInt + -typedef AsnInt Gauge; /* [APPLICATION 2] IMPLICIT INTEGER (0..-1) */ +typedef AsnInt Gauge; /* [APPLICATION 2] IMPLICIT INTEGER (0..2147483647) */ #define BEncGaugeContent BEncAsnIntContent #define BDecGaugeContent BDecAsnIntContent +#define PrintGauge PrintAsnInt -typedef AsnInt TimeTicks; /* [APPLICATION 3] IMPLICIT INTEGER (0..-1) */ + +typedef AsnInt TimeTicks; /* [APPLICATION 3] IMPLICIT INTEGER (0..2147483647) */ #define BEncTimeTicksContent BEncAsnIntContent #define BDecTimeTicksContent BDecAsnIntContent +#define PrintTimeTicks PrintAsnInt + @@ -68,6 +78,8 @@ #define BDecOpaqueContent BDecAsnOctsContent +#define PrintOpaque PrintAsnOcts + @@ -94,6 +106,7 @@ void BDecSimpleSyntaxContent PROTO(( BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, SimpleSyntax* v, AsnLen* bytesDecoded, ENV_TYPE env)); +void PrintSimpleSyntax PROTO((FILE* f, SimpleSyntax* v, unsigned short int indent)); @@ -114,6 +127,7 @@ void BDecNetworkAddressContent PROTO(( BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, NetworkAddress* v, AsnLen* bytesDecoded, ENV_TYPE env)); +void PrintNetworkAddress PROTO((FILE* f, NetworkAddress* v, unsigned short int indent)); @@ -142,6 +156,7 @@ void BDecApplicationSyntaxContent PROTO(( BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, ApplicationSyntax* v, AsnLen* bytesDecoded, ENV_TYPE env)); +void PrintApplicationSyntax PROTO((FILE* f, ApplicationSyntax* v, unsigned short int indent)); @@ -164,6 +179,7 @@ void BDecObjectSyntaxContent PROTO(( BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, ObjectSyntax* v, AsnLen* bytesDecoded, ENV_TYPE env)); +void PrintObjectSyntax PROTO((FILE* f, ObjectSyntax* v, unsigned short int indent)); diff -ur --new-file old/atm/ilmid/rfc1157_snmp.c new/atm/ilmid/rfc1157_snmp.c --- old/atm/ilmid/rfc1157_snmp.c Wed Nov 29 21:05:18 1995 +++ new/atm/ilmid/rfc1157_snmp.c Fri Jan 31 22:24:15 1997 @@ -3,7 +3,7 @@ * * "RFC1157-SNMP" ASN.1 module encode/decode/print/free C src. * - * This file was generated by snacc on Fri Nov 24 17:10:09 1995 + * This file was generated by snacc on Fri Jan 31 14:49:02 1997 * * UBC snacc written by Mike Sample * @@ -105,6 +105,29 @@ (*bytesDecoded) += totalElmtsLen1; } /* BDecVarBindContent */ +void +PrintVarBind PARAMS((f, v, indent), +FILE* f _AND_ +VarBind* v _AND_ +unsigned short int indent) +{ + if (v == NULL) + return; + + fprintf(f,"{ -- SEQUENCE --\n"); + + Indent(f, indent + stdIndentG); + fprintf(f,"name "); + PrintObjectName(f, (&v->name), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"value "); + PrintObjectSyntax(f, (v->value), indent + stdIndentG); + fprintf(f,"\n"); + Indent(f, indent); + fprintf(f,"}"); +} /* PrintVarBind */ + @@ -176,6 +199,28 @@ (*bytesDecoded) += totalElmtsLen1; } /* BDecVarBindListContent */ +void +PrintVarBindList PARAMS((f, v, indent), +FILE* f _AND_ +VarBindList* v _AND_ +unsigned short int indent) +{ + VarBind* tmp; + if (v == NULL) + return; + fprintf(f,"{ -- SEQUENCE OF -- \n"); + FOR_EACH_LIST_ELMT(tmp, v) + { + Indent(f, indent+ stdIndentG); + PrintVarBind(f, tmp, indent + stdIndentG); + if (tmp != (VarBind*)LAST_LIST_ELMT(v)) + fprintf(f,",\n"); + } + fprintf(f,"\n"); + Indent(f, indent); + fprintf(f,"}"); +} /* PrintVarBindList */ + @@ -291,6 +336,37 @@ (*bytesDecoded) += totalElmtsLen1; } /* BDecPDUContent */ +void +PrintPDU PARAMS((f, v, indent), +FILE* f _AND_ +PDU* v _AND_ +unsigned short int indent) +{ + if (v == NULL) + return; + + fprintf(f,"{ -- SEQUENCE --\n"); + + Indent(f, indent + stdIndentG); + fprintf(f,"request-id "); + PrintAsnInt(f, (&v->request_id), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"error-status "); + PrintPDUInt(f, (&v->error_status), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"error-index "); + PrintAsnInt(f, (&v->error_index), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"variable-bindings "); + PrintVarBindList(f, (v->variable_bindings), indent + stdIndentG); + fprintf(f,"\n"); + Indent(f, indent); + fprintf(f,"}"); +} /* PrintPDU */ + @@ -442,6 +518,45 @@ (*bytesDecoded) += totalElmtsLen1; } /* BDecTrap_PDUContent */ +void +PrintTrap_PDU PARAMS((f, v, indent), +FILE* f _AND_ +Trap_PDU* v _AND_ +unsigned short int indent) +{ + if (v == NULL) + return; + + fprintf(f,"{ -- SEQUENCE --\n"); + + Indent(f, indent + stdIndentG); + fprintf(f,"enterprise "); + PrintAsnOid(f, (&v->enterprise), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"agent-addr "); + PrintNetworkAddress(f, (v->agent_addr), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"generic-trap "); + PrintTrap_PDUInt(f, (&v->generic_trap), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"specific-trap "); + PrintAsnInt(f, (&v->specific_trap), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"time-stamp "); + PrintTimeTicks(f, (&v->time_stamp), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"variable-bindings "); + PrintVarBindList(f, (v->variable_bindings), indent + stdIndentG); + fprintf(f,"\n"); + Indent(f, indent); + fprintf(f,"}"); +} /* PrintTrap_PDU */ + @@ -573,6 +688,42 @@ (*bytesDecoded) += totalElmtsLen1; } /* BDecPDUsContent */ +void +PrintPDUs PARAMS((f, v, indent), +FILE* f _AND_ +PDUs* v _AND_ +unsigned short int indent) +{ + switch(v->choiceId) + { + case(PDUS_GET_REQUEST): + fprintf(f,"get-request "); + PrintGetRequest_PDU(f, (v->a.get_request), indent + stdIndentG); + break; + + case(PDUS_GET_NEXT_REQUEST): + fprintf(f,"get-next-request "); + PrintGetNextRequest_PDU(f, (v->a.get_next_request), indent + stdIndentG); + break; + + case(PDUS_GET_RESPONSE): + fprintf(f,"get-response "); + PrintGetResponse_PDU(f, (v->a.get_response), indent + stdIndentG); + break; + + case(PDUS_SET_REQUEST): + fprintf(f,"set-request "); + PrintSetRequest_PDU(f, (v->a.set_request), indent + stdIndentG); + break; + + case(PDUS_TRAP): + fprintf(f,"trap "); + PrintTrap_PDU(f, (v->a.trap), indent + stdIndentG); + break; + + } +} /* PrintPDUs */ + @@ -705,6 +856,33 @@ (*bytesDecoded) += totalElmtsLen1; } /* BDecMessageContent */ + +void +PrintMessage PARAMS((f, v, indent), +FILE* f _AND_ +Message* v _AND_ +unsigned short int indent) +{ + if (v == NULL) + return; + + fprintf(f,"{ -- SEQUENCE --\n"); + + Indent(f, indent + stdIndentG); + fprintf(f,"version "); + PrintMessageInt(f, (&v->version), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"community "); + PrintAsnOcts(f, (&v->community), indent + stdIndentG); + fprintf(f, ",\n"); + Indent(f, indent + stdIndentG); + fprintf(f,"data "); + PrintPDUs(f, (v->data), indent + stdIndentG); + fprintf(f,"\n"); + Indent(f, indent); + fprintf(f,"}\n"); +} /* PrintMessage */ diff -ur --new-file old/atm/ilmid/rfc1157_snmp.h new/atm/ilmid/rfc1157_snmp.h --- old/atm/ilmid/rfc1157_snmp.h Wed Nov 29 21:05:18 1995 +++ new/atm/ilmid/rfc1157_snmp.h Fri Jan 31 20:50:05 1997 @@ -3,7 +3,7 @@ * * "RFC1157-SNMP" ASN.1 module C type definitions and prototypes * - * This .h file was by snacc on Fri Nov 24 17:10:09 1995 + * This .h file was by snacc on Fri Jan 31 14:49:02 1997 * * UBC snacc written compiler by Mike Sample * @@ -14,8 +14,8 @@ #ifndef _rfc1157_snmp_h_ #define _rfc1157_snmp_h_ -#include "asn_incl.h" -#include "rfc1155_smi.h" + + #define COLDSTART 0 @@ -32,6 +32,8 @@ #define BDecTrap_PDUIntContent BDecAsnIntContent +#define PrintTrap_PDUInt PrintAsnInt + @@ -49,6 +51,8 @@ #define BDecPDUIntContent BDecAsnIntContent +#define PrintPDUInt PrintAsnInt + @@ -61,6 +65,8 @@ #define BDecMessageIntContent BDecAsnIntContent +#define PrintMessageInt PrintAsnInt + @@ -75,6 +81,7 @@ void BDecVarBindContent PROTO(( BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, VarBind* v, AsnLen* bytesDecoded, ENV_TYPE env)); +void PrintVarBind PROTO((FILE* f, VarBind* v, unsigned short int indent)); @@ -85,6 +92,7 @@ void BDecVarBindListContent PROTO(( BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, VarBindList* v, AsnLen* bytesDecoded, ENV_TYPE env)); +void PrintVarBindList PROTO((FILE* f, VarBindList* v, unsigned short int indent)); @@ -101,6 +109,7 @@ void BDecPDUContent PROTO(( BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, PDU* v, AsnLen* bytesDecoded, ENV_TYPE env)); +void PrintPDU PROTO((FILE* f, PDU* v, unsigned short int indent)); @@ -119,6 +128,7 @@ void BDecTrap_PDUContent PROTO(( BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, Trap_PDU* v, AsnLen* bytesDecoded, ENV_TYPE env)); +void PrintTrap_PDU PROTO((FILE* f, Trap_PDU* v, unsigned short int indent)); @@ -128,6 +138,8 @@ #define BDecGetRequest_PDUContent BDecPDUContent +#define PrintGetRequest_PDU PrintPDU + @@ -137,6 +149,8 @@ #define BDecGetNextRequest_PDUContent BDecPDUContent +#define PrintGetNextRequest_PDU PrintPDU + @@ -146,6 +160,8 @@ #define BDecGetResponse_PDUContent BDecPDUContent +#define PrintGetResponse_PDU PrintPDU + @@ -155,6 +171,8 @@ #define BDecSetRequest_PDUContent BDecPDUContent +#define PrintSetRequest_PDU PrintPDU + @@ -183,6 +201,7 @@ void BDecPDUsContent PROTO(( BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, PDUs* v, AsnLen* bytesDecoded, ENV_TYPE env)); +void PrintPDUs PROTO((FILE* f, PDUs* v, unsigned short int indent)); @@ -201,6 +220,7 @@ void BDecMessageContent PROTO(( BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, Message* v, AsnLen* bytesDecoded, ENV_TYPE env)); +void PrintMessage PROTO((FILE* f, Message* v, unsigned short int indent)); diff -ur --new-file old/atm/ilmid/util.h new/atm/ilmid/util.h --- old/atm/ilmid/util.h Thu Nov 30 23:17:51 1995 +++ new/atm/ilmid/util.h Fri Jan 31 20:44:07 1997 @@ -35,6 +35,8 @@ #ifndef UTIL_H #define UTIL_H +#include "asn_incl.h" +#include "rfc1155_smi.h" #include "rfc1157_snmp.h" #include "atmd.h" diff -ur --new-file old/atm/ip/atmarp.c new/atm/ip/atmarp.c --- old/atm/ip/atmarp.c Thu Oct 10 23:20:43 1996 +++ new/atm/ip/atmarp.c Tue Mar 11 12:08:13 1997 @@ -1,6 +1,6 @@ /* atmarp.c - RFC1577 ATMARP control */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -58,7 +58,7 @@ fprintf(stderr,"%6s %s -c [[atm]N]\n","",name); fprintf(stderr,"%6s %s -q ip_addr qos_spec\n","",name); fprintf(stderr,"%6s %s -s ip_addr [itf.]vpi.vci [pcr value] [qos spec] " - "[temp] [pub] [null]\n","",name); + "[temp] [pub]\n%8s [null]\n","",name,""); fprintf(stderr,"%6s %s -s ip_addr atm_addr [pcr value] [qos spec] [temp] " "[pub] [arpsrv]\n","",name); fprintf(stderr,"%6s %s -d ip_addr [arpsrv]\n","",name); @@ -189,6 +189,7 @@ if (optind+2 < argc || strcmp(argv[optind+1],"arpsrv")) usage(argv[0]); req.arp_flags |= ATF_ARPSRV; } + if (!req.arp_qos.aal) req.arp_qos.aal = ATM_AAL5; if ((s = socket(AF_INET,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; diff -ur --new-file old/atm/ip/clip.c new/atm/ip/clip.c --- old/atm/ip/clip.c Thu Sep 26 16:35:16 1996 +++ new/atm/ip/clip.c Tue Mar 11 11:55:38 1997 @@ -1,6 +1,6 @@ /* clip.c - CLassical IP over ATM control (to be replaced by ATMARP) */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -40,7 +40,7 @@ argv++; } if (argc != 2 && argc != 3) usage(name); - if ((s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; } @@ -48,6 +48,7 @@ if (text2atm(argv[1],(struct sockaddr *) &addr,sizeof(addr),T2A_PVC) < 0) usage(argv[0]); memset(&qos,0,sizeof(qos)); + qos.aal = ATM_AAL5; if (argc != 3) qos.txtp.traffic_class = ATM_UBR; else { qos.txtp.traffic_class = ATM_CBR; diff -ur --new-file old/atm/lane/atm.c new/atm/lane/atm.c --- old/atm/lane/atm.c Tue Oct 1 17:26:18 1996 +++ new/atm/lane/atm.c Tue Mar 11 11:56:38 1997 @@ -69,7 +69,7 @@ int fd, ret; int len = sizeof(server); - fd = socket(PF_ATMSVC, SOCK_DGRAM, ATM_AAL5); + fd = socket(PF_ATMSVC, SOCK_DGRAM, 0); if (fd <0) { dump_error(&atm_unit,"socket"); return -1; @@ -81,6 +81,7 @@ server.sas_family = AF_ATMSVC; memcpy(server.sas_addr.prv, our_addr, ATM_ESA_LEN); server.sas_addr.blli = &blli; + qos.aal = ATM_AAL5; qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = 1516; qos.rxtp.traffic_class = ATM_UBR; @@ -125,13 +126,14 @@ int fd, ret; int len = sizeof(address); - fd = socket(PF_ATMSVC, SOCK_DGRAM, ATM_AAL5); + fd = socket(PF_ATMSVC, SOCK_DGRAM, 0); if (fd <0) { dump_error(&atm_unit,"socket"); return -1; } memset(&qos, 0, sizeof(qos)); + qos.aal = ATM_AAL5; qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = 1516; qos.rxtp.traffic_class = ATM_UBR; diff -ur --new-file old/atm/lane/atm_lecs.c new/atm/lane/atm_lecs.c --- old/atm/lane/atm_lecs.c Tue Oct 1 17:26:28 1996 +++ new/atm/lane/atm_lecs.c Tue Mar 11 11:56:55 1997 @@ -29,7 +29,7 @@ int fd, ret; int len = sizeof(server); - fd = socket(PF_ATMSVC, SOCK_DGRAM, ATM_AAL5); + fd = socket(PF_ATMSVC, SOCK_DGRAM, 0); if (fd <0) { perror("socket(PF_ATMSVC, ...)"); return -1; @@ -42,6 +42,7 @@ if (our_addr) memcpy(server.sas_addr.prv, our_addr, ATM_ESA_LEN); server.sas_addr.blli = &blli; + qos.aal = ATM_AAL5; qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = 1516; qos.rxtp.traffic_class = ATM_UBR; diff -ur --new-file old/atm/lib/Makefile new/atm/lib/Makefile --- old/atm/lib/Makefile Tue Jan 14 13:23:25 1997 +++ new/atm/lib/Makefile Tue Mar 11 23:35:40 1997 @@ -10,7 +10,6 @@ PGMS=#test GENLIBS=libatm.a libatmd.a libarequipa.a SYSHDR=atm.h atmd.h atmsap.h arequipa.h -# TRASH=cc.inc keep it around for distribution all: libatm.a libatmd.a libarequipa.a @@ -31,9 +30,3 @@ ans_l.o: ans.o ld -r -o ans_l.o ans.o -L/usr/lib -lresolv - -ans.o: cc.inc - -cc.inc: rtf2cc.pl - perl rtf2cc.pl cc.inc || \ - { rm cc.inc; exit 1; } diff -ur --new-file old/atm/lib/ans.c new/atm/lib/ans.c --- old/atm/lib/ans.c Fri Jan 17 13:44:41 1997 +++ new/atm/lib/ans.c Fri Mar 7 17:19:46 1997 @@ -158,7 +158,7 @@ } -int cc_len(int p0,int p1) +static int cc_len(int p0,int p1) { static char *cc_table = NULL; FILE *file; diff -ur --new-file old/atm/lib/arequipa.c new/atm/lib/arequipa.c --- old/atm/lib/arequipa.c Thu Nov 28 13:16:05 1996 +++ new/atm/lib/arequipa.c Tue Mar 11 11:58:26 1997 @@ -34,6 +34,7 @@ int s; if ((s = socket(addr->sas_family,SOCK_DGRAM,ATM_AAL5)) < 0) return -1; + /* ^_ hack @@@ */ q = *qos; if (!q.txtp.max_sdu) q.txtp.max_sdu = RFC1626_MTU+RFC1483LLC_LEN; if (!q.rxtp.max_sdu) q.rxtp.max_sdu = RFC1626_MTU+RFC1483LLC_LEN; diff -ur --new-file old/atm/lib/atm.h new/atm/lib/atm.h --- old/atm/lib/atm.h Tue Nov 12 21:45:49 1996 +++ new/atm/lib/atm.h Tue Mar 11 12:16:43 1997 @@ -35,7 +35,7 @@ #define MAX_ATM_ADDR_LEN (2*ATM_ESA_LEN+ATM_E164_LEN+5) /* 4 dots, 1 plus */ #define MAX_ATM_NAME_LEN 256 /* wild guess */ -#define MAX_ATM_QOS_LEN 111 /* 4+2*(3+3*(7+9)+2)+1 */ +#define MAX_ATM_QOS_LEN 116 /* 5+4+2*(3+3*(7+9)+2)+1 */ int text2atm(const char *text,struct sockaddr *addr,int length,int flags); diff -ur --new-file old/atm/lib/atmd.h new/atm/lib/atmd.h --- old/atm/lib/atmd.h Thu Sep 26 18:15:18 1996 +++ new/atm/lib/atmd.h Fri Mar 7 17:19:02 1997 @@ -8,10 +8,10 @@ /*--------------------------- Common definitions ----------------------------*/ +#include #include #include - /* doubly linked list primitives */ #define Q_INSERT_HEAD(r,i) ({ (i)->next = r; (i)->prev = NULL; \ @@ -54,7 +54,11 @@ void set_logfile(const char *name); +FILE *get_logfile(void); + void set_verbosity(const char *component,int level); + +int get_verbosity(const char *component); void vdiag(const char *component,int severity,const char *fmt,va_list ap); void diag(const char *component,int severity,const char *fmt,...); diff -ur --new-file old/atm/lib/cc.inc new/atm/lib/cc.inc --- old/atm/lib/cc.inc Fri Jan 10 17:38:34 1997 +++ new/atm/lib/cc.inc Thu Jan 1 01:00:00 1970 @@ -1,3 +0,0 @@ -static const char bits[] = - "001001111101110000010110100000000001100000000110000000111011" - "00101011110000001101"; diff -ur --new-file old/atm/lib/diag.c new/atm/lib/diag.c --- old/atm/lib/diag.c Fri Sep 27 21:57:19 1996 +++ new/atm/lib/diag.c Fri Mar 7 17:19:24 1997 @@ -59,6 +59,19 @@ } +int get_verbosity(const char *component) +{ + COMPONENT *walk; + + if (!component) { + return default_verbosity; + } + for (walk = components; walk; walk = walk->next) + if (!strcmp(walk->name,component)) break; + return walk ? walk->verbosity : default_verbosity; +} + + void set_logfile(const char *name) { if (log_to && log_to != stderr) { @@ -77,6 +90,12 @@ perror(name); log_to = stderr; } +} + + +FILE *get_logfile(void) +{ + return log_to; } diff -ur --new-file old/atm/lib/qos2text.c new/atm/lib/qos2text.c --- old/atm/lib/qos2text.c Wed Oct 9 18:02:20 1996 +++ new/atm/lib/qos2text.c Tue Mar 11 12:52:30 1997 @@ -1,7 +1,7 @@ /* qos2text.c - Converts binary encoding of QOS parameters to textual representation */ -/* Written 1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1996,1997 by Werner Almesberger, EPFL-LRC */ #include @@ -61,20 +61,40 @@ switch (qos->txtp.traffic_class == ATM_NONE ? qos->rxtp.traffic_class : qos->txtp.traffic_class) { case ATM_UBR: - strcat(buffer,"ubr:"); - pos += 4; + strcpy(buffer,"ubr"); + pos += 3; break; case ATM_CBR: - strcat(buffer,"cbr:"); + strcpy(buffer,"cbr"); + pos += 3; + break; + default: + return -1; + } + if (qos->aal != ATM_NO_AAL) { + strcpy(pos,","); + pos++; + } + switch (qos->aal) { + case ATM_NO_AAL: + break; + case ATM_AAL0: + strcpy(pos,"aal0"); + pos += 4; + break; + case ATM_AAL5: + strcpy(pos,"aal5"); pos += 4; break; default: return -1; } + pos++; start = pos; if (qos->txtp.traffic_class != ATM_NONE && qos->rxtp.traffic_class != ATM_NONE) params(buffer,&pos,NULL,&qos->txtp,&qos->rxtp); opt(start == pos ? "tx:" : ",tx:",buffer,&pos,&qos->rxtp,&qos->txtp,NULL); opt(start == pos ? "rx:" : ",rx:",buffer,&pos,&qos->txtp,&qos->rxtp,NULL); + if (pos != start) start[-1] = ':'; return 0; } diff -ur --new-file old/atm/lib/rtf2cc.pl new/atm/lib/rtf2cc.pl --- old/atm/lib/rtf2cc.pl Fri Jan 10 17:14:44 1997 +++ new/atm/lib/rtf2cc.pl Thu Jan 1 01:00:00 1970 @@ -1,35 +0,0 @@ -#!/usr/bin/perl -# -# The E.164 country code listing can be obtained from -# http://www.itu.ch/itudoc/itu-t/lists/tf_cc_e_*.rtf -# -# This program generates the following coding: -# -# 0: this is the last digit -# 1: more digits follow; the next bits describe the ten digits -# -# The hierarchy is limited to two digits (i.e. the bit indicating a third -# digit is present but no bits for further digits are there) - -while (<>) { - next unless - /{\\fs18\\cf1\s(\d+)}{\\f7\\fs24\s\\tab\s}{\\fs18\\cf1\s([^}]+)}/; - $more[$1/10] = 1; -} -$more[0] = 0; # anomaly -for $a (0..9) { - if (!$more[$a]) { $bits .= "0"; } - else { - $bits .= "1"; - for $b (0..9) { - $bits .= sprintf("%d",$more[$a*10+$b]); - } - } -} -print "static const char bits[] =" || die "write: $!"; -while (length($bits)) { - print "\n" || die "write: $!"; - print " \"".substr($bits,0,60)."\"" || die "write: $!"; - $bits = substr($bits,60); -} -print ";\n" || die "write: $!"; diff -ur --new-file old/atm/lib/rtf2e164_cc.pl new/atm/lib/rtf2e164_cc.pl --- old/atm/lib/rtf2e164_cc.pl Thu Jan 1 01:00:00 1970 +++ new/atm/lib/rtf2e164_cc.pl Fri Jan 17 13:33:48 1997 @@ -0,0 +1,18 @@ +#!/usr/bin/perl +# +# The E.164 country code listing can be obtained from +# http://www.itu.ch/itudoc/itu-t/lists/tf_cc_e_*.rtf +# +# Usage of this program: +# perl rtf2e164_cc.pl /etc/e164_cc + +while (<>) { + next unless + /{\\fs18\\cf1\s(\d+)}{\\f7\\fs24\s\\tab\s}{\\fs18\\cf1\s([^}]+)}/; + last if $1 == 999; +} +while (<>) { + next unless + /{\\fs18\\cf1\s(\d+)}{\\f7\\fs24\s\\tab\s}{\\fs18\\cf1\s([^}]+)}/; + printf("%-3d %s\n",$1,$2) || die "printf: $!"; +} diff -ur --new-file old/atm/lib/text2qos.c new/atm/lib/text2qos.c --- old/atm/lib/text2qos.c Mon Nov 11 15:49:51 1996 +++ new/atm/lib/text2qos.c Tue Mar 11 12:54:42 1997 @@ -1,7 +1,7 @@ /* text2qos.c - Converts textual representation of QOS parameters to binary encoding */ -/* Written 1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1996,1997 by Werner Almesberger, EPFL-LRC */ #include @@ -139,11 +139,33 @@ int text2qos(const char *text,struct atm_qos *qos,int flags) { - int traffic_class; + int traffic_class,aal; - if ((traffic_class = fetch(&text,"!none","ubr","cbr",NULL)) < 0) return -1; + traffic_class = ATM_NONE; + aal = ATM_NO_AAL; + do { + static const unsigned char aal_number[] = { ATM_AAL0, ATM_AAL5 }; + int item; + + item = fetch(&text,"!none","ubr","cbr","aal0","aal5",NULL); + switch (item) { + case 1: + case 2: + traffic_class = item; + break; + case 3: + case 4: + aal = aal_number[item-3]; + break; + default: + return -1; + } + } + while (*text == ',' ? text++ : 0); + if (!traffic_class) return -1; if (qos && !(flags & T2Q_DEFAULTS)) memset(qos,0,sizeof(*qos)); if (qos) qos->txtp.traffic_class = qos->rxtp.traffic_class = traffic_class; + if (qos && aal) qos->aal = aal; if (!*text) return 0; if (params(&text,qos ? &qos->txtp : NULL,qos ? &qos->rxtp : NULL)) return -1; diff -ur --new-file old/atm/maint/atmdiag.c new/atm/maint/atmdiag.c --- old/atm/maint/atmdiag.c Fri Jul 19 15:40:54 1996 +++ new/atm/maint/atmdiag.c Tue Mar 11 11:59:04 1997 @@ -61,7 +61,7 @@ argv++; argc--; } - if ((s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; } diff -ur --new-file old/atm/maint/atmdump.c new/atm/maint/atmdump.c --- old/atm/maint/atmdump.c Fri Sep 27 15:00:20 1996 +++ new/atm/maint/atmdump.c Tue Mar 11 12:05:50 1997 @@ -1,6 +1,6 @@ /* atmdump.c - ATM raw cell dumper */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -108,7 +108,7 @@ usage(name); } if (argc != optind+1) usage(name); - if ((s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL0)) < 0) { + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; } @@ -116,6 +116,7 @@ if (text2atm(argv[optind],(struct sockaddr *) &addr,sizeof(addr),T2A_PVC) < 0) usage(name); memset(&qos,0,sizeof(qos)); + qos.aal = ATM_AAL0; if (type == -1) { qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = 52; diff -ur --new-file old/atm/maint/sonetdiag.c new/atm/maint/sonetdiag.c --- old/atm/maint/sonetdiag.c Thu Mar 21 15:43:25 1996 +++ new/atm/maint/sonetdiag.c Tue Mar 11 11:59:27 1997 @@ -1,6 +1,6 @@ /* sonetdiag.c - SONET diagnostics */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -51,7 +51,7 @@ argc--; argv++; } - if ((s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; } diff -ur --new-file old/atm/man/qos.7 new/atm/man/qos.7 --- old/atm/man/qos.7 Fri Oct 18 18:15:29 1996 +++ new/atm/man/qos.7 Tue Mar 11 12:38:01 1997 @@ -1,4 +1,4 @@ -.TH QOS 7 "Oct 18, 1996" "Linux" "Miscellaneous" +.TH QOS 7 "March 11, 1997" "Linux" "Miscellaneous" .SH NAME qos \- Quality of Service specification .SH DESCRIPTION @@ -7,25 +7,35 @@ functions to convert to or from the textual representation of QOS specifications, they expect them in the same format too. .P -The most fundamental parameter is the \fItraffic class\fP. If the +The most fundamental parameters are the \fItraffic class\fP and the +\fIAAL (ATM Adaption Layer) type\fP. If the connection is bi-directional, both directions have the same traffic -class. The traffic class is the first element in a QOS specification -and the only required one. The following traffic classes are -recognized: +class and the same AAL type. The traffic class and the AAL type are the first +elements (in any order) in a QOS specification. The traffic class is the only +required element. If the AAL type is omitted, the application will provide a +default value. The following traffic classes are recognized: .IP \fBubr\fP Unassigned Bit Rate .IP \fBcbr\fP Constant Bit Rate .P -If more parameters are supplied, the traffic class must be followed by -a colon. Traffic parameters can be specified independently for the -transmit and the receive direction. Their parameter lists are prefixed +The following AAL types are recognized: +.IP \fBaal0\fP +("raw ATM") +.IP \fBaal5\fP +.P +If both, the traffic class and the AAL type are specified, they are separated +by a comma. +.P +If more parameters are supplied, the traffic class and AAL type must be +followed by a colon. Traffic parameters can be specified independently for +the transmit and the receive direction. Their parameter lists are prefixed with \fBtx:\fP and \fBrx:\fP, respectively. If both parameter lists are present, the \fBtx:\fP list must precede the \fBrx:\fP list. If a parameter is equal for both directions, it can be placed in a common parameter list (without prefix). The general format is as follows: .P -\fIclass\fB:\fIcommon_list\fP,tx:\fIlist\fB,rx:\fIlist\fP +\fIclass_and_aal\fB:\fIcommon_list\fP,tx:\fIlist\fB,rx:\fIlist\fP .P Each list consists of elements specifying a parameter. Elements can appear in any order and they are separated with commas. The following @@ -73,18 +83,18 @@ .nf .sp ubr - cbr:pcr=64kbps + cbr,aal0:pcr=64kbps CBR:max_pcr=11Mbps,min_pcr=10mbps,sdu=8192 - ubr:tx:none + aal5,ubr:tx:none cbr:tx:pcr=30000,rx:none .sp .fi The following specificiations are equivalent: .nf .sp - CBR:PCR=48Mbps - cbr:max_pcr=125000 - cbr:tx:pcr=125kcps,rx:pcr=125kcps + CBR,AAL5:PCR=48Mbps + cbr,aal5:max_pcr=125000 + cbr,aal5:tx:pcr=125kcps,rx:pcr=125kcps .sp .fi .SH AUTHOR diff -ur --new-file old/atm/mkdist new/atm/mkdist --- old/atm/mkdist Fri Jan 17 15:32:16 1997 +++ new/atm/mkdist Tue Mar 11 23:38:23 1997 @@ -37,7 +37,7 @@ 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/atmarpd.8 \ - atm/ilmid/README atm/ilmid/COPYRIGHT atm/ilmid/Makefile \ + 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 \ atm/ilmid/mib.h atm/ilmid/mib.c atm/ilmid/util.h atm/ilmid/util.c \ @@ -67,12 +67,13 @@ 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/debug/znth.c atm/debug/delay.c \ + atm/debug/aqtest.c \ atm/lib/Makefile atm/lib/atm2text.c atm/lib/atm.h atm/lib/text2atm.c \ atm/lib/atmequal.c atm/lib/sdu2cell.c atm/lib/atmsap.h \ atm/lib/atmd.h atm/lib/common.c atm/lib/diag.c \ atm/lib/timer.c atm/lib/arequipa.h atm/lib/arequipa.c \ atm/lib/text2qos.c atm/lib/qos2text.c atm/lib/qosequal.c \ - atm/lib/atmres.h atm/lib/ans.c atm/lib/rtf2cc.pl atm/lib/cc.inc \ + atm/lib/atmres.h atm/lib/ans.c atm/lib/rtf2e164_cc.pl \ atm/led/USAGE atm/led/COPYRIGHT.DEC atm/led/COPYRIGHT.TUT \ atm/led/lec.h atm/led/lec_arp.h atm/led/lec_ctrl.h atm/led/emask.h \ atm/led/le_disp.h atm/led/g_event.h \ diff -ur --new-file old/atm/sigd/atmsigd.8 new/atm/sigd/atmsigd.8 --- old/atm/sigd/atmsigd.8 Mon Jan 20 13:27:04 1997 +++ new/atm/sigd/atmsigd.8 Mon Mar 10 16:50:06 1997 @@ -1,4 +1,4 @@ -.TH ATMSIGD 8 "Jan 20, 1997" "Linux" "Maintenance Commands" +.TH ATMSIGD 8 "Mar 10, 1997" "Linux" "Maintenance Commands" .SH NAME atmsigd \- ATM signaling demon .SH SYNOPSIS @@ -12,6 +12,7 @@ .RB [ \-N ] .RB [ \-q\ \fIqos\fP ] .RB [ \-t\ \fItrace_length\fP ] +.RB [ [\fIitf\fP.]\fIvpi\fP.\fIvci\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 @@ -21,6 +22,9 @@ 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. +.P +The default signaling VC (interface 0, VPI 0, VCI 5) can be overridden on +the command line by specifying a different PVC address. .P If \fBatmsigd\fP is killed, all system calls requiring interaction with it will return with an error and set \fBerrno\fP to \fBEUNATCH\fP. diff -ur --new-file old/atm/sigd/atmsigd.c new/atm/sigd/atmsigd.c --- old/atm/sigd/atmsigd.c Wed Jan 29 21:08:31 1997 +++ new/atm/sigd/atmsigd.c Tue Feb 25 15:56:53 1997 @@ -201,9 +201,9 @@ if (sockets) fprintf(file,"%s\n\n",banner); for (walk = sockets; walk; walk = walk->next) { - 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); + fprintf(file,"0x%lx: %s, CR 0x%06lX, PVC %d.%d.%d\n",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(file,"local ",walk->local); dump_sap(file,"remote",walk->remote); } @@ -328,7 +328,8 @@ static void usage(const char *name) { fprintf(stderr,"usage: %s [ -b ] [ -c config_file ] [ -d ] [ -D dump_dir ]" - " [ -l logfile ] [ -n ] [ -N ] [ -q qos ] [ -t trace_length ]\n",name); + " [ -l logfile ] [ -n ] [ -N ] [ -q qos ] [ -t trace_length ] " + "[ [itf.]vpi.vci ]\n",name); exit(1); } @@ -404,7 +405,12 @@ default: usage(argv[0]); } - if (optind != argc) usage(argv[0]); + if (optind == argc-1) { + if (text2atm(argv[optind],(struct sockaddr *) &signaling_pvc, + sizeof(signaling_pvc),T2A_PVC) < 0) + diag(COMPONENT,DIAG_FATAL,"text2atm \"%s\": failed",argv[optind]); + } + else if (optind != argc) usage(argv[0]); diag(COMPONENT,DIAG_INFO,"Linux ATM signaling " #ifdef UNI30 "UNI 3.0" diff -ur --new-file old/atm/sigd/io.c new/atm/sigd/io.c --- old/atm/sigd/io.c Thu Oct 10 18:39:15 1996 +++ new/atm/sigd/io.c Tue Mar 11 12:01:03 1997 @@ -1,6 +1,6 @@ /* io.c - I/O operations */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -121,11 +121,12 @@ struct atm_qos qos; int s; - if ((s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return -1; } memset(&qos,0,sizeof(qos)); + qos.aal = ATM_AAL5; qos.rxtp.max_sdu = qos.txtp.max_sdu = MAX_Q_MSG; if (sig_qos) { if (text2qos(sig_qos,&qos,T2Q_DEFAULTS) < 0) { @@ -307,4 +308,47 @@ time out unnecessarily because of scheduling delays */ } } +} + + +/* + * The allocation strategy could be improved as follows: we should try + * vci = prev_vci++ first and only resort to ATM_VCI_ANY if that fails several + * times (and we should actually skip over those which are in use by SVCs. This + * way we avoid using VCIs that just became available. Doing it "right" seems + * to be getting complex, though. + */ + + +int get_pvc(int itf,int *vci) +{ + struct sockaddr_atmpvc addr; + struct atm_qos qos; + int s,error; + + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) + diag(COMPONENT,DIAG_FATAL,"get_pvc: %s",strerror(errno)); + memset(&qos,0,sizeof(qos)); + qos.aal = ATM_AAL5; + qos.rxtp.traffic_class = qos.txtp.traffic_class = ATM_UBR; + if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) + diag(COMPONENT,DIAG_FATAL,"setsockopt SO_ATMQOS: %s",strerror(errno)); + memset(&addr,0,sizeof(addr)); + addr.sap_family = AF_ATMPVC; + addr.sap_addr.itf = itf; + addr.sap_addr.vpi = 0; /* @@@ */ + addr.sap_addr.vci = ATM_VCI_ANY; + error = 0; + if (bind(s,(struct sockaddr *) &addr,sizeof(addr)) < 0) error = errno; + else { + int size; + + size = sizeof(addr); + if (getsockname(s,(struct sockaddr *) &addr,&size) < 0) + diag(COMPONENT,DIAG_FATAL,"get_pvc: %s",strerror(errno)); + *vci = addr.sap_addr.vci; + return s; + } + (void) close(s); + return -error; } diff -ur --new-file old/atm/sigd/io.h new/atm/sigd/io.h --- old/atm/sigd/io.h Tue Mar 12 16:04:53 1996 +++ new/atm/sigd/io.h Tue Feb 25 15:12:03 1997 @@ -1,6 +1,6 @@ /* io.h - I/O operations */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #ifndef IO_H @@ -32,5 +32,7 @@ void to_net(void *msg,int size); int get_addr(int itf); + +int get_pvc(int itf,int *vci); #endif diff -ur --new-file old/atm/sigd/kernel.c new/atm/sigd/kernel.c --- old/atm/sigd/kernel.c Thu Sep 5 15:10:31 1996 +++ new/atm/sigd/kernel.c Tue Mar 11 20:01:47 1997 @@ -1,6 +1,6 @@ /* kernel.c - Processing of incoming kernel messages */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -24,9 +24,6 @@ #define COMPONENT "KERNEL" -extern int assign_vci; - - static int send_setup(SOCKET *sock) { static unsigned long call_ref = 0; @@ -74,11 +71,18 @@ q_write(&dsc,QF_cgpn,(void *) local->sas_addr.prv,ATM_ESA_LEN); } if (net) { - q_assign(&dsc,QF_vpi,0); - q_assign(&dsc,QF_vci,assign_vci); /* @@@ */ + int vci; + + vci = get_vci(0); + if (vci < 0) { + (void) q_close(&dsc); + return vci; + } + q_assign(&dsc,QF_vpi,0); /* @@@ */ + q_assign(&dsc,QF_vci,vci); sock->pvc.sap_addr.itf = get_itf(0); sock->pvc.sap_addr.vpi = 0; - sock->pvc.sap_addr.vci = assign_vci++; + sock->pvc.sap_addr.vci = vci; } if ((size = q_close(&dsc)) < 0) error = -EINVAL; else if (!error) to_signaling(q_buffer,size); @@ -136,10 +140,6 @@ switch (msg->type) { case as_bind: /* only in NULL state */ if (sock) break; - if (msg->aal != ATM_AAL5) { - SEND_ERROR(msg->vcc,-EINVAL); - return; - } if (!*msg->svc.sas_addr.pub && !*msg->svc.sas_addr.prv) #ifdef BE_PICKY_ABOUT_BINDING_LOCAL_WILDCARD_ADDRESSES if (local_addr[0].state != ls_same) @@ -216,6 +216,10 @@ struct sockaddr_atmsvc *sap; if (sock) break; + if (msg->qos.aal != ATM_AAL5) { + SEND_ERROR(msg->vcc,-EINVAL); + return; + } sap = sap_copy(&msg->svc); if (lookup_sap(sap,&msg->qos,NULL,NULL)) { free(sap); @@ -354,9 +358,9 @@ if (msg->listen_vcc == curr->id && curr->state == ss_listening) break; } - diag(COMPONENT,DIAG_DEBUG,"FROM KERNEL: %s for socket 0x%lx (0x%lx/0x%lx) " - "in state %s",as_name[msg->type],(unsigned long) curr,msg->vcc, - msg->listen_vcc,state_name[curr ? curr->state : ss_null]); + diag(COMPONENT,DIAG_DEBUG,"FROM KERNEL: %s for socket 0x%p (0x%lx/0x%lx) " + "in state %s",as_name[msg->type],curr,msg->vcc,msg->listen_vcc, + state_name[curr ? curr->state : ss_null]); msg->svc.sas_addr.blli = msg->local.sas_addr.blli = NULL; bllis = msg2bllis(size); this = &msg->svc.sas_addr.blli; diff -ur --new-file old/atm/sigd/proto.c new/atm/sigd/proto.c --- old/atm/sigd/proto.c Wed Sep 4 18:24:40 1996 +++ new/atm/sigd/proto.c Tue Feb 25 16:58:54 1997 @@ -1,11 +1,12 @@ /* proto.c - Common protocol functions and structures */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include #include #include +#include #include #include "atmd.h" @@ -76,16 +77,15 @@ { SOCKET **walk; - diag(COMPONENT,DIAG_DEBUG,"freeing socket 0x%lx@0x%lx",sock->id, - (unsigned long) sock); + diag(COMPONENT,DIAG_DEBUG,"freeing socket 0x%lx@0x%p",sock->id,sock); for (walk = &sockets; *walk != sock; walk = &(*walk)->next); if (!*walk) diag(COMPONENT,DIAG_FATAL, "INTERNAL ERROR: freeing non-existing socket 0x%lx",sock->id); *walk = sock->next; if (sock->conn_timer) { - diag(COMPONENT,DIAG_ERROR,"socket 0x%lx has timer (0x%lx) running", - sock->id,(unsigned long) sock->conn_timer->callback); + diag(COMPONENT,DIAG_ERROR,"socket 0x%lx has timer (0x%p) running", + sock->id,sock->conn_timer->callback); stop_timer(sock->conn_timer); } if (sock->listen) @@ -261,6 +261,24 @@ va_start(ap,msg); vdiag("QMSG",severity,msg,ap); va_end(ap); +} + + +int get_vci(int itf) +{ + SOCKET *walk; + int s,vci; + + s = get_pvc(itf,&vci); + if (s < 0) return s; + for (walk = sockets; walk; walk = walk->next) + if (walk->pvc.sap_addr.vci == vci) { + vci = get_vci(itf); /* this recursion will keep all the busy ones + open until we return */ + break; + } + (void) close(s); + return vci; } diff -ur --new-file old/atm/sigd/proto.h new/atm/sigd/proto.h --- old/atm/sigd/proto.h Thu Oct 10 18:39:28 1996 +++ new/atm/sigd/proto.h Fri Feb 21 21:06:53 1997 @@ -1,6 +1,6 @@ /* proto.h - Common protocol functions and structures */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #ifndef PROTO_H @@ -104,6 +104,8 @@ void set_error(SOCKET *sock,int code); void send_close(SOCKET *sock); + +int get_vci(int itf); void enter_vpci(int vpci,int itf); int get_itf(int *vpci); diff -ur --new-file old/atm/sigd/q2931.c new/atm/sigd/q2931.c --- old/atm/sigd/q2931.c Tue Jan 21 04:08:04 1997 +++ new/atm/sigd/q2931.c Tue Mar 11 21:46:10 1997 @@ -30,13 +30,11 @@ extern const char *cause_text[]; /* from mess.c */ -int assign_vci = 42; /* assigning VCIs from here on if acting as network */ - static Q_DSC in_dsc; static TIMER *t309 = NULL; -static void send_call_proceeding(SOCKET *sock) +static int send_call_proceeding(SOCKET *sock) { Q_DSC dsc; int size; @@ -45,14 +43,22 @@ q_assign(&dsc,QF_msg_type,QMSG_CALL_PROC); q_assign(&dsc,QF_call_ref,sock->call_ref); if (net) { - q_assign(&dsc,QF_vpi,0); - q_assign(&dsc,QF_vci,assign_vci); /* @@@ */ + int vci; + + vci = get_vci(0); + if (vci < 0) { + (void) q_close(&dsc); + return vci; + } + q_assign(&dsc,QF_vpi,0); /* @@@ */ + q_assign(&dsc,QF_vci,vci); sock->pvc.sap_addr.itf = signaling_pvc.sap_addr.itf; sock->pvc.sap_addr.vpi = 0; - sock->pvc.sap_addr.vci = assign_vci++; + sock->pvc.sap_addr.vci = vci; } if (sock->ep_ref >= 0) q_assign(&dsc,QF_ep_ref,sock->ep_ref); if ((size = q_close(&dsc)) >= 0) to_signaling(q_buffer,size); + return 0; } @@ -69,6 +75,7 @@ sock = lookup_sap(sap,&qos,&new_sap,&new_qos); if (!sock || new_sap) free(sap); else new_sap = sap; /* @@@ should strip extra BLLIs */ + new_qos.aal = ATM_AAL5; /* hack @@@ */ if (!sock) { send_release_complete(call_ref,ATM_CV_INCOMP_DEST); /* @@@ dunno */ return; @@ -82,7 +89,16 @@ #ifdef CISCO else #endif - send_call_proceeding(this); + { + int error; + + error = send_call_proceeding(this); + if (error) { + free_sock(this); + send_release_complete(call_ref,ATM_CV_NO_CI); + return; + } + } this->local = new_sap; this->qos = new_qos; /* if (sock->local) *this->local->sas_addr = sock->local->sas_addr; ??? */ diff -ur --new-file old/atm/sigd/trace.c new/atm/sigd/trace.c --- old/atm/sigd/trace.c Fri Nov 29 18:45:47 1996 +++ new/atm/sigd/trace.c Tue Mar 11 20:17:50 1997 @@ -1,6 +1,6 @@ /* trace.c - Support functions for message tracing */ -/* Written 1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1996,1997 by Werner Almesberger, EPFL-LRC */ #include @@ -192,7 +192,7 @@ error = strerror(m->reply > 0 ? m->reply : -m->reply); append(" (%s)",error ? error : "???"); } - append(", aal %d\n",m->aal); + append(", aal %d\n",m->qos.aal); append(" pvc %d.%d.%d\n",m->pvc.sap_addr.itf,m->pvc.sap_addr.vpi, m->pvc.sap_addr.vci); append(" local "); diff -ur --new-file old/atm/test/aping.c new/atm/test/aping.c --- old/atm/test/aping.c Sat Aug 31 14:20:41 1996 +++ new/atm/test/aping.c Tue Mar 11 12:01:59 1997 @@ -1,6 +1,6 @@ /* aping.c - simple round-trip tester */ -/* Written 1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1996,1997 by Werner Almesberger, EPFL-LRC */ #include @@ -38,7 +38,7 @@ int s,i,len; if (argc != 2) usage(argv[0]); - if ((s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; } @@ -46,6 +46,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.aal = ATM_AAL5; qos.txtp.traffic_class = ATM_UBR; qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = 1; diff -ur --new-file old/atm/test/aread.c new/atm/test/aread.c --- old/atm/test/aread.c Sat Aug 31 14:20:46 1996 +++ new/atm/test/aread.c Tue Mar 11 12:02:19 1997 @@ -1,6 +1,6 @@ /* read.c - receive AAL5 PDU */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -31,7 +31,7 @@ int s; if (argc != 2) usage(argv[0]); - if ((s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; } @@ -39,6 +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.aal = ATM_AAL5; qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = BSIZE; if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { diff -ur --new-file old/atm/test/awrite.c new/atm/test/awrite.c --- old/atm/test/awrite.c Sat Aug 31 14:20:48 1996 +++ new/atm/test/awrite.c Tue Mar 11 12:02:32 1997 @@ -1,6 +1,6 @@ /* write.c - send AAL5 PDU */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -28,7 +28,7 @@ int s,size,offset; if (argc != 3 && argc != 4) usage(argv[0]); - if ((s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; } @@ -37,6 +37,7 @@ usage(argv[0]); offset = argc == 3 ? 0 : atoi(argv[3]); memset(&qos,0,sizeof(qos)); + qos.aal = ATM_AAL5; 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) { diff -ur --new-file old/atm/test/br.c new/atm/test/br.c --- old/atm/test/br.c Sat Aug 31 14:20:52 1996 +++ new/atm/test/br.c Tue Mar 11 12:02:47 1997 @@ -1,6 +1,6 @@ /* br.c - block read */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -31,7 +31,7 @@ int s; if (argc != 2) usage(argv[0]); - if ((s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; } @@ -39,6 +39,7 @@ if (text2atm(argv[1],(struct sockaddr *) &addr,sizeof(addr),T2A_PVC) < 0) usage(argv[0]); memset(&qos,0,sizeof(qos)); + qos.aal = ATM_AAL5; qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = BSIZE; if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { diff -ur --new-file old/atm/test/bw.c new/atm/test/bw.c --- old/atm/test/bw.c Sat Aug 31 14:20:56 1996 +++ new/atm/test/bw.c Tue Mar 11 12:03:02 1997 @@ -1,6 +1,6 @@ /* bw.c - block write */ -/* Written 1995,1996 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1997 by Werner Almesberger, EPFL-LRC */ #include @@ -35,7 +35,7 @@ if (argc != 2 && argc != 3) usage(argv[0]); if (argc == 2) blocks = 0; else blocks = atoi(argv[2]); - if ((s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; } @@ -43,6 +43,7 @@ if (text2atm(argv[1],(struct sockaddr *) &addr,sizeof(addr),T2A_PVC) < 0) usage(argv[0]); memset(&qos,0,sizeof(qos)); + qos.aal = ATM_AAL5; qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = BSIZE; if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { diff -ur --new-file old/atm/test/ttcp.c new/atm/test/ttcp.c --- old/atm/test/ttcp.c Tue Nov 26 20:58:40 1996 +++ new/atm/test/ttcp.c Tue Mar 11 12:04:33 1997 @@ -322,6 +322,7 @@ } } if (arequipa && !udp) qos.rxtp = qos.txtp; + if (!qos.aal) qos.aal = ATM_AAL5; } if (!atm && trans) { /* xmitr */ @@ -387,7 +388,7 @@ } if ((fd = socket(atm ? satm.sas_family : AF_INET, - udp?SOCK_DGRAM:SOCK_STREAM, atm ? ATM_AAL5 : 0)) < 0) err("socket"); + udp?SOCK_DGRAM:SOCK_STREAM,0)) < 0) err("socket"); mes("socket"); if (arequipa && trans) { diff -ur --new-file old/atm/test/window.c new/atm/test/window.c --- old/atm/test/window.c Fri Nov 15 23:53:38 1996 +++ new/atm/test/window.c Tue Mar 11 12:05:02 1997 @@ -96,11 +96,11 @@ exit(-1); } - if ((s1 = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s1 = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); exit(-1); } - if ((s2 = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + if ((s2 = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); exit(-1); } @@ -130,8 +130,10 @@ memset(&qos1,0,sizeof(qos1)); memset(&qos2,0,sizeof(qos2)); + qos1.aal = ATM_AAL5; qos1.txtp.traffic_class = ATM_UBR; qos1.txtp.max_sdu = PINGPONG_SIZE; + qos2.aal = ATM_AAL5; qos2.rxtp.traffic_class = ATM_UBR; qos2.rxtp.max_sdu = REPLY_SIZE; .