Commit Graph

211 Commits

Author SHA1 Message Date
Guy Harris 8d8d351d02 Actually, we do have to clear all the dissector information if we're
redissecting the packets due to some preference changing, as the
preference may affect what state information gets constructed as a
result of some particular frame being dissected.

We don't have to do it when filtering the packets, or colorizing them,
however.

svn path=/trunk/; revision=2359
2000-08-24 06:45:37 +00:00
Guy Harris 47d5cfab52 Instead of keeping in the information about an RPC call a count of the
number of replies seen, keep the frame number of the first request seen
for that call and the first reply seen for that call.  Use that to
determine whether a request or reply is a duplicate or not.

That means that we don't have to reset the table of RPC calls on a
rescan of the capture (which didn't even fix all the cases where we'd
have misreported the original call or reply as a duplicate due to having
seen it once on the initial pass through the file and once again when,
for example, the user clicked on the packet); doing so causes plenty of
other problems, so don't do that - and don't clear the "visited" flag on
frames on a rescan, either, as that's only done because we were clearing
out conversations and calling all protocols' "init" routines.

As a free bonus, this means that, for a reply, we know what frame the
request was in; put that information into the protocol tree for the
reply, snoop-style.

Make the table of RPC call information, and the routines that manipulate
it, static to "packet-rpc.c"; nobody outside "packet-rpc.c" uses them.

svn path=/trunk/; revision=2358
2000-08-24 06:19:53 +00:00
Laurent Deniel ab47385543 Add prefs.gui_marked_[fb]g color preferences for the
color of marked frames.

They are currently only available from preferences file,
but I will add the color selection in GUI later.

svn path=/trunk/; revision=2327
2000-08-21 21:24:15 +00:00
Laurent Deniel 8fbd65cc7f Frames in the packet list can now be marked by the user using
the middle mouse button. The marked packets are displayed in
reverse video but this should change in the future (the color
should be configurable via the GUI).

Then,  the marked packets can be saved (via the "Save as"
window dialog).

Other features will be added in the future (I am waiting for
your comments and wishes).

svn path=/trunk/; revision=2322
2000-08-21 15:45:33 +00:00
Laurent Deniel 8bc95e98e4 Fix potential buffer overflows.
svn path=/trunk/; revision=2298
2000-08-19 18:20:59 +00:00
Laurent Deniel e559d013fc Oups. Forgot some set_menus_for_selected_tree_row calls.
svn path=/trunk/; revision=2277
2000-08-15 21:03:55 +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 fac3eec39a Make copy_binary_file() static since follow_dlg.c no longer uses it.
svn path=/trunk/; revision=2237
2000-08-09 06:18:16 +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
Gilbert Ramirez 15a399d338 Replace calls to sprintf() with snprintf() in file_*_error_message routines,
as a long filename may overflow the buffer.

svn path=/trunk/; revision=2199
2000-08-03 12:02:15 +00:00
Gilbert Ramirez eeade6de43 When rescanning a file, all state information for the frames has
been deleted. So we have to set fdata->flags.visited to 0 for each frame,
denoting a "fresh" scan.

