Rename WTAP_ERR_UNSUPPORTED_ENCAP to WTAP_ERR_UNWRITABLE_ENCAP.
authorGuy Harris <guy@alum.mit.edu>
Wed, 17 Dec 2014 06:40:45 +0000 (22:40 -0800)
committerGuy Harris <guy@alum.mit.edu>
Wed, 17 Dec 2014 06:41:45 +0000 (06:41 +0000)
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>
35 files changed:
capinfos.c
capture_info.c
captype.c
editcap.c
epan/wslua/wslua_dumper.c
epan/wslua/wslua_file.c
file.c
frame_tvbuff.c
mergecap.c
rawshark.c
reordercap.c
tshark.c
wiretap/5views.c
wiretap/btsnoop.c
wiretap/catapult_dct2000.c
wiretap/commview.c
wiretap/erf.c
wiretap/eyesdn.c
wiretap/k12.c
wiretap/k12text.l
wiretap/lanalyzer.c
wiretap/libpcap.c
wiretap/logcat.c
wiretap/logcat_text.c
wiretap/netmon.c
wiretap/netscaler.c
wiretap/nettl.c
wiretap/network_instruments.c
wiretap/netxray.c
wiretap/ngsniffer.c
wiretap/pcapng.c
wiretap/snoop.c
wiretap/visual.c
wiretap/wtap.c
wiretap/wtap.h

index dda4b57a07f5d1435ca16e672ab43b4649a23ab8..01b1122c09559dc55aaa34adff6d0b180229a506 100644 (file)
@@ -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);
index be60360368752f5a87dedc6fc81251b1148e9449..ff04e2d417a96d2d788a60ddcc5f948b1bd3ed3f 100644 (file)
@@ -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 {
index 6dd1769ac27c94f031ac216ad8a36c28a32ef9cc..6f6cac02428a5605fbeabdb05da789b2d3c160ff 100644 (file)
--- a/captype.c
+++ b/captype.c
@@ -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);
index 31a76f981e3f1dbdd0e0a0650c88e744eb6a56db..d91c53af48780f2c955ea91a8145229df275a3c3 100644 (file)
--- a/editcap.c
+++ b/editcap.c
@@ -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);
index 80469c2963d525c85cc4d2881fd6097112039cf6..226fab83b0e132393d0690c605ffea6aefea02cf 100644 (file)
@@ -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));
index 2c73a8f37a0c3b8e82eb2996f1b194e4920a663b..355d972204953d348f3de055331ed81ecf9c778a 100644 (file)
@@ -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;
diff --git a/file.c b/file.c
index 78d0ad34c1910acee3248f07f2def03c40320170..3c47bbd1cc2f97a27c932c734b0a3ce82392e6e6 100644 (file)
--- a/file.c
+++ b/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 {
index 2e3019c7e324ffab0261eb54a0e36cae75b50e8c..c8d2f83a68d663b4a04618814e26573424d20c01 100644 (file)
@@ -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;
index 31d7c5efdaeec5ffb6f5f293449625dfe75c8fad..b85f1f04e8119840e4394067c88c922dac8685c2 100644 (file)
@@ -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
index b1e484544bb893da703dca58f3bfcd1c5a4eaeef..bcd9281082682fd40a187f0d77252004b2cfbbeb 100644 (file)
@@ -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);
index 90fd84babf7d1524b70967bef7e480f035958bb9..014c839951d3fe63c92d95ebcdcb4ecc9d9fdcd5 100644 (file)
@@ -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);
index d3f31f181d21bedf8f559e5a7f2825541bc585e3..ed2b480abd9e512bed1a61903b551d3fdf9f6511 100644 (file)
--- a/tshark.c
+++ b/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.",
index d615a3eca40d8a4e8971da254d9f919dcb6b91a9..aa5dd9afa9c1f79a0243ef0f0711c30fee4cc9ef 100644 (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;
 }
index 2591f78d8edd29274273016e8823d9374e43e2c7..e0f266ba41db219ef1e163335c8945e8716d2be2 100644 (file)
@@ -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;
 }
