aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/packet_win.c
AgeCommit message (Collapse)AuthorFilesLines
2001-08-21On Windows, use the directory in which the binary resides as theGuy Harris1-4/+2
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-03-24Fix typos in comments.Guy Harris1-3/+3
svn path=/trunk/; revision=3185
2001-03-24The declaration of "destroy_packet_wins()" belongs inGuy Harris1-2/+1
"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-23Changes required to support multiple named data sources.Jeff Foster1-16/+46
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-02-11In Ethereal, attempt to get the packet statistics from libpcap whenGuy Harris1-2/+1
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-01Create a more modular type system for the FT_* types. Put themGilbert Ramirez1-2/+1
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
2000-10-06Implement epan_dissect_new() and epan_dissect_free(). These are theGilbert Ramirez1-2/+5
"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-09-09"redraw_hex_dump()" can't use "cfile.pd" or "cfile.current_frame", as itGuy Harris1-14/+11
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-08Redraw:Guy Harris1-12/+9
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-08Graham Bloice's patch to support inverse video rather than boldfaceGuy Harris1-5/+26
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-08-21Instead of each set of built-in preferences having "ok", "save",Guy Harris1-46/+1
"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-17It was silly of me to require that "forget_scrolled_window()" be calledGuy Harris1-3/+1
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-03Add a "Save As" feature to the TCP Follow dialogue, to save the streamGilbert Ramirez1-2/+1
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-06-27Patch from Ben Fowler to rename the global variable "cf" to "cfile", toGuy Harris1-8/+8
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-05-19Add wtap-int.h. Move definitions relevant to the internal workins of wiretapGilbert Ramirez1-2/+2
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-18Remove the "union pseudo_header" from the "frame_data" structure;Guy Harris1-2/+5
there's no need to keep it around in memory - when the frame data is read in when handing a frame, read in the information, if any, necessary to reconstruct the frame header, and reconstruct it. This saves some memory. This requires that the seek-and-read function be implemented inside Wiretap, and that the Wiretap handle remain open even after we've finished reading the file sequentially. This also points out that we can't really do X.25-over-Ethernet correctly, as we don't know where the direction (DTE->DCE or DCE->DTE) flag is stored; it's not clear how the Ethernet type 0x0805 for X.25 Layer 3 is supposed to be handled in any case. We eliminate X.25-over-Ethernet support (until we find out what we're supposed to do). svn path=/trunk/; revision=1975
2000-05-18Have "proto_tree_is_visible" false except when we're in the middle ofGuy Harris1-1/+3
doing something that requires that the text for protocol tree entries be generated, i.e. 1) initialize it to FALSE; 2) have every routine that sets it clear it when it's done; 3) when printing packets, set it to TRUE only if we're not just printing packet summary lines; and then get rid of settings to FALSE made unnecessary as a result of those changes. This makes sure it's not set when it doesn't have to be (which causes the protocol tree code to format the text when it doesn't have to, wasting CPU time). svn path=/trunk/; revision=1973
2000-04-13Consolidate flags in struct frame_data, and add "visited" flag. UseGilbert Ramirez1-2/+2
it in SOCKS dissector. (Okay, how many times am I going to modify packet.h today, forcing you to re-compile everything? :-) svn path=/trunk/; revision=1850
2000-03-08We already set the foreground and background color for every frame,Guy Harris1-2/+7
which means we're already doing a "do something to the last row in the packet list" operation on every frame we add to the list, so adding a call to "gtk_clist_set_row_data()" won't make matters worse. In addition, we already set one column in a row on a "change time format" operation, so finding the row for a frame by calling "gtk_clist_find_row_from_data()" doesn't turn a constant-time operation into a linear-time operation, it just cranks the proportionality constant up - it was quadratic before, alas, and it's still quadratic. Adding calls to "gtk_clist_find_row_from_data()" to the "Find Frame" and "Go To Frame" code does add an extra linear operation there, but those operations shouldn't be common - and "Go To Frame", going to the last frame on an ~100,000-frame big capture file, was quick, at least on my 450 MHz Pentium II machine, so maybe it won't be too bad. And "select_packet()" either has to search the frame table for the frame with the specified row number, or has to call "gtk_clist_get_row_data()" to do that - the first is linear in the position of the frame in the frame table, and the latter is linear in its position in the CList, and the latter is less than or equal to the former, so the only thing making it worse would be a change in the proportionality constant. So it probably won't hurt performance by much. Furthermore, if we add the ability to sort the display on an arbitrary column, or to delete frames from the display - both of which are in the wish list - storing the row number of the frame in the "frame_data" structure won't necessarily work, as the row number can change out from under us. Therefore, reinstate the old way of doing things, where we associate with each row a pointer to the "frame_data" structure for the row, using "gtk_clist_set_row_data()". svn path=/trunk/; revision=1703
2000-03-02Use GtkScrolledWindows to add scrollbars to the hex/ASCII panes and toGuy Harris1-41/+10
the "Follow TCP Stream" displays; that means we can use the same GTK+ calls to set the scrollbar placement on them that is used to set it on other widgets. Keep a list of all the GtkScrolledWindows whose scrollbar placement we control with the GUI preference item for that, and change them all when the GUI preference item is changed (which means that the GUI preference item now applies to the "Follow TCP Stream" window as well as to the hex/ASCII panes). svn path=/trunk/; revision=1676
2000-03-01Use the "destroy" signal on a packet popup window to find out when toGuy Harris1-12/+9
destroy the data structure for that window, rather than doing so when the "tree-unselect-row" signal catcher is unhooked from the tree view. svn path=/trunk/; revision=1672
2000-02-29Jeff Foster's changes, with my additions, to allow the user to pop up aGuy Harris1-0/+339
window showing the protocol tree and hex/ASCII data for the currently selected packet. svn path=/trunk/; revision=1670