Commit Graph

2560 Commits

Author SHA1 Message Date
Guy Harris cc4710ac5f Also define LONGOPT_CAPTURE_COMMON as nothing if we don't have pcap.
While we're at it, simplify the #ifdefs and #defines in capture_opts.h -
don't do the same tests twice.

Change-Id: I2079167f31789470ef77120054d769d5914745e3
Reviewed-on: https://code.wireshark.org/review/2496
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 21:39:08 +00:00
Guy Harris 13b5d9b145 Use OPTSTRING_CAPTURE_COMMON here as well.
Change-Id: If0078797a2e7b14edbd1b64863c4961c9b198168
Reviewed-on: https://code.wireshark.org/review/2494
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 21:29:31 +00:00
Guy Harris 9a50b0f20b Define OPTSTRING_CAPTURE_COMMON as nothing if we don't have pcap.
No capturing, no capture options.

Change-Id: I0023184b9c358d5876f19a098590f34d641c8649
Reviewed-on: https://code.wireshark.org/review/2493
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 21:14:27 +00:00
Guy Harris 26bbee3fad Add some long options for capture short options.
The names match tcpdump trunk's names for the corresponding options.

Also have capture_opts.h provide a #define for the part of the short
option string that corresponds to the capture short options that all our
programs that take capture short options take (those are largely the
ones we have in common with tcpdump).

Change-Id: Ia209425959c801725850b56a7d63441ee99b5001
Reviewed-on: https://code.wireshark.org/review/2492
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 21:00:16 +00:00
Guy Harris 312ed10900 Add --help and --version long options.
Also, make the convention for long-only options be that their
case-statement values start at 128, so they avoid colliding with any
ASCII code points, including control characters.

Make the tables of long options "static const" while we're at it, and
get rid of unnecessary casts.

Change-Id: I55702a85e9bc078b1cd0f2803ebb68a710405bab
Reviewed-on: https://code.wireshark.org/review/2491
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 19:19:47 +00:00
dameiss db0e534ebd Changed a cast (from guint to guint64) in a call to gtk_tree_store_set(). The data is actually
64-bit, and was being fetched that way - but not stored that way - leading to some very strange
(and large) values.

Change-Id: I2235ae7f1bab7f48f99afac70109a7d8f9b38e2b
Reviewed-on: https://code.wireshark.org/review/2468
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-19 23:07:03 +00:00
Chris Maynard e07b7953a8 Save the size and position of the expert info dialog
Set initialize position to center on parent

bug: 3817
Change-Id: Iad48aa762d892908d50f742606160c8305084f48
Reviewed-on: https://code.wireshark.org/review/2459
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Tested-by: Balint Reczey <balint@balintreczey.hu>
2014-06-19 22:21:05 +00:00
dameiss 88b0d0a139 Cleaned up some CLang dead assignment warnings.
Change-Id: Ibd2fa6c791253e4dbac9a21532e894db3327ce57
Reviewed-on: https://code.wireshark.org/review/2465
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 22:05:54 +00:00
Jeff Morriss a32dbae525 Don't crash when closing the Summary window if the file has been closed.
Yes, this is a Gtk-UI fix but it's a one-liner and easy enough.
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8715

Bug: 8715
Change-Id: I554b6c953e83ff3d8cb57029e844f2f481b751dd
Reviewed-on: https://code.wireshark.org/review/2460
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-06-19 21:47:04 +00:00
dameiss 78a5f0c1d8 gtk_table_new is deprecated in GTK3. Change to use grid instead, and use
ws_gtk_grid_attach_extended() to do the heavy lifting.

Change-Id: I1c9d12556857196f53fadbce70f206a3cc41f7a5
Reviewed-on: https://code.wireshark.org/review/2433
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-19 19:56:08 +00:00
dameiss 46a808acf4 Add GTK modules for existing LBM dissectors.
bug: 10204
Change-Id: Ie21cc07b0ac9a56648ec72062ce58a1ac800318e
Reviewed-on: https://code.wireshark.org/review/2420
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 14:36:24 +00:00
Pascal Quantin bcff3c57cc Add the ability to dynamically add a new protocol to export PDU dialog box
Change-Id: I83012cc963d514982e40010e837e11a6fcf1bc3e
Reviewed-on: https://code.wireshark.org/review/2423
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-19 06:48:32 +00:00
Gerald Combs ed38e69235 Make sure we hide columns for live captures as well.
Remove some dependencies on having an open capture file.

