print-rx.c (75115) | print-rx.c (80231) |
---|---|
1/* 2 * This code unmangles RX packets. RX is the mutant form of RPC that AFS 3 * uses to communicate between clients and servers. 4 * 5 * In this code, I mainly concern myself with decoding the AFS calls, not 6 * with the guts of RX, per se. 7 * 8 * Bah. If I never look at rx_packet.h again, it will be too soon. 9 * 10 * Ken Hornstein <kenh@cmf.nrl.navy.mil> 11 * 12 */ 13 14#ifndef lint 15static const char rcsid[] = | 1/* 2 * This code unmangles RX packets. RX is the mutant form of RPC that AFS 3 * uses to communicate between clients and servers. 4 * 5 * In this code, I mainly concern myself with decoding the AFS calls, not 6 * with the guts of RX, per se. 7 * 8 * Bah. If I never look at rx_packet.h again, it will be too soon. 9 * 10 * Ken Hornstein <kenh@cmf.nrl.navy.mil> 11 * 12 */ 13 14#ifndef lint 15static const char rcsid[] = |
16 "@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.20 2001/01/10 08:12:01 fenner Exp $"; | 16 "@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.20.2.1 2001/07/09 01:40:59 fenner Exp $"; |
17#endif 18 19#ifdef HAVE_CONFIG_H 20#include "config.h" 21#endif 22 23#include <stdio.h> 24#include <stdlib.h> --- 605 unchanged lines hidden (view full) --- 630 bp += sizeof(int32_t); \ 631 n2 = EXTRACT_32BITS(bp); \ 632 bp += sizeof(int32_t); \ 633 n3 = EXTRACT_32BITS(bp); \ 634 bp += sizeof(int32_t); \ 635 printf(" fid %d/%d/%d", (int) n1, (int) n2, (int) n3); \ 636 } 637 | 17#endif 18 19#ifdef HAVE_CONFIG_H 20#include "config.h" 21#endif 22 23#include <stdio.h> 24#include <stdlib.h> --- 605 unchanged lines hidden (view full) --- 630 bp += sizeof(int32_t); \ 631 n2 = EXTRACT_32BITS(bp); \ 632 bp += sizeof(int32_t); \ 633 n3 = EXTRACT_32BITS(bp); \ 634 bp += sizeof(int32_t); \ 635 printf(" fid %d/%d/%d", (int) n1, (int) n2, (int) n3); \ 636 } 637 |
638#define STROUT(MAX) { int i; \ | 638#define STROUT(MAX) { unsigned int i; \ |
639 TCHECK2(bp[0], sizeof(int32_t)); \ | 639 TCHECK2(bp[0], sizeof(int32_t)); \ |
640 i = (int) EXTRACT_32BITS(bp); \ | 640 i = EXTRACT_32BITS(bp); \ 641 if (i > MAX) \ 642 goto trunc; \ |
641 bp += sizeof(int32_t); \ | 643 bp += sizeof(int32_t); \ |
642 TCHECK2(bp[0], i); \ 643 strncpy(s, (char *) bp, min(MAX, i)); \ 644 s[i] = '\0'; \ 645 printf(" \"%s\"", s); \ | 644 printf(" \""); \ 645 if (fn_printn(bp, i, snapend)) \ 646 goto trunc; \ 647 printf("\""); \ |
646 bp += ((i + sizeof(int32_t) - 1) / sizeof(int32_t)) * sizeof(int32_t); \ 647 } 648 649#define INTOUT() { int i; \ 650 TCHECK2(bp[0], sizeof(int32_t)); \ 651 i = (int) EXTRACT_32BITS(bp); \ 652 bp += sizeof(int32_t); \ 653 printf(" %d", i); \ --- 68 unchanged lines hidden (view full) --- 722 int k; \ 723 TCHECK2(bp[0], MAX * sizeof(int32_t)); \ 724 sp = s; \ 725 for (k = 0; k < MAX; k++) { \ 726 *sp++ = (char) EXTRACT_32BITS(bp); \ 727 bp += sizeof(int32_t); \ 728 } \ 729 s[MAX] = '\0'; \ | 648 bp += ((i + sizeof(int32_t) - 1) / sizeof(int32_t)) * sizeof(int32_t); \ 649 } 650 651#define INTOUT() { int i; \ 652 TCHECK2(bp[0], sizeof(int32_t)); \ 653 i = (int) EXTRACT_32BITS(bp); \ 654 bp += sizeof(int32_t); \ 655 printf(" %d", i); \ --- 68 unchanged lines hidden (view full) --- 724 int k; \ 725 TCHECK2(bp[0], MAX * sizeof(int32_t)); \ 726 sp = s; \ 727 for (k = 0; k < MAX; k++) { \ 728 *sp++ = (char) EXTRACT_32BITS(bp); \ 729 bp += sizeof(int32_t); \ 730 } \ 731 s[MAX] = '\0'; \ |
730 printf(" \"%s\"", s); \ | 732 printf(" \""); \ 733 fn_print(s, NULL); \ 734 printf("\""); \ |
731 } 732 733static void 734ack_print(register const u_char *bp, int length) 735{ 736 u_char nAcks; 737 int i; 738 --- 343 unchanged lines hidden (view full) --- 1082 printf("k"); \ 1083 if (acl & PRSFS_ADMINISTER) \ 1084 printf("a"); 1085 1086 for (i = 0; i < pos; i++) { 1087 if (sscanf((char *) s, "%s %d\n%n", user, &acl, &n) != 2) 1088 goto finish; 1089 s += n; | 735 } 736 737static void 738ack_print(register const u_char *bp, int length) 739{ 740 u_char nAcks; 741 int i; 742 --- 343 unchanged lines hidden (view full) --- 1086 printf("k"); \ 1087 if (acl & PRSFS_ADMINISTER) \ 1088 printf("a"); 1089 1090 for (i = 0; i < pos; i++) { 1091 if (sscanf((char *) s, "%s %d\n%n", user, &acl, &n) != 2) 1092 goto finish; 1093 s += n; |
1090 printf(" +{%s ", user); | 1094 printf(" +{"); 1095 fn_print(user, NULL); 1096 printf(" "); |
1091 ACLOUT(acl); 1092 printf("}"); 1093 if (s > end) 1094 goto finish; 1095 } 1096 1097 for (i = 0; i < neg; i++) { 1098 if (sscanf((char *) s, "%s %d\n%n", user, &acl, &n) != 2) 1099 goto finish; 1100 s += n; | 1097 ACLOUT(acl); 1098 printf("}"); 1099 if (s > end) 1100 goto finish; 1101 } 1102 1103 for (i = 0; i < neg; i++) { 1104 if (sscanf((char *) s, "%s %d\n%n", user, &acl, &n) != 2) 1105 goto finish; 1106 s += n; |
1101 printf(" -{%s ", user); | 1107 printf(" -{"); 1108 fn_print(user, NULL); 1109 printf(" "); |
1102 ACLOUT(acl); 1103 printf("}"); 1104 if (s > end) 1105 goto finish; 1106 } 1107 1108finish: 1109 free(user); --- 1416 unchanged lines hidden --- | 1110 ACLOUT(acl); 1111 printf("}"); 1112 if (s > end) 1113 goto finish; 1114 } 1115 1116finish: 1117 free(user); --- 1416 unchanged lines hidden --- |