Changeset fc0f131
- Timestamp:
- 06/01/06 14:28:00 (15 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 3b49843
- Parents:
- e49ec63
- Location:
- tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/traceanon/traceanon.c
r853603a rfc0f131 44 44 /* Ok this is remarkably complicated 45 45 * 46 * We want to change one, or the other IP address, while preserving the47 * checksum. TCP and UDP both include the faux header in their checksum48 * c alculations, so you have to update them too. ICMP is even worse --49 * it can include the original IP packet that caused the error! So anonymise50 * that too, but remember that it's travelling in the opposite direction so51 * we need to encrypt the destination and source instead of the sourceand52 * destination!46 * We want to change one, or the other IP address, while preserving 47 * the checksum. TCP and UDP both include the faux header in their 48 * checksum calculations, so you have to update them too. ICMP is 49 * even worse -- it can include the original IP packet that caused the 50 * error! So anonymise that too, but remember that it's travelling in 51 * the opposite direction so we need to encrypt the destination and 52 * source instead of the source and destination! 53 53 */ 54 54 void encrypt_ips(struct libtrace_ip *ip,bool enc_source,bool enc_dest) … … 85 85 86 86 if (icmp) { 87 /* These are error codes that return the IP packet internally */ 88 if (icmp->type == 3 || icmp->type == 5 || icmp->type == 11) { 87 /* These are error codes that return the IP packet 88 * internally 89 */ 90 if (icmp->type == 3 91 || icmp->type == 5 92 || icmp->type == 11) { 89 93 encrypt_ips( 90 91 92 93 94 (struct libtrace_ip*)icmp+ 95 sizeof(struct libtrace_icmp), 96 enc_dest, 97 enc_source); 94 98 } 95 99 } … … 162 166 return 1; 163 167 } 164 165 if (optind == argc) { 166 /* no output specified, output in same format to stdout */ 168 169 if (optind +1>= argc) { 170 /* no output specified, output in same format to 171 * stdout 172 */ 167 173 asprintf(&output,"%s:-","erf"); 168 174 writer = trace_create_output(output); … … 179 185 if (trace_start(trace)==-1) { 180 186 trace_perror(trace,"trace_start"); 187 return 1; 181 188 } 182 189 if (trace_start_output(writer)==-1) { -
tools/tracesplit/tracesplit.c
r853603a rfc0f131 105 105 output=NULL; 106 106 input=trace_create(argv[optind]); 107 if (trace_is_err(input)) { 108 trace_perror(input,""); 109 return 1; 110 } 107 111 108 trace_start(input); 112 if (trace_start(input)==-1) { 113 trace_perror(input,""); 114 return 1; 115 } 109 116 110 117 while(1) { -
tools/tracesplit/tracesplit_dir.c
r853603a rfc0f131 41 41 return 1; 42 42 } 43 trace_start(input); 43 if (trace_start(input)==-1) { 44 trace_perror(input,""); 45 return 1; 46 } 44 47 45 48 while(1) { … … 51 54 if (!out_write) { 52 55 out_write = create_output(argv[3]); 53 if (!out_write) 56 if (trace_is_err_output(out_write)) { 57 trace_perror_output(out_write,""); 54 58 return 1; 59 } 55 60 } 56 61 if (trace_write_packet(out_write, packet)==-1){ … … 61 66 case 1: 62 67 if (!in_write) { 68 in_write = create_output(argv[2]); 69 if (trace_is_err_output(in_write)) { 70 trace_perror_output(in_write,""); 71 return 1; 72 } 63 73 in_write = create_output(argv[2]); 64 74 if (!in_write)
Note: See TracChangeset
for help on using the changeset viewer.