add HFILL to the skeleton example and documentation of the field registration

svn path=/trunk/; revision=11864
This commit is contained in:
Ulf Lamping 2004-08-31 12:39:25 +00:00
parent 121022d8a0
commit 7b71fe2b17
1 changed files with 8 additions and 5 deletions

View File

@ -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