version 1.14, 2003/06/25 15:45:10 |
version 1.15, 2003/09/24 20:21:40 |
|
|
ap->th_block = ntohs(ap->th_block); |
ap->th_block = ntohs(ap->th_block); |
if (ap->th_opcode == ERROR) { |
if (ap->th_opcode == ERROR) { |
printf("Error code %d: %s\n", ap->th_code, |
printf("Error code %d: %s\n", ap->th_code, |
ap->th_msg); |
ap->th_msg); |
goto abort; |
goto abort; |
} |
} |
if (ap->th_opcode == ACK) { |
if (ap->th_opcode == ACK) { |
|
|
* both sides. |
* both sides. |
*/ |
*/ |
j = synchnet(f); |
j = synchnet(f); |
if (j && trace) { |
if (j && trace) |
printf("discarded %d packets\n", |
printf("discarded %d packets\n", j); |
j); |
if (ap->th_block == (block-1)) |
} |
|
if (ap->th_block == (block-1)) { |
|
goto send_data; |
goto send_data; |
} |
|
} |
} |
} |
} |
if (block > 0) |
if (block > 0) |
|
|
dp->th_block = ntohs(dp->th_block); |
dp->th_block = ntohs(dp->th_block); |
if (dp->th_opcode == ERROR) { |
if (dp->th_opcode == ERROR) { |
printf("Error code %d: %s\n", dp->th_code, |
printf("Error code %d: %s\n", dp->th_code, |
dp->th_msg); |
dp->th_msg); |
goto abort; |
goto abort; |
} |
} |
if (dp->th_opcode == DATA) { |
if (dp->th_opcode == DATA) { |
|
|
* both sides. |
* both sides. |
*/ |
*/ |
j = synchnet(f); |
j = synchnet(f); |
if (j && trace) { |
if (j && trace) |
printf("discarded %d packets\n", j); |
printf("discarded %d packets\n", j); |
} |
if (dp->th_block == (block-1)) |
if (dp->th_block == (block-1)) { |
|
goto send_ack; /* resend ack */ |
goto send_ack; /* resend ack */ |
} |
|
} |
} |
} |
} |
/* size = write(fd, dp->th_data, n - 4); */ |
/* size = write(fd, dp->th_data, n - 4); */ |
|
|
printstats(const char *direction, unsigned long amount) |
printstats(const char *direction, unsigned long amount) |
{ |
{ |
double delta; |
double delta; |
/* compute delta in 1/10's second units */ |
|
|
/* compute delta in 1/10's second units */ |
delta = ((tstop.tv_sec*10.)+(tstop.tv_usec/100000)) - |
delta = ((tstop.tv_sec*10.)+(tstop.tv_usec/100000)) - |
((tstart.tv_sec*10.)+(tstart.tv_usec/100000)); |
((tstart.tv_sec*10.)+(tstart.tv_usec/100000)); |
delta = delta/10.; /* back to seconds */ |
delta = delta/10.; /* back to seconds */ |