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) 1993, 1999 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%W% %E% SMI"
29 #include <sys/types.h>
30 #include <sys/errno.h>
33 #include <netinet/in.h>
36 #include <rpc/types.h>
41 #include <rpc/rpc_msg.h>
46 extern char *dlc_header
;
47 extern jmp_buf xdr_err
;
49 static char *procnames_short
[] = {
56 static char *procnames_long
[] = {
57 "Null procedure", /* 0 */
58 "Invoke operation", /* 1 */
60 "Kill operation", /* 3 */
70 typedef enum Rec_type Rec_type
;
73 interpret_solarnet_fw(
83 char buff
[CTXTLEN
+ 1];
89 int new_row
= 1, row
= 0;
91 if (proc
< 0 || proc
> MAXPROC
)
95 if (setjmp(xdr_err
)) {
99 line
= get_sum_line();
104 procnames_short
[proc
]);
105 line
+= strlen(line
);
109 (void) sprintf(line
, " %s",
110 getxdr_string(buff
, CTXTLEN
));
111 line
+= strlen(line
);
112 (void) sprintf(line
, "/%s",
113 getxdr_string(buff
, CTXTLEN
));
114 line
+= strlen(line
);
115 getxdr_string(buff
, CTXTLEN
);
116 if (strlen(buff
) != 0) {
117 (void) sprintf(line
, ".%s", buff
);
118 line
+= strlen(line
);
120 (void) getxdr_string(buff
, CTXTLEN
);
121 thresh
= getxdr_u_long();
122 if (thresh
== ULONG_MAX
)
123 (void) sprintf(line
, " (all)");
125 (void) sprintf(line
, " %lu", thresh
);
126 line
+= strlen(line
);
127 (void) getxdr_context(buff
, CTXTLEN
);
130 (void) getxdr_context(buff
, CTXTLEN
);
131 sscanf(buff
, "%*s %*s %s.%*s", op
);
132 op
[strlen(op
)-1] = '\0';
133 (void) sprintf(line
, " %s", op
);
134 line
+= strlen(line
);
135 thresh
= getxdr_u_long();
136 if (thresh
== ULONG_MAX
)
137 (void) sprintf(line
, " (all)");
139 (void) sprintf(line
, " %lu", thresh
);
140 line
+= strlen(line
);
143 (void) getxdr_context(buff
, CTXTLEN
);
144 sscanf(buff
, "%*s %*s %s.%*s", op
);
145 op
[strlen(op
)-1] = '\0';
146 (void) sprintf(line
, " %s", op
);
147 line
+= strlen(line
);
153 check_retransmit(line
, xid
);
155 (void) sprintf(line
, "SOLARNET R %s",
156 procnames_short
[proc
]);
157 line
+= strlen(line
);
162 sprintf(line
, " FW");
163 else if (e
== FW_ERR_OP
)
164 sprintf(line
, " OP");
166 sprintf(line
, " NOERR");
167 line
+= strlen(line
);
168 if (e
!= FW_ERR_NONE
) {
169 sprintf(line
, " %lu", getxdr_u_long());
170 line
+= strlen(line
);
171 (void) getxdr_bool();
173 getxdr_string(buff
, CTXTLEN
));
174 line
+= strlen(line
);
177 sprintf(line
, " Success");
178 line
+= strlen(line
);
182 sprintf(line
, " %lu rows", getxdr_u_long());
183 line
+= strlen(line
);
185 sprintf(line
, " (No output)");
186 line
+= strlen(line
);
191 if ((flags
& F_DTAIL
)) {
192 show_header("SOLARNET: ", "Solarnet Administration Service",
195 if (setjmp(xdr_err
)) {
198 (void) sprintf(get_line(0, 0), "Proc = %d (%s)", proc
,
199 procnames_long
[proc
]);
203 (void) showxdr_string(CTXTLEN
, "Category: %s");
204 (void) showxdr_string(CTXTLEN
, "Operation: %s");
205 (void) showxdr_string(CTXTLEN
, "Version: %s");
206 (void) showxdr_string(CTXTLEN
, "Locale: %s");
207 (void) showxdr_u_long("Threshold: %lu rows");
208 (void) showxdr_context("Context: %s");
211 sprintf(get_line(0, 0),
212 "No input arguments");
215 thresh
= showxdr_u_long("Input rows = %lu");
216 (void) getxdr_bool();
219 if (rt
== REC_TYPE_NORM
) {
221 sprintf(get_line(0, 0),
225 (void) getxdr_string(buff
,
227 (void) getxdr_string(op
,
229 sprintf(get_line(0, 0),
230 "\t%s = %s", buff
, op
);
231 } else if (rt
== REC_TYPE_EOR
) {
234 } while (rt
!= REC_TYPE_EOF
);
237 (void) showxdr_context("Context: %s");
238 (void) showxdr_u_long("Threshold: %lu rows");
241 (void) showxdr_context("Context: %s");
250 if (e
== FW_ERR_FW
) {
252 "Framework error code %lu");
253 } else if (e
== FW_ERR_OP
) {
255 "Operation error code %lu");
257 showxdr_u_long("No error %*lu");
259 (void) getxdr_bool();
260 (void) getxdr_string(buff
, CTXTLEN
);
261 if (e
!= FW_ERR_NONE
) {
262 sprintf(get_line(0, 0),
263 "Error message: %s", buff
);
267 sprintf(get_line(0, 0),
268 "Operation was successful");
272 showxdr_u_long("Output rows: %lu");
273 (void) getxdr_bool();
276 if (rt
== REC_TYPE_NORM
) {
278 sprintf(get_line(0, 0),
282 (void) getxdr_string(buff
,
284 (void) getxdr_string(op
,
286 sprintf(get_line(0, 0),
287 "\t%s = %s", buff
, op
);
288 } else if (rt
== REC_TYPE_EOR
) {
291 } while (rt
!= REC_TYPE_EOF
);
293 sprintf(get_line(0, 0), "No output");