📄 print-rx.c
字号:
} /* * Print out the afs call we're invoking. The table used here was * gleaned from ptserver/ptint.xg */ pt_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" pt"); if (is_ubik(pt_op)) { ubik_print(bp, length); return; } printf(" call %s", tok2str(pt_req, "op#%d", pt_op)); /* * Decode some of the arguments to the PT calls */ bp += sizeof(struct rx_header) + 4; switch (pt_op) { case 500: /* I New User */ STROUT(PRNAMEMAX); printf(" id"); INTOUT(); printf(" oldid"); INTOUT(); break; case 501: /* Where is it */ case 506: /* Delete */ case 508: /* Get CPS */ case 512: /* List entry */ case 514: /* List elements */ case 517: /* List owned */ case 518: /* Get CPS2 */ case 519: /* Get host CPS */ printf(" id"); INTOUT(); break; case 502: /* Dump entry */ printf(" pos"); INTOUT(); break; case 503: /* Add to group */ case 507: /* Remove from group */ case 515: /* Is a member of? */ printf(" uid"); INTOUT(); printf(" gid"); INTOUT(); break; case 504: /* Name to ID */ { unsigned long j; TCHECK2(bp[0], 4); j = EXTRACT_32BITS(bp); bp += sizeof(int32_t); /* * Who designed this chicken-shit protocol? * * Each character is stored as a 32-bit * integer! */ for (i = 0; i < j; i++) { VECOUT(PRNAMEMAX); } if (j == 0) printf(" <none!>"); } break; case 505: /* Id to name */ { unsigned long j; printf(" ids:"); TCHECK2(bp[0], 4); i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); for (j = 0; j < i; j++) INTOUT(); if (j == 0) printf(" <none!>"); } break; case 509: /* New entry */ STROUT(PRNAMEMAX); printf(" flag"); INTOUT(); printf(" oid"); INTOUT(); break; case 511: /* Set max */ printf(" id"); INTOUT(); printf(" gflag"); INTOUT(); break; case 513: /* Change entry */ printf(" id"); INTOUT(); STROUT(PRNAMEMAX); printf(" oldid"); INTOUT(); printf(" newid"); INTOUT(); break; case 520: /* Update entry */ printf(" id"); INTOUT(); STROUT(PRNAMEMAX); break; default: ; } return;trunc: printf(" [|pt]");}/* * Handle replies to the AFS protection service */static voidprot_reply_print(register const u_char *bp, int length, int32_t opcode){ struct rx_header *rxh; unsigned long i; char s[AFSNAMEMAX]; if (length < sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the afs call we're invoking. The table used here was * gleaned from ptserver/ptint.xg. Check to see if it's a * Ubik call, however. */ printf(" pt"); if (is_ubik(opcode)) { ubik_reply_print(bp, length, opcode); return; } printf(" reply %s", tok2str(pt_req, "op#%d", opcode)); bp += sizeof(struct rx_header); /* * If it was a data packet, interpret the response */ if (rxh->type == RX_PACKET_TYPE_DATA) switch (opcode) { case 504: /* Name to ID */ { unsigned long j; printf(" ids:"); TCHECK2(bp[0], 4); i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); for (j = 0; j < i; j++) INTOUT(); if (j == 0) printf(" <none!>"); } break; case 505: /* ID to name */ { unsigned long j; TCHECK2(bp[0], 4); j = EXTRACT_32BITS(bp); bp += sizeof(int32_t); /* * Who designed this chicken-shit protocol? * * Each character is stored as a 32-bit * integer! */ for (i = 0; i < j; i++) { VECOUT(PRNAMEMAX); } if (j == 0) printf(" <none!>"); } break; case 508: /* Get CPS */ case 514: /* List elements */ case 517: /* List owned */ case 518: /* Get CPS2 */ case 519: /* Get host CPS */ { unsigned long j; TCHECK2(bp[0], 4); j = EXTRACT_32BITS(bp); bp += sizeof(int32_t); for (i = 0; i < j; i++) { INTOUT(); } if (j == 0) printf(" <none!>"); } break; case 510: /* List max */ printf(" maxuid"); INTOUT(); printf(" maxgid"); INTOUT(); break; default: ; } else { /* * Otherwise, just print out the return code */ printf(" errcode"); INTOUT(); } return;trunc: printf(" [|pt]");}/* * Handle calls to the AFS volume location database service */static voidvldb_print(register const u_char *bp, int length){ int vldb_op; unsigned long i; char s[AFSNAMEMAX]; if (length <= sizeof(struct rx_header)) return; if (snapend - bp + 1 <= sizeof(struct rx_header) + sizeof(int32_t)) { goto trunc; } /* * Print out the afs call we're invoking. The table used here was * gleaned from vlserver/vldbint.xg */ vldb_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" vldb"); if (is_ubik(vldb_op)) { ubik_print(bp, length); return; } printf(" call %s", tok2str(vldb_req, "op#%d", vldb_op)); /* * Decode some of the arguments to the VLDB calls */ bp += sizeof(struct rx_header) + 4; switch (vldb_op) { case 501: /* Create new volume */ case 517: /* Create entry N */ VECOUT(VLNAMEMAX); break; case 502: /* Delete entry */ case 503: /* Get entry by ID */ case 507: /* Update entry */ case 508: /* Set lock */ case 509: /* Release lock */ case 518: /* Get entry by ID N */ printf(" volid"); INTOUT(); TCHECK2(bp[0], sizeof(int32_t)); i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); if (i <= 2) printf(" type %s", voltype[i]); break; case 504: /* Get entry by name */ case 519: /* Get entry by name N */ case 524: /* Update entry by name */ case 527: /* Get entry by name U */ STROUT(VLNAMEMAX); break; case 505: /* Get new vol id */ printf(" bump"); INTOUT(); break; case 506: /* Replace entry */ case 520: /* Replace entry N */ printf(" volid"); INTOUT(); TCHECK2(bp[0], sizeof(int32_t)); i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); if (i <= 2) printf(" type %s", voltype[i]); VECOUT(VLNAMEMAX); break; case 510: /* List entry */ case 521: /* List entry N */ printf(" index"); INTOUT(); break; default: ; } return;trunc: printf(" [|vldb]");}/* * Handle replies to the AFS volume location database service */static voidvldb_reply_print(register const u_char *bp, int length, int32_t opcode){ struct rx_header *rxh; unsigned long i; char s[AFSNAMEMAX]; if (length < sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the afs call we're invoking. The table used here was * gleaned from vlserver/vldbint.xg. Check to see if it's a * Ubik call, however. */ printf(" vldb"); if (is_ubik(opcode)) { ubik_reply_print(bp, length, opcode); return; } printf(" reply %s", tok2str(vldb_req, "op#%d", opcode)); bp += sizeof(struct rx_header); /* * If it was a data packet, interpret the response */ if (rxh->type == RX_PACKET_TYPE_DATA) switch (opcode) { case 510: /* List entry */ printf(" count"); INTOUT(); printf(" nextindex"); INTOUT(); case 503: /* Get entry by id */ case 504: /* Get entry by name */ { unsigned long nservers, j; VECOUT(VLNAMEMAX); TCHECK2(bp[0], sizeof(int32_t)); bp += sizeof(int32_t); printf(" numservers"); TCHECK2(bp[0], sizeof(int32_t)); nservers = EXTRACT_32BITS(bp); bp += sizeof(int32_t); printf(" %lu", nservers); printf(" servers"); for (i = 0; i < 8; i++) { TCHECK2(bp[0], sizeof(int32_t)); if (i < nservers) printf(" %s", inet_ntoa(*((struct in_addr *) bp))); bp += sizeof(int32_t); } printf(" partitions"); for (i = 0; i < 8; i++) { TCHECK2(bp[0], sizeof(int32_t)); j = EXTRACT_32BITS(bp); if (i < nservers && j <= 26) printf(" %c", 'a' + (int)j); else if (i < nservers) printf(" %lu", j); bp += sizeof(int32_t); } TCHECK2(bp[0], 8 * sizeof(int32_t)); bp += 8 * sizeof(int32_t); printf(" rwvol"); UINTOUT(); printf(" rovol"); UINTOUT(); printf(" backup"); UINTOUT(); } break; case 505: /* Get new volume ID */ printf(" newvol"); UINTOUT(); break; case 521: /* List entry */ case 529: /* List entry U */ printf(" count"); INTOUT(); printf(" nextindex"); INTOUT(); case 518: /* Get entry by ID N */ case 519: /* Get entry by name N */ { unsigned long nservers, j; VECOUT(VLNAMEMAX); printf(" numservers"); TCHECK2(bp[0], sizeof(int32_t)); nservers = EXTRACT_32BITS(bp); bp += sizeof(int32_t); printf(" %lu", nservers); printf(" servers"); for (i = 0; i < 13; i++) { TCHECK2(bp[0], sizeof(int32_t)); if (i < nservers) printf(" %s", inet_ntoa(*((struct in_addr *) bp))); bp += sizeof(int32_t); } printf(" partitions"); for (i = 0; i < 13; i++) { TCHECK2(bp[0], sizeof(int32_t)); j = EXTRACT_32BITS(bp); if (i < nservers && j <= 26) printf(" %c", 'a' + (int)j); else if (i < nservers) printf(" %lu", j); bp += sizeof(int32_t); } TCHECK2(bp[0], 13 * sizeof(int32_t)); bp += 13 * sizeof(int32_t); printf(" rwvol"); UINTOUT(); printf(" rovol"); UINTOUT(); printf(" backup"); UINTOUT(); } break; case 526: /* Get entry by ID U */ case 527: /* Get entry by name U */ { unsigned long nservers, j; VECOUT(VLNAMEMAX); printf(" numservers"); TCHECK2(bp[0], sizeof(int32_t)); nservers = EXTRACT_32BITS(bp); bp += sizeof(int32_t); printf(" %lu", nservers); printf(" servers"); for (i = 0; i < 13; i++) { if (i < nservers) { printf(" afsuuid"); AFSUUIDOUT(); } else { TCHECK2(bp[0], 44); bp += 44; } } TCHECK2(bp[0], 4 * 13); bp += 4 * 13; printf(" partitions"); for (i = 0; i < 13; i++) { TCHECK2(bp[0], sizeof(int32_t)); j = EXTRACT_32BITS(bp); if (i < nservers && j <= 26) printf(" %c", 'a' + (int)j); else if (i < nservers) printf(" %lu", j); bp += sizeof(int32_t); } TCHECK2(bp[0], 13 * sizeof(int32_t)); bp += 13 * sizeof(int32_t); printf(" rwvol"); UINTOUT(); printf(" rovol"); UINTOUT(); printf(" backup"); UINTOUT(); } default: ; } else { /* * Otherwise, just print out the return code */ printf(" errcode"); INTOUT(); } return;trunc: printf(" [|vldb]");}/* * Handle calls to the AFS Kerberos Authentication service */static voidkauth_print(register const u_char *bp, int length){ int kauth_op; char s[AFSNAMEMAX]; if (length <= sizeof(struct rx_header)) return; if (snapend - bp + 1 <= sizeof(struct rx_header) + sizeof(int32_t)) { goto trunc; } /* * Print out the afs call we're invoking. The table used here was * gleaned from kauth/kauth.rg */ kauth_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" kauth"); if (is_ubik(kauth_op)) { ubik_print(bp, length); return; } printf(" call %s", tok2str(kauth_req, "op#%d", kauth_op)); /* * Decode some of the arguments to the KA calls */ bp += sizeof(struct rx_header) + 4; switch (kauth_op) { case 1: /* Authenticate old */; case 21: /* Authenticate */ case 22: /* Authenticate-V2 */ case 2: /* Change PW */ case 5: /* Set fields */ case 6: /* Create user */ case 7: /* Delete user */ case 8: /* Get entry */ case 14: /* Unlock */ case 15: /* Lock status */ printf(" principal"); STROUT(KANAMEMAX); STROUT(KANAMEMAX); break; case 3: /* GetTicket-old */ case 23: /* GetTicket */ { int i; printf(" kvno"); INTOUT(); printf(" domain"); STROUT(KANAMEMAX); TCHECK2(bp[0], sizeof(int32_t)); i = (int) EXTRACT_32BITS(bp); bp += sizeof(int32_t); TCHECK2(bp[0], i); bp += i; printf(" principal"); STROUT(KANAMEMAX); STROUT(KANAMEMAX); break; } case 4: /* Set Password */ printf(" principal"); STROUT(KANAMEMAX); STROUT(KANAMEMAX); printf(" kvno"); INTOUT(); break; case 12: /* Get password */ printf(" name"); STROUT(KANAMEMAX); break; default: ; } return;trunc: printf(" [|kauth]");}/* * Handle replies to the AFS Kerberos Authentication Service */static voidkauth_reply_print(register const u_char *bp, int length, int32_t opcode){ struct rx_header *rxh; if (length <= sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the afs call we're invoking. The table used here was * gleaned from kauth/kauth.rg
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -