Commit Graph

257 Commits

Author SHA1 Message Date
Jakub Zawadzki 8b73d378a4 exceptions.h not needed by tvbuff.h (no much progress because it's needed by proto.h)
svn path=/trunk/; revision=53219
2013-11-10 11:48:03 +00:00
Jörg Mayer 7c2c2d89f5 Fix:
cd /home/jmayer/work/wireshark/svn/build/qt-gtk3/epan && /usr/bin/cc  -DG_DISABLE_DEPRc
In file included from /home/jmayer/work/wireshark/svn/trunk/epan/packet.h:29:0,
                 from /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-2dp:
/home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-2dparityfec.c: In functio:
/home/jmayer/work/wireshark/svn/trunk/epan/proto.h:2128:2: error: ISO C90 forbids mixe]
  extern header_field_info __start__data_ ##proto[]; \
  ^
/home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-2dparityfec.c:331:4: note’
    proto_register_fields(proto_2dparityfec, hfi, array_length(hfi));
    ^
cc1: all warnings being treated as errors


svn path=/trunk/; revision=53152
2013-11-08 00:01:19 +00:00
Jakub Zawadzki 1dffd1a949 GCC on amd64 align header_field_info variables to 16-bytes, this cause problems with proto_register_fields_section().
sizeof(void *) alignment should be enough, use it in HFI_INIT.

This fixes http://www.wireshark.org/lists/wireshark-dev/201311/msg00069.html

svn path=/trunk/; revision=53150
2013-11-07 23:20:06 +00:00
Jakub Zawadzki ce6ca9a05d Add infrastructure for section-initializing protocol hfis (without array).
configure implementation later.

svn path=/trunk/; revision=53146
2013-11-07 20:14:18 +00:00
Evan Huus 8a0ef07000 Effectively remove the tree memory pool and port some of its behaviour to the
pinfo memory pool, they have exactly the same scope. Simplification and minor
performance win (one GHashTable we longer have to create/destroy on every
packet).

svn path=/trunk/; revision=53076
2013-11-04 14:12:59 +00:00
Jakub Zawadzki bad81b517f Reintroduce back epan_dissect_reset(), proto_tree_reset()
This time it makes more sense, cause for each dissection we need two wmem allocators.
Reseting wmem allocator is much faster than destroy & create.

svn path=/trunk/; revision=52706
2013-10-20 10:21:25 +00:00
Evan Huus c2b2d204db Redo r52569 in a way that doesn't break the GUI. Add a mem_pool member to
tree_data and reference it directly when allocating/freeing tree items. This
lets us keep multiple around when we need them, and still lets us use
wmem_free_all for a major speedup. It also, coincidentally, lets us get rid of
the annoying fi_tmp hack that was needed before, since that element gets swept
up in the free_all with everything else.

Keep one pool cached to avoid creating/destroying a pool for each packet,
another minor performance win.

The various changes in approach seem to balance out pretty much exactly, this
still gives ~11% over pre-52569.

svn path=/trunk/; revision=52573
2013-10-12 21:01:17 +00:00
Michael Mann a891f3e70b Make expert items used in "low level" proto functions filterable (and ensure they are called even with a NULL tree). I don't really like the Type Length Mismatch "protocol", but it doesn't seem that much different than the exception "protocols".
svn path=/trunk/; revision=52341
2013-10-03 01:54:02 +00:00
Jörg Mayer 1e762e315d Remove epan.h from ftypes.h, address.h and tpg.h,
add it to proto.h as it contains macros that require emem.h

svn path=/trunk/; revision=52001
2013-09-13 09:13:09 +00:00
Guy Harris 8d8c56d3e4 Note what the various ENC_TIME_ encodings are.
svn path=/trunk/; revision=51980
2013-09-12 20:30:55 +00:00
Evan Huus f8693e35e0 From RobiOneKenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9072
Add support for Time-of-Day timestamp format from z/OS.

svn path=/trunk/; revision=51974
2013-09-12 16:56:37 +00:00
Jakub Zawadzki 401cdb009e Convert more dissectors to use hfinfo instead of hfindex.
svn path=/trunk/; revision=51478
2013-08-22 20:54:50 +00:00
Jakub Zawadzki 4e870dd240 Fix few concept of new api tree:
- (for now) keep ABI, restore prototype of old proto_tree_add_item, add new proto_tree_add_item_new
- add few helpers for boolean, time, string which will do ->id
- don't use HFI_INIT directly, use it by another macro (MSVC has very small limit for section name)

