Commit Graph

40 Commits

Author SHA1 Message Date
Guy Harris cb16dff992 Get rid of more tvb_get_nstringz* calls.
Add an FT_STRINGZPAD type, for null-padded strings (typically
fixed-length fields, where the string can be up to the length of the
field, and is null-padded if it's shorter than that), and use it.  Use
IS_FT_STRING() in more cases, so that less code needs to know what types
are string types.

Add a tvb_get_stringzpad() routine, which gets null-padded strings.
Currently, it does the same thing that tvb_get_string_enc() does, but
that might change if we don't store string values as null-terminated
strings.

Change-Id: I46f56e130de8f419a19b56ded914e24cc7518a66
Reviewed-on: https://code.wireshark.org/review/1082
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-12 22:27:22 +00:00
Balint Reczey 00be1d31ce Migrate GTK icon handling to GTK 3.10 API
GtkStockItem usage is deprecated with all the GTK_STOCK_.* stock ids.
We keep a stock id based approach but without relying on GTK's
GtkStockItem system.

We create our own internal stock ids for {icon, label} tuples and keep
the original GTK stock id #define-s and values to preserve backward
compatibility.

Change-Id: Ia0b35a5903f079e92c8026e3df21bbf0be2d06b0
Reviewed-on: https://code.wireshark.org/review/302
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-11 05:38:01 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Bill Meier 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +00:00
Gerald Combs 17a67c3b5c Get the "Decode As" dialog working, albeit with a few warts. It differs
from the GTK flavor in two major ways:

- The "Decode As" and "User Specified Decodes" dialog have been unified.
- You can modify the decode as behavior at any time, not just when you
  have a packet selected.

Revert part of 53498 so that we can move items marked

/*** THE FOLLOWING SHOULD NOT BE USED BY ANY DISSECTORS!!! ***/

from epan/decode_as.h to ui/decode_as_utils.h. 

Move "save" code from decode_as_dlg.c to decode_as_utils.c as well.

In packet-dcerpc.c don't register a table named "ethertype". We might
want to add checks for duplicate table names.

To do:
- Add support for ranges?
- Either add support for DCERPC or make DCERPC use a regular dissector
  table.
- Fix string selectors (i.e. BER).


svn path=/trunk/; revision=53910
2013-12-10 19:23:26 +00:00
Gerald Combs 5acdfae070 Restore disabled "decode as" settings.
svn path=/trunk/; revision=53635
2013-11-29 03:14:24 +00:00
Gerald Combs e5c9616fd2 Remove a commented-out duplicate dissector_table definition.
svn path=/trunk/; revision=53500
2013-11-22 01:11:49 +00:00
Gerald Combs 78266fe17e Add an initial "Decode As" dialog. Currently read-only.
Fixup some of the Statistics menu items.

svn path=/trunk/; revision=53499
2013-11-22 01:07:36 +00:00
Gerald Combs 70709e1b35 Move common "decode as" preference code to epan.
We presumably want "decode as" behavior to be consistent across UIs so
call load_decode_as_entries() from read_prefs().

svn path=/trunk/; revision=53498
2013-11-22 00:20:23 +00:00
Michael Mann 01c8945438 Provide "Decode As" functionality through dissectors themselves instead of the GUI. Bug 9450 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450)
The basic idea behind this design is to have dissectors register with a "decode as list" with their name and dissector table.  When "Decode As" dialog is launched, any "registered" dissector found in the packet will cause a tab to be created in the dialog.  Any GUI (GTK+/Qt/tshark) can just hook into the "decode as list" to see what can be provided.

This patch includes the GUI portion of the functionality (including packet-dcerpc.[ch] because it had some GUI dependencies that are now removed).

Other notes:
1. Some "GUI text" (UTF8_LEFTWARDS_ARROW and similar) made their way into the dissector code.  Not sure how necessary it is and if reformatting the strings to avoid the macros is desired (TCP/UDP use it, SCTP doesn't).

2. I converted the SCTP functionality to have 2 tabs (instead of radio button), currently both are labeled "Transport" which could be confusing to users.  Naming suggestions welcome (as well as for naming of tabs from other dissectors).

3. BER and DCERPC have more opportunity to use Decode As now that they are selected based on dissector presense, not packet_info values.

4. Catapult DCT2000 populates pinfo->ipproto, yet under new design will not show up to do Decode As.  Should a "decode as item" be created for it?

5. BER dissector doesn't have Clear/Show Current functionality working (never did)

6. Bluetooth (in old design) could have been used "capture wide" instead of single packet (creating tabs of values not present in current packet), which goes against what I believe to be in the intent of Decode As, but I'm willing to hear counter-arguments.

svn path=/trunk/; revision=53446
2013-11-20 19:23:02 +00:00
Guy Harris db25270df8 Move the epan/filesystem.c routines to wsutil; they're not specific to
packet dissection, they're specific to the entire Wireshark suite of
programs.

svn path=/trunk/; revision=53377
2013-11-17 02:55:14 +00:00
Guy Harris 5cec175b07 Another one.
svn path=/trunk/; revision=53165
2013-11-08 09:11:54 +00:00
Guy Harris 011ee99394 What matters is the encapsulation type, not the file type, so just test
for WTAP_ENCAP_BER, not for WTAP_FILE_BER.

svn path=/trunk/; revision=53164
2013-11-08 09:10:36 +00:00
Guy Harris 05c9234020 Make routines not used outside their source files static.
svn path=/trunk/; revision=49522
2013-05-22 20:23:10 +00:00
Jeff Morriss c2ced4a2ab Don't try to open <home>/.wireshark on Windows: Wireshark hasn't written to
that directory since 2001 and reading from that directory was only left in for
backwards compatibility with versions prior to r4702.  I think it's now safe
to remove that backwards compatibility.

This eliminates the last argument of get_persconffile_path().

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8437

svn path=/trunk/; revision=48797
2013-04-09 02:48:03 +00:00
Evan Huus aee73d6d9e From Michal Labedzki via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8530
Enable "Decode As" for Bluetooth over USB.

svn path=/trunk/; revision=48605
2013-03-28 03:06:30 +00:00
Evan Huus c4a36c513f Redissect extra packet windows in all cases (that I know of) where we
redissect normal packet list.

Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8482

svn path=/trunk/; revision=48528
2013-03-24 16:47:38 +00:00
Bill Meier 8112ecc321 From beroset:
remove C++ incompatibilities
 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10404

Note: The following parts of the patch had been previously done:
 asn1/snmp/packet-snmp-template.c
 epan/dissectors/packet-snmp.c
 epan/dissectors/packet-x11.c

Also; hostlist_table.c: code under '#ifdef HAVE_GEOIP'
 didn't compile and needed a few additional patches.


svn path=/trunk/; revision=48447
2013-03-21 02:29:09 +00:00
Anders Broman ed87ba43a6 Use explicit casts.
svn path=/trunk/; revision=48179
2013-03-07 19:52:33 +00:00
Michael Mann e094c21301 Minor Bluetooth fixes
1. Allow to DecodeBy payload over AVCTP
2. Fix L2CAP CID payload recognize after disc
3. Removed unneeded _U_
4. Fall back to control channel in AVRCP
5. Fix time-tracking for passthrough and capability AVRCP commands

From Michal Labedzki, bug 8367 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8367)

