Wireshark-dev: [Wireshark-dev] Branching in subtree for different packet dissection.
From: Craig Bumpstead <cbumpste@xxxxxxxxxxxx>
Date: Sun, 9 May 2010 20:04:24 -0700 (PDT)
Hi,

First thanks to all that have help so far, it has been great and valuable advice!

What I need to do now is branch in the dissect of the sub-tree when the 6th byte in the data is a certain value.
Is there an array that holds that information that i can search???

if (tree) {  /*we are being asked for details */
    proto_item *ti = NULL;
    gint offset = 0;
    proto_tree *myproto_tree = NULL;
    ti = proto_tree_add_item(tree, proto_myproto, tvb, 0, -1, FALSE);
    myproto_tree = proto_item_add_subtree(ti, ett_myproto);
    proto_tree_add_item(myproto_tree, hf_myproto_pdu_type, tvb, offset, 1, FALSE); offset += 1;
    proto_tree_add_item(myproto_tree, hf_myproto_sequence, tvb, offset, 1, FALSE); offset += 1;

*** This is where I need to dissect the sub tree differently.****
.....
.......
}

Am i doing this correctly or should I be doing this another way?


Regards,
Craig