forked from osmocom/wireshark
R-GOOSE dissector: Fix subtree item lengths
This commit is contained in:
parent
adb1b59495
commit
7e8392c784
|
@ -167,7 +167,7 @@ dissect_rgoose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
|
|||
void* data _U_)
|
||||
{
|
||||
guint offset = 0, old_offset = 0;
|
||||
guint32 init_v_length, payload_tag, padding_length;
|
||||
guint32 init_v_length, payload_tag, padding_length, length;
|
||||
guint32 payload_length, apdu_offset = 0, apdu_length;
|
||||
proto_item *item = NULL;
|
||||
proto_tree *tree = NULL, *sess_user_info_tree = NULL;
|
||||
|
@ -186,8 +186,10 @@ dissect_rgoose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
|
|||
proto_tree_add_item(tree, hf_goose_spdu_id, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN);
|
||||
/* Session header length */
|
||||
proto_tree_add_item(tree, hf_goose_session_hdr_length, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item_ret_uint(tree, hf_goose_session_hdr_length, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN, &length);
|
||||
proto_item_set_len(item, length + 2);
|
||||
|
||||
/* Header content indicator */
|
||||
proto_tree_add_item(tree, hf_goose_content_id, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN);
|
||||
|
@ -224,6 +226,8 @@ dissect_rgoose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
|
|||
/* Initialization vector length */
|
||||
proto_tree_add_item_ret_uint(tree, hf_goose_init_vec_length, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN, &init_v_length);
|
||||
proto_item_set_len(item, init_v_length + 11);
|
||||
|
||||
if (init_v_length > 0) {
|
||||
/* Initialization vector bytes */
|
||||
proto_tree_add_item(tree, hf_goose_init_vec, tvb, offset, init_v_length,
|
||||
|
@ -290,6 +294,8 @@ dissect_rgoose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
|
|||
/* Padding length */
|
||||
proto_tree_add_item_ret_uint(tree, hf_goose_padding_length, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN, &padding_length);
|
||||
proto_item_set_len(item, padding_length + 1);
|
||||
|
||||
/* Padding bytes */
|
||||
proto_tree_add_item(tree, hf_goose_padding, tvb, offset, padding_length,
|
||||
ENC_NA);
|
||||
|
|
|
@ -816,7 +816,7 @@ dissect_rgoose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
|
|||
void* data _U_)
|
||||
{
|
||||
guint offset = 0, old_offset = 0;
|
||||
guint32 init_v_length, payload_tag, padding_length;
|
||||
guint32 init_v_length, payload_tag, padding_length, length;
|
||||
guint32 payload_length, apdu_offset = 0, apdu_length;
|
||||
proto_item *item = NULL;
|
||||
proto_tree *tree = NULL, *sess_user_info_tree = NULL;
|
||||
|
@ -835,8 +835,10 @@ dissect_rgoose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
|
|||
proto_tree_add_item(tree, hf_goose_spdu_id, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN);
|
||||
/* Session header length */
|
||||
proto_tree_add_item(tree, hf_goose_session_hdr_length, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item_ret_uint(tree, hf_goose_session_hdr_length, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN, &length);
|
||||
proto_item_set_len(item, length + 2);
|
||||
|
||||
/* Header content indicator */
|
||||
proto_tree_add_item(tree, hf_goose_content_id, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN);
|
||||
|
@ -873,6 +875,8 @@ dissect_rgoose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
|
|||
/* Initialization vector length */
|
||||
proto_tree_add_item_ret_uint(tree, hf_goose_init_vec_length, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN, &init_v_length);
|
||||
proto_item_set_len(item, init_v_length + 11);
|
||||
|
||||
if (init_v_length > 0) {
|
||||
/* Initialization vector bytes */
|
||||
proto_tree_add_item(tree, hf_goose_init_vec, tvb, offset, init_v_length,
|
||||
|
@ -939,6 +943,8 @@ dissect_rgoose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
|
|||
/* Padding length */
|
||||
proto_tree_add_item_ret_uint(tree, hf_goose_padding_length, tvb, offset++, 1,
|
||||
ENC_BIG_ENDIAN, &padding_length);
|
||||
proto_item_set_len(item, padding_length + 1);
|
||||
|
||||
/* Padding bytes */
|
||||
proto_tree_add_item(tree, hf_goose_padding, tvb, offset, padding_length,
|
||||
ENC_NA);
|
||||
|
@ -1374,7 +1380,7 @@ void proto_register_goose(void) {
|
|||
"UtcTime", HFILL }},
|
||||
|
||||
/*--- End of included file: packet-goose-hfarr.c ---*/
|
||||
#line 488 "./asn1/goose/packet-goose-template.c"
|
||||
#line 494 "./asn1/goose/packet-goose-template.c"
|
||||
};
|
||||
|
||||
/* List of subtrees */
|
||||
|
@ -1407,7 +1413,7 @@ void proto_register_goose(void) {
|
|||
&ett_goose_Data,
|
||||
|
||||
/*--- End of included file: packet-goose-ettarr.c ---*/
|
||||
#line 499 "./asn1/goose/packet-goose-template.c"
|
||||
#line 505 "./asn1/goose/packet-goose-template.c"
|
||||
};
|
||||
|
||||
static ei_register_info ei[] = {
|
||||
|
|
Loading…
Reference in New Issue