From Irene Ruengeler: Fix two bugs regarding plotted TSNs reported by
authortuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 21 Aug 2009 20:10:51 +0000 (20:10 +0000)
committertuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 21 Aug 2009 20:10:51 +0000 (20:10 +0000)
Christian Constantin.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29498 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/sctp_graph_dlg.c
gtk/sctp_stat.c

index 051d89d5c40199b58061c2ed89d1ebf698e31521..fda7045bbea84e203e5cb257602855a02584ad4e 100644 (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,
index 2672ca886cee7292b39ff66db5b9ec24c7e749f7..dd7ea9b80c6c677967d6ac11b7d4bf7601ef3b18 100644 (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)
                                        {