aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-07-08 03:18:20 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-07-08 03:18:20 +0000
commitacad5a37302d417bd6caeb2ad462d5f3a453fc92 (patch)
tree2f9fb4d61d19686ac9ed2907a974b84604bc226e /doc
parent56c0587491f07bda16d10d4f1aab6fbb5ba58eef (diff)
Documented the proto_register_field_array() function, and converted
the registration functions in packet-fddi.c and packet-eth.c to this new registration method. svn path=/trunk/; revision=346
Diffstat (limited to 'doc')
-rw-r--r--doc/proto_tree19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/proto_tree b/doc/proto_tree
index 4f20865272..550c1a47b2 100644
--- a/doc/proto_tree
+++ b/doc/proto_tree
@@ -101,6 +101,24 @@ during registration.
/* parent */ proto_frame,
/* vals[] */ NULL );
+Groups of header fields can be registered with one call to
+proto_register_field_array(). An const array of hf_register_info
+structs is declared, then passed to proto_register_field_array, along
+with a count of the number of records. You can use the handy
+array_length() macro found in packet.h to have the compiler compute
+the array length for you at compile time:
+
+ int hf_field_a = -1;
+ int hf_field_b = -1;
+
+ const hf_register_info hf[] = {
+ { "Field A", "proto.field_a", &hf_field_a, FT_UINT8, NULL },
+ { "Field B", "proto.field_a", &hf_field_a, FT_VALS_UINT16, VALS(vs) },
+ };
+
+ proto_tr = proto_register_protocol("Token-Ring", "tr");
+ proto_register_field_array(proto_tr, hf, array_length(hf));
+
The name can be used in any type of display, either in the GUI tree, or
in a display filter UI. The abbreviation is used when representing a
display filter as a string. For example, the following strings could be a
@@ -131,6 +149,7 @@ enum ftenum {
FT_VALS_UINT16,
FT_VALS_UINT24,
FT_VALS_UINT32,
+ FT_TEXT_ONLY, /* used internally, but should be used by dissectors */
NUM_FIELD_TYPES /* last item number plus one */
};