Commit Graph

43 Commits

Author SHA1 Message Date
Guy Harris 2cbb8e33e2 Immediately quit routines if fwrite() fails - further writes will
probably fail (as you're probably out of disk space or over quota), and,
even if they don't, the file's going to be corrupt in any case.

(Hopefully that's sufficient to avoid warnings that we're ignoring the
result of fwrite().)

For fread(), check for errors or short reads, at least in all cases
where we have a provision for failing if the read fails.

svn path=/trunk/; revision=21649
2007-05-02 19:28:24 +00:00
Ronnie Sahlberg 2fadd01c25 fix some more warnings that the result from fread/fwrite is discarded by assigning the return value to a variable
svn path=/trunk/; revision=21638
2007-05-02 11:50:54 +00:00
Guy Harris 29c7090c23 Copy up to 4 bytes from the source address, rather than just copying the
first byte; if the goal is to have the address not be fake for IPv4,
that's the way to do it.

svn path=/trunk/; revision=21585
2007-04-26 03:38:40 +00:00
Ronnie Sahlberg 40c806f54b compile fix for gtk1
svn path=/trunk/; revision=21503
2007-04-22 15:49:29 +00:00
Anders Broman 31dfe96326 Preparations to be able to display dynamic payload type name in the stream analysis.
svn path=/trunk/; revision=21334
2007-04-04 06:58:12 +00:00
Ulf Lamping 407d0aeab0 fix all warnings in gtk dir & set the "treat all warnings as errors" MSVC flag
svn path=/trunk/; revision=21080
2007-03-21 03:26:26 +00:00
Guy Harris 92552c2d76 Get rid of a bunch of "Ethereal"s and "ethereal"s in comments, GUI
strings, and function names.

svn path=/trunk/; revision=18205
2006-05-22 07:29:40 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Ulf Lamping c3187174bf replace *a lot* of file related calls by their GLib counterparts. This is necessary for the switch to GTK 2.6 (at least on WIN32).
to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place.

deleted related things from config.h.win32

As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon.

svn path=/trunk/; revision=16403
2005-11-06 22:43:25 +00:00
Guy Harris f34e1a97c6 Have cf_retap_packets() take an argument that indicates whether to
generate columns; use cf_retap_packets instead of cf_redissect_packets()
when running taps (the general flow graph stat uses the Info column).

svn path=/trunk/; revision=15793
2005-09-14 08:59:41 +00:00
Ulf Lamping 6f43fbb2f0 EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ...

What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere.

As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon.

Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way...

As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number...

svn path=/trunk/; revision=15520
2005-08-24 21:31:56 +00:00
Guy Harris a0e68da918 Add a "register_dfilter_stat()", to register stats that take a display
filter as an argument on the command line and have a dialog box to enter
the display filter through the GUI.  Use it for all stats using
"gtk_tap_dfilter_dlg_cb()".

Add a top-level "stat_menu.h" file to declare "REGISTER_STAT_GROUP_E"
for the benefit of the declaration of "register_dfilter_stat()" in the
top-level "tap_dfilter_dlg.h".  Rename the "stat_menu.h" in the gtk
directory to "gtk_stat_menu.h", so as not to have two headers with the
same name.

Get rid of headers not declaring any functions not being used in the
module.

svn path=/trunk/; revision=15493
2005-08-21 09:48:27 +00:00
Guy Harris 65064719d3 We already have a tap that registers as a command-line stat under the
name "rtp"; we don't need another one, especially given that
"rtp_stream.c" doesn't directly implement a stat (note that it doesn't
register a menu item).

svn path=/trunk/; revision=15488
2005-08-20 22:26:32 +00:00
Guy Harris 50d77b113c Rename epan/stat.[ch] to epan/stat_cmd_args.[ch] - it only deals with
implementing the "-z" command-line arguments, it doesn't deal with *all*
issues for stats.

svn path=/trunk/; revision=15483
2005-08-20 20:06:05 +00:00
Jörg Mayer 0edcc8920e - Declare some functions static
- Add plugins_dlg.h
- Include .h files in their respective .c files
- Include .h and remove extern declarations in .c files
- set eol-style and keywords on gui_utils.[hc]

svn path=/trunk/; revision=15471
2005-08-20 14:02:00 +00:00
Guy Harris 4ddd504bb4 Move the stats.[ch] stuff into epan, so plugins can use it.
svn path=/trunk/; revision=15429
2005-08-19 10:00:14 +00:00
Guy Harris b2807e2ab6 Move the APIs for registering and processing "-z" command-line arguments
and "Statistics" menu items into "stat.h" and "stat.c", to separate them
from the core tapping APIs.  A tap could conceivably not register as a
"-z" command-line argument or "Statistics" menu item, and a stat could
conceivably not be implemented as a tap, and dissectors that implement
tapping points don't need the UI-related stuff from "stat.h", they just
want the tap-related stuff in <epan/tap.h>.

