From Irene Ruengeler: Fix two bugs regarding plotted TSNs reported by

Christian Constantin.

svn path=/trunk/; revision=29498
This commit is contained in:
Michael Tüxen 2009-08-21 20:10:51 +00:00
parent 9661baf237
commit cc11620041
2 changed files with 75 additions and 13 deletions

View File

@ -226,7 +226,7 @@ static void draw_sack_graph(struct sctp_udata *u_data)
yvalue = (guint32)(u_data->io->pixmap_height-BOTTOM_BORDER-POINT_SIZE-u_data->io->offset-((SUB_32(j+tsnumber,min_tsn))*u_data->io->y_interval));
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
xvalue <= u_data->io->pixmap_width-RIGHT_BORDER+u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset-5 &&
yvalue <= u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)
gdk_draw_arc(u_data->io->pixmap,green_gc,TRUE,
xvalue,
@ -249,7 +249,7 @@ static void draw_sack_graph(struct sctp_udata *u_data)
yvalue = (guint32)(u_data->io->pixmap_height-BOTTOM_BORDER-POINT_SIZE -u_data->io->offset-((SUB_32(tsnumber,min_tsn))*u_data->io->y_interval));
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
xvalue <= u_data->io->pixmap_width-RIGHT_BORDER+u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset-5 &&
yvalue <= u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)
gdk_draw_arc(u_data->io->pixmap,red_gc,TRUE,
xvalue,
@ -368,7 +368,7 @@ static void draw_nr_sack_graph(struct sctp_udata *u_data)
yvalue = (guint32)(u_data->io->pixmap_height-BOTTOM_BORDER-POINT_SIZE-u_data->io->offset-((SUB_32(j+tsnumber,min_tsn))*u_data->io->y_interval));
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
xvalue <= u_data->io->pixmap_width-RIGHT_BORDER+u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset-5 &&
yvalue <= u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)
{
/* Check if this is an GAP ACK or NR GAP ACK */
@ -418,7 +418,7 @@ static void draw_nr_sack_graph(struct sctp_udata *u_data)
yvalue = (guint32)(u_data->io->pixmap_height-BOTTOM_BORDER-POINT_SIZE -u_data->io->offset-((SUB_32(tsnumber,min_tsn))*u_data->io->y_interval));
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
xvalue <= u_data->io->pixmap_width-RIGHT_BORDER+u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset-5 &&
yvalue <= u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)
gdk_draw_arc(u_data->io->pixmap,red_gc,TRUE,
xvalue,
@ -493,7 +493,7 @@ static void draw_tsn_graph(struct sctp_udata *u_data)
yvalue = (guint32)(u_data->io->pixmap_height-BOTTOM_BORDER-POINT_SIZE-u_data->io->offset-((SUB_32(tsnumber,min_tsn))*u_data->io->y_interval));
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
xvalue <= u_data->io->pixmap_width-RIGHT_BORDER+u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset-5 &&
yvalue <= u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)
gdk_draw_arc(u_data->io->pixmap,u_data->io->draw_area->style->black_gc,TRUE,
xvalue,

View File

@ -840,11 +840,26 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
datachunk = TRUE;
tsn_s = g_malloc(sizeof(struct tsn_sort));
tsn_s->tsnumber = tsnumber;
tsn_s->secs = tsn->secs;
tsn_s->usecs = tsn->usecs;
tsn_s->secs = tsn->secs = (guint32)pinfo->fd->rel_ts.secs;
tsn_s->usecs = tsn->usecs = (guint32)pinfo->fd->rel_ts.nsecs/1000;
tsn_s->offset = 0;
tsn_s->framenumber = framenumber;
tsn_s->length = length-DATA_CHUNK_HEADER_LENGTH;
if (tsn->secs < info->min_secs)
{
info->min_secs = tsn->secs;
info->min_usecs = tsn->usecs;
}
else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs)
info->min_usecs = tsn->usecs;
if (tsn->secs > info->max_secs)
{
info->max_secs = tsn->secs;
info->max_usecs = tsn->usecs;
}
else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs)
info->max_usecs = tsn->usecs;
g_ptr_array_add(info->sort_tsn1, tsn_s);
info->n_array_tsn1++;
}
@ -866,13 +881,28 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
sackchunk = TRUE;
tsn_s = g_malloc(sizeof(struct tsn_sort));
tsn_s->tsnumber = tsnumber;
tsn_s->secs = tsn->secs;
tsn_s->usecs = tsn->usecs;
tsn_s->secs = tsn->secs = (guint32)pinfo->fd->rel_ts.secs;
tsn_s->usecs = tsn->usecs = (guint32)pinfo->fd->rel_ts.nsecs/1000;
tsn_s->offset = 0;
tsn_s->framenumber = framenumber;
tsn_s->length = tvb_get_ntohl(sctp_info->tvb[chunk_number], SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET);
if (tsn_s->length > info->max_window1)
info->max_window1 = tsn_s->length;
if (tsn->secs < info->min_secs)
{
info->min_secs = tsn->secs;
info->min_usecs = tsn->usecs;
}
else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs)
info->min_usecs = tsn->usecs;
if (tsn->secs > info->max_secs)
{
info->max_secs = tsn->secs;
info->max_usecs = tsn->usecs;
}
else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs)
info->max_usecs = tsn->usecs;
g_ptr_array_add(info->sort_sack2, tsn_s);
info->n_sack_chunks_ep2++;
}
@ -1109,11 +1139,27 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
info->n_data_bytes+=length;
tsn_s = g_malloc(sizeof(struct tsn_sort));
tsn_s->tsnumber = tsnumber;
tsn_s->secs = tsn->secs;
tsn_s->usecs = tsn->usecs;
tsn_s->secs = tsn->secs = (guint32)pinfo->fd->rel_ts.secs;
tsn_s->usecs = tsn->usecs = (guint32)pinfo->fd->rel_ts.nsecs/1000;
tsn_s->offset = 0;
tsn_s->framenumber = framenumber;
tsn_s->length = length;
if (tsn->secs < info->min_secs)
{
info->min_secs = tsn->secs;
info->min_usecs = tsn->usecs;
}
else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs)
info->min_usecs = tsn->usecs;
if (tsn->secs > info->max_secs)
{
info->max_secs = tsn->secs;
info->max_usecs = tsn->usecs;
}
else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs)
info->max_usecs = tsn->usecs;
if (info->direction == 1)
{
@ -1181,12 +1227,28 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
sackchunk = TRUE;
tsn_s = g_malloc(sizeof(struct tsn_sort));
tsn_s->tsnumber = tsnumber;
tsn_s->secs = tsn->secs;
tsn_s->usecs = tsn->usecs;
tsn_s->secs = tsn->secs = (guint32)pinfo->fd->rel_ts.secs;
tsn_s->usecs = tsn->usecs = (guint32)pinfo->fd->rel_ts.nsecs/1000;
tsn_s->offset = 0;
tsn_s->framenumber = framenumber;
tsn_s->length = tvb_get_ntohl(sctp_info->tvb[chunk_number], SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET);
if (tsn->secs < info->min_secs)
{
info->min_secs = tsn->secs;
info->min_usecs = tsn->usecs;
}
else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs)
info->min_usecs = tsn->usecs;
if (tsn->secs > info->max_secs)
{
info->max_secs = tsn->secs;
info->max_usecs = tsn->usecs;
}
else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs)
info->max_usecs = tsn->usecs;
if (info->direction == 2)
{