summaryrefslogtreecommitdiff
path: root/epan/ftypes/ftypes.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-20ftypes: move get_value_ptr into the unionMartin Kaiser1-2/+19
Delete get_value_ptr from struct _ftype_t, make it part of the get_value union. Change-Id: I947331069662a7043bd838e622d286629cc7be9a Reviewed-on: https://code.wireshark.org/review/20647 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-20ftypes: move get_value_uinteger into the unionMartin Kaiser1-2/+11
Delete get_value_uinteger from struct _ftype_t, make it part of the get_value union. Change-Id: I4a6c8341676c442e2bf8ae3b8f771b72161d133c Reviewed-on: https://code.wireshark.org/review/20640 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-19ftypes: move get_value_sinteger into the unionMartin Kaiser1-2/+6
Delete get_value_sinteger from struct _ftype_t, make it part of the get_value union. Change-Id: I3127252cafc62389ce426639992f1d59f7ac9731 Reviewed-on: https://code.wireshark.org/review/20637 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-19ftypes: move get_value_uinteger64 into the unionMartin Kaiser1-2/+8
Delete get_value_uinteger64 from struct _ftype_t, make it part of the get_value union. Change-Id: I2b06efb7691c1bd4089994849373ab8b5ff0bcc7 Reviewed-on: https://code.wireshark.org/review/20618 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-19ftypes: move get_value_sinteger64 into the unionMartin Kaiser1-2/+6
Delete get_value_sinteger64 from struct _ftype_t, make it part of the get_value union. Change-Id: I0113f70ab0aadd1aa655466e896e3acce6c8faeb Reviewed-on: https://code.wireshark.org/review/20617 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-19ftypes: create a get_value union, move get_value_floating into the unionMartin Kaiser1-2/+4
Change-Id: I6bbaf6a7c8a3124e5eab7a7b97c6be082fe8beff Reviewed-on: https://code.wireshark.org/review/20611 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-18ftypes: rename get_value to get_value_ptrMartin Kaiser1-2/+2
This is in preparation for introducing a get_value union, similar to set_value. Change-Id: Id0cf913a616e0314638f1531836c3136ed02631d Reviewed-on: https://code.wireshark.org/review/20610 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-03-15ftypes: move set_value_floating into the unionMartin Kaiser1-2/+4
Delete set_value_floating from struct _ftype_t, make it part of the set_value union. Change-Id: Ic00e1c70488ddc4422c34657c62af7dc07db02d9 Reviewed-on: https://code.wireshark.org/review/20556 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-14ftypes: move set_value_sinteger64 into the unionMartin Kaiser1-2/+6
Delete set_value_sinteger64 from struct _ftype_t, make it part of the set_value union. Change-Id: I76668f0a6455c5d75c703cd4f440757601246bdb Reviewed-on: https://code.wireshark.org/review/20551 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-14ftypes: move set_value_uinteger64 into the unionMartin Kaiser1-2/+8
Delete set_value_uinteger64 from struct _ftype_t, make it part of the set_value union. Change-Id: I12407b7336282daa60fe6e0e742d65e205dc84fd Reviewed-on: https://code.wireshark.org/review/20539 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-13ftypes: move set_value_sinteger into the unionMartin Kaiser1-2/+6
Delete set_value_sinteger from struct _ftype_t, make it part of the set_value union. Change-Id: I084c4c9beba9978b538d359ebaac21391ebd7f82 Reviewed-on: https://code.wireshark.org/review/20523 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-13ftypes: move set_value_uinteger into the unionMartin Kaiser1-2/+12
Delete set_value_uinteger from struct _ftype_t, make it part of the set_value union. Change-Id: I26de15be8ea0ede76236a8f8a4958bfd97ad9d52 Reviewed-on: https://code.wireshark.org/review/20521 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-10ftypes: move set_value_protocol into the unionMartin Kaiser1-2/+3
Delete set_value_protocol from struct _ftype_t, make it part of the set_value union. Change-Id: Iae55388b8a2c965944028499619282c3232c31f3 Reviewed-on: https://code.wireshark.org/review/20475 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-10ftypes: move set_value_string into the unionMartin Kaiser1-2/+5
Delete set_value_string from struct _ftype_t, make it part of the set_value union. Change-Id: Ia3a57245330ed0d158c8c3e4552ec5d80752fe0f Reviewed-on: https://code.wireshark.org/review/20474 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-09ftypes: move set_value_time into the unionMartin Kaiser1-2/+3
Delete set_value_time from struct _ftype_t, make it part of the set_value union. Change-Id: Ieee3b083d52afdd608e31e8ca75b50016fec8a69 Reviewed-on: https://code.wireshark.org/review/20442 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-03-08ftypes: move set_value_guid into the unionMartin Kaiser1-2/+3
Delete set_value_guid from struct _ftype_t, make it part of the set_value union. Change-Id: I3a04ff6b1ab179063ef77a3c475809df0bde5c68 Reviewed-on: https://code.wireshark.org/review/20441 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-03-08ftypes: move set_value_bytes into the unionMartin Kaiser1-2/+7
Delete set_value_bytes from struct _ftype_t, make it part of the set_value union. Change-Id: I3ee6a9f68b269ee083794947816e13ea6c1b9d29 Reviewed-on: https://code.wireshark.org/review/20440 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-03-07ftypes: create a set_value unionMartin Kaiser1-2/+7
struct _ftype_t contains a number of pointers to set_value_...() functions. For each pre-defined ftype_t, only one of these pointers is != NULL. As the comment already says, we should move these functions into a union. ftenum_t ftype will be used for selecting the correct function pointer from the union. Create a set_value union and move the FvalueSetByteArrayFunc pointer into the union. Update fvalue_set_byte_array() accordingly. Check that the fvalue_t parameter is of the correct type. Change-Id: I6568d8f47108311289c0cd425f28ea8b38046141 Reviewed-on: https://code.wireshark.org/review/20433 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-05-10Give FvalueToStringRepr a length parameter.Michael Mann1-1/+1
This allows the conversion of a few straggler strcpy calls in ftype library. Also provides a more accurate size value instead of the many hard coded values the ftypes were using. Change-Id: Ia6273980432e16ad3a6233816a6054d9fed5d2a4 Reviewed-on: https://code.wireshark.org/review/15344 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-10Have fvalue_to_string_repr always return an (wmem) allocated buffer.Michael Mann1-9/+10
Previous patches converted all fvalue_to_string_repr calls to expect an allocated buffer (and not a passed in one). Now changing signature to force an allocated buffer. Added wmem in case that can be taken advantage of within epan (and since the function signature was changing anyway). Change-Id: Ica1ac4a9a182ce0e73303856329e198d9d525b7b Reviewed-on: https://code.wireshark.org/review/15343 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-05Convert ftype-tvbuff.c to ftype-protocol.cMichael Mann1-3/+3
As noted in https://www.wireshark.org/lists/wireshark-dev/201604/msg00103.html a protocol field isn't really a tv_buff, so allow for the possibility of a NULL tv_buff in a "protocol type". If the tvb is NULL, use the string of the protocol field for comparison Bug: 12335 Change-Id: Ie12a5f7b31c7293c61006b0f70135d100a97c4e0 Reviewed-on: https://code.wireshark.org/review/15261 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-29Add support for IEEE-11073 FLOATsMichal Labedzki1-0/+1
Add support for IEEE-11073 32-bit FLOAT and 16 bit SFLOAT field types. Use them in Bluetooth ATT dissector. Change-Id: Ife0f3843da84a9af23483b0a0d9b69cd2f511d08 Reviewed-on: https://code.wireshark.org/review/12680 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-21Make FT_{U}INT64 behave more like FT_{U}INT32, add support for ↵JC Wren1-9/+31
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-15epan/ftypes/*.[hc]: As needed: Add editor modelines & Fix indentationBill Meier1-0/+13
Change-Id: Ib0bd1ea7801ab450b300a94c4757f16d0dd75760 Reviewed-on: https://code.wireshark.org/review/7137 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-18Clean up ftype-conversion and dfilter error message string handling.Guy Harris1-8/+18
Have dfilter_compile() take an additional gchar ** argument, pointing to a gchar * item that, on error, gets set to point to a g_malloc()ed error string. That removes one bit of global state from the display filter parser, and doesn't impose a fixed limit on the error message strings. Have fvalue_from_string() and fvalue_from_unparsed() take a gchar ** argument, pointer to a gchar * item, rather than an error-reporting function, and set the gchar * item to point to a g_malloc()ed error string on an error. Allow either gchar ** argument to be null; if the argument is null, no error message is allocated or provided. Change-Id: Ibd36b8aaa9bf4234aa6efa1e7fb95f7037493b4c Reviewed-on: https://code.wireshark.org/review/6608 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-04Create BASE_DOT, BASE_DASH, and BASE_SEMICOLON types for the FT_BYTES field ↵Michael Mann1-5/+5
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-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-21Fix bug 9790: Lua: wslua allows duplicate field registrationHadriel Kaplan1-0/+63
As discussed in bug 3513 and 9709, one can register more than one new ProtoFields for the same field name. Of course C-code can do that too, and does a LOT apparently, but if they're not similar ftypes then things can get scrweed up in display filters. So this change prevents duplicate field registration of dissimilar ftypes. The similarity is based on the discussion on the mailing list, and the listing in README.developer has been updated to refelect that as well. Also, this change adds a testscript for Proto/ProtoFields. Change-Id: I43bd323f785245941a21289647332a19adec2a9d Reviewed-on: https://code.wireshark.org/review/285 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-01-15Eliminate fvalue_set() in favor of routines that take argumentsGuy Harris1-6/+41
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
2013-11-12Replace fvalue_ftype() with a fvalue_type_ftenum() routine that returnsGuy Harris1-4/+7
the ftenum_t for the fvalue's ftype, rather than a pointer to the ftype (which isn't all that useful except as a handle, unless you import the internal header). Have fvalue_to_string_repr() return NULL, rather than failing, if the fvalue's ftype has no val_to_string_repr method. This lets us not include the ftypes internal header in ui/cli/tap-diameter-avp.c. svn path=/trunk/; revision=53290
2013-03-10Remove slab.h and replace its last remaining usage with glib slices.Evan Huus1-1/+0
Take the opportunity to deduplicate some code that was common to both an if block and its else block. svn path=/trunk/; revision=48227
2013-03-09Remove the emem slab feature (sl_* functions) completely, replacing it withEvan Huus1-5/+1
glib memory slices. - We weren't doing anything with the emem slab that couldn't be done with glib slices. - Removes a fair bit of code as well as one debugging environment variable. - Glib slices are much cache-friendlier and are multi-threading friendly (if we ever go there). - Allows glib to actually return slices to the OS on occasion. The emem slab would hold onto its memory forever which resulted in a great deal of wasted memory after closing a large file. svn path=/trunk/; revision=48218
2013-03-05type drange -> drange_tAnders Broman1-1/+1
explicit casts. svn path=/trunk/; revision=48083
2012-11-06When comparing fvalue_t we don't modify them, make arguments const.Jakub Zawadzki1-9/+9
svn path=/trunk/; revision=45948
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45016
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-02Try to squelch warningsAnders Broman1-4/+4
svn path=/trunk/; revision=43001
2011-09-07From Jakub Zawadzki :Anders Broman1-0/+1
Add support for prefix in IPv6 address filter. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5538 svn path=/trunk/; revision=38916
2011-05-09Convert SLAB_-s, to sl_-API.Jakub Zawadzki1-2/+3
svn path=/trunk/; revision=37030
2010-05-12(Trivial) Use consistent indentation.Bill Meier1-3/+3
svn path=/trunk/; revision=32773
2010-01-19Use more unique names for certain enum constants.Bill Meier1-3/+3
(enum constant names are part of the global name space). (Fixes at least one gcc -Wshadow warning). svn path=/trunk/; revision=31572
2008-11-11Signal error on field values that cannot be safely represented as strings ↵Balint Reczey1-1/+7
instead of crashing. This fixes bug 2845. svn path=/trunk/; revision=26749
2008-06-23Rename some variables to avoid shadowing warnings.Stig Bjørlykke1-2/+2
svn path=/trunk/; revision=25543
2007-01-18Add separate union entries to fvalue.value for signed and unsignedMartin Mathieson1-6/+22
32-bit numbers. Separate signed and unsigned accessors have been added and used where appropriate. Definitely not for 0.99.5. svn path=/trunk/; revision=20472
2006-12-22hmmRonnie Sahlberg1-2/+3
best to revert this for a while. revert all changes from previous patch. svn path=/trunk/; revision=20195
2006-12-22change some slab allocated memory into ep/emem allocated structures instead.Ronnie Sahlberg1-3/+2
this primarily removes code and simplifies (==eliminates) the need to track the data that is allocated and should potentially be slightly faster than a slab allocator. however these functions are called A LOT so there might be a performance hit when using emem with full debugging canary values and all the bells and whistles activated. this change also makes any future attempt to parallellize dissection of frames easier if we just make the ep allocator allocate from a threads specific ep pool. (something we would have to do anyway to make ep allocations multithreaded) this works in all my tests so far but needs more test coverage. svn path=/trunk/; revision=20194
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-05-02Add infrastructure for display filter functions.Gilbert Ramirez1-0/+7
Add upper() and lower() display filter functions for string fields. svn path=/trunk/; revision=18071
2006-03-10new FT_GUID handling - big/little endian supportedTomas Kukosa1-0/+1
svn path=/trunk/; revision=17566
2005-08-20- Include the .h files in their .c files.Jörg Mayer1-0/+2
- Remove epan/dissectors/packet-sna.h, it isn't used anywhere. svn path=/trunk/; revision=15475