forked from osmocom/wireshark
Rename WTAP_ERR_UNSUPPORTED_ENCAP to WTAP_ERR_UNWRITABLE_ENCAP.
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: Icc5c9cff43be6c073f0467607555fa7138c5d074 Reviewed-on: https://code.wireshark.org/review/5797 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
40f69b2778
commit
dbdcae80ba
|
@ -905,7 +905,7 @@ process_cap_file(wtap *wth, const char *filename)
|
|||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED:
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
case WTAP_ERR_DECOMPRESS:
|
||||
fprintf(stderr, "(%s)\n", err_info);
|
||||
|
@ -1485,7 +1485,7 @@ main(int argc, char *argv[])
|
|||
switch (err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED:
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
case WTAP_ERR_DECOMPRESS:
|
||||
fprintf(stderr, "(%s)\n", err_info);
|
||||
|
|
|
@ -143,7 +143,7 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing,
|
|||
errmsg = "TShark doesn't support writing capture files in that format.";
|
||||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
if (for_writing)
|
||||
errmsg = "TShark can't save this capture in that format.";
|
||||
else {
|
||||
|
|
|
@ -257,7 +257,7 @@ main(int argc, char *argv[])
|
|||
switch (err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED:
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
fprintf(stderr, "(%s)\n", err_info);
|
||||
g_free(err_info);
|
||||
|
|
|
@ -1251,7 +1251,7 @@ main(int argc, char *argv[])
|
|||
wtap_strerror(err));
|
||||
switch (err) {
|
||||
case WTAP_ERR_UNSUPPORTED:
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
fprintf(stderr, "(%s)\n", err_info);
|
||||
g_free(err_info);
|
||||
|
@ -1640,7 +1640,7 @@ main(int argc, char *argv[])
|
|||
|
||||
if (!wtap_dump(pdh, phdr, buf, &err)) {
|
||||
switch (err) {
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
/*
|
||||
* This is a problem with the particular frame we're
|
||||
* writing and the file type and subtype we're
|
||||
|
@ -1689,7 +1689,7 @@ main(int argc, char *argv[])
|
|||
argv[optind], wtap_strerror(err));
|
||||
switch (err) {
|
||||
case WTAP_ERR_UNSUPPORTED:
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
fprintf(stderr, "(%s)\n", err_info);
|
||||
g_free(err_info);
|
||||
|
|
|
@ -228,7 +228,7 @@ WSLUA_CONSTRUCTOR Dumper_new(lua_State* L) {
|
|||
wtap_file_type_subtype_string(filetype));
|
||||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
luaL_error(L,"Files of file type %s don't support encapsulation %s",
|
||||
wtap_file_type_subtype_string(filetype),
|
||||
wtap_encap_short_string(encap));
|
||||
|
@ -372,7 +372,7 @@ WSLUA_METHOD Dumper_new_for_current(lua_State* L) {
|
|||
wtap_file_type_subtype_string(filetype));
|
||||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
luaL_error(L,"Files of file type %s don't support encapsulation %s",
|
||||
wtap_file_type_subtype_string(filetype),
|
||||
wtap_encap_short_string(encap));
|
||||
|
|
|
@ -1918,7 +1918,7 @@ static int
|
|||
wslua_filehandler_can_write_encap(int encap, void* data)
|
||||
{
|
||||
FileHandler fh = (FileHandler)(data);
|
||||
int retval = WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
int retval = WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
lua_State* L = NULL;
|
||||
|
||||
INIT_FILEHANDLER_ROUTINE(can_write_encap,WTAP_ERR_INTERNAL);
|
||||
|
@ -1927,19 +1927,19 @@ wslua_filehandler_can_write_encap(int encap, void* data)
|
|||
|
||||
switch ( lua_pcall(L,1,1,1) ) {
|
||||
case 0:
|
||||
retval = wslua_optboolint(L,-1,WTAP_ERR_UNSUPPORTED_ENCAP);
|
||||
retval = wslua_optboolint(L,-1,WTAP_ERR_UNWRITABLE_ENCAP);
|
||||
break;
|
||||
CASE_ERROR("can_write_encap")
|
||||
}
|
||||
|
||||
END_FILEHANDLER_ROUTINE();
|
||||
|
||||
/* the retval we got was either a 1 for true, 0 for false, or WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
/* the retval we got was either a 1 for true, 0 for false, or WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
but can_write_encap() expects 0 to be true/yes */
|
||||
if (retval == 1) {
|
||||
retval = 0;
|
||||
} else if (retval == 0) {
|
||||
retval = WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
retval = WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
|
14
file.c
14
file.c
|
@ -747,7 +747,7 @@ cf_read(capture_file *cf, gboolean reloading)
|
|||
g_free(err_info);
|
||||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
simple_error_message_box(
|
||||
"The capture file has a packet with a network type that Wireshark doesn't support.\n(%s)",
|
||||
err_info);
|
||||
|
@ -1526,7 +1526,7 @@ cf_merge_files(char **out_filenamep, int in_file_count,
|
|||
display_basename = g_filename_display_basename(in_files[i].filename);
|
||||
switch (read_err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
simple_error_message_box(
|
||||
"The capture file %s has a packet with a network type that Wireshark doesn't support.\n(%s)",
|
||||
display_basename, err_info);
|
||||
|
@ -1571,7 +1571,7 @@ cf_merge_files(char **out_filenamep, int in_file_count,
|
|||
/* Wiretap error. */
|
||||
switch (write_err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
/*
|
||||
* This is a problem with the particular frame we're writing and
|
||||
* the file type and subtype we're writing; note that, and report
|
||||
|
@ -1728,7 +1728,7 @@ cf_read_record_r(capture_file *cf, const frame_data *fdata,
|
|||
display_basename = g_filename_display_basename(cf->filename);
|
||||
switch (err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
simple_error_message_box("The file \"%s\" has a packet with a network type that Wireshark doesn't support.\n(%s)",
|
||||
display_basename, err_info);
|
||||
g_free(err_info);
|
||||
|
@ -4150,7 +4150,7 @@ save_record(capture_file *cf, frame_data *fdata,
|
|||
/* Wiretap error. */
|
||||
switch (err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
/*
|
||||
* This is a problem with the particular frame we're writing and
|
||||
* the file type and subtype we're writing; note that, and report
|
||||
|
@ -4488,7 +4488,7 @@ rescan_file(capture_file *cf, const char *fname, gboolean is_tempfile, int *err)
|
|||
g_free(err_info);
|
||||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
simple_error_message_box(
|
||||
"The capture file has a packet with a network type that Wireshark doesn't support.\n(%s)",
|
||||
err_info);
|
||||
|
@ -5026,7 +5026,7 @@ cf_open_failure_alert_box(const char *filename, int err, gchar *err_info,
|
|||
"Wireshark doesn't support writing capture files in that format.");
|
||||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
if (for_writing) {
|
||||
simple_error_message_box("Wireshark can't save this capture in that format.");
|
||||
} else {
|
||||
|
|
|
@ -59,7 +59,7 @@ frame_read(struct tvb_frame *frame_tvb, struct wtap_pkthdr *phdr, Buffer *buf)
|
|||
*/
|
||||
if (!wtap_seek_read(frame_tvb->wth, frame_tvb->file_off, phdr, buf, &err, &err_info)) {
|
||||
switch (err) {
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
g_free(err_info);
|
||||
break;
|
||||
|
|
|
@ -377,7 +377,7 @@ main(int argc, char *argv[])
|
|||
switch (open_err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED:
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
fprintf(stderr, "(%s)\n", err_info);
|
||||
g_free(err_info);
|
||||
|
@ -546,7 +546,7 @@ main(int argc, char *argv[])
|
|||
switch (read_err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED:
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
fprintf(stderr, "(%s)\n", err_info);
|
||||
g_free(err_info);
|
||||
|
@ -559,7 +559,7 @@ main(int argc, char *argv[])
|
|||
if (got_write_error) {
|
||||
switch (write_err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
/*
|
||||
* This is a problem with the particular frame we're writing and
|
||||
* the file type and subtype we're wwriting; note that, and
|
||||
|
|
|
@ -1012,7 +1012,7 @@ load_cap_file(capture_file *cf)
|
|||
g_free(err_info);
|
||||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
cmdarg_err("The file \"%s\" has a packet with a network type that Rawshark doesn't support.\n(%s)",
|
||||
cf->filename, err_info);
|
||||
g_free(err_info);
|
||||
|
|
|
@ -124,7 +124,7 @@ frame_write(FrameRecord_t *frame, wtap *wth, wtap_dumper *pdh,
|
|||
switch (err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED:
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
fprintf(stderr, "(%s)\n", err_info);
|
||||
g_free(err_info);
|
||||
|
@ -286,7 +286,7 @@ main(int argc, char *argv[])
|
|||
switch (err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED:
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
fprintf(stderr, "(%s)\n", err_info);
|
||||
g_free(err_info);
|
||||
|
@ -343,7 +343,7 @@ main(int argc, char *argv[])
|
|||
switch (err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED:
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_BAD_FILE:
|
||||
fprintf(stderr, "(%s)\n", err_info);
|
||||
g_free(err_info);
|
||||
|
|
10
tshark.c
10
tshark.c
|
@ -3120,7 +3120,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
|
|||
cmdarg_err("Capture files can't be written in that format.");
|
||||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
case WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED:
|
||||
cmdarg_err("The capture file being read can't be written as a "
|
||||
"\"%s\" file.", wtap_file_type_subtype_short_string(out_file_type));
|
||||
|
@ -3242,7 +3242,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
|
|||
/* Error writing to a capture file */
|
||||
switch (err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
/*
|
||||
* This is a problem with the particular frame we're writing
|
||||
* and the file type and subtype we're writing; note that,
|
||||
|
@ -3325,7 +3325,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
|
|||
/* Error writing to a capture file */
|
||||
switch (err) {
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
/*
|
||||
* This is a problem with the particular frame we're writing
|
||||
* and the file type and subtype we're writing; note that,
|
||||
|
@ -3411,7 +3411,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
|
|||
g_free(err_info);
|
||||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
cmdarg_err("The file \"%s\" has a packet with a network type that TShark doesn't support.\n(%s)",
|
||||
cf->filename, err_info);
|
||||
g_free(err_info);
|
||||
|
@ -4165,7 +4165,7 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing,
|
|||
errmsg = "TShark doesn't support writing capture files in that format.";
|
||||
break;
|
||||
|
||||
case WTAP_ERR_UNSUPPORTED_ENCAP:
|
||||
case WTAP_ERR_UNWRITABLE_ENCAP:
|
||||
if (for_writing) {
|
||||
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
|
||||
"TShark can't save this capture as a \"%s\" file.",
|
||||
|
|
|
@ -319,7 +319,7 @@ int _5views_dump_can_write_encap(int encap)
|
|||
return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
|
||||
|
||||
if (encap < 0 || (unsigned int) encap >= NUM_WTAP_ENCAPS || wtap_encap[encap] == -1)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ int btsnoop_dump_can_write_encap(int encap)
|
|||
|
||||
/* XXX - for now we only support WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR and WTAP_ENCAP_BLUETOOTH_LINUX_MONITOR */
|
||||
if (encap != WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR && encap != WTAP_ENCAP_BLUETOOTH_LINUX_MONITOR)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -575,7 +575,7 @@ catapult_dct2000_dump_can_write_encap(int encap)
|
|||
|
||||
default:
|
||||
/* But don't write to any other formats... */
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ int commview_dump_can_write_encap(int encap)
|
|||
return 0;
|
||||
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -392,7 +392,7 @@ static gboolean commview_dump(wtap_dumper *wdh,
|
|||
break;
|
||||
|
||||
default :
|
||||
*err = WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
*err = WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -715,7 +715,7 @@ int erf_dump_can_write_encap(int encap)
|
|||
return 0;
|
||||
|
||||
if (wtap_wtap_encap_to_erf_encap(encap) == -1)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -385,7 +385,7 @@ int eyesdn_dump_can_write_encap(int encap)
|
|||
return 0;
|
||||
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -467,7 +467,7 @@ static gboolean eyesdn_dump(wtap_dumper *wdh,
|
|||
break;
|
||||
|
||||
default:
|
||||
*err=WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
*err=WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1105,7 +1105,7 @@ int k12_dump_can_write_encap(int encap) {
|
|||
return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
|
||||
|
||||
if (encap != WTAP_ENCAP_K12)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -399,7 +399,7 @@ k12text_dump(wtap_dumper *wdh _U_, const struct wtap_pkthdr *phdr,
|
|||
/*
|
||||
* That encapsulation type is not supported. Fail.
|
||||
*/
|
||||
*err = WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
*err = WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -458,7 +458,7 @@ k12text_dump_can_write_encap(int encap)
|
|||
case WTAP_ENCAP_MTP2:
|
||||
case WTAP_ENCAP_ATM_PDUS:
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -726,7 +726,7 @@ int lanalyzer_dump_can_write_encap(int encap)
|
|||
|
||||
if ( encap != WTAP_ENCAP_ETHERNET
|
||||
&& encap != WTAP_ENCAP_TOKEN_RING )
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
/*
|
||||
* printf("lanalyzer_dump_can_write_encap(%d)\n",encap);
|
||||
*/
|
||||
|
|
|
@ -811,7 +811,7 @@ int libpcap_dump_can_write_encap(int encap)
|
|||
return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
|
||||
|
||||
if (wtap_wtap_encap_to_pcap_encap(encap) == -1)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ int logcat_dump_can_write_encap(int encap)
|
|||
return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
|
||||
|
||||
if (encap != WTAP_ENCAP_LOGCAT && encap != WTAP_ENCAP_WIRESHARK_UPPER_PDU)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -314,7 +314,7 @@ int logcat_text_brief_dump_can_write_encap(int encap) {
|
|||
case WTAP_ENCAP_WIRESHARK_UPPER_PDU:
|
||||
return 0;
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -328,7 +328,7 @@ int logcat_text_process_dump_can_write_encap(int encap) {
|
|||
case WTAP_ENCAP_WIRESHARK_UPPER_PDU:
|
||||
return 0;
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ int logcat_text_tag_dump_can_write_encap(int encap) {
|
|||
case WTAP_ENCAP_WIRESHARK_UPPER_PDU:
|
||||
return 0;
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ int logcat_text_time_dump_can_write_encap(int encap) {
|
|||
case WTAP_ENCAP_WIRESHARK_UPPER_PDU:
|
||||
return 0;
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -370,7 +370,7 @@ int logcat_text_thread_dump_can_write_encap(int encap) {
|
|||
case WTAP_ENCAP_WIRESHARK_UPPER_PDU:
|
||||
return 0;
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -384,7 +384,7 @@ int logcat_text_threadtime_dump_can_write_encap(int encap) {
|
|||
case WTAP_ENCAP_WIRESHARK_UPPER_PDU:
|
||||
return 0;
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -398,7 +398,7 @@ int logcat_text_long_dump_can_write_encap(int encap) {
|
|||
case WTAP_ENCAP_WIRESHARK_UPPER_PDU:
|
||||
return 0;
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -942,7 +942,7 @@ int netmon_dump_can_write_encap_1_x(int encap)
|
|||
* format.
|
||||
*/
|
||||
if (encap < 0 || (unsigned) encap >= NUM_WTAP_ENCAPS || wtap_encap[encap] == -1)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -957,7 +957,7 @@ int netmon_dump_can_write_encap_2_x(int encap)
|
|||
return 0;
|
||||
|
||||
if (encap < 0 || (unsigned) encap >= NUM_WTAP_ENCAPS || wtap_encap[encap] == -1)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1052,7 +1052,7 @@ static gboolean netmon_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
|
|||
/*
|
||||
* No. Fail.
|
||||
*/
|
||||
*err = WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
*err = WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1606,7 +1606,7 @@ int nstrace_10_dump_can_write_encap(int encap)
|
|||
if (encap == WTAP_ENCAP_NSTRACE_1_0)
|
||||
return 0;
|
||||
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1617,7 +1617,7 @@ int nstrace_20_dump_can_write_encap(int encap)
|
|||
if (encap == WTAP_ENCAP_NSTRACE_2_0)
|
||||
return 0;
|
||||
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
|
||||
/* Returns 0 if we could write the specified encapsulation type,
|
||||
|
@ -1627,7 +1627,7 @@ int nstrace_30_dump_can_write_encap(int encap)
|
|||
if (encap == WTAP_ENCAP_NSTRACE_3_0)
|
||||
return 0;
|
||||
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
|
||||
/* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on
|
||||
|
|
|
@ -646,7 +646,7 @@ int nettl_dump_can_write_encap(int encap)
|
|||
case WTAP_ENCAP_NETTL_UNKNOWN:
|
||||
return 0;
|
||||
default:
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -764,7 +764,7 @@ static gboolean nettl_dump(wtap_dumper *wdh,
|
|||
#endif
|
||||
default:
|
||||
/* found one we don't support */
|
||||
*err = WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
*err = WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -567,7 +567,7 @@ int network_instruments_dump_can_write_encap(int encap)
|
|||
return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
|
||||
|
||||
if (encap < 0 || (wtap_to_observer_encap(encap) == OBSERVER_UNDEFINED))
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1690,7 +1690,7 @@ netxray_dump_can_write_encap_1_1(int encap)
|
|||
return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
|
||||
|
||||
if (wtap_encap_to_netxray_1_1_encap(encap) == -1)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1867,7 +1867,7 @@ netxray_dump_can_write_encap_2_0(int encap)
|
|||
return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
|
||||
|
||||
if (wtap_encap_to_netxray_2_0_encap(encap) == -1)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1957,7 +1957,7 @@ ngsniffer_dump_can_write_encap(int encap)
|
|||
return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
|
||||
|
||||
if (encap < 0 || (unsigned)encap >= NUM_WTAP_ENCAPS || wtap_encap[encap] == -1)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2791,7 +2791,7 @@ pcapng_write_if_descr_block(wtap_dumper *wdh, wtapng_if_descr_t *int_data, int *
|
|||
int_data->snap_len);
|
||||
|
||||
if (int_data->link_type == (guint16)-1) {
|
||||
*err = WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
*err = WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -3834,7 +3834,7 @@ int pcapng_dump_can_write_encap(int wtap_encap)
|
|||
|
||||
/* Make sure we can figure out this DLT type */
|
||||
if (wtap_wtap_encap_to_pcap_encap(wtap_encap) == -1)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -781,7 +781,7 @@ int snoop_dump_can_write_encap(int encap)
|
|||
return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
|
||||
|
||||
if (encap < 0 || (unsigned)encap >= NUM_WTAP_ENCAPS || wtap_encap[encap] == -1)
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -605,7 +605,7 @@ int visual_dump_can_write_encap(int encap)
|
|||
return 0;
|
||||
}
|
||||
|
||||
return WTAP_ERR_UNSUPPORTED_ENCAP;
|
||||
return WTAP_ERR_UNWRITABLE_ENCAP;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -834,7 +834,7 @@ static const char *wtap_errlist[] = {
|
|||
/* WTAP_ERR_UNSUPPORTED_FILE_TYPE */
|
||||
"Files can't be saved in that format",
|
||||
|
||||
/* WTAP_ERR_UNSUPPORTED_ENCAP */
|
||||
/* WTAP_ERR_UNWRITABLE_ENCAP */
|
||||
"Files from that network type can't be saved in that format",
|
||||
|
||||
/* WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED */
|
||||
|
|
|
@ -1684,7 +1684,7 @@ int wtap_register_encap_type(const char* name, const char* short_name);
|
|||
#define WTAP_ERR_UNSUPPORTED_FILE_TYPE -7
|
||||
/** Wiretap can't save files in the specified format */
|
||||
|
||||
#define WTAP_ERR_UNSUPPORTED_ENCAP -8
|
||||
#define WTAP_ERR_UNWRITABLE_ENCAP -8
|
||||
/** Wiretap can't read or save files in the specified format with the
|
||||
specified encapsulation */
|
||||
|
||||
|
|
Loading…
Reference in New Issue