diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-12-13 09:53:50 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-12-13 09:53:50 +0000 |
commit | d94bd07f99438278cb11f24b00571ab2907b6bdb (patch) | |
tree | 5f96d0a35c97af466bcb2d5b8a9371327bb0190f /wiretap/pcap-common.c | |
parent | 1df4ee91090e35c25835204d7175b9395be32606 (diff) |
Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports any
form of corruption/bogosity in a file, including in a file header as
well as in records in the file. Change the error message
wtap_strerror() returns for it to reflect that.
Use it for some file header problems for which it wasn't already being
used - WTAP_ERR_UNSUPPORTED shouldn't be used for that, it should only
be used for files that we have no reason to believe are invalid but that
have a version number we don't know about or some other
non-link-layer-encapsulation-type value we don't know about.
svn path=/trunk/; revision=40175
Diffstat (limited to 'wiretap/pcap-common.c')
-rw-r--r-- | wiretap/pcap-common.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c index baf6ed007e..25a2be444c 100644 --- a/wiretap/pcap-common.c +++ b/wiretap/pcap-common.c @@ -857,7 +857,7 @@ pcap_read_irda_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header, } if (pntohs(&irda_phdr[IRDA_SLL_PROTOCOL_OFFSET]) != 0x0017) { - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; if (err_info != NULL) *err_info = g_strdup("libpcap: IrDA capture has a packet with an invalid sll_protocol field"); return FALSE; @@ -907,7 +907,7 @@ pcap_read_lapd_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header, } if (pntohs(&lapd_phdr[LAPD_SLL_PROTOCOL_OFFSET]) != ETH_P_LAPD) { - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; if (err_info != NULL) *err_info = g_strdup("libpcap: LAPD capture has a packet with an invalid sll_protocol field"); return FALSE; @@ -1399,7 +1399,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap, * Uh-oh, the packet isn't big enough to even * have a pseudo-header. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("pcap: Nokia IPSO ATM file has a %u-byte packet, too small to have even an ATM pseudo-header", packet_size); return -1; @@ -1418,7 +1418,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap, * Uh-oh, the packet isn't big enough to even * have a pseudo-header. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("pcap: SunATM file has a %u-byte packet, too small to have even an ATM pseudo-header", packet_size); return -1; @@ -1459,7 +1459,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap, * Uh-oh, the packet isn't big enough to even * have a pseudo-header. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("pcap: IrDA file has a %u-byte packet, too small to have even an IrDA pseudo-header", packet_size); return -1; @@ -1477,7 +1477,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap, * Uh-oh, the packet isn't big enough to even * have a pseudo-header. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("pcap: MTP2 file has a %u-byte packet, too small to have even an MTP2 pseudo-header", packet_size); return -1; @@ -1495,7 +1495,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap, * Uh-oh, the packet isn't big enough to even * have a pseudo-header. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("pcap: LAPD file has a %u-byte packet, too small to have even a LAPD pseudo-header", packet_size); return -1; @@ -1513,7 +1513,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap, * Uh-oh, the packet isn't big enough to even * have a pseudo-header. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("pcap: SITA file has a %u-byte packet, too small to have even a SITA pseudo-header", packet_size); return -1; @@ -1537,7 +1537,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap, * Uh-oh, the packet isn't big enough to even * have a pseudo-header. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("pcap: libpcap bluetooth file has a %u-byte packet, too small to have even a pseudo-header", packet_size); return -1; @@ -1556,7 +1556,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap, * Uh-oh, the packet isn't big enough to even * have a pseudo-header. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("pcap: libpcap ppp file has a %u-byte packet, too small to have even a pseudo-header", packet_size); return -1; @@ -1575,7 +1575,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap, * Uh-oh, the packet isn't big enough to even * have a pseudo-header. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("pcap: ERF file has a %u-byte packet, too small to have even an ERF pseudo-header", packet_size); return -1; @@ -1609,7 +1609,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap, * Uh-oh, the packet isn't big enough to even * have a pseudo-header. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("pcap: I2C file has a %u-byte packet, too small to have even a I2C pseudo-header", packet_size); return -1; |