SCTPGraphArwndDialog: Detect max arwnd value when startArwnd is not set
authorVasil Velichkov <vvvelichkov@gmail.com>
Fri, 20 Jul 2018 22:32:55 +0000 (01:32 +0300)
committerAnders Broman <a.broman58@gmail.com>
Mon, 30 Jul 2018 12:19:35 +0000 (12:19 +0000)
When the capture does not contains SCTP INIT and INAT_ACK packets the
startArwnd value is 0 (not set) and as a result the Y axis range is
(0,0) and the dots are not visible

Change-Id: Iafb1981e62f28fe09b106138836c866d0dbebb27
Reviewed-on: https://code.wireshark.org/review/28861
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
ui/qt/sctp_graph_arwnd_dialog.cpp
ui/qt/sctp_graph_arwnd_dialog.h

index 1347a543fc3917dcab6e0beb1c527a1ecb9171fe..18a6d35b2f067ddccf59ab24e9d499473b284db2 100644 (file)
@@ -72,6 +72,8 @@ void SCTPGraphArwndDialog::drawArwndGraph()
         listSACK = g_list_last(selected_assoc->sack2);
         startArwnd = selected_assoc->arwnd1;
     }
+    bool detect_max_arwnd = (startArwnd == 0) ? true : false;
+
     while (listSACK) {
         tsn = (tsn_t*) (listSACK->data);
         tlist = g_list_first(tsn->tsns);
@@ -84,6 +86,9 @@ void SCTPGraphArwndDialog::drawArwndGraph()
                 nr_sack_header =(struct nr_sack_chunk_header *)tlist->data;
                 arwnd = g_ntohl(nr_sack_header->a_rwnd);
             }
+            if (detect_max_arwnd && startArwnd < arwnd) {
+                startArwnd = arwnd;
+            }
             ya.append(arwnd);
             xa.append(tsn->secs + tsn->usecs/1000000.0);
             fa.append(tsn->frame_number);
index 7edf13e589bb74a0b48a90b72af07a1d8a69bfea..c682014f4b04dedce393d53f9990f466009e9ae6 100644 (file)
@@ -49,7 +49,7 @@ private:
     capture_file *cap_file_;
     int frame_num;
     int direction;
-    int startArwnd;
+    guint32 startArwnd;
     QVector<double> xa, ya;
     QVector<guint32> fa;
  //   QVector<QString> typeStrings;