svn path=/trunk/; revision=47810
2013-02-21 22:00:32 +00:00
Chris Maynard c6c41ee09b Fix Coverity CID 741991: Wrong sizeof argument.
svn path=/trunk/; revision=47074
2013-01-14 18:41:25 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Evan Huus 52aff57285 Remove unneeded initializations, and one redundant if condition.
svn path=/trunk/; revision=46702
2012-12-22 21:14:13 +00:00
Anders Broman cdc278aefd Try to make the decode as window look a bit nicer.
svn path=/trunk/; revision=45947
2012-11-06 12:23:46 +00:00
Anders Broman dc284b0c04 Initialize variables.
svn path=/trunk/; revision=45916
2012-11-05 09:13:36 +00:00
Anders Broman 120dab634e From Michal Labedzki:
"Decode By" for Bluetooth support decoding by L2CAP service, L2CAP CID,
L2CAP PSM, RFCOMM service and RFCOMM channel.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7754

svn path=/trunk/; revision=45913
2012-11-05 08:39:51 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Anders Broman eaf81ff987 From Rick Krull:
One can't resize the columns on several "tree views".  The one that I ran into
was "Decode As: Show".  I added "set_resizable" to make it resizable.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7706

svn path=/trunk/; revision=44828
2012-09-10 08:36:03 +00:00
Gerald Combs 02894a0be8 Move utf8_entities.h to the "ui" directory. Separate packet information
items with MIDDLE DOTs.

svn path=/trunk/; revision=44194
2012-08-01 19:18:49 +00:00
Jeff Morriss dc3629ad55 #include old-gtk-compat.h in order to get compilation working with older gtks.
svn path=/trunk/; revision=44188
2012-08-01 14:33:12 +00:00
Anders Broman 1cd8b5b0cc Get rid of some GTK_CHECK_VERSION instances by using compabillity macros.
svn path=/trunk/; revision=44186
2012-08-01 13:41:40 +00:00
Jakub Zawadzki e4b07c11d4 Decode as: Don't add notebook twice to hbox (fix r43825)
svn path=/trunk/; revision=43873
2012-07-20 21:34:23 +00:00
Anders Broman aa1dd4546d Shoul be gtk_box_pack_start(GTK_BOX (vbox), message_type_fr, TRUE, TRUE, 0);
svn path=/trunk/; revision=43828
2012-07-19 14:02:47 +00:00
Anders Broman d3ecc1431f gtk_container_add() -> gtk_box_pack_start().
svn path=/trunk/; revision=43825
2012-07-19 13:06:04 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Jeff Morriss d4fdd6ad52 Only propose decoding PPID 0 if that PPID is in the currently-selected frame.
(I used PPID 0xffffffff as an end-of-list marker so that PPID can no longer
be used in this dialog; if someone starts using that PPID then we'll have
to put a count of PPIDs in pinfo.)

svn path=/trunk/; revision=42991
2012-06-01 21:18:59 +00:00
Chris Maynard ada62f22a8 If either create_persconffile_dir() or ws_fopen() fail, then bail out. This avoids potentially dereferencing "daf" if it's NULL and fixes Coverity CID 281275.
svn path=/trunk/; revision=42841
2012-05-25 00:43:32 +00:00
Anders Broman b832d1d6ba Replace gtk_vbox_new() and gtk_hbox_new() with ws_gtk_box_new().
svn path=/trunk/; revision=42161
2012-04-20 14:56:24 +00:00
Guy Harris d7b2aad043 Move some headers for UI stuff, and the alert_box.c UI-specific file, to
the ui directory.  (Perhaps some other files that would be used by all
flavors of Wireshark, for any GUI toolkit or for someting such as
ncurses, and not for any command-line tool such as TShark, should be
moved there as well.)

Shuffle some #includes to put the "ui/XXX.h" includes together.

svn path=/trunk/; revision=40529
2012-01-16 01:07:52 +00:00
Jörg Mayer be706c6380 Move gtk to ui/gtk.
This looses the last checkin to gtk, will add this manually back.

svn path=/trunk/; revision=40518
2012-01-15 21:59:11 +00:00