My Packet Data: 04 1A 0C 68 00 01 00 00 4D 15 00 04 9D F6 10 3A | 9E 0E 95 34 9E 33 38 D3 75 31 74 63 5E 07: Node: 04 1A Counter: 0C 68 Type: 00 01 Channel: 00 00 RTU: 4D 15 Number of Register(s): 00 04 Register: 9D F6 Register Data: 10 3A I need my Dissector to loop through and add the below until the total Number of Register(s) 00 04 is satisfied: "proto_tree_add_item(ar_tree, hf_ar_reg, tvb, MSG_REG_OS, MSG_REG_SZ, ENC_NA );" & "proto_tree_add_item(ar_tree, hf_ar_regdata, tvb, MSG_REGDATA_OS, MSG_REGDATA_SZ, ENC_NA );" Thoughts? asked 18 Jan '13, 05:54 jballard1979 |
One Answer:
Trick is to get the value out of the TVB: where offset is the offset in the TVB where this count can be found (MSG_NUM_REG_OS ?). Now loop, call proto_tree_add_item() and advance the offset while you go:
answered 18 Jan '13, 15:21 Jaap ♦ edited 18 Jan '13, 15:22 |
AWESOME... Worked like a charm. Thanks :)