checkpoint for ``alpha tape''; tp is still a little broken.
authorKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Wed, 30 Aug 1989 04:45:52 +0000 (20:45 -0800)
committerKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Wed, 30 Aug 1989 04:45:52 +0000 (20:45 -0800)
SCCS-vsn: sys/netiso/clnp_debug.c 7.4
SCCS-vsn: sys/netiso/clnp_er.c 7.4
SCCS-vsn: sys/netiso/clnp_frag.c 7.5
SCCS-vsn: sys/netiso/clnp_input.c 7.6
SCCS-vsn: sys/netiso/clnp_output.c 7.4
SCCS-vsn: sys/netiso/clnp_options.c 7.5
SCCS-vsn: sys/netiso/clnp_raw.c 7.4
SCCS-vsn: sys/netiso/clnp_subr.c 7.6
SCCS-vsn: sys/netiso/clnp_timer.c 7.3
SCCS-vsn: sys/netiso/cons_pcb.h 7.3
SCCS-vsn: sys/netiso/esis.c 7.4
SCCS-vsn: sys/netiso/esis.h 7.3
SCCS-vsn: sys/netiso/if_eon.c 7.4
SCCS-vsn: sys/netiso/iso.c 7.5
SCCS-vsn: sys/netiso/iso.h 7.3
SCCS-vsn: sys/netiso/iso_chksum.c 7.3
SCCS-vsn: sys/netiso/iso_errno.h 7.3
SCCS-vsn: sys/netiso/iso_pcb.c 7.5
SCCS-vsn: sys/netiso/iso_pcb.h 7.3
SCCS-vsn: sys/netiso/iso_proto.c 7.3
SCCS-vsn: sys/netiso/iso_snpac.c 7.5
SCCS-vsn: sys/netiso/iso_snpac.h 7.3
SCCS-vsn: sys/netiso/iso_usrreq.c 7.3
SCCS-vsn: sys/netiso/tp.trans 7.3
SCCS-vsn: sys/netiso/tp_astring.c 7.3
SCCS-vsn: sys/netiso/tp_cons.c 7.3
SCCS-vsn: sys/netiso/tp_emit.c 7.3
SCCS-vsn: sys/netiso/tp_inet.c 7.4
SCCS-vsn: sys/netiso/tp_input.c 7.3
SCCS-vsn: sys/netiso/tp_iso.c 7.3
SCCS-vsn: sys/netiso/tp_meas.c 7.3
SCCS-vsn: sys/netiso/tp_meas.h 7.3
SCCS-vsn: sys/netiso/tp_pcb.c 7.3
SCCS-vsn: sys/netiso/tp_output.c 7.4
SCCS-vsn: sys/netiso/tp_param.h 7.4
SCCS-vsn: sys/netiso/tp_pcb.h 7.4
SCCS-vsn: sys/netiso/tp_seq.h 7.3
SCCS-vsn: sys/netiso/tp_sizes.c 7.3
SCCS-vsn: sys/netiso/tp_subr.c 7.3
SCCS-vsn: sys/netiso/tp_tpdu.h 7.3
SCCS-vsn: sys/netiso/tp_subr2.c 7.3
SCCS-vsn: sys/netiso/tp_timer.c 7.3
SCCS-vsn: sys/netiso/tp_timer.h 7.3
SCCS-vsn: sys/netiso/tp_user.h 7.4
SCCS-vsn: sys/netiso/tp_trace.c 7.3
SCCS-vsn: sys/netiso/tp_trace.h 7.3
SCCS-vsn: sys/netiso/tp_usrreq.c 7.4

47 files changed:
usr/src/sys/netiso/clnp_debug.c
usr/src/sys/netiso/clnp_er.c
usr/src/sys/netiso/clnp_frag.c
usr/src/sys/netiso/clnp_input.c
usr/src/sys/netiso/clnp_options.c
usr/src/sys/netiso/clnp_output.c
usr/src/sys/netiso/clnp_raw.c
usr/src/sys/netiso/clnp_subr.c
usr/src/sys/netiso/clnp_timer.c
usr/src/sys/netiso/cons_pcb.h
usr/src/sys/netiso/esis.c
usr/src/sys/netiso/esis.h
usr/src/sys/netiso/if_eon.c
usr/src/sys/netiso/iso.c
usr/src/sys/netiso/iso.h
usr/src/sys/netiso/iso_chksum.c
usr/src/sys/netiso/iso_errno.h
usr/src/sys/netiso/iso_pcb.c
usr/src/sys/netiso/iso_pcb.h
usr/src/sys/netiso/iso_proto.c
usr/src/sys/netiso/iso_snpac.c
usr/src/sys/netiso/iso_snpac.h
usr/src/sys/netiso/iso_usrreq.c
usr/src/sys/netiso/tp.trans
usr/src/sys/netiso/tp_astring.c
usr/src/sys/netiso/tp_cons.c
usr/src/sys/netiso/tp_emit.c
usr/src/sys/netiso/tp_inet.c
usr/src/sys/netiso/tp_input.c
usr/src/sys/netiso/tp_iso.c
usr/src/sys/netiso/tp_meas.c
usr/src/sys/netiso/tp_meas.h
usr/src/sys/netiso/tp_output.c
usr/src/sys/netiso/tp_param.h
usr/src/sys/netiso/tp_pcb.c
usr/src/sys/netiso/tp_pcb.h
usr/src/sys/netiso/tp_seq.h
usr/src/sys/netiso/tp_sizes.c
usr/src/sys/netiso/tp_subr.c
usr/src/sys/netiso/tp_subr2.c
usr/src/sys/netiso/tp_timer.c
usr/src/sys/netiso/tp_timer.h
usr/src/sys/netiso/tp_tpdu.h
usr/src/sys/netiso/tp_trace.c
usr/src/sys/netiso/tp_trace.h
usr/src/sys/netiso/tp_user.h
usr/src/sys/netiso/tp_usrreq.c

index 77f6cde..c0772b0 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: clnp_debug.c,v 4.2 88/06/29 14:58:34 hagens Exp $ */
 /* $Source: /usr/argo/sys/netargo/RCS/clnp_debug.c,v $ */
  */
 /* $Header: clnp_debug.c,v 4.2 88/06/29 14:58:34 hagens Exp $ */
 /* $Source: /usr/argo/sys/netargo/RCS/clnp_debug.c,v $ */
+/*     @(#)clnp_debug.c        7.4 (Berkeley) %G% */
 
 #ifndef lint
 static char *rcsid = "$Header: clnp_debug.c,v 4.2 88/06/29 14:58:34 hagens Exp $";
 
 #ifndef lint
 static char *rcsid = "$Header: clnp_debug.c,v 4.2 88/06/29 14:58:34 hagens Exp $";
@@ -220,7 +221,7 @@ register struct sockaddr_iso *s;
 
        while (*cp) cp++;
        *cp++ = '(';
 
        while (*cp) cp++;
        *cp++ = '(';
-       cp = clnp_hexp(TSEL(s), (int)s->siso_tsuffixlen, cp);
+       cp = clnp_hexp(TSEL(s), (int)s->siso_tlen, cp);
        *cp++ = ')';
        *cp++ = 0;
        return (iso_addr_b);
        *cp++ = ')';
        *cp++ = 0;
        return (iso_addr_b);
index 93639e1..41641a1 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_er.c,v 5.1 89/02/09 16:20:18 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_er.c,v $ */
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_er.c,v 5.1 89/02/09 16:20:18 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_er.c,v $ */
+/*     @(#)clnp_er.c   7.4 (Berkeley) %G% */
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_er.c,v 5.1 89/02/09 16:20:18 hagens Exp $";
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_er.c,v 5.1 89/02/09 16:20:18 hagens Exp $";
index cada3f6..64c0b8f 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_frag.c,v 5.1 89/02/09 16:20:26 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_frag.c,v $ */
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_frag.c,v 5.1 89/02/09 16:20:26 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_frag.c,v $ */
+/*     @(#)clnp_frag.c 7.5 (Berkeley) %G% */
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_frag.c,v 5.1 89/02/09 16:20:26 hagens Exp $";
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_frag.c,v 5.1 89/02/09 16:20:26 hagens Exp $";
index 1dff8db..60e9239 100644 (file)
@@ -26,7 +26,7 @@ SOFTWARE.
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_input.c,v 5.1 89/02/09 16:20:32 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_input.c,v $ */
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_input.c,v 5.1 89/02/09 16:20:32 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_input.c,v $ */
-/*     @(#)clnp_input.c        7.5 (Berkeley) %G% */
+/*     @(#)clnp_input.c        7.6 (Berkeley) %G% */
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_input.c,v 5.1 89/02/09 16:20:32 hagens Exp $";
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_input.c,v 5.1 89/02/09 16:20:32 hagens Exp $";
@@ -51,10 +51,11 @@ static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_input.c,v 5.1 89/02/
 #include "iso_snpac.h"
 #include "clnp.h"
 #include "clnl.h"
 #include "iso_snpac.h"
 #include "clnp.h"
 #include "clnl.h"
+#include "esis.h"
 #include "../netinet/in_systm.h"
 #include "../netinet/ip.h"
 #include "../netinet/in_systm.h"
 #include "../netinet/ip.h"
+#include "../netinet/if_ether.h"
 #include "eonvar.h"
 #include "eonvar.h"
-#include "esis.h"
 #include "clnp_stat.h"
 #include "argo_debug.h"
 
 #include "clnp_stat.h"
 #include "argo_debug.h"
 
@@ -161,11 +162,11 @@ next:
 
        default:
                if (sh.snh_ifp->if_output == ether_output) {
 
        default:
                if (sh.snh_ifp->if_output == ether_output) {
-                       bcopy((caddr_t)(mtod(m, struct llc_etherhdr *)->dst),
+                       bcopy((caddr_t)(mtod(m, struct ether_header *)->ether_dhost),
                                (caddr_t)sh.snh_dhost, 2*sizeof(sh.snh_dhost));
                                (caddr_t)sh.snh_dhost, 2*sizeof(sh.snh_dhost));
-                       m->m_data += sizeof (struct llc_etherhdr);
-                       m->m_len -= sizeof (struct llc_etherhdr);
-                       m->m_pkthdr.len -= sizeof (struct llc_etherhdr);
+                       m->m_data += sizeof (struct ether_header);
+                       m->m_len -= sizeof (struct ether_header);
+                       m->m_pkthdr.len -= sizeof (struct ether_header);
                }
        }
        IFDEBUG(D_INPUT)
                }
        }
        IFDEBUG(D_INPUT)
index 7f65949..65ca192 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_options.c,v 5.1 89/02/09 16:20:37 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_options.c,v $ */
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_options.c,v 5.1 89/02/09 16:20:37 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_options.c,v $ */
+/*     @(#)clnp_options.c      7.5 (Berkeley) %G% */
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_options.c,v 5.1 89/02/09 16:20:37 hagens Exp $";
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_options.c,v 5.1 89/02/09 16:20:37 hagens Exp $";
index 293774f..6d3294d 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_output.c,v 5.0 89/02/08 12:00:15 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_output.c,v $ */
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_output.c,v 5.0 89/02/08 12:00:15 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_output.c,v $ */
+/*     @(#)clnp_output.c       7.4 (Berkeley) %G% */
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_output.c,v 5.0 89/02/08 12:00:15 hagens Exp $";
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_output.c,v 5.0 89/02/08 12:00:15 hagens Exp $";
@@ -136,14 +137,14 @@ int                               clnp_id = 0;            /* id for segmented dgrams */
  *                                     to have clnp check that the route has the same dest, but
  *                                     by avoiding this check, we save a call to iso_addrmatch1.
  */
  *                                     to have clnp check that the route has the same dest, but
  *                                     by avoiding this check, we save a call to iso_addrmatch1.
  */
-clnp_output(m0, isop, flags)
+clnp_output(m0, isop, datalen, flags)
 struct mbuf                    *m0;            /* data for the packet */
 struct isopcb          *isop;          /* iso pcb */
 struct mbuf                    *m0;            /* data for the packet */
 struct isopcb          *isop;          /* iso pcb */
+int                                    datalen;        /* number of bytes of data in m0 */
 int                                    flags;          /* flags */
 {
        int                                                     error = 0;              /* return value of function */
        register struct mbuf            *m = m0;                /* mbuf for clnp header chain */
 int                                    flags;          /* flags */
 {
        int                                                     error = 0;              /* return value of function */
        register struct mbuf            *m = m0;                /* mbuf for clnp header chain */
-       int                                                     datalen;        /* number of bytes of data in m */
        register struct clnp_fixed      *clnp;                  /* ptr to fixed part of hdr */
        register caddr_t                        hoff;                   /* offset into header */
        int                                                     total_len;              /* total length of packet */
        register struct clnp_fixed      *clnp;                  /* ptr to fixed part of hdr */
        register caddr_t                        hoff;                   /* offset into header */
        int                                                     total_len;              /* total length of packet */
@@ -156,11 +157,6 @@ int                                        flags;          /* flags */
        src = &isop->isop_laddr->siso_addr;
        dst = &isop->isop_faddr->siso_addr;
 
        src = &isop->isop_laddr->siso_addr;
        dst = &isop->isop_faddr->siso_addr;
 
-       if ((m->m_flags & M_PKTHDR) == 0) {
-               m_freem(m);
-               return EINVAL;
-       }
-       datalen = m->m_pkthdr.len;
        IFDEBUG(D_OUTPUT)
                printf("clnp_output: to %s", clnp_iso_addrp(dst));
                printf(" from %s of %d bytes\n", clnp_iso_addrp(src), datalen);
        IFDEBUG(D_OUTPUT)
                printf("clnp_output: to %s", clnp_iso_addrp(dst));
                printf(" from %s of %d bytes\n", clnp_iso_addrp(src), datalen);
index 65bc31d..cb4367a 100644 (file)
@@ -25,6 +25,7 @@ SOFTWARE.
  */
 /* $Header: clnp_raw.c,v 4.2 88/06/29 14:58:56 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/clnp_raw.c,v $ */
  */
 /* $Header: clnp_raw.c,v 4.2 88/06/29 14:58:56 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/clnp_raw.c,v $ */
+/*     @(#)clnp_raw.c  7.4 (Berkeley) %G% */
 #ifndef lint
 static char *rcsid = "$Header: clnp_raw.c,v 4.2 88/06/29 14:58:56 hagens Exp $";
 #endif lint
 #ifndef lint
 static char *rcsid = "$Header: clnp_raw.c,v 4.2 88/06/29 14:58:56 hagens Exp $";
 #endif lint
@@ -113,6 +114,8 @@ struct socket       *so;    /* socket to send from */
        int                                             error;          /* return value of function */
        int                                             flags;          /* flags for clnp_output */
 
        int                                             error;          /* return value of function */
        int                                             flags;          /* flags for clnp_output */
 
+       if (0 == m0->m_flags & M_PKTHDR)
+               return (EINVAL);
        /*
         *      Set up src address. If user has bound socket to an address, use it.
         *      Otherwise, do not specify src (clnp_output will fill it in).
        /*
         *      Set up src address. If user has bound socket to an address, use it.
         *      Otherwise, do not specify src (clnp_output will fill it in).
@@ -134,7 +137,8 @@ bad:
        /* get flags and ship it off */
        flags = rp->risop_flags & CLNP_VFLAGS;
 
        /* get flags and ship it off */
        flags = rp->risop_flags & CLNP_VFLAGS;
 
-       error = clnp_output(m0, &rp->risop_isop, flags|CLNP_NOCACHE);
+       error = clnp_output(m0, &rp->risop_isop, m0->m_pkthdr.len,
+                                                                                               flags|CLNP_NOCACHE);
 
        return (error);
 }
 
        return (error);
 }
