aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--capinfos.c14
-rw-r--r--ui/qt/capture_file_properties_dialog.cpp5
-rw-r--r--ui/qt/gsm_map_summary_dialog.cpp5
-rw-r--r--ui/qt/mtp3_summary_dialog.cpp5
-rw-r--r--ui/qt/wireshark_de.ts12
-rw-r--r--ui/qt/wireshark_en.ts12
-rw-r--r--ui/qt/wireshark_fr.ts12
-rw-r--r--ui/qt/wireshark_it.ts12
-rw-r--r--ui/qt/wireshark_ja_JP.ts12
-rw-r--r--ui/qt/wireshark_pl.ts12
-rw-r--r--ui/qt/wireshark_zh_CN.ts12
-rw-r--r--wiretap/wtap.c12
-rw-r--r--wiretap/wtap.h5
13 files changed, 35 insertions, 95 deletions
diff --git a/capinfos.c b/capinfos.c
index bed9cfe2a8..34bf6b8864 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -583,10 +583,16 @@ print_stats(const gchar *filename, capture_info *cf_info)
file_encap_string = wtap_encap_string(cf_info->file_encap);
if (filename) printf ("File name: %s\n", filename);
- if (cap_file_type) printf ("File type: %s%s\n",
- file_type_string,
- cf_info->compression_type == WTAP_GZIP_COMPRESSED ? " (gzip compressed)" : "");
-
+ if (cap_file_type) {
+ const char *compression_type_description;
+ compression_type_description = wtap_compression_type_description(cf_info->compression_type);
+ if (compression_type_description == NULL)
+ printf ("File type: %s\n",
+ file_type_string);
+ else
+ printf ("File type: %s (%s)\n",
+ file_type_string, compression_type_description);
+ }
if (cap_file_encap) {
printf ("File encapsulation: %s\n", file_encap_string);
if (cf_info->file_encap == WTAP_ENCAP_PER_PACKET) {
diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp
index a1fb3df5ca..701366260a 100644
--- a/ui/qt/capture_file_properties_dialog.cpp
+++ b/ui/qt/capture_file_properties_dialog.cpp
@@ -177,8 +177,9 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
<< table_row_end;
QString format_str = wtap_file_type_subtype_string(summary.file_type);
- if (summary.compression_type == WTAP_GZIP_COMPRESSED) {
- format_str.append(tr(" (gzip compressed)"));
+ const char *compression_type_description = wtap_compression_type_description(summary.compression_type);
+ if (compression_type_description != NULL) {
+ format_str += QString::asprintf(" (%s)", compression_type_description);
}
out << table_row_begin
<< table_vheader_tmpl.arg(tr("Format"))
diff --git a/ui/qt/gsm_map_summary_dialog.cpp b/ui/qt/gsm_map_summary_dialog.cpp
index ecc6be98c2..11992f41ef 100644
--- a/ui/qt/gsm_map_summary_dialog.cpp
+++ b/ui/qt/gsm_map_summary_dialog.cpp
@@ -107,8 +107,9 @@ QString GsmMapSummaryDialog::summaryToHtml()
<< table_row_end;
QString format_str = wtap_file_type_subtype_string(summary.file_type);
- if (summary.compression_type == WTAP_GZIP_COMPRESSED) {
- format_str.append(tr(" (gzip compressed)"));
+ const char *compression_type_description = wtap_compression_type_description(summary.compression_type);
+ if (compression_type_description != NULL) {
+ format_str += QString::asprintf(" (%s)", compression_type_description);
}
out << table_row_begin
<< table_vheader_tmpl.arg(tr("Format"))
diff --git a/ui/qt/mtp3_summary_dialog.cpp b/ui/qt/mtp3_summary_dialog.cpp
index 412a0cb82f..acf7e6d10c 100644
--- a/ui/qt/mtp3_summary_dialog.cpp
+++ b/ui/qt/mtp3_summary_dialog.cpp
@@ -111,8 +111,9 @@ QString Mtp3SummaryDialog::summaryToHtml()
<< table_row_end;
QString format_str = wtap_file_type_subtype_string(summary.file_type);
- if (summary.compression_type == WTAP_GZIP_COMPRESSED) {
- format_str.append(tr(" (gzip compressed)"));
+ const char *compression_type_description = wtap_compression_type_description(summary.compression_type);
+ if (compression_type_description != NULL) {
+ format_str += QString::asprintf(" (%s)", compression_type_description);
}
out << table_row_begin
<< table_vheader_tmpl.arg(tr("Format"))
diff --git a/ui/qt/wireshark_de.ts b/ui/qt/wireshark_de.ts
index 8aee4371c6..a0ec303b21 100644
--- a/ui/qt/wireshark_de.ts
+++ b/ui/qt/wireshark_de.ts
@@ -937,10 +937,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (gzip-komprimiert)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Format</translation>
</message>
@@ -3069,10 +3065,6 @@ Achtung: Eine Option MUSS ausgewählt sein.</translation>
<translation>Länge</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (gzip komprimiert)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Format</translation>
</message>
@@ -7885,10 +7877,6 @@ Achtung: Eine Option MUSS ausgewählt sein.</translation>
<translation>Länge</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (gzip-komprimiert)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Format</translation>
</message>
diff --git a/ui/qt/wireshark_en.ts b/ui/qt/wireshark_en.ts
index 9c019f696c..8aa629d737 100644
--- a/ui/qt/wireshark_en.ts
+++ b/ui/qt/wireshark_en.ts
@@ -937,10 +937,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Format</source>
<translation type="unfinished"></translation>
</message>
@@ -3057,10 +3053,6 @@ PLEASE NOTE: One option MUST be selected.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Format</source>
<translation type="unfinished"></translation>
</message>
@@ -7819,10 +7811,6 @@ PLEASE NOTE: One option MUST be selected.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Format</source>
<translation type="unfinished"></translation>
</message>
diff --git a/ui/qt/wireshark_fr.ts b/ui/qt/wireshark_fr.ts
index 6321e386dc..2849fae41d 100644
--- a/ui/qt/wireshark_fr.ts
+++ b/ui/qt/wireshark_fr.ts
@@ -914,10 +914,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation>(compressé gzip)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Format</translation>
</message>
@@ -3037,10 +3033,6 @@ NOTE: Une option DOIT être sélectionnée.</translation>
<translation>Longueur</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation>(compressé gzip)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Format</translation>
</message>
@@ -7849,10 +7841,6 @@ Changer la direction de la connexion (voir le flux inverse).&lt;/p&gt;&lt;/body&
<translation>Longueur</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation>(compressé gzip)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Format</translation>
</message>
diff --git a/ui/qt/wireshark_it.ts b/ui/qt/wireshark_it.ts
index 8ac3b7d174..3d2bb5cf9a 100644
--- a/ui/qt/wireshark_it.ts
+++ b/ui/qt/wireshark_it.ts
@@ -937,10 +937,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (compresso con gzip)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Formato</translation>
</message>
@@ -3069,10 +3065,6 @@ NOTA: un&apos;opzione DEVE essere selezionata.</translation>
<translation>Lunghezza</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (compresso con gzip)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Formato</translation>
</message>
@@ -7885,10 +7877,6 @@ NOTA: un&apos;opzione DEVE essere selezionata.</translation>
<translation>Lunghezza</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (compresso con gzip)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Formato</translation>
</message>
diff --git a/ui/qt/wireshark_ja_JP.ts b/ui/qt/wireshark_ja_JP.ts
index 755babb039..958ae122ba 100644
--- a/ui/qt/wireshark_ja_JP.ts
+++ b/ui/qt/wireshark_ja_JP.ts
@@ -911,10 +911,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (gzip圧縮)</translation>
- </message>
- <message>
<source>Format</source>
<translation>形式</translation>
</message>
@@ -3025,10 +3021,6 @@ PLEASE NOTE: One option MUST be selected.</source>
<translation>長さ</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (gzip圧縮)</translation>
- </message>
- <message>
<source>Format</source>
<translation>フォーマット</translation>
</message>
@@ -7840,10 +7832,6 @@ PLEASE NOTE: One option MUST be selected.</source>
<translation>長さ</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (gzip圧縮)</translation>
- </message>
- <message>
<source>Format</source>
<translation>フォーマット</translation>
</message>
diff --git a/ui/qt/wireshark_pl.ts b/ui/qt/wireshark_pl.ts
index ad54c40dd0..af3080532b 100644
--- a/ui/qt/wireshark_pl.ts
+++ b/ui/qt/wireshark_pl.ts
@@ -917,10 +917,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (skompresowany gzip)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Format</translation>
</message>
@@ -3045,10 +3041,6 @@ UWAGA: Przynajmniej jedna opcja MUSI zostać zaznaczona.</translation>
<translation>Długość</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (skompresowany gzip)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Format</translation>
</message>
@@ -7859,10 +7851,6 @@ UWAGA: Przynajmniej jedna opcja MUSI zostać zaznaczona.</translation>
<translation>Długość</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation>(skompresowany gzip)</translation>
- </message>
- <message>
<source>Format</source>
<translation>Format</translation>
</message>
diff --git a/ui/qt/wireshark_zh_CN.ts b/ui/qt/wireshark_zh_CN.ts
index 75ef15f2f4..d24accfc19 100644
--- a/ui/qt/wireshark_zh_CN.ts
+++ b/ui/qt/wireshark_zh_CN.ts
@@ -931,10 +931,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation>(gzip 压缩)</translation>
- </message>
- <message>
<source>Format</source>
<translation>格式</translation>
</message>
@@ -3046,10 +3042,6 @@ PLEASE NOTE: One option MUST be selected.</source>
<translation>长度</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation> (gzip 压缩)</translation>
- </message>
- <message>
<source>Format</source>
<translation>格式</translation>
</message>
@@ -7857,10 +7849,6 @@ PLEASE NOTE: One option MUST be selected.</source>
<translation>长度</translation>
</message>
<message>
- <source> (gzip compressed)</source>
- <translation>(gzip 压缩)</translation>
- </message>
- <message>
<source>Format</source>
<translation>格式</translation>
</message>
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index 3b7c31891f..a9ee84c3eb 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -86,6 +86,18 @@ wtap_get_compression_type(wtap *wth)
return is_compressed ? WTAP_GZIP_COMPRESSED : WTAP_UNCOMPRESSED;
}
+static const char *compression_type_descriptions[WTAP_NUM_COMPRESSION_TYPES] = {
+ NULL, /* uncompressed */
+ "gzip compressed"
+};
+
+const char *
+wtap_compression_type_description(wtap_compression_type compression_type)
+{
+ g_assert(compression_type >= 0 && compression_type < WTAP_NUM_COMPRESSION_TYPES);
+ return compression_type_descriptions[compression_type];
+}
+
guint
wtap_snapshot_length(wtap *wth)
{
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index eb6685323d..a853e1735b 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -1695,7 +1695,8 @@ void wtap_rec_cleanup(wtap_rec *rec);
*/
typedef enum {
WTAP_UNCOMPRESSED,
- WTAP_GZIP_COMPRESSED
+ WTAP_GZIP_COMPRESSED,
+ WTAP_NUM_COMPRESSION_TYPES
} wtap_compression_type;
/*** get various information snippets about the current file ***/
@@ -1709,6 +1710,8 @@ gint64 wtap_file_size(wtap *wth, int *err);
WS_DLL_PUBLIC
wtap_compression_type wtap_get_compression_type(wtap *wth);
WS_DLL_PUBLIC
+const char *wtap_compression_type_description(wtap_compression_type compression_type);
+WS_DLL_PUBLIC
guint wtap_snapshot_length(wtap *wth); /* per file */
WS_DLL_PUBLIC
int wtap_file_type_subtype(wtap *wth);