Commit Graph

27 Commits

Author SHA1 Message Date
Roland Knall 505226d1e2 Ui: Centralize PacketList helper prototypes
To implement loading a packet list, a lot of helper
methods are required. Those prototypes where split up
over two places and have been moved to packet_list_utils.h
to ensure a single place for lookup
2022-06-29 09:31:09 +00:00
Gerald Combs 34ef2066e5 CMake: Don't bother checking for fcntl.h or floorl.
fcntl.h appears to be available on all of our supported platforms,
including Windows. We've also been including it without HAVE_FCNTL_H
guards in a few places (e.g. sshdump.c) without any issues for some
time.

floorl is part of C99.
2021-07-15 06:41:05 +00:00
Gerald Combs 9222bd77cd Remove unneeded modelines in ui.
Remove the editor modeline blocks from the source files in ui that use 4
space indentation by running

perl -i -p0e 's{ \n+ /[ *\n]+ editor \s+ modelines .* shiftwidth= .* \*/ \s+ } {\n}gsix' $( ag -l shiftwidth=4 $( ag -g '\.(c|cpp|h|m|mm)') )

This gives us one source of indentation truth for these files, and it
*shouldn't* affect anyone since

- These files match the default in our top-level .editorconfig.

- The one notable editor that's likely to be used on these files and
*doesn't* support EditorConfig (Qt Creator) defaults to 4 space
indentation.
2021-04-20 07:43:39 +00:00
Michael Mann ca1d13d407 TimeShiftDialog should be considered an "edit" operation
When TimeShiftDialog is used, it should trigger the need to save the packet capture.

Ping-Bug: 14306
Change-Id: Ia0dfbefdabcb9d759b5ed2ce897637f9727d0768
Reviewed-on: https://code.wireshark.org/review/31057
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-12-21 13:59:32 +00:00
Guy Harris e7d24c606c Always explicitly set tm_isdst before calling mktime().
Except in rare cases, we want to set it to -1 so that we let mktime()
determine whether DST/Summer Time was in effect at the given date and
time rather than pretending that we know whether it's in effect or not.

Change-Id: I0ea75317dd308a515cedf4d1260b583e1592cc9b
Reviewed-on: https://code.wireshark.org/review/27431
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-09 16:33:21 +00:00
Stig Bjørlykke 14720ace06 Fix comment end after SPDX identifier
Move */ to a separate line below the SPDX identifier.

Change-Id: Id1032215449cfccae0933147b45e04b65e0b727f
Reviewed-on: https://code.wireshark.org/review/27211
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 06:56:37 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
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>
2018-02-08 14:57:36 +00:00
Dario Lombardo e5f4ef0c42 ui: use SPDX identifiers.
Change-Id: I6b05399395bcc35e59b73b4030ba4a05711a7b1a
Reviewed-on: https://code.wireshark.org/review/25565
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-02 13:39:04 +00:00
Guy Harris 797d2f6a87 Move the frame_set stuff back into the capture_file structure.
libwireshark now expects an epan_t to be created with a pointer to a
"packet provider" structure; that structure is opaque within
libwireshark, and a pointer to it is passed to the callbacks that
provide interface names, interface, descriptions, user comments, and
packet time stamps, and that set user comments.  The code that calls
epan_new() is expected to provide those callbacks, and to define the
structure, which can be used by the providers.  If none of the callbacks
need that extra information, the "packet provider" structure can be
null.

Have a "file" packet provider for all the programs that provide packets
from a file.

Change-Id: I4b5709a3dd7b098ebd7d2a7d95bcdd7b5903c1a0
Reviewed-on: https://code.wireshark.org/review/24731
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-08 03:32:25 +00:00
Guy Harris ccc55bc80c Put the structure of a capture_file back in cfile.h.
The split isn't necessary now that epan no longer uses the capture_file
structure.

Change-Id: Ia232712a2fb5db511865805518e8d03509b2167f
Reviewed-on: https://code.wireshark.org/review/24693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:35:36 +00:00
Guy Harris 1834dca365 Move the parts of a capture_file used by libwireshark to a new structure.
Embed one of those structures in a capture_file, and have a struct
epan_session point to that structure rather than to a capture_file.
Pass that structure to the routines that fetch data that libwireshark
uses when dissecting.

That separates the stuff that libwireshark expects from the stuff that
it doesn't look at.

Change-Id: Ia3cd28efb9622476437a2ce32204597fae720877
Reviewed-on: https://code.wireshark.org/review/24692
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:02:18 +00:00
Guy Harris eb8ffb74e2 Use cfile.h to define the capture_file type.
Have cfile-int.h declare the structure, and use it in files that
directly access the structure.

Have cfile.h just incompletely declare the structure and include it
rather than explicitly declaring it in source files or other header
files.

Never directly refer to struct _capture_file except when typedeffing
capture_file.

Add #includes as necessary, now that cfile.h doesn't drag in a ton of

