aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
AgeCommit message (Collapse)AuthorFilesLines
2015-05-24proto.h: fix clang++ 3.6 warningLuke Mewburn1-4/+4
Add spaces around literals to avoid warnings when compiling ui/qt with clang++ 3.6 -Wreserved-user-defined-literal (on Mac OS X). Change-Id: Ia2703dd8c914e8ffb299c4a6c44bba3aa674acb8 Reviewed-on: https://code.wireshark.org/review/8607 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>
2015-04-29- Mark some DCE/RPC functions as public do allow calls from pluginsMicha Reiser1-1/+1
- DCOM: * Mark some DCOM functions as public do allow calls from plugins * Add Support for Additional Variant Types Money, I8, UI8 * Fix an uint32 overflow when dissecting nwstringz0 where the length is 0 * Use WS_DLL_PUBLIC instead of WS_DLL_PUBLIC_DEF Change-Id: I02861a09203c6b42326f5a7b7e652e0f7c26d369 Reviewed-on: https://code.wireshark.org/review/8222 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-29proto.h: fix api referenceAlexis La Goutte1-1/+4
argument 'expression' of command @param is not found in the argument list of __DISSECTOR_ASSERT_STRINGIFY(s) The following parameters of __DISSECTOR_ASSERT_STRINGIFY(s) are not documented: parameter 's' The following parameters of __DISSECTOR_ASSERT_CMPINT(a, op, b, type, fmt) are not documented: parameter 'type', fmt The following parameters of proto_tree_add_bitmask_list(proto_tree *tree, tvbuff_t *tvb, const guint offset, const int len, const int **fields, const guint encoding) are not documented: parameter 'len' Change-Id: I6adc34e66f45cdba63c34e87db762b39a281d127 Reviewed-on: https://code.wireshark.org/review/8230 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-22Add VALS_EXT_PTR to decorate pointers to value_string_ext's in hfinfo.Jeff Morriss1-0/+3
This allows checkAPIs to continue checking the 'convert' field for correctness when dissectors use value_string_ext_new() to build their value_string_ext's (without resorting to tricks like getting the address of the dereferenced pointer). This will be used to resolve the checkAPIs failure in patch set 3 of Ia5c96b1f6f1fe3a9521b3d70142889e3881fae5e . Change-Id: I700d86b9076f077706d34000f5a6aa5c96351f69 Reviewed-on: https://code.wireshark.org/review/8162 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-18proto(.h): fix '@return' command used in a comment that is attached to a ↵Alexis La Goutte1-1/+1
function returning void [-Wdocumentation] Change-Id: Ice88ddf2d35293f23be2d5a61a6ae77ed540f886 Reviewed-on: https://code.wireshark.org/review/8107 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-13Add more "bitmask grouping" APIs.Michael Mann1-0/+70
Add proto_tree_add_bitmask_value, proto_tree_add_bitmask_value_with_flags and proto_tree_add_bitmask_list to aid in the removal of proto_tree_add_boolean "groupings" as well as "groups" of fields that use proto_tree_add_item with the same offset/len. This may be able to be optimized later, but the first step will be converting dissectors to use it. A sample conversion of each API is also included. Change-Id: I53febc7450ad632482f82615a7fa62174f8472c9 Reviewed-on: https://code.wireshark.org/review/8038 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>
2015-03-21Proto.h: fix parameter 'err' not found in the function declaration ↵Alexis La Goutte1-1/+0
[-Wdocumentation] Change-Id: Ibca63a9119b9c45e6a24fe3dc14dc7ed86c3576a Reviewed-on: https://code.wireshark.org/review/7774 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-03-19Implement proto_tree_add_item_ret_int() and proto_tree_add_item_ret_uint() whichAndersBroman1-0/+37
works as proto_tree_add_item(), but also returns the value of (u)ints of 8,16,24 and 32 bits length in a 32 bit variable. It's based on Hadriels previous work. Change-Id: If3b4b8588b63251f1ee9b954a202acde7c02ce86 Reviewed-on: https://code.wireshark.org/review/7230 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>
2015-03-10Change a lot of http:// URLs to https://.Gerald Combs1-1/+1
Most of our sites are now HTTPS-only. Update URLs accordingly. Update other URLs while we're at it. Remove or comment out dead links. Change-Id: I7c4f323e6585d22760bb90bf28fc0faa6b893a33 Reviewed-on: https://code.wireshark.org/review/7621 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-09Proto.c: fix no previous prototype for ... [-Wmissing-prototypes]Alexis La Goutte1-0/+47
proto.c:8733:1: warning: no previous prototype for 'proto_tree_add_uint64_bits_format_value' [-Wmissing-prototypes] proto.c:8812:1: warning: no previous prototype for 'proto_tree_add_int64_bits_format_value' [-Wmissing-prototypes] proto.c:8861:1: warning: no previous prototype for 'proto_tree_add_boolean_bits_format_value64' [-Wmissing-prototypes] Change-Id: Ic40ca6f32739b415a423fc978e8677d669a95867 Reviewed-on: https://code.wireshark.org/review/7509 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-05Qt: Add extra related packet indicator types.Gerald Combs1-0/+3
Add the ability to set frame number types: none, request, or response. Use the types to draw different related packet indicators in the packet list. Track the conversation in PacketListRecord. Use it to draw dashed lines for unrelated frames. Set frame number types for DNS and ICMP. Instead of drawing a transparent QImage, alpha blend our foreground color and draw directly in our painter. Blend more toward the foreground color. Add FRAMENUM_TYPE to checkAPIs. Change-Id: I2495945bb436413e05d6ec697184a0b4fd5ad214 Reviewed-on: https://code.wireshark.org/review/7436 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-21Make FT_{U}INT64 behave more like FT_{U}INT32, add support for ↵JC Wren1-0/+3
FT_{U}INT{40,48,56} Change-Id: I57354c309ecf3a0c8f0c7cff485638027f30bb19 Reviewed-on: https://code.wireshark.org/review/5813 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-18Add a CF_FUNC macro for casting BASE_CUSTOM functions.Gerald Combs1-0/+8
Add a CF_FUNC macro to match VALS, TFS, etc. This should help us to avoid the following warning: warning: ISO C forbids initialization between function pointer and 'void *' [-Wpedantic] We could start adding DIAG_OFF+DIAG_ON everywhere but this seems to be more consistent with the other macros in proto.h. Update each instance of BASE_CUSTOM to use CF_FUNC. Adjust a dummy variable name generated by asn2wrs.py that was triggering an invalid error in checkhf.pl. Fix an encoding arguement in packet-elasticsearch.c found by fix-encoding-args.pl. Change-Id: Id0e75076c2d71736639d486f47b87bab84e07d22 Reviewed-on: https://code.wireshark.org/review/7150 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-16proto(.h): fix parameter 'offset' not found in the function declaration ↵Alexis La Goutte1-1/+0
[-Wdocumentation] Change-Id: Ib79831e02a9a6457ca49c21536ce46df7d4cafa0 Reviewed-on: https://code.wireshark.org/review/7133 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-14Don't check for C89 headers.Guy Harris1-5/+1
1988 called, they want their lack of a C standard back. We don't need to check whether we have stdarg.h, stddef.h, stdlib.h, or string.h, as they're specified by C89 and I don't think there are any platforms we care about that don't have a C89 environment in which we could be built. Change-Id: I447551181284fab7722354b62774625ed8ee94bc Reviewed-on: https://code.wireshark.org/review/7110 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>
2015-02-12Support for looking for incomplete dissectors.Dario Lombardo1-0/+8
Change-Id: I03e592dd3d54fc0e1c4af09d5d5336dda93f950e Reviewed-on: https://code.wireshark.org/review/6978 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-12Little tuning of proto_tree_add_bytes_with_lengthMichal Labedzki1-2/+3
Change name from proto_tree_add_new_bytes to proto_tree_add_bytes_with_length and other tweaks pointed by Peter Wu. Change-Id: I6058c28a74a154e2882e4eb04558bedcede6f508 Reviewed-on: https://code.wireshark.org/review/7039 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-07Add proto_tree_add_new_bytes()Michal Labedzki1-0/+13
Version to add as generated field, without tvb offset, length. Change-Id: If4c7aebcbf1b47faa483bcbd40995eff3ccb99f0 Reviewed-on: https://code.wireshark.org/review/6906 Tested-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-01-18Remove a couple more apparently-no-longer-necessary emem.h includes.Guy Harris1-1/+0
Change-Id: I007a904613653b60a5b1a4fdc8261bc1480e41c6 Reviewed-on: https://code.wireshark.org/review/6637 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18replace DISSECTOR_ASSERT ep strings with wmemEvan Huus1-16/+24
the DISSECTOR_ASSERT macro and friends are all guaranteed to be called within the scope of a dissection, so they are safe to replace with wmem_packet_scope. Change-Id: I2684fb902da78d50aca5f4644df66c060caff625 Reviewed-on: https://code.wireshark.org/review/6629 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-17Convert proto_construct_match_selected_string to use wmem.Michael Mann1-1/+1
Change-Id: I7a40c0996517aa71b4ddb764ce3a6e92a55260ad Reviewed-on: https://code.wireshark.org/review/6589 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-11Rename the FT_BYTES separator types to SEP_ from BASE_.Guy Harris1-4/+4
There's no requirement for "display" field values to have names beginning with BASE_; use SEP_, to indicate that they're separators. (And, yes, we should introduce SEP_NONE, with a value of 0, and use it.) While we're at it, fix BASE_SEMICOLON - the separator is a colon, not a semicolon - and document SEP_SPACE in doc/README.dissector. Change-Id: I856aafda2c60b8320dffe287f0deb06a9604a2bf Reviewed-on: https://code.wireshark.org/review/6486 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-10Add BASE_SPACE for FT_BYTESMichael Mann1-1/+2
It's just like BASE_DOT, BASE_DASH and BASE_SEMICOLON, only its a space between bytes. Since this seems pretty specific to FT_BYTES, perhaps there is a better was to represent the functionality (like FT_BOOLEAN uses numeric values for number of bits)? Change-Id: I1a8f1ab263ece2736a8012b66fdd6a9105db7282 Reviewed-on: https://code.wireshark.org/review/6451 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-09Some more random removal of ep_ memory.Michael Mann1-1/+1
Change-Id: I6eccd20280e907bd9e6a5fcf873ccf80afddecac Reviewed-on: https://code.wireshark.org/review/6416 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-09Remove proto_tree_add_ax25Michael Mann1-12/+0
There isn't a legitimate use for the API, all cases can be covered with proto_tree_add_item. As a bonus, a few more tvb_get_ptr calls can be removed. Change-Id: I3bb86ba8f05ef3363407bcfe9b059ee27ebc135d Reviewed-on: https://code.wireshark.org/review/6429 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-04Get rid of warning: comma at end of enumerator list [-Wpedantic]Pascal Quantin1-3/+3
Change-Id: I8faca065e1afff6d4d29b9b96c1b0f0b135163a7 Reviewed-on: https://code.wireshark.org/review/6306 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-04Create BASE_DOT, BASE_DASH, and BASE_SEMICOLON types for the FT_BYTES field ↵Michael Mann1-1/+6
type. These "bases" will put a ".", "-", or ":" respectively between hexidecimal bytes in the field in packet view and display filter. FT_BYTES with BASE_NONE will have no separator in the packet view, but continue to have the ':' as a separator in the display filter. Converted the "string" hf_ entries that used tvb_fc_to_str as a string to use proto_tree_add_item with FT_BYTES/BASE_DOT type. Converted applicable tvb_bytes_to_ep_str_punct() calls to use the new BASE values. Change-Id: I2442185bb314d04a3ff2ba57883652ecd738b5f9 Reviewed-on: https://code.wireshark.org/review/6098 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-22Improve the message for "this field has an integral type" assertions.Guy Harris1-0/+9
(Along the lines of provious changes.) Change-Id: I22d76f22400d4a93242392ff4688acc753eb0039 Reviewed-on: https://code.wireshark.org/review/5961 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-21Improve the message for "this field doesn't have the right type" assertions.Guy Harris1-0/+43
Give the field name in the message. Change-Id: I046c74b451b473c9c87c2980122b025390f82cc8 Reviewed-on: https://code.wireshark.org/review/5959 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-21Move another helper macro.Guy Harris1-5/+5
Change-Id: Id3801373526af57146a87abe9698b192074a0fa0 Reviewed-on: https://code.wireshark.org/review/5958 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-21Define helper macros before they're used.Guy Harris1-12/+12
The code works if they're defined afterwards, but defining them earlier makes it a bit clearer that they're helper macros used as components of the macros we're exporting. Change-Id: I326894eea67d2db43fedf4567699cd9eaaa0e004 Reviewed-on: https://code.wireshark.org/review/5956 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-18Add support for multifields in custom columnMichal Labedzki1-1/+1
You can now add column with Custom type with more than one field by using OR "||" splitter. Bug: 9695 Change-Id: Ia82a91e7a35b867647d36cb9626e3870f46c0d85 Reviewed-on: https://code.wireshark.org/review/5804 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-12-10Refactor "color" conversation filtersMichael Mann1-0/+6
Have dissectors register their desire to be part of "color" conversation filters and have the GUI use that registered list. GUI actually using API will come in a separate commit. Change-Id: I5ffe922d97894fe7bf3182056b76ab5839a9461a Reviewed-on: https://code.wireshark.org/review/5658 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-08Add proto_tree_add_bitmask_with_flags.Michael Mann1-0/+26
It's proto_tree_add_bitmask with the ability to control the data appended to header. Change-Id: Icce97437ba7cfc9158ec204a837da8db8138424a Reviewed-on: https://code.wireshark.org/review/5533 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-10Improved deregistering fields.Stig Bjørlykke1-5/+10
This improvement avoids use of deallocated memory (crash) if using a deregistered field in display filter, color filter, custom column and other cases when the field is used as "interesting field". This functionality is currently used in http, imf and ldap preferences. Also removed unused proto_registrar_n() as this does not work correctly after deregistering fields. Change-Id: I043e3bf7a98bd773c9801e712a012d1eab8a7f94 Reviewed-on: https://code.wireshark.org/review/5161 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-11-02new function proto_tree_get_parent_tree()Martin Kaiser1-0/+5
it returns the parent tree of a given tree object Change-Id: I191e0221651ffb5b26df761e9a25075aa0eb2ad3 Reviewed-on: https://code.wireshark.org/review/4954 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-10-12Make boolean bitmask type 64-bit wideDaniel Mack1-1/+1
There are protocols out there that have 64-bit wide bit mask fields, so make the internal representation and bitfield decoders 64-bit aware. For this, the ws_ctz() fallback and bits_count_ones() have to be tweaked slightly. Change-Id: I19237b954a69c9e6c55864f281993c1e8731a233 Reviewed-on: https://code.wireshark.org/review/4158 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-20proto.h; (try to) fix bug in DISSECTOR_ASSERT_CMP... macros;Bill Meier1-3/+3
Also: re-enable use of DISSECTOR_ASSERT_CMP... macros in packet-ceph.c Change-Id: Icee80381f5c8feb14cfc7e4033bdeb893018ce95 Reviewed-on: https://code.wireshark.org/review/3749 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-19"Highly discourage" use of proto_tree_add_text.Michael Mann1-2/+2
Change-Id: I2e8d18df71688c654f7acaff51fae7823c08aa6a Reviewed-on: https://code.wireshark.org/review/3677 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: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-10Eliminate proto_tree_add_text from some dissectors.Michael Mann1-0/+4
Other minor cleanup while in the neighborhood. Change-Id: Ib76f4a9f89b5933425760af0a980c6a549031b8f Reviewed-on: https://code.wireshark.org/review/3537 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-26Refactor "common" Conversation table functionality.Michael Mann1-0/+5
Refactor (non-GUI) conversation table functionality from gtk/Qt to epan. Also refactor "common GUI" conversation table functionality. The idea is to not have to modify the GUI when a dissector adds a new "conversation type" Change-Id: I11f08d0d7edd631218663ba4b902c4a4c849acda Reviewed-on: https://code.wireshark.org/review/3113 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-23Fix (-W)documentation error found by ClangAlexis La Goutte1-4/+2
Change-Id: I2d2bbc211e98ad24a27c855031f670b7bdbd530e Reviewed-on: https://code.wireshark.org/review/3162 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-07-18Add better assertions for comparing integers.Kevin Cox1-0/+45
Adds DISSECTOR_ASSERT_CMPINT() family of assertions which show the value of each side of the comparison upon failure. Change-Id: Ie6f2ba46d62fc864c08eb432c403fab8f1932d91 Reviewed-on: https://code.wireshark.org/review/3103 Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-10convert to proto_tree_add_subtree[_format] for plugin dissectorsMichael Mann1-2/+2
Change-Id: I13924c5a2f056688a42cdee25654d82c056b5f97 Reviewed-on: https://code.wireshark.org/review/2974 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-06Add printf-format annotations, fix garbagePeter Wu1-1/+2
The WRETH dissector showed up some garbage in the column display. Upon further inspection, it turns out that the format string had a trailing percent sign which caused (unsigned)-1 to be returned by g_printf_string_upper_bound (in emem_strdup_vprintf). Then ep_alloc is called with (unsigned)-1 + 1 = 0 memory, no wonder that garbage shows up. ASAN could not even catch this error because EP is in charge of this. So, start adding G_GNUC_PRINTF annotations in each header that uses the "fmt" or "format" paramters (grepped + awk). This revealed some other errors. The NCP2222 dissector was missing a format string (not a security vuln though). Many dissectors used val_to_str with a constant (but empty) string, these have been replaced by val_to_str_const. ASN.1 dissectors were regenerated for this. Minor: the mate plugin used "%X" instead of "%p" for a pointer type. The ncp2222 dissector and wimax plugin gained modelines. Change-Id: I7f3f6a3136116f9b251719830a39a7b21646f622 Reviewed-on: https://code.wireshark.org/review/2881 Reviewed-by: Evan Huus <eapache@gmail.com>
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>