diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-12-17 00:29:31 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-12-17 08:31:49 +0000 |
commit | ddcc2aee3d28510ee4f5c4b8dac1e2fc68f1e8e7 (patch) | |
tree | bcc00e4561d3d718bb124b7d8c370d0068c020dd /wiretap | |
parent | dbdcae80ba93961f66274f37178d745557786525 (diff) |
Rename WTAP_ERR_UNSUPPORTED_FILE_TYPE to WTAP_ERR_UNWRITABLE_FILE_TYPE.
That makes it clearer what the problem is, and that it should only be
returned by the dump code path, not by the read code path.
Change-Id: I22d407efe3ae9fba7aa25f08f050317549866442
Reviewed-on: https://code.wireshark.org/review/5798
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/btsnoop.c | 4 | ||||
-rw-r--r-- | wiretap/erf.c | 2 | ||||
-rw-r--r-- | wiretap/file_access.c | 2 | ||||
-rw-r--r-- | wiretap/libpcap.c | 4 | ||||
-rw-r--r-- | wiretap/logcat.c | 2 | ||||
-rw-r--r-- | wiretap/logcat_text.c | 2 | ||||
-rw-r--r-- | wiretap/netmon.c | 6 | ||||
-rw-r--r-- | wiretap/netscaler.c | 8 | ||||
-rw-r--r-- | wiretap/wtap.c | 2 | ||||
-rw-r--r-- | wiretap/wtap.h | 2 |
10 files changed, 17 insertions, 17 deletions
diff --git a/wiretap/btsnoop.c b/wiretap/btsnoop.c index e0f266ba41..af10c3c86d 100644 --- a/wiretap/btsnoop.c +++ b/wiretap/btsnoop.c @@ -409,7 +409,7 @@ gboolean btsnoop_dump_open_h1(wtap_dumper *wdh, int *err) default: /* We should never get here - our open routine should only get called for the types above. */ - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } @@ -451,7 +451,7 @@ gboolean btsnoop_dump_open_h4(wtap_dumper *wdh, int *err) default: /* We should never get here - our open routine should only get called for the types above. */ - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } diff --git a/wiretap/erf.c b/wiretap/erf.c index 2398d15912..b6a984a82e 100644 --- a/wiretap/erf.c +++ b/wiretap/erf.c @@ -730,7 +730,7 @@ int erf_dump_open(wtap_dumper *wdh, int *err) wdh->tsprecision = WTAP_TSPREC_NSEC; break; default: - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; break; } diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 03177c7407..018045cf61 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -2225,7 +2225,7 @@ wtap_dump_open_check(int file_type_subtype, int encap, gboolean compressed, int { if (!wtap_dump_can_open(file_type_subtype)) { /* Invalid type, or type we don't know how to write. */ - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c index 2a770a594c..c6141cd1db 100644 --- a/wiretap/libpcap.c +++ b/wiretap/libpcap.c @@ -851,7 +851,7 @@ gboolean libpcap_dump_open(wtap_dumper *wdh, int *err) default: /* We should never get here - our open routine should only get called for the types above. */ - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } @@ -982,7 +982,7 @@ static gboolean libpcap_dump(wtap_dumper *wdh, /* We should never get here - our open routine should only get called for the types above. */ g_assert_not_reached(); - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } diff --git a/wiretap/logcat.c b/wiretap/logcat.c index b1ab83dbe4..a10cc7544e 100644 --- a/wiretap/logcat.c +++ b/wiretap/logcat.c @@ -353,7 +353,7 @@ gboolean logcat_binary_dump_open(wtap_dumper *wdh, int *err) break; default: - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } diff --git a/wiretap/logcat_text.c b/wiretap/logcat_text.c index a0da65616e..96ec2cb656 100644 --- a/wiretap/logcat_text.c +++ b/wiretap/logcat_text.c @@ -532,7 +532,7 @@ static gboolean logcat_text_dump_text(wtap_dumper *wdh, return FALSE; } } else { - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } } diff --git a/wiretap/netmon.c b/wiretap/netmon.c index 7d0592890e..e9f50ce204 100644 --- a/wiretap/netmon.c +++ b/wiretap/netmon.c @@ -1038,7 +1038,7 @@ static gboolean netmon_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr, default: /* We should never get here - our open routine should only get called for the types above. */ - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } @@ -1143,7 +1143,7 @@ static gboolean netmon_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr, default: /* We should never get here - our open routine should only get called for the types above. */ - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } @@ -1296,7 +1296,7 @@ static gboolean netmon_dump_close(wtap_dumper *wdh, int *err) /* We should never get here - our open routine should only get called for the types above. */ if (err != NULL) - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } if (!wtap_dump_file_write(wdh, magicp, magic_size, err)) diff --git a/wiretap/netscaler.c b/wiretap/netscaler.c index f8764ab43c..7d3fb9da6b 100644 --- a/wiretap/netscaler.c +++ b/wiretap/netscaler.c @@ -1845,7 +1845,7 @@ static gboolean nstrace_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr, nstrace->page_offset += (guint16) phdr->caplen; } else if (wdh->file_type_subtype == WTAP_FILE_TYPE_SUBTYPE_NETSCALER_2_0) { - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } @@ -1860,7 +1860,7 @@ static gboolean nstrace_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr, case NSPR_HEADER_VERSION206: if (wdh->file_type_subtype == WTAP_FILE_TYPE_SUBTYPE_NETSCALER_1_0) { - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } else if (wdh->file_type_subtype == WTAP_FILE_TYPE_SUBTYPE_NETSCALER_2_0) { @@ -1889,11 +1889,11 @@ static gboolean nstrace_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr, case NSPR_HEADER_VERSION300: if (wdh->file_type_subtype == WTAP_FILE_TYPE_SUBTYPE_NETSCALER_1_0) { - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } else if (wdh->file_type_subtype == WTAP_FILE_TYPE_SUBTYPE_NETSCALER_2_0) { - *err = WTAP_ERR_UNSUPPORTED_FILE_TYPE; + *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; return FALSE; } else if (wdh->file_type_subtype == WTAP_FILE_TYPE_SUBTYPE_NETSCALER_3_0) { diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 6ce8f38dda..74cab0901c 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -831,7 +831,7 @@ static const char *wtap_errlist[] = { /* WTAP_ERR_CANT_OPEN */ NULL, - /* WTAP_ERR_UNSUPPORTED_FILE_TYPE */ + /* WTAP_ERR_UNWRITABLE_FILE_TYPE */ "Files can't be saved in that format", /* WTAP_ERR_UNWRITABLE_ENCAP */ diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 2590bb35e9..e7d80da355 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -1681,7 +1681,7 @@ int wtap_register_encap_type(const char* name, const char* short_name); #define WTAP_ERR_CANT_OPEN -6 /** The file couldn't be opened, reason unknown */ -#define WTAP_ERR_UNSUPPORTED_FILE_TYPE -7 +#define WTAP_ERR_UNWRITABLE_FILE_TYPE -7 /** Wiretap can't save files in the specified format */ #define WTAP_ERR_UNWRITABLE_ENCAP -8 |