index 93930cb..edd9434 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_subr.c,v 5.1 89/02/09 16:20:46 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_subr.c,v $ */
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_subr.c,v 5.1 89/02/09 16:20:46 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_subr.c,v $ */
+/*     @(#)clnp_subr.c 7.6 (Berkeley) %G% */
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_subr.c,v 5.1 89/02/09 16:20:46 hagens Exp $";
 
 #ifndef lint
 static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_subr.c,v 5.1 89/02/09 16:20:46 hagens Exp $";
index e21fe7c..7fa0bdf 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: clnp_timer.c,v 4.2 88/06/29 14:59:05 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/clnp_timer.c,v $ */
  */
 /* $Header: clnp_timer.c,v 4.2 88/06/29 14:59:05 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/clnp_timer.c,v $ */
+/*     @(#)clnp_timer.c        7.3 (Berkeley) %G% */
 
 #ifndef lint
 static char *rcsid = "$Header: clnp_timer.c,v 4.2 88/06/29 14:59:05 hagens Exp $";
 
 #ifndef lint
 static char *rcsid = "$Header: clnp_timer.c,v 4.2 88/06/29 14:59:05 hagens Exp $";
index e396256..9db4a2c 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: cons_pcb.h,v 4.2 88/06/29 14:59:08 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/cons_pcb.h,v $ */
  */
 /* $Header: cons_pcb.h,v 4.2 88/06/29 14:59:08 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/cons_pcb.h,v $ */
+/*     @(#)cons_pcb.h  7.3 (Berkeley) %G% */
 
 /*
  * protocol control block for the connection oriented network service
 
 /*
  * protocol control block for the connection oriented network service
index e39a650..7162365 100644 (file)
@@ -24,6 +24,7 @@ SOFTWARE.
 /*
  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
  */
 /*
  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
  */
+/*     @(#)esis.c      7.4 (Berkeley) %G% */
 #ifndef lint
 static char *rcsid = "$Header: esis.c,v 4.10 88/09/15 18:57:03 hagens Exp $";
 #endif
 #ifndef lint
 static char *rcsid = "$Header: esis.c,v 4.10 88/09/15 18:57:03 hagens Exp $";
 #endif
@@ -51,8 +52,8 @@ static char *rcsid = "$Header: esis.c,v 4.10 88/09/15 18:57:03 hagens Exp $";
 #include "clnl.h"
 #include "clnp.h"
 #include "clnp_stat.h"
 #include "clnl.h"
 #include "clnp.h"
 #include "clnp_stat.h"
-#include "argo_debug.h"
 #include "esis.h"
 #include "esis.h"
+#include "argo_debug.h"
 
 /*
  *     Global variables to esis implementation
 
 /*
  *     Global variables to esis implementation
index f50c607..5250686 100644 (file)
@@ -27,6 +27,7 @@ SOFTWARE.
 /*
  *     $Header: esis.h,v 4.7 88/09/15 11:24:18 hagens Exp $
  *     $Source: /usr/argo/sys/netiso/RCS/esis.h,v $
 /*
  *     $Header: esis.h,v 4.7 88/09/15 11:24:18 hagens Exp $
  *     $Source: /usr/argo/sys/netiso/RCS/esis.h,v $
+ *     @(#)esis.h      7.3 (Berkeley) %G% *
  */
 
 #ifndef BYTE_ORDER
  */
 
 #ifndef BYTE_ORDER
index 21514dd..5b3051a 100644 (file)
@@ -27,6 +27,7 @@ SOFTWARE.
 /*
  * $Header: if_eon.c,v 1.4 88/07/19 15:53:59 hagens Exp $ 
  * $Source: /usr/argo/sys/netiso/RCS/if_eon.c,v $ 
 /*
  * $Header: if_eon.c,v 1.4 88/07/19 15:53:59 hagens Exp $ 
  * $Source: /usr/argo/sys/netiso/RCS/if_eon.c,v $ 
+ *     @(#)if_eon.c    7.4 (Berkeley) %G% *
  *
  *     EON rfc 
  *  Layer between IP and CLNL
  *
  *     EON rfc 
  *  Layer between IP and CLNL
index ba677c4..4c56147 100644 (file)
@@ -27,7 +27,7 @@ SOFTWARE.
 /*
  * $Header: iso.c,v 4.11 88/09/19 14:58:35 root Exp $ 
  * $Source: /usr/argo/sys/netiso/RCS/iso.c,v $ 
 /*
  * $Header: iso.c,v 4.11 88/09/19 14:58:35 root Exp $ 
  * $Source: /usr/argo/sys/netiso/RCS/iso.c,v $ 
- *     @(#)iso.c       7.4 (Berkeley) %G%
+ *     @(#)iso.c       7.5 (Berkeley) %G%
  *
  * iso.c: miscellaneous routines to support the iso address family
  */
  *
  * iso.c: miscellaneous routines to support the iso address family
  */
