socket layer and transport; more changes to come to usrreq and tp_send.
SCCS-vsn: sys/netiso/tp_input.c 7.4
SCCS-vsn: sys/netiso/tp_meas.h 7.4
SCCS-vsn: sys/netiso/tp_usrreq.c 7.5
SCCS-vsn: sys/netiso/tp_pcb.c 7.4
SCCS-vsn: sys/netiso/tp_subr.c 7.4
*
* $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.c 7.4 (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
*/
IFTRACE(D_NEWSOCK)
tptraceTPCB(TPPTmisc, "newsock: listg_so, _tpcb, so_head",
*/
IFTRACE(D_NEWSOCK)
tptraceTPCB(TPPTmisc, "newsock: listg_so, _tpcb, so_head",
- so, tpcb, so->so_head);
+ so, tpcb, so->so_head, 0);
ENDTRACE
if ((so = sonewsock(so, SS_ISCONFIRMING)) == (struct socket *)0)
ENDTRACE
if ((so = sonewsock(so, SS_ISCONFIRMING)) == (struct socket *)0)
/***********************************************************
/***********************************************************
- Copyright IBM Corporation 1987
+ Copyright IBM Corporation 1987
/*
* 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
+/* @(#)tp_meas.h 7.4 (Berkeley) %G% */
+#ifdef TP_PERF_MEAS
#define tpmeas(a, b, t, c, d, e) \
Tpmeas((u_int)(a), (u_int)(b), t, (u_int)(c), (u_int)(d), (u_int)(e))
#define tpmeas(a, b, t, c, d, e) \
Tpmeas((u_int)(a), (u_int)(b), t, (u_int)(c), (u_int)(d), (u_int)(e))
struct tp_Meas {
int tpm_tseq;
struct tp_Meas {
int tpm_tseq;
/***********************************************************
/***********************************************************
- Copyright IBM Corporation 1987
+ Copyright IBM Corporation 1987
*
* $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% *
+ * @(#)tp_pcb.c 7.4 (Berkeley) %G% *
*
*
* This is the initialization and cleanup stuff -
*
*
* This is the initialization and cleanup stuff -
ENDDEBUG
IFTRACE(D_CONN)
tptraceTPCB(TPPTmisc, "tp_detach tpcb so lsufx",
ENDDEBUG
IFTRACE(D_CONN)
tptraceTPCB(TPPTmisc, "tp_detach tpcb so lsufx",
- tpcb, so, *(int *)(tpcb->tp_lsuffix), 0);
+ tpcb, so, *(u_short *)(tpcb->tp_lsuffix), 0);
ENDTRACE
if (so->so_head) {
ENDTRACE
if (so->so_head) {
*
* $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% *
+ * @(#)tp_subr.c 7.4 (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.
IFTRACE(D_DATA)
tptraceTPCB( TPPTmisc,
IFTRACE(D_DATA)
tptraceTPCB( TPPTmisc,
- "tp_send emitting DT lowseq eotsdu_reached",
- lowseq, eotsdu_reached, 0, 0);
+ "tp_send emitting DT lowseq eotsdu_reached len",
+ lowseq, eotsdu_reached, len, 0);
ENDTRACE
if( tpcb->tp_sock->so_error =
tp_emit(DT_TPDU_type, tpcb, lowseq, eotsdu_reached, m) ) {
ENDTRACE
if( tpcb->tp_sock->so_error =
tp_emit(DT_TPDU_type, tpcb, lowseq, eotsdu_reached, m) ) {
/***********************************************************
/***********************************************************
- Copyright IBM Corporation 1987
+ Copyright IBM Corporation 1987
*
* $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.c 7.5 (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.
}
IFPERF(tpcb)
u_int lsufx, fsufx;
}
IFPERF(tpcb)
u_int lsufx, fsufx;
- lsufx = *(u_int *)(tpcb->tp_lsuffix);
- fsufx = *(u_int *)(tpcb->tp_fsuffix);
+ lsufx = *(u_short *)(tpcb->tp_lsuffix);
+ fsufx = *(u_short *)(tpcb->tp_fsuffix);
tpmeas( tpcb->tp_lref,
TPtime_open | (tpcb->tp_xtd_format <<4 ),
tpmeas( tpcb->tp_lref,
TPtime_open | (tpcb->tp_xtd_format <<4 ),
ENDDEBUG
IFPERF(tpcb)
u_int lsufx, fsufx;
ENDDEBUG
IFPERF(tpcb)
u_int lsufx, fsufx;
- lsufx = *(u_int *)(tpcb->tp_lsuffix);
- fsufx = *(u_int *)(tpcb->tp_fsuffix);
+ lsufx = *(u_short *)(tpcb->tp_lsuffix);
+ fsufx = *(u_short *)(tpcb->tp_fsuffix);
tpmeas( tpcb->tp_lref, TPtime_open,
&time, lsufx, fsufx, tpcb->tp_fref);
tpmeas( tpcb->tp_lref, TPtime_open,
&time, lsufx, fsufx, tpcb->tp_fref);
- tp_headersize(DT_TPDU_type, tpcb)
- (tpcb->tp_use_checksum?4:0) ;
int totlen = n->m_pkthdr.len;
- tp_headersize(DT_TPDU_type, tpcb)
- (tpcb->tp_use_checksum?4:0) ;
int totlen = n->m_pkthdr.len;
/*
* Could have eotsdu and no data.(presently MUST have
/*
* Could have eotsdu and no data.(presently MUST have
* Pre-packetize the data in the sockbuf
* according to negotiated mtu. Do it here
* where we can safely wait for mbufs.
* Pre-packetize the data in the sockbuf
* according to negotiated mtu. Do it here
* where we can safely wait for mbufs.
+ *
+ * This presumes knowledge of sockbuf conventions.
- while (n->m_pkthdr.len > maxsize) {
- struct mbuf *nn
- = m_copym(n, 0, maxsize, M_WAIT);
+ len = 0;
+ if (n = sb->sb_mb)
+ while (n->m_act)
+ n = n->m_act;
+ if (n && n->m_pkthdr.len < maxsize) {
+ int space = maxsize - n->m_pkthdr.len;
+ int eorseen = 0;
+ nn = n;
+ for (;; n = n->m_next) {
+ eorseen |= n->m_flags & M_EOR;
+ if (n->m_next == 0)
+ break;
+ }
+ if (eorseen)
+ goto on1;
+ if (m->m_pkthdr.len <= space) {
+ n->m_next = m;
+ if (eotsdu)
+ nn->m_flags |= M_EOR;
+ goto on2;
+ } else {
+ nn->m_next = m_copym(n, 0, space, M_WAIT);
+ m_adj(n, space);
+ }
+ }
+ on1: len++;
+ for (n = m; n->m_pkthdr.len > maxsize;) {
+ nn = m_copym(n, 0, len, M_WAIT);
sbappendrecord(sb, nn);
m_adj(n, maxsize);
sbappendrecord(sb, nn);
m_adj(n, maxsize);
- sbappendrecord(sb, n);
- if (eotsdu) /* This presumes knowledge of sbappendrecord() */
+ sbappendrecord(sb, n);
+ on2:
+ IFTRACE(D_DATA)
+ tptraceTPCB(TPPTmisc,
+ "SEND BF: maxsize totlen frags eotsdu",
+ maxsize, totlen, len, eotsdu);
+ ENDTRACE
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);
+tp_ltrace(so, uio)
+struct socket *so;
+struct uio *uio;
+{
+ IFTRACE(D_DATA)
+ register struct tp_pcb *tpcb = sototpcb(so);
+ if (tpcb) {
+ tptraceTPCB(TPPTmisc, "sosend so resid iovcnt", so,
+ uio->uio_resid, uio->uio_iovcnt, 0);
+ }
+ ENDTRACE
+}
tp_confirm(tpcb)
register struct tp_pcb *tpcb;
tp_confirm(tpcb)
register struct tp_pcb *tpcb;