SCCS-vsn: sys/netiso/tp_subr.c 7.9
SCCS-vsn: sys/netiso/tp_usrreq.c 7.17
SCCS-vsn: sys/netiso/tp_output.c 7.10
SCCS-vsn: sys/netiso/tp_stat.h 7.5
SCCS-vsn: sys/netiso/tp_subr2.c 7.9
SCCS-vsn: sys/netiso/tp_param.h 7.8
SCCS-vsn: sys/netiso/tp_trace.h 7.5
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)tp_output.c 7.9 (Berkeley) %G%
+ * @(#)tp_output.c 7.10 (Berkeley) %G%
*/
/***********************************************************
*/
/***********************************************************
#include "socket.h"
#include "socketvar.h"
#include "protosw.h"
#include "socket.h"
#include "socketvar.h"
#include "protosw.h"
-#include "user.h"
-#include "kernel.h"
#include "errno.h"
#include "time.h"
#include "tp_param.h"
#include "errno.h"
#include "time.h"
#include "tp_param.h"
#include "argo_debug.h"
#include "tp_pcb.h"
#include "tp_trace.h"
#include "argo_debug.h"
#include "tp_pcb.h"
#include "tp_trace.h"
#define USERFLAGSMASK_G 0x0f00643b
#define USERFLAGSMASK_S 0x0f000432
#define USERFLAGSMASK_G 0x0f00643b
#define USERFLAGSMASK_S 0x0f000432
switch (optname) {
case TPOPT_INTERCEPT:
switch (optname) {
case TPOPT_INTERCEPT:
- if (error = suser(u.u_cred, &u.u_acflag))
+ if ((so->so_state & SS_PRIV) == 0) {
+ error = EPERM;
- else if (cmd != PRCO_SETOPT || tpcb->tp_state != TP_LISTENING)
+ } else if (cmd != PRCO_SETOPT || tpcb->tp_state != TP_LISTENING)
error = EINVAL;
else {
register struct tp_pcb *t = 0;
error = EINVAL;
else {
register struct tp_pcb *t = 0;
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)tp_param.h 7.7 (Berkeley) %G%
+ * @(#)tp_param.h 7.8 (Berkeley) %G%
*/
/***********************************************************
*/
/***********************************************************
#include "tp_states.h"
#include "tp_events.h"
#include "tp_states.h"
#include "tp_events.h"
+#if defined(__STDC__) || defined(__cplusplus)
+#undef ATTR
+#define ATTR(X) ev_union.EV_ ## X
+#endif /* defined(__STDC__) || defined(__cplusplus) */
#endif tp_NSTATES
#endif KERNEL
#endif tp_NSTATES
#endif KERNEL
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)tp_stat.h 7.4 (Berkeley) %G%
+ * @(#)tp_stat.h 7.5 (Berkeley) %G%
*/
/***********************************************************
*/
/***********************************************************
* ACK_FCC **
*/
} tp_stat ;
* ACK_FCC **
*/
} tp_stat ;
+#define TP_PM_MAX 0xa /* 10 decimal */
#define IncStat(x) tp_stat./**/x/**/++
#define IncStat(x) tp_stat./**/x/**/++
/* for perf measurement stuff: maximum window size it can handle */
/* for perf measurement stuff: maximum window size it can handle */
-#define TP_PM_MAX 0xa /* 10 decimal */
struct tp_pmeas {
/* the first few are distributions as a fn of window size
struct tp_pmeas {
/* the first few are distributions as a fn of window size
-#define PStat(tpcb, x) /* no-op */
+int PStat_Junk;
+#define PStat(tpcb, x) PStat_Junk
#define IncPStat(tpcb, x) /* no-op */
#define IncPStat(tpcb, x) /* no-op */
+#define tpmeas(a,b,c,d,e,f) 0
-#ifndef STAR
-#define STAR *
-#endif STAR
-#define IFPERF //*beginning of comment*/STAR
-#define ENDPERF STAR/*end of comment*//
+#define IFPERF(x) if (0) {
+#define ENDPERF }
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)tp_subr.c 7.8 (Berkeley) %G%
+ * @(#)tp_subr.c 7.9 (Berkeley) %G%
*/
/***********************************************************
*/
/***********************************************************
SeqNum lowseq, highseq ;
SeqNum lowsave;
#ifdef TP_PERF_MEAS
SeqNum lowseq, highseq ;
SeqNum lowsave;
#ifdef TP_PERF_MEAS
struct timeval send_start_time;
struct timeval send_start_time;
+ IFPERF(tpcb)
+ GET_CUR_TIME(&send_start_time);
+ ENDPERF
#endif TP_PERF_MEAS
lowsave = lowseq = SEQ(tpcb, tpcb->tp_sndhiwat + 1);
#endif TP_PERF_MEAS
lowsave = lowseq = SEQ(tpcb, tpcb->tp_sndhiwat + 1);
if ( SEQ_GT(tpcb, lowseq, highseq) )
return ; /* don't send, don't change hiwat, don't set timers */
if ( SEQ_GT(tpcb, lowseq, highseq) )
return ; /* don't send, don't change hiwat, don't set timers */
- IFPERF(tpcb)
- GET_CUR_TIME(&send_start_time);
- ENDPERF
-
ASSERT( SEQ_LEQ(tpcb, lowseq, highseq) );
SEQ_DEC(tpcb, lowseq);
ASSERT( SEQ_LEQ(tpcb, lowseq, highseq) );
SEQ_DEC(tpcb, lowseq);
IFPERF(tpcb)
{
register int npkts;
IFPERF(tpcb)
{
register int npkts;
TPsbsend, &send_end_time, lowsave, tpcb->tp_Nwindow, npkts);
}
ENDPERF
TPsbsend, &send_end_time, lowsave, tpcb->tp_Nwindow, npkts);
}
ENDPERF
tpcb->tp_sndhiwat = lowseq;
tpcb->tp_sndhiwat = lowseq;
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)tp_subr2.c 7.8 (Berkeley) %G%
+ * @(#)tp_subr2.c 7.9 (Berkeley) %G%
*/
/***********************************************************
*/
/***********************************************************
+#define Buf ((u_char *)buf)
printf("Dump buf 0x%x len 0x%x\n", buf, len);
for (i = 0; i < len; i += MAX_COLUMNS) {
printf("+%d:\t", i);
for (j = 0; j < MAX_COLUMNS; j++) {
if (i + j < len) {
printf("Dump buf 0x%x len 0x%x\n", buf, len);
for (i = 0; i < len; i += MAX_COLUMNS) {
printf("+%d:\t", i);
for (j = 0; j < MAX_COLUMNS; j++) {
if (i + j < len) {
- printf("%x/%d\t", buf[i+j]&0xff, buf[i+j]);
+ printf("%x/%d\t", Buf[i+j], Buf[i+j]);
for (j = 0; j < MAX_COLUMNS; j++) {
if (i + j < len) {
for (j = 0; j < MAX_COLUMNS; j++) {
if (i + j < len) {
- if (((buf[i+j]) > 31) && ((buf[i+j]) < 128))
- printf("%c", buf[i+j]&0xff);
+ if (((Buf[i+j]) > 31) && ((Buf[i+j]) < 128))
+ printf("%c", Buf[i+j]);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)tp_trace.h 7.4 (Berkeley) %G%
+ * @(#)tp_trace.h 7.5 (Berkeley) %G%
*/
/***********************************************************
*/
/***********************************************************
#ifndef __TP_TRACE__
#define __TP_TRACE__
#ifndef __TP_TRACE__
#define __TP_TRACE__
#define TPPTsendack 1
#define TPPTgotack 2
#define TPPTsendack 1
#define TPPTgotack 2
#define tpt_window tpt_stuff.tpt_Time.tptv_window
#define tpt_size tpt_stuff.tpt_Time.tptv_size
#define tpt_window tpt_stuff.tpt_Time.tptv_window
#define tpt_size tpt_stuff.tpt_Time.tptv_size
-#define TPTRACEN 300
-int tp_Tracen = 0;
-struct tp_Trace tp_Trace[TPTRACEN];
-
#endif defined(TP_TRACEFILE)||!defined(KERNEL)
#endif defined(TP_TRACEFILE)||!defined(KERNEL)
-extern u_char tp_traceflags[];
-
-#define IFTRACE(ascii)\
- if(tp_traceflags[ascii]) {
-/*
- * for some reason lint complains about tp_param being undefined no
- * matter where or how many times I define it.
- */
#define tptrace(A,B,C,D,E,F) \
tpTrace((struct tp_pcb *)0,\
#define tptrace(A,B,C,D,E,F) \
tpTrace((struct tp_pcb *)0,\
(u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
extern void tpTrace();
(u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
extern void tpTrace();
+extern struct tp_Trace tp_Trace[];
+extern u_char tp_traceflags[];
+int tp_Tracen = 0;
+
+#define IFTRACE(ascii)\
+ if(tp_traceflags[ascii]) {
+/*
+ * for some reason lint complains about tp_param being undefined no
+ * matter where or how many times I define it.
+ */
+#define ENDTRACE }
+
#else TPPT
/***********************************************
* NO TPPT TRACE STUFF
**********************************************/
#else TPPT
/***********************************************
* NO TPPT TRACE STUFF
**********************************************/
-#ifndef STAR
-#define STAR *
-#endif STAR
-#define IFTRACE(ascii) //*beginning of comment*/STAR
-#define ENDTRACE STAR/*end of comment*//
+#define tptrace(A,B,C,D,E,F) 0
+#define tptraceTPCB(A,B,C,D,E,F) 0
+
+#define IFTRACE(ascii) if (0) {
+#define ENDTRACE }
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)tp_usrreq.c 7.16 (Berkeley) %G%
+ * @(#)tp_usrreq.c 7.17 (Berkeley) %G%
*/
/***********************************************************
*/
/***********************************************************
#include "param.h"
#include "systm.h"
#include "param.h"
#include "systm.h"
#include "mbuf.h"
#include "socket.h"
#include "socketvar.h"
#include "domain.h"
#include "protosw.h"
#include "errno.h"
#include "mbuf.h"
#include "socket.h"
#include "socketvar.h"
#include "domain.h"
#include "protosw.h"
#include "errno.h"
#include "tp_param.h"
#include "tp_timer.h"
#include "tp_param.h"
#include "tp_timer.h"