...
 
Commits (2)
......@@ -343,6 +343,7 @@ collapse_quad (quadrant * pquad)
Bool freed;
segment *pseg;
segment *tmpseg;
int max_seg_keep = segs_lookback;
if ((pquad == NULL) || (pquad->seglist_head == NULL))
return;
......@@ -386,6 +387,33 @@ collapse_quad (quadrant * pquad)
/* else, see if the next one also can be collapsed into me */
}
/* Now count backwards from the tail, and when the
count exceeds some configurable max, collapse all subsequent segs
_and_ _holes_.
This will lose stats for dup-ack (at least) - but it should greatly
help performance in the face of packets missing from the capture.
*/
for (pseg = pquad->seglist_tail; pseg; ) {
if (max_seg_keep) {
max_seg_keep--;
pseg = pseg->prev;
} else {
if ((tmpseg = pseg->prev)) {
pseg->seq_firstbyte = tmpseg->seq_firstbyte;
if (tv_lt (tmpseg->time, pseg->time))
pseg->time = tmpseg->time;
if ((pseg->prev = tmpseg->prev))
pseg->prev->next = pseg;
if (tmpseg == pquad->seglist_head)
pquad->seglist_head = pseg;
free(tmpseg);
} else
break;
}
}
/* see if the quadrant is now "full" */
if ((pquad->seglist_head->seq_lastbyte -
pquad->seglist_head->seq_firstbyte + 1) == QUADSIZE) {
......
......@@ -172,14 +172,17 @@ char *xplot_args = NULL;
char *sv = NULL;
char *rscale = "m";
char *tcpw = NULL;
char *tscale = NULL;
char *tscale = "M";
char *twhich = "t";
char *segs_lookback_str = "100";
/* globals */
struct timeval current_time;
int num_modules = 0;
char *ColorNames[NCOLORS] =
{"green", "red", "blue", "yellow", "purple", "orange", "magenta", "pink"};
char *comment;
u_int segs_lookback = 100;
/* locally global variables */
static u_long filesize = 0;
......@@ -302,6 +305,7 @@ static void VerifyMaxConnNum(char *varname, char *value);
static void VerifyLiveConnInt(char *varname, char *value);
static void VerifyNonrealLiveConnInt(char *varname, char*value);
static void VerifyClosedConnInt(char *varname, char *value);
static void Verify_segs_lookback(char *varname, char *value);
/* extended variable options */
/* they must all be strings */
......@@ -342,6 +346,8 @@ static struct ext_var_op {
"throughput display scale (k/M/G)"},
{"twhich", &twhich, NULL,
"throughput of (c=capture, t=new-transmit)"},
{"sl", &segs_lookback_str, Verify_segs_lookback,
"number of segs to keep in previous quad for ack-lookback)"},
};
#define NUM_EXTENDED_VARS (sizeof(extended_vars) / sizeof(struct ext_var_op))
......@@ -2111,6 +2117,21 @@ VerifyClosedConnInt(
static void
Verify_segs_lookback(
char *varname,
char *value)
{
if (!(segs_lookback = atoi(value))) {
fprintf(stderr,
"Value '%s' is not valid for variable '%s'\n",
value, varname);
exit(1);
}
}
static void
ParseArgs(
char *argsource,
......
......@@ -826,6 +826,7 @@ extern char *output_file_dir;
extern char *output_file_prefix;
extern char *xplot_title_prefix;
extern char *xplot_args;
extern u_int segs_lookback;
extern char *sv;
extern char *rscale;
extern char *tcpw;
......
......@@ -2807,7 +2807,7 @@ nextrpc:
plotter_text(to_tsgpl, current_time, SeqRep(otherdir,winend), "a", "!");
}
else if (winend < otherdir->seq)
else if (SEQ_GREATERTHAN(otherdir->seq, winend))
{ /* had data exceeding even the updated window */
if (thisdir->tcpw < 14)
{ /* increase our assessment of wscale */
......