Fix some "proto_tree_add_text()" calls.

svn path=/trunk/; revision=1696
This commit is contained in:
Guy Harris 2000-03-07 05:28:39 +00:00
parent 8c200212c7
commit f249c7f2dc
6 changed files with 38 additions and 38 deletions

View File

@ -1,7 +1,7 @@
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
* $Id: packet-ip.c,v 1.74 2000/02/15 21:02:15 gram Exp $
* $Id: packet-ip.c,v 1.75 2000/03/07 05:24:12 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -425,7 +425,7 @@ dissect_ipopt_security(const ip_tcp_opt *optp, const u_char *opd, int offset,
val = pntohs(opd);
proto_tree_add_text(field_tree, offset, 2,
"Compartments: %d", val);
"Compartments: %u", val);
offset += 2;
opd += 2;
@ -448,7 +448,7 @@ dissect_ipopt_route(const ip_tcp_opt *optp, const u_char *opd, int offset,
int optoffset = 0;
struct in_addr addr;
tf = proto_tree_add_text(opt_tree, offset, optlen, "%s (%d bytes)",
tf = proto_tree_add_text(opt_tree, offset, optlen, "%s (%u bytes)",
optp->name, optlen);
field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
@ -721,7 +721,7 @@ dissect_ip_tcp_options(const u_char *opd, int offset, guint length,
return;
} else {
if (optp == NULL) {
proto_tree_add_text(opt_tree, offset, len, "%s (%d byte%s)",
proto_tree_add_text(opt_tree, offset, len, "%s (%u byte%s)",
name, len, plurality(len, "", "s"));
} else {
if (dissect != NULL) {
@ -984,7 +984,7 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
options. */
optlen = hlen - sizeof (e_ip); /* length of options, in bytes */
tf = proto_tree_add_text(ip_tree, offset + 20, optlen,
"Options: (%d bytes)", optlen);
"Options: (%u bytes)", optlen);
field_tree = proto_item_add_subtree(tf, ett_ip_options);
dissect_ip_tcp_options(&pd[offset + 20], offset + 20, optlen,
ipopts, N_IP_OPTS, IPOPT_END, field_tree);
@ -1007,7 +1007,7 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
if (check_col(fd, COL_PROTOCOL))
col_add_str(fd, COL_PROTOCOL, "IP");
if (check_col(fd, COL_INFO))
col_add_fstr(fd, COL_INFO, "Fragmented IP protocol (proto=%s 0x%02x, off=%d)",
col_add_fstr(fd, COL_INFO, "Fragmented IP protocol (proto=%s 0x%02x, off=%u)",
ipprotostr(iph.ip_p), iph.ip_p, iph.ip_off & IP_OFFSET);
dissect_data(pd, offset, fd, tree);
return;
@ -1203,11 +1203,11 @@ dissect_icmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
icmp_tree = proto_item_add_subtree(ti, ett_icmp);
proto_tree_add_item_format(icmp_tree, hf_icmp_type, offset, 1,
ih.icmp_type,
"Type: %d (%s)",
"Type: %u (%s)",
ih.icmp_type, type_str);
proto_tree_add_item_format(icmp_tree, hf_icmp_code, offset + 1, 1,
ih.icmp_code,
"Code: %d %s",
"Code: %u %s",
ih.icmp_code, code_str);
proto_tree_add_item(icmp_tree, hf_icmp_checksum, offset + 2, 2,
cksum);
@ -1286,7 +1286,7 @@ dissect_icmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
"Router address: %s",
ip_to_str((guint8 *)&pd[offset + 8 + (i*8)]));
proto_tree_add_text(icmp_tree, offset + 12 + (i*8), 4,
"Preference level: %d", pntohl(&pd[offset + 12 + (i*8)]));
"Preference level: %u", pntohl(&pd[offset + 12 + (i*8)]));
}
} else
dissect_data(pd, offset + 8, fd, icmp_tree);
@ -1364,7 +1364,7 @@ dissect_igmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
hi_nibble(ih.igmp_v_t));
proto_tree_add_item_format(igmp_tree, hf_igmp_type, offset , 1,
lo_nibble(ih.igmp_v_t),
"Type: %d (%s)",
"Type: %u (%s)",
lo_nibble(ih.igmp_v_t), type_str);
proto_tree_add_item_format(igmp_tree, hf_igmp_unused, offset + 1, 1,
ih.igmp_unused,
@ -1593,14 +1593,14 @@ static const value_string eigrp_opcode_vals[] = {
ti = proto_tree_add_item(tree, proto_eigrp, offset, END_OF_FRAME, NULL);
eigrp_tree = proto_item_add_subtree(ti, ett_eigrp);
proto_tree_add_text(eigrp_tree, offset, 1, "Version: %d", ih.eigrp_version);
proto_tree_add_text(eigrp_tree, offset + 1, 1, "Opcode: %d (%s)", ih.eigrp_opcode,
proto_tree_add_text(eigrp_tree, offset, 1, "Version: %u", ih.eigrp_version);
proto_tree_add_text(eigrp_tree, offset + 1, 1, "Opcode: %u (%s)", ih.eigrp_opcode,
val_to_str( ih.eigrp_opcode, eigrp_opcode_vals, "Unknown") );
proto_tree_add_text(eigrp_tree, offset + 2, 2, "Checksum: 0x%x", cksum);
proto_tree_add_text(eigrp_tree, offset + 4, 2, "Subnets in local net: %d", ih.eigrp_subnets);
proto_tree_add_text(eigrp_tree, offset + 4, 2, "Subnets in local net: %u", ih.eigrp_subnets);
proto_tree_add_text(eigrp_tree, offset + 6, 2, "Networks in Autonomous System: %d", ih.eigrp_networks);
proto_tree_add_text(eigrp_tree, offset + 8, 4, "Sequence Number: 0x%x", ih.eigrp_sequence);
proto_tree_add_text(eigrp_tree, offset + 12, 4, "Autonomous System number: %ld", ih.eigrp_asnumber);
proto_tree_add_text(eigrp_tree, offset + 12, 4, "Autonomous System number: %u", ih.eigrp_asnumber);
}
}

View File

@ -1,7 +1,7 @@
/* packet-ipv6.c
* Routines for IPv6 packet disassembly
*
* $Id: packet-ipv6.c,v 1.27 2000/02/15 21:02:21 gram Exp $
* $Id: packet-ipv6.c,v 1.28 2000/03/07 05:26:05 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -91,7 +91,7 @@ dissect_routing6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
if (tree) {
/* !!! specify length */
ti = proto_tree_add_text(tree, offset, len,
"Routing Header, Type %d", rt.ip6r_type);
"Routing Header, Type %u", rt.ip6r_type);
rthdr_tree = proto_item_add_subtree(ti, ett_ipv6);
proto_tree_add_text(rthdr_tree,
@ -99,13 +99,13 @@ dissect_routing6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
"Next header: %s (0x%02x)", ipprotostr(rt.ip6r_nxt), rt.ip6r_nxt);
proto_tree_add_text(rthdr_tree,
offset + offsetof(struct ip6_rthdr, ip6r_len), 1,
"Length: %d (%d bytes)", rt.ip6r_len, len);
"Length: %u (%d bytes)", rt.ip6r_len, len);
proto_tree_add_text(rthdr_tree,
offset + offsetof(struct ip6_rthdr, ip6r_type), 1,
"Type: %d", rt.ip6r_type, len);
"Type: %u", rt.ip6r_type);
proto_tree_add_text(rthdr_tree,
offset + offsetof(struct ip6_rthdr, ip6r_segleft), 1,
"Segments left: %d", rt.ip6r_segleft, len);
"Segments left: %u", rt.ip6r_segleft);
if (rt.ip6r_type == 0 && len <= sizeof(buf)) {
struct e_in6_addr *a;
@ -181,7 +181,7 @@ dissect_opts(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
"Next header: %s (0x%02x)", ipprotostr(ext.ip6e_nxt), ext.ip6e_nxt);
proto_tree_add_text(dstopt_tree,
offset + offsetof(struct ip6_ext, ip6e_len), 1,
"Length: %d (%d bytes)", ext.ip6e_len, len);
"Length: %u (%d bytes)", ext.ip6e_len, len);
p = (u_char *)(pd + offset + 2);
while (p < pd + offset + len) {
@ -193,18 +193,18 @@ dissect_opts(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
break;
case IP6OPT_PADN:
proto_tree_add_text(dstopt_tree, p - pd, p[1] + 2,
"PadN: %d bytes", p[1] + 2);
"PadN: %u bytes", p[1] + 2);
p += p[1];
p += 2;
break;
case IP6OPT_JUMBO:
if (p[1] == 4) {
proto_tree_add_text(dstopt_tree, p - pd, p[1] + 2,
"Jumbo payload: %u (%d bytes)",
"Jumbo payload: %u (%u bytes)",
pntohl(&p[2]), p[1] + 2);
} else {
proto_tree_add_text(dstopt_tree, p - pd, p[1] + 2,
"Jumbo payload: Invalid length (%d bytes)",
"Jumbo payload: Invalid length (%u bytes)",
p[1] + 2);
}
p += p[1];
@ -220,7 +220,7 @@ dissect_opts(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
} else
rta = "Invalid length";
ti = proto_tree_add_text(dstopt_tree, p - pd, p[1] + 2,
"Router alert: %s (%d bytes)", rta, p[1] + 2);
"Router alert: %s (%u bytes)", rta, p[1] + 2);
p += p[1];
p += 2;
break;

