Remove incorrect 'if (tree)'
Incorrect because of one or both of the following: - col_...()/expert...() called under 'if (tree)' - vars set under 'if (tree)' used later (not under 'if (tree)' as args to col_...()/expert_...() Change-Id: I89f7d453f2d6eaa40d51cbd794ed2c9be7e549de Reviewed-on: https://code.wireshark.org/review/6754 Reviewed-by: Bill Meier <wmeier@newsguy.com>
This commit is contained in:
parent
5a23a02ab8
commit
8d1a9848e3
|
@ -968,132 +968,130 @@ dissect_edp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
|
||||
col_set_str(pinfo->cinfo, COL_INFO, PROTO_SHORT_NAME ":");
|
||||
|
||||
if (tree) {
|
||||
ti = proto_tree_add_item(tree, proto_edp, tvb, offset, -1,
|
||||
ENC_NA);
|
||||
edp_tree = proto_item_add_subtree(ti, ett_edp);
|
||||
ti = proto_tree_add_item(tree, proto_edp, tvb, offset, -1,
|
||||
ENC_NA);
|
||||
edp_tree = proto_item_add_subtree(ti, ett_edp);
|
||||
|
||||
proto_tree_add_item(edp_tree, hf_edp_version, tvb, offset, 1,
|
||||
ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
proto_tree_add_item(edp_tree, hf_edp_version, tvb, offset, 1,
|
||||
ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(edp_tree, hf_edp_reserved, tvb, offset, 1,
|
||||
ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
proto_tree_add_item(edp_tree, hf_edp_reserved, tvb, offset, 1,
|
||||
ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
data_length = tvb_get_ntohs(tvb, offset);
|
||||
proto_tree_add_uint(edp_tree, hf_edp_length, tvb, offset, 2,
|
||||
data_length);
|
||||
offset += 2;
|
||||
data_length = tvb_get_ntohs(tvb, offset);
|
||||
proto_tree_add_uint(edp_tree, hf_edp_length, tvb, offset, 2,
|
||||
data_length);
|
||||
offset += 2;
|
||||
|
||||
packet_checksum = tvb_get_ntohs(tvb, offset);
|
||||
/*
|
||||
* If we have the entire ESP packet available, check the checksum.
|
||||
*/
|
||||
if (tvb_length(tvb) >= data_length) {
|
||||
/* Checksum from version to null tlv */
|
||||
SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, data_length);
|
||||
computed_checksum = in_cksum(&cksum_vec[0], 1);
|
||||
checksum_good = (computed_checksum == 0);
|
||||
checksum_bad = !checksum_good;
|
||||
if (checksum_good) {
|
||||
checksum_item = proto_tree_add_uint_format(edp_tree,
|
||||
hf_edp_checksum, tvb, offset, 2, packet_checksum,
|
||||
"Checksum: 0x%04x [correct]",
|
||||
packet_checksum);
|
||||
} else {
|
||||
checksum_item = proto_tree_add_uint_format(edp_tree,
|
||||
hf_edp_checksum, tvb, offset, 2, packet_checksum,
|
||||
"Checksum: 0x%04x [incorrect, should be 0x%04x]",
|
||||
packet_checksum,
|
||||
in_cksum_shouldbe(packet_checksum, computed_checksum));
|
||||
}
|
||||
packet_checksum = tvb_get_ntohs(tvb, offset);
|
||||
/*
|
||||
* If we have the entire ESP packet available, check the checksum.
|
||||
*/
|
||||
if (tvb_length(tvb) >= data_length) {
|
||||
/* Checksum from version to null tlv */
|
||||
SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, data_length);
|
||||
computed_checksum = in_cksum(&cksum_vec[0], 1);
|
||||
checksum_good = (computed_checksum == 0);
|
||||
checksum_bad = !checksum_good;
|
||||
if (checksum_good) {
|
||||
checksum_item = proto_tree_add_uint_format(edp_tree,
|
||||
hf_edp_checksum, tvb, offset, 2, packet_checksum,
|
||||
"Checksum: 0x%04x [correct]",
|
||||
packet_checksum);
|
||||
} else {
|
||||
checksum_good = checksum_bad = FALSE;
|
||||
checksum_item = proto_tree_add_uint(edp_tree, hf_edp_checksum,
|
||||
tvb, offset, 2, packet_checksum);
|
||||
checksum_item = proto_tree_add_uint_format(edp_tree,
|
||||
hf_edp_checksum, tvb, offset, 2, packet_checksum,
|
||||
"Checksum: 0x%04x [incorrect, should be 0x%04x]",
|
||||
packet_checksum,
|
||||
in_cksum_shouldbe(packet_checksum, computed_checksum));
|
||||
}
|
||||
checksum_tree = proto_item_add_subtree(checksum_item, ett_edp_checksum);
|
||||
checksum_item = proto_tree_add_boolean(checksum_tree, hf_edp_checksum_good,
|
||||
tvb, offset, 2, checksum_good);
|
||||
PROTO_ITEM_SET_GENERATED(checksum_item);
|
||||
checksum_item = proto_tree_add_boolean(checksum_tree, hf_edp_checksum_bad,
|
||||
tvb, offset, 2, checksum_bad);
|
||||
PROTO_ITEM_SET_GENERATED(checksum_item);
|
||||
offset += 2;
|
||||
} else {
|
||||
checksum_good = checksum_bad = FALSE;
|
||||
checksum_item = proto_tree_add_uint(edp_tree, hf_edp_checksum,
|
||||
tvb, offset, 2, packet_checksum);
|
||||
}
|
||||
checksum_tree = proto_item_add_subtree(checksum_item, ett_edp_checksum);
|
||||
checksum_item = proto_tree_add_boolean(checksum_tree, hf_edp_checksum_good,
|
||||
tvb, offset, 2, checksum_good);
|
||||
PROTO_ITEM_SET_GENERATED(checksum_item);
|
||||
checksum_item = proto_tree_add_boolean(checksum_tree, hf_edp_checksum_bad,
|
||||
tvb, offset, 2, checksum_bad);
|
||||
PROTO_ITEM_SET_GENERATED(checksum_item);
|
||||
offset += 2;
|
||||
|
||||
seqno = tvb_get_ntohs(tvb, offset);
|
||||
proto_tree_add_item(edp_tree, hf_edp_seqno, tvb, offset, 2,
|
||||
ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
seqno = tvb_get_ntohs(tvb, offset);
|
||||
proto_tree_add_item(edp_tree, hf_edp_seqno, tvb, offset, 2,
|
||||
ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Machine ID is 8 bytes, if it starts with 0000, the remaining
|
||||
6 bytes are a MAC */
|
||||
proto_tree_add_item(edp_tree, hf_edp_midtype, tvb, offset, 2,
|
||||
ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
/* Machine ID is 8 bytes, if it starts with 0000, the remaining
|
||||
6 bytes are a MAC */
|
||||
proto_tree_add_item(edp_tree, hf_edp_midtype, tvb, offset, 2,
|
||||
ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
proto_tree_add_item(edp_tree, hf_edp_midmac, tvb, offset, 6,
|
||||
ENC_NA);
|
||||
offset += 6;
|
||||
proto_tree_add_item(edp_tree, hf_edp_midmac, tvb, offset, 6,
|
||||
ENC_NA);
|
||||
offset += 6;
|
||||
|
||||
/* Decode the individual TLVs */
|
||||
while (offset < data_length && !last) {
|
||||
if (data_length - offset < 4) {
|
||||
proto_tree_add_expert_format(edp_tree, pinfo, &ei_edp_short_tlv, tvb, offset, 4,
|
||||
"Too few bytes left for TLV: %u (< 4)",
|
||||
data_length - offset);
|
||||
break;
|
||||
}
|
||||
tlv_type = tvb_get_guint8(tvb, offset + 1);
|
||||
tlv_length = tvb_get_ntohs(tvb, offset + 2);
|
||||
/* Decode the individual TLVs */
|
||||
while (offset < data_length && !last) {
|
||||
if (data_length - offset < 4) {
|
||||
proto_tree_add_expert_format(edp_tree, pinfo, &ei_edp_short_tlv, tvb, offset, 4,
|
||||
"Too few bytes left for TLV: %u (< 4)",
|
||||
data_length - offset);
|
||||
break;
|
||||
}
|
||||
tlv_type = tvb_get_guint8(tvb, offset + 1);
|
||||
tlv_length = tvb_get_ntohs(tvb, offset + 2);
|
||||
|
||||
if ((tlv_length < 4) || (tlv_length > (data_length - offset))) {
|
||||
proto_tree_add_expert_format(edp_tree, pinfo, &ei_edp_short_tlv, tvb, offset, 0,
|
||||
"TLV with invalid length: %u", tlv_length);
|
||||
break;
|
||||
}
|
||||
if (tlv_type != EDP_TYPE_NULL)
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
|
||||
if ((tlv_length < 4) || (tlv_length > (data_length - offset))) {
|
||||
proto_tree_add_expert_format(edp_tree, pinfo, &ei_edp_short_tlv, tvb, offset, 0,
|
||||
"TLV with invalid length: %u", tlv_length);
|
||||
break;
|
||||
}
|
||||
if (tlv_type != EDP_TYPE_NULL)
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
|
||||
val_to_str(tlv_type, edp_type_vals, "[0x%02x]"));
|
||||
|
||||
switch (tlv_type) {
|
||||
case EDP_TYPE_NULL: /* Last TLV */
|
||||
dissect_null_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
last = 1;
|
||||
break;
|
||||
case EDP_TYPE_DISPLAY: /* MIB II display string */
|
||||
dissect_display_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_INFO: /* Basic system information */
|
||||
dissect_info_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_VLAN: /* VLAN info */
|
||||
dissect_vlan_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_ESRP: /* Extreme Standby Router Protocol */
|
||||
dissect_esrp_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_EAPS: /* Ethernet Automatic Protection Swtiching */
|
||||
dissect_eaps_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_ESL: /* EAPS shared link */
|
||||
dissect_esl_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_ELSM: /* Extreme Link Status Monitoring */
|
||||
dissect_elsm_tlv(tvb, pinfo, offset, tlv_length, edp_tree, seqno);
|
||||
break;
|
||||
case EDP_TYPE_ELRP: /* Extreme Loop Recognition Protocol */
|
||||
dissect_elrp_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
default:
|
||||
dissect_unknown_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
}
|
||||
offset += tlv_length;
|
||||
switch (tlv_type) {
|
||||
case EDP_TYPE_NULL: /* Last TLV */
|
||||
dissect_null_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
last = 1;
|
||||
break;
|
||||
case EDP_TYPE_DISPLAY: /* MIB II display string */
|
||||
dissect_display_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_INFO: /* Basic system information */
|
||||
dissect_info_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_VLAN: /* VLAN info */
|
||||
dissect_vlan_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_ESRP: /* Extreme Standby Router Protocol */
|
||||
dissect_esrp_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_EAPS: /* Ethernet Automatic Protection Swtiching */
|
||||
dissect_eaps_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_ESL: /* EAPS shared link */
|
||||
dissect_esl_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
case EDP_TYPE_ELSM: /* Extreme Link Status Monitoring */
|
||||
dissect_elsm_tlv(tvb, pinfo, offset, tlv_length, edp_tree, seqno);
|
||||
break;
|
||||
case EDP_TYPE_ELRP: /* Extreme Loop Recognition Protocol */
|
||||
dissect_elrp_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
default:
|
||||
dissect_unknown_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
|
||||
break;
|
||||
}
|
||||
|
||||
offset += tlv_length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -318,10 +318,8 @@ static void dissect_ismacryp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tre
|
|||
} /* end if user_mode == FALSE */
|
||||
|
||||
/* navigate through buffer */
|
||||
if (tree)
|
||||
/* if (tree) */
|
||||
{
|
||||
/* we are being asked for details */
|
||||
|
||||
guint16 au_headers_length = 0; /* total length of AU headers */
|
||||
guint16 totalbits =0; /* keeps track of total number of AU header bits treated (used to determine end of AU headers) */
|
||||
int deltabits = -1; /* keeps track of extra bits per AU header treated (used to determine end of AU heafers ) */
|
||||
|
|
|
@ -90,7 +90,7 @@ static void dissect_kdp(tvbuff_t *tvb,
|
|||
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "KDP");
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
if (tree) {
|
||||
/* if (tree) */ {
|
||||
proto_item *ti;
|
||||
proto_tree *kdp_tree, *flags_tree;
|
||||
ti = NULL;
|
||||
|
|
|
@ -145,187 +145,187 @@ dissect_lacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LACP");
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "Link Aggregation Control Protocol");
|
||||
|
||||
/* Add LACP Heading */
|
||||
lacpdu_item = proto_tree_add_protocol_format(tree, proto_lacp, tvb,
|
||||
0, -1, "Link Aggregation Control Protocol");
|
||||
lacpdu_tree = proto_item_add_subtree(lacpdu_item, ett_lacp);
|
||||
|
||||
/* Version Number */
|
||||
|
||||
raw_octet = tvb_get_guint8(tvb, offset);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "Version %d. ", raw_octet);
|
||||
proto_tree_add_uint(lacpdu_tree, hf_lacp_version_number, tvb,
|
||||
offset, 1, raw_octet);
|
||||
offset += 1;
|
||||
|
||||
/* Actor Type */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_type, tvb,
|
||||
offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
/* Actor Info Length */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_info_len, tvb,
|
||||
offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
/* Actor System Priority */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_sys_priority, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Actor System */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_sys, tvb,
|
||||
offset, 6, ENC_NA);
|
||||
offset += 6;
|
||||
|
||||
/* Actor Key */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_key, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Actor Port Priority */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_port_priority, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Actor Port */
|
||||
|
||||
raw_word = tvb_get_ntohs(tvb, offset);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "Actor Port = %d ", raw_word);
|
||||
proto_tree_add_uint(lacpdu_tree, hf_lacp_actor_port, tvb,
|
||||
offset, 2, raw_word);
|
||||
offset += 2;
|
||||
|
||||
/* Actor State */
|
||||
|
||||
flags = tvb_get_guint8(tvb, offset);
|
||||
actor_flags_item = proto_tree_add_uint(lacpdu_tree, hf_lacp_actor_state, tvb,
|
||||
offset, 1, flags);
|
||||
actor_flags_tree = proto_item_add_subtree(actor_flags_item, ett_lacp_a_flags);
|
||||
|
||||
sep = initial_sep;
|
||||
|
||||
/* Activity Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_ACTIVITY, actor_flags_item,
|
||||
"%sActivity");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_activity, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Timeout Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_TIMEOUT, actor_flags_item,
|
||||
"%sTimeout");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_timeout, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Aggregation Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_AGGREGATION, actor_flags_item,
|
||||
"%sAggregation");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_aggregation, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Synchronization Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_SYNC, actor_flags_item,
|
||||
"%sSynchronization");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_sync, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Collecting Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_COLLECTING, actor_flags_item,
|
||||
"%sCollecting");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_collecting, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Distributing Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DISTRIB, actor_flags_item,
|
||||
"%sDistributing");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_distrib, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Defaulted Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DEFAULTED, actor_flags_item,
|
||||
"%sDefaulted");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_defaulted, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Expired Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_EXPIRED, actor_flags_item,
|
||||
"%sExpired");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_expired, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
if (sep != initial_sep)
|
||||
{
|
||||
/* We put something in; put in the terminating ")" */
|
||||
proto_item_append_text(actor_flags_item, ")");
|
||||
}
|
||||
offset += 1;
|
||||
|
||||
/* Actor Reserved */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_reserved, tvb,
|
||||
offset, 3, ENC_NA);
|
||||
offset += 3;
|
||||
|
||||
/* Partner Type */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_type, tvb,
|
||||
offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
/* Partner Info Length */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_info_len, tvb,
|
||||
offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
/* Partner System Priority */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_sys_priority, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Partner System */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_sys, tvb,
|
||||
offset, 6, ENC_NA);
|
||||
offset += 6;
|
||||
|
||||
/* Partner Key */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_key, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Partner Port Priority */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_port_priority, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Partner Port */
|
||||
|
||||
raw_word = tvb_get_ntohs(tvb, offset);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "Partner Port = %d ", raw_word);
|
||||
proto_tree_add_uint(lacpdu_tree, hf_lacp_partner_port, tvb,
|
||||
offset, 2, raw_word);
|
||||
offset += 2;
|
||||
|
||||
if (tree)
|
||||
{
|
||||
/* Add LACP Heading */
|
||||
lacpdu_item = proto_tree_add_protocol_format(tree, proto_lacp, tvb,
|
||||
0, -1, "Link Aggregation Control Protocol");
|
||||
lacpdu_tree = proto_item_add_subtree(lacpdu_item, ett_lacp);
|
||||
|
||||
/* Version Number */
|
||||
|
||||
raw_octet = tvb_get_guint8(tvb, offset);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "Version %d. ", raw_octet);
|
||||
proto_tree_add_uint(lacpdu_tree, hf_lacp_version_number, tvb,
|
||||
offset, 1, raw_octet);
|
||||
offset += 1;
|
||||
|
||||
/* Actor Type */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_type, tvb,
|
||||
offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
/* Actor Info Length */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_info_len, tvb,
|
||||
offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
/* Actor System Priority */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_sys_priority, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Actor System */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_sys, tvb,
|
||||
offset, 6, ENC_NA);
|
||||
offset += 6;
|
||||
|
||||
/* Actor Key */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_key, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Actor Port Priority */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_port_priority, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Actor Port */
|
||||
|
||||
raw_word = tvb_get_ntohs(tvb, offset);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "Actor Port = %d ", raw_word);
|
||||
proto_tree_add_uint(lacpdu_tree, hf_lacp_actor_port, tvb,
|
||||
offset, 2, raw_word);
|
||||
offset += 2;
|
||||
|
||||
/* Actor State */
|
||||
|
||||
flags = tvb_get_guint8(tvb, offset);
|
||||
actor_flags_item = proto_tree_add_uint(lacpdu_tree, hf_lacp_actor_state, tvb,
|
||||
offset, 1, flags);
|
||||
actor_flags_tree = proto_item_add_subtree(actor_flags_item, ett_lacp_a_flags);
|
||||
|
||||
sep = initial_sep;
|
||||
|
||||
/* Activity Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_ACTIVITY, actor_flags_item,
|
||||
"%sActivity");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_activity, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Timeout Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_TIMEOUT, actor_flags_item,
|
||||
"%sTimeout");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_timeout, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Aggregation Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_AGGREGATION, actor_flags_item,
|
||||
"%sAggregation");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_aggregation, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Synchronization Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_SYNC, actor_flags_item,
|
||||
"%sSynchronization");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_sync, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Collecting Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_COLLECTING, actor_flags_item,
|
||||
"%sCollecting");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_collecting, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Distributing Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DISTRIB, actor_flags_item,
|
||||
"%sDistributing");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_distrib, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Defaulted Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DEFAULTED, actor_flags_item,
|
||||
"%sDefaulted");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_defaulted, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
/* Expired Flag */
|
||||
|
||||
APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_EXPIRED, actor_flags_item,
|
||||
"%sExpired");
|
||||
proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_expired, tvb,
|
||||
offset, 1, flags);
|
||||
|
||||
if (sep != initial_sep)
|
||||
{
|
||||
/* We put something in; put in the terminating ")" */
|
||||
proto_item_append_text(actor_flags_item, ")");
|
||||
}
|
||||
offset += 1;
|
||||
|
||||
/* Actor Reserved */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_actor_reserved, tvb,
|
||||
offset, 3, ENC_NA);
|
||||
offset += 3;
|
||||
|
||||
/* Partner Type */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_type, tvb,
|
||||
offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
/* Partner Info Length */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_info_len, tvb,
|
||||
offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
/* Partner System Priority */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_sys_priority, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Partner System */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_sys, tvb,
|
||||
offset, 6, ENC_NA);
|
||||
offset += 6;
|
||||
|
||||
/* Partner Key */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_key, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Partner Port Priority */
|
||||
|
||||
proto_tree_add_item(lacpdu_tree, hf_lacp_partner_port_priority, tvb,
|
||||
offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
/* Partner Port */
|
||||
|
||||
raw_word = tvb_get_ntohs(tvb, offset);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "Partner Port = %d ", raw_word);
|
||||
proto_tree_add_uint(lacpdu_tree, hf_lacp_partner_port, tvb,
|
||||
offset, 2, raw_word);
|
||||
offset += 2;
|
||||
|
||||
/* Partner State */
|
||||
|
||||
flags = tvb_get_guint8(tvb, offset);
|
||||
|
|
|
@ -1039,7 +1039,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
mi->is_duplicate = FALSE;
|
||||
mi->request_available = FALSE;
|
||||
|
||||
if (tree)
|
||||
/* if (tree) */
|
||||
{
|
||||
tokennum = 0;
|
||||
|
||||
|
|
|
@ -2075,14 +2075,12 @@ dissect_netflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
|
|||
offset += 2;
|
||||
|
||||
pdus = tvb_get_ntohs(tvb, offset);
|
||||
if (tree) {
|
||||
if(ver == 10) {
|
||||
proto_tree_add_uint(netflow_tree, hf_cflow_len, tvb, offset, 2, pdus);
|
||||
flow_len = pdus;
|
||||
} else {
|
||||
proto_tree_add_uint(netflow_tree, hf_cflow_count, tvb, offset, 2, pdus);
|
||||
flow_len = -1;
|
||||
}
|
||||
if(ver == 10) {
|
||||
proto_tree_add_uint(netflow_tree, hf_cflow_len, tvb, offset, 2, pdus);
|
||||
flow_len = pdus;
|
||||
} else {
|
||||
proto_tree_add_uint(netflow_tree, hf_cflow_count, tvb, offset, 2, pdus);
|
||||
flow_len = -1;
|
||||
}
|
||||
offset += 2;
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ dissect_tivoconnect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
|
|||
|
||||
col_set_str(pinfo->cinfo, COL_INFO, proto_name);
|
||||
|
||||
if (tree) {
|
||||
/* if (tree) */ {
|
||||
/* Set up structures needed to add the protocol subtree and manage it */
|
||||
proto_item *ti = NULL;
|
||||
proto_tree *tivoconnect_tree = NULL;
|
||||
|
|
|
@ -2001,8 +2001,7 @@ dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
}
|
||||
|
||||
|
||||
if (v52_tree != NULL) {
|
||||
|
||||
/* if (v52_tree != NULL) */ {
|
||||
|
||||
message_type_tmp = tvb_get_guint8(tvb, MSG_TYPE_OFFSET);
|
||||
|
||||
|
|
Loading…
Reference in New Issue