aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/time_util.c
AgeCommit message (Collapse)AuthorFilesLines
2021-06-16Replace g_log() calls with ws_log()João Valverde1-1/+3
2021-01-08Add iso8601_to_nstime() for editcap and nettraceDavid Perry1-1/+40
This adds a function to parse a string date-time in ISO 8601 format into a `nstime_t` structure. It's based on code from epan/tvbuff.c and wiretap/nettrace_3gpp_32_423.c and meant to eventually replace both. (Currently only replaces the latter.) Since most of Wireshark expects ISO 8601 date-times to fit a fairly strict pattern, iso8601_to_nstime() currently rejects date-times without separators between the components, even though ISO 8601 actually permits this. This could be revisited later. Also uses iso8601_to_nstime in editcap to parse the -A/-B options, thus allowing the user to specify a time zone if desired. (See #17110)
2020-01-21Put various epoch time deltas into wsutil/epochs.h.Guy Harris1-1/+3
There are some deltas between the UN*X epoch and other epochs that are used in a number of places; put them into a header. Change-Id: Ia2d9d69b9d91352d730d97d9e4897518635b4861 Reviewed-on: https://code.wireshark.org/review/35895 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-19Try to discourage the use of APIs via counting.Gerald Combs1-2/+1
Add the ability to specify maximum function counts for each group to checkAPIs. Add maximum counts for the "termoutput" and "abort" groups where needed. Show summaries in various checkAPI targets. Switch uses of ws_g_warning back to plain g_warning. Change-Id: I5cbddc8c671729e424eed8551f69116d16491976 Reviewed-on: https://code.wireshark.org/review/29721 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-17Log output updates.Gerald Combs1-0/+52
Add a Qt message handler that calls g_log. Add milliseconds to the g_log_message_handler timestamp. Change-Id: I5b1c1d902b6b05cd8daa01741b19d6c2048dfb9a Reviewed-on: https://code.wireshark.org/review/24865 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-10Convert to using use SPDX identifier on wsutil directoryMichael Mann1-13/+1
Change-Id: Id73e641499e75bc1afc1dea29682418156f461fe Reviewed-on: https://code.wireshark.org/review/24751 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-07Avoid colliding with the (old) UNIX stime() system call.Guy Harris1-14/+15
Rename "stime" to "sys_time", and, for consistency, do the same with "utime". This failed when I tried a build on an Ubuntu 12.04 LTS machine. Change-Id: Ib955b723506346aa742db0de4d26dc157bcd4fc8 Reviewed-on: https://code.wireshark.org/review/16935 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-30Add string function times to wmem_test.Gerald Combs1-13/+17
The system, GLib, and wmem string functions can perform differently, particularly on Windows. Start adding performance tests to wmem_test so that we can see the differences. With this change applied "wmem_test --verbose" prints out the following on a Windows 7 x64 VM here. wmem_test is linked against GLib 2.4.20. (MINPERF:g_printf_string_upper_bound (via g_snprintf) 1 string: u 327.602 ms s 0 .000 ms) (MINPERF:g_printf_string_upper_bound (via g_snprintf) 5 strings: u 1419.609 ms s 0.000 ms) (MINPERF:g_printf_string_upper_bound (via g_snprintf) mixed args: u 1606.810 ms s 0.000 ms) (MINPERF:_snprintf_s upper bound 1 string: u 124.801 ms s 0.000 ms) (MINPERF:_snprintf_s upper bound 5 strings: u 140.401 ms s 0.000 ms) (MINPERF:_snprintf_s upper bound mixed args: u 124.801 ms s 0.000 ms) (MINPERF:g_strdup_printf 2 strings: u 702.005 ms s 0.156 ms) (MINPERF:g_strconcat 2 strings: u 78.000 ms s 0.000 ms) (MINPERF:g_strdup_printf 5 strings: u 1419.609 ms s 0.156 ms) (MINPERF:g_strconcat 5 strings: u 93.601 ms s 0.156 ms) (MINPERF:wmem_strdup_printf 2 strings: u 343.202 ms s 0.312 ms) (MINPERF:wmem_strconcat 2 strings: u 93.601 ms s 0.468 ms) (MINPERF:wmem_strdup_printf 5 strings: u 327.602 ms s 8.268 ms) (MINPERF:wmem_strconcat 5 strings: u 62.400 ms s 3.432 ms) Change-Id: Id9b23918829db1719d141e7f830b9eba6245a25b Reviewed-on: https://code.wireshark.org/review/14857 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-26Cleanup some checkAPI warnings that were missed in previous patches.Michael Mann1-1/+2
Some search/replace of printf, g_warning and GTK APIs were changed to use a ws_ prefix Change-Id: I9beb763a975530a4006d1afbcad079a7d8d4ebf9 Reviewed-on: https://code.wireshark.org/review/16704 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-07-12Add resource usage logging.Gerald Combs1-0/+57
Add log_resource_usage, which prints the current and elapsed user and system times. Add a usage example in packet_list_model.cpp. Change-Id: I747161c754a3731e540821715cc9bb10b3dc821d Reviewed-on: https://code.wireshark.org/review/16383 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-14Add editor-modelines; adjust whitespace.Bill Meier1-0/+13
Change-Id: I8cad872cee972a6d22a72852dac57fd188daca84 Reviewed-on: https://code.wireshark.org/review/4683 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-25Move mktime_utc() from tvbuff.c to wsutil/time_util.cJakub Zawadzki1-0/+63
Also do little cleanup in mktime_utc (one big #ifndef) Change-Id: I8f721ba76cad856cfef0a2d78e7f98686f8e4e3f Reviewed-on: https://code.wireshark.org/review/1327 Reviewed-by: Anders Broman <a.broman58@gmail.com>