...
 
Commits (2)
......@@ -529,6 +529,7 @@ typedef struct tcb {
u_long num_sacks;
u_long max_sack_blocks;
u_long num_dsacks;
u_long sack_amount;
/* for computing LEAST (see FAQ) */
enum tcp_strains { TCP_RENO, TCP_SACK, TCP_DSACK } tcp_strain;
......
......@@ -2401,7 +2401,7 @@ nextrpc:
u_long val = ptcpo->tcp_trace.optval[i];
if (val && !(val & (1UL<<31)) && (val != prev)) {
plotter_perm_color(from_tsgpl, i&1 ? d2_color:d1_color);
plotter_perm_color(from_tsgpl, i&1 ? d1_color:d2_color);
if (prev) {
plotter_line(from_tsgpl,
thisdir->tcp_trace_opttime[i],
......@@ -2410,10 +2410,13 @@ nextrpc:
plotter_line(from_tsgpl,
current_time, SeqRep(thisdir,otherdir->ack+prev),
current_time, SeqRep(thisdir,otherdir->ack+val));
if (*clicky_wireshark)
plotter_clickarea(from_tsgpl, clicky_wireshark);
} else
plotter_text(from_tsgpl, current_time,
SeqRep(thisdir,otherdir->ack+val), "b",
thisdir->tcp_trace_optname[i]);
frame_info(from_tsgpl, fpnum, pip);
thisdir->tcp_trace_optval[i] = val;
thisdir->tcp_trace_opttime[i] = current_time;;
}
......@@ -2683,7 +2686,7 @@ nextrpc:
u_long prev = otherdir->tcp_trace_optval[i];
if (prev) {
plotter_perm_color(to_tsgpl, i&1 ? d2_color:d1_color);
plotter_perm_color(to_tsgpl, i&1 ? d1_color:d2_color);
plotter_line(to_tsgpl,
otherdir->tcp_trace_opttime[i],
SeqRep(otherdir,thisdir->ack+prev),
......@@ -2907,6 +2910,7 @@ nextrpc:
}
/* draw sacks, if appropriate */
thisdir->sack_amount = 0;
if (to_tsgpl != NO_PLOTTER && show_sacks
&& (ptcpo->sack_count > 0)) {
int scount;
......@@ -2917,10 +2921,8 @@ nextrpc:
sack_block * sb = &ptcpo->sacks[scount];
plotter_line(to_tsgpl,
current_time,
SeqRep(otherdir,sb->sack_left),
current_time,
SeqRep(otherdir,sb->sack_right));
current_time, SeqRep(otherdir,sb->sack_left),
current_time, SeqRep(otherdir,sb->sack_right));
if (*clicky_wireshark)
plotter_clickarea(to_tsgpl, clicky_wireshark);
frame_info(to_tsgpl, fpnum, pip);
......@@ -2929,11 +2931,9 @@ nextrpc:
|-----| (sideways)
*/
plotter_htick(to_tsgpl,
current_time,
SeqRep(otherdir,sb->sack_left));
current_time, SeqRep(otherdir,sb->sack_left));
plotter_htick(to_tsgpl,
current_time,
SeqRep(otherdir,sb->sack_right));
current_time, SeqRep(otherdir,sb->sack_right));
/* if there's more than one, label the order */
/* purple number to the right of the top ("right" edge) */
......@@ -2941,8 +2941,7 @@ nextrpc:
char buf[5]; /* can't be more than 1 digit! */
snprintf(buf,sizeof(buf),"%u",scount+1); /* 1-base, rather than 0-base */
plotter_text(to_tsgpl,
current_time,
SeqRep(otherdir,sb->sack_right),
current_time, SeqRep(otherdir,sb->sack_right),
"r", buf);
}
......@@ -2952,10 +2951,14 @@ nextrpc:
/* mark the first one 'DS' underneath if (the common case of) */
/* a DSACK */
if (scount == 0 && sb->sack_right <= th_ack)
if (scount == 0 && !SEQ_GREATERTHAN(sb->sack_right, th_ack))
plotter_text(to_tsgpl, current_time,
SeqRep(otherdir,sb->sack_left),
"b", "DS"); /* 'DS' is for D-Sack */
/* count the amount of non-D SACKd data */
if (SEQ_GREATERTHAN(sb->sack_right, th_ack))
thisdir->sack_amount += (long)sb->sack_right - (long)sb->sack_left;
}
/* just draw the 'S' above the highest one, and not if it's DSACK */
if (sack_top > th_ack)
......@@ -2994,15 +2997,17 @@ nextrpc:
/* If there has been no ack from the other direction, owin is just
* bytes in this pkt.
*/
if (otherdir->ack == 0){
if (otherdir->ack == 0)
owin = end - start ;
}
else {
/* ack always acks 'received + 1' bytes, so subtract 1
* for owin */
else /* ack always acks 'received + 1' bytes, so subtract 1 * for owin */
owin = end - (otherdir->ack - 1);
}
owin &= 0xffffffff;
/* jgh: subtract any SACK blocks; we know that data is no longer
outstanding. But not DSACK blocks are they were accounted for by
the cumack. */
owin -= otherdir->sack_amount;
if (owin > thisdir->owin_max)
thisdir->owin_max = owin;
......