Commit Graph

57 Commits

Author SHA1 Message Date
Gerald Combs 92802883a6 Change the "--enable-setuid-install" option to install dumpcap and TShark
setuid instead of Wireshark.  Remove the "DANGEROUS" notices, but leave it
disabled by default.  Whine if the user runs Wireshark or TShark as root.
Add a preference to disable the whining.  Add a "setuid-root" script that
can be used to switch dumpcap and TShark's setuid-ness on and off for
development and testing.  Update the release notes and README.packaging.

svn path=/trunk/; revision=22733
2007-08-30 00:24:40 +00:00
Guy Harris 87dd0d2636 Make the routines that manipulate the hex/text display window take a
GtkWidget * as an argument, rather than a version-of-GTK+-dependent
pointer; that way, we need fewer #ifdefs.

Use WIDGET_SET_SIZE() instead of #ifdeffed code using
gtk_widget_set_usize() or gtk_widget_set_size_request() -
WIDGET_SET_SIZE() was created to encapsulate that GTK+ 1.2[.x] vs. 2.x
difference.

Make some variables not used outside gtk/main.c static.

Clean up white space.

Clean up handling of return value from load_airpcap() a bit.

Use one big #ifdef HAVE_AIRPCAP/#endif for all the AirPcap stuff in
gtk/main.c.

Attach _U_ to the unused arguments to driver_warning_dialog_cb(), not to
the arguments that are being used - and don't include it at all if
HAVE_AIRPCAP isn't defined, as it's not used in that case.

svn path=/trunk/; revision=19798
2006-11-05 00:54:17 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Jörg Mayer b55266d3c0 - Include ../ui_util.h into files that implement functions declard in
ui_util.h
- Replace one instance of ui_util.h by gui_utils.h

svn path=/trunk/; revision=15468
2005-08-20 12:57:52 +00:00
Ulf Lamping eafbbbcabb renamed ui_util.c/.h to gui_utils.c/.h to prevent confusion with identical named ui_util.h in / dir
svn path=/trunk/; revision=15465
2005-08-20 12:09:48 +00:00
Jörg Mayer a0506eb598 Undo the last "fix" (13626): Unconditionally including <pcap.h> is
going to cause trouble for compilations without libpcap.

svn path=/trunk/; revision=13628
2005-03-06 10:26:00 +00:00
Jörg Mayer af9b899e73 Warning fix:
../capture.h:115: warning: struct pcap_stat declared inside parameter list
../capture.h:115: warning: its scope is only this definition or declaration,
        which is probably not what you want
../capture.h:125: warning: struct pcap_stat declared inside parameter list


svn path=/trunk/; revision=13626
2005-03-06 10:02:39 +00:00
Guy Harris 467e33d1b1 Make the "col_data" field in a "column_info" structure a pointer to an
array of "const char *" rather than to an array of "char *", and make
the second argument of "col_set_str()" a "const char *" - there's no
guarantee that "col_data" points to something you're allowed to modify.

svn path=/trunk/; revision=12875
2004-12-30 23:42:02 +00:00
Guy Harris 7f5b234c5c Move the column preferences stuff to epan (the rest of the preferences
stuff is already there).

Update Gerald's e-mail address in column.h.

svn path=/trunk/; revision=12131
2004-09-29 02:54:22 +00:00
Guy Harris bbe7f89742 Move prefs.c and prefs.h into the epan subdirectory.
svn path=/trunk/; revision=12115
2004-09-27 22:55:15 +00:00
Guy Harris 3a583aeb59 From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that an
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).

svn path=/trunk/; revision=11615
2004-08-06 19:57:49 +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 7d37fc9d23 more code cleanup from dialog things:
changed window_xy (dialog) function calling in a lot of gtk files
cleanup of file selection code
cleanup in dlg_utils/file_dlg/ui_util
Please report any problems!!!

svn path=/trunk/; revision=11003
2004-05-26 03:49:24 +00:00
Guy Harris 36ece5a17a Add a "window_new()" routine that creates a window of a given type, sets
the title, and arranges to set the icon for it.  Use that instead of
"gtk_window_new()" and separate calls to set the title and arrange to
set the icon.

Regularize #includes a bit.

Clean up white space.

svn path=/trunk/; revision=10054
2004-02-13 00:53:37 +00:00
Ulf Lamping 453309c0c6 added some menuitems "View->Show" including show/hide of all main widgets,
saving the states in the recent file

