Commit Graph

51 Commits

Author SHA1 Message Date
Moshe Kaplan 7567432ec4 Add remaining header files to Doxygen
Add @file markers for remaining
header files so that Doxygen will
generate documentation for them.
2021-12-12 03:56:35 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
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>
2019-07-26 18:44:40 +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
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 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
Gerald Combs 775bbbcded Start using SPDX license identifiers.
A while back Graham pointed out the SPDX project (spdx.org), which is
working on standardizing license specifications:

https://www.wireshark.org/lists/wireshark-dev/201509/msg00119.html

Appendix V of the specification describes a short identifier
(SPDX-License-Identifier) that you can use in place of boilerplate in
your source files:

https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b

Start the conversion process with our top-level C and C++ files.

Change-Id: Iba1d835776714deb6285e2181e8ca17f95221878
Reviewed-on: https://code.wireshark.org/review/24302
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-09 20:03:51 +00:00
Bill Meier bfe3706035 Always put editor-modelines at the end of the file ...
... to ensure that there are no potential issues with respect to
editors limiting the number of lines scanned at the end of the file
when checking for editor modelines.

Change-Id: Ic85cbb108bb5159d6ec4116fea11f5eebb4e44a4
Reviewed-on: https://code.wireshark.org/review/4688
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-14 20:08:29 +00:00
Bill Meier 1b8b2a8aa8 Add editor modelines; Adjust whitespace as needed.
Change-Id: I4da7b335d905dbca10bbce03aa88e1cdeeb1f8ad
Reviewed-on: https://code.wireshark.org/review/4626
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-12 18:58:32 +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 bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Gerald Combs 6b178bd415 Add 'extern "C"' wrappers and #include guards to various header files.
svn path=/trunk/; revision=40321
2011-12-29 00:08:47 +00:00
Anders Broman f2e7cc9518 Do as the comment says - move the variable to gtkglobals.
svn path=/trunk/; revision=38791
2011-08-30 07:33:24 +00:00
Anders Broman 0cf099392c Path from Joerg Mayer, I'm committing it as I think the right thing to do is to have all menus defined in the GUI and then hide the ones
not available/usable and thuss get rid of a lot of #ifdefs.

As for the icons we should load all of them even if some are not needed in all configurations.

svn path=/trunk/; revision=38789
2011-08-30 05:20:37 +00:00
Stephen Fisher 4c1b59c989 Wrap include file in extern "C" { ... } for __cplusplus
svn path=/trunk/; revision=35521
2011-01-13 17:39:54 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Guy Harris b8136fbfa9 Add a routine to attempt to get the absolute pathname of the executable
file, strip off the last component to get the pathname of the directory
containing the executable file, and save it for future use.  On Windows,
you can get that from the OS, but, on UN*X, you have to look at argv[0]
and derive the absolute path from that (argv[0] is not guaranteed to be
an absolute path, or even a path at all).  (In addition, if you're
running from the build directory, you might have to strip off a ".libs/"
added to argv[0] as an artifact of the libtoolizing script.)

Use that in the About dialog, and use it to construct the path of
dumpcap.

Don't put quotes into the path of dumpcap; you don't have to quote
strings with spaces in them when handing them to execvp and, in fact,
you *mustn't* quote them, as the quotes will be treated as part of the
pathname.

svn path=/trunk/; revision=17267
2006-02-12 03:15:29 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
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-07-18 00:24:25 +00:00
Ulf Lamping 0af3839716 various code cleanups
svn path=/trunk/; revision=11053
2004-06-01 17:37:10 +00:00
Olivier Biot 11f9232336 From Lars Roland: Move timestamp_type into libethereal and provide accessor
methods for getting and setting the timestamp type.

This is a move towards a real libethereal shared library.

svn path=/trunk/; revision=10402
2004-03-18 19:04:33 +00:00
Guy Harris 219b6cefa2 Based on a patch from Brian Fundakowski Feldman, add support for setting
link-layer type when capturing, using the "pcap_set_datalink()" and
related APIs.

svn path=/trunk/; revision=8848
2003-11-01 02:30:18 +00:00
Guy Harris dd628e00c7 Make "finfo_selected" a member of a "capture_file" structure rather than
an independent global variable.

svn path=/trunk/; revision=8524
2003-09-24 00:47:37 +00:00
Jörg Mayer f8c12c2520 Remove unused include
svn path=/trunk/; revision=6199
2002-09-06 18:29:41 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"epan/..." pathnames, so as to avoid collisions with header files in any
of the directories in which we look (e.g., "proto.h", as some other
package has its own "proto.h" file which it installs in the top-level
include directory).

