aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2011-12-27 20:35:41 +0000
committerGerald Combs <gerald@wireshark.org>2011-12-27 20:35:41 +0000
commit3c1b8a6ca13f6c0d0ce035859b12f0be9daca4f7 (patch)
tree97a0a11cc063f2d0fccb3a6a439870ee0b1fa999 /epan/proto.c
parent727046dc35c535c13c06ac82d1132618d0f24ad0 (diff)
Add a "-G ftypes" option, which dumps our supprted FT_… names and
descriptions. Captitalize and fix up the descriptions. Use its output to create the field type list in the wireshark-filter man page. svn path=/trunk/; revision=40306
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 72e2b3ac80..6ccac1de57 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -6635,6 +6635,25 @@ proto_registrar_dump_fields(const int format)
}
}
+/* Dumps field types and descriptive names to stdout. An independent
+ * program can take this output and format it into nice tables or HTML or
+ * whatever.
+ *
+ * There is one record per line. The fields are tab-delimited.
+ *
+ * Field 1 = field type name, e.g. FT_UINT8
+ * Field 2 = descriptive name, e.g. "Unsigned, 1 byte"
+ */
+void
+proto_registrar_dump_ftypes(void)
+{
+ ftenum_t fte;
+
+ for (fte = 0; fte < FT_NUM_TYPES; fte++) {
+ printf("%s\t%s\n", ftype_name(fte), ftype_pretty_name(fte));
+ }
+}
+
static const char *
hfinfo_numeric_format(const header_field_info *hfinfo)
{