diff options
author | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-10-12 06:21:15 +0000 |
---|---|---|
committer | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-10-12 06:21:15 +0000 |
commit | 64eb24f8447475802bbefa085ad07467bb570898 (patch) | |
tree | 13a576cc1a346d2364a1b13bf493b2efc42a856f /packet-trmac.c | |
parent | 895c3bcb3e3e2fff087233630eadccb1cb9a7c95 (diff) |
New proto_tree header_field_info stuff. Header_field_infos now contain
the base for numbers to be displayed in, bitmasks for bitfields, and blurbs
(which are one or two sentences describing the field).
proto_tree_add*() routines now automatically handle bitfields. You tell
it which header field you are adding, and just pass it the value of the
entire field, and the proto_tree routines will do the masking and shifting
for you.
This means that bitfields are more naturally filtered via dfilter now.
Added Phil Techau's support for signed integers in dfilters/proto_tree.
Added the beginning of the SNA dissector. It's not complete, but I'm
committing it now because it has example after example of how to use
bitfields with the new header_field_info struct and proto_tree routines.
It was the impetus to change how header_field_info works.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@815 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-trmac.c')
-rw-r--r-- | packet-trmac.c | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/packet-trmac.c b/packet-trmac.c index 07ab0c4c09..baf7c3e493 100644 --- a/packet-trmac.c +++ b/packet-trmac.c @@ -2,7 +2,7 @@ * Routines for Token-Ring Media Access Control * Gilbert Ramirez <gram@verdict.uthscsa.edu> * - * $Id: packet-trmac.c,v 1.15 1999/09/17 04:20:23 gram Exp $ + * $Id: packet-trmac.c,v 1.16 1999/10/12 06:20:19 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -320,58 +320,76 @@ proto_register_trmac(void) { static hf_register_info hf[] = { { &hf_trmac_mv, - { "Major Vector", "trmac.mvec", FT_VALS_UINT8, VALS(major_vector_vs) }}, + { "Major Vector", "trmac.mvec", FT_UINT8, BASE_HEX, major_vector_vs, 0x0, + "" }}, { &hf_trmac_length, - { "Total Length", "trmac.length", FT_UINT8, NULL }}, + { "Total Length", "trmac.length", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_srcclass, - { "Source Class", "trmac.srcclass", FT_VALS_UINT8, VALS(classes_vs) }}, + { "Source Class", "trmac.srcclass", FT_UINT8, BASE_HEX, classes_vs, 0x0, + "" }}, { &hf_trmac_dstclass, - { "Destination Class", "trmac.dstclass", FT_VALS_UINT8, VALS(classes_vs) }}, + { "Destination Class", "trmac.dstclass", FT_UINT8, BASE_HEX, classes_vs, 0x0, + "" }}, { &hf_trmac_sv, - { "Sub-Vector", "trmac.svec", FT_UINT8, NULL }}, + { "Sub-Vector", "trmac.svec", FT_UINT8, BASE_HEX, NULL, 0x0, + "" }}, { &hf_trmac_errors_iso, - { "Isolating Errors", "trmac.errors.iso", FT_UINT16, NULL }}, + { "Isolating Errors", "trmac.errors.iso", FT_UINT16, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_line, - { "Line Errors", "trmac.errors.line", FT_UINT8, NULL }}, + { "Line Errors", "trmac.errors.line", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_internal, - { "Internal Errors", "trmac.errors.internal", FT_UINT8, NULL }}, + { "Internal Errors", "trmac.errors.internal", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_burst, - { "Burst Errors", "trmac.errors.burst", FT_UINT8, NULL }}, + { "Burst Errors", "trmac.errors.burst", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_ac, - { "A/C Errors", "trmac.errors.ac", FT_UINT8, NULL }}, + { "A/C Errors", "trmac.errors.ac", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_abort, - { "Abort Delimiter Transmitted Errors", "trmac.errors.abort", FT_UINT8, NULL }}, + { "Abort Delimiter Transmitted Errors", "trmac.errors.abort", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_noniso, - { "Non-Isolating Errors", "trmac.errors.noniso", FT_UINT16, NULL }}, + { "Non-Isolating Errors", "trmac.errors.noniso", FT_UINT16, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_lost, - { "Lost Frame Errors", "trmac.errors.lost", FT_UINT8, NULL }}, + { "Lost Frame Errors", "trmac.errors.lost", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_congestion, - { "Receiver Congestion Errors", "trmac.errors.congestion", FT_UINT8, NULL }}, + { "Receiver Congestion Errors", "trmac.errors.congestion", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_fc, - { "Frame-Copied Errors", "trmac.errors.fc", FT_UINT8, NULL }}, + { "Frame-Copied Errors", "trmac.errors.fc", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_freq, - { "Frequency Errors", "trmac.errors.freq", FT_UINT8, NULL }}, + { "Frequency Errors", "trmac.errors.freq", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_errors_token, - { "Token Errors", "trmac.errors.token", FT_UINT8, NULL }}, + { "Token Errors", "trmac.errors.token", FT_UINT8, BASE_DEC, NULL, 0x0, + "" }}, { &hf_trmac_naun, - { "NAUN", "trmac.naun", FT_ETHER, NULL }} + { "NAUN", "trmac.naun", FT_ETHER, BASE_DEC, NULL, 0x0, + "" }}, }; proto_trmac = proto_register_protocol("Token-Ring Media Access Control", "trmac"); |