no need for if(tree)
Change-Id: Ie06738d99851b35e53effb50b2c109ce50e9c6df Reviewed-on: https://code.wireshark.org/review/5949 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
This commit is contained in:
parent
9c036553ab
commit
9fbede8567
|
@ -140,16 +140,14 @@ static const true_false_string tfs_error_ctrl = {
|
|||
static void
|
||||
dissect_brdwlk_err(proto_tree *parent_tree, tvbuff_t *tvb, int offset)
|
||||
{
|
||||
proto_item *item = NULL;
|
||||
proto_tree *tree = NULL;
|
||||
proto_item *item;
|
||||
proto_tree *tree;
|
||||
guint8 flags;
|
||||
|
||||
flags = tvb_get_guint8(tvb, offset);
|
||||
if (parent_tree) {
|
||||
item=proto_tree_add_uint(parent_tree, hf_brdwlk_error,
|
||||
tvb, offset, 1, flags);
|
||||
tree=proto_item_add_subtree(item, ett_brdwlk_error);
|
||||
}
|
||||
item = proto_tree_add_uint(parent_tree, hf_brdwlk_error,
|
||||
tvb, offset, 1, flags);
|
||||
tree = proto_item_add_subtree(item, ett_brdwlk_error);
|
||||
|
||||
|
||||
proto_tree_add_boolean(tree, hf_brdwlk_error_plp, tvb, offset, 1, flags);
|
||||
|
@ -208,7 +206,7 @@ dissect_brdwlk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
/* Set up structures needed to add the protocol subtree and manage it */
|
||||
proto_item *ti, *hidden_item;
|
||||
proto_tree *brdwlk_tree = NULL;
|
||||
proto_tree *brdwlk_tree;
|
||||
tvbuff_t *next_tvb;
|
||||
guint8 error, eof, sof;
|
||||
int hdrlen = 2,
|
||||
|
@ -234,16 +232,13 @@ dissect_brdwlk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
fc_data.sof_eof = FC_DATA_SOF_SOFF;
|
||||
}
|
||||
|
||||
if (tree) {
|
||||
ti = proto_tree_add_protocol_format(tree, proto_brdwlk, tvb, 0,
|
||||
hdrlen, "Boardwalk");
|
||||
ti = proto_tree_add_protocol_format(tree, proto_brdwlk, tvb, 0,
|
||||
hdrlen, "Boardwalk");
|
||||
|
||||
brdwlk_tree = proto_item_add_subtree(ti, ett_brdwlk);
|
||||
brdwlk_tree = proto_item_add_subtree(ti, ett_brdwlk);
|
||||
|
||||
proto_tree_add_item(brdwlk_tree, hf_brdwlk_sof, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(brdwlk_tree, hf_brdwlk_vsan, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
|
||||
}
|
||||
proto_tree_add_item(brdwlk_tree, hf_brdwlk_sof, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(brdwlk_tree, hf_brdwlk_vsan, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
|
||||
/* Locate EOF which is the last 4 bytes of the frame */
|
||||
len = tvb_length_remaining(tvb, hdrlen);
|
||||
|
@ -317,11 +312,10 @@ dissect_brdwlk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (tree) {
|
||||
hidden_item = proto_tree_add_boolean(brdwlk_tree, hf_brdwlk_drop,
|
||||
tvb, offset, 0, dropped_packets);
|
||||
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
||||
}
|
||||
|
||||
hidden_item = proto_tree_add_boolean(brdwlk_tree, hf_brdwlk_drop,
|
||||
tvb, offset, 0, dropped_packets);
|
||||
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
||||
|
||||
packet_count = pkt_cnt;
|
||||
|
||||
|
@ -336,10 +330,8 @@ dissect_brdwlk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
fc_data.sof_eof |= FC_DATA_EOF_INVALID;
|
||||
}
|
||||
|
||||
if (tree) {
|
||||
proto_tree_add_item(brdwlk_tree, hf_brdwlk_eof, tvb, offset+3,
|
||||
1, ENC_BIG_ENDIAN);
|
||||
}
|
||||
proto_tree_add_item(brdwlk_tree, hf_brdwlk_eof, tvb, offset+3,
|
||||
1, ENC_BIG_ENDIAN);
|
||||
|
||||
if ((error & BRDWLK_HAS_PLEN) && tree) {
|
||||
/* In newer Boardwalks, if this bit is set, the actual frame length
|
||||
|
|
Loading…
Reference in New Issue