svn path=/trunk/; revision=9726
2004-01-19 00:42:12 +00:00
Olivier Abad 29011060de Use gtk1/gtk2 compatibility macros to reduce #ifdefs.
svn path=/trunk/; revision=6610
2002-11-11 15:39:06 +00:00
Olivier Abad 05ef1fc475 Merge gtk and gtk2 directories.
svn path=/trunk/; revision=6552
2002-11-03 17:38:45 +00:00
Jörg Mayer e4a2e2cefe Include cleanups in gtk and gtk2:
Remove unneded includes
Add include wrappers where missing

svn path=/trunk/; revision=6191
2002-09-05 18:48:52 +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 117f95bb39 Clean up white space.
svn path=/trunk/; revision=5615
2002-06-04 07:48:57 +00:00
Guy Harris 392a7dfc04 Get rid of the "data_src" member of the "frame_data" structure; put it
in the "packet_info" structure instead, as we don't need a pointer for
every single frame in the capture file, just for each frame for which we
currently have an open "epan_dissect_t".

svn path=/trunk/; revision=5614
2002-06-04 07:03:57 +00:00
Guy Harris f5c5669291 Get rid of unused arguments.
Use the "nb" argument to "redraw_hex_dump()", so we redraw the specified
byte view pane, rather than always redrawing the main window's byte view
pane (and never redrawing the byte view pane of additional packet
windows, so that the font for them doesn't change if you change the font
preference).

svn path=/trunk/; revision=5066
2002-03-31 23:11:04 +00:00
Guy Harris e28f56867d From Joerg Mayer: remove unused variables.
svn path=/trunk/; revision=4879
2002-03-05 12:03:27 +00:00
Guy Harris 5fe414c555 From Joerg Mayer: use _U_ to flag unused arguments.
svn path=/trunk/; revision=4878
2002-03-05 11:56:00 +00:00
Guy Harris 6a21dc7e44 Don't give tvbuffs names; instead, give data sources names, where a
"data source" has a name and a top-level tvbuff, and frames can have a
list of data sources associated with them.

Use the tvbuff pointer to determine which data source is the data source
for a given field; this means we don't have to worry about multiple data
sources with the same name - the only thing the name does is label the
notebook tab for the display of the data source, and label the hex dump
of the data source in print/Tethereal output.

Clean up a bunch of things discovered in the process of doing the above.

svn path=/trunk/; revision=4749
2002-02-18 01:08:44 +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 feb5791d6a Have a routine to create a scrolled window, set its vertical scrollbar
preference, and add it to the list of scrolled windows; call that
routine to create scrolled windows, rather than creating it and calling
other routines to do the other two operations.

As "set_scrollbar_placement_all()" and "set_ctree_styles_all()" always
set the styles to match the user's preference, don't have them take an
argument, have them just use the user's preference settings.

Get rid of unnecessary includes of "prefs_dlg.h", replacing them with
includes of "prefs.h" if necessary.  Don't have "prefs_dlg.h" include
"prefs.h" - its sole purpose is to declare routines defined in
"prefs_dlg.c" - and add any additional includes of "prefs.h" this
requires.

Get rid of unnecessary includes of "prefs.h" and "gtkglobals.h".

Fix up white space.

svn path=/trunk/; revision=4521
2002-01-11 07:40:32 +00:00
Gilbert Ramirez 791f5774d0 Provide for per-protocol-tree data in the proto_tree code.
Put a hash-table of "interesting" fields in the per-proto-tree data.
The dfilter code records which fields/protocols are "interesting" (by which
I mean, their value or existence is checked). Thus, the proto_tree routines
can create special arrays of field_info*'s that are ready for the dfilter
engine to use during a filter operation.

Also store the "proto_tree_is_visible" boolean, renamed "visible", in
the per-proto-tree data.

Move epan_dissect_t to its own header file to make #include dependencies
easier to handle.

Provide epan_dissect_fill_in_columns(), which accepts just the epan_dissect_t*
as an argument.

epan_dissect_new() needs to be followed by epan_dissect_run() for the
dissection to actually take place. Between those two calls,
epan_dissect_prime_dfilter() can be run 0, 1, or multiple times in order to
prime the empty proto_tree with the "intersesting" fields from the dfilter_t.

svn path=/trunk/; revision=4422
2001-12-18 19:09:08 +00:00
Guy Harris 794f0c04f4 Add an extra argument to "epan_dissect_new()" that indicates whether the
display representation should be put into protocol tree items if a
protocol tree is to be constructed; have it set "proto_tree_is_visible"
from that argument.