index 7b02b0e3415c702dde17285e3723a13e509e4be0..28c60093b0b948c1a67fae5ca7f6e275516440d5 100644 (file)
@@ -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;
     }
 }
 
index 0e85cbe347eed6d9bf0f8208d2505a5067929f91..c82fdbb51a7b765305b48765440999fe7e41f2fc 100644 (file)
@@ -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;
        }
 
index fc3700e2cf6bc8ae0b89bb5be1a732aab536900d..2398d1591284e69bd14a3c9bf43f152f5fe70246 100644 (file)
@@ -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;
 }
index 4350d236441e879ab602ca1127400dfa1a979c7b..83daf8218651bae7da25d901225a7cb3383fa34d 100644 (file)
@@ -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;
        }
 
index a36fbedc96a55a391425f9ffc113a16b0fd6b8d5..934e8d4ec5d05157a26ec5e867f9e0ad612c6543 100644 (file)
@@ -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;
 }
index 9aed765f8d5177665777c98fe64b185c57aa627a..f203fa7edb5f8f090c2e19add919dd656a852039 100644 (file)
@@ -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;
     }
 }
 
index 6eaeb7f44bf2b07ce541b10fe10531c56d04d28d..bac54fa20481296c9a3581ccb6f65f37126126bb 100644 (file)
@@ -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);
        */
index 03266b975de989e6dddf7f962bdb4f4bbbd6665c..2a770a594c311482b64b6dc28525450cf6ecc106 100644 (file)
@@ -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;
 }
index cb6e0067ee1038642d5ede410f9944ec1683847d..b1ab83dbe4bb8322be850762e90a7c4726a9c822 100644 (file)
@@ -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;
 }
index 674991d53a6991fe779f41836478d84da56d1492..a0da65616efe4de35589f5ea3dc26be6aef066bd 100644 (file)
@@ -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;
     }
 }
 
index 9b23d284b7c33003e47936137151faf5201ca02c..7d0592890e13a70f8b0cdf64b394785234edcb93 100644 (file)
@@ -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;
                }
 
index e5a80836a628abfea44a2edb4261bcabf86e497d..f8764ab43c5f05dead49c9f2d6e4e23df4c13523 100644 (file)
@@ -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
index f859c2e265a28d46010c27598cf8451dfae25c9d..88d42e6e8f096e566302c7c1316f3ae39c59f9b7 100644 (file)
@@ -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;
         }
 
index 54c97b0758cc7f8c780b4f5487ec670de4a3fb74..7eb647b575ed9a1c7c7cfc0c0c34bc6b80190de9 100644 (file)
@@ -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;
 }
index fad1f8454ee7e2c1dc978cfc387167680a53d491..fa047ccaca75442cbcd487b28bcd8ea608070e61 100644 (file)
@@ -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;
 }
index 3f31395e0d39c79eb408b307dc6c8d94fe594d9d..06ba78468b059f787b96360513ec32efbc7fa6ed 100644 (file)
@@ -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;
 }
index 7c44a10e9bd7ce33e9a4174492b92f5a6fb9c606..41edb340078da0f6755865d36bd80d3c41400a4a 100644 (file)
@@ -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;
 }
index 9bd2cdbc7482a13477da756d1b1d0dfebc04607f..88aecaf7a8c2ef96aa720aa6d6ff606c0e4c9f5a 100644 (file)
@@ -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;
 }
index e29b79009fa968ac8bb52f0431830805cb0b315a..02acaf711bb2345ff4b27068d82445ae85e177fd 100644 (file)
@@ -605,7 +605,7 @@ int visual_dump_can_write_encap(int encap)
         return 0;
     }
 
-    return WTAP_ERR_UNSUPPORTED_ENCAP;
+    return WTAP_ERR_UNWRITABLE_ENCAP;
 }
 
 
index e8726e280d0ab667291b6d99c079391b15983948..6ce8f38dda574b8fb8e1a464608a16d5ea7b88f8 100644 (file)
@@ -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 */
index 55b35448c3eac1686340acb8f73f87b3172a9b81..2590bb35e95089dbbf953250a055a03ff6828447 100644 (file)
@@ -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 */