summaryrefslogtreecommitdiff
path: root/wiretap/pppdump.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-10-09 16:44:15 -0700
committerGuy Harris <guy@alum.mit.edu>2014-10-09 23:45:30 +0000
commit45e462985db891248ffcb9db21e6b66733de0b84 (patch)
tree90d031f9769c07abaea83330a58dd9d3933eb7b1 /wiretap/pppdump.c
parent112c90a04b778958985b02b9663743cea1039f47 (diff)
downloadwireshark-45e462985db891248ffcb9db21e6b66733de0b84.tar.gz
Use an enum for the open-routine return value, as per Evan Huus's suggestion.
Clean up some things we ran across while making those changes. Change-Id: Ic0d8943d36e6e120d7af0a6148fad98015d1e83e Reviewed-on: https://code.wireshark.org/review/4581 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/pppdump.c')
-rw-r--r--wiretap/pppdump.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/pppdump.c b/wiretap/pppdump.c
index d678eee1d0..3e64ab1783 100644
--- a/wiretap/pppdump.c
+++ b/wiretap/pppdump.c
@@ -242,7 +242,7 @@ init_state(pppdump_t *state)
}
-int
+wtap_open_return_val
pppdump_open(wtap *wth, int *err, gchar **err_info)
{
guint8 buffer[6]; /* Looking for: 0x07 t3 t2 t1 t0 ID */
@@ -259,8 +259,8 @@ pppdump_open(wtap *wth, int *err, gchar **err_info)
if (!wtap_read_bytes(wth->fh, buffer, sizeof(buffer),
err, err_info)) {
if (*err != WTAP_ERR_SHORT_READ)
- return -1;
- return 0;
+ return WTAP_OPEN_ERROR;
+ return WTAP_OPEN_NOT_MINE;
}
if (buffer[0] == PPPD_RESET_TIME &&
@@ -273,13 +273,13 @@ pppdump_open(wtap *wth, int *err, gchar **err_info)
goto my_file_type;
}
else {
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
my_file_type:
if (file_seek(wth->fh, 5, SEEK_SET, err) == -1)
- return -1;
+ return WTAP_OPEN_ERROR;
state = (pppdump_t *)g_malloc(sizeof(pppdump_t));
wth->priv = (void *)state;
@@ -309,7 +309,7 @@ pppdump_open(wtap *wth, int *err, gchar **err_info)
state->pids = NULL;
state->pkt_cnt = 0;
- return 1;
+ return WTAP_OPEN_MINE;
}
/* Set part of the struct wtap_pkthdr. */