Don't add "-I" flags to search "epan", as that's no longer necessary
(and we want includes of "epan" headers to fail if the "epan/" is left
out, so that we don't re-introduce includes lacking "epan/").

svn path=/trunk/; revision=4586
2002-01-21 07:37:49 +00:00
Guy Harris b3f81eb30c Separate the promiscuous mode, "Update list of packets in real time",
and "Automatic scrolling in live capture" options from the preference
settings for them, so that the preference settings affect the initial
values of those options, but changing those values in a capture don't
affect the preferences, and don't automatically get saved when you save
the preferences.

If we're building without libpcap, don't have an "Automatic scrolling in
live capture" option anywhere.

svn path=/trunk/; revision=4514
2002-01-10 11:05:50 +00:00
Guy Harris 2851b7ef76 Enable "Match Selected" only if there's a field selected *and* we can do
a "Match Selected" on it - we can't do a "Match Selected" if the field
has no value (e.g., FT_NULL) and has a length of 0.

If we unselect the current packet, we don't have a protocol tree, so we
don't have a currently selected field - clear the "Match Selected" menu
item and the display in the status line of information about the
currently selected field.

Move the low-level statusbar manipulation into "gtk/main.c", in routines
whose API doesn't expose anything GTK+-ish.

"close_cap_file()" calls one of those routines to clear out the status
bar, so it doesn't need to take a pointer to the statusbar widget as an
argument.

"clear_tree_and_hex_views()" is purely a display-manipulating routine;
move it to "gtk/proto_draw.c".

Extract from "tree_view_unselect_row_cb()" an "unselect_field()" routine
to do all the work that needs to be done if the currently selected
protocol tree row is unselected, and call it if the currently selected
packet list row is unselected (if it's unselected, there *is* no
protocol tree, so no row can be selected), as well as from
"tree_view_unselect_row_cb()".

Before pushing a new field-description message onto the statusbar, pop
the old one off.

Get rid of an unused variable (set, but not used).

svn path=/trunk/; revision=3513
2001-06-05 07:39:31 +00:00
Guy Harris bdb69627b2 "prefs.capture_real_time", not "prefs.capture_auto_scroll", should
control whether we have a child process do the capturing; a user might
want the packet list to be updated as packets arrive but *not* want it
to scroll so that the most recently arrived packets are shown.

"prefs.capture_auto_scroll", not "auto_scroll_live", should control
whether we scroll a real-time-update capture's packet list;
"auto_scroll_live" isn't set by the capture dialog box,
"prefs_capture_auto_scroll" is.

svn path=/trunk/; revision=3388
2001-05-01 00:18:48 +00:00
Guy Harris c58b7b49b5 Make "comp_info_str" static in Ethereal - there's no need for it outside
"gtk/main.c" in Ethereal.

Add the GLib version to it in Ethereal, and put in the GLib version
rather than the GTK+ version in Tethereal (which isn't linked with
GTK+...).

Make it a GString; this makes the code to construct it slightly less
ugly, especially now that we're putting the GLib version in.

Fix the code for the "-D" flag in Tethereal to compile in a no-libpcap
version (in a no-libpcap version, it just says that this version of
Tethereal wasn't compiled with capture support).

svn path=/trunk/; revision=3196
2001-03-27 06:48:12 +00:00
Guy Harris fb84384942 Move the declaration of "g_resolving_actif" from the top-level
"globals.h" file to "epan/resolv.h", as it's exported by
"epan/resolv.c", have files that use "g_resolving_actif" include
"resolv.h", and don't have "epan/resolv.c" include "globals.h" so that
it doesn't drag in, for example, headers that, in turn, drag in GTK+
headers.

svn path=/trunk/; revision=2517
2000-10-19 22:59:24 +00:00
Gilbert Ramirez 9d9850f209 More EPAN-related code movements. Get rid of usage of #include "globals.h"
and #include "util.h" from epan code. Move get_home_dir() into epan/filesystem.c
as it's used by plugins.c.

svn path=/trunk/; revision=2461
2000-09-28 03:16:29 +00:00
Guy Harris e697eb8e9f Instead of having the normal-weight and bold fonts set separately,
generate the name of the boldface font from the Roman font; if the two
fonts don't have the same widths, the display will look weird when a
field is selected, and it's a bit of a pain for the user to have to
select *two* fonts.

On UNIX/X, default to
"-*-fixed-medium-r-semicondensed-*-*-120-*-*-*-*-*-" rather than to
"-*-lucidatypewriter-medium-r-normal-*-*-120-*-*-*-*-iso8859-1" - some
Linux distributions appear to lack the Lucida typewriter font.

Add a "gui.font_name" preference to the preferences file, specifying the
normal-weight font to use.  Have it settable from the "GUI" tab in the
Preferences dialog box - the "Font..." button, when clicked, pops up a
font selection dialog box.

If we either can't open the selected font or the boldfaced version of
the font, default to "6x13" and "6x13bold" as fallbacks - the former
will probably be "fixed", and the latter would be "fixedbold" if X
actually created such an alias, but it doesn't so we use "6x13bold"
instead.

svn path=/trunk/; revision=2304
2000-08-20 07:53:45 +00:00
Laurent Deniel 6a480953a9 Miscellaneous code cleaning
- add <stdarg.h> or <varargs.h> in snprintf.h
  and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes

- remove the check of multiple inclusions in source (.c)  code
  (there is a bit loss of _cpp_ performance, but I prefer the gain of
   code reading and maintenance; and nowadays, disk caches and VM are
   correctly optimized ;-).

- protect all (well almost) header files against multiple inclusions

- add header (i.e. GPL license) in some include files

- reorganize a bit the way header files are included:

  First:
  #include <system_include_files>
  #include <external_package_include_files (e.g. gtk, glib etc.)>
  Then
  #include "ethereal_include_files"

  with the correct HAVE_XXX or NEED_XXX protections.

- add some HAVE_XXX checks before including some system header files

- add the same HAVE_XXX in wiretap as in ethereal

Please forgive me, if I break something (I've only compiled and regression
tested on Linux).

svn path=/trunk/; revision=2254
2000-08-11 13:37:21 +00:00
Gilbert Ramirez a3e7190456 Add a "Save As" feature to the TCP Follow dialogue, to save the stream
file to a user-specified file.

Move the file-copy routine in save_cap_file() to an indepenent
function in file.c  (copy_binary_file()) so that follow_dlg.c can use it.

Remove #include "follow.h" from the C files that don't need it.

svn path=/trunk/; revision=2200
2000-08-03 12:44:40 +00:00
Guy Harris 7fbf320b8a Patch from Ben Fowler to rename the global variable "cf" to "cfile", to
make it easier to use grep to find all references to it without getting
a lot of false hits and to check, after allocating the memory chunk for
"frame_data" structures, that the allocation succeeded.

svn path=/trunk/; revision=2092
2000-06-27 04:36:03 +00:00
Guy Harris 8e68faf22f Encapsulate the code to take a pointer to a pathname and return a
pointer to the name of the file to which it refers (i.e., to the last
component of the pathname) in a "get_basename()" routine, and have the
code in "file.c" call it.

svn path=/trunk/; revision=1552
2000-01-25 04:31:17 +00:00
Guy Harris 59fcaf5c03 On Win32, when splitting file names into directory and last component,
search for '\' rather than '/'.

svn path=/trunk/; revision=1545
2000-01-25 00:17:01 +00:00
Guy Harris f393a19883 Heikki Vatiainen's patch to add a flag to control whether to interpret
the IPv4 TOS field as a TOS field or as a DiffServ field, and allow that
field to be controlled by a command-line option or an option in the
"Display:Options" dialog box.

svn path=/trunk/; revision=1532
2000-01-24 04:44:58 +00:00
Guy Harris 9f60ef9ce2 Don't include "print.h" in "globals.h"; have the few files that need
stuff from it include it themselves.

svn path=/trunk/; revision=1424
2000-01-06 06:28:54 +00:00
Guy Harris d035d071ec Get rid of the commented-out GTK+ declarations.
svn path=/trunk/; revision=1386
1999-12-29 05:48:25 +00:00
Gilbert Ramirez b91d595c77 Change match_selected() to produce a display filter using the selected
field's name, if possible. (If the selected field is not a registered field,
then of course, we still have to use the frame[x:y] syntax).

tree_selected_start and tree_selected_len are on longer globals variables;
finfo_selected has replaced them.

svn path=/trunk/; revision=1070
1999-11-19 22:32:00 +00:00
Gilbert Ramirez b0cfa34169 Move GTK-related stuff out of globals.h and put it in gtk/gtkglobals.h
svn path=/trunk/; revision=896
1999-10-20 22:36:05 +00:00
Guy Harris 3395559532 Move the declaration of global variables involved with packet capture
from "globals.h" to "capture.h".

Only "capture.c" needs to include <pcap.h>; move the include of <pcap.h>
from "capture.h" to "capture.c".

We no longer need any DLT_ defines (that's handled inside Wiretap);
remove the defines of DLT_ from "capture.h".

svn path=/trunk/; revision=753
1999-10-02 19:24:27 +00:00
Guy Harris bab015f5e5 Add a new global flag "capture_child", which is TRUE if we're a child
process for a sync mode or fork mode capture.

Have that flag control whether we do things that *only* the parent or
*only* the child should do, rather than basing it solely on the setting
of "sync_mode" or "fork_mode" (or, in the case of stuff done in the
child process either in sync mode or fork mode, rather than basing it on
the setting of those flags at all).

Split "do_capture()" into a "run_capture()" routine that starts a
capture (possibly by forking off and execing a child process, if we're
supposed to do sync mode or fork mode captures), and that assumes the
file to which the capture is to write has already been opened and that
"cf.save_file_fd" is the file descriptor for that file, and a
"do_capture()" routine that creates a temporary file, getting an FD for
it, and calls "run_capture()".

Use "run_capture()", rather than "capture()", for "-k" captures, so that
it'll do the capture in a child process if "-S" or "-F" was specified
("do_capture()" won't do because "-k" captures should write to the file
specified by the "-w" flag, not some random temporary file).

For child process captures, however, just use "capture()" - the child
process shouldn't itself fork off a child if we're in sync or fork mode,
and should just write to the file whose file descriptor was specified by
the "-W" flag on the command line.

All this allows you to do "ethereal -S -w <file> -i <interface> -k" to
start a sync mode capture from the command line.

svn path=/trunk/; revision=740
1999-09-30 06:50:01 +00:00
Guy Harris e4f7809763 Add an item to the "File/Print" dialog box to ask that the full hex data
of the packet be printed (this is only done if "Print detail" is
selected; it should be grayed out of "Print summary" is selected).

If that item is selected, suppress the hex printing of uninterpreted
data items in the protocol tree.

Move some GTK+ keys not used outside of "gtk/print_dlg.c" from
"gtk/keys.h" into "gtk/print_dlg.c".

svn path=/trunk/; revision=736
1999-09-29 22:19:24 +00:00
Laurent Deniel a673e8bb2c Added name resolution in GUI part:
- Capture->Start->"Active name resolution"

Allows the user to turn on/off name resolution
during a live capture.

- Display->Options->"Name resolution"

Turn on/off name resolution for the displayed
data (or during the -S mode).
E.g. clicking on a packet captured with
resolution disabled will resolve names in
the detailed list if this option is set.
And applying or resetting a display filter
allows the update of the packet list as well.

svn path=/trunk/; revision=726
1999-09-26 14:40:01 +00:00
Guy Harris 12d3278d0b Move the toolkit-independent code to create a temporary capture file,
and to fork off and run a separate copy of "ethereal" for "-S" and "-F"
captures or just call "capture()" otherwise, out of "gtk/capture_dlg.c"
and into a routine in "capture.c".

If the attempt to create said temporary capture file fails, pop up a
dialog box and don't do the capture.

Have the child capture process send a message upstream after it either
successfully starts the capture and syncs out the header of the capture
file, or fails to start the capture; the message indicates whether it
succeeded or failed, and, if it failed, includes a failure message.
This:

	avoids the use of a signal, and thus means we don't have to
	worry about whether to capture the signal, or whether to start
	or stop capturing depending on whether this particular capture
	is in sync mode or not;

	lets us pop up the message box for the error in the parent
	process if we're in sync mode, rather than doing it in the
	child, which didn't work well.


Add a check button to the Capture/Start dialog box, so that we can
control, for each capture, whether it's to be done in sync mode or not.

svn path=/trunk/; revision=708
1999-09-23 06:27:27 +00:00
Laurent Deniel 3bd68e680b Added "Automatic scrolling in live capture".
This display option is disabled by default.

svn path=/trunk/; revision=691
1999-09-19 15:54:54 +00:00
Laurent Deniel 35d5e37a82 Some old CPP or tools that take C code in input do
not like #preprocessor_macros that do not start at
the first column.

So write:

#ifdef FOO
#  include <dummy1.h>
#  define DUMMY 1
#else
#  include <dummy2.h>
#  define DUMMY 2
#endif

instead of

#ifdef FOO
  #include <dummy1.h>
  #define DUMMY 1
#else
  #include <dummy2.h>
  #define DUMMY 2
#endif

svn path=/trunk/; revision=668
1999-09-12 14:34:36 +00:00
Guy Harris dc298db578 Give "globals.h" an RCS ID and copyright/GPL notice.
Move some defines that would be used even by a non-GTK+-based Ethereal
from "gtk/main.h" to "globals.h".

Remove the byte-order #defines from "packet.h", as they're now in
"globals.h" (having been moved there from "gtk/main.h").

Fix up some files that use those #defines to include "globals.h".

"resolv.c" doesn't use any GTK stuff, so it needn't include <gtk/gtk.h>
nor "gtk/main.h" - it only did so to get the byte-order #defines for the
benefit of "packet-ipv6.h", and "packet-ipv6.h" now includes them
itself.

svn path=/trunk/; revision=649
1999-09-10 07:19:51 +00:00
Gilbert Ramirez 8617c58f3c More shuffling of GTK-related routines to gtk subdirectory.
svn path=/trunk/; revision=636
1999-09-09 03:32:03 +00:00