Hi guys, Some warnings displayed when I compiled the Wireshark source code after modifying some code. Please see below:
I've no idea where the problem is. I searched Google, and someone said the warning level of my VS2008 shouldn't be so high, but I didn't find anywhere how to modify the warning level. Anyone know how to modify this? Thanks in advance! Sam asked 02 Oct '11, 04:17 Sam edited 02 Oct '11, 15:47 helloworld |
One Answer:
The above two warnings need to be fixed. The messages should be self-explanatory. Did you make changes to the definition of ethertype in packet-ethertype.c ? If yes, your changes need work to solve the errors. If not, does your Wireshark source w/o any of your changes compile w/o error ? answered 02 Oct '11, 06:03 Bill Meier ♦♦ edited 02 Oct '11, 06:21 showing 5 of 6 show 1 more comments |
thanks, Bill. I just have a parameter/vtime_id added in packet-ethertype.c as below:
ethertype(guint16 etype, tvbuff_t tvb, int offset_after_etype, packet_info pinfo, proto_tree tree, proto_tree fh_tree, int etype_id, int vtime_id, int trailer_id, int fcs_len)
Does this have some problem? anywhere else need to changed if theparameter/vtime_id added? BTW, why I added this parameter/vtime_id? because I have some bytes in the trailer need be extracted. For expample, if the trailer is: 112233445566778899, I want the first four bytes need be recongnized as 'vtime', and the last five bytes recognized as 'trailer'. Do you have any idea? Thanks again.
Firstly you should have made your second entry a comment to Bill's answer, not an "answer" of your own.
Secondly, if you modify the function definition you must modify any corresponding function declaration, i.e. in epan/packet.h. This is the cause of the 'packet-ethertype.c(211) : warning C4029: declared formal parameter list different from definition' warning.
Thirdly, any code that calls your modified function must also be modified to match the modified function declaration. This is the cause of the 'packet-eth.c(434) : warning C4020: 'ethertype' : too many actual parameters' warning.
(converted your "answer" to a "comment", please see the FAQ for details)
First line, I modified the epan/packet.h and then compiled success follow your tips. thank you, Grahamb.
But what's meaning about the word 'w/o' or w/o error in previous comment from Bill?
Sam
w/o is an abbreviation for "without".
Thank you, helloworld. Thank you all for help. My reply is wireshark source have no any errors. And I have another question need your help.
I use the function 'proto_tree_add_item' to put some bytes to the 'vtime' item, but the bytes are just hex code, but its readability is very poor, I have to convert these bytes to a good readability format.
For example: The 'vtime' item display '64000064', and I need convert the '64000064' to '100.0.0.100' and displayed in the 'vtime' item. how to do it? use the 'vtime_id' like the 'trailer_id'?
thanks again.
Sam