svn path=/trunk/; revision=2161
2000-07-26 03:08:56 +00:00
Guy Harris e068b7dbe7 In Tethereal:
When capturing, report errors trying to create the output file
	with "file_open_error_message()".

	Make the "for_writing" argument to "file_open_error_message()" a
	"gboolean", as it's either TRUE (if the file is being opened for
	writing) or FALSE (if it's being opened for reading).

	Report EISDIR as "XXX is a directory (folder), not a file.".

When checking whether an "open()" of a capture file succeeded, check
whether "open()" returns a negative number, not whether it returns 0.

In "wtap_open_offline()", if the file to be opened is a directory,
return EISDIR, not WTAP_ERR_NOT_REGULAR_FILE, so that the error message
can say "that's a directory, not a file".

If "wtap_open_offline()" returns WTAP_ERR_NOT_REGULAR_FILE, don't just
say the file is "invalid", say it's a "special file" or socket or some
other weird type of file.

svn path=/trunk/; revision=2144
2000-07-20 09:39:43 +00:00
Guy Harris 024c2d72fe Use ESD_TYPE_CRIT for most errors (the model used by various GUIs seems
to use "warning" dialog boxes only to warn the user "if you do that, bad
things may happen" *and* to offer them the option either to drive on or
quit, so perhaps ESD_TYPE_CRIT should be used for all errors).

However, put "Ethereal: Error" rather than "Ethereal: Critical" in the
title bar, in the hopes that it'll make it clearer that Something Bad
Happened.

If the user specifies that captures should be saved to a user-specified
file rather than a temporary file, report errors trying to create that
file with "file_open_error_message()".

Make the "for_writing" argument to "file_open_error_message()" a
"gboolean", as it's either TRUE (if the file is being opened for
writing) or FALSE (if it's being opened for reading).

Report EISDIR as "XXX is a directory (folder), not a file.".

svn path=/trunk/; revision=2143
2000-07-20 05:10:02 +00:00
Guy Harris ebb525fac6 Put up a progress dialog when changing the time display; it can take a
long time on a large capture.

If the user is changing the setting of "Display TOS as DiffServ" *and*
the time stamp format, don't bother doing the time display update -
we'll regenerate the entire display anyway because we changed the
setting of "Display TOS as DiffServ".

svn path=/trunk/; revision=2130
2000-07-09 23:22:33 +00:00
Guy Harris 0a71de8137 Turn the code of "colorize_packet()" into a static routine that is given
a word to use in the progress dialog, and a flag indicating whether the
display filter is to be reevaluated or not, and:

	have "colorize_packet()" call that routine with "Colorizing" and
	FALSE as those arguments;

	have the filtering code call that routine with "Filtering" and
	TRUE as those arguments;

	add an exported routine to call that routine with "Reprocessing"
	and TRUE as those arguments, to use to re-generate the packet
	list and to re-filter the packets if a protocol preference has
	been changed.

Keep track of whether preferences are changed from their initial value
by a preferences file or a command-line option, or from their previous
value by the "Preferences" dialog box; have "prefs_apply_all()" only
call the "apply" callback for a module if they have.

Call "prefs_apply_all()" after the command-line arguments have been
parsed and after "OK" has been clicked in the "Preferences" dialog box,
to notify modules of preference changes if they've registered a callback
for that.

After "OK" has been clicked in the "Preferences" dialog box, if any
preferences have changed, call the reprocessing routine, as the summary
line for some frames and/or the current display filter's value when
applied to some frames may have changed as a result of a preference
change.  Do the same after "OK" or "Apply" has been clicked in the
"Display Options" dialog box (as it controls a protocol preferences
item.

svn path=/trunk/; revision=2126
2000-07-09 03:29:42 +00:00
Guy Harris ae1df37513 If the progress dialog gets a "delete" event, have the handler return
TRUE, meaning "don't delete this", and if its "stop this operation"
button gets clicked, don't have its handler delete the progress dialog;
instead, leave the deletion of the window up to the code using the
dialog, as it'll do so when it stops the operation.

Make the "read file" operation destroy the dialog; all the other
operations already did so (as they just broke out of the loop doing the
operation, rather than returning).

Don't catch the "destroy" operation on the dialog box - its handler
appeared never to get called; we can just free the "progdlg_t" for the
dialog in "destroy_progress_dlg()", right after destroying the dialog
box widget.

svn path=/trunk/; revision=2122
2000-07-07 23:09:15 +00:00
Guy Harris 4e69c6bc87 Use "progdlg_t *" rather than "void *" as the handle for a progress
dialog box; that lets us do some type-checking, but we can still typedef
it to an incompletely-defined structure to hide the implementation
details from the caller.

Make "create_progress_dlg()" take, as an argument, the title to put in
the "stop the operation" button, and use "Stop" rather than "Cancel" if
stopping the operation doesn't undo all the work it's done.

Thaw the clist if we break out of a "read the file" operation, as we
freeze it before the operation.

Have the handler for the "delete" event on the progress dialog box
return FALSE, to let GTK+ know that it should, in fact, delete the
window.  ("delete" event handlers should return TRUE if the window
shouldn't actually be deleted, FALSE if it should; they should not
return "void".)

svn path=/trunk/; revision=2120
2000-07-07 07:01:58 +00:00
Guy Harris e4a9d0f426 If the user clicks the "Cancel" button in a progress-bar dialog box for
reading a capture file, we should just clean up and return so that
Ethereal continues running with no capture file loaded, unless the read
is being done as a result of Ethereal being run with the "-r" flag, in
which case we still exit (although we may eventually choose to continue
running with no capture file loaded even in that case).

svn path=/trunk/; revision=2104
2000-07-03 09:34:27 +00:00
Guy Harris 9e42b3a4ed Remove the progress bar from the status line, and, instead, for any
potentially long-running operation that has a progress indicator, pop up
a modal dialog box with

	an indication of what is being done;

	a progress bar;

	a "Cancel" button to stop the operation.

This:

	leaves more room on the status line for a filter expression;

	provides a mechanism to allow the user to cancel long-running
	operations (although the way we do so may not back out of them
	as nicely as the user might like, if it's not obvious what the
	"right" way is or if the "right" way is difficult to implement
	or involves doing as much work as letting the operation
	continue);

	means that, because the dialog box is modal, we don't have to
	worry about the user performing arbitrary UI operations out from
	under the operation and changing arbitrary bits of state being
	used by that operation.

svn path=/trunk/; revision=2103
2000-07-03 08:36:52 +00:00
Guy Harris 6ea9c6aa9b Don't pass a pointer to the packet data buffer to "read_packet()"; let
it, rather than its callers, get that pointer from "cf->wth".

svn path=/trunk/; revision=2096
2000-06-27 09:26:10 +00:00
Guy Harris 7843ac6d0e Add routines to Wiretap to allow a client of Wiretap to get:
a pointer to the "wtap_pkthdr" structure for an open capture
	file;

	a pointer to the "wtap_pseudo_header" union for an open capture
	file;

	a pointer to the packet buffer for an open capture file;

so that a program using "wtap_read()" in a loop can get at those items.

Keep, in a "capture_file" structure, an indicator of whether:

	no file is open;

	a file is open, and being read;

	a file is open, and is being read, but the user tried to quit
	out of reading the file (e.g., by doing "File/Quit");

	a file is open, and has been completely read.

Abort if we try to close a capture that's being read if the user hasn't
tried to quit out of the read.

Have "File/Quit" check if a file is being read; if so, just set the
state indicator to "user tried to quit out of it", so that the code
reading the file can do what's appropriate to clean up, rather than
closing the file out from under that code and causing crashes.

Have "read_cap_file()" read the capture file with a loop using
"wtap_read()", rather than by using "wtap_loop()"; have it check after
reading each packet whether the user tried to abort the read and, if so,
close the capture and return an indication that the read was aborted by
the user.  Otherwise, return an indication of whether the read
completely succeeded or failed in the middle (and, if it failed, return
the error code through a pointer).

Have "continue_tail_cap_file()" read the capture file with a loop using
"wtap_read()", rather than by using "wtap_loop()"; have it check after
reading each packet whether the user tried to abort the read and, if so,
quit the loop, and after the loop finishes (even if it read no packets),
return an indication that the read was aborted by the user if that
happened.  Otherwise, return an indication of whether the read
completely succeeded or failed in the middle (and, if it failed, return
the error code through a pointer).

Have "finish_tail_cap_file()" read the capture file with a loop using
"wtap_read()", rather than by using "wtap_loop()"; have it check after
reading each packet whether the user tried to abort the read and, if so,
quit the loop, and after the loop finishes (even if it read no packets),
close the capture and return an indication that the read was aborted by
the user if that happened.  Otherwise, return an indication of whether
the read completely succeeded or failed in the middle (and, if it
failed, return the error code through a pointer).

Have their callers check whether the read was aborted or not and, if it
was, bail out in the appropriate fashion (exit if it's reading a file
specified by "-r" on the command line; exit the main loop if it's
reading a file specified with File->Open; kill the capture child if it's
"continue_tail_cap_file()"; exit the main loop if it's
"finish_tail_cap_file()".

svn path=/trunk/; revision=2095
2000-06-27 07:13:42 +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
Guy Harris f3d90d30a4 Remove the "union pseudo_header" from the "frame_data" structure;
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-18 09:09:50 +00:00
Guy Harris 7bf3c7523b Have "proto_tree_is_visible" false except when we're in the middle of
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-05-18 08:35:01 +00:00
Guy Harris 9befd25e50 We can't trust "cf->current_frame" to refer to the frame that was
selected before we started re-colorizing or re-filtering the display, as
when the first row is added to the clist, that may be selected and thus
made the current frame.

This means that we can't find the row corresponding to the
previously-selected frame, if any, by checking as each packet is
colorized/filtered and see whether its "frame_data" structure is equal
to "cf->current_frame", as that'll always say that the first frame in
the display is the selected frame.

Instead, we recored the value of "cf->current_frame" before we do
anything to the clist, have "add_packet_to_packet_list()" return either
the row number of the frame (if it passed the filter and thus was added
to the clist) or -1 (if it didn't pass the filter and thus wasn't added
to the clist), and, after "add_packet_to_packet_list()", if the current
frame is the one that was the selected row, remember its row number (if
any), and, when we're finished colorizing/filtering the display, make
that row the current row if it's not -1 (-1 means that the selected row
didn't pass the filter).

Also, don't do that until after we've thawed the clist, as the vertical
adjustment for the clist doesn't reflect reality until then, and
attempting to go to a given row won't work right until the vertical
adjustment for the clist reflects reality.

Shove all the code to set the selected and focus rows, and to make said
row visible, into a routine, so the "Find Frame" and "Go To Frame" code
can use it as well.

svn path=/trunk/; revision=1959
2000-05-15 01:50:16 +00:00
Gilbert Ramirez 651acccfd9 Ben Fowler <wapdev@leedsnet.com>'s "usage of fd" patch.
svn path=/trunk/; revision=1952
2000-05-12 22:03:59 +00:00
Guy Harris 97420edd50 Fix indentation so that it looks correct if tabs are every 8 spaces,
that being the UNIX default.

svn path=/trunk/; revision=1911
2000-05-06 05:19:42 +00:00
Gilbert Ramirez 61167a3c28 Change dfilter_apply() to 4-argument function. 4th argument is not yet used,
but will be in the future, and it's easier for me to keep my local branch
in sync with the source with the calls to dfilter_apply() already modified
tothe 4-arg format.

Add a CPP macro to ipv4.h to define ipv4_addr_ne(). Use it in dfilter.c

svn path=/trunk/; revision=1854
2000-04-14 05:39:43 +00:00
Gilbert Ramirez b218a8f550 Consolidate flags in struct frame_data, and add "visited" flag. Use
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-04-13 20:39:38 +00:00
Guy Harris 5fe1de894e When searching for a frame that matches a filter expression, we
shouldn't stop the search as soon as we get back to the starting frame,
we should stop the search if the filter expression doesn't match and the
frame we tried it on was the starting frame - it's OK if we find the
starting frame, it's just not OK to continue if we don't find that
frame.

svn path=/trunk/; revision=1815
2000-04-07 08:00:34 +00:00
Guy Harris 76f0935df9 Plug a memory leak in the "Find Frame" code - we weren't freeing the
protocol tree after checking whether it matched the filter we supplied.

svn path=/trunk/; revision=1814
2000-04-07 07:48:15 +00:00
Guy Harris f9acb5fdb7 After destroying the mem chunk for the packet list, null out the pointer
pointing to it, so that if we call "close_cap_file()" again, we don't
try to destroy an already-destroyed mem chunk.

svn path=/trunk/; revision=1806
2000-04-06 06:04:24 +00:00
Guy Harris 05fe159e74 Allocate the new mem chunk for the capture in "open_cap_file()", rather
than duplicating the allocation code in "read_cap_file()" and
"start_tail_cap_file()".

svn path=/trunk/; revision=1784
2000-04-04 05:14:48 +00:00
Gilbert Ramirez b61aeda52d Set cf->plist_chunk in the other place where needed. Guy's experiencing
some network problems today, so I checked this in for him.

svn path=/trunk/; revision=1782
2000-04-03 22:28:51 +00:00
Guy Harris 9653203d24 Note that it didn't seem to save a significant amount of time or space
to use a G_ALLOC_ONLY memory chunk rather than a G_ALLOC_AND_FREE memory
chunk.

svn path=/trunk/; revision=1777
2000-04-03 08:57:17 +00:00
Guy Harris f3c287d201 Use a GMemChunk for allocating and freeing "frame_data" structures; it
reduces the memory required for one big capture file I have by about 10
megabytes, and speeds up the reading in of that file, presumably because
it amortizes the memory-allocator space and CPU time overhead over
a set of several "frame_data" structures.

svn path=/trunk/; revision=1776
2000-04-03 08:42:45 +00:00
Olivier Abad 2673685067 Add a counter : "enabled_plugins_number", to record how many plugins are
enabled. The counter is incremented in enable_plugin() and decremented
in disable_plugin().
In add_packet_to_packet_list(), we check this counter (instead of
plugin_list) to see if there is at least one enabled plugin. If this is
the case, we must build the protocol tree.

svn path=/trunk/; revision=1770
2000-03-31 21:42:24 +00:00
Guy Harris e386451345 Patches from Andreas Sikkema:
On Win32, always save a temporary capture file by copying -
	Win32 systems don't allow you to rename a file that is open, and
	we have the temporary file open.

	When saving by copying the raw bytes of a capture file, create
	the target file with "open()", using the O_BINARY flag, rather
	than with "creat()"; on Win32 systems, "creat()" apparently
	opens the file as a text file rather than a binary file.

svn path=/trunk/; revision=1757
2000-03-28 08:11:52 +00:00
Richard Sharpe e987dcca02 Set the per frame data pointer to NULL when a new frame is read in.
svn path=/trunk/; revision=1749
2000-03-26 07:03:52 +00:00
Guy Harris a62224b08c In "add_packet_to_packet_list()", always use the "buf" argument to refer
to the raw packet data, don't use "cf->pd" - "cf->pd" doesn't contain
the packet data when the file is being read in, it only contains it when
we're re-reading packets.

svn path=/trunk/; revision=1728
2000-03-20 04:55:10 +00:00
Guy Harris da5757e340 Making the "frame_data" structure for a frame the data associated with
the row for that frame, and using that to get the frame for the selected
row in "select_packet()", revives the crash caused by the GtkCList
selecting the first row added to the list as it's added, i.e. before we
get a chance to set the data for that row, in this case.

Introduce a workaround for this instance of that crash.

svn path=/trunk/; revision=1711
2000-03-12 03:13:58 +00:00
Guy Harris 050979d522 We already set the foreground and background color for every frame,
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-08 06:48:01 +00:00
Guy Harris 7c11334000 Jeff Foster's changes, with my additions, to allow the user to pop up a
window showing the protocol tree and hex/ASCII data for the currently
selected packet.

svn path=/trunk/; revision=1670
2000-02-29 06:24:41 +00:00
Guy Harris 1d5f958c02 Don't use a fixed-size line buffer for summary lines in the print code;
mallocate the buffer and grow it as necessary.

svn path=/trunk/; revision=1659
2000-02-21 08:18:00 +00:00
Olivier Abad 44a7c1ec31 Used register_init_routine() to register "reinit_x25_hashtable()" as a
routine to be called every time a new capture file is opened instead of
calling it in read_cap_file() and do_capture().

svn path=/trunk/; revision=1651
2000-02-19 14:00:35 +00:00
Guy Harris 585268e3e1 Use WTAP_ERR_UNSUPPORTED_ENCAP for all attempts to open or read a
capture file for an unsupported link-layer encapsulation type (as the
nettl reader does), and report it correctly if it occurs on an open or
read attempt rather than a save attempt.

svn path=/trunk/; revision=1647
2000-02-19 08:00:08 +00:00
Olivier Abad bb2454e8bd Renamed init_dissect_x25() to reinit_x25_hashtable() and actually used it !
This function is used to re-initialize the hash table used by the X.25
dissector to record the upper layer protocol used by each VC. The hash
table should be re-initialized each time we read / start a new capture.

I moved the definition of the function from packet.h to packet-x25.h, and
added calls to reinit_x25_hashtable() in read_cap_file (file.c) and
do_capture (capture.c).

svn path=/trunk/; revision=1644
2000-02-18 13:41:26 +00:00
Guy Harris 679a1de7dd Get rid of redundant include of <stdio.h> - one is enough.
svn path=/trunk/; revision=1635
2000-02-14 04:57:30 +00:00
Guy Harris a30c9d9979 Change from Ed Meaney - when doing a "Save" or "Save As" that saves all
packets and doesn't change the capture file format, i.e. that's done by
a raw copy, read the file in binary.  (XXX - does "creat()", on Win32,
open the file in ASCII or binary mode?  If ASCII, we may have to use

	open(fname, O_CREAT|O_TRUNC|O_WRONLY|O_BINARY, 0644)

rather than

	creat(fname, 0644)

so that the output file is written in binary as well.)

svn path=/trunk/; revision=1599
2000-02-03 06:35:27 +00:00