aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes/ftype-time.c
AgeCommit message (Collapse)AuthorFilesLines
2016-05-10Give FvalueToStringRepr a length parameter.Michael Mann1-4/+4
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-05Convert ftype-tvbuff.c to ftype-protocol.cMichael Mann1-2/+2
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-03-11Remove use of sprintf for ftype string formattingMichael Mann1-3/+9
Change-Id: I656d6193aad740ab88bf16fb25c202e766e3092a Reviewed-on: https://code.wireshark.org/review/7616 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-21Make FT_{U}INT64 behave more like FT_{U}INT32, add support for ↵JC Wren1-4/+8
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-01-18Clean up ftype-conversion and dfilter error message string handling.Guy Harris1-8/+8
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-4/+4
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-10-17Don't use <ctype.h> macros.Guy Harris1-3/+2
They're locale-dependent (although those *particular* ones might not be). Remove no-longer necessary (or not-even-necessary-before-this-change) includes of <ctype.h> Change-Id: I1384e3ae4ccba6af9220a08773abcde7ea320573 Reviewed-on: https://code.wireshark.org/review/4755 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-01Escape double quotes when printing ABSOLUTE_TIME fieldMichael Mann1-9/+13
This regression was introduced by the commit e5353bf1198d6abf748de78084ff64f597f13663 done for bug 10081 Bug: 10213 Change-Id: I3925a47ef13055f10f49fa9fefd022731746fbb8 Reviewed-on: https://code.wireshark.org/review/2572 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-06Clean up handling of missing functions.Guy Harris1-1/+1
With autotools, CMake, and nmake, if we have a function, #define HAVE_{function_name_in_all_caps}, otherwise don't #define it. If we provide our own version of a function in libwsutil, make sure we have a header that declares it, and *ONLY* include that header if HAVE_{function_name_in_all_caps} is *NOT* defined, so that we don't have the system declaration and our declaration colliding. Check for inet_aton, strncasecmp, and strptime with CMake, just as we do with autotools. Simplify the addition of {function_name_in_all_caps}_LO to libwsutil in autotools. Change-Id: Id5be5c73f79f81919a3a865324e400eca7b88889 Reviewed-on: https://code.wireshark.org/review/2903 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-16Convert more time_to_str functions to wmemEvan Huus1-3/+23
Change-Id: Ibaae0e79935dc62f12f713f2df5b57d0f3f799b9 Reviewed-on: https://code.wireshark.org/review/2254 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16Convert a bunch of time_to_str functions to wmemEvan Huus1-5/+12
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983 Reviewed-on: https://code.wireshark.org/review/2245 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-01-15Eliminate fvalue_set() in favor of routines that take argumentsGuy Harris1-11/+21
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-19Rename more to_str functions to have ep_ in the name if they return ephemeralEvan Huus1-4/+4
buffers. Remove two unused functions. svn path=/trunk/; revision=54250
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53230
2013-11-09Include <epan/to_str.h> only when needed.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53189
2012-11-06When comparing fvalue_t we don't modify them, make arguments const.Jakub Zawadzki1-6/+6
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
2011-12-27Add a "-G ftypes" option, which dumps our supprted FT_… names andGerald Combs1-2/+2
descriptions. Captitalize and fix up the descriptions. Use its output to create the field type list in the wireshark-filter man page. svn path=/trunk/; revision=40306
2011-07-28From Dirk:Anders Broman1-1/+12
support ISO style date and time for frame.time filter https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6086 svn path=/trunk/; revision=38233
2010-05-28Move some code (including the optional objects) into libwsutilJeff Morriss1-5/+5
svn path=/trunk/; revision=33012
2010-05-21Have abs_time_to_str() and abs_time_to_str_secs() take an additionalGuy Harris1-2/+5
argument indicating whether to include the time zone in the string. If we're constructing a display filter, don't include the time zone, otherwise do. Fixes bug 4756. svn path=/trunk/; revision=32913
2010-02-27Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with theGuy Harris1-2/+2
date as YYYY/DDD, where DDD is a 1-origin day of year. Move the formats to a "time_fmt.h" file, included by the headers that use it. Have abs_time_to_str() and abs_time_secs_to_str() take the date format value, rather than a Boolean "show this as UTC" flag, as an argument. Document the ABSOLUTE_TIME_ formats a bit better. Use that format in the CCSDS and VCDU dissectors, rather than having those dissectors do the formatting themselves. svn path=/trunk/; revision=32034
2009-12-10Add an argument to abs_time_to_str() and abs_time_secs_to_str()Guy Harris1-2/+2
indicating whether the time should be shown as local time or UTC. For now, always pass FALSE, meaning "show as local time". Clean up some stuff in the SNMP dissector, use abs_time_secs_to_str() for times with one-second resolution, and update a comment in various macros in the WSP dissector, while we're at it. svn path=/trunk/; revision=31227
2009-08-26(FWIW) One step towards including stdio.h & stdlib.h only when req'd.Bill Meier1-0/+1
svn path=/trunk/; revision=29568
2009-03-15Some more P64 fixes - they all assume we don't have truly giganticGuy Harris1-3/+3
strings. svn path=/trunk/; revision=27720
2007-04-22Only #deinfe __USE_XOPEN if not already defined. On my Suse 10.2 it wasJörg Mayer1-2/+5
already #defined to 1, so this would create a warning/error. svn path=/trunk/; revision=21508
2007-01-18Add separate union entries to fvalue.value for signed and unsignedMartin Mathieson1-4/+8
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-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-05-02Add infrastructure for display filter functions.Gilbert Ramirez1-0/+2
Add upper() and lower() display filter functions for string fields. svn path=/trunk/; revision=18071
2005-08-18From Richard van der HoffAnders Broman1-4/+11
negative relative time fixes. svn path=/trunk/; revision=15407
2004-08-22Add "tvb_get_ntoh64()" and "tvb_get_letoh64()" routines to fetch 64-bitGuy Harris1-22/+26
integers. Make FT_INT64 and FT_UINT64 add numerical values, rather than byte-array values, to the protocol tree, and add routines to add specified 64-bit integer values to the protocol tree. Use those routines in the RSVP dissector. svn path=/trunk/; revision=11796
2004-07-18Set the svn:eol-style property on all text files to "native", so thatGuy Harris1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. svn path=/trunk/; revision=11400
2004-02-27First attempt at "bitwise AND" display filter operator.Olivier Biot1-1/+3
Document how a display operator can be added. svn path=/trunk/; revision=10250
2003-12-06From Olivier BiotGilbert Ramirez1-1/+3
New "matches" operater in display filter language. Uses PCRE. If a "matches" operator is found in a dfilter while libpcre has not been used to build the binary, then an exception is thrown after using dfilter_fail() to set an apporporiate error message. svn path=/trunk/; revision=9182
2003-08-27Add a "contains" operator for byte-strings, strings, and tvbuffs (protocols).Gilbert Ramirez1-3/+13
The search uses a naive approach; more work is required to add a Boyer-Moore Search algorithm. svn path=/trunk/; revision=8280
2003-07-30Give FT_ABSOLUTE_TIME and FT_RELATIVE_TIME val_repr_len and val_to_reprGuy Harris1-5/+35
methods, and use them when constructing display filters. svn path=/trunk/; revision=8107
2003-07-25Add to the fundamental types passed between the scanner and the parser.Gilbert Ramirez1-4/+6
Besides "STRING", there is now "UNPARSED_STRING", where the distinction is that "STRING" was a double-quoted string and "UNPARSED_STRING" is just a sequence of characters that the scanner didn't know how to scan/parse, so it's up to the Ftype to parse it. This gives us more flexibility and prepares the dfilter parsing engine for the upcoming addition of the "contains" operator. In the process of doing this, I also re-did the double-quoted string support in the scanner, so that instead of the naively-simple support we used to have, double-quoted strings now can have embedded dobule-quotes, embedded octal sequences, and embedded hexadecimal sequences: "\"" embedded double-quote "\110" embedded octal "\x48" embedded hex Enhance the dfilter unit test script to be able to run a single collection of tests instead of having to run all of them all the time. svn path=/trunk/; revision=8083
2003-02-08Provide a way for ftype modules to provide a string representationGilbert Ramirez1-1/+5
of their value. Provide such a method for FT_BYTES, FT_UINT_BYTES, and FT_ETHER. Have proto_alloc_dfilter_string() use the new methods. This is part of a movement of ftype-related code out of proto.c and into the ftype code. The immediate effect is that generated display filters for long byte sequences don't incorrectly have trailing periods ("...") to indicate continuation. svn path=/trunk/; revision=7100
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-4/+4
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6116
2002-02-05"log" is a name that belongs to the ANSI C89 standard; it refers to aGuy Harris1-7/+7
function that computes the natural logarithm of a double. Using it as the name of a pointer to a routine to do logging can cause namespace collisions; in fact, it *does* cause them on AIX. Rename the function argument to "logfunc". svn path=/trunk/; revision=4700
2002-01-30Try defining just _USE_XOPEN and see if that gets "strptime()" declaredGuy Harris1-16/+1
on most platforms; it works on Solaris, at least. svn path=/trunk/; revision=4630
2002-01-30Alas, on Solaris, defining _XOPEN_SOURCE causes some things not in theGuy Harris1-1/+13
X/Open specs *not* to be defined, so we also have to define __EXTENSIONS__. XXX - can we just define __USE_XOPEN, and not define _XOPEN_SOURCE? Is that sufficient to get "strptime()" declared on all platforms? svn path=/trunk/; revision=4629
2002-01-29Use:Gilbert Ramirez1-3/+4
#ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 500 #endif #define __USE_XOPEN #include <time.h> to get strptime() declared in time.h on various systems. I hope this helps more than it hurts. svn path=/trunk/; revision=4624
2001-12-28Correctly handle the nanoseconds fields in strings representing absoluteGuy Harris1-7/+68
and relative times - "0.4" is 400,000,000 nanoseconds, not 4 nanoseconds. svn path=/trunk/; revision=4458
2001-09-14Make the resolution for time values be nanoseconds rather thanGuy Harris1-33/+33
microseconds. Fix some "signed vs. unsigned" comparison warnings. svn path=/trunk/; revision=3934
2001-07-13From Joerg Mayer:Guy Harris1-1/+2
* gcc 3.0 warning fixes: - text2pcap.c: The number of characters to scan should probably not be 0 - wiretap/csids.c: using preincrement on a variable used on both sides of an assignment might be undefined by the C99(?) standard * turn on additional warnings for epan and wiretap too - epan/configure.in - wiretap/configure.in * Fix some warnings (missing includes, signed/unsigned, missing initializers) found by turning on the warnings - all other files :-) svn path=/trunk/; revision=3709
2001-06-19More signed vs. unsigned cleanups, and initialization cleanups, fromGuy Harris1-1/+5
Joerg Mayer. svn path=/trunk/; revision=3578
2001-06-18Define __USE_XOPEN in files that use "strptime()", from Joerg Mayer.Guy Harris1-2/+9
svn path=/trunk/; revision=3559