diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-07-15 15:33:52 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-07-15 15:33:52 +0000 |
commit | 0d36ec8de2e587337c8d8bc787e40de23cda644a (patch) | |
tree | f039dce320dbc82cf7724400ce75c8afc499f1c7 /packet.c | |
parent | c1bfe4a1a84e4fdae4e28476a4fe23318f12a025 (diff) | |
download | wireshark-0d36ec8de2e587337c8d8bc787e40de23cda644a.tar.gz |
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.
svn path=/trunk/; revision=364
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 39 |
1 files changed, 14 insertions, 25 deletions
@@ -1,7 +1,7 @@ /* packet.c * Routines for packet disassembly * - * $Id: packet.c,v 1.30 1999/07/13 02:52:57 gram Exp $ + * $Id: packet.c,v 1.31 1999/07/15 15:32:43 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -688,28 +688,17 @@ dissect_packet(const u_char *pd, frame_data *fd, proto_tree *tree) void proto_register_frame(void) { - proto_frame = proto_register_protocol ( - /* name */ "Frame", - /* abbrev */ "frame"); - - hf_frame_arrival_time = proto_register_field ( - /* name */ "Arrival Time", - /* abbrev */ "frame.time", - /* ftype */ FT_ABSOLUTE_TIME, - /* parent */ proto_frame, - /* vals[] */ NULL ); - - hf_frame_packet_len = proto_register_field( - /* name */ "Total Frame Length", - /* abbrev */ "frame.frame_len", - /* ftype */ FT_UINT32, - /* parent */ proto_frame, - /* vals[] */ NULL ); - - hf_frame_capture_len = proto_register_field( - /* name */ "Capture Frame Length", - /* abbrev */ "frame.cap_len", - /* ftype */ FT_UINT32, - /* parent */ proto_frame, - /* vals[] */ NULL ); + static hf_register_info hf[] = { + { &hf_frame_arrival_time, + { "Arrival Time", "frame.time", FT_ABSOLUTE_TIME, NULL }}, + + { &hf_frame_packet_len, + { "Total Frame Length", "frame.pkt_len", FT_UINT32, NULL }}, + + { &hf_frame_capture_len, + { "Capture Frame Length", "frame.cap_len", FT_UINT32, NULL }} + }; + + proto_frame = proto_register_protocol("Frame", "frame"); + proto_register_field_array(proto_frame, hf, array_length(hf)); } |