summaryrefslogtreecommitdiff
path: root/wiretap
diff options
context:
space:
mode:
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/file.c66
-rw-r--r--wiretap/lanalyzer.c12
-rw-r--r--wiretap/lanalyzer.h4
-rw-r--r--wiretap/libpcap.c4
-rw-r--r--wiretap/libpcap.h4
-rw-r--r--wiretap/netmon.c13
-rw-r--r--wiretap/netmon.h4
-rw-r--r--wiretap/netxray.c24
-rw-r--r--wiretap/netxray.h6
-rw-r--r--wiretap/ngsniffer.c4
-rw-r--r--wiretap/ngsniffer.h4
-rw-r--r--wiretap/snoop.c4
-rw-r--r--wiretap/snoop.h4
-rw-r--r--wiretap/visual.c11
-rw-r--r--wiretap/visual.h4
-rw-r--r--wiretap/wtap.c7
-rw-r--r--wiretap/wtap.h28
17 files changed, 132 insertions, 71 deletions
diff --git a/wiretap/file.c b/wiretap/file.c
index 036b9057dc..3253ecb974 100644
--- a/wiretap/file.c
+++ b/wiretap/file.c
@@ -1,6 +1,6 @@
/* file.c
*
- * $Id: file.c,v 1.93 2002/06/27 22:46:47 guy Exp $
+ * $Id: file.c,v 1.94 2002/07/16 07:15:08 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -308,7 +308,7 @@ static const struct file_type_info {
const char *name;
const char *short_name;
int (*can_write_encap)(int);
- int (*dump_open)(wtap_dumper *, int *);
+ int (*dump_open)(wtap_dumper *, gboolean, int *);
} dump_open_table[WTAP_NUM_FILE_TYPES] = {
/* WTAP_FILE_UNKNOWN */
{ NULL, NULL,
@@ -513,20 +513,26 @@ wtap_dumper* wtap_dump_open(const char *filename, int filetype, int encap,
if (wdh == NULL)
return NULL; /* couldn't allocate it */
- /* In case "fopen()" fails but doesn't set "errno", set "errno"
- to a generic "the open failed" error. */
- errno = WTAP_ERR_CANT_OPEN;
- fh = fopen(filename, "wb");
- if (fh == NULL) {
- *err = errno;
- return NULL; /* can't create file */
+ /* Empty filename means stdout */
+ if (*filename == '\0')
+ wdh->fh = stdout;
+ else {
+ /* In case "fopen()" fails but doesn't set "errno", set "errno"
+ to a generic "the open failed" error. */
+ errno = WTAP_ERR_CANT_OPEN;
+ fh = fopen(filename, "wb");
+ if (fh == NULL) {
+ *err = errno;
+ return NULL; /* can't create file */
+ }
+ wdh->fh = fh;
}
- wdh->fh = fh;
if (!wtap_dump_open_finish(wdh, filetype, err)) {
/* Get rid of the file we created; we couldn't finish
opening it. */
- unlink(filename);
+ if (wdh->fh != stdout)
+ unlink(filename);
return NULL;
}
return wdh;
@@ -604,12 +610,27 @@ static wtap_dumper* wtap_dump_alloc_wdh(int filetype, int encap, int snaplen,
static gboolean wtap_dump_open_finish(wtap_dumper *wdh, int filetype, int *err)
{
+ int fd;
+ gboolean cant_seek;
+
+ /* Can we do a seek on the file descriptor?
+ If not, note that fact. */
+ fd = fileno(wdh->fh);
+ if (lseek(fd, 1, SEEK_CUR) == -1)
+ cant_seek = TRUE;
+ else {
+ /* Undo the seek. */
+ lseek(fd, 0, SEEK_SET);
+ cant_seek = FALSE;
+ }
+
/* Now try to open the file for writing. */
- if (!(*dump_open_table[filetype].dump_open)(wdh, err)) {
+ if (!(*dump_open_table[filetype].dump_open)(wdh, cant_seek, err)) {
/* The attempt failed. Close the stream for the file.
NOTE: this means the FD handed to "wtap_dump_fdopen()"
will be closed if the open fails. */
- fclose(wdh->fh);
+ if (wdh->fh != stdout)
+ fclose(wdh->fh);
/* Now free up the dumper handle. */
g_free(wdh);
@@ -640,15 +661,18 @@ gboolean wtap_dump_close(wtap_dumper *wdh, int *err)
ret = FALSE;
}
errno = WTAP_ERR_CANT_CLOSE;
- if (fclose(wdh->fh) == EOF) {
- if (ret) {
- /* The per-format close function succeeded,
- but the fclose didn't. Save the reason
- why, if our caller asked for it. */
- if (err != NULL)
- *err = errno;
+ /* Don't close stdout */
+ if (wdh->fh != stdout) {
+ if (fclose(wdh->fh) == EOF) {
+ if (ret) {
+ /* The per-format close function succeeded,
+ but the fclose didn't. Save the reason
+ why, if our caller asked for it. */
+ if (err != NULL)
+ *err = errno;
+ }
+ ret = FALSE;
}
- ret = FALSE;
}
if (wdh->dump.opaque != NULL)
g_free(wdh->dump.opaque);
diff --git a/wiretap/lanalyzer.c b/wiretap/lanalyzer.c
index 18b8571c05..095f9d5e0c 100644
--- a/wiretap/lanalyzer.c
+++ b/wiretap/lanalyzer.c
@@ -1,6 +1,6 @@
/* lanalyzer.c
*
- * $Id: lanalyzer.c,v 1.34 2002/06/27 22:46:48 guy Exp $
+ * $Id: lanalyzer.c,v 1.35 2002/07/16 07:15:08 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -594,12 +594,18 @@ int lanalyzer_dump_can_write_encap(int encap)
* Returns TRUE on success, FALSE on failure; sets "*err" to an
* error code on failure
*---------------------------------------------------*/
-gboolean lanalyzer_dump_open(wtap_dumper *wdh, int *err)
+gboolean lanalyzer_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err)
{
int jump;
void *tmp;
- /* This is a LANalyzer file */
+ /* This is a LANalyzer file. We can't fill in some fields in the
+ header until all the packets have been written, so we can't
+ write to a pipe. */
+ if (cant_seek) {
+ *err = WTAP_ERR_CANT_WRITE_TO_PIPE;
+ return FALSE;
+ }
tmp = g_malloc(sizeof(LA_TmpInfo));
if (!tmp) {
diff --git a/wiretap/lanalyzer.h b/wiretap/lanalyzer.h
index e42a347699..42d030d034 100644
--- a/wiretap/lanalyzer.h
+++ b/wiretap/lanalyzer.h
@@ -1,6 +1,6 @@
/* lanalyzer.h
*
- * $Id: lanalyzer.h,v 1.6 2002/06/27 22:46:48 guy Exp $
+ * $Id: lanalyzer.h,v 1.7 2002/07/16 07:15:08 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -170,7 +170,7 @@ typedef struct {
} LA_TmpInfo;
int lanalyzer_open(wtap *wth, int *err);
-gboolean lanalyzer_dump_open(wtap_dumper *wdh, int *err);
+gboolean lanalyzer_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err);
int lanalyzer_dump_can_write_encap(int encap);
#endif
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c
index 5e37b7c856..3d31a72920 100644
--- a/wiretap/libpcap.c
+++ b/wiretap/libpcap.c
@@ -1,6 +1,6 @@
/* libpcap.c
*
- * $Id: libpcap.c,v 1.78 2002/06/13 11:03:23 guy Exp $
+ * $Id: libpcap.c,v 1.79 2002/07/16 07:15:08 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -1249,7 +1249,7 @@ int libpcap_dump_can_write_encap(int encap)
/* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on
failure */
-gboolean libpcap_dump_open(wtap_dumper *wdh, int *err)
+gboolean libpcap_dump_open(wtap_dumper *wdh, gboolean cant_seek _U_, int *err)
{
guint32 magic;
struct pcap_hdr file_hdr;
diff --git a/wiretap/libpcap.h b/wiretap/libpcap.h
index 3e272b1abc..b7cbcb7c81 100644
--- a/wiretap/libpcap.h
+++ b/wiretap/libpcap.h
@@ -1,6 +1,6 @@
/* libpcap.h
*
- * $Id: libpcap.h,v 1.12 2002/02/27 08:57:25 guy Exp $
+ * $Id: libpcap.h,v 1.13 2002/07/16 07:15:08 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -92,7 +92,7 @@ struct pcaprec_nokia_hdr {
};
int libpcap_open(wtap *wth, int *err);
-gboolean libpcap_dump_open(wtap_dumper *wdh, int *err);
+gboolean libpcap_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err);
int libpcap_dump_can_write_encap(int encap);
#endif
diff --git a/wiretap/netmon.c b/wiretap/netmon.c
index 3de968242c..1e393b27c3 100644
--- a/wiretap/netmon.c
+++ b/wiretap/netmon.c
@@ -1,6 +1,6 @@
/* netmon.c
*
- * $Id: netmon.c,v 1.56 2002/06/07 07:27:35 guy Exp $
+ * $Id: netmon.c,v 1.57 2002/07/16 07:15:08 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -581,9 +581,16 @@ int netmon_dump_can_write_encap(int encap)
/* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on
failure */
-gboolean netmon_dump_open(wtap_dumper *wdh, int *err)
+gboolean netmon_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err)
{
- /* This is a netmon file */
+ /* This is a NetMon file. We can't fill in some fields in the
+ header until all the packets have been written, so we can't
+ write to a pipe. */
+ if (cant_seek) {
+ *err = WTAP_ERR_CANT_WRITE_TO_PIPE;
+ return FALSE;
+ }
+
wdh->subtype_write = netmon_dump;
wdh->subtype_close = netmon_dump_close;
diff --git a/wiretap/netmon.h b/wiretap/netmon.h
index 9c3611e71a..a1c2f523c5 100644
--- a/wiretap/netmon.h
+++ b/wiretap/netmon.h
@@ -1,6 +1,6 @@
/* netmon.h
*
- * $Id: netmon.h,v 1.9 2002/02/27 08:57:25 guy Exp $
+ * $Id: netmon.h,v 1.10 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -24,7 +24,7 @@
#define __NETMON_H__
int netmon_open(wtap *wth, int *err);
-gboolean netmon_dump_open(wtap_dumper *wdh, int *err);
+gboolean netmon_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err);
int netmon_dump_can_write_encap(int encap);
#endif
diff --git a/wiretap/netxray.c b/wiretap/netxray.c
index 1500e92dde..57e54551f2 100644
--- a/wiretap/netxray.c
+++ b/wiretap/netxray.c
@@ -1,6 +1,6 @@
/* netxray.c
*
- * $Id: netxray.c,v 1.56 2002/06/07 07:27:35 guy Exp $
+ * $Id: netxray.c,v 1.57 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -549,9 +549,16 @@ int netxray_dump_can_write_encap(int encap)
/* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on
failure */
-gboolean netxray_dump_open_1_1(wtap_dumper *wdh, int *err)
+gboolean netxray_dump_open_1_1(wtap_dumper *wdh, gboolean cant_seek, int *err)
{
- /* This is a netxray file */
+ /* This is a NetXRay file. We can't fill in some fields in the header
+ until all the packets have been written, so we can't write to a
+ pipe. */
+ if (cant_seek) {
+ *err = WTAP_ERR_CANT_WRITE_TO_PIPE;
+ return FALSE;
+ }
+
wdh->subtype_write = netxray_dump_1_1;
wdh->subtype_close = netxray_dump_close_1_1;
@@ -689,9 +696,16 @@ static gboolean netxray_dump_close_1_1(wtap_dumper *wdh, int *err)
/* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on
failure */
-gboolean netxray_dump_open_2_0(wtap_dumper *wdh, int *err)
+gboolean netxray_dump_open_2_0(wtap_dumper *wdh, gboolean cant_seek, int *err)
{
- /* This is a netxray file */
+ /* This is a NetXRay file. We can't fill in some fields in the header
+ until all the packets have been written, so we can't write to a
+ pipe. */
+ if (cant_seek) {
+ *err = WTAP_ERR_CANT_WRITE_TO_PIPE;
+ return FALSE;
+ }
+
wdh->subtype_write = netxray_dump_2_0;
wdh->subtype_close = netxray_dump_close_2_0;
diff --git a/wiretap/netxray.h b/wiretap/netxray.h
index f87229d418..1cf63abc17 100644
--- a/wiretap/netxray.h
+++ b/wiretap/netxray.h
@@ -1,6 +1,6 @@
/* netxray.h
*
- * $Id: netxray.h,v 1.8 2002/04/18 21:35:57 guy Exp $
+ * $Id: netxray.h,v 1.9 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -24,8 +24,8 @@
#define __NETXRAY_H__
int netxray_open(wtap *wth, int *err);
-gboolean netxray_dump_open_2_0(wtap_dumper *wdh, int *err);
-gboolean netxray_dump_open_1_1(wtap_dumper *wdh, int *err);
+gboolean netxray_dump_open_2_0(wtap_dumper *wdh, gboolean cant_seek, int *err);
+gboolean netxray_dump_open_1_1(wtap_dumper *wdh, gboolean cant_seek, int *err);
int netxray_dump_can_write_encap(int encap);
#endif
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c
index 219f8ec469..f975bfc970 100644
--- a/wiretap/ngsniffer.c
+++ b/wiretap/ngsniffer.c
@@ -1,6 +1,6 @@
/* ngsniffer.c
*
- * $Id: ngsniffer.c,v 1.82 2002/06/07 07:27:35 guy Exp $
+ * $Id: ngsniffer.c,v 1.83 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -1401,7 +1401,7 @@ int ngsniffer_dump_can_write_encap(int encap)
/* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on
failure */
-gboolean ngsniffer_dump_open(wtap_dumper *wdh, int *err)
+gboolean ngsniffer_dump_open(wtap_dumper *wdh, gboolean cant_seek _U_, int *err)
{
size_t nwritten;
char buf[6] = {REC_VERS, 0x00, 0x12, 0x00, 0x00, 0x00}; /* version record */
diff --git a/wiretap/ngsniffer.h b/wiretap/ngsniffer.h
index cde0011a30..3c5cf3b301 100644
--- a/wiretap/ngsniffer.h
+++ b/wiretap/ngsniffer.h
@@ -1,6 +1,6 @@
/* ngsniffer.h
*
- * $Id: ngsniffer.h,v 1.10 2002/02/27 08:57:25 guy Exp $
+ * $Id: ngsniffer.h,v 1.11 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -24,7 +24,7 @@
#define __NGSNIFFER_H__
int ngsniffer_open(wtap *wth, int *err);
-gboolean ngsniffer_dump_open(wtap_dumper *wdh, int *err);
+gboolean ngsniffer_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err);
int ngsniffer_dump_can_write_encap(int encap);
#endif
diff --git a/wiretap/snoop.c b/wiretap/snoop.c
index 33817a26b3..2c3b257559 100644
--- a/wiretap/snoop.c
+++ b/wiretap/snoop.c
@@ -1,6 +1,6 @@
/* snoop.c
*
- * $Id: snoop.c,v 1.52 2002/06/07 07:27:35 guy Exp $
+ * $Id: snoop.c,v 1.53 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -597,7 +597,7 @@ int snoop_dump_can_write_encap(int encap)
/* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on
failure */
-gboolean snoop_dump_open(wtap_dumper *wdh, int *err)
+gboolean snoop_dump_open(wtap_dumper *wdh, gboolean cant_seek _U_, int *err)
{
struct snoop_hdr file_hdr;
size_t nwritten;
diff --git a/wiretap/snoop.h b/wiretap/snoop.h
index 405ede821f..4b45a1c18e 100644
--- a/wiretap/snoop.h
+++ b/wiretap/snoop.h
@@ -1,6 +1,6 @@
/* snoop.h
*
- * $Id: snoop.h,v 1.10 2002/02/27 08:57:25 guy Exp $
+ * $Id: snoop.h,v 1.11 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -24,7 +24,7 @@
#define __W_SNOOP_H__
int snoop_open(wtap *wth, int *err);
-gboolean snoop_dump_open(wtap_dumper *wdh, int *err);
+gboolean snoop_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err);
int snoop_dump_can_write_encap(int encap);
#endif
diff --git a/wiretap/visual.c b/wiretap/visual.c
index 41dca79594..b1d4efbf03 100644
--- a/wiretap/visual.c
+++ b/wiretap/visual.c
@@ -2,7 +2,7 @@
* File read and write routines for Visual Networks cap files.
* Copyright (c) 2001, Tom Nisbet tnisbet@visualnetworks.com
*
- * $Id: visual.c,v 1.8 2002/06/07 07:27:35 guy Exp $
+ * $Id: visual.c,v 1.9 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -412,10 +412,17 @@ int visual_dump_can_write_encap(int encap)
/* Open a file for writing.
Returns TRUE on success, FALSE on failure; sets "*err" to an
error code on failure */
-gboolean visual_dump_open(wtap_dumper *wdh, int *err)
+gboolean visual_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err)
{
struct visual_write_info *visual;
+ /* We can't fill in some fields in the header until all the packets
+ have been written, so we can't write to a pipe. */
+ if (cant_seek) {
+ *err = WTAP_ERR_CANT_WRITE_TO_PIPE;
+ return FALSE;
+ }
+
/* Set the write routines for a visual file. */
wdh->subtype_write = visual_dump;
wdh->subtype_close = visual_dump_close;
diff --git a/wiretap/visual.h b/wiretap/visual.h
index 7102664280..0d9b02aae9 100644
--- a/wiretap/visual.h
+++ b/wiretap/visual.h
@@ -5,7 +5,7 @@
*
* Based on the code that handles netmon files.
*
- * $Id: visual.h,v 1.3 2002/02/27 08:57:25 guy Exp $
+ * $Id: visual.h,v 1.4 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -29,7 +29,7 @@
#define __VISUAL_H__
int visual_open(wtap *wth, int *err);
-gboolean visual_dump_open(wtap_dumper *wdh, int *err);
+gboolean visual_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err);
int visual_dump_can_write_encap(int encap);
#endif
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index c0cc35c003..023b93833d 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -1,6 +1,6 @@
/* wtap.c
*
- * $Id: wtap.c,v 1.66 2002/06/07 07:47:57 guy Exp $
+ * $Id: wtap.c,v 1.67 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -179,14 +179,15 @@ wtap_short_string_to_encap(const char *short_name)
}
static const char *wtap_errlist[] = {
- "The file isn't a plain file",
+ "The file isn't a plain file or pipe",
"The file is being opened for random access but is a pipe",
"The file isn't a capture file in a known format",
"File contains record data we don't support",
+ "That file format cannot be written to a pipe",
NULL,
"Files can't be saved in that format",
"Files from that network type can't be saved in that format",
- "That format doesn't support per-packet encapsulations",
+ "That file format doesn't support per-packet encapsulations",
NULL,
NULL,
"Less data was read than was expected",
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index e961d68164..7b73452804 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -1,6 +1,6 @@
/* wtap.h
*
- * $Id: wtap.h,v 1.116 2002/07/12 22:52:43 guy Exp $
+ * $Id: wtap.h,v 1.117 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -393,30 +393,32 @@ void wtap_set_bytes_dumped(wtap_dumper *wdh, long bytes_dumped);
#define WTAP_ERR_UNSUPPORTED -4
/* Supported file type, but there's something in the file we
can't support */
-#define WTAP_ERR_CANT_OPEN -5
+#define WTAP_ERR_CANT_WRITE_TO_PIPE -5
+ /* Wiretap can't save to a pipe in the specified format */
+#define WTAP_ERR_CANT_OPEN -6
/* The file couldn't be opened, reason unknown */
-#define WTAP_ERR_UNSUPPORTED_FILE_TYPE -6
+#define WTAP_ERR_UNSUPPORTED_FILE_TYPE -7
/* Wiretap can't save files in the specified format */
-#define WTAP_ERR_UNSUPPORTED_ENCAP -7
+#define WTAP_ERR_UNSUPPORTED_ENCAP -8
/* Wiretap can't read or save files in the specified format with the
specified encapsulation */
-#define WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED -8
+#define WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED -9
/* The specified format doesn't support per-packet encapsulations */
-#define WTAP_ERR_CANT_CLOSE -9
+#define WTAP_ERR_CANT_CLOSE -10
/* The file couldn't be closed, reason unknown */
-#define WTAP_ERR_CANT_READ -10
+#define WTAP_ERR_CANT_READ -11
/* An attempt to read failed, reason unknown */
-#define WTAP_ERR_SHORT_READ -11
+#define WTAP_ERR_SHORT_READ -12
/* An attempt to read read less data than it should have */
-#define WTAP_ERR_BAD_RECORD -12
+#define WTAP_ERR_BAD_RECORD -13
/* We read an invalid record */
-#define WTAP_ERR_SHORT_WRITE -13
+#define WTAP_ERR_SHORT_WRITE -14
/* An attempt to write wrote less data than it should have */
-#define WTAP_ERR_UNC_TRUNCATED -14
+#define WTAP_ERR_UNC_TRUNCATED -15
/* Sniffer compressed data was oddly truncated */
-#define WTAP_ERR_UNC_OVERFLOW -15
+#define WTAP_ERR_UNC_OVERFLOW -16
/* Uncompressing Sniffer data would overflow buffer */
-#define WTAP_ERR_UNC_BAD_OFFSET -16
+#define WTAP_ERR_UNC_BAD_OFFSET -17
/* LZ77 compressed data has bad offset to string */
/* Errors from zlib; zlib error Z_xxx turns into Wiretap error