checked in for torek by sklower; Mike agrees to all these changes
[unix-history] / usr / src / sys / netiso / trtp.c
CommitLineData
9caf7cfb
KS
1#include <stdio.h>
2#define TPPT
3
4#include <sys/param.h>
5#include <sys/systm.h>
6#include <sys/mbuf.h>
7#include <sys/socket.h>
8#include <sys/socketvar.h>
9#include <sys/types.h>
10#include <sys/time.h>
11
12#include <netiso/tp_param.h>
13#include <netiso/tp_timer.h>
14#include <netiso/tp_stat.h>
15#include <netiso/tp_param.h>
16#include <netiso/tp_ip.h>
17#include <netiso/tp_pcb.h>
18#include <netiso/tp_tpdu.h>
19#include <netiso/argo_debug.h>
20#include <netiso/tp_trace.h>
21
22static tp_seq = 0;
23u_char tp_traceflags[128];
24
25main(argc, argv)
26{
27
28}
29
30#ifdef notdef
31
32tpprint(tp)
33 register struct tp_Trace *tp;
34{
35/*tptrace(tpcb, event, arg, src, len, arg4, arg5)*/
36 struct tp_pcb *tpcb;
37 u_int event, arg;
38 u_int src;
39 u_int len;
40 u_int arg4;
41 u_int arg5;
42
43 tp->tpt_event = event;
44 tp->tpt_tseq = tp_seq++;
45 tp->tpt_arg = arg;
46 if(tpcb)
47 tp->tpt_arg2 = tpcb->tp_lref;
48 bcopy( (caddr_t)&time, (caddr_t)&tp->tpt_time, sizeof(struct timeval) );
49
50 switch(tp->tpt_event) {
51
52 case TPPTertpdu:
53 bcopy((caddr_t)src, (caddr_t)&tp->tpt_ertpdu,
54 (unsigned)MIN((int)len, sizeof(struct tp_Trace)));
55 break;
56
57 case TPPTusrreq:
58 case TPPTmisc:
59
60 printf(tp->tpt_str,
61 tp->tpt_m2/* = src */,
62 tp->tpt_m3/* = len */,
63 tp->tpt_m4/* = arg4 */,
64 tp->tpt_m1/* = arg5 */);
65
66 case TPPTgotXack:
67 case TPPTXack:
68 case TPPTsendack:
69 case TPPTgotack:
70 case TPPTack:
71 case TPPTindicate:
72 default:
73 case TPPTdriver:
74 tp->tpt_m2 = arg;
75 tp->tpt_m3 = src;
76 tp->tpt_m4 = len;
77 tp->tpt_m5 = arg4;
78 tp->tpt_m1 = arg5;
79 break;
80 case TPPTparam:
81 bcopy((caddr_t)src, (caddr_t)&tp->tpt_param, sizeof(struct tp_param));
82 break;
83 case TPPTref:
84 bcopy((caddr_t)src, (caddr_t)&tp->tpt_ref, sizeof(struct tp_ref));
85 break;
86
87 case TPPTtpduin:
88 case TPPTtpduout:
89 tp->tpt_arg2 = arg4;
90 bcopy((caddr_t)src, (caddr_t)&tp->tpt_tpdu,
91 (unsigned)MIN((int)len, sizeof(struct tp_Trace)));
92 break;
93 }
94}
95#endif
96
97char tpdu_types[][4] = {
98"#0", "XPD", "XAK", "GR", "#4", "#5", "AK", "ER",
99"DR", "#9", "#10", "#11", "DC", "CC", "CR", "DT"};
100
101p_tpdu(tpdu, xtype)
102struct tpdu *tpdu;
103{
104 struct tpdu t = *tpdu;
105 int type = t.tpdu_type;
106
107 printf("<(%d)%s:", t.tpdu_li, tpdu_types[type]);
108 switch (type) {
109 case DT_TPDU_type:
110 case XPD_TPDU_type:
111 printf("to %x cdt %d seq %d eot %d\>", t.tpdu_dref, t.tpdu_cdt
112 xtype ? t.tpdu_DTseqX : t.tpdu_DTseq,
113 xtype ? t.tpdu_DTeotX : t.tpdu_DTeot);
114 break;
115 }
116}