forked from osmocom/wireshark
Fix proto_tree_add_item( encoding args;
Do whitespace cleanup (for a few files). svn path=/trunk/; revision=39640
This commit is contained in:
parent
1b75d2a3f3
commit
c4b63360dc
|
@ -221,7 +221,7 @@ dissect_aarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|||
if (ar_hln != 0) {
|
||||
proto_tree_add_item(aarp_tree,
|
||||
AARP_HW_IS_ETHER(ar_hrd, ar_hln) ? hf_aarp_src_hw_mac : hf_aarp_src_hw,
|
||||
tvb, sha_offset, ar_hln, FALSE);
|
||||
tvb, sha_offset, ar_hln, ENC_NA);
|
||||
}
|
||||
|
||||
if (ar_pln != 0) {
|
||||
|
@ -239,7 +239,7 @@ dissect_aarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|||
if (ar_hln != 0) {
|
||||
proto_tree_add_item(aarp_tree,
|
||||
AARP_HW_IS_ETHER(ar_hrd, ar_hln) ? hf_aarp_dst_hw_mac : hf_aarp_dst_hw,
|
||||
tvb, tha_offset, ar_hln, FALSE);
|
||||
tvb, tha_offset, ar_hln, ENC_NA);
|
||||
}
|
||||
|
||||
if (ar_pln != 0) {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -307,7 +307,7 @@ dissect_collectd_string (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
|
|||
pt = proto_item_add_subtree (pi, ett_collectd_string);
|
||||
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
|
||||
proto_tree_add_uint (pt, hf_collectd_length, tvb, offset + 2, 2, length);
|
||||
proto_tree_add_item (pt, type_hf, tvb, *ret_offset, *ret_length, FALSE);
|
||||
proto_tree_add_item (pt, type_hf, tvb, *ret_offset, *ret_length, ENC_ASCII|ENC_NA);
|
||||
|
||||
return (0);
|
||||
} /* int dissect_collectd_string */
|
||||
|
@ -385,7 +385,7 @@ dissect_collectd_integer (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
|
|||
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
|
||||
proto_tree_add_uint (pt, hf_collectd_length, tvb, offset + 2, 2,
|
||||
length);
|
||||
proto_tree_add_item (pt, type_hf, tvb, offset + 4, 8, FALSE);
|
||||
proto_tree_add_item (pt, type_hf, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
|
||||
|
||||
return (0);
|
||||
} /* int dissect_collectd_integer */
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
@ -61,8 +61,8 @@ const value_string phbid_bit15_vals[] = {
|
|||
};
|
||||
|
||||
void
|
||||
dissect_diffserv_mpls_common(tvbuff_t *tvb, proto_tree *tree, int type,
|
||||
int offset, int **hfindexes, gint **etts)
|
||||
dissect_diffserv_mpls_common(tvbuff_t *tvb, proto_tree *tree, int type,
|
||||
int offset, int **hfindexes, gint **etts)
|
||||
{
|
||||
proto_item *ti = NULL, *sub_ti;
|
||||
proto_tree *tree2 = NULL, *phbid_subtree;
|
||||
|
@ -71,43 +71,43 @@ dissect_diffserv_mpls_common(tvbuff_t *tvb, proto_tree *tree, int type,
|
|||
|
||||
switch (type) {
|
||||
case 1: /* E-LSP */
|
||||
ti = proto_tree_add_item(tree, hf_map, tvb, offset, 4, FALSE);
|
||||
tree2 = proto_item_add_subtree(ti, ett_map);
|
||||
proto_item_set_text(ti, "MAP: ");
|
||||
offset ++;
|
||||
exp = tvb_get_guint8(tvb, offset) & 7;
|
||||
proto_tree_add_uint(tree2, hf_exp, tvb, offset, 1, exp);
|
||||
proto_item_append_text(ti, "EXP %u, ", exp);
|
||||
offset ++;
|
||||
break;
|
||||
ti = proto_tree_add_item(tree, hf_map, tvb, offset, 4, ENC_NA);
|
||||
tree2 = proto_item_add_subtree(ti, ett_map);
|
||||
proto_item_set_text(ti, "MAP: ");
|
||||
offset ++;
|
||||
exp = tvb_get_guint8(tvb, offset) & 7;
|
||||
proto_tree_add_uint(tree2, hf_exp, tvb, offset, 1, exp);
|
||||
proto_item_append_text(ti, "EXP %u, ", exp);
|
||||
offset ++;
|
||||
break;
|
||||
case 2: /* L-LSP */
|
||||
tree2 = tree;
|
||||
break;
|
||||
tree2 = tree;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
/* PHBID subtree */
|
||||
sub_ti = proto_tree_add_item(tree2, hf_phbid, tvb, offset, 2, FALSE);
|
||||
sub_ti = proto_tree_add_item(tree2, hf_phbid, tvb, offset, 2, ENC_NA);
|
||||
phbid_subtree = proto_item_add_subtree(sub_ti, ett_map_phbid);
|
||||
proto_item_set_text(sub_ti, "%s: ", (type == 1) ? PHBID_DESCRIPTION : "PSC");
|
||||
phbid = tvb_get_ntohs(tvb, offset);
|
||||
|
||||
if ((phbid & 1) == 0) {
|
||||
/* Case 1 of RFC 3140 */
|
||||
proto_tree_add_uint(phbid_subtree, hf_phbid_dscp,
|
||||
tvb, offset, 2, phbid);
|
||||
if (type == 1)
|
||||
proto_item_append_text(ti, "DSCP %u", phbid >> 10);
|
||||
proto_item_append_text(sub_ti, "DSCP %u", phbid >> 10);
|
||||
/* Case 1 of RFC 3140 */
|
||||
proto_tree_add_uint(phbid_subtree, hf_phbid_dscp,
|
||||
tvb, offset, 2, phbid);
|
||||
if (type == 1)
|
||||
proto_item_append_text(ti, "DSCP %u", phbid >> 10);
|
||||
proto_item_append_text(sub_ti, "DSCP %u", phbid >> 10);
|
||||
}
|
||||
else {
|
||||
/* Case 2 of RFC 3140 */
|
||||
proto_tree_add_uint(phbid_subtree, hf_phbid_code,
|
||||
tvb, offset, 2, phbid);
|
||||
if (type == 1)
|
||||
proto_item_append_text(ti, "PHB id code %u", phbid >> 4);
|
||||
proto_item_append_text(sub_ti, "PHB id code %u", phbid >> 4);
|
||||
/* Case 2 of RFC 3140 */
|
||||
proto_tree_add_uint(phbid_subtree, hf_phbid_code,
|
||||
tvb, offset, 2, phbid);
|
||||
if (type == 1)
|
||||
proto_item_append_text(ti, "PHB id code %u", phbid >> 4);
|
||||
proto_item_append_text(sub_ti, "PHB id code %u", phbid >> 4);
|
||||
}
|
||||
proto_tree_add_uint(phbid_subtree, hf_phbid_bit14, tvb, offset, 2, phbid);
|
||||
proto_tree_add_uint(phbid_subtree, hf_phbid_bit15, tvb, offset, 2, phbid);
|
||||
|
|
|
@ -823,10 +823,10 @@ gint parseField_Enum(tvbuff_t *tvb, proto_tree *tree, gint offset, DIS_ParserNod
|
|||
|
||||
if (dis_hf_id != -1) {
|
||||
#if 0
|
||||
pi = proto_tree_add_item(tree, dis_hf_id, tvb, offset, numBytes, FALSE);
|
||||
pi = proto_tree_add_item(tree, dis_hf_id, tvb, offset, numBytes, ENC_BIG_ENDIAN);
|
||||
proto_item_set_text(pi, "%s = %s", parserNode.fieldLabel, enumStr);
|
||||
#else
|
||||
proto_tree_add_item(tree, dis_hf_id, tvb, offset, numBytes, FALSE);
|
||||
proto_tree_add_item(tree, dis_hf_id, tvb, offset, numBytes, ENC_BIG_ENDIAN);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -303,7 +303,7 @@ static void dissect_3GTFO_codec_mode(proto_tree* tree, tvbuff_t* tvb, packet_inf
|
|||
dissect_codec_mode(pt, sub_tvb, 0, tvb_length(tvb));
|
||||
}
|
||||
} else {
|
||||
proto_tree_add_item(tree,hfid,tvb,0,-1,FALSE);
|
||||
proto_tree_add_item(tree,hfid,tvb,0,-1,ENC_NA);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ static void dissect_3GTFO_codec_list(proto_tree* tree, tvbuff_t* tvb, packet_inf
|
|||
} while(offset < len);
|
||||
}
|
||||
} else {
|
||||
proto_tree_add_item(tree,hfid,tvb,0,-1,FALSE);
|
||||
proto_tree_add_item(tree,hfid,tvb,0,-1,ENC_NA);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -343,7 +343,7 @@ isis_dissect_ip_int_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
|
|||
}
|
||||
|
||||
if ( tree ) {
|
||||
proto_tree_add_item(tree, tree_id, tvb, offset, 4, FALSE);
|
||||
proto_tree_add_item(tree, tree_id, tvb, offset, 4, ENC_BIG_ENDIAN);
|
||||
}
|
||||
offset += 4;
|
||||
length -= 4;
|
||||
|
@ -427,7 +427,7 @@ isis_dissect_te_router_id_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
|
|||
return;
|
||||
}
|
||||
if ( tree ) {
|
||||
proto_tree_add_item(tree, tree_id, tvb, offset, 4, FALSE);
|
||||
proto_tree_add_item(tree, tree_id, tvb, offset, 4, ENC_BIG_ENDIAN);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
(is_request) ?
|
||||
hf_pop_request_command :
|
||||
hf_pop_response_indicator,
|
||||
tvb, offset, tokenlen, FALSE);
|
||||
tvb, offset, tokenlen, ENC_ASCII|ENC_NA);
|
||||
|
||||
if (data_val) {
|
||||
if (is_request) {
|
||||
|
@ -313,7 +313,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
(is_request) ?
|
||||
hf_pop_request_parameter :
|
||||
hf_pop_response_description,
|
||||
tvb, offset, linelen, FALSE);
|
||||
tvb, offset, linelen, ENC_ASCII|ENC_NA);
|
||||
}
|
||||
offset = next_offset;
|
||||
|
||||
|
|
|
@ -329,7 +329,7 @@ static const gchar* dissect_packetcable_qos_descriptor(proto_tree* tree, tvbuff_
|
|||
proto_tree_add_item(obj_tree, hf_packetcable_qos_status_indication, tvb, 0, 4, ENC_BIG_ENDIAN);
|
||||
|
||||
for (intval = 0; intval < PACKETCABLE_QOS_DESC_BITFIELDS; intval++) {
|
||||
proto_tree_add_item(obj_tree, hf_packetcable_qos_desc_flags[intval], tvb, 0, 4, FALSE);
|
||||
proto_tree_add_item(obj_tree, hf_packetcable_qos_desc_flags[intval], tvb, 0, 4, ENC_BIG_ENDIAN);
|
||||
}
|
||||
|
||||
tvb_memcpy(tvb, packetcable_buf, 4, 16);
|
||||
|
@ -340,7 +340,7 @@ static const gchar* dissect_packetcable_qos_descriptor(proto_tree* tree, tvbuff_
|
|||
for (intval = 0; intval < PACKETCABLE_QOS_DESC_BITFIELDS; intval++) {
|
||||
if (packetcable_qos_flags & packetcable_qos_desc_mask[intval]) {
|
||||
proto_tree_add_item(tree, hf_packetcable_qos_desc_fields[intval],
|
||||
tvb, packetcable_qos_off, 4, FALSE);
|
||||
tvb, packetcable_qos_off, 4, ENC_BIG_ENDIAN);
|
||||
packetcable_qos_off += 4;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -876,11 +876,11 @@ dissect_sflow_245_address_type(tvbuff_t *tvb, proto_tree *tree, gint offset,
|
|||
switch (addr_type) {
|
||||
case ADDR_TYPE_IPV4:
|
||||
len = 4;
|
||||
proto_tree_add_item(tree, hf_type->hf_addr_v4, tvb, offset, 4, FALSE);
|
||||
proto_tree_add_item(tree, hf_type->hf_addr_v4, tvb, offset, 4, ENC_BIG_ENDIAN);
|
||||
break;
|
||||
case ADDR_TYPE_IPV6:
|
||||
len = 16;
|
||||
proto_tree_add_item(tree, hf_type->hf_addr_v6, tvb, offset, 16, FALSE);
|
||||
proto_tree_add_item(tree, hf_type->hf_addr_v6, tvb, offset, 16, ENC_NA);
|
||||
break;
|
||||
default:
|
||||
/* acferen: November 10, 2010
|
||||
|
|
|
@ -798,7 +798,7 @@ ucp_handle_string(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
|
|||
} else
|
||||
len = idx - *offset;
|
||||
if (len > 0)
|
||||
proto_tree_add_item(tree, field, tvb, *offset, len, FALSE);
|
||||
proto_tree_add_item(tree, field, tvb, *offset, len, ENC_ASCII|ENC_NA);
|
||||
*offset += len;
|
||||
if (idx != -1)
|
||||
*offset += 1; /* skip terminating '/' */
|
||||
|
|
Loading…
Reference in New Issue