Ask Your Question

Revision history [back]

how to define hf_register_info in dissector

I get data in tvbuff_t *tvb, its size is 10 to 50 bit depend on another parameter assume p.
Message structure is as below:

Struct AA
{
Var a : x bit, [0<=range(x)<=32]
Var b : y bit.,[0<=range(y)<=16]
};

define static hf_register_info hf[] in dissector, andregister it to proto as
"proto_register_field_array(proto_xxx, hf, array_length(hf));"

Should I define 32+16=48 hf_xxx with different bit_mask and byte_type ?
Is there any good method to solve this problem?

how to define hf_register_info in dissector

I get data in tvbuff_t *tvb, its size is 10 to 50 bit depend on another parameter assume p.
Message structure is as below:

Struct AA
{
Var a : x bit, [0<=range(x)<=32]
Var b : y bit.,[0<=range(y)<=16]
};

define static hf_register_info hf[] in dissector, andregister it to proto as
"proto_register_field_array(proto_xxx, hf, array_length(hf));"

Should I define 32+16=48 hf_xxx with different bit_mask and byte_type and select different two hf_xxx for a and b according to p?
Is there any good method to solve this problem?

how to define hf_register_info in dissector

I get data in tvbuff_t *tvb, its size is 10 to 50 bit depend on another parameter assume p.
Message structure is as below:

Struct AA   {  

Struct AA
{
Var a : x bit, [0<=range(x)<=32]
Var b : y bit.,[0<=range(y)<=16]
bit, [0<=range(y)<=16] };

};

define static hf_register_info hf[] in dissector, andregister and register it to proto as
"proto_register_field_array(proto_xxx, hf, array_length(hf));"

proto_register_field_array(proto_xxx, hf, array_length(hf));

Should I define 32+16=48 hf_xxx with different bit_mask and byte_type and select different two hf_xxx for a and b according to p?
Is there any good method to solve this problem?