aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
AgeCommit message (Collapse)AuthorFilesLines
2013-09-23The pointer into proto_tree_add_oid can be NULL if the length is 0. ExposedEvan Huus1-1/+1
because wmem_alloc(pool, 0) returns NULL (like pretty much every other malloc-style function) where ep_ or se_ alloc did not. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9175 svn path=/trunk/; revision=52187
2013-09-22More emem -> wmem conversion:Pascal Quantin1-4/+1
- tvb_get_g_stringz()/tvb_get_ephemeral_stringz()/tvb_get_seasonal_stringz() -> tvb_get_stringz() - tvb_get_g_stringz_enc()/tvb_get_ephemeral_stringz_enc() -> tvb_get_stringz_enc() - tvb_get_ephemeral_unicode_stringz() -> tvb_get_unicode_stringz() - tvb_bcd_dig_to_ep_str() -> tvb_bcd_dig_to_wmem_packet_str() - update docs accordingly svn path=/trunk/; revision=52180
2013-09-22emem -> wmem conversion:Pascal Quantin1-4/+7
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
2013-09-21Add _g_ to the names of functions that allocate glib memory. This is a bit moreEvan Huus1-1/+1
explicit, and frees up the "generic" names (like tvb_memdup) for new signatures that take the appropriate wmem pool. Majority of the conversion done with sed. svn path=/trunk/; revision=52164
2013-09-17Fix proto_registrar_dump_protocols() bug introduced by theBill Meier1-5/+5
implementation of BASE_VAL64_STRING value_strings. Fixes 'tshark -G values' crash. svn path=/trunk/; revision=52121
2013-09-12The secs field of an nstime_t is a time_t, so cast to that.Guy Harris1-2/+2
svn path=/trunk/; revision=51981
2013-09-12Make proto.c compile on my system (linux, 32 bit)Jörg Mayer1-2/+2
[-Werror,-Wshorten-64-to-32] time_stamp.secs = (todsecs / 1000000) - TOD_BASETIME; ~ ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ /home/jmayer/work/wireshark/svn/trunk/epan/proto.c:1613:44: error: implicit conversion loses integer precision: 'unsigned long long' to 'time_t' (aka 'long') [-Werror,-Wshorten-64-to-32] time_stamp.secs = (todsecs / 1000000) - TOD_BASETIME; ~ ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ svn path=/trunk/; revision=51978
2013-09-12Add casts to fix mac buildbots.Evan Huus1-2/+2
svn path=/trunk/; revision=51975
2013-09-12From RobiOneKenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9072Evan Huus1-0/+22
Add support for Time-of-Day timestamp format from z/OS. svn path=/trunk/; revision=51974
2013-09-08Couldn't quite figure out how to make the expert items in proto.c and the ↵Michael Mann1-2/+2
LUA API filterable (suggestions welcome!), but I wanted to start forcing dissectors to use the filterable expert API (nothing like compile errors to force change!). I created expert_add_info_format_internal (original expert_add_info_format) and used it as a placeholder for proto.c/LUA API until a solution is created. The "new" expert_add_info_format will be the "old" expert_add_info_format_text, and I'll slowly do the search/replace. For those with dissectors outside the source tree, please see tools/convert_expert_add_info_format.pl for help with the conversion. Please do not use expert_add_info_format_internal, as it's support time will be very short lived. svn path=/trunk/; revision=51844
2013-08-26From Jiri Engelthaler viaEvan Huus1-6/+19
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9055 Add support for bitmask set for signed integer types. svn path=/trunk/; revision=51522
2013-08-22proto: simplify proto_tree_add_pi() remove out pointer to field_info *Jakub Zawadzki1-69/+44
field_info can be already get using PNODE_FINFO(return_value) svn path=/trunk/; revision=51479
2013-08-17Fix few concept of new api tree:Jakub Zawadzki1-8/+6
- (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-16Introduce new proto_tree API required for hf_ variables removal.Jakub Zawadzki1-15/+51
svn path=/trunk/; revision=51396
2013-08-06Try to fix compilation under MSVCJakub Zawadzki1-1/+1
__builtin_ctz() with bitmask == 0 is UB, so only do g_assert there. svn path=/trunk/; revision=51176
2013-08-06Replace hfinfo pointer to same_name_prev, with same_name_prev_id.Jakub Zawadzki1-10/+18
svn path=/trunk/; revision=51175
2013-08-06Remove hfinfo->bitshift member, add hfinfo_bitshift() to get it.Jakub Zawadzki1-36/+27
svn path=/trunk/; revision=51174
2013-08-06Optimize wrs_count_bitshift()Jakub Zawadzki1-5/+10
- Use __builtin_ctz for GCC/clang - Do multiply and lookup on other platforms svn path=/trunk/; revision=51173
2013-08-05Completely remove support for proto_item_set_expert_flags.Michael Mann1-24/+0
svn path=/trunk/; revision=51144
2013-07-30Optimize marking label as truncated in proto_tree_set_representation_*()Jakub Zawadzki1-22/+14
svn path=/trunk/; revision=51036
2013-07-29add a NULL check to report_type_length_mismatch()Martin Kaiser1-6/+8
this might be called via proto_tree_add_item() with tree==NULL which results in a crash svn path=/trunk/; revision=51020
2013-07-28Much simpler (and possibly faster) fix for the 64-bit value string label issue.Evan Huus1-24/+8
svn path=/trunk/; revision=50983
2013-07-28As caught by Stig: 64-bit value strings could print the field name twice.Evan Huus1-18/+25
Don't do that. svn path=/trunk/; revision=50982
2013-07-28Store protocol fields in single linked list, saves about 1 MB of memory.Jakub Zawadzki1-11/+12
svn path=/trunk/; revision=50967
2013-07-28Fix compile error that resulted from whitespace cleanup.Michael Mann1-1/+1
svn path=/trunk/; revision=50963
2013-07-28Make many items filterable for Vines dissectors.Michael Mann1-0/+35
Add support for FT_VINES type. svn path=/trunk/; revision=50962
2013-07-27make some variables staticJakub Zawadzki1-1/+2
svn path=/trunk/; revision=50952
2013-07-26Follow-up to r50935: add support for 64-bit value strings in more places thatEvan Huus1-0/+7
need it, I think this is all of them. svn path=/trunk/; revision=50941
2013-07-26Squelch MSVC warnings. It doesn't know that DISSECTOR_ASSERT_NOT_REACHED doesn'tEvan Huus1-0/+5
return. svn path=/trunk/; revision=50939
2013-07-26Add 64-bit value strings and the appropriate tooling (including yet anotherEvan Huus1-10/+67
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-25As pointed out in ↵Jeff Morriss1-0/+7
https://www.wireshark.org/lists/wireshark-dev/201307/msg00153.html : The fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3290 needs to allow for giving a length of -1 for FT_STRINGZ's. This is another fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8960 (in addition to r50836). There's no point in reverting that revision, though, since there was no need to use a length of -1 in that case. svn path=/trunk/; revision=50892
2013-07-25Optimize proto_item_append_string()Jakub Zawadzki1-3/+6
- When old string empty just pass new one (like: frame.protocols) - if not, use ep_strconcat() svn path=/trunk/; revision=50890
2013-07-22Have get_uint_value() assume it's being passed an encoding value, whichGuy Harris1-17/+11
isn't necessarily going to be zero if the item is big-endian. The last argument to test_length() is an encoding, not a big-endian vs. little-endian Boolean; name it appropriately. This fixes bug 8953. svn path=/trunk/; revision=50806
2013-07-16Use label_fill also when boolean / bitfield.Jakub Zawadzki1-30/+24
svn path=/trunk/; revision=50682
2013-07-16optimize: remove g_snprintf()'s from label_fill[_descr]Jakub Zawadzki1-14/+55
svn path=/trunk/; revision=50681
2013-07-15Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-2/+1
svn path=/trunk/; revision=50632
2013-07-13proto_custom_set() cleanupJakub Zawadzki1-62/+34
- Merge _UINT / _INT into one case - fix possible generation of wrong expression ("some_integer") for unknown value in BASE_NONE field svn path=/trunk/; revision=50548
2013-07-11get_hfi_and_length() hasn't returned the hfi since r50015: rename itJeff Morriss1-7/+7
to get_hfi_length(). svn path=/trunk/; revision=50509
2013-07-11For consistency:Jeff Morriss1-50/+50
s/hf_index/hfindex/g s/hf_info/hfinfo/g svn path=/trunk/; revision=50507
2013-07-11Fix the very long loop fuzz failure reported in ↵Jeff Morriss1-4/+13
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8923 : Apply the fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3290 to proto_tree_add_bits_item(). That is, test that we have offset+length bytes left in the TVB before trying to fake the item. svn path=/trunk/; revision=50504
2013-07-08Fixes for tmp_fld_check_value():Jakub Zawadzki1-8/+11
- FT_FRAMENUM can't have strings - mask hfinfo->display to compare with valid BASE_ value svn path=/trunk/; revision=50444
2013-07-07ups? first add + 1, then multiply.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=50438
2013-07-07tree_is_expanded: make it bit array.Jakub Zawadzki1-10/+15
Right now we have about 36K of ett items, and tree_is_expanded takes: 144K of memory (36K*sizeof(gboolean)) By making tree_is_expanded bit array, it reduce size to 4.5K (36K/8) svn path=/trunk/; revision=50434
2013-07-07Make tree_is_expanded array static, add setter/getter function.Jakub Zawadzki1-1/+15
svn path=/trunk/; revision=50433
2013-07-06proto.c: add few more cases when oct/hex can show up with signed numberJakub Zawadzki1-7/+2
remove invalid comment about HEX/OCT print not supported for signed numbers. svn path=/trunk/; revision=50427
2013-07-03PROTO_REGISTRAR_GET_NTH() not needed after TRY_TO_FAKE_THIS_ITEMJakub Zawadzki1-1/+0
svn path=/trunk/; revision=50376
2013-07-03Optimize proto_item_prepend_text: if there's no fi->rep avoid one strlcpy().Jakub Zawadzki1-3/+3
svn path=/trunk/; revision=50372
2013-07-02- rename and optimize proto_data_add_maybe_interesting_fieldJakub Zawadzki1-10/+6
- proto_tree_add_node() double checks if tree_type is valid remove second one (first one is more verbose) svn path=/trunk/; revision=50328
2013-07-02Remove tree argument from TRY_TO_FAKE_THIS_REPR macroJakub Zawadzki1-26/+24
PTREE_DATA should be the same for both *tree* and *pi* svn path=/trunk/; revision=50326
2013-07-02Rewrite proto_lookup_or_create_interesting_hfids() and rename to ↵Jakub Zawadzki1-27/+13
proto_data_add_maybe_interesting_field Now proto_data_add_maybe_interesting_field: - it actually add field_info to interesting hash_tree - accept only required parameters - is called only by proto_tree_add_node svn path=/trunk/; revision=50321