svn path=/trunk/; revision=51401
2013-08-17 07:16:12 +00:00
Jakub Zawadzki 9d79b3233a Introduce new proto_tree API required for hf_ variables removal.
svn path=/trunk/; revision=51396
2013-08-16 21:21:52 +00:00
Alexis La Goutte c47aad79dd Fix (-W)documentation error found by Clang
In file included from ../../epan/packet.h:29:
./../proto.h:1775:16: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 @param protocol
 ~~~~~~~~~~~~~~^
./../proto.h:1947:13: error: empty paragraph passed to '@param' command [-Werror,-Wdocumentation]
 @param flags
 ~~~~~~~~~~~^

svn path=/trunk/; revision=51255
2013-08-10 21:28:10 +00:00
Jakub Zawadzki 9cfac1227d Replace hfinfo pointer to same_name_prev, with same_name_prev_id.
svn path=/trunk/; revision=51175
2013-08-06 20:53:47 +00:00
Jakub Zawadzki 72ea2f9c9c Remove hfinfo->bitshift member, add hfinfo_bitshift() to get it.
svn path=/trunk/; revision=51174
2013-08-06 20:10:59 +00:00
Michael Mann 81f3faf1e8 Completely remove support for proto_item_set_expert_flags.
svn path=/trunk/; revision=51144
2013-08-05 02:25:45 +00:00
Jakub Zawadzki 3f9b7e36e9 Reorder field_info structure to remove paddings on 64 bits (8B less).
svn path=/trunk/; revision=51039
2013-07-30 21:09:03 +00:00
Evan Huus 6e3a30794e Add 64-bit value strings and the appropriate tooling (including yet another
overloaded use of the DISPLAY field). Thanks to Jakub for pointing out I'd done
this wrong the first time (months ago in r49357).

Fixes severity display for collectd protocol, originally filed at:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8472

svn path=/trunk/; revision=50935
2013-07-26 21:51:39 +00:00
Jeff Morriss 33cf749c19 Fix up some indentation.
svn path=/trunk/; revision=50697
2013-07-17 14:01:47 +00:00
Jakub Zawadzki 792f35a28c Make tree_is_expanded array static, add setter/getter function.
svn path=/trunk/; revision=50433
2013-07-07 16:33:49 +00:00
Jeff Morriss a441793cba Move a couple of time-related modules into wsutil.
A bunch of files didn't really need to include these header files so remove
the include line rather than changing it.

svn path=/trunk/; revision=50154
2013-06-25 22:02:20 +00:00
Gerald Combs d14fa4914d Add Doxygen boilerplate for some of our core modules and data structures.
svn path=/trunk/; revision=49640
2013-05-30 22:20:21 +00:00
Evan Huus c0c0b10f96 A few more doxygen fix-ups.
svn path=/trunk/; revision=49092
2013-04-30 00:55:03 +00:00
Evan Huus 63ef04ec84 Fix a whole bunch of doxygen warnings, mostly typos or renamed parameters.
svn path=/trunk/; revision=49053
2013-04-26 18:28:21 +00:00
Chris Maynard 4ac2441d7c Coalesce "-G fields2" and "-G fields3" into "-G fields", as discussed on -dev.
See: http://www.wireshark.org/lists/wireshark-dev/201304/msg00015.html

svn path=/trunk/; revision=48753
2013-04-05 21:58:43 +00:00
Evan Huus 8569907b9f From Steve Magnani via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8339
This patch adds a new public API, proto_tree_add_bitmask_len(), identical to
proto_tree_add_bitmask() but using a caller-supplied length rather than an
inferred one. The underlying proto_item_add_bitmask_tree() code is modified
to display only fields for which all defined bits are available, and to
ignore bits that have no corresponding defined field ("forward compatibility"
cases).

From me: minor edits, see the bug for more details.

svn path=/trunk/; revision=48049
2013-03-04 14:18:18 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Bill Meier 24eff41b08 it's ==> its & its ==> it's as needed.
svn path=/trunk/; revision=47896
2013-02-26 02:19:57 +00:00
Bill Meier cfff564398 Add 'proto_registrar_get_id_byname()' accessor.
svn path=/trunk/; revision=47540
2013-02-07 22:04:02 +00:00
Jakub Zawadzki bdcdec560c Manually revert r45669
svn path=/trunk/; revision=45884
2012-11-03 20:51:19 +00:00
Guy Harris 7044125704 Uniformly use spaces, not tabs, for the PI_ list (one had spaces, one
had 4-space tabs, and the others had 8-space tabs).

svn path=/trunk/; revision=45745
2012-10-24 00:04:17 +00:00
Jakub Zawadzki 6dc977b7d2 - Allow reseting edt with new function epan_dissect_reset(),
- initialize edt once in few places, and later reset it after dissecting
  (add_packet_to_packet_list),
- revert r45667, probably no longer needed.