View File

@ -5,7 +5,7 @@
*
* derived from the packet-nbns.c
*
* $Id: packet-netbios.c,v 1.16 2000/02/16 00:44:45 sharpe Exp $
* $Id: packet-netbios.c,v 1.17 2000/03/07 05:20:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -754,7 +754,7 @@ static void dissect_netb_status_resp(const u_char *pd, int offset,
status_response);
}
data2 = pletohs(&pd[offset + NB_DATA2]);
td2 = proto_tree_add_text(tree, offset + NB_DATA2, 2, "Status: 0x04x",
td2 = proto_tree_add_text(tree, offset + NB_DATA2, 2, "Status: 0x%04x",
data2);
data2_tree = proto_item_add_subtree(td2, ett_netb_status);
if (data2 & 0x8000) {

View File

@ -2,7 +2,7 @@
* Routines for nfs dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
* $Id: packet-nfs.c,v 1.21 2000/01/26 09:52:42 girlich Exp $
* $Id: packet-nfs.c,v 1.22 2000/03/07 05:22:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -1783,7 +1783,7 @@ dissect_set_atime(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
if (tree) {
set_atime_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s: %s",
name, set_it_name, set_it);
name, set_it_name);
if (set_atime_item)
set_atime_tree = proto_item_add_subtree(set_atime_item, ett_nfs_set_atime);
}
@ -1831,7 +1831,7 @@ dissect_set_mtime(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
if (tree) {
set_mtime_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s: %s",
name, set_it_name, set_it);
name, set_it_name);
if (set_mtime_item)
set_mtime_tree = proto_item_add_subtree(set_mtime_item, ett_nfs_set_mtime);
}