svn path=/trunk/; revision=15427
2005-08-19 09:29:41 +00:00
Guy Harris 5fb6e97fb4 Squelch more const warnings (and fix some memory leaks that found).
_U_-ify some unused arguments, rather than assigning them to themselves.

Un-constify one variable that gets assigned a mallocated pointer.

Clean up indentation.

svn path=/trunk/; revision=15236
2005-08-06 03:44:55 +00:00
Guy Harris 80c1907a36 Rename "register_ethereal_tap()" to "register_tap_listener_cmd_arg()" as
it's used to register a callback for a tap listener invoked if the
specified command line argument is specified to the "-z" flag.

Move it, along with routines to:

	look up a "-z" argument in the table constructed by
	"register_tap_listener_cmd_arg()" and either save the full
	argument to "-z" and the corresponding listener if it's found or
	return a failure indication if it isn't;

	list the available tap listeners;

	call the "init" routines for the tap listeners saved in the
	table above;

and have Ethereal and Tethereal use those routines.

svn path=/trunk/; revision=13993
2005-04-01 09:08:27 +00:00
Luis Ontanon 93b30edbb5 This is the rest of the patch from Francisco Alcoba.
I forgot to check in changes to these files yesterday


svn path=/trunk/; revision=13575
2005-03-02 23:22:11 +00:00
Ronnie Sahlberg fe94290194 from lars ruoff a few extra columns for rtp analysis
svn path=/trunk/; revision=13410
2005-02-16 09:24:52 +00:00
Ulf Lamping 0861927ce3 huge cleanup of capture file API (functions in file.c/file.h).
This includes: all functions in file.h now have a cf_ prefix, will have doxygen tags, will have the capture_file *cf as the first parameter and I tried to generalize the return values for non trivial functions.

Hopefully, I didn't introduced any new bugs, as I had to change a lot of files...

svn path=/trunk/; revision=13289
2005-02-04 18:44:44 +00:00
Lars Roland 197ceddab1 From Alejandro Vaquero:
h323 taps support up to 5 messages per packet now.

VoIP call analysis:
      - Collect ISUP, SIP and H323 calls from a capture and show them in window with the following info:
      - Start and Stop time of the call
      - Init

svn path=/trunk/; revision=13225
2005-02-01 12:12:35 +00:00
Guy Harris 4df2c4abd9 Make the signatures of functions passed to "register_tap_listener()"
match what "register_tap_listener()" expects (rather than squelching
warnings about the differences by casting function pointers to "void
*").

Make static some functions not used outside the module in which they're
defined. 

svn path=/trunk/; revision=12913
2005-01-01 12:49:54 +00:00
Guy Harris e4ae2aa011 From Francisco Alcoba:
add IPv6 support;

	replace "delay" with "delta".

svn path=/trunk/; revision=12636
2004-12-01 11:54:41 +00:00
Guy Harris 6472876ab3 Move the tap infrastructure to the epan directory.
svn path=/trunk/; revision=12128
2004-09-29 00:06:36 +00:00
Gilbert Ramirez 669db206cb Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +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 a24b176c32 define of O_BINARY not needed, if fcntl.h is included
other #include related cleanups

svn path=/trunk/; revision=11272
2004-06-29 20:51:26 +00:00
Guy Harris 90cf9a6b7b The HIG's and/or GUI toolkit documentation for:
Mac OS X

	GNOME

	Qt

	KDE

	Windows

all indicate that {message,alert} boxes are modal, at least for the
window to which they apply.  (Presumably the idea is that not forcing
the user to pay attention to the alert box, and allowing more than one
alert box to be up for a given window, causes more problems than not
letting the user do stuff to that window in order to figure out what the
underlying problem is or figure out what to do to fix it - the message
should be sufficient, in most if not all cases, to let you know what the
problem is.)

Make "simple_dialog()" unconditionally make the alert box modal, and get
rid of ESD_TYPE_MODAL.  XXX - we need to make it possible to make an
alert box modal for a given window, rather than just the top-level
window.

svn path=/trunk/; revision=10051
2004-02-12 22:24:28 +00:00
Guy Harris 3a4e71a724 Add "write_failure_alert_box()" to put up an alert box for a failed
attempt to write to a file (or close a file opened for writing).

Get rid of no-longer-needed #includes of <epan/filesystem.h>.

svn path=/trunk/; revision=10027
2004-02-11 01:37:13 +00:00
Guy Harris 727b913bbd Add an "open_failure_alert_box()" routine to pop up an alert box for a
failed attempt to open/create a file.

Fix one call to pass the right value for the "for_writing" flag.

svn path=/trunk/; revision=10026
2004-02-11 01:23:25 +00:00
Guy Harris d4857dc706 Add to the _rtp_info structure a "info_all_data_present" boolean, which
is TRUE if all the RTP raw data is present in the tvbuff and FALSE
otherwise.  If it's not all present, also set "info_data_len" to 0 and
"info_data" to NULL.

In the RTP Analysis "Save Payload..." operation, check the
"info_all_data_present" flag and fail if it's not set, and use
"rtpinfo->info_data" and "rtpinfo->info_payload_offset" to get at the
payload, rather than using "cfile.pd", as the latter doesn't necessarily
refer to the current frame data.

Note that the RTP Streams save operation should also check the
"info_all_data_present" flag.

svn path=/trunk/; revision=9920
2004-01-31 09:48:26 +00:00
Guy Harris 1980fa5dbf Pass ESD_BTN_OK rather than NULL as a second argument to
"simple_dialog()"; NULL might be #defined to be a pointer expression on
some platforms, causing compiler warnings (and, on platforms where a
null pointer doesn't have all its bits 0, possibly causing misbehavior,
although I don't think there are any such platforms on which Ethereal
runs).

Don't allow 0 as button mask argument to "simple_dialog()".

Squelch a compiler warning.

Report fatal problems as errors, not warnings.

Report file I/O errors with "file_open_error_message()".

Report file write errors (including those reported by "close()", e.g.
some errors writing to an NFS server) when saving raw packet data to a
file.

svn path=/trunk/; revision=9915
2004-01-31 03:22:42 +00:00
Ulf Lamping 25edd1c53e renamed ESD_TYPE_CRIT to ESD_TYPE_ERROR to
better reflect the real error text

svn path=/trunk/; revision=9913
2004-01-31 02:25:46 +00:00
Olivier Biot 3b1f5f17b3 From Lars Ruoff:
- made streams list sortable by column
- added a button "Find Reverse" that finds the reverse stream to the
  selected forward stream. (If different reverse streams available,
  pushing the button repeatedly will cycle through all of them,
  one after the other.)
- tidied up lots of superflous code.

Also get rid of a const pointer cast warning, and remove the _U_ attribute
from rtpstream_reset().

svn path=/trunk/; revision=9863
2004-01-26 19:16:30 +00:00
Guy Harris a0528c5f82 Report open errors when saving the contents of an RTP stream. Check for
and report write errors as well.

svn path=/trunk/; revision=9833
2004-01-25 02:24:44 +00:00
Jörg Mayer e68ca30d10 Fix warnings found by -Wstrict-prototypes
svn path=/trunk/; revision=9722
2004-01-18 16:21:12 +00:00
Guy Harris a093c75b59 Use "retap_packets()" rather than "redissect_packets()".
svn path=/trunk/; revision=9660
2004-01-13 22:49:15 +00:00
Guy Harris 50917e1ead From Lars Ruoff: use the pointer to the RTP payload, rather than
extracting the data from the frame directly.

svn path=/trunk/; revision=9059
2003-11-21 19:24:00 +00:00
Guy Harris 9687947b5f From Lars Roland:
- added a pointer to raw rtp data to _rtp_info that can be used by
	  taps;

	- RTP packets are passed to the tap queue only if they are not
	  error packets (so that you don't need to filter out ICMP
	  packets)

	- use that pointer in rtp_stream, so it handles packets with
	  padding, and should handle RTP packets fragmented across
	  lower-level packets

	- moved rtp_stream from tap sources to normal files
	  (prevents on-start-up registration of the rtp_stream tap
	  listener)

	- rtp_stream tap gets registered/unregistered with the "RTP
	  Streams" dialog box
	  i.e. the tap is registered as long as the dialog box is open.
	  Alternatively, it is de-/registered on demand if RTP Analysis is
	  called directly on a packet.

	- rtp_stream tap listener no longer uses a filter in dissection
`	  and does not need to have a proto tree being built.
	  (performance increase)

	- fixed: RTP Streams list will get updated in real time if the
	  dialog box is open while a redissection takes place.

svn path=/trunk/; revision=9051
2003-11-20 23:34:31 +00:00
Guy Harris 87d87ace4e RTP analysis updates from Lars Ruoff:
- can now handle streams with different payload types
	- detects payload changes
	- detects comfort noise (PT=13 and 19)
	- status line now shows: sequence errors, payload changes,
	  comfort noise (if any)
	- uses colours for lines with status != "Ok"
	- new button "next": jumps to next line with status != "Ok"
	  (starting from selected line)
	- fixed: wrong jitter calculation (bug from tap_rtp)
	- fixed: marker was not shown on first packet or erroneous
	  packets (bug from tap_rtp)
	- code refactored to improve readability and reuse

svn path=/trunk/; revision=8543
2003-09-25 19:35:14 +00:00
Guy Harris 14d13e3401 From Lars Ruoff: rewritten RTP analysis module.
svn path=/trunk/; revision=8529
2003-09-24 07:48:12 +00:00