@@ -919,7 +919,7 @@ dump_isoaddr(s)
 
        if( s->siso_family == AF_ISO) {
                printf("ISO address: suffixlen %d, %s\n",
 
        if( s->siso_family == AF_ISO) {
                printf("ISO address: suffixlen %d, %s\n",
-                       s->siso_tsuffixlen, clnp_saddr_isop(s));
+                       s->siso_tlen, clnp_saddr_isop(s));
        } else if( s->siso_family == AF_INET) {
                /* hack */
                struct sockaddr_in *sin = (struct sockaddr_in *)s;
        } else if( s->siso_family == AF_INET) {
                /* hack */
                struct sockaddr_in *sin = (struct sockaddr_in *)s;
index ec870c6..5a821a5 100644 (file)
@@ -26,7 +26,7 @@ SOFTWARE.
  */
 /* $Header: iso.h,v 4.9 88/09/11 18:06:38 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/iso.h,v $ */
  */
 /* $Header: iso.h,v 4.9 88/09/11 18:06:38 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/iso.h,v $ */
-/*     @(#)iso.h       7.2 (Berkeley) %G% */
+/*     @(#)iso.h       7.3 (Berkeley) %G% */
 
 #ifndef __ISO__
 #define __ISO__
 
 #ifndef __ISO__
 #define __ISO__
@@ -86,209 +86,45 @@ SOFTWARE.
 #define        ISO9542_ESIS    0x82
 #define ISO9542X25_ESIS        0x8a
 
 #define        ISO9542_ESIS    0x82
 #define ISO9542X25_ESIS        0x8a
 
+
 #ifndef IN_CLASSA_NET
 #include "../netinet/in.h"
 #endif IN_CLASSA_NET
 
 #ifndef IN_CLASSA_NET
 #include "../netinet/in.h"
 #endif IN_CLASSA_NET
 
-/*
- *     Type 37 Address
- *
- *     This address is named for the value of its AFI (37). This format
- *     supports an X.121 address. A type 37 address has the following format:
- *
- *  <----- idp -------> <- dsp ->
- *  <- afi -> <- idi -> <- dsp ->
- *  | "37"   | 7 bytes | 9 bytes |
- *
- *     The idi contains 14 bcd digits of X.121 address.
- *     The use of the dsp part is unknown.
- *
- *     The afi is considered the "network" portion of the address.
- *  This means that you can't have multihoming in the x.25 environment.
- *  Makes loopback a bear.
- */
-#define BIGSOCKADDRS
-#ifdef BIGSOCKADDRS
-#define        ADDR37_IDI_LEN          7                       /* 14 bcd digits == 7 octets */
-#define        ADDR37_DSP_LEN          9
-#else
-#define        ADDR37_IDI_LEN          7                       /* 14 bcd digits == 7 octets */
-#define        ADDR37_DSP_LEN          3                       /* this is a lie to fit in sockaddr */
-#endif BIGSOCKADDRS
-struct addr_37 {
-       u_char a37_idi[ADDR37_IDI_LEN];         /* initial domain identifier */
-       u_char a37_dsp[ADDR37_DSP_LEN];         /* domain specific part */
-};
-
-struct ovl_37 {        /* overlay for type 37 address */
-       u_char  o37_afi;                                        /* afi */
-       u_char  o37_x121[ADDR37_IDI_LEN];       /* X.121 address */
-       u_char  o37_dsp[ADDR37_DSP_LEN];        /* unknown use at this time */
-};
-
-/*
- *     OSINET address
- *
- *     This style address is used by the OSINET group
- *     An OSINET address has the following (variable-length) format
- *
- *  <----- idp ------->  <---------------- dsp --------------------------->
- *  <- afi -> <- idi ->  <---------------- dsp --------------------------->
- *  | "47"   | "0004"   |             11 bytes                            |
- *  |  afi(1)| osinetid | orgid(2) | subnet id(2) | (4-8) | nsap sel(1) |
- *
- *     the afi, orgid, and subnet id are considered the "network" portion of
- *     the address.
- */
-#ifdef BIGSOCKADDRS
-#define ADDROSINET_IDI_LEN             2
-#define ADDROSINET_DSP_LEN             11
-#else
-#define ADDROSINET_IDI_LEN             2
-#define ADDROSINET_DSP_LEN             8               /* this is a lie to fit in sockaddr */
-#endif BIGSOCKADDRS
-struct addr_osinet {
-       u_char aosi_idi[ADDROSINET_IDI_LEN];            /* initial domain identifier */
-       u_char aosi_dsp[ADDROSINET_DSP_LEN];            /* domain specific part */
-};
-
-#define        OVLOSINET_ID_LEN                2
-#ifdef BIGSOCKADDRS
-#define        OVLOSINET_ORGID_LEN             2
-#define        OVLOSINET_SNETID_LEN    2
-#define        OVLOSINET_SNPA_LEN              8
-#define        OVLOSINET_NSAP_LEN              1
-#else
-#define        OVLOSINET_ORGID_LEN             2
-#define        OVLOSINET_SNETID_LEN    2
-#define        OVLOSINET_SNPA_LEN              5               /* this is a lie to fit in sockaddr */
-#define        OVLOSINET_NSAP_LEN              1
-#endif BIGSOCKADDRS
-struct ovl_osinet { /* overlay for osinet address */
-       u_char  oosi_afi;                                                       /* afi */
-       u_char  oosi_id[OVLOSINET_ID_LEN];                      /* osinet id */
-       u_char  oosi_orgid[OVLOSINET_ORGID_LEN];        /* orgid */
-       u_char  oosi_snetid[OVLOSINET_SNETID_LEN];      /* subnet id */
-       u_char  oosi_snpa[OVLOSINET_SNPA_LEN];          /* snpa */
-       u_char  oosi_nsap[OVLOSINET_NSAP_LEN];          /* nsap sel */
-};
-
-/*
- *     RFC 986 address
- *
- *     This style address is used when DOD internet addresses are used
- *     The format of rfc986 addresses is:
- *
- *  <----- idp -------> <---------------- dsp -------------------->
- *  <- afi -> <- idi -> <---------------- dsp -------------------->
- *  | "47"   | "0006"  |             6 bytes                       |
- *  |  afi(1)| idi(2)  | version (1) | inet addr (4) | proto id(1) |
- *
- *     the afi, idi, and network portion of the inet address are considered 
- *     the "network" portion of the address.
- */
-#define ADDRRFC986_IDI_LEN             2
-#define ADDRRFC986_DSP_LEN             6
-struct addr_rfc986 {
-       u_char  a986_idi[ADDRRFC986_IDI_LEN];           /* initial domain identifier */
-       u_char  a986_dsp[ADDRRFC986_DSP_LEN];           /* domain specific part */
-};
-
-#define        OVLRFC986_INET_LEN              4
-struct ovl_rfc986 {
-       u_char  o986_afi;                                                       /* afi */
-       u_char  o986_idi[ADDRRFC986_IDI_LEN];           /* idi */
-       u_char  o986_vers;                                                      /* version */
-       u_char  o986_inetaddr[OVLRFC986_INET_LEN];      /* internet address */
-       u_char  o986_upid;                                                      /* upper protocol id */
-};
-#define RFC986V1                               0x01                    /* version of 986 addr */
-
-#define        AFI_37          0x37    /* bcd of "37" */
-#define AFI_OSINET     0x47    /* bcd of "47" */
-#define AFI_RFC986     0x47    /* bcd of "47" */
-#define        AFI_SNA         0x00    /* SubNetwork Address; invalid really...
-                                                               - used by ES-IS */
-
-/* the idi for type 37 addresses is very different than the others */
-#define        IDI_OSINET      0x0004  /* bcd of "0004" */     
-#define        IDI_RFC986      0x0006  /* bcd of "0006" */
-
-/*
- *     This address type is used to store a subnetwork address in a 
- *     sockaddr_iso. The isoa_len field should contain the length of the
- *     subnetwork address plus the length of the afi (ie +1 ).
- *
- *     This address format is used only by the ES-IS protocol
- */
-#define        ADDRSNA_IDI_LEN         7
-struct addr_sn {
-       char    sna_addr[ADDRSNA_IDI_LEN];              /* subnetwork address */
-};
 
 
-/* 
- *     Type 47 is the biggest address: 11 bytes. The length of iso_addr
- *     is 13 bytes.
- */
-struct old_iso_addr {
-       u_char  isoa_afi;                                               /* authority and format id */
-       union {
-               struct addr_37          addr_37;                /* type 37 */
-               struct addr_osinet      addr_osinet;    /* type osinet */
-               struct addr_rfc986      addr_rfc986;    /* type rfc986 */
-               struct addr_sn          addr_sn;                /* subnetwork address */
-       }               isoa_u;
-       u_char  isoa_len;                                               /* length (in bytes) */
-};
 
 /* The following looks like a sockaddr
 
 /* The following looks like a sockaddr
- * in case we decide to use tree routines */
+ * to facilitate using tree lookup routines */
 struct iso_addr {
        u_char  isoa_len;                                               /* length (in bytes) */
        char    isoa_genaddr[20];                               /* general opaque address */
 };
 
 struct iso_addr {
        u_char  isoa_len;                                               /* length (in bytes) */
        char    isoa_genaddr[20];                               /* general opaque address */
 };
 
-#define t37_idi                isoa_u.addr_37.a37_idi
-#define        t37_dsp         isoa_u.addr_37.a37_dsp
-#define osinet_idi     isoa_u.addr_osinet.aosi_idi
-#define        osinet_dsp      isoa_u.addr_osinet.aosi_dsp
-#define        rfc986_idi      isoa_u.addr_rfc986.a986_idi
-#define        rfc986_dsp      isoa_u.addr_rfc986.a986_dsp
-#define sna_idi                isoa_u.addr_sn.sna_addr
-
-/*
- *     An iso_addr is 18 bytes, a sockaddr_iso is therefore 20 bytes.
- *     the struct sockaddr data field has been changed to 22 bytes.
- *
- * severly changed osinet and t37 addresses from argo code, we don't want
- * sockaddrs to grow bigger than the original 16 bytes so we changed the 
- * t37 and osinet addresses so that they were only 10 bytes long
- */
 struct sockaddr_iso {
        u_char                          siso_len;                       /* length */
        u_char                          siso_family;            /* family */
 struct sockaddr_iso {
        u_char                          siso_len;                       /* length */
        u_char                          siso_family;            /* family */
-       u_char                          siso_ssuffixlen;        /* session suffix len */
-       u_char                          siso_tsuffixlen;        /* transport suffix len */
-/*  u_char                             siso_nsaptype;          /* someday?? */
+       u_char                          siso_plen;                      /* presentation selector length */
+       u_char                          siso_slen;                      /* session selector length */
+       u_char                          siso_tlen;                      /* transport selector length */
        struct  iso_addr        siso_addr;                      /* network address */
        struct  iso_addr        siso_addr;                      /* network address */
-       u_char                          siso_pad[3];            /* make multiple of sizeof long */
+       u_char                          siso_pad[6];            /* space for gosip v2 sels */
+                                                                                       /* makes struct 32 bytes long */
 };
 };
-
-#define siso_data siso_addr.isoa_genaddr
 #define siso_nlen siso_addr.isoa_len
 #define siso_nlen siso_addr.isoa_len
+#define siso_data siso_addr.isoa_genaddr
+
 #define TSEL(s) ((caddr_t)((s)->siso_data + (s)->siso_nlen))
 
 #define SAME_ISOADDR(a, b) \
        (bcmp((a)->siso_data, (b)->siso_data, (unsigned)(a)->siso_nlen)==0)
 #define TSEL(s) ((caddr_t)((s)->siso_data + (s)->siso_nlen))
 
 #define SAME_ISOADDR(a, b) \
        (bcmp((a)->siso_data, (b)->siso_data, (unsigned)(a)->siso_nlen)==0)
-
-#define NSAPTYPE_UNKNOWN       -1
-#define NSAPTYPE_INET          0
-#define NSAPTYPE_X121BCD       1
-#define NSAPTYPE_X121BIN       2
-#define NSAPTYPE_DCCBCD                3
-#define NSAPTYPE_DCCBIN                4
-#define NSAPTYPE_OSINET        5
-#define NSAPTYPE_RFC986        6
+/*
+ * The following are specific values for siso->siso_data[0],
+ * otherwise known as the AFI:
+ */
+#define        AFI_37          0x37    /* bcd of "37" */
+#define AFI_OSINET     0x47    /* bcd of "47" */
+#define AFI_RFC986     0x47    /* bcd of "47" */
+#define        AFI_SNA         0x00    /* SubNetwork Address; invalid really...*/
 
 #ifdef KERNEL
 
 
 #ifdef KERNEL
 
@@ -307,5 +143,5 @@ struct hostent *iso_gethostbyname(), *iso_gethostbyaddr();
 
 #endif KERNEL
 
 
 #endif KERNEL
 
-#endif __ISO__
 #define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m))
 #define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m))
+#endif __ISO__
index 5668f93..9721c60 100644 (file)
@@ -27,6 +27,7 @@ SOFTWARE.
 /* 
  * $Header: iso_chksum.c,v 4.7 88/07/29 15:31:26 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/iso_chksum.c,v $
 /* 
  * $Header: iso_chksum.c,v 4.7 88/07/29 15:31:26 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/iso_chksum.c,v $
+ *     @(#)iso_chksum.c        7.3 (Berkeley) %G% *
  *
  * ISO CHECKSUM
  *
  *
  * ISO CHECKSUM
  *
index 7593808..a8acda7 100644 (file)
@@ -24,6 +24,7 @@ SOFTWARE.
 /*
  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
  */
 /*
  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
  */
+/*     @(#)iso_errno.h 7.3 (Berkeley) %G% */
 
 #ifndef __ISO_ERRNO__
 #define __ISO_ERRNO__
 
 #ifndef __ISO_ERRNO__
 #define __ISO_ERRNO__
index 46de8ca..1a12f6a 100644 (file)
@@ -27,7 +27,7 @@ SOFTWARE.
 /*
  * $Header: iso_pcb.c,v 4.5 88/06/29 14:59:56 hagens Exp $
  * $Source: /usr/argo/sys/netiso/RCS/iso_pcb.c,v $
 /*
  * $Header: iso_pcb.c,v 4.5 88/06/29 14:59:56 hagens Exp $
  * $Source: /usr/argo/sys/netiso/RCS/iso_pcb.c,v $
- *     @(#)iso_pcb.c   7.4 (Berkeley) %G%
+ *     @(#)iso_pcb.c   7.5 (Berkeley) %G% *
  *
  * Iso address family net-layer(s) pcb stuff. NEH 1/29/87
  */
  *
  * Iso address family net-layer(s) pcb stuff. NEH 1/29/87
  */
@@ -131,10 +131,12 @@ iso_pcbbind(isop, nam)
                return EADDRINUSE;
        if(nam == (struct mbuf *)0) {
                isop->isop_laddr = &isop->isop_sladdr;
                return EADDRINUSE;
        if(nam == (struct mbuf *)0) {
                isop->isop_laddr = &isop->isop_sladdr;
-               isop->isop_sladdr.siso_tsuffixlen = 2;
-               isop->isop_sladdr.siso_nlen = 0;
-               isop->isop_sladdr.siso_family = AF_ISO;
                isop->isop_sladdr.siso_len = sizeof(struct sockaddr_iso);
                isop->isop_sladdr.siso_len = sizeof(struct sockaddr_iso);
+               isop->isop_sladdr.siso_family = AF_ISO;
+               isop->isop_sladdr.siso_tlen = 2;
+               isop->isop_sladdr.siso_nlen = 0;
+               isop->isop_sladdr.siso_slen = 0;
+               isop->isop_sladdr.siso_plen = 0;
                goto noname;
        }
        siso = mtod(nam, struct sockaddr_iso *);
                goto noname;
        }
        siso = mtod(nam, struct sockaddr_iso *);
@@ -154,7 +156,7 @@ iso_pcbbind(isop, nam)
        if( (nam->m_len < 2) || (nam->m_len < siso->siso_len)) {
                        return ENAMETOOLONG;
        }
        if( (nam->m_len < 2) || (nam->m_len < siso->siso_len)) {
                        return ENAMETOOLONG;
        }
-       if (siso->siso_tsuffixlen) {
+       if (siso->siso_tlen) {
                        register char *cp = TSEL(siso);
                        suf.data[0] = cp[0];
                        suf.data[1] = cp[1];
                        register char *cp = TSEL(siso);
                        suf.data[0] = cp[0];
                        suf.data[1] = cp[1];
@@ -179,7 +181,7 @@ iso_pcbbind(isop, nam)
        }
        bcopy((caddr_t)siso, (caddr_t)isop->isop_laddr, siso->siso_len);
        if (suf.s) {
        }
        bcopy((caddr_t)siso, (caddr_t)isop->isop_laddr, siso->siso_len);
        if (suf.s) {
-               if((suf.s < ISO_PORT_RESERVED) && (siso->siso_tsuffixlen <= 2) &&
+               if((suf.s < ISO_PORT_RESERVED) && (siso->siso_tlen <= 2) &&
                   (u.u_uid != 0))
                        return EACCES;
                if ((isop->isop_socket->so_options & SO_REUSEADDR) == 0 &&
                   (u.u_uid != 0))
                        return EACCES;
                if ((isop->isop_socket->so_options & SO_REUSEADDR) == 0 &&
@@ -250,7 +252,7 @@ iso_pcbconnect(isop, nam)
                if (ia = iso_ifaddr) {
                        int nlen = ia->ia_addr.siso_nlen;
                        ovbcopy(TSEL(siso), nlen + TSEL(siso),
                if (ia = iso_ifaddr) {
                        int nlen = ia->ia_addr.siso_nlen;
                        ovbcopy(TSEL(siso), nlen + TSEL(siso),
-                               siso->siso_tsuffixlen + siso->siso_ssuffixlen);
+                               siso->siso_plen + siso->siso_tlen + siso->siso_slen);
                        bcopy((caddr_t)&ia->ia_addr.siso_addr,
                                  (caddr_t)&siso->siso_addr, nlen + 1);
                        /* includes siso->siso_nlen = nlen; */
                        bcopy((caddr_t)&ia->ia_addr.siso_addr,
                                  (caddr_t)&siso->siso_addr, nlen + 1);
                        /* includes siso->siso_nlen = nlen; */
@@ -291,7 +293,7 @@ iso_pcbconnect(isop, nam)
        if (local_zero) {
                int nlen, tlen, totlen; caddr_t oldtsel, newtsel;
                siso = isop->isop_laddr;
        if (local_zero) {
                int nlen, tlen, totlen; caddr_t oldtsel, newtsel;
                siso = isop->isop_laddr;
-               if (siso == 0 || siso->siso_tsuffixlen == 0)
+               if (siso == 0 || siso->siso_tlen == 0)
                        (void)iso_pcbbind(isop, (struct mbuf *)0);
                /*
                 * Here we have problem of squezeing in a definite network address
                        (void)iso_pcbbind(isop, (struct mbuf *)0);
                /*
                 * Here we have problem of squezeing in a definite network address
@@ -300,7 +302,7 @@ iso_pcbconnect(isop, nam)
                 */
                siso = isop->isop_laddr;
                oldtsel = TSEL(siso);
                 */
                siso = isop->isop_laddr;
                oldtsel = TSEL(siso);
-               tlen = siso->siso_tsuffixlen;
+               tlen = siso->siso_tlen;
                nlen = ia->ia_addr.siso_nlen;
                totlen = tlen + nlen + _offsetof(struct sockaddr_iso, siso_data[0]);
                if ((siso == &isop->isop_sladdr) &&
                nlen = ia->ia_addr.siso_nlen;
                totlen = tlen + nlen + _offsetof(struct sockaddr_iso, siso_data[0]);
                if ((siso == &isop->isop_sladdr) &&
@@ -315,7 +317,7 @@ iso_pcbconnect(isop, nam)
                newtsel = TSEL(siso);
                ovbcopy(oldtsel, newtsel, tlen);
                bcopy(ia->ia_addr.siso_data, siso->siso_data, nlen);
                newtsel = TSEL(siso);
                ovbcopy(oldtsel, newtsel, tlen);
                bcopy(ia->ia_addr.siso_data, siso->siso_data, nlen);
-               siso->siso_tsuffixlen = tlen;
+               siso->siso_tlen = tlen;
                siso->siso_family = AF_ISO;
                siso->siso_len = totlen;
                siso = mtod(nam, struct sockaddr_iso *);
                siso->siso_family = AF_ISO;
                siso->siso_len = totlen;
                siso = mtod(nam, struct sockaddr_iso *);
@@ -456,39 +458,6 @@ iso_pcbdetach(isop)
        free((caddr_t)isop, M_IFADDR);
 }
 
        free((caddr_t)isop, M_IFADDR);
 }
 
-#ifdef notdef
-/* NEEDED? */
-void
-iso_setsockaddr(isop, nam)
-       register struct isopcb *isop;
-       struct mbuf *nam;
-{
-       register struct sockaddr_iso *siso = mtod(nam, struct sockaddr_iso *);
-       
-       nam->m_len = sizeof (*siso);
-       siso = mtod(nam, struct sockaddr_iso *);
-       bzero((caddr_t)siso, sizeof (*siso));
-       siso->siso_family = AF_ISO;
-       siso->siso_tsuffix = isop->isop_lport;
-       siso->siso_addr = isop->isop_laddr.siso_addr;
-}
-
-/* NEEDED? */
-void
-iso_setpeeraddr(isop, nam)
-       register struct isopcb *isop;
-       struct mbuf *nam;
-{
-       register struct sockaddr_iso *siso = mtod(nam, struct sockaddr_iso *);
-       
-       nam->m_len = sizeof (*siso);
-       siso = mtod(nam, struct sockaddr_iso *);
-       bzero((caddr_t)siso, sizeof (*siso));
-       siso->siso_family = AF_ISO;
-       siso->siso_tsuffix = isop->isop_fport;
-       siso->siso_addr = isop->isop_faddr.siso_addr;
-}
-#endif notdef
 
 /*
  * FUNCTION:           iso_pcbnotify
 
 /*
  * FUNCTION:           iso_pcbnotify
@@ -565,7 +534,7 @@ iso_pcblookup(head, fportlen, fport, laddr)
 {
        register struct isopcb *isop;
        register caddr_t lp = TSEL(laddr);
 {
        register struct isopcb *isop;
        register caddr_t lp = TSEL(laddr);
-       unsigned int llen = laddr->siso_tsuffixlen;
+       unsigned int llen = laddr->siso_tlen;
 
        IFDEBUG(D_ISO)
                printf("iso_pcblookup(head 0x%x laddr 0x%x fport 0x%x)\n", 
 
        IFDEBUG(D_ISO)
                printf("iso_pcblookup(head 0x%x laddr 0x%x fport 0x%x)\n", 
@@ -574,7 +543,7 @@ iso_pcblookup(head, fportlen, fport, laddr)
        for (isop = head->isop_next; isop != head; isop = isop->isop_next) {
                if (isop->isop_laddr == 0 || isop->isop_laddr == laddr)
                        continue;
        for (isop = head->isop_next; isop != head; isop = isop->isop_next) {
                if (isop->isop_laddr == 0 || isop->isop_laddr == laddr)
                        continue;
-               if (isop->isop_laddr->siso_tsuffixlen != llen)
+               if (isop->isop_laddr->siso_tlen != llen)
                        continue;
                if (bcmp(lp, TSEL(isop->isop_laddr), llen))
                        continue;
                        continue;
                if (bcmp(lp, TSEL(isop->isop_laddr), llen))
                        continue;
index 9248263..7e3441a 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: iso_pcb.h,v 4.3 88/06/29 15:00:01 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/iso_pcb.h,v $ */
  */
 /* $Header: iso_pcb.h,v 4.3 88/06/29 15:00:01 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/iso_pcb.h,v $ */
+/*     @(#)iso_pcb.h   7.3 (Berkeley) %G% */
 
 #define        MAXX25CRUDLEN   16      /* 16 bytes of call request user data */
 
 
 #define        MAXX25CRUDLEN   16      /* 16 bytes of call request user data */
 
@@ -39,8 +40,6 @@ struct isopcb {
        struct  socket                  *isop_socket;   /* back pointer to socket */
        struct  sockaddr_iso    *isop_laddr;
        struct  sockaddr_iso    *isop_faddr;
        struct  socket                  *isop_socket;   /* back pointer to socket */
        struct  sockaddr_iso    *isop_laddr;
        struct  sockaddr_iso    *isop_faddr;
-#define isop_lportlen isop_laddr->siso_tsuffixlen
-#define isop_fportlen isop_faddr->siso_tsuffixlen
        struct  route_iso {
                struct  rtentry         *ro_rt;
                struct  sockaddr_iso ro_dst;
        struct  route_iso {
                struct  rtentry         *ro_rt;
                struct  sockaddr_iso ro_dst;
index 6cc9c56..b7551c2 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: iso_proto.c,v 4.4 88/09/08 08:38:42 hagens Exp $ 
  * $Source: /usr/argo/sys/netiso/RCS/iso_proto.c,v $ 
  */
 /* $Header: iso_proto.c,v 4.4 88/09/08 08:38:42 hagens Exp $ 
  * $Source: /usr/argo/sys/netiso/RCS/iso_proto.c,v $ 
+ *     @(#)iso_proto.c 7.3 (Berkeley) %G% *
  *
  * iso_proto.c : protocol switch tables in the ISO domain
  *
  *
  * iso_proto.c : protocol switch tables in the ISO domain
  *
index 598f17a..1711324 100644 (file)
@@ -26,6 +26,7 @@ SOFTWARE.
  */
 /* $Header: iso_snpac.c,v 1.8 88/09/19 13:51:36 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/iso_snpac.c,v $ */
  */
 /* $Header: iso_snpac.c,v 1.8 88/09/19 13:51:36 hagens Exp $ */
 /* $Source: /usr/argo/sys/netiso/RCS/iso_snpac.c,v $ */
+/*     @(#)iso_snpac.c 7.5 (Berkeley) %G% */
 
 #ifndef lint
 static char *rcsid = "$Header: iso_snpac.c,v 1.8 88/09/19 13:51:36 hagens Exp $";
 
 #ifndef lint
 static char *rcsid = "$Header: iso_snpac.c,v 1.8 88/09/19 13:51:36 hagens Exp $";
@@ -53,8 +54,8 @@ static char *rcsid = "$Header: iso_snpac.c,v 1.8 88/09/19 13:51:36 hagens Exp $"
 #include "iso_snpac.h"
 #include "clnp.h"
 #include "clnp_stat.h"
 #include "iso_snpac.h"
 #include "clnp.h"
 #include "clnp_stat.h"
-#include "argo_debug.h"
 #include "esis.h"
 #include "esis.h"
+#include "argo_debug.h"
 
 #define        SNPAC_BSIZ      20              /* bucket size */
 #define        SNPAC_NB        13              /* number of buckets */
 
 #define        SNPAC_BSIZ      20              /* bucket size */
 #define        SNPAC_NB        13              /* number of buckets */
index 74389bd..21444fc 100644 (file)
@@ -24,6 +24,7 @@ SOFTWARE.
 /*
  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
  */
 /*
  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
  */
+/*     @(#)iso_snpac.h 7.3 (Berkeley) %G% */
 #define        MAX_SNPALEN             8                       /* curiously equal to sizeof x.121 (
                                                                                plus 1 for nibble len) addr */
 struct snpa_req {
 #define        MAX_SNPALEN             8                       /* curiously equal to sizeof x.121 (
                                                                                plus 1 for nibble len) addr */
 struct snpa_req {
index 7be8569..f17d221 100644 (file)
@@ -27,6 +27,7 @@ SOFTWARE.
 /*
  * $Header: iso_usrreq.c,v 4.2 88/06/29 15:00:06 hagens Exp $ 
  * $Source: /usr/argo/sys/netiso/RCS/iso_usrreq.c,v $ 
 /*
  * $Header: iso_usrreq.c,v 4.2 88/06/29 15:00:06 hagens Exp $ 
  * $Source: /usr/argo/sys/netiso/RCS/iso_usrreq.c,v $ 
+ *     @(#)iso_usrreq.c        7.3 (Berkeley) %G% *
  *
  * iso_usrreq.c : support for iso address family ioctls only.
  * (which support ifconfig, for example)
  *
  * iso_usrreq.c : support for iso address family ioctls only.
  * (which support ifconfig, for example)
index 27fb1d8..74ce2ab 100644 (file)
@@ -50,7 +50,7 @@ SOFTWARE.
 *INCLUDE
 
 {
 *INCLUDE
 
 {
-
+/*     @(#)tp.trans    7.3 (Berkeley) %G% */
 #include "param.h"
 #include "socket.h"
 #include "socketvar.h"
 #include "param.h"
 #include "socket.h"
 #include "socketvar.h"
@@ -105,6 +105,7 @@ TP_OPEN
 TP_CLOSING 
 TP_REFWAIT
 TP_LISTENING   /* Local to this implementation */
 TP_CLOSING 
 TP_REFWAIT
 TP_LISTENING   /* Local to this implementation */
+TP_CONFIRMING  /* Local to this implementation */
 
 *EVENTS                { struct timeval e_time; }              SYNONYM  E
 
 
 *EVENTS                { struct timeval e_time; }              SYNONYM  E
 
@@ -190,6 +191,7 @@ TP_LISTENING        /* Local to this implementation */
  T_USR_Xrcvd   
  T_DETACH
  T_NETRESET
  T_USR_Xrcvd   
  T_DETACH
  T_NETRESET
+ T_ACPT_req
 
 
 *TRANSITIONS
 
 
 *TRANSITIONS
@@ -290,27 +292,16 @@ TP_CLOSED                 <==             [ TP_LISTENING, TP_CLOSED ]                     T_DETACH
        }
 ;
 
        }
 ;
 
-TP_OPEN                <==              TP_LISTENING                                                           CR_TPDU 
-       ( $P.tp_class == TP_CLASS_0 )
+TP_CONFIRMING  <==              TP_LISTENING                                                           CR_TPDU 
+       ( $P.tp_class == TP_CLASS_0)
        {
        {
-               IncStat(ts_tp0_conn);
-               IFTRACE(D_CONN)
-                       tptrace(TPPTmisc, "CR datalen data", $$.e_datalen, $$.e_data,0,0);
-               ENDTRACE
-               IFDEBUG(D_CONN)
-                       printf("CR datalen 0x%x data 0x%x", $$.e_datalen, $$.e_data);
-               ENDDEBUG
-               soisconnected($P.tp_sock);
                $P.tp_refp->tpr_state = REF_OPEN; /* has timers ??? */
                $P.tp_refp->tpr_state = REF_OPEN; /* has timers ??? */
-               (void) tp_emit(CC_TPDU_type, $P, 0,0, MNULL) ;
-               $P.tp_fcredit = 1;
        }
 ;
 
        }
 ;
 
-TP_AKWAIT              <==              TP_LISTENING                                                           CR_TPDU 
-       ( tp_emit(CC_TPDU_type, $P, 0,0, MCPY($P.tp_ucddata, M_NOWAIT)) == 0 )
+TP_CONFIRMING          <==              TP_LISTENING                                                   CR_TPDU 
+       DEFAULT
        {
        {
-               IncStat(ts_tp4_conn); /* even though not quite open */
                IFTRACE(D_CONN)
                        tptrace(TPPTmisc, "CR datalen data", $$.e_datalen, $$.e_data,0,0);
                ENDTRACE
                IFTRACE(D_CONN)
                        tptrace(TPPTmisc, "CR datalen data", $$.e_datalen, $$.e_data,0,0);
                ENDTRACE
@@ -318,6 +309,7 @@ TP_AKWAIT           <==              TP_LISTENING                                                           CR_TPDU
                        printf("CR datalen 0x%x data 0x%x", $$.e_datalen, $$.e_data);
                ENDDEBUG
                $P.tp_refp->tpr_state = REF_OPEN; /* has timers */
                        printf("CR datalen 0x%x data 0x%x", $$.e_datalen, $$.e_data);
                ENDDEBUG
                $P.tp_refp->tpr_state = REF_OPEN; /* has timers */
+               $P.tp_fcredit = $$.e_cdt;
 
                if ($$.e_datalen > 0) {
                        /* n/a for class 0 */
 
                if ($$.e_datalen > 0) {
                        /* n/a for class 0 */
@@ -326,16 +318,45 @@ TP_AKWAIT         <==              TP_LISTENING                                                           CR_TPDU
                        /*$P.tp_flags |= TPF_CONN_DATA_IN;*/
                        $$.e_data = MNULL; 
                } 
                        /*$P.tp_flags |= TPF_CONN_DATA_IN;*/
                        $$.e_data = MNULL; 
                } 
-               $P.tp_fcredit = $$.e_cdt;
+       }
+;
+
+TP_OPEN                <==              TP_CONFIRMING                                                                  T_ACPT_req 
+       ( $P.tp_class == TP_CLASS_0 )
+       {
+               IncStat(ts_tp0_conn);
+               IFTRACE(D_CONN)
+                       tptrace(TPPTmisc, "Confiming", $P, 0,0,0);
+               ENDTRACE
+               IFDEBUG(D_CONN)
+                       printf("Confirming connection: $P" );
+               ENDDEBUG
+               soisconnected($P.tp_sock);
+               (void) tp_emit(CC_TPDU_type, $P, 0,0, MNULL) ;
+               $P.tp_fcredit = 1;
+       }
+;
+
+TP_AKWAIT              <==              TP_CONFIRMING                                                          T_ACPT_req
+       (tp_emit(CC_TPDU_type, $P, 0,0, MCPY($P.tp_ucddata, M_NOWAIT)) == 0)
+       {
+               IncStat(ts_tp4_conn); /* even though not quite open */
+               IFTRACE(D_CONN)
+                       tptrace(TPPTmisc, "Confiming", $P, 0,0,0);
+               ENDTRACE
+               IFDEBUG(D_CONN)
+                       printf("Confirming connection: $P" );
+               ENDDEBUG
+               soisconnecting($P.tp_sock);
                if($P.tp_rx_strat & TPRX_FASTSTART)
                if($P.tp_rx_strat & TPRX_FASTSTART)
-                       $P.tp_cong_win = $$.e_cdt;
+                       $P.tp_cong_win = $P.tp_fcredit;
                $P.tp_retrans = $P.tp_Nretrans;
                tp_ctimeout($P.tp_refp, TM_retrans, (int)$P.tp_cc_ticks);
                $P.tp_retrans = $P.tp_Nretrans;
                tp_ctimeout($P.tp_refp, TM_retrans, (int)$P.tp_cc_ticks);
-        }
+       }
 ;
 
 /* TP4 only */
 ;
 
 /* TP4 only */
-TP_CLOSED              <==              TP_LISTENING                                                           CR_TPDU 
+TP_CLOSED              <==              TP_CONFIRMING                                                          T_ACPT_req
        DEFAULT /* emit failed */
        {
                register struct tp_ref *r = $P.tp_refp;
        DEFAULT /* emit failed */
        {
                register struct tp_ref *r = $P.tp_refp;
@@ -343,6 +364,7 @@ TP_CLOSED           <==              TP_LISTENING                                                           CR_TPDU
                IFDEBUG(D_CONN)
                        printf("event: CR_TPDU emit CC failed done " );
                ENDDEBUG
                IFDEBUG(D_CONN)
                        printf("event: CR_TPDU emit CC failed done " );
                ENDDEBUG
+               soisdisconnected($P.tp_sock);
                tp_recycle_tsuffix( $P );
                tp_freeref(r);
                tp_detach($P);
                tp_recycle_tsuffix( $P );
                tp_freeref(r);
                tp_detach($P);
@@ -846,7 +868,7 @@ TP_REFWAIT          <==     TP_CRSENT                                                                               T_DETACH
 ;
 
 /* TP4 only */
 ;
 
 /* TP4 only */
-TP_CLOSING             <==     [ TP_CLOSING, TP_AKWAIT, TP_CRSENT ]                    T_DETACH
+TP_CLOSING             <== [ TP_CLOSING, TP_AKWAIT, TP_CRSENT, TP_CONFIRMING ] T_DETACH
        DEFAULT
        {
                struct socket *so = $P.tp_sock;
        DEFAULT
        {
                struct socket *so = $P.tp_sock;
@@ -878,7 +900,7 @@ TP_REFWAIT          <==             [ TP_OPEN, TP_CRSENT ]                                          T_DISC_req
 ;
 
 /* TP4 only */
 ;
 
 /* TP4 only */
-TP_CLOSING             <==             [ TP_AKWAIT, TP_OPEN, TP_CRSENT ]                         T_DISC_req
+TP_CLOSING             <==     [ TP_AKWAIT, TP_OPEN, TP_CRSENT, TP_CONFIRMING ]  T_DISC_req
        DEFAULT
        {
                struct mbuf *data = MCPY($P.tp_ucddata, M_WAIT);
        DEFAULT
        {
                struct mbuf *data = MCPY($P.tp_ucddata, M_WAIT);
index 361028f..48a6a2c 100644 (file)
@@ -1,5 +1,6 @@
 /* $Header$ */
 /* $Source$ */
 /* $Header$ */
 /* $Source$ */
+/*     @(#)tp_astring.c        7.3 (Berkeley) %G% */
 #ifndef _NFILE
 #include <stdio.h>
 #endif _NFILE
 #ifndef _NFILE
 #include <stdio.h>
 #endif _NFILE
@@ -12,6 +13,7 @@ char *tp_sstring[] = {
 "TP_CLOSING(0x5)",
 "TP_REFWAIT(0x6)",
 "TP_LISTENING(0x7)",
 "TP_CLOSING(0x5)",
 "TP_REFWAIT(0x6)",
 "TP_LISTENING(0x7)",
+"TP_CONFIRMING(0x8)",
 };
 
 char *tp_estring[] = {
 };
 
 char *tp_estring[] = {
@@ -39,4 +41,5 @@ char *tp_estring[] = {
 "T_USR_Xrcvd(0x15)",
 "T_DETACH(0x16)",
 "T_NETRESET(0x17)",
 "T_USR_Xrcvd(0x15)",
 "T_DETACH(0x16)",
 "T_NETRESET(0x17)",
+"T_ACPT_req(0x18)",
 };
 };
index dc36e47..6a264cf 100644 (file)
@@ -28,6 +28,7 @@ SOFTWARE.
  * ARGO TP
  * $Header: tp_cons.c,v 5.6 88/11/18 17:27:13 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_cons.c,v $
  * ARGO TP
  * $Header: tp_cons.c,v 5.6 88/11/18 17:27:13 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_cons.c,v $
+ *     @(#)tp_cons.c   7.3 (Berkeley) %G% *
  *
  * Here is where you find the iso-dependent code.  We've tried
  * keep all net-level and (primarily) address-family-dependent stuff
  *
  * Here is where you find the iso-dependent code.  We've tried
  * keep all net-level and (primarily) address-family-dependent stuff
index 6bf51c5..7253fa9 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_emit.c,v 5.5 88/11/18 17:27:20 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_emit.c,v $
  *
  * $Header: tp_emit.c,v 5.5 88/11/18 17:27:20 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_emit.c,v $
+ *     @(#)tp_emit.c   7.3 (Berkeley) %G% *
  *
  * This file contains tp_emit() and tp_error_emit(), which
  * form TPDUs and hand them to ip.
  *
  * This file contains tp_emit() and tp_error_emit(), which
  * form TPDUs and hand them to ip.
index 07d5f20..36ca624 100644 (file)
@@ -28,6 +28,7 @@ SOFTWARE.
  * ARGO TP
  * $Header: tp_inet.c,v 5.3 88/11/18 17:27:29 nhall Exp $ 
  * $Source: /usr/argo/sys/netiso/RCS/tp_inet.c,v $
  * ARGO TP
  * $Header: tp_inet.c,v 5.3 88/11/18 17:27:29 nhall Exp $ 
  * $Source: /usr/argo/sys/netiso/RCS/tp_inet.c,v $
+ *     @(#)tp_inet.c   7.4 (Berkeley) %G% *
  *
  * Here is where you find the inet-dependent code.  We've tried
  * keep all net-level and (primarily) address-family-dependent stuff
  *
  * Here is where you find the inet-dependent code.  We've tried
  * keep all net-level and (primarily) address-family-dependent stuff
index ac2ec03..ad697d9 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_input.c,v 5.6 88/11/18 17:27:38 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_input.c,v $
  *
  * $Header: tp_input.c,v 5.6 88/11/18 17:27:38 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_input.c,v $
+ *     @(#)tp_input.c  7.3 (Berkeley) %G% *
  *
  * tp_input() gets an mbuf chain from ip.  Actually, not directly
  * from ip, because ip calls a net-level routine that strips off
  *
  * tp_input() gets an mbuf chain from ip.  Actually, not directly
  * from ip, because ip calls a net-level routine that strips off
@@ -219,7 +220,7 @@ tp_newsocket(so, fname, cons_channel, class_to_use, netservice)
 {
        register struct tp_pcb  *tpcb = sototpcb(so); /* old tpcb, needed below */
        struct tp_pcb *                  newtpcb;
 {
        register struct tp_pcb  *tpcb = sototpcb(so); /* old tpcb, needed below */
        struct tp_pcb *                  newtpcb;
-       struct proc *                   selproc = so->so_rcv.sb_sel; /* kludge for select */
+       extern struct socket *sonewsock();
 
        /* 
         * sonewconn() gets a new socket structure,
 
        /* 
         * sonewconn() gets a new socket structure,
@@ -227,21 +228,17 @@ tp_newsocket(so, fname, cons_channel, class_to_use, netservice)
         * but the pcbs are unnamed (not bound)
         */
        IFTRACE(D_NEWSOCK)
         * but the pcbs are unnamed (not bound)
         */
        IFTRACE(D_NEWSOCK)
-               tptraceTPCB(TPPTmisc, "newsock: listg_so,_tpcb selproc, so_head",
-                       so, tpcb, selproc, so->so_head);
+               tptraceTPCB(TPPTmisc, "newsock: listg_so, _tpcb, so_head",
+                       so, tpcb, so->so_head);
        ENDTRACE        
 
        ENDTRACE        
 
-       if ((so = sonewconn(so)) == (struct socket *)0)
+       if ((so = sonewsock(so, SS_ISCONFIRMING)) == (struct socket *)0)
                return so;
        IFTRACE(D_NEWSOCK)
                return so;
        IFTRACE(D_NEWSOCK)
-               tptraceTPCB(TPPTmisc, "newsock: after newconn so, selproc, so_head",
-                       so, selproc, so->so_head, 0);
+               tptraceTPCB(TPPTmisc, "newsock: after newconn so, so_head",
+                       so, so->so_head, 0, 0);
        ENDTRACE        
 
        ENDTRACE        
 
-       so->so_rcv.sb_sel = selproc; /* so that soisconnected() after receipt
-               * of the ack will wake this guy up if he's selecting on the
-               * listening socket
-               */
        IFDEBUG(D_NEWSOCK)
                printf("tp_newsocket(channel 0x%x)  after sonewconn so 0x%x \n",
                                cons_channel, so);
        IFDEBUG(D_NEWSOCK)
                printf("tp_newsocket(channel 0x%x)  after sonewconn so 0x%x \n",
                                cons_channel, so);
@@ -379,38 +376,39 @@ tp_input(m, faddr, laddr, cons_channel, dgout_routine)
        register struct tpdu    *hdr = mtod(m, struct tpdu *);
        struct socket                   *so;
        struct tp_event                 e;
        register struct tpdu    *hdr = mtod(m, struct tpdu *);
        struct socket                   *so;
        struct tp_event                 e;
-       int                                     error = 0;
+       int                                     error;
        unsigned                                dutype;
        u_short                                 dref, sref, acktime, subseq; /*VAX*/
        unsigned                                dutype;
        u_short                                 dref, sref, acktime, subseq; /*VAX*/
-       u_char                                  preferred_class=0, class_to_use=0;
+       u_char                                  preferred_class, class_to_use;
        u_char                                  opt, dusize, addlopt;
 #ifdef TP_PERF_MEAS
        u_char                                  opt, dusize, addlopt;
 #ifdef TP_PERF_MEAS
-       u_char                                  perf_meas=0;
+       u_char                                  perf_meas;
 #endif TP_PERF_MEAS
        u_char                                  fsufxlen;
        u_char                                  lsufxlen;
 #endif TP_PERF_MEAS
        u_char                                  fsufxlen;
        u_char                                  lsufxlen;
-       caddr_t                                 fsufxloc=0, lsufxloc=0;
+       caddr_t                                 fsufxloc, lsufxloc;
        int                                             tpdu_len;
        u_int                                   takes_data;
        u_int                                   fcc_present; 
        int                                             tpdu_len;
        u_int                                   takes_data;
        u_int                                   fcc_present; 
-       caddr_t                                 errloc=0;
+       caddr_t                                 errloc;
        struct tp_conn_param    tpp;
        int                                             tpcons_output();
 
        struct tp_conn_param    tpp;
        int                                             tpcons_output();
 
+again:
 #ifdef TP_PERF_MEAS
 #ifdef TP_PERF_MEAS
-       GET_CUR_TIME( &e.e_time );
+       GET_CUR_TIME( &e.e_time ); perf_meas = 0;
 #endif TP_PERF_MEAS
        
        IFDEBUG(D_TPINPUT)
                printf("tp_input(0x%x, ... 0x%x)\n", m, cons_channel);
        ENDDEBUG
 
 #endif TP_PERF_MEAS
        
        IFDEBUG(D_TPINPUT)
                printf("tp_input(0x%x, ... 0x%x)\n", m, cons_channel);
        ENDDEBUG
 
-again:
 
        tpdu_len = 0;
        tpcb = (struct tp_pcb *)0;
 
        tpdu_len = 0;
        tpcb = (struct tp_pcb *)0;
-       fsufxlen = 0;
-       lsufxlen = 0;
+       fsufxlen = 0; fsufxloc = 0;
+       lsufxlen = 0; lsufxloc = 0;
+       errloc = 0; error = 0;
        addlopt = 0;
        acktime = 2;
        dusize = TP_DFL_TPDUSIZE;
        addlopt = 0;
        acktime = 2;
        dusize = TP_DFL_TPDUSIZE;
@@ -418,6 +416,7 @@ again:
        subseq = 0;
        takes_data = FALSE;
        fcc_present = FALSE;
        subseq = 0;
        takes_data = FALSE;
        fcc_present = FALSE;
+       preferred_class = 0; class_to_use = 0;
 
        /* 
         * get the actual tpdu length - necessary for monitoring
 
        /* 
         * get the actual tpdu length - necessary for monitoring
@@ -770,10 +769,12 @@ again:
 
                        /* stash the f suffix in the new tpcb */
                        /* l suffix is already there */
 
                        /* stash the f suffix in the new tpcb */
                        /* l suffix is already there */
-
                        bcopy(fsufxloc, tpcb->tp_fsuffix, fsufxlen);
                        bcopy(fsufxloc, tpcb->tp_fsuffix, fsufxlen);
+
                        (tpcb->tp_nlproto->nlp_putsufx)
                                        (so->so_pcb, fsufxloc, fsufxlen, TP_FOREIGN);
                        (tpcb->tp_nlproto->nlp_putsufx)
                                        (so->so_pcb, fsufxloc, fsufxlen, TP_FOREIGN);
+                       (tpcb->tp_nlproto->nlp_putsufx)
+                                       (so->so_pcb, lsufxloc, lsufxlen, TP_LOCAL);
 
 #ifdef TP_PERF_MEAS
                        if( tpcb->tp_perf_on = perf_meas ) { /* assignment */
 
 #ifdef TP_PERF_MEAS
                        if( tpcb->tp_perf_on = perf_meas ) { /* assignment */
index eb37c28..d15bbe9 100644 (file)
@@ -28,6 +28,7 @@ SOFTWARE.
  * ARGO TP
  * $Header: /var/src/sys/netiso/RCS/tp_iso.c,v 5.1 89/02/09 16:20:51 hagens Exp $
  * $Source: /var/src/sys/netiso/RCS/tp_iso.c,v $
  * ARGO TP
  * $Header: /var/src/sys/netiso/RCS/tp_iso.c,v 5.1 89/02/09 16:20:51 hagens Exp $
  * $Source: /var/src/sys/netiso/RCS/tp_iso.c,v $
+ *     @(#)tp_iso.c    7.3 (Berkeley) %G% *
  *
  * Here is where you find the iso-dependent code.  We've tried
  * keep all net-level and (primarily) address-family-dependent stuff
  *
  * Here is where you find the iso-dependent code.  We've tried
  * keep all net-level and (primarily) address-family-dependent stuff
@@ -100,7 +101,7 @@ iso_getsufx(isop, lenp, data_out, which)
                addr = isop->isop_faddr;
        }
        if (addr)
                addr = isop->isop_faddr;
        }
        if (addr)
-               bcopy(TSEL(addr), data_out, (*lenp = addr->siso_tsuffixlen));
+               bcopy(TSEL(addr), data_out, (*lenp = addr->siso_tlen));
 }
 
 /* CALLED FROM:
 }
 
 /* CALLED FROM:
@@ -138,13 +139,14 @@ iso_putsufx(isop, sufxloc, sufxlen, which)
        if ((addr = *dst) == 0) {
                addr = *dst = backup;
                addr->siso_nlen = 0;
        if ((addr = *dst) == 0) {
                addr = *dst = backup;
                addr->siso_nlen = 0;
-               addr->siso_ssuffixlen = 0;
+               addr->siso_slen = 0;
+               addr->siso_plen = 0;
                printf("iso_putsufx on un-initialized isopcb\n");
        }
        len = sufxlen + addr->siso_nlen +
                printf("iso_putsufx on un-initialized isopcb\n");
        }
        len = sufxlen + addr->siso_nlen +
-                       (sizeof(struct sockaddr_iso) - sizeof(struct iso_addr));
+                       (sizeof(*addr) - sizeof(addr->siso_data));
        if (addr == backup) {
        if (addr == backup) {
-               if (len > sizeof(isop->isop_sladdr)) {
+               if (len > sizeof(*addr)) {
                                m = m_getclr(M_DONTWAIT, MT_SONAME);
                                if (m == 0)
                                        return;
                                m = m_getclr(M_DONTWAIT, MT_SONAME);
                                if (m == 0)
                                        return;
@@ -152,10 +154,9 @@ iso_putsufx(isop, sufxloc, sufxlen, which)
                                *addr = *backup;
                                m->m_len = len;
                }
                                *addr = *backup;
                                m->m_len = len;
                }
-       } else
-               dtom(addr)->m_len = len;
+       }
        bcopy(sufxloc, TSEL(addr), sufxlen);
        bcopy(sufxloc, TSEL(addr), sufxlen);
-       addr->siso_tsuffixlen = sufxlen;
+       addr->siso_tlen = sufxlen;
        addr->siso_len = len;
 }
 
        addr->siso_len = len;
 }
 
@@ -174,7 +175,7 @@ void
 iso_recycle_tsuffix(isop)
        struct isopcb   *isop;
 {
 iso_recycle_tsuffix(isop)
        struct isopcb   *isop;
 {
-       isop->isop_laddr->siso_tsuffixlen = isop->isop_faddr->siso_tsuffixlen = 0;
+       isop->isop_laddr->siso_tlen = isop->isop_faddr->siso_tlen = 0;
 }
 
 /*
 }
 
 /*
@@ -370,23 +371,9 @@ tpclnp_output(isop, m0, datalen, nochksum)
                dump_isoaddr(isop->isop_laddr);
                dump_mbuf(m0, "at tpclnp_output");
        ENDDEBUG
                dump_isoaddr(isop->isop_laddr);
                dump_mbuf(m0, "at tpclnp_output");
        ENDDEBUG
-       if ((m->m_flags & M_PKTHDR) == 0) {
-               IFDEBUG(D_TPISO)
-               printf("tpclnp_output: non headered mbuf");
-               ENDDEBUG
-               MGETHDR(m, M_DONTWAIT, MT_DATA);
-               if (m == 0) {
-                       m_freem(m0);
-                       return ENOBUFS;
-               }
-               m->m_next = m0;
-               m->m_len = 0;
-               m->m_pkthdr.len = datalen;
-               m0 = m;
-       }
 
        return 
 
        return 
-               clnp_output(m0, isop, /* flags */nochksum ? CLNP_NO_CKSUM : 0);
+               clnp_output(m0, isop, datalen,  /* flags */nochksum ? CLNP_NO_CKSUM : 0);
 }
 
 /*
 }
 
 /*
@@ -443,19 +430,7 @@ tpclnp_output_dg(laddr, faddr, m0, datalen, ro, nochksum)
 
        IncStat(ts_tpdu_sent);
 
 
        IncStat(ts_tpdu_sent);
 
-       if ((m->m_flags & M_PKTHDR) == 0) {
-               printf("tpclnp_output: non headered mbuf");
-               MGETHDR(m, M_DONTWAIT, MT_DATA);
-               if (m == 0) {
-                       m_freem(m0);
-                       return ENOBUFS;
-               }
-               m->m_next = m0;
-               m->m_len = 0;
-               m->m_pkthdr.len = datalen;
-               m0 = m;
-       }
-       err = clnp_output(m0, &tmppcb, flags);
+       err = clnp_output(m0, &tmppcb, datalen,  flags);
        
        /*
         *      Free route allocated by clnp (if the route was indeed allocated)
        
        /*
         *      Free route allocated by clnp (if the route was indeed allocated)
index a7cb277..67e518c 100644 (file)
@@ -27,6 +27,7 @@ SOFTWARE.
 /*
  * $Header: tp_meas.c,v 5.2 88/11/18 17:28:04 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_meas.c,v $
 /*
  * $Header: tp_meas.c,v 5.2 88/11/18 17:28:04 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_meas.c,v $
+ *     @(#)tp_meas.c   7.3 (Berkeley) %G% *
  * 
  * tp_meas.c : create a performance measurement event
  * in the circular buffer tp_Meas[]
  * 
  * tp_meas.c : create a performance measurement event
  * in the circular buffer tp_Meas[]
index 87ba7fb..1251b9f 100644 (file)
@@ -24,6 +24,7 @@ SOFTWARE.
 /*
  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
  */
 /*
  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
  */
+/*     @(#)tp_meas.h   7.3 (Berkeley) %G% */
 #ifdef TPPT
 #define TP_PERF_MEAS
 #endif TPPT
 #ifdef TPPT
 #define TP_PERF_MEAS
 #endif TPPT
index ffbbb11..c672524 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_output.c,v 5.4 88/11/18 17:28:08 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_output.c,v $
  *
  * $Header: tp_output.c,v 5.4 88/11/18 17:28:08 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_output.c,v $
+ *     @(#)tp_output.c 7.4 (Berkeley) %G% *
  *
  * In here is tp_ctloutput(), the guy called by [sg]etsockopt(),
  */
  *
  * In here is tp_ctloutput(), the guy called by [sg]etsockopt(),
  */
@@ -392,6 +393,7 @@ tp_ctloutput(cmd, so, level, optname, mp)
                &&
                (cmd == PRCO_SETOPT  && 
                        optname != TPOPT_DISC_DATA && 
                &&
                (cmd == PRCO_SETOPT  && 
                        optname != TPOPT_DISC_DATA && 
+                       optname != TPOPT_CFRM_DATA && 
                        optname != TPOPT_PERF_MEAS &&
                        optname != TPOPT_CDDATA_CLEAR ) ) {
                error = EISCONN; goto done;
                        optname != TPOPT_PERF_MEAS &&
                        optname != TPOPT_CDDATA_CLEAR ) ) {
                error = EISCONN; goto done;
@@ -401,7 +403,7 @@ tp_ctloutput(cmd, so, level, optname, mp)
         * and they're not allowed if the ref timer has gone off, because
         * the tpcb is gone 
         */
         * and they're not allowed if the ref timer has gone off, because
         * the tpcb is gone 
         */
-       if ((so->so_state & SS_ISCONNECTED) ==  0) {
+       if ((so->so_state & (SS_ISCONNECTED | SS_ISCONFIRMING)) ==  0) {
                if ( so->so_tpcb == (caddr_t)0 ) {
                        error = ENOTCONN; goto done;
                }
                if ( so->so_tpcb == (caddr_t)0 ) {
                        error = ENOTCONN; goto done;
                }
@@ -528,12 +530,30 @@ tp_ctloutput(cmd, so, level, optname, mp)
                        error = EINVAL;
                } else {
                        if (tpcb->tp_ucddata) {
                        error = EINVAL;
                } else {
                        if (tpcb->tp_ucddata) {
-                                       m_freem(tpcb->tp_ucddata);
-                                       tpcb->tp_ucddata = 0;
+                               m_freem(tpcb->tp_ucddata);
+                               tpcb->tp_ucddata = 0;
                        }
                }
                break;
 
                        }
                }
                break;
 
+#ifdef TPOPT_NGC8_ACCEPT
+       case TPOPT_NGC8_ACCEPT: 
+               if ( cmd == PRCO_GETOPT ) {
+                       *(int *)value = (int)tpcb->tp_flags & TPFLAG_NGC8_ACCEPT;
+                       (*mp)->m_len = sizeof(u_int);
+               } else  {
+                       if (*(int *)value)
+                               tpcb->tp_flags |= TPFLAG_NGC8_ACCEPT;
+                       else
+                               tpcb->tp_flags &= ~TPFLAG_NGC8_ACCEPT;
+               }
+               break;
+#endif
+
+       case TPOPT_CFRM_DATA:
+               if (cmd == PRCO_SETOPT && (so->so_state & SS_ISCONFIRMING))
+                       (void) tp_confirm(tpcb);
+               /* drop through */
        case TPOPT_DISC_DATA: 
                /* drop through */
        /* sending is for debugging purposes only -- we don't pretend 
        case TPOPT_DISC_DATA: 
                /* drop through */
        /* sending is for debugging purposes only -- we don't pretend 
index 3524d0b..9628e87 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_param.h,v 5.3 88/11/18 17:28:18 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_param.h,v $
  *
  * $Header: tp_param.h,v 5.3 88/11/18 17:28:18 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_param.h,v $
+ *     @(#)tp_param.h  7.4 (Berkeley) %G% *
  *
  */
 
  *
  */
 
index 5c823f4..f76ab6e 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_pcb.c,v 5.4 88/11/18 17:28:24 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_pcb.c,v $
  *
  * $Header: tp_pcb.c,v 5.4 88/11/18 17:28:24 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_pcb.c,v $
+ *     @(#)tp_pcb.c    7.3 (Berkeley) %G% *
  *
  *
  * This is the initialization and cleanup stuff - 
  *
  *
  * This is the initialization and cleanup stuff - 
@@ -113,7 +114,7 @@ struct tp_conn_param tp_conn_param[] = {
                0,                                              /* 1 bit use net xpd */
                0,                                              /* 1 bit use rcc */
                0,                                              /* 1 bit use efc */
                0,                                              /* 1 bit use net xpd */
                0,                                              /* 1 bit use rcc */
                0,                                              /* 1 bit use efc */
-               0,                                              /* no disc indications */
+               1,                                              /* no disc indications */
                0,                                              /* don't change params */
                ISO_CLNS,                               /* p_netservice */
        },
                0,                                              /* don't change params */
                ISO_CLNS,                               /* p_netservice */
        },
@@ -148,7 +149,7 @@ struct tp_conn_param tp_conn_param[] = {
                0,                                              /* 1 bit use net xpd */
                0,                                              /* 1 bit use rcc */
                0,                                              /* 1 bit use efc */
                0,                                              /* 1 bit use net xpd */
                0,                                              /* 1 bit use rcc */
                0,                                              /* 1 bit use efc */
-               0,                                              /* no disc indications */
+               1,                                              /* no disc indications */
                0,                                              /* don't change params */
                IN_CLNS,                                /* p_netservice */
        },
                0,                                              /* don't change params */
                IN_CLNS,                                /* p_netservice */
        },
@@ -383,16 +384,8 @@ void
 tp_soisdisconnecting(so)
        register struct socket *so;
 {
 tp_soisdisconnecting(so)
        register struct socket *so;
 {
-       so->so_state &= ~SS_ISCONNECTING;
-       so->so_state |= SS_ISDISCONNECTING;
-       if (so->so_head) {
-               if (!soqremque(so, 0) && !soqremque(so, 1))
-                       panic("tp_soisdisconnecting");
-               so->so_head = 0;
-       }
-       wakeup((caddr_t)&so->so_timeo);
-       sowwakeup(so);
-       sorwakeup(so);
+       soisdisconnecting(so);
+       so->so_state &= ~SS_CANTSENDMORE;
        IFPERF(sototpcb(so))
                register struct tp_pcb *tpcb = sototpcb(so);
                u_int   fsufx, lsufx;
        IFPERF(sototpcb(so))
                register struct tp_pcb *tpcb = sototpcb(so);
                u_int   fsufx, lsufx;
@@ -435,15 +428,8 @@ tp_soisdisconnected(tpcb)
 {
        register struct socket  *so = tpcb->tp_sock;
 
 {
        register struct socket  *so = tpcb->tp_sock;
 
-       so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
-       if (so->so_head) {
-               if (!soqremque(so, 0) && !soqremque(so, 1))
-                       panic("tp_soisdisconnected");
-               so->so_head = 0;
-       }
-       wakeup((caddr_t)&so->so_timeo);
-       sowwakeup(so);
-       sorwakeup(so);
+       soisdisconnecting(so);
+       so->so_state &= ~SS_CANTSENDMORE;
        IFPERF(sototpcb(so))
                register struct tp_pcb *ttpcb = sototpcb(so);
                u_int   fsufx, lsufx;
        IFPERF(sototpcb(so))
                register struct tp_pcb *ttpcb = sototpcb(so);
                u_int   fsufx, lsufx;
index 7306a71..a6f5a54 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_pcb.h,v 5.2 88/11/18 17:09:32 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_pcb.h,v $
  *
  * $Header: tp_pcb.h,v 5.2 88/11/18 17:09:32 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_pcb.h,v $
+ *     @(#)tp_pcb.h    7.4 (Berkeley) %G% *
  *
  * 
  * This file defines the transport protocol control block (tpcb).
  *
  * 
  * This file defines the transport protocol control block (tpcb).
index 851eefc..72c899b 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_seq.h,v 5.1 88/10/12 12:20:59 root Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_seq.h,v $
  *
  * $Header: tp_seq.h,v 5.1 88/10/12 12:20:59 root Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_seq.h,v $
+ *     @(#)tp_seq.h    7.3 (Berkeley) %G% *
  *
  * These macros perform sequence number arithmetic modulo (2**7 or 2**31).
  * The relevant fields in the tpcb are:
  *
  * These macros perform sequence number arithmetic modulo (2**7 or 2**31).
  * The relevant fields in the tpcb are:
index 004a655..5afa588 100644 (file)
@@ -48,6 +48,7 @@ SOFTWARE.
  *
  * $Header: tp_sizes.c,v 5.1 88/10/12 12:21:03 root Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_sizes.c,v $
  *
  * $Header: tp_sizes.c,v 5.1 88/10/12 12:21:03 root Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_sizes.c,v $
+ *     @(#)tp_sizes.c  7.3 (Berkeley) %G% *
  *
  *
  * This is the initialization and cleanup stuff - 
  *
  *
  * This is the initialization and cleanup stuff - 
@@ -76,8 +77,6 @@ static char *rcsid = "$Header: tp_sizes.c,v 5.1 88/10/12 12:21:03 root Exp $";
 #include "errno.h"
 #include "time.h"
 #include "tp_param.h"
 #include "errno.h"
 #include "time.h"
 #include "tp_param.h"
-#include "tp_timer.h"
-#include "tp_ip.h"
 #include "tp_stat.h"
 #include "tp_pcb.h"
 #include "tp_tpdu.h"
 #include "tp_stat.h"
 #include "tp_pcb.h"
 #include "tp_tpdu.h"
@@ -92,7 +91,7 @@ static char *rcsid = "$Header: tp_sizes.c,v 5.1 88/10/12 12:21:03 root Exp $";
 #include "cons_pcb.h"
 
 #define DUP(x) x, x
 #include "cons_pcb.h"
 
 #define DUP(x) x, x
-#define SIZE(P) printf("Size of %s: 0x%x %d\n", "P", DUP(sizeof(struct P)))
+#define SIZE(P) printf("  Size of %s: 0x%x %d\n", "P", DUP(sizeof(struct P)))
 #define OFF(P, Q) printf("\toffset of %s in %s: 0x%x %d\n", "P", "Q", \
                DUP(_offsetof(struct Q, P)))
 main()
 #define OFF(P, Q) printf("\toffset of %s in %s: 0x%x %d\n", "P", "Q", \
                DUP(_offsetof(struct Q, P)))
 main()
@@ -100,24 +99,24 @@ main()
        printf( "TP struct sizes:\n");
        SIZE(tp_pcb);
 #define O(y) OFF(tp_/**/y,tp_pcb);
        printf( "TP struct sizes:\n");
        SIZE(tp_pcb);
 #define O(y) OFF(tp_/**/y,tp_pcb);
-       O(state) O(retrans) O(snduna)
-       O(lref) O(fref) O(fsuffix)
-       O(fsuffixlen) O(lsuffix) O(lsuffixlen)
-       O(Xsnd) O(Xuna)
-       SIZE(tp_ref); OFF(tpr_pcb,tp_ref);OFF(tpr_calltodo,tp_ref);
-       SIZE(tp_stat); SIZE(tp_param);
-       SIZE(tp_conn_param); SIZE(tp_rtc); SIZE(nl_protosw);
-#ifdef TP_PERF_MEAS
-       SIZE(tp_Meas);
-#endif
-       printf( "ISO struct sizes:\n");
+       O(state) O(retrans) O(snduna) O(lref) O(fref)
+       O(fsuffix) O(fsuffixlen) O(lsuffix) O(lsuffixlen) O(Xsnd) O(Xuna)
+       SIZE(tp_ref);
+#undef O
+#define O(y) OFF(tpr_/**/y,tp_ref);
+       O(pcb) O(calltodo)
+       SIZE(tp_stat);
+       SIZE(tp_param); SIZE(tp_conn_param);
+       SIZE(tp_rtc); SIZE(nl_protosw);
+#undef O
+#define O(y) OFF(so_/**/y,socket);
+       printf( "socket struct sizes:\n");
        SIZE(socket);
        SIZE(socket);
-       OFF(so_timeo,socket); OFF(so_rcv,socket); OFF(so_snd,socket);
-       OFF(so_tpcb,socket); OFF(so_pcb,socket); OFF(so_qlen,socket);
-       OFF(so_error,socket); OFF(so_state,socket);
+       O(timeo) O(rcv) O(snd) O(tpcb) O(pcb) O(qlen) O(error) O(state)
        SIZE(sockbuf);
        SIZE(sockbuf);
-       OFF(sb_flags,sockbuf); OFF(sb_cc,sockbuf);
-       OFF(sb_mb,sockbuf); OFF(sb_mbcnt,sockbuf);
-       SIZE(isopcb);
-        SIZE(cons_pcb); OFF(co_state,cons_pcb);
+#undef O
+#define O(y) OFF(sb_/**/y,sockbuf);
+       O(flags) O(cc) O(mb) O(mbcnt)
+       SIZE(isopcb); SIZE(cons_pcb);
+       OFF(co_state,cons_pcb);
 }
 }
index d2c3674..e42c58d 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_subr.c,v 5.3 88/11/18 17:28:43 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_subr.c,v $
  *
  * $Header: tp_subr.c,v 5.3 88/11/18 17:28:43 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_subr.c,v $
+ *     @(#)tp_subr.c   7.3 (Berkeley) %G% *
  *
  * The main work of data transfer is done here.
  * These routines are called from tp.trans.
  *
  * The main work of data transfer is done here.
  * These routines are called from tp.trans.
@@ -452,17 +453,12 @@ tp_send(tpcb)
                        lowseq, highseq, tpcb->tp_fcredit,  tpcb->tp_cong_win);
        ENDTRACE
 
                        lowseq, highseq, tpcb->tp_fcredit,  tpcb->tp_cong_win);
        ENDTRACE
 
-       while( SEQ_LT( tpcb, lowseq, highseq ) ) {
-               mb = m = sb->sb_mb; 
-               if (m == (struct mbuf *)0) {
-                       break; /* empty socket buffer */
-               }
+       while ((SEQ_LT(tpcb, lowseq, highseq)) && (mb = m = sb->sb_mb)) {
                if (tpcb->tp_Xsnd.sb_mb) {
                if (tpcb->tp_Xsnd.sb_mb) {
-                       register SeqNum Xuna = * (mtod(m, SeqNum *));
                        IFTRACE(D_XPD)
                                tptraceTPCB( TPPTmisc,
                                        "tp_send XPD mark low high tpcb.Xuna", 
                        IFTRACE(D_XPD)
                                tptraceTPCB( TPPTmisc,
                                        "tp_send XPD mark low high tpcb.Xuna", 
-                                       Xuna, lowseq, highseq, tpcb->tp_Xuna);
+                                       lowseq, highseq, tpcb->tp_Xsnd.sb_mb, 0);
                        ENDTRACE
                        /* stop sending here because there are unacked XPD which were 
                         * given to us before the next data were.
                        ENDTRACE
                        /* stop sending here because there are unacked XPD which were 
                         * given to us before the next data were.
@@ -478,7 +474,7 @@ tp_send(tpcb)
                                eotsdu_reached = 1;
                        sbfree(sb, m); /* reduce counts in socket buffer */
                }
                                eotsdu_reached = 1;
                        sbfree(sb, m); /* reduce counts in socket buffer */
                }
-               m = sb->sb_mb = nextrecord;
+               sb->sb_mb = nextrecord;
                IFTRACE(D_STASH)
                        tptraceTPCB(TPPTmisc, "tp_send whole mbuf: m_len len maxsize",
                                 0, mb->m_len, len, maxsize);
                IFTRACE(D_STASH)
                        tptraceTPCB(TPPTmisc, "tp_send whole mbuf: m_len len maxsize",
                                 0, mb->m_len, len, maxsize);
@@ -513,17 +509,15 @@ tp_send(tpcb)
                /* make a copy - mb goes into the retransmission list 
                 * while m gets emitted.  m_copy won't copy a zero-length mbuf.
                 */
                /* make a copy - mb goes into the retransmission list 
                 * while m gets emitted.  m_copy won't copy a zero-length mbuf.
                 */
-               if(len) {
-                       if( (m = m_copy(mb, 0, len )) == MNULL ) { 
+               if (len) {
+                       if ((m = m_copy(mb, 0, len )) == MNULL)
                                goto done;
                                goto done;
-                       }
                } else {
                        /* eotsdu reached */
                        MGET(m, M_WAIT, TPMT_DATA);
                } else {
                        /* eotsdu reached */
                        MGET(m, M_WAIT, TPMT_DATA);
-                       if (m == NULL)
+                       if (m == MNULL)
                                goto done;
                        m->m_len = 0;
                                goto done;
                        m->m_len = 0;
-                       m->m_act = MNULL;
                }
 
                SEQ_INC(tpcb,lowseq);   /* it was decremented at the beginning */
                }
 
                SEQ_INC(tpcb,lowseq);   /* it was decremented at the beginning */
@@ -652,6 +646,7 @@ tp_stash( tpcb, e )
        if ( E.e_eot ) {
                register struct mbuf *n = E.e_data;
                n->m_flags |= M_EOR;
        if ( E.e_eot ) {
                register struct mbuf *n = E.e_data;
                n->m_flags |= M_EOR;
+               n->m_act = 0;
        }
                IFDEBUG(D_STASH)
                        dump_mbuf(tpcb->tp_sock->so_rcv.sb_mb, 
        }
                IFDEBUG(D_STASH)
                        dump_mbuf(tpcb->tp_sock->so_rcv.sb_mb, 
@@ -857,19 +852,10 @@ tp0_stash( tpcb, e )
 
        if ( E.e_eot ) {
                register struct mbuf *n = E.e_data;
 
        if ( E.e_eot ) {
                register struct mbuf *n = E.e_data;
-
-               /* sigh. have to go through this again! */
-               /* a kludgy optimization would be to take care of this in
-                * tp_input (oh, horrors!) 
-                */
-               while (n->m_next )
-                       n = n->m_next;
-
-               n->m_act = MNULL; /* set on tp_input */
-
                n->m_flags |= M_EOR;
                n->m_flags |= M_EOR;
+               n->m_act = MNULL; /* set on tp_input */
        }
        }
-       sbappendrecord (&tpcb->tp_sock->so_rcv, E.e_data);
+       sbappend(&tpcb->tp_sock->so_rcv, E.e_data);
        IFDEBUG(D_STASH)
                dump_mbuf(tpcb->tp_sock->so_rcv.sb_mb, 
                        "stash 0: so_rcv after appending");
        IFDEBUG(D_STASH)
                dump_mbuf(tpcb->tp_sock->so_rcv.sb_mb, 
                        "stash 0: so_rcv after appending");
index 2fe935f..11383d2 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_subr2.c,v 5.5 88/11/18 17:28:55 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_subr2.c,v $
  *
  * $Header: tp_subr2.c,v 5.5 88/11/18 17:28:55 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_subr2.c,v $
+ *     @(#)tp_subr2.c  7.3 (Berkeley) %G% *
  *
  * Some auxiliary routines:
  *             tp_protocol_error: required by xebec- called when a combo of state,
  *
  * Some auxiliary routines:
  *             tp_protocol_error: required by xebec- called when a combo of state,
@@ -474,6 +475,7 @@ tp_route_to( m, tpcb, channel)
                         * can get long enough timers. sigh.
                        if( siso->siso_addr.osinet_idi[1] == (u_char)IDI_OSINET )
                         */
                         * can get long enough timers. sigh.
                        if( siso->siso_addr.osinet_idi[1] == (u_char)IDI_OSINET )
                         */
+#define        IDI_OSINET      0x0004  /* bcd of "0004" */     
                        if( siso->siso_addr.isoa_genaddr[2] == (char)IDI_OSINET ) {
                                if( tpcb->tp_dont_change_params == 0) {
                                        copyQOSparms( &tp_conn_param[ISO_COSNS],
                        if( siso->siso_addr.isoa_genaddr[2] == (char)IDI_OSINET ) {
                                if( tpcb->tp_dont_change_params == 0) {
                                        copyQOSparms( &tp_conn_param[ISO_COSNS],
index f78e916..2c221b9 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_timer.c,v 5.2 88/11/18 17:29:07 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_timer.c,v $
  *
  * $Header: tp_timer.c,v 5.2 88/11/18 17:29:07 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_timer.c,v $
+ *     @(#)tp_timer.c  7.3 (Berkeley) %G% *
  *
  * Contains all the timer code.  
  * There are two sources of calls to these routines:
  *
  * Contains all the timer code.  
  * There are two sources of calls to these routines:
index 5199be9..0e02143 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_timer.h,v 5.1 88/10/12 12:21:41 root Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_timer.h,v $
  *
  * $Header: tp_timer.h,v 5.1 88/10/12 12:21:41 root Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_timer.h,v $
+ *     @(#)tp_timer.h  7.3 (Berkeley) %G% *
  *
  * ARGO TP
  * The callout structures used by the tp timers.
  *
  * ARGO TP
  * The callout structures used by the tp timers.
index ff47982..d8d3cce 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_tpdu.h,v 4.4 88/07/26 16:45:40 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_tpdu.h,v $
  *
  * $Header: tp_tpdu.h,v 4.4 88/07/26 16:45:40 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_tpdu.h,v $
+ *     @(#)tp_tpdu.h   7.3 (Berkeley) %G% *
  *
  * This ghastly set of macros makes it possible to
  * refer to tpdu structures without going mad.
  *
  * This ghastly set of macros makes it possible to
  * refer to tpdu structures without going mad.
index 653c0ae..3958515 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_trace.c,v 5.3 88/11/18 17:29:14 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_trace.c,v $
  *
  * $Header: tp_trace.c,v 5.3 88/11/18 17:29:14 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_trace.c,v $
+ *     @(#)tp_trace.c  7.3 (Berkeley) %G% *
  *
  * The whole protocol trace module.
  * We keep a circular buffer of trace structures, which are big
  *
  * The whole protocol trace module.
  * We keep a circular buffer of trace structures, which are big
index bd5d267..edb93c7 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_trace.h,v 5.1 88/10/12 12:21:51 root Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_trace.h,v $
  *
  * $Header: tp_trace.h,v 5.1 88/10/12 12:21:51 root Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_trace.h,v $
+ *     @(#)tp_trace.h  7.3 (Berkeley) %G% *
  *
  * 
  * Definitions needed for the protocol trace mechanism.
  *
  * 
  * Definitions needed for the protocol trace mechanism.
index d7f2066..0d55880 100644 (file)
@@ -29,7 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_user.h,v 5.2 88/11/04 15:44:44 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_user.h,v $
  *
  * $Header: tp_user.h,v 5.2 88/11/04 15:44:44 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_user.h,v $
- *     @(#)tp_user.h   7.3 (Berkeley) %G%
+ *     @(#)tp_user.h   7.4 (Berkeley) %G%
  *
  * These are the values a real-live user ;-) needs. 
  */
  *
  * These are the values a real-live user ;-) needs. 
  */
@@ -109,6 +109,7 @@ struct tp_control_hdr {
 #define TPOPT_PARAMS           0xc00 /* to replace a bunch of the others */
 #define TPOPT_MY_TSEL          0x800 
 #define TPOPT_PEER_TSEL                0x900 
 #define TPOPT_PARAMS           0xc00 /* to replace a bunch of the others */
 #define TPOPT_MY_TSEL          0x800 
 #define TPOPT_PEER_TSEL                0x900 
+#define TPOPT_NGC8_ACCEPT      0xd00 /* negotiate connection requests */
 
 /* 
  ***********************flags**********************************
 
 /* 
  ***********************flags**********************************
@@ -122,6 +123,7 @@ struct tp_control_hdr {
 #define TPFLAG_XPD_PRESENT             (u_char)0x08 /* xpd data present */
 #define TPFLAG_PEER_ON_SAMENET (u_char)0x02
 #define TPFLAG_NLQOS_PDN               (u_char)0x01
 #define TPFLAG_XPD_PRESENT             (u_char)0x08 /* xpd data present */
 #define TPFLAG_PEER_ON_SAMENET (u_char)0x02
 #define TPFLAG_NLQOS_PDN               (u_char)0x01
+#define TPFLAG_NGC8_ACCEPT             (u_char)0x04 /* negotiate conn rq's */
 
 
 /* 
 
 
 /* 
index 578e516..a01d32f 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_usrreq.c,v 5.4 88/11/18 17:29:18 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_usrreq.c,v $
  *
  * $Header: tp_usrreq.c,v 5.4 88/11/18 17:29:18 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_usrreq.c,v $
+ *     @(#)tp_usrreq.c 7.4 (Berkeley) %G% *
  *
  * tp_usrreq(), the fellow that gets called from most of the socket code.
  * Pretty straighforward.
  *
  * tp_usrreq(), the fellow that gets called from most of the socket code.
  * Pretty straighforward.
@@ -156,8 +157,6 @@ tp_rcvoob(tpcb, so, m, outflags, inflags)
                return ENOBUFS;
 
 restart:
                return ENOBUFS;
 
 restart:
-       sblock(sb);
-
        if ((((so->so_state & SS_ISCONNECTED) == 0)
                 || (so->so_state & SS_ISDISCONNECTING) != 0) &&
                (so->so_proto->pr_flags & PR_CONNREQUIRED)) {
        if ((((so->so_state & SS_ISCONNECTED) == 0)
                 || (so->so_state & SS_ISDISCONNECTING) != 0) &&
                (so->so_proto->pr_flags & PR_CONNREQUIRED)) {
@@ -176,6 +175,7 @@ restart:
         * uipc_socket2.c (like sbappend).
         */
        
         * uipc_socket2.c (like sbappend).
         */
        
+       sblock(sb);
        for (nn = &sb->sb_mb; n = *nn; nn = &n->m_act)
                if (n->m_type == MT_OOBDATA)
                        break;
        for (nn = &sb->sb_mb; n = *nn; nn = &n->m_act)
                if (n->m_type == MT_OOBDATA)
                        break;
@@ -185,10 +185,10 @@ restart:
                IFDEBUG(D_XPD)
                        printf("RCVOOB: empty queue!\n");
                ENDDEBUG
                IFDEBUG(D_XPD)
                        printf("RCVOOB: empty queue!\n");
                ENDDEBUG
+               sbunlock(sb);
                if (so->so_state & SS_NBIO) {
                        return  EWOULDBLOCK;
                }
                if (so->so_state & SS_NBIO) {
                        return  EWOULDBLOCK;
                }
-               sbunlock(sb);
                sbwait(sb);
                goto restart;
        }
                sbwait(sb);
                goto restart;
        }
@@ -267,7 +267,6 @@ tp_sendoob(tpcb, so, xdata, outflags)
                if(xdata)
                        printf("xdata len 0x%x\n", xdata->m_len);
        ENDDEBUG
                if(xdata)
                        printf("xdata len 0x%x\n", xdata->m_len);
        ENDDEBUG
-oob_again:
        /* DO NOT LOCK the Xsnd buffer!!!! You can have at MOST one 
         * socket buf locked at any time!!! (otherwise you might
         * sleep() in sblock() w/ a signal pending and cause the
        /* DO NOT LOCK the Xsnd buffer!!!! You can have at MOST one 
         * socket buf locked at any time!!! (otherwise you might
         * sleep() in sblock() w/ a signal pending and cause the
@@ -275,14 +274,15 @@ oob_again:
         * is a problem.  So the so_snd buffer lock
         * (done in sosend()) serves as the lock for Xpd.
         */
         * is a problem.  So the so_snd buffer lock
         * (done in sosend()) serves as the lock for Xpd.
         */
-       if (sb->sb_mb) { /* anything already in this sockbuf? */
+       if (sb->sb_mb) { /* Anything already in eXpedited data sockbuf? */
                if (so->so_state & SS_NBIO) {
                        return EWOULDBLOCK;
                }
                if (so->so_state & SS_NBIO) {
                        return EWOULDBLOCK;
                }
-               sbunlock(&so->so_snd);
-               sbwait(&so->so_snd);
-               sblock(&so->so_snd);
-               goto oob_again;
+               while (sb->sb_mb) {
+                       sbunlock(&so->so_snd); /* already locked by sosend */
+                       sbwait(&so->so_snd);
+                       sblock(&so->so_snd);  /* sosend will unlock on return */
+               }
        }
 
        if (xdata == (struct mbuf *)0) {
        }
 
        if (xdata == (struct mbuf *)0) {
@@ -315,7 +315,7 @@ oob_again:
 
 
        IFTRACE(D_XPD)
 
 
        IFTRACE(D_XPD)
-               tptraceTPCB(TPPTmisc, "XPD mark m_next ", xmark->m_next, 0, 0, 0);
+               tptraceTPCB(TPPTmisc, "XPD mark m_next ", xdata->m_next, 0, 0, 0);
        ENDTRACE
 
        sbappendrecord(sb, xdata);      
        ENDTRACE
 
        sbappendrecord(sb, xdata);      
@@ -326,7 +326,6 @@ oob_again:
                dump_mbuf(tpcb->tp_Xsnd.sb_mb, "XPD request Xsndbuf:");
        ENDDEBUG
        return DoEvent(T_XPD_req); 
                dump_mbuf(tpcb->tp_Xsnd.sb_mb, "XPD request Xsndbuf:");
        ENDDEBUG
        return DoEvent(T_XPD_req); 
-
 }
 
 /*
 }
 
 /*
@@ -339,11 +338,6 @@ oob_again:
  *     receive type requests only.
  *     (nam) is used for addresses usually, in particular for the bind request.
  * 
  *     receive type requests only.
  *     (nam) is used for addresses usually, in particular for the bind request.
  * 
- *     The last argument (rights in most usrreq()s) has been stolen for 
- *     returning flags values.  Since rights can't be passed around w/ tp,
- *     this field is used only for RCVOOB user requests, and is assumed
- *     to be either 0 (as soreceive() would have it) or a ptr to the int flags
- *     (as recvv()'s version of soreceive() would have it
  */
 /*ARGSUSED*/
 ProtoHook
  */
 /*ARGSUSED*/
 ProtoHook
@@ -424,12 +418,9 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
                break;
 
        case PRU_LISTEN:
                break;
 
        case PRU_LISTEN:
-               if ( *SHORT_LSUFXP(tpcb) == (short)0 ) {
-                       /* note: this suffix is independent of the extended suffix */
+               if( tpcb->tp_lsuffixlen ==  0) {
                        if( error = (tpcb->tp_nlproto->nlp_pcbbind)(so->so_pcb, MNULL) )
                                break;
                        if( error = (tpcb->tp_nlproto->nlp_pcbbind)(so->so_pcb, MNULL) )
                                break;
-               }
-               if( tpcb->tp_lsuffixlen ==  0) {
                        (tpcb->tp_nlproto->nlp_getsufx)(so->so_pcb, &tpcb->tp_lsuffixlen,
                                tpcb->tp_lsuffix, TP_LOCAL );
                }
                        (tpcb->tp_nlproto->nlp_getsufx)(so->so_pcb, &tpcb->tp_lsuffixlen,
                                tpcb->tp_lsuffix, TP_LOCAL );
                }
@@ -456,17 +447,13 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
                        tpcb->tp_sock, *SHORT_LSUFXP(tpcb), tpcb->tp_lsuffixlen,
                                tpcb->tp_class);
                ENDDEBUG
                        tpcb->tp_sock, *SHORT_LSUFXP(tpcb), tpcb->tp_lsuffixlen,
                                tpcb->tp_class);
                ENDDEBUG
-               if (*SHORT_LSUFXP(tpcb) == (short)0) {
-                       /* no bind was done */
-                       /* note: this suffix is independent of the extended suffix */
+               if( tpcb->tp_lsuffixlen ==  0) {
                        if( error = (tpcb->tp_nlproto->nlp_pcbbind)(so->so_pcb, MNULL) ) {
                                IFDEBUG(D_CONN)
                                        printf("pcbbind returns error 0x%x\n", error );
                                ENDDEBUG
                                break;
                        }
                        if( error = (tpcb->tp_nlproto->nlp_pcbbind)(so->so_pcb, MNULL) ) {
                                IFDEBUG(D_CONN)
                                        printf("pcbbind returns error 0x%x\n", error );
                                ENDDEBUG
                                break;
                        }
-               }
-               if( tpcb->tp_lsuffixlen ==  0) {
                        (tpcb->tp_nlproto->nlp_getsufx)(so->so_pcb, &tpcb->tp_lsuffixlen,
                                tpcb->tp_lsuffix, TP_LOCAL );
                }
                        (tpcb->tp_nlproto->nlp_getsufx)(so->so_pcb, &tpcb->tp_lsuffixlen,
                                tpcb->tp_lsuffix, TP_LOCAL );
                }
@@ -510,30 +497,11 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
                break;
 
        case PRU_ACCEPT: 
                break;
 
        case PRU_ACCEPT: 
-               /* all this garbage is to keep accept from returning
-                * before the 3-way handshake is done in class 4.
-                * it'll have to be modified for other classes 
-                */
+               (tpcb->tp_nlproto->nlp_getnetaddr)(so->so_pcb, nam, TP_FOREIGN);
                IFDEBUG(D_REQUEST)
                IFDEBUG(D_REQUEST)
-                       printf("PRU_ACCEPT so_error 0x%x\n", so->so_error);
+                       printf("ACCEPT PEERADDDR:");
+                       dump_buf(mtod(nam, char *), nam->m_len);
                ENDDEBUG
                ENDDEBUG
-               so->so_error = 0;
-               if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTED)== 0) {
-                       error = EWOULDBLOCK;
-                       break;
-               }
-               while ((so->so_state & SS_ISCONNECTED) == 0 && so->so_error == 0) {
-                       sleep((caddr_t)&so->so_timeo, PZERO+1);
-               }
-               if (so->so_error) {
-                       error = so->so_error;
-               } else {
-                       (tpcb->tp_nlproto->nlp_getnetaddr)(so->so_pcb, nam, TP_FOREIGN);
-                       IFDEBUG(D_REQUEST)
-                               printf("ACCEPT PEERADDDR:");
-                               dump_buf(mtod(nam, char *), nam->m_len);
-                       ENDDEBUG
-               }
                IFPERF(tpcb)
                        u_int lsufx, fsufx;
                        lsufx = *(u_int *)(tpcb->tp_lsuffix);
                IFPERF(tpcb)
                        u_int lsufx, fsufx;
                        lsufx = *(u_int *)(tpcb->tp_lsuffix);
@@ -545,6 +513,11 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
                break;
 
        case PRU_RCVD:
                break;
 
        case PRU_RCVD:
+               if (so->so_state & SS_ISCONFIRMING) {
+                       if (tpcb->tp_state == TP_CONFIRMING)
+                               error = tp_confirm(tpcb);
+                       break;
+               }
                IFTRACE(D_DATA)
                        tptraceTPCB(TPPTmisc,
                        "RCVD BF: lcredit sent_lcdt cc hiwat \n",
                IFTRACE(D_DATA)
                        tptraceTPCB(TPPTmisc,
                        "RCVD BF: lcredit sent_lcdt cc hiwat \n",
@@ -580,21 +553,32 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
                error = tp_rcvoob(tpcb, so, m, outflags, (int)nam);
                break;
 
                error = tp_rcvoob(tpcb, so, m, outflags, (int)nam);
                break;
 
+       case PRU_SEND:
        case PRU_SENDOOB:
                if (controlp && (error = tp_snd_control(controlp, so, &m)))
                        break;
        case PRU_SENDOOB:
                if (controlp && (error = tp_snd_control(controlp, so, &m)))
                        break;
+               if (so->so_state & SS_ISCONFIRMING) {
+                       if (tpcb->tp_state == TP_CONFIRMING)
+                               error = tp_confirm(tpcb);
+                       if (m) {
+                               if (error == 0 && m->m_len != 0)
+                                       error =  ENOTCONN;
+                               m_freem(m);
+                               m = 0;
+                       }
+                       break;
+               }
                if (m == 0)
                        break;
                if (m == 0)
                        break;
-               if (so->so_state & SS_ISCONFIRMING)
-                       tp_confirm();
-               if( ! tpcb->tp_xpd_service ) {
-                       error = EOPNOTSUPP;
+
+               if (req == PRU_SENDOOB) {
+                       if (tpcb->tp_xpd_service == 0) {
+                               error = EOPNOTSUPP;
+                               break;
+                       }
+                       error = tp_sendoob(tpcb, so, m, outflags);
                        break;
                }
                        break;
                }
-               error = tp_sendoob(tpcb, so, m, outflags);
-               break;
-
-       case PRU_SEND:
                /*
                 * The protocol machine copies mbuf chains,
                 * prepends headers, assigns seq numbers, and
                /*
                 * The protocol machine copies mbuf chains,
                 * prepends headers, assigns seq numbers, and
@@ -605,12 +589,6 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
                 * Sbspace may be made negative by appending this mbuf chain,
                 * possibly by a whole cluster.
                 */
                 * Sbspace may be made negative by appending this mbuf chain,
                 * possibly by a whole cluster.
                 */
-               if (controlp && (error = tp_snd_control(controlp, so, &m)))
-                       break;
-               if (m == 0)
-                       break;
-               if (so->so_state & SS_ISCONFIRMING)
-                       tp_confirm();
                {
                        register struct mbuf *n = m;
                        register int len=0;
                {
                        register struct mbuf *n = m;
                        register int len=0;
@@ -624,8 +602,10 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
                         * Could have eotsdu and no data.(presently MUST have
                         * an mbuf though, even if its length == 0) 
                         */
                         * Could have eotsdu and no data.(presently MUST have
                         * an mbuf though, even if its length == 0) 
                         */
-                       if (n->m_flags & M_EOR)
+                       if (n->m_flags & M_EOR) {
                                eotsdu = 1;
                                eotsdu = 1;
+                               n->m_flags &= ~M_EOR;
+                       }
                        IFPERF(tpcb)
                           PStat(tpcb, Nb_from_sess) += totlen;
                           tpmeas(tpcb->tp_lref, TPtime_from_session, 0, 0, 
                        IFPERF(tpcb)
                           PStat(tpcb, Nb_from_sess) += totlen;
                           tpmeas(tpcb->tp_lref, TPtime_from_session, 0, 0, 
@@ -646,12 +626,12 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
                        while (n->m_pkthdr.len > maxsize) {
                                struct mbuf *nn
                                            = m_copym(n, 0, maxsize, M_WAIT);
                        while (n->m_pkthdr.len > maxsize) {
                                struct mbuf *nn
                                            = m_copym(n, 0, maxsize, M_WAIT);
-                               if (eotsdu)
-                                       n->m_flags &= ~M_EOR;
                                sbappendrecord(sb, nn);
                                m_adj(n, maxsize);
                        }
                        sbappendrecord(sb, n);
                                sbappendrecord(sb, nn);
                                m_adj(n, maxsize);
                        }
                        sbappendrecord(sb, n);
+                       if (eotsdu)     /* This presumes knowledge of sbappendrecord() */
+                               n->m_flags |= M_EOR;
                        IFDEBUG(D_SYSCALL)
                                printf("PRU_SEND: eot %d after sbappend 0x%x len 0x%x\n",
                                        eotsdu, n, len);
                        IFDEBUG(D_SYSCALL)
                                printf("PRU_SEND: eot %d after sbappend 0x%x len 0x%x\n",
                                        eotsdu, n, len);
@@ -672,15 +652,7 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
                break;
 
        case PRU_PEERADDR:
                break;
 
        case PRU_PEERADDR:
-               if ((so->so_state & SS_ISCONNECTED) && 
-                   (so->so_state & SS_ISDISCONNECTING) == 0) {
-                               (tpcb->tp_nlproto->nlp_getnetaddr)(so->so_pcb, nam, TP_FOREIGN);
-                               IFDEBUG(D_REQUEST)
-                                       printf("PEERADDDR:");
-                                       dump_buf(mtod(nam, char *), nam->m_len);
-                               ENDDEBUG
-               } else 
-                       error = ENOTCONN;
+               (tpcb->tp_nlproto->nlp_getnetaddr)(so->so_pcb, nam, TP_FOREIGN);
                break;
 
        case PRU_CONTROL:
                break;
 
        case PRU_CONTROL:
@@ -703,7 +675,9 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
        }
 
        IFDEBUG(D_REQUEST)
        }
 
        IFDEBUG(D_REQUEST)
-               printf("returning from tp_usrreq(so 0x%x) error 0x%x\n", so, error);
+               printf("%s, so 0x%x, tpcb 0x%x, error %d, state %d\n",
+                       "returning from tp_usrreq", so, tpcb, error,
+                       tpcb ? 0 : tpcb->tp_state);
        ENDDEBUG
        IFTRACE(D_REQUEST)
                tptraceTPCB(TPPTusrreq, "END req so m state [", req, so, m, 
        ENDDEBUG
        IFTRACE(D_REQUEST)
                tptraceTPCB(TPPTusrreq, "END req so m state [", req, so, m, 
@@ -713,11 +687,15 @@ tp_usrreq(so, req, m, nam, rightsp, controlp)
        return error;
 }
 
        return error;
 }
 
-/*
- * Stub for future negotiated confirmation of connections.
- */
-tp_confirm()
+tp_confirm(tpcb)
+register struct tp_pcb *tpcb;
 {
 {
+       struct tp_event E;
+       if (tpcb->tp_state == TP_CONFIRMING)
+           return DoEvent(T_ACPT_req);
+       printf("Tp confirm called when not confirming; tpcb 0x%x, state 0x%x\n",
+               tpcb, tpcb->tp_state);
+       return 0;
 }
 
 /*
 }
 
 /*