4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 2001 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 #include <sys/types.h>
35 static char *atp_ci(uint8_t);
37 static char *atp_trel
[8] = {
49 interpret_atp(int flags
, struct ddp_hdr
*ddp
, int len
)
51 struct atp_hdr
*atp
= (struct atp_hdr
*)ddp
;
52 int atplen
= len
- (DDPHDR_SIZE
+ ATPHDR_SIZE
);
56 (void) snprintf(get_sum_line(), MAXLINE
,
57 "ATP (short packet)");
60 (void) snprintf(get_sum_line(), MAXLINE
,
61 "ATP (%s), TID=%d, L=%d",
62 atp_ci(atp
->atp_ctrl
),
63 get_short((uint8_t *)&atp
->atp_tid
),
67 if (flags
& F_DTAIL
) {
68 show_header("ATP: ", "ATP Header", 8);
72 (void) snprintf(get_line(0, 0), get_line_remain(),
73 "ATP (short packet)");
76 (void) snprintf(get_line(0, 0), get_line_remain(),
78 (void) snprintf(get_line(0, 0), get_line_remain(),
79 "Ctrl = 0x%x (%s), bitmap/seq = 0x%x",
81 atp_ci(atp
->atp_ctrl
),
83 (void) snprintf(get_line(0, 0), get_line_remain(),
84 "TID = %d, user bytes 0x%x 0x%x 0x%x 0x%x",
85 get_short((uint8_t *)&atp
->atp_tid
),
86 atp
->atp_user
[0], atp
->atp_user
[1],
87 atp
->atp_user
[2], atp
->atp_user
[3]);
91 if (ddp
->ddp_dest_sock
== DDP_TYPE_ZIP
||
92 ddp
->ddp_src_sock
== DDP_TYPE_ZIP
)
93 interpret_atp_zip(flags
, atp
, atplen
);
102 char *tail
= &buf
[sizeof (buf
)];
104 switch (atp_fun(ci
)) {
106 p
+= snprintf(p
, tail
-p
, "TReq");
107 to
= atp_trel
[atp_tmo(ci
)];
110 p
+= snprintf(p
, tail
-p
, "TResp");
113 p
+= snprintf(p
, tail
-p
, "TRel");
117 p
+= snprintf(p
, tail
-p
, ci
& ATP_FLG_XO
? " XO" : " ALO");
119 if (ci
& ATP_FLG_EOM
)
120 p
+= snprintf(p
, tail
-p
, " EOM");
122 if (ci
& ATP_FLG_STS
)
123 p
+= snprintf(p
, tail
-p
, " STS");
126 (void) snprintf(p
, tail
-p
, " %s", to
);