diff -ur --new-file old/atm/BUGS new/atm/BUGS --- old/atm/BUGS Tue Aug 11 17:01:12 1998 +++ new/atm/BUGS Tue Aug 18 13:24:29 1998 @@ -1,4 +1,4 @@ -Known bugs and restrictions in version 0.40 +Known bugs and restrictions in version 0.41 =========================================== - libresolve conflicts with libc on some systems @@ -7,3 +7,4 @@ - few if any drivers build properly as modules - MPOA may fail on RedHat 5.x with "mpcd: changed_fds = ...", due to what seems to be a bug in RedHat's glibc + - CLIP interfaces must not be reconfigured while "up" diff -ur --new-file old/atm/CHANGES new/atm/CHANGES --- old/atm/CHANGES Thu Aug 13 13:38:10 1998 +++ new/atm/CHANGES Wed Aug 19 18:19:02 1998 @@ -1,3 +1,29 @@ +Version 0.40 to 0.41 (19-AUG-1998) +==================== + +Bug fixes +--------- + + - 0.40 contained an older atm.patch than the one that was supposed to go with + it (some changes to sch_atm and MPOA were missing) + - kernel didn't build with LANE enabled and MPOA disabled (fix by Mitchell + Blank Jr) + +New features +------------ + + - MPOA now also supports CBR SVCs (by Heikki Vatiainen and Sampo Saaristo) + +Other changes +------------- + + - atmtcp may work as a module (untested) + - kernel code now uses capabilities instead of suser() + - removed obsolete recycle_buffer code + - distribution now also includes mkpatch, the script that's used to create + atm.patch + + Version 0.39 to 0.40 (13-AUG-1998) ==================== @@ -13,6 +39,8 @@ of help from John McPherson) - ATM qdisc now properly re-allocates skb memory to grow headers, if necessary - atm/switch/Makefile didn't build SUBDIRS + - atmarpd sent garbage ATM addresses in InARP responses over PVCs (reported by + Stefan Keller-Tuberg) New features ------------ diff -ur --new-file old/atm/COPYING new/atm/COPYING --- old/atm/COPYING Wed Aug 12 17:49:12 1998 +++ new/atm/COPYING Tue Aug 18 12:52:07 1998 @@ -11,6 +11,12 @@ See the file COPYING.GPL for details. +For the ATM-related kernel code, authorship is typically recorded at +the beginning of files. Note that some parts contain code from many +authors, of which only the principal one(s) is or are listed. Kernel +code is released under the conditions described in the file COPYING +in the top-level directory of the kernel (i.e. the GPL, version 2). + The libraries libatm, libatmd, libarequipa (in atm/lib/), libsaal (in atm/saal/), and qlib (in atm/qgen/) are covered by the more permissive Library General Public License. See the file COPYING.LGPL for details. diff -ur --new-file old/atm/README new/atm/README --- old/atm/README Tue Aug 11 19:43:30 1998 +++ new/atm/README Tue Aug 18 12:59:59 1998 @@ -1,4 +1,4 @@ -ATM on Linux, release 0.40 (alpha) by Werner Almesberger, EPFL ICA +ATM on Linux, release 0.41 (alpha) by Werner Almesberger, EPFL ICA ============================================== Werner.Almesberger@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 Thu Aug 13 13:38:23 1998 +++ new/atm/USAGE Wed Aug 19 16:45:55 1998 @@ -1,4 +1,4 @@ -Usage instructions - ATM on Linux, release 0.40 +Usage instructions - ATM on Linux, release 0.41 ------------------------------------------------- For updates of ATM on Linux, please check the Web page at @@ -17,7 +17,7 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.40.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.41.tar.gz - the Linux kernel, version 2.1.105, e.g. from ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.105.tar.gz - Perl, version 4 or 5 @@ -33,7 +33,7 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.40.tar.gz +tar xfz atm-0.41.tar.gz and the kernel source: @@ -91,6 +91,8 @@ ZeitNet ZN1221/ZN1225 (CONFIG_ATM_ZATM) Enable extended debugging (CONFIG_ATM_ZATM_DEBUG) Enable usec resolution timestamps (CONFIG_ATM_ZATM_EXACT_TS) + +IDT 77201 (NICStAR) (CONFIG_ATM_NICSTAR) Then build your kernel and reboot. diff -ur --new-file old/atm/VERSION new/atm/VERSION --- old/atm/VERSION Wed Aug 12 19:42:23 1998 +++ new/atm/VERSION Wed Aug 19 16:39:21 1998 @@ -1 +1 @@ -0.40 +0.41 diff -ur --new-file old/atm/atm.patch new/atm/atm.patch --- old/atm/atm.patch Thu Aug 13 13:37:20 1998 +++ new/atm/atm.patch Wed Aug 19 16:45:43 1998 @@ -156,7 +156,7 @@ ifeq ($(CONFIG_AP1000),y) --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/Config.in Tue Jun 9 21:32:11 1998 ++++ work/drivers/atm/Config.in Wed Aug 19 18:21:40 1998 @@ -0,0 +1,23 @@ +# +# ATM device configuration @@ -293,13 +293,14 @@ + return devs; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/atmtcp.c Tue Aug 4 19:07:09 1998 -@@ -0,0 +1,311 @@ ++++ work/drivers/atm/atmtcp.c Tue Aug 18 13:27:32 1998 +@@ -0,0 +1,339 @@ +/* drivers/atm/atmtcp.c - ATM over TCP "device" driver */ + +/* Written 1997,1998 by Werner Almesberger, EPFL LRC/ICA */ + + ++#include +#include +#include +#include @@ -324,7 +325,7 @@ + +static void atmtcp_v_dev_close(struct atm_dev *dev) +{ -+ /* do nothing */ ++ MOD_DEC_USE_COUNT; +} + + @@ -548,6 +549,7 @@ + kfree(dev_data); + return itf == -1 ? -ENOMEM : -EBUSY; + } ++ MOD_INC_USE_COUNT; + dev->ci_range.vpi_bits = MAX_VPI_BITS; + dev->ci_range.vci_bits = MAX_VCI_BITS; + PRIV(dev) = dev_data; @@ -606,6 +608,32 @@ + shutdown_atm_dev(dev); + return 0; +} ++ ++ ++#ifdef MODULE ++ ++int init_module(void) ++{ ++ atm_tcp_ops.attach = atmtcp_attach; ++ atm_tcp_ops.create_persistent = atmtcp_create_persistent; ++ atm_tcp_ops.remove_persistent = atmtcp_remove_persistent; ++ return 0; ++} ++ ++void cleanup_module(void) ++{ ++} ++ ++#else ++ ++struct atm_tcp_ops atm_tcp_ops = { ++ atmtcp_attach, /* attach */ ++ atmtcp_create_persistent, /* create_persistent */ ++ atmtcp_remove_persistent /* remove_persistent */ ++}; ++ ++#endif ++ --- /dev/null Tue Jan 1 05:00:00 1980 +++ work/drivers/atm/eni.c Fri Jul 17 16:38:52 1998 @@ -0,0 +1,2143 @@ @@ -2753,7 +2781,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/eni.h Tue Aug 11 19:45:45 1998 ++++ work/drivers/atm/eni.h Wed Aug 19 14:31:02 1998 @@ -0,0 +1,114 @@ +/* drivers/atm/eni.h - Efficient Networks ENI155P device driver declarations */ + @@ -3138,8 +3166,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/suni.c Fri Jul 24 23:49:36 1998 -@@ -0,0 +1,310 @@ ++++ work/drivers/atm/suni.c Tue Aug 18 13:42:40 1998 +@@ -0,0 +1,311 @@ +/* drivers/atm/suni.c - PMC SUNI (PHY) driver */ + +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ @@ -3156,6 +3184,7 @@ +#include +#include +#include ++#include +#include +#include +#include @@ -3318,7 +3347,7 @@ + case SONET_GETDIAG: + return get_diag(dev,arg); + case SONET_SETFRAMING: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + if (arg != SONET_FRAME_SONET) return -EINVAL; + return 0; + case SONET_GETFRAMING: @@ -3327,7 +3356,7 @@ + case SONET_GETFRSENSE: + return -EINVAL; + case SUNI_SETLOOP: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + if ((int) arg < 0 || (int) arg > SUNI_LM_LOOP) + return -EINVAL; + PUT((GET(MCT) & ~(SUNI_MCT_DLE | SUNI_MCT_LLE)) | @@ -3451,7 +3480,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/suni.h Tue Aug 11 19:45:41 1998 ++++ work/drivers/atm/suni.h Wed Aug 19 14:31:00 1998 @@ -0,0 +1,210 @@ +/* drivers/atm/suni.h - PMC SUNI (PHY) declarations */ + @@ -4318,8 +4347,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/zatm.c Fri Jul 17 16:40:25 1998 -@@ -0,0 +1,1869 @@ ++++ work/drivers/atm/zatm.c Tue Aug 18 13:43:03 1998 +@@ -0,0 +1,1870 @@ +/* drivers/atm/zatm.c - ZeitNet ZN122x device driver */ + +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ @@ -4341,6 +4370,7 @@ +#include +#include +#include ++#include +#include +#include +#include @@ -5931,7 +5961,7 @@ + zatm_dev = ZATM_DEV(dev); + switch (cmd) { + case ZATM_GETPOOLZ: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + /* fall through */ + case ZATM_GETPOOL: + { @@ -5960,7 +5990,7 @@ + struct zatm_pool_info info; + int pool; + -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + if (get_user(pool, + &((struct zatm_pool_req *) arg)->pool_num)) + return -EFAULT; @@ -6190,7 +6220,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/zatm.h Tue Aug 11 19:45:52 1998 ++++ work/drivers/atm/zatm.h Wed Aug 19 14:31:06 1998 @@ -0,0 +1,136 @@ +/* drivers/atm/zatm.h - ZeitNet ZN122x device driver declarations */ + @@ -6386,7 +6416,7 @@ #ifdef CONFIG_VT console_map_init(); --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/arequipa.h Tue Aug 11 19:46:26 1998 ++++ work/include/linux/arequipa.h Wed Aug 19 14:31:31 1998 @@ -0,0 +1,63 @@ +/* arequipa.h - Arequipa interface definitions */ + @@ -6452,13 +6482,18 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atm.h Tue Aug 11 19:45:40 1998 -@@ -0,0 +1,234 @@ ++++ work/include/linux/atm.h Tue Aug 18 14:51:43 1998 +@@ -0,0 +1,239 @@ +/* atm.h - general ATM declarations */ + +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ + + ++/* ++ * WARNING: User-space programs should not #include directly. ++ * Instead, #include ++ */ ++ +#ifndef _LINUX_ATM_H +#define _LINUX_ATM_H + @@ -6707,7 +6742,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atm_suni.h Fri Jul 17 16:47:52 1998 ++++ work/include/linux/atm_suni.h Wed Aug 19 14:59:10 1998 @@ -0,0 +1,19 @@ +/* atm_suni.h - Driver-specific declarations of the SUNI driver (for use by + driver-specific utilities) */ @@ -6729,8 +6764,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atm_tcp.h Tue Aug 4 17:53:34 1998 -@@ -0,0 +1,42 @@ ++++ work/include/linux/atm_tcp.h Tue Aug 18 13:21:08 1998 +@@ -0,0 +1,46 @@ +/* atm_tcp.h - Driver-specific declarations of the ATMTCP driver (for use by + driver-specific utilities) */ + @@ -6766,9 +6801,13 @@ + +#ifdef __KERNEL__ + -+int atmtcp_attach(struct atm_vcc *vcc,int itf); -+int atmtcp_create_persistent(int itf); -+int atmtcp_remove_persistent(int itf); ++struct atm_tcp_ops { ++ int (*attach)(struct atm_vcc *vcc,int itf); ++ int (*create_persistent)(int itf); ++ int (*remove_persistent)(int itf); ++}; ++ ++extern struct atm_tcp_ops atm_tcp_ops; + +#endif + @@ -6876,8 +6915,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmclip.h Tue Aug 11 19:46:26 1998 -@@ -0,0 +1,26 @@ ++++ work/include/linux/atmclip.h Tue Aug 11 22:56:11 1998 +@@ -0,0 +1,25 @@ +/* atmclip.h - Classical IP over ATM */ + +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ @@ -6898,14 +6937,13 @@ + +#define SIOCMKCLIP _IO('a',ATMIOC_CLIP) /* create IP interface */ + -+ +#ifdef __KERNEL__ -+void clip_xmit_vcc(struct sk_buff *skb,struct atm_vcc *vcc); ++extern const unsigned char llc_oui[6]; +#endif + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmdev.h Tue Aug 11 19:45:41 1998 ++++ work/include/linux/atmdev.h Wed Aug 19 14:31:00 1998 @@ -0,0 +1,309 @@ +/* atmdev.h - ATM device driver declarations */ + @@ -7259,7 +7297,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmlec.h Tue Aug 11 19:46:26 1998 ++++ work/include/linux/atmlec.h Wed Aug 19 14:31:31 1998 @@ -0,0 +1,70 @@ +/* + * @@ -7332,7 +7370,7 @@ +}; +#endif /* _ATMLEC_H_ */ --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmmpc.h Tue Aug 11 19:18:07 1998 ++++ work/include/linux/atmmpc.h Wed Aug 19 14:59:32 1998 @@ -0,0 +1,98 @@ +#ifndef _ATMMPC_H_ +#define _ATMMPC_H_ @@ -7597,7 +7635,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmsvc.h Tue Aug 11 19:46:26 1998 ++++ work/include/linux/atmsvc.h Wed Aug 19 14:31:31 1998 @@ -0,0 +1,52 @@ +/* atmsvc.h - ATM signaling kernel-demon interface definitions */ + @@ -7651,8 +7689,26 @@ + (tp).max_pcr : (tp).min_pcr ? (tp).min_pcr : ATM_MAX_PCR) + +#endif +--- ref/include/linux/capability.h Sun Jun 7 20:22:35 1998 ++++ work/include/linux/capability.h Tue Aug 18 13:49:56 1998 +@@ -121,6 +121,7 @@ + #define CAP_LINUX_IMMUTABLE 9 + + /* Allows binding to TCP/UDP sockets below 1024 */ ++/* Allows binding to ATM VCIs below 32 */ + + #define CAP_NET_BIND_SERVICE 10 + +@@ -140,6 +141,7 @@ + /* Allow clearing driver statistics */ + /* Allow multicasting */ + /* Allow read/write of device-specific registers */ ++/* Allow activation of ATM control sockets */ + + #define CAP_NET_ADMIN 12 + --- ref/include/linux/if_arp.h Sun Jun 7 20:23:23 1998 -+++ work/include/linux/if_arp.h Tue Jul 28 21:35:51 1998 ++++ work/include/linux/if_arp.h Tue Aug 18 14:07:42 1998 @@ -35,6 +35,7 @@ #define ARPHRD_ARCNET 7 /* ARCnet */ #define ARPHRD_APPLETLK 8 /* APPLEtalk */ @@ -7671,9 +7727,29 @@ /* ARP ioctl request. */ +--- ref/include/linux/pkt_sched.h Tue Apr 28 20:10:10 1998 ++++ work/include/linux/pkt_sched.h Wed Aug 12 22:04:43 1998 +@@ -274,4 +274,17 @@ + + #define TCA_CBQ_MAX TCA_CBQ_POLICE + ++/* ATM section */ ++ ++enum { ++ TCA_ATM_UNSPEC, ++ TCA_ATM_FD, /* file/socket descriptor */ ++ TCA_ATM_PTR, /* pointer to descriptor - later */ ++ TCA_ATM_HDR, /* LL header */ ++ TCA_ATM_POLICE, /* policing - later */ ++ TCA_ATM_ADDR /* PVC address (for output only) */ ++}; ++ ++#define TCA_ATM_MAX TCA_ATM_ADDR ++ + #endif --- ref/include/linux/skbuff.h Sun Jun 7 20:22:36 1998 -+++ work/include/linux/skbuff.h Tue Jun 9 21:44:44 1998 -@@ -106,6 +106,20 @@ ++++ work/include/linux/skbuff.h Tue Aug 18 14:06:31 1998 +@@ -106,6 +106,16 @@ __u32 shapestamp; /* Stamp for shaper */ __u16 shapepend; /* Pending */ #endif @@ -7681,10 +7757,6 @@ + struct { + struct atm_vcc *vcc; /* ATM VCC */ + int iovcnt; /* 0 for "normal" operation */ -+#ifdef CONFIG_ATM_NICSTAR -+ void *recycle_buffer; /* set when buffer should be */ -+ /* recycled; points to vcc */ -+#endif +#ifdef CONFIG_AREQUIPA + int generation; /* generation number */ +#endif @@ -7750,7 +7822,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/net/atmclip.h Tue Aug 11 19:46:16 1998 ++++ work/include/net/atmclip.h Wed Aug 19 14:31:25 1998 @@ -0,0 +1,62 @@ +/* net/atm/atmarp.h - RFC1577 ATM ARP */ + @@ -7966,8 +8038,8 @@ tc_filter_init(); #endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/sched/sch_atm.c Tue Aug 4 22:00:38 1998 -@@ -0,0 +1,523 @@ ++++ work/net/sched/sch_atm.c Thu Aug 13 17:23:58 1998 +@@ -0,0 +1,550 @@ +/* net/sched/sch_atm.c - ATM VC selection "queueing discipline" */ + +/* Written 1998 by Werner Almesberger, EPFL ICA */ @@ -8043,6 +8115,8 @@ + int ref; /* reference count */ + struct tc_stats stats; + struct atm_flow_data *next; ++ int hdr_len; ++ unsigned char hdr[0]; /* header data */ +}; + +struct atm_qdisc_data { @@ -8146,8 +8220,10 @@ + struct atm_qdisc_data *p = PRIV(sch); + struct atm_flow_data *flow = (struct atm_flow_data *) *arg; + struct rtattr *opt = tca[TCA_OPTIONS-1]; ++ struct rtattr *tb[TCA_ATM_MAX]; + struct socket *sock; -+ int fd,error; ++ int fd,error,hdr_len; ++ void *hdr; + + DPRINTK("atm_tc_change(sch %p,[qdisc %p],classid %x,parent %x," + "flow %p,opt %p)\n",sch,p,classid,parent,flow,opt); @@ -8162,17 +8238,22 @@ + * class needs to be removed and a new one added. + */ + if (flow) return -EBUSY; -+ /* -+ * @@@ Just treat the whole option block as our argument. (Technically, -+ * this makes sense, because there's only one variable and it's -+ * required anyway. Of course, this differs from how things are done -+ * elsewhere. Need to fix it when adding policing ...) -+ */ -+ DPRINTK("atm_tc_change: type %d, payload %d\n",opt->rta_type, -+ RTA_PAYLOAD(opt)); -+ if (RTA_PAYLOAD(*tca) != sizeof(int)) return -EINVAL; -+ fd = *(int *) RTA_DATA(opt); ++ if (opt == NULL || rtattr_parse(tb,TCA_ATM_MAX,RTA_DATA(opt), ++ RTA_PAYLOAD(opt))) return -EINVAL; ++ if (!tb[TCA_ATM_FD-1] || RTA_PAYLOAD(tb[TCA_ATM_FD-1]) < sizeof(fd)) ++ return -EINVAL; ++ fd = *(int *) RTA_DATA(tb[TCA_ATM_FD-1]); + DPRINTK("atm_tc_change: fd %d\n",fd); ++ if (tb[TCA_ATM_HDR-1]) { ++ hdr_len = RTA_PAYLOAD(tb[TCA_ATM_HDR-1]); ++ hdr = RTA_DATA(tb[TCA_ATM_HDR-1]); ++ } ++ else { ++ hdr_len = RFC1483LLC_LEN; ++ hdr = NULL; /* default LLC/SNAP for IP */ ++ } ++ DPRINTK("atm_tc_change: type %d, payload %d, hdr_len %d\n", ++ opt->rta_type,RTA_PAYLOAD(opt),hdr_len); + if (!(sock = sockfd_lookup(fd,&error))) return error; /* f_count++ */ + DPRINTK("atm_tc_change: f_count %d\n",sock->file->f_count); + if (sock->ops->family != PF_ATMSVC && sock->ops->family != PF_ATMPVC) { @@ -8203,7 +8284,7 @@ + } + } + DPRINTK("atm_tc_change: new id %x\n",classid); -+ flow = kmalloc(sizeof(struct atm_flow_data),GFP_KERNEL); ++ flow = kmalloc(sizeof(struct atm_flow_data)+hdr_len,GFP_KERNEL); + DPRINTK("atm_tc_change: flow %p\n",flow); + if (!flow) { + error = -ENOBUFS; @@ -8221,6 +8302,12 @@ + flow->ref = 1; + flow->next = p->link.next; + p->link.next = flow; ++ flow->hdr_len = hdr_len; ++ if (hdr) memcpy(flow->hdr,hdr,hdr_len); ++ else { ++ memcpy(flow->hdr,llc_oui,sizeof(llc_oui)); ++ ((u16 *) flow->hdr)[3] = htons(ETH_P_IP); ++ } + *arg = (unsigned long) flow; + return 0; +err_out: @@ -8310,23 +8397,27 @@ + * If traffic is properly shaped, this won't generate nasty + * little bursts. Otherwise, it may ... @@@ + */ -+ while (skb = flow->q->dequeue(flow->q)) { ++ while ((skb = flow->q->dequeue(flow->q))) { + sch->q.qlen--; + D2PRINTK("atm_tc_deqeueue: sending on class %p\n",flow); -+ /* -+ * Now we're in the unfortunate situation that the -+ * packet header may have to change. So we remove all -+ * other headers first. Then clip_xmit_vcc will try to -+ * add the RFC1483 header. If we're unlucky, we panic, -+ * because there's not enough space left ... -+ * -+ * To avoid this, we should call skb_realloc_headroom -+ * when we detect that there's not enough space. @@@ -+ */ ++ /* remove any LL header somebody else has attached */ ++ skb_pull(skb,(char *) skb->nh.iph-(char *) skb->data); ++ if (skb_headroom(skb) < flow->hdr_len) { ++ struct sk_buff *new; ++ ++ new = skb_realloc_headroom(skb,flow->hdr_len); ++ dev_kfree_skb(skb); ++ if (!new) continue; ++ skb = new; ++ } + D2PRINTK("atm_tc_dequeue: ip %p, data %p\n", + skb->nh.iph,skb->data); -+ skb_pull(skb,(char *) skb->nh.iph-(char *) skb->data); -+ clip_xmit_vcc(skb,flow->vcc); ++ skb->atm.vcc = flow->vcc; ++ memcpy(skb_push(skb,flow->hdr_len),flow->hdr, ++ flow->hdr_len); ++ atomic_add(skb->truesize,&flow->vcc->tx_inuse); ++ skb->atm.iovcnt = 0; ++ (void) flow->vcc->dev->ops->send(flow->vcc,skb); + } + skb = p->link.q->dequeue(p->link.q); + if (skb) sch->q.qlen--; @@ -8413,10 +8504,15 @@ +{ + struct atm_qdisc_data *p = PRIV(sch); + struct atm_flow_data *flow = (struct atm_flow_data *) cl; ++ unsigned char *b = skb->tail; ++ struct rtattr *rta; + + DPRINTK("atm_tc_dump_class(sch %p,[qdisc %p],flow %p,skb %p,tcm %p)\n", + sch,p,flow,skb,tcm); + if (!find_flow(p,flow)) return -EINVAL; ++ rta = (struct rtattr *) b; ++ RTA_PUT(skb,TCA_OPTIONS,0,NULL); ++ RTA_PUT(skb,TCA_ATM_HDR,flow->hdr_len,flow->hdr); + if (flow->vcc) { + struct sockaddr_atmpvc pvc; + @@ -8424,10 +8520,13 @@ + pvc.sap_addr.itf = flow->vcc->dev ? flow->vcc->dev->number : -1; + pvc.sap_addr.vpi = flow->vcc->vpi; + pvc.sap_addr.vci = flow->vcc->vci; -+ RTA_PUT(skb,TCA_OPTIONS,sizeof(pvc),&pvc); ++ RTA_PUT(skb,TCA_ATM_ADDR,sizeof(pvc),&pvc); + } ++ rta->rta_len = skb->tail-b; + return skb->len; ++ +rtattr_failure: ++ skb_trim(skb,b-skb->data); + return -1; +} + @@ -8721,7 +8820,7 @@ + return total; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/addr.h Tue Aug 11 19:46:26 1998 ++++ work/net/atm/addr.h Wed Aug 19 14:31:31 1998 @@ -0,0 +1,18 @@ +/* net/atm/addr.h - Local ATM address registry */ + @@ -8742,8 +8841,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/clip.c Fri Jul 24 03:28:37 1998 -@@ -0,0 +1,664 @@ ++++ work/net/atm/clip.c Tue Aug 11 22:36:07 1998 +@@ -0,0 +1,645 @@ +/* clip.c - RFC1577 Classical IP over ATM */ + +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ @@ -9068,25 +9167,6 @@ +} + + -+/* -+ * For playing with RSVP. Should later be merged with clip_start_xmit -+ */ -+ -+ -+void clip_xmit_vcc(struct sk_buff *skb,struct atm_vcc *vcc) -+{ -+ void *here; -+ -+ skb->atm.vcc = vcc; -+ here = skb_push(skb,RFC1483LLC_LEN); -+ memcpy(here,llc_oui,sizeof(llc_oui)); -+ ((u16 *) here)[3] = skb->protocol; -+ atomic_add(skb->truesize,&vcc->tx_inuse); -+ skb->atm.iovcnt = 0; -+ (void) vcc->dev->ops->send(vcc,skb); -+} -+ -+ +static int clip_start_xmit(struct sk_buff *skb,struct device *dev) +{ + struct atmarp_entry *entry; @@ -9409,8 +9489,8 @@ + return 0; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/common.c Tue Aug 11 19:11:54 1998 -@@ -0,0 +1,908 @@ ++++ work/net/atm/common.c Tue Aug 18 13:47:50 1998 +@@ -0,0 +1,913 @@ +/* net/atm/common.c - ATM sockets (common part for PVC and SVC) */ + +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ @@ -9427,7 +9507,7 @@ +#include /* for ioctls */ +#include /* SOL_SOCKET */ +#include /* error codes */ -+#include /* suser */ ++#include +#include /* verify_area */ +#include +#include /* struct timeval */ @@ -9467,8 +9547,12 @@ +#endif +#endif + -+#ifdef CONFIG_ATM_TCP ++#if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) +#include ++#ifdef CONFIG_ATM_TCP_MODULE ++struct atm_tcp_ops atm_tcp_ops; ++EXPORT_SYMBOL(atm_tcp_ops); ++#endif +#endif + +#include "resources.h" /* atm_find_dev */ @@ -9624,7 +9708,8 @@ + 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 (vci > 0 && vci < ATM_NOT_RSV_VCI && !capable(CAP_NET_BIND_SERVICE)) ++ return -EPERM; + error = 0; + switch (vcc->qos.aal) { + case ATM_AAL0: @@ -9985,7 +10070,7 @@ + ATM_VF_SCTX)) | arg; + return 0; + case ATMSIGD_CTRL: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + error = sigd_attach(vcc); + if (!error) sock->state = SS_CONNECTED; + return error; @@ -10004,21 +10089,21 @@ +#endif +#ifdef CONFIG_ATM_CLIP + case SIOCMKCLIP: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + return clip_create(arg); + case ATMARPD_CTRL: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + error = atm_init_atmarp(vcc); + if (!error) sock->state = SS_CONNECTED; + return error; + case ATMARP_MKIP: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + return clip_mkip(vcc,arg); + case ATMARP_SETENTRY: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + return clip_setentry(vcc,arg); + case ATMARP_ENCAP: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + return clip_encap(vcc,arg); +#endif +#ifdef CONFIG_AREQUIPA @@ -10035,18 +10120,18 @@ + case AREQUIPA_INCOMING: + return arequipa_incoming(sock); + case AREQUIPA_CTRL: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + error = arequipad_attach(vcc); + if (!error) sock->state = SS_CONNECTED; + return error; + case AREQUIPA_WORK: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + arequipa_work(); + return 0; +#endif +#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) + case ATMLEC_CTRL: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + if (atm_lane_ops.lecd_attach == NULL) + atm_lane_init(); + if (atm_lane_ops.lecd_attach == NULL) /* try again */ @@ -10055,15 +10140,15 @@ + if (error >= 0) sock->state = SS_CONNECTED; + return error; + case ATMLEC_MCAST: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + return atm_lane_ops.mcast_attach(vcc, (int)arg); + case ATMLEC_DATA: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + return atm_lane_ops.vcc_attach(vcc, (void*)arg); +#endif +#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) + case ATMMPC_CTRL: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + if (atm_mpoa_ops.mpoad_attach == NULL) + atm_mpoa_init(); + if (atm_mpoa_ops.mpoad_attach == NULL) /* try again */ @@ -10072,21 +10157,21 @@ + if (error >= 0) sock->state = SS_CONNECTED; + return error; + case ATMMPC_DATA: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + return atm_mpoa_ops.vcc_attach(vcc, arg); +#endif -+#ifdef CONFIG_ATM_TCP ++#if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) + case SIOCSIFATMTCP: -+ if (!suser()) return -EPERM; -+ error = atmtcp_attach(vcc,(int) arg); ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; ++ error = atm_tcp_ops.attach(vcc,(int) arg); + if (error >= 0) sock->state = SS_CONNECTED; + return error; + case ATMTCP_CREATE: -+ if (!suser()) return -EPERM; -+ return atmtcp_create_persistent((int) arg); ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; ++ return atm_tcp_ops.create_persistent((int) arg); + case ATMTCP_REMOVE: -+ if (!suser()) return -EPERM; -+ return atmtcp_remove_persistent((int) arg); ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; ++ return atm_tcp_ops.remove_persistent((int) arg); +#endif + default: + break; @@ -10118,14 +10203,14 @@ + { + unsigned char esi[ESI_LEN]; + -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + if (copy_from_user(esi,buf,ESI_LEN)) + return -EFAULT; + memcpy(dev->esi,esi,ESI_LEN); + return ESI_LEN; + } + case ATM_GETSTATZ: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + /* fall through */ + case ATM_GETSTAT: + size = sizeof(struct atm_dev_stats); @@ -10138,12 +10223,12 @@ + return -EFAULT; + break; + case ATM_RSTADDR: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + reset_addr(dev); + break; + case ATM_ADDADDR: + case ATM_DELADDR: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + { + struct sockaddr_atmsvc addr; + @@ -10165,7 +10250,7 @@ + case SONET_SETDIAG: + case SONET_CLRDIAG: + case SONET_SETFRAMING: -+ if (!suser()) return -EPERM; ++ if (!capable(CAP_NET_ADMIN)) return -EPERM; + /* fall through */ + default: + if (!dev->ops->ioctl) return -EINVAL; @@ -10320,7 +10405,7 @@ + return atm_do_getsockopt(sock,level,optname,optval,len); +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/common.h Fri Jul 17 22:28:30 1998 ++++ work/net/atm/common.h Tue Aug 18 14:14:27 1998 @@ -0,0 +1,46 @@ +/* net/atm/common.h - ATM sockets (common part for PVC and SVC) */ + @@ -10424,8 +10509,8 @@ + skb_queue_head_init(from); +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/ipcommon.h Tue Aug 11 19:54:47 1998 -@@ -0,0 +1,22 @@ ++++ work/net/atm/ipcommon.h Wed Aug 19 14:31:36 1998 +@@ -0,0 +1,21 @@ +/* net/atm/ipcommon.h - Common items for all ways of doing IP over ATM */ + +/* Written 1996-1998 by Werner Almesberger, EPFL LRC/ICA */ @@ -10441,7 +10526,6 @@ +#include + + -+extern const unsigned char llc_oui[6]; +extern struct device *clip_devs; + + @@ -12613,7 +12697,7 @@ +} + --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/lec.h Tue Aug 11 19:46:26 1998 ++++ work/net/atm/lec.h Wed Aug 19 14:31:31 1998 @@ -0,0 +1,143 @@ +/* + * @@ -12759,7 +12843,7 @@ +#endif _LEC_H_ + --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/lec_arpc.h Tue Aug 11 19:46:26 1998 ++++ work/net/atm/lec_arpc.h Wed Aug 19 14:31:31 1998 @@ -0,0 +1,112 @@ +/* + * Lec arp cache @@ -12874,8 +12958,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/mpc.c Tue Aug 11 19:14:28 1998 -@@ -0,0 +1,1269 @@ ++++ work/net/atm/mpc.c Wed Aug 12 20:57:27 1998 +@@ -0,0 +1,1270 @@ +#include +#include +#include @@ -13984,7 +14068,8 @@ + memcpy(&tlv[7], mesg->MPS_ctrl, ATM_ESA_LEN); /* MPC ctrl ATM addr */ + memcpy(mpc->our_ctrl_addr, mesg->MPS_ctrl, ATM_ESA_LEN); + -+ printk("mpoa: (%s) setting MPC ctrl ATM address to ", mpc->dev->name); ++ printk("mpoa: (%s) setting MPC ctrl ATM address to ", ++ (mpc->dev) ? mpc->dev->name : ""); + for (i = 7; i < sizeof(tlv); i++) + printk("%02x ", tlv[i]); + printk("\n"); @@ -14146,7 +14231,7 @@ +#endif /* MODULE */ + --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/mpc.h Tue Aug 11 19:14:28 1998 ++++ work/net/atm/mpc.h Wed Aug 19 14:59:32 1998 @@ -0,0 +1,59 @@ +#ifndef _MPC_H_ +#define _MPC_H_ @@ -14718,7 +14803,7 @@ + return; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/mpoa_caches.h Tue Aug 11 19:14:28 1998 ++++ work/net/atm/mpoa_caches.h Wed Aug 19 14:59:32 1998 @@ -0,0 +1,87 @@ +#ifndef MPOA_CACHES_H +#define MPOA_CACHES_H @@ -14808,8 +14893,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/mpoa_proc.c Tue Aug 11 19:14:28 1998 -@@ -0,0 +1,246 @@ ++++ work/net/atm/mpoa_proc.c Wed Aug 12 19:27:54 1998 +@@ -0,0 +1,223 @@ +#include + +#ifdef CONFIG_PROC_FS @@ -14829,32 +14914,15 @@ + * file system statistics + */ + ++#define STAT_FILE_NAME "mpc" /* Our statistic file's name */ ++ +extern struct mpoa_client *mpcs; ++extern struct proc_dir_entry atm_proc_root; /* from proc.c. */ + +static ssize_t proc_mpc_read(struct file *file, char *buff, + size_t count, loff_t *pos); + +/* -+ * /proc/mpoa DIRECTORY ENTRY. -+ */ -+static struct proc_dir_entry mpc_proc_root = { -+ 0, /* low_ino (0=dynamic?) */ -+ 4, /* name length */ -+ "mpoa", /* name string */ -+ S_IFDIR | S_IRUGO | S_IXUGO, /* mode/permissions */ -+ 2, /* 2=dir */ -+ 0, /* UID */ -+ 0, /* GID */ -+ 0, /* size */ -+ &proc_dir_inode_operations, /* inode operations */ -+ NULL, /* get_info func-ptr */ -+ NULL, /* fill_inode func-ptr */ -+ NULL, /* next ptr */ -+ NULL, /* parent ptr */ -+ NULL /* subdir ptr */ -+}; -+ -+/* + * Define allowed FILE OPERATIONS + */ +static struct file_operations mpc_file_operations = { @@ -14894,12 +14962,12 @@ +}; + +/* -+ * /proc/mpoa/mpc_stats REGULAR_FILE ++ * Our statistics file + */ +static struct proc_dir_entry mpc_stats = { + 0, /* low_ino */ -+ 9, /* name length */ -+ "mpc_stats", /* name */ ++ sizeof(STAT_FILE_NAME)-1, /* name length */ ++ STAT_FILE_NAME, /* name */ + S_IFREG | S_IRUGO, /* mode */ + 1, /* 1=file */ + 0, /* UID */ @@ -15027,13 +15095,8 @@ +{ + int retval = 0; + -+ if ( (retval = proc_register(&proc_root,&mpc_proc_root)) != 0 ) { -+ printk(KERN_ERR "Unable to initialize /proc/mpoa/\n"); -+ return retval; -+ } -+ -+ if ( (retval = proc_register(&mpc_proc_root,&mpc_stats)) != 0 ) { -+ printk(KERN_ERR "Unable to initialize /proc/mpoa/mpc_stats\n"); ++ if ( (retval = proc_register(&atm_proc_root,&mpc_stats)) != 0 ) { ++ printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME); + return retval; + } + return 0; @@ -15044,8 +15107,7 @@ + */ +void mpc_proc_clean(void) +{ -+ proc_unregister(&mpc_proc_root,mpc_stats.low_ino); -+ proc_unregister(&proc_root,mpc_proc_root.low_ino); ++ proc_unregister(&atm_proc_root,mpc_stats.low_ino); +} + + @@ -15057,8 +15119,8 @@ + + --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/lane_mpoa_init.c Tue Aug 11 19:14:28 1998 -@@ -0,0 +1,44 @@ ++++ work/net/atm/lane_mpoa_init.c Tue Aug 18 13:10:32 1998 +@@ -0,0 +1,48 @@ +#include +#include + @@ -15086,6 +15148,7 @@ +extern struct atm_mpoa_ops atm_mpoa_ops; /* in common.c */ +extern struct atm_lane_ops atm_lane_ops; /* in common.c */ + ++#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) +void atm_mpoa_init(void) +{ +#ifndef CONFIG_ATM_MPOA_MODULE /* not module */ @@ -15094,7 +15157,9 @@ + + return; +} ++#endif + ++#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) +void atm_lane_init(void) +{ +#ifndef CONFIG_ATM_LANE_MODULE /* not module */ @@ -15103,6 +15168,7 @@ + + return; +} ++#endif --- /dev/null Tue Jan 1 05:00:00 1980 +++ work/net/atm/proc.c Tue Aug 11 20:42:50 1998 @@ -0,0 +1,610 @@ @@ -16169,7 +16235,7 @@ +EXPORT_SYMBOL(shutdown_atm_dev); +EXPORT_SYMBOL(bind_vcc); --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/resources.h Tue Aug 11 20:07:10 1998 ++++ work/net/atm/resources.h Wed Aug 19 14:31:31 1998 @@ -0,0 +1,32 @@ +/* net/atm/resources.h - ATM-related resources */ + @@ -16204,7 +16270,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/signaling.c Tue Aug 4 18:41:24 1998 ++++ work/net/atm/signaling.c Tue Aug 18 13:43:42 1998 @@ -0,0 +1,252 @@ +/* net/atm/signaling.c - ATM signaling */ + @@ -16212,7 +16278,7 @@ + + +#include /* error codes */ -+#include /* printk, suser */ ++#include /* printk */ +#include +#include +#include /* jiffies and HZ */ @@ -16459,7 +16525,7 @@ + return 0; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/signaling.h Tue Aug 11 19:46:26 1998 ++++ work/net/atm/signaling.h Wed Aug 19 14:31:31 1998 @@ -0,0 +1,25 @@ +/* net/atm/signaling.h - ATM signaling */ + @@ -16906,38 +16972,15 @@ + +#endif --- ref/net/core/skbuff.c Thu May 14 19:26:22 1998 -+++ work/net/core/skbuff.c Tue Jun 9 21:32:12 1998 -@@ -149,6 +149,13 @@ ++++ work/net/core/skbuff.c Tue Aug 18 14:04:05 1998 +@@ -149,6 +149,10 @@ skb->is_clone = 0; skb->cloned = 0; +#ifdef CONFIG_ATM + skb->atm.iovcnt = 0; -+#ifdef CONFIG_ATM_NICSTAR -+ skb->atm.recycle_buffer = NULL; -+#endif +#endif + atomic_set(&skb->users, 1); atomic_set(skb_datarefp(skb), 1); return skb; -@@ -241,6 +248,9 @@ - n->is_clone = 1; - atomic_set(&n->users, 1); - n->destructor = NULL; -+#ifdef CONFIG_ATM_NICSTAR -+ n->atm.recycle_buffer = NULL; -+#endif - return n; - } - -@@ -291,6 +301,9 @@ - n->stamp=skb->stamp; - n->destructor = NULL; - n->security=skb->security; -+#ifdef CONFIG_ATM_NICSTAR -+ n->atm.recycle_buffer = NULL; -+#endif - return n; - } - diff -ur --new-file old/atm/doc/usage.tex new/atm/doc/usage.tex --- old/atm/doc/usage.tex Wed Aug 12 19:41:18 1998 +++ new/atm/doc/usage.tex Wed Aug 19 16:41:03 1998 @@ -1,7 +1,7 @@ %%def%:= %:\begin{verbatim} -%:Usage instructions - ATM on Linux, release 0.40 +%:Usage instructions - ATM on Linux, release 0.41 %:------------------------------------------------- %: %:\end{verbatim} @@ -38,14 +38,14 @@ \title{ATM on Linux \\ User's guide \\ - Release 0.40 (alpha)} + Release 0.41 (alpha)} \author{Werner Almesberger \\ {\tt Werner.Almesberger@epfl.ch} \\ \\ Institute for computer Communications and Applications (ICA) \\ EPFL, CH-1015 Lausanne, Switzerland} -\date{August 12, 1998} +\date{August 19, 1998} \begin{document} \maketitle @@ -81,7 +81,7 @@ In order to install this package, you need \begin{itemize} \item the package itself - \url{ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.40.tar.gz} + \url{ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.41.tar.gz} \item the Linux kernel, version 2.1.105, e.g. from \url{ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.105.tar.gz} \item Perl, version 4 or 5 @@ -98,7 +98,7 @@ distribution: \begin{verbatim} -tar xfz atm-0.40.tar.gz +tar xfz atm-0.41.tar.gz \end{verbatim} and the kernel source: @@ -178,7 +178,8 @@ %after usec %Rolfs TI TNETA1570 (CONFIG_ATM_TNETA1570) % Enable extended debugging (CONFIG_ATM_TNETA1570_DEBUG) -%IDT 77201 (NICStAR) (CONFIG_ATM_NICSTAR) +IDT 77201 (NICStAR) (CONFIG_ATM_NICSTAR) + %The ``MMU hacks'' add single-copy support for raw AAL5 on adapters whose %driver supports this (currently only the ENI155p). Extended debugging should @@ -188,8 +189,8 @@ %The TNETA1570 driver is for a board developed by Rolf Fiedler at TU Chemnitz, %see also \url{ftp://ftp.infotech.tu-chemnitz.de/pub/linux-atm}. -%Note that the file \path{drivers/atm/nicstar.h} contains a few configurable -%settings for the IDT 77201 driver. +% Note that the file \path{drivers/atm/nicstar.h} contains a few configurable +% settings for the IDT 77201 driver. Then build your kernel and reboot. diff -ur --new-file old/atm/doc/usage.txt new/atm/doc/usage.txt --- old/atm/doc/usage.txt Thu Aug 13 13:38:23 1998 +++ new/atm/doc/usage.txt Wed Aug 19 16:45:55 1998 @@ -1,4 +1,4 @@ -Usage instructions - ATM on Linux, release 0.40 +Usage instructions - ATM on Linux, release 0.41 ------------------------------------------------- For updates of ATM on Linux, please check the Web page at @@ -17,7 +17,7 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.40.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.41.tar.gz - the Linux kernel, version 2.1.105, e.g. from ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.105.tar.gz - Perl, version 4 or 5 @@ -33,7 +33,7 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.40.tar.gz +tar xfz atm-0.41.tar.gz and the kernel source: @@ -91,6 +91,8 @@ ZeitNet ZN1221/ZN1225 (CONFIG_ATM_ZATM) Enable extended debugging (CONFIG_ATM_ZATM_DEBUG) Enable usec resolution timestamps (CONFIG_ATM_ZATM_EXACT_TS) + +IDT 77201 (NICStAR) (CONFIG_ATM_NICSTAR) Then build your kernel and reboot. diff -ur --new-file old/atm/maint/Makefile new/atm/maint/Makefile --- old/atm/maint/Makefile Wed Jun 17 19:09:47 1998 +++ new/atm/maint/Makefile Wed Aug 19 16:40:54 1998 @@ -1,6 +1,6 @@ INCLUDES=-I../qgen -I../saal BOOTPGMS=atmaddr esi -SYSPGMS=atmtcp zntune +SYSPGMS=atmtcp zntune # nstune USRPGMS=atmdiag atmdump sonetdiag saaldump MAN8=atmaddr.8 atmdiag.8 atmdump.8 atmtcp.8 diff -ur --new-file old/atm/mkdist new/atm/mkdist --- old/atm/mkdist Tue Aug 11 19:40:26 1998 +++ new/atm/mkdist Wed Aug 19 16:40:37 1998 @@ -16,7 +16,7 @@ atm/CHANGES atm/BUGS \ atm/COPYING atm/COPYING.GPL atm/COPYING.LGPL \ atm/Makefile atm/Rules.make atm/mkdist atm/mkdiff atm/mkbindist \ - atm/.kernel \ + atm/mkpatch atm/.kernel \ atm/doc/README atm/doc/usage.tex atm/doc/usage.txt atm/doc/url.sty \ atm/doc/Makefile atm/doc/rlatex atm/doc/t2a.pl \ atm/man/Makefile atm/man/qos.7 atm/man/sap.7 \ @@ -135,4 +135,4 @@ # atm/atm-$VERSION-1.spec | gzip -9 >$ARCHDIR/atm-$VERSION.tar.gz #atm/bind-4.9.4.T4B.ATM.patch -# atm/WARNING \ +# atm/maint/README.nstune atm/maint/nstune.c \ diff -ur --new-file old/atm/mkpatch new/atm/mkpatch --- old/atm/mkpatch Thu Jan 1 01:00:00 1970 +++ new/atm/mkpatch Wed Aug 19 16:45:43 1998 @@ -0,0 +1,157 @@ +#!/bin/sh +>atm.patch +for n in `awk '$1 !~ /^#/ {print$1}' <>atm.patch +done +exit + +DEAD + + drivers/atm/fore200.c DEAD + include/linux/netdevice.h DEAD + drivers/net/net_init.c + drivers/net/eql.c + drivers/net/pi2.c + drivers/net/ppp.c + +AREQUIPA + + net/atm/arequipa.c + include/net/route.h + include/net/sock.h + net/ipv4/af_inet.c + net/ipv4/ip_forward.c + net/ipv4/ip_input.c + net/ipv4/ip_output.c + net/ipv4/ip_socketglue.c + net/ipv4/raw.c + net/ipv4/tcp_ipv4.c + net/ipv4/udp.c + +LATER ? + + include/linux/mmuio.h + net/atm/mmuio.c + arch/sparc/config.in + kernel/ksyms.c + include/linux/pci.h + + fs/proc/inode.c NO + + net/atm/dev.c + net/atm/ipcommon.h + net/atm/ipcommon.c + include/net/ip.h + include/net/tcp.h + net/ipv4/arp.c + net/ipv4/tcp_input.c + net/ipv4/Config.in + net/core/sock.c + net/ipv4/tcp_output.c diff -ur --new-file old/atm/mpoad/README.mpoa new/atm/mpoad/README.mpoa --- old/atm/mpoad/README.mpoa Fri Aug 7 16:24:57 1998 +++ new/atm/mpoad/README.mpoa Wed Aug 19 17:07:46 1998 @@ -1,4 +1,4 @@ -August 7 1998 +August 19 1998 This is the first version of MPOA client for Linux. In order to run MPOA you need to have LANE client (zeppelin) running too. Below is a @@ -41,10 +41,38 @@ advertise it's MAC address via MPOA device discovery. Shortcuts, shortcut states and packet counters are available in -/proc/mpoa/mpc_stats. +/proc/atm/mpc + +How to create CBR SVCs +====================== + +You can create CBR SVCs with /proc/atm/mpc. Here is an example: + +# echo "add 130.230.54.142 tx=40000,40000,0,300,1536 rx=40000,40000,0,300,1536" > /proc/atm/mpc + +After this when a shortcut is created to destination 130.230.54.142 it will +be signaled using the above values which are + + tx=max_pcr,pcr,min_pcr,max_cdv,max_sdu rx=max_pcr,pcr,min_pcr,max_cdv,max_sdu + +These correspond to values in + struct atm_trafprm + +An entry can be deleted like this: + +# echo "del 130.230.54.142" > /proc/atm/mpc + +Existing entries can be checked with + +% cat /proc/atm/mpc + + +Other things +============ If you are running your LANE services on a Fore switch, you can try the '-f' option for zeppelin. My favourite is -f "`fortune`" :) + Sampo Saaristo Heikki Vatiainen diff -ur --new-file old/atm/mpoad/TODO new/atm/mpoad/TODO --- old/atm/mpoad/TODO Fri Aug 7 16:18:59 1998 +++ new/atm/mpoad/TODO Wed Aug 19 17:07:46 1998 @@ -1,6 +1,8 @@ Check that closing unused SVCs does not create synchronization problems -Move /proc/mpoa/mpc_stats to /proc/atm/ +Get configuration information from LECS + +Handling of IP masks in NHRP purge requests MPOA spec, A.1.4, IP Options, check them diff -ur --new-file old/atm/mpoad/io.c new/atm/mpoad/io.c --- old/atm/mpoad/io.c Wed Aug 12 18:10:15 1998 +++ new/atm/mpoad/io.c Wed Aug 19 17:07:46 1998 @@ -78,7 +78,7 @@ static int add_shortcut(int slot, int type); static int check_connection(int slot); static int complete_connection(int slot); -static int create_shortcut(char *atm_addr); +static int create_shortcut(char *atm_addr,struct atm_qos qos); static void wait_for_mps_ctrl_addr(void); static int connect_to_MPS(void); @@ -581,18 +581,18 @@ /* * Called if kernel wants us to create a shortcut */ -void create_ingress_svc(uint32_t ipaddr, char *atm_addr) +void create_ingress_svc(uint32_t ipaddr, char *atm_addr, struct atm_qos qos) { int i, new_socket; - - new_socket = create_shortcut(atm_addr); + + new_socket = create_shortcut(atm_addr,qos); if (new_socket < 0) { printf("mpcd: io.c: create_ingress_svc: create_shortcut failed\n"); return; } for (i = first_empty; i < OPEN_MAX; i++) { - if (fds[i].fd >= 0) /* slot in use ? */ + if (fds[i].fd >= 0) /* slot in use ? */ continue; fds[i].fd = new_socket; fds[i].events = POLLIN | POLLOUT; @@ -627,7 +627,7 @@ * returns < 0 for error, socket for ok * */ -static int create_shortcut(char *atm_addr) +static int create_shortcut(char *atm_addr, struct atm_qos qos) { int s, flags, retval; struct sockaddr_atmsvc addr; @@ -638,6 +638,13 @@ addr.sas_family = AF_ATMSVC; memcpy(addr.sas_addr.prv, atm_addr, ATM_ESA_LEN); s = get_socket(&data_listen_addr); + if(qos.txtp.traffic_class > ATM_UBR || qos.rxtp.traffic_class > ATM_UBR){ + if (setsockopt(s, SOL_ATM,SO_ATMQOS, &qos, sizeof(qos)) < 0){ + printf("mpcd: io.c: setsockopt SO_ATMQOS failed: %s \n",strerror(errno)); + close(s); + return -1; + } + } dprintf("mpcd: create_shortcut() got fd %d \n", s); if ( (flags = fcntl(s, F_GETFL)) < 0) { printf("mpcd: io.c: fcntl(F_GETFL) failed: %s\n", strerror(errno)); diff -ur --new-file old/atm/mpoad/io.h new/atm/mpoad/io.h --- old/atm/mpoad/io.h Mon Aug 3 14:22:51 1998 +++ new/atm/mpoad/io.h Wed Aug 19 17:07:46 1998 @@ -9,7 +9,7 @@ int send_to_dataplane(char *buff, int length, int fd); void keep_alive_sm(unsigned keep_alive_lifetime, int sequence_number); int get_socket(struct sockaddr_atmsvc *address); -void create_ingress_svc(uint32_t ipaddr, char *atm_addr); +void create_ingress_svc(uint32_t ipaddr, char *atm_addr, struct atm_qos qos); /* Socket types and states */ #define NOT_USED 0x0000 diff -ur --new-file old/atm/mpoad/k_interf.c new/atm/mpoad/k_interf.c --- old/atm/mpoad/k_interf.c Fri Aug 7 15:04:39 1998 +++ new/atm/mpoad/k_interf.c Wed Aug 19 17:07:47 1998 @@ -28,6 +28,8 @@ static void snd_mpoa_res_rtry(struct k_message *msg); static void set_mps_ctrl_addr(struct k_message *msg); static void stop_keep_alive_sm(void); +static uint32_t traff_class_to_service_category(uint8_t traffic_class); + /* * returns < 0 for error * @@ -109,7 +111,8 @@ case OPEN_INGRESS_SVC: dprintf(" open_ingress_svc"); create_ingress_svc(msg.content.in_info.in_dst_ip, - msg.content.in_info.eg_MPC_ATM_addr); + msg.content.in_info.eg_MPC_ATM_addr, + msg.qos); return 1; break; default: @@ -125,7 +128,7 @@ 1, /* Source ip present */ msg->content.in_info.in_dst_ip, 0, /* prefix length */ - msg->content.in_info.service_category); + traff_class_to_service_category(msg->qos.txtp.traffic_class)); return; } @@ -137,7 +140,7 @@ 1, msg->content.in_info.in_dst_ip, 0, - msg->content.in_info.service_category); + traff_class_to_service_category(msg->qos.txtp.traffic_class)); return; } @@ -176,4 +179,23 @@ return; } +/* + * Converts linux-ATM traffic descriptions to those used in MPOA ATM service + * category extension. Only UBR and CBR supported. + */ +static uint32_t traff_class_to_service_category(uint8_t traffic_class){ + switch(traffic_class){ + case ATM_NONE: + return 0; + break; + case ATM_UBR: + return 0; + break; + case ATM_CBR: + return CBR; + break; + default: + return 0; + } +} diff -ur --new-file old/atm/mpoad/p_factory.c new/atm/mpoad/p_factory.c --- old/atm/mpoad/p_factory.c Mon Aug 10 14:52:47 1998 +++ new/atm/mpoad/p_factory.c Wed Aug 19 17:07:47 1998 @@ -307,7 +307,7 @@ extension_with_value = (struct nhrp_extension_with_value *)(reply + pos); extension_with_value->type = htons(MPOA_ATM_SERVICE_CATEGORY_EXTENSION); extension_with_value->length = htons(sizeof(values.service_category)); - extension_with_value->value = htonl(values.service_category); + extension_with_value->value = htonl(CBR); /* FIXME */ pos += sizeof(struct nhrp_extension_with_value); } if(values.dll_header_present){ @@ -388,3 +388,5 @@ finish(pos, buff, fixed); return send_to_mps(buff,pos); } + + diff -ur --new-file old/atm/mpoad/p_recogn.c new/atm/mpoad/p_recogn.c --- old/atm/mpoad/p_recogn.c Fri Aug 7 15:17:04 1998 +++ new/atm/mpoad/p_recogn.c Wed Aug 19 17:07:47 1998 @@ -56,11 +56,12 @@ pos += sizeof(struct nhrp_extension_with_value); break; case MPOA_ATM_SERVICE_CATEGORY_EXTENSION: - dprintf("mpcd: p_recogn.c: mpoa_atm_service_category_extension.\n"); + printf("mpcd: p_recogn.c: mpoa_atm_service_category_extension."); ext_with_value = (struct nhrp_extension_with_value *)(buff + pos); values->service_category_present = 1; values->service_category = ntohl(ext_with_value->value); pos += sizeof(struct nhrp_extension_with_value); + printf("service_category = %u\n",values->service_category); break; case MPOA_KEEPALIVE_LIFETIME_EXTENSION: dprintf("mpcd: p_recogn.c: mpoa_keepalive_lifetime_extension.\n"); diff -ur --new-file old/atm/mpoad/packets.h new/atm/mpoad/packets.h --- old/atm/mpoad/packets.h Mon Aug 3 13:41:21 1998 +++ new/atm/mpoad/packets.h Wed Aug 19 17:07:47 1998 @@ -343,6 +343,12 @@ #define ID_EXPIRING_TIME 600 +/* ATM service categories */ + +#define RT_VBR 0x0001 +#define NRT_VBR 0x0002 +#define ABR 0x0004 +#define CBR 0x0008 #endif /* PACKETS_H */ .