View File

@ -2,7 +2,7 @@
* Routines for OSPF packet disassembly
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
* $Id: packet-ospf.c,v 1.18 2000/02/11 22:35:49 guy Exp $
* $Id: packet-ospf.c,v 1.19 2000/03/07 05:21:54 guy Exp $
*
* At this time, this module is able to analyze OSPF
* packets as specified in RFC2328. MOSPF (RFC1584) and other
@ -132,8 +132,8 @@ dissect_ospf(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
crypto->key_id);
proto_tree_add_text(ospf_header_tree, offset + 19 , 1, "Auth Data Length: %d",
crypto->length);
proto_tree_add_text(ospf_header_tree, offset + 20 , 4, "Auth Crypto Sequence Number: 0x%x",
ntohl(crypto->sequence_num));
proto_tree_add_text(ospf_header_tree, offset + 20 , 4, "Auth Crypto Sequence Number: 0x%lx",
(unsigned long)ntohl(crypto->sequence_num));
ospflen = ntohs(ospfh.length);
for (i = 0; i < crypto->length && i < (sizeof(auth_data)/2); i++)

View File

@ -3,7 +3,7 @@
* (c) Copyright Jun-ichiro itojun Hagino <itojun@itojun.org>
* derived from packet-rip.c
*
* $Id: packet-ripng.c,v 1.6 1999/11/16 11:42:51 guy Exp $
* $Id: packet-ripng.c,v 1.7 2000/03/07 05:28:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -71,7 +71,7 @@ dissect_ripng(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
cmd = val_to_str(rip6.rip6_cmd, cmdvals, "Unknown");
if (check_col(fd, COL_PROTOCOL))
col_add_fstr(fd, COL_PROTOCOL, "RIPng version %d", rip6.rip6_vers);
col_add_fstr(fd, COL_PROTOCOL, "RIPng version %u", rip6.rip6_vers);
if (check_col(fd, COL_INFO))
col_add_fstr(fd, COL_INFO, "%s", cmd);
@ -90,14 +90,14 @@ dissect_ripng(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
memcpy(&ni6, &pd[offset], sizeof(ni6));
if (ni6.rip6_tag) {
ti = proto_tree_add_text(ripng_tree, offset,
sizeof(ni6), "IP Address: %s/%d, Metric: %ld, tag: 0x%04x",
sizeof(ni6), "IP Address: %s/%u, Metric: %u, tag: 0x%04x",
ip6_to_str(&ni6.rip6_dest),
ni6.rip6_plen,
ni6.rip6_metric,
ntohs(ni6.rip6_tag));
} else {
ti = proto_tree_add_text(ripng_tree, offset,
sizeof(ni6), "IP Address: %s/%d, Metric: %ld",
sizeof(ni6), "IP Address: %s/%u, Metric: %u",
ip6_to_str(&ni6.rip6_dest),
ni6.rip6_plen,
ni6.rip6_metric);
@ -113,11 +113,11 @@ dissect_ripng(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
ntohs(ni6.rip6_tag));
proto_tree_add_text(subtree,
offset + offsetof(struct netinfo6, rip6_plen),
sizeof(ni6.rip6_plen), "Prefix length: %d",
sizeof(ni6.rip6_plen), "Prefix length: %u",
ni6.rip6_plen);
proto_tree_add_text(subtree,
offset + offsetof(struct netinfo6, rip6_metric),
sizeof(ni6.rip6_metric), "Metric: %d",
sizeof(ni6.rip6_metric), "Metric: %u",
ni6.rip6_metric);
offset += sizeof(ni6);