Wireshark-bugs: [Wireshark-bugs] [Bug 5846] A new dissector for uTorrent Transport Protocol

Date: Wed, 20 Apr 2011 01:32:53 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5846

--- Comment #8 from Alexis La Goutte <alexis.lagoutte@xxxxxxxxx> 2011-04-20 01:32:47 PDT ---
(In reply to comment #6)
> 
> OK: I've looked at the libutp utp.cpp and see that the V2 (and greater) header
> format is quite different: somewhat similar fields but different sizes/offsets.
> 
> The V2 format matches your capture so I'll update the dissector tomorrow to
> dissect the header according to the version (unless you've already started).

Hi Bill,

I not found a V2 (and greader) header, only a v0(?) Header
struct PacketFormat {
    // connection ID
    uint32_big connid;
    uint32_big tv_sec;
...
}
and there is no field for type and version in v0 Header.

Also the Libutp don't respect the spec ? (about type and version)
BEP-0029 Spec : 
0       4       8               16              24              32
+-------+-------+---------------+---------------+---------------+
| ver   | type  | extension     | connection_id                 |
+-------+-------+---------------+---------------+---------------+
It is indicated : All fields are in network byte order (big endian).

LibUTP Source :
struct PacketFormatV1 {
    // packet_type (4 high bits)
    // protocol version (4 low bits)
    byte ver_type;
    byte version() const { return ver_type & 0xf; }
    byte type() const { return ver_type >> 4; }
    void set_version(byte v) { ver_type = (ver_type & 0xf0) | (v & 0xf); }
    void set_type(byte t) { ver_type = (ver_type & 0xf) | (t << 4); }

The field is inverted ?

The problem comes from following commit 
https://github.com/bittorrent/libutp/commit/931f01252ef66e8263bfda09a629ff07e40538c0#utp.cpp

(It not in Expert in Big/Little Endian...)

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