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

Update plugin error

0

0 I have a plugin and I need to update it, I have done it to some extent but getting some errors.

code => https://github.com/amanpreet05/plugins/blob/master/packet-minet.c

please help me how do I solve these errors

error C2220: warning treated as error - no 'object' file generated warning C4013: 'decode_boolean_bitfield' undefined; assuming extern returning int warning C4113: 'void (cdecl )(tvbuff_t ,packet_info ,proto_tree )' differs in parameter lists from 'new_dissector_t' warning C4133: 'function' : incompatible types - from 'void (cdecl )(tvbuff_t ,packet_info ,proto_tree )' to 'new_dissector_t'

asked 23 Jun '14, 06:00

aman's gravatar image

aman
36151620
accept rate: 0%

@kurt @grahamb please reply for this..

(23 Jun '14, 06:20) aman

decode_boolean_bitfield has be depricated and removed. You will have to rewrite the code to use a different API. Like proto_tree_add_item() and define hf variables with the apropriate bitmask. Glancing at the dissector code it should probably be totaly rewritten to use proto_tree_add_item() and value_strings.

(23 Jun '14, 06:51) Anders ♦

if I replace decode_boolean_bitfield() with proto_tree_add_item(), I need to change parameters as well or add a parameter to it?

(23 Jun '14, 07:00) aman

2 Answers:

0
                    proto_tree_add_text(tree, tvb, tempOffset, 1, "%s",                     decode_boolean_bitfield(tempByte, 0x80, 8,                              "Overall Result: Ignored", "Overall Result: Digits dialed on analog line

Replace by:

proto_tree_add_item(tree, hf_your_new_hf, tvb, tempOffset, 1, ENC_BIG_ENDIAN);

answered 23 Jun '14, 07:31

Anders's gravatar image

Anders ♦
4.6k952
accept rate: 17%

0

answered 23 Jun '14, 09:43

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

@pascal: they asked me for the git code so I updated it. Maybe this may help diagnose the exact error I am making.

(23 Jun '14, 10:14) aman

If you read the thread again, you will see that Guy and myself already told you how to fix those two errors. Did you actually read our answers and tried to do the suggested changes? Of course we could fo the changes for you but it will not help you progress. Moreover we already provided you some info but you restart a new thread with the same for initial question without taking into account the answers already done. IMHO this is not nice for the people who spent time answering you (Guy did a far better job than myself).

(23 Jun '14, 10:56) Pascal Quantin

@pascal: ya I appreciate the fact and I did read your comments, and you and Guy helped me a lot, and it did solve the thing but now I started this thread because I got the last comment to show the code on git. I thought maybe it could help more..

(23 Jun '14, 11:04) aman

You will find here https://dl.dropboxusercontent.com/u/4857000/packet-minet.c a version of packet-mimet.c that I quickly modified so as to have it compile. You will see that it is ugly as I did not take the time to replace the 59 calls to decode_boolean_bitfield() by a call to proto_add_item, but instead added back the code for the function as I suggested you in your previous thread (but it seems like you missed this comment). You can take it as an example to modify the other dissectors.

If you feel courageous enough, it would be a good thing to follow the advices done by Guy / Anders and remove all those calls to proto_tree_add_text as those items are not filterable.

(23 Jun '14, 11:53) Pascal Quantin

Thanks @pascal for your help..

(23 Jun '14, 12:30) aman