aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
AgeCommit message (Collapse)AuthorFilesLines
2014-06-20fix printf argument indexEvan Huus1-2/+1
Change-Id: I56aae95d61930c74ac9962225e1bcda72079595e Reviewed-on: https://code.wireshark.org/review/2477 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-20Add proto_tree_add_subtree and proto_tree_add_subtree_formatMichael Mann1-0/+29
This is intended as a replacement for all of the proto_tree_add_text followed by proto_item_add_subtree calls. Change-Id: I892136d7b9d8b4e100996097eff62ce7af9512d2 Reviewed-on: https://code.wireshark.org/review/2472 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-19Add new proto_tree_add_format_text() functionJakub Zawadzki1-0/+4
There are lot of text dissectors which want just to add escaped (not filtrable) text, add new function proto_tree_add_format_text() which just do this in optimized way. Change-Id: Ia0e189b620cc0a5b74cfdaef1ad4571d766bb2ab Reviewed-on: https://code.wireshark.org/review/1678 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-21Replace linked list of proto fields with arrayEvan Huus1-2/+2
This is substantially more memory-efficient, shaving another ~1.5MB off our base usage. It also lets us remove the annoying extra "last_field" pointer and simplify proto_register_field_common(). It also accidentally fixed what may have been a memory leak in proto_unregister_field(). It unfortunately complicates proto_get_next_protocol_field() to require refetching the protocol each time, but that is itself just an array-lookup under the covers (and isn't much used), so I don't expect the performance hit to be noticable. Change-Id: I8e1006b2326d6563fc3b710b827cc99b54440df1 Reviewed-on: https://code.wireshark.org/review/1225 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-17Add tvb_get and proto_tree_add for string-encoded byte arraysHadriel Kaplan1-0/+54
This commit adds tvb_get_string_bytes and proto_tree_add_bytes_item routines for getting GByteArrays fields from the tvb when they are encoded in ASCII hex string form. The proto_tree_add_bytes_item routine is also usable for normal binary encoded byte arrays, and has the advantage of retrieving the array values even if there's no proto tree. It also exposes the routines to Lua, both so that a Lua script can take advantage of this, but also so I can write a testsuite to test the functions. Change-Id: I112a038653df6482a5d0ebe7c95708f207319e20 Reviewed-on: https://code.wireshark.org/review/1158 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-14Fix warning when generate documentation (doxygen)Alexis La Goutte1-1/+1
build/epan/proto.h:384: warning: Found unknown command `\uXXXX' Change-Id: Ic42730e49ba9b956090269a3b80ffd7a87da33d3 Reviewed-on: https://code.wireshark.org/review/1133 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-14Add tvb_get and proto_tree_add for string-encoded timestampsHadriel Kaplan1-0/+63
This commit adds tvb_get_string_time and proto_tree_add_time_item routines for getting nstime fields from the tvb when they are encoded in ASCII string form. The proto_tree_add_time_item routine is also usable for normal big/little-endian encoded time_t, and has the advantage of retrieving the value even if there's no proto tree. It also exposes the routines to Lua, both so that a Lua script can take advantage of this, but also so I can write a testsuite to test the functions. Change-Id: I955da10f68f2680e3da3a5be5ad8fdce7ed6808c Reviewed-on: https://code.wireshark.org/review/1084 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-13Add ENC_ASCII_7BITS encodingPascal Quantin1-1/+12
Change-Id: I01ec87ff4181afb5b2de487fd5f5200f8d62f17d Reviewed-on: https://code.wireshark.org/review/1088 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-12Get rid of more tvb_get_nstringz* calls.Guy Harris1-6/+7
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-12Add Mac Roman and DOS CP437.Guy Harris1-0/+2
Change-Id: Ib96f2cf4ea71cd0cc2c703d58b9d254bf4c1248a Reviewed-on: https://code.wireshark.org/review/1077 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-07Add a Qt I/O Graph dialog.Gerald Combs1-1/+1
For each graph you can set: - Its visibility - A name - A display filter - Color, from a fixed list - Plot style: Line, Impulse, Bar, Stacked Bar, Dot, Square, Diamond - Basic Y Axes (packets/s, bytes/s, bits/s) - Computed Y Axes (SUM, MIN, AVG, MAX) - Smoothing You can pan and zoom using the mouse and keyboard. Clicking on a graph selects the last packet for that interval. If all graphs have the same Y axis a single label is shown, otherwise a legend is shown. The time scale (X axis) can be toggled between relative seconds and the time of day. Graphs can be saved as PDF, PNG, BMP, and JPEG. Settings are "sticky" via the io_graphs UAT. To do: - Minimize graph drawing delays. - Figure out why smoothing differs from GTK+ - Everything else at the top of io_graph_dialog.cpp - Fix empty resets. A fair amount of code was copied from TCPStreamDialog. We might want to subclass QCustomPlot and place the shared code there. Move common syntax checking to SyntaxLineEdit. Move some common code from ui/gtk/io_stat.c to ui/io_graph_item.[ch] and use it in both GTK+ and Qt. Make the io_graph_item_t array allocation in io_stat.c static. The behavior should be identical and this gives us additional compile-time checks. Change-Id: I9a3d544469b7048f0761fdbf7bcf20f44ae76577 Reviewed-on: https://code.wireshark.org/review/435 Reviewed-by: Gerald Combs <gerald@wireshark.org> Tested-by: Gerald Combs <gerald@wireshark.org>
2014-04-02redefine proto_tree_add_float_format_value() if we're using the newMartin Kaiser1-0/+5
proto tree api, similar to other proto_tree_add_...() functions Change-Id: Iaef0711b8221a7bbb24f1004c81a1438f5674e42 Reviewed-on: https://code.wireshark.org/review/926 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-26Add filterable expert info for LuaHadriel Kaplan1-12/+14
This adds the ability for a Lua script to register expert info fields, similar to C-code dissectors. This change also removes the need for the expert_add_info_format_internal() function. Existing Lua scripts do not have to change, because the existing expert info function uses the internal "_ws.lua" protocol instead of nothing; but using the new functionality provides more benefits since it correctly registers the expert info fields to the dissector's protocol. The test suite was amended to generate both old and new forms. Change-Id: Ib5ae74e927cfa81312baf7b04ff4104b0b4f936e Reviewed-on: https://code.wireshark.org/review/830 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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-02-25Remove trailing whitespaceBill Meier1-1/+1
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-04USB: Fix Linux header byte-orderMichal Labedzki1-3/+10
Linux USB Header should be in Host Endian. Also add ENC_HOST_ENDIAN to simplify code. Change-Id: I95e7d97014633e8fc1d7739d0728780d70c60442 Reviewed-on: https://code.wireshark.org/review/15 Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Evan Huus <eapache@gmail.com>
2014-02-03Fix all -fstrict-alias warnings found by gcc 4.1.2Gilbert Ramirez1-1/+4
The majority of the fixes are for calls to uat_new(). Instead of having each caller cast its private data to (void**), we use void* in the uat_new() API itself. Inside uat_new(), we cast the void* to void**. Some dissectors use val64_string arrays, so a VALS64() macro was added for those, to avoid using VALS(), which is useful only for value_string arrays. packet-mq.c was changed because dissect_nt_sid() requires a char**, not a guint**. All other callers of dissect_nt_sid() use char*'s (and take the address of it) for their local storage. So, this was changed to follow the other practices. A confusion between gint and absolute_time_display_e in packet-time.c was cleared up. The ugliest fix is the addition of ip6_guint8_to_str(), for exactly one caller. The caller uses one type of ip6 address byte array, while ip6_to_str() expects another. This new function is in place until the various address implementations can be consolidated. Add VALS64() to the developer documentation. Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805 Reviewed-on: https://code.wireshark.org/review/48 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-01-19As spotted by Joerg; make a HFILL_INIT(hf) macro and use it to init the ↵Anders Broman1-5/+12
private part of the hf structure. svn path=/trunk/; revision=54843
2014-01-15Eliminate fvalue_set() in favor of routines that take argumentsGuy Harris1-3/+3
appropriate for particular FT_ types. This lets us do some more type checking and lets us use const pointers when appropriate. Constify a bunch of stuff, and don't cast away constness. svn path=/trunk/; revision=54811
2014-01-06Try to fix warning: initializer element is not computable at load time.Anders Broman1-1/+1
svn path=/trunk/; revision=54616
2014-01-01Add proto_tree_add_ts_23_038_7bits_item() / tvb_get_ts_23_038_7bits_string() ↵Pascal Quantin1-30/+38
functions and update dissectors to use it. Remove gsm_sms_char_7bit_unpack() / gsm_sms_chars_to_utf8() functions. Update documentation a bit. svn path=/trunk/; revision=54534
2013-12-24add ssl detection to proto_get_frame_protocols()Martin Kaiser1-1/+4
svn path=/trunk/; revision=54439
2013-12-24Add a ENC_3GPP_TS_23_038 encoding, for the standard SMS alphabet in aGuy Harris1-8/+11
bit-packed string, and use it in some places. svn path=/trunk/; revision=54428
2013-12-22Add UCS-4 support, and use it.Guy Harris1-23/+19
Shuffle the character ENC_ values around a bit, keeping the Unicode encodings together, moving the Windows code pages (only one for now) after the ISO 8859 encodings, and putting "I can't believe it's not ASCII!" at the end. Fix some comment typoes, and update another comment, while we're at it. svn path=/trunk/; revision=54351
2013-12-21Add the rest of ISO-8859-n, thanks to Jakub's "generate a mapping table"Guy Harris1-1/+12
program. Put the character-encoding cases in order. svn path=/trunk/; revision=54344
2013-12-18Add charset table for ISO/IEC 8859-9 (ENC_ISO_8859_9)Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=54239
2013-12-15add support for ISO 8859-5Martin Kaiser1-0/+1
svn path=/trunk/; revision=54132
2013-12-10Remove config.h includes from proto.h and tap.h.Gerald Combs1-3/+1
svn path=/trunk/; revision=53913
2013-12-10Fix epan building with undefined HAVE_PLUGINSJakub Zawadzki1-0/+4
+ guard prototypes with HAVE_PLUGINS in .h files to get errors before linking. svn path=/trunk/; revision=53909
2013-12-08Remove proto_tree_add_unicode_string()Pascal Quantin1-4/+0
svn path=/trunk/; revision=53869
2013-12-08Expand a comment.Guy Harris1-1/+2
svn path=/trunk/; revision=53839
2013-12-08Add ENC_ISO_8859_1.Guy Harris1-3/+3
Move the Wikipedia links for the code page layouts in front of the tables whose contents reflect the code page layouts. svn path=/trunk/; revision=53837
2013-12-07Add string encoding for ISO/IEC 8859-2 (ENC_ISO_8859_2)Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53826
2013-12-07Add STR_ASCII, STR_UNICODE as possible displays for field_display_eJakub Zawadzki1-7/+13
svn path=/trunk/; revision=53822
2013-12-07Rename base_display_* to field_displayJakub Zawadzki1-7/+7
This is preparation to support ->display for FT_STRING values. svn path=/trunk/; revision=53820
2013-12-07Add new string proto encoding for windows-1250 (ENC_WINDOWS_1250)Jakub Zawadzki1-0/+1
- Move windows-1250 to unicode encoding table to charset.c - Add tvb_get_string_unichar2, tvb_get_stringz_unichar2 functions which recode tvb-string to UTF-8. svn path=/trunk/; revision=53819
2013-12-03Avoid including <epan/epan.h> in dissectors.Jakub Zawadzki1-3/+3
svn path=/trunk/; revision=53774
2013-12-02Move most of the plugin code from epan to wsutil and remove allGuy Harris1-0/+4
knowledge of particular types of plugins. Instead, let particular types of plugins register with the common plugin code, giving a name and a routine to recognize that type of plugin. In particular applications, only process the relevant plugin types. Add a Makefile.common to the codecs directory. svn path=/trunk/; revision=53710
2013-11-23Replace similar code with a common routine.Gerald Combs1-0/+13
svn path=/trunk/; revision=53519
2013-11-14Expand CHECK_DISPLAY_AS_X ('this macro looks like a hack') macro in ↵Jakub Zawadzki1-9/+0
packet-ieee80211.c, remove it. svn path=/trunk/; revision=53327
2013-11-10Move REPORT_DISSECTOR_BUG() body to proto_report_dissector_bug() function. ↵Jakub Zawadzki1-5/+4
Remove exceptions.h include from proto.h svn path=/trunk/; revision=53231
2013-11-10exceptions.h not needed by tvbuff.h (no much progress because it's needed by ↵Jakub Zawadzki1-0/+1
proto.h) svn path=/trunk/; revision=53219
2013-11-08Fix:Jörg Mayer1-1/+3
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-07GCC on amd64 align header_field_info variables to 16-bytes, this cause ↵Jakub Zawadzki1-1/+1
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-07Add infrastructure for section-initializing protocol hfis (without array).Jakub Zawadzki1-2/+17
configure implementation later. svn path=/trunk/; revision=53146
2013-11-04Effectively remove the tree memory pool and port some of its behaviour to theEvan Huus1-2/+1
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-10-20Reintroduce back epan_dissect_reset(), proto_tree_reset()Jakub Zawadzki1-0/+2
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-12Redo r52569 in a way that doesn't break the GUI. Add a mem_pool member toEvan Huus1-1/+5
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-03Make expert items used in "low level" proto functions filterable (and ensure ↵Michael Mann1-1/+4
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-09-13Remove epan.h from ftypes.h, address.h and tpg.h,Jörg Mayer1-0/+2
add it to proto.h as it contains macros that require emem.h svn path=/trunk/; revision=52001