This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Questions on packet-kafka.c

0

Hello,

I have some observations on packet-kafka.c, that do not look correct to me. Can somebody comment on them ? (I am very new to this so please forgive me if this question is trivial).

1) No attempt to call proto_item_add_subtree(ti, ett_kafka_metadata_topics); 
     yet "ett_kafka_metadata_topics" is contained in an array that is passed to 
     proto_register_subtree_array(..);
  1. There are multiple invocations of the following where the second argument is not unique. Is this a problem ?

    subtree = proto_item_add_subtree(ti, ett_kafka_request_partition); subtree = proto_item_add_subtree(ti, ett_kafka_request_topic); subtree = proto_item_add_subtree(ti, ett_kafka_response_partition); subtree = proto_item_add_subtree(ti, ett_kafka_response_topic);

asked 20 Dec ‘13, 04:09

gahanr's gravatar image

gahanr
11112
accept rate: 0%


One Answer:

1
  1. Yes, that appears to have been a cut-n-pasteo. It is now fixed (r54294).
  2. No, that's not necessarily a problem. It just means that there are multiple places in the decode tree which will be expanded or collapsed based on the same ett_ variable. It's a style thing but not a problem.

answered 20 Dec '13, 06:31

JeffMorriss's gravatar image

JeffMorriss ♦
6.2k572
accept rate: 27%

ett_kafka_metadata_topics is already used in dissect_kafka_metadata_response(). The tree in dissect_kafka_metadata_request() was a cut-n-pasteo, but I should have just removed it completely (r54301).

(20 Dec '13, 07:05) eapache