Wireshark-bugs: [Wireshark-bugs] [Bug 6060] Universal Alcatel Protocol

Date: Sat, 23 Jul 2011 08:14:56 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6060

--- Comment #6 from Alexis La Goutte <alexis.lagoutte@xxxxxxxxx> 2011-07-23 08:14:53 PDT ---
Hi,

Be careful, there is a mix of space and tab !
There is some whitespace too.

The code don't compile in Linux :
packet-ua.c: In function ‘DissectUA’:
packet-ua.c:289: error: ignoring return value of ‘proto_item_add_subtree’,
declared with attribute warn_unused_result
packet-ua.c: In function ‘DissectNOE’:
packet-ua.c:334: error: ignoring return value of ‘proto_item_add_subtree’,
declared with attribute warn_unused_result
packet-ua.c: In function ‘DissectNOE_ip_startrtp’:
packet-ua.c:479: error: unused variable ‘u8PropID’
packet-ua.c: In function ‘DissectNOE_ip_startrtp_properties’:
packet-ua.c:497: error: ignoring return value of ‘proto_item_add_subtree’,
declared with attribute warn_unused_result
packet-ua.c:490: error: unused parameter ‘pInfo’
packet-ua.c: In function ‘DissectTLV’:
packet-ua.c:574: error: ignoring return value of ‘proto_item_add_subtree’,
declared with attribute warn_unused_result
packet-ua.c: In function ‘DissectTLV_data’:
packet-ua.c:593: error: unused parameter ‘pInfo’

packet-uaudp.c: In function ‘proto_register_uaudp’:
packet-uaudp.c:214: error: passing argument 2 of ‘register_dissector’ from
incompatible pointer type
../../epan/packet.h:311: note: expected ‘dissector_t’ but argument is of type
‘int (*)(struct tvbuff_t *, struct packet_info *, struct proto_tree *)’

It is a little or big endian Protocol ? 

                    const guint8* ptr = tvb_get_ptr(pTvb, iOffs, -1);
                    proto_tree_add_bytes(pNoeItem, hf_noe_keychar, pTvb, iOffs,
-1, ptr);

use directly proto_tree_add_item(pNoeItem, hf_noe_keychar, pTvb, iOffs, -1,
ENC_NA);
It is recommanded to use prot_tree_add_item when it is possible

                u32 = tvb_get_ipv4(pTvb, iOffs);
                proto_item_append_text(pProp, ": %u.%u.%u.%u", u32&0xFF,
(u32>>8)&0xFF, (u32>>16)&0xFF, u32>>24);
There is tvb_ip_to_str function to display a IPv4 from tvb

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.