33 # include <sys/types.h> 35 # include <netinet/in.h> 38 #include "XrdSys/XrdSysPlatform.hh" 54 switch(str->
header.requestid) {
117 fprintf(stderr,
"clientMarshall: unknown req ID: %d (0x%x)\n",
133 str->status = ntohs(str->status);
134 str->dlen = ntohl(str->dlen);
141 srh->status = htons(srh->status);
142 srh->dlen = htonl(srh->dlen);
149 srh->msglen = ntohl(srh->msglen);
150 srh->protover = ntohl(srh->protover);
151 srh->msgval = ntohl(srh->msgval);
163 return (
char *)
"kXP_login";
165 return (
char *)
"kXP_auth";
167 return (
char *)
"kXP_create";
169 return (
char *)
"kXP_destroy";
171 return (
char *)
"kXP_attach";
173 return (
char *)
"kXP_detach";
175 return (
char *)
"kXP_sendmsg";
177 return (
char *)
"kXP_admin";
179 return (
char *)
"kXP_readbuf";
181 return (
char *)
"kXP_interrupt";
183 return (
char *)
"kXP_ping";
185 return (
char *)
"kXP_cleanup";
187 return (
char *)
"kXP_urgent";
189 return (
char *)
"kXP_touch";
191 return (
char *)
"kXP_ctrlc";
193 return (
char *)
"kXP_UNKNOWN";
203 return (
char *)
"kXP_ok";
206 return (
char *)
"kXP_oksofar";
209 return (
char *)
"kXP_attn";
212 return (
char *)
"kXP_authmore";
215 return (
char *)
"kXP_error";
218 return (
char *)
"kXP_wait";
221 return (
char *)
"kXP_UNKNOWN";
230 printf(
"\n\n================= DUMPING CLIENT REQUEST HEADER =================\n");
232 printf(
"%40s0x%.2x 0x%.2x\n",
"ClientHeader.streamid = ",
235 printf(
"%40s%s (%d)\n",
"ClientHeader.requestid = ",
239 switch(hdr->
header.requestid) {
242 printf(
"%40s%d \n",
"ClientHeader.login.pid = ", hdr->
login.
pid);
243 printf(
"%40s%s\n",
"ClientHeader.login_body.username = ", hdr->
login.
username);
245 printf(
"%40s0 repeated %d times\n",
"ClientHeader.login.reserved = ",
246 *((kXR_int16 *)tmp));
247 printf(
"%40s%d\n",
"ClientHeader.login.role = ", (kXR_int32)hdr->
login.
role[0]);
250 printf(
"%40s0 repeated %d times\n",
"ClientHeader.auth.reserved = ",
251 (kXR_int32)
sizeof(hdr->
auth.reserved));
252 printf(
" ClientHeader.auth.credtype= 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",
253 hdr->
auth.credtype[0], hdr->
auth.credtype[1],
254 hdr->
auth.credtype[2], hdr->
auth.credtype[3]);
259 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
262 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
265 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
268 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
271 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
272 printf(
"%40s%d \n",
"ClientHeader.proof.int1 = ", hdr->
proof.
int1);
273 printf(
"%40s%d \n",
"ClientHeader.proof.int2 = ", hdr->
proof.
int2);
276 printf(
"%40s%d \n",
"ClientHeader.sendrcv.sid = ", hdr->
sendrcv.
sid);
277 printf(
"%40s%d \n",
"ClientHeader.sendrcv.opt = ", hdr->
sendrcv.
opt);
278 printf(
"%40s%d \n",
"ClientHeader.sendrcv.cid = ", hdr->
sendrcv.
cid);
281 printf(
"%40s%d \n",
"ClientHeader.interrupt.sid = ", hdr->
interrupt.
sid);
282 printf(
"%40s%d \n",
"ClientHeader.interrupt.type = ", hdr->
interrupt.
type);
285 printf(
"%40s%d \n",
"ClientHeader.sendrcv.sid = ", hdr->
sendrcv.
sid);
286 printf(
"%40s%d \n",
"ClientHeader.sendrcv.opt = ", hdr->
sendrcv.
opt);
289 printf(
"%40s%d \n",
"ClientHeader.sendrcv.sid = ", hdr->
sendrcv.
sid);
293 printf(
"%40s%d \n",
"ClientHeader.proof.sid = ", hdr->
proof.
sid);
294 printf(
"%40s%d \n",
"ClientHeader.proof.int1 = ", hdr->
proof.
int1);
295 printf(
"%40s%d \n",
"ClientHeader.proof.int2 = ", hdr->
proof.
int2);
296 printf(
"%40s%d \n",
"ClientHeader.proof.int3 = ", hdr->
proof.
int3);
299 printf(
"%40s%lld \n",
"ClientHeader.readbuf.ofs = ", hdr->
readbuf.
ofs);
300 printf(
"%40s%d \n",
"ClientHeader.readbuf.len = ", hdr->
readbuf.
len);
303 printf(
"Unknown request ID: %d ! \n", hdr->
header.requestid);
306 printf(
"%40s%d",
"ClientHeader.header.dlen = ", hdr->
header.dlen);
307 printf(
"\n=================== END CLIENT HEADER DUMPING ===================\n\n");
314 printf(
"\n\n======== DUMPING SERVER RESPONSE HEADER ========\n");
315 printf(
"%30s0x%.2x 0x%.2x\n",
"ServerHeader.streamid = ",
316 hdr->streamid[0], hdr->streamid[1]);
317 switch(hdr->status) {
319 printf(
"%30skXP_ok",
"ServerHeader.status = ");
322 printf(
"%30skXP_attn",
"ServerHeader.status = ");
325 printf(
"%30skXP_authmore",
"ServerHeader.status = ");
328 printf(
"%30skXP_error",
"ServerHeader.status = ");
331 printf(
"%30skXP_oksofar",
"ServerHeader.status = ");
334 printf(
"%30skXP_wait",
"ServerHeader.status = ");
337 printf(
" (%d)\n", hdr->status);
338 printf(
"%30s%d",
"ServerHeader.dlen = ", hdr->dlen);
339 printf(
"\n========== END DUMPING SERVER HEADER ===========\n\n");
struct XPClientReadbufRequest readbuf
void clientUnmarshall(struct ServerResponseHeader *str)
struct XPClientInterruptRequest interrupt
char * convertRespStatusToChar(kXR_int16 status)
struct ClientRequestHdr header
char * convertRequestIdToChar(kXR_int16 requestid)
This procedure convert the request code id (an integer defined in XProtocol.hh) in the ascii label (h...
struct XPClientSendRcvRequest sendrcv
struct XPClientProofRequest proof
void ServerResponseHeader2NetFmt(struct ServerResponseHeader *srh)
void smartPrintServerHeader(struct ServerResponseHeader *hdr)
int clientMarshall(XPClientRequest *str)
This function applies the network byte order on those parts of the 16-bytes buffer, only if it is composed by some binary part Return 0 if OK, -1 in case the ID is unknown.
struct ClientAuthRequest auth
struct XPClientLoginRequest login
void ServerInitHandShake2HostFmt(struct ServerInitHandShake *srh)
void smartPrintClientHeader(XPClientRequest *hdr)