svn path=/trunk/; revision=4408
2001-12-16 22:16:14 +00:00
Guy Harris 23319ff023 Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently
stored with each frame should be in the "frame_data" structure, and the
"column_info" structure is not guaranteed to hold the column values for
that frame at all times - it was only in the "frame_data" structure so
that it could be passed to dissectors, and, as all dissectors are now
passed a pointer to a "packet_info" structure, it could just as well be
put in the "packet_info" structure.

That saves memory, by shrinking the "frame_data" structure (there's one
of those per frame), and also lets us clean up the code a bit.

svn path=/trunk/; revision=4370
2001-12-10 00:26:21 +00:00
Gilbert Ramirez 6542c18172 Remove proto_tree from capture_file and PacketWinData, since they
already contain a pointer to an epan_dissect_t, which contains
the proto_tree.

Routines calling epan_dissect_new() do not create their own
proto_tree via proto_tree_create_root(); instead, they pass a boolean
to epan_dissect_new() telling it whether it should create the root
proto_tree.

svn path=/trunk/; revision=4343
2001-12-06 04:25:09 +00:00
Guy Harris 6f776aa40d Get rid of some unused variables.
svn path=/trunk/; revision=4239
2001-11-21 01:02:03 +00:00
Guy Harris 1c3f2e4cd5 Have a routine to add all the hex dump tabs to the hex dump notebook,
and call it both from "select_packet()" and "create_new_window()",
rather than having two similar loops in both places.

svn path=/trunk/; revision=4233
2001-11-20 10:37:16 +00:00
Guy Harris 800030b8a0 If bytes in a hex dump view are selected, the field in the corresponding
text view should be selected, rather than always selecting a field in
the main text view.

svn path=/trunk/; revision=4232
2001-11-20 10:10:45 +00:00
Guy Harris 8550cfcc6f Allow the tvbuff pointer to various "proto_tree_add" routines to be null
if (and only if) the length of the item being added is 0 (so that it has
no data backing it).

This means the data stream name pointer for the item in question is
null; make sure we handle that.

Use that for some "uses the value from the matching request" fields in
the SMB Pipe protocol.

svn path=/trunk/; revision=4231
2001-11-20 09:07:34 +00:00
Guy Harris 9d601c6799 On Windows, use the directory in which the binary resides as the
directory in which global data files are stored.  If an installed binary
is being run, that's the correct directory for them; if a build-tree
binary is being run, the "manuf" file will be there, and you can put
other data files there as well, if necessary.

