platform-dependent work is now done in get_interface_type().
That means we also don't need to protect the handling of IF_DIALUP or
even IF_AIRPCAP in #ifdefs, just in case we add support for those types
in other OSes.
Nothing's uisng the capture_ethernet_16.xpm image here, so don't bother
including it. (Does *anybody* use it? I couldn't find any uses, but
maybe we should use that.)
svn path=/trunk/; revision=43531
does a ws_stat64() to check for the existence of files in /sys.
It's *not* needed in ui/gtk/main.c any more, as that code was moved out
of ui/gtk/main.c.
svn path=/trunk/; revision=43525
Add an interface monitor that, on Linux distributions with libnl,
watches for interfaces to appear or disappear and, on such an event,
causes windows showing interface lists to update.
svn path=/trunk/; revision=43521
that want a list of interfaces should either call
fill_in_local_interfaces() to make sure the list has been populated at
least once or refresh_local_interface_lists() if they want the list to
be rescanned.
Also make get_interface_type() local to ui/gtk/main.c, as it's not
called from outside ui/gtk/main.c.
Don't declare fill_in_local_interfaces() or hide_interface() unless we
have pcap - we don't define them unless we have pcap.
svn path=/trunk/; revision=43518
fill_capture_box():
if there are interfaces on which to capture, constructs the
interface list, otherwise destroys the interface list and puts
up a message.
update_capture_box():
updates the interface list to reflect current reality.
welcome_if_panel_reload():
if there is an interface list, and if there are interfaces on
which to capture (so that we still want that list), updates the
list by calling update_capture_box(), otherwise creates or
destroys it by calling fill_capture_box() (as either it doesn't
exist but now needs to or does exist but needs to go away).
Have refresh_local_interface_lists(), which re-fetches the list of local
interfaces and updates every interface list that includes local
interfaces, and refresh_non_local_interface_lists(), which only updates
interface lists that (also) include interfaces other than local
interfaces (such as pipes and remote interfaces). Call them in the
apprpriate places (if we know the list of local interfaces has been
updated, call refresh_local_interface_lists(), otherwise, if we know
interfaces other than local interfaces have been added or removed, call
refresh_non_local_interface_lists()).
Don't have any routine that updates the interface list for one widget
update the interface list for any other widget; leave the global
updating of interface lists up to refresh_local_interface_lists() and
refresh_non_local_interface_lists() - only call one of them if any
interface lists are to be updated.
svn path=/trunk/; revision=43517
add a capture_dlg_refresh_if() routine to redraw the list of
interfaces in the Capture -> Interfaces dialog if the lsit of
known interfaces is updated, and have it do that not by
destroying and reconstructing the entire dialog box, but just by
destroying and reconstructing the table containing the
interfaces and their statistics.
From me:
have a refresh_interfaces_cb() routine in ui/gtk/main.c that
scans the local interfaces and refreshes *all* the widgets that
have interface lists;
add a "Refresh Interfaces" item to the Capture menu that calls
that;
have the "Refresh" button in the "Manage Interfaces" window also
call that;
rename the Capture Options window routine dlg_window_present()
to capture_dlg_window_present() to make it clearer *which*
dialog it checks for;
fix Pontus' patch to call capture_stat_stop() *before* nulling
out the global pointer for the statistics cache - if it's called
*after* nulling it out, the argument passed to
capture_stat_stop() is null, and it doesn't kill off the dumpcap
gathering the statistics so they just pile up (and, at least on
OS X, chewing up BPF devices until you run out of BPF devices
that have the right ownership and permissions for dumpcap to use
as a normal user);
if refreshing the interfaces fails to get an interface list,
close the Capture Interfaces dialog.
svn path=/trunk/; revision=43515
the file has unsaved changes, and we can save it in some format
through Wiretap
or
the file is a temporary file and has no unsaved changes (so that
"saving" it just means copying it).
Only allow "Save As" if
we can save it in some format through Wiretap
or
the file is a temporary file and has no unsaved changes (so that
"saving" it just means copying it).
This means that we don't support using "Save As" for just copying the
file unless we can do that with Wiretap; copying the file byte-for-byte
only works as "saving" if there are no unsaved changes *and* we're
saving it in the same format that it's in *and* we're saving it with the
same form of compression (if any) that it has.
Rename cf_can_save_as() to cf_can_write_with_wiretap() to better reflect
what it really does.
svn path=/trunk/; revision=43477
checks for the inability to save comments that we do for UN*X. This
should fix bug 7222, although the UI isn't currently as nice, as the
dialog boxes are Windows dialog boxes and we don't set the button labels
to reflect the actual choices being offered to the user. (We may be
able to do that by using template resources to construct the message
boxes.)
svn path=/trunk/; revision=43444
routine to run a file chooser dialog.
On Windows, add to that code to resolve shell links ("shortcuts"),
adopted from the Sylpheed mail reader. (That code requires a pile of
OLE stuff, so link with the OLE library.)
Make it a bit easier to configure ui/gtk/capture_file_dlg.c to use GTK+
dialogs on Windows, but continue to default to using the Win32 dialogs,
at least for now.
svn path=/trunk/; revision=43439
did not HAVE_LIBNL. Now that we only compile the modules when we HAVE_LIBNL
(and thus the stub no longer exists) there's no need to check for it.
svn path=/trunk/; revision=43430
- ws80211_utils.c is only needed to build dumpcap, not to build wireshark.
If it were different it would probably indicate a bad api design.
ui/gtk/Makefile.common:
- Sort in the toolbar in the right place (alphabetically)
svn path=/trunk/; revision=43415
in a format that supports comments and they do a "Save" by popping up a
similar question to the one we pop up in the "Save As" case and, if they
say "choose another format", pop up a "Save As" dialog box.
svn path=/trunk/; revision=43395
tries to do "Save As" in a format for which we don't support comments
(currently, we only support them for pcap-ng), ask whether they want to
discard the comments and save anyway or, *if* the file can be saved in a
format for which we *do* support comments, they want to save the file in
some other format.
Keep a count of packet comments so that we don't have to scan all the
frame_data structures to determine whether we have any comments.
svn path=/trunk/; revision=43392
they want to overwrite an existing file; just use that. (The Win32 file
chooser also does that itself.) Just do UI for "do you want to
overwrite this {user-immutable,unwritable} file?".
svn path=/trunk/; revision=43381
track of multiple such "save as" windows.
Use modal dialog boxes to report errors, while we're at it. That lets
us keep the dialog open if we get an error.
svn path=/trunk/; revision=43380
- Replace airpcap_tb in comment
- Remove trailing whitespace
main.c:
- wireless_tb must always be defined now, even if compiling without
HAVE_AIRPCAP
svn path=/trunk/; revision=43373
It's probably not a good idea to read the menu bar code from file as it causes problems with permissions when Wireshark is run fom build dir.
svn path=/trunk/; revision=43367
relies on get_interface_type() having done so. Thus, we no longer need
to include <sys/types.h> or <sys/stat.h> on Linux, as we aren't doing,
and haven't been doing, ws_stat64()s on Linux.
svn path=/trunk/; revision=43351
If there are many interfaces the button bar is not visible
unless you manually resize the dialog. On a normal Linux PC
you can easily reach 15-20 interfaces due to USB monitor.
Add a vbox so that you get a scrollbar for the interface table
instead of on the window. This way the button bar is always
visible.
Also increase the default height to handle 20 interfaces.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7379
svn path=/trunk/; revision=43345
Maximal length of column is defined as 256, for COL_INFO it's 4096,
so limiting it to 65535 bytes in GUI is OK.
XXX To save memory more, we could make col_text_len[] member of PacketList, not PacketListRecord.
svn path=/trunk/; revision=43338
file.c and routines called from it; non-modal dialogs end up, in some
cases, either hidden, devoid of the input focus and not dismissable, or
both.
svn path=/trunk/; revision=43321
only return file types that could handle a single file with all those
encapsulations - this means that
1) if there's more then one encapsulation, the file format has
to handle per-packet encapsulation;
2) just because a file format handles per-packet encapsulation,
that doesn't mean that it can handle the *particular* encapsulations
being handed to it.
This fixes some cases where we were claiming that a file could be saved
in a format that doesn't actually support it (e.g., ISDN files being
reported as savable in pcap-NG format - there's no LINKTYPE_ value for
ISDN including B and D channels).
svn path=/trunk/; revision=43300
out of main_menubar.c into routines in main.c.
Move some routines that are only used by main.c into
main_menubar_private.h.
svn path=/trunk/; revision=43298
it specifically works on the main window's tree and hex dump views (it
doesn't apply to packet windows - they are always showing data from a
particular packet), and move its declaration to main_packet_panes.h.
svn path=/trunk/; revision=43293
panes to main_packet_panes.c.
Rename main_tree_view_new() to proto_tree_view_new() - it's not just for
creating the main window's protocol tree view, it's also for creating
protocol tree views in packet windows.
svn path=/trunk/; revision=43292
used for popped-up packet windows, and it includes more than just code
to draw the protocol tree - it includes the hex dump pane code as well.
Rename it packet_panes.c; the stuff specific to the main window should
be moved into a different file.
svn path=/trunk/; revision=43291
used for popped-up packet windows, and it includes more than just code
to draw the protocol tree - it includes the hex dump pane code as well.
Rename it packet_panes.c; the stuff specific to the main window should
be moved into a different file.
svn path=/trunk/; revision=43290
Show all of them in the summary dialog; we will be using it in the
future to figure out what capture file formats we can write to (just
because a capture file format supports per-packet encapsulations, that
doesn't mean that it supports *all possible* encapsulations).
svn path=/trunk/; revision=43278
highlight_field() is also called when we open packet in new window and we click some bytes,
it caused redrawing packet details in *main window* but with protocol tree from (possibly) another frame.
svn path=/trunk/; revision=43277
stopped - there's no guaranteed way to make the UI's close button
inactive (on X11, it depends on whether the window manager allows that),
but we can just do nothing and return TRUE from the delete event handler
to ignore the delete event.
svn path=/trunk/; revision=43252
capture to stop, so that we don't try to quit while we're in the middle
of quitting or try to stop or restart the capture we're in the middle of
stopping.
svn path=/trunk/; revision=43250
the main loop until we're done reading the captured packets. Hopefully
this clears up bug 7318 in Evan Huus's case; I can't reproduce that
myself.
svn path=/trunk/; revision=43248
File name preferences are basically just string preferences except that the
GUI will present a "Browse" button that allows the user to go and find the
file s/he wants (rather than having to blindly type in the full path).
svn path=/trunk/; revision=43228
When building current data for packet details treeview we store two things.
- Generated string with item label
- Pointer to node field_info structure
After epan_dissect_{free, cleanup} pointer to field_info node is no longer
valid so we should clear GtkTreeStore before freeing.
svn path=/trunk/; revision=43188
(Before checking the code it wasn't clear to me what COUNT(*) was counting
and--especially with SCTP's bundling of user messages--counting fields was
really what I wanted/needed.)
Remove a 32-bit cast (should have been part of r43136).
svn path=/trunk/; revision=43137
just tweak the elements in the capture_file structure as necessary and
poke the UI to update stuff such as the windows title.
If we do a Save or Save As with a copy, don't reread the capture file,
just close the old wtap, open a wtap for the copy, and tweak the
elements in the capture_file structure as necessary and poke the UI to
update stuff such as the windows title.
Otherwise, don't do a full read-and-dissect pass on the capture file,
just close the old wtap, open a wtap for the new file, tweak the
elements in the capture_file structure as necessary and poke the UI to
update stuff such as the windows title, and rescan the file to update
the packet offsets (and cause Wiretap to regenerate, for a gzipped file,
the information needed to support fast random access to the gzipped
file).
This should speed up Save and Save As a bit, as well as removing some
glitches in the UI (e.g., you won't see the packet list disappear and
reappear).
svn path=/trunk/; revision=43101
"export specified packets". For "failed", let the user try again with a
different file, in case it failed due to, for example, running out of
space or quota (probably the most likely failure mode for writing, and
trying to a different volume might be the best workaround). For "user
stopped it", presumably they don't want to try again (the most likely
reason is "it was taking too damn long").
Put "Exporting to: ...", not "Saving: ..." in the statusbar if we're
doing "export specified packets".
In process_specified_packets(), allow a null range pointer to be
specified, meaning "save 'em all"; that avoids the possibly-expensive
(with a large capture) operation of initializing the range.
If a "safe save" atop an existing file fails or is stopped, get rid of
the temporary file we created.
svn path=/trunk/; revision=43095