Change-Id: Iad5d03e0a45ed31c83781861ef1ed7fdeb92e4a5
Reviewed-on: https://code.wireshark.org/review/2352
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-06-17 22:39:09 +00:00
Tim Furlong 74fec38529 Get QtShark building on Win7 with Qt 5.3.0 using Qt Creator.
Several header file references in .ui files needed to be changed to not
be global, and the path to stats_tree_dialog.ui needed a "../qt" path
prepended to be found from the build...-Release directory.

Change-Id: I51c0bb15eed706f483085020ce2b3cea3c1cdc95
Reviewed-on: https://code.wireshark.org/review/2281
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-17 21:02:18 +00:00
Alexis La Goutte 11243e3977 Qt: fix loading of language translation
But need always restart to apply change...

Based on http://qt-project.org/wiki/How_to_create_a_multi_language_application


Change-Id: I0f95afb68aa5b125e0707b0af1ce096dab9c29e4
Reviewed-on: https://code.wireshark.org/review/2286
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-17 00:08:51 +00:00
Gerald Combs 6c79a718ab Column visibility fixups.
Move visibility to its own method and call it when we show ourselves and
when we thaw.

Change-Id: I936cd33e5ccabddb32061ea347a465ac12f1be87
Reviewed-on: https://code.wireshark.org/review/2289
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-06-16 23:56:39 +00:00
Jeff Morriss f113306e0e More Python-bindings removal.
Change-Id: I4d82175781e65c73179f4c8e737a7900cb050bce
Reviewed-on: https://code.wireshark.org/review/2283
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-06-16 23:14:05 +00:00
Gerald Combs 7f6ebece15 Hide hidden columns in Qt.
Change-Id: I1da0d95c606eb2f17c03874f20d38b9a7ba9e8ee
Reviewed-on: https://code.wireshark.org/review/2278
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-06-16 21:31:12 +00:00
Alexis La Goutte b71b68cd63 Fix indent (Use 4spaces like end of the file and modelines info
Change-Id: I80e0193240032e62c685c5b976df921ea1e6a581
Reviewed-on: https://code.wireshark.org/review/2251
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Graham Bloice <graham.bloice@trihedral.com>
2014-06-16 17:08:57 +00:00
Evan Huus c76b70fa12 Remove last remaining call to se_strdup
get_filter_from_packet_list_row_and_column now returns glib memory

Change-Id: I24361670322ff4a936c157a842b07f32c474089e
Reviewed-on: https://code.wireshark.org/review/2240
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16 15:36:44 +00:00
Evan Huus 83f9cc6603 Remove last caller of se_strdup_printf
Also remove that function as it is now unused.

Fix what appeared to be a memory leak in the manual address resolution dialog
while in the neighbourhood.

Change-Id: I75128ab0f95e5a7673f92bfeea45191f00581c25
Reviewed-on: https://code.wireshark.org/review/2244
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 15:25:53 +00:00
Alexis La Goutte ac5479b4b8 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I781c7eec381d3296d15e666385f549e44f62e3f1
Reviewed-on: https://code.wireshark.org/review/2226
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16 06:48:33 +00:00
Irene Ruengeler e14357032f Define INET6 for all platforms.
Show the addresses as a tooltip in capture interfaces.

Change-Id: I911784e09ed9479229a7d6f8a7f1476e2e1e6224
Reviewed-on: https://code.wireshark.org/review/2155
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-14 13:27:10 +00:00
Guy Harris a972e8f2b3 Try to fix a used-but-not-set warning.
I'm guessing that GCC is complaining because "device" isn't guaranteed
to be set (if there are no interfaces, the body of the loop will never
be executed), so do with the list of link-layer header types what's done
for the buffer size and snapshot length.

But should the column-setting code be executed if the interface isn't
found?

Change-Id: I8c365a482b8af44cdd1c1a7f41ca611141387c86
Reviewed-on: https://code.wireshark.org/review/2180
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-12 18:55:17 +00:00
Irene Ruengeler df8c4bf264 Capture Interfaces Dialog:
- allow to change the interface options in the table
- save the options to preferences when the dialog is left
- add a field for setting a capture filter for all selected interfaces
- add a "Compile BPF" button and a window to show the compiled filter output
- try to address Alexis' and Evan's comments

Change-Id: Ic1272e29183ec80e2d2f4b3e494c79dabe2c3b6f
Reviewed-on: https://code.wireshark.org/review/1946
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-12 05:54:59 +00:00
Alexis La Goutte dc904a161f rlc lte graph: Assigned value is garbage or undefined (clang analyzer)
Change-Id: Ia371c26299aa62566a63bc1a4d4f6df827fdf5b9
Reviewed-on: https://code.wireshark.org/review/2085
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-10 08:15:02 +00:00
Alexis La Goutte f627ee8674 Add Modelines info
Change-Id: I2364104145518d484c2e5fb0ae5d5d80cce0982d
Reviewed-on: https://code.wireshark.org/review/2064
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-09 23:56:49 +00:00
Alexis La Goutte 60ce7bce5f Add TFTP export for Qt too
Change-Id: I056829d48aa49eb106c76c8f572c0f8b6e1a4245
Reviewed-on: https://code.wireshark.org/review/1916
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-06 15:49:44 +00:00
Pascal Quantin ad7b5381ac Upgrade Windows builds to GnuTLS 3.1.22 and Gcrypt 1.6.0
Change-Id: I7650a3ec31120ac5e7954f4c1ca985ad55d189b4
Reviewed-on: https://code.wireshark.org/review/1978
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-06 15:33:01 +00:00
Martin Mathieson 17b98ad420 Add a missing header file, and add new file to cmake build
Change-Id: I3be8bef8c7542e7bcb11f3696783ca68c3920082
Reviewed-on: https://code.wireshark.org/review/1987
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-06-05 22:03:31 +00:00
Martin Mathieson 29222aba7c Add Object (file) export for files transferred over TFTP.
Updated following review comments.

Change-Id: I56e70d8f8e332d2aea604ceec16c980ad890fa58
Reviewed-on: https://code.wireshark.org/review/1885
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-06-05 18:00:49 +00:00
Alexis La Goutte 9389d789a4 Qt: Export Object
* Fix indent (remove tabs)
* Add title to the window

Change-Id: I454046e47fa17969c710fa8dec4fac8cb7dbf22f
Reviewed-on: https://code.wireshark.org/review/1917
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-03 15:07:16 +00:00
ruengeler a192e4792d Use Q_UNUSED instead of _U_
Change-Id: I19732f097b1238159b634e32ee13fe6ae3f1883d
Reviewed-on: https://code.wireshark.org/review/1849
Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2014-05-28 17:46:30 +00:00
ruengeler 9d77e7cff8 QIcon is not needed.
Change-Id: I07207177e97e22bb8810226818b2280db5f5055e
Reviewed-on: https://code.wireshark.org/review/1836
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-28 12:36:12 +00:00
Guy Harris 318cf8a678 Add support for dissecting non-packet records.
Add a dissector table indexed by the file type, and, for the
file-type-specific records, have the frame dissector skip the usual
pseudo-header processing, as the pseudo-header has a file-type-specific
record subtype in it, and call the dissector for that file type's
records.

Change-Id: Ibe97cf6340ffb0dabc08f355891bc346391b91f9
Reviewed-on: https://code.wireshark.org/review/1782
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-25 00:05:07 +00:00
Guy Harris 6db77b000f Allow wtap_read() and wtap_seek_read() to return records other than packets.
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be
REC_TYPE_PACKET, for a record containing a packet, or
REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific
data.

Modify code that reads packets to be able to handle non-packet records,
even if that just means ignoring them.

Rename some routines to indicate that they handle more than just
packets.

We don't yet have any libwiretap code that supplies records other than
REC_TYPE_PACKET or that supporting writing records other than
REC_TYPE_PACKET, or any code to support plugins for handling
REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug
8590.

Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813
Reviewed-on: https://code.wireshark.org/review/1773
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24 18:31:25 +00:00
Guy Harris a344c9736e Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."
This reverts commit c0c480d08c.

A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes.  That is in-progress.

Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6
Reviewed-on: https://code.wireshark.org/review/1741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 10:50:10 +00:00
Guy Harris c0c480d08c Allow wtap_read() and wtap_seek_read() to return non-packet records.
This is the first step towards implementing the mechanisms requestd in
bug 8590; currently, we don't return any records other than packet
records from libwiretap, and just ignore non-packet records in the rest
of Wireshark, but this at least gets the ball rolling.

Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574
Reviewed-on: https://code.wireshark.org/review/1736
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 03:02:32 +00:00
Michael Mann e5353bf119 Use g_ alloced memory (instead of emem) when printing fields. emem shouldn't be used for GUI functions anyway.
emem was exposed because of its memory limits trying to output PDML for a very large byte field in a capture file.

When converting from proto_construct_match_selected_string to fvalue_to_string_repr remember proto_construct_match_selected_string includes fieldname + value, not just value

bug:10081
Change-Id: I4fc6ea7fd1f63cff410207c8b30562771af40ada
Reviewed-on: https://code.wireshark.org/review/1578
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-19 01:46:55 +00:00
Peter Wu 3aee917058 wiretap: remove unused code, drop number_of_interfaces
While investigating an ASAN issue (fixed in
commit dcdd076ab0), I got greatly confused
by three different types having the same "interface_data" field name:

 * pcapng_t *pn stores an array of interface_data_t objects.
 * wtap *wth stores an array of wtapng_if_descr_t objects.
 * pcapng_dump_t should store an array of interface_data_t objects.

pcapng_dump_t and friends are unused since
commit c7f1a431d2, so drop it.

To fix the confusion, rename the interface_data_t type to
interface_info_t type and use the local variable "iface_info"
everywhere. Rename interface_data of pcapng_t to "interfaces" and
add a comment what this exactly means (interfaces listed in the capture
file).

Drop the number_of_interfaces field for interfaces as the array
length is already available from GArray. Now interface_data is always
initialized for wth (which also gets copied to idb).

s/int/guint/g and replace cast at some places.

There are no regressions for the in-tree test suite.

Change-Id: I2d5985c9f1e43f8230dbb4a73bd1e243c4858170
Reviewed-on: https://code.wireshark.org/review/1656
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-17 12:41:50 +00:00
Evan Huus 25ba4a2a44 Guard closing capture window with ifdef.
That variable is only defined if we HAVE_LIBPCAP. Should fix OSX10.5 buildbot.

Change-Id: I0bafc48955ef4af3c0b8d9d7a35b1e8b27577d31
Reviewed-on: https://code.wireshark.org/review/1669
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-17 12:07:45 +00:00
ruengeler 53eeff6c91 Do not leave the Options Interfaces Dialog open, when the Main Window is closed.
Change-Id: Ifd4fb88ceff24561131fad1d72531889e323f5ac
Reviewed-on: https://code.wireshark.org/review/1651
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-15 11:58:57 +00:00
ruengeler 2828bf7777 The filter string can only be valid, if an interface is selected.
Change-Id: I578f6b46d5e2631c6315eb0a8b6141ba93ee21bb
Reviewed-on: https://code.wireshark.org/review/1631
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-14 10:46:15 +00:00
Alexis La Goutte 2c00d66fb7 Use pre-scan command line parameters with double while(opt=getopt...)
Don't need launch "Qt" for some console only parameters (-h -v ...)

Based on GTK+ code

Change-Id: I1a810e394088959aefbbb39fb88836591a8b2367
Reviewed-on: https://code.wireshark.org/review/1311
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 16:41:30 +00:00
AndersBroman 3157bf6ba5 isprint() -> g_ascii_isprint()
Change-Id: Ia586ef8ce500d5fc7578c52014206fa7a7eaea41
Reviewed-on: https://code.wireshark.org/review/1624
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 16:14:07 +00:00
Gerald Combs 9803122c8e Ignore SIGPIPE on systems that have it.
According to the GTK+ docs, gtk_init calls "signal(SIGPIPE, SIG_IGN)" at
startup. Replicate that behavior here, otherwise we tend to terminate
unexpectedly.

Change-Id: Ia017402755d647e6050af40deacef6765eea8694
Reviewed-on: https://code.wireshark.org/review/1614
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Gerald Combs <gerald@wireshark.org>
2014-05-12 17:05:06 +00:00
Pascal Quantin d1d5caaf25 Fix tshark -z follow,tcp stats regression when TCP stream index is > 0
With tshark stats are being configured before the file gets loaded and the number of TCP streams are computed

Bug: 9541
Change-Id: I42c2891124f1781b05967d5f071ad40df2d6d9f5
Reviewed-on: https://code.wireshark.org/review/1598
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-12 05:20:45 +00:00
Pascal Quantin 98f608cc0d Identify client/server by their IP address and port number in follow streams dialog box
This allows to properly identify hosts that use the same port number

Change-Id: I93bf5b53e4df1d339fb06b372b90f88fce6785a0
Reviewed-on: https://code.wireshark.org/review/1588
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-11 17:01:54 +00:00
Pascal Quantin 4af23b0d7f Fix display of unidirectional follow TCP/UDP streams
It was broken since 48285bb16b
While we are at it, display the streams in the same order as Qt version

Change-Id: I12df1c033dd51b7a162adca3fd36b31af5c074a1
Reviewed-on: https://code.wireshark.org/review/1587
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-11 16:53:01 +00:00
Pascal Quantin e2eea89698 Small fixes to Follow Streams dialog box:
- get the right IPv6 client address
- display the right client to server string for UDP/SSL in Qt port

Change-Id: I399cc38b8a32321198deccdd8e2ecd05b54e14db
Reviewed-on: https://code.wireshark.org/review/1586
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-11 16:47:18 +00:00