Do the same with plugins, except that, if there's no
"plugins\\{version}" subdirectory of that directory, fall back on the
default installation directory, so you at least have a place where you
can put plugins for use by build-tree binaries.  (Should we, instead,
have the Windows build procedure create a subdirectory of the "plugins"
source directory, with the plugin version number as its name, and copy
the plugins there, so you'd use the build-tree plugin binaries?)

Move "test_for_directory()" out of "util.c" and into
"epan/filesystem.c", with the other file system access portability
wrappers and convenience routines.  Fix "util.h" not to declare it - or
other routines moved to "epan/filesystem.c" a while ago.

svn path=/trunk/; revision=3858
2001-08-21 06:39:18 +00:00
Guy Harris 92a7d9b2eb Fix typos in comments.
svn path=/trunk/; revision=3185
2001-03-24 23:53:07 +00:00
Guy Harris 8ac0e6618a The declaration of "destroy_packet_wins()" belongs in
"gtk/packet_win.h", along with the declarations of the other packet
window manipulation routines; put it there.

svn path=/trunk/; revision=3180
2001-03-24 02:14:56 +00:00
Jeff Foster 395b68ea19 Changes required to support multiple named data sources.
Tvbuffers changed to added the data source name,
GUI and printing code changed to support these changes
and display the multiple hex views.

svn path=/trunk/; revision=3165
2001-03-23 14:44:04 +00:00
Guy Harris bf0a3a32d1 In Ethereal, attempt to get the packet statistics from libpcap when
capturing; if we succeed, display the packet drops count as the "Drops"
value in the status line and as the "Dropped packets" statistics in the
summary dialog box, otherwise don't display it at all.

In Tethereal, attempt to get the packet statistics from libpcap when
capturing; if we succeed, and if there were any dropped packets, print
out the count of dropped packets when the capture finishes.

svn path=/trunk/; revision=3016
2001-02-11 09:28:17 +00:00
Gilbert Ramirez 8f1fff2e6a Create a more modular type system for the FT_* types. Put them
into epan/ftypes.

Re-write display filter routines using Lemon parser instead of yacc.
Besides using a different tool, the new grammar is much simpler, while
the display filter engine itself is more powerful and more easily extended.

Add dftest executable, to test display filter "bytecode" generation.
Add option to "configure" to build dftest or randpkt, both of which are not
built by default.

Implement Ed Warnicke's ideas about dranges in the new display filter and
ftype code.

Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered
as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree,
while FT_PROTOCOL is used for protocols. This was necessary for being
able to make byte slices (ranges) out of protocols, like "frame[0:3]"

Win32 Makefile.nmake's will be added tonight.

svn path=/trunk/; revision=2967
2001-02-01 20:21:25 +00:00
Gilbert Ramirez e69b5278aa Implement epan_dissect_new() and epan_dissect_free(). These are the
"top-level" dissectors that libepan-users call, instead of dissect_packet().
The epan_dissect_t holds the tvbuff after dissection so that the tvbuff's
memory is not cleared until after the proto_tree is freed. (I might stuff
the proto_tree into the epan_dissect_t, too).

What remains of dissect_packet() in packet.c handles the tvbuff initialiation.
The real meat of dissect_packet() is now in dissect_frame(), in packet-frame.c
This means that "packet.c" is no longer a dissector, os it is no longer
passed to make-reg-dotc.

Once dissect_fddi() gets two wrapper functions (dissect_fddi_swapped()
and dissect_fddi_nonswapped()), the a dissector handoff routine could
be used instead of the switch statement in dissect_frame(). I'd register
a field like "wtap.encap"

svn path=/trunk/; revision=2478
2000-10-06 10:11:40 +00:00
Guy Harris f0efbd1a02 "redraw_hex_dump()" can't use "cfile.pd" or "cfile.current_frame", as it
may be redrawing a packet window that displays a frame other than the
current frame; give it arguments to specify the raw frame data and
"frame_data" structure for the frame.

This requires that each packet window have, associated with it, a
pointer to the "frame_data" structure; that replaces the "cap_len" and
"encoding" fields in a "PacketWinData" structure, as those are just
copies of fields from the frame's "frame_data" structure.

"packet_hex_print()" needn't be passed both the start and length values
from a "field_info" structure - just pass it a pointer to that
structure, or NULL for "no field is selected in the packet".  It also
needn't, any longer, be passed the "cap_len" and "flags.encoding" fields
of a "frame_data" structure - just pass it a pointer to that structure.

In "redraw_hex_dump_all()", don't redraw the hex dump pane of the main
window if there is no current frame.

svn path=/trunk/; revision=2404
2000-09-09 10:26:58 +00:00
Guy Harris e91341e3c3 Redraw:
the text in all "Follow TCP Stream" windows;

	the text in the help window if we have one up;

	all hex dump windows;

when GUI preference changes are to be applied, so that font changes and
"Follow TCP Stream" color changes show up.

Update both the Roman and bold font when the font is changed.

Don't decrement the reference counts on the old Roman and bold fonts
until that's all done.

svn path=/trunk/; revision=2401
2000-09-08 10:59:21 +00:00
Guy Harris b85ddbe885 Graham Bloice's patch to support inverse video rather than boldface
highlighting of the bytes, in the hex dump window, corresponding to a
selected field.

Also, make "remember_ptree_widget()" static, as it's not used outside
"gtk/proto_draw.c".

svn path=/trunk/; revision=2399
2000-09-08 09:50:08 +00:00
Guy Harris 023bf363b5 Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:

	"fetch" - fetch from the notebook tab any values not already
	stored in "prefs", and store them there, but doesn't apply them;

	"apply" - apply the settings in "prefs";

	"destroy" - clean up any windows created from the tab.

As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.

Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.

Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".

Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows.  Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".

Make the font one of the preferences we can set on the fly for protocol
tree widgets.  Also make it something we can set on the fly for the
packet list widget.

svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
Guy Harris da88c237c2 It was silly of me to require that "forget_scrolled_window()" be called
explicitly; the right thing to do was to have
"remember_scrolled_window()" catch the "destroy" signal on the scrolled
window widget, and have the handler for that signal forget the scrolled
window.

Doing that obviates the need to have creators of scrolled windows keep
track of the windows they have and forget them when they're destroyed.

The signal for a "the window manager has requested that this window go
away" event is "delete_event", not "delete-event"; fix the
"gtk_signal_connect()" calls that were using "delete-event".

svn path=/trunk/; revision=2284
2000-08-17 07:56:44 +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
Gilbert Ramirez d7e6e0e384 Add wtap-int.h. Move definitions relevant to the internal workins of wiretap
to that file, leave public definitions in wtap.h.

Rename "union pseudo_header" to "union wtap_pseudo_header".
Make the wtap_pseudo_header pointer available in packet_info struct.

svn path=/trunk/; revision=1989
2000-05-19 23:07:04 +00:00