From 283ce59938ad2be252a6232e40a958e177a40e1a Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 31 May 2000 05:09:07 +0000 Subject: [PATCH] Add routines for adding items to a protocol tree that take arguments of a particular type, rather than taking a varargs list, along the lines of the "proto_tree_add_XXX_format()" routines. Replace most calls to "proto_tree_add_item()" and "proto_tree_add_item_hidden()" with calls to those routines. Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to "proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()" routines that don't take the item to be added as an argument - instead, they fetch the argument from the packet whose tvbuff was handed to them, from the offset handed to them. svn path=/trunk/; revision=2031 --- packet-aarp.c | 12 +- packet-afs.c | 71 ++- packet-arp.c | 34 +- packet-ascend.c | 18 +- packet-atalk.c | 58 +-- packet-atm.c | 6 +- packet-auto_rp.c | 12 +- packet-bootp.c | 28 +- packet-bootparams.c | 9 +- packet-bpdu.c | 22 +- packet-cdp.c | 34 +- packet-cgmp.c | 14 +- packet-clnp.c | 38 +- packet-ddtp.c | 18 +- packet-dns.c | 16 +- packet-eigrp.c | 4 +- packet-esis.c | 12 +- packet-eth.c | 22 +- packet-ethertype.c | 4 +- packet-fddi.c | 20 +- packet-ftp.c | 12 +- packet-giop.c | 6 +- packet-gre.c | 4 +- packet-h1.c | 36 +- packet-hsrp.c | 4 +- packet-http.c | 8 +- packet-icmpv6.c | 6 +- packet-icp.c | 5 +- packet-imap.c | 8 +- packet-ip.c | 54 +- packet-ipp.c | 4 +- packet-ipsec.c | 20 +- packet-ipv6.c | 14 +- packet-ipx.c | 46 +- packet-irc.c | 8 +- packet-isakmp.c | 4 +- packet-isis-clv.c | 4 +- packet-isis-hello.c | 10 +- packet-isis-lsp.c | 12 +- packet-isis-snp.c | 10 +- packet-isis.c | 18 +- packet-isl.c | 40 +- packet-l2tp.c | 4 +- packet-lapd.c | 16 +- packet-ldap.c | 78 ++- packet-llc.c | 22 +- packet-lpd.c | 8 +- packet-mapi.c | 8 +- packet-mip.c | 42 +- packet-mount.c | 52 +- packet-mpls.c | 12 +- packet-msproxy.c | 91 ++-- packet-nbipx.c | 8 +- packet-nbns.c | 30 +- packet-ncp.c | 14 +- packet-netbios.c | 6 +- packet-nfs.c | 80 +-- packet-nntp.c | 8 +- packet-ntp.c | 10 +- packet-null.c | 8 +- packet-ospf.c | 4 +- packet-pim.c | 8 +- packet-pop.c | 8 +- packet-portmap.c | 32 +- packet-ppp.c | 12 +- packet-q2931.c | 20 +- packet-q931.c | 12 +- packet-radius.c | 4 +- packet-rip.c | 4 +- packet-ripng.c | 6 +- packet-rlogin.c | 16 +- packet-rpc.c | 62 +-- packet-rsvp.c | 32 +- packet-rtcp.c | 4 +- packet-rtp.c | 4 +- packet-rtsp.c | 10 +- packet-rx.c | 34 +- packet-sap.c | 28 +- packet-sdp.c | 4 +- packet-smb-browse.c | 4 +- packet-smb-logon.c | 4 +- packet-smb-mailslot.c | 4 +- packet-smb-pipe.c | 16 +- packet-smb.c | 4 +- packet-sna.c | 184 +++---- packet-snmp.c | 12 +- packet-socks.c | 34 +- packet-srvloc.c | 20 +- packet-tacacs.c | 18 +- packet-tcp.c | 28 +- packet-telnet.c | 4 +- packet-tftp.c | 8 +- packet-time.c | 4 +- packet-tns.c | 30 +- packet-tr.c | 48 +- packet-trmac.c | 38 +- packet-udp.c | 10 +- packet-vlan.c | 10 +- packet-vrrp.c | 8 +- packet-vtp.c | 48 +- packet-wccp.c | 24 +- packet-who.c | 30 +- packet-x25.c | 88 ++-- packet-yhoo.c | 24 +- packet-ypserv.c | 8 +- packet.c | 8 +- plugins/gryphon/packet-gryphon.c | 16 +- proto.c | 833 +++++++++++++++++++++++++------ proto.h | 134 ++++- 109 files changed, 1980 insertions(+), 1307 deletions(-) diff --git a/packet-aarp.c b/packet-aarp.c index 0f4dab66a8..a4c0c43811 100644 --- a/packet-aarp.c +++ b/packet-aarp.c @@ -1,7 +1,7 @@ /* packet-aarp.c * Routines for Appletalk ARP packet disassembly * - * $Id: packet-aarp.c,v 1.19 2000/05/11 08:14:49 gram Exp $ + * $Id: packet-aarp.c,v 1.20 2000/05/31 05:06:48 guy Exp $ * * Simon Wilkinson * @@ -200,15 +200,15 @@ dissect_aarp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { 2*ar_pln, "AppleTalk Address Resolution Protocol (opcode 0x%04x)", ar_op); aarp_tree = proto_item_add_subtree(ti, ett_aarp); - proto_tree_add_item(aarp_tree, hf_aarp_hard_type, NullTVB, offset + AR_HRD, 2, + proto_tree_add_uint(aarp_tree, hf_aarp_hard_type, NullTVB, offset + AR_HRD, 2, ar_hrd); - proto_tree_add_item(aarp_tree, hf_aarp_proto_type, NullTVB, offset + AR_PRO, 2, + proto_tree_add_uint(aarp_tree, hf_aarp_proto_type, NullTVB, offset + AR_PRO, 2, ar_pro); - proto_tree_add_item(aarp_tree, hf_aarp_hard_size, NullTVB, offset + AR_HLN, 1, + proto_tree_add_uint(aarp_tree, hf_aarp_hard_size, NullTVB, offset + AR_HLN, 1, ar_hln); - proto_tree_add_item(aarp_tree, hf_aarp_proto_size, NullTVB, offset + AR_PLN, 1, + proto_tree_add_uint(aarp_tree, hf_aarp_proto_size, NullTVB, offset + AR_PLN, 1, ar_pln); - proto_tree_add_item(aarp_tree, hf_aarp_opcode, NullTVB, offset + AR_OP, 2, + proto_tree_add_uint(aarp_tree, hf_aarp_opcode, NullTVB, offset + AR_OP, 2, ar_op); proto_tree_add_bytes_format(aarp_tree, hf_aarp_src_ether, NullTVB, sha_offset, ar_hln, &pd[sha_offset], diff --git a/packet-afs.c b/packet-afs.c index 0fe12a4e5a..fa907ff7de 100644 --- a/packet-afs.c +++ b/packet-afs.c @@ -1,12 +1,12 @@ -/* packet-rx.c - * Routines for RX packet dissection +/* packet-afs.c + * Routines for AFS packet dissection * Copyright 1999, Nathan Neulinger * Based on routines from tcpdump patches by * Ken Hornstein * Portions based on information retrieved from the RX definitions * in Arla, the free AFS client at http://www.stacken.kth.se/project/arla/ * - * $Id: packet-afs.c,v 1.10 2000/05/11 08:14:49 gram Exp $ + * $Id: packet-afs.c,v 1.11 2000/05/31 05:06:48 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -886,7 +886,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - ti = proto_tree_add_item(tree, proto_afs, NullTVB, doffset, END_OF_FRAME); + ti = proto_tree_add_item(tree, proto_afs, NullTVB, doffset, END_OF_FRAME, FALSE); afs_tree = proto_item_add_subtree(ti, ett_afs); if ( !BYTES_ARE_IN_FRAME(offset, sizeof(struct rx_header) + @@ -910,13 +910,13 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) ti = NULL; if ( !reply && node != 0 ) { - ti = proto_tree_add_item(afs_tree, + ti = proto_tree_add_uint(afs_tree, node, NullTVB, doffset, 4, opcode); } else if ( reply && node != 0 ) { /* the opcode isn't in this packet */ - ti = proto_tree_add_item(afs_tree, + ti = proto_tree_add_uint(afs_tree, node, NullTVB, doffset, 0, opcode); } else @@ -931,7 +931,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if ( typenode != 0 ) { /* indicate the type of request */ - proto_tree_add_item_hidden(afs_tree, typenode, NullTVB, doffset, 0, 1); + proto_tree_add_boolean_hidden(afs_tree, typenode, NullTVB, doffset, 0, 1); } /* Process the packet according to what service it is */ @@ -972,34 +972,33 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) Assumes it is in network byte order, converts to host before using */ #define UINTOUT(field) \ TRUNC(sizeof(guint32)) \ - proto_tree_add_item(tree,field, NullTVB,curoffset,sizeof(guint32), GETINT()); \ + proto_tree_add_uint(tree,field, NullTVB,curoffset,sizeof(guint32), GETINT()); \ curoffset += 4; -/* Output a unsigned integer, stored into field 'field' - Assumes it is in network byte order, converts to host before using */ +/* Output an IPv4 address, stored into field 'field' */ #define IPOUT(field) \ TRUNC(sizeof(gint32)) \ - proto_tree_add_item(tree,field, NullTVB,curoffset,sizeof(gint32),\ + proto_tree_add_ipv4(tree,field, NullTVB,curoffset,sizeof(gint32),\ *((int*)&pd[curoffset]));\ curoffset += 4; -/* Output a unix timestamp, after converting to a timeval */ +/* Output a UNIX seconds/microseconds timestamp, after converting to a timeval */ #define BIGDATEOUT(field) \ { struct timeval tv; \ TRUNC(2*sizeof(guint32)); \ tv.tv_sec = GETINT(); \ tv.tv_usec = GETINT(); \ - proto_tree_add_item(tree,field, NullTVB,curoffset,2*sizeof(guint32),&tv); \ + proto_tree_add_time(tree,field, NullTVB,curoffset,2*sizeof(guint32),&tv); \ curoffset += 8; \ } -/* Output a unix timestamp, after converting to a timeval */ +/* Output a UNIX seconds-only timestamp, after converting to a timeval */ #define DATEOUT(field) \ { struct timeval tv; \ TRUNC(sizeof(guint32)); \ tv.tv_sec = GETINT(); \ tv.tv_usec = 0; \ - proto_tree_add_item(tree,field, NullTVB,curoffset,sizeof(guint32),&tv); \ + proto_tree_add_time(tree,field, NullTVB,curoffset,sizeof(guint32),&tv); \ curoffset += 4; \ } @@ -1075,16 +1074,16 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) who, tmp, positive ? "" : " (negative)"); \ save = tree; \ tree = proto_item_add_subtree(ti, ett_afs_acl); \ - proto_tree_add_item(tree,hf_afs_fs_acl_entity, NullTVB,curoffset,strlen(who), who);\ + proto_tree_add_string(tree,hf_afs_fs_acl_entity, NullTVB,curoffset,strlen(who), who);\ tmpoffset = curoffset + strlen(who) + 1; \ acllen = bytes - strlen(who) - 1; \ - proto_tree_add_item(tree,hf_afs_fs_acl_r, NullTVB,tmpoffset,acllen,acl);\ - proto_tree_add_item(tree,hf_afs_fs_acl_l, NullTVB,tmpoffset,acllen,acl);\ - proto_tree_add_item(tree,hf_afs_fs_acl_i, NullTVB,tmpoffset,acllen,acl);\ - proto_tree_add_item(tree,hf_afs_fs_acl_d, NullTVB,tmpoffset,acllen,acl);\ - proto_tree_add_item(tree,hf_afs_fs_acl_w, NullTVB,tmpoffset,acllen,acl);\ - proto_tree_add_item(tree,hf_afs_fs_acl_k, NullTVB,tmpoffset,acllen,acl);\ - proto_tree_add_item(tree,hf_afs_fs_acl_a, NullTVB,tmpoffset,acllen,acl);\ + proto_tree_add_uint(tree,hf_afs_fs_acl_r, NullTVB,tmpoffset,acllen,acl);\ + proto_tree_add_uint(tree,hf_afs_fs_acl_l, NullTVB,tmpoffset,acllen,acl);\ + proto_tree_add_uint(tree,hf_afs_fs_acl_i, NullTVB,tmpoffset,acllen,acl);\ + proto_tree_add_uint(tree,hf_afs_fs_acl_d, NullTVB,tmpoffset,acllen,acl);\ + proto_tree_add_uint(tree,hf_afs_fs_acl_w, NullTVB,tmpoffset,acllen,acl);\ + proto_tree_add_uint(tree,hf_afs_fs_acl_k, NullTVB,tmpoffset,acllen,acl);\ + proto_tree_add_uint(tree,hf_afs_fs_acl_a, NullTVB,tmpoffset,acllen,acl);\ tree = save; \ } @@ -1099,7 +1098,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) /* Raw data */ #define BYTESOUT(field, bytes) \ TRUNC(bytes); \ - proto_tree_add_item(tree,field, NullTVB,curoffset,bytes,\ + proto_tree_add_bytes(tree,field, NullTVB,curoffset,bytes,\ (void *)&pd[curoffset]); \ curoffset += bytes; @@ -1112,10 +1111,10 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) curoffset += 4; \ TRUNC(i); \ if ( i > 0 ) { \ - proto_tree_add_item(tree, field, NullTVB, curoffset-4, i+4, \ + proto_tree_add_string(tree, field, NullTVB, curoffset-4, i+4, \ (void *)&pd[curoffset]); \ } else { \ - proto_tree_add_item(tree, field, NullTVB, curoffset-4, 4, \ + proto_tree_add_string(tree, field, NullTVB, curoffset-4, 4, \ ""); \ } \ curoffset += i; \ @@ -1133,7 +1132,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) curoffset += sizeof(guint32);\ }\ tmp[length] = '\0';\ - proto_tree_add_item(tree, field, NullTVB, soff, length, tmp);\ + proto_tree_add_string(tree, field, NullTVB, soff, length, tmp);\ } /* Output a UBIK version code */ @@ -1152,9 +1151,9 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) "UBIK Version (%s): %u.%u", label, epoch, counter ); \ save = tree; \ tree = proto_item_add_subtree(ti, ett_afs_ubikver); \ - proto_tree_add_item(tree,hf_afs_ubik_version_epoch, NullTVB,curoffset-8, \ + proto_tree_add_time(tree,hf_afs_ubik_version_epoch, NullTVB,curoffset-8, \ sizeof(guint32),&tv); \ - proto_tree_add_item(tree,hf_afs_ubik_version_counter, NullTVB,curoffset-4, \ + proto_tree_add_uint(tree,hf_afs_ubik_version_counter, NullTVB,curoffset-4, \ sizeof(guint32),counter); \ tree = save; \ } @@ -1203,14 +1202,14 @@ static void dissect_acl(const u_char *pd, int offset, frame_data *fd, proto_tree return; s += n; TRUNC(1); - proto_tree_add_item(tree, hf_afs_fs_acl_count_positive, NullTVB, curoffset, n, pos); + proto_tree_add_uint(tree, hf_afs_fs_acl_count_positive, NullTVB, curoffset, n, pos); curoffset += n; if (sscanf((char *) s, "%d %n", &neg, &n) != 1) return; s += n; TRUNC(1); - proto_tree_add_item(tree, hf_afs_fs_acl_count_negative, NullTVB, curoffset, n, neg); + proto_tree_add_uint(tree, hf_afs_fs_acl_count_negative, NullTVB, curoffset, n, neg); curoffset += n; @@ -1887,7 +1886,7 @@ dissect_vldb_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tre if ( i @@ -285,9 +285,9 @@ dissect_atm_number(const u_char *pd, int offset, int tl, int hf_e164, proto_tree *nsap_tree; if (tl & ATMARP_IS_E164) - proto_tree_add_item(tree, hf_e164, NullTVB, offset, len, &pd[offset]); + proto_tree_add_string(tree, hf_e164, NullTVB, offset, len, &pd[offset]); else { - ti = proto_tree_add_item(tree, hf_nsap, NullTVB, offset, len, + ti = proto_tree_add_bytes(tree, hf_nsap, NullTVB, offset, len, &pd[offset]); if (len >= 20) { nsap_tree = proto_item_add_subtree(ti, ett_atmarp_nsap); @@ -503,23 +503,23 @@ dissect_atmarp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) ti = proto_tree_add_protocol_format(tree, proto_arp, NullTVB, offset, tot_len, "ATM Address Resolution Protocol (opcode 0x%04x)", ar_op); arp_tree = proto_item_add_subtree(ti, ett_arp); - proto_tree_add_item(arp_tree, hf_arp_hard_type, NullTVB, offset + ATM_AR_HRD, 2, + proto_tree_add_uint(arp_tree, hf_arp_hard_type, NullTVB, offset + ATM_AR_HRD, 2, ar_hrd); - proto_tree_add_item(arp_tree, hf_arp_proto_type, NullTVB, offset + ATM_AR_PRO, 2, + proto_tree_add_uint(arp_tree, hf_arp_proto_type, NullTVB, offset + ATM_AR_PRO, 2, ar_pro); - proto_tree_add_item(arp_tree, hf_atmarp_shtl, NullTVB, offset + ATM_AR_SHTL, 1, + proto_tree_add_uint(arp_tree, hf_atmarp_shtl, NullTVB, offset + ATM_AR_SHTL, 1, ar_shtl); - proto_tree_add_item(arp_tree, hf_atmarp_ssl, NullTVB, offset + ATM_AR_SSL, 1, + proto_tree_add_uint(arp_tree, hf_atmarp_ssl, NullTVB, offset + ATM_AR_SSL, 1, ar_ssl); - proto_tree_add_item(arp_tree, hf_arp_opcode, NullTVB, offset + AR_OP, 2, + proto_tree_add_uint(arp_tree, hf_arp_opcode, NullTVB, offset + AR_OP, 2, ar_op); - proto_tree_add_item(arp_tree, hf_atmarp_spln, NullTVB, offset + ATM_AR_SPLN, 1, + proto_tree_add_uint(arp_tree, hf_atmarp_spln, NullTVB, offset + ATM_AR_SPLN, 1, ar_spln); - proto_tree_add_item(arp_tree, hf_atmarp_thtl, NullTVB, offset + ATM_AR_THTL, 1, + proto_tree_add_uint(arp_tree, hf_atmarp_thtl, NullTVB, offset + ATM_AR_THTL, 1, ar_thtl); - proto_tree_add_item(arp_tree, hf_atmarp_tsl, NullTVB, offset + ATM_AR_TSL, 1, + proto_tree_add_uint(arp_tree, hf_atmarp_tsl, NullTVB, offset + ATM_AR_TSL, 1, ar_tsl); - proto_tree_add_item(arp_tree, hf_atmarp_tpln, NullTVB, offset + ATM_AR_TPLN, 1, + proto_tree_add_uint(arp_tree, hf_atmarp_tpln, NullTVB, offset + ATM_AR_TPLN, 1, ar_tpln); if (ar_shl != 0) dissect_atm_number(pd, sha_offset, ar_shtl, hf_atmarp_src_atm_num_e164, @@ -645,15 +645,15 @@ dissect_arp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) ti = proto_tree_add_protocol_format(tree, proto_arp, NullTVB, offset, tot_len, "Address Resolution Protocol (opcode 0x%04x)", ar_op); arp_tree = proto_item_add_subtree(ti, ett_arp); - proto_tree_add_item(arp_tree, hf_arp_hard_type, NullTVB, offset + AR_HRD, 2, + proto_tree_add_uint(arp_tree, hf_arp_hard_type, NullTVB, offset + AR_HRD, 2, ar_hrd); - proto_tree_add_item(arp_tree, hf_arp_proto_type, NullTVB, offset + AR_PRO, 2, + proto_tree_add_uint(arp_tree, hf_arp_proto_type, NullTVB, offset + AR_PRO, 2, ar_pro); - proto_tree_add_item(arp_tree, hf_arp_hard_size, NullTVB, offset + AR_HLN, 1, + proto_tree_add_uint(arp_tree, hf_arp_hard_size, NullTVB, offset + AR_HLN, 1, ar_hln); - proto_tree_add_item(arp_tree, hf_arp_proto_size, NullTVB, offset + AR_PLN, 1, + proto_tree_add_uint(arp_tree, hf_arp_proto_size, NullTVB, offset + AR_PLN, 1, ar_pln); - proto_tree_add_item(arp_tree, hf_arp_opcode, NullTVB, offset + AR_OP, 2, + proto_tree_add_uint(arp_tree, hf_arp_opcode, NullTVB, offset + AR_OP, 2, ar_op); if (ar_hln != 0) proto_tree_add_bytes_format(arp_tree, hf_arp_src_ether, NullTVB, sha_offset, ar_hln, diff --git a/packet-ascend.c b/packet-ascend.c index c4561532ba..c2e6de836f 100644 --- a/packet-ascend.c +++ b/packet-ascend.c @@ -1,7 +1,7 @@ /* packet-ascend.c * Routines for decoding Lucent/Ascend packet traces * - * $Id: packet-ascend.c,v 1.15 2000/05/25 07:42:24 gram Exp $ + * $Id: packet-ascend.c,v 1.16 2000/05/31 05:06:51 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -77,22 +77,22 @@ dissect_ascend(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(tree) { ti = proto_tree_add_text(tree, tvb, 0, 0, "Lucent/Ascend packet trace" ); fh_tree = proto_item_add_subtree(ti, ett_raw); - proto_tree_add_item(fh_tree, hf_link_type, tvb, 0, 0, + proto_tree_add_uint(fh_tree, hf_link_type, tvb, 0, 0, pseudo_header->ascend.type); if (pseudo_header->ascend.type == ASCEND_PFX_WDD) { - proto_tree_add_item(fh_tree, hf_called_number, tvb, 0, 0, + proto_tree_add_string(fh_tree, hf_called_number, tvb, 0, 0, pseudo_header->ascend.call_num); - proto_tree_add_item(fh_tree, hf_chunk, tvb, 0, 0, + proto_tree_add_uint(fh_tree, hf_chunk, tvb, 0, 0, pseudo_header->ascend.chunk); - proto_tree_add_item_hidden(fh_tree, hf_session_id, tvb, 0, 0, 0); + proto_tree_add_uint_hidden(fh_tree, hf_session_id, tvb, 0, 0, 0); } else { /* It's wandsession data */ - proto_tree_add_item(fh_tree, hf_user_name, tvb, 0, 0, + proto_tree_add_string(fh_tree, hf_user_name, tvb, 0, 0, pseudo_header->ascend.user); - proto_tree_add_item(fh_tree, hf_session_id, tvb, 0, 0, + proto_tree_add_uint(fh_tree, hf_session_id, tvb, 0, 0, pseudo_header->ascend.sess); - proto_tree_add_item_hidden(fh_tree, hf_chunk, tvb, 0, 0, 0); + proto_tree_add_uint_hidden(fh_tree, hf_chunk, tvb, 0, 0, 0); } - proto_tree_add_item(fh_tree, hf_task, tvb, 0, 0, pseudo_header->ascend.task); + proto_tree_add_uint(fh_tree, hf_task, tvb, 0, 0, pseudo_header->ascend.task); } switch (pseudo_header->ascend.type) { diff --git a/packet-atalk.c b/packet-atalk.c index f82e58f004..56b1b6ccdb 100644 --- a/packet-atalk.c +++ b/packet-atalk.c @@ -1,7 +1,7 @@ /* packet-atalk.c * Routines for Appletalk packet disassembly (DDP, currently). * - * $Id: packet-atalk.c,v 1.37 2000/05/30 03:35:51 guy Exp $ + * $Id: packet-atalk.c,v 1.38 2000/05/31 05:06:51 guy Exp $ * * Simon Wilkinson * @@ -168,7 +168,7 @@ int dissect_pascal_string(const u_char *pd, int offset, frame_data *fd, tmp = g_malloc( len+1 ); memcpy(tmp, &pd[offset], len); tmp[len] = 0; - item = proto_tree_add_item(tree, hf_index, NullTVB, offset-1, len+1, tmp); + item = proto_tree_add_string(tree, hf_index, NullTVB, offset-1, len+1, tmp); subtree = proto_item_add_subtree(item, ett_pstring); proto_tree_add_text(subtree, NullTVB, offset-1, 1, "Length: %d", len); @@ -219,12 +219,12 @@ dissect_rtmp_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree net, nodelen_bits, node); if (tree) { - ti = proto_tree_add_item(tree, proto_rtmp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_rtmp, NullTVB, offset, END_OF_FRAME, FALSE); rtmp_tree = proto_item_add_subtree(ti, ett_rtmp); - proto_tree_add_item(rtmp_tree, hf_rtmp_net, NullTVB, offset, 2, net); - proto_tree_add_item(rtmp_tree, hf_rtmp_node_len, NullTVB, offset+2, 1, nodelen_bits); - proto_tree_add_item(rtmp_tree, hf_rtmp_node, NullTVB, offset+3, nodelen, nodelen); + proto_tree_add_uint(rtmp_tree, hf_rtmp_net, NullTVB, offset, 2, net); + proto_tree_add_uint(rtmp_tree, hf_rtmp_node_len, NullTVB, offset+2, 1, nodelen_bits); + proto_tree_add_uint(rtmp_tree, hf_rtmp_node, NullTVB, offset+3, nodelen, nodelen); offset += 3 + nodelen; i = 1; @@ -248,9 +248,9 @@ dissect_rtmp_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree i, tuple_net, tuple_dist); tuple_tree = proto_item_add_subtree(tuple_item, ett_rtmp_tuple); - proto_tree_add_item(tuple_tree, hf_rtmp_tuple_net, NullTVB, offset, 2, + proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_net, NullTVB, offset, 2, tuple_net); - proto_tree_add_item(tuple_tree, hf_rtmp_tuple_dist, NullTVB, offset+2, 1, + proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_dist, NullTVB, offset+2, 1, tuple_dist); if ( tuple_dist == 0 || tuple_dist & 0x80 ) /* phase 1/2 */ @@ -264,9 +264,9 @@ dissect_rtmp_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree tuple_net2 = pntohs(&pd[offset+3]); tuple_dist2 = pd[offset+5]; - proto_tree_add_item(tuple_tree, hf_rtmp_tuple_net, NullTVB, offset, 2, + proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_net, NullTVB, offset, 2, tuple_net2); - proto_tree_add_item(tuple_tree, hf_rtmp_tuple_dist, NullTVB, offset+2, 1, + proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_dist, NullTVB, offset+2, 1, tuple_dist2); proto_item_set_len(tuple_item, 6); @@ -308,7 +308,7 @@ dissect_nbp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { val_to_str(op, nbp_op_vals, "unknown (%1x)"), count); if (tree) { - ti = proto_tree_add_item(tree, proto_nbp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_nbp, NullTVB, offset, END_OF_FRAME, FALSE); nbp_tree = proto_item_add_subtree(ti, ett_nbp); info_item = proto_tree_add_uint_format(nbp_tree, hf_nbp_info, NullTVB, offset, 1, @@ -317,9 +317,9 @@ dissect_nbp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { val_to_str(op, nbp_op_vals, "unknown"), count); nbp_info_tree = proto_item_add_subtree(info_item, ett_nbp_info); - proto_tree_add_item(nbp_info_tree, hf_nbp_op, NullTVB, offset, 1, pd[offset]); - proto_tree_add_item(nbp_info_tree, hf_nbp_count, NullTVB, offset, 1, pd[offset]); - proto_tree_add_item(nbp_tree, hf_nbp_tid, NullTVB, offset+1, 1, pd[offset+1]); + proto_tree_add_uint(nbp_info_tree, hf_nbp_op, NullTVB, offset, 1, pd[offset]); + proto_tree_add_uint(nbp_info_tree, hf_nbp_count, NullTVB, offset, 1, pd[offset]); + proto_tree_add_uint(nbp_tree, hf_nbp_tid, NullTVB, offset+1, 1, pd[offset+1]); offset += 2; for (i=0; i @@ -668,9 +668,9 @@ dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; } } - proto_tree_add_item(atm_tree, hf_atm_vpi, tvb, 0, 0, + proto_tree_add_uint(atm_tree, hf_atm_vpi, tvb, 0, 0, pinfo->pseudo_header->ngsniffer_atm.Vpi); - proto_tree_add_item(atm_tree, hf_atm_vci, tvb, 0, 0, + proto_tree_add_uint(atm_tree, hf_atm_vci, tvb, 0, 0, pinfo->pseudo_header->ngsniffer_atm.Vci); switch (pinfo->pseudo_header->ngsniffer_atm.channel) { diff --git a/packet-auto_rp.c b/packet-auto_rp.c index 91065a327f..dee0db1ec4 100644 --- a/packet-auto_rp.c +++ b/packet-auto_rp.c @@ -4,7 +4,7 @@ * * Heikki Vatiainen * - * $Id: packet-auto_rp.c,v 1.5 2000/05/11 08:14:57 gram Exp $ + * $Id: packet-auto_rp.c,v 1.6 2000/05/31 05:06:53 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -151,7 +151,7 @@ static void dissect_auto_rp(const u_char *pd, int offset, frame_data *fd, proto_ return; } - ti = proto_tree_add_item(tree, proto_auto_rp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_auto_rp, NullTVB, offset, END_OF_FRAME, FALSE); auto_rp_tree = proto_item_add_subtree(ti, ett_auto_rp); tv = proto_tree_add_uint_format(auto_rp_tree, hf_auto_rp_ver_type, NullTVB, offset, 1, @@ -159,8 +159,8 @@ static void dissect_auto_rp(const u_char *pd, int offset, frame_data *fd, proto_ val_to_str(hi_nibble(arh.ver_type), auto_rp_ver_vals, "Unknown"), val_to_str(lo_nibble(arh.ver_type), auto_rp_type_vals, "Unknown")); ver_type_tree = proto_item_add_subtree(tv, ett_auto_rp_ver_type); - proto_tree_add_item(ver_type_tree, hf_auto_rp_version, NullTVB, offset, 1, arh.ver_type); - proto_tree_add_item(ver_type_tree, hf_auto_rp_type, NullTVB, offset, 1, arh.ver_type); + proto_tree_add_uint(ver_type_tree, hf_auto_rp_version, NullTVB, offset, 1, arh.ver_type); + proto_tree_add_uint(ver_type_tree, hf_auto_rp_type, NullTVB, offset, 1, arh.ver_type); offset++; proto_tree_add_text(auto_rp_tree, NullTVB, offset++, 1, "RP Count: %u", arh.rp_count); @@ -270,7 +270,7 @@ static int do_auto_rp_map(const u_char *pd, int offset, frame_data *fd, proto_tr proto_tree_add_text(map_tree, NullTVB, offset, 4, "Unicast IP address of this RP: %s (%s)", ip_to_str((void *)&m.rp_address), get_hostname(m.rp_address)); offset +=4; - proto_tree_add_item(map_tree, hf_auto_rp_pim_ver, NullTVB, offset, 1, pd[offset]); + proto_tree_add_uint(map_tree, hf_auto_rp_pim_ver, NullTVB, offset, 1, pd[offset]); offset++; proto_tree_add_text(map_tree, NullTVB, offset, 1, "Number of groups this RP maps to: %u", m.group_count); offset++; @@ -287,7 +287,7 @@ static int do_auto_rp_map(const u_char *pd, int offset, frame_data *fd, proto_tr val_to_str(pd[offset]&AUTO_RP_SIGN_MASK, auto_rp_mask_sign_vals, "")); grp_tree = proto_item_add_subtree(gi, ett_auto_rp_group); - proto_tree_add_item(grp_tree, hf_auto_rp_mask_sgn, NullTVB, offset, 1, pd[offset]); + proto_tree_add_uint(grp_tree, hf_auto_rp_mask_sgn, NullTVB, offset, 1, pd[offset]); offset++; proto_tree_add_text(grp_tree, NullTVB, offset, 1, "Group mask length: %u", pd[offset]); offset++; diff --git a/packet-bootp.c b/packet-bootp.c index 4a275ebbf2..680abe0376 100644 --- a/packet-bootp.c +++ b/packet-bootp.c @@ -2,7 +2,7 @@ * Routines for BOOTP/DHCP packet disassembly * Gilbert Ramirez * - * $Id: packet-bootp.c,v 1.33 2000/05/19 04:54:32 gram Exp $ + * $Id: packet-bootp.c,v 1.34 2000/05/31 05:06:54 guy Exp $ * * The information used comes from: * RFC 2132: DHCP Options and BOOTP Vendor Extensions @@ -583,7 +583,7 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - ti = proto_tree_add_item(tree, proto_bootp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_bootp, NullTVB, offset, END_OF_FRAME, FALSE); bp_tree = proto_item_add_subtree(ti, ett_bootp); proto_tree_add_uint_format(bp_tree, hf_bootp_type, NullTVB, @@ -597,28 +597,28 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) "Hardware type: %s", arphrdtype_to_str(pd[offset+1], "Unknown (0x%02x)")); - proto_tree_add_item(bp_tree, hf_bootp_hw_len, NullTVB, + proto_tree_add_uint(bp_tree, hf_bootp_hw_len, NullTVB, offset + 2, 1, pd[offset+2]); - proto_tree_add_item(bp_tree, hf_bootp_hops, NullTVB, + proto_tree_add_uint(bp_tree, hf_bootp_hops, NullTVB, offset + 3, 1, pd[offset+3]); - proto_tree_add_item(bp_tree, hf_bootp_id, NullTVB, + proto_tree_add_uint(bp_tree, hf_bootp_id, NullTVB, offset + 4, 4, pntohl(&pd[offset+4])); - proto_tree_add_item(bp_tree, hf_bootp_secs, NullTVB, + proto_tree_add_uint(bp_tree, hf_bootp_secs, NullTVB, offset + 8, 2, pntohs(&pd[offset+8])); - proto_tree_add_item(bp_tree, hf_bootp_flag, NullTVB, + proto_tree_add_uint(bp_tree, hf_bootp_flag, NullTVB, offset + 10, 2, pntohs(&pd[offset+10]) & 0x8000); memcpy(&ip_addr, &pd[offset+12], sizeof(ip_addr)); - proto_tree_add_item(bp_tree, hf_bootp_ip_client, NullTVB, + proto_tree_add_ipv4(bp_tree, hf_bootp_ip_client, NullTVB, offset + 12, 4, ip_addr); memcpy(&ip_addr, &pd[offset+16], sizeof(ip_addr)); - proto_tree_add_item(bp_tree, hf_bootp_ip_your, NullTVB, + proto_tree_add_ipv4(bp_tree, hf_bootp_ip_your, NullTVB, offset + 16, 4, ip_addr); memcpy(&ip_addr, &pd[offset+20], sizeof(ip_addr)); - proto_tree_add_item(bp_tree, hf_bootp_ip_server, NullTVB, + proto_tree_add_ipv4(bp_tree, hf_bootp_ip_server, NullTVB, offset + 20, 4, ip_addr); memcpy(&ip_addr, &pd[offset+24], sizeof(ip_addr)); - proto_tree_add_item(bp_tree, hf_bootp_ip_relay, NullTVB, + proto_tree_add_ipv4(bp_tree, hf_bootp_ip_relay, NullTVB, offset + 24, 4, ip_addr); if (pd[offset+2] > 0) { @@ -630,7 +630,7 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) pd[offset+2], pd[offset+1])); } else { - proto_tree_add_item(bp_tree, hf_bootp_hw_addr, NullTVB, + proto_tree_add_bytes(bp_tree, hf_bootp_hw_addr, NullTVB, offset + 28, 0, NULL); } @@ -672,7 +672,7 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } else { memcpy(&ip_addr, &pd[offset + 236], sizeof(ip_addr)); - proto_tree_add_item(bp_tree, hf_bootp_cookie, NullTVB, + proto_tree_add_ipv4(bp_tree, hf_bootp_cookie, NullTVB, offset + 236, 4, ip_addr); } @@ -687,7 +687,7 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_PROTOCOL, "DHCP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "DHCP %-8s - Trans. ID 0x%x", is_dhcp, pntohl(&pd[offset+4]) ); - proto_tree_add_item_hidden(bp_tree, hf_bootp_dhcp, NullTVB, 0, 0, 1); + proto_tree_add_boolean_hidden(bp_tree, hf_bootp_dhcp, NullTVB, 0, 0, 1); } } } diff --git a/packet-bootparams.c b/packet-bootparams.c index d644f05cad..7ae6c8f33b 100644 --- a/packet-bootparams.c +++ b/packet-bootparams.c @@ -1,7 +1,7 @@ /* packet-bootparams.c * Routines for bootparams dissection * - * $Id: packet-bootparams.c,v 1.10 2000/05/11 08:15:03 gram Exp $ + * $Id: packet-bootparams.c,v 1.11 2000/05/31 05:06:55 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -61,10 +61,11 @@ int dissect_bp_address(const u_char *pd, int offset, frame_data *fd, /* get the address type */ if ( !BYTES_ARE_IN_FRAME(offset, 1)) return offset; type = pntohl(&pd[offset]); /* type of address */ -#if 0 +/* +ZZZZZZZZZZZZZZZZZZZ Check type: proto_tree_add_item(tree, hf_bootparams_addresstype, NullTVB, offset, 4, type); -#endif +*/ offset += 4; if ( type != 1 ) /* only know how to handle this type of address */ @@ -76,7 +77,7 @@ int dissect_bp_address(const u_char *pd, int offset, frame_data *fd, if ( ! BYTES_ARE_IN_FRAME(offset, 16)) return offset; ipaddr = (pd[offset+3]<<24) + (pd[offset+7]<<16) + (pd[offset+11]<<8) + (pd[offset+15]); - proto_tree_add_item(tree, hfindex, NullTVB, + proto_tree_add_ipv4(tree, hfindex, NullTVB, offset, 16, ntohl(ipaddr)); offset += 16; diff --git a/packet-bpdu.c b/packet-bpdu.c index d72220c159..316238646e 100644 --- a/packet-bpdu.c +++ b/packet-bpdu.c @@ -1,7 +1,7 @@ /* packet-bpdu.c * Routines for BPDU (Spanning Tree Protocol) disassembly * - * $Id: packet-bpdu.c,v 1.10 2000/05/11 08:15:03 gram Exp $ + * $Id: packet-bpdu.c,v 1.11 2000/05/31 05:06:56 guy Exp $ * * Copyright 1999 Christophe Tronche * @@ -132,7 +132,7 @@ void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree protocol_identifier == 0 ? "Spanning Tree" : "Unknown Protocol"); - proto_tree_add_item(bpdu_tree, hf_bpdu_version_id, NullTVB, + proto_tree_add_uint(bpdu_tree, hf_bpdu_version_id, NullTVB, offset + BPDU_VERSION_IDENTIFIER, 1, protocol_version_identifier); if (protocol_version_identifier != 0) @@ -157,14 +157,14 @@ void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree hello_time = pntohs(bpdu + BPDU_HELLO_TIME) / 256.0; forward_delay = pntohs(bpdu + BPDU_FORWARD_DELAY) / 256.0; - proto_tree_add_item(bpdu_tree, hf_bpdu_flags, NullTVB, + proto_tree_add_uint(bpdu_tree, hf_bpdu_flags, NullTVB, offset + BPDU_FLAGS, 1, flags); if (flags & 0x80) proto_tree_add_text(bpdu_tree, NullTVB, offset + BPDU_FLAGS, 1, " 1... .... Topology Change Acknowledgment"); if (flags & 0x01) proto_tree_add_text(bpdu_tree, NullTVB, offset + BPDU_FLAGS, 1, " .... ...1 Topology Change"); - proto_tree_add_item_hidden(bpdu_tree, hf_bpdu_root_mac, NullTVB, + proto_tree_add_ether_hidden(bpdu_tree, hf_bpdu_root_mac, NullTVB, offset + BPDU_ROOT_IDENTIFIER + 2, 6, bpdu + BPDU_ROOT_IDENTIFIER + 2); proto_tree_add_text(bpdu_tree, NullTVB, @@ -172,7 +172,7 @@ void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree "Root Identifier: %d / %s", root_identifier_bridge_priority, root_identifier_mac); - proto_tree_add_item(bpdu_tree, hf_bpdu_root_cost, NullTVB, + proto_tree_add_uint(bpdu_tree, hf_bpdu_root_cost, NullTVB, offset + BPDU_ROOT_PATH_COST, 4, root_path_cost); proto_tree_add_text(bpdu_tree, NullTVB, @@ -180,22 +180,22 @@ void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree "Bridge Identifier: %d / %s", bridge_identifier_bridge_priority, bridge_identifier_mac); - proto_tree_add_item_hidden(bpdu_tree, hf_bpdu_bridge_mac, NullTVB, + proto_tree_add_ether_hidden(bpdu_tree, hf_bpdu_bridge_mac, NullTVB, offset + BPDU_BRIDGE_IDENTIFIER + 2, 6, bpdu + BPDU_BRIDGE_IDENTIFIER + 2); - proto_tree_add_item(bpdu_tree, hf_bpdu_port_id, NullTVB, + proto_tree_add_uint(bpdu_tree, hf_bpdu_port_id, NullTVB, offset + BPDU_PORT_IDENTIFIER, 2, port_identifier); - proto_tree_add_item(bpdu_tree, hf_bpdu_msg_age, NullTVB, + proto_tree_add_double(bpdu_tree, hf_bpdu_msg_age, NullTVB, offset + BPDU_MESSAGE_AGE, 2, message_age); - proto_tree_add_item(bpdu_tree, hf_bpdu_max_age, NullTVB, + proto_tree_add_double(bpdu_tree, hf_bpdu_max_age, NullTVB, offset + BPDU_MAX_AGE, 2, max_age); - proto_tree_add_item(bpdu_tree, hf_bpdu_hello_time, NullTVB, + proto_tree_add_double(bpdu_tree, hf_bpdu_hello_time, NullTVB, offset + BPDU_HELLO_TIME, 2, hello_time); - proto_tree_add_item(bpdu_tree, hf_bpdu_forward_delay, NullTVB, + proto_tree_add_double(bpdu_tree, hf_bpdu_forward_delay, NullTVB, offset + BPDU_FORWARD_DELAY, 2, forward_delay); } diff --git a/packet-cdp.c b/packet-cdp.c index 551826fe4f..d56d038731 100644 --- a/packet-cdp.c +++ b/packet-cdp.c @@ -2,7 +2,7 @@ * Routines for the disassembly of the "Cisco Discovery Protocol" * (c) Copyright Hannes R. Boehm * - * $Id: packet-cdp.c,v 1.22 2000/05/11 08:15:04 gram Exp $ + * $Id: packet-cdp.c,v 1.23 2000/05/31 05:06:56 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -107,11 +107,11 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_INFO, "Cisco Discovery Protocol"); if(tree){ - ti = proto_tree_add_item(tree, proto_cdp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_cdp, NullTVB, offset, END_OF_FRAME, FALSE); cdp_tree = proto_item_add_subtree(ti, ett_cdp); /* CDP header */ - proto_tree_add_item(cdp_tree, hf_cdp_version, NullTVB, offset, 1, pd[offset]); + proto_tree_add_uint(cdp_tree, hf_cdp_version, NullTVB, offset, 1, pd[offset]); offset += 1; proto_tree_add_uint_format(cdp_tree, hf_cdp_ttl, NullTVB, offset, 1, pntohs(&pd[offset]), @@ -136,9 +136,9 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) &pd[offset+4]); tlv_tree = proto_item_add_subtree(tlvi, ett_cdp_tlv); - proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvtype, NullTVB, offset + TLV_TYPE, 2, type); - proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvlength, NullTVB, offset + TLV_LENGTH, 2, length); proto_tree_add_text(tlv_tree, NullTVB, offset + 4, length - 4, "Device ID: %s", @@ -151,9 +151,9 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) length, "Addresses"); tlv_tree = proto_item_add_subtree(tlvi, ett_cdp_tlv); - proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvtype, NullTVB, offset + TLV_TYPE, 2, type); - proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvlength, NullTVB, offset + TLV_LENGTH, 2, length); offset += 4; length -= 4; @@ -194,9 +194,9 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) &pd[offset+4]); tlv_tree = proto_item_add_subtree(tlvi, ett_cdp_tlv); - proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvtype, NullTVB, offset + TLV_TYPE, 2, type); - proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvlength, NullTVB, offset + TLV_LENGTH, 2, length); proto_tree_add_text(tlv_tree, NullTVB, offset + 4, real_length - 4, @@ -209,9 +209,9 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) length, "Capabilities"); tlv_tree = proto_item_add_subtree(tlvi, ett_cdp_tlv); - proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvtype, NullTVB, offset + TLV_TYPE, 2, type); - proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvlength, NullTVB, offset + TLV_LENGTH, 2, length); offset += 4; length -= 4; @@ -224,9 +224,9 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) length, "Software Version"); tlv_tree = proto_item_add_subtree(tlvi, ett_cdp_tlv); - proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvtype, NullTVB, offset + TLV_TYPE, 2, type); - proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvlength, NullTVB, offset + TLV_LENGTH, 2, length); add_multi_line_string_to_tree(tlv_tree, offset + 4, length - 4, "Software Version: ", @@ -243,9 +243,9 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) stringmem); tlv_tree = proto_item_add_subtree(tlvi, ett_cdp_tlv); - proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvtype, NullTVB, offset + TLV_TYPE, 2, type); - proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvlength, NullTVB, offset + TLV_LENGTH, 2, length); proto_tree_add_text(tlv_tree, NullTVB, offset + 4, length - 4, "Platform: %s", stringmem); @@ -258,9 +258,9 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) type_str, length); tlv_tree = proto_item_add_subtree(tlvi, ett_cdp_tlv); - proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvtype, NullTVB, offset + TLV_TYPE, 2, type); - proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB, + proto_tree_add_uint(tlv_tree, hf_cdp_tlvlength, NullTVB, offset + TLV_LENGTH, 2, length); if (length > 4) { proto_tree_add_text(tlv_tree, NullTVB, diff --git a/packet-cgmp.c b/packet-cgmp.c index 9155aeb682..65333f055b 100644 --- a/packet-cgmp.c +++ b/packet-cgmp.c @@ -1,7 +1,7 @@ /* packet-cgmp.c * Routines for the disassembly of the Cisco Group Management Protocol * - * $Id: packet-cgmp.c,v 1.2 2000/05/11 08:15:04 gram Exp $ + * $Id: packet-cgmp.c,v 1.3 2000/05/31 05:06:58 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -71,32 +71,32 @@ dissect_cgmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_INFO, "Cisco Group Management Protocol"); if (tree) { - ti = proto_tree_add_item(tree, proto_cgmp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_cgmp, NullTVB, offset, END_OF_FRAME, FALSE); cgmp_tree = proto_item_add_subtree(ti, ett_cgmp); - proto_tree_add_item(cgmp_tree, hf_cgmp_version, NullTVB, offset, 1, + proto_tree_add_uint(cgmp_tree, hf_cgmp_version, NullTVB, offset, 1, pd[offset]); - proto_tree_add_item(cgmp_tree, hf_cgmp_type, NullTVB, offset, 1, + proto_tree_add_uint(cgmp_tree, hf_cgmp_type, NullTVB, offset, 1, pd[offset]); offset += 1; offset += 2; /* skip reserved field */ count = pd[offset]; - proto_tree_add_item(cgmp_tree, hf_cgmp_count, NullTVB, offset, 1, + proto_tree_add_uint(cgmp_tree, hf_cgmp_count, NullTVB, offset, 1, count); offset += 1; while (count != 0) { if (!BYTES_ARE_IN_FRAME(offset, 6)) break; - proto_tree_add_item(cgmp_tree, hf_cgmp_gda, NullTVB, offset, 6, + proto_tree_add_ether(cgmp_tree, hf_cgmp_gda, NullTVB, offset, 6, &pd[offset]); offset += 6; if (!BYTES_ARE_IN_FRAME(offset, 6)) break; - proto_tree_add_item(cgmp_tree, hf_cgmp_usa, NullTVB, offset, 6, + proto_tree_add_ether(cgmp_tree, hf_cgmp_usa, NullTVB, offset, 6, &pd[offset]); offset += 6; diff --git a/packet-clnp.c b/packet-clnp.c index 93b557fcee..de43f67ec1 100644 --- a/packet-clnp.c +++ b/packet-clnp.c @@ -1,7 +1,7 @@ /* packet-clnp.c * Routines for ISO/OSI network and transport protocol packet disassembly * - * $Id: packet-clnp.c,v 1.7 2000/05/11 08:15:04 gram Exp $ + * $Id: packet-clnp.c,v 1.8 2000/05/31 05:06:58 guy Exp $ * Laurent Deniel * Ralf Schneider * @@ -272,7 +272,7 @@ static int osi_decode_DR(const u_char *pd, int offset, src_ref, dst_ref); if (tree) { - ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL); + ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, FALSE); cotp_tree = proto_item_add_subtree(ti, ett_cotp); proto_tree_add_text(cotp_tree, NullTVB, offset, 1, "Length indicator: %u", li); @@ -364,7 +364,7 @@ static gboolean osi_decode_DT(const u_char *pd, int offset, (fragment)? "(fragment)" : ""); if (tree) { - ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL); + ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, FALSE); cotp_tree = proto_item_add_subtree(ti, ett_cotp); proto_tree_add_text(cotp_tree, NullTVB, offset, 1, "Length indicator: %u", li); @@ -506,7 +506,7 @@ static int osi_decode_ED(const u_char *pd, int offset, tpdu_nr, dst_ref); if (tree) { - ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL); + ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, FALSE); cotp_tree = proto_item_add_subtree(ti, ett_cotp); proto_tree_add_text(cotp_tree, NullTVB, offset, 1, "Length indicator: %u", li); @@ -587,7 +587,7 @@ static int osi_decode_RJ(const u_char *pd, int offset, tpdu_nr, dst_ref); if (tree) { - ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL); + ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, FALSE); cotp_tree = proto_item_add_subtree(ti, ett_cotp); proto_tree_add_text(cotp_tree, NullTVB, offset, 1, "Length indicator: %u", li); @@ -686,7 +686,7 @@ static int osi_decode_CC(const u_char *pd, int offset, dst_ref); if (tree) { - ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL); + ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, FALSE); cotp_tree = proto_item_add_subtree(ti, ett_cotp); proto_tree_add_text(cotp_tree, NullTVB, offset, 1, "Length indicator: %u", li); @@ -970,7 +970,7 @@ static int osi_decode_DC(const u_char *pd, int offset, dst_ref); if (tree) { - ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL); + ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, FALSE); cotp_tree = proto_item_add_subtree(ti, ett_cotp); proto_tree_add_text(cotp_tree, NullTVB, offset, 1, "Length indicator: %u", li); @@ -1020,7 +1020,7 @@ static int osi_decode_AK(const u_char *pd, int offset, tpdu_nr, dst_ref); if (tree) { - ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL); + ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, FALSE); cotp_tree = proto_item_add_subtree(ti, ett_cotp); proto_tree_add_text(cotp_tree, NullTVB, offset, 1, "Length indicator: %u", li); @@ -1124,7 +1124,7 @@ static int osi_decode_AK(const u_char *pd, int offset, tpdu_nr, dst_ref); if (tree) { - ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL); + ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, FALSE); cotp_tree = proto_item_add_subtree(ti, ett_cotp); proto_tree_add_text(cotp_tree, NullTVB, offset, 1, "Length indicator: %u", li); @@ -1274,7 +1274,7 @@ static int osi_decode_EA(const u_char *pd, int offset, "EA TPDU (%u) dst-ref: 0x%04x", tpdu_nr, dst_ref); if (tree) { - ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL); + ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, FALSE); cotp_tree = proto_item_add_subtree(ti, ett_cotp); proto_tree_add_text(cotp_tree, NullTVB, offset, 1, "Length indicator: %u", li); @@ -1356,7 +1356,7 @@ static int osi_decode_ER(const u_char *pd, int offset, col_append_fstr(fd, COL_INFO, "ER TPDU dst-ref: 0x%04x", dst_ref); if (tree) { - ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL); + ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, FALSE); cotp_tree = proto_item_add_subtree(ti, ett_cotp); proto_tree_add_text(cotp_tree, NullTVB, offset, 1, "Length indicator: %u", li); @@ -1509,7 +1509,7 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd, if (check_col(fd, COL_INFO)) col_add_str(fd, COL_INFO, "Inactive subset"); if (tree) { - ti = proto_tree_add_item(tree, proto_clnp, NullTVB, offset, 1, NULL); + ti = proto_tree_add_item(tree, proto_clnp, NullTVB, offset, 1, FALSE); clnp_tree = proto_item_add_subtree(ti, ett_clnp); proto_tree_add_uint_format(clnp_tree, hf_clnp_id, NullTVB, offset, 1, clnp.cnf_proto_id, @@ -1544,13 +1544,13 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd, pdu_type_string = val_to_str(clnp.cnf_type & CNF_TYPE, npdu_type_vals, "Unknown (0x%02x)"); if (tree) { - ti = proto_tree_add_item(tree, proto_clnp, NullTVB, offset, clnp.cnf_hdr_len, NULL); + ti = proto_tree_add_item(tree, proto_clnp, NullTVB, offset, clnp.cnf_hdr_len, FALSE); clnp_tree = proto_item_add_subtree(ti, ett_clnp); - proto_tree_add_item(clnp_tree, hf_clnp_id, NullTVB, offset, 1, + proto_tree_add_uint(clnp_tree, hf_clnp_id, NullTVB, offset, 1, clnp.cnf_proto_id); - proto_tree_add_item(clnp_tree, hf_clnp_length, NullTVB, offset + 1, 1, + proto_tree_add_uint(clnp_tree, hf_clnp_length, NullTVB, offset + 1, 1, clnp.cnf_hdr_len); - proto_tree_add_item(clnp_tree, hf_clnp_version, NullTVB, offset + 2, 1, + proto_tree_add_uint(clnp_tree, hf_clnp_version, NullTVB, offset + 2, 1, clnp.cnf_vers); proto_tree_add_uint_format(clnp_tree, hf_clnp_ttl, NullTVB, offset + 3, 1, clnp.cnf_ttl, @@ -1562,7 +1562,7 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd, clnp.cnf_type, flag_string, pdu_type_string); - proto_tree_add_item(clnp_tree, hf_clnp_pdu_length, NullTVB, offset + 5, 2, + proto_tree_add_uint(clnp_tree, hf_clnp_pdu_length, NullTVB, offset + 5, 2, segment_length); proto_tree_add_uint_format(clnp_tree, hf_clnp_checksum, NullTVB, offset + 7, 2, EXTRACT_SHORT(&clnp.cnf_cksum_msb), @@ -1588,13 +1588,13 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd, src_len = pd[offset + dst_len + 1]; if (tree) { - proto_tree_add_item(clnp_tree, hf_clnp_dest_length, NullTVB, offset, 1, + proto_tree_add_uint(clnp_tree, hf_clnp_dest_length, NullTVB, offset, 1, dst_len); proto_tree_add_bytes_format(clnp_tree, hf_clnp_dest, NullTVB, offset + 1 , dst_len, &pd[offset + 1], " DA : %s", print_nsap_net(&pd[offset + 1], dst_len)); - proto_tree_add_item(clnp_tree, hf_clnp_src_length, NullTVB, + proto_tree_add_uint(clnp_tree, hf_clnp_src_length, NullTVB, offset + 1 + dst_len, 1, src_len); proto_tree_add_bytes_format(clnp_tree, hf_clnp_src, NullTVB, offset + dst_len + 2, src_len, diff --git a/packet-ddtp.c b/packet-ddtp.c index eefb212264..9d8ab47a47 100644 --- a/packet-ddtp.c +++ b/packet-ddtp.c @@ -3,7 +3,7 @@ * see http://ddt.sourceforge.net/ * Olivier Abad * - * $Id: packet-ddtp.c,v 1.4 2000/05/28 17:04:09 oabad Exp $ + * $Id: packet-ddtp.c,v 1.5 2000/05/31 05:07:00 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -111,32 +111,32 @@ dissect_ddtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { ti = proto_tree_add_item(tree, proto_ddtp, NullTVB, offset, - END_OF_FRAME - offset, NULL); + END_OF_FRAME - offset, FALSE); ddtp_tree = proto_item_add_subtree(ti, ett_ddtp); if (!BYTES_ARE_IN_FRAME(offset, 4)) { proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short"); return; } - proto_tree_add_item(ddtp_tree, hf_ddtp_version, NullTVB, offset, 4, pntohl(pd+offset)); + proto_tree_add_uint(ddtp_tree, hf_ddtp_version, NullTVB, offset, 4, pntohl(pd+offset)); offset += 4; if (!BYTES_ARE_IN_FRAME(offset, 4)) { proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short"); return; } - proto_tree_add_item(ddtp_tree, hf_ddtp_encrypt, NullTVB, offset, 4, pntohl(pd+offset)); + proto_tree_add_uint(ddtp_tree, hf_ddtp_encrypt, NullTVB, offset, 4, pntohl(pd+offset)); if (!BYTES_ARE_IN_FRAME(offset+4, 4)) { proto_tree_add_text(ddtp_tree, NullTVB, offset+4, END_OF_FRAME-offset-4, "Frame too short"); return; } - proto_tree_add_item(ddtp_tree, hf_ddtp_hostid, NullTVB, offset+4, 4, pntohl(pd+offset+4)); + proto_tree_add_uint(ddtp_tree, hf_ddtp_hostid, NullTVB, offset+4, 4, pntohl(pd+offset+4)); if (pntohl(pd+offset) == DDTP_ENCRYPT_PLAINTEXT) { offset += 8; if (!BYTES_ARE_IN_FRAME(offset, 4)) { proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short"); return; } - proto_tree_add_item(ddtp_tree, hf_ddtp_msgtype, NullTVB, offset, 4, pntohl(pd+offset)); + proto_tree_add_uint(ddtp_tree, hf_ddtp_msgtype, NullTVB, offset, 4, pntohl(pd+offset)); switch (pntohl(pd+offset)) { case DDTP_MESSAGE_ERROR : offset += 4; @@ -149,13 +149,13 @@ dissect_ddtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short"); return; } - proto_tree_add_item(ddtp_tree, hf_ddtp_opcode, NullTVB, offset, 4, pntohl(pd+offset)); + proto_tree_add_uint(ddtp_tree, hf_ddtp_opcode, NullTVB, offset, 4, pntohl(pd+offset)); offset += 4; if (!BYTES_ARE_IN_FRAME(offset, 4)) { proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short"); return; } - proto_tree_add_item(ddtp_tree, hf_ddtp_ipaddr, NullTVB, offset, 4, pntohl(pd+offset)); + proto_tree_add_ipv4(ddtp_tree, hf_ddtp_ipaddr, NullTVB, offset, 4, pntohl(pd+offset)); break; case DDTP_UPDATE_REPLY : offset += 4; @@ -164,7 +164,7 @@ dissect_ddtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short"); return; } - proto_tree_add_item(ddtp_tree, hf_ddtp_status, NullTVB, offset, 4, pntohl(pd+offset)); + proto_tree_add_uint(ddtp_tree, hf_ddtp_status, NullTVB, offset, 4, pntohl(pd+offset)); break; case DDTP_ALIVE_QUERY : offset += 4; diff --git a/packet-dns.c b/packet-dns.c index c8e0dac521..ff0d4cbd1d 100644 --- a/packet-dns.c +++ b/packet-dns.c @@ -1,7 +1,7 @@ /* packet-dns.c * Routines for DNS packet disassembly * - * $Id: packet-dns.c,v 1.44 2000/05/11 08:15:05 gram Exp $ + * $Id: packet-dns.c,v 1.45 2000/05/31 05:07:00 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1573,11 +1573,11 @@ dissect_dns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) dns_tree = proto_item_add_subtree(ti, ett_dns); if (flags & F_RESPONSE) - proto_tree_add_item_hidden(dns_tree, hf_dns_response, NullTVB, offset, 4, 1); + proto_tree_add_boolean_hidden(dns_tree, hf_dns_response, NullTVB, offset, 4, 1); else - proto_tree_add_item_hidden(dns_tree, hf_dns_query, NullTVB, offset, 4, 1); + proto_tree_add_boolean_hidden(dns_tree, hf_dns_query, NullTVB, offset, 4, 1); - proto_tree_add_item(dns_tree, hf_dns_transaction_id, NullTVB, + proto_tree_add_uint(dns_tree, hf_dns_transaction_id, NullTVB, offset + DNS_ID, 2, id); strcpy(buf, val_to_str(flags & F_OPCODE, opcode_vals, "Unknown operation")); @@ -1640,13 +1640,13 @@ dissect_dns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) decode_enumerated_bitfield(flags, F_RCODE, 2*8, rcode_vals, "%s")); } - proto_tree_add_item(dns_tree, hf_dns_count_questions, NullTVB, + proto_tree_add_uint(dns_tree, hf_dns_count_questions, NullTVB, offset + DNS_QUEST, 2, quest); - proto_tree_add_item(dns_tree, hf_dns_count_answers, NullTVB, + proto_tree_add_uint(dns_tree, hf_dns_count_answers, NullTVB, offset + DNS_ANS, 2, ans); - proto_tree_add_item(dns_tree, hf_dns_count_auth_rr, NullTVB, + proto_tree_add_uint(dns_tree, hf_dns_count_auth_rr, NullTVB, offset + DNS_AUTH, 2, auth); - proto_tree_add_item(dns_tree, hf_dns_count_add_rr, NullTVB, + proto_tree_add_uint(dns_tree, hf_dns_count_add_rr, NullTVB, offset + DNS_ADD, 2, add); } diff --git a/packet-eigrp.c b/packet-eigrp.c index f9facfcaaa..23b49b3fd8 100644 --- a/packet-eigrp.c +++ b/packet-eigrp.c @@ -1,6 +1,6 @@ /* packet-eigrp.c * - * $Id: packet-eigrp.c,v 1.3 2000/05/30 03:35:51 guy Exp $ + * $Id: packet-eigrp.c,v 1.4 2000/05/31 05:07:02 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -104,7 +104,7 @@ dissect_eigrp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { val_to_str( ih.eigrp_opcode, eigrp_opcode_vals, "Unknown (0x%04x)")); if (tree) { - ti = proto_tree_add_item(tree, proto_eigrp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_eigrp, NullTVB, offset, END_OF_FRAME, FALSE); eigrp_tree = proto_item_add_subtree(ti, ett_eigrp); proto_tree_add_text(eigrp_tree, NullTVB, offset, 1, "Version: %u", ih.eigrp_version); diff --git a/packet-esis.c b/packet-esis.c index 2b3980a155..90f562663f 100644 --- a/packet-esis.c +++ b/packet-esis.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI End System to Intermediate System * Routeing Exchange Protocol ISO 9542. * - * $Id: packet-esis.c,v 1.3 2000/05/11 08:15:07 gram Exp $ + * $Id: packet-esis.c,v 1.4 2000/05/31 05:07:02 guy Exp $ * Ralf Schneider * * Ethereal - Network traffic analyzer @@ -319,15 +319,15 @@ dissect_esis(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } if (tree) { - ti = proto_tree_add_item(tree, proto_esis, NullTVB, offset, END_OF_FRAME, NULL ); + ti = proto_tree_add_item(tree, proto_esis, NullTVB, offset, END_OF_FRAME, FALSE); esis_tree = proto_item_add_subtree(ti, ett_esis); - proto_tree_add_item( esis_tree, hf_esis_nlpi, NullTVB, offset, 1, ehdr->esis_nlpi ); - proto_tree_add_item( esis_tree, hf_esis_length, NullTVB, + proto_tree_add_uint( esis_tree, hf_esis_nlpi, NullTVB, offset, 1, ehdr->esis_nlpi ); + proto_tree_add_uint( esis_tree, hf_esis_length, NullTVB, offset + 1, 1, ehdr->esis_length ); - proto_tree_add_item( esis_tree, hf_esis_version, NullTVB, offset + 2, 1, + proto_tree_add_uint( esis_tree, hf_esis_version, NullTVB, offset + 2, 1, ehdr->esis_version ); - proto_tree_add_item( esis_tree, hf_esis_reserved, NullTVB, offset + 3, 1, + proto_tree_add_uint( esis_tree, hf_esis_reserved, NullTVB, offset + 3, 1, ehdr->esis_reserved ); pdu_type_string = val_to_str(ehdr->esis_type&OSI_PDU_TYPE_MASK, diff --git a/packet-eth.c b/packet-eth.c index 3218d0caa3..65ce8b3c1b 100644 --- a/packet-eth.c +++ b/packet-eth.c @@ -1,7 +1,7 @@ /* packet-eth.c * Routines for ethernet packet disassembly * - * $Id: packet-eth.c,v 1.41 2000/05/19 05:29:44 guy Exp $ + * $Id: packet-eth.c,v 1.42 2000/05/31 05:07:03 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -223,14 +223,14 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) fh_tree = proto_item_add_subtree(ti, ett_ieee8023); - proto_tree_add_item(fh_tree, hf_eth_dst, tvb, 0, 6, dst); - proto_tree_add_item(fh_tree, hf_eth_src, tvb, 6, 6, src); + proto_tree_add_ether(fh_tree, hf_eth_dst, tvb, 0, 6, dst); + proto_tree_add_ether(fh_tree, hf_eth_src, tvb, 6, 6, src); /* add items for eth.addr filter */ - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, tvb, 0, 6, dst); - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, tvb, 6, 6, src); + proto_tree_add_ether_hidden(fh_tree, hf_eth_addr, tvb, 0, 6, dst); + proto_tree_add_ether_hidden(fh_tree, hf_eth_addr, tvb, 6, 6, src); - proto_tree_add_item(fh_tree, hf_eth_len, tvb, 12, 2, length); + proto_tree_add_uint(fh_tree, hf_eth_len, tvb, 12, 2, length); } /* Convert the LLC length from the 802.3 header to a total @@ -254,11 +254,11 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) fh_tree = proto_item_add_subtree(ti, ett_ether2); - proto_tree_add_item(fh_tree, hf_eth_dst, tvb, 0, 6, dst); - proto_tree_add_item(fh_tree, hf_eth_src, tvb, 6, 6, src); + proto_tree_add_ether(fh_tree, hf_eth_dst, tvb, 0, 6, dst); + proto_tree_add_ether(fh_tree, hf_eth_src, tvb, 6, 6, src); /* add items for eth.addr filter */ - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, tvb, 0, 6, dst); - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, tvb, 6, 6, src); + proto_tree_add_ether_hidden(fh_tree, hf_eth_addr, tvb, 0, 6, dst); + proto_tree_add_ether_hidden(fh_tree, hf_eth_addr, tvb, 6, 6, src); } } eth_offset += ETH_HEADER_SIZE; @@ -298,7 +298,7 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) trailer_length = tvb_length(trailer_tvb); if (trailer_length > 0) { ptr = tvb_get_ptr(trailer_tvb, 0, trailer_length); - proto_tree_add_item(fh_tree, hf_eth_trailer, tvb, ETH_HEADER_SIZE + etype, + proto_tree_add_bytes(fh_tree, hf_eth_trailer, tvb, ETH_HEADER_SIZE + etype, trailer_length, ptr); } } diff --git a/packet-ethertype.c b/packet-ethertype.c index 1878f7cc3f..b7003027ce 100644 --- a/packet-ethertype.c +++ b/packet-ethertype.c @@ -1,7 +1,7 @@ /* ethertype.c * Routines for calling the right protocol for the ethertype. * - * $Id: packet-ethertype.c,v 1.4 2000/05/19 04:54:33 gram Exp $ + * $Id: packet-ethertype.c,v 1.5 2000/05/31 05:07:03 guy Exp $ * * Gilbert Ramirez * @@ -97,7 +97,7 @@ ethertype(guint16 etype, tvbuff_t *tvb, int offset_after_etype, packet_info *pin /* Add to proto_tree */ if (tree) { - proto_tree_add_item(fh_tree, item_id, tvb, offset_after_etype - 2, 2, etype); + proto_tree_add_uint(fh_tree, item_id, tvb, offset_after_etype - 2, 2, etype); } next_tvb = tvb_new_subset(tvb, offset_after_etype, -1, -1); diff --git a/packet-fddi.c b/packet-fddi.c index c19f3573bf..09fbdcd026 100644 --- a/packet-fddi.c +++ b/packet-fddi.c @@ -3,7 +3,7 @@ * * Laurent Deniel * - * $Id: packet-fddi.c,v 1.35 2000/05/28 22:02:16 guy Exp $ + * $Id: packet-fddi.c,v 1.36 2000/05/31 05:07:03 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -279,7 +279,7 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ti = proto_tree_add_protocol_format(tree, proto_fddi, tvb, 0, FDDI_HEADER_SIZE, "Fiber Distributed Data Interface, %s", fc_str); fh_tree = proto_item_add_subtree(ti, ett_fddi); - proto_tree_add_item(fh_tree, hf_fddi_fc, tvb, FDDI_P_FC, 1, fc); + proto_tree_add_uint(fh_tree, hf_fddi_fc, tvb, FDDI_P_FC, 1, fc); } /* Extract the destination address, possibly bit-swapping it. */ @@ -295,12 +295,12 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, SET_ADDRESS(&pi.dst, AT_ETHER, 6, &dst[0]); if (fh_tree) { - proto_tree_add_item(fh_tree, hf_fddi_dst, tvb, FDDI_P_DHOST, 6, dst); - proto_tree_add_item_hidden(fh_tree, hf_fddi_addr, tvb, FDDI_P_DHOST, 6, dst); + proto_tree_add_ether(fh_tree, hf_fddi_dst, tvb, FDDI_P_DHOST, 6, dst); + proto_tree_add_ether_hidden(fh_tree, hf_fddi_addr, tvb, FDDI_P_DHOST, 6, dst); /* hide some bit-swapped mac address fields in the proto_tree, just in case */ - proto_tree_add_item_hidden(fh_tree, hf_fddi_dst, tvb, FDDI_P_DHOST, 6, dst_swapped); - proto_tree_add_item_hidden(fh_tree, hf_fddi_addr, tvb, FDDI_P_DHOST, 6, dst_swapped); + proto_tree_add_ether_hidden(fh_tree, hf_fddi_dst, tvb, FDDI_P_DHOST, 6, dst_swapped); + proto_tree_add_ether_hidden(fh_tree, hf_fddi_addr, tvb, FDDI_P_DHOST, 6, dst_swapped); } /* Extract the source address, possibly bit-swapping it. */ @@ -316,12 +316,12 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, SET_ADDRESS(&pi.src, AT_ETHER, 6, &src[0]); if (fh_tree) { - proto_tree_add_item(fh_tree, hf_fddi_src, tvb, FDDI_P_SHOST, 6, src); - proto_tree_add_item_hidden(fh_tree, hf_fddi_addr, tvb, FDDI_P_SHOST, 6, src); + proto_tree_add_ether(fh_tree, hf_fddi_src, tvb, FDDI_P_SHOST, 6, src); + proto_tree_add_ether_hidden(fh_tree, hf_fddi_addr, tvb, FDDI_P_SHOST, 6, src); /* hide some bit-swapped mac address fields in the proto_tree, just in case */ - proto_tree_add_item_hidden(fh_tree, hf_fddi_src, tvb, FDDI_P_SHOST, 6, src_swapped); - proto_tree_add_item_hidden(fh_tree, hf_fddi_addr, tvb, FDDI_P_SHOST, 6, src_swapped); + proto_tree_add_ether_hidden(fh_tree, hf_fddi_src, tvb, FDDI_P_SHOST, 6, src_swapped); + proto_tree_add_ether_hidden(fh_tree, hf_fddi_addr, tvb, FDDI_P_SHOST, 6, src_swapped); } next_tvb = tvb_new_subset(tvb, FDDI_HEADER_SIZE, -1, -1); diff --git a/packet-ftp.c b/packet-ftp.c index 53399885a0..8f436d8db7 100644 --- a/packet-ftp.c +++ b/packet-ftp.c @@ -2,7 +2,7 @@ * Routines for ftp packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-ftp.c,v 1.15 2000/05/11 08:15:08 gram Exp $ + * $Id: packet-ftp.c,v 1.16 2000/05/31 05:07:04 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -108,14 +108,14 @@ dissect_ftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_ftp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_ftp, NullTVB, offset, END_OF_FRAME, FALSE); ftp_tree = proto_item_add_subtree(ti, ett_ftp); if (pi.match_port == pi.destport) { /* Request */ - proto_tree_add_item_hidden(ftp_tree, hf_ftp_request, NullTVB, + proto_tree_add_boolean_hidden(ftp_tree, hf_ftp_request, NullTVB, offset, i1, TRUE); - proto_tree_add_item_hidden(ftp_tree, hf_ftp_response, NullTVB, + proto_tree_add_boolean_hidden(ftp_tree, hf_ftp_response, NullTVB, offset, i1, FALSE); proto_tree_add_string_format(ftp_tree, hf_ftp_request_command, NullTVB, offset, i1, rr, "Request: %s", rr); @@ -125,9 +125,9 @@ dissect_ftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } else { - proto_tree_add_item_hidden(ftp_tree, hf_ftp_request, NullTVB, + proto_tree_add_boolean_hidden(ftp_tree, hf_ftp_request, NullTVB, offset, i1, FALSE); - proto_tree_add_item_hidden(ftp_tree, hf_ftp_response, NullTVB, + proto_tree_add_boolean_hidden(ftp_tree, hf_ftp_response, NullTVB, offset, i1, TRUE); proto_tree_add_uint_format(ftp_tree, hf_ftp_response_code, NullTVB, offset, i1, diff --git a/packet-giop.c b/packet-giop.c index 8b53eb0c3c..d593917da2 100644 --- a/packet-giop.c +++ b/packet-giop.c @@ -3,7 +3,7 @@ * * Laurent Deniel * - * $Id: packet-giop.c,v 1.13 2000/05/11 08:15:09 gram Exp $ + * $Id: packet-giop.c,v 1.14 2000/05/31 05:07:04 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -271,7 +271,7 @@ dissect_giop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { ti = proto_tree_add_item(tree, proto_giop, NullTVB, offset, - GIOP_HEADER_SIZE + message_size, NULL); + GIOP_HEADER_SIZE + message_size, FALSE); clnp_tree = proto_item_add_subtree(ti, ett_giop); proto_tree_add_text(clnp_tree, NullTVB, offset, 4, "Magic number: %s", GIOP_MAGIC); @@ -310,7 +310,7 @@ dissect_giop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) (header.message_type == MessageError) ? "MessageError" : (header.message_type == Fragment) ? "Fragment" : "?"); - proto_tree_add_item(clnp_tree, + proto_tree_add_uint(clnp_tree, hf_giop_message_size, NullTVB, offset + 8, 4, message_size); diff --git a/packet-gre.c b/packet-gre.c index 263aec7445..aea393e816 100644 --- a/packet-gre.c +++ b/packet-gre.c @@ -2,7 +2,7 @@ * Routines for the Generic Routing Encapsulation (GRE) protocol * Brad Robel-Forrest * - * $Id: packet-gre.c,v 1.21 2000/05/25 07:42:24 gram Exp $ + * $Id: packet-gre.c,v 1.22 2000/05/31 05:07:05 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -132,7 +132,7 @@ dissect_gre(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { offset += sizeof(flags_and_ver); - proto_tree_add_item(gre_tree, hf_gre_proto, NullTVB, offset, sizeof(type), type); + proto_tree_add_uint(gre_tree, hf_gre_proto, NullTVB, offset, sizeof(type), type); offset += sizeof(type); if (flags_and_ver & GH_B_C || flags_and_ver & GH_B_R) { diff --git a/packet-h1.c b/packet-h1.c index f42eef18d7..eb4f79438e 100644 --- a/packet-h1.c +++ b/packet-h1.c @@ -2,7 +2,7 @@ * Routines for Sinec H1 packet disassembly * Gerrit Gehnen * - * $Id: packet-h1.c,v 1.8 2000/05/11 08:15:09 gram Exp $ + * $Id: packet-h1.c,v 1.9 2000/05/31 05:07:05 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -122,11 +122,11 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) col_add_str (fd, COL_INFO, "S5: "); if (tree) { - ti = proto_tree_add_item (tree, proto_h1, NullTVB, offset, 16, NULL); + ti = proto_tree_add_item (tree, proto_h1, NullTVB, offset, 16, FALSE); h1_tree = proto_item_add_subtree (ti, ett_h1); - proto_tree_add_item (h1_tree, hf_h1_header, NullTVB, offset, 2, + proto_tree_add_uint (h1_tree, hf_h1_header, NullTVB, offset, 2, pd[offset] * 0x100 + pd[offset + 1]); - proto_tree_add_item (h1_tree, hf_h1_len, NullTVB, offset + 2, 1, + proto_tree_add_uint (h1_tree, hf_h1_len, NullTVB, offset + 2, 1, pd[offset + 2]); } @@ -137,15 +137,15 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case OPCODE_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_opfield, NullTVB, + ti = proto_tree_add_uint (h1_tree, hf_h1_opfield, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); opcode_tree = proto_item_add_subtree (ti, ett_opcode); - proto_tree_add_item (opcode_tree, hf_h1_oplen, NullTVB, + proto_tree_add_uint (opcode_tree, hf_h1_oplen, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); - proto_tree_add_item (opcode_tree, hf_h1_opcode, NullTVB, + proto_tree_add_uint (opcode_tree, hf_h1_opcode, NullTVB, offset + position + 2, 1, pd[offset + position + 2]); } @@ -159,25 +159,25 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case REQUEST_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_requestblock, NullTVB, + ti = proto_tree_add_uint (h1_tree, hf_h1_requestblock, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); org_tree = proto_item_add_subtree (ti, ett_org); - proto_tree_add_item (org_tree, hf_h1_requestlen, NullTVB, + proto_tree_add_uint (org_tree, hf_h1_requestlen, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); - proto_tree_add_item (org_tree, hf_h1_org, NullTVB, + proto_tree_add_uint (org_tree, hf_h1_org, NullTVB, offset + position + 2, 1, pd[offset + position + 2]); - proto_tree_add_item (org_tree, hf_h1_dbnr, NullTVB, + proto_tree_add_uint (org_tree, hf_h1_dbnr, NullTVB, offset + position + 3, 1, pd[offset + position + 3]); - proto_tree_add_item (org_tree, hf_h1_dwnr, NullTVB, + proto_tree_add_uint (org_tree, hf_h1_dwnr, NullTVB, offset + position + 4, 2, pd[offset + position + 4] * 0x100 + pd[offset + position + 5]); - proto_tree_add_item (org_tree, hf_h1_dlen, NullTVB, + proto_tree_add_int (org_tree, hf_h1_dlen, NullTVB, offset + position + 6, 2, pd[offset + position + 6] * 0x100 + pd[offset + position + 7]); @@ -199,15 +199,15 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case RESPONSE_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_response, NullTVB, + ti = proto_tree_add_uint (h1_tree, hf_h1_response, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); response_tree = proto_item_add_subtree (ti, ett_response); - proto_tree_add_item (response_tree, hf_h1_response_len, NullTVB, + proto_tree_add_uint (response_tree, hf_h1_response_len, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); - proto_tree_add_item (response_tree, hf_h1_response_value, NullTVB, + proto_tree_add_uint (response_tree, hf_h1_response_value, NullTVB, offset + position + 2, 1, pd[offset + position + 2]); } @@ -221,13 +221,13 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case EMPTY_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_empty, NullTVB, + ti = proto_tree_add_uint (h1_tree, hf_h1_empty, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); empty_tree = proto_item_add_subtree (ti, ett_empty); - proto_tree_add_item (empty_tree, hf_h1_empty_len, NullTVB, + proto_tree_add_uint (empty_tree, hf_h1_empty_len, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); } diff --git a/packet-hsrp.c b/packet-hsrp.c index 5ae1390d82..8857c22862 100644 --- a/packet-hsrp.c +++ b/packet-hsrp.c @@ -4,7 +4,7 @@ * * Heikki Vatiainen * - * $Id: packet-hsrp.c,v 1.4 2000/05/11 08:15:10 gram Exp $ + * $Id: packet-hsrp.c,v 1.5 2000/05/31 05:07:05 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -120,7 +120,7 @@ dissect_hsrp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) return; } - ti = proto_tree_add_item(tree, proto_hsrp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_hsrp, NullTVB, offset, END_OF_FRAME, FALSE); hsrp_tree = proto_item_add_subtree(ti, ett_hsrp); proto_tree_add_text(hsrp_tree, NullTVB, offset++, 1, "Version: %u", hsrp.version); diff --git a/packet-http.c b/packet-http.c index 50d9f9c458..886f15cf3a 100644 --- a/packet-http.c +++ b/packet-http.c @@ -3,7 +3,7 @@ * * Guy Harris * - * $Id: packet-http.c,v 1.18 2000/05/11 08:15:10 gram Exp $ + * $Id: packet-http.c,v 1.19 2000/05/31 05:07:06 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -92,7 +92,7 @@ void dissect_http(const u_char *pd, int offset, frame_data *fd, proto_tree *tree } if (tree) { - ti = proto_tree_add_item(tree, proto_http, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_http, NullTVB, offset, END_OF_FRAME, FALSE); http_tree = proto_item_add_subtree(ti, ett_http); while (data < dataend) { @@ -189,12 +189,12 @@ void dissect_http(const u_char *pd, int offset, frame_data *fd, proto_tree *tree switch (http_type) { case HTTP_RESPONSE: - proto_tree_add_item_hidden(http_tree, + proto_tree_add_boolean_hidden(http_tree, hf_http_response, NullTVB, 0, 0, 1); break; case HTTP_REQUEST: - proto_tree_add_item_hidden(http_tree, + proto_tree_add_boolean_hidden(http_tree, hf_http_request, NullTVB, 0, 0, 1); break; diff --git a/packet-icmpv6.c b/packet-icmpv6.c index 2623a46b33..85bc272b67 100644 --- a/packet-icmpv6.c +++ b/packet-icmpv6.c @@ -1,7 +1,7 @@ /* packet-icmpv6.c * Routines for ICMPv6 packet disassembly * - * $Id: packet-icmpv6.c,v 1.16 2000/05/11 08:15:10 gram Exp $ + * $Id: packet-icmpv6.c,v 1.17 2000/05/31 05:07:06 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -345,7 +345,7 @@ dissect_icmpv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { /* !!! specify length */ - ti = proto_tree_add_item(tree, proto_icmpv6, NullTVB, offset, len, NULL); + ti = proto_tree_add_item(tree, proto_icmpv6, NullTVB, offset, len, FALSE); icmp6_tree = proto_item_add_subtree(ti, ett_icmpv6); proto_tree_add_uint_format(icmp6_tree, hf_icmpv6_type, NullTVB, @@ -358,7 +358,7 @@ dissect_icmpv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) dp->icmp6_code, "Code: 0x%02x (%s)", dp->icmp6_code, codename); } - proto_tree_add_item(icmp6_tree, hf_icmpv6_checksum, NullTVB, + proto_tree_add_uint(icmp6_tree, hf_icmpv6_checksum, NullTVB, offset + offsetof(struct icmp6_hdr, icmp6_cksum), 2, (guint16)htons(dp->icmp6_cksum)); diff --git a/packet-icp.c b/packet-icp.c index f890d9603d..f273a29e22 100644 --- a/packet-icp.c +++ b/packet-icp.c @@ -2,7 +2,7 @@ * Routines for ICP (internet cache protocol) packet disassembly * RFC 2186 && RFC 2187 * - * $Id: packet-icp.c,v 1.7 2000/05/11 08:15:10 gram Exp $ + * $Id: packet-icp.c,v 1.8 2000/05/31 05:07:06 guy Exp $ * * Ethereal - Network traffic analyzer * By Peter Torvals @@ -209,8 +209,7 @@ static void dissect_icp(const u_char *pd, int offset, frame_data *fd, if (tree) { - ti = proto_tree_add_item(tree,proto_icp , NullTVB,offset,fd->pkt_len-offset, - NULL); + ti = proto_tree_add_item(tree,proto_icp, NullTVB,offset,fd->pkt_len-offset, FALSE); icp_tree = proto_item_add_subtree(ti, ett_icp); proto_tree_add_uint_format(icp_tree,hf_icp_opcode, NullTVB, offset, 1, diff --git a/packet-imap.c b/packet-imap.c index b4957237d0..b1809a9bdc 100644 --- a/packet-imap.c +++ b/packet-imap.c @@ -2,7 +2,7 @@ * Routines for imap packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-imap.c,v 1.6 2000/05/11 08:15:11 gram Exp $ + * $Id: packet-imap.c,v 1.7 2000/05/31 05:07:07 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -91,12 +91,12 @@ dissect_imap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_imap, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_imap, NullTVB, offset, END_OF_FRAME, FALSE); imap_tree = proto_item_add_subtree(ti, ett_imap); if (pi.match_port == pi.destport) { /* Request */ - proto_tree_add_item_hidden(imap_tree, hf_imap_request, NullTVB, offset, i1, TRUE); + proto_tree_add_boolean_hidden(imap_tree, hf_imap_request, NullTVB, offset, i1, TRUE); proto_tree_add_text(imap_tree, NullTVB, offset, i1, "Request Tag: %s", rr); proto_tree_add_text(imap_tree, NullTVB, offset + i1 + 1, END_OF_FRAME, "Request: %s", rd); @@ -104,7 +104,7 @@ dissect_imap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } else { - proto_tree_add_item_hidden(imap_tree, hf_imap_response, NullTVB, offset, i1, TRUE); + proto_tree_add_boolean_hidden(imap_tree, hf_imap_response, NullTVB, offset, i1, TRUE); proto_tree_add_text(imap_tree, NullTVB, offset, i1, "Response Tag: %s", rr); proto_tree_add_text(imap_tree, NullTVB, offset + i1 + 1, END_OF_FRAME, "Response: %s", rd); diff --git a/packet-ip.c b/packet-ip.c index 7fcee4b385..c3a5e88c44 100644 --- a/packet-ip.c +++ b/packet-ip.c @@ -1,7 +1,7 @@ /* packet-ip.c * Routines for IP and miscellaneous IP protocol packet disassembly * - * $Id: packet-ip.c,v 1.89 2000/05/28 22:59:18 guy Exp $ + * $Id: packet-ip.c,v 1.90 2000/05/31 05:07:08 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -861,10 +861,10 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { break; } - ti = proto_tree_add_item(tree, proto_ip, NullTVB, offset, hlen, NULL); + ti = proto_tree_add_item(tree, proto_ip, NullTVB, offset, hlen, FALSE); ip_tree = proto_item_add_subtree(ti, ett_ip); - proto_tree_add_item(ip_tree, hf_ip_version, NullTVB, offset, 1, hi_nibble(iph.ip_v_hl)); + proto_tree_add_uint(ip_tree, hf_ip_version, NullTVB, offset, 1, hi_nibble(iph.ip_v_hl)); proto_tree_add_uint_format(ip_tree, hf_ip_hdr_len, NullTVB, offset, 1, hlen, "Header length: %u bytes", hlen); @@ -875,40 +875,40 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "Unknown DSCP")); field_tree = proto_item_add_subtree(tf, ett_ip_dsfield); - proto_tree_add_item(field_tree, hf_ip_dsfield_dscp, NullTVB, offset + 1, 1, iph.ip_tos); - proto_tree_add_item(field_tree, hf_ip_dsfield_cu, NullTVB, offset + 1, 1, iph.ip_tos); + proto_tree_add_uint(field_tree, hf_ip_dsfield_dscp, NullTVB, offset + 1, 1, iph.ip_tos); + proto_tree_add_uint(field_tree, hf_ip_dsfield_cu, NullTVB, offset + 1, 1, iph.ip_tos); } else { tf = proto_tree_add_uint_format(ip_tree, hf_ip_tos, NullTVB, offset + 1, 1, iph.ip_tos, "Type of service: 0x%02x (%s)", iph.ip_tos, val_to_str( IPTOS_TOS(iph.ip_tos), iptos_vals, "Unknown") ); field_tree = proto_item_add_subtree(tf, ett_ip_tos); - proto_tree_add_item(field_tree, hf_ip_tos_precedence, NullTVB, offset + 1, 1, iph.ip_tos); - proto_tree_add_item(field_tree, hf_ip_tos_delay, NullTVB, offset + 1, 1, iph.ip_tos); - proto_tree_add_item(field_tree, hf_ip_tos_throughput, NullTVB, offset + 1, 1, iph.ip_tos); - proto_tree_add_item(field_tree, hf_ip_tos_reliability, NullTVB, offset + 1, 1, iph.ip_tos); - proto_tree_add_item(field_tree, hf_ip_tos_cost, NullTVB, offset + 1, 1, iph.ip_tos); + proto_tree_add_uint(field_tree, hf_ip_tos_precedence, NullTVB, offset + 1, 1, iph.ip_tos); + proto_tree_add_boolean(field_tree, hf_ip_tos_delay, NullTVB, offset + 1, 1, iph.ip_tos); + proto_tree_add_boolean(field_tree, hf_ip_tos_throughput, NullTVB, offset + 1, 1, iph.ip_tos); + proto_tree_add_boolean(field_tree, hf_ip_tos_reliability, NullTVB, offset + 1, 1, iph.ip_tos); + proto_tree_add_boolean(field_tree, hf_ip_tos_cost, NullTVB, offset + 1, 1, iph.ip_tos); } - proto_tree_add_item(ip_tree, hf_ip_len, NullTVB, offset + 2, 2, iph.ip_len); - proto_tree_add_item(ip_tree, hf_ip_id, NullTVB, offset + 4, 2, iph.ip_id); + proto_tree_add_uint(ip_tree, hf_ip_len, NullTVB, offset + 2, 2, iph.ip_len); + proto_tree_add_uint(ip_tree, hf_ip_id, NullTVB, offset + 4, 2, iph.ip_id); flags = (iph.ip_off & (IP_DF|IP_MF)) >> 12; - tf = proto_tree_add_item(ip_tree, hf_ip_flags, NullTVB, offset + 6, 1, flags); + tf = proto_tree_add_uint(ip_tree, hf_ip_flags, NullTVB, offset + 6, 1, flags); field_tree = proto_item_add_subtree(tf, ett_ip_off); - proto_tree_add_item(field_tree, hf_ip_flags_df, NullTVB, offset + 6, 1, flags), - proto_tree_add_item(field_tree, hf_ip_flags_mf, NullTVB, offset + 6, 1, flags), + proto_tree_add_boolean(field_tree, hf_ip_flags_df, NullTVB, offset + 6, 1, flags), + proto_tree_add_boolean(field_tree, hf_ip_flags_mf, NullTVB, offset + 6, 1, flags), - proto_tree_add_item(ip_tree, hf_ip_frag_offset, NullTVB, offset + 6, 2, + proto_tree_add_uint(ip_tree, hf_ip_frag_offset, NullTVB, offset + 6, 2, (iph.ip_off & IP_OFFSET)*8); - proto_tree_add_item(ip_tree, hf_ip_ttl, NullTVB, offset + 8, 1, iph.ip_ttl); + proto_tree_add_uint(ip_tree, hf_ip_ttl, NullTVB, offset + 8, 1, iph.ip_ttl); proto_tree_add_uint_format(ip_tree, hf_ip_proto, NullTVB, offset + 9, 1, iph.ip_p, "Protocol: %s (0x%02x)", ipprotostr(iph.ip_p), iph.ip_p); proto_tree_add_uint_format(ip_tree, hf_ip_checksum, NullTVB, offset + 10, 2, iph.ip_sum, "Header checksum: 0x%04x (%s)", iph.ip_sum, ip_checksum_state((e_ip*) &pd[offset])); - proto_tree_add_item(ip_tree, hf_ip_src, NullTVB, offset + 12, 4, iph.ip_src); - proto_tree_add_item(ip_tree, hf_ip_dst, NullTVB, offset + 16, 4, iph.ip_dst); - proto_tree_add_item_hidden(ip_tree, hf_ip_addr, NullTVB, offset + 12, 4, iph.ip_src); - proto_tree_add_item_hidden(ip_tree, hf_ip_addr, NullTVB, offset + 16, 4, iph.ip_dst); + proto_tree_add_ipv4(ip_tree, hf_ip_src, NullTVB, offset + 12, 4, iph.ip_src); + proto_tree_add_ipv4(ip_tree, hf_ip_dst, NullTVB, offset + 16, 4, iph.ip_dst); + proto_tree_add_ipv4_hidden(ip_tree, hf_ip_addr, NullTVB, offset + 12, 4, iph.ip_src); + proto_tree_add_ipv4_hidden(ip_tree, hf_ip_addr, NullTVB, offset + 16, 4, iph.ip_dst); /* Decode IP options, if any. */ if (hlen > sizeof (e_ip)) { @@ -1093,7 +1093,7 @@ dissect_icmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_str(fd, COL_INFO, type_str); if (tree) { - ti = proto_tree_add_item(tree, proto_icmp, NullTVB, offset, 4, NULL); + ti = proto_tree_add_item(tree, proto_icmp, NullTVB, offset, 4, FALSE); icmp_tree = proto_item_add_subtree(ti, ett_icmp); proto_tree_add_uint_format(icmp_tree, hf_icmp_type, NullTVB, offset, 1, ih.icmp_type, @@ -1103,7 +1103,7 @@ dissect_icmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { ih.icmp_code, "Code: %u %s", ih.icmp_code, code_str); - proto_tree_add_item(icmp_tree, hf_icmp_checksum, NullTVB, offset + 2, 2, + proto_tree_add_uint(icmp_tree, hf_icmp_checksum, NullTVB, offset + 2, 2, cksum); /* Decode the second 4 bytes of the packet. */ @@ -1252,9 +1252,9 @@ dissect_igmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { if (check_col(fd, COL_INFO)) col_add_str(fd, COL_INFO, type_str); if (tree) { - ti = proto_tree_add_item(tree, proto_igmp, NullTVB, offset, 8, NULL); + ti = proto_tree_add_item(tree, proto_igmp, NullTVB, offset, 8, FALSE); igmp_tree = proto_item_add_subtree(ti, ett_igmp); - proto_tree_add_item(igmp_tree, hf_igmp_version, NullTVB, offset, 1, + proto_tree_add_uint(igmp_tree, hf_igmp_version, NullTVB, offset, 1, hi_nibble(ih.igmp_v_t)); proto_tree_add_uint_format(igmp_tree, hf_igmp_type, NullTVB, offset , 1, lo_nibble(ih.igmp_v_t), @@ -1264,9 +1264,9 @@ dissect_igmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { ih.igmp_unused, "Unused: 0x%02x", ih.igmp_unused); - proto_tree_add_item(igmp_tree, hf_igmp_checksum, NullTVB, offset + 2, 2, + proto_tree_add_uint(igmp_tree, hf_igmp_checksum, NullTVB, offset + 2, 2, cksum); - proto_tree_add_item(igmp_tree, hf_igmp_group, NullTVB, offset + 4, 4, + proto_tree_add_ipv4(igmp_tree, hf_igmp_group, NullTVB, offset + 4, 4, ih.igmp_gaddr); } } diff --git a/packet-ipp.c b/packet-ipp.c index 32aa93dbde..8bd685005a 100644 --- a/packet-ipp.c +++ b/packet-ipp.c @@ -3,7 +3,7 @@ * * Guy Harris * - * $Id: packet-ipp.c,v 1.9 2000/05/11 08:15:13 gram Exp $ + * $Id: packet-ipp.c,v 1.10 2000/05/31 05:07:09 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -177,7 +177,7 @@ void dissect_ipp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - ti = proto_tree_add_item(tree, proto_ipp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_ipp, NullTVB, offset, END_OF_FRAME, FALSE); ipp_tree = proto_item_add_subtree(ti, ett_ipp); proto_tree_add_text(ipp_tree, NullTVB, offset, 2, "Version: %u.%u", diff --git a/packet-ipsec.c b/packet-ipsec.c index eafdb5ce83..a555432fcf 100644 --- a/packet-ipsec.c +++ b/packet-ipsec.c @@ -1,7 +1,7 @@ /* packet-ipsec.c * Routines for IPsec/IPComp packet disassembly * - * $Id: packet-ipsec.c,v 1.15 2000/05/11 08:15:14 gram Exp $ + * $Id: packet-ipsec.c,v 1.16 2000/05/31 05:07:09 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -120,17 +120,17 @@ dissect_ah(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { /* !!! specify length */ - ti = proto_tree_add_item(tree, proto_ah, NullTVB, offset, advance, NULL); + ti = proto_tree_add_item(tree, proto_ah, NullTVB, offset, advance, FALSE); ah_tree = proto_item_add_subtree(ti, ett_ah); proto_tree_add_text(ah_tree, NullTVB, offset + offsetof(struct newah, ah_nxt), 1, "Next Header: %s (0x%02x)", ipprotostr(ah.ah_nxt), ah.ah_nxt); proto_tree_add_text(ah_tree, NullTVB, offset + offsetof(struct newah, ah_len), 1, "Length: %d", ah.ah_len << 2); - proto_tree_add_item(ah_tree, hf_ah_spi, NullTVB, + proto_tree_add_uint(ah_tree, hf_ah_spi, NullTVB, offset + offsetof(struct newah, ah_spi), 4, (guint32)ntohl(ah.ah_spi)); - proto_tree_add_item(ah_tree, hf_ah_sequence, NullTVB, + proto_tree_add_uint(ah_tree, hf_ah_sequence, NullTVB, offset + offsetof(struct newah, ah_seq), 4, (guint32)ntohl(ah.ah_seq)); proto_tree_add_text(ah_tree, NullTVB, offset + sizeof(ah), (ah.ah_len - 1) << 2, @@ -166,12 +166,12 @@ dissect_esp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) * (ie none) */ if(tree) { - ti = proto_tree_add_item(tree, proto_esp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_esp, NullTVB, offset, END_OF_FRAME, FALSE); esp_tree = proto_item_add_subtree(ti, ett_esp); - proto_tree_add_item(esp_tree, hf_esp_spi, NullTVB, + proto_tree_add_uint(esp_tree, hf_esp_spi, NullTVB, offset + offsetof(struct newesp, esp_spi), 4, (guint32)ntohl(esp.esp_spi)); - proto_tree_add_item(esp_tree, hf_esp_sequence, NullTVB, + proto_tree_add_uint(esp_tree, hf_esp_sequence, NullTVB, offset + offsetof(struct newesp, esp_seq), 4, (guint32)ntohl(esp.esp_seq)); dissect_data(pd, offset + sizeof(struct newesp), fd, esp_tree); @@ -209,19 +209,19 @@ dissect_ipcomp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) */ if (tree) { ti = proto_tree_add_item(tree, proto_ipcomp, NullTVB, offset, END_OF_FRAME, - NULL); + FALSE); ipcomp_tree = proto_item_add_subtree(ti, ett_ipcomp); proto_tree_add_text(ipcomp_tree, NullTVB, offset + offsetof(struct ipcomp, comp_nxt), 1, "Next Header: %s (0x%02x)", ipprotostr(ipcomp.comp_nxt), ipcomp.comp_nxt); - proto_tree_add_item(ipcomp_tree, hf_ipcomp_flags, NullTVB, + proto_tree_add_uint(ipcomp_tree, hf_ipcomp_flags, NullTVB, offset + offsetof(struct ipcomp, comp_flags), 1, ipcomp.comp_flags); p = val_to_str(ntohs(ipcomp.comp_cpi), cpi2val, ""); if (p[0] == '\0') { - proto_tree_add_item(ipcomp_tree, hf_ipcomp_cpi, NullTVB, + proto_tree_add_uint(ipcomp_tree, hf_ipcomp_cpi, NullTVB, offset + offsetof(struct ipcomp, comp_cpi), 2, ntohs(ipcomp.comp_cpi)); } else { diff --git a/packet-ipv6.c b/packet-ipv6.c index 8fc4ff80d5..df1ee69bc2 100644 --- a/packet-ipv6.c +++ b/packet-ipv6.c @@ -1,7 +1,7 @@ /* packet-ipv6.c * Routines for IPv6 packet disassembly * - * $Id: packet-ipv6.c,v 1.37 2000/05/24 07:52:31 guy Exp $ + * $Id: packet-ipv6.c,v 1.38 2000/05/31 05:07:09 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -268,16 +268,16 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { if (tree) { /* !!! specify length */ - ti = proto_tree_add_item(tree, proto_ipv6, NullTVB, offset, 40, NULL); + ti = proto_tree_add_item(tree, proto_ipv6, NullTVB, offset, 40, FALSE); ipv6_tree = proto_item_add_subtree(ti, ett_ipv6); /* !!! warning: version also contains 4 Bit priority */ - proto_tree_add_item(ipv6_tree, hf_ipv6_version, NullTVB, + proto_tree_add_uint(ipv6_tree, hf_ipv6_version, NullTVB, offset + offsetof(struct ip6_hdr, ip6_vfc), 1, (ipv6.ip6_vfc >> 4) & 0x0f); - proto_tree_add_item(ipv6_tree, hf_ipv6_class, NullTVB, + proto_tree_add_uint(ipv6_tree, hf_ipv6_class, NullTVB, offset + offsetof(struct ip6_hdr, ip6_flow), 4, (guint8)((ntohl(ipv6.ip6_flow) >> 20) & 0xff)); @@ -291,7 +291,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "Flowlabel: 0x%05lx", (unsigned long)(ntohl(ipv6.ip6_flow & IPV6_FLOWLABEL_MASK))); - proto_tree_add_item(ipv6_tree, hf_ipv6_plen, NullTVB, + proto_tree_add_uint(ipv6_tree, hf_ipv6_plen, NullTVB, offset + offsetof(struct ip6_hdr, ip6_plen), 2, ntohs(ipv6.ip6_plen)); @@ -301,7 +301,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "Next header: %s (0x%02x)", ipprotostr(ipv6.ip6_nxt), ipv6.ip6_nxt); - proto_tree_add_item(ipv6_tree, hf_ipv6_hlim, NullTVB, + proto_tree_add_uint(ipv6_tree, hf_ipv6_hlim, NullTVB, offset + offsetof(struct ip6_hdr, ip6_hlim), 1, ipv6.ip6_hlim); @@ -363,7 +363,7 @@ again: } #ifdef TEST_FINALHDR - proto_tree_add_item_hidden(ipv6_tree, hf_ipv6_final, NullTVB, poffset, 1, nxt); + proto_tree_add_uint_hidden(ipv6_tree, hf_ipv6_final, NullTVB, poffset, 1, nxt); #endif if (frag) { /* fragmented */ diff --git a/packet-ipx.c b/packet-ipx.c index 1fb9db630b..e69319157f 100644 --- a/packet-ipx.c +++ b/packet-ipx.c @@ -2,7 +2,7 @@ * Routines for NetWare's IPX * Gilbert Ramirez * - * $Id: packet-ipx.c,v 1.60 2000/05/30 03:35:51 guy Exp $ + * $Id: packet-ipx.c,v 1.61 2000/05/31 05:07:10 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -333,21 +333,21 @@ dissect_ipx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { ipx_checksum = pntohs(&pd[offset]); ipx_hops = pd[offset+4]; - ti = proto_tree_add_item(tree, proto_ipx, NullTVB, offset, 30, NULL); + ti = proto_tree_add_item(tree, proto_ipx, NullTVB, offset, 30, FALSE); ipx_tree = proto_item_add_subtree(ti, ett_ipx); - proto_tree_add_item(ipx_tree, hf_ipx_checksum, NullTVB, offset, 2, ipx_checksum); + proto_tree_add_uint(ipx_tree, hf_ipx_checksum, NullTVB, offset, 2, ipx_checksum); proto_tree_add_uint_format(ipx_tree, hf_ipx_len, NullTVB, offset+2, 2, ipx_length, "Length: %d bytes", ipx_length); proto_tree_add_uint_format(ipx_tree, hf_ipx_hops, NullTVB, offset+4, 1, ipx_hops, "Transport Control: %d hops", ipx_hops); - proto_tree_add_item(ipx_tree, hf_ipx_packet_type, NullTVB, offset+5, 1, ipx_type); - proto_tree_add_item(ipx_tree, hf_ipx_dnet, NullTVB, offset+6, 4, ipx_dnet_val); - proto_tree_add_item(ipx_tree, hf_ipx_dnode, NullTVB, offset+10, 6, ipx_dnode); + proto_tree_add_uint(ipx_tree, hf_ipx_packet_type, NullTVB, offset+5, 1, ipx_type); + proto_tree_add_ipxnet(ipx_tree, hf_ipx_dnet, NullTVB, offset+6, 4, ipx_dnet_val); + proto_tree_add_ether(ipx_tree, hf_ipx_dnode, NullTVB, offset+10, 6, ipx_dnode); proto_tree_add_uint_format(ipx_tree, hf_ipx_dsocket, NullTVB, offset+16, 2, ipx_dsocket, "Destination Socket: %s (0x%04X)", port_text(ipx_dsocket), ipx_dsocket); - proto_tree_add_item(ipx_tree, hf_ipx_snet, NullTVB, offset+18, 4, ipx_snet_val); - proto_tree_add_item(ipx_tree, hf_ipx_snode, NullTVB, offset+22, 6, ipx_snode); + proto_tree_add_ipxnet(ipx_tree, hf_ipx_snet, NullTVB, offset+18, 4, ipx_snet_val); + proto_tree_add_ether(ipx_tree, hf_ipx_snode, NullTVB, offset+22, 6, ipx_snode); proto_tree_add_uint_format(ipx_tree, hf_ipx_ssocket, NullTVB, offset+28, 2, ipx_ssocket, "Source Socket: %s (0x%04X)", port_text(ipx_ssocket), ipx_ssocket); @@ -430,7 +430,7 @@ dissect_spx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_str(fd, COL_INFO, "SPX"); if (tree) { - ti = proto_tree_add_item(tree, proto_spx, NullTVB, offset, 12, NULL); + ti = proto_tree_add_item(tree, proto_spx, NullTVB, offset, 12, FALSE); spx_tree = proto_item_add_subtree(ti, ett_spx); proto_tree_add_uint_format(spx_tree, hf_spx_connection_control, NullTVB, @@ -447,23 +447,23 @@ dissect_spx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { spx_datastream(pd[offset+1]), pd[offset+1]); - proto_tree_add_item(spx_tree, hf_spx_src_id, NullTVB, + proto_tree_add_uint(spx_tree, hf_spx_src_id, NullTVB, offset+2, 2, pntohs( &pd[offset+2] )); - proto_tree_add_item(spx_tree, hf_spx_dst_id, NullTVB, + proto_tree_add_uint(spx_tree, hf_spx_dst_id, NullTVB, offset+4, 2, pntohs( &pd[offset+4] )); - proto_tree_add_item(spx_tree, hf_spx_seq_nr, NullTVB, + proto_tree_add_uint(spx_tree, hf_spx_seq_nr, NullTVB, offset+6, 2, pntohs( &pd[offset+6] ) ); - proto_tree_add_item(spx_tree, hf_spx_ack_nr, NullTVB, + proto_tree_add_uint(spx_tree, hf_spx_ack_nr, NullTVB, offset+8, 2, pntohs( &pd[offset+8] ) ); - proto_tree_add_item(spx_tree, hf_spx_all_nr, NullTVB, + proto_tree_add_uint(spx_tree, hf_spx_all_nr, NullTVB, offset+10, 2, pntohs( &pd[offset+10] ) ); @@ -498,11 +498,11 @@ dissect_ipxmsg(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } if (tree) { - ti = proto_tree_add_item(tree, proto_ipxmsg, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_ipxmsg, NullTVB, offset, END_OF_FRAME, FALSE); msg_tree = proto_item_add_subtree(ti, ett_ipxmsg); - proto_tree_add_item(msg_tree, hf_msg_conn, NullTVB, offset, 1, conn_number); - proto_tree_add_item(msg_tree, hf_msg_sigchar, NullTVB, offset+1, 1, sig_char); + proto_tree_add_uint(msg_tree, hf_msg_conn, NullTVB, offset, 1, conn_number); + proto_tree_add_uint(msg_tree, hf_msg_sigchar, NullTVB, offset+1, 1, sig_char); } } @@ -534,7 +534,7 @@ dissect_ipxrip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } if (tree) { - ti = proto_tree_add_item(tree, proto_ipxrip, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_ipxrip, NullTVB, offset, END_OF_FRAME, FALSE); rip_tree = proto_item_add_subtree(ti, ett_ipxrip); if (operation < 2) { @@ -542,11 +542,11 @@ dissect_ipxrip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "RIP packet type: %s", rip_type[operation]); if (operation == 0) { - proto_tree_add_item_hidden(rip_tree, + proto_tree_add_boolean_hidden(rip_tree, hf_ipxrip_request, NullTVB, offset, 2, 1); } else { - proto_tree_add_item_hidden(rip_tree, + proto_tree_add_boolean_hidden(rip_tree, hf_ipxrip_response, NullTVB, offset, 2, 1); } @@ -682,17 +682,17 @@ dissect_ipxsap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } if (tree) { - ti = proto_tree_add_item(tree, proto_sap, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_sap, NullTVB, offset, END_OF_FRAME, FALSE); sap_tree = proto_item_add_subtree(ti, ett_ipxsap); if (query.query_type >= 1 && query.query_type <= 4) { proto_tree_add_text(sap_tree, NullTVB, offset, 2, sap_type[query.query_type - 1]); if ((query.query_type - 1) % 2) { - proto_tree_add_item_hidden(sap_tree, + proto_tree_add_boolean_hidden(sap_tree, hf_sap_response, NullTVB, offset, 2, 1); } else { - proto_tree_add_item_hidden(sap_tree, + proto_tree_add_boolean_hidden(sap_tree, hf_sap_request, NullTVB, offset, 2, 1); } diff --git a/packet-irc.c b/packet-irc.c index e32454954d..4236e24d1b 100644 --- a/packet-irc.c +++ b/packet-irc.c @@ -1,7 +1,7 @@ /* packet-irc.c * Routines for MSX irc packet dissection * - * $Id: packet-irc.c,v 1.5 2000/05/11 08:15:15 gram Exp $ + * $Id: packet-irc.c,v 1.6 2000/05/31 05:07:11 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -55,7 +55,7 @@ static gint ett_irc = -1; static void dissect_irc_request(proto_tree *tree, char *line, int offset, int len) { - proto_tree_add_item_hidden(tree, hf_irc_request, NullTVB, + proto_tree_add_boolean_hidden(tree, hf_irc_request, NullTVB, offset, len, TRUE); proto_tree_add_text(tree, NullTVB, offset, len, "Request Line: %s", line); @@ -64,7 +64,7 @@ dissect_irc_request(proto_tree *tree, char *line, int offset, int len) static void dissect_irc_response(proto_tree *tree, char *line, int offset, int len) { - proto_tree_add_item_hidden(tree, hf_irc_response, NullTVB, + proto_tree_add_boolean_hidden(tree, hf_irc_response, NullTVB, offset, len, TRUE); proto_tree_add_text(tree, NullTVB, offset, len, "Response Line: %s", line); @@ -89,7 +89,7 @@ dissect_irc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_irc, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_irc, NullTVB, offset, END_OF_FRAME, FALSE); irc_tree = proto_item_add_subtree(ti, ett_irc); tmpline = (char *)g_malloc( pi.captured_len ); diff --git a/packet-isakmp.c b/packet-isakmp.c index 33c0538913..0d86879b92 100644 --- a/packet-isakmp.c +++ b/packet-isakmp.c @@ -2,7 +2,7 @@ * Routines for the Internet Security Association and Key Management Protocol (ISAKMP) * Brad Robel-Forrest * - * $Id: packet-isakmp.c,v 1.21 2000/05/22 17:59:53 guy Exp $ + * $Id: packet-isakmp.c,v 1.22 2000/05/31 05:07:11 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -366,7 +366,7 @@ dissect_isakmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_item * ti; proto_tree * isakmp_tree; - ti = proto_tree_add_item(tree, proto_isakmp, NullTVB, offset, len, NULL); + ti = proto_tree_add_item(tree, proto_isakmp, NullTVB, offset, len, FALSE); isakmp_tree = proto_item_add_subtree(ti, ett_isakmp); proto_tree_add_text(isakmp_tree, NullTVB, offset, sizeof(hdr->icookie), diff --git a/packet-isis-clv.c b/packet-isis-clv.c index ed1354af90..7de64f88b6 100644 --- a/packet-isis-clv.c +++ b/packet-isis-clv.c @@ -1,7 +1,7 @@ /* packet-isis-clv.c * Common CLV decode routines. * - * $Id: packet-isis-clv.c,v 1.4 2000/05/11 08:15:16 gram Exp $ + * $Id: packet-isis-clv.c,v 1.5 2000/05/31 05:07:12 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -212,7 +212,7 @@ isis_dissect_ip_int_clv(const u_char *pd, int offset, } memcpy(&addr, &pd[offset], sizeof(addr)); if ( tree ) { - proto_tree_add_item(tree, tree_id, NullTVB, offset, 4, addr); + proto_tree_add_ipv4(tree, tree_id, NullTVB, offset, 4, addr); } offset += 4; length -= 4; diff --git a/packet-isis-hello.c b/packet-isis-hello.c index 519e0e48b3..9f5c96e139 100644 --- a/packet-isis-hello.c +++ b/packet-isis-hello.c @@ -1,7 +1,7 @@ /* packet-isis-hello.c * Routines for decoding isis hello packets and their CLVs * - * $Id: packet-isis-hello.c,v 1.7 2000/05/11 08:15:16 gram Exp $ + * $Id: packet-isis-hello.c,v 1.8 2000/05/31 05:07:12 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -437,7 +437,7 @@ isis_dissect_isis_hello(int hello_type, int header_length, if (tree) { ti = proto_tree_add_item(tree, proto_isis_hello, NullTVB, - offset, END_OF_FRAME, NULL); + offset, END_OF_FRAME, FALSE); hello_tree = proto_item_add_subtree(ti, ett_isis_hello); proto_tree_add_uint_format(hello_tree, hf_isis_hello_circuit_reserved, @@ -453,16 +453,16 @@ isis_dissect_isis_hello(int hello_type, int header_length, offset + 1, 6, ihp->isis_hello_source_id, "SystemID{ Sender of PDU } : %s", print_system_id( pd + offset + 1, 6 ) ); - proto_tree_add_item(hello_tree, hf_isis_hello_holding_timer, NullTVB, + proto_tree_add_uint(hello_tree, hf_isis_hello_holding_timer, NullTVB, offset + 7, 2,pntohs(&ihp->isis_hello_holding_timer[0])); - proto_tree_add_item(hello_tree, hf_isis_hello_pdu_length, NullTVB, + proto_tree_add_uint(hello_tree, hf_isis_hello_pdu_length, NullTVB, offset + 9, 2,pntohs(&ihp->isis_hello_pdu_length[0])); proto_tree_add_uint_format(hello_tree, hf_isis_hello_priority_reserved, NullTVB, offset + 11, 1, ihp->isis_hello_priority_reserved, "Priority : %d, reserved(0x%02x == 0)", ihp->isis_hello_priority, ihp->isis_hello_preserved ); if (hello_type == ISIS_TYPE_PTP_HELLO) { - proto_tree_add_item(hello_tree, hf_isis_hello_local_circuit_id, NullTVB, + proto_tree_add_uint(hello_tree, hf_isis_hello_local_circuit_id, NullTVB, offset + 12, 1, ihp->isis_hello_lan_id[0] ); } else { proto_tree_add_string_format(hello_tree, hf_isis_hello_lan_id, NullTVB, diff --git a/packet-isis-lsp.c b/packet-isis-lsp.c index 0b27029389..5148dcc8c1 100644 --- a/packet-isis-lsp.c +++ b/packet-isis-lsp.c @@ -1,7 +1,7 @@ /* packet-isis-lsp.c * Routines for decoding isis lsp packets and their CLVs * - * $Id: packet-isis-lsp.c,v 1.6 2000/05/11 08:15:16 gram Exp $ + * $Id: packet-isis-lsp.c,v 1.7 2000/05/31 05:07:12 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -791,20 +791,20 @@ isis_dissect_isis_lsp(int lsp_type, int header_length, if (tree) { ti = proto_tree_add_item(tree, proto_isis_lsp, NullTVB, - offset, END_OF_FRAME, NULL); + offset, END_OF_FRAME, FALSE); lsp_tree = proto_item_add_subtree(ti, ett_isis_lsp); - proto_tree_add_item(lsp_tree, hf_isis_lsp_pdu_length, NullTVB, + proto_tree_add_uint(lsp_tree, hf_isis_lsp_pdu_length, NullTVB, offset, 2, pntohs(&ilp->isis_lsp_pdu_length)); - proto_tree_add_item(lsp_tree, hf_isis_lsp_remaining_life, NullTVB, + proto_tree_add_uint(lsp_tree, hf_isis_lsp_remaining_life, NullTVB, offset + 2, 2, pntohs(&ilp->isis_lsp_remaining_life)); isis_lsp_decode_lsp_id("LSP ID", lsp_tree, offset + 4, &ilp->isis_lsp_id ); - proto_tree_add_item(lsp_tree, hf_isis_lsp_sequence_number, NullTVB, + proto_tree_add_uint(lsp_tree, hf_isis_lsp_sequence_number, NullTVB, offset + 12, 4, pntohl(&ilp->isis_lsp_sequence_number)); /* XXX -> we could validate the cksum here! */ - proto_tree_add_item(lsp_tree, hf_isis_lsp_checksum, NullTVB, + proto_tree_add_uint(lsp_tree, hf_isis_lsp_checksum, NullTVB, offset + 16, 2, pntohs(&ilp->isis_lsp_checksum)); /* diff --git a/packet-isis-snp.c b/packet-isis-snp.c index a5ce886790..da82e77cd9 100644 --- a/packet-isis-snp.c +++ b/packet-isis-snp.c @@ -1,7 +1,7 @@ /* packet-isis-snp.c * Routines for decoding isis complete & partial SNP and their payload * - * $Id: packet-isis-snp.c,v 1.4 2000/05/11 08:15:17 gram Exp $ + * $Id: packet-isis-snp.c,v 1.5 2000/05/31 05:07:14 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -254,9 +254,9 @@ isis_dissect_isis_csnp(int type, int header_length, const u_char *pd, if (tree) { ti = proto_tree_add_item(tree, proto_isis_csnp, NullTVB, - offset, END_OF_FRAME, NULL); + offset, END_OF_FRAME, FALSE); csnp_tree = proto_item_add_subtree(ti, ett_isis_csnp); - proto_tree_add_item(csnp_tree, hf_isis_csnp_pdu_length, NullTVB, + proto_tree_add_uint(csnp_tree, hf_isis_csnp_pdu_length, NullTVB, offset, 2, pntohs(&ilp->isis_csnp_pdu_length)); proto_tree_add_text(csnp_tree, NullTVB, offset + 2, 7, "Source id : %s", @@ -322,9 +322,9 @@ isis_dissect_isis_psnp(int type, int header_length, const u_char *pd, if (tree) { ti = proto_tree_add_item(tree, proto_isis_psnp, NullTVB, - offset, END_OF_FRAME, NULL); + offset, END_OF_FRAME, FALSE); psnp_tree = proto_item_add_subtree(ti, ett_isis_psnp); - proto_tree_add_item(psnp_tree, hf_isis_psnp_pdu_length, NullTVB, + proto_tree_add_uint(psnp_tree, hf_isis_psnp_pdu_length, NullTVB, offset, 2, pntohs(&ilp->isis_psnp_pdu_length)); proto_tree_add_text(psnp_tree, NullTVB, offset + 2, 7, "Source id: %s", diff --git a/packet-isis.c b/packet-isis.c index b402506cfc..aefc7f49e2 100644 --- a/packet-isis.c +++ b/packet-isis.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI network and transport protocol packet disassembly, core * bits. * - * $Id: packet-isis.c,v 1.9 2000/05/11 08:15:17 gram Exp $ + * $Id: packet-isis.c,v 1.10 2000/05/31 05:07:15 guy Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -160,15 +160,15 @@ dissect_isis(const u_char *pd, int offset, frame_data *fd, if (tree) { ti = proto_tree_add_item(tree, proto_isis, NullTVB, offset, - END_OF_FRAME, NULL ); + END_OF_FRAME, FALSE ); isis_tree = proto_item_add_subtree(ti, ett_isis); - proto_tree_add_item(isis_tree, hf_isis_irpd, NullTVB, offset, 1, + proto_tree_add_uint(isis_tree, hf_isis_irpd, NullTVB, offset, 1, ihdr->isis_irpd ); - proto_tree_add_item(isis_tree, hf_isis_header_length, NullTVB, + proto_tree_add_uint(isis_tree, hf_isis_header_length, NullTVB, offset + 1, 1, ihdr->isis_header_length ); - proto_tree_add_item(isis_tree, hf_isis_version, NullTVB, + proto_tree_add_uint(isis_tree, hf_isis_version, NullTVB, offset + 2, 1, ihdr->isis_version ); - proto_tree_add_item(isis_tree, hf_isis_system_id_length, NullTVB, + proto_tree_add_uint(isis_tree, hf_isis_system_id_length, NullTVB, offset + 3, 1, ihdr->isis_system_id_len ); proto_tree_add_uint_format(isis_tree, hf_isis_type, NullTVB, offset + 4, 1, ihdr->isis_type, @@ -178,11 +178,11 @@ dissect_isis(const u_char *pd, int offset, frame_data *fd, (ihdr->isis_type & ISIS_R8_MASK) ? "1" : "0", (ihdr->isis_type & ISIS_R7_MASK) ? "1" : "0", (ihdr->isis_type & ISIS_R6_MASK) ? "1" : "0"); - proto_tree_add_item(isis_tree, hf_isis_version2, NullTVB, + proto_tree_add_uint(isis_tree, hf_isis_version2, NullTVB, offset + 5, 1, ihdr->isis_version2 ); - proto_tree_add_item(isis_tree, hf_isis_reserved, NullTVB, + proto_tree_add_uint(isis_tree, hf_isis_reserved, NullTVB, offset + 6, 1, ihdr->isis_reserved ); - proto_tree_add_item(isis_tree, hf_isis_max_area_adr, NullTVB, + proto_tree_add_uint(isis_tree, hf_isis_max_area_adr, NullTVB, offset + 7, 1, ihdr->isis_max_area_adr ); } diff --git a/packet-isl.c b/packet-isl.c index a466f346ad..074d512304 100644 --- a/packet-isl.c +++ b/packet-isl.c @@ -1,7 +1,7 @@ /* packet-isl.c * Routines for Cisco ISL Ethernet header disassembly * - * $Id: packet-isl.c,v 1.11 2000/05/16 06:21:32 gram Exp $ + * $Id: packet-isl.c,v 1.12 2000/05/31 05:07:15 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -162,26 +162,26 @@ dissect_isl(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) ti = proto_tree_add_protocol_format(tree, proto_isl, NullTVB, offset, ISL_HEADER_SIZE, "ISL"); fh_tree = proto_item_add_subtree(ti, ett_isl); - proto_tree_add_item(fh_tree, hf_isl_dst, NullTVB, offset+0, 6, &pd[offset+0]); - proto_tree_add_item_hidden(fh_tree, hf_isl_addr, NullTVB, offset+0, 6, &pd[offset+0]); - proto_tree_add_item(fh_tree, hf_isl_type, NullTVB, offset+5, 1, pd[offset+5]); + proto_tree_add_ether(fh_tree, hf_isl_dst, NullTVB, offset+0, 6, &pd[offset+0]); + proto_tree_add_ether_hidden(fh_tree, hf_isl_addr, NullTVB, offset+0, 6, &pd[offset+0]); + proto_tree_add_uint(fh_tree, hf_isl_type, NullTVB, offset+5, 1, pd[offset+5]); switch (type) { case TYPE_ETHER: - proto_tree_add_item(fh_tree, hf_isl_user_eth, NullTVB, offset+5, 1, + proto_tree_add_uint(fh_tree, hf_isl_user_eth, NullTVB, offset+5, 1, pd[offset+5]&0x03); break; default: /* XXX - the spec appears to indicate that the "User" field is used for TYPE_TR to distinguish between types of packets. */ - proto_tree_add_item(fh_tree, hf_isl_user, NullTVB, offset+5, 1, pd[offset+5]); + proto_tree_add_uint(fh_tree, hf_isl_user, NullTVB, offset+5, 1, pd[offset+5]); break; } - proto_tree_add_item(fh_tree, hf_isl_src, NullTVB, offset+6, 6, &pd[offset+6]); - proto_tree_add_item_hidden(fh_tree, hf_isl_addr, NullTVB, offset+6, 6, &pd[offset+6]); + proto_tree_add_ether(fh_tree, hf_isl_src, NullTVB, offset+6, 6, &pd[offset+6]); + proto_tree_add_ether_hidden(fh_tree, hf_isl_addr, NullTVB, offset+6, 6, &pd[offset+6]); length = pntohs(&pd[offset+12]); - proto_tree_add_item(fh_tree, hf_isl_len, NullTVB, offset+12, 2, length); + proto_tree_add_uint(fh_tree, hf_isl_len, NullTVB, offset+12, 2, length); /* This part looks sort of like a SNAP-encapsulated LLC header... */ proto_tree_add_text(fh_tree, NullTVB, offset+14, 1, "DSAP: 0x%X", pd[offset+14]); @@ -190,18 +190,18 @@ dissect_isl(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) /* ...but this is the manufacturer's ID portion of the source address field (which is, admittedly, an OUI). */ - proto_tree_add_item(fh_tree, hf_isl_hsa, NullTVB, offset+17, 3, + proto_tree_add_uint(fh_tree, hf_isl_hsa, NullTVB, offset+17, 3, pd[offset+17] << 16 | pd[offset+18] << 8 | pd[offset+19]); - proto_tree_add_item(fh_tree, hf_isl_vlan_id, NullTVB, offset+20, 2, + proto_tree_add_uint(fh_tree, hf_isl_vlan_id, NullTVB, offset+20, 2, pntohs(&pd[offset+20])); - proto_tree_add_item(fh_tree, hf_isl_bpdu, NullTVB, offset+20, 2, + proto_tree_add_boolean(fh_tree, hf_isl_bpdu, NullTVB, offset+20, 2, pntohs(&pd[offset+20])); - proto_tree_add_item(fh_tree, hf_isl_index, NullTVB, offset+22, 2, + proto_tree_add_uint(fh_tree, hf_isl_index, NullTVB, offset+22, 2, pntohs(&pd[offset+22])); /* Now for the CRC, which is at the *end* of the packet. */ if (BYTES_ARE_IN_FRAME(pi.len - 4, 4)) { - proto_tree_add_item(fh_tree, hf_isl_crc, NullTVB, pi.len - 4, 4, + proto_tree_add_uint(fh_tree, hf_isl_crc, NullTVB, pi.len - 4, 4, pntohl(&pd[END_OF_FRAME - 4])); } } @@ -214,17 +214,17 @@ dissect_isl(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) break; case TYPE_TR: - proto_tree_add_item(fh_tree, hf_isl_src_vlan_id, NullTVB, offset+24, 2, + proto_tree_add_uint(fh_tree, hf_isl_src_vlan_id, NullTVB, offset+24, 2, pntohs(&pd[offset+24])); - proto_tree_add_item(fh_tree, hf_isl_explorer, NullTVB, offset+24, 2, + proto_tree_add_boolean(fh_tree, hf_isl_explorer, NullTVB, offset+24, 2, pntohs(&pd[offset+24])); - proto_tree_add_item(fh_tree, hf_isl_dst_route_descriptor, NullTVB, offset+26, 2, + proto_tree_add_uint(fh_tree, hf_isl_dst_route_descriptor, NullTVB, offset+26, 2, pntohs(&pd[offset+26])); - proto_tree_add_item(fh_tree, hf_isl_src_route_descriptor, NullTVB, offset+28, 2, + proto_tree_add_uint(fh_tree, hf_isl_src_route_descriptor, NullTVB, offset+28, 2, pntohs(&pd[offset+28])); - proto_tree_add_item(fh_tree, hf_isl_fcs_not_incl, NullTVB, offset+30, 1, + proto_tree_add_boolean(fh_tree, hf_isl_fcs_not_incl, NullTVB, offset+30, 1, pd[offset+30]); - proto_tree_add_item(fh_tree, hf_isl_esize, NullTVB, offset+16, 1, + proto_tree_add_uint(fh_tree, hf_isl_esize, NullTVB, offset+16, 1, pd[offset+30]); next_tvb = tvb_new_subset(pi.compat_top_tvb, offset+31, -1, -1); dissect_tr(next_tvb, &pi, tree); diff --git a/packet-l2tp.c b/packet-l2tp.c index 7daefb6aa9..f5b9032c53 100644 --- a/packet-l2tp.c +++ b/packet-l2tp.c @@ -7,7 +7,7 @@ * Laurent Cazalet * Thomas Parvais * - * $Id: packet-l2tp.c,v 1.9 2000/05/11 08:15:17 gram Exp $ + * $Id: packet-l2tp.c,v 1.10 2000/05/31 05:07:15 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -336,7 +336,7 @@ dissect_l2tp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_fstr(fd,COL_INFO,textbuffer); } if (tree) { - ti = proto_tree_add_item(tree,proto_l2tp, NullTVB, offset, length , NULL); + ti = proto_tree_add_item(tree,proto_l2tp, NullTVB, offset, length, FALSE); l2tp_tree = proto_item_add_subtree(ti, ett_l2tp); proto_tree_add_uint_format(l2tp_tree,hf_l2tp_code, NullTVB, offset ,1, rhcode, "Packet Type: %s Tunnel Id=%d Session Id=%d",( CONTROL_BIT(ver) ? control_msg : data_msg) ,tid,cid); diff --git a/packet-lapd.c b/packet-lapd.c index 75959b5c39..9808d7f57c 100644 --- a/packet-lapd.c +++ b/packet-lapd.c @@ -2,7 +2,7 @@ * Routines for LAPD frame disassembly * Gilbert Ramirez * - * $Id: packet-lapd.c,v 1.10 2000/05/31 03:58:54 gram Exp $ + * $Id: packet-lapd.c,v 1.11 2000/05/31 05:07:16 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -121,17 +121,17 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_lapd, tvb, 0, 3, NULL); + ti = proto_tree_add_item(tree, proto_lapd, tvb, 0, 3, FALSE); lapd_tree = proto_item_add_subtree(ti, ett_lapd); - ti = proto_tree_add_item(lapd_tree, hf_lapd_address, tvb, 0, 2, address); + ti = proto_tree_add_uint(lapd_tree, hf_lapd_address, tvb, 0, 2, address); addr_tree = proto_item_add_subtree(ti, ett_lapd_address); - proto_tree_add_item(addr_tree, hf_lapd_sapi,tvb, 0, 1, address); - proto_tree_add_item(addr_tree, hf_lapd_cr, tvb, 0, 1, address); - proto_tree_add_item(addr_tree, hf_lapd_ea1, tvb, 0, 1, address); - proto_tree_add_item(addr_tree, hf_lapd_tei, tvb, 1, 1, address); - proto_tree_add_item(addr_tree, hf_lapd_ea2, tvb, 1, 1, address); + proto_tree_add_uint(addr_tree, hf_lapd_sapi,tvb, 0, 1, address); + proto_tree_add_uint(addr_tree, hf_lapd_cr, tvb, 0, 1, address); + proto_tree_add_uint(addr_tree, hf_lapd_ea1, tvb, 0, 1, address); + proto_tree_add_uint(addr_tree, hf_lapd_tei, tvb, 1, 1, address); + proto_tree_add_uint(addr_tree, hf_lapd_ea2, tvb, 1, 1, address); } else { lapd_tree = NULL; diff --git a/packet-ldap.c b/packet-ldap.c index d70aee9824..3fdda66fbd 100644 --- a/packet-ldap.c +++ b/packet-ldap.c @@ -1,7 +1,7 @@ /* packet-ldap.c * Routines for ldap packet dissection * - * $Id: packet-ldap.c,v 1.11 2000/05/12 08:04:29 guy Exp $ + * $Id: packet-ldap.c,v 1.12 2000/05/31 05:07:16 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -152,7 +152,7 @@ static int read_length(ASN1_SCK *a, proto_tree *tree, int hf_id, guint *len) *len = length; if (tree) - proto_tree_add_item(tree, hf_id, NullTVB, start-a->begin, a->pointer-start, length); + proto_tree_add_uint(tree, hf_id, NullTVB, start-a->begin, a->pointer-start, length); return 0; } @@ -204,7 +204,7 @@ static int read_integer_value(ASN1_SCK *a, proto_tree *tree, int hf_id, if (tree) { proto_tree *temp_tree = 0; - temp_tree = proto_tree_add_item(tree, hf_id, NullTVB, start-a->begin, a->pointer-start, integer); + temp_tree = proto_tree_add_uint(tree, hf_id, NullTVB, start-a->begin, a->pointer-start, integer); if (new_tree) *new_tree = temp_tree; } @@ -228,6 +228,43 @@ static int read_integer(ASN1_SCK *a, proto_tree *tree, int hf_id, return read_integer_value(a, tree, hf_id, new_tree, i, start, length); } +static int read_boolean_value(ASN1_SCK *a, proto_tree *tree, int hf_id, + proto_tree **new_tree, guint *i, const guchar *start, guint length) +{ + guint integer = 0; + + asn1_uint32_value_decode(a, length, &integer); + + if (i) + *i = integer; + + if (tree) + { + proto_tree *temp_tree = 0; + temp_tree = proto_tree_add_boolean(tree, hf_id, NullTVB, start-a->begin, a->pointer-start, integer); + if (new_tree) + *new_tree = temp_tree; + } + + return 0; +} + +static int read_boolean(ASN1_SCK *a, proto_tree *tree, int hf_id, + proto_tree **new_tree, guint *i) +{ + guint cls, con, tag; + gboolean def; + guint length; + const guchar *start = a->pointer; + + if (asn1_header_decode(a, &cls, &con, &tag, &def, &length) != ASN1_ERR_NOERROR) + return 1; + if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_BOL) + return 1; + + return read_boolean_value(a, tree, hf_id, new_tree, i, start, length); +} + static void read_string_value(ASN1_SCK *a, proto_tree *tree, int hf_id, proto_tree **new_tree, char **s, const guchar *start, guint length) { @@ -245,7 +282,7 @@ static void read_string_value(ASN1_SCK *a, proto_tree *tree, int hf_id, if (tree) { proto_tree *temp_tree; - temp_tree = proto_tree_add_item(tree, hf_id, NullTVB, start - a->begin, a->pointer - start, string); + temp_tree = proto_tree_add_string(tree, hf_id, NullTVB, start - a->begin, a->pointer - start, string); if (new_tree) *new_tree = temp_tree; } @@ -535,7 +572,7 @@ static int read_filter(ASN1_SCK *a, proto_tree *tree, int hf_id) proto_tree_add_text(tree, NullTVB, start-a->begin, 0, "Error parsing filter (%d)", ret); } else - proto_tree_add_item(tree, hf_id, NullTVB, start-a->begin, a->pointer-start, filter); + proto_tree_add_string(tree, hf_id, NullTVB, start-a->begin, a->pointer-start, filter); } g_free(filter); @@ -586,7 +623,7 @@ static int dissect_ldap_request_bind(ASN1_SCK *a, proto_tree *tree) return 1; /* XXX - right return value for an error? */ if (cls != ASN1_CTX) return 1; /* RFCs 1777 and 2251 say these are context-specific types */ - proto_tree_add_item(tree, hf_ldap_message_bind_auth, NullTVB, start - a->begin, + proto_tree_add_uint(tree, hf_ldap_message_bind_auth, NullTVB, start - a->begin, a->pointer - start, tag); switch (tag) { @@ -620,7 +657,7 @@ static int dissect_ldap_request_search(ASN1_SCK *a, proto_tree *tree) read_integer(a, tree, hf_ldap_message_search_deref, 0, 0, ASN1_ENUM); read_integer(a, tree, hf_ldap_message_search_sizeLimit, 0, 0, ASN1_INT); read_integer(a, tree, hf_ldap_message_search_timeLimit, 0, 0, ASN1_INT); - read_integer(a, tree, hf_ldap_message_search_typesOnly, 0, 0, ASN1_BOL); + read_boolean(a, tree, hf_ldap_message_search_typesOnly, 0, 0); ret = read_filter(a, tree, hf_ldap_message_search_filter); if (ret != ASN1_ERR_NOERROR) return ret; @@ -704,7 +741,7 @@ static int dissect_ldap_request_modifyrdn(ASN1_SCK *a, proto_tree *tree, read_string(a, tree, hf_ldap_message_dn, 0, 0, ASN1_UNI, ASN1_OTS); read_string(a, tree, hf_ldap_message_modrdn_name, 0, 0, ASN1_UNI, ASN1_OTS); - read_integer(a, tree, hf_ldap_message_modrdn_delete, 0, 0, ASN1_BOL); + read_boolean(a, tree, hf_ldap_message_modrdn_delete, 0, 0); if (a->pointer < (start + length)) { /* LDAP V3 Modify DN operation, with newSuperior */ @@ -732,7 +769,7 @@ static int dissect_ldap_request_compare(ASN1_SCK *a, proto_tree *tree) length = 2 + strlen(string1) + strlen(string2); compare = g_malloc0(length); snprintf(compare, length, "%s=%s", string1, string2); - proto_tree_add_item(tree, hf_ldap_message_compare, NullTVB, start-a->begin, a->pointer-start, compare); + proto_tree_add_string(tree, hf_ldap_message_compare, NullTVB, start-a->begin, a->pointer-start, compare); g_free(string1); g_free(string2); @@ -807,7 +844,7 @@ dissect_ldap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_ldap, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_ldap, NullTVB, offset, END_OF_FRAME, FALSE); ldap_tree = proto_item_add_subtree(ti, ett_ldap); } @@ -862,8 +899,8 @@ dissect_ldap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (ldap_tree) { - proto_tree_add_item_hidden(ldap_tree, hf_ldap_message_id, NullTVB, message_id_start, message_id_length, messageId); - proto_tree_add_item_hidden(ldap_tree, hf_ldap_message_type, NullTVB, + proto_tree_add_uint_hidden(ldap_tree, hf_ldap_message_id, NullTVB, message_id_start, message_id_length, messageId); + proto_tree_add_uint_hidden(ldap_tree, hf_ldap_message_type, NullTVB, start - a.begin, a.pointer - start, protocolOpTag); ti = proto_tree_add_text(ldap_tree, NullTVB, message_id_start, messageLength, "Message: Id=%u %s", messageId, typestr); msg_tree = proto_item_add_subtree(ti, ett_ldap_message); @@ -985,12 +1022,12 @@ proto_register_ldap(void) static hf_register_info hf[] = { { &hf_ldap_length, { "Length", "ldap.length", - FT_INT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "LDAP Length" }}, { &hf_ldap_message_id, { "Message Id", "ldap.message_id", - FT_INT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "LDAP Message Id" }}, { &hf_ldap_message_type, { "Message Type", "ldap.message_type", @@ -998,12 +1035,12 @@ proto_register_ldap(void) "LDAP Message Type" }}, { &hf_ldap_message_length, { "Message Length", "ldap.message_length", - FT_INT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "LDAP Message Length" }}, { &hf_ldap_message_result, { "Result Code", "ldap.result.code", - FT_INT8, BASE_HEX, result_codes, 0x0, + FT_UINT8, BASE_HEX, result_codes, 0x0, "LDAP Result Code" }}, { &hf_ldap_message_result_matcheddn, { "Matched DN", "ldap.result.matcheddn", @@ -1020,7 +1057,7 @@ proto_register_ldap(void) { &hf_ldap_message_bind_version, { "Version", "ldap.bind.version", - FT_INT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "LDAP Bind Version" }}, { &hf_ldap_message_bind_dn, { "DN", "ldap.bind.dn", @@ -1049,11 +1086,11 @@ proto_register_ldap(void) "LDAP Search Dereference" }}, { &hf_ldap_message_search_sizeLimit, { "Size Limit", "ldap.search.sizelimit", - FT_INT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "LDAP Search Size Limit" }}, { &hf_ldap_message_search_timeLimit, { "Time Limit", "ldap.search.timelimit", - FT_INT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "LDAP Search Time Limit" }}, { &hf_ldap_message_search_typesOnly, { "Attributes Only", "ldap.search.typesonly", @@ -1109,7 +1146,7 @@ proto_register_ldap(void) { &hf_ldap_message_abandon_msgid, { "Abandon Msg Id", "ldap.abandon.msgid", - FT_INT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "LDAP Abandon Msg Id" }}, }; @@ -1130,4 +1167,3 @@ proto_reg_handoff_ldap(void) { dissector_add("tcp.port", TCP_PORT_LDAP, dissect_ldap); } - diff --git a/packet-llc.c b/packet-llc.c index b18544c68d..1f060a9b7d 100644 --- a/packet-llc.c +++ b/packet-llc.c @@ -2,7 +2,7 @@ * Routines for IEEE 802.2 LLC layer * Gilbert Ramirez * - * $Id: packet-llc.c,v 1.64 2000/05/31 03:58:54 gram Exp $ + * $Id: packet-llc.c,v 1.65 2000/05/31 05:07:17 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -286,20 +286,20 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dsap = tvb_get_guint8(tvb, 0); if (tree) { - ti = proto_tree_add_item(tree, proto_llc, tvb, 0, 0, NULL); + ti = proto_tree_add_item(tree, proto_llc, tvb, 0, 0, FALSE); llc_tree = proto_item_add_subtree(ti, ett_llc); - proto_tree_add_item(llc_tree, hf_llc_dsap, tvb, 0, + proto_tree_add_uint(llc_tree, hf_llc_dsap, tvb, 0, 1, dsap & SAP_MASK); - proto_tree_add_item(llc_tree, hf_llc_dsap_ig, tvb, 0, + proto_tree_add_boolean(llc_tree, hf_llc_dsap_ig, tvb, 0, 1, dsap & DSAP_GI_BIT); } else llc_tree = NULL; ssap = tvb_get_guint8(tvb, 1); if (tree) { - proto_tree_add_item(llc_tree, hf_llc_ssap, tvb, 1, + proto_tree_add_uint(llc_tree, hf_llc_ssap, tvb, 1, 1, ssap & SAP_MASK); - proto_tree_add_item(llc_tree, hf_llc_ssap_cr, tvb, 1, + proto_tree_add_boolean(llc_tree, hf_llc_ssap_cr, tvb, 1, 1, ssap & SSAP_CR_BIT); } else llc_tree = NULL; @@ -315,7 +315,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ control = dissect_xdlc_control(tvb, 2, pinfo, llc_tree, hf_llc_ctrl, ett_llc_ctrl, - tvb_get_guint8(tvb, 1) & SSAP_CR_BIT, TRUE); + ssap & SSAP_CR_BIT, TRUE); llc_header_len += XDLC_CONTROL_LEN(control, TRUE); if (is_snap) llc_header_len += 5; /* 3 bytes of OUI, 2 bytes of protocol ID */ @@ -338,7 +338,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) etype); } if (tree) { - proto_tree_add_item(llc_tree, hf_llc_oui, tvb, 3, 3, + proto_tree_add_uint(llc_tree, hf_llc_oui, tvb, 3, 3, oui); } @@ -370,7 +370,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) are some of them raw or encapsulated Ethernet? */ if (tree) { - proto_tree_add_item(llc_tree, + proto_tree_add_uint(llc_tree, hf_llc_pid, tvb, 6, 2, etype); } if (XDLC_IS_INFORMATION(control)) { @@ -404,7 +404,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case OUI_CABLE_BPDU: /* DOCSIS cable modem spanning tree BPDU */ if (tree) { - proto_tree_add_item(llc_tree, + proto_tree_add_uint(llc_tree, hf_llc_pid, tvb, 6, 2, etype); } dissect_bpdu(pd, offset, pinfo->fd, tree); @@ -412,7 +412,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) default: if (tree) { - proto_tree_add_item(llc_tree, + proto_tree_add_uint(llc_tree, hf_llc_pid, tvb, 6, 2, etype); } dissect_data_tvb(next_tvb, pinfo, tree); diff --git a/packet-lpd.c b/packet-lpd.c index f354757101..d457f5bf7f 100644 --- a/packet-lpd.c +++ b/packet-lpd.c @@ -2,7 +2,7 @@ * Routines for LPR and LPRng packet disassembly * Gilbert Ramirez * - * $Id: packet-lpd.c,v 1.19 2000/05/11 08:15:23 gram Exp $ + * $Id: packet-lpd.c,v 1.20 2000/05/31 05:07:17 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -105,13 +105,13 @@ dissect_lpd(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { ti = proto_tree_add_item(tree, proto_lpd, NullTVB, offset, - END_OF_FRAME, NULL); + END_OF_FRAME, FALSE); lpd_tree = proto_item_add_subtree(ti, ett_lpd); if (lpr_packet_type == response) { - proto_tree_add_item_hidden(lpd_tree, hf_lpd_response, NullTVB, 0, 0, TRUE); + proto_tree_add_boolean_hidden(lpd_tree, hf_lpd_response, NullTVB, 0, 0, TRUE); } else { - proto_tree_add_item_hidden(lpd_tree, hf_lpd_request, NullTVB, 0, 0, TRUE); + proto_tree_add_boolean_hidden(lpd_tree, hf_lpd_request, NullTVB, 0, 0, TRUE); } if (lpr_packet_type == request) { diff --git a/packet-mapi.c b/packet-mapi.c index 32672b0622..b0c1e0bff0 100644 --- a/packet-mapi.c +++ b/packet-mapi.c @@ -1,7 +1,7 @@ /* packet-mapi.c * Routines for MSX mapi packet dissection * - * $Id: packet-mapi.c,v 1.6 2000/05/11 08:15:23 gram Exp $ + * $Id: packet-mapi.c,v 1.7 2000/05/31 05:07:18 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -66,19 +66,19 @@ dissect_mapi(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_mapi, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_mapi, NullTVB, offset, END_OF_FRAME, FALSE); mapi_tree = proto_item_add_subtree(ti, ett_mapi); if (pi.match_port == pi.destport) { - proto_tree_add_item_hidden(mapi_tree, hf_mapi_request, NullTVB, + proto_tree_add_boolean_hidden(mapi_tree, hf_mapi_request, NullTVB, offset, END_OF_FRAME, TRUE); proto_tree_add_text(mapi_tree, NullTVB, offset, END_OF_FRAME, "Request: " ); } else { - proto_tree_add_item_hidden(mapi_tree, hf_mapi_response, NullTVB, + proto_tree_add_boolean_hidden(mapi_tree, hf_mapi_response, NullTVB, offset, END_OF_FRAME, TRUE); proto_tree_add_text(mapi_tree, NullTVB, offset, END_OF_FRAME, "Response: "); diff --git a/packet-mip.c b/packet-mip.c index c216273987..ce71552fd1 100644 --- a/packet-mip.c +++ b/packet-mip.c @@ -2,7 +2,7 @@ * Routines for Mobile IP dissection * Copyright 2000, Stefan Raab * - * $Id: packet-mip.c,v 1.3 2000/05/27 17:51:15 guy Exp $ + * $Id: packet-mip.c,v 1.4 2000/05/31 05:07:18 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -165,23 +165,23 @@ dissect_mip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_INFO, "Mobile IP Registration Request"); if (tree) { - ti = proto_tree_add_item(tree, proto_mip, tvb, 0, tvb_length(tvb), NULL); + ti = proto_tree_add_item(tree, proto_mip, tvb, 0, tvb_length(tvb), FALSE); mip_tree = proto_item_add_subtree(ti, ett_mip); - proto_tree_add_item(mip_tree, hf_mip_type, 0, 1, type); + proto_tree_add_int(mip_tree, hf_mip_type, tvb, 0, 1, type); code = tvb_get_guint8(tvb, 1); - proto_tree_add_item(mip_tree, hf_mip_s, tvb, 1, 1, code); - proto_tree_add_item(mip_tree, hf_mip_b, tvb, 1, 1, code); - proto_tree_add_item(mip_tree, hf_mip_d, tvb, 1, 1, code); - proto_tree_add_item(mip_tree, hf_mip_m, tvb, 1, 1, code); - proto_tree_add_item(mip_tree, hf_mip_g, tvb, 1, 1, code); - proto_tree_add_item(mip_tree, hf_mip_v, tvb, 1, 1, code); + proto_tree_add_boolean(mip_tree, hf_mip_s, tvb, 1, 1, code); + proto_tree_add_boolean(mip_tree, hf_mip_b, tvb, 1, 1, code); + proto_tree_add_boolean(mip_tree, hf_mip_d, tvb, 1, 1, code); + proto_tree_add_boolean(mip_tree, hf_mip_m, tvb, 1, 1, code); + proto_tree_add_boolean(mip_tree, hf_mip_g, tvb, 1, 1, code); + proto_tree_add_boolean(mip_tree, hf_mip_v, tvb, 1, 1, code); - proto_tree_add_item(mip_tree, hf_mip_life, tvb, 2, 2, tvb_get_ntohs(tvb, 2)); - proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, 4, 4, tvb_get_letohl(tvb, 4)); - proto_tree_add_item(mip_tree, hf_mip_haaddr, tvb, 8, 4, tvb_get_letohl(tvb, 8)); - proto_tree_add_item(mip_tree, hf_mip_coa, tvb, 12, 4, tvb_get_letohl(tvb, 12)); - proto_tree_add_item(mip_tree, hf_mip_ident, tvb, 16, 8, tvb_get_ptr(tvb, 16, 8)); + proto_tree_add_int(mip_tree, hf_mip_life, tvb, 2, 2, tvb_get_ntohs(tvb, 2)); + proto_tree_add_ipv4(mip_tree, hf_mip_homeaddr, tvb, 4, 4, tvb_get_letohl(tvb, 4)); + proto_tree_add_ipv4(mip_tree, hf_mip_haaddr, tvb, 8, 4, tvb_get_letohl(tvb, 8)); + proto_tree_add_ipv4(mip_tree, hf_mip_coa, tvb, 12, 4, tvb_get_letohl(tvb, 12)); + proto_tree_add_bytes(mip_tree, hf_mip_ident, tvb, 16, 8, tvb_get_ptr(tvb, 16, 8)); } } @@ -191,16 +191,16 @@ dissect_mip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_INFO, "Mobile IP Registration Reply"); if (tree) { - ti = proto_tree_add_item(tree, proto_mip, tvb, 0, tvb_length(tvb), NULL); + ti = proto_tree_add_item(tree, proto_mip, tvb, 0, tvb_length(tvb), FALSE); mip_tree = proto_item_add_subtree(ti, ett_mip); - proto_tree_add_item(mip_tree, hf_mip_type, tvb, 0, 1, type); + proto_tree_add_int(mip_tree, hf_mip_type, tvb, 0, 1, type); code = tvb_get_guint8(tvb, 1); - proto_tree_add_item(mip_tree, hf_mip_code, tvb, 1, 1, code); - proto_tree_add_item(mip_tree, hf_mip_life, tvb, 2, 2, tvb_get_ntohs(tvb, 2)); - proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, 4, 4, tvb_get_letohl(tvb, 4)); - proto_tree_add_item(mip_tree, hf_mip_haaddr, tvb, 8, 4, tvb_get_letohl(tvb, 8)); - proto_tree_add_item(mip_tree, hf_mip_ident, tvb, 12, 8, tvb_get_ptr(tvb, 12, 8)); + proto_tree_add_uint(mip_tree, hf_mip_code, tvb, 1, 1, code); + proto_tree_add_int(mip_tree, hf_mip_life, tvb, 2, 2, tvb_get_ntohs(tvb, 2)); + proto_tree_add_ipv4(mip_tree, hf_mip_homeaddr, tvb, 4, 4, tvb_get_letohl(tvb, 4)); + proto_tree_add_ipv4(mip_tree, hf_mip_haaddr, tvb, 8, 4, tvb_get_letohl(tvb, 8)); + proto_tree_add_bytes(mip_tree, hf_mip_ident, tvb, 12, 8, tvb_get_ptr(tvb, 12, 8)); } } } diff --git a/packet-mount.c b/packet-mount.c index 349b68b9fb..97d05ce9c4 100644 --- a/packet-mount.c +++ b/packet-mount.c @@ -1,7 +1,7 @@ /* packet-mount.c * Routines for mount dissection * - * $Id: packet-mount.c,v 1.14 2000/05/11 08:15:23 gram Exp $ + * $Id: packet-mount.c,v 1.15 2000/05/31 05:07:18 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -86,7 +86,7 @@ dissect_fhstatus(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; status = EXTRACT_UINT(pd, offset+0); if (tree) { - proto_tree_add_item(tree, hf_mount_status, NullTVB, offset, 4, status); + proto_tree_add_uint(tree, hf_mount_status, NullTVB, offset, 4, status); } offset += 4; @@ -140,7 +140,7 @@ dissect_mountlist(const u_char *pd, int offset, frame_data *fd, proto_tree *tree if (tree) { mountlist_item = proto_tree_add_item(tree, hf_mount_mountlist, NullTVB, - offset+0, END_OF_FRAME, NULL); + offset+0, END_OF_FRAME, FALSE); if (mountlist_item) mountlist_tree = proto_item_add_subtree(mountlist_item, ett_mount_mountlist); } @@ -199,7 +199,7 @@ dissect_exportlist(const u_char *pd, int offset, frame_data *fd, proto_tree *tre if (tree) { exportlist_item = proto_tree_add_item(tree, hf_mount_exportlist, NullTVB, - offset+0, END_OF_FRAME, NULL); + offset+0, END_OF_FRAME, FALSE); if (exportlist_item) exportlist_tree = proto_item_add_subtree(exportlist_item, ett_mount_exportlist); } @@ -208,7 +208,7 @@ dissect_exportlist(const u_char *pd, int offset, frame_data *fd, proto_tree *tre groups_offset = offset; if (tree) { groups_item = proto_tree_add_item(exportlist_tree, hf_mount_groups, NullTVB, - offset+0, END_OF_FRAME, NULL); + offset+0, END_OF_FRAME, FALSE); if (groups_item) groups_tree = proto_item_add_subtree(groups_item, ett_mount_groups); } @@ -330,7 +330,7 @@ dissect_mount_pathconf_reply(const u_char *pd, int offset, frame_data *fd, return offset; if (!(pc_mask & (PC_ERROR_LINK_MAX|PC_ERROR_ALL))) { if (tree) { - proto_tree_add_item(tree, + proto_tree_add_uint(tree, hf_mount_pathconf_link_max, NullTVB, offset, 4, EXTRACT_UINT(pd, offset+0)); } @@ -341,7 +341,7 @@ dissect_mount_pathconf_reply(const u_char *pd, int offset, frame_data *fd, return offset; if (!(pc_mask & (PC_ERROR_MAX_CANON|PC_ERROR_ALL))) { if (tree) { - proto_tree_add_item(tree, + proto_tree_add_uint(tree, hf_mount_pathconf_max_canon, NullTVB, offset + 2, 2, (EXTRACT_UINT(pd, offset+0)) & 0xFFFF); } @@ -353,7 +353,7 @@ dissect_mount_pathconf_reply(const u_char *pd, int offset, frame_data *fd, return offset; if (!(pc_mask & (PC_ERROR_MAX_INPUT|PC_ERROR_ALL))) { if (tree) { - proto_tree_add_item(tree, + proto_tree_add_uint(tree, hf_mount_pathconf_max_input, NullTVB, offset + 2, 2, (EXTRACT_UINT(pd, offset+0)) & 0xFFFF); } @@ -364,7 +364,7 @@ dissect_mount_pathconf_reply(const u_char *pd, int offset, frame_data *fd, return offset; if (!(pc_mask & (PC_ERROR_NAME_MAX|PC_ERROR_ALL))) { if (tree) { - proto_tree_add_item(tree, + proto_tree_add_uint(tree, hf_mount_pathconf_name_max, NullTVB, offset + 2, 2, (EXTRACT_UINT(pd, offset+0)) & 0xFFFF); } @@ -375,7 +375,7 @@ dissect_mount_pathconf_reply(const u_char *pd, int offset, frame_data *fd, return offset; if (!(pc_mask & (PC_ERROR_PATH_MAX|PC_ERROR_ALL))) { if (tree) { - proto_tree_add_item(tree, + proto_tree_add_uint(tree, hf_mount_pathconf_path_max, NullTVB, offset + 2, 2, (EXTRACT_UINT(pd, offset+0)) & 0xFFFF); } @@ -386,7 +386,7 @@ dissect_mount_pathconf_reply(const u_char *pd, int offset, frame_data *fd, return offset; if (!(pc_mask & (PC_ERROR_PIPE_BUF|PC_ERROR_ALL))) { if (tree) { - proto_tree_add_item(tree, + proto_tree_add_uint(tree, hf_mount_pathconf_pipe_buf, NullTVB, offset + 2, 2, (EXTRACT_UINT(pd, offset+0)) & 0xFFFF); } @@ -399,7 +399,7 @@ dissect_mount_pathconf_reply(const u_char *pd, int offset, frame_data *fd, return offset; if (!(pc_mask & (PC_ERROR_VDISABLE|PC_ERROR_ALL))) { if (tree) { - proto_tree_add_item(tree, + proto_tree_add_uint(tree, hf_mount_pathconf_vdisable, NullTVB, offset + 3, 1, (EXTRACT_UINT(pd, offset+0)) & 0xFF); } @@ -407,28 +407,28 @@ dissect_mount_pathconf_reply(const u_char *pd, int offset, frame_data *fd, offset += 4; if (tree) { - ti = proto_tree_add_item(tree, hf_mount_pathconf_mask, NullTVB, + ti = proto_tree_add_uint(tree, hf_mount_pathconf_mask, NullTVB, offset + 2, 2, pc_mask); mask_tree = proto_item_add_subtree(ti, ett_mount_pathconf_mask); - proto_tree_add_item(mask_tree, hf_mount_pathconf_error_all, NullTVB, + proto_tree_add_boolean(mask_tree, hf_mount_pathconf_error_all, NullTVB, offset + 2, 2, pc_mask); - proto_tree_add_item(mask_tree, hf_mount_pathconf_error_link_max, NullTVB, + proto_tree_add_boolean(mask_tree, hf_mount_pathconf_error_link_max, NullTVB, offset + 2, 2, pc_mask); - proto_tree_add_item(mask_tree, hf_mount_pathconf_error_max_canon, NullTVB, + proto_tree_add_boolean(mask_tree, hf_mount_pathconf_error_max_canon, NullTVB, offset + 2, 2, pc_mask); - proto_tree_add_item(mask_tree, hf_mount_pathconf_error_max_input, NullTVB, + proto_tree_add_boolean(mask_tree, hf_mount_pathconf_error_max_input, NullTVB, offset + 2, 2, pc_mask); - proto_tree_add_item(mask_tree, hf_mount_pathconf_error_name_max, NullTVB, + proto_tree_add_boolean(mask_tree, hf_mount_pathconf_error_name_max, NullTVB, offset + 2, 2, pc_mask); - proto_tree_add_item(mask_tree, hf_mount_pathconf_error_path_max, NullTVB, + proto_tree_add_boolean(mask_tree, hf_mount_pathconf_error_path_max, NullTVB, offset + 2, 2, pc_mask); - proto_tree_add_item(mask_tree, hf_mount_pathconf_error_pipe_buf, NullTVB, + proto_tree_add_boolean(mask_tree, hf_mount_pathconf_error_pipe_buf, NullTVB, offset + 2, 2, pc_mask); - proto_tree_add_item(mask_tree, hf_mount_pathconf_chown_restricted, NullTVB, + proto_tree_add_boolean(mask_tree, hf_mount_pathconf_chown_restricted, NullTVB, offset + 2, 2, pc_mask); - proto_tree_add_item(mask_tree, hf_mount_pathconf_no_trunc, NullTVB, + proto_tree_add_boolean(mask_tree, hf_mount_pathconf_no_trunc, NullTVB, offset + 2, 2, pc_mask); - proto_tree_add_item(mask_tree, hf_mount_pathconf_error_vdisable, NullTVB, + proto_tree_add_boolean(mask_tree, hf_mount_pathconf_error_vdisable, NullTVB, offset + 2, 2, pc_mask); } offset += 4; @@ -510,7 +510,7 @@ dissect_mountstat3(const u_char *pd, int offset, frame_data *fd, proto_tree *tre mountstat3 = EXTRACT_UINT(pd, offset+0); if (tree) { - proto_tree_add_item(tree, hfindex, NullTVB, offset, 4, mountstat3); + proto_tree_add_uint(tree, hfindex, NullTVB, offset, 4, mountstat3); } offset += 4; @@ -535,13 +535,13 @@ dissect_mount3_mnt_reply(const u_char *pd, int offset, frame_data *fd, offset = dissect_nfs_fh3(pd,offset,fd,tree,"fhandle"); if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; auth_flavors = EXTRACT_UINT(pd,offset+0); - proto_tree_add_item(tree,hf_mount_flavors, NullTVB, + proto_tree_add_uint(tree,hf_mount_flavors, NullTVB, offset, 4, auth_flavors); offset += 4; for (auth_flavor_i = 0 ; auth_flavor_i < hf_mount_flavors ; auth_flavor_i++) { if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; auth_flavor = EXTRACT_UINT(pd,offset+0); - proto_tree_add_item(tree,hf_mount_flavor, NullTVB, + proto_tree_add_uint(tree,hf_mount_flavor, NullTVB, offset, 4, auth_flavor); offset += 4; } diff --git a/packet-mpls.c b/packet-mpls.c index 87adfb23aa..23c385241a 100644 --- a/packet-mpls.c +++ b/packet-mpls.c @@ -3,7 +3,7 @@ * * (c) Copyright Ashok Narayanan * - * $Id: packet-mpls.c,v 1.6 2000/05/11 08:15:23 gram Exp $ + * $Id: packet-mpls.c,v 1.7 2000/05/31 05:07:19 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -153,7 +153,7 @@ dissect_mpls(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_mpls, NullTVB, offset, 4, NULL); + ti = proto_tree_add_item(tree, proto_mpls, NullTVB, offset, 4, FALSE); mpls_tree = proto_item_add_subtree(ti, ett_mpls); if (label <= MAX_RESERVED) @@ -162,14 +162,14 @@ dissect_mpls(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) label, val_to_str(label, special_labels, "Reserved - Unknown")); else - proto_tree_add_item(mpls_tree, mpls_filter[MPLSF_LABEL], NullTVB, + proto_tree_add_uint(mpls_tree, mpls_filter[MPLSF_LABEL], NullTVB, offset, 3, label); - proto_tree_add_item(mpls_tree,mpls_filter[MPLSF_EXP], NullTVB, + proto_tree_add_uint(mpls_tree,mpls_filter[MPLSF_EXP], NullTVB, offset+2,1, exp); - proto_tree_add_item(mpls_tree,mpls_filter[MPLSF_BOTTOM_OF_STACK], NullTVB, + proto_tree_add_uint(mpls_tree,mpls_filter[MPLSF_BOTTOM_OF_STACK], NullTVB, offset+2,1, bos); - proto_tree_add_item(mpls_tree,mpls_filter[MPLSF_TTL], NullTVB, + proto_tree_add_uint(mpls_tree,mpls_filter[MPLSF_TTL], NullTVB, offset+3,1, ttl); } offset += 4; diff --git a/packet-msproxy.c b/packet-msproxy.c index 97ac51e79c..0ebc942965 100644 --- a/packet-msproxy.c +++ b/packet-msproxy.c @@ -2,7 +2,7 @@ * Routines for Microsoft Proxy packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-msproxy.c,v 1.2 2000/05/11 08:15:23 gram Exp $ + * $Id: packet-msproxy.c,v 1.3 2000/05/31 05:07:20 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -243,14 +243,14 @@ static void msproxy_sub_dissector( const u_char *pd, int offset, frame_data *fd, if ( tree) { ti = proto_tree_add_item( tree, proto_msproxy, NullTVB, offset, 0, - NULL, "MS Proxy:" ); + FALSE ); msp_tree = proto_item_add_subtree(ti, ett_msproxy); - proto_tree_add_item( msp_tree, hf_msproxy_dstport, NullTVB, + proto_tree_add_uint( msp_tree, hf_msproxy_dstport, NullTVB, offset, 0, redirect_info->remote_port); - proto_tree_add_item( msp_tree, hf_msproxy_dstaddr, NullTVB, offset, 0, + proto_tree_add_ipv4( msp_tree, hf_msproxy_dstaddr, NullTVB, offset, 0, redirect_info->remote_addr); } @@ -434,19 +434,19 @@ static void dissect_bind(const u_char *pd, int offset, frame_data *fd, CHECK_PACKET_LENGTH( 4); if ( tree) - proto_tree_add_item( tree, hf_msproxy_bindaddr, NullTVB, offset, 4, + proto_tree_add_ipv4( tree, hf_msproxy_bindaddr, NullTVB, offset, 4, GWORD( pd, offset)); offset += 4; CHECK_PACKET_LENGTH( 2); if ( tree) - proto_tree_add_item( tree, hf_msproxy_bindport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_bindport, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 6; CHECK_PACKET_LENGTH( 2); if ( tree) - proto_tree_add_item( tree, hf_msproxy_clntport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_clntport, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2; @@ -455,7 +455,7 @@ static void dissect_bind(const u_char *pd, int offset, frame_data *fd, if ( tree){ CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_boundport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_boundport, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 82; @@ -499,11 +499,11 @@ static void dissect_tcp_bind(const u_char *pd, int offset, offset += 6; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); + proto_tree_add_uint( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); offset += 16; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_boundport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_boundport, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 96; @@ -523,7 +523,7 @@ static void dissect_request_connect(const u_char *pd, int offset, frame_data *fd CHECK_PACKET_LENGTH( 2); if ( tree) - proto_tree_add_item( tree, hf_msproxy_dstport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_dstport, NullTVB, offset, 2, pntohs( &pd[ offset])); conv_info->dst_port = pntohs( &pd[ offset]); @@ -531,7 +531,7 @@ static void dissect_request_connect(const u_char *pd, int offset, frame_data *fd CHECK_PACKET_LENGTH( 4); if ( tree) - proto_tree_add_item( tree, hf_msproxy_dstaddr, NullTVB, offset, 4, + proto_tree_add_ipv4( tree, hf_msproxy_dstaddr, NullTVB, offset, 4, GWORD( pd, offset)); memcpy( &conv_info->dst_addr, &pd[ offset], sizeof( guint32)); @@ -542,7 +542,7 @@ static void dissect_request_connect(const u_char *pd, int offset, frame_data *fd conv_info->clnt_port = pntohs( &pd[ offset]); if ( tree){ - proto_tree_add_item( tree, hf_msproxy_clntport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_clntport, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 84; @@ -562,31 +562,31 @@ static void dissect_bind_info_ack(const u_char *pd, int offset, frame_data *fd, offset += 6; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); + proto_tree_add_uint( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); offset += 14; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_dstport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_dstport, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_dstaddr, NullTVB, offset, 4, + proto_tree_add_ipv4( tree, hf_msproxy_dstaddr, NullTVB, offset, 4, GWORD( pd, offset)); offset += 12; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_server_int_port, NullTVB, offset, + proto_tree_add_uint( tree, hf_msproxy_server_int_port, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 4; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_server_ext_port, NullTVB, offset, + proto_tree_add_uint( tree, hf_msproxy_server_ext_port, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_server_ext_addr, NullTVB, offset, + proto_tree_add_ipv4( tree, hf_msproxy_server_ext_addr, NullTVB, offset, 4, GWORD( pd, offset)); offset += 78; @@ -644,19 +644,19 @@ static void dissect_udp_bind(const u_char *pd, int offset, CHECK_PACKET_LENGTH( 4); if ( tree) - proto_tree_add_item( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); + proto_tree_add_uint( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); offset += 12; CHECK_PACKET_LENGTH( 2); if ( tree) - proto_tree_add_item( tree, hf_msproxy_dstport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_dstport, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2; CHECK_PACKET_LENGTH( 4); if ( tree) - proto_tree_add_item( tree, hf_msproxy_dstaddr, NullTVB, offset, 4, + proto_tree_add_ipv4( tree, hf_msproxy_dstaddr, NullTVB, offset, 4, GWORD( pd, offset)); offset += 96; @@ -677,7 +677,7 @@ static void dissect_udp_assoc(const u_char *pd, int offset, CHECK_PACKET_LENGTH( 2); if ( tree) - proto_tree_add_item( tree, hf_msproxy_clntport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_clntport, NullTVB, offset, 2, pntohs( &pd[ offset])); conv_info->clnt_port = pntohs( &pd[ offset]); @@ -800,12 +800,12 @@ static void dissect_hello_ack(const u_char *pd, int offset, frame_data *fd, if ( tree) { CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_serverport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_serverport, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_serveraddr, NullTVB, offset, 4, + proto_tree_add_ipv4( tree, hf_msproxy_serveraddr, NullTVB, offset, 4, GWORD( pd, offset)); offset += 4; } @@ -834,15 +834,15 @@ static void dissect_udpassociate_ack( const u_char *pd, int offset, if ( tree) { CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); + proto_tree_add_uint( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); offset += 14; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_server_ext_port, NullTVB, offset, 2, pntohs( &pd[ offset])); + proto_tree_add_uint( tree, hf_msproxy_server_ext_port, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_server_ext_addr, NullTVB, offset, 4, GWORD( pd, offset)); + proto_tree_add_ipv4( tree, hf_msproxy_server_ext_addr, NullTVB, offset, 4, GWORD( pd, offset)); offset += 96; display_application_name( pd, offset, fd, tree); @@ -893,7 +893,7 @@ static void dissect_connect_ack( const u_char *pd, int offset, frame_data *fd, CHECK_PACKET_LENGTH( 2); if ( tree) - proto_tree_add_item( tree, hf_msproxy_server_int_port, NullTVB, offset, 2, pntohs( &pd[ offset])); + proto_tree_add_uint( tree, hf_msproxy_server_int_port, NullTVB, offset, 2, pntohs( &pd[ offset])); conv_info->proto = PT_TCP; @@ -902,15 +902,15 @@ static void dissect_connect_ack( const u_char *pd, int offset, frame_data *fd, if ( tree){ CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_server_int_addr, NullTVB, offset, 2, GWORD( pd, offset)); + proto_tree_add_ipv4( tree, hf_msproxy_server_int_addr, NullTVB, offset, 2, GWORD( pd, offset)); offset += 14; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_server_ext_port, NullTVB, offset, 2, pntohs( &pd[ offset])); + proto_tree_add_uint( tree, hf_msproxy_server_ext_port, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_server_ext_addr, NullTVB, offset, 4, GWORD( pd, offset)); + proto_tree_add_ipv4( tree, hf_msproxy_server_ext_addr, NullTVB, offset, 4, GWORD( pd, offset)); offset += 80; display_application_name( pd, offset, fd, tree); @@ -930,21 +930,21 @@ static void dissect_tcp_bind_ack( const u_char *pd, int offset, frame_data *fd, offset += 6; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); + proto_tree_add_uint( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); offset += 16; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_server_int_port, NullTVB, offset, + proto_tree_add_uint( tree, hf_msproxy_server_int_port, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 6; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_server_ext_port, NullTVB, offset, + proto_tree_add_uint( tree, hf_msproxy_server_ext_port, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_server_ext_addr, NullTVB, offset, + proto_tree_add_ipv4( tree, hf_msproxy_server_ext_addr, NullTVB, offset, 4, GWORD( pd, offset)); offset += 88; @@ -964,20 +964,20 @@ static void dissect_bind_info( const u_char *pd, int offset, frame_data *fd, CHECK_PACKET_LENGTH( 4); if ( tree) - proto_tree_add_item( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); + proto_tree_add_uint( tree, hf_msproxy_bind_id, NullTVB, offset, 4, pntohl( &pd[ offset])); offset += 14; CHECK_PACKET_LENGTH( 2); if ( tree) - proto_tree_add_item( tree, hf_msproxy_dstport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_msproxy_dstport, NullTVB, offset, 2, pntohs( &pd[ offset])); conv_info->dst_port = pntohs( &pd[ offset]); offset += 2; CHECK_PACKET_LENGTH( 4); if ( tree) - proto_tree_add_item( tree, hf_msproxy_dstaddr, NullTVB, offset, 4, + proto_tree_add_ipv4( tree, hf_msproxy_dstaddr, NullTVB, offset, 4, GWORD( pd, offset)); memcpy( &conv_info->dst_addr, &pd[ offset], sizeof( guint32)); @@ -986,7 +986,7 @@ static void dissect_bind_info( const u_char *pd, int offset, frame_data *fd, CHECK_PACKET_LENGTH( 2); if ( tree) - proto_tree_add_item( tree, hf_msproxy_server_int_port, NullTVB, offset, + proto_tree_add_uint( tree, hf_msproxy_server_int_port, NullTVB, offset, 2, pntohs( &pd[ offset])); conv_info->server_int_port = pntohs( &pd[ offset]); offset += 4; @@ -994,12 +994,12 @@ static void dissect_bind_info( const u_char *pd, int offset, frame_data *fd, if ( tree) { CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( tree, hf_msproxy_server_ext_port, NullTVB, offset, + proto_tree_add_uint( tree, hf_msproxy_server_ext_port, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_server_ext_addr, NullTVB, offset, + proto_tree_add_ipv4( tree, hf_msproxy_server_ext_addr, NullTVB, offset, 4, GWORD( pd, offset)); offset += 78; @@ -1034,7 +1034,7 @@ static void dissect_resolve(const u_char *pd, int offset, frame_data *fd, offset += addr_offset; CHECK_PACKET_LENGTH( 4); - proto_tree_add_item( tree, hf_msproxy_resolvaddr, NullTVB, offset, 4, + proto_tree_add_ipv4( tree, hf_msproxy_resolvaddr, NullTVB, offset, 4, GWORD( pd, offset)); } } @@ -1203,7 +1203,7 @@ static void dissect_msproxy(const u_char *pd, int offset, frame_data *fd, proto_ if (tree) { /* if proto tree, decode data */ ti = proto_tree_add_item( tree, proto_msproxy, NullTVB, offset, - END_OF_FRAME, NULL, "MSproxy:" ); + END_OF_FRAME, FALSE ); msproxy_tree = proto_item_add_subtree(ti, ett_msproxy); } @@ -1356,6 +1356,3 @@ proto_reg_handoff_msproxy(void) { dissector_add("udp.port", UDP_PORT_MSPROXY, dissect_msproxy); } - - - diff --git a/packet-nbipx.c b/packet-nbipx.c index 591bbd089a..4840291eee 100644 --- a/packet-nbipx.c +++ b/packet-nbipx.c @@ -2,7 +2,7 @@ * Routines for NetBIOS over IPX packet disassembly * Gilbert Ramirez * - * $Id: packet-nbipx.c,v 1.20 2000/05/30 03:35:52 guy Exp $ + * $Id: packet-nbipx.c,v 1.21 2000/05/31 05:07:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -187,7 +187,7 @@ dissect_nbipx_ns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, } if (tree) { - ti = proto_tree_add_item(tree, proto_nbipx, NullTVB, offset, 50, NULL); + ti = proto_tree_add_item(tree, proto_nbipx, NullTVB, offset, 50, FALSE); nbipx_tree = proto_item_add_subtree(ti, ett_nbipx); add_routers(nbipx_tree, pd, offset); @@ -239,7 +239,7 @@ dissect_nbipx_dg(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, if (tree) { ti = proto_tree_add_item(tree, proto_nbipx, NullTVB, offset, - 2+NETBIOS_NAME_LEN+NETBIOS_NAME_LEN, NULL); + 2+NETBIOS_NAME_LEN+NETBIOS_NAME_LEN, FALSE); nbipx_tree = proto_item_add_subtree(ti, ett_nbipx); proto_tree_add_text(nbipx_tree, NullTVB, offset, 1, @@ -341,7 +341,7 @@ dissect_nwlink_dg(const u_char *pd, int offset, frame_data *fd, proto_tree *tree } if (tree) { - ti = proto_tree_add_item(tree, proto_nbipx, NullTVB, offset, 68, NULL); + ti = proto_tree_add_item(tree, proto_nbipx, NullTVB, offset, 68, FALSE); nbipx_tree = proto_item_add_subtree(ti, ett_nbipx); add_routers(nbipx_tree, pd, offset); diff --git a/packet-nbns.c b/packet-nbns.c index e99161d54a..48d1f40cd0 100644 --- a/packet-nbns.c +++ b/packet-nbns.c @@ -4,7 +4,7 @@ * Gilbert Ramirez * Much stuff added by Guy Harris * - * $Id: packet-nbns.c,v 1.42 2000/05/11 08:15:24 gram Exp $ + * $Id: packet-nbns.c,v 1.43 2000/05/31 05:07:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1167,28 +1167,28 @@ dissect_nbns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - ti = proto_tree_add_item(tree, proto_nbns, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_nbns, NullTVB, offset, END_OF_FRAME, FALSE); nbns_tree = proto_item_add_subtree(ti, ett_nbns); if (flags & F_RESPONSE) { - proto_tree_add_item_hidden(nbns_tree, hf_nbns_response, NullTVB, + proto_tree_add_boolean_hidden(nbns_tree, hf_nbns_response, NullTVB, 0, 0, TRUE); } else { - proto_tree_add_item_hidden(nbns_tree, hf_nbns_query, NullTVB, + proto_tree_add_boolean_hidden(nbns_tree, hf_nbns_query, NullTVB, 0, 0, TRUE); } - proto_tree_add_item(nbns_tree, hf_nbns_transaction_id, NullTVB, + proto_tree_add_uint(nbns_tree, hf_nbns_transaction_id, NullTVB, offset + NBNS_ID, 2, id); nbns_add_nbns_flags(nbns_tree, offset + NBNS_FLAGS, flags, 0); - proto_tree_add_item(nbns_tree, hf_nbns_count_questions, NullTVB, + proto_tree_add_uint(nbns_tree, hf_nbns_count_questions, NullTVB, offset + NBNS_QUEST, 2, quest); - proto_tree_add_item(nbns_tree, hf_nbns_count_answers, NullTVB, + proto_tree_add_uint(nbns_tree, hf_nbns_count_answers, NullTVB, offset + NBNS_ANS, 2, ans); - proto_tree_add_item(nbns_tree, hf_nbns_count_auth_rr, NullTVB, + proto_tree_add_uint(nbns_tree, hf_nbns_count_auth_rr, NullTVB, offset + NBNS_AUTH, 2, auth); - proto_tree_add_item(nbns_tree, hf_nbns_count_add_rr, NullTVB, + proto_tree_add_uint(nbns_tree, hf_nbns_count_add_rr, NullTVB, offset + NBNS_ADD, 2, add); } @@ -1325,7 +1325,7 @@ dissect_nbdgm(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - ti = proto_tree_add_item(tree, proto_nbdgm, NullTVB, offset, header.dgm_length, NULL); + ti = proto_tree_add_item(tree, proto_nbdgm, NullTVB, offset, header.dgm_length, FALSE); nbdgm_tree = proto_item_add_subtree(ti, ett_nbdgm); proto_tree_add_uint_format(nbdgm_tree, hf_nbdgm_type, NullTVB, @@ -1349,11 +1349,11 @@ dissect_nbdgm(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) "Node Type: %s", node[header.flags.node_type]); - proto_tree_add_item(nbdgm_tree, hf_nbdgm_datagram_id, NullTVB, + proto_tree_add_uint(nbdgm_tree, hf_nbdgm_datagram_id, NullTVB, offset+2, 2, header.dgm_id); - proto_tree_add_item(nbdgm_tree, hf_nbdgm_src_ip, NullTVB, + proto_tree_add_ipv4(nbdgm_tree, hf_nbdgm_src_ip, NullTVB, offset+4, 4, header.src_ip); - proto_tree_add_item(nbdgm_tree, hf_nbdgm_src_port, NullTVB, + proto_tree_add_uint(nbdgm_tree, hf_nbdgm_src_port, NullTVB, offset+8, 2, header.src_port); } @@ -1490,7 +1490,7 @@ dissect_nbss_packet(const u_char *pd, int offset, frame_data *fd, proto_tree *tr } if (tree) { - ti = proto_tree_add_item(tree, proto_nbss, NullTVB, offset, length + 4, NULL); + ti = proto_tree_add_item(tree, proto_nbss, NullTVB, offset, length + 4, FALSE); nbss_tree = proto_item_add_subtree(ti, ett_nbss); proto_tree_add_uint_format(nbss_tree, hf_nbss_type, NullTVB, @@ -1510,7 +1510,7 @@ dissect_nbss_packet(const u_char *pd, int offset, frame_data *fd, proto_tree *tr offset += 3; } else { if (tree) { - tf = proto_tree_add_item(nbss_tree, hf_nbss_flags, NullTVB, offset, 1, flags); + tf = proto_tree_add_uint(nbss_tree, hf_nbss_flags, NullTVB, offset, 1, flags); field_tree = proto_item_add_subtree(tf, ett_nbss_flags); proto_tree_add_text(field_tree, NullTVB, offset, 1, "%s", decode_boolean_bitfield(flags, NBSS_FLAGS_E, diff --git a/packet-ncp.c b/packet-ncp.c index b8c04b521a..9f18cd22c6 100644 --- a/packet-ncp.c +++ b/packet-ncp.c @@ -3,7 +3,7 @@ * Gilbert Ramirez * Modified to allow NCP over TCP/IP decodes by James Coe * - * $Id: packet-ncp.c,v 1.36 2000/05/30 03:35:53 guy Exp $ + * $Id: packet-ncp.c,v 1.37 2000/05/31 05:07:22 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -575,14 +575,14 @@ dissect_ncp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { nw_ncp_type = header.type; if (tree) { - ti = proto_tree_add_item(tree, proto_ncp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_ncp, NullTVB, offset, END_OF_FRAME, FALSE); ncp_tree = proto_item_add_subtree(ti, ett_ncp); if ( pi.ptype == PT_TCP || pi.ptype == PT_UDP ) { - proto_tree_add_item(ncp_tree, hf_ncp_ip_sig, NullTVB, offset - 16, 4, ncpiph.signature); + proto_tree_add_uint(ncp_tree, hf_ncp_ip_sig, NullTVB, offset - 16, 4, ncpiph.signature); proto_tree_add_text(ncp_tree, NullTVB, offset - 12, 4, "Length: %d", ncpiph.length); if ( ncpiph.signature == NCPIP_RQST ) { - proto_tree_add_item(ncp_tree, hf_ncp_ip_ver, NullTVB, offset - 8, 4, ncpiphrq.version); + proto_tree_add_uint(ncp_tree, hf_ncp_ip_ver, NullTVB, offset - 8, 4, ncpiphrq.version); proto_tree_add_text(ncp_tree, NullTVB, offset - 4, 4, "Reply buffer size: %d", ncpiphrq.rplybufsize); }; }; @@ -594,13 +594,13 @@ dissect_ncp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { request_reply_values, "Unknown (%04X)")); - proto_tree_add_item(ncp_tree, hf_ncp_seq, NullTVB, + proto_tree_add_uint(ncp_tree, hf_ncp_seq, NullTVB, offset+2, 1, header.sequence); - proto_tree_add_item(ncp_tree, hf_ncp_connection, NullTVB, + proto_tree_add_uint(ncp_tree, hf_ncp_connection, NullTVB, offset+3, 3, nw_connection); - proto_tree_add_item(ncp_tree, hf_ncp_task, NullTVB, + proto_tree_add_uint(ncp_tree, hf_ncp_task, NullTVB, offset+4, 1, header.task); } diff --git a/packet-netbios.c b/packet-netbios.c index d48e4e9d2b..6d7ec36bd9 100644 --- a/packet-netbios.c +++ b/packet-netbios.c @@ -5,7 +5,7 @@ * * derived from the packet-nbns.c * - * $Id: packet-netbios.c,v 1.19 2000/05/11 08:15:28 gram Exp $ + * $Id: packet-netbios.c,v 1.20 2000/05/31 05:07:23 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -986,7 +986,7 @@ static void dissect_netbios(const u_char *pd, int offset, frame_data *fd, if (tree) { ti = proto_tree_add_item(tree, proto_netbios, NullTVB, - offset, END_OF_FRAME, NULL); + offset, END_OF_FRAME, FALSE); netb_tree = proto_item_add_subtree(ti, ett_netb); proto_tree_add_text( netb_tree, NullTVB, offset, @@ -1030,7 +1030,7 @@ static void dissect_netbios(const u_char *pd, int offset, frame_data *fd, if (tree) { - ti = proto_tree_add_item(tree, proto_netbios, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_netbios, NullTVB, offset, END_OF_FRAME, FALSE); netb_tree = proto_item_add_subtree(ti, ett_netb); diff --git a/packet-nfs.c b/packet-nfs.c index 2beb99888d..25a5fbed9e 100644 --- a/packet-nfs.c +++ b/packet-nfs.c @@ -2,7 +2,7 @@ * Routines for nfs dissection * Copyright 1999, Uwe Girlich * - * $Id: packet-nfs.c,v 1.27 2000/05/11 08:15:28 gram Exp $ + * $Id: packet-nfs.c,v 1.28 2000/05/31 05:07:24 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -663,11 +663,11 @@ dissect_nfs2_read_call(const u_char *pd, int offset, frame_data *fd, proto_tree count = EXTRACT_UINT(pd, offset+4); totalcount = EXTRACT_UINT(pd, offset+8); if (tree) { - proto_tree_add_item(tree, hf_nfs_read_offset, NullTVB, + proto_tree_add_uint(tree, hf_nfs_read_offset, NullTVB, offset+0, 4, offset_value); - proto_tree_add_item(tree, hf_nfs_read_count, NullTVB, + proto_tree_add_uint(tree, hf_nfs_read_count, NullTVB, offset+4, 4, count); - proto_tree_add_item(tree, hf_nfs_read_totalcount, NullTVB, + proto_tree_add_uint(tree, hf_nfs_read_totalcount, NullTVB, offset+8, 4, totalcount); } offset += 12; @@ -711,11 +711,11 @@ dissect_nfs2_write_call(const u_char *pd, int offset, frame_data *fd, proto_tree offset_value = EXTRACT_UINT(pd, offset+4); totalcount = EXTRACT_UINT(pd, offset+8); if (tree) { - proto_tree_add_item(tree, hf_nfs_write_beginoffset, NullTVB, + proto_tree_add_uint(tree, hf_nfs_write_beginoffset, NullTVB, offset+0, 4, beginoffset); - proto_tree_add_item(tree, hf_nfs_write_offset, NullTVB, + proto_tree_add_uint(tree, hf_nfs_write_offset, NullTVB, offset+4, 4, offset_value); - proto_tree_add_item(tree, hf_nfs_write_totalcount, NullTVB, + proto_tree_add_uint(tree, hf_nfs_write_totalcount, NullTVB, offset+8, 4, totalcount); } offset += 12; @@ -783,9 +783,9 @@ dissect_nfs2_readdir_call(const u_char *pd, int offset, frame_data *fd, proto_tr cookie = EXTRACT_UINT(pd, offset+ 0); count = EXTRACT_UINT(pd, offset+ 4); if (tree) { - proto_tree_add_item(tree, hf_nfs_readdir_cookie, NullTVB, + proto_tree_add_uint(tree, hf_nfs_readdir_cookie, NullTVB, offset+ 0, 4, cookie); - proto_tree_add_item(tree, hf_nfs_readdir_count, NullTVB, + proto_tree_add_uint(tree, hf_nfs_readdir_count, NullTVB, offset+ 4, 4, count); } offset += 8; @@ -807,7 +807,7 @@ dissect_readdir_entry(const u_char* pd, int offset, frame_data* fd, proto_tree* if (tree) { entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, NullTVB, - offset+0, END_OF_FRAME, NULL); + offset+0, END_OF_FRAME, FALSE); if (entry_item) entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry); } @@ -818,7 +818,7 @@ dissect_readdir_entry(const u_char* pd, int offset, frame_data* fd, proto_tree* } fileid = EXTRACT_UINT(pd, offset + 0); if (entry_tree) - proto_tree_add_item(entry_tree, hf_nfs_readdir_entry_fileid, NullTVB, + proto_tree_add_uint(entry_tree, hf_nfs_readdir_entry_fileid, NullTVB, offset+0, 4, fileid); offset += 4; @@ -832,7 +832,7 @@ dissect_readdir_entry(const u_char* pd, int offset, frame_data* fd, proto_tree* if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset; cookie = EXTRACT_UINT(pd, offset + 0); if (entry_tree) - proto_tree_add_item(entry_tree, hf_nfs_readdir_entry_cookie, NullTVB, + proto_tree_add_uint(entry_tree, hf_nfs_readdir_entry_cookie, NullTVB, offset+0, 4, cookie); offset += 4; @@ -858,7 +858,7 @@ dissect_nfs2_readdir_reply(const u_char* pd, int offset, frame_data* fd, proto_t while (1) { if (!BYTES_ARE_IN_FRAME(offset,4)) break; value_follows = EXTRACT_UINT(pd, offset+0); - proto_tree_add_item(tree,hf_nfs_readdir_value_follows, NullTVB, + proto_tree_add_boolean(tree,hf_nfs_readdir_value_follows, NullTVB, offset+0, 4, value_follows); offset += 4; if (value_follows == 1) { @@ -871,7 +871,7 @@ dissect_nfs2_readdir_reply(const u_char* pd, int offset, frame_data* fd, proto_t if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; eof_value = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hf_nfs_readdir_eof, NullTVB, + proto_tree_add_uint(tree, hf_nfs_readdir_eof, NullTVB, offset+ 0, 4, eof_value); offset += 4; break; @@ -905,15 +905,15 @@ dissect_nfs2_statfs_reply(const u_char* pd, int offset, frame_data* fd, proto_tr bfree = EXTRACT_UINT(pd, offset+12); bavail = EXTRACT_UINT(pd, offset+16); if (tree) { - proto_tree_add_item(tree, hf_nfs_statfs_tsize, NullTVB, + proto_tree_add_uint(tree, hf_nfs_statfs_tsize, NullTVB, offset+ 0, 4, tsize); - proto_tree_add_item(tree, hf_nfs_statfs_bsize, NullTVB, + proto_tree_add_uint(tree, hf_nfs_statfs_bsize, NullTVB, offset+ 4, 4, bsize); - proto_tree_add_item(tree, hf_nfs_statfs_blocks, NullTVB, + proto_tree_add_uint(tree, hf_nfs_statfs_blocks, NullTVB, offset+ 8, 4, blocks); - proto_tree_add_item(tree, hf_nfs_statfs_bfree, NullTVB, + proto_tree_add_uint(tree, hf_nfs_statfs_bfree, NullTVB, offset+12, 4, bfree); - proto_tree_add_item(tree, hf_nfs_statfs_bavail, NullTVB, + proto_tree_add_uint(tree, hf_nfs_statfs_bavail, NullTVB, offset+16, 4, bavail); } offset += 20; @@ -1219,7 +1219,7 @@ dissect_nfsstat3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, nfsstat3 = EXTRACT_UINT(pd, offset+0); if (tree) { - proto_tree_add_item(tree, hf_nfs_nfsstat3, NullTVB, + proto_tree_add_uint(tree, hf_nfs_nfsstat3, NullTVB, offset, 4, nfsstat3); } @@ -1253,7 +1253,7 @@ int hf, guint32* ftype3) type = EXTRACT_UINT(pd, offset+0); if (tree) { - proto_tree_add_item(tree, hf, NullTVB, offset, 4, type); + proto_tree_add_uint(tree, hf, NullTVB, offset, 4, type); } offset += 4; @@ -2249,7 +2249,7 @@ dissect_stable_how(const u_char* pd, int offset, frame_data* fd, proto_tree* tre if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; stable_how = EXTRACT_UINT(pd,offset+0); if (tree) { - proto_tree_add_item(tree, hfindex, NullTVB, + proto_tree_add_uint(tree, hfindex, NullTVB, offset, 4, stable_how); } offset += 4; @@ -2313,7 +2313,7 @@ dissect_createmode3(const u_char* pd, int offset, frame_data* fd, proto_tree* tr if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset; mode_value = EXTRACT_UINT(pd, offset + 0); if (tree) { - proto_tree_add_item(tree, hf_nfs_createmode3, NullTVB, + proto_tree_add_uint(tree, hf_nfs_createmode3, NullTVB, offset+0, 4, mode_value); } offset += 4; @@ -2527,7 +2527,7 @@ dissect_entry3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree) if (tree) { entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, NullTVB, - offset+0, END_OF_FRAME, NULL); + offset+0, END_OF_FRAME, FALSE); if (entry_item) entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry); } @@ -2567,7 +2567,7 @@ dissect_nfs3_readdir_reply(const u_char* pd, int offset, frame_data* fd, proto_t while (1) { if (!BYTES_ARE_IN_FRAME(offset,4)) break; value_follows = EXTRACT_UINT(pd, offset+0); - proto_tree_add_item(tree,hf_nfs_readdir_value_follows, NullTVB, + proto_tree_add_boolean(tree,hf_nfs_readdir_value_follows, NullTVB, offset+0, 4, value_follows); offset += 4; if (value_follows == 1) { @@ -2580,7 +2580,7 @@ dissect_nfs3_readdir_reply(const u_char* pd, int offset, frame_data* fd, proto_t if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; eof_value = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hf_nfs_readdir_eof, NullTVB, + proto_tree_add_uint(tree, hf_nfs_readdir_eof, NullTVB, offset+ 0, 4, eof_value); offset += 4; break; @@ -2618,7 +2618,7 @@ dissect_entryplus3(const u_char* pd, int offset, frame_data* fd, proto_tree* tre if (tree) { entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, NullTVB, - offset+0, END_OF_FRAME, NULL); + offset+0, END_OF_FRAME, FALSE); if (entry_item) entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry); } @@ -2661,7 +2661,7 @@ dissect_nfs3_readdirplus_reply(const u_char* pd, int offset, frame_data* fd, pro while (1) { if (!BYTES_ARE_IN_FRAME(offset,4)) break; value_follows = EXTRACT_UINT(pd, offset+0); - proto_tree_add_item(tree,hf_nfs_readdir_value_follows, NullTVB, + proto_tree_add_boolean(tree,hf_nfs_readdir_value_follows, NullTVB, offset+0, 4, value_follows); offset += 4; if (value_follows == 1) { @@ -2674,7 +2674,7 @@ dissect_nfs3_readdirplus_reply(const u_char* pd, int offset, frame_data* fd, pro if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; eof_value = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hf_nfs_readdir_eof, NullTVB, + proto_tree_add_uint(tree, hf_nfs_readdir_eof, NullTVB, offset+ 0, 4, eof_value); offset += 4; break; @@ -2707,7 +2707,7 @@ dissect_nfs3_fsstat_reply(const u_char* pd, int offset, frame_data* fd, proto_tr if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset; invarsec = EXTRACT_UINT(pd, offset + 0); if (tree) - proto_tree_add_item(tree, hf_nfs_fsstat_invarsec, NullTVB, + proto_tree_add_uint(tree, hf_nfs_fsstat_invarsec, NullTVB, offset+0, 4, invarsec); offset += 4; break; @@ -2749,43 +2749,43 @@ dissect_nfs3_fsinfo_reply(const u_char* pd, int offset, frame_data* fd, proto_tr if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; rtmax = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hf_nfs_fsinfo_rtmax, NullTVB, + proto_tree_add_uint(tree, hf_nfs_fsinfo_rtmax, NullTVB, offset+0, 4, rtmax); offset += 4; if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; rtpref = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hf_nfs_fsinfo_rtpref, NullTVB, + proto_tree_add_uint(tree, hf_nfs_fsinfo_rtpref, NullTVB, offset+0, 4, rtpref); offset += 4; if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; rtmult = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hf_nfs_fsinfo_rtmult, NullTVB, + proto_tree_add_uint(tree, hf_nfs_fsinfo_rtmult, NullTVB, offset+0, 4, rtmult); offset += 4; if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; wtmax = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hf_nfs_fsinfo_wtmax, NullTVB, + proto_tree_add_uint(tree, hf_nfs_fsinfo_wtmax, NullTVB, offset+0, 4, wtmax); offset += 4; if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; wtpref = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hf_nfs_fsinfo_wtpref, NullTVB, + proto_tree_add_uint(tree, hf_nfs_fsinfo_wtpref, NullTVB, offset+0, 4, wtpref); offset += 4; if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; wtmult = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hf_nfs_fsinfo_wtmult, NullTVB, + proto_tree_add_uint(tree, hf_nfs_fsinfo_wtmult, NullTVB, offset+0, 4, wtmult); offset += 4; if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; dtpref = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hf_nfs_fsinfo_dtpref, NullTVB, + proto_tree_add_uint(tree, hf_nfs_fsinfo_dtpref, NullTVB, offset+0, 4, dtpref); offset += 4; @@ -2794,7 +2794,7 @@ dissect_nfs3_fsinfo_reply(const u_char* pd, int offset, frame_data* fd, proto_tr if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; properties = EXTRACT_UINT(pd, offset+0); if (tree) { - properties_item = proto_tree_add_item(tree, + properties_item = proto_tree_add_uint(tree, hf_nfs_fsinfo_properties, NullTVB, offset+0, 4, properties); if (properties_item) @@ -2855,13 +2855,13 @@ dissect_nfs3_pathconf_reply(const u_char* pd, int offset, frame_data* fd, proto_ if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset; linkmax = EXTRACT_UINT(pd, offset + 0); if (tree) - proto_tree_add_item(tree, hf_nfs_pathconf_linkmax, NullTVB, + proto_tree_add_uint(tree, hf_nfs_pathconf_linkmax, NullTVB, offset+0, 4, linkmax); offset += 4; if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset; name_max = EXTRACT_UINT(pd, offset + 0); if (tree) - proto_tree_add_item(tree, hf_nfs_pathconf_name_max, NullTVB, + proto_tree_add_uint(tree, hf_nfs_pathconf_name_max, NullTVB, offset+0, 4, name_max); offset += 4; offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_no_trunc); diff --git a/packet-nntp.c b/packet-nntp.c index 54b04196a0..eab360e222 100644 --- a/packet-nntp.c +++ b/packet-nntp.c @@ -2,7 +2,7 @@ * Routines for nntp packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-nntp.c,v 1.9 2000/05/11 08:15:30 gram Exp $ + * $Id: packet-nntp.c,v 1.10 2000/05/31 05:07:26 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -84,13 +84,13 @@ dissect_nntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_nntp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_nntp, NullTVB, offset, END_OF_FRAME, FALSE); nntp_tree = proto_item_add_subtree(ti, ett_nntp); if (pi.match_port == pi.destport) { - proto_tree_add_item_hidden(nntp_tree, hf_nntp_request, NullTVB, 0, 0, TRUE); + proto_tree_add_boolean_hidden(nntp_tree, hf_nntp_request, NullTVB, 0, 0, TRUE); } else { - proto_tree_add_item_hidden(nntp_tree, hf_nntp_response, NullTVB, 0, 0, TRUE); + proto_tree_add_boolean_hidden(nntp_tree, hf_nntp_response, NullTVB, 0, 0, TRUE); } /* diff --git a/packet-ntp.c b/packet-ntp.c index 751a44b927..7c1aa92d95 100644 --- a/packet-ntp.c +++ b/packet-ntp.c @@ -2,7 +2,7 @@ * Routines for NTP packet dissection * Copyright 1999, Nathan Neulinger * - * $Id: packet-ntp.c,v 1.12 2000/05/11 08:15:30 gram Exp $ + * $Id: packet-ntp.c,v 1.13 2000/05/31 05:07:26 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -255,9 +255,9 @@ dissect_ntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { /* Adding NTP item and subtree */ - ti = proto_tree_add_item(tree, proto_ntp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_ntp, NullTVB, offset, END_OF_FRAME, FALSE); ntp_tree = proto_item_add_subtree(ti, ett_ntp); - tf = proto_tree_add_item(ntp_tree, hf_ntp_flags, NullTVB, offset, 1, pkt->flags); + tf = proto_tree_add_bytes(ntp_tree, hf_ntp_flags, NullTVB, offset, 1, pkt->flags); /* Adding flag subtree and items */ flags_tree = proto_item_add_subtree(tf, ett_ntp_flags); @@ -368,9 +368,9 @@ dissect_ntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) * hex code for now. */ if ( BYTES_ARE_IN_FRAME(offset, 50) ) - proto_tree_add_item(ntp_tree, hf_ntp_keyid, NullTVB, offset+48, 4, pkt->keyid); + proto_tree_add_bytes(ntp_tree, hf_ntp_keyid, NullTVB, offset+48, 4, pkt->keyid); if ( BYTES_ARE_IN_FRAME(offset, 53) ) - proto_tree_add_item(ntp_tree, hf_ntp_mac, NullTVB, offset+52, END_OF_FRAME, pkt->mac); + proto_tree_add_bytes(ntp_tree, hf_ntp_mac, NullTVB, offset+52, END_OF_FRAME, pkt->mac); } } diff --git a/packet-null.c b/packet-null.c index ac910d9105..39f4253ec0 100644 --- a/packet-null.c +++ b/packet-null.c @@ -1,7 +1,7 @@ /* packet-null.c * Routines for null packet disassembly * - * $Id: packet-null.c,v 1.24 2000/05/25 07:42:24 gram Exp $ + * $Id: packet-null.c,v 1.25 2000/05/31 05:07:27 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -272,7 +272,7 @@ dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ if (null_header > IEEE_802_3_MAX_LEN) { if (tree) { - ti = proto_tree_add_item(tree, proto_null, tvb, 0, 4, NULL); + ti = proto_tree_add_item(tree, proto_null, tvb, 0, 4, FALSE); fh_tree = proto_item_add_subtree(ti, ett_null); } else fh_tree = NULL; @@ -281,9 +281,9 @@ dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* populate a tree in the second pane with the status of the link layer (ie none) */ if (tree) { - ti = proto_tree_add_item(tree, proto_null, tvb, 0, 4, NULL); + ti = proto_tree_add_item(tree, proto_null, tvb, 0, 4, FALSE); fh_tree = proto_item_add_subtree(ti, ett_null); - proto_tree_add_item(fh_tree, hf_null_family, tvb, 0, 4, null_header); + proto_tree_add_uint(fh_tree, hf_null_family, tvb, 0, 4, null_header); } next_tvb = tvb_new_subset(tvb, 4, -1, -1); diff --git a/packet-ospf.c b/packet-ospf.c index bf753bb689..b0fe9556ab 100644 --- a/packet-ospf.c +++ b/packet-ospf.c @@ -2,7 +2,7 @@ * Routines for OSPF packet disassembly * (c) Copyright Hannes R. Boehm * - * $Id: packet-ospf.c,v 1.23 2000/05/11 08:15:32 gram Exp $ + * $Id: packet-ospf.c,v 1.24 2000/05/31 05:07:28 guy Exp $ * * At this time, this module is able to analyze OSPF * packets as specified in RFC2328. MOSPF (RFC1584) and other @@ -111,7 +111,7 @@ dissect_ospf(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } if (tree) { - ti = proto_tree_add_item(tree, proto_ospf, NullTVB, offset, ntohs(ospfh.length), NULL); + ti = proto_tree_add_item(tree, proto_ospf, NullTVB, offset, ntohs(ospfh.length), FALSE); ospf_tree = proto_item_add_subtree(ti, ett_ospf); ti = proto_tree_add_text(ospf_tree, NullTVB, offset, OSPF_HEADER_LENGTH, "OSPF Header"); diff --git a/packet-pim.c b/packet-pim.c index e8ffeba716..658c58ad2e 100644 --- a/packet-pim.c +++ b/packet-pim.c @@ -2,7 +2,7 @@ * Routines for PIM disassembly * (c) Copyright Jun-ichiro itojun Hagino * - * $Id: packet-pim.c,v 1.13 2000/05/11 08:15:33 gram Exp $ + * $Id: packet-pim.c,v 1.14 2000/05/31 05:07:28 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -218,16 +218,16 @@ dissect_pim(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_fstr(fd, COL_INFO, "%s", typestr); if (tree) { - ti = proto_tree_add_item(tree, proto_pim, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_pim, NullTVB, offset, END_OF_FRAME, FALSE); pim_tree = proto_item_add_subtree(ti, ett_pim); - proto_tree_add_item(pim_tree, hf_pim_version, NullTVB, offset, 1, + proto_tree_add_uint(pim_tree, hf_pim_version, NullTVB, offset, 1, PIM_VER(pim.pim_typever)); proto_tree_add_uint_format(pim_tree, hf_pim_type, NullTVB, offset, 1, PIM_TYPE(pim.pim_typever), "Type: %s (%u)", typestr, PIM_TYPE(pim.pim_typever)); - proto_tree_add_item(pim_tree, hf_pim_cksum, NullTVB, + proto_tree_add_uint(pim_tree, hf_pim_cksum, NullTVB, offset + offsetof(struct pim, pim_cksum), sizeof(pim.pim_cksum), ntohs(pim.pim_cksum)); diff --git a/packet-pop.c b/packet-pop.c index ff93456b7c..47b4a303c8 100644 --- a/packet-pop.c +++ b/packet-pop.c @@ -2,7 +2,7 @@ * Routines for pop packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-pop.c,v 1.14 2000/05/11 08:15:33 gram Exp $ + * $Id: packet-pop.c,v 1.15 2000/05/31 05:07:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -101,11 +101,11 @@ dissect_pop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_pop, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_pop, NullTVB, offset, END_OF_FRAME, FALSE); pop_tree = proto_item_add_subtree(ti, ett_pop); if (pi.match_port == pi.destport) { /* Request */ - proto_tree_add_item_hidden(pop_tree, hf_pop_request, NullTVB, offset, i1, TRUE); + proto_tree_add_boolean_hidden(pop_tree, hf_pop_request, NullTVB, offset, i1, TRUE); proto_tree_add_text(pop_tree, NullTVB, offset, i1, "Request: %s", rr); if (strlen(rd) != 0) @@ -113,7 +113,7 @@ dissect_pop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } else { - proto_tree_add_item_hidden(pop_tree, hf_pop_response, NullTVB, offset, i1, TRUE); + proto_tree_add_boolean_hidden(pop_tree, hf_pop_response, NullTVB, offset, i1, TRUE); if (is_continuation(pd+offset)) dissect_data(pd, offset, fd, pop_tree); diff --git a/packet-portmap.c b/packet-portmap.c index 802df7ab18..b024478ce6 100644 --- a/packet-portmap.c +++ b/packet-portmap.c @@ -1,7 +1,7 @@ /* packet-portmap.c * Routines for portmap dissection * - * $Id: packet-portmap.c,v 1.15 2000/05/11 08:15:34 gram Exp $ + * $Id: packet-portmap.c,v 1.16 2000/05/31 05:07:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -77,14 +77,14 @@ int dissect_getport_call(const u_char *pd, int offset, frame_data *fd, proto_tree_add_uint_format(tree, hf_portmap_prog, NullTVB, offset, 4, prog, "Program: %s (%u)", rpc_prog_name(prog), prog); - proto_tree_add_item(tree, hf_portmap_version, NullTVB, + proto_tree_add_uint(tree, hf_portmap_version, NullTVB, offset+4, 4, pntohl(&pd[offset+4])); proto = pntohl(&pd[offset+8]); proto_tree_add_uint_format(tree, hf_portmap_proto, NullTVB, offset+8, 4, proto, "Proto: %s (%u)", ipprotostr(proto), proto); - proto_tree_add_item(tree, hf_portmap_port, NullTVB, + proto_tree_add_uint(tree, hf_portmap_port, NullTVB, offset+12, 4, pntohl(&pd[offset+12])); } @@ -97,7 +97,7 @@ int dissect_getport_reply(const u_char *pd, int offset, frame_data *fd, if ( !BYTES_ARE_IN_FRAME(offset, 4)) return offset; if ( tree ) { - proto_tree_add_item(tree, hf_portmap_port, NullTVB, + proto_tree_add_uint(tree, hf_portmap_port, NullTVB, offset, 4, pntohl(&pd[offset+0])); } return offset+=4; @@ -117,14 +117,14 @@ int dissect_set_call(const u_char *pd, int offset, frame_data *fd, proto_tree_add_uint_format(tree, hf_portmap_prog, NullTVB, offset, 4, prog, "Program: %s (%d)", rpc_prog_name(prog), prog); - proto_tree_add_item(tree, hf_portmap_version, NullTVB, + proto_tree_add_uint(tree, hf_portmap_version, NullTVB, offset+4, 4, pntohl(&pd[offset+4])); proto = pntohl(&pd[offset+8]); proto_tree_add_uint_format(tree, hf_portmap_proto, NullTVB, offset+8, 4, proto, "Proto: %s (%d)", ipprotostr(proto), proto); - proto_tree_add_item(tree, hf_portmap_port, NullTVB, + proto_tree_add_uint(tree, hf_portmap_port, NullTVB, offset+12, 4, pntohl(&pd[offset+12])); } @@ -145,14 +145,14 @@ int dissect_unset_call(const u_char *pd, int offset, frame_data *fd, proto_tree_add_uint_format(tree, hf_portmap_prog, NullTVB, offset, 4, prog, "Program: %s (%d)", rpc_prog_name(prog), prog); - proto_tree_add_item(tree, hf_portmap_version, NullTVB, + proto_tree_add_uint(tree, hf_portmap_version, NullTVB, offset+4, 4, pntohl(&pd[offset+4])); proto = pntohl(&pd[offset+8]); - proto_tree_add_item(tree, hf_portmap_proto, NullTVB, + proto_tree_add_uint(tree, hf_portmap_proto, NullTVB, offset+8, 4, proto); - proto_tree_add_item(tree, hf_portmap_port, NullTVB, + proto_tree_add_uint(tree, hf_portmap_port, NullTVB, offset+12, 4, pntohl(&pd[offset+12])); } @@ -166,7 +166,7 @@ int dissect_set_reply(const u_char *pd, int offset, frame_data *fd, { if ( !BYTES_ARE_IN_FRAME(offset, 4)) return offset; - proto_tree_add_item(tree, hf_portmap_answer, NullTVB, + proto_tree_add_boolean(tree, hf_portmap_answer, NullTVB, offset, 4, pntohl(&pd[offset+0])); offset += 4; } @@ -184,7 +184,7 @@ int dissect_dump_reply(const u_char *pd, int offset, frame_data *fd, value_follows = pntohl(&pd[offset+0]); if ( tree ) { - proto_tree_add_item(tree, hf_portmap_value_follows, NullTVB, + proto_tree_add_boolean(tree, hf_portmap_value_follows, NullTVB, offset, 4, value_follows); } offset += 4; @@ -209,12 +209,12 @@ int dissect_dump_reply(const u_char *pd, int offset, frame_data *fd, proto_tree_add_uint_format(subtree, hf_portmap_prog, NullTVB, offset+0, 4, prog, "Program: %s (%u)", rpc_prog_name(prog), prog); - proto_tree_add_item(subtree, hf_portmap_version, NullTVB, + proto_tree_add_uint(subtree, hf_portmap_version, NullTVB, offset+4, 4, version); proto_tree_add_uint_format(subtree, hf_portmap_proto, NullTVB, offset+8, 4, proto, "Protocol: %s (0x%02x)", ipprotostr(proto), proto); - proto_tree_add_item(subtree, hf_portmap_port, NullTVB, + proto_tree_add_uint(subtree, hf_portmap_port, NullTVB, offset+12, 4, port); } offset += 16; @@ -265,7 +265,7 @@ int dissect_rpcb(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, if (tree) { rpcb_item = proto_tree_add_item(tree, hfindex, NullTVB, - offset+0, END_OF_FRAME, NULL); + offset+0, END_OF_FRAME, FALSE); if (rpcb_item) rpcb_tree = proto_item_add_subtree(rpcb_item, ett_portmap_rpcb); } @@ -281,7 +281,7 @@ int dissect_rpcb(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset; version = EXTRACT_UINT(pd, offset + 0); if (rpcb_tree) - proto_tree_add_item(rpcb_tree, hf_portmap_rpcb_version, NullTVB, + proto_tree_add_uint(rpcb_tree, hf_portmap_rpcb_version, NullTVB, offset+0, 4, version); offset += 4; @@ -328,7 +328,7 @@ int dissect_rpcb3_dump_reply(const u_char *pd, int offset, frame_data *fd, while (1) { if (!BYTES_ARE_IN_FRAME(offset,4)) break; value_follows = EXTRACT_UINT(pd, offset+0); - proto_tree_add_item(tree,hf_portmap_value_follows, NullTVB, + proto_tree_add_boolean(tree,hf_portmap_value_follows, NullTVB, offset+0, 4, value_follows); offset += 4; if (value_follows == 1) { diff --git a/packet-ppp.c b/packet-ppp.c index e0c4e1e3d7..d8f31a84e9 100644 --- a/packet-ppp.c +++ b/packet-ppp.c @@ -1,7 +1,7 @@ /* packet-ppp.c * Routines for ppp packet disassembly * - * $Id: packet-ppp.c,v 1.35 2000/05/25 07:42:25 gram Exp $ + * $Id: packet-ppp.c,v 1.36 2000/05/31 05:07:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1069,7 +1069,7 @@ dissect_mp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) flag_str = "Unknown"; break; } - ti = proto_tree_add_item(tree, proto_mp, tvb, 0, 4, NULL); + ti = proto_tree_add_item(tree, proto_mp, tvb, 0, 4, FALSE); mp_tree = proto_item_add_subtree(ti, ett_mp); ti = proto_tree_add_text(mp_tree, tvb, 0, 1, "Fragment: 0x%2X (%s)", flags, flag_str); @@ -1083,14 +1083,14 @@ dissect_mp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_text(hdr_tree, tvb, 0, 1, "%s", decode_boolean_bitfield(flags, MP_FRAG_RESERVED, sizeof(flags) * 8, "reserved", "reserved")); - proto_tree_add_item(mp_tree, hf_mp_sequence_num, tvb, 1, 3, seq); + proto_tree_add_uint(mp_tree, hf_mp_sequence_num, tvb, 1, 3, seq); } next_tvb = tvb_new_subset(tvb, 4, -1, -1); if (tvb_length(next_tvb) > 0) { if (tree) { - ti = proto_tree_add_item(tree, proto_ppp, next_tvb, 0, 1, NULL); + ti = proto_tree_add_item(tree, proto_ppp, next_tvb, 0, 1, FALSE); fh_tree = proto_item_add_subtree(ti, ett_ppp); } dissect_ppp_stuff(next_tvb, pinfo, tree, fh_tree); @@ -1106,7 +1106,7 @@ dissect_payload_ppp( const u_char *pd, int offset, frame_data *fd, proto_tree *t /* populate a tree in the second pane with the status of the link layer (ie none) */ if(tree) { - ti = proto_tree_add_item(tree, proto_ppp, NullTVB, 0+offset, 2, NULL); + ti = proto_tree_add_item(tree, proto_ppp, NullTVB, 0+offset, 2, FALSE); fh_tree = proto_item_add_subtree(ti, ett_ppp); } @@ -1151,7 +1151,7 @@ dissect_ppp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { /* populate a tree in the second pane with the status of the link layer (ie none) */ if(tree) { - ti = proto_tree_add_item(tree, proto_ppp, tvb, 0, 4, NULL); + ti = proto_tree_add_item(tree, proto_ppp, tvb, 0, 4, FALSE); fh_tree = proto_item_add_subtree(ti, ett_ppp); if (byte0 == 0xff) { proto_tree_add_text(fh_tree, tvb, 0, 1, "Address: %02x", ph.ppp_addr); diff --git a/packet-q2931.c b/packet-q2931.c index 9f55c6a8e1..03c075cba6 100644 --- a/packet-q2931.c +++ b/packet-q2931.c @@ -2,7 +2,7 @@ * Routines for Q.2931 frame disassembly * Guy Harris * - * $Id: packet-q2931.c,v 1.9 2000/05/29 08:57:37 guy Exp $ + * $Id: packet-q2931.c,v 1.10 2000/05/31 05:07:30 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1995,21 +1995,21 @@ dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tree) { ti = proto_tree_add_item(tree, proto_q2931, tvb, offset, - tvb_length(tvb), NULL); + tvb_length(tvb), FALSE); q2931_tree = proto_item_add_subtree(ti, ett_q2931); - proto_tree_add_item(q2931_tree, hf_q2931_discriminator, tvb, offset, 1, tvb_get_guint8(tvb, offset)); + proto_tree_add_uint(q2931_tree, hf_q2931_discriminator, tvb, offset, 1, tvb_get_guint8(tvb, offset)); } offset += 1; call_ref_len = tvb_get_guint8(tvb, offset) & 0xF; /* XXX - do as a bit field? */ if (q2931_tree != NULL) - proto_tree_add_item(q2931_tree, hf_q2931_call_ref_len, tvb, offset, 1, call_ref_len); + proto_tree_add_uint(q2931_tree, hf_q2931_call_ref_len, tvb, offset, 1, call_ref_len); offset += 1; if (call_ref_len != 0) { /* XXX - split this into flag and value */ tvb_memcpy(tvb, call_ref, offset, call_ref_len); if (q2931_tree != NULL) - proto_tree_add_item(q2931_tree, hf_q2931_call_ref, tvb, offset, call_ref_len, call_ref); + proto_tree_add_bytes(q2931_tree, hf_q2931_call_ref, tvb, offset, call_ref_len, call_ref); offset += call_ref_len; } message_type = tvb_get_guint8(tvb, offset); @@ -2019,18 +2019,18 @@ dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Unknown message type (0x%02X)")); } if (q2931_tree != NULL) - proto_tree_add_item(q2931_tree, hf_q2931_message_type, tvb, offset, 1, message_type); + proto_tree_add_uint(q2931_tree, hf_q2931_message_type, tvb, offset, 1, message_type); offset += 1; message_type_ext = tvb_get_guint8(tvb, offset); if (q2931_tree != NULL) { - ti = proto_tree_add_item(q2931_tree, hf_q2931_message_type_ext, tvb, + ti = proto_tree_add_uint(q2931_tree, hf_q2931_message_type_ext, tvb, offset, 1, message_type_ext); ext_tree = proto_item_add_subtree(ti, ett_q2931_ext); - proto_tree_add_item(ext_tree, hf_q2931_message_flag, tvb, + proto_tree_add_boolean(ext_tree, hf_q2931_message_flag, tvb, offset, 1, message_type_ext); if (message_type_ext & Q2931_MSG_TYPE_EXT_FOLLOW_INST) { - proto_tree_add_item(ext_tree, hf_q2931_message_action_indicator, tvb, + proto_tree_add_uint(ext_tree, hf_q2931_message_action_indicator, tvb, offset, 1, message_type_ext); } } @@ -2038,7 +2038,7 @@ dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) message_len = tvb_get_ntohs(tvb, offset); if (q2931_tree != NULL) - proto_tree_add_item(q2931_tree, hf_q2931_message_len, tvb, offset, 2, message_len); + proto_tree_add_uint(q2931_tree, hf_q2931_message_len, tvb, offset, 2, message_len); offset += 2; /* diff --git a/packet-q931.c b/packet-q931.c index 547c7361a8..f0ce81fe2a 100644 --- a/packet-q931.c +++ b/packet-q931.c @@ -2,7 +2,7 @@ * Routines for Q.931 frame disassembly * Guy Harris * - * $Id: packet-q931.c,v 1.15 2000/05/29 08:57:38 guy Exp $ + * $Id: packet-q931.c,v 1.16 2000/05/31 05:07:31 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -2074,21 +2074,21 @@ dissect_q931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tree) { ti = proto_tree_add_item(tree, proto_q931, tvb, offset, - END_OF_FRAME, NULL); + tvb_length(tvb), FALSE); q931_tree = proto_item_add_subtree(ti, ett_q931); - proto_tree_add_item(q931_tree, hf_q931_discriminator, tvb, offset, 1, tvb_get_guint8(tvb, offset)); + proto_tree_add_uint(q931_tree, hf_q931_discriminator, tvb, offset, 1, tvb_get_guint8(tvb, offset)); } offset += 1; call_ref_len = tvb_get_guint8(tvb, offset) & 0xF; /* XXX - do as a bit field? */ if (q931_tree != NULL) - proto_tree_add_item(q931_tree, hf_q931_call_ref_len, tvb, offset, 1, call_ref_len); + proto_tree_add_uint(q931_tree, hf_q931_call_ref_len, tvb, offset, 1, call_ref_len); offset += 1; if (call_ref_len != 0) { /* XXX - split this into flag and value */ tvb_memcpy(tvb, call_ref, offset, call_ref_len); if (q931_tree != NULL) - proto_tree_add_item(q931_tree, hf_q931_call_ref, tvb, offset, call_ref_len, call_ref); + proto_tree_add_bytes(q931_tree, hf_q931_call_ref, tvb, offset, call_ref_len, call_ref); offset += call_ref_len; } message_type = tvb_get_guint8(tvb, offset); @@ -2098,7 +2098,7 @@ dissect_q931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Unknown message type (0x%02X)")); } if (q931_tree != NULL) - proto_tree_add_item(q931_tree, hf_q931_message_type, tvb, offset, 1, message_type); + proto_tree_add_uint(q931_tree, hf_q931_message_type, tvb, offset, 1, message_type); offset += 1; /* diff --git a/packet-radius.c b/packet-radius.c index 6a497f4fc9..cf88fe4e18 100644 --- a/packet-radius.c +++ b/packet-radius.c @@ -1,7 +1,7 @@ /* packet-radius.c * Routines for RADIUS packet disassembly * - * $Id: packet-radius.c,v 1.12 2000/05/11 08:15:40 gram Exp $ + * $Id: packet-radius.c,v 1.13 2000/05/31 05:07:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Johan Feyaerts @@ -704,7 +704,7 @@ proto_tree { ti = proto_tree_add_item(tree,proto_radius, NullTVB, offset, rhlength, - NULL); + FALSE); radius_tree = proto_item_add_subtree(ti, ett_radius); diff --git a/packet-rip.c b/packet-rip.c index a6970b78bb..ad68cd60b7 100644 --- a/packet-rip.c +++ b/packet-rip.c @@ -2,7 +2,7 @@ * Routines for RIPv1 and RIPv2 packet disassembly * (c) Copyright Hannes R. Boehm * - * $Id: packet-rip.c,v 1.15 2000/05/11 08:15:40 gram Exp $ + * $Id: packet-rip.c,v 1.16 2000/05/31 05:07:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -97,7 +97,7 @@ dissect_rip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_str(fd, COL_INFO, packet_type[rip_header.command]); if (tree) { - ti = proto_tree_add_item(tree, proto_rip, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_rip, NullTVB, offset, END_OF_FRAME, FALSE); rip_tree = proto_item_add_subtree(ti, ett_rip); proto_tree_add_text(rip_tree, NullTVB, offset, 1, "Command: %d (%s)", rip_header.command, packet_type[rip_header.command]); diff --git a/packet-ripng.c b/packet-ripng.c index 8046c0ac8a..7eb34a7618 100644 --- a/packet-ripng.c +++ b/packet-ripng.c @@ -3,7 +3,7 @@ * (c) Copyright Jun-ichiro itojun Hagino * derived from packet-rip.c * - * $Id: packet-ripng.c,v 1.11 2000/05/17 04:09:32 gram Exp $ + * $Id: packet-ripng.c,v 1.12 2000/05/31 05:07:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -78,13 +78,13 @@ dissect_ripng(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_fstr(fd, COL_INFO, "%s", cmd); if (tree) { - ti = proto_tree_add_item(tree, proto_ripng, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_ripng, NullTVB, offset, END_OF_FRAME, FALSE); ripng_tree = proto_item_add_subtree(ti, ett_ripng); proto_tree_add_uint_format(ripng_tree, hf_ripng_cmd, NullTVB, offset, 1, rip6.rip6_cmd, "Command: %s (%u)", cmd, rip6.rip6_cmd); - proto_tree_add_item(ripng_tree, hf_ripng_version, NullTVB, offset + 1, 1, + proto_tree_add_uint(ripng_tree, hf_ripng_version, NullTVB, offset + 1, 1, rip6.rip6_vers); offset += 4; diff --git a/packet-rlogin.c b/packet-rlogin.c index 9b564d0b3d..34f7ea7c5f 100644 --- a/packet-rlogin.c +++ b/packet-rlogin.c @@ -2,7 +2,7 @@ * Routines for unix rlogin packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-rlogin.c,v 1.2 2000/05/11 08:15:41 gram Exp $ + * $Id: packet-rlogin.c,v 1.3 2000/05/31 05:07:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -211,7 +211,7 @@ static void rlogin_display( rlogin_hash_entry_t *hash_info, const u_char *pd, proto_item *user_info_item, *window_info_item; ti = proto_tree_add_item( tree, proto_rlogin, NullTVB, offset, - END_OF_FRAME, NULL, "Rlogin:" ); + END_OF_FRAME, FALSE); rlogin_tree = proto_item_add_subtree(ti, ett_rlogin); @@ -252,7 +252,7 @@ static void rlogin_display( rlogin_hash_entry_t *hash_info, const u_char *pd, if ( compare_packet_ptr( hash_info->info_row)){ /* user info ?*/ user_info_item = proto_tree_add_item( rlogin_tree, hf_user_info, NullTVB, - offset, END_OF_FRAME, NULL ); + offset, END_OF_FRAME, FALSE); str = &pd[ offset]; /* do server user name */ @@ -297,7 +297,7 @@ static void rlogin_display( rlogin_hash_entry_t *hash_info, const u_char *pd, CHECK_PACKET_LENGTH( 12); window_info_item = proto_tree_add_item( rlogin_tree, - hf_window_info, NullTVB, offset, 12, NULL ); + hf_window_info, NullTVB, offset, 12, FALSE ); window_tree = proto_item_add_subtree( window_info_item, ett_rlogin_window); @@ -313,22 +313,22 @@ static void rlogin_display( rlogin_hash_entry_t *hash_info, const u_char *pd, offset += 2; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( window_tree, hf_window_info_rows, NullTVB, offset, + proto_tree_add_uint( window_tree, hf_window_info_rows, NullTVB, offset, 2, pntohs( &pd[offset])); offset += 2; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( window_tree, hf_window_info_cols, NullTVB, offset, + proto_tree_add_uint( window_tree, hf_window_info_cols, NullTVB, offset, 2, pntohs( &pd[offset]) ); offset += 2; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( window_tree, hf_window_info_x_pixels, NullTVB, + proto_tree_add_uint( window_tree, hf_window_info_x_pixels, NullTVB, offset, 2, pntohs( &pd[offset])); offset += 2; CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( window_tree, hf_window_info_y_pixels, NullTVB, + proto_tree_add_uint( window_tree, hf_window_info_y_pixels, NullTVB, offset, 2, pntohs( &pd[offset]) ); offset += 2; } diff --git a/packet-rpc.c b/packet-rpc.c index 50f6c5a8dc..c8409152ea 100644 --- a/packet-rpc.c +++ b/packet-rpc.c @@ -2,7 +2,7 @@ * Routines for rpc dissection * Copyright 1999, Uwe Girlich * - * $Id: packet-rpc.c,v 1.30 2000/05/11 08:15:41 gram Exp $ + * $Id: packet-rpc.c,v 1.31 2000/05/31 05:07:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -338,7 +338,7 @@ int hfindex) if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; value = EXTRACT_UINT(pd, offset+0); if (tree) - proto_tree_add_item(tree, hfindex, NullTVB, offset, 4, value); + proto_tree_add_boolean(tree, hfindex, NullTVB, offset, 4, value); offset += 4; return offset; @@ -499,7 +499,7 @@ dissect_rpc_opaque_data(const u_char *pd, int offset, frame_data *fd, string_item = proto_tree_add_text(tree, NullTVB,offset+0, END_OF_FRAME, "%s: %s", proto_registrar_get_name(hfindex), string_buffer_print); if (string_data) { - proto_tree_add_item_hidden(tree, hfindex, NullTVB, offset+4, + proto_tree_add_string_hidden(tree, hfindex, NullTVB, offset+4, string_length_copy, string_buffer); } if (string_item) { @@ -585,7 +585,7 @@ dissect_rpc_list(const u_char *pd, int offset, frame_data *fd, while (1) { if (!BYTES_ARE_IN_FRAME(offset,4)) break; value_follows = EXTRACT_UINT(pd, offset+0); - proto_tree_add_item(tree,hf_rpc_value_follows, NullTVB, + proto_tree_add_boolean(tree,hf_rpc_value_follows, NullTVB, offset+0, 4, value_follows); offset += 4; if (value_follows == 1) { @@ -615,9 +615,9 @@ dissect_rpc_auth( const u_char *pd, int offset, frame_data *fd, proto_tree *tree /* if (!BYTES_ARE_IN_FRAME(offset+8,full_length)) return; */ if (tree) { - proto_tree_add_item(tree, hf_rpc_auth_flavor, NullTVB, offset+0, 4, + proto_tree_add_uint(tree, hf_rpc_auth_flavor, NullTVB, offset+0, 4, flavor); - proto_tree_add_item(tree, hf_rpc_auth_length, NullTVB, offset+4, 4, + proto_tree_add_uint(tree, hf_rpc_auth_length, NullTVB, offset+4, 4, length); } @@ -637,7 +637,7 @@ dissect_rpc_auth( const u_char *pd, int offset, frame_data *fd, proto_tree *tree if (!BYTES_ARE_IN_FRAME(offset,4)) return; stamp = EXTRACT_UINT(pd,offset+0); if (tree) - proto_tree_add_item(tree, hf_rpc_auth_stamp, NullTVB, + proto_tree_add_uint(tree, hf_rpc_auth_stamp, NullTVB, offset+0, 4, stamp); offset += 4; @@ -647,14 +647,14 @@ dissect_rpc_auth( const u_char *pd, int offset, frame_data *fd, proto_tree *tree if (!BYTES_ARE_IN_FRAME(offset,4)) return; uid = EXTRACT_UINT(pd,offset+0); if (tree) - proto_tree_add_item(tree, hf_rpc_auth_uid, NullTVB, + proto_tree_add_uint(tree, hf_rpc_auth_uid, NullTVB, offset+0, 4, uid); offset += 4; if (!BYTES_ARE_IN_FRAME(offset,4)) return; gid = EXTRACT_UINT(pd,offset+0); if (tree) - proto_tree_add_item(tree, hf_rpc_auth_gid, NullTVB, + proto_tree_add_uint(tree, hf_rpc_auth_gid, NullTVB, offset+0, 4, gid); offset += 4; @@ -670,7 +670,7 @@ dissect_rpc_auth( const u_char *pd, int offset, frame_data *fd, proto_tree *tree for (gids_i = 0 ; gids_i < gids_count ; gids_i++) { gids_entry = EXTRACT_UINT(pd,offset+0); if (gtree) - proto_tree_add_item(gtree, hf_rpc_auth_gid, NullTVB, + proto_tree_add_uint(gtree, hf_rpc_auth_gid, NullTVB, offset, 4, gids_entry); offset+=4; } @@ -882,16 +882,16 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_PROTOCOL, "RPC"); if (tree) { - rpc_item = proto_tree_add_item(tree, proto_rpc, NullTVB, offset, END_OF_FRAME, NULL); + rpc_item = proto_tree_add_item(tree, proto_rpc, NullTVB, offset, END_OF_FRAME, FALSE); if (rpc_item) { rpc_tree = proto_item_add_subtree(rpc_item, ett_rpc); } } if (use_rm && rpc_tree) { - proto_tree_add_item(rpc_tree,hf_rpc_lastfrag, NullTVB, + proto_tree_add_boolean(rpc_tree,hf_rpc_lastfrag, NullTVB, offset-4, 4, (rpc_rm >> 31) & 0x1); - proto_tree_add_item(rpc_tree,hf_rpc_fraglen, NullTVB, + proto_tree_add_uint(rpc_tree,hf_rpc_fraglen, NullTVB, offset-4, 4, rpc_rm & RPC_RM_FRAGLEN); } @@ -903,7 +903,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) msg_type_name = val_to_str(msg_type,rpc_msg_type,"%u"); if (rpc_tree) { - proto_tree_add_item(rpc_tree, hf_rpc_msgtype, NullTVB, + proto_tree_add_uint(rpc_tree, hf_rpc_msgtype, NullTVB, offset+4, 4, msg_type); } @@ -918,7 +918,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) rpcvers = EXTRACT_UINT(pd,offset+0); if (rpc_tree) { - proto_tree_add_item(rpc_tree, + proto_tree_add_uint(rpc_tree, hf_rpc_version, NullTVB, offset+0, 4, rpcvers); } @@ -940,7 +940,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) return TRUE; vers = EXTRACT_UINT(pd,offset+8); if (rpc_tree) { - proto_tree_add_item(rpc_tree, + proto_tree_add_uint(rpc_tree, hf_rpc_programversion, NullTVB, offset+8, 4, vers); } @@ -1003,9 +1003,9 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (check_col(fd, COL_INFO)) { col_append_fstr(fd, COL_INFO, " dup XID 0x%x", xid); if (rpc_tree) { - proto_tree_add_item_hidden(rpc_tree, + proto_tree_add_uint_hidden(rpc_tree, hf_rpc_dup, NullTVB, 0,0, xid); - proto_tree_add_item_hidden(rpc_tree, + proto_tree_add_uint_hidden(rpc_tree, hf_rpc_call_dup, NullTVB, 0,0, xid); } } @@ -1085,7 +1085,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree_add_uint_format(rpc_tree, hf_rpc_program, NullTVB, 0, 0, prog, "Program: %s (%u)", progname, prog); - proto_tree_add_item(rpc_tree, + proto_tree_add_uint(rpc_tree, hf_rpc_programversion, NullTVB, 0, 0, vers); proto_tree_add_uint_format(rpc_tree, hf_rpc_procedure, NullTVB, 0, 0, proc, @@ -1096,9 +1096,9 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (check_col(fd, COL_INFO)) { col_append_fstr(fd, COL_INFO, " dup XID 0x%x", xid); if (rpc_tree) { - proto_tree_add_item_hidden(rpc_tree, + proto_tree_add_uint_hidden(rpc_tree, hf_rpc_dup, NullTVB, 0,0, xid); - proto_tree_add_item_hidden(rpc_tree, + proto_tree_add_uint_hidden(rpc_tree, hf_rpc_reply_dup, NullTVB, 0,0, xid); } } @@ -1108,7 +1108,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) return TRUE; reply_state = EXTRACT_UINT(pd,offset+0); if (rpc_tree) { - proto_tree_add_item(rpc_tree, hf_rpc_state_reply, NullTVB, + proto_tree_add_uint(rpc_tree, hf_rpc_state_reply, NullTVB, offset+0, 4, reply_state); } offset += 4; @@ -1119,7 +1119,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) return TRUE; accept_state = EXTRACT_UINT(pd,offset+0); if (rpc_tree) { - proto_tree_add_item(rpc_tree, hf_rpc_state_accept, NullTVB, + proto_tree_add_uint(rpc_tree, hf_rpc_state_accept, NullTVB, offset+0, 4, accept_state); } offset += 4; @@ -1134,10 +1134,10 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) vers_low = EXTRACT_UINT(pd,offset+0); vers_high = EXTRACT_UINT(pd,offset+4); if (rpc_tree) { - proto_tree_add_item(rpc_tree, + proto_tree_add_uint(rpc_tree, hf_rpc_programversion_min, NullTVB, offset+0, 4, vers_low); - proto_tree_add_item(rpc_tree, + proto_tree_add_uint(rpc_tree, hf_rpc_programversion_max, NullTVB, offset+4, 4, vers_high); } @@ -1152,7 +1152,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) return TRUE; reject_state = EXTRACT_UINT(pd,offset+0); if (rpc_tree) { - proto_tree_add_item(rpc_tree, + proto_tree_add_uint(rpc_tree, hf_rpc_state_reject, NullTVB, offset+0, 4, reject_state); } @@ -1164,10 +1164,10 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) vers_low = EXTRACT_UINT(pd,offset+0); vers_high = EXTRACT_UINT(pd,offset+4); if (rpc_tree) { - proto_tree_add_item(rpc_tree, + proto_tree_add_uint(rpc_tree, hf_rpc_version_min, NullTVB, offset+0, 4, vers_low); - proto_tree_add_item(rpc_tree, + proto_tree_add_uint(rpc_tree, hf_rpc_version_max, NullTVB, offset+4, 4, vers_high); } @@ -1177,7 +1177,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) return TRUE; auth_state = EXTRACT_UINT(pd,offset+0); if (rpc_tree) { - proto_tree_add_item(rpc_tree, + proto_tree_add_uint(rpc_tree, hf_rpc_state_auth, NullTVB, offset+0, 4, auth_state); } @@ -1196,13 +1196,13 @@ dissect_rpc_prog: /* create here the program specific sub-tree */ if (tree) { - pitem = proto_tree_add_item(tree, proto, NullTVB, offset, END_OF_FRAME); + pitem = proto_tree_add_item(tree, proto, NullTVB, offset, END_OF_FRAME, FALSE); if (pitem) { ptree = proto_item_add_subtree(pitem, ett); } if (ptree) { - proto_tree_add_item(ptree, + proto_tree_add_uint(ptree, hf_rpc_programversion, NullTVB, 0, 0, vers); proto_tree_add_uint_format(ptree, hf_rpc_procedure, NullTVB, 0, 0, proc, diff --git a/packet-rsvp.c b/packet-rsvp.c index a0a13db5be..718974e4ae 100644 --- a/packet-rsvp.c +++ b/packet-rsvp.c @@ -3,7 +3,7 @@ * * (c) Copyright Ashok Narayanan * - * $Id: packet-rsvp.c,v 1.21 2000/05/11 08:15:41 gram Exp $ + * $Id: packet-rsvp.c,v 1.22 2000/05/31 05:07:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -857,7 +857,7 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { msg_length = pntohs(pd+offset+6); - ti = proto_tree_add_item(tree, proto_rsvp, NullTVB, offset, msg_length, NULL); + ti = proto_tree_add_item(tree, proto_rsvp, NullTVB, offset, msg_length, FALSE); rsvp_tree = proto_item_add_subtree(ti, ett_rsvp); ti = proto_tree_add_text(rsvp_tree, NullTVB, offset, @@ -868,14 +868,14 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) (hdr->ver_flags & 0xf0)>>4); proto_tree_add_text(rsvp_header_tree, NullTVB, offset, 1, "Flags: %02X", hdr->ver_flags & 0xf); - proto_tree_add_item(rsvp_header_tree, rsvp_filter[RSVPF_MSG], NullTVB, + proto_tree_add_uint(rsvp_header_tree, rsvp_filter[RSVPF_MSG], NullTVB, offset+1, 1, hdr->message_type); if (hdr->message_type >= RSVPF_MAX) { proto_tree_add_text(rsvp_header_tree, NullTVB, offset+1, 1, "Message Type: %u - Unknown", hdr->message_type); return; } - proto_tree_add_item_hidden(rsvp_header_tree, rsvp_filter[RSVPF_MSG + hdr->message_type], NullTVB, + proto_tree_add_item_hidden_old(rsvp_header_tree, rsvp_filter[RSVPF_MSG + hdr->message_type], NullTVB, offset+1, 1, 1); proto_tree_add_text(rsvp_header_tree, NullTVB, offset + 2 , 2, "Message Checksum"); proto_tree_add_text(rsvp_header_tree, NullTVB, offset + 4 , 1, "Sending TTL: %u", @@ -896,9 +896,9 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) object_type = match_strval(obj->class, rsvp_class_vals); if (!object_type) object_type = "Unknown"; - ti = proto_tree_add_item_hidden(rsvp_tree, rsvp_filter[RSVPF_OBJECT], NullTVB, + ti = proto_tree_add_uint_hidden(rsvp_tree, rsvp_filter[RSVPF_OBJECT], NullTVB, offset, obj_length, obj->class); - ti = proto_tree_add_item(rsvp_tree, rsvp_filter[rsvp_class_to_filter_num(obj->class)], NullTVB, + ti = proto_tree_add_item_old(rsvp_tree, rsvp_filter[rsvp_class_to_filter_num(obj->class)], NullTVB, offset, obj_length, obj->class); offset2 = offset + sizeof(rsvp_object); @@ -917,14 +917,14 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree_add_text(rsvp_object_tree, NullTVB, offset+3, 1, "C-type: 1 - IPv4"); memcpy(&ip_addr, pd+offset2, 4); - proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_IP], NullTVB, + proto_tree_add_ipv4(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_IP], NullTVB, offset2, 4, ip_addr); - proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_PROTO], NullTVB, + proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_PROTO], NullTVB, offset2+4, 1, *(pd+offset2+4)); proto_tree_add_text(rsvp_object_tree, NullTVB, offset2+5, 1, "Flags: %x", pntohs(pd+offset2+5)); - proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_PORT], NullTVB, + proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_PORT], NullTVB, offset2+6, 2, pntohs(pd+offset2+6)); break; } @@ -950,10 +950,10 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree_add_text(rsvp_object_tree, NullTVB, offset+3, 1, "C-type: 7 - IPv4 LSP"); memcpy(&ip_addr, pd+offset2, 4); - proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_IP], NullTVB, + proto_tree_add_ipv4(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_IP], NullTVB, offset2, 4, ip_addr); - proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_TUNNEL_ID], NullTVB, + proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_TUNNEL_ID], NullTVB, offset2+6, 2, pntohs(pd+offset2+6)); memcpy(&ip_addr, pd+offset2+8, 4); @@ -961,7 +961,7 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) "Extended Tunnel ID: %lu (%s)", (unsigned long)ntohl(ip_addr), ip_to_str(pd+offset2+8)); - proto_tree_add_item_hidden(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], NullTVB, + proto_tree_add_uint_hidden(rsvp_object_tree, rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], NullTVB, offset2+8, 4, ip_addr); break; } @@ -1253,10 +1253,10 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree_add_text(rsvp_object_tree, NullTVB, offset+3, 1, "C-type: 1 - IPv4"); memcpy(&ip_addr, pd+offset2, 4); - proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_SENDER_IP], NullTVB, + proto_tree_add_ipv4(rsvp_object_tree, rsvp_filter[RSVPF_SENDER_IP], NullTVB, offset2, 4, ip_addr); - proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_SENDER_PORT], NullTVB, + proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_SENDER_PORT], NullTVB, offset2+6, 2, pntohs(pd+offset2+6)); break; } @@ -1277,10 +1277,10 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree_add_text(rsvp_object_tree, NullTVB, offset+3, 1, "C-type: 7 - IPv4 LSP"); memcpy(&ip_addr, pd+offset2, 4); - proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_SENDER_IP], NullTVB, + proto_tree_add_ipv4(rsvp_object_tree, rsvp_filter[RSVPF_SENDER_IP], NullTVB, offset2, 4, ip_addr); - proto_tree_add_item(rsvp_object_tree, rsvp_filter[RSVPF_SENDER_LSP_ID], NullTVB, + proto_tree_add_uint(rsvp_object_tree, rsvp_filter[RSVPF_SENDER_LSP_ID], NullTVB, offset2+6, 2, pntohs(pd+offset2+6)); break; } diff --git a/packet-rtcp.c b/packet-rtcp.c index 517b1f0f7c..a2928d4d7d 100644 --- a/packet-rtcp.c +++ b/packet-rtcp.c @@ -3,7 +3,7 @@ * * Jason Lango * - * $Id: packet-rtcp.c,v 1.2 2000/05/11 08:15:42 gram Exp $ + * $Id: packet-rtcp.c,v 1.3 2000/05/31 05:07:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -342,7 +342,7 @@ dissect_one_rtcp(const u_char *pd, int offset, frame_data *fd, start_packet = offset; end_offset = offset + END_OF_FRAME; - ti = proto_tree_add_item(tree, proto_rtcp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_rtcp, NullTVB, offset, END_OF_FRAME, FALSE); rtcp_tree = proto_item_add_subtree(ti, ett_rtcp); memcpy(&hdr, data, END_OF_FRAME < sizeof(rtcp_hdr_t) ? diff --git a/packet-rtp.c b/packet-rtp.c index f9d1dfd2b2..92763c8c80 100644 --- a/packet-rtp.c +++ b/packet-rtp.c @@ -3,7 +3,7 @@ * * Jason Lango * - * $Id: packet-rtp.c,v 1.3 2000/05/11 08:15:43 gram Exp $ + * $Id: packet-rtp.c,v 1.4 2000/05/31 05:07:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -108,7 +108,7 @@ dissect_rtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { ti = proto_tree_add_item(tree, proto_rtp, NullTVB, offset, END_OF_FRAME, - NULL); + FALSE); rtp_tree = proto_item_add_subtree(ti, ett_rtp); } diff --git a/packet-rtsp.c b/packet-rtsp.c index 1c929c32e4..f250e9e341 100644 --- a/packet-rtsp.c +++ b/packet-rtsp.c @@ -4,7 +4,7 @@ * Jason Lango * Liberally copied from packet-http.c, by Guy Harris * - * $Id: packet-rtsp.c,v 1.13 2000/05/11 08:15:43 gram Exp $ + * $Id: packet-rtsp.c,v 1.14 2000/05/31 05:07:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -154,7 +154,7 @@ static void dissect_rtsp(const u_char *pd, int offset, frame_data *fd, rtsp_tree = NULL; if (tree) { ti = proto_tree_add_item(tree, proto_rtsp, NullTVB, offset, - END_OF_FRAME, NULL); + END_OF_FRAME, FALSE); rtsp_tree = proto_item_add_subtree(ti, ett_rtsp); } @@ -318,7 +318,7 @@ process_rtsp_request_or_reply(const u_char *data, int offset, int linelen, status_start = status; while (status < lineend && isdigit(*status)) status_i = status_i * 10 + *status++ - '0'; - proto_tree_add_item_hidden(tree, hf_rtsp_status, NullTVB, + proto_tree_add_uint_hidden(tree, hf_rtsp_status, NullTVB, offset + (status_start - data), status - status_start, status_i); } @@ -340,7 +340,7 @@ process_rtsp_request_or_reply(const u_char *data, int offset, int linelen, u_char *tmp_url; /* method name */ - proto_tree_add_item_hidden(tree, hf_rtsp_method, NullTVB, offset, + proto_tree_add_string_hidden(tree, hf_rtsp_method, NullTVB, offset, strlen(rtsp_methods[ii]), rtsp_methods[ii]); /* URL */ @@ -355,7 +355,7 @@ process_rtsp_request_or_reply(const u_char *data, int offset, int linelen, tmp_url = g_malloc(url - url_start + 1); memcpy(tmp_url, url_start, url - url_start); tmp_url[url - url_start] = 0; - proto_tree_add_item_hidden(tree, hf_rtsp_url, NullTVB, + proto_tree_add_string_hidden(tree, hf_rtsp_url, NullTVB, offset + (url_start - data), url - url_start, tmp_url); g_free(tmp_url); } diff --git a/packet-rx.c b/packet-rx.c index 7889c2456f..54ae5ff8fa 100644 --- a/packet-rx.c +++ b/packet-rx.c @@ -4,7 +4,7 @@ * Based on routines from tcpdump patches by * Ken Hornstein * - * $Id: packet-rx.c,v 1.11 2000/05/11 08:15:43 gram Exp $ + * $Id: packet-rx.c,v 1.12 2000/05/31 05:07:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -119,41 +119,41 @@ dissect_rx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) val_to_str(rxh->type,rx_types,"unknown (%d)")); rx_tree = proto_item_add_subtree(ti, ett_rx); - proto_tree_add_item(rx_tree, hf_rx_epoch, NullTVB, + proto_tree_add_uint(rx_tree, hf_rx_epoch, NullTVB, offset, 4, pntohl(&rxh->epoch)); - proto_tree_add_item(rx_tree, hf_rx_cid, NullTVB, + proto_tree_add_uint(rx_tree, hf_rx_cid, NullTVB, offset+4, 4, pntohl(&rxh->cid)); - proto_tree_add_item(rx_tree, hf_rx_callnumber, NullTVB, + proto_tree_add_uint(rx_tree, hf_rx_callnumber, NullTVB, offset+8, 4, pntohl(&rxh->callNumber)); - proto_tree_add_item(rx_tree, hf_rx_seq, NullTVB, + proto_tree_add_uint(rx_tree, hf_rx_seq, NullTVB, offset+12, 4, pntohl(&rxh->seq)); - proto_tree_add_item(rx_tree, hf_rx_serial, NullTVB, + proto_tree_add_uint(rx_tree, hf_rx_serial, NullTVB, offset+16, 4, pntohl(&rxh->serial)); - proto_tree_add_item(rx_tree, hf_rx_type, NullTVB, + proto_tree_add_uint(rx_tree, hf_rx_type, NullTVB, offset+20, 1, rxh->type); - rx_flags = proto_tree_add_item(rx_tree, hf_rx_flags, NullTVB, + rx_flags = proto_tree_add_uint(rx_tree, hf_rx_flags, NullTVB, offset+21, 1, rxh->flags); rx_tree_flags = proto_item_add_subtree(rx_flags, ett_rx_flags); - proto_tree_add_item(rx_tree_flags, hf_rx_flags_free_packet, NullTVB, + proto_tree_add_uint(rx_tree_flags, hf_rx_flags_free_packet, NullTVB, offset+21, 1, rxh->flags); - proto_tree_add_item(rx_tree_flags, hf_rx_flags_more_packets, NullTVB, + proto_tree_add_uint(rx_tree_flags, hf_rx_flags_more_packets, NullTVB, offset+21, 1, rxh->flags); - proto_tree_add_item(rx_tree_flags, hf_rx_flags_last_packet, NullTVB, + proto_tree_add_uint(rx_tree_flags, hf_rx_flags_last_packet, NullTVB, offset+21, 1, rxh->flags); - proto_tree_add_item(rx_tree_flags, hf_rx_flags_request_ack, NullTVB, + proto_tree_add_uint(rx_tree_flags, hf_rx_flags_request_ack, NullTVB, offset+21, 1, rxh->flags); - proto_tree_add_item(rx_tree_flags, hf_rx_flags_clientinit, NullTVB, + proto_tree_add_uint(rx_tree_flags, hf_rx_flags_clientinit, NullTVB, offset+21, 1, rxh->flags); - proto_tree_add_item(rx_tree, hf_rx_userstatus, NullTVB, + proto_tree_add_uint(rx_tree, hf_rx_userstatus, NullTVB, offset+22, 1, rxh->userStatus); - proto_tree_add_item(rx_tree, hf_rx_securityindex, NullTVB, + proto_tree_add_uint(rx_tree, hf_rx_securityindex, NullTVB, offset+23, 1, rxh->securityIndex); - proto_tree_add_item(rx_tree, hf_rx_spare, NullTVB, + proto_tree_add_uint(rx_tree, hf_rx_spare, NullTVB, offset+24, 2, pntohs(&rxh->spare)); - proto_tree_add_item(rx_tree, hf_rx_serviceid, NullTVB, + proto_tree_add_uint(rx_tree, hf_rx_serviceid, NullTVB, offset+26, 2, pntohs(&rxh->serviceId)); } diff --git a/packet-sap.c b/packet-sap.c index 99d9bea9fa..61723e45ee 100644 --- a/packet-sap.c +++ b/packet-sap.c @@ -4,7 +4,7 @@ * * Heikki Vatiainen * - * $Id: packet-sap.c,v 1.7 2000/05/11 08:15:43 gram Exp $ + * $Id: packet-sap.c,v 1.8 2000/05/31 05:07:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -154,17 +154,17 @@ dissect_sap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - si = proto_tree_add_item(tree, proto_sap, NullTVB, offset, END_OF_FRAME, NULL); + si = proto_tree_add_item(tree, proto_sap, NullTVB, offset, END_OF_FRAME, FALSE); sap_tree = proto_item_add_subtree(si, ett_sap); - sif = proto_tree_add_item(sap_tree, hf_sap_flags, NullTVB, offset, 1, pd[offset]); + sif = proto_tree_add_uint(sap_tree, hf_sap_flags, NullTVB, offset, 1, pd[offset]); sap_flags_tree = proto_item_add_subtree(sif, ett_sap_flags); - proto_tree_add_item(sap_flags_tree, hf_sap_flags_v, NullTVB, offset, 1, pd[offset]); - proto_tree_add_item(sap_flags_tree, hf_sap_flags_a, NullTVB, offset, 1, pd[offset]); - proto_tree_add_item(sap_flags_tree, hf_sap_flags_r, NullTVB, offset, 1, pd[offset]); - proto_tree_add_item(sap_flags_tree, hf_sap_flags_t, NullTVB, offset, 1, pd[offset]); - proto_tree_add_item(sap_flags_tree, hf_sap_flags_e, NullTVB, offset, 1, pd[offset]); - proto_tree_add_item(sap_flags_tree, hf_sap_flags_c, NullTVB, offset, 1, pd[offset]); + proto_tree_add_uint(sap_flags_tree, hf_sap_flags_v, NullTVB, offset, 1, pd[offset]); + proto_tree_add_boolean(sap_flags_tree, hf_sap_flags_a, NullTVB, offset, 1, pd[offset]); + proto_tree_add_boolean(sap_flags_tree, hf_sap_flags_r, NullTVB, offset, 1, pd[offset]); + proto_tree_add_boolean(sap_flags_tree, hf_sap_flags_t, NullTVB, offset, 1, pd[offset]); + proto_tree_add_boolean(sap_flags_tree, hf_sap_flags_e, NullTVB, offset, 1, pd[offset]); + proto_tree_add_boolean(sap_flags_tree, hf_sap_flags_c, NullTVB, offset, 1, pd[offset]); offset++; proto_tree_add_text(sap_tree, NullTVB, offset, 1, "Authentication Length: %u", pd[offset]); @@ -189,14 +189,14 @@ dissect_sap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) auth_data_len = auth_len * sizeof(guint32); - sdi = proto_tree_add_item(sap_tree, hf_auth_data, NullTVB, offset, auth_data_len, pd[offset]); + sdi = proto_tree_add_item(sap_tree, hf_auth_data, NullTVB, offset, auth_data_len, FALSE); sa_tree = proto_item_add_subtree(sdi, ett_sap_auth); - sai = proto_tree_add_item(sa_tree, hf_auth_flags, NullTVB, offset, 1, pd[offset]); + sai = proto_tree_add_uint(sa_tree, hf_auth_flags, NullTVB, offset, 1, pd[offset]); saf_tree = proto_item_add_subtree(sai, ett_sap_authf); - proto_tree_add_item(saf_tree, hf_auth_flags_v, NullTVB, offset, 1, pd[offset]); - proto_tree_add_item(saf_tree, hf_auth_flags_p, NullTVB, offset, 1, pd[offset]); - proto_tree_add_item(saf_tree, hf_auth_flags_t, NullTVB, offset, 1, pd[offset]); + proto_tree_add_uint(saf_tree, hf_auth_flags_v, NullTVB, offset, 1, pd[offset]); + proto_tree_add_boolean(saf_tree, hf_auth_flags_p, NullTVB, offset, 1, pd[offset]); + proto_tree_add_uint(saf_tree, hf_auth_flags_t, NullTVB, offset, 1, pd[offset]); has_pad = pd[offset]&MCAST_SAP_AUTH_BIT_P; if (has_pad) pad_len = *(pd+offset+auth_data_len-1); diff --git a/packet-sdp.c b/packet-sdp.c index 9b84e83cce..677581f272 100644 --- a/packet-sdp.c +++ b/packet-sdp.c @@ -4,7 +4,7 @@ * Jason Lango * Liberally copied from packet-http.c, by Guy Harris * - * $Id: packet-sdp.c,v 1.7 2000/05/11 08:15:43 gram Exp $ + * $Id: packet-sdp.c,v 1.8 2000/05/31 05:07:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -72,7 +72,7 @@ void dissect_sdp(const u_char *pd, int offset, frame_data *fd, if (!tree) return; - ti = proto_tree_add_item(tree, proto_sdp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_sdp, NullTVB, offset, END_OF_FRAME, FALSE); sdp_tree = proto_item_add_subtree(ti, ett_sdp); section = 0; diff --git a/packet-smb-browse.c b/packet-smb-browse.c index a217b7597e..4770eb8e3d 100644 --- a/packet-smb-browse.c +++ b/packet-smb-browse.c @@ -2,7 +2,7 @@ * Routines for smb packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-smb-browse.c,v 1.3 2000/05/11 08:15:44 gram Exp $ + * $Id: packet-smb-browse.c,v 1.4 2000/05/31 05:07:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -167,7 +167,7 @@ dissect_mailslot_browse(const u_char *pd, int offset, frame_data *fd, proto_tree if (tree) { /* Add the browse tree */ - ti = proto_tree_add_item(parent, proto_smb_browse, NullTVB, DataOffset, DataCount, NULL); + ti = proto_tree_add_item(parent, proto_smb_browse, NullTVB, DataOffset, DataCount, FALSE); browse_tree = proto_item_add_subtree(ti, ett_browse); proto_tree_add_text(browse_tree, NullTVB, loc_offset, 1, "OpCode: %s", (OpCode > (sizeof(browse_commands)/sizeof(char *))) ? "Error, No Such Command" : browse_commands[OpCode]); diff --git a/packet-smb-logon.c b/packet-smb-logon.c index 82fdea6aaf..f326743f7d 100644 --- a/packet-smb-logon.c +++ b/packet-smb-logon.c @@ -2,7 +2,7 @@ * Routines for smb net logon packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-smb-logon.c,v 1.4 2000/05/11 08:15:45 gram Exp $ + * $Id: packet-smb-logon.c,v 1.5 2000/05/31 05:07:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -531,7 +531,7 @@ static void (*dissect_smb_logon_cmds[])(const u_char *, int, frame_data *, if (tree) { ti = proto_tree_add_item( parent, proto_smb_logon, NullTVB, offset, - END_OF_FRAME, NULL); + END_OF_FRAME, FALSE); smb_logon_tree = proto_item_add_subtree(ti, ett_smb_logon); proto_tree_add_text(smb_logon_tree, NullTVB, offset, 1, diff --git a/packet-smb-mailslot.c b/packet-smb-mailslot.c index 5e8e5fdfc4..ae0ccb3749 100644 --- a/packet-smb-mailslot.c +++ b/packet-smb-mailslot.c @@ -2,7 +2,7 @@ * Routines for smb mailslot packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-smb-mailslot.c,v 1.4 2000/05/11 08:15:45 gram Exp $ + * $Id: packet-smb-mailslot.c,v 1.5 2000/05/31 05:07:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -92,7 +92,7 @@ dissect_mailslot_smb(const u_char *pd, int offset, frame_data *fd, if (tree) { ti = proto_tree_add_item( parent, proto_smb_msp, NullTVB, offset, - END_OF_FRAME, NULL); + END_OF_FRAME, FALSE); smb_msp_tree = proto_item_add_subtree(ti, ett_smb_msp); proto_tree_add_text(smb_msp_tree, NullTVB, offset, 2, "Op code: %u (%s)", diff --git a/packet-smb-pipe.c b/packet-smb-pipe.c index 598a969197..bc1ea076b5 100644 --- a/packet-smb-pipe.c +++ b/packet-smb-pipe.c @@ -2,7 +2,7 @@ * Routines for smb packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-smb-pipe.c,v 1.8 2000/05/14 20:50:03 guy Exp $ + * $Id: packet-smb-pipe.c,v 1.9 2000/05/31 05:07:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -593,7 +593,7 @@ dissect_pipe_lanman(const u_char *pd, int offset, frame_data *fd, if (tree) { - ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, ParameterCount, NULL); + ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, ParameterCount, FALSE); lanman_tree = proto_item_add_subtree(ti, ett_lanman); proto_tree_add_text(lanman_tree, NullTVB, loc_offset, 2, "Function Code: NetShareEnum"); @@ -666,7 +666,7 @@ dissect_pipe_lanman(const u_char *pd, int offset, frame_data *fd, if (tree) { - ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, ParameterCount, NULL); + ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, ParameterCount, FALSE); lanman_tree = proto_item_add_subtree(ti, ett_lanman); proto_tree_add_text(lanman_tree, NullTVB, loc_offset, 2, "Function Code: NetServerEnum2"); @@ -762,7 +762,7 @@ dissect_pipe_lanman(const u_char *pd, int offset, frame_data *fd, if (tree) { - ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, ParameterCount, NULL); + ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, ParameterCount, FALSE); lanman_tree = proto_item_add_subtree(ti, ett_lanman); if (lanman) { @@ -851,7 +851,7 @@ dissect_pipe_lanman(const u_char *pd, int offset, frame_data *fd, if (tree) { - ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + DataOffset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + DataOffset, END_OF_FRAME, FALSE); lanman_tree = proto_item_add_subtree(ti, ett_lanman); @@ -878,7 +878,7 @@ dissect_pipe_lanman(const u_char *pd, int offset, frame_data *fd, if (tree) { - ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, END_OF_FRAME, FALSE); lanman_tree = proto_item_add_subtree(ti, ett_lanman); proto_tree_add_text(lanman_tree, NullTVB, loc_offset, 0, "Function Code: NetShareEnum"); @@ -1003,7 +1003,7 @@ dissect_pipe_lanman(const u_char *pd, int offset, frame_data *fd, if (tree) { - ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, END_OF_FRAME, FALSE); lanman_tree = proto_item_add_subtree(ti, ett_lanman); proto_tree_add_text(lanman_tree, NullTVB, loc_offset, 2, "Function Code: NetServerEnum2"); @@ -1166,7 +1166,7 @@ dissect_pipe_lanman(const u_char *pd, int offset, frame_data *fd, if (tree) { - ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(parent, proto_smb_lanman, NullTVB, SMB_offset + ParameterOffset, END_OF_FRAME, FALSE); lanman_tree = proto_item_add_subtree(ti, ett_lanman); if (lanman) { proto_tree_add_text(lanman_tree, NullTVB, 0, 0, "%s Response", lanman -> lanman_name); diff --git a/packet-smb.c b/packet-smb.c index 15b0999388..deff02de5a 100644 --- a/packet-smb.c +++ b/packet-smb.c @@ -2,7 +2,7 @@ * Routines for smb packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-smb.c,v 1.67 2000/05/25 08:38:54 guy Exp $ + * $Id: packet-smb.c,v 1.68 2000/05/31 05:07:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -10351,7 +10351,7 @@ dissect_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int if (tree) { - ti = proto_tree_add_item(tree, proto_smb, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_smb, NullTVB, offset, END_OF_FRAME, FALSE); smb_tree = proto_item_add_subtree(ti, ett_smb); /* 0xFFSMB is actually a 1 byte msg type and 3 byte server diff --git a/packet-sna.c b/packet-sna.c index 848b88e800..4baf87f603 100644 --- a/packet-sna.c +++ b/packet-sna.c @@ -2,7 +2,7 @@ * Routines for SNA * Gilbert Ramirez * - * $Id: packet-sna.c,v 1.15 2000/05/11 08:15:48 gram Exp $ + * $Id: packet-sna.c,v 1.16 2000/05/31 05:07:44 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -332,13 +332,13 @@ dissect_sna(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { /* Don't bother setting length. We'll set it later after we find * the lengths of TH/RH/RU */ - sna_ti = proto_tree_add_item(tree, proto_sna, NullTVB, offset, 0, NULL); + sna_ti = proto_tree_add_item(tree, proto_sna, NullTVB, offset, 0, FALSE); sna_tree = proto_item_add_subtree(sna_ti, ett_sna); /* --- TH --- */ /* Don't bother setting length. We'll set it later after we find * the length of TH */ - th_ti = proto_tree_add_item(sna_tree, hf_sna_th, NullTVB, offset, 0, NULL); + th_ti = proto_tree_add_item(sna_tree, hf_sna_th, NullTVB, offset, 0, FALSE); th_tree = proto_item_add_subtree(th_ti, ett_sna_th); } @@ -375,7 +375,7 @@ dissect_sna(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { /* --- RH --- */ if (BYTES_ARE_IN_FRAME(offset, 3)) { - rh_ti = proto_tree_add_item(sna_tree, hf_sna_rh, NullTVB, offset, 3, NULL); + rh_ti = proto_tree_add_item(sna_tree, hf_sna_rh, NullTVB, offset, 3, FALSE); rh_tree = proto_item_add_subtree(rh_ti, ett_sna_rh); dissect_rh(pd, offset, fd, rh_tree); sna_header_len += 3; @@ -432,18 +432,18 @@ dissect_fid0_1 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } /* Create the bitfield tree */ - bf_item = proto_tree_add_item(tree, hf_sna_th_0, NullTVB, offset, 1, th_0); + bf_item = proto_tree_add_uint(tree, hf_sna_th_0, NullTVB, offset, 1, th_0); bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); - proto_tree_add_item(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_0); - proto_tree_add_item(bf_tree, hf_sna_th_mpf, NullTVB, offset, 1, th_0); - proto_tree_add_item(bf_tree, hf_sna_th_efi , NullTVB,offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_mpf, NullTVB, offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_efi , NullTVB,offset, 1, th_0); proto_tree_add_text(tree, NullTVB, offset+1, 1, "Reserved"); - proto_tree_add_item(tree, hf_sna_th_daf , NullTVB,offset+2, 1, daf); - proto_tree_add_item(tree, hf_sna_th_oaf , NullTVB,offset+4, 1, oaf); - proto_tree_add_item(tree, hf_sna_th_snf , NullTVB,offset+6, 2, snf); - proto_tree_add_item(tree, hf_sna_th_dcf , NullTVB,offset+8, 2, dcf); + proto_tree_add_uint(tree, hf_sna_th_daf , NullTVB,offset+2, 1, daf); + proto_tree_add_uint(tree, hf_sna_th_oaf , NullTVB,offset+4, 1, oaf); + proto_tree_add_uint(tree, hf_sna_th_snf , NullTVB,offset+6, 2, snf); + proto_tree_add_uint(tree, hf_sna_th_dcf , NullTVB,offset+8, 2, dcf); return bytes_in_header; @@ -482,13 +482,13 @@ dissect_fid2 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { snf = pntohs(&pd[offset+4]); /* Create the bitfield tree */ - bf_item = proto_tree_add_item(tree, hf_sna_th_0, NullTVB, offset, 1, th_0); + bf_item = proto_tree_add_uint(tree, hf_sna_th_0, NullTVB, offset, 1, th_0); bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); - proto_tree_add_item(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_0); - proto_tree_add_item(bf_tree, hf_sna_th_mpf, NullTVB, offset, 1, th_0); - proto_tree_add_item(bf_tree, hf_sna_th_odai , NullTVB,offset, 1, th_0); - proto_tree_add_item(bf_tree, hf_sna_th_efi , NullTVB,offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_mpf, NullTVB, offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_odai , NullTVB,offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_efi , NullTVB,offset, 1, th_0); /* Addresses in FID 2 are FT_UINT8 */ proto_tree_add_text(tree, NullTVB, offset+1, 1, "Reserved"); @@ -496,7 +496,7 @@ dissect_fid2 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "Destination Address Field: 0x%02x", daf); proto_tree_add_uint_format(tree, hf_sna_th_oaf , NullTVB,offset+3, 1, oaf, "Origin Address Field: 0x%02x", oaf); - proto_tree_add_item(tree, hf_sna_th_snf , NullTVB,offset+4, 2, snf); + proto_tree_add_uint(tree, hf_sna_th_snf , NullTVB,offset+4, 2, snf); return bytes_in_header; } @@ -524,14 +524,14 @@ dissect_fid3 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { lsid = pd[offset+1]; /* Create the bitfield tree */ - bf_item = proto_tree_add_item(tree, hf_sna_th_0, NullTVB, offset, 1, th_0); + bf_item = proto_tree_add_uint(tree, hf_sna_th_0, NullTVB, offset, 1, th_0); bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); - proto_tree_add_item(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_0); - proto_tree_add_item(bf_tree, hf_sna_th_mpf, NullTVB, offset, 1, th_0); - proto_tree_add_item(bf_tree, hf_sna_th_efi , NullTVB,offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_mpf, NullTVB, offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_efi , NullTVB,offset, 1, th_0); - proto_tree_add_item(tree, hf_sna_th_lsid , NullTVB,offset+1, 1, lsid); + proto_tree_add_uint(tree, hf_sna_th_lsid , NullTVB,offset+1, 1, lsid); return bytes_in_header; } @@ -601,15 +601,15 @@ dissect_fid4 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { th_byte = pd[offset]; /* Create the bitfield tree */ - bf_item = proto_tree_add_item(tree, hf_sna_th_0, NullTVB, offset, 1, th_byte); + bf_item = proto_tree_add_uint(tree, hf_sna_th_0, NullTVB, offset, 1, th_byte); bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); /* Byte 0 */ - proto_tree_add_item(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_byte); - proto_tree_add_item(bf_tree, hf_sna_th_tg_sweep, NullTVB, offset, 1, th_byte); - proto_tree_add_item(bf_tree, hf_sna_th_er_vr_supp_ind, NullTVB, offset, 1, th_byte); - proto_tree_add_item(bf_tree, hf_sna_th_vr_pac_cnt_ind, NullTVB, offset, 1, th_byte); - proto_tree_add_item(bf_tree, hf_sna_th_ntwk_prty, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_tg_sweep, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_er_vr_supp_ind, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_vr_pac_cnt_ind, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_ntwk_prty, NullTVB, offset, 1, th_byte); offset += 1; th_byte = pd[offset]; @@ -619,9 +619,9 @@ dissect_fid4 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); /* Byte 1 */ - proto_tree_add_item(bf_tree, hf_sna_th_tgsf, NullTVB, offset, 1, th_byte); - proto_tree_add_item(bf_tree, hf_sna_th_mft, NullTVB, offset, 1, th_byte); - proto_tree_add_item(bf_tree, hf_sna_th_piubf, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_tgsf, NullTVB, offset, 1, th_byte); + proto_tree_add_boolean(bf_tree, hf_sna_th_mft, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_piubf, NullTVB, offset, 1, th_byte); mft = th_byte & 0x04; offset += 1; @@ -633,13 +633,13 @@ dissect_fid4 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { /* Byte 2 */ if (mft) { - proto_tree_add_item(bf_tree, hf_sna_th_nlpoi, NullTVB, offset, 1, th_byte); - proto_tree_add_item(bf_tree, hf_sna_th_nlp_cp, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_nlpoi, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_nlp_cp, NullTVB, offset, 1, th_byte); } else { - proto_tree_add_item(bf_tree, hf_sna_th_iern, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_iern, NullTVB, offset, 1, th_byte); } - proto_tree_add_item(bf_tree, hf_sna_th_ern, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_ern, NullTVB, offset, 1, th_byte); offset += 1; th_byte = pd[offset]; @@ -649,8 +649,8 @@ dissect_fid4 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); /* Byte 3 */ - proto_tree_add_item(bf_tree, hf_sna_th_vrn, NullTVB, offset, 1, th_byte); - proto_tree_add_item(bf_tree, hf_sna_th_tpf, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_vrn, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(bf_tree, hf_sna_th_tpf, NullTVB, offset, 1, th_byte); offset += 1; th_word = pntohs(&pd[offset]); @@ -660,12 +660,12 @@ dissect_fid4 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); /* Bytes 4-5 */ - proto_tree_add_item(bf_tree, hf_sna_th_vr_cwi, NullTVB, offset, 2, th_word); - proto_tree_add_item(bf_tree, hf_sna_th_tg_nonfifo_ind, NullTVB, offset, 2, th_word); - proto_tree_add_item(bf_tree, hf_sna_th_vr_sqti, NullTVB, offset, 2, th_word); + proto_tree_add_uint(bf_tree, hf_sna_th_vr_cwi, NullTVB, offset, 2, th_word); + proto_tree_add_boolean(bf_tree, hf_sna_th_tg_nonfifo_ind, NullTVB, offset, 2, th_word); + proto_tree_add_uint(bf_tree, hf_sna_th_vr_sqti, NullTVB, offset, 2, th_word); /* I'm not sure about byte-order on this one... */ - proto_tree_add_item(bf_tree, hf_sna_th_tg_snf, NullTVB, offset, 2, th_word); + proto_tree_add_uint(bf_tree, hf_sna_th_tg_snf, NullTVB, offset, 2, th_word); offset += 2; th_word = pntohs(&pd[offset]); @@ -675,23 +675,23 @@ dissect_fid4 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); /* Bytes 6-7 */ - proto_tree_add_item(bf_tree, hf_sna_th_vrprq, NullTVB, offset, 2, th_word); - proto_tree_add_item(bf_tree, hf_sna_th_vrprs, NullTVB, offset, 2, th_word); - proto_tree_add_item(bf_tree, hf_sna_th_vr_cwri, NullTVB, offset, 2, th_word); - proto_tree_add_item(bf_tree, hf_sna_th_vr_rwi, NullTVB, offset, 2, th_word); + proto_tree_add_boolean(bf_tree, hf_sna_th_vrprq, NullTVB, offset, 2, th_word); + proto_tree_add_boolean(bf_tree, hf_sna_th_vrprs, NullTVB, offset, 2, th_word); + proto_tree_add_uint(bf_tree, hf_sna_th_vr_cwri, NullTVB, offset, 2, th_word); + proto_tree_add_boolean(bf_tree, hf_sna_th_vr_rwi, NullTVB, offset, 2, th_word); /* I'm not sure about byte-order on this one... */ - proto_tree_add_item(bf_tree, hf_sna_th_vr_snf_send, NullTVB, offset, 2, th_word); + proto_tree_add_uint(bf_tree, hf_sna_th_vr_snf_send, NullTVB, offset, 2, th_word); offset += 2; /* Bytes 8-11 */ - proto_tree_add_item(tree, hf_sna_th_dsaf, NullTVB, offset, 4, dsaf); + proto_tree_add_uint(tree, hf_sna_th_dsaf, NullTVB, offset, 4, dsaf); offset += 4; /* Bytes 12-15 */ - proto_tree_add_item(tree, hf_sna_th_osaf, NullTVB, offset, 4, osaf); + proto_tree_add_uint(tree, hf_sna_th_osaf, NullTVB, offset, 4, osaf); offset += 4; th_byte = pd[offset]; @@ -701,22 +701,22 @@ dissect_fid4 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); /* Byte 16 */ - proto_tree_add_item(tree, hf_sna_th_snai, NullTVB, offset, 1, th_byte); + proto_tree_add_boolean(tree, hf_sna_th_snai, NullTVB, offset, 1, th_byte); /* We luck out here because in their infinite wisdom the SNA * architects placed the MPF and EFI fields in the same bitfield * locations, even though for FID4 they're not in byte 0. * Thank you IBM! */ - proto_tree_add_item(tree, hf_sna_th_mpf, NullTVB, offset, 1, th_byte); - proto_tree_add_item(tree, hf_sna_th_efi, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(tree, hf_sna_th_mpf, NullTVB, offset, 1, th_byte); + proto_tree_add_uint(tree, hf_sna_th_efi, NullTVB, offset, 1, th_byte); offset += 2; /* 1 for byte 16, 1 for byte 17 which is reserved */ /* Bytes 18-25 */ - proto_tree_add_item(tree, hf_sna_th_def, NullTVB, offset+0, 2, def); - proto_tree_add_item(tree, hf_sna_th_oef, NullTVB, offset+2, 2, oef); - proto_tree_add_item(tree, hf_sna_th_snf, NullTVB, offset+4, 2, snf); - proto_tree_add_item(tree, hf_sna_th_snf, NullTVB, offset+6, 2, dcf); + proto_tree_add_uint(tree, hf_sna_th_def, NullTVB, offset+0, 2, def); + proto_tree_add_uint(tree, hf_sna_th_oef, NullTVB, offset+2, 2, oef); + proto_tree_add_uint(tree, hf_sna_th_snf, NullTVB, offset+4, 2, snf); + proto_tree_add_uint(tree, hf_sna_th_snf, NullTVB, offset+6, 2, dcf); return bytes_in_header; } @@ -744,17 +744,17 @@ dissect_fid5 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } /* Create the bitfield tree */ - bf_item = proto_tree_add_item(tree, hf_sna_th_0, NullTVB, offset, 1, th_0); + bf_item = proto_tree_add_uint(tree, hf_sna_th_0, NullTVB, offset, 1, th_0); bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); - proto_tree_add_item(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_0); - proto_tree_add_item(bf_tree, hf_sna_th_mpf, NullTVB, offset, 1, th_0); - proto_tree_add_item(bf_tree, hf_sna_th_efi, NullTVB, offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_mpf, NullTVB, offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_efi, NullTVB, offset, 1, th_0); proto_tree_add_text(tree, NullTVB, offset+1, 1, "Reserved"); - proto_tree_add_item(tree, hf_sna_th_snf, NullTVB, offset+2, 2, snf); + proto_tree_add_uint(tree, hf_sna_th_snf, NullTVB, offset+2, 2, snf); - proto_tree_add_item(tree, hf_sna_th_sa, NullTVB, offset+4, 8, &pd[offset+4]); + proto_tree_add_bytes(tree, hf_sna_th_sa, NullTVB, offset+4, 8, &pd[offset+4]); return bytes_in_header; @@ -788,19 +788,19 @@ dissect_fidf (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } /* Create the bitfield tree */ - bf_item = proto_tree_add_item(tree, hf_sna_th_0, NullTVB, offset, 1, th_0); + bf_item = proto_tree_add_uint(tree, hf_sna_th_0, NullTVB, offset, 1, th_0); bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid); - proto_tree_add_item(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_0); + proto_tree_add_uint(bf_tree, hf_sna_th_fid, NullTVB, offset, 1, th_0); proto_tree_add_text(tree, NullTVB, offset+1, 1, "Reserved"); - proto_tree_add_item(tree, hf_sna_th_cmd_fmt, NullTVB, offset+2, 1, cmd_fmt); - proto_tree_add_item(tree, hf_sna_th_cmd_type, NullTVB, offset+3, 1, cmd_type); - proto_tree_add_item(tree, hf_sna_th_cmd_sn, NullTVB, offset+4, 2, cmd_sn); + proto_tree_add_uint(tree, hf_sna_th_cmd_fmt, NullTVB, offset+2, 1, cmd_fmt); + proto_tree_add_uint(tree, hf_sna_th_cmd_type, NullTVB, offset+3, 1, cmd_type); + proto_tree_add_uint(tree, hf_sna_th_cmd_sn, NullTVB, offset+4, 2, cmd_sn); proto_tree_add_text(tree, NullTVB, offset+6, 18, "Reserved"); - proto_tree_add_item(tree, hf_sna_th_dcf, NullTVB, offset+24, 8, dcf); + proto_tree_add_uint(tree, hf_sna_th_dcf, NullTVB, offset+24, 8, dcf); return bytes_in_header; } @@ -822,56 +822,56 @@ dissect_rh (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { is_response = (rh_0 & 0x80); /* Create the bitfield tree for byte 0*/ - bf_item = proto_tree_add_item(tree, hf_sna_rh_0, NullTVB, offset, 1, rh_0); + bf_item = proto_tree_add_uint(tree, hf_sna_rh_0, NullTVB, offset, 1, rh_0); bf_tree = proto_item_add_subtree(bf_item, ett_sna_rh_0); - proto_tree_add_item(bf_tree, hf_sna_rh_rri, NullTVB, offset, 1, rh_0); - proto_tree_add_item(bf_tree, hf_sna_rh_ru_category, NullTVB, offset, 1, rh_0); - proto_tree_add_item(bf_tree, hf_sna_rh_fi, NullTVB, offset, 1, rh_0); - proto_tree_add_item(bf_tree, hf_sna_rh_sdi, NullTVB, offset, 1, rh_0); - proto_tree_add_item(bf_tree, hf_sna_rh_bci, NullTVB, offset, 1, rh_0); - proto_tree_add_item(bf_tree, hf_sna_rh_eci, NullTVB, offset, 1, rh_0); + proto_tree_add_uint(bf_tree, hf_sna_rh_rri, NullTVB, offset, 1, rh_0); + proto_tree_add_uint(bf_tree, hf_sna_rh_ru_category, NullTVB, offset, 1, rh_0); + proto_tree_add_boolean(bf_tree, hf_sna_rh_fi, NullTVB, offset, 1, rh_0); + proto_tree_add_boolean(bf_tree, hf_sna_rh_sdi, NullTVB, offset, 1, rh_0); + proto_tree_add_boolean(bf_tree, hf_sna_rh_bci, NullTVB, offset, 1, rh_0); + proto_tree_add_boolean(bf_tree, hf_sna_rh_eci, NullTVB, offset, 1, rh_0); offset += 1; /* Create the bitfield tree for byte 1*/ - bf_item = proto_tree_add_item(tree, hf_sna_rh_1, NullTVB, offset, 1, rh_1); + bf_item = proto_tree_add_uint(tree, hf_sna_rh_1, NullTVB, offset, 1, rh_1); bf_tree = proto_item_add_subtree(bf_item, ett_sna_rh_1); - proto_tree_add_item(bf_tree, hf_sna_rh_dr1, NullTVB, offset, 1, rh_1); + proto_tree_add_boolean(bf_tree, hf_sna_rh_dr1, NullTVB, offset, 1, rh_1); if (!is_response) { - proto_tree_add_item(bf_tree, hf_sna_rh_lcci, NullTVB, offset, 1, rh_1); + proto_tree_add_boolean(bf_tree, hf_sna_rh_lcci, NullTVB, offset, 1, rh_1); } - proto_tree_add_item(bf_tree, hf_sna_rh_dr2, NullTVB, offset, 1, rh_1); + proto_tree_add_boolean(bf_tree, hf_sna_rh_dr2, NullTVB, offset, 1, rh_1); if (is_response) { - proto_tree_add_item(bf_tree, hf_sna_rh_rti, NullTVB, offset, 1, rh_1); + proto_tree_add_boolean(bf_tree, hf_sna_rh_rti, NullTVB, offset, 1, rh_1); } else { - proto_tree_add_item(bf_tree, hf_sna_rh_eri, NullTVB, offset, 1, rh_1); - proto_tree_add_item(bf_tree, hf_sna_rh_rlwi, NullTVB, offset, 1, rh_1); + proto_tree_add_boolean(bf_tree, hf_sna_rh_eri, NullTVB, offset, 1, rh_1); + proto_tree_add_boolean(bf_tree, hf_sna_rh_rlwi, NullTVB, offset, 1, rh_1); } - proto_tree_add_item(bf_tree, hf_sna_rh_qri, NullTVB, offset, 1, rh_1); - proto_tree_add_item(bf_tree, hf_sna_rh_pi, NullTVB, offset, 1, rh_1); + proto_tree_add_boolean(bf_tree, hf_sna_rh_qri, NullTVB, offset, 1, rh_1); + proto_tree_add_boolean(bf_tree, hf_sna_rh_pi, NullTVB, offset, 1, rh_1); offset += 1; /* Create the bitfield tree for byte 2*/ - bf_item = proto_tree_add_item(tree, hf_sna_rh_2, NullTVB, offset, 1, rh_2); + bf_item = proto_tree_add_uint(tree, hf_sna_rh_2, NullTVB, offset, 1, rh_2); if (!is_response) { bf_tree = proto_item_add_subtree(bf_item, ett_sna_rh_2); - proto_tree_add_item(bf_tree, hf_sna_rh_bbi, NullTVB, offset, 1, rh_2); - proto_tree_add_item(bf_tree, hf_sna_rh_ebi, NullTVB, offset, 1, rh_2); - proto_tree_add_item(bf_tree, hf_sna_rh_cdi, NullTVB, offset, 1, rh_2); - proto_tree_add_item(bf_tree, hf_sna_rh_csi, NullTVB, offset, 1, rh_2); - proto_tree_add_item(bf_tree, hf_sna_rh_edi, NullTVB, offset, 1, rh_2); - proto_tree_add_item(bf_tree, hf_sna_rh_pdi, NullTVB, offset, 1, rh_2); - proto_tree_add_item(bf_tree, hf_sna_rh_cebi, NullTVB, offset, 1, rh_2); + proto_tree_add_boolean(bf_tree, hf_sna_rh_bbi, NullTVB, offset, 1, rh_2); + proto_tree_add_boolean(bf_tree, hf_sna_rh_ebi, NullTVB, offset, 1, rh_2); + proto_tree_add_boolean(bf_tree, hf_sna_rh_cdi, NullTVB, offset, 1, rh_2); + proto_tree_add_boolean(bf_tree, hf_sna_rh_csi, NullTVB, offset, 1, rh_2); + proto_tree_add_boolean(bf_tree, hf_sna_rh_edi, NullTVB, offset, 1, rh_2); + proto_tree_add_boolean(bf_tree, hf_sna_rh_pdi, NullTVB, offset, 1, rh_2); + proto_tree_add_boolean(bf_tree, hf_sna_rh_cebi, NullTVB, offset, 1, rh_2); } /* XXX - check for sdi. If TRUE, the next 4 bytes will be sense data */ diff --git a/packet-snmp.c b/packet-snmp.c index 9d896a40db..04efbb6c87 100644 --- a/packet-snmp.c +++ b/packet-snmp.c @@ -2,7 +2,7 @@ * Routines for SNMP (simple network management protocol) * D.Jorand (c) 1998 * - * $Id: packet-snmp.c,v 1.35 2000/05/30 03:35:54 guy Exp $ + * $Id: packet-snmp.c,v 1.36 2000/05/31 05:07:46 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1217,7 +1217,7 @@ dissect_snmp_pdu(const u_char *pd, int offset, frame_data *fd, if (tree) { item = proto_tree_add_item(tree, proto, NullTVB, offset, - END_OF_FRAME, NULL); + END_OF_FRAME, FALSE); snmp_tree = proto_item_add_subtree(item, ett); } @@ -1325,11 +1325,11 @@ dissect_snmp_pdu(const u_char *pd, int offset, frame_data *fd, hf_snmpv3_flags, NullTVB, offset, length, msgflags[0], "Flags: 0x%02x", msgflags[0]); flags_tree = proto_item_add_subtree(item, ett_flags); - proto_tree_add_item(flags_tree, hf_snmpv3_flags_report, + proto_tree_add_boolean(flags_tree, hf_snmpv3_flags_report, NullTVB, offset, length, msgflags[0]); - proto_tree_add_item(flags_tree, hf_snmpv3_flags_crypt, + proto_tree_add_boolean(flags_tree, hf_snmpv3_flags_crypt, NullTVB, offset, length, msgflags[0]); - proto_tree_add_item(flags_tree, hf_snmpv3_flags_auth, + proto_tree_add_boolean(flags_tree, hf_snmpv3_flags_auth, NullTVB, offset, length, msgflags[0]); } encrypted = msgflags[0] & TH_CRYPT; @@ -1610,7 +1610,7 @@ dissect_smux_pdu(const u_char *pd, int offset, frame_data *fd, if (tree) { item = proto_tree_add_item(tree, proto, NullTVB, offset, - END_OF_FRAME, NULL); + END_OF_FRAME, FALSE); smux_tree = proto_item_add_subtree(item, ett); } diff --git a/packet-socks.c b/packet-socks.c index 702b3acb48..c75f6271eb 100644 --- a/packet-socks.c +++ b/packet-socks.c @@ -2,7 +2,7 @@ * Routines for socks versions 4 &5 packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-socks.c,v 1.4 2000/05/11 08:15:49 gram Exp $ + * $Id: packet-socks.c,v 1.5 2000/05/31 05:07:48 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -308,7 +308,7 @@ static int display_address( const u_char *pd, int offset, if ( (offset + 4) > fd->cap_len) proto_tree_add_text(tree, NullTVB, offset, 0, "*** FRAME TOO SHORT ***"); - proto_tree_add_item( tree, hf_socks_ip_dst, NullTVB, offset, + proto_tree_add_ipv4( tree, hf_socks_ip_dst, NullTVB, offset, 4, GWORD( pd, offset)); offset += 4; } @@ -321,8 +321,8 @@ static int display_address( const u_char *pd, int offset, if ((offset + 16) > fd->cap_len) proto_tree_add_text(tree, NullTVB, offset, 0, "*** FRAME TOO SHORT ***"); - proto_tree_add_item( tree, hf_socks_ip6_dst, NullTVB, offset, - 4, GWORD( pd, offset)); + proto_tree_add_ipv6( tree, hf_socks_ip6_dst, NullTVB, offset, + 4, &pd[offset]); offset += 16; } @@ -385,8 +385,8 @@ static void socks_udp_dissector( const u_char *pd, int offset, frame_data *fd, col_add_fstr(fd, COL_INFO, "Version: 5, UDP Associated packet"); if ( tree) { - ti = proto_tree_add_item( tree, proto_socks, NullTVB, offset, - END_OF_FRAME, NULL, "Socks:" ); + ti = proto_tree_add_protocol_format( tree, proto_socks, NullTVB, offset, + END_OF_FRAME, "Socks" ); socks_tree = proto_item_add_subtree(ti, ett_socks); @@ -403,7 +403,7 @@ static void socks_udp_dissector( const u_char *pd, int offset, frame_data *fd, hash_info->udp_remote_port = pntohs( &pd[ offset]); CHECK_PACKET_LENGTH( 2); - proto_tree_add_item( socks_tree, hf_socks_dstport, NullTVB, + proto_tree_add_uint( socks_tree, hf_socks_dstport, NullTVB, offset, 2, hash_info->udp_remote_port); offset += 2; @@ -475,19 +475,19 @@ void display_socks_v4( const u_char *pd, int offset, frame_data *fd, ++offset; /* Do remote port */ - proto_tree_add_item( tree, hf_socks_dstport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_socks_dstport, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2; /* Do destination address */ - proto_tree_add_item( tree, hf_socks_ip_dst, NullTVB, offset, + proto_tree_add_ipv4( tree, hf_socks_ip_dst, NullTVB, offset, 4, GWORD( pd, offset)); offset += 4; /*$$ check this, needs to do length checking */ /* display user name */ - proto_tree_add_item( tree, hf_user_name, NullTVB, offset, + proto_tree_add_string( tree, hf_user_name, NullTVB, offset, strlen( &pd[offset]) + 1, &pd[offset]); @@ -507,11 +507,11 @@ void display_socks_v4( const u_char *pd, int offset, frame_data *fd, ++offset; /* Do remote port */ - proto_tree_add_item( tree, hf_socks_dstport, NullTVB, offset, 2, + proto_tree_add_uint( tree, hf_socks_dstport, NullTVB, offset, 2, pntohs( &pd[ offset])); offset += 2;; /* Do remote address */ - proto_tree_add_item( tree, hf_socks_ip_dst, NullTVB, offset, 4, + proto_tree_add_ipv4( tree, hf_socks_ip_dst, NullTVB, offset, 4, GWORD( pd, offset)); } @@ -546,7 +546,7 @@ void display_socks_v5( const u_char *pd, int offset, frame_data *fd, CHECK_PACKET_LENGTH( 2); /* Do version */ - proto_tree_add_item( tree, hf_socks_ver, NullTVB, offset, 1, + proto_tree_add_uint( tree, hf_socks_ver, NullTVB, offset, 1, hash_info->version); ++offset; @@ -1025,7 +1025,7 @@ dissect_socks(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { if (tree) { ti = proto_tree_add_item( tree, proto_socks, NullTVB, offset, - END_OF_FRAME, NULL, "Socks:" ); + END_OF_FRAME, FALSE ); socks_tree = proto_item_add_subtree(ti, ett_socks); @@ -1044,14 +1044,14 @@ dissect_socks(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "Command: %d (%s)", hash_info->command, get_command_name(hash_info->command)); - proto_tree_add_item( socks_tree, hf_socks_ip_dst, NullTVB, + proto_tree_add_ipv4( socks_tree, hf_socks_ip_dst, NullTVB, offset, 0, hash_info->dst_addr); /* no fake address for ping & traceroute */ if (( hash_info->command != PING_COMMAND) && ( hash_info->command != TRACERT_COMMAND)){ - proto_tree_add_item( socks_tree, hf_socks_dstport, NullTVB, + proto_tree_add_uint( socks_tree, hf_socks_dstport, NullTVB, offset, 0, hash_info->port); } } @@ -1152,5 +1152,3 @@ proto_reg_handoff_socks(void) { dissector_add("tcp.port", TCP_PORT_SOCKS, dissect_socks); } - - diff --git a/packet-srvloc.c b/packet-srvloc.c index e3558787c3..e1f1ba8971 100644 --- a/packet-srvloc.c +++ b/packet-srvloc.c @@ -6,7 +6,7 @@ * In particular I have not had an opportunity to see how it * responds to SRVLOC over TCP. * - * $Id: packet-srvloc.c,v 1.8 2000/05/11 08:15:52 gram Exp $ + * $Id: packet-srvloc.c,v 1.9 2000/05/31 05:07:48 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -192,7 +192,7 @@ dissect_srvloc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_INFO, val_to_str(pd[offset + 1], srvloc_functions, "Unknown Function (%d)")); if (tree) { - ti = proto_tree_add_item(tree, proto_srvloc, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_srvloc, NullTVB, offset, END_OF_FRAME, FALSE); srvloc_tree = proto_item_add_subtree(ti, ett_srvloc); if ( END_OF_FRAME > sizeof(srvloc_hdr) ) { @@ -200,10 +200,10 @@ dissect_srvloc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) srvloc_hdr.length = pntohs(&srvloc_hdr.length); srvloc_hdr.encoding = pntohs(&srvloc_hdr.encoding); srvloc_hdr.xid = pntohs(&srvloc_hdr.xid); - proto_tree_add_item(srvloc_tree, hf_srvloc_version, NullTVB, offset, 1, srvloc_hdr.version); - proto_tree_add_item(srvloc_tree, hf_srvloc_function, NullTVB, offset + 1, 1, srvloc_hdr.function); + proto_tree_add_uint(srvloc_tree, hf_srvloc_version, NullTVB, offset, 1, srvloc_hdr.version); + proto_tree_add_uint(srvloc_tree, hf_srvloc_function, NullTVB, offset + 1, 1, srvloc_hdr.function); proto_tree_add_text(srvloc_tree, NullTVB, offset + 2, 2, "Length: %d",srvloc_hdr.length); - tf = proto_tree_add_item(srvloc_tree, hf_srvloc_flags, NullTVB, offset + 4, 1, srvloc_hdr.flags); + tf = proto_tree_add_uint(srvloc_tree, hf_srvloc_flags, NullTVB, offset + 4, 1, srvloc_hdr.flags); srvloc_flags = proto_item_add_subtree(tf, ett_srvloc_flags); proto_tree_add_text(srvloc_flags, NullTVB, offset + 4, 0, "Overflow %d... .xxx", (srvloc_hdr.flags & FLAG_O) >> 7 ); proto_tree_add_text(srvloc_flags, NullTVB, offset + 4, 0, "Monolingual .%d.. .xxx", (srvloc_hdr.flags & FLAG_M) >> 6 ); @@ -237,7 +237,7 @@ dissect_srvloc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) case SRVRPLY: proto_tree_add_text(srvloc_tree, NullTVB, offset, 0, "Service Reply"); - proto_tree_add_item(srvloc_tree, hf_srvloc_error, NullTVB, offset, 2, pd[offset]);; + proto_tree_add_uint(srvloc_tree, hf_srvloc_error, NullTVB, offset, 2, pd[offset]);; offset += 2; proto_tree_add_text(srvloc_tree, NullTVB, offset, 2, "URL Count: %d", pntohs(&pd[offset])); offset += 2; @@ -294,7 +294,7 @@ dissect_srvloc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) case SRVACK: proto_tree_add_text(srvloc_tree, NullTVB, offset, 0, "Service Acknowledge"); - proto_tree_add_item(srvloc_tree, hf_srvloc_error, NullTVB, offset, 2, pd[offset]);; + proto_tree_add_uint(srvloc_tree, hf_srvloc_error, NullTVB, offset, 2, pd[offset]);; offset += 2; break; @@ -324,7 +324,7 @@ dissect_srvloc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) case ATTRRPLY: proto_tree_add_text(srvloc_tree, NullTVB, offset, 0, "Attribute Reply"); - proto_tree_add_item(srvloc_tree, hf_srvloc_error, NullTVB, offset, 2, pd[offset]);; + proto_tree_add_uint(srvloc_tree, hf_srvloc_error, NullTVB, offset, 2, pd[offset]);; offset += 2; length = pntohs(&pd[offset]); proto_tree_add_text(srvloc_tree, NullTVB, offset, 2, "Attribute List length: %d", length); @@ -337,7 +337,7 @@ dissect_srvloc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) case DAADVERT: proto_tree_add_text(srvloc_tree, NullTVB, offset, 0, "DA Advertisement"); - proto_tree_add_item(srvloc_tree, hf_srvloc_error, NullTVB, offset, 2, pd[offset]);; + proto_tree_add_uint(srvloc_tree, hf_srvloc_error, NullTVB, offset, 2, pd[offset]);; offset += 2; length = pntohs(&pd[offset]); proto_tree_add_text(srvloc_tree, NullTVB, offset, 2, "URL length: %d", length); @@ -372,7 +372,7 @@ dissect_srvloc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) case SRVTYPERPLY: proto_tree_add_text(srvloc_tree, NullTVB, offset, 0, "Service Type Reply"); - proto_tree_add_item(srvloc_tree, hf_srvloc_error, NullTVB, offset, 2, pd[offset]);; + proto_tree_add_uint(srvloc_tree, hf_srvloc_error, NullTVB, offset, 2, pd[offset]);; offset += 2; proto_tree_add_text(srvloc_tree, NullTVB, offset, 2, "Service Type Count: %d", pntohs(&pd[offset])); offset += 2; diff --git a/packet-tacacs.c b/packet-tacacs.c index d070d6984d..a748cb19eb 100644 --- a/packet-tacacs.c +++ b/packet-tacacs.c @@ -1,7 +1,7 @@ /* packet-tacacs.c * Routines for cisco tacacs/tacplus/AAA packet dissection * - * $Id: packet-tacacs.c,v 1.4 2000/05/11 08:15:52 gram Exp $ + * $Id: packet-tacacs.c,v 1.5 2000/05/31 05:07:49 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -68,21 +68,21 @@ dissect_tacacs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_tacacs, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_tacacs, NullTVB, offset, END_OF_FRAME, FALSE); tacacs_tree = proto_item_add_subtree(ti, ett_tacacs); - proto_tree_add_item(tacacs_tree, hf_tacacs_version, NullTVB, 0, 0, "XTacacs"); + proto_tree_add_string(tacacs_tree, hf_tacacs_version, NullTVB, 0, 0, "XTacacs"); if (pi.match_port == pi.destport) { - proto_tree_add_item_hidden(tacacs_tree, hf_tacacs_request, NullTVB, + proto_tree_add_boolean_hidden(tacacs_tree, hf_tacacs_request, NullTVB, offset, END_OF_FRAME, TRUE); proto_tree_add_text(tacacs_tree, NullTVB, offset, END_OF_FRAME, "Request: " ); } else { - proto_tree_add_item_hidden(tacacs_tree, hf_tacacs_response, NullTVB, + proto_tree_add_boolean_hidden(tacacs_tree, hf_tacacs_response, NullTVB, offset, END_OF_FRAME, TRUE); proto_tree_add_text(tacacs_tree, NullTVB, offset, END_OF_FRAME, "Response: "); @@ -106,21 +106,21 @@ dissect_tacplus(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_tacacs, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_tacacs, NullTVB, offset, END_OF_FRAME, FALSE); tacacs_tree = proto_item_add_subtree(ti, ett_tacacs); - proto_tree_add_item(tacacs_tree, hf_tacacs_version, NullTVB, 0, 0, "Tacacs+"); + proto_tree_add_string(tacacs_tree, hf_tacacs_version, NullTVB, 0, 0, "Tacacs+"); if (pi.match_port == pi.destport) { - proto_tree_add_item_hidden(tacacs_tree, hf_tacacs_request, NullTVB, + proto_tree_add_boolean_hidden(tacacs_tree, hf_tacacs_request, NullTVB, offset, END_OF_FRAME, TRUE); proto_tree_add_text(tacacs_tree, NullTVB, offset, END_OF_FRAME, "Request: " ); } else { - proto_tree_add_item_hidden(tacacs_tree, hf_tacacs_response, NullTVB, + proto_tree_add_boolean_hidden(tacacs_tree, hf_tacacs_response, NullTVB, offset, END_OF_FRAME, TRUE); proto_tree_add_text(tacacs_tree, NullTVB, offset, END_OF_FRAME, "Response: "); diff --git a/packet-tcp.c b/packet-tcp.c index afaa5f965d..1edeb30d84 100644 --- a/packet-tcp.c +++ b/packet-tcp.c @@ -1,7 +1,7 @@ /* packet-tcp.c * Routines for TCP packet disassembly * - * $Id: packet-tcp.c,v 1.74 2000/05/11 08:15:52 gram Exp $ + * $Id: packet-tcp.c,v 1.75 2000/05/31 05:07:49 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -480,26 +480,26 @@ dissect_tcp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "Source port: %s (%u)", get_tcp_port(th.th_sport), th.th_sport); proto_tree_add_uint_format(tcp_tree, hf_tcp_dstport, NullTVB, offset + 2, 2, th.th_dport, "Destination port: %s (%u)", get_tcp_port(th.th_dport), th.th_dport); - proto_tree_add_item_hidden(tcp_tree, hf_tcp_port, NullTVB, offset, 2, th.th_sport); - proto_tree_add_item_hidden(tcp_tree, hf_tcp_port, NullTVB, offset + 2, 2, th.th_dport); - proto_tree_add_item(tcp_tree, hf_tcp_seq, NullTVB, offset + 4, 4, th.th_seq); + proto_tree_add_uint_hidden(tcp_tree, hf_tcp_port, NullTVB, offset, 2, th.th_sport); + proto_tree_add_uint_hidden(tcp_tree, hf_tcp_port, NullTVB, offset + 2, 2, th.th_dport); + proto_tree_add_uint(tcp_tree, hf_tcp_seq, NullTVB, offset + 4, 4, th.th_seq); if (th.th_flags & TH_ACK) - proto_tree_add_item(tcp_tree, hf_tcp_ack, NullTVB, offset + 8, 4, th.th_ack); + proto_tree_add_uint(tcp_tree, hf_tcp_ack, NullTVB, offset + 8, 4, th.th_ack); proto_tree_add_uint_format(tcp_tree, hf_tcp_hdr_len, NullTVB, offset + 12, 1, hlen, "Header length: %u bytes", hlen); tf = proto_tree_add_uint_format(tcp_tree, hf_tcp_flags, NullTVB, offset + 13, 1, th.th_flags, "Flags: 0x%04x (%s)", th.th_flags, flags); field_tree = proto_item_add_subtree(tf, ett_tcp_flags); - proto_tree_add_item(field_tree, hf_tcp_flags_urg, NullTVB, offset + 13, 1, th.th_flags); - proto_tree_add_item(field_tree, hf_tcp_flags_ack, NullTVB, offset + 13, 1, th.th_flags); - proto_tree_add_item(field_tree, hf_tcp_flags_push, NullTVB, offset + 13, 1, th.th_flags); - proto_tree_add_item(field_tree, hf_tcp_flags_reset, NullTVB, offset + 13, 1, th.th_flags); - proto_tree_add_item(field_tree, hf_tcp_flags_syn, NullTVB, offset + 13, 1, th.th_flags); - proto_tree_add_item(field_tree, hf_tcp_flags_fin, NullTVB, offset + 13, 1, th.th_flags); - proto_tree_add_item(tcp_tree, hf_tcp_window_size, NullTVB, offset + 14, 2, th.th_win); - proto_tree_add_item(tcp_tree, hf_tcp_checksum, NullTVB, offset + 16, 2, th.th_sum); + proto_tree_add_boolean(field_tree, hf_tcp_flags_urg, NullTVB, offset + 13, 1, th.th_flags); + proto_tree_add_boolean(field_tree, hf_tcp_flags_ack, NullTVB, offset + 13, 1, th.th_flags); + proto_tree_add_boolean(field_tree, hf_tcp_flags_push, NullTVB, offset + 13, 1, th.th_flags); + proto_tree_add_boolean(field_tree, hf_tcp_flags_reset, NullTVB, offset + 13, 1, th.th_flags); + proto_tree_add_boolean(field_tree, hf_tcp_flags_syn, NullTVB, offset + 13, 1, th.th_flags); + proto_tree_add_boolean(field_tree, hf_tcp_flags_fin, NullTVB, offset + 13, 1, th.th_flags); + proto_tree_add_uint(tcp_tree, hf_tcp_window_size, NullTVB, offset + 14, 2, th.th_win); + proto_tree_add_uint(tcp_tree, hf_tcp_checksum, NullTVB, offset + 16, 2, th.th_sum); if (th.th_flags & TH_URG) - proto_tree_add_item(tcp_tree, hf_tcp_urgent_pointer, NullTVB, offset + 18, 2, th.th_urp); + proto_tree_add_uint(tcp_tree, hf_tcp_urgent_pointer, NullTVB, offset + 18, 2, th.th_urp); } /* Decode TCP options, if any. */ diff --git a/packet-telnet.c b/packet-telnet.c index c6858d1eef..c78b55d5b2 100644 --- a/packet-telnet.c +++ b/packet-telnet.c @@ -2,7 +2,7 @@ * Routines for telnet packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-telnet.c,v 1.12 2000/05/11 08:15:52 gram Exp $ + * $Id: packet-telnet.c,v 1.13 2000/05/31 05:07:50 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -307,7 +307,7 @@ dissect_telnet(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int data_offset; int data_len; - ti = proto_tree_add_item(tree, proto_telnet, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_telnet, NullTVB, offset, END_OF_FRAME, FALSE); telnet_tree = proto_item_add_subtree(ti, ett_telnet); data_offset = offset; diff --git a/packet-tftp.c b/packet-tftp.c index 175927c322..e7d368ae1c 100644 --- a/packet-tftp.c +++ b/packet-tftp.c @@ -5,7 +5,7 @@ * Craig Newell * RFC2347 TFTP Option Extension * - * $Id: packet-tftp.c,v 1.11 2000/05/11 08:15:53 gram Exp $ + * $Id: packet-tftp.c,v 1.12 2000/05/31 05:07:50 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -97,11 +97,11 @@ dissect_tftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_tftp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_tftp, NullTVB, offset, END_OF_FRAME, FALSE); tftp_tree = proto_item_add_subtree(ti, ett_tftp); i1 = pntohs(pd+offset); - proto_tree_add_item_hidden(tftp_tree, hf_tftp_type, NullTVB, offset, 2, i1); + proto_tree_add_uint_hidden(tftp_tree, hf_tftp_type, NullTVB, offset, 2, i1); switch (i1) { case RRQ: @@ -159,7 +159,7 @@ dissect_tftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree_add_text(tftp_tree, NullTVB, offset, 2, "Error Code"); offset += 2; i1 = pntohs(pd+offset); - proto_tree_add_item_hidden(tftp_tree, hf_tftp_error_code, NullTVB, offset, 2, i1); + proto_tree_add_uint_hidden(tftp_tree, hf_tftp_error_code, NullTVB, offset, 2, i1); proto_tree_add_text(tftp_tree, NullTVB, offset, 2, "Code = %s", tftp_errors[i1 % 8]); offset += 2; proto_tree_add_text(tftp_tree, NullTVB, offset, END_OF_FRAME, "Error Message: %s", pd + offset); diff --git a/packet-time.c b/packet-time.c index d60e6a32c3..801c160e9e 100644 --- a/packet-time.c +++ b/packet-time.c @@ -5,7 +5,7 @@ * Craig Newell * RFC2347 TIME Option Extension * - * $Id: packet-time.c,v 1.5 2000/05/11 08:15:53 gram Exp $ + * $Id: packet-time.c,v 1.6 2000/05/31 05:07:50 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -56,7 +56,7 @@ dissect_time(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_time, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_time, NullTVB, offset, END_OF_FRAME, FALSE); time_tree = proto_item_add_subtree(ti, ett_time); proto_tree_add_text(time_tree, NullTVB, offset, 0, diff --git a/packet-tns.c b/packet-tns.c index 54e6a3f50e..244e542b19 100644 --- a/packet-tns.c +++ b/packet-tns.c @@ -1,7 +1,7 @@ /* packet-tns.c * Routines for MSX tns packet dissection * - * $Id: packet-tns.c,v 1.6 2000/05/11 08:15:53 gram Exp $ + * $Id: packet-tns.c,v 1.7 2000/05/31 05:07:50 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -88,7 +88,7 @@ static void dissect_tns_sns(const u_char *pd, int offset, frame_data *fd, ti = proto_tree_add_text(tns_tree, NullTVB, offset, END_OF_FRAME, "Secure Network Services"); sns_tree = proto_item_add_subtree(ti, ett_tns_sns); - proto_tree_add_item_hidden(tns_tree, hf_tns_sns, NullTVB, 0, 0, TRUE); + proto_tree_add_boolean_hidden(tns_tree, hf_tns_sns, NullTVB, 0, 0, TRUE); } if ( check_col(fd, COL_INFO) ) @@ -109,7 +109,7 @@ static void dissect_tns_data(const u_char *pd, int offset, frame_data *fd, TRUNC(2); if ( tree ) { - proto_tree_add_item(tns_tree, hf_tns_data_flag, NullTVB, + proto_tree_add_uint(tns_tree, hf_tns_data_flag, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; @@ -138,7 +138,7 @@ static void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd, ti = proto_tree_add_text(tns_tree, NullTVB, offset, END_OF_FRAME, "Connect"); connect_tree = proto_item_add_subtree(ti, ett_tns_connect); - proto_tree_add_item_hidden(tns_tree, hf_tns_connect, NullTVB, 0, 0, TRUE); + proto_tree_add_boolean_hidden(tns_tree, hf_tns_connect, NullTVB, 0, 0, TRUE); } if ( check_col(fd, COL_INFO) ) @@ -149,7 +149,7 @@ static void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd, TRUNC(2); if ( connect_tree ) { - proto_tree_add_item(connect_tree, hf_tns_version, NullTVB, + proto_tree_add_uint(connect_tree, hf_tns_version, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; @@ -157,7 +157,7 @@ static void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd, TRUNC(2); if ( connect_tree ) { - proto_tree_add_item(connect_tree, hf_tns_compat_version, NullTVB, + proto_tree_add_uint(connect_tree, hf_tns_compat_version, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; @@ -166,7 +166,7 @@ static void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd, if ( connect_tree ) { /* need to break down w/ bitfield */ - proto_tree_add_item(connect_tree, hf_tns_service_options, NullTVB, + proto_tree_add_uint(connect_tree, hf_tns_service_options, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; @@ -204,19 +204,19 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_tns, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_tns, NullTVB, offset, END_OF_FRAME, FALSE); tns_tree = proto_item_add_subtree(ti, ett_tns); if (pi.match_port == pi.destport) { - proto_tree_add_item_hidden(tns_tree, hf_tns_request, NullTVB, + proto_tree_add_boolean_hidden(tns_tree, hf_tns_request, NullTVB, offset, END_OF_FRAME, TRUE); proto_tree_add_text(tns_tree, NullTVB, offset, END_OF_FRAME, "Request: " ); } else { - proto_tree_add_item_hidden(tns_tree, hf_tns_response, NullTVB, + proto_tree_add_boolean_hidden(tns_tree, hf_tns_response, NullTVB, offset, END_OF_FRAME, TRUE); proto_tree_add_text(tns_tree, NullTVB, offset, END_OF_FRAME, "Response: "); @@ -229,7 +229,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) length = pntohs(&pd[offset]); if (tree) { - proto_tree_add_item(tns_tree, hf_tns_length, NullTVB, + proto_tree_add_uint(tns_tree, hf_tns_length, NullTVB, offset, 2, length); } TRUNC(length); @@ -238,7 +238,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) TRUNC(2); if ( tree ) { - proto_tree_add_item(tns_tree, hf_tns_packet_checksum, NullTVB, + proto_tree_add_uint(tns_tree, hf_tns_packet_checksum, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; @@ -247,7 +247,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) type = pd[offset]; if ( tree ) { - proto_tree_add_item(tns_tree, hf_tns_packet_type, NullTVB, + proto_tree_add_uint(tns_tree, hf_tns_packet_type, NullTVB, offset, 1, type); } offset += 1; @@ -261,7 +261,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) TRUNC(1); if ( tree ) { - proto_tree_add_item(tns_tree, hf_tns_reserved_byte, NullTVB, + proto_tree_add_bytes(tns_tree, hf_tns_reserved_byte, NullTVB, offset, 1, &pd[offset]); } offset += 1; @@ -269,7 +269,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) TRUNC(2); if ( tree ) { - proto_tree_add_item(tns_tree, hf_tns_header_checksum, NullTVB, + proto_tree_add_uint(tns_tree, hf_tns_header_checksum, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; diff --git a/packet-tr.c b/packet-tr.c index a72be23a0b..0703fc9b70 100644 --- a/packet-tr.c +++ b/packet-tr.c @@ -2,7 +2,7 @@ * Routines for Token-Ring packet disassembly * Gilbert Ramirez * - * $Id: packet-tr.c,v 1.42 2000/05/19 05:29:43 guy Exp $ + * $Id: packet-tr.c,v 1.43 2000/05/31 05:07:51 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -451,45 +451,45 @@ dissect_tr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* protocol analysis tree */ if (tree) { /* Create Token-Ring Tree */ - ti = proto_tree_add_item(tree, proto_tr, tr_tvb, 0, TR_MIN_HEADER_LEN + actual_rif_bytes, NULL); + ti = proto_tree_add_item(tree, proto_tr, tr_tvb, 0, TR_MIN_HEADER_LEN + actual_rif_bytes, FALSE); tr_tree = proto_item_add_subtree(ti, ett_token_ring); /* Create the Access Control bitfield tree */ trn_ac = tvb_get_guint8(tr_tvb, 0); - ti = proto_tree_add_item(tr_tree, hf_tr_ac, tr_tvb, 0, 1, trn_ac); + ti = proto_tree_add_uint(tr_tree, hf_tr_ac, tr_tvb, 0, 1, trn_ac); bf_tree = proto_item_add_subtree(ti, ett_token_ring_ac); - proto_tree_add_item(bf_tree, hf_tr_priority, tr_tvb, 0, 1, trn_ac); - proto_tree_add_item(bf_tree, hf_tr_frame, tr_tvb, 0, 1, trn_ac); - proto_tree_add_item(bf_tree, hf_tr_monitor_cnt, tr_tvb, 0, 1, trn_ac); - proto_tree_add_item(bf_tree, hf_tr_priority_reservation, tr_tvb, 0, 1, trn_ac); + proto_tree_add_uint(bf_tree, hf_tr_priority, tr_tvb, 0, 1, trn_ac); + proto_tree_add_boolean(bf_tree, hf_tr_frame, tr_tvb, 0, 1, trn_ac); + proto_tree_add_uint(bf_tree, hf_tr_monitor_cnt, tr_tvb, 0, 1, trn_ac); + proto_tree_add_uint(bf_tree, hf_tr_priority_reservation, tr_tvb, 0, 1, trn_ac); /* Create the Frame Control bitfield tree */ - ti = proto_tree_add_item(tr_tree, hf_tr_fc, tr_tvb, 1, 1, trn_fc); + ti = proto_tree_add_uint(tr_tree, hf_tr_fc, tr_tvb, 1, 1, trn_fc); bf_tree = proto_item_add_subtree(ti, ett_token_ring_fc); - proto_tree_add_item(bf_tree, hf_tr_fc_type, tr_tvb, 1, 1, trn_fc); - proto_tree_add_item(bf_tree, hf_tr_fc_pcf, tr_tvb, 1, 1, trn_fc); - proto_tree_add_item(tr_tree, hf_tr_dst, tr_tvb, 2, 6, trn_dhost); - proto_tree_add_item(tr_tree, hf_tr_src, tr_tvb, 8, 6, trn_shost); - proto_tree_add_item_hidden(tr_tree, hf_tr_addr, tr_tvb, 2, 6, trn_dhost); - proto_tree_add_item_hidden(tr_tree, hf_tr_addr, tr_tvb, 8, 6, trn_shost); + proto_tree_add_uint(bf_tree, hf_tr_fc_type, tr_tvb, 1, 1, trn_fc); + proto_tree_add_uint(bf_tree, hf_tr_fc_pcf, tr_tvb, 1, 1, trn_fc); + proto_tree_add_ether(tr_tree, hf_tr_dst, tr_tvb, 2, 6, trn_dhost); + proto_tree_add_ether(tr_tree, hf_tr_src, tr_tvb, 8, 6, trn_shost); + proto_tree_add_ether_hidden(tr_tree, hf_tr_addr, tr_tvb, 2, 6, trn_dhost); + proto_tree_add_ether_hidden(tr_tree, hf_tr_addr, tr_tvb, 8, 6, trn_shost); - proto_tree_add_item(tr_tree, hf_tr_sr, tr_tvb, 8, 1, source_routed); + proto_tree_add_boolean(tr_tree, hf_tr_sr, tr_tvb, 8, 1, source_routed); /* non-source-routed version of src addr */ - proto_tree_add_item_hidden(tr_tree, hf_tr_src, tr_tvb, 8, 6, trn_shost_nonsr); + proto_tree_add_ether_hidden(tr_tree, hf_tr_src, tr_tvb, 8, 6, trn_shost_nonsr); if (source_routed) { /* RCF Byte 1 */ rcf1 = tvb_get_guint8(tr_tvb, 14); - proto_tree_add_item(tr_tree, hf_tr_rif_bytes, tr_tvb, 14, 1, trn_rif_bytes); - proto_tree_add_item(tr_tree, hf_tr_broadcast, tr_tvb, 14, 1, rcf1 & 224); + proto_tree_add_uint(tr_tree, hf_tr_rif_bytes, tr_tvb, 14, 1, trn_rif_bytes); + proto_tree_add_uint(tr_tree, hf_tr_broadcast, tr_tvb, 14, 1, rcf1 & 224); /* RCF Byte 2 */ rcf2 = tvb_get_guint8(tr_tvb, 15); - proto_tree_add_item(tr_tree, hf_tr_max_frame_size, tr_tvb, 15, 1, rcf2 & 112); - proto_tree_add_item(tr_tree, hf_tr_direction, tr_tvb, 15, 1, rcf2 & 128); + proto_tree_add_uint(tr_tree, hf_tr_max_frame_size, tr_tvb, 15, 1, rcf2 & 112); + proto_tree_add_uint(tr_tree, hf_tr_direction, tr_tvb, 15, 1, rcf2 & 128); /* if we have more than 2 bytes of RIF, then we have ring/bridge pairs */ @@ -564,17 +564,17 @@ add_ring_bridge_pairs(int rcf_len, tvbuff_t *tvb, proto_tree *tree) if (j==1) { segment = tvb_get_ntohs(tvb, RIF_OFFSET) >> 4; size = sprintf(buffer, "%03X",segment); - proto_tree_add_item_hidden(tree, hf_tr_rif_ring, tvb, TR_MIN_HEADER_LEN + 2, 2, segment); + proto_tree_add_uint_hidden(tree, hf_tr_rif_ring, tvb, TR_MIN_HEADER_LEN + 2, 2, segment); buff_offset += size; } segment = tvb_get_ntohs(tvb, RIF_OFFSET + 1 + j) >> 4; brdgnmb = tvb_get_guint8(tvb, RIF_OFFSET + j) & 0x0f; size = sprintf(buffer+buff_offset, "-%01X-%03X",brdgnmb,segment); - proto_tree_add_item_hidden(tree, hf_tr_rif_ring, tvb, TR_MIN_HEADER_LEN + 3 + j, 2, segment); - proto_tree_add_item_hidden(tree, hf_tr_rif_bridge, tvb, TR_MIN_HEADER_LEN + 2 + j, 1, brdgnmb); + proto_tree_add_uint_hidden(tree, hf_tr_rif_ring, tvb, TR_MIN_HEADER_LEN + 3 + j, 2, segment); + proto_tree_add_uint_hidden(tree, hf_tr_rif_bridge, tvb, TR_MIN_HEADER_LEN + 2 + j, 1, brdgnmb); buff_offset += size; } - proto_tree_add_item(tree, hf_tr_rif, tvb, TR_MIN_HEADER_LEN + 2, rcf_len, buffer); + proto_tree_add_string(tree, hf_tr_rif, tvb, TR_MIN_HEADER_LEN + 2, rcf_len, buffer); if (unprocessed_rif > 0) { proto_tree_add_text(tree, tvb, TR_MIN_HEADER_LEN + RIF_BYTES_TO_PROCESS, unprocessed_rif, diff --git a/packet-trmac.c b/packet-trmac.c index 246c6863bf..f5a9138144 100644 --- a/packet-trmac.c +++ b/packet-trmac.c @@ -2,7 +2,7 @@ * Routines for Token-Ring Media Access Control * Gilbert Ramirez * - * $Id: packet-trmac.c,v 1.21 2000/05/11 08:15:54 gram Exp $ + * $Id: packet-trmac.c,v 1.22 2000/05/31 05:07:52 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -119,7 +119,7 @@ sv_text(const u_char *pd, int pkt_offset, proto_tree *tree) proto_tree_add_text(tree, NullTVB, pkt_offset, 1, "Subvector Length: %d bytes", sv_length);*/ - proto_tree_add_item_hidden(tree, hf_trmac_sv, NullTVB, pkt_offset+1, 1, pd[1]); + proto_tree_add_uint_hidden(tree, hf_trmac_sv, NullTVB, pkt_offset+1, 1, pd[1]); switch(pd[1]) { case 0x01: /* Beacon Type */ @@ -134,7 +134,7 @@ sv_text(const u_char *pd, int pkt_offset, proto_tree *tree) break; case 0x02: /* NAUN */ - proto_tree_add_item(tree, hf_trmac_naun, NullTVB, pkt_offset+1, sv_length-1, (guint8*)&pd[2]); + proto_tree_add_ether(tree, hf_trmac_naun, NullTVB, pkt_offset+1, sv_length-1, (guint8*)&pd[2]); break; case 0x03: /* Local Ring Number */ @@ -232,29 +232,29 @@ sv_text(const u_char *pd, int pkt_offset, proto_tree *tree) case 0x2D: /* Isolating Error Counts */ memcpy(errors, &pd[2], 6); - ti = proto_tree_add_item(tree, hf_trmac_errors_iso, NullTVB, pkt_offset+1, sv_length-1, + ti = proto_tree_add_uint(tree, hf_trmac_errors_iso, NullTVB, pkt_offset+1, sv_length-1, errors[0] + errors[1] + errors[2] + errors[3] + errors[4]); sv_tree = proto_item_add_subtree(ti, ett_tr_ierr_cnt); - proto_tree_add_item(sv_tree, hf_trmac_errors_line, NullTVB, pkt_offset+2, 1, errors[0]); - proto_tree_add_item(sv_tree, hf_trmac_errors_internal, NullTVB, pkt_offset+3, 1, errors[1]); - proto_tree_add_item(sv_tree, hf_trmac_errors_burst, NullTVB, pkt_offset+4, 1, errors[2]); - proto_tree_add_item(sv_tree, hf_trmac_errors_ac, NullTVB, pkt_offset+5, 1, errors[3]); - proto_tree_add_item(sv_tree, hf_trmac_errors_abort, NullTVB, pkt_offset+6, 1, errors[4]); + proto_tree_add_uint(sv_tree, hf_trmac_errors_line, NullTVB, pkt_offset+2, 1, errors[0]); + proto_tree_add_uint(sv_tree, hf_trmac_errors_internal, NullTVB, pkt_offset+3, 1, errors[1]); + proto_tree_add_uint(sv_tree, hf_trmac_errors_burst, NullTVB, pkt_offset+4, 1, errors[2]); + proto_tree_add_uint(sv_tree, hf_trmac_errors_ac, NullTVB, pkt_offset+5, 1, errors[3]); + proto_tree_add_uint(sv_tree, hf_trmac_errors_abort, NullTVB, pkt_offset+6, 1, errors[4]); break; case 0x2E: /* Non-Isolating Error Counts */ memcpy(errors, &pd[2], 6); - ti = proto_tree_add_item(tree, hf_trmac_errors_noniso, NullTVB, pkt_offset+1, sv_length-1, + ti = proto_tree_add_uint(tree, hf_trmac_errors_noniso, NullTVB, pkt_offset+1, sv_length-1, errors[0] + errors[1] + errors[2] + errors[3] + errors[4]); sv_tree = proto_item_add_subtree(ti, ett_tr_nerr_cnt); - proto_tree_add_item(sv_tree, hf_trmac_errors_lost, NullTVB, pkt_offset+2, 1, errors[0]); - proto_tree_add_item(sv_tree, hf_trmac_errors_congestion, NullTVB, pkt_offset+3, 1, errors[1]); - proto_tree_add_item(sv_tree, hf_trmac_errors_fc, NullTVB, pkt_offset+4, 1, errors[2]); - proto_tree_add_item(sv_tree, hf_trmac_errors_freq, NullTVB, pkt_offset+5, 1, errors[3]); - proto_tree_add_item(sv_tree, hf_trmac_errors_token, NullTVB, pkt_offset+6, 1, errors[4]); + proto_tree_add_uint(sv_tree, hf_trmac_errors_lost, NullTVB, pkt_offset+2, 1, errors[0]); + proto_tree_add_uint(sv_tree, hf_trmac_errors_congestion, NullTVB, pkt_offset+3, 1, errors[1]); + proto_tree_add_uint(sv_tree, hf_trmac_errors_fc, NullTVB, pkt_offset+4, 1, errors[2]); + proto_tree_add_uint(sv_tree, hf_trmac_errors_freq, NullTVB, pkt_offset+5, 1, errors[3]); + proto_tree_add_uint(sv_tree, hf_trmac_errors_token, NullTVB, pkt_offset+6, 1, errors[4]); break; case 0x30: /* Error Code */ @@ -292,14 +292,14 @@ dissect_trmac(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { if (tree) { - ti = proto_tree_add_item(tree, proto_trmac, NullTVB, offset, mv_length, NULL); + ti = proto_tree_add_item(tree, proto_trmac, NullTVB, offset, mv_length, FALSE); mac_tree = proto_item_add_subtree(ti, ett_tr_mac); - proto_tree_add_item(mac_tree, hf_trmac_mv, NullTVB, offset+3, 1, mv_val); + proto_tree_add_uint(mac_tree, hf_trmac_mv, NullTVB, offset+3, 1, mv_val); proto_tree_add_uint_format(mac_tree, hf_trmac_length, NullTVB, offset, 2, mv_length, "Total Length: %d bytes", mv_length); - proto_tree_add_item(mac_tree, hf_trmac_srcclass, NullTVB, offset+2, 1, pd[offset+2] & 0x0f); - proto_tree_add_item(mac_tree, hf_trmac_dstclass, NullTVB, offset+2, 1, pd[offset+2] >> 4 ); + proto_tree_add_uint(mac_tree, hf_trmac_srcclass, NullTVB, offset+2, 1, pd[offset+2] & 0x0f); + proto_tree_add_uint(mac_tree, hf_trmac_dstclass, NullTVB, offset+2, 1, pd[offset+2] >> 4 ); /* interpret the subvectors */ sv_offset = 0; diff --git a/packet-udp.c b/packet-udp.c index 7ebe966c2a..46a126bbd2 100644 --- a/packet-udp.c +++ b/packet-udp.c @@ -1,7 +1,7 @@ /* packet-udp.c * Routines for UDP packet disassembly * - * $Id: packet-udp.c,v 1.71 2000/05/30 03:35:55 guy Exp $ + * $Id: packet-udp.c,v 1.72 2000/05/31 05:07:52 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -165,7 +165,7 @@ dissect_udp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { get_udp_port(uh_sport), get_udp_port(uh_dport)); if (tree) { - ti = proto_tree_add_item(tree, proto_udp, NullTVB, offset, 8); + ti = proto_tree_add_item(tree, proto_udp, NullTVB, offset, 8, FALSE); udp_tree = proto_item_add_subtree(ti, ett_udp); proto_tree_add_uint_format(udp_tree, hf_udp_srcport, NullTVB, offset, 2, uh_sport, @@ -173,10 +173,10 @@ dissect_udp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_tree_add_uint_format(udp_tree, hf_udp_dstport, NullTVB, offset + 2, 2, uh_dport, "Destination port: %s (%u)", get_udp_port(uh_dport), uh_dport); - proto_tree_add_item_hidden(udp_tree, hf_udp_port, NullTVB, offset, 2, uh_sport); - proto_tree_add_item_hidden(udp_tree, hf_udp_port, NullTVB, offset+2, 2, uh_dport); + proto_tree_add_uint_hidden(udp_tree, hf_udp_port, NullTVB, offset, 2, uh_sport); + proto_tree_add_uint_hidden(udp_tree, hf_udp_port, NullTVB, offset+2, 2, uh_dport); - proto_tree_add_item(udp_tree, hf_udp_length, NullTVB, offset + 4, 2, uh_ulen); + proto_tree_add_uint(udp_tree, hf_udp_length, NullTVB, offset + 4, 2, uh_ulen); proto_tree_add_uint_format(udp_tree, hf_udp_checksum, NullTVB, offset + 6, 2, uh_sum, "Checksum: 0x%04x", uh_sum); } diff --git a/packet-vlan.c b/packet-vlan.c index 8bd1b12238..7945ad06c4 100644 --- a/packet-vlan.c +++ b/packet-vlan.c @@ -1,7 +1,7 @@ /* packet-vlan.c * Routines for VLAN 802.1Q ethernet header disassembly * - * $Id: packet-vlan.c,v 1.15 2000/05/19 04:54:34 gram Exp $ + * $Id: packet-vlan.c,v 1.16 2000/05/31 05:07:53 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -90,12 +90,12 @@ dissect_vlan(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { } if (tree) { - ti = proto_tree_add_item(tree, proto_vlan, NullTVB, offset, 4); + ti = proto_tree_add_item(tree, proto_vlan, NullTVB, offset, 4, FALSE); vlan_tree = proto_item_add_subtree(ti, ett_vlan); - proto_tree_add_item(vlan_tree, hf_vlan_priority, NullTVB, offset, 2, tci); - proto_tree_add_item(vlan_tree, hf_vlan_cfi, NullTVB, offset, 2, tci); - proto_tree_add_item(vlan_tree, hf_vlan_id, NullTVB, offset, 2, tci); + proto_tree_add_uint(vlan_tree, hf_vlan_priority, NullTVB, offset, 2, tci); + proto_tree_add_uint(vlan_tree, hf_vlan_cfi, NullTVB, offset, 2, tci); + proto_tree_add_uint(vlan_tree, hf_vlan_id, NullTVB, offset, 2, tci); } next_tvb = tvb_new_subset(pi.compat_top_tvb, offset+4, -1, -1); /* XXX - should TRY() like dissect_eth() */ diff --git a/packet-vrrp.c b/packet-vrrp.c index 487dbc3197..7b2f955489 100644 --- a/packet-vrrp.c +++ b/packet-vrrp.c @@ -4,7 +4,7 @@ * * Heikki Vatiainen * - * $Id: packet-vrrp.c,v 1.5 2000/05/11 08:15:55 gram Exp $ + * $Id: packet-vrrp.c,v 1.6 2000/05/31 05:07:53 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -132,7 +132,7 @@ dissect_vrrp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) return; } - ti = proto_tree_add_item(tree, proto_vrrp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_vrrp, NullTVB, offset, END_OF_FRAME, FALSE); vrrp_tree = proto_item_add_subtree(ti, ett_vrrp); tv = proto_tree_add_uint_format(vrrp_tree, hf_vrrp_ver_type, NullTVB, offset, 1, @@ -140,8 +140,8 @@ dissect_vrrp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) hi_nibble(vrh.ver_type), lo_nibble(vrh.ver_type), val_to_str(lo_nibble(vrh.ver_type), vrrp_type_vals, "Unknown")); ver_type_tree = proto_item_add_subtree(tv, ett_vrrp_ver_type); - proto_tree_add_item(ver_type_tree, hf_vrrp_version, NullTVB, offset, 1, vrh.ver_type); - proto_tree_add_item(ver_type_tree, hf_vrrp_type, NullTVB, offset, 1, vrh.ver_type); + proto_tree_add_uint(ver_type_tree, hf_vrrp_version, NullTVB, offset, 1, vrh.ver_type); + proto_tree_add_uint(ver_type_tree, hf_vrrp_type, NullTVB, offset, 1, vrh.ver_type); offset++; proto_tree_add_text(vrrp_tree, NullTVB, offset++, 1, "Virtual Router ID: %u", vrh.vrouter_id); diff --git a/packet-vtp.c b/packet-vtp.c index e093a0292b..d76f169df4 100644 --- a/packet-vtp.c +++ b/packet-vtp.c @@ -1,7 +1,7 @@ /* packet-vtp.c * Routines for the disassembly of Cisco's Virtual Trunking Protocol * - * $Id: packet-vtp.c,v 1.4 2000/05/14 07:19:49 guy Exp $ + * $Id: packet-vtp.c,v 1.5 2000/05/31 05:07:53 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -108,27 +108,27 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { ti = proto_tree_add_item(tree, proto_vtp, NullTVB, offset, END_OF_FRAME, - NULL); + FALSE); vtp_tree = proto_item_add_subtree(ti, ett_vtp); - proto_tree_add_item(vtp_tree, hf_vtp_version, NullTVB, offset, 1, + proto_tree_add_uint(vtp_tree, hf_vtp_version, NullTVB, offset, 1, pd[offset]); offset += 1; code = pd[offset]; - proto_tree_add_item(vtp_tree, hf_vtp_code, NullTVB, offset, 1, + proto_tree_add_uint(vtp_tree, hf_vtp_code, NullTVB, offset, 1, code); offset += 1; switch (code) { case SUMMARY_ADVERT: - proto_tree_add_item(vtp_tree, hf_vtp_followers, NullTVB, offset, + proto_tree_add_uint(vtp_tree, hf_vtp_followers, NullTVB, offset, 1, pd[offset]); offset += 1; md_len = pd[offset]; - proto_tree_add_item(vtp_tree, hf_vtp_md_len, NullTVB, offset, + proto_tree_add_uint(vtp_tree, hf_vtp_md_len, NullTVB, offset, 1, md_len); offset += 1; @@ -137,12 +137,12 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) &pd[offset]); offset += 32; - proto_tree_add_item(vtp_tree, hf_vtp_conf_rev_num, NullTVB, + proto_tree_add_uint(vtp_tree, hf_vtp_conf_rev_num, NullTVB, offset, 4, pntohl(&pd[offset])); offset += 4; memcpy(&upd_id, &pd[offset], sizeof upd_id); - proto_tree_add_item(vtp_tree, hf_vtp_upd_id, NullTVB, + proto_tree_add_ipv4(vtp_tree, hf_vtp_upd_id, NullTVB, offset, 4, upd_id); offset += 4; @@ -153,17 +153,17 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) &pd[offset+6], &pd[offset+8], &pd[offset+10]); offset += 12; - proto_tree_add_item(vtp_tree, hf_vtp_md5_digest, NullTVB, + proto_tree_add_bytes(vtp_tree, hf_vtp_md5_digest, NullTVB, offset, 16, &pd[offset]); break; case SUBSET_ADVERT: - proto_tree_add_item(vtp_tree, hf_vtp_seq_num, NullTVB, offset, + proto_tree_add_uint(vtp_tree, hf_vtp_seq_num, NullTVB, offset, 1, pd[offset]); offset += 1; md_len = pd[offset]; - proto_tree_add_item(vtp_tree, hf_vtp_md_len, NullTVB, offset, + proto_tree_add_uint(vtp_tree, hf_vtp_md_len, NullTVB, offset, 1, md_len); offset += 1; @@ -172,7 +172,7 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) &pd[offset]); offset += 32; - proto_tree_add_item(vtp_tree, hf_vtp_conf_rev_num, NullTVB, + proto_tree_add_uint(vtp_tree, hf_vtp_conf_rev_num, NullTVB, offset, 4, pntohl(&pd[offset])); offset += 4; @@ -189,11 +189,11 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) offset += 1; /* skip reserved field */ md_len = pd[offset]; - proto_tree_add_item(vtp_tree, hf_vtp_md_len, NullTVB, offset, + proto_tree_add_uint(vtp_tree, hf_vtp_md_len, NullTVB, offset, 1, md_len); offset += 1; - proto_tree_add_item(vtp_tree, hf_vtp_start_value, NullTVB, + proto_tree_add_uint(vtp_tree, hf_vtp_start_value, NullTVB, offset, 2, pntohs(&pd[offset])); break; @@ -205,7 +205,7 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) offset += 1; /* skip unknown field */ md_len = pd[offset]; - proto_tree_add_item(vtp_tree, hf_vtp_md_len, NullTVB, offset, + proto_tree_add_uint(vtp_tree, hf_vtp_md_len, NullTVB, offset, 1, md_len); offset += 1; @@ -284,7 +284,7 @@ dissect_vlan_info(const u_char *pd, int offset, proto_tree *tree) vlan_info_tree = proto_item_add_subtree(ti, ett_vtp_vlan_info); vlan_info_left = vlan_info_len; - proto_tree_add_item(vlan_info_tree, hf_vtp_vlan_info_len, NullTVB, offset, 1, + proto_tree_add_uint(vlan_info_tree, hf_vtp_vlan_info_len, NullTVB, offset, 1, vlan_info_len); offset += 1; vlan_info_left -= 1; @@ -296,14 +296,14 @@ dissect_vlan_info(const u_char *pd, int offset, proto_tree *tree) "Status: 0x%02x%s", status, (status & VLAN_SUSPENDED) ? "(VLAN suspended)" : ""); status_tree = proto_item_add_subtree(ti, ett_vtp_vlan_status); - proto_tree_add_item(status_tree, hf_vtp_vlan_status_vlan_susp, NullTVB, offset, 1, + proto_tree_add_boolean(status_tree, hf_vtp_vlan_status_vlan_susp, NullTVB, offset, 1, status); offset += 1; vlan_info_left -= 1; if (!BYTES_ARE_IN_FRAME(offset, 1) || vlan_info_left < 1) return -1; - proto_tree_add_item(vlan_info_tree, hf_vtp_vlan_type, NullTVB, offset, 1, + proto_tree_add_uint(vlan_info_tree, hf_vtp_vlan_type, NullTVB, offset, 1, pd[offset]); offset += 1; vlan_info_left -= 1; @@ -311,28 +311,28 @@ dissect_vlan_info(const u_char *pd, int offset, proto_tree *tree) if (!BYTES_ARE_IN_FRAME(offset, 1) || vlan_info_left < 1) return -1; vlan_name_len = pd[offset]; - proto_tree_add_item(vlan_info_tree, hf_vtp_vlan_name_len, NullTVB, offset, 1, + proto_tree_add_uint(vlan_info_tree, hf_vtp_vlan_name_len, NullTVB, offset, 1, vlan_name_len); offset += 1; vlan_info_left -= 1; if (!BYTES_ARE_IN_FRAME(offset, 2) || vlan_info_left < 2) return -1; - proto_tree_add_item(vlan_info_tree, hf_vtp_isl_vlan_id, NullTVB, offset, 2, + proto_tree_add_uint(vlan_info_tree, hf_vtp_isl_vlan_id, NullTVB, offset, 2, pntohs(&pd[offset])); offset += 2; vlan_info_left -= 2; if (!BYTES_ARE_IN_FRAME(offset, 2) || vlan_info_left < 2) return -1; - proto_tree_add_item(vlan_info_tree, hf_vtp_mtu_size, NullTVB, offset, 2, + proto_tree_add_uint(vlan_info_tree, hf_vtp_mtu_size, NullTVB, offset, 2, pntohs(&pd[offset])); offset += 2; vlan_info_left -= 2; if (!BYTES_ARE_IN_FRAME(offset, 4) || vlan_info_left < 4) return -1; - proto_tree_add_item(vlan_info_tree, hf_vtp_802_10_index, NullTVB, offset, 4, + proto_tree_add_uint(vlan_info_tree, hf_vtp_802_10_index, NullTVB, offset, 4, pntohl(&pd[offset])); offset += 4; vlan_info_left -= 4; @@ -358,9 +358,9 @@ dissect_vlan_info(const u_char *pd, int offset, proto_tree *tree) ti = proto_tree_add_notext(vlan_info_tree, NullTVB, offset, 2 + length*2); tlv_tree = proto_item_add_subtree(ti, ett_vtp_tlv); - proto_tree_add_item(tlv_tree, hf_vtp_vlan_tlvtype, NullTVB, offset, + proto_tree_add_uint(tlv_tree, hf_vtp_vlan_tlvtype, NullTVB, offset, 1, type); - proto_tree_add_item(tlv_tree, hf_vtp_vlan_tlvlength, NullTVB, offset+1, + proto_tree_add_uint(tlv_tree, hf_vtp_vlan_tlvlength, NullTVB, offset+1, 1, length); offset += 2; vlan_info_left -= 2; diff --git a/packet-wccp.c b/packet-wccp.c index 9756d8a4d1..87583163b1 100644 --- a/packet-wccp.c +++ b/packet-wccp.c @@ -2,7 +2,7 @@ * Routines for Web Cache Coordination Protocol dissection * Jerry Talkington * - * $Id: packet-wccp.c,v 1.7 2000/05/11 08:15:55 gram Exp $ + * $Id: packet-wccp.c,v 1.8 2000/05/31 05:07:54 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -115,10 +115,10 @@ dissect_wccp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if(tree != NULL) { wccp_tree_item = proto_tree_add_item(tree, proto_wccp, NullTVB, offset, - END_OF_FRAME, NULL); + END_OF_FRAME, FALSE); wccp_tree = proto_item_add_subtree(wccp_tree_item, ett_wccp); - proto_tree_add_item(wccp_tree, hf_wccp_message_type, NullTVB, offset, + proto_tree_add_uint(wccp_tree, hf_wccp_message_type, NullTVB, offset, sizeof(wccp_message_type), wccp_message_type); offset += sizeof(wccp_message_type); @@ -126,25 +126,25 @@ dissect_wccp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) case WCCP_HERE_I_AM: wccp_version = pntohl(&pd[offset]); - proto_tree_add_item(wccp_tree, hf_wccp_version, NullTVB, + proto_tree_add_uint(wccp_tree, hf_wccp_version, NullTVB, offset, 4, wccp_version); offset += 4; dissect_hash_data(pd, offset, wccp_tree); offset += HASH_INFO_SIZE; - proto_tree_add_item(wccp_tree, hf_recvd_id, NullTVB, offset, + proto_tree_add_uint(wccp_tree, hf_recvd_id, NullTVB, offset, 4, pntohl(&pd[offset])); offset += 4; break; case WCCP_I_SEE_YOU: wccp_version = pntohl(&pd[offset]); - proto_tree_add_item(wccp_tree, hf_wccp_version, NullTVB, + proto_tree_add_uint(wccp_tree, hf_wccp_version, NullTVB, offset, 4, wccp_version); offset += 4; - proto_tree_add_item(wccp_tree, hf_change_num, NullTVB, offset, + proto_tree_add_uint(wccp_tree, hf_change_num, NullTVB, offset, 4, pntohl(&pd[offset])); offset += 4; - proto_tree_add_item(wccp_tree, hf_recvd_id, NullTVB, offset, + proto_tree_add_uint(wccp_tree, hf_recvd_id, NullTVB, offset, 4, pntohl(&pd[offset])); offset += 4; cache_count = pntohl(&pd[offset]); @@ -163,7 +163,7 @@ dissect_wccp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) * This hasn't been tested, since I don't have any * traces with this in it. */ - proto_tree_add_item(wccp_tree, hf_recvd_id, NullTVB, offset, + proto_tree_add_uint(wccp_tree, hf_recvd_id, NullTVB, offset, 4, pntohl(&pd[offset])); offset += 4; cache_count = pntohl(&pd[offset]); @@ -192,7 +192,7 @@ dissect_wccp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) default: wccp_version = pntohl(&pd[offset]); - proto_tree_add_item(wccp_tree, hf_wccp_version, NullTVB, + proto_tree_add_uint(wccp_tree, hf_wccp_version, NullTVB, offset, 4, wccp_version); offset += 4; dissect_data(pd, offset, fd, wccp_tree); @@ -213,7 +213,7 @@ dissect_hash_data(const u_char *pd, int offset, proto_tree *wccp_tree) int n; guint32 flags; - proto_tree_add_item(wccp_tree, hf_hash_revision, NullTVB, offset, 4, + proto_tree_add_uint(wccp_tree, hf_hash_revision, NullTVB, offset, 4, pntohl(&pd[offset])); offset += 4; @@ -251,7 +251,7 @@ dissect_web_cache_list_entry(const u_char *pd, int offset, int index, "Web-Cache List Entry(%d)", index); list_entry_tree = proto_item_add_subtree(tl, ett_cache_info); - proto_tree_add_item(list_entry_tree, hf_cache_ip, NullTVB, offset, 4, + proto_tree_add_ipv4(list_entry_tree, hf_cache_ip, NullTVB, offset, 4, pntohl(&pd[offset])); dissect_hash_data(pd, offset + 4, list_entry_tree); } diff --git a/packet-who.c b/packet-who.c index 9df4775559..38df766d87 100644 --- a/packet-who.c +++ b/packet-who.c @@ -2,7 +2,7 @@ * Routines for who protocol (see man rwhod) * Gilbert Ramirez * - * $Id: packet-who.c,v 1.6 2000/05/11 08:15:56 gram Exp $ + * $Id: packet-who.c,v 1.7 2000/05/31 05:07:54 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -137,41 +137,41 @@ dissect_who(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) /* We already know that the packet has enough data to fill in * the summary info. Retrieve that data */ - who_ti = proto_tree_add_item(tree, proto_who, NullTVB, offset, END_OF_FRAME, NULL); + who_ti = proto_tree_add_item(tree, proto_who, NullTVB, offset, END_OF_FRAME, FALSE); who_tree = proto_item_add_subtree(who_ti, ett_who); - proto_tree_add_item(who_tree, hf_who_vers, NullTVB, offset, 1, pd[offset]); + proto_tree_add_uint(who_tree, hf_who_vers, NullTVB, offset, 1, pd[offset]); offset += 1; - proto_tree_add_item(who_tree, hf_who_type, NullTVB, offset, 1, pd[offset]); + proto_tree_add_uint(who_tree, hf_who_type, NullTVB, offset, 1, pd[offset]); offset += 1; /* 2 filler bytes */ offset += 2; tv.tv_sec = pntohl(&pd[offset]); - proto_tree_add_item(who_tree, hf_who_sendtime, NullTVB, offset, 4, &tv); + proto_tree_add_time(who_tree, hf_who_sendtime, NullTVB, offset, 4, &tv); offset += 4; tv.tv_sec = pntohl(&pd[offset]); - proto_tree_add_item(who_tree, hf_who_recvtime, NullTVB, offset, 4, &tv); + proto_tree_add_time(who_tree, hf_who_recvtime, NullTVB, offset, 4, &tv); offset += 4; - proto_tree_add_item(who_tree, hf_who_hostname, NullTVB, offset, 32, server_name); + proto_tree_add_string(who_tree, hf_who_hostname, NullTVB, offset, 32, server_name); offset += 32; - proto_tree_add_item(who_tree, hf_who_loadav_5, NullTVB, offset, 4, loadav_5); + proto_tree_add_double(who_tree, hf_who_loadav_5, NullTVB, offset, 4, loadav_5); offset += 4; - proto_tree_add_item(who_tree, hf_who_loadav_10, NullTVB, offset, 4, loadav_10); + proto_tree_add_double(who_tree, hf_who_loadav_10, NullTVB, offset, 4, loadav_10); offset += 4; - proto_tree_add_item(who_tree, hf_who_loadav_15, NullTVB, offset, 4, loadav_15); + proto_tree_add_double(who_tree, hf_who_loadav_15, NullTVB, offset, 4, loadav_15); offset += 4; tv.tv_sec = pntohl(&pd[offset]); - proto_tree_add_item(who_tree, hf_who_boottime, NullTVB, offset, 4, &tv); + proto_tree_add_time(who_tree, hf_who_boottime, NullTVB, offset, 4, &tv); offset += 4; dissect_whoent(pd, offset, fd, who_tree); @@ -203,17 +203,17 @@ dissect_whoent(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) memcpy(out_line, &pd[line_offset], 8); memcpy(out_name, &pd[line_offset+8], 8); - whoent_ti = proto_tree_add_item(tree, hf_who_whoent, NullTVB, line_offset, SIZE_OF_WHOENT, NULL); + whoent_ti = proto_tree_add_item(tree, hf_who_whoent, NullTVB, line_offset, SIZE_OF_WHOENT, FALSE); whoent_tree = proto_item_add_subtree(whoent_ti, ett_whoent); - proto_tree_add_item(whoent_tree, hf_who_tty, NullTVB, line_offset, 8, out_line); + proto_tree_add_string(whoent_tree, hf_who_tty, NullTVB, line_offset, 8, out_line); line_offset += 8; - proto_tree_add_item(whoent_tree, hf_who_uid, NullTVB, line_offset, 8, out_name); + proto_tree_add_string(whoent_tree, hf_who_uid, NullTVB, line_offset, 8, out_name); line_offset += 8; tv.tv_sec = pntohl(&pd[line_offset]); - proto_tree_add_item(whoent_tree, hf_who_timeon, NullTVB, line_offset, 4, &tv); + proto_tree_add_time(whoent_tree, hf_who_timeon, NullTVB, line_offset, 4, &tv); line_offset += 4; idle_secs = pntohl(&pd[line_offset]); diff --git a/packet-x25.c b/packet-x25.c index 140201b42e..710e5fb2ce 100644 --- a/packet-x25.c +++ b/packet-x25.c @@ -2,7 +2,7 @@ * Routines for x25 packet disassembly * Olivier Abad * - * $Id: packet-x25.c,v 1.31 2000/05/29 22:35:11 oabad Exp $ + * $Id: packet-x25.c,v 1.32 2000/05/31 05:07:54 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1432,14 +1432,14 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "X.25"); x25_tree = proto_item_add_subtree(ti, ett_x25); if (bytes0_1 & 0x8000) - proto_tree_add_item(x25_tree, + proto_tree_add_boolean(x25_tree, (modulo == 8) ? hf_x25_qbit : hf_ex25_qbit, tvb, 0, 2, bytes0_1); if (bytes0_1 & 0x4000) - proto_tree_add_item(x25_tree, + proto_tree_add_boolean(x25_tree, (modulo == 8) ? hf_x25_dbit : hf_ex25_dbit, tvb, 0, 2, bytes0_1); - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_mod : hf_ex25_mod, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_mod : hf_ex25_mod, tvb, 0, 2, bytes0_1); } @@ -1452,7 +1452,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) : "Call req." , vc); if (x25_tree) { - proto_tree_add_item(x25_tree, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, 0, 2, bytes0_1); proto_tree_add_uint_format(x25_tree, @@ -1566,7 +1566,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) : "Call acc." , vc); if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, 0, 2, bytes0_1); proto_tree_add_uint_format(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, @@ -1598,7 +1598,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } x25_hash_add_proto_end(vc, pinfo->fd->abs_secs, pinfo->fd->abs_usecs); if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, 0, 2, bytes0_1); proto_tree_add_uint_format(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, @@ -1616,9 +1616,9 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(check_col(pinfo->fd, COL_INFO)) col_add_fstr(pinfo->fd, COL_INFO, "Clear Conf. VC:%d", vc); if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, 2, 1, X25_CLEAR_CONFIRMATION); } localoffset = x25_pkt_len; @@ -1635,7 +1635,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) (int)tvb_get_guint8(tvb, 3)); } if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, 2, 1, X25_DIAGNOSTIC); proto_tree_add_text(x25_tree, tvb, 3, 1, "Diagnostic : %d", (int)tvb_get_guint8(tvb, 3)); @@ -1646,9 +1646,9 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(check_col(pinfo->fd, COL_INFO)) col_add_fstr(pinfo->fd, COL_INFO, "Interrupt VC:%d", vc); if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, 2, 1, X25_INTERRUPT); } localoffset = x25_pkt_len; @@ -1657,9 +1657,9 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(check_col(pinfo->fd, COL_INFO)) col_add_fstr(pinfo->fd, COL_INFO, "Interrupt Conf. VC:%d", vc); if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, 2, 1, X25_INTERRUPT_CONFIRMATION); } localoffset = x25_pkt_len; @@ -1674,7 +1674,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } x25_hash_add_proto_end(vc, pinfo->fd->abs_secs, pinfo->fd->abs_usecs); if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, 0, 2, bytes0_1); proto_tree_add_uint_format(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, 2, 1, @@ -1692,9 +1692,9 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(check_col(pinfo->fd, COL_INFO)) col_add_fstr(pinfo->fd, COL_INFO, "Reset conf. VC:%d", vc); if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, 2, 1, X25_RESET_CONFIRMATION); } localoffset = x25_pkt_len; @@ -1724,7 +1724,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(check_col(pinfo->fd, COL_INFO)) col_add_str(pinfo->fd, COL_INFO, "Restart conf."); if (x25_tree) - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, 2, 1, X25_RESTART_CONFIRMATION); localoffset = x25_pkt_len; break; @@ -1732,7 +1732,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(check_col(pinfo->fd, COL_INFO)) col_add_str(pinfo->fd, COL_INFO, "Registration req."); if (x25_tree) - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, 2, 1, X25_REGISTRATION_REQUEST); localoffset = 3; if (localoffset < x25_pkt_len) @@ -1754,7 +1754,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(check_col(pinfo->fd, COL_INFO)) col_add_str(pinfo->fd, COL_INFO, "Registration conf."); if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_type : hf_ex25_type, tvb, 2, 1, X25_REGISTRATION_CONFIRMATION); proto_tree_add_text(x25_tree, tvb, 3, 1, "Cause: %s", registration_code(tvb_get_guint8(tvb, 3))); @@ -1796,31 +1796,31 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) (tvb_get_guint8(tvb, localoffset+1) & 0x01) ? " M" : ""); } if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, localoffset-2, 2, bytes0_1); if (modulo == 8) { - proto_tree_add_item_hidden(x25_tree, hf_x25_type, tvb, + proto_tree_add_uint_hidden(x25_tree, hf_x25_type, tvb, localoffset, 1, X25_DATA); - proto_tree_add_item(x25_tree, hf_x25_p_r, tvb, + proto_tree_add_uint(x25_tree, hf_x25_p_r, tvb, localoffset, 1, pkt_type); if (pkt_type & 0x10) - proto_tree_add_item(x25_tree, hf_x25_mbit, tvb, localoffset, 1, + proto_tree_add_boolean(x25_tree, hf_x25_mbit, tvb, localoffset, 1, pkt_type); - proto_tree_add_item(x25_tree, hf_x25_p_s, tvb, localoffset, 1, + proto_tree_add_uint(x25_tree, hf_x25_p_s, tvb, localoffset, 1, pkt_type); proto_tree_add_text(x25_tree, tvb, localoffset, 1, decode_boolean_bitfield(pkt_type, 0x01, 1*8, NULL, "DATA")); } else { - proto_tree_add_item_hidden(x25_tree, hf_ex25_type, tvb, + proto_tree_add_uint_hidden(x25_tree, hf_ex25_type, tvb, localoffset, 1, X25_DATA); - proto_tree_add_item(x25_tree, hf_x25_p_r, tvb, + proto_tree_add_uint(x25_tree, hf_x25_p_r, tvb, localoffset, 1, pkt_type); - proto_tree_add_item(x25_tree, hf_x25_p_s, tvb, + proto_tree_add_uint(x25_tree, hf_x25_p_s, tvb, localoffset+1, 1, tvb_get_guint8(tvb, localoffset+1)); if (tvb_get_guint8(tvb, localoffset+1) & 0x01) - proto_tree_add_item(x25_tree, hf_ex25_mbit, tvb, + proto_tree_add_boolean(x25_tree, hf_ex25_mbit, tvb, localoffset+1, 1, tvb_get_guint8(tvb, localoffset+1)); } } @@ -1839,19 +1839,19 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) vc, tvb_get_guint8(tvb, localoffset+1) >> 1); } if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, localoffset-2, 2, bytes0_1); if (modulo == 8) { - proto_tree_add_item(x25_tree, hf_x25_p_r, tvb, + proto_tree_add_uint(x25_tree, hf_x25_p_r, tvb, localoffset, 1, pkt_type); - proto_tree_add_item(x25_tree, hf_x25_type, tvb, + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, localoffset, 1, X25_RR); } else { - proto_tree_add_item(x25_tree, hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, hf_ex25_type, tvb, localoffset, 1, X25_RR); proto_tree_add_item(x25_tree, hf_ex25_p_r, tvb, - localoffset+1, 1, tvb_get_guint8(tvb, localoffset+1)); + localoffset+1, 1, FALSE); } } break; @@ -1866,19 +1866,19 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) vc, tvb_get_guint8(tvb, localoffset+1) >> 1); } if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, localoffset-2, 2, bytes0_1); if (modulo == 8) { - proto_tree_add_item(x25_tree, hf_x25_p_r, tvb, + proto_tree_add_uint(x25_tree, hf_x25_p_r, tvb, localoffset, 1, pkt_type); - proto_tree_add_item(x25_tree, hf_x25_type, tvb, + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, localoffset, 1, X25_RNR); } else { - proto_tree_add_item(x25_tree, hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, hf_ex25_type, tvb, localoffset, 1, X25_RNR); proto_tree_add_item(x25_tree, hf_ex25_p_r, tvb, - localoffset+1, 1, tvb_get_guint8(tvb, localoffset+1)); + localoffset+1, 1, FALSE); } } break; @@ -1893,19 +1893,19 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) vc, tvb_get_guint8(tvb, localoffset+1) >> 1); } if (x25_tree) { - proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, + proto_tree_add_uint(x25_tree, (modulo == 8) ? hf_x25_lcn : hf_ex25_lcn, tvb, localoffset-2, 2, bytes0_1); if (modulo == 8) { - proto_tree_add_item(x25_tree, hf_x25_p_r, tvb, + proto_tree_add_uint(x25_tree, hf_x25_p_r, tvb, localoffset, 1, pkt_type); - proto_tree_add_item(x25_tree, hf_x25_type, tvb, + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, localoffset, 1, X25_REJ); } else { - proto_tree_add_item(x25_tree, hf_ex25_type, tvb, + proto_tree_add_uint(x25_tree, hf_ex25_type, tvb, localoffset, 1, X25_REJ); proto_tree_add_item(x25_tree, hf_ex25_p_r, tvb, - localoffset+1, 1, tvb_get_guint8(tvb, localoffset+1)); + localoffset+1, 1, FALSE); } } } diff --git a/packet-yhoo.c b/packet-yhoo.c index ad291fa3e5..2299985bf8 100644 --- a/packet-yhoo.c +++ b/packet-yhoo.c @@ -2,7 +2,7 @@ * Routines for yahoo messenger packet dissection * Copyright 1999, Nathan Neulinger * - * $Id: packet-yhoo.c,v 1.7 2000/05/11 08:15:57 gram Exp $ + * $Id: packet-yhoo.c,v 1.8 2000/05/31 05:07:55 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -143,28 +143,28 @@ dissect_yhoo(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) ); if (tree) { - ti = proto_tree_add_item(tree, proto_yhoo, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_yhoo, NullTVB, offset, END_OF_FRAME, FALSE); yhoo_tree = proto_item_add_subtree(ti, ett_yhoo); - proto_tree_add_item(yhoo_tree, hf_yhoo_version, NullTVB, + proto_tree_add_string(yhoo_tree, hf_yhoo_version, NullTVB, offset, 8, pkt->version); - proto_tree_add_item(yhoo_tree, hf_yhoo_len, NullTVB, + proto_tree_add_uint(yhoo_tree, hf_yhoo_len, NullTVB, offset+8, 4, pletohl(pkt->len)); - proto_tree_add_item(yhoo_tree, hf_yhoo_service, NullTVB, + proto_tree_add_uint(yhoo_tree, hf_yhoo_service, NullTVB, offset+12, 4, pletohl(pkt->service)); - proto_tree_add_item(yhoo_tree, hf_yhoo_connection_id, NullTVB, + proto_tree_add_uint(yhoo_tree, hf_yhoo_connection_id, NullTVB, offset+16, 4, pletohl(pkt->connection_id)); - proto_tree_add_item(yhoo_tree, hf_yhoo_magic_id, NullTVB, + proto_tree_add_uint(yhoo_tree, hf_yhoo_magic_id, NullTVB, offset+20, 4, pletohl(pkt->magic_id)); - proto_tree_add_item(yhoo_tree, hf_yhoo_unknown1, NullTVB, + proto_tree_add_uint(yhoo_tree, hf_yhoo_unknown1, NullTVB, offset+24, 4, pletohl(pkt->unknown1)); - proto_tree_add_item(yhoo_tree, hf_yhoo_msgtype, NullTVB, + proto_tree_add_uint(yhoo_tree, hf_yhoo_msgtype, NullTVB, offset+28, 4, pletohl(pkt->msgtype)); - proto_tree_add_item(yhoo_tree, hf_yhoo_nick1, NullTVB, + proto_tree_add_string(yhoo_tree, hf_yhoo_nick1, NullTVB, offset+32, 36, pkt->nick1); - proto_tree_add_item(yhoo_tree, hf_yhoo_nick2, NullTVB, + proto_tree_add_string(yhoo_tree, hf_yhoo_nick2, NullTVB, offset+68, 36, pkt->nick2); - proto_tree_add_item(yhoo_tree, hf_yhoo_content, NullTVB, + proto_tree_add_string(yhoo_tree, hf_yhoo_content, NullTVB, offset+104, END_OF_FRAME, pkt->content); } diff --git a/packet-ypserv.c b/packet-ypserv.c index 9f5ad0aa09..e42e78c696 100644 --- a/packet-ypserv.c +++ b/packet-ypserv.c @@ -1,7 +1,7 @@ /* packet-ypserv.c * Routines for ypserv dissection * - * $Id: packet-ypserv.c,v 1.10 2000/05/11 08:15:58 gram Exp $ + * $Id: packet-ypserv.c,v 1.11 2000/05/31 05:07:56 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -66,7 +66,7 @@ int dissect_domain_reply(const u_char *pd, int offset, frame_data *fd, if ( tree ) { - proto_tree_add_item(tree, hf_ypserv_servesdomain, NullTVB, + proto_tree_add_boolean(tree, hf_ypserv_servesdomain, NullTVB, offset, 4, pntohl(&pd[offset])); } @@ -120,7 +120,7 @@ int dissect_match_reply(const u_char *pd, int offset, frame_data *fd, if ( tree ) { - proto_tree_add_item(tree, hf_ypserv_status, NullTVB, + proto_tree_add_boolean(tree, hf_ypserv_status, NullTVB, offset, 4, pntohl(&pd[offset])); offset += 4; @@ -137,7 +137,7 @@ int dissect_firstnext_reply(const u_char *pd, int offset, frame_data *fd, if ( tree ) { - proto_tree_add_item(tree, hf_ypserv_status, NullTVB, + proto_tree_add_boolean(tree, hf_ypserv_status, NullTVB, offset, 4, pntohl(&pd[offset])); offset += 4; diff --git a/packet.c b/packet.c index eef7e53462..937ad0670e 100644 --- a/packet.c +++ b/packet.c @@ -1,7 +1,7 @@ /* packet.c * Routines for packet disassembly * - * $Id: packet.c,v 1.93 2000/05/31 03:58:55 gram Exp $ + * $Id: packet.c,v 1.94 2000/05/31 05:07:57 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1139,16 +1139,16 @@ dissect_packet(union wtap_pseudo_header *pseudo_header, const u_char *pd, tv.tv_sec = fd->abs_secs; tv.tv_usec = fd->abs_usecs; - proto_tree_add_item(fh_tree, hf_frame_arrival_time, NullTVB, + proto_tree_add_time(fh_tree, hf_frame_arrival_time, NullTVB, 0, 0, &tv); tv.tv_sec = fd->del_secs; tv.tv_usec = fd->del_usecs; - proto_tree_add_item(fh_tree, hf_frame_time_delta, NullTVB, + proto_tree_add_time(fh_tree, hf_frame_time_delta, NullTVB, 0, 0, &tv); - proto_tree_add_item(fh_tree, hf_frame_number, NullTVB, + proto_tree_add_uint(fh_tree, hf_frame_number, NullTVB, 0, 0, fd->num); proto_tree_add_uint_format(fh_tree, hf_frame_packet_len, NullTVB, diff --git a/plugins/gryphon/packet-gryphon.c b/plugins/gryphon/packet-gryphon.c index 725dc6b787..06ca90a924 100644 --- a/plugins/gryphon/packet-gryphon.c +++ b/plugins/gryphon/packet-gryphon.c @@ -1,7 +1,7 @@ /* packet-gryphon.c * Routines for Gryphon protocol packet disassembly * - * $Id: packet-gryphon.c,v 1.9 2000/05/11 08:18:09 gram Exp $ + * $Id: packet-gryphon.c,v 1.10 2000/05/31 05:09:07 guy Exp $ * * Ethereal - Network traffic analyzer * By Steve Limkemann @@ -141,7 +141,7 @@ dissector(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { if (fd) { ti = proto_tree_add_item(tree, proto_gryphon, NullTVB, offset, - end_of_frame, NULL); + end_of_frame, FALSE); gryphon_tree = proto_item_add_subtree(ti, ett_gryphon); } else gryphon_tree = tree; @@ -164,8 +164,8 @@ dissector(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) i = SIZEOF(src_dest) - 1; proto_tree_add_text(header_tree, NullTVB, offset, 2, "Source: %s, channel %hd", src_dest[i].strptr, data[1]); - proto_tree_add_item_hidden(header_tree, hf_gryph_src, NullTVB, offset, 1, src); - proto_tree_add_item_hidden(header_tree, hf_gryph_srcchan, NullTVB, offset+1, 1, data[1]); + proto_tree_add_uint_hidden(header_tree, hf_gryph_src, NullTVB, offset, 1, src); + proto_tree_add_uint_hidden(header_tree, hf_gryph_srcchan, NullTVB, offset+1, 1, data[1]); for (i = 0; i < SIZEOF(src_dest); i++) { if (src_dest[i].value == dest) @@ -175,8 +175,8 @@ dissector(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) i = SIZEOF(src_dest) - 1; proto_tree_add_text(header_tree, NullTVB, offset+2, 2, "Destination: %s, channel %hd", src_dest[i].strptr, data[3]); - proto_tree_add_item_hidden(header_tree, hf_gryph_dest, NullTVB, offset+2, 1, dest); - proto_tree_add_item_hidden(header_tree, hf_gryph_destchan, NullTVB, offset+3, 1, data[3]); + proto_tree_add_uint_hidden(header_tree, hf_gryph_dest, NullTVB, offset+2, 1, dest); + proto_tree_add_uint_hidden(header_tree, hf_gryph_destchan, NullTVB, offset+3, 1, data[3]); proto_tree_add_text(header_tree, NullTVB, offset+4, 2, "Data length: %d bytes", msglen); @@ -184,7 +184,7 @@ dissector(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) "Frame type: %s", frame_type[frmtyp]); proto_tree_add_text(header_tree, NullTVB, offset+7, 1, "reserved"); - proto_tree_add_item_hidden(header_tree, hf_gryph_type, NullTVB, offset+6, 1, frmtyp); + proto_tree_add_uint_hidden(header_tree, hf_gryph_type, NullTVB, offset+6, 1, frmtyp); msgpad = 3 - (msglen + 3) % 4; msgend = data + msglen + msgpad + MSG_HDR_SZ; @@ -446,7 +446,7 @@ decode_command (int dst, const u_char **data, const u_char *dataend, int *offset proto_item *ti; cmd = (*data)[0]; - proto_tree_add_item_hidden(pt, hf_gryph_cmd, NullTVB, *offset, 1, cmd); + proto_tree_add_uint_hidden(pt, hf_gryph_cmd, NullTVB, *offset, 1, cmd); if (cmd > 0x3F) cmd += dst * 256; diff --git a/proto.c b/proto.c index 98d3e7ecfe..c4aa97ea00 100644 --- a/proto.c +++ b/proto.c @@ -1,7 +1,7 @@ /* proto.c * Routines for protocol tree * - * $Id: proto.c,v 1.66 2000/05/19 04:54:36 gram Exp $ + * $Id: proto.c,v 1.67 2000/05/31 05:07:59 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -89,32 +89,39 @@ static char* hfinfo_int_format(header_field_info *hfinfo); static gboolean check_for_protocol_or_field_id(GNode *node, gpointer data); static gboolean check_for_field_within_protocol(GNode *node, gpointer data); -static field_info* -proto_tree_add_field_info(int hfindex, tvbuff_t *tvb, gint start, gint length, int visible); - static proto_item* proto_tree_add_node(proto_tree *tree, field_info *fi); static proto_item * proto_tree_add_pi(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - const char *format, gboolean visible, field_info **pfi, va_list ap); + field_info **pfi); +static void +proto_tree_set_representation(proto_item *pi, const char *format, va_list ap); static void proto_tree_set_value(field_info *fi, gint length, va_list ap); static void proto_tree_set_bytes(field_info *fi, const guint8* start_ptr, gint length); static void +proto_tree_set_bytes_tvb(field_info *fi, tvbuff_t *tvb, gint offset, gint length); +static void proto_tree_set_time(field_info *fi, struct timeval *value_ptr); static void proto_tree_set_string(field_info *fi, const char* value); static void -proto_tree_set_ether(field_info *fi, guint8* value); +proto_tree_set_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, gint length); +static void +proto_tree_set_ether(field_info *fi, const guint8* value); +static void +proto_tree_set_ether_tvb(field_info *fi, tvbuff_t *tvb, gint start); static void proto_tree_set_ipxnet(field_info *fi, guint32 value); static void proto_tree_set_ipv4(field_info *fi, guint32 value); static void -proto_tree_set_ipv6(field_info *fi, guint8* value_ptr); +proto_tree_set_ipv6(field_info *fi, const guint8* value_ptr); +static void +proto_tree_set_ipv6_tvb(field_info *fi, tvbuff_t *tvb, gint start); static void proto_tree_set_boolean(field_info *fi, guint32 value); static void @@ -267,17 +274,12 @@ proto_registrar_get_nth(int hfindex) proto_item * proto_tree_add_notext(proto_tree *tree, tvbuff_t *tvb, gint start, gint length) { - field_info *fi; proto_item *pi; - if (!tree) + pi = proto_tree_add_pi(tree, hf_text_only, tvb, start, length, NULL); + if (pi == NULL) return(NULL); - fi = proto_tree_add_field_info(hf_text_only, tvb, start, length, - proto_tree_is_visible); - pi = proto_tree_add_node(tree, fi); - fi->representation = NULL; - return pi; } @@ -286,46 +288,33 @@ proto_item * proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, const char *format, ...) { - field_info *fi; proto_item *pi; va_list ap; - if (!tree) + pi = proto_tree_add_notext(tree, tvb, start, length); + if (pi == NULL) return(NULL); - fi = proto_tree_add_field_info(hf_text_only, tvb, start, length, - proto_tree_is_visible); - pi = proto_tree_add_node(tree, fi); - - /* Only add text if we know that proto_tree is to be shown */ - if (proto_tree_is_visible) { - va_start(ap, format); - fi->representation = g_mem_chunk_alloc(gmc_item_labels); - vsnprintf(fi->representation, ITEM_LABEL_LENGTH, format, ap); - va_end(ap); - } - else { - fi->representation = NULL; - } + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); + va_end(ap); return pi; } /* Add an item to a proto_tree, using the text label registered to that item. */ proto_item * -proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, ...) +proto_tree_add_item_old(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, ...) { proto_item *pi; va_list ap; field_info *new_fi; - if (!tree) + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); + if (pi == NULL) return(NULL); va_start(ap, length); - /* ap won't be used since format is NULL */ - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - NULL, TRUE, &new_fi, ap); proto_tree_set_value(new_fi, length, ap); va_end(ap); @@ -335,21 +324,188 @@ proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gi /* Add an item to a proto_tree, but make it invisible in GUI. The field is * still searchable, though. */ proto_item * -proto_tree_add_item_hidden(proto_tree *tree, int hfindex, tvbuff_t* tvb, gint start, gint length, ...) +proto_tree_add_item_hidden_old(proto_tree *tree, int hfindex, tvbuff_t* tvb, gint start, gint length, ...) { proto_item *pi; - va_list ap; - field_info *new_fi; + field_info *fi; - if (!tree) + pi = proto_tree_add_item_old(tree, hfindex, tvb, start, length); + if (pi == NULL) return(NULL); - va_start(ap, length); - /* ap won't be used since format is NULL */ - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - NULL, FALSE, &new_fi, ap); - proto_tree_set_value(new_fi, length, ap); - va_end(ap); + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +static guint32 +get_uint_value(tvbuff_t *tvb, gint offset, gint length, gboolean little_endian) +{ + guint32 value; + + switch (length) { + + case 1: + value = tvb_get_guint8(tvb, offset); + break; + + case 2: + value = little_endian ? tvb_get_letohs(tvb, offset) + : tvb_get_ntohs(tvb, offset); + break; + + case 3: + value = little_endian ? tvb_get_letoh24(tvb, offset) + : tvb_get_ntoh24(tvb, offset); + break; + + case 4: + value = little_endian ? tvb_get_letohl(tvb, offset) + : tvb_get_ntohl(tvb, offset); + break; + + default: + g_assert_not_reached(); + value = 0; + break; + } + return value; +} + +static gint32 +get_int_value(tvbuff_t *tvb, gint offset, gint length, gboolean little_endian) +{ + gint32 value; + + switch (length) { + + case 1: + value = (gint8)tvb_get_guint8(tvb, offset); + break; + + case 2: + value = (gint16) (little_endian ? tvb_get_letohs(tvb, offset) + : tvb_get_ntohs(tvb, offset)); + break; + + case 3: + value = little_endian ? tvb_get_letoh24(tvb, offset) + : tvb_get_ntoh24(tvb, offset); + if (value & 0x00800000) { + /* Sign bit is set; sign-extend it. */ + value |= 0xFF000000; + } + break; + + case 4: + value = little_endian ? tvb_get_letohl(tvb, offset) + : tvb_get_ntohl(tvb, offset); + break; + + default: + g_assert_not_reached(); + value = 0; + break; + } + return value; +} + +/* Add an item to a proto_tree, using the text label registered to that item; + the item is extracted from the tvbuff handed to it. */ +proto_item * +proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, + gint start, gint length, gboolean little_endian) +{ + proto_item *pi; + field_info *new_fi; + guint32 value; + + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); + if (pi == NULL) + return(NULL); + + switch(new_fi->hfinfo->type) { + case FT_NONE: + /* no value to set for FT_NONE */ + break; + + case FT_BYTES: + proto_tree_set_bytes_tvb(new_fi, tvb, start, length); + break; + + case FT_BOOLEAN: + proto_tree_set_boolean(new_fi, + get_uint_value(tvb, start, length, little_endian)); + break; + + /* XXX - make these just FT_UINT? */ + case FT_UINT8: + case FT_UINT16: + case FT_UINT24: + case FT_UINT32: + proto_tree_set_uint(new_fi, + get_uint_value(tvb, start, length, little_endian)); + break; + + /* XXX - make these just FT_INT? */ + case FT_INT8: + case FT_INT16: + case FT_INT24: + case FT_INT32: + proto_tree_set_int(new_fi, + get_int_value(tvb, start, length, little_endian)); + break; + + case FT_IPv4: + g_assert(length == 4); + tvb_memcpy(tvb, (guint8 *)&value, start, 4); + proto_tree_set_ipv4(new_fi, value); + break; + + case FT_IPXNET: + g_assert(length == 4); /* 2? */ + tvb_memcpy(tvb, (guint8 *)&value, start, 4); + proto_tree_set_ipxnet(new_fi, value); + break; + + case FT_IPv6: + g_assert(length == 16); + proto_tree_set_ipv6_tvb(new_fi, tvb, start); + break; + + case FT_ETHER: + g_assert(length == 6); + proto_tree_set_ether_tvb(new_fi, tvb, start); + break; + + case FT_STRING: + /* This g_strdup'ed memory is freed in proto_tree_free_node() */ + proto_tree_set_string_tvb(new_fi, tvb, start, length); + break; + + default: + g_error("new_fi->hfinfo->type %d not handled\n", new_fi->hfinfo->type); + g_assert_not_reached(); + break; + } + + return pi; +} + +proto_item * +proto_tree_add_item_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, + gint start, gint length, gboolean little_endian) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_item(tree, hfindex, tvb, start, length, little_endian); + if (pi == NULL) + return(NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; return pi; } @@ -458,22 +614,23 @@ proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gin hfinfo = proto_registrar_get_nth(hfindex); g_assert(hfinfo->type == FT_NONE); + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, NULL); + va_start(ap, format); - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, NULL, ap); - /* no value to set for FT_NONE */ + proto_tree_set_representation(pi, format, ap); va_end(ap); + /* no value to set for FT_NONE */ + return pi; } /* Add a FT_BYTES to a proto_tree */ proto_item * -proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, - gint length, const guint8 *start_ptr, const char *format, ...) +proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const guint8 *start_ptr) { proto_item *pi; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -483,10 +640,42 @@ proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s hfinfo = proto_registrar_get_nth(hfindex); g_assert(hfinfo->type == FT_BYTES); - va_start(ap, format); - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); proto_tree_set_bytes(new_fi, start_ptr, length); + + return pi; +} + +proto_item * +proto_tree_add_bytes_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const guint8 *start_ptr) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_bytes(tree, hfindex, tvb, start, length, start_ptr); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const guint8 *start_ptr, const char *format, ...) +{ + proto_item *pi; + va_list ap; + + pi = proto_tree_add_bytes(tree, hfindex, tvb, start, length, start_ptr); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); va_end(ap); return pi; @@ -509,13 +698,25 @@ proto_tree_set_bytes(field_info *fi, const guint8* start_ptr, gint length) } } +static void +proto_tree_set_bytes_tvb(field_info *fi, tvbuff_t *tvb, gint offset, gint length) +{ + if (length > 0) { + /* This g_malloc'ed memory is freed in + proto_tree_free_node() */ + fi->value.bytes = tvb_memdup(tvb, offset, length); + } + else { + fi->value.bytes = NULL; + } +} + /* Add a FT_*TIME to a proto_tree */ proto_item * -proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - struct timeval *value_ptr, const char *format, ...) +proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + struct timeval *value_ptr) { proto_item *pi; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -526,10 +727,42 @@ proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st g_assert(hfinfo->type == FT_ABSOLUTE_TIME || hfinfo->type == FT_RELATIVE_TIME); - va_start(ap, format); - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); proto_tree_set_time(new_fi, value_ptr); + + return pi; +} + +proto_item * +proto_tree_add_time_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + struct timeval *value_ptr) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_time(tree, hfindex, tvb, start, length, value_ptr); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + struct timeval *value_ptr, const char *format, ...) +{ + proto_item *pi; + va_list ap; + + pi = proto_tree_add_time(tree, hfindex, tvb, start, length, value_ptr); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); va_end(ap); return pi; @@ -544,11 +777,10 @@ proto_tree_set_time(field_info *fi, struct timeval *value_ptr) /* Add a FT_IPXNET to a proto_tree */ proto_item * -proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - guint32 value, const char *format, ...) +proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value) { proto_item *pi; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -558,10 +790,42 @@ proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint hfinfo = proto_registrar_get_nth(hfindex); g_assert(hfinfo->type == FT_IPXNET); - va_start(ap, format); - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); proto_tree_set_ipxnet(new_fi, value); + + return pi; +} + +proto_item * +proto_tree_add_ipxnet_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_ipxnet(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value, const char *format, ...) +{ + proto_item *pi; + va_list ap; + + pi = proto_tree_add_ipxnet(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); va_end(ap); return pi; @@ -576,11 +840,10 @@ proto_tree_set_ipxnet(field_info *fi, guint32 value) /* Add a FT_IPv4 to a proto_tree */ proto_item * -proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - guint32 value, const char *format, ...) +proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value) { proto_item *pi; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -590,10 +853,42 @@ proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st hfinfo = proto_registrar_get_nth(hfindex); g_assert(hfinfo->type == FT_IPv4); - va_start(ap, format); - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); proto_tree_set_ipv4(new_fi, value); + + return pi; +} + +proto_item * +proto_tree_add_ipv4_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_ipv4(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value, const char *format, ...) +{ + proto_item *pi; + va_list ap; + + pi = proto_tree_add_ipv4(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); va_end(ap); return pi; @@ -609,11 +904,10 @@ proto_tree_set_ipv4(field_info *fi, guint32 value) /* Add a FT_IPv6 to a proto_tree */ proto_item * -proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - guint8* value_ptr, const char *format, ...) +proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + const guint8* value_ptr) { proto_item *pi; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -623,29 +917,66 @@ proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st hfinfo = proto_registrar_get_nth(hfindex); g_assert(hfinfo->type == FT_IPv6); - va_start(ap, format); - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); proto_tree_set_ipv6(new_fi, value_ptr); + + return pi; +} + +proto_item * +proto_tree_add_ipv6_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + const guint8* value_ptr) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_ipv6(tree, hfindex, tvb, start, length, value_ptr); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + const guint8* value_ptr, const char *format, ...) +{ + proto_item *pi; + va_list ap; + + pi = proto_tree_add_ipv6(tree, hfindex, tvb, start, length, value_ptr); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); va_end(ap); return pi; } -/* Set the FT_IPv4 value */ +/* Set the FT_IPv6 value */ static void -proto_tree_set_ipv6(field_info *fi, guint8* value_ptr) +proto_tree_set_ipv6(field_info *fi, const guint8* value_ptr) { memcpy(fi->value.ipv6, value_ptr, 16); } +static void +proto_tree_set_ipv6_tvb(field_info *fi, tvbuff_t *tvb, gint start) +{ + tvb_memcpy(tvb, fi->value.ipv6, start, 16); +} + /* Add a FT_STRING to a proto_tree */ proto_item * -proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, - gint length, const char* value, const char *format, ...) +proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const char* value) { proto_item *pi; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -655,10 +986,42 @@ proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint hfinfo = proto_registrar_get_nth(hfindex); g_assert(hfinfo->type == FT_STRING); - va_start(ap, format); - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); proto_tree_set_string(new_fi, value); + + return pi; +} + +proto_item * +proto_tree_add_string_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const char* value) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_string(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const char* value, const char *format, ...) +{ + proto_item *pi; + va_list ap; + + pi = proto_tree_add_string(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); va_end(ap); return pi; @@ -672,13 +1035,19 @@ proto_tree_set_string(field_info *fi, const char* value) fi->value.string = g_strdup(value); } +static void +proto_tree_set_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, gint length) +{ + /* This g_strdup'ed memory is freed in proto_tree_free_node() */ + fi->value.string = tvb_memdup(tvb, start, length); +} + /* Add a FT_ETHER to a proto_tree */ proto_item * -proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - guint8* value, const char *format, ...) +proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + const guint8* value) { proto_item *pi; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -688,10 +1057,42 @@ proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s hfinfo = proto_registrar_get_nth(hfindex); g_assert(hfinfo->type == FT_ETHER); - va_start(ap, format); - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); proto_tree_set_ether(new_fi, value); + + return pi; +} + +proto_item * +proto_tree_add_ether_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + const guint8* value) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_ether(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + const guint8* value, const char *format, ...) +{ + proto_item *pi; + va_list ap; + + pi = proto_tree_add_ether(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); va_end(ap); return pi; @@ -699,18 +1100,23 @@ proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s /* Set the FT_ETHER value */ static void -proto_tree_set_ether(field_info *fi, guint8* value) +proto_tree_set_ether(field_info *fi, const guint8* value) { memcpy(fi->value.ether, value, 6); } +static void +proto_tree_set_ether_tvb(field_info *fi, tvbuff_t *tvb, gint start) +{ + tvb_memcpy(tvb, fi->value.ether, start, 6); +} + /* Add a FT_BOOLEAN to a proto_tree */ proto_item * -proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - guint32 value, const char *format, ...) +proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value) { proto_item *pi; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -720,10 +1126,42 @@ proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint hfinfo = proto_registrar_get_nth(hfindex); g_assert(hfinfo->type == FT_BOOLEAN); - va_start(ap, format); - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); proto_tree_set_boolean(new_fi, value); + + return pi; +} + +proto_item * +proto_tree_add_boolean_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_boolean(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value, const char *format, ...) +{ + proto_item *pi; + va_list ap; + + pi = proto_tree_add_boolean(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); va_end(ap); return pi; @@ -738,11 +1176,10 @@ proto_tree_set_boolean(field_info *fi, guint32 value) /* Add a FT_DOUBLE to a proto_tree */ proto_item * -proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - double value, const char *format, ...) +proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + double value) { proto_item *pi; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -752,10 +1189,42 @@ proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint hfinfo = proto_registrar_get_nth(hfindex); g_assert(hfinfo->type == FT_DOUBLE); - va_start(ap, format); - pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, &new_fi); proto_tree_set_double(new_fi, value); + + return pi; +} + +proto_item * +proto_tree_add_double_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + double value) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_double(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + double value, const char *format, ...) +{ + proto_item *pi; + va_list ap; + + pi = proto_tree_add_double(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); va_end(ap); return pi; @@ -770,11 +1239,10 @@ proto_tree_set_double(field_info *fi, double value) /* Add any FT_UINT* to a proto_tree */ proto_item * -proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - guint32 value, const char *format, ...) +proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value) { proto_item *pi = NULL; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -787,11 +1255,9 @@ proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st case FT_UINT16: case FT_UINT24: case FT_UINT32: - va_start(ap, format); pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + &new_fi); proto_tree_set_uint(new_fi, value); - va_end(ap); break; default: @@ -801,6 +1267,41 @@ proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st return pi; } +proto_item * +proto_tree_add_uint_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_uint(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + guint32 value, const char *format, ...) +{ + proto_item *pi; + va_list ap; + + pi = proto_tree_add_uint(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); + va_end(ap); + + return pi; +} + /* Set the FT_UINT* value */ static void proto_tree_set_uint(field_info *fi, guint32 value) @@ -822,11 +1323,10 @@ proto_tree_set_uint(field_info *fi, guint32 value) /* Add any FT_INT* to a proto_tree */ proto_item * -proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - gint32 value, const char *format, ...) +proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + gint32 value) { proto_item *pi = NULL; - va_list ap; field_info *new_fi; header_field_info *hfinfo; @@ -839,11 +1339,9 @@ proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint sta case FT_INT16: case FT_INT24: case FT_INT32: - va_start(ap, format); pi = proto_tree_add_pi(tree, hfindex, tvb, start, length, - format, TRUE, &new_fi, ap); + &new_fi); proto_tree_set_int(new_fi, value); - va_end(ap); break; default: @@ -853,6 +1351,41 @@ proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint sta return pi; } +proto_item * +proto_tree_add_int_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + gint32 value) +{ + proto_item *pi; + field_info *fi; + + pi = proto_tree_add_int(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + fi = (field_info*) (((GNode*)pi)->data); + fi->visible = FALSE; + + return pi; +} + +proto_item * +proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, + gint32 value, const char *format, ...) +{ + proto_item *pi = NULL; + va_list ap; + + pi = proto_tree_add_int(tree, hfindex, tvb, start, length, value); + if (pi == NULL) + return (NULL); + + va_start(ap, format); + proto_tree_set_representation(pi, format, ap); + va_end(ap); + + return pi; +} + /* Set the FT_INT* value */ static void proto_tree_set_int(field_info *fi, gint32 value) @@ -873,28 +1406,6 @@ proto_tree_set_int(field_info *fi, gint32 value) } -/* Create a new field_info struct, and initialize it */ -static field_info * -proto_tree_add_field_info(int hfindex, tvbuff_t *tvb, gint start, gint length, int visible) -{ - field_info *fi; - - fi = g_mem_chunk_alloc(gmc_field_info); - - g_assert(hfindex >= 0 && hfindex < gpa_hfinfo->len); - fi->hfinfo = proto_registrar_get_nth(hfindex); - g_assert(fi->hfinfo != NULL); - fi->start = start; - if (tvb) { - fi->start += tvb_raw_offset(tvb); - } - fi->length = length; - fi->tree_type = ETT_NONE; - fi->visible = visible; - - return fi; -} - /* Add a field_info struct to the proto_tree, encapsulating it in a GNode (proto_item) */ static proto_item * proto_tree_add_node(proto_tree *tree, field_info *fi) @@ -908,11 +1419,11 @@ proto_tree_add_node(proto_tree *tree, field_info *fi) } -/* Generic way to allocate field_info, add to proto_tree, and set representation. +/* Generic way to allocate field_info and add to proto_tree. * Sets *pfi to address of newly-allocated field_info struct, if pfi is non-NULL. */ static proto_item * proto_tree_add_pi(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, - const char *format, gboolean visible, field_info **pfi, va_list ap) + field_info **pfi) { proto_item *pi; field_info *fi; @@ -920,22 +1431,22 @@ proto_tree_add_pi(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint if (!tree) return(NULL); - /* either visibility flag can nullify the other */ - visible = proto_tree_is_visible && visible; + fi = g_mem_chunk_alloc(gmc_field_info); - fi = proto_tree_add_field_info(hfindex, tvb, start, length, visible); + g_assert(hfindex >= 0 && hfindex < gpa_hfinfo->len); + fi->hfinfo = proto_registrar_get_nth(hfindex); + g_assert(fi->hfinfo != NULL); + fi->start = start; + if (tvb) { + fi->start += tvb_raw_offset(tvb); + } + fi->length = length; + fi->tree_type = ETT_NONE; + fi->visible = proto_tree_is_visible; + fi->representation = NULL; pi = proto_tree_add_node(tree, fi); - /* are there any formatting arguments? */ - if (visible && format) { - fi->representation = g_mem_chunk_alloc(gmc_item_labels); - vsnprintf(fi->representation, ITEM_LABEL_LENGTH, format, ap); - } - else { - fi->representation = NULL; - } - if (pfi) { *pfi = fi; } @@ -943,6 +1454,18 @@ proto_tree_add_pi(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint return pi; } +/* Set representation of a proto_tree entry, if the protocol tree is to + be visible. */ +static void +proto_tree_set_representation(proto_item *pi, const char *format, va_list ap) +{ + field_info *fi = (field_info*) (((GNode*)pi)->data); + + if (fi->visible) { + fi->representation = g_mem_chunk_alloc(gmc_item_labels); + vsnprintf(fi->representation, ITEM_LABEL_LENGTH, format, ap); + } +} void proto_item_set_text(proto_item *pi, const char *format, ...) @@ -953,10 +1476,8 @@ proto_item_set_text(proto_item *pi, const char *format, ...) if (fi->representation) g_mem_chunk_free(gmc_item_labels, fi->representation); - fi->representation = g_mem_chunk_alloc(gmc_item_labels); va_start(ap, format); - vsnprintf(fi->representation, ITEM_LABEL_LENGTH, - format, ap); + proto_tree_set_representation(pi, format, ap); va_end(ap); } diff --git a/proto.h b/proto.h index b046100124..234a7f24ba 100644 --- a/proto.h +++ b/proto.h @@ -1,7 +1,7 @@ /* proto.h * Definitions for protocol display * - * $Id: proto.h,v 1.31 2000/05/30 09:52:30 guy Exp $ + * $Id: proto.h,v 1.32 2000/05/31 05:08:00 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -197,13 +197,24 @@ proto_register_subtree_array(gint **indices, int num_indices); /* Add item's value to proto_tree, using label registered to that field */ proto_item * -proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, +proto_tree_add_item_old(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, ...); proto_item * -proto_tree_add_item_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, +proto_tree_add_item_hidden_old(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, ...); +/* Add an item to a proto_tree, using the text label registered to that item; + the item is extracted from the tvbuff handed to it. */ +proto_item * +proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, + gint start, gint length, gboolean little_endian); + +proto_item * +proto_tree_add_item_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, + gint start, gint length, gboolean little_endian); + +/* Add a FT_NONE to a proto_tree */ #if __GNUC__ == 2 proto_item * proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, @@ -215,6 +226,14 @@ proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gin gint length, const char *format, ...); #endif +/* Add a FT_BYTES to a proto_tree */ +proto_item * +proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const guint8* start_ptr); + +proto_item * +proto_tree_add_bytes_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const guint8* start_ptr); #if __GNUC__ == 2 proto_item * @@ -227,6 +246,15 @@ proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s gint length, const guint8* start_ptr, const char *format, ...); #endif +/* Add a FT_*TIME to a proto_tree */ +proto_item * +proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, struct timeval* value_ptr); + +proto_item * +proto_tree_add_time_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, struct timeval* value_ptr); + #if __GNUC__ == 2 proto_item * proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, @@ -238,6 +266,15 @@ proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st gint length, struct timeval* value_ptr, const char *format, ...); #endif +/* Add a FT_IPXNET to a proto_tree */ +proto_item * +proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, guint32 value); + +proto_item * +proto_tree_add_ipxnet_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, guint32 value); + #if __GNUC__ == 2 proto_item * proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, @@ -249,6 +286,15 @@ proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint gint length, guint32 value, const char *format, ...); #endif +/* Add a FT_IPv4 to a proto_tree */ +proto_item * +proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, guint32 value); + +proto_item * +proto_tree_add_ipv4_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, guint32 value); + #if __GNUC__ == 2 proto_item * proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, @@ -260,21 +306,39 @@ proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st gint length, guint32 value, const char *format, ...); #endif +/* Add a FT_IPv6 to a proto_tree */ +proto_item * +proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const guint8* value_ptr); + +proto_item * +proto_tree_add_ipv6_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const guint8* value_ptr); + #if __GNUC__ == 2 proto_item * proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, - gint length, guint8* value_ptr, const char *format, ...) + gint length, const guint8* value_ptr, const char *format, ...) __attribute__((format (printf, 7, 8))); #else proto_item * proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, - gint length, guint8* value_ptr, const char *format, ...); + gint length, const guint8* value_ptr, const char *format, ...); #endif +/* Add a FT_ETHER to a proto_tree */ +proto_item * +proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const guint8* value); + +proto_item * +proto_tree_add_ether_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const guint8* value); + #if __GNUC__ == 2 proto_item * proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, - gint length, guint8* value, const char *format, ...) + gint length, const guint8* value, const char *format, ...) __attribute__((format (printf, 7, 8))); #else proto_item * @@ -282,6 +346,15 @@ proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s gint length, guint8* value, const char *format, ...); #endif +/* Add a FT_STRING to a proto_tree */ +proto_item * +proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const char* value); + +proto_item * +proto_tree_add_string_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, const char* value); + #if __GNUC__ == 2 proto_item * proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, @@ -293,6 +366,15 @@ proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint gint length, const char* value, const char *format, ...); #endif +/* Add a FT_BOOLEAN to a proto_tree */ +proto_item * +proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, guint32 value); + +proto_item * +proto_tree_add_boolean_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, guint32 value); + #if __GNUC__ == 2 proto_item * proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, @@ -304,6 +386,35 @@ proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint gint length, guint32 value, const char *format, ...); #endif +/* Add a FT_DOUBLE to a proto_tree */ +proto_item * +proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, double value); + +proto_item * +proto_tree_add_double_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, double value); + +#if __GNUC__ == 2 +proto_item * +proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, double value, const char *format, ...) + __attribute__((format (printf, 7, 8))); +#else +proto_item * +proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, double value, const char *format, ...); +#endif + +/* Add any FT_UINT* to a proto_tree */ +proto_item * +proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, guint32 value); + +proto_item * +proto_tree_add_uint_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, guint32 value); + #if __GNUC__ == 2 proto_item * proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, @@ -315,6 +426,15 @@ proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st gint length, guint32 value, const char *format, ...); #endif +/* Add any FT_INT* to a proto_tree */ +proto_item * +proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, gint32 value); + +proto_item * +proto_tree_add_int_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, + gint length, gint32 value); + #if __GNUC__ == 2 proto_item * proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, @@ -327,6 +447,7 @@ proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint sta #endif +/* Add a text-only node to the proto_tree */ #if __GNUC__ == 2 proto_item * proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, const char *, @@ -338,6 +459,7 @@ proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, co #endif +/* Add a node with no text */ proto_item * proto_tree_add_notext(proto_tree *tree, tvbuff_t *tvb, gint start, gint length);