Ethereal-dev: [Ethereal-dev] dissector handoff boolean

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Hartmut Mueller <hartmut@xxxxxxxxxxxxxxxxx>
Date: Fri, 23 Feb 2001 15:09:10 +0100
Hello folks,

is it possible to refer to a boolean in a dissector call? Using the code 
below results in the following error:

packet-bacnet.c: In function `dissect_bacnet':
packet-bacnet.c:473: `bacnet' undeclared (first use in this function)

Hmm. My brain seems to be in friday mode. 

Hartmut


in packet-bacnet.c: --------------
if (!dissector_try_port(bacnet_dissector_table,
        bacnet.control_net, next_tvb, pinfo, tree)) {  /* line 473 */
                dissect_data(next_tvb, offset, pinfo, tree);

static hf_register_info hf[] = {
                { &hf_bacnet_control,
                        { "Control",           "bacnet.control",
                        FT_UINT8, BASE_HEX, NULL, 0xff,
                        "BACnet Control" }
                },
                { &hf_bacnet_control_net,
                        { "NSDU contains",
                        "bacnet.control_net",
                        FT_BOOLEAN, 8, TFS(&control_net_set_high),
                        BAC_CONTROL_NET, "BACnet Control" }
                },
-----------------------------

in packet-bacapp.c: ----------------
/* Register the protocol name and description */
/*      proto_bacapp = proto_register_protocol("BACapp",
 *          "PROTOSHORTNAME", "bacapp");
 */
        proto_bacapp = proto_register_protocol("Building Automation and 
Control Network APDU",
            "BACapp", "bacapp");
 
/* Required function calls to register the header fields and subtrees used */
        proto_register_field_array(proto_bacapp, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));
}
 
[...]
 
/* If this dissector uses sub-dissector registration add a registration 
routine.
   This format is required because a script is used to find these routines and
   create the code that calls these routines.
*/
void
proto_reg_handoff_bacapp(void)
{
        dissector_add("bacnet.control_net", 0, dissect_bacapp, proto_bacapp);
}
---------------------------------