[Thrift] Fix a copy-paste-o and add dissecton of T_BYTE
authorAndersBroman <anders.broman@ericsson.com>
Wed, 6 May 2015 13:52:21 +0000 (15:52 +0200)
committerAnders Broman <a.broman58@gmail.com>
Wed, 6 May 2015 14:06:58 +0000 (14:06 +0000)
Change-Id: I2623d273a39393533c10568ef2f7642c05ac636c
Reviewed-on: https://code.wireshark.org/review/8311
Reviewed-by: Anders Broman <a.broman58@gmail.com>
epan/dissectors/packet-thrift.c

index 102949b033784452cae96aae6d776a79684ffc05..76cdeca26c09df30c240cf7a41f2a85d35977fed 100644 (file)
@@ -50,6 +50,7 @@ static int hf_thrift_i32 = -1;
 static int hf_thrift_utf7str = -1;
 static int hf_thrift_num_list_item = -1;
 static int hf_thrift_bool = -1;
+static int hf_thrift_byte = -1;
 static int hf_thrift_i64 = -1;
 static int hf_thrift_u64 = -1;
 static int hf_thrift_double = -1;
@@ -171,6 +172,11 @@ dissect_thrift_type(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int
                proto_tree_add_item(tree, hf_thrift_bool, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset += 1;
                break;
+       case 3:
+               /*T_BYTE , T_I08*/
+               proto_tree_add_item(tree, hf_thrift_byte, tvb, offset, 1, ENC_BIG_ENDIAN);
+               offset += 1;
+               break;
        case 4:
                /*T_DOUBLE*/
                proto_tree_add_item(tree, hf_thrift_double, tvb, offset, 8, ENC_BIG_ENDIAN);
@@ -188,12 +194,12 @@ dissect_thrift_type(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int
                break;
        case 9:
                /*T_U64 Integer 64*/
-               proto_tree_add_item(tree, hf_thrift_u64, tvb, offset, 4, ENC_BIG_ENDIAN);
+               proto_tree_add_item(tree, hf_thrift_u64, tvb, offset, 8, ENC_BIG_ENDIAN);
                offset += 8;
                break;
        case 10:
                /*T_I64 Integer 64*/
-               proto_tree_add_item(tree, hf_thrift_i64, tvb, offset, 4, ENC_BIG_ENDIAN);
+               proto_tree_add_item(tree, hf_thrift_i64, tvb, offset, 8, ENC_BIG_ENDIAN);
                offset += 8;
                break;
        case 11:
@@ -385,6 +391,11 @@ void proto_register_thrift(void) {
                FT_UINT8, BASE_DEC, VALS(thrift_bool_vals), 0x0,
                NULL, HFILL }
                },
+               { &hf_thrift_byte,
+               { "Byte", "thrift.byte",
+               FT_UINT8, BASE_DEC, NULL, 0x0,
+               NULL, HFILL }
+               },
                { &hf_thrift_i64,
                { "Integer64", "thrift.i64",
                FT_INT64, BASE_DEC, NULL, 0x0,