diff options
author | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-07-15 15:33:52 +0000 |
---|---|---|
committer | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-07-15 15:33:52 +0000 |
commit | 9037c6c625b2f3850c86dc2413aa13a84d953792 (patch) | |
tree | f039dce320dbc82cf7724400ce75c8afc499f1c7 /print.c | |
parent | ac323b858bae0ae19c3e7998ee66f630964b2e12 (diff) |
Modified the proto_register_field_array usage again. Thanks to Guy's
suggestion, this new method using a static array should use less memory
and be faster. It also has a nice side-effect of making the source-code
more readble, IMHO.
Changed the print routines to look for protocol proto_data instead of
looking at the text label as they did before, hoping that the data hex
dump field item starts with "Data (".
Added the -G keyword to ethereal to make it dump a glossary of display
filter keywords to stdout and exit. This data is then formatted with
the doc/dfilter2pod perl program to pod format, which is combined
with doc/ethereal.pod.template to create doc/ethereal.pod, from which
the ethereal manpage is created. This way we can keep the manpage up-to-date
with a list of fields that can be filtered on.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@364 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -1,7 +1,7 @@ /* print.c * Routines for printing packet analysis trees. * - * $Id: print.c,v 1.12 1999/07/13 04:38:13 guy Exp $ + * $Id: print.c,v 1.13 1999/07/15 15:32:43 gram Exp $ * * Gilbert Ramirez <gram@verdict.uthscsa.edu> * @@ -57,6 +57,7 @@ static void ps_clean_string(unsigned char *out, const unsigned char *in, static void dumpit_ps (FILE *fh, register const u_char *cp, register u_int length); extern e_prefs prefs; +extern int proto_data; /* in packet-data.c */ /* #include "ps.c" */ @@ -343,9 +344,8 @@ void proto_tree_print_node_text(GNode *node, gpointer data) /* Print the text */ fprintf(pdata->fh, "%s%s\n", space, label_ptr); - /* If it's uninterpreted data, dump it. - XXX - have a better way of doing this than looking for "Data (" */ - if (strncmp("Data (", label_ptr, 6) == 0) + /* If it's uninterpreted data, dump it. */ + if (fi->hfinfo->id == proto_data) dumpit(pdata->fh, &pdata->pd[fi->start], fi->length); /* Recurse into the subtree, if it exists */ @@ -420,9 +420,8 @@ void proto_tree_print_node_ps(GNode *node, gpointer data) ps_clean_string(psbuffer, label_ptr, MAX_LINE_LENGTH); fprintf(pdata->fh, "%d (%s) putline\n", pdata->level, psbuffer); - /* If it's uninterpreted data, dump it. - XXX - have a better way of doing this than looking for "Data (" */ - if (strncmp("Data (", label_ptr, 6) == 0) { + /* If it's uninterpreted data, dump it. */ + if (fi->hfinfo->id == proto_data) { print_ps_hex(pdata->fh); dumpit_ps(pdata->fh, &pdata->pd[fi->start], fi->length); } |