svn path=/trunk/; revision=45669
2012-10-20 16:44:55 +00:00
Jakub Zawadzki 1db996e051 MT: move global field_info_tmp to tree_data_t
svn path=/trunk/; revision=44747
2012-09-03 12:00:08 +00:00
Gerald Combs cd3cca7edc Make the corresponding packet_info available to each tree item. This
lets us pass a NULL pinfo to expert_add_info_format() and
expert_add_undecoded_item(), which makes it possible to use those
routines deep in the bowels of many dissectors. As a proof of concept
remove the recent pinfo additions to packet-afp.c. This should also make
it easier to fix bug 3884.

svn path=/trunk/; revision=44435
2012-08-10 20:33:01 +00:00
Guy Harris 835111692f From Richard Stearn: support for AX.25, including support for
LINKTYPE_AX25.

svn path=/trunk/; revision=44211
2012-08-02 16:54:43 +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
Jakub Zawadzki 85aad38347 Add proto_tree_add_unicode_string() to add UTF-8 string to tree.
Convert some proto_tree_add_string_format_value(..., val, "%s", val); to use new function.

svn path=/trunk/; revision=43363
2012-06-19 14:32:24 +00:00
Guy Harris 14b616c35d Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls.

Add new "add_packet_field" method to the TreeItem class, taking a
protocol field (*not* a protocol), TvbRange, and encoding value as
arguments.

Add the ENC_ values to init.lua.  Make them all hex #defines so
make-init-lua.pl can easily extract them.

Export tvb_unicode_strsize() for use by Lua (and elsewhere as desired). 
Note that it handles UTF-16 and UTF-8, and fix the comment to note that
its count of hexadectets *does* include the null terminator (that's what
the code does).

svn path=/trunk/; revision=42621
2012-05-14 00:49:05 +00:00
Guy Harris 7a87d7b6a3 Add ENC_UTF_16 and ENC_UCS_2. Note that UTF-16 and UCS-2 are not the
same, and that the routines to get "Unicode" strings are really doing
UCS-2 (and not doing anything about code values that aren't valid in
UCS-2 strings).

Have tvb_get_ephemeral_string_enc() separate cases for ASCII and UTF-8,
even though they're *currently* treated the same.

For FT_UINT_STRING, treat an encoding value of TRUE as meaning
"little-endian ASCII"; pass all other encodings through to
tvb_get_ephemeral_string_enc().

svn path=/trunk/; revision=42592
2012-05-11 23:55:54 +00:00
Guy Harris f1b11f62f8 proto_registrar_get_ftype() returns an FT_ value; make its return type
"enum ftenum" to reflect that, and fix the "switch doesn't handle XXX"
warnings that provokes.

svn path=/trunk/; revision=42579
2012-05-11 17:29:56 +00:00
Anders Broman 0cea399fda From Jakub Zawadzki: Use custom model in Filter Expression dialog.
svn path=/trunk/; revision=42411
2012-05-04 04:44:23 +00:00
Anders Broman 82a60c13d0 From Evan Huus: Add DISSECTOR_ASSERT_HINT() macro https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7142
svn path=/trunk/; revision=42137
2012-04-19 05:44:50 +00:00
Gerald Combs 8b3024e57c Make bit_offset in _tvb_get_bits64 and related functions unsigned. This
removes a potential buffer overflow and should fix a bunch of Coverity
errors mentioned in bug 6878.

We might want to do the same for no_of_bits.

svn path=/trunk/; revision=41945
2012-04-04 21:54:22 +00:00
Anders Broman ff47bdf96c Use the expert system to show packet comments.
The packet comment widget should be replaced by a ListView with two columns,  packet no and Comment.

svn path=/trunk/; revision=41322
2012-03-02 13:31:16 +00:00
Anders Broman b28516dc00 From Mike Morrin: A small patch to correct the name of the function proto_tree_add_split_bits_item_ret_val()
svn path=/trunk/; revision=41255
2012-03-01 07:01:15 +00:00
Anders Broman 597047d253 From Mike Morrin:
The attached patches add the ability to dissect split bit-strings as discussed under bug 6797.
proto_tree_add_split_bits_ret_val()
proto_tree_add_split_bits_crumb()

svn path=/trunk/; revision=41246
2012-02-29 17:13:43 +00:00
Gerald Combs 3c1b8a6ca1 Add a "-G ftypes" option, which dumps our supprted FT_… names and
descriptions. Captitalize and fix up the descriptions. Use its output to
create the field type list in the wireshark-filter man page.

svn path=/trunk/; revision=40306
2011-12-27 20:35:41 +00:00
Bill Meier eeaf3993ad (Trivial) remove an extra blank line.
svn path=/trunk/; revision=39909
2011-11-17 17:36:29 +00:00