aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-17Fix crash caused by trying to apply a field of type BASE_CUSTOM as a column. ↵cmaynard1-3/+7
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6503. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39902 f5534014-38df-0310-8fa8-9805f1628bb7
2011-11-02Use "%g" for float as well as double.guy1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39709 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-25Allow signed integers displayed as BASE_HEX_DEC.stig1-1/+10
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39571 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-25Display BASE_DEC_HEX correct for int64/uint64.stig1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39569 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-25Added missing support for FT_INT64 in proto_tree_add_bits_format_value().stig1-0/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39561 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-25Simplified code checking if FT_UINT64 is displayed as BASE_NONE.stig1-7/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39560 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-25Allow signed integers displayed as DEC_HEX.stig1-1/+0
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39559 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-25Fixed using signed 64-bits integer in custom column.stig1-0/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39558 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-25Revert "Allow value_strings for FT_INT64 and FT_UINT64.", as westig1-2/+0
haven't generic support for value_strings for 64-bit values yet. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39557 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-25Allow value_strings for FT_INT64 and FT_UINT64.stig1-0/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39556 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-24Convert proto_tree_add_bitmask(), proto_tree_add_bitmask_text(), ↵wmeier1-11/+18
proto_tree_add_bitmask_tree() to have 'encoding' arg rather than 'little_endian' arg git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39538 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-05Use g_tree_steal to remove an entry without calling the destroy function.stig1-1/+1
This because we use the destroy function to determine same_name_hfinfo. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39267 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-04Add proto_unregister_field().stig1-0/+28
This can be used to unregister fields registered in dissector UAT's. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39248 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-02Removed the protocol registration updates in the splash screen for Pythonstig1-2/+6
dissectors, because it does not work as expected and causes an assert. Added generic splash updates for python register and handoff instead. This should fix bug 5431. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39221 f5534014-38df-0310-8fa8-9805f1628bb7
2011-09-27In proto_tree_add_bits... use const guint encoding to be consistent with ↵etxrab1-8/+8
proto_tree_add_item(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39163 f5534014-38df-0310-8fa8-9805f1628bb7
2011-09-20From Sylvain Munaut:etxrab1-0/+28
Add support for signed types in _proto_tree_add_bits_ret_val https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6363 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39060 f5534014-38df-0310-8fa8-9805f1628bb7
2011-09-16From Sylvain Munaut:etxrab1-38/+12
proto: Use fill_label_xxx helpers in _proto_tree_add_bits_ret_val https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6329 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39026 f5534014-38df-0310-8fa8-9805f1628bb7
2011-07-05Add some additional routine variants that handle string encodings, andguy1-51/+19
make FT_STRING and FT_UINT_STRING handle string encodings. Get rid of FT_EBCDIC in favor of FT_STRING with ENC_EBCDIC. Add some URLs for DRDA. Clean up some stuff in TN3270 and TN5250, including using ENC_ values for proto_tree_add_item(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37909 f5534014-38df-0310-8fa8-9805f1628bb7
2011-07-03Add ENC_ values for UTF-8 and EBCDIC, support them for FT_STRINGZguy1-1/+8
values, and use them in the MQ dissector, so EBCDIC strings are displayed as such. Fix up some other final arguments to proto_tree_add_item(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37872 f5534014-38df-0310-8fa8-9805f1628bb7
2011-06-25Make guy's fix in revision 37236 actually work:stig1-1/+1
"You cannot just make the "len" field of a GByteArray larger, if there's no data to back that length; you can only make it smaller." Two equal values are always equal! This fixes bug 5941. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37783 f5534014-38df-0310-8fa8-9805f1628bb7
2011-06-19Make creating a display filter from a custom column defined as integer withstig1-12/+20
strings and BASE_NONE equal to selecting the filter from the tree entry. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37720 f5534014-38df-0310-8fa8-9805f1628bb7
2011-06-19Handle BASE_NONE as BASE_DEC for filter expression in custom columns.stig1-0/+1
This fixes bug 6035. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37705 f5534014-38df-0310-8fa8-9805f1628bb7
2011-06-16Squelch some compiler warnings.guy1-3/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37685 f5534014-38df-0310-8fa8-9805f1628bb7
2011-06-07Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warningswmeier1-3/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37600 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-27Make TVBs opaque for most users.morriss1-10/+10
Convert TVB_RAW_OFFSET() and TVB_GET_DS_TVB() into functions. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37422 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-19Add a check that (plain) value_strings that are used in hf items don't havemartinm1-0/+48
any conflicting entries. i.e. lots of value_strings have repeated items, but for now only warn for cases where the same numeric value appears with a different string. Because this will slow down startup and output distracting warnings, it has been #if 0'd out for now. As discussed on the dev mailing list, it'd be good to create a #define for developer/non-release builds so that tests such as this can regularly be run. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37274 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-18You cannot just make the "len" field of a GByteArray larger, if there'sguy1-1/+6
no data to back that length; you can only make it smaller. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37236 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-18Make some more routines not used outside epan/proto.c static.guy1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37235 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-09Convert SLAB_-s, to sl_-API.darkjames1-13/+16
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37030 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-08Add FT_EUI64 Field Typealagoutte1-3/+110
* Remove proto_tree_add_eui64 function from 802.15.4 Dissector * Replace print_eui64/print_eui64 by eui64_to_str/get_eui64_name * Update Documentation (README.dev) * Add new function in libwireshark.def * Support of encoding for tvb_eui64_to_str * Use FT_EUI64 for ICMPv6, CAPWAP, Zbee ... dissector git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37015 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-11Use g_strlcpy() instead of prohibited strncpy() to guarantee NULL-termination.cmaynard1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36553 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-10strcpy -> strncpy.stig1-1/+1
Coverity 669. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36543 f5534014-38df-0310-8fa8-9805f1628bb7
2011-03-29Guard against NULL return from find_protocol_by_id().stig1-0/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36393 f5534014-38df-0310-8fa8-9805f1628bb7
2011-03-28Don't use prohibited strncpy(). In this case, use g_strlcat() instead.cmaynard1-6/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36382 f5534014-38df-0310-8fa8-9805f1628bb7
2011-03-26Added a FALLTHRU comment to avoid a coverity warning.stig1-0/+1
Coverity 480. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36350 f5534014-38df-0310-8fa8-9805f1628bb7
2011-03-20Clean up indentation.guy1-7/+7
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36213 f5534014-38df-0310-8fa8-9805f1628bb7
2011-02-10Modify proto_tree_add_bytes_format() and proto_tree_add_bytes_format_value()morriss1-2/+14
so that if the start_ptr is NULL the bytes are extracted from the given TVB using the given offset and length. Replace a bunch of: proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, tvb_get_ptr(tvb, offset, length), [...]) with: proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, NULL, [...]) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35896 f5534014-38df-0310-8fa8-9805f1628bb7
2011-02-08Add support for 4-byte NTP times (only the seconds) in proto_tree_add_item().morriss1-18/+27
Use it in packet-diameter.c . Eliminate an unnecessary local variable. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35875 f5534014-38df-0310-8fa8-9805f1628bb7
2011-02-07For FT_{ABSOLUTE,RELATIVE}_TIME, make the rest of the encodingguy1-20/+180
orthogonal to the byte order. This means that we can't just test for a non-zero encoding to determine whether the format is big-endian or little-endian when we set the field's endianness flag; instead, for the types where we accept any non-zero value as meaning "litle-endian", map it to ENC_LITTLE_ENDIAN. When we use ENC_TIME_NTP, OR in the byte order flag. While we're at it, in the dissectors that used ENC_TIME_NTP, update all the other encoding items in proto_tree_add_item() calls to use the appropriate ENC_ value. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35841 f5534014-38df-0310-8fa8-9805f1628bb7
2011-02-07Add support for passing NTP times to proto_tree_add_item() by specifyingmorriss1-21/+28
an encoding of ENC_TIME_NTP. This increases the number of decimal places shown for NTP times (from 6 to 9), so round the value to the nearest microsecond. (I can't tell if NTP times are ever more precise than a microsecond--this rounding is mainly to be closer to the old behavior.) Use proto_tree_add_item() for some NTP times. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35840 f5534014-38df-0310-8fa8-9805f1628bb7
2011-02-04Fix Bug 5500 - failed assertion in ISAKMP dissector (proto.c:4002) etxrab1-0/+9
By reinseringt the check in proto_tree_move_item() if tree vissible removed in http://anonsvn.wireshark.org/viewvc?view=rev&revision=32443 Hopefully not breaking tshark again. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5500 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35817 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-02Fix indentation.guy1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35329 f5534014-38df-0310-8fa8-9805f1628bb7
2010-11-14'tshark -G values' - Validate (somewhat) value_string_ext before use to ↵wmeier1-0/+4
prevent a crash. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34869 f5534014-38df-0310-8fa8-9805f1628bb7
2010-11-12Enhance 'tshark -G values': Add info about extended value strings (including ↵wmeier1-9/+31
acess method). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34854 f5534014-38df-0310-8fa8-9805f1628bb7
2010-11-12Use val_to_str_const & val_to_str_ext_const where appropriate.wmeier1-10/+10
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34850 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-14Rework "extended value strings":wmeier1-1/+1
- Allow direct access when a range of values begins with a value other than 0; - Provide value_string_ext_new() for creating extended value strings at runtime; - Do access to value_string_ext members via a macro (all but value_string.c); - Update documentation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34514 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-14Support multiple header fields with the same abbreviation in custom columns.stig1-11/+47
We have some different fields using the same abbreviation (e.g "eth.dst" used in both eth and tte), and this patch will fetch values from all fields. When using occurrences the entries listed first is from the field registered last when starting Wireshark, and not ordered from the occurrence in the packet, but I don't see how we can easily fix this. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34513 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-14Fix crash for 'tshark -G values' when printing "extended value string" value.wmeier1-1/+1
Fixes bug #5296 [ https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5296 ] git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34507 f5534014-38df-0310-8fa8-9805f1628bb7
2010-09-25Fix the output of columns with "show resolved" disabled when all occurrences ↵sake1-67/+68
are displayed. Limit the input field for occurrence to 4 characters to prevent an overflow. Make sure "... as filter" does not result in an invalid filter string if all occurrences are displayed. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34247 f5534014-38df-0310-8fa8-9805f1628bb7
2010-09-23Add some more casts.morriss1-8/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34208 f5534014-38df-0310-8fa8-9805f1628bb7