aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk
AgeCommit message (Collapse)AuthorFilesLines
2016-12-09ui: move filesystem code to wsutil/filesystem.cDario Lombardo1-0/+2
This function can be used by code outside ui (eg. extcap). Ping-Bug: 13218 Change-Id: Ic11f7acebefeaf777692df044ebff9b1bc387aa3 Reviewed-on: https://code.wireshark.org/review/19178 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-09extcap: add new option type (timestamp).Dario Lombardo2-1/+34
Bug: 12787 Change-Id: I941833c55fb607c8af2ef832082af58d7b94e965 Reviewed-on: https://code.wireshark.org/review/18721 Petri-Dish: Roland Knall <rknall@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-06codecs: Add support for G.722 and G.726Peter Wu1-1/+7
Integrate the Spandsp library for G.722 and G.726 support. Adds support for G.722 and all eight variants of G.726. Note: this also fixes a crash in Qt (buffer overrun, reading too much data) caused by confusion of the larger output buffer (resample_buff) with the smaller input buffer (decode_buff). It was not triggered before because the sample rate was always 8k, but with the addition of the new codecs, a different sample rate became possible (16k). Fix also a crash which occurs when the RTP_STREAM_DEBUG macro is enabled and the VOIP Calls dialog is opened (the begin frame, start_fd, is not yet known and therfore a NULL dereference could occur). Passes testing (plays normally without bad RTP timing errors) with SampleCaptures files: sip-rtp-g722.pcap and sip-rtp-g726.pcap. Tested with cmake (Qt), autotools (Qt and GTK+) with ASAN enabled. Bug: 5619 Change-Id: I5661908d193927bba50901079119eeff0c04991f Reviewed-on: https://code.wireshark.org/review/18939 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-12-05Clean up initialization code for programs.Guy Harris1-2/+3
Make the init_progfile_dir() call unconditionally, even if plugins aren't supported, as that doesn't necessarily mean nobody uses the directory containing the executable. Report the error the same way in all programs, and free the error string after we're finished with it. Make the error - and the comment before the code - reflect what init_progfile_dir() is actually doing (the goal is to get the full pathname of the directory *containing* the executable; that's generally done by getting the pathname of the executable and stripping off the name of the executable, but that's won't necessarily always be the case). Also note for TShark that we won't be able to capture traffic, just as we do for Wireshark (if we don't have the pathname of the program file, we don't have a pathname to use to find dumpcap). Have the plugin scanner just fail silently if we weren't able to get the plugin directory path, so we don't have to worry about calling it if init_progfile_dir() fails. Clean up white space while we're at it. Change-Id: I8e580c719aab6fbf74a764bf6629962394fff7c8 Reviewed-on: https://code.wireshark.org/review/19076 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-04Have a routine to do all the work of initializing libwiretap.Guy Harris1-2/+1
Have programs that use libwiretap call that routine rather than separately calling some or all of init_open_routines(), wtap_register_plugin_types(), and wtap_opttypes_initialize(). Also don't have routines internal to libwiretap call those. Yes, this means doing some initialization work when it isn't necessary, but scattering on-demand calls throughout the code is a great way to forget to make those calls. Change-Id: I5828e1c5591c9d94fbb3eb0a0e54591e8fc61710 Reviewed-on: https://code.wireshark.org/review/19069 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-04Show codec information in About dialogPeter Wu1-0/+2
Show codec libraries in About dialog, this should give the user a clue of what codecs are available. SBC is already supported, Spandsp (for G.722/G.726) is work in progress. Change-Id: Iebc4d9c9fae619a442e06c8afc780a420aa3971b Reviewed-on: https://code.wireshark.org/review/18978 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-12-04codecs: allow it to be used without pluginsPeter Wu1-1/+1
Not all codecs require the plugin infrastructure. For example, G.711U/A is a built-in codec. Allow such functionality to be registered even if plugin support is disabled. Change-Id: I2505cc9955e7953268ec0739531278921f70a771 Reviewed-on: https://code.wireshark.org/review/18977 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-12-04Have separate merge APIs for regular file/temporary file/standard output.Guy Harris2-7/+5
This is similar to what we have for opening a dump file - one API that uses the file name as specified, one that creates a temporary file and provides the file name, and one that uses the standard output. All of those APIs handle closing the output file. Change-Id: I56beea7be347402773460b9148ab31a8f8bc51e1 Reviewed-on: https://code.wireshark.org/review/19059 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-02Enable exporting objects with tsharkMoshe Kaplan3-83/+126
A new "--export-object <protocol>,<destdir>" option is added to tshark. This required refactoring Export Object behavior in all GUIs to give the export object handling to the dissector, rather than the ui layer. Included in the refactoring was fixing some serious memory leaks in Qt Export Object dialog, crash due to memory scope issues in GTK Export Object dialog, and addition sorting column feature in Qt dialog (set up by creating a widget to manage the items that were previously leaking memory) Bug: 9319 Ping-Bug: 13174 Change-Id: I515d7662fa1f150f672b1476716f347ec27deb9b Reviewed-on: https://code.wireshark.org/review/18927 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-10tcp: Fix Follow TCP tap data and when its tapped.Michael Mann1-16/+1
Use the model from the 2.0 branch and earlier that only "tapped" the follow data in a single location. This fixes duplicate data for reassembled data and handles out-of-order packets. Bug: 12855 Change-Id: I5268f13e3c08e9271acf026b859de693ad794c94 Reviewed-on: https://code.wireshark.org/review/18368 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-11-09CMake: Use find_program to find a program.Gerald Combs1-3/+3
Use find_program to find glib-compile-resources instead of find_file. Change-Id: I565c3a596923ff4761bc38988ee396aa24bd63a6 Reviewed-on: https://code.wireshark.org/review/18714 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-10-30Have routines for parsing options that affect dissection.Guy Harris2-10/+12
Have them handle -d, -t, --disable-protocol, --disable-heuristic, and --enable-heuristic for TShark and both flavors of Wireshark. Change-Id: I612c276b1f9df8a2092202d23ab3d48be7857e85 Reviewed-on: https://code.wireshark.org/review/18583 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-27Fix compile errors in GTK buildMichael Mann2-2/+2
Change-Id: Ib28c63e0ead6950b3b11b7c87adc543f80c070ed Reviewed-on: https://code.wireshark.org/review/18498 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-26Gtk: remove atoi calls and use ws_strtoi functions.Dario Lombardo7-18/+52
Change-Id: Ie38bdd27d9e3810e3a64b985dfd5621a3aa6d073 Reviewed-on: https://code.wireshark.org/review/18445 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-22Fix the #defines for the presence of structure names.Guy Harris1-5/+5
AC_CHECK_MEMBER() and AC_CHECK_MEMBERS() use a standard name for the {structurename} being the name of the structure type, complete with "struct" if a typedef wasn't used, and with all letters mapped to upper case, and with {membername} being the name of the structure member, with all letters mapped to upper case. check_struct_has_member() lets you choose the name; choose the same name that the autoconf macros use, and fix the code to check for them. Change-Id: Ifb3cf65e7e94907ad0a2f8aacca0c21a531f0c5b Reviewed-on: https://code.wireshark.org/review/18382 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-22On UN*X, st_ctime is the last status change time, not the creation time.Guy Harris1-9/+19
That's the time the file's inode last changed, so size changes, permission changes, etc. affect it. It's *not* the time the file was created; most UN*Xes don't provide that. Newer versions of FreeBSD, NetBSD, OpenBSD, and macOS do, but other UN*Xes don't appear to. On Windows, at least according to Microsoft's documentation, st_ctime *is* the creation time. Hopefully that's not the result of confusion on the part of somebody at Microsoft. Change-Id: I20743703f6ef66e40dff9004dc91bed46af6fad0 Reviewed-on: https://code.wireshark.org/review/18378 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-22Fix some errors from the previous commit.Guy Harris2-2/+2
Pro tip: if you're modifying GTK+ code, make sure you explicitly configure to build the GTK+ version. Change-Id: Ia24321a5037dff67d9acf1444fa0b74f5aed089e Reviewed-on: https://code.wireshark.org/review/18371 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-22More checks for localtime() and gmtime() returning NULL.Guy Harris7-43/+76
And some comments in the case where we're converting the result of time() - if your machine's idea of time predates January 1, 1970, 00:00:00 UTC, it'll crash on Windows, but that's not a case where a *file* can cause the problem due either to a bad file time stamp or bad time stamps in the file. Change-Id: I837a438e4b875dd8c4f3ec2137df7a16ee4e9498 Reviewed-on: https://code.wireshark.org/review/18369 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-16Inspired by prevous commit: grep for wlan_mgt turned up a few more ↵Joerg Mayer1-3/+3
occurrences. Fix them. Change-Id: I6661f483f7bf1e34c96467917358dbddf45f808e Reviewed-on: https://code.wireshark.org/review/18216 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-10-12MTP3: Added SS7 Point Code Name ResolutionBinh Trinh1-1/+2
bug: 7592 Change-Id: I1af2c5d6664e172c358cd19bc20e9352c2582eae Reviewed-on: https://code.wireshark.org/review/17677 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann3-8/+171
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-30cmake: make WERROR_COMMON_FLAGS a normal stringPeter Wu1-7/+5
Instead of checking for the boolean "FALSE", just set an empty string. This avoids the need to check for WERROR_COMMON_FLAGS before using it. The transformation is the same for all files, remove "if (WERROR_COMMON_FLAGS)" and "endif()", reindent and add quotes (since we have a string here and not a list). Modelines have been added where missing. Change-Id: I0ab05ae507c51fa77336d49a99a226399cc81b92 Reviewed-on: https://code.wireshark.org/review/17997 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Dario Lombardo <lomato@gmail.com>
2016-09-16Use valid channel parameters from wireless toolbarMikael Kanstrup1-1/+1
Both the QT and GTK wireless toolbar used "-1" to indicate unused channel parameters. This was an undocumented feature that recently stopped working. Use the now documented way (NULL) to specify that some parameters are not used. Bug: 12896 Change-Id: I4a93a15ba1d880592b355b7eca155632a4b92ea0 Reviewed-on: https://code.wireshark.org/review/17700 Reviewed-by: Gilbert Ramirez <gram@alumni.rice.edu> Petri-Dish: Gilbert Ramirez <gram@alumni.rice.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-12fix some compilation issues without extcap.Dario Lombardo1-0/+2
Change-Id: I18c855e13281013a6277c1f38eeac92e74d52b34 Reviewed-on: https://code.wireshark.org/review/17665 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-11extcap: fix use-after-free for preferencesPeter Wu1-4/+2
In commit v2.3.0rc0-117-g485bc45 (backported to v2.2.0rc0-44-g66721ca), extcap_prefs_dynamic_vals and extcap_cleanup were added in an attempt to address dangling pointers. Unfortunately it is not sufficient: - A pointer to the preference value is stored in extcap_arg and passed to the prefs API, but this extcap_arg structure can become invalid which result in use-after-free whenever the preference is accessed. - On exit, a use-after-free occurs in prefs_cleanup when the preference value is being checked. As the preference subsystem actually manages the memory for the string value and consumers should only provide a pointer where the value can be stored, convert the char* field in extcap to char**. This has as additional benefit that values are not limited to 256 bytes anymore. extcap_cleanup is moved after epan_cleanup to ensure that prefs_cleanup does not operate on dangling pointers. Crash is reproducible under ASAN with: tshark -i randpkt Ping-Bug: 12183 Change-Id: Ibf1ba1102a5633aa085dc278a12ffc05a4f4a34b Reviewed-on: https://code.wireshark.org/review/17631 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-09-09Remove name resolution from the file dialogs.Gerald Combs1-71/+19
A single name resolution checkbox was added to the file dialog way back in 2000 in g0f7cf64. At that time it was needed because resolution was synchronous and could drastically affect your load time. Since then we've added asynchronous name resolution and more recently made it mandatory (ge005bc8). We've also added more name resolution checkboxes and other controls. Remove the name resolution checkboxes. You can just as easily change resolution options before or after opening a file and they take up valuable real estate. Combine the size and packets in the Qt and Win32 dialogs and pretty-print the size. Combine the start and elapsed times in the Qt, Win32, and GTK+ dialogs. This lets us shrink the custom areas of the file dialogs even further. Make the default file type combo item more descriptive. Change-Id: Id770adc0f284a4c7f08ee5a7db84f8435f4bf907 Reviewed-on: https://code.wireshark.org/review/17597 Tested-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-09-05Have scan_plugins() take an argument specify what to do on load failures.Guy Harris1-1/+1
That's a less gross hack to suppress load failures due to not having libwiretap than providing a no-op failure-message routine, as it at least allows other code using a failure-message routine, such as cmdarg_err() and routines that call it, to be used. We really should put libwiretap and libwireshark plugins into separate subdirectories of the plugin directories, and avoid even looking at libwireshark plugins in programs that don't use libwireshark. Change-Id: I0a6ec01ecb4e718ed36233cfaf638a317f839a73 Reviewed-on: https://code.wireshark.org/review/17506 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-01gtk: fix compilation with GTK+ before 2.18Peter Wu31-8/+37
Removed in v1.99.2rc0-399-g43f09e6, but some includes are still needed. Basically I looked for the functions defined in the ui/gtk/old-gtk-compat.h header file that were in files below ui/gtk/. Then I matched it against the removed part in the above commit and added the header back at its old place. In two other cases, the header was only needed for Windows. If the above commit did not reference the file, I checked which function was in use and added the header on top, removing redundant conditionals. Reported and tested by a user of GTK+ 2.12.12 on top of v2.0.5. Change-Id: I649eec1e5531070f88c99d893c4920306f56d849 Reviewed-on: https://code.wireshark.org/review/17371 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-01gtk: fix 32-bit buildPeter Wu2-3/+3
32-bit glib before 2.31.2 expand GUINT_TO_POINTER(x) as (gpointer)x. add explicit cast since curr_layer_num is 8 bits. Fixes v1.99.10rc0-179-g1d7bcb2. Storing a 64-bit integer into a 32-bit pointer makes the compiler complain. Add explicit cast. Fixes v1.99.1rc0-76-ged0b19b. Change-Id: I75fdf17882a0f5ddce7d3b3e74b1bf80ff6cd4ae Reviewed-on: https://code.wireshark.org/review/17417 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-08-28UAT gtk-ui, Qt-ui: Fixed copying records when no cp callback is definedMichał Skalski1-0/+4
According to documentation of uat_copy_cb_t, if uat->copy_cb is NULL, memcpy() should be used. This affected IKEv1 and IKEv2 UAT tables (possibly others). Change-Id: I27ebdc08385d260945699f101e714d3abb288b22 Reviewed-on: https://code.wireshark.org/review/17245 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-08-23CMake: Allow setting per target compiler warningsJoão Valverde1-0/+1
Setting our compiler warning flags in CMAKE_C_FLAGS does not allow using different flags per target. Allow for that possibility by setting the internal WS_WARNINGS_{C,CXX}_FLAGS and using the COMPILE_OPTIONS property to set them. This change is just setting mechanism and there should be no difference in generated warnings. The check_X_compiler_flag cmake test is changed to test each flag individually. We need a list, not a space separated string, and the aggregate test is not significant. Change-Id: I59fc5cd7e130c7a5e001c598e3df3e13f83a6a25 Reviewed-on: https://code.wireshark.org/review/17150 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-08-07gtk: add assert (CID 1159169).Dario Lombardo1-0/+1
Change-Id: I365bdbc49fe50b6442fd01f56cc7ffdda972585c Reviewed-on: https://code.wireshark.org/review/16949 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-01Remove proto_help.[ch]Michael Mann7-759/+0
The functionality hasn't been used for awhile and was deprecated with GTK 2.4 (while our minimum support is at least 2.14). It's also causing unnecessary checkAPI warnings. Change-Id: Ib8da8300a50e2129a46ad188b4ed4d7b2d44b1ca Reviewed-on: https://code.wireshark.org/review/16813 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-07-31lbm_uimflow_dlg.c: Pacify another GTK checkAPIs.pl warning.Michael Mann2-1/+2
Add another "Wireshark" macros to old-gtk-compat.h for GTK API that has been deprecated. Change-Id: Icae4ebae365329fad076324c23d5cee4c89893b5 Reviewed-on: https://code.wireshark.org/review/16803 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-29extcap: Restore functionality for optionsRoland Knall1-0/+4
Allow stored options to be restored to their default values. This adds a global cleanup method for extcap and globally defined preference values, which fixes the parameter problem with windows Change-Id: I48e0cf846ef81f4732d652c6a2ad0020db5df08e Reviewed-on: https://code.wireshark.org/review/13741 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-07-26CLI/GTK: Fix compare_stat checksum to include IPv4 offset againJoão Valverde1-1/+1
BYTES was not changed to account for the change of ip_len from 16 to 32 bits. Change-Id: I37b472971fe42a05eb612f88bd38c753f5cf0a08 Reviewed-on: https://code.wireshark.org/review/16706 Reviewed-by: João Valverde <j@v6e.pt>
2016-07-26Cleanup some checkAPI warnings that were missed in previous patches.Michael Mann1-1/+1
Some search/replace of printf, g_warning and GTK APIs were changed to use a ws_ prefix Change-Id: I9beb763a975530a4006d1afbcad079a7d8d4ebf9 Reviewed-on: https://code.wireshark.org/review/16704 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-26Ensure to have a valid string pointer when writing OS SHB optionPascal Quantin1-1/+6
Change-Id: Ib0b6dcdf1700e88383d30bf43739312fce10e1c7 Reviewed-on: https://code.wireshark.org/review/16696 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-07-24Pacify GTK checkAPIs.pl warnings.Michael Mann15-43/+61
Add "Wireshark" macros to old-gtk-compat.h for GTK APIs that have been deprecated. The macros are setup by version number to limit their proliferation (not that I suspect much development will really be done there since GTK is deprecated). Just want to make buildbots happy for the time being. Change-Id: I095f850065166a0bc2e2456fb2e886ab64fdd97d Reviewed-on: https://code.wireshark.org/review/16635 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Balint Reczey <balint@balintreczey.hu> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-24Replace strlen with NULL checks to pacify checkAPIs.plMichael Mann2-4/+4
Change-Id: I5db39cbd531c228da73447bf8899599f82e1889d Reviewed-on: https://code.wireshark.org/review/16624 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-23Update struct ws_ip with flow label and commentsJoão Valverde1-2/+2
Change field ip_v_hl to version. Change-Id: Ic7ce8d6d083f6413284a7b9ba91a2387b11b29fb Reviewed-on: https://code.wireshark.org/review/16555 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-07-21No need to check for string option values being null.Guy Harris1-8/+8
A string option, if present, always has a value; it might be a null *string*, but you won't get a null pointer (if the option isn't present, it simply isn't present). Fix some comments while we're at it. Change-Id: I9c1420f56998a7d04de5c5cc2e92631b181f303a Reviewed-on: https://code.wireshark.org/review/16564 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-18Mark the file as having unsaved data if you change address resolution.Guy Harris1-1/+2
That information can, and will, get saved in some file formats, so mark the file as changed so it can and will get saved by "Save". XXX - we need to treat it as a type of data that can be discarded when saving in some file formats, just like comments. Bug: 12629 Change-Id: I1fd69b95f4f7345c339961b4c53c28b98b364e4e Reviewed-on: https://code.wireshark.org/review/16538 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-18Use follow_record_t in SSL follow stream.Jeff Morriss1-62/+1
... rather than a structure (SslDecryptedRecord) which looks (mostly) like a follow_record_t. (The biggest different is the former carries its data in a StringInfo while the latter uses a GByteArray.) With this change following SSL no longer needs its own special code. This also fixes a crash after saving a followed SSL stream (in the Qt UI). Bug: 12616 Change-Id: Ibdb2b85f8a6a30712743a5da420be1e6b78f5b92 Reviewed-on: https://code.wireshark.org/review/16516 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-07-18Rename iph->ip_p to iph->ip_nxtJoão Valverde1-1/+1
struct ws_ip is IP version agnostic. "ip_p" is too terse and less appropriate. Change-Id: I06b8740ab420e20781bf7b9efcf5dce19ad22ab2 Reviewed-on: https://code.wireshark.org/review/16519 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: João Valverde <j@v6e.pt>
2016-07-17Fix sscanf VS Code Analysis warnings.Michael Mann1-3/+4
Some needed to check return value, others were converted to use strtoul. Change-Id: I55aae216f95362b67e006f6e682abbd5ae2c8dcc Reviewed-on: https://code.wireshark.org/review/16502 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-14Redo the block options APIs.Guy Harris2-36/+33
A block can have zero or more instances of a given option. We distinguish between "one instance only" options, where a block can have zero or one instance, and "multiple instances allowed" options, where a block can have zero or more instances. For "one instance only" options: "add" routines add an instance if there isn't one already and fail if there is; "set" routines add an instance if there isn't one already and change the value of the existing instance if there is one; "set nth" routines fail; "get" routines return the value of the instance if there is one and fail if there isn't; "get nth" routines fail. For "multiple instances allowed" options: "add" routines add an instance; "set" routines fail; "set nth" routines set the value of the nth instance if there is one and fail otherwise; "get" routines fail; "get nth" routines get the value if the nth instance if there is one and fail otherwise. Rename "optionblock" to just "block"; it describes the contents of a block, including both mandatory items and options. Add some support for NRB options, including IPv4 and IPv6 option types. Change-Id: Iad184f668626c3d1498b2ed00c7f1672e4abf52e Reviewed-on: https://code.wireshark.org/review/16444 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-06Qt: add initializers (CID 1162824).Dario Lombardo1-0/+2
Change-Id: Ib570d3531bfdd35404b75d49dbd7dd43db4c30d9 Reviewed-on: https://code.wireshark.org/review/16310 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-07-01Qt+Gtk: Fix the -t command line flag.Gerald Combs1-3/+7
Add the time format to commandline_param_info_t and apply it when we've finished application initialization. Bug: 12489 Change-Id: Ice626198a610567e945a8e53c0c1093797e8208e Reviewed-on: https://code.wireshark.org/review/16232 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-06-30Remove Makefile.common filesJoão Valverde2-364/+338
Now that nmake build system has been removed they are not needed anymore. Change-Id: I88075f955bb4349185859c1af4be22e53de5850f Reviewed-on: https://code.wireshark.org/review/16050 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>