aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dfilter
AgeCommit message (Collapse)AuthorFilesLines
2015-02-13epan/dfilter/*.c: As needed: Add editor modelines & Fix indentationBill Meier13-122/+289
Change-Id: I410839329a98bd806c60961dfb9693d5eeeeb702 Reviewed-on: https://code.wireshark.org/review/7104 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-09(Trivial) Fix printf-related 'Mismatch on sign' warningsBill Meier2-3/+3
Found by MSVC2013 Code Analysis Change-Id: I58063946dd558e98308c87b36eeac0ddbe1a6e79 Reviewed-on: https://code.wireshark.org/review/7045 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-18Remove some apparently-unnecessary includes of emem.h.Guy Harris1-1/+0
Change-Id: Id50ce3e707056cca8f30052f05c451ce431b39b5 Reviewed-on: https://code.wireshark.org/review/6632 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18Clean up ftype-conversion and dfilter error message string handling.Guy Harris10-207/+267
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-18Trim down the use of ep_ memory in the display filter code.Michael Mann4-22/+31
Couldn't quite eliminate it completely, but it's much improved. Need to figure out where/when to free dfilter_error_msg. Change-Id: I10216e9546d38e83f69991ded8ec0b3fc8472035 Reviewed-on: https://code.wireshark.org/review/6591 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-13Consistently use the "g_string_free returns a C string pointer" idiom.Guy Harris1-4/+2
g_string_free(str, FALSE) frees the GString container but not the underlying g_malloc()ed string; instead, it returns a pointer to the g_malloc()ed string. Fix those places that didn't already get the string pointer from g_string_free() to do so rather than manually extracting the string themselves. And fix one place that didn't even need to use a string - it was just scanning a C string without even modifying it. Change-Id: Ibbf4872bf5b9935b9907f539b6edb1013f3053a5 Reviewed-on: https://code.wireshark.org/review/6532 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13UAT error string pointers should not be const pointers.Guy Harris1-2/+2
UAT error strings are usually allocated by g_strdup() or g_strdup_printf(), and must ultimately be freed by the caller. Make the pointer-to-error-string-pointer arguments to various functions be "char **", not "const char **". Fix cases that finds where a raw string was being used, as that won't work if you try to free it; g_strdup() it instead. Add a missing free of an error string. Remove some no-longer-necessary casts. Remove some unnecessary g_strdup()s (the string being handed to it was already g_malloc()ated). Change some variable declarations to match. Put in XXX comments for some cases where the error string is just freed, without being shown to the user. Change-Id: I40297746a2ef729c56763baeddbb0842386fa0d0 Reviewed-on: https://code.wireshark.org/review/6525 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-12Remove emem APIs from UAT functionality.Michael Mann1-2/+2
Change-Id: I009c09f25d170e5c9aaaef713eaacb3252817856 Reviewed-on: https://code.wireshark.org/review/6460 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-11Revert "Lemon: Update lemon tools"Pascal Quantin2-2/+2
This reverts commit 5855dd8d538eb81d4825961b1bf0d583bf96f751. This Lemon update fails to compile on OSX and triggers asserts on other platforms Change-Id: I12a8a2bf32db31e5a9b0cb1a67a39724e30f3e91 Reviewed-on: https://code.wireshark.org/review/6496 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-11Lemon: Update lemon toolsAlexis La Goutte2-2/+2
Fix warning: declaration shadows a variable in the global scope [-Wshadow] Add include <config.h> Fix warning: unused parameter 'argc' [-Wunused-parameter] (using _U_) Fix implicit conversion loses integer precision Fix comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] Fix function declaration isn’t a prototype [-Wstrict-prototypes] Fix warning: old-style function definition [-Wold-style-definition] Fix trailing whitespace Fix use -T for template for epan\Makefile.nmake, epan\dfilter\Makefile.nmake, plugins\mate\Makefile.nmake, plugins\tpg\Makefile.nmake and cmake/modules/UseLemon.cmake Fix -Wmissing-prototypes Remove unused function (acttab_free) Add basename the filename with only filename (no path...) Change-Id: Ia79f61e29f828575df61cc89134c6c553044e86d Reviewed-on: https://code.wireshark.org/review/3976 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-04Create BASE_DOT, BASE_DASH, and BASE_SEMICOLON types for the FT_BYTES field ↵Michael Mann2-2/+2
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>
2015-01-02Add '*.nativecodeanalysis.xml' to 'clean' targetsBill Meier1-1/+1
Change-Id: I90dbf0b31fc737150a01533763a7869b34c68cb6 Reviewed-on: https://code.wireshark.org/review/6220 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-28Create FT_FCWWN field type.Michael Mann1-1/+4
Also, convert the "string" hf_ entries that used tvb_fcwwn_to_str as a string to use proto_tree_add_item with FT_FCWWN type. Change-Id: I4ca77870499fd8239584a70874998b5d194a7167 Reviewed-on: https://code.wireshark.org/review/6036 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-18DisplayFilter: Check also another fields with the same nameMichal Labedzki1-33/+18
This adds possibility to have two fields with the same abbrev name but different type, for example FT_ETHER and FT_STRING. That allows to compare each one to find a valid field. Change-Id: I8b2a1708ac9648b7a4289777c72a0f3b18f3d8f8 Reviewed-on: https://code.wireshark.org/review/5702 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>
2014-11-17display filter: the body of a range should only beMartin Kaiser1-2/+5
a string, a field name or another range - not an unparsed element Bug: 10690 Change-Id: I126143636c940cc73ed6467660f0a573209e2ae9 Reviewed-on: https://code.wireshark.org/review/5243 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-10-17No need for our own wrappers around tolower() and toupper().Guy Harris1-20/+3
We can just use g_ascii_tolower() and g_ascii_toupper(); Change-Id: I8a88a096d16ce8c60dd9151e5bdddf6747702145 Reviewed-on: https://code.wireshark.org/review/4754 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16Use g_ascii_isalnum() rather than isalnum().Guy Harris1-3/+2
That way, we don't have to worry about casting the argument (which, in one place, was done wrong - casting to int preserves the sign-extension done with signed chars), and don't have to worry about a locale in which particular 8-bit byte values are considered alphanumeric characters. Change-Id: I129b4bfdad70ade4ab6e0a1d2c13d59ae9e6f524 Reviewed-on: https://code.wireshark.org/review/4751 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-13when we check the parameter for upper(), lower() or len(),Martin Kaiser1-1/+1
return an error if the parameter is _no_ string Bug: 10401 Change-Id: I5643ef05009072538155e63c3178071ed6bab061 Reviewed-on: https://code.wireshark.org/review/4071 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-20Use forward slashes in paths to runlex.shРоман Донченко1-1/+1
This gets rid of "MS-DOS style path detected" warnings from Cygwin. Change-Id: Id10429669704aa371dbf56a9398947c8002260ad Reviewed-on: https://code.wireshark.org/review/3024 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Wireshark Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-07-16Don't use __func__, use G_STRFUNC.Guy Harris1-1/+1
Not all compilers we use support __func__. Change-Id: I61194e1073c87e67f821e14698ea21b73d63983c Reviewed-on: https://code.wireshark.org/review/3071 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06Add printf-format annotations, fix garbagePeter Wu3-8/+8
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-04-25Support out-of-source checkapiStig Bjørlykke1-3/+4
Always call $(top_srcdir)/tools/checkAPIs.pl with -sourcedir=$(srcdir) from Makefile.am to allow out-of-source 'make checkapi'. Change-Id: I60d7e0079984a8ededdacf4517a0738486fa7973 Reviewed-on: https://code.wireshark.org/review/1294 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-12Get rid of more tvb_get_nstringz* calls.Guy Harris2-35/+22
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-03-31Continue to remove $Id$ from top of fileAlexis La Goutte1-1/+0
(Using sed :sed -i '/^\/\* \$Id\$ \*\//,+0 d') ( /* $Id */ ) Change-Id: I46e928d7f2a307c35876ed5d34cb6b7cccfcd6e9 Reviewed-on: https://code.wireshark.org/review/886 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31Continue to remove $Id$ from top of fileAlexis La Goutte3-5/+0
(Using sed : sed -i '/^\# \$Id\$/,+1 d') (start with dash) Change-Id: Ia4b5a6c2302f6a531f6a86c1ec3a2f8205c8c2dd Reviewed-on: https://code.wireshark.org/review/881 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte27-54/+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 Meier6-15/+15
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-03Fix all -fstrict-alias warnings found by gcc 4.1.2Gilbert Ramirez1-1/+1
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-15Eliminate fvalue_set() in favor of routines that take argumentsGuy Harris1-1/+1
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-12-23Add FT_SYSTEM_ID for type checkingMichael Mann1-1/+4
svn path=/trunk/; revision=54394
2013-12-14Use "(void) <variable/>" to avoid unused variable warnings similar toGerald Combs1-1/+4
Qt's Q_UNUSED macro. svn path=/trunk/; revision=54110
2013-12-13Trivial: Spaces -> tabsChris Maynard1-11/+8
svn path=/trunk/; revision=54004
2013-12-13Trivial: Spaces -> tabsChris Maynard1-6/+6
svn path=/trunk/; revision=54002
2013-12-03Avoid including <epan/epan.h> in dissectors.Jakub Zawadzki1-1/+3
svn path=/trunk/; revision=53774
2013-12-03struct _dfilter_t: rename to epan_dfilter.Jakub Zawadzki2-2/+2
typedef (dfilter_t) not renamed. svn path=/trunk/; revision=53765
2013-11-28Add count() function to display filter. Bug 9480 ↵Michael Mann1-3/+22
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9480) From Martin Kaiser svn path=/trunk/; revision=53623
2013-11-12Replace fvalue_ftype() with a fvalue_type_ftenum() routine that returnsGuy Harris1-2/+2
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-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+2
svn path=/trunk/; revision=53230
2013-11-10Move struct _ftype_t + callback typedefs + free macro to ftypes-int.hJakub Zawadzki4-0/+5
svn path=/trunk/; revision=53223
2013-10-25Add a very small hack to make the UAT update callback error string freeable, andEvan Huus1-1/+1
convert all existing UAT update callbacks to use glib memory instead of ephemeral memory for that string. UAT code paths are entirely distinct from packet dissection, so using ephemeral memory was the wrong choice, because there was no guarantees about when it would be freed. The move away from emem still needs to be propogated deeper into the UAT code itself at some point. Net effect: remove another bunch of emem calls from dissectors, where replacing with wmem would have caused assertions. svn path=/trunk/; revision=52854
2013-10-18Revert SVN #52650 as per discussion on wireshark-devBill Meier1-2/+1
svn path=/trunk/; revision=52671
2013-10-16Prepend to lists rather than append as that's more efficient.Anders Broman1-1/+2
svn path=/trunk/; revision=52650
2013-10-06Add support for RELATIVE-OID ASN.1 type. Bug 9192 ↵Michael Mann1-1/+4
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9192) From Ed Beroset. svn path=/trunk/; revision=52393
2013-08-10dfilter: report warning if OR and AND logic operands are mixed without ↵Jakub Zawadzki6-12/+42
parentheses. svn path=/trunk/; revision=51247
2013-08-06Replace hfinfo pointer to same_name_prev, with same_name_prev_id.Jakub Zawadzki2-6/+6
svn path=/trunk/; revision=51175
2013-07-28dfilter: move convertion to byte to seperate functionJakub Zawadzki1-33/+23
svn path=/trunk/; revision=50964
2013-07-28Make many items filterable for Vines dissectors.Michael Mann1-1/+4
Add support for FT_VINES type. svn path=/trunk/; revision=50962
2013-07-27Support drange for functionsJakub Zawadzki2-5/+16
last think from bug #8979 + fix semcheck.c:875: warning: signed and unsigned type in conditional expression svn path=/trunk/; revision=50951
2013-07-27Some more work related to bug #8979 and previous commitJakub Zawadzki1-7/+16
- Make http.location[0:4] == lower(http.location) behave the same as lower(http.location) == http.location[0:4] - fix compiler errors + comments svn path=/trunk/; revision=50950
2013-07-27Fix bug #8979: Comparing function call and a range in the filter crashes ↵Jakub Zawadzki4-38/+68
Wireshark store whole node, don't assume it's always STTYPE_FIELD svn path=/trunk/; revision=50949