Change-Id: I7931c8039d75ff7c980b0f2a6e221f20e602a556
Reviewed-on: https://code.wireshark.org/review/24686
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-03 18:54:37 +00:00
Peter Wu 1dea7f3dc1 Rename ui_util.h -> ws_ui_util.h
In preparation for possibly using AUTOUIC in CMake which treats "ui_*.h"
files specially, rename ui_util.h. No other changes.

Change-Id: Id026572c000b713ff0e9388dc7fff8d81d4df73e
Reviewed-on: https://code.wireshark.org/review/23916
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-10-15 01:14:26 +00:00
João Valverde cd1d137743 Avoid unnecessary replacement source file floorl.c
Change-Id: If282cb22dcf099559cbe8acd5b1affd07155af8c
Reviewed-on: https://code.wireshark.org/review/14808
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-04 23:58:31 +00:00
Martin Mathieson 43f09e67b4 Remove unneeded includes from ui folder
Change-Id: Ifd1eebff9080cd3867e44e4dcb2d2681370ed60a
Reviewed-on: https://code.wireshark.org/review/6128
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-01-01 23:11:10 +00:00
Guy Harris b445b3da44 Rename wsutil/floor.[ch] to wsutil/floorl.[ch].
That better indicates what they do - they don't supply floor(), as
that's a standard math.h feature dating back before C89, they supply
floorl().

Change-Id: Ib1278c51cdfc57680c28c51de87eafb2cb50c8eb
Reviewed-on: https://code.wireshark.org/review/5905
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20 03:44:34 +00:00
Guy Harris b736896490 Handle floorl() the same way we handle other not-on-all-platforms functions.
Use AC_CHECK_FUNC() for it, define FLOORL_LO to floorl.lo if we *don't*
have it, add FLOORL_LO to the list of items conditionally built in
libwsutil, and include "wsutil/floor.h" only if HAVE_FLOORL is *not*
defined, as that means it's *not* supplied by the platform and thus
*not* declared in <math.h>.

Also, use the standard export stuff in wsutil/floor.h.

Change-Id: Ic24aa69f65f2d15450d8b84b0c2b0c58f38edebe
Reviewed-on: https://code.wireshark.org/review/5901
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20 02:54:04 +00:00
Stephen Fisher 71fc2f8a7a Another missing change, to include floor.h
Change-Id: Ice962bb9d62ab99f225228bf1e78850947eea625
Reviewed-on: https://code.wireshark.org/review/5895
Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-12-20 00:28:11 +00:00
Stephen Fisher 47dc4e77cc Revert "Provide a floorl() function (which is currently only able to call GCC's __builtin_floorl() function) for systems which don't provide one." because I left off the new wsutil/floor.[ch] files
This reverts commit e2586ec36d.

Change-Id: Ie38b7f32b2d21e3beba5173eec22ca12b7f5da91
Reviewed-on: https://code.wireshark.org/review/5891
Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-12-19 23:12:09 +00:00
Stephen Fisher e2586ec36d Provide a floorl() function (which is currently only able to call GCC's
__builtin_floorl() function) for systems which don't provide one.

Change-Id: Ie0140ff195f0eae525c7bd70c7c3e23039fde569
Reviewed-on: https://code.wireshark.org/review/5889
Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-12-19 22:56:18 +00:00
Guy Harris 63ab36be92 Don't use <ctype.h> macros, and eliminate an include of <ctype.h>.
This avoids locale-dependent tests, and fixes cases where we passed
signed char values to those macros (which is not safe with char being
signed, as it is on most, but not all, platforms).

Change-Id: Iea962cd7e4dfaf33c3c873ba43814cc6ed298d94
Reviewed-on: https://code.wireshark.org/review/4764
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 06:41:58 +00:00
Bill Meier 07698d536b Adjust some whitespace to match editor modelines.
Change-Id: Ia22cac3ebd7a454c156f98d967e6fd61f708a2b3
Reviewed-on: https://code.wireshark.org/review/4489
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06 02:55:49 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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-03-04 14:27:33 +00:00
Jakub Zawadzki 4cf7cdd387 fix some warnings.
svn path=/trunk/; revision=54334
2013-12-21 17:34:41 +00:00
Jakub Zawadzki 3d975361a2 From r50772 we don't need first_packet in modify_time_perform(), so we can remove whole initialization op.
svn path=/trunk/; revision=51078
2013-07-31 22:07:05 +00:00
Jakub Zawadzki c702e92121 Replace relative timestamp with reference frame number. Saves 16B per frame.
svn path=/trunk/; revision=50772
2013-07-21 23:07:33 +00:00
Gerald Combs 962b4f08f7 Move common time shifting code to ui/time_shift.[ch]. Change the
shifting routines to return an error message on failure or NULL on
success.  Prettify and simplify the layout of the GTK+ time shift
dialog. Make the cancel button work as expected.

Add a time shift dialog to the Qt port. I used a Mad Lib (sentence)
layout. Hopefully that won't make translation too difficult.  For some
reason time shifts aren't immediately shown in the packet detail. This
appears to be a bug in the packet list / packet detail code.

Add warning role color definitions to tango_colors.h and use them.

svn path=/trunk/; revision=46680
2012-12-21 17:37:57 +00:00