summaryrefslogtreecommitdiff
path: root/ui/qt/endpoint_dialog.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-04-26Qt: Don't use _U_ for unused parameters in C++Stig Bjørlykke1-3/+2
Change-Id: If7acab5f438bb20b053fdcfef86b2f06765b5321 Reviewed-on: https://code.wireshark.org/review/21341 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-03-06Switch conversations to use wmem_tree_t instead of (sorted) GSList.Michael Mann1-1/+1
Change-Id: Ifaf25ca5a7974f1d398ceebbb4c6733d4d3e001a Reviewed-on: https://code.wireshark.org/review/20006 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-14Qt: Set Close as default buttonStig Bjørlykke1-0/+5
Set Close as default button in some statistics dialogs. Change-Id: I82e17d27de256aabaec1633bb973c554eec907c3 Reviewed-on: https://code.wireshark.org/review/17685 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-06-27There's no need to check the return from g_array_index().Jeff Morriss1-8/+0
g_array_index() returns an index into an array: we're sure to find something at that index (whether that something is in bounds is a-whole-nother question). This fixes CIDs 1362829 and 1362890/1362830. There were other CIDs like this but they've already been fixed. Change-Id: I94af0931b9adf3abd3bedc969e399cda98bbdd07 Reviewed-on: https://code.wireshark.org/review/16168 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-06-27endpoint dialog: fix compilation when we don't HAVE_GEOIP.Jeff Morriss1-3/+7
Also fix some indentation and white space. Remove a break-after-return. Bug: 12562 Change-Id: I912ccdac62aceaabcffec8f7739da56cc6036abf Reviewed-on: https://code.wireshark.org/review/16159 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-26Qt: Conversation and Endpoint dialog performance tweaks.Gerald Combs1-82/+77
Generate column text dynamically. This keeps us from having to iterate over our tree items each time we receive updates. Set the uniformRowHeights property. Stop automatically resizing columns after 200 items. Fixup name resolution behavior. Disable the checkbox if host name resolution is disabled. Change-Id: Ib2fef604d6ee9e39a8b1edd72d58d0cb02d3bb64 Reviewed-on: https://code.wireshark.org/review/16110 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-23Qt: Use queued signals+slots for filter actionsGerald Combs1-4/+4
Many of our dialogs can send an "apply this display filter" signal to the main window. Applying a display filter in turn creates a nested event loop via cf_read+update_progress_dlg. If the "apply" signal+slot is directly connected (which is the default, and which means we're calling into a function table) we can close the dialog while the signal is firing, which means we return into a deleted object. Make all of the filterAction signals+slots queued instead of direct. Bug: 12523 Change-Id: Ica331054c0aa52a7f33bd8df1fa65ecd09fdc292 Reviewed-on: https://code.wireshark.org/review/16080 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-22No GeoIP, no need for geoip_none_.Guy Harris1-0/+2
Change-Id: I6fb328d07718d2ff7a7d6008c936b7478ea6db3f Reviewed-on: https://code.wireshark.org/review/16084 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-22Qt: Fix crash in Conversations and Endpoints dialogsGerald Combs1-27/+28
Don't assume that conv_item_t or hostlist_talker_t pointers never change. GArrays can reallocate their data, and in our case this can happen when we have more than 10,000 items (which is the size that the conversation table code passes to_array_sized_new). Bug: 12288 Change-Id: I88e58be830e35dde272f81fe9250b054fb87facf Reviewed-on: https://code.wireshark.org/review/16078 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-23Forcibly update all items if name resolution is turned on or off.Guy Harris1-9/+12
This makes the display change if you turn the name resolution checkbox on or off. Change-Id: I873832b103b61e1e566523a1ae1c4211937c7bae Reviewed-on: https://code.wireshark.org/review/15063 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-21We have to call updateWidgets() to initialize the name resolution flag.Guy Harris1-0/+1
The conversation dialog does this, and we must do so to, in order to fetch the initial setting of the name resolution flag. Bug: 12353 Change-Id: I7ee97960216ff89a612c076edcfaad8e547a27d9 Reviewed-on: https://code.wireshark.org/review/15029 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-21Avoid returning malloced memory as const [-Wcast-qual]João Valverde1-4/+4
Change-Id: I0b2c03cbde963d13d07ef13284d85b922eec3be9 Reviewed-on: https://code.wireshark.org/review/13439 Reviewed-by: João Valverde <j@v6e.pt>
2016-01-12Need to include <epan/prefs.h> to declare preference functions.Guy Harris1-0/+2
Change-Id: I5fbc9d25dde30ce8d14c80e765a3a8a630fec708 Reviewed-on: https://code.wireshark.org/review/13239 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-26Rework tapping in Qt dialogs.Gerald Combs1-11/+4
Add cf_cb_file_retap_started and cf_cb_file_retap_finished to file.[ch]. Add their associated signals to CaptureFile. Add registerTapListener and removeTapListeners to WiresharkDialog, which collect and automatically remove tap listeners. Add beginRetapPackets and endRetapPackets, which can be used to wrap critical sections so that we don't delete ourselves while tapping. Don't cancel tapping on close in WiresharkDialog. Use beginRetapPackets and endRetapPackets in WiresharkDialog and FollowStreamDialog. We will likely need to add them elsewhere. Update comments. Change-Id: I1788a6ade0817c31aa3419216df96be5e36b2178 Reviewed-on: https://code.wireshark.org/review/10261 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-26Add per-dialog progress frames.Gerald Combs1-1/+2
Add ProgressFame::addToButtonBox, which violates the UX guidelines on every platform we support by inserting a ProgressFrame into a QDialogButtonBox. Call addToButtonBox in the constructors of a bunch of dialogs. Change-Id: I33ac5fd7a976ee6e0527de569a5c4b528980dae1 Reviewed-on: https://code.wireshark.org/review/10242 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-29Capture file retapping fixups.Gerald Combs1-1/+1
Add CaptureFile::delayedRetapPackets, which starts retapping after the current batch of UI event are processed. Call it in the constructors of various dialogs so that they are shown before tapping starts. This *might* fix a crash found when following large streams from the Conversations dialog. Change-Id: If1b87491621ab7efcc0519f95891d34dcd9d18c1 Reviewed-on: https://code.wireshark.org/review/9818 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-07Finish removal of Q_UNUSED.Joerg Mayer1-1/+0
Todo: qcustomplot via upstream Change-Id: I19cf98f1281ecb1f6efbb7d36c997d5aa43f5baf Reviewed-on: https://code.wireshark.org/review/9547 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-02-10Qt/C++: Change a bunch of includes to forward declarations.Gerald Combs1-0/+3
In theory this this should reduce compilation times. On my particular system it makes no difference but hopefully it will elsewhere. Change-Id: I570177d3ca4eec691c82d46b4dbbce74092aac1d Reviewed-on: https://code.wireshark.org/review/7060 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-18Remove emem from GeoIPMichael Mann1-1/+2
Change-Id: Ifa96dc38a277b86c28f762489251dcc595afae67 Reviewed-on: https://code.wireshark.org/review/6603 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-08ep_<protocol>_port_to_display -> <protocol>_port_to_displayMichael Mann1-3/+8
Adjust any other ep_ related APIs related to the transition. Change-Id: I961b371c2c4bda557e0f1817705c27eef0dae66c Reviewed-on: https://code.wireshark.org/review/6388 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-05Replace ep_display_to_address with wmem equivalent display_to_address.Michael Mann1-2/+10
Almost all instances require using "manual" memory management, but it gets some ep_ calls out of the GUI. Change-Id: Ifa7303766b08d09442ccf3d7063cbe061578ecd9 Reviewed-on: https://code.wireshark.org/review/6318 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-29Qt: Add a WiresharkDialog convenience class.Gerald Combs1-1/+1
Add WiresharkDialog, a common base class for dialogs centered around capture files. Make it a parent of Capture File Properties, Traffic Table, Conversations, and Endpoints. Rename CaptureFile::read_only_ to file_closed_. Add methods to WiresharkApplication for generating consistent window titles. Change-Id: Idc771556d8192e60f85dddc08fc4757698dee257 Reviewed-on: https://code.wireshark.org/review/6097 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-22Qt: Add methods to CaptureFile and WiresharkApplication.Gerald Combs1-16/+14
Add isValid, fileTitle, and retapPackets methods to CaptureFile. Add application name and title separator convenience methods to WiresharkApplication. Convert traffic tables, conversations, and endpoints to use CaptureFile directly and to let the user know when the capture file is closed. Set the file dialog titles while we're here. Change-Id: I990392786d3833e1e0b3638aa2d34a5ada39fa13 Reviewed-on: https://code.wireshark.org/review/5957 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-01qt: fix use-after-free patternPeter Wu1-1/+3
qstring.toUtf8() returns a QByteArray object and .constData() returns a pointer inside that object. It is not safe to store this pointer as it will become invalid after the statement. Store a const reference instead. (Due to scoping differences, some are copy-assigned though.) In the UAT dialog, strlen(bytes.constData()) has also been replaced by bytes.size() as an optimization. Caught by ASAN. Change-Id: Ie09f999a32d0ef1abaa1e658b9403b74bedffc37 Reviewed-on: https://code.wireshark.org/review/5528 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-11-28Endpoint dialog (Qt): Add missing text to translateAlexis La Goutte1-1/+1
Change-Id: I375b348b6d6e35c212f76fc73135990a93560a75 Reviewed-on: https://code.wireshark.org/review/5517 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-08fix a crash in the endpoint dialogueMartin Kaiser1-1/+1
compile Wireshark with GeoIP enabled load a USB capture open Statistics / Endpoints the tree is empty, USB is not amongst the selected Enpoint Types select USB in the Endpoint Types list -> crash to fix this, add a NULL check for cur_tree to EndpointDialog::tabChanged() Change-Id: I43d963ae5cd451120ac354e89e37ccbbbc2c5910 Reviewed-on: https://code.wireshark.org/review/5192 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-09-18Fix compilation when we don't HAVE_GEOIP.Jeff Morriss1-1/+3
We really need a buildbot or Petri-Dish which doesn't have GeoIP because this problem keeps popping up. Bug: 10480 Change-Id: Iccba50dfcafd2dbacb315b9416324de4114be220 Reviewed-on: https://code.wireshark.org/review/4171 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-09-17Qt: Add the "Map" button to the Endpoints dialog.Gerald Combs1-3/+46
Move the map creation code from ui/gtk/hostlist_table.c to ui/traffic_table_ui.c. Add CMake commands to copy ipmap.html to the run directory so that WIRESHARK_RUN_FROM_BUILD_DIRECTORY works for the endpoint map. Not sure if they're entirely correct but they appear to work. Add boundary checkes to geoip_db_lookup_ipv[46]. To do: - It looks like there are prettier maps and newer APIs that we might want to use. Change-Id: Ie06992c9bc9c9aa683328aecab3f5f69c9cab966 Reviewed-on: https://code.wireshark.org/review/4011 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-17Qt: Remove duplicate GeoIP columns.Gerald Combs1-16/+29
Different GeoIP databases have the same column name, e.g. "City" currently matches two revisions each for IPv4 and IPv6. Map each uniquely named column to a list of databases and populate EndpointTreeWidgetItem columns based on the first database match. Fix a copy/pasteo introduced in g30f3d52: Make sure geoip_db_lookup_ipv[46] returns longitude instead of latitude. Change-Id: Idd31f976dfd1cb011cfa7b5aec14b7031ee0e25e Reviewed-on: https://code.wireshark.org/review/4157 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-05Fix compilation when we don't HAVE_GEOIP.Jeff Morriss1-1/+1
Change-Id: Ib72178aab69c266cb903ef5ad5587cc0b80eb1fd Reviewed-on: https://code.wireshark.org/review/4007 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-05Fix compiler warnings from g30f3d52.Gerald Combs1-5/+5
Change-Id: I76fa088f72f0e31da9be105919d56fd8db1ea7b5 Reviewed-on: https://code.wireshark.org/review/3999 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-05Qt: Refactor ConversationDialog for endpoints.Gerald Combs1-0/+545
Create a TrafficTableDialog (for lack of a better name) parent class from the general parts of ConversationDialog. Use it to create EndpointsDialog. Move the contents of conversation_tree_widget.{cpp,h} to conversation_dialog.{cpp,h} to match endpoint_dialog and traffic_table_dialog. Fill in GeoIP columns dynamically instead of using a hard-coded limit. Use "endp_" and "ENDP_" prefixes for a lot of endpoint variables and defines. Try to make geoip_db_lookup_ipv4 and geoip_db_lookup_ipv6 more robust. Clean up some includes. Fix a shadowed variable. Change-Id: I23054816ac7f8c6edb3b1f01c8536db37ba4122d Reviewed-on: https://code.wireshark.org/review/3462 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>