33# include <sys/types.h>
35# include <netinet/in.h>
38#include "XrdSys/XrdSysPlatform.hh"
55 switch(str->
header.requestid) {
118 fprintf(stderr,
"clientMarshall: unknown req ID: %d (0x%x)\n",
134 str->status = ntohs(str->status);
135 str->dlen = ntohl(str->dlen);
142 srh->status = htons(srh->status);
143 srh->dlen = htonl(srh->dlen);
150 srh->msglen = ntohl(srh->msglen);
151 srh->protover = ntohl(srh->protover);
152 srh->msgval = ntohl(srh->msgval);
164 return (
char *)
"kXP_login";
166 return (
char *)
"kXP_auth";
168 return (
char *)
"kXP_create";
170 return (
char *)
"kXP_destroy";
172 return (
char *)
"kXP_attach";
174 return (
char *)
"kXP_detach";
176 return (
char *)
"kXP_sendmsg";
178 return (
char *)
"kXP_admin";
180 return (
char *)
"kXP_readbuf";
182 return (
char *)
"kXP_interrupt";
184 return (
char *)
"kXP_ping";
186 return (
char *)
"kXP_cleanup";
188 return (
char *)
"kXP_urgent";
190 return (
char *)
"kXP_touch";
192 return (
char *)
"kXP_ctrlc";
194 return (
char *)
"kXP_UNKNOWN";
204 return (
char *)
"kXP_ok";
207 return (
char *)
"kXP_oksofar";
210 return (
char *)
"kXP_attn";
213 return (
char *)
"kXP_authmore";
216 return (
char *)
"kXP_error";
219 return (
char *)
"kXP_wait";
222 return (
char *)
"kXP_UNKNOWN";
231 printf(
"\n\n================= DUMPING CLIENT REQUEST HEADER =================\n");
233 printf(
"%40s0x%.2x 0x%.2x\n",
"ClientHeader.streamid = ",
236 printf(
"%40s%s (%d)\n",
"ClientHeader.requestid = ",
240 switch(hdr->
header.requestid) {
243 printf(
"%40s%d \n",
"ClientHeader.login.pid = ", hdr->
login.
pid);
244 printf(
"%40s%s\n",
"ClientHeader.login_body.username = ", hdr->
login.
username);
246 printf(
"%40s0 repeated %d times\n",
"ClientHeader.login.reserved = ",
247 *((kXR_int16 *)tmp));
248 printf(
"%40s%d\n",
"ClientHeader.login.role = ", (kXR_int32)hdr->
login.
role[0]);
251 printf(
"%40s0 repeated %d times\n",
"ClientHeader.auth.reserved = ",
252 (kXR_int32)
sizeof(hdr->
auth.reserved));
253 printf(
" ClientHeader.auth.credtype= 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",
254 hdr->
auth.credtype[0], hdr->
auth.credtype[1],
255 hdr->
auth.credtype[2], hdr->
auth.credtype[3]);
260 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
263 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
266 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
269 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
272 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
273 printf(
"%40s%d \n",
"ClientHeader.proof.int1 = ", hdr->
proof.
int1);
274 printf(
"%40s%d \n",
"ClientHeader.proof.int2 = ", hdr->
proof.
int2);
277 printf(
"%40s%d \n",
"ClientHeader.sendrcv.sid = ", hdr->
sendrcv.
sid);
278 printf(
"%40s%d \n",
"ClientHeader.sendrcv.opt = ", hdr->
sendrcv.
opt);
279 printf(
"%40s%d \n",
"ClientHeader.sendrcv.cid = ", hdr->
sendrcv.
cid);
282 printf(
"%40s%d \n",
"ClientHeader.interrupt.sid = ", hdr->
interrupt.
sid);
283 printf(
"%40s%d \n",
"ClientHeader.interrupt.type = ", hdr->
interrupt.
type);
286 printf(
"%40s%d \n",
"ClientHeader.sendrcv.sid = ", hdr->
sendrcv.
sid);
287 printf(
"%40s%d \n",
"ClientHeader.sendrcv.opt = ", hdr->
sendrcv.
opt);
290 printf(
"%40s%d \n",
"ClientHeader.sendrcv.sid = ", hdr->
sendrcv.
sid);
294 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
295 printf(
"%40s%d \n",
"ClientHeader.proof.int1 = ", hdr->
proof.
int1);
296 printf(
"%40s%d \n",
"ClientHeader.proof.int2 = ", hdr->
proof.
int2);
297 printf(
"%40s%d \n",
"ClientHeader.proof.int3 = ", hdr->
proof.
int3);
300 printf(
"%40s%lld \n",
"ClientHeader.readbuf.ofs = ", hdr->
readbuf.
ofs);
301 printf(
"%40s%d \n",
"ClientHeader.readbuf.len = ", hdr->
readbuf.
len);
304 printf(
"Unknown request ID: %d ! \n", hdr->
header.requestid);
307 printf(
"%40s%d",
"ClientHeader.header.dlen = ", hdr->
header.dlen);
308 printf(
"\n=================== END CLIENT HEADER DUMPING ===================\n\n");
315 printf(
"\n\n======== DUMPING SERVER RESPONSE HEADER ========\n");
316 printf(
"%30s0x%.2x 0x%.2x\n",
"ServerHeader.streamid = ",
317 hdr->streamid[0], hdr->streamid[1]);
318 switch(hdr->status) {
320 printf(
"%30skXP_ok",
"ServerHeader.status = ");
323 printf(
"%30skXP_attn",
"ServerHeader.status = ");
326 printf(
"%30skXP_authmore",
"ServerHeader.status = ");
329 printf(
"%30skXP_error",
"ServerHeader.status = ");
332 printf(
"%30skXP_oksofar",
"ServerHeader.status = ");
335 printf(
"%30skXP_wait",
"ServerHeader.status = ");
338 printf(
" (%d)\n", hdr->status);
339 printf(
"%30s%d",
"ServerHeader.dlen = ", hdr->dlen);
340 printf(
"\n========== END DUMPING SERVER HEADER ===========\n\n");
void smartPrintClientHeader(XPClientRequest *hdr)
char * convertRespStatusToChar(kXR_int16 status)
void ServerResponseHeader2NetFmt(struct ServerResponseHeader *srh)
void ServerInitHandShake2HostFmt(struct ServerInitHandShake *srh)
void clientUnmarshall(struct ServerResponseHeader *str)
char * convertRequestIdToChar(kXR_int16 requestid)
This procedure convert the request code id (an integer defined in XProtocol.hh) in the ascii label (h...
void smartPrintServerHeader(struct ServerResponseHeader *hdr)
int clientMarshall(XPClientRequest *str)
This function applies the network byte order on those parts of the 16-bytes buffer,...
struct XPClientLoginRequest login
struct ClientRequestHdr header
struct XPClientProofRequest proof
struct XPClientInterruptRequest interrupt
struct ClientAuthRequest auth
struct XPClientSendRcvRequest sendrcv
struct XPClientReadbufRequest readbuf