diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2004-08-31 12:39:25 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2004-08-31 12:39:25 +0000 |
commit | 7b71fe2b17c1b525837759d7a50ba15ced8082ec (patch) | |
tree | d0ebf14f5b92427edc8afef20a148300c5f3eae2 /doc/README.developer | |
parent | 121022d8a0f4a6e47c4a0d5d3034c7d3a697ed98 (diff) | |
download | wireshark-7b71fe2b17c1b525837759d7a50ba15ced8082ec.tar.gz |
add HFILL to the skeleton example and documentation of the field registration
svn path=/trunk/; revision=11864
Diffstat (limited to 'doc/README.developer')
-rw-r--r-- | doc/README.developer | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/README.developer b/doc/README.developer index 2d7ec4740e..b1c7de7c89 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -575,7 +575,7 @@ proto_register_PROTOABBREV(void) { &hf_PROTOABBREV_FIELDABBREV, { "FIELDNAME", "PROTOABBREV.FIELDABBREV", FIELDTYPE, FIELDBASE, FIELDCONVERT, BITMASK, - "FIELDDESCR" } + "FIELDDESCR", HFILL } }, }; @@ -1231,11 +1231,11 @@ the protocol that is the parent of the fields. Here is a complete example: { &hf_field_a, { "Field A", "proto.field_a", FT_UINT8, BASE_HEX, NULL, - 0xf0, "Field A represents Apples" }}, + 0xf0, "Field A represents Apples", HFILL }}, { &hf_field_b, { "Field B", "proto.field_b", FT_UINT16, BASE_DEC, VALS(vs), - 0x0, "Field B represents Bananas" }} + 0x0, "Field B represents Bananas", HFILL }} }; proto_eg = proto_register_protocol("Example Protocol", @@ -1268,17 +1268,20 @@ the same abbreviation. For instance, the following is valid: { &hf_field_8bit, /* 8-bit version of proto.field */ { "Field (8 bit)", "proto.field", FT_UINT8, BASE_DEC, NULL, - 0x00, "Field represents FOO" }}, + 0x00, "Field represents FOO", HFILL }}, { &hf_field_32bit, /* 32-bit version of proto.field */ { "Field (32 bit)", "proto.field", FT_UINT32, BASE_DEC, NULL, - 0x00, "Field represents FOO" }} + 0x00, "Field represents FOO", HFILL }} }; This way a filter expression can match a header field, irrespective of the representation of it in the specific protocol context. This is interesting for protocols with variable-width header fields. +The HFILL macro at the end of the struct will set resonable default values +for internally used fields. + 1.6.2 Adding Items and Values to the Protocol Tree. A protocol item is added to an existing protocol tree with one of a |