Stop using deprecated functions identified by checkAPIs script.

svn path=/trunk/; revision=25258
This commit is contained in:
Martin Mathieson 2008-05-08 14:01:31 +00:00
parent 7e40100fb3
commit 693291377e
6 changed files with 70 additions and 60 deletions

View File

@ -402,8 +402,9 @@ static void dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (mgcp_tree)
{
proto_tree_add_uint_hidden(mgcp_tree, hf_mgcp_messagecount, tvb,
0 ,0 , num_messages);
proto_item *ti = proto_tree_add_uint(mgcp_tree, hf_mgcp_messagecount, tvb,
0 ,0 , num_messages);
PROTO_ITEM_SET_HIDDEN(ti);
}
/*
@ -1543,7 +1544,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
switch (mgcp_type)
{
case MGCP_RESPONSE:
proto_tree_add_boolean_hidden(tree, hf_mgcp_rsp, tvb, 0, 0, TRUE);
PROTO_ITEM_SET_HIDDEN(proto_tree_add_boolean(tree, hf_mgcp_rsp, tvb, 0, 0, TRUE));
/* Check for MGCP response. A response must match a call that
we've seen, and the response must be sent to the same
port and address that the call came from, and must
@ -1631,7 +1632,8 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (tree)
{
proto_item* item;
proto_tree_add_uint_hidden(tree, hf_mgcp_dup, tvb, 0,0, mi->transid);
item = proto_tree_add_uint(tree, hf_mgcp_dup, tvb, 0,0, mi->transid);
PROTO_ITEM_SET_HIDDEN(item);
item = proto_tree_add_uint(tree, hf_mgcp_rsp_dup,
tvb, 0, 0, mi->transid);
PROTO_ITEM_SET_GENERATED(item);
@ -1647,7 +1649,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
}
break;
case MGCP_REQUEST:
proto_tree_add_boolean_hidden(tree, hf_mgcp_req, tvb, 0, 0, TRUE);
PROTO_ITEM_SET_HIDDEN(proto_tree_add_boolean(tree, hf_mgcp_req, tvb, 0, 0, TRUE));
/* Keep track of the address and port whence the call came,
* and the port to which the call is being sent, so that
* we can match up calls with replies.
@ -1725,7 +1727,8 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (tree)
{
proto_item* item;
proto_tree_add_uint_hidden(tree, hf_mgcp_dup, tvb, 0,0, mi->transid);
item = proto_tree_add_uint(tree, hf_mgcp_dup, tvb, 0,0, mi->transid);
PROTO_ITEM_SET_HIDDEN(item);
item = proto_tree_add_uint(tree, hf_mgcp_req_dup, tvb, 0,0, mi->transid);
PROTO_ITEM_SET_GENERATED(item);
item = proto_tree_add_uint(tree, hf_mgcp_req_dup_frame, tvb, 0,0, mi->req_num);

View File

@ -81,12 +81,13 @@ dissect_nntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
nntp_tree = proto_item_add_subtree(ti, ett_nntp);
if (pinfo->match_port == pinfo->destport) {
proto_tree_add_boolean_hidden(nntp_tree,
ti = proto_tree_add_boolean(nntp_tree,
hf_nntp_request, tvb, 0, 0, TRUE);
} else {
proto_tree_add_boolean_hidden(nntp_tree,
ti = proto_tree_add_boolean(nntp_tree,
hf_nntp_response, tvb, 0, 0, TRUE);
}
PROTO_ITEM_SET_HIDDEN(ti);
/*
* Show the request or response as text, a line at a time.

View File

@ -2,7 +2,7 @@
*
* Routines for RFC2190-encapsulated H.263 dissection
*
* Copyright 2003 Niklas gren <niklas.ogren@7l.se>
* Copyright 2003 Niklas Ogren <niklas.ogren@7l.se>
* Seven Levels Consultants AB
*
* Copyright 2008 Richard van der Hoff, MX Telecom

View File

@ -715,51 +715,53 @@ dissect_rtcp_rtpfb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item
offset += 4;
/* Transport-Layer Feedback Message Elements */
switch(rtcp_rtpfb_fmt) {
case 1:
/* NACK */
while ((offset - start_offset) < packet_length) {
proto_tree_add_item( rtcp_tree, hf_rtcp_rtpfb_nack_pid,
tvb, offset, 2, FALSE);
rtcp_rtpfb_nack_pid = tvb_get_ntohs(tvb, offset);
offset += 2;
ti = proto_tree_add_item( rtcp_tree, hf_rtcp_rtpfb_nack_blp,
tvb, offset, 2, FALSE);
proto_item_set_text(ti, "RTCP Transport Feedback NACK BLP: ");
rtcp_rtpfb_nack_blp = tvb_get_ntohs(tvb, offset);
bitfield_tree = proto_item_add_subtree( ti, ett_rtcp_nack_blp);
nack_num_frames_lost ++;
if (rtcp_rtpfb_nack_blp) {
for (i = 0; i < 16; i ++) {
g_snprintf(strbuf, 64, "Frame %d also lost", rtcp_rtpfb_nack_pid + i + 1);
proto_tree_add_text(
bitfield_tree, tvb, offset, 2,
decode_boolean_bitfield(rtcp_rtpfb_nack_blp, (1<<i),
16, strbuf, ""));
if (rtcp_rtpfb_nack_blp & (1<<i)) {
proto_tree_add_uint_hidden(bitfield_tree, hf_rtcp_rtpfb_nack_pid,
tvb, offset, 2,
rtcp_rtpfb_nack_pid + i + 1);
proto_item_append_text(ti, "%d ", rtcp_rtpfb_nack_pid + i + 1);
nack_num_frames_lost ++;
}
}
} else {
proto_item_set_text(ti, "0 (No additional frames lost)");
}
offset += 2;
}
if (top_item) {
proto_item_append_text(top_item, ": NACK: %d frames lost", nack_num_frames_lost);
}
break;
default:
/* Unknown FMT */
proto_tree_add_item( rtcp_tree, hf_rtcp_fci, tvb, offset, packet_length - offset, FALSE );
offset = start_offset + packet_length;
}
return offset;
switch (rtcp_rtpfb_fmt) {
case 1:
/* NACK */
while ((offset - start_offset) < packet_length) {
proto_tree_add_item(rtcp_tree, hf_rtcp_rtpfb_nack_pid,
tvb, offset, 2, FALSE);
rtcp_rtpfb_nack_pid = tvb_get_ntohs(tvb, offset);
offset += 2;
ti = proto_tree_add_item(rtcp_tree, hf_rtcp_rtpfb_nack_blp,
tvb, offset, 2, FALSE);
proto_item_set_text(ti, "RTCP Transport Feedback NACK BLP: ");
rtcp_rtpfb_nack_blp = tvb_get_ntohs(tvb, offset);
bitfield_tree = proto_item_add_subtree( ti, ett_rtcp_nack_blp);
nack_num_frames_lost ++;
if (rtcp_rtpfb_nack_blp) {
for (i = 0; i < 16; i ++) {
g_snprintf(strbuf, 64, "Frame %d also lost", rtcp_rtpfb_nack_pid + i + 1);
proto_tree_add_text(bitfield_tree, tvb, offset, 2,
decode_boolean_bitfield(rtcp_rtpfb_nack_blp, (1<<i),
16, strbuf, ""));
if (rtcp_rtpfb_nack_blp & (1<<i)) {
proto_item *hidden_ti;
hidden_ti = proto_tree_add_uint_hidden(bitfield_tree, hf_rtcp_rtpfb_nack_pid,
tvb, offset, 2,
rtcp_rtpfb_nack_pid + i + 1);
proto_item_append_text(ti, "%d ", rtcp_rtpfb_nack_pid + i + 1);
nack_num_frames_lost ++;
}
}
} else {
proto_item_set_text(ti, "0 (No additional frames lost)");
}
offset += 2;
}
if (top_item) {
proto_item_append_text(top_item, ": NACK: %d frames lost", nack_num_frames_lost);
}
break;
default:
/* Unknown FMT */
proto_tree_add_item(rtcp_tree, hf_rtcp_fci, tvb, offset, packet_length - offset, FALSE );
offset = start_offset + packet_length;
}
return offset;
}
static int
dissect_rtcp_psfb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree,

View File

@ -956,13 +956,16 @@ static void dissect_key_mgmt(tvbuff_t *tvb, packet_info * pinfo, proto_item * ti
key_tree);
}
if (found_match)
proto_tree_add_item_hidden(key_tree, hf_key_mgmt_data,
keymgmt_tvb, 0, -1, FALSE);
else
if (found_match) {
proto_item *ti = proto_tree_add_item(key_tree, hf_key_mgmt_data,
keymgmt_tvb, 0, -1, FALSE);
PROTO_ITEM_SET_HIDDEN(ti);
}
else {
proto_tree_add_item(key_tree, hf_key_mgmt_data,
keymgmt_tvb, 0, -1, FALSE);
return;
keymgmt_tvb, 0, -1, FALSE);
}
}

View File

@ -452,8 +452,9 @@ dissect_zebra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_zebra, tvb, offset, -1,
FALSE);
zebra_tree = proto_item_add_subtree(ti, ett_zebra);
proto_tree_add_boolean_hidden(zebra_tree, hf_zebra_request,
ti = proto_tree_add_boolean(zebra_tree, hf_zebra_request,
tvb, offset, 0, request);
PROTO_ITEM_SET_HIDDEN(ti);
for (;;) {
guint8 command;