diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-08-19 05:52:55 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-08-19 05:52:55 +0000 |
commit | aae22bd2279292449e74a10b6887b034a3b17a78 (patch) | |
tree | 59d0fbaf9d19c67e0d3c1900c81ec5b9f0ce89bb /wiretap/ngsniffer.h | |
parent | 68f2dca6e75cc250858092930e2ee001fde8e5ed (diff) |
Have the per-capture-file-type open routines "wtap_open_offline()" calls
return 1 on success, -1 if they got an error, and 0 if the file isn't of
the type that file is checking for, and supply an error code if they
return -1; have "wtap_open_offline()" use that error code. Also, have
the per-capture-file-type open routines treat errors accessing the file
as errors, and return -1, rather than just returning 0 so that we try
another file type.
Have the per-capture-file-type read routines "wtap_loop()" calls return
-1 and supply an error code on error (and not, as they did in some
cases, call "g_error()" and abort), and have "wtap_loop()", if the read
routine returned an error, return FALSE (and pass an error-code-pointer
argument onto the read routines, so they fill it in), and return TRUE on
success.
Add some new error codes for them to return.
Now that "wtap_loop()" can return a success/failure indication and an
error code, in "read_cap_file()" put up a message box if we get an error
reading the file, and return the error code.
Handle the additional errors we can get when opening a capture file.
If the attempt to open a capture file succeeds, but the attempt to read
it fails, don't treat that as a complete failure - we may have managed
to read some of the capture file, and we should display what we managed
to read.
svn path=/trunk/; revision=518
Diffstat (limited to 'wiretap/ngsniffer.h')
-rw-r--r-- | wiretap/ngsniffer.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/wiretap/ngsniffer.h b/wiretap/ngsniffer.h index 40dd6e23f8..0ec8cd6421 100644 --- a/wiretap/ngsniffer.h +++ b/wiretap/ngsniffer.h @@ -1,6 +1,6 @@ /* ngsniffer.h * - * $Id: ngsniffer.h,v 1.4 1998/12/17 06:39:13 gram Exp $ + * $Id: ngsniffer.h,v 1.5 1999/08/19 05:52:55 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu> @@ -21,5 +21,4 @@ * */ -int ngsniffer_open(wtap *wth); -int ngsniffer_read(wtap *wth); +int ngsniffer_open(wtap *wth, int *err); |