/* gtkpacket.c
* Routines for GTK+ packet display
*
- * $Id: proto_draw.c,v 1.4 1999/11/15 22:52:03 gram Exp $
+ * $Id: proto_draw.c,v 1.5 1999/11/16 11:44:20 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
void expand_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view) {
int i;
- for(i=0; i < NUM_TREE_TYPES; i++) {
+ for(i=0; i < num_tree_types; i++) {
tree_is_expanded[i] = TRUE;
}
gtk_tree_clear_items(GTK_TREE(tree_view), 0, -1);
void collapse_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view) {
int i;
- for(i=0; i < NUM_TREE_TYPES; i++) {
+ for(i=0; i < num_tree_types; i++) {
tree_is_expanded[i] = FALSE;
}
gtk_tree_clear_items(GTK_TREE(tree_view), 0, -1);
/* packet-aarp.c
* Routines for Appletalk ARP packet disassembly
*
- * $Id: packet-aarp.c,v 1.13 1999/11/04 08:21:04 guy Exp $
+ * $Id: packet-aarp.c,v 1.14 1999/11/16 11:42:23 guy Exp $
*
* Simon Wilkinson <sxw@dcs.ed.ac.uk>
*
static int hf_aarp_dst_ether = -1;
static int hf_aarp_dst_id = -1;
+static gint ett_aarp = -1;
+
#ifndef AARP_REQUEST
#define AARP_REQUEST 0x0001
#endif
MIN_AARP_HEADER_SIZE + 2*ar_hln +
2*ar_pln, NULL,
"Unknown AARP (opcode 0x%04x)", ar_op);
- aarp_tree = proto_item_add_subtree(ti, ETT_AARP);
+ aarp_tree = proto_item_add_subtree(ti, ett_aarp);
proto_tree_add_item(aarp_tree, hf_aarp_hard_type, offset + AR_HRD, 2,
ar_hrd);
proto_tree_add_item(aarp_tree, hf_aarp_proto_type, offset + AR_PRO, 2,
FT_BYTES, BASE_HEX, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_aarp,
+ };
proto_aarp = proto_register_protocol("Appletalk Address Resolution Protocol",
"aarp");
proto_register_field_array(proto_aarp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* 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.5 1999/10/28 20:46:42 nneul Exp $
+ * $Id: packet-afs.c,v 1.6 1999/11/16 11:42:23 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_afs_ubik_voteend = -1;
static int hf_afs_ubik_votetype = -1;
+static gint ett_afs = -1;
+static gint ett_afs_op = -1;
+static gint ett_afs_acl = -1;
+static gint ett_afs_fid = -1;
+static gint ett_afs_callback = -1;
+static gint ett_afs_ubikver = -1;
+
/*
* Dissector prototypes
*/
if (tree) {
ti = proto_tree_add_item(tree, proto_afs, doffset, END_OF_FRAME);
- afs_tree = proto_item_add_subtree(ti, ETT_AFS);
+ afs_tree = proto_item_add_subtree(ti, ett_afs);
if ( !BYTES_ARE_IN_FRAME(offset, sizeof(struct rx_header) +
sizeof(struct afs_header)) )
}
/* Add the subtree for this particular service */
- afs_op_tree = proto_item_add_subtree(ti, ETT_AFS_OP);
+ afs_op_tree = proto_item_add_subtree(ti, ett_afs_op);
if ( typenode != 0 )
{
{ proto_tree *save, *ti; \
ti = proto_tree_add_text(tree, curoffset, 3*4, "Callback"); \
save = tree; \
- tree = proto_item_add_subtree(ti, ETT_AFS_CALLBACK); \
+ tree = proto_item_add_subtree(ti, ett_afs_callback); \
TRUNC(3*sizeof(guint32)); \
UINTOUT(hf_afs_fs_callback_version); \
BIGDATEOUT(hf_afs_fs_callback_expires); \
{ proto_tree *save, *ti; \
ti = proto_tree_add_text(tree, curoffset, 3*4, "Callback"); \
save = tree; \
- tree = proto_item_add_subtree(ti, ETT_AFS_CALLBACK); \
+ tree = proto_item_add_subtree(ti, ett_afs_callback); \
TRUNC(3*sizeof(guint32)); \
UINTOUT(hf_afs_cb_callback_version); \
DATEOUT(hf_afs_cb_callback_expires); \
ti = proto_tree_add_text(tree, curoffset, 3*4, \
"FileID (%s)", label); \
save = tree; \
- tree = proto_item_add_subtree(ti, ETT_AFS_FID); \
+ tree = proto_item_add_subtree(ti, ett_afs_fid); \
UINTOUT(hf_afs_fs_fid_volume); \
UINTOUT(hf_afs_fs_fid_vnode); \
UINTOUT(hf_afs_fs_fid_uniqifier); \
ti = proto_tree_add_text(tree, curoffset, 3*4, \
"FileID (%s)", label); \
save = tree; \
- tree = proto_item_add_subtree(ti, ETT_AFS_FID); \
+ tree = proto_item_add_subtree(ti, ett_afs_fid); \
UINTOUT(hf_afs_cb_fid_volume); \
UINTOUT(hf_afs_cb_fid_vnode); \
UINTOUT(hf_afs_cb_fid_uniqifier); \
"ACL: %s %s%s", \
who, tmp, positive ? "" : " (negative)"); \
save = tree; \
- tree = proto_item_add_subtree(ti, ETT_AFS_ACL); \
+ tree = proto_item_add_subtree(ti, ett_afs_acl); \
proto_tree_add_item(tree,hf_afs_fs_acl_entity,curoffset,strlen(who), who);\
tmpoffset = curoffset + strlen(who) + 1; \
acllen = bytes - strlen(who) - 1; \
ti = proto_tree_add_text(tree, curoffset, 3*4, \
"UBIK Version (%s): %u.%u", label, epoch, counter ); \
save = tree; \
- tree = proto_item_add_subtree(ti, ETT_AFS_UBIKVER); \
+ tree = proto_item_add_subtree(ti, ett_afs_ubikver); \
proto_tree_add_item(tree,hf_afs_ubik_version_epoch,curoffset-8, \
sizeof(guint32),&tv); \
proto_tree_add_item(tree,hf_afs_ubik_version_counter,curoffset-4, \
0, 0, "Site" }},
};
+ static gint *ett[] = {
+ &ett_afs,
+ &ett_afs_op,
+ &ett_afs_acl,
+ &ett_afs_fid,
+ &ett_afs_callback,
+ &ett_afs_ubikver,
+ };
proto_afs = proto_register_protocol("Andrew File System (AFS)", "afs");
proto_register_field_array(proto_afs, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-arp.c
* Routines for ARP packet disassembly
*
- * $Id: packet-arp.c,v 1.21 1999/11/04 08:15:38 guy Exp $
+ * $Id: packet-arp.c,v 1.22 1999/11/16 11:42:24 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_arp_dst_ether = -1;
static int hf_arp_dst_proto = -1;
+static gint ett_arp = -1;
+
/* Definitions taken from Linux "linux/if_arp.h" header file, and from
http://www.isi.edu/in-notes/iana/assignments/arp-parameters
MIN_ARP_HEADER_SIZE + 2*ar_hln +
2*ar_pln, NULL,
"Unknown ARP (opcode 0x%04x)", ar_op);
- arp_tree = proto_item_add_subtree(ti, ETT_ARP);
+ arp_tree = proto_item_add_subtree(ti, ett_arp);
proto_tree_add_item(arp_tree, hf_arp_hard_type, offset + AR_HRD, 2,
ar_hrd);
proto_tree_add_item(arp_tree, hf_arp_proto_type, offset + AR_PRO, 2,
FT_BYTES, BASE_NONE, NULL, 0x0,
"" }}
};
+ static gint *ett[] = {
+ &ett_arp,
+ };
proto_arp = proto_register_protocol("Address Resolution Protocol", "arp");
proto_register_field_array(proto_arp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-ascend.c
* Routines for decoding Lucent/Ascend packet traces
*
- * $Id: packet-ascend.c,v 1.7 1999/10/16 14:04:22 deniel Exp $
+ * $Id: packet-ascend.c,v 1.8 1999/11/16 11:42:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_task = -1;
static int hf_user_name = -1;
+static gint ett_raw = -1;
+
static const value_string encaps_vals[] = {
{ASCEND_PFX_WDS_X, "PPP Transmit"},
{ASCEND_PFX_WDS_R, "PPP Receive" },
layer (ie none) */
if(tree) {
ti = proto_tree_add_text(tree, 0, 0, "Lucent/Ascend packet trace" );
- fh_tree = proto_item_add_subtree(ti, ETT_RAW);
+ fh_tree = proto_item_add_subtree(ti, ett_raw);
proto_tree_add_item(fh_tree, hf_link_type, 0, 0,
fd->pseudo_header.ascend.type);
if (fd->pseudo_header.ascend.type == ASCEND_PFX_WDD) {
{ "User name", "ascend.user", FT_STRING, BASE_NONE, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_raw,
+ };
proto_ascend = proto_register_protocol("Lucent/Ascend debug output", "ascend");
proto_register_field_array(proto_ascend, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
-
/* packet-atalk.c
* Routines for Appletalk packet disassembly (DDP, currently).
*
- * $Id: packet-atalk.c,v 1.21 1999/11/04 07:06:50 guy Exp $
+ * $Id: packet-atalk.c,v 1.22 1999/11/16 11:42:25 guy Exp $
*
* Simon Wilkinson <sxw@dcs.ed.ac.uk>
*
static int hf_ddp_src_socket = -1;
static int hf_ddp_type = -1;
+static gint ett_ddp = -1;
+
/* P = Padding, H = Hops, L = Len */
#if BYTE_ORDER == BIG_ENDIAN
/* PPHHHHLL LLLLLLLL */
if (tree) {
ti = proto_tree_add_item(tree, proto_ddp, offset, DDP_HEADER_SIZE, NULL);
- ddp_tree = proto_item_add_subtree(ti, ETT_DDP);
+ ddp_tree = proto_item_add_subtree(ti, ett_ddp);
proto_tree_add_item(ddp_tree, hf_ddp_hopcount, offset, 1,
ddp_hops(ddp.hops_len));
proto_tree_add_item(ddp_tree, hf_ddp_len, offset, 2,
{ "Protocol type", "ddp.type", FT_UINT8, BASE_DEC, VALS(op_vals), 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_ddp,
+ };
proto_ddp = proto_register_protocol("Datagram Delivery Protocol", "ddp");
proto_register_field_array(proto_ddp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-atm.c
* Routines for ATM packet disassembly
*
- * $Id: packet-atm.c,v 1.1 1999/08/20 06:55:05 guy Exp $
+ * $Id: packet-atm.c,v 1.2 1999/11/16 11:42:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int proto_atm = -1;
static int proto_atm_lane = -1;
+static gint ett_atm = -1;
+static gint ett_atm_lane = -1;
+static gint ett_atm_lane_lc_lan_dest = -1;
+static gint ett_atm_lane_lc_lan_dest_rd = -1;
+static gint ett_atm_lane_lc_flags = -1;
+
/*
* See
*
if (tree) {
ti = proto_tree_add_item_format(tree, proto_atm_lane, offset, 2, NULL,
"ATM LANE");
- lane_tree = proto_item_add_subtree(ti, ETT_ATM_LANE);
+ lane_tree = proto_item_add_subtree(ti, ett_atm_lane);
proto_tree_add_text(lane_tree, offset, 2, "LE Client: 0x%04X",
pntohs(&pd[offset]));
td = proto_tree_add_text(tree, offset, 8, "%s LAN destination",
type);
- dest_tree = proto_item_add_subtree(td, ETT_ATM_LANE_LC_LAN_DEST);
+ dest_tree = proto_item_add_subtree(td, ett_atm_lane_lc_lan_dest);
tag = pntohs(&pd[offset]);
proto_tree_add_text(dest_tree, offset, 2, "Tag: %s",
val_to_str(tag, le_control_landest_tag_vals,
route_descriptor = pntohs(&pd[offset]);
trd = proto_tree_add_text(dest_tree, offset, 2, "Route descriptor: 0x%02X",
route_descriptor);
- rd_tree = proto_item_add_subtree(td, ETT_ATM_LANE_LC_LAN_DEST_RD);
+ rd_tree = proto_item_add_subtree(td, ett_atm_lane_lc_lan_dest_rd);
proto_tree_add_text(rd_tree, offset, 2,
decode_numeric_bitfield(route_descriptor, 0xFFF0, 2*8,
"LAN ID = %u"));
if (tree) {
ti = proto_tree_add_item_format(tree, proto_atm_lane, offset, 108, NULL,
"ATM LANE");
- lane_tree = proto_item_add_subtree(ti, ETT_ATM_LANE);
+ lane_tree = proto_item_add_subtree(ti, ett_atm_lane);
proto_tree_add_text(lane_tree, offset, 2, "Marker: 0x%04X",
pntohs(&pd[offset]));
flags = pntohs(&pd[offset]);
tf = proto_tree_add_text(lane_tree, offset, 2, "Flags: 0x%04X",
pntohs(&pd[offset]));
- flags_tree = proto_item_add_subtree(tf, ETT_ATM_LANE_LC_FLAGS);
+ flags_tree = proto_item_add_subtree(tf, ett_atm_lane_lc_flags);
proto_tree_add_text(flags_tree, offset, 2, "%s",
decode_boolean_bitfield(flags, 0x0001, 8*2,
"Remote address", "Local address"));
if (tree) {
ti = proto_tree_add_item_format(tree, proto_atm, 0, 0, NULL,
"ATM");
- atm_tree = proto_item_add_subtree(ti, ETT_ATM);
+ atm_tree = proto_item_add_subtree(ti, ett_atm);
proto_tree_add_text(atm_tree, 0, 0, "AAL: %s",
val_to_str(aal_type, aal_vals, "Unknown AAL (%x)"));
void
proto_register_atm(void)
{
+ static gint *ett[] = {
+ &ett_atm,
+ &ett_atm_lane,
+ &ett_atm_lane_lc_lan_dest,
+ &ett_atm_lane_lc_lan_dest_rd,
+ &ett_atm_lane_lc_flags,
+ };
proto_atm = proto_register_protocol("ATM", "atm");
proto_atm_lane = proto_register_protocol("ATM LANE", "lane");
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for BGP packet dissection.
* Copyright 1999, Jun-ichiro itojun Hagino <itojun@itojun.org>
*
- * $Id: packet-bgp.c,v 1.9 1999/11/11 21:08:51 itojun Exp $
+ * $Id: packet-bgp.c,v 1.10 1999/11/16 11:42:26 guy Exp $
*
* Supports:
* RFC1771 A Border Gateway Protocol 4 (BGP-4)
static int proto_bgp = -1;
+static gint ett_bgp = -1;
+static gint ett_bgp_unfeas = -1;
+static gint ett_bgp_attrs = -1;
+static gint ett_bgp_attr = -1;
+static gint ett_bgp_attr_flags = -1;
+static gint ett_bgp_mp_reach_nlri = -1;
+static gint ett_bgp_mp_unreach_nlri = -1;
+static gint ett_bgp_nlri = -1;
+static gint ett_bgp_open = -1;
+static gint ett_bgp_update = -1;
+static gint ett_bgp_notification = -1;
+
/*
* Decode an IPv4 prefix.
*/
if (len > 0) {
ti = proto_tree_add_text(tree, p - pd, len, "Withdrawn routes:");
/* TODO: unfeasible */
- subtree = proto_item_add_subtree(ti, ETT_BGP_UNFEAS);
+ subtree = proto_item_add_subtree(ti, ett_bgp_unfeas);
}
p += 2 + len;
/* --- move --- */
if (len > 0) {
ti = proto_tree_add_text(tree, p - pd + 2, len, "Path attributes");
- subtree = proto_item_add_subtree(ti, ETT_BGP_ATTRS);
+ subtree = proto_item_add_subtree(ti, ett_bgp_attrs);
i = 2;
while (i < len) {
int alen, aoff;
val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
alen + aoff, (alen + aoff == 1) ? "byte" : "bytes");
}
- subtree2 = proto_item_add_subtree(ti, ETT_BGP_ATTR);
+ subtree2 = proto_item_add_subtree(ti, ett_bgp_attr);
/* figure out flags */
ti = proto_tree_add_text(subtree2,
p - pd + i + offsetof(struct bgp_attr, bgpa_flags), 1,
"Flags: 0x%02x", bgpa.bgpa_flags);
- subtree3 = proto_item_add_subtree(ti, ETT_BGP_ATTR_FLAGS);
+ subtree3 = proto_item_add_subtree(ti, ett_bgp_attr_flags);
proto_tree_add_text(subtree3,
p - pd + i + offsetof(struct bgp_attr, bgpa_flags), 1,
"%s", decode_boolean_bitfield(bgpa.bgpa_flags,
int j, advance;
const char *s;
- subtree3 = proto_item_add_subtree(ti, ETT_BGP_MP_REACH_NLRI);
+ subtree3 = proto_item_add_subtree(ti, ett_bgp_mp_reach_nlri);
j = 0;
while (j < p[i + aoff + 3]) {
"Subnetwork points of attachment: %u", snpa);
off++;
if (snpa)
- subtree3 = proto_item_add_subtree(ti, ETT_BGP_MP_REACH_NLRI);
+ subtree3 = proto_item_add_subtree(ti, ett_bgp_mp_reach_nlri);
for (/*nothing*/; snpa > 0; snpa--) {
proto_tree_add_text(subtree3, p - pd + i + aoff + off, 1,
"SNPA length: ", p[i + aoff + off]);
"Network Layer Reachability Information (%u %s)",
alen, (alen == 1) ? "byte" : "bytes");
if (alen)
- subtree3 = proto_item_add_subtree(ti, ETT_BGP_MP_UNREACH_NLRI);
+ subtree3 = proto_item_add_subtree(ti, ett_bgp_mp_unreach_nlri);
while (alen > 0) {
int advance;
char buf[256];
alen -= 3;
aoff += 3;
if (alen > 0)
- subtree3 = proto_item_add_subtree(ti, ETT_BGP_MP_UNREACH_NLRI);
+ subtree3 = proto_item_add_subtree(ti, ett_bgp_mp_unreach_nlri);
while (alen > 0) {
int advance;
char buf[256];
(len == 1) ? "byte" : "bytes");
if (len > 0) {
- subtree = proto_item_add_subtree(ti, ETT_BGP_NLRI);
+ subtree = proto_item_add_subtree(ti, ett_bgp_nlri);
/* parse prefixes */
end = p + len;
if (tree) {
ti = proto_tree_add_text(tree, offset, END_OF_FRAME,
"Border Gateway Protocol");
- bgp_tree = proto_item_add_subtree(ti, ETT_BGP);
+ bgp_tree = proto_item_add_subtree(ti, ett_bgp);
p = &pd[offset];
l = END_OF_FRAME;
/* add a different tree for each message type */
switch (bgp.bgp_type) {
case BGP_OPEN:
- bgp1_tree = proto_item_add_subtree(ti, ETT_BGP_OPEN);
+ bgp1_tree = proto_item_add_subtree(ti, ett_bgp_open);
break;
case BGP_UPDATE:
- bgp1_tree = proto_item_add_subtree(ti, ETT_BGP_UPDATE);
+ bgp1_tree = proto_item_add_subtree(ti, ett_bgp_update);
break;
case BGP_NOTIFICATION:
- bgp1_tree = proto_item_add_subtree(ti, ETT_BGP_NOTIFICATION);
+ bgp1_tree = proto_item_add_subtree(ti, ett_bgp_notification);
break;
case BGP_KEEPALIVE:
- bgp1_tree = proto_item_add_subtree(ti, ETT_BGP);
+ bgp1_tree = proto_item_add_subtree(ti, ett_bgp);
break;
default:
- bgp1_tree = proto_item_add_subtree(ti, ETT_BGP);
+ bgp1_tree = proto_item_add_subtree(ti, ett_bgp);
break;
}
void
proto_register_bgp(void)
{
+ static gint *ett[] = {
+ &ett_bgp,
+ &ett_bgp_unfeas,
+ &ett_bgp_attrs,
+ &ett_bgp_attr,
+ &ett_bgp_attr_flags,
+ &ett_bgp_mp_reach_nlri,
+ &ett_bgp_mp_unreach_nlri,
+ &ett_bgp_nlri,
+ &ett_bgp_open,
+ &ett_bgp_update,
+ &ett_bgp_notification,
+ };
+
proto_bgp = proto_register_protocol("Border Gateway Protocol", "bgp");
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for BOOTP/DHCP packet disassembly
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-bootp.c,v 1.21 1999/10/12 06:20:02 gram Exp $
+ * $Id: packet-bootp.c,v 1.22 1999/11/16 11:42:27 guy Exp $
*
* The information used comes from:
* RFC 2132: DHCP Options and BOOTP Vendor Extensions
static int hf_bootp_file = -1;
static int hf_bootp_cookie = -1;
+static guint ett_bootp = -1;
+static guint ett_bootp_option = -1;
+
enum field_type { none, ipv4, string, toggle, yes_no, special, opaque,
time_in_secs,
val_u_byte, val_u_short, val_u_long,
vti = proto_tree_add_text(bp_tree, voff,
consumed, "Option %d: %s", code, text);
- v_tree = proto_item_add_subtree(vti, ETT_BOOTP_OPTION);
+ v_tree = proto_item_add_subtree(vti, ett_bootp_option);
for (i = voff + 2; i < voff + consumed; i += 8) {
proto_tree_add_text(v_tree, i, 8, "IP Address/Mask: %s/%s",
ip_to_str((guint8*)&pd[i]),
vti = proto_tree_add_text(bp_tree, voff,
consumed, "Option %d: %s", code, text);
- v_tree = proto_item_add_subtree(vti, ETT_BOOTP_OPTION);
+ v_tree = proto_item_add_subtree(vti, ett_bootp_option);
for (i = voff + 2; i < voff + consumed; i += 8) {
proto_tree_add_text(v_tree, i, 8,
"Destination IP Address/Router: %s/%s",
case 55:
vti = proto_tree_add_text(bp_tree, voff,
vlen + 2, "Option %d: %s", code, text);
- v_tree = proto_item_add_subtree(vti, ETT_BOOTP_OPTION);
+ v_tree = proto_item_add_subtree(vti, ett_bootp_option);
for (i = 0; i < vlen; i++) {
byte = pd[voff+2+i];
if (byte < NUM_OPT_INFOS) {
if (vlen == 7) {
vti = proto_tree_add_text(bp_tree, voff,
consumed, "Option %d: %s", code, text);
- v_tree = proto_item_add_subtree(vti, ETT_BOOTP_OPTION);
+ v_tree = proto_item_add_subtree(vti, ett_bootp_option);
proto_tree_add_text(v_tree, voff+2, 1,
"Hardware type: %s",
arphrdtype_to_str(pd[voff+2],
vti = proto_tree_add_text(bp_tree, voff,
consumed, "Option %d: %s", code, text);
- v_tree = proto_item_add_subtree(vti, ETT_BOOTP_OPTION);
+ v_tree = proto_item_add_subtree(vti, ett_bootp_option);
for (i = voff + 2; i < voff + consumed; i += 4) {
proto_tree_add_text(v_tree, i, 4, "IP Address: %s",
ip_to_str((guint8*)&pd[i]));
else {
vti = proto_tree_add_text(bp_tree, voff,
consumed, "Option %d: %s", code, text);
- v_tree = proto_item_add_subtree(vti, ETT_BOOTP_OPTION);
+ v_tree = proto_item_add_subtree(vti, ett_bootp_option);
for (i = voff + 2; i < voff + consumed; i += 2) {
proto_tree_add_text(v_tree, i, 4, "Value: %d",
pntohs(&pd[i]));
if (tree) {
ti = proto_tree_add_item(tree, proto_bootp, offset, END_OF_FRAME, NULL);
- bp_tree = proto_item_add_subtree(ti, ETT_BOOTP);
+ bp_tree = proto_item_add_subtree(ti, ett_bootp);
proto_tree_add_item_format(bp_tree, hf_bootp_type,
offset, 1,
{ "Magic cookie", "bootp.cookie", FT_IPv4, BASE_NONE, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_bootp,
+ &ett_bootp_option,
+ };
proto_bootp = proto_register_protocol("Bootstrap Protocol", "bootp");
proto_register_field_array(proto_bootp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-bootparams.c
* Routines for bootparams dissection
*
- * $Id: packet-bootparams.c,v 1.5 1999/11/15 17:16:50 nneul Exp $
+ * $Id: packet-bootparams.c,v 1.6 1999/11/16 11:42:27 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_bootparams_hostaddr = -1;
static int hf_bootparams_routeraddr = -1;
+static gint ett_bootparams = -1;
+
int dissect_bp_address(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree, int hfindex)
{
"Router Address", "bootparams.routeraddr", FT_IPv4, BASE_DEC,
NULL, 0, "Router Address" }},
};
+ static gint *ett[] = {
+ &ett_bootparams,
+ };
proto_bootparams = proto_register_protocol("Boot Parameters", "bootparams");
proto_register_field_array(proto_bootparams, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_bootparams, BOOTPARAMS_PROGRAM, ETT_BOOTPARAMS);
+ rpc_init_prog(proto_bootparams, BOOTPARAMS_PROGRAM, ett_bootparams);
/* Register the procedure tables */
rpc_init_proc_table(BOOTPARAMS_PROGRAM, 1, bootparams1_proc);
}
/* packet-bpdu.c
* Routines for BPDU (Spanning Tree Protocol) disassembly
*
- * $Id: packet-bpdu.c,v 1.5 1999/10/16 09:31:47 deniel Exp $
+ * $Id: packet-bpdu.c,v 1.6 1999/11/16 11:42:27 guy Exp $
*
* Copyright 1999 Christophe Tronche <ch.tronche@computer.org>
*
static int hf_bpdu_hello_time = -1;
static int hf_bpdu_forward_delay = -1;
+static gint ett_bpdu = -1;
+
void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
guint16 protocol_identifier;
guint8 protocol_version_identifier;
protocol_version_identifier = (guint8) bpdu[BPDU_VERSION_IDENTIFIER];
ti = proto_tree_add_item_format(tree, proto_bpdu, offset, 35, NULL, "Spanning Tree Protocol");
- bpdu_tree = proto_item_add_subtree(ti, ETT_BPDU);
+ bpdu_tree = proto_item_add_subtree(ti, ett_bpdu);
proto_tree_add_item_format(bpdu_tree, hf_bpdu_proto_id,
offset + BPDU_IDENTIFIER, 2,
protocol_identifier,
FT_DOUBLE, BASE_NONE, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_bpdu,
+ };
proto_bpdu = proto_register_protocol("Spanning Tree Protocol", "stp");
proto_register_field_array(proto_bpdu, hf, array_length(hf));
-
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for the disassembly of the "Cisco Discovery Protocol"
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-cdp.c,v 1.16 1999/10/16 14:27:00 deniel Exp $
+ * $Id: packet-cdp.c,v 1.17 1999/11/16 11:42:28 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_cdp_tlvtype = -1;
static int hf_cdp_tlvlength = -1;
+static gint ett_cdp = -1;
+static gint ett_cdp_tlv = -1;
+
static void
add_multi_line_string_to_tree(proto_tree *tree, gint start, gint len,
const gchar *prefix, const gchar *string);
if(tree){
ti = proto_tree_add_item(tree, proto_cdp, offset, END_OF_FRAME, NULL);
- cdp_tree = proto_item_add_subtree(ti, ETT_CDP);
+ cdp_tree = proto_item_add_subtree(ti, ett_cdp);
/* CDP header */
proto_tree_add_item(cdp_tree, hf_cdp_version, offset, 1, pd[offset]);
length + 4, "Type: %s, length: %u",
type_str, length);
tlv_tree = proto_item_add_subtree(tlvi,
- ETT_CDP_TLV);
+ ett_cdp_tlv);
proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
offset + TLV_TYPE, 2, type);
proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
length, "Chassis ID: %s",
&pd[offset+4]);
tlv_tree = proto_item_add_subtree(tlvi,
- ETT_CDP_TLV);
+ ett_cdp_tlv);
proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
offset + TLV_TYPE, 2, type);
proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
4, "Type: %u (unknown), second field: %u",
type, length);
tlv_tree = proto_item_add_subtree(tlvi,
- ETT_CDP_TLV);
+ ett_cdp_tlv);
proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
offset + TLV_TYPE, 2, type);
proto_tree_add_text(tlv_tree,
length, "Sent through Interface: %s",
&pd[offset+4]);
tlv_tree = proto_item_add_subtree(tlvi,
- ETT_CDP_TLV);
+ ett_cdp_tlv);
proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
offset + TLV_TYPE, 2, type);
proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
offset, length, "Platform: %s",
stringmem);
tlv_tree = proto_item_add_subtree(tlvi,
- ETT_CDP_TLV);
+ ett_cdp_tlv);
proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
offset + TLV_TYPE, 2, type);
proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
offset, length + 4, "Mgmt IP: %s",
ip_to_str(&pd[offset+4]));
tlv_tree = proto_item_add_subtree(tlvi,
- ETT_CDP_TLV);
+ ett_cdp_tlv);
proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
offset + TLV_TYPE, 2, type);
proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
length, "Type: %s, length: %u",
type_str, length);
tlv_tree = proto_item_add_subtree(tlvi,
- ETT_CDP_TLV);
+ ett_cdp_tlv);
proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
offset + TLV_TYPE, 2, type);
proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
{ "Length", "cdp.tlv.len", FT_UINT16, BASE_DEC, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_cdp,
+ &ett_cdp_tlv,
+ };
proto_cdp = proto_register_protocol("Cisco Discovery Protocol", "cdp");
proto_register_field_array(proto_cdp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-clip.c
* Routines for clip packet disassembly
*
- * $Id: packet-clip.c,v 1.2 1999/08/24 06:16:27 guy Exp $
+ * $Id: packet-clip.c,v 1.3 1999/11/16 11:42:28 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#include <glib.h>
#include "packet.h"
+static gint ett_clip = -1;
+
void
capture_clip( const u_char *pd, guint32 cap_len, packet_counts *ld ) {
header. */
if(tree) {
ti = proto_tree_add_text(tree, 0, 0, "Classical IP frame" );
- fh_tree = proto_item_add_subtree(ti, ETT_CLIP);
+ fh_tree = proto_item_add_subtree(ti, ett_clip);
proto_tree_add_text(fh_tree, 0, 0, "No link information available");
}
dissect_ip(pd, 0, fd, tree);
}
+
+void
+proto_register_clip(void)
+{
+ static gint *ett[] = {
+ &ett_clip,
+ };
+
+ proto_register_subtree_array(ett, array_length(ett));
+}
/* packet-dns.c
* Routines for DNS packet disassembly
*
- * $Id: packet-dns.c,v 1.28 1999/11/12 22:43:32 guy Exp $
+ * $Id: packet-dns.c,v 1.29 1999/11/16 11:42:28 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_dns_count_auth_rr = -1;
static int hf_dns_count_add_rr = -1;
+static gint ett_dns = -1;
+static gint ett_dns_qd = -1;
+static gint ett_dns_rr = -1;
+static gint ett_dns_qry = -1;
+static gint ett_dns_ans = -1;
+static gint ett_dns_flags = -1;
+
/* DNS structs and definitions */
/* Offsets of fields in the DNS header. */
if (dns_tree != NULL) {
tq = proto_tree_add_text(dns_tree, offset, len, "%s: type %s, class %s",
name, type_name, class_name);
- q_tree = proto_item_add_subtree(tq, ETT_DNS_QD);
+ q_tree = proto_item_add_subtree(tq, ett_dns_qd);
proto_tree_add_text(q_tree, offset, name_len, "Name: %s", name);
offset += name_len;
"%s: type %s, class %s, addr %s",
name, type_name, class_name,
ip_to_str((guint8 *)dptr));
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
if (!BYTES_ARE_IN_FRAME(cur_offset, 4)) {
/* We ran past the end of the captured data in the packet. */
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, ns %s",
name, type_name, class_name, ns_name);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
if (ns_name_len < 0) {
/* We ran past the end of the captured data in the packet. */
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, cname %s",
name, type_name, class_name, cname);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
if (cname_len < 0) {
/* We ran past the end of the captured data in the packet. */
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, mname %s",
name, type_name, class_name, mname);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
if (mname_len < 0) {
/* We ran past the end of the captured data in the packet. */
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, ptr %s",
name, type_name, class_name, pname);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
if (pname_len < 0) {
/* We ran past the end of the captured data in the packet. */
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, <CPU goes past end of captured data in packet>",
name, type_name, class_name);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
}
return 0;
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, <CPU goes past end of captured data in packet>",
name, type_name, class_name);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
}
return 0;
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, CPU %.*s, <OS goes past end of captured data in packet>",
name, type_name, class_name, cpu_len, &pd[cpu_offset + 1]);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
}
return 0;
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, CPU %*.s, <OS goes past end of captured data in packet>",
name, type_name, class_name, cpu_len, &pd[cpu_offset + 1]);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
}
return 0;
"%s: type %s, class %s, CPU %.*s, OS %.*s",
name, type_name, class_name,
cpu_len, &pd[cpu_offset + 1], os_len, &pd[os_offset + 1]);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
proto_tree_add_text(rr_tree, cpu_offset, 1 + cpu_len, "CPU: %.*s",
cpu_len, &pd[cpu_offset + 1]);
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, <preference goes past end of captured data in packet>",
name, type_name, class_name);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
}
return 0;
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, preference %u, <mx goes past end of captured data in packet>",
name, type_name, class_name, preference);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
}
return 0;
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s, preference %u, mx %s",
name, type_name, class_name, preference, mx_name);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
proto_tree_add_text(rr_tree, cur_offset, 2, "Preference: %u", preference);
proto_tree_add_text(rr_tree, cur_offset + 2, mx_name_len, "Mail exchange: %s",
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s",
name, type_name, class_name);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
if (!BYTES_ARE_IN_FRAME(cur_offset, 1)) {
/* We ran past the end of the captured data in the packet. */
trr = proto_tree_add_text(dns_tree, offset, (dptr - data_start) + data_len,
"%s: type %s, class %s",
name, type_name, class_name);
- rr_tree = add_rr_to_tree(trr, ETT_DNS_RR, offset, name, name_len,
+ rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
long_type_name, class_name, ttl, data_len);
proto_tree_add_text(rr_tree, cur_offset, data_len, "Data");
}
start_off = cur_off;
if (dns_tree) {
ti = proto_tree_add_text(dns_tree, start_off, 0, "Queries");
- qatree = proto_item_add_subtree(ti, ETT_DNS_QRY);
+ qatree = proto_item_add_subtree(ti, ett_dns_qry);
}
while (count-- > 0) {
add_off = dissect_dns_query(pd, cur_off, dns_data_offset, fd, qatree);
start_off = cur_off;
if (dns_tree) {
ti = proto_tree_add_text(dns_tree, start_off, 0, name);
- qatree = proto_item_add_subtree(ti, ETT_DNS_ANS);
+ qatree = proto_item_add_subtree(ti, ett_dns_ans);
}
while (count-- > 0) {
add_off = dissect_dns_answer(pd, cur_off, dns_data_offset, fd, qatree);
ti = proto_tree_add_item_format(tree, proto_dns, offset, 4, NULL,
(flags & F_RESPONSE) ? "DNS response" : "DNS query");
- dns_tree = proto_item_add_subtree(ti, ETT_DNS);
+ dns_tree = proto_item_add_subtree(ti, ett_dns);
if (flags & F_RESPONSE)
proto_tree_add_item_hidden(dns_tree, hf_dns_response, offset, 4, 1);
flags,
"Flags: 0x%04x (%s)",
flags, buf);
- field_tree = proto_item_add_subtree(tf, ETT_DNS_FLAGS);
+ field_tree = proto_item_add_subtree(tf, ett_dns_flags);
proto_tree_add_text(field_tree, offset + DNS_FLAGS, 2, "%s",
decode_boolean_bitfield(flags, F_RESPONSE,
2*8, "Response", "Query"));
FT_UINT16, BASE_DEC, NULL, 0x0,
"Number of additional records in packet" }}
};
+ static gint *ett[] = {
+ &ett_dns,
+ &ett_dns_qd,
+ &ett_dns_rr,
+ &ett_dns_qry,
+ &ett_dns_ans,
+ &ett_dns_flags,
+ };
proto_dns = proto_register_protocol("Domain Name Service", "dns");
proto_register_field_array(proto_dns, hf, array_length(hf));
-
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-eth.c
* Routines for ethernet packet disassembly
*
- * $Id: packet-eth.c,v 1.21 1999/10/22 07:17:31 guy Exp $
+ * $Id: packet-eth.c,v 1.22 1999/11/16 11:42:29 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_eth_len = -1;
static int hf_eth_type = -1;
+static gint ett_ieee8023 = -1;
+static gint ett_ether2 = -1;
+
#define ETH_HEADER_SIZE 14
/* These are the Netware-ish names for the different Ethernet frame types.
ti = proto_tree_add_item_format(tree, proto_eth, 0, ETH_HEADER_SIZE,
NULL, "IEEE 802.3 %s", (ethhdr_type == ETHERNET_802_3 ? "Raw " : ""));
- fh_tree = proto_item_add_subtree(ti, ETT_IEEE8023);
+ fh_tree = proto_item_add_subtree(ti, ett_ieee8023);
proto_tree_add_item(fh_tree, hf_eth_dst, 0, 6, &pd[offset+0]);
proto_tree_add_item(fh_tree, hf_eth_src, 6, 6, &pd[offset+6]);
ti = proto_tree_add_item_format(tree, proto_eth, 0, ETH_HEADER_SIZE,
NULL, "Ethernet II");
- fh_tree = proto_item_add_subtree(ti, ETT_ETHER2);
+ fh_tree = proto_item_add_subtree(ti, ett_ether2);
proto_tree_add_item_format(fh_tree, hf_eth_dst, 0, 6, &pd[offset+0],
"Destination: %s (%s)", ether_to_str((guint8 *) &pd[offset+0]),
{ "Type", "eth.type", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
"" }}
};
+ static gint *ett[] = {
+ &ett_ieee8023,
+ &ett_ether2,
+ };
proto_eth = proto_register_protocol ("Ethernet", "eth" );
proto_register_field_array(proto_eth, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
*
* Laurent Deniel <deniel@worldnet.fr>
*
- * $Id: packet-fddi.c,v 1.24 1999/10/22 07:17:31 guy Exp $
+ * $Id: packet-fddi.c,v 1.25 1999/11/16 11:42:30 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_fddi_dst = -1;
static int hf_fddi_src = -1;
+static gint ett_fddi = -1;
+
/* FDDI Frame Control values */
#define FDDI_FC_VOID 0x00 /* Void frame */
swap_mac_addr(dst_swapped, (u_char*)&pd[FDDI_P_DHOST]);
swap_mac_addr(src_swapped, (u_char*)&pd[FDDI_P_SHOST]);
- fh_tree = proto_item_add_subtree(ti, ETT_FDDI);
+ fh_tree = proto_item_add_subtree(ti, ett_fddi);
proto_tree_add_item(fh_tree, hf_fddi_fc, FDDI_P_FC, 1, fc);
proto_tree_add_item(fh_tree, hf_fddi_dst, FDDI_P_DHOST, 6, dst);
proto_tree_add_item(fh_tree, hf_fddi_src, FDDI_P_SHOST, 6, src);
{ "Source", "fddi.src", FT_ETHER, BASE_NONE, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_fddi,
+ };
proto_fddi = proto_register_protocol ("Fiber Distributed Data Interface", "fddi" );
proto_register_field_array(proto_fddi, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for ftp packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-ftp.c,v 1.9 1999/10/12 06:20:05 gram Exp $
+ * $Id: packet-ftp.c,v 1.10 1999/11/16 11:42:30 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_ftp_response_code = -1;
static int hf_ftp_response_data = -1;
+static gint ett_ftp = -1;
+
void
dissect_ftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
if (tree) {
ti = proto_tree_add_item(tree, proto_ftp, offset, END_OF_FRAME, NULL);
- ftp_tree = proto_item_add_subtree(ti, ETT_FTP);
+ ftp_tree = proto_item_add_subtree(ti, ett_ftp);
if (pi.match_port == pi.destport) { /* Request */
{ "Response data", "ftp.reponse.data", FT_STRING, BASE_NONE, NULL, 0x0,
"" }}
};
+ static gint *ett[] = {
+ &ett_ftp,
+ };
proto_ftp = proto_register_protocol("File Transfer Protocol", "ftp");
proto_register_field_array(proto_ftp, hf, array_length(hf));
-
+ proto_register_subtree_array(ett, array_length(ett));
}
*
* Laurent Deniel <deniel@worldnet.fr>
*
- * $Id: packet-giop.c,v 1.9 1999/10/16 19:50:19 deniel Exp $
+ * $Id: packet-giop.c,v 1.10 1999/11/16 11:42:30 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_giop_message_type = -1;
static int hf_giop_message_size = -1;
+static gint ett_giop = -1;
+
/*
* GIOP / IIOP types definition - OMG CORBA 2.x / GIOP 1.[01]
* See OMG WEB site <http://www.omg.org> - CORBA+IIOP 2.2 (98-02-01.ps)
if (tree) {
ti = proto_tree_add_item(tree, proto_giop, offset,
GIOP_HEADER_SIZE + message_size, NULL);
- clnp_tree = proto_item_add_subtree(ti, ETT_GIOP);
+ clnp_tree = proto_item_add_subtree(ti, ett_giop);
proto_tree_add_text(clnp_tree, offset, 4,
"Magic number: %s", GIOP_MAGIC);
proto_tree_add_text(clnp_tree, offset + 4, 2,
{ "Message size", "giop.len", FT_UINT32, BASE_DEC, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_giop,
+ };
proto_giop = proto_register_protocol("General Inter-ORB Protocol", "giop");
proto_register_field_array(proto_giop, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for the Generic Routing Encapsulation (GRE) protocol
* Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
*
- * $Id: packet-gre.c,v 1.6 1999/09/17 05:56:54 guy Exp $
+ * $Id: packet-gre.c,v 1.7 1999/11/16 11:42:31 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_gre = -1;
+static gint ett_gre = -1;
+static gint ett_gre_flags = -1;
+
/* bit positions for flags in header */
#define GH_B_C 0x8000
#define GH_B_R 0x4000
is_ppp = 1;
ti = proto_tree_add_item_format(tree, proto_gre, offset, calc_len(flags_and_ver, 1),
NULL, "Generic Routing Encapsulation (PPP)");
- gre_tree = proto_item_add_subtree(ti, ETT_GRE);
+ gre_tree = proto_item_add_subtree(ti, ett_gre);
add_flags_and_ver(gre_tree, flags_and_ver, offset, 1);
}
else {
is_ppp = 0;
ti = proto_tree_add_item(tree, proto_gre, offset, calc_len(flags_and_ver, 1), NULL);
- gre_tree = proto_item_add_subtree(ti, ETT_GRE);
+ gre_tree = proto_item_add_subtree(ti, ett_gre);
add_flags_and_ver(gre_tree, flags_and_ver, offset, 0);
}
ti = proto_tree_add_text(tree, offset, 2,
"Flags and version: %#08x", flags_and_ver);
- fv_tree = proto_item_add_subtree(ti, ETT_GRE_FLAGS);
+ fv_tree = proto_item_add_subtree(ti, ett_gre_flags);
proto_tree_add_text(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_boolean_bitfield(flags_and_ver, GH_B_C, nbits,
{ &variable,
{ "Name", "gre.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_gre,
+ };
proto_gre = proto_register_protocol("Generic Routing Encapsulation", "gre");
/* proto_register_field_array(proto_gre, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
*
* Guy Harris <guy@netapp.com>
*
- * $Id: packet-http.c,v 1.10 1999/10/16 20:30:14 deniel Exp $
+ * $Id: packet-http.c,v 1.11 1999/11/16 11:42:31 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_http_response = -1;
static int hf_http_request = -1;
+static gint ett_http = -1;
+
static proto_tree *http_tree;
static int is_http_request_or_reply(const u_char *data, int linelen);
if (tree) {
ti = proto_tree_add_item(tree, proto_http, offset, END_OF_FRAME, NULL);
- http_tree = proto_item_add_subtree(ti, ETT_HTTP);
+ http_tree = proto_item_add_subtree(ti, ett_http);
while (data < dataend) {
/*
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"TRUE if HTTP request (GET, PUT, HEAD, POST)" }},
};
+ static gint *ett[] = {
+ &ett_http,
+ };
proto_http = proto_register_protocol("Hypertext Transfer Protocol", "http");
proto_register_field_array(proto_http, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-icmpv6.c
* Routines for ICMPv6 packet disassembly
*
- * $Id: packet-icmpv6.c,v 1.10 1999/10/16 20:41:37 deniel Exp $
+ * $Id: packet-icmpv6.c,v 1.11 1999/11/16 11:42:31 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_icmpv6_code = -1;
static int hf_icmpv6_checksum = -1;
+static gint ett_icmpv6 = -1;
+static gint ett_icmpv6opt = -1;
+static gint ett_icmpv6flag = -1;
+
static void
dissect_icmpv6opt(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
/* !!! specify length */
ti = proto_tree_add_text(tree, offset, len, "ICMPv6 options");
- icmp6opt_tree = proto_item_add_subtree(ti, ETT_ICMPv6OPT);
+ icmp6opt_tree = proto_item_add_subtree(ti, ett_icmpv6opt);
switch (opt->nd_opt_type) {
case ND_OPT_SOURCE_LINKADDR:
flagoff = offsetof(struct nd_opt_prefix_info, nd_opt_pi_flags_reserved);
tf = proto_tree_add_text(icmp6opt_tree, flagoff, 1, "Flags: 0x%02x",
pntohl(&pi->nd_opt_pi_flags_reserved));
- field_tree = proto_item_add_subtree(tf, ETT_ICMPv6FLAG);
+ field_tree = proto_item_add_subtree(tf, ett_icmpv6flag);
proto_tree_add_text(field_tree, flagoff, 1, "%s",
decode_boolean_bitfield(pi->nd_opt_pi_flags_reserved,
0x80, 8, "Onlink", "Not onlink"));
if (tree) {
/* !!! specify length */
ti = proto_tree_add_item(tree, proto_icmpv6, offset, len, NULL);
- icmp6_tree = proto_item_add_subtree(ti, ETT_ICMPv6);
+ icmp6_tree = proto_item_add_subtree(ti, ett_icmpv6);
proto_tree_add_item_format(icmp6_tree, hf_icmpv6_type,
offset + offsetof(struct icmp6_hdr, icmp6_type), 1,
flagoff = offset + offsetof(struct nd_router_advert, nd_ra_flags_reserved);
ra_flags = pntohl(&pd[flagoff]);
tf = proto_tree_add_text(icmp6_tree, flagoff, 4, "Flags: 0x%08x", ra_flags);
- field_tree = proto_item_add_subtree(tf, ETT_ICMPv6FLAG);
+ field_tree = proto_item_add_subtree(tf, ett_icmpv6flag);
proto_tree_add_text(field_tree, flagoff, 4, "%s",
decode_boolean_bitfield(ra_flags,
0x80000000, 32, "Managed", "Not managed"));
na_flags = pntohl(&pd[flagoff]);
tf = proto_tree_add_text(icmp6_tree, flagoff, 4, "Flags: 0x%08x", na_flags);
- field_tree = proto_item_add_subtree(tf, ETT_ICMPv6FLAG);
+ field_tree = proto_item_add_subtree(tf, ett_icmpv6flag);
proto_tree_add_text(field_tree, flagoff, 4, "%s",
decode_boolean_bitfield(na_flags,
0x80000000, 32, "Router", "Not router"));
flagoff = offset + offsetof(struct icmp6_router_renum, rr_segnum) + 1;
tf = proto_tree_add_text(icmp6_tree, flagoff, 4, "Flags: 0x%08x",
pd[flagoff]);
- field_tree = proto_item_add_subtree(tf, ETT_ICMPv6FLAG);
+ field_tree = proto_item_add_subtree(tf, ett_icmpv6flag);
proto_tree_add_text(field_tree, flagoff, 1, "%s",
decode_boolean_bitfield(pd[flagoff], 0x80, 8,
"Test command", "Not test command"));
{ "Checksum", "icmpv6.checksum", FT_UINT16, BASE_HEX, NULL, 0x0,
"" }}
};
+ static gint *ett[] = {
+ &ett_icmpv6,
+ &ett_icmpv6opt,
+ &ett_icmpv6flag,
+ };
proto_icmpv6 = proto_register_protocol("Internet Control Message Protocol v6",
"icmpv6");
proto_register_field_array(proto_icmpv6, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-icp.c
- * Routines for ICP (internet cache protocol) packet disassembly RFC 2186 && RFC 2187
- *
+ * Routines for ICP (internet cache protocol) packet disassembly
+ * RFC 2186 && RFC 2187
*
- * $Id: packet-icp.c,v 1.2 1999/10/12 06:20:07 gram Exp $
+ * $Id: packet-icp.c,v 1.3 1999/11/16 11:42:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Peter Torvals
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-int proto_icp=-1;
-int hf_icp_length=-1;
-int hf_icp_opcode=-1;
-int hf_icp_version=-1;
-int hf_icp_request_nr=-1;
-
-
#define MAX_TEXTBUF_LENGTH 600
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "packet.h"
#include "resolv.h"
+static int proto_icp=-1;
+static int hf_icp_length=-1;
+static int hf_icp_opcode=-1;
+static int hf_icp_version=-1;
+static int hf_icp_request_nr=-1;
+
+static gint ett_icp = -1;
+static gint ett_icp_payload = -1;
+
#define CODE_ICP_OP_QUERY 1
#define CODE_ICP_OP_INVALID 0
#define CODE_ICP_OP_HIT 2
ti = proto_tree_add_item(tree,proto_icp ,offset,fd->pkt_len-offset,
NULL);
- icp_tree = proto_item_add_subtree(ti, ETT_ICP);
+ icp_tree = proto_item_add_subtree(ti, ett_icp);
proto_tree_add_item_format(icp_tree,hf_icp_opcode, offset, 1,
icph.opcode, "Opcode:0x%01x (%s)",icph.opcode, opcodestrval);
payloadtf = proto_tree_add_text(icp_tree,
offset+20,icph.message_length - 20,
"Payload");
- payload_tree = proto_item_add_subtree(payloadtf, ETT_ICP_PAYLOAD);
+ payload_tree = proto_item_add_subtree(payloadtf, ett_icp_payload);
if (payload_tree !=NULL)
{
{ "Request Number","icp.nr", FT_UINT32, BASE_DEC, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_icp,
+ &ett_icp_payload,
+ };
proto_icp = proto_register_protocol ("Internet Cache protocol", "icp");
proto_register_field_array(proto_icp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-icq.c
* Routines for ICQ packet disassembly
*
- * $Id: packet-icq.c,v 1.5 1999/11/06 03:08:33 guy Exp $
+ * $Id: packet-icq.c,v 1.6 1999/11/16 11:42:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Johan Feyaerts
#include "packet.h"
#include "resolv.h"
-int proto_icq = -1;
-int hf_icq_uin =-1;
-int hf_icq_cmd =-1;
-int hf_icq_sessionid =-1;
-int hf_icq_checkcode =-1;
-int hf_icq_decode = -1;
-int hf_icq_type = -1;
+static int proto_icq = -1;
+static int hf_icq_uin =-1;
+static int hf_icq_cmd =-1;
+static int hf_icq_sessionid =-1;
+static int hf_icq_checkcode =-1;
+static int hf_icq_decode = -1;
+static int hf_icq_type = -1;
+
+static gint ett_icq = -1;
+static gint ett_icq_header = -1;
+static gint ett_icq_decode = -1;
+static gint ett_icq_body = -1;
+static gint ett_icq_body_parts = -1;
enum { ICQ5_client, ICQ5_server};
2,
"Type: %d (%s)", msgType, findMsgType(msgType));
/* Create a new subtree */
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY_PARTS);
+ subtree = proto_item_add_subtree(ti, ett_icq_body_parts);
switch(msgType) {
case 0xffff: /* Field unknown */
u_char* msgText2 = NULL;
msgText = NULL;
/* Create a new subtree */
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY_PARTS);
+ subtree = proto_item_add_subtree(ti, ett_icq_body_parts);
while (p!=NULL) {
p = strnchr(pprev, 0xfe, left);
4,
CMD_ACK,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + CMD_ACK_RANDOM,
4,
4,
CMD_RAND_SEARCH,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
if (group>0 && (group<=sizeof(groups)/sizeof(const char*)))
proto_tree_add_text(subtree,
offset + CMD_RAND_SEARCH_GROUP,
4,
CMD_ACK_MESSAGES,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + CMD_ACK_MESSAGES_RANDOM,
4,
4,
CMD_KEEP_ALIVE,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + CMD_KEEP_ALIVE_RANDOM,
4,
left,
CMD_KEEP_ALIVE,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + CMD_SEND_TEXT_CODE_LEN,
2,
4,
CMD_ADD_TO_LIST,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + CMD_ADD_TO_LIST_UIN,
4,
offset,
4,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
if (status!=-1)
proto_tree_add_text(subtree,
offset + CMD_STATUS_CHANGE_STATUS,
size,
CMD_SEND_MSG,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + CMD_SEND_MSG_RECV_UIN,
4,
size,
CMD_SEND_MSG,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
if (theTime!=-1)
proto_tree_add_text(subtree,
offset + CMD_LOGIN_TIME,
size,
CMD_CONTACT_LIST,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + CMD_CONTACT_LIST,
1,
0,
cmd,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset,
0,
0,
cmd,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset,
0,
SRV_LOGIN_REPLY_IP + 8,
SRV_LOGIN_REPLY,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + SRV_LOGIN_REPLY_IP,
4,
SRV_LOGIN_REPLY_IP + 8,
SRV_LOGIN_REPLY,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + SRV_USER_ONL_UIN,
4,
SRV_USER_OFFLINE_UIN + 4,
SRV_USER_OFFLINE,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + SRV_USER_OFFLINE_UIN,
4,
size,
SRV_MULTI,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
proto_tree_add_text(subtree,
offset + SRV_MULTI_NUM,
1,
size,
SRV_META_USER,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
ti = proto_tree_add_text(subtree,
offset + SRV_META_USER_SUBCMD,
2,
int len = 0;
guint16 x2 = -1;
guint32 x3 = -1;
- proto_tree* sstree = proto_item_add_subtree(ti, ETT_ICQ_BODY_PARTS);
+ proto_tree* sstree = proto_item_add_subtree(ti, ett_icq_body_parts);
/* Skip over META_USER header */
left -= 3;
{
int len;
char* about = NULL;
- proto_tree* sstree = proto_item_add_subtree(ti, ETT_ICQ_BODY_PARTS);
+ proto_tree* sstree = proto_item_add_subtree(ti, ett_icq_body_parts);
/* Skip over META_USER header */
left -= 3;
unsigned char user_timezone = -1;
unsigned char auth = -1;
int len = 0;
- proto_tree* sstree = proto_item_add_subtree(ti, ETT_ICQ_BODY_PARTS);
+ proto_tree* sstree = proto_item_add_subtree(ti, ett_icq_body_parts);
/* Skip over META_USER header */
left -= 3;
4,
SRV_RECV_MESSAGE,
"Body");
- subtree = proto_item_add_subtree(ti, ETT_ICQ_BODY);
+ subtree = proto_item_add_subtree(ti, ett_icq_body);
if (left>=sizeof(guint32)) {
uin = pletohl(pd + SRV_RECV_MSG_UIN);
proto_tree_add_item_format(subtree,
"ICQv5 %s (len %d)",
findClientCmd(cmd),
pktsize);
- icq_tree = proto_item_add_subtree(ti, ETT_ICQ);
+ icq_tree = proto_item_add_subtree(ti, ett_icq);
ti = proto_tree_add_item_format(icq_tree,
hf_icq_type,
offset,
ICQ5_CL_HDRSIZE,
ICQ5_client,
"Header");
- icq_header_tree = proto_item_add_subtree(ti, ETT_ICQ_HEADER);
+ icq_header_tree = proto_item_add_subtree(ti, ett_icq_header);
proto_tree_add_item_format(icq_header_tree,
hf_icq_sessionid,
pktsize,
"Decoded packet");
icq_decode_tree = proto_item_add_subtree(ti,
- ETT_ICQ_DECODE);
+ ett_icq_decode);
proto_tree_add_hexdump(icq_decode_tree, offset, decr_pd, pktsize);
}
findServerCmd(cmd),
pktsize);
- icq_tree = proto_item_add_subtree(ti, ETT_ICQ);
+ icq_tree = proto_item_add_subtree(ti, ett_icq);
ti = proto_tree_add_item_format(icq_tree,
hf_icq_type,
ICQ5_SRV_HDRSIZE,
ICQ5_server,
"Header");
- icq_header_tree = proto_item_add_subtree(ti, ETT_ICQ_HEADER);
+ icq_header_tree = proto_item_add_subtree(ti, ett_icq_header);
proto_tree_add_item_format(icq_header_tree,
hf_icq_sessionid,
pktsize,
"Decoded packet");
icq_decode_tree = proto_item_add_subtree(ti,
- ETT_ICQ_DECODE);
+ ett_icq_decode);
proto_tree_add_hexdump(icq_decode_tree, offset, decr_pd, pktsize);
}
}
{ &hf_icq_decode,
{"Decode", "icq.decode", FT_STRING, BASE_NONE, NULL, 0x0, ""}}
};
+ static gint *ett[] = {
+ &ett_icq,
+ &ett_icq_header,
+ &ett_icq_decode,
+ &ett_icq_body,
+ &ett_icq_body_parts,
+ };
proto_icq = proto_register_protocol ("ICQ Protocol", "icq");
proto_register_field_array(proto_icq, hf, array_length(hf));
+
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for imap packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-imap.c,v 1.2 1999/11/14 10:48:17 deniel Exp $
+ * $Id: packet-imap.c,v 1.3 1999/11/16 11:42:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_imap_response = -1;
static int hf_imap_request = -1;
+static gint ett_imap = -1;
+
void
dissect_imap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
if (tree) {
ti = proto_tree_add_item(tree, proto_imap, offset, END_OF_FRAME, NULL);
- imap_tree = proto_item_add_subtree(ti, ETT_IMAP);
+ imap_tree = proto_item_add_subtree(ti, ett_imap);
if (pi.match_port == pi.destport) { /* Request */
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"TRUE if IMAP request" }}
};
+ static gint *ett[] = {
+ &ett_imap,
+ };
proto_imap = proto_register_protocol("Internet Message Access Protocol",
"imap");
proto_register_field_array(proto_imap, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
- * $Id: packet-ip.c,v 1.61 1999/11/02 07:06:07 guy Exp $
+ * $Id: packet-ip.c,v 1.62 1999/11/16 11:42:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_ip_proto = -1;
static int hf_ip_checksum = -1;
+static gint ett_ip = -1;
+static gint ett_ip_tos = -1;
+static gint ett_ip_off = -1;
+static gint ett_ip_options = -1;
+static gint ett_ip_option_sec = -1;
+static gint ett_ip_option_route = -1;
+static gint ett_ip_option_timestamp = -1;
+
static int proto_igmp = -1;
static int hf_igmp_version = -1;
static int hf_igmp_type = -1;
static int hf_igmp_checksum = -1;
static int hf_igmp_group = -1;
+static gint ett_igmp = -1;
+
static int proto_icmp = -1;
static int hf_icmp_type = -1;
static int hf_icmp_code = -1;
static int hf_icmp_checksum = -1;
+static gint ett_icmp = -1;
+
/* ICMP structs and definitions */
typedef struct _e_icmp {
guint8 icmp_type;
{0, NULL } };
tf = proto_tree_add_text(opt_tree, offset, optlen, "%s:", optp->name);
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
offset += 2;
val = pntohs(opd);
tf = proto_tree_add_text(opt_tree, offset, optlen, "%s (%d bytes)",
optp->name, optlen);
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
optoffset += 2; /* skip past type and length */
optlen -= 2; /* subtract size of type and length */
guint ts;
tf = proto_tree_add_text(opt_tree, offset, optlen, "%s:", optp->name);
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
optoffset += 2; /* skip past type and length */
optlen -= 2; /* subtract size of type and length */
{
IPOPT_END,
"EOL",
- -1,
+ NULL,
NO_LENGTH,
0,
NULL,
{
IPOPT_NOOP,
"NOP",
- -1,
+ NULL,
NO_LENGTH,
0,
NULL,
{
IPOPT_SEC,
"Security",
- ETT_IP_OPTION_SEC,
+ &ett_ip_option_sec,
FIXED_LENGTH,
IPOLEN_SEC,
dissect_ipopt_security
{
IPOPT_SSRR,
"Strict source route",
- ETT_IP_OPTION_ROUTE,
+ &ett_ip_option_route,
VARIABLE_LENGTH,
IPOLEN_SSRR_MIN,
dissect_ipopt_route
{
IPOPT_LSRR,
"Loose source route",
- ETT_IP_OPTION_ROUTE,
+ &ett_ip_option_route,
VARIABLE_LENGTH,
IPOLEN_LSRR_MIN,
dissect_ipopt_route
{
IPOPT_RR,
"Record route",
- ETT_IP_OPTION_ROUTE,
+ &ett_ip_option_route,
VARIABLE_LENGTH,
IPOLEN_RR_MIN,
dissect_ipopt_route
{
IPOPT_SID,
"Stream identifier",
- -1,
+ NULL,
FIXED_LENGTH,
IPOLEN_SID,
dissect_ipopt_sid
{
IPOPT_TIMESTAMP,
"Time stamp",
- ETT_IP_OPTION_TIMESTAMP,
+ &ett_ip_option_timestamp,
VARIABLE_LENGTH,
IPOLEN_TIMESTAMP_MIN,
dissect_ipopt_timestamp
}
ti = proto_tree_add_item(tree, proto_ip, offset, hlen, NULL);
- ip_tree = proto_item_add_subtree(ti, ETT_IP);
+ ip_tree = proto_item_add_subtree(ti, ett_ip);
proto_tree_add_item(ip_tree, hf_ip_version, offset, 1, hi_nibble(iph.ip_v_hl));
proto_tree_add_item_format(ip_tree, hf_ip_hdr_len, offset, 1, hlen,
"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);
+ field_tree = proto_item_add_subtree(tf, ett_ip_tos);
proto_tree_add_item(field_tree, hf_ip_tos_precedence, offset + 1, 1, iph.ip_tos);
proto_tree_add_item(field_tree, hf_ip_tos_delay, offset + 1, 1, iph.ip_tos);
proto_tree_add_item(field_tree, hf_ip_tos_throughput, offset + 1, 1, iph.ip_tos);
flags = (iph.ip_off & (IP_DF|IP_MF)) >> 12;
tf = proto_tree_add_item(ip_tree, hf_ip_flags, offset + 6, 1, flags);
- field_tree = proto_item_add_subtree(tf, ETT_IP_OFF);
+ field_tree = proto_item_add_subtree(tf, ett_ip_off);
proto_tree_add_item(field_tree, hf_ip_flags_df, offset + 6, 1, flags),
proto_tree_add_item(field_tree, hf_ip_flags_mf, offset + 6, 1, flags),
optlen = hlen - sizeof (e_ip); /* length of options, in bytes */
tf = proto_tree_add_text(ip_tree, offset + 20, optlen,
"Options: (%d bytes)", optlen);
- field_tree = proto_item_add_subtree(tf, ETT_IP_OPTIONS);
+ field_tree = proto_item_add_subtree(tf, ett_ip_options);
dissect_ip_tcp_options(&pd[offset + 20], offset + 20, optlen,
ipopts, N_IP_OPTS, IPOPT_END, field_tree);
}
if (tree) {
ti = proto_tree_add_item(tree, proto_icmp, offset, 4, NULL);
- icmp_tree = proto_item_add_subtree(ti, ETT_ICMP);
+ icmp_tree = proto_item_add_subtree(ti, ett_icmp);
proto_tree_add_item_format(icmp_tree, hf_icmp_type, offset, 1,
ih.icmp_type,
"Type: %d (%s)",
col_add_str(fd, COL_INFO, type_str);
if (tree) {
ti = proto_tree_add_item(tree, proto_igmp, offset, 8, NULL);
- igmp_tree = proto_item_add_subtree(ti, ETT_IGMP);
+ igmp_tree = proto_item_add_subtree(ti, ett_igmp);
proto_tree_add_item(igmp_tree, hf_igmp_version, offset, 1,
hi_nibble(ih.igmp_v_t));
proto_tree_add_item_format(igmp_tree, hf_igmp_type, offset , 1,
{ "Group address", "igmp.group", FT_IPv4, BASE_NONE, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_igmp,
+ };
proto_igmp = proto_register_protocol ("Internet Group Management Protocol", "igmp");
proto_register_field_array(proto_igmp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
void
{ "Header checksum", "ip.checksum", FT_UINT16, BASE_HEX, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_ip,
+ &ett_ip_tos,
+ &ett_ip_off,
+ &ett_ip_options,
+ &ett_ip_option_sec,
+ &ett_ip_option_route,
+ &ett_ip_option_timestamp,
+ };
proto_ip = proto_register_protocol ("Internet Protocol", "ip");
proto_register_field_array(proto_ip, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
void
{ "Checksum", "icmp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_icmp,
+ };
proto_icmp = proto_register_protocol ("Internet Control Message Protocol",
"icmp");
proto_register_field_array(proto_icmp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
static int proto_eigrp = -1;
+static gint ett_eigrp = -1;
+
void
dissect_eigrp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
e_eigrp ih;
if (tree) {
ti = proto_tree_add_item(tree, proto_eigrp, offset, END_OF_FRAME, NULL);
- eigrp_tree = proto_item_add_subtree(ti, ETT_RIP);
+ eigrp_tree = proto_item_add_subtree(ti, ett_eigrp);
proto_tree_add_text(eigrp_tree, offset, 1, "Version: %d", ih.eigrp_version);
proto_tree_add_text(eigrp_tree, offset + 1, 1, "Opcode: %d (%s)", ih.eigrp_opcode,
void
proto_register_eigrp(void)
{
+ static gint *ett[] = {
+ &ett_eigrp,
+ };
proto_eigrp = proto_register_protocol("Enhanced Interior Gateway Routing Protocol", "eigrp");
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-ip.h
* Definitions for IP packet disassembly structures and routines
*
- * $Id: packet-ip.h,v 1.7 1999/10/30 06:10:32 guy Exp $
+ * $Id: packet-ip.h,v 1.8 1999/11/16 11:42:34 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
/* Member of table of IP or TCP options. */
typedef struct ip_tcp_opt {
int optcode; /* code for option */
- char *name; /* name of option */
- int subtree_index; /* ETT_ value for option */
+ char *name; /* name of option */
+ int *subtree_index; /* pointer to subtree index for option */
opt_len_type len_type; /* type of option length field */
int optlen; /* value length should be (minimum if VARIABLE) */
void (*dissect)(const struct ip_tcp_opt *, const u_char *, int, guint, proto_tree *);
*
* Guy Harris <guy@netapp.com>
*
- * $Id: packet-ipp.c,v 1.2 1999/09/17 06:25:41 guy Exp $
+ * $Id: packet-ipp.c,v 1.3 1999/11/16 11:42:35 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int proto_ipp = -1;
+static gint ett_ipp = -1;
+static gint ett_ipp_as = -1;
+static gint ett_ipp_attr = -1;
+
#define PRINT_JOB 0x0002
#define PRINT_URI 0x0003
#define VALIDATE_JOB 0x0004
if (tree) {
ti = proto_tree_add_item(tree, proto_ipp, offset, END_OF_FRAME, NULL);
- ipp_tree = proto_item_add_subtree(ti, ETT_IPP);
+ ipp_tree = proto_item_add_subtree(ti, ett_ipp);
proto_tree_add_text(ipp_tree, offset, 2, "Version: %u.%u",
pd[offset], pd[offset + 1]);
* a tree.
*/
as_tree = proto_item_add_subtree(tas,
- ETT_IPP_AS);
+ ett_ipp_as);
attr_tree = as_tree;
}
name_length, &pd[offset + 1 + 2],
pntohl(&pd[1 + 2 + name_length + 2]));
}
- return proto_item_add_subtree(ti, ETT_IPP_ATTR);
+ return proto_item_add_subtree(ti, ett_ipp_attr);
}
static void
name_length,
&pd[offset + 1 + 2]);
bytes_to_str(&pd[offset + 1 + 2 + name_length + 2], value_length);
- return proto_item_add_subtree(ti, ETT_IPP_ATTR);
+ return proto_item_add_subtree(ti, ett_ipp_attr);
}
static void
"%.*s: %.*s",
name_length, &pd[offset + 1 + 2],
value_length, &pd[offset + 1 + 2 + name_length + 2]);
- return proto_item_add_subtree(ti, ETT_IPP_ATTR);
+ return proto_item_add_subtree(ti, ett_ipp_attr);
}
static void
{ &variable,
{ "Name", "ipp.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_ipp,
+ &ett_ipp_as,
+ &ett_ipp_attr,
+ };
proto_ipp = proto_register_protocol("Internet Printing Protocol", "ipp");
/* proto_register_field_array(proto_ipp, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-ipsec.c
* Routines for IPsec/IPComp packet disassembly
*
- * $Id: packet-ipsec.c,v 1.9 1999/10/17 08:33:23 deniel Exp $
+ * $Id: packet-ipsec.c,v 1.10 1999/11/16 11:42:35 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_ipcomp_flags = -1;
static int hf_ipcomp_cpi = -1;
+static gint ett_ah = -1;
+static gint ett_esp = -1;
+static gint ett_ipcomp = -1;
+
struct newah {
guint8 ah_nxt; /* Next Header */
guint8 ah_len; /* Length of data + 1, in 32bit */
if (tree) {
/* !!! specify length */
ti = proto_tree_add_item(tree, proto_ah, offset, advance, NULL);
- ah_tree = proto_item_add_subtree(ti, ETT_AH);
+ ah_tree = proto_item_add_subtree(ti, ett_ah);
proto_tree_add_text(ah_tree, offset + offsetof(struct newah, ah_nxt), 1,
"Next Header: %s (0x%02x)", ipprotostr(ah.ah_nxt), ah.ah_nxt);
*/
if(tree) {
ti = proto_tree_add_item(tree, proto_esp, offset, END_OF_FRAME, NULL);
- esp_tree = proto_item_add_subtree(ti, ETT_ESP);
+ esp_tree = proto_item_add_subtree(ti, ett_esp);
proto_tree_add_item(esp_tree, hf_esp_spi,
offset + offsetof(struct newesp, esp_spi), 4,
(guint32)ntohl(esp.esp_spi));
if (tree) {
ti = proto_tree_add_item(tree, proto_ipcomp, offset, END_OF_FRAME,
NULL);
- ipcomp_tree = proto_item_add_subtree(ti, ETT_IPCOMP);
+ ipcomp_tree = proto_item_add_subtree(ti, ett_ipcomp);
proto_tree_add_text(ipcomp_tree,
offset + offsetof(struct ipcomp, comp_nxt), 1,
{ "CPI", "ipcomp.cpi", FT_UINT16, BASE_HEX, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_ah,
+ &ett_esp,
+ &ett_ipcomp,
+ };
proto_ah = proto_register_protocol("Authentication Header", "ah");
proto_register_field_array(proto_ah, hf_ah, array_length(hf_ah));
proto_ipcomp = proto_register_protocol("IP Payload Compression", "ipcomp");
proto_register_field_array(proto_ipcomp, hf_ipcomp, array_length(hf_ipcomp));
+
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-ipv6.c
* Routines for IPv6 packet disassembly
*
- * $Id: packet-ipv6.c,v 1.24 1999/10/22 07:17:32 guy Exp $
+ * $Id: packet-ipv6.c,v 1.25 1999/11/16 11:42:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_ipv6_final = -1;
#endif
+static gint ett_ipv6 = -1;
+
#ifndef offsetof
#define offsetof(type, member) ((size_t)(&((type *)0)->member))
#endif
/* !!! specify length */
ti = proto_tree_add_text(tree, offset, len,
"Routing Header, Type %d", rt.ip6r_type);
- rthdr_tree = proto_item_add_subtree(ti, ETT_IPv6);
+ rthdr_tree = proto_item_add_subtree(ti, ett_ipv6);
proto_tree_add_text(rthdr_tree,
offset + offsetof(struct ip6_rthdr, ip6r_nxt), 1,
/* !!! specify length */
ti = proto_tree_add_text(tree, offset, len,
"%s Header", optname);
- dstopt_tree = proto_item_add_subtree(ti, ETT_IPv6);
+ dstopt_tree = proto_item_add_subtree(ti, ett_ipv6);
proto_tree_add_text(dstopt_tree,
offset + offsetof(struct ip6_ext, ip6e_nxt), 1,
if (tree) {
/* !!! specify length */
ti = proto_tree_add_item(tree, proto_ipv6, offset, 40, NULL);
- ipv6_tree = proto_item_add_subtree(ti, ETT_IPv6);
+ 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,
FT_UINT8, BASE_HEX, NULL, 0x0, "" }},
#endif
};
+ static gint *ett[] = {
+ &ett_ipv6,
+ };
proto_ipv6 = proto_register_protocol("Internet Protocol Version 6", "ipv6");
proto_register_field_array(proto_ipv6, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for NetWare's IPX
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-ipx.c,v 1.31 1999/11/15 21:33:56 nneul Exp $
+ * $Id: packet-ipx.c,v 1.32 1999/11/16 11:42:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_ipx_snode = -1;
static int hf_ipx_ssocket = -1;
+static gint ett_ipx = -1;
+
static int proto_spx = -1;
static int hf_spx_connection_control = -1;
static int hf_spx_datastream_type = -1;
static int hf_spx_ack_nr = -1;
static int hf_spx_all_nr = -1;
+static gint ett_spx = -1;
+
static int proto_ipxrip = -1;
static int hf_ipxrip_request = -1;
static int hf_ipxrip_response = -1;
+static gint ett_ipxrip = -1;
+
static int proto_sap = -1;
static int hf_sap_request = -1;
static int hf_sap_response = -1;
+static gint ett_ipxsap = -1;
+static gint ett_ipxsap_server = -1;
+
static void
dissect_spx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree);
ipx_hops = pd[offset+4];
ti = proto_tree_add_item(tree, proto_ipx, offset, 30, NULL);
- ipx_tree = proto_item_add_subtree(ti, ETT_IPX);
+ ipx_tree = proto_item_add_subtree(ti, ett_ipx);
proto_tree_add_item(ipx_tree, hf_ipx_checksum, offset, 2, ipx_checksum);
proto_tree_add_item_format(ipx_tree, hf_ipx_len, offset+2, 2, ipx_length,
"Length: %d bytes", ipx_length);
if (tree) {
ti = proto_tree_add_item(tree, proto_spx, offset, 12, NULL);
- spx_tree = proto_item_add_subtree(ti, ETT_SPX);
+ spx_tree = proto_item_add_subtree(ti, ett_spx);
proto_tree_add_item_format(spx_tree, hf_spx_connection_control,
offset, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_ipxrip, offset, END_OF_FRAME, NULL);
- rip_tree = proto_item_add_subtree(ti, ETT_IPXRIP);
+ rip_tree = proto_item_add_subtree(ti, ett_ipxrip);
if (operation < 2) {
proto_tree_add_text(rip_tree, offset, 2,
if (tree) {
ti = proto_tree_add_item(tree, proto_sap, offset, END_OF_FRAME, NULL);
- sap_tree = proto_item_add_subtree(ti, ETT_IPXSAP);
+ sap_tree = proto_item_add_subtree(ti, ett_ipxsap);
if (query.query_type >= 1 && query.query_type <= 4) {
proto_tree_add_text(sap_tree, offset, 2, sap_type[query.query_type - 1]);
ti = proto_tree_add_text(sap_tree, cursor+2, 48,
"Server Name: %s", server.server_name);
- s_tree = proto_item_add_subtree(ti, ETT_IPXSAP_SERVER);
+ s_tree = proto_item_add_subtree(ti, ett_ipxsap_server);
proto_tree_add_text(s_tree, cursor, 2, "Server Type: %s (0x%04X)",
server_type(server.server_type), server.server_type);
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"TRUE if SAP response" }}
};
-
+ static gint *ett[] = {
+ &ett_ipx,
+ &ett_spx,
+ &ett_ipxrip,
+ &ett_ipxsap,
+ &ett_ipxsap_server,
+ };
+
proto_ipx = proto_register_protocol ("Internetwork Packet eXchange", "ipx");
proto_register_field_array(proto_ipx, hf_ipx, array_length(hf_ipx));
proto_sap = proto_register_protocol ("Service Advertisement Protocol", "sap");
proto_register_field_array(proto_sap, hf_sap, array_length(hf_sap));
+
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for the Internet Security Association and Key Management Protocol (ISAKMP)
* Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
*
- * $Id: packet-isakmp.c,v 1.9 1999/09/17 05:56:54 guy Exp $
+ * $Id: packet-isakmp.c,v 1.10 1999/11/16 11:42:37 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_isakmp = -1;
+static gint ett_isakmp = -1;
+static gint ett_isakmp_flags = -1;
+static gint ett_isakmp_payload = -1;
+
#define NUM_PROTO_TYPES 5
#define proto2str(t) \
((t < NUM_PROTO_TYPES) ? prototypestr[t] : "UNKNOWN-PROTO-TYPE")
proto_tree * isakmp_tree;
ti = proto_tree_add_item(tree, proto_isakmp, offset, len, NULL);
- isakmp_tree = proto_item_add_subtree(ti, ETT_ISAKMP);
+ isakmp_tree = proto_item_add_subtree(ti, ett_isakmp);
proto_tree_add_text(isakmp_tree, offset, sizeof(hdr->icookie),
"Initiator cookie");
proto_tree * ftree;
fti = proto_tree_add_text(isakmp_tree, offset, sizeof(hdr->flags), "Flags");
- ftree = proto_item_add_subtree(fti, ETT_ISAKMP_FLAGS);
+ ftree = proto_item_add_subtree(fti, ett_isakmp_flags);
proto_tree_add_text(ftree, offset, 1, "%s",
decode_boolean_bitfield(hdr->flags, E_FLAG, sizeof(hdr->flags)*8,
proto_item * ti = proto_tree_add_text(tree, offset, length, "Security Association payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_tree * ntree;
guint8 i;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_item * ti = proto_tree_add_text(tree, offset, length, "Transform payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_item * ti = proto_tree_add_text(tree, offset, length, "Key Exchange payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_item * ti = proto_tree_add_text(tree, offset, length, "Identification payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_item * ti = proto_tree_add_text(tree, offset, length, "Certificate payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_item * ti = proto_tree_add_text(tree, offset, length, "Certificate Request payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_item * ti = proto_tree_add_text(tree, offset, length, "Hash payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_item * ti = proto_tree_add_text(tree, offset, length, "Signature payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_item * ti = proto_tree_add_text(tree, offset, length, "Nonce payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_item * ti = proto_tree_add_text(tree, offset, length, "Notification payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_tree * ntree;
guint16 i;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
proto_item * ti = proto_tree_add_text(tree, offset, length, "Vendor ID payload");
proto_tree * ntree;
- ntree = proto_item_add_subtree(ti, ETT_ISAKMP_PAYLOAD);
+ ntree = proto_item_add_subtree(ti, ett_isakmp_payload);
proto_tree_add_text(ntree, offset, sizeof(hdr->next_payload),
"Next payload: %s (%u)",
{ &variable,
{ "Name", "isakmp.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_isakmp,
+ &ett_isakmp_flags,
+ &ett_isakmp_payload,
+ };
proto_isakmp = proto_register_protocol("Internet Security Association and Key Management Protocol", "isakmp");
/* proto_register_field_array(proto_isakmp, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for lapb frame disassembly
* Olivier Abad <abad@daba.dhis.org>
*
- * $Id: packet-lapb.c,v 1.7 1999/10/15 21:05:49 gram Exp $
+ * $Id: packet-lapb.c,v 1.8 1999/11/16 11:42:37 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#define FROM_DCE 0x80
-int proto_lapb = -1;
-int hf_lapb_address = -1;
-int hf_lapb_control = -1;
+static int proto_lapb = -1;
+static int hf_lapb_address = -1;
+static int hf_lapb_control = -1;
+
+static gint ett_lapb = -1;
+static gint ett_lapb_control = -1;
void
dissect_lapb(const u_char *pd, frame_data *fd, proto_tree *tree)
if (tree) {
ti = proto_tree_add_item_format(tree, proto_lapb, 0, 2, NULL,
"LAPB");
- lapb_tree = proto_item_add_subtree(ti, ETT_LAPB);
+ lapb_tree = proto_item_add_subtree(ti, ett_lapb);
proto_tree_add_item_format(lapb_tree, hf_lapb_address, 0, 1, pd[0],
"Address: 0x%02X", pd[0]);
}
else
lapb_tree = NULL;
dissect_xdlc_control(pd, 1, fd, lapb_tree, hf_lapb_control,
- is_response, FALSE);
+ ett_lapb_control, is_response, FALSE);
/* not end of frame ==> X.25 */
if (fd->cap_len > 2) dissect_x25(pd, 2, fd, tree);
{ "Control Field", "lapb.control", FT_STRING, BASE_NONE, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_lapb,
+ &ett_lapb_control,
+ };
proto_lapb = proto_register_protocol ("Link Access Procedure Balanced (LAPB)", "lapb");
proto_register_field_array (proto_lapb, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for LAPD frame disassembly
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-lapd.c,v 1.2 1999/11/11 08:35:10 guy Exp $
+ * $Id: packet-lapd.c,v 1.3 1999/11/16 11:42:37 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
* http://www.acacia-net.com/Clarinet/Protocol/q9213o84.htm
*/
-int proto_lapd = -1;
-int hf_lapd_address = -1;
-int hf_lapd_sapi = -1;
-int hf_lapd_cr = -1;
-int hf_lapd_ea1 = -1;
-int hf_lapd_tei = -1;
-int hf_lapd_ea2 = -1;
-int hf_lapd_control = -1;
+static int proto_lapd = -1;
+static int hf_lapd_address = -1;
+static int hf_lapd_sapi = -1;
+static int hf_lapd_cr = -1;
+static int hf_lapd_ea1 = -1;
+static int hf_lapd_tei = -1;
+static int hf_lapd_ea2 = -1;
+static int hf_lapd_control = -1;
+
+static gint ett_lapd = -1;
+static gint ett_lapd_address = -1;
+static gint ett_lapd_control = -1;
/*
* Bits in the address field.
if (tree) {
ti = proto_tree_add_item(tree, proto_lapd, 0, 3, NULL);
- lapd_tree = proto_item_add_subtree(ti, ETT_LAPD);
+ lapd_tree = proto_item_add_subtree(ti, ett_lapd);
ti = proto_tree_add_item(lapd_tree, hf_lapd_address, 0, 2, address);
- addr_tree = proto_item_add_subtree(ti, ETT_LAPD_ADDRESS);
+ addr_tree = proto_item_add_subtree(ti, ett_lapd_address);
proto_tree_add_item(addr_tree, hf_lapd_sapi, 0, 1, address);
proto_tree_add_item(addr_tree, hf_lapd_cr, 0, 1, address);
lapd_tree = NULL;
}
- control = dissect_xdlc_control(pd, 2, fd, lapd_tree, hf_lapd_control, is_response, TRUE);
+ control = dissect_xdlc_control(pd, 2, fd, lapd_tree, hf_lapd_control,
+ ett_lapd_control, is_response, TRUE);
lapd_header_len += XDLC_CONTROL_LEN(control, TRUE);
if (XDLC_HAS_PAYLOAD(control)) {
{ "Control Field", "lapd.control", FT_UINT16, BASE_HEX, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_lapd,
+ &ett_lapd_address,
+ &ett_lapd_control,
+ };
proto_lapd = proto_register_protocol ("Link Access Procedure, Channel D (LAPD)", "lapd");
proto_register_field_array (proto_lapd, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for IEEE 802.2 LLC layer
* Gilbert Ramirez <gramirez@tivoli.com>
*
- * $Id: packet-llc.c,v 1.27 1999/11/11 08:04:06 guy Exp $
+ * $Id: packet-llc.c,v 1.28 1999/11/16 11:42:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_llc_type = -1;
static int hf_llc_oui = -1;
+static gint ett_llc = -1;
+static gint ett_llc_ctrl = -1;
+
typedef void (capture_func_t)(const u_char *, int, guint32, packet_counts *);
typedef void (dissect_func_t)(const u_char *, int, frame_data *, proto_tree *);
if (tree) {
ti = proto_tree_add_item(tree, proto_llc, offset, 0, NULL);
- llc_tree = proto_item_add_subtree(ti, ETT_LLC);
+ llc_tree = proto_item_add_subtree(ti, ett_llc);
proto_tree_add_item(llc_tree, hf_llc_dsap, offset, 1, pd[offset]);
proto_tree_add_item(llc_tree, hf_llc_ssap, offset+1, 1, pd[offset+1]);
} else
* it's basic or extended operation; is that the case?
*/
control = dissect_xdlc_control(pd, offset+2, fd, llc_tree,
- hf_llc_ctrl, pd[offset+1] & 0x01, TRUE);
+ hf_llc_ctrl, ett_llc_ctrl,
+ pd[offset+1] & 0x01, TRUE);
llc_header_len += XDLC_CONTROL_LEN(control, TRUE);
if (is_snap)
llc_header_len += 5; /* 3 bytes of OUI, 2 bytes of ethertype */
{ "Organization Code", "llc.oui", FT_UINT24, BASE_HEX, VALS(llc_oui_vals), 0x0,
""}}
};
+ static gint *ett[] = {
+ &ett_llc,
+ &ett_llc_ctrl,
+ };
proto_llc = proto_register_protocol ("Logical-Link Control", "llc" );
proto_register_field_array(proto_llc, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for LPR and LPRng packet disassembly
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-lpd.c,v 1.12 1999/11/05 15:55:09 gram Exp $
+ * $Id: packet-lpd.c,v 1.13 1999/11/16 11:42:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_lpd_response = -1;
static int hf_lpd_request = -1;
+static gint ett_lpd = -1;
+
enum lpr_type { request, response };
void
if (tree) {
ti = proto_tree_add_item(tree, proto_lpd, offset,
END_OF_FRAME, NULL);
- lpd_tree = proto_item_add_subtree(ti, ETT_LPD);
+ lpd_tree = proto_item_add_subtree(ti, ett_lpd);
if (lpr_packet_type == response) {
proto_tree_add_item_hidden(lpd_tree, hf_lpd_response,
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"TRUE if LPD request" }}
};
+ static gint *ett[] = {
+ &ett_lpd,
+ };
proto_lpd = proto_register_protocol("Line Printer Daemon Protocol", "lpd");
proto_register_field_array(proto_lpd, hf, array_length(hf));
-
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-mapi.c
* Routines for MSX mapi packet dissection
*
- * $Id: packet-mapi.c,v 1.1 1999/11/11 23:13:42 nneul Exp $
+ * $Id: packet-mapi.c,v 1.2 1999/11/16 11:42:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_mapi = -1;
+static gint ett_mapi = -1;
+
void
dissect_mapi(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
if (tree)
{
ti = proto_tree_add_item(tree, proto_mapi, offset, END_OF_FRAME, NULL);
- mapi_tree = proto_item_add_subtree(ti, ETT_MAPI);
+ mapi_tree = proto_item_add_subtree(ti, ett_mapi);
if (pi.match_port == pi.destport)
{
void
proto_register_mapi(void)
{
+ static gint *ett[] = {
+ &ett_mapi,
+ };
proto_mapi = proto_register_protocol("MAPI", "mapi");
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-mount.c
* Routines for mount dissection
*
- * $Id: packet-mount.c,v 1.3 1999/11/15 17:16:51 nneul Exp $
+ * $Id: packet-mount.c,v 1.4 1999/11/16 11:42:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_mount = -1;
static int hf_mount_path = -1;
+static gint ett_mount = -1;
int dissect_mount_dirpath_call(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree)
"Path", "mount.path", FT_STRING, BASE_DEC,
NULL, 0, "Path" }},
};
+ static gint *ett[] = {
+ &ett_mount,
+ };
proto_mount = proto_register_protocol("Mount Service", "mount");
proto_register_field_array(proto_mount, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_mount, MOUNT_PROGRAM, ETT_MOUNT);
+ rpc_init_prog(proto_mount, MOUNT_PROGRAM, ett_mount);
/* Register the procedure tables */
rpc_init_proc_table(MOUNT_PROGRAM, 1, mount1_proc);
rpc_init_proc_table(MOUNT_PROGRAM, 3, mount3_proc);
* Routines for NetBIOS over IPX packet disassembly
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-nbipx.c,v 1.14 1999/09/03 03:22:19 guy Exp $
+ * $Id: packet-nbipx.c,v 1.15 1999/11/16 11:42:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int proto_nbipx = -1;
+static gint ett_nbipx = -1;
+static gint ett_nbipx_name_type_flags = -1;
+
enum nbipx_protocol {
NETBIOS_NETWARE,
NETBIOS_NWLINK
if (tree) {
ti = proto_tree_add_item(tree, proto_nbipx, offset, 50, NULL);
- nbipx_tree = proto_item_add_subtree(ti, ETT_NBIPX);
+ nbipx_tree = proto_item_add_subtree(ti, ett_nbipx);
add_routers(nbipx_tree, pd, offset);
tf = proto_tree_add_text(nbipx_tree, offset+32, 1,
"Name type flag: 0x%02x", name_type_flag);
name_type_flag_tree = proto_item_add_subtree(tf,
- ETT_NBIPX_NAME_TYPE_FLAGS);
+ ett_nbipx_name_type_flags);
proto_tree_add_text(name_type_flag_tree, offset+32,
1, "%s",
decode_boolean_bitfield(name_type_flag, 0x80, 8,
if (tree) {
ti = proto_tree_add_item(tree, proto_nbipx, offset,
2+16+16, NULL);
- nbipx_tree = proto_item_add_subtree(ti, ETT_NBIPX);
+ nbipx_tree = proto_item_add_subtree(ti, ett_nbipx);
proto_tree_add_text(nbipx_tree, offset, 1,
"Connection control: 0x%02x", pd[offset]);
if (tree) {
ti = proto_tree_add_item(tree, proto_nbipx, offset, 68, NULL);
- nbipx_tree = proto_item_add_subtree(ti, ETT_NBIPX);
+ nbipx_tree = proto_item_add_subtree(ti, ett_nbipx);
add_routers(nbipx_tree, pd, offset);
"Name type flag: 0x%02x",
name_type_flag);
name_type_flag_tree = proto_item_add_subtree(tf,
- ETT_NBIPX_NAME_TYPE_FLAGS);
+ ett_nbipx_name_type_flags);
proto_tree_add_text(name_type_flag_tree, offset+32,
1, "%s",
decode_boolean_bitfield(name_type_flag, 0x80, 8,
{ &variable,
{ "Name", "nbipx.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_nbipx,
+ &ett_nbipx_name_type_flags,
+ };
proto_nbipx = proto_register_protocol("NetBIOS over IPX", "nbipx");
/* proto_register_field_array(proto_nbipx, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
* Much stuff added by Guy Harris <guy@netapp.com>
*
- * $Id: packet-nbns.c,v 1.32 1999/11/08 09:16:52 guy Exp $
+ * $Id: packet-nbns.c,v 1.33 1999/11/16 11:42:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_nbns_count_auth_rr = -1;
static int hf_nbns_count_add_rr = -1;
+static gint ett_nbns = -1;
+static gint ett_nbns_qd = -1;
+static gint ett_nbns_flags = -1;
+static gint ett_nbns_nb_flags = -1;
+static gint ett_nbns_name_flags = -1;
+static gint ett_nbns_rr = -1;
+static gint ett_nbns_qry = -1;
+static gint ett_nbns_ans = -1;
+
static int proto_nbdgm = -1;
static int hf_nbdgm_type = -1;
static int hf_nbdgm_fragment = -1;
static int hf_nbdgm_src_ip = -1;
static int hf_nbdgm_src_port = -1;
+static gint ett_nbdgm = -1;
+
static int proto_nbss = -1;
static int hf_nbss_type = -1;
static int hf_nbss_flags = -1;
+static gint ett_nbss = -1;
+static gint ett_nbss_flags = -1;
+
/* Packet structure taken from RFC 1002. See also RFC 1001.
* Opcode, flags, and rcode treated as "flags", similarly to DNS,
* to make it easier to lift the dissection code from "packet-dns.c". */
if (nbns_tree != NULL) {
tq = proto_tree_add_text(nbns_tree, offset, len,
"%s: type %s, class %s", name, type_name, class_name);
- q_tree = proto_item_add_subtree(tq, ETT_NBNS_QD);
+ q_tree = proto_item_add_subtree(tq, ett_nbns_qd);
add_name_and_type(q_tree, offset, name_len, "Name", name,
name_type);
}
tf = proto_tree_add_text(nbns_tree, offset, 2,
"Flags: 0x%04x (%s)", flags, buf);
- field_tree = proto_item_add_subtree(tf, ETT_NBNS_FLAGS);
+ field_tree = proto_item_add_subtree(tf, ett_nbns_flags);
proto_tree_add_text(field_tree, offset, 2, "%s",
decode_boolean_bitfield(flags, F_RESPONSE,
2*8, "Response", "Query"));
strcat(buf, "unique");
tf = proto_tree_add_text(rr_tree, offset, 2, "Flags: 0x%x (%s)", flags,
buf);
- field_tree = proto_item_add_subtree(tf, ETT_NBNS_NB_FLAGS);
+ field_tree = proto_item_add_subtree(tf, ett_nbns_nb_flags);
proto_tree_add_text(field_tree, offset, 2, "%s",
decode_boolean_bitfield(flags, NB_FLAGS_G,
2*8,
strcat(buf, ", permanent node name");
tf = proto_tree_add_text(rr_tree, offset, 2, "Name flags: 0x%x (%s)",
flags, buf);
- field_tree = proto_item_add_subtree(tf, ETT_NBNS_NAME_FLAGS);
+ field_tree = proto_item_add_subtree(tf, ett_nbns_name_flags);
proto_tree_add_text(field_tree, offset, 2, "%s",
decode_boolean_bitfield(flags, NAME_FLAGS_G,
2*8,
strcat(name, " (");
strcat(name, netbios_name_type_descr(name_type));
strcat(name, ")");
- rr_tree = add_rr_to_tree(trr, ETT_NBNS_RR, offset, name,
+ rr_tree = add_rr_to_tree(trr, ett_nbns_rr, offset, name,
name_len, type_name, class_name, ttl, data_len);
while (data_len > 0) {
if (opcode == OPCODE_WACK) {
(dptr - data_start) + data_len,
"%s: type %s, class %s",
name, type_name, class_name);
- rr_tree = add_rr_to_tree(trr, ETT_NBNS_RR, offset, name,
+ rr_tree = add_rr_to_tree(trr, ett_nbns_rr, offset, name,
name_len, type_name, class_name, ttl, data_len);
if (!BYTES_ARE_IN_FRAME(cur_offset, 1)) {
/* We ran past the end of the captured
(dptr - data_start) + data_len,
"%s: type %s, class %s",
name, type_name, class_name);
- rr_tree = add_rr_to_tree(trr, ETT_NBNS_RR, offset, name,
+ rr_tree = add_rr_to_tree(trr, ett_nbns_rr, offset, name,
name_len, type_name, class_name, ttl, data_len);
proto_tree_add_text(rr_tree, cur_offset, data_len, "Data");
break;
start_off = cur_off;
if (nbns_tree != NULL) {
ti = proto_tree_add_text(nbns_tree, start_off, 0, "Queries");
- qatree = proto_item_add_subtree(ti, ETT_NBNS_QRY);
+ qatree = proto_item_add_subtree(ti, ett_nbns_qry);
}
while (count-- > 0) {
add_off = dissect_nbns_query(pd, cur_off, nbns_data_offset,
start_off = cur_off;
if (nbns_tree != NULL) {
ti = proto_tree_add_text(nbns_tree, start_off, 0, name);
- qatree = proto_item_add_subtree(ti, ETT_NBNS_ANS);
+ qatree = proto_item_add_subtree(ti, ett_nbns_ans);
}
while (count-- > 0) {
add_off = dissect_nbns_answer(pd, cur_off, nbns_data_offset,
if (tree) {
ti = proto_tree_add_item(tree, proto_nbns, offset, END_OF_FRAME, NULL);
- nbns_tree = proto_item_add_subtree(ti, ETT_NBNS);
+ nbns_tree = proto_item_add_subtree(ti, ett_nbns);
if (flags & F_RESPONSE) {
proto_tree_add_item_hidden(nbns_tree, hf_nbns_response,
if (tree) {
ti = proto_tree_add_item(tree, proto_nbdgm, offset, header.dgm_length, NULL);
- nbdgm_tree = proto_item_add_subtree(ti, ETT_NBDGM);
+ nbdgm_tree = proto_item_add_subtree(ti, ett_nbdgm);
proto_tree_add_item_format(nbdgm_tree, hf_nbdgm_type,
offset, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_nbss, offset, length + 4, NULL);
- nbss_tree = proto_item_add_subtree(ti, ETT_NBSS);
+ nbss_tree = proto_item_add_subtree(ti, ett_nbss);
proto_tree_add_item_format(nbss_tree, hf_nbss_type,
offset, 1,
if (tree) {
tf = proto_tree_add_item(nbss_tree, hf_nbss_flags, offset, 1, flags);
- field_tree = proto_item_add_subtree(tf, ETT_NBSS_FLAGS);
+ field_tree = proto_item_add_subtree(tf, ett_nbss_flags);
proto_tree_add_text(field_tree, offset, 1, "%s",
decode_boolean_bitfield(flags, NBSS_FLAGS_E,
8, "Add 65536 to length", "Add 0 to length"));
FT_UINT8, BASE_HEX, NULL, 0x0,
"NBSS message flags" }}
};
+ static gint *ett[] = {
+ &ett_nbns,
+ &ett_nbns_qd,
+ &ett_nbns_flags,
+ &ett_nbns_nb_flags,
+ &ett_nbns_name_flags,
+ &ett_nbns_rr,
+ &ett_nbns_qry,
+ &ett_nbns_ans,
+ &ett_nbdgm,
+ &ett_nbss,
+ &ett_nbss_flags,
+ };
proto_nbns = proto_register_protocol("NetBIOS Name Service", "nbns");
proto_register_field_array(proto_nbns, hf_nbns, array_length(hf_nbns));
proto_nbss = proto_register_protocol("NetBIOS Session Service", "nbss");
proto_register_field_array(proto_nbss, hf_nbss, array_length(hf_nbss));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for NetWare Core Protocol
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-ncp.c,v 1.20 1999/10/17 14:09:35 deniel Exp $
+ * $Id: packet-ncp.c,v 1.21 1999/11/16 11:42:40 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_ncp_connection = -1;
static int hf_ncp_task = -1;
+static gint ett_ncp = -1;
+static gint ett_ncp_request_fields = -1;
+static gint ett_ncp_reply_fields = -1;
+
struct svc_record;
static void
if (tree) {
ti = proto_tree_add_item(tree, proto_ncp, offset, END_OF_FRAME, NULL);
- ncp_tree = proto_item_add_subtree(ti, ETT_NCP);
+ ncp_tree = proto_item_add_subtree(ti, ett_ncp);
proto_tree_add_item_format(ncp_tree, hf_ncp_type,
offset, 2,
if (ncp_request->req) {
ti = proto_tree_add_text(ncp_tree, offset, END_OF_FRAME,
"NCP Request Packet");
- field_tree = proto_item_add_subtree(ti, ETT_NCP_REQUEST_FIELDS);
+ field_tree = proto_item_add_subtree(ti, ett_ncp_request_fields);
parse_ncp_svc_fields(pd, field_tree, offset, ncp_request->req);
}
if (ncp_request->rep) {
ti = proto_tree_add_text(ncp_tree, offset+8, END_OF_FRAME,
"NCP Reply Packet");
- field_tree = proto_item_add_subtree(ti, ETT_NCP_REPLY_FIELDS);
+ field_tree = proto_item_add_subtree(ti, ett_ncp_reply_fields);
parse_ncp_svc_fields(pd, field_tree, offset+8, ncp_request->rep);
}
FT_UINT8, BASE_DEC, NULL, 0x0,
"" }}
};
+ static gint *ett[] = {
+ &ett_ncp,
+ &ett_ncp_request_fields,
+ &ett_ncp_reply_fields,
+ };
proto_ncp = proto_register_protocol("NetWare Core Protocol", "ncp");
proto_register_field_array(proto_ncp, hf, array_length(hf));
-
+ proto_register_subtree_array(ett, array_length(ett));
}
*
* derived from the packet-nbns.c
*
- * $Id: packet-netbios.c,v 1.9 1999/11/15 21:33:57 nneul Exp $
+ * $Id: packet-netbios.c,v 1.10 1999/11/16 11:42:41 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int proto_netbios = -1;
+static gint ett_netb = -1;
+static gint ett_netb_name = -1;
+static gint ett_netb_flags = -1;
+static gint ett_netb_status = -1;
+
/* The strings for the station type, used by get_netbios_name function;
many of them came from the file "NetBIOS.txt" in the Zip archive at
tf = proto_tree_add_text( tree, offset + nb_offset, NETBIOS_NAME_LEN,
"%s: %s<%02x> (%s)", label, name_str, name_type, name_type_str);
- field_tree = proto_item_add_subtree( tf, ETT_NETB_NAME);
+ field_tree = proto_item_add_subtree( tf, ett_netb_name);
proto_tree_add_text( field_tree, offset + nb_offset, 15, "%s",
name_str);
tf = proto_tree_add_text( tree, offset, 1,
"Flags: 0x%02x", flags);
- field_tree = proto_item_add_subtree(tf, ETT_NETB_FLAGS);
+ field_tree = proto_item_add_subtree(tf, ett_netb_flags);
proto_tree_add_text(field_tree, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x08, 8,
tf = proto_tree_add_text( tree, offset, 1,
"Flags: 0x%02x", flags);
- field_tree = proto_item_add_subtree(tf, ETT_NETB_FLAGS);
+ field_tree = proto_item_add_subtree(tf, ett_netb_flags);
proto_tree_add_text(field_tree, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x08, 8,
tf = proto_tree_add_text( tree, offset, 1,
"Flags: 0x%02x", flags);
- field_tree = proto_item_add_subtree( tf, ETT_NETB_FLAGS);
+ field_tree = proto_item_add_subtree( tf, ett_netb_flags);
proto_tree_add_text(field_tree, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x80, 8,
tf = proto_tree_add_text( tree, offset, 1,
"Flags: 0x%02x", flags);
- field_tree = proto_item_add_subtree(tf, ETT_NETB_FLAGS);
+ field_tree = proto_item_add_subtree(tf, ett_netb_flags);
proto_tree_add_text(field_tree, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x80, 8,
"Flags: 0x%02x", flags);
if (flags & 0x02) {
- field_tree = proto_item_add_subtree(tf, ETT_NETB_FLAGS);
+ field_tree = proto_item_add_subtree(tf, ett_netb_flags);
proto_tree_add_text(field_tree, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x02, 8,
"SEND.NO.ACK data not received", NULL));
data2 = pletohs(data_ptr + NB_DATA2);
td2 = proto_tree_add_text(tree, offset + NB_DATA2, 2, "Status: 0x04x",
data2);
- data2_tree = proto_item_add_subtree(td2, ETT_NETB_STATUS);
+ data2_tree = proto_item_add_subtree(td2, ett_netb_status);
if (data2 & 0x8000) {
proto_tree_add_text(data2_tree, offset, 2, "%s",
decode_boolean_bitfield(data2, 0x8000, 8*2,
if (tree) {
ti = proto_tree_add_item(tree, proto_netbios,
offset, END_OF_FRAME, NULL);
- netb_tree = proto_item_add_subtree(ti, ETT_NETB);
+ netb_tree = proto_item_add_subtree(ti, ett_netb);
proto_tree_add_text( netb_tree, offset,
END_OF_FRAME, "Data (%u bytes)",
if (tree) {
ti = proto_tree_add_item(tree, proto_netbios, offset, END_OF_FRAME, NULL);
- netb_tree = proto_item_add_subtree(ti, ETT_NETB);
+ netb_tree = proto_item_add_subtree(ti, ett_netb);
proto_tree_add_text(netb_tree, offset, 2,
"Header Length: %d", hdr_len);
void proto_register_netbios(void)
{
+ static gint *ett[] = {
+ &ett_netb,
+ &ett_netb_name,
+ &ett_netb_flags,
+ &ett_netb_status,
+ };
proto_netbios = proto_register_protocol("NetBIOS", "netbios");
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for nfs dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
- * $Id: packet-nfs.c,v 1.4 1999/11/15 14:32:15 nneul Exp $
+ * $Id: packet-nfs.c,v 1.5 1999/11/16 11:42:41 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_nfs = -1;
+static gint ett_nfs = -1;
+static gint ett_nfs_fhandle = -1;
+static gint ett_nfs_timeval = -1;
+static gint ett_nfs_mode = -1;
+static gint ett_nfs_fattr = -1;
+static gint ett_nfs_sattr = -1;
+static gint ett_nfs_mode3 = -1;
+static gint ett_nfs_specdata3 = -1;
+static gint ett_nfs_fh3 = -1;
+static gint ett_nfs_nfstime3 = -1;
+static gint ett_nfs_fattr3 = -1;
+static gint ett_nfs_sattr3 = -1;
+static gint ett_nfs_sattrguard3 = -1;
+static gint ett_nfs_set_mode3 = -1;
+static gint ett_nfs_set_uid3 = -1;
+static gint ett_nfs_set_gid3 = -1;
+static gint ett_nfs_set_size3 = -1;
+static gint ett_nfs_set_atime = -1;
+static gint ett_nfs_set_mtime = -1;
+static gint ett_nfs_pre_op_attr = -1;
+static gint ett_nfs_post_op_attr = -1;
+static gint ett_nfs_wcc_attr = -1;
+static gint ett_nfs_wcc_data = -1;
+
/***************************/
/* NFS Version 2, RFC 1094 */
fitem = proto_tree_add_text(tree, offset, FHSIZE,
"%s", name);
if (fitem)
- ftree = proto_item_add_subtree(fitem, ETT_NFS_FHANDLE);
+ ftree = proto_item_add_subtree(fitem, ett_nfs_fhandle);
}
if (ftree) {
time_item = proto_tree_add_text(tree, offset, 8,
"%s: %u.%06u", name, seconds, mseconds);
if (time_item)
- time_tree = proto_item_add_subtree(time_item, ETT_NFS_TIMEVAL);
+ time_tree = proto_item_add_subtree(time_item, ett_nfs_timeval);
}
if (time_tree) {
mode_item = proto_tree_add_text(tree, offset, 4,
"%s: 0%o", name, mode);
if (mode_item)
- mode_tree = proto_item_add_subtree(mode_item, ETT_NFS_MODE);
+ mode_tree = proto_item_add_subtree(mode_item, ett_nfs_mode);
}
if (mode_tree) {
fattr_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s", name);
if (fattr_item)
- fattr_tree = proto_item_add_subtree(fattr_item, ETT_NFS_FATTR);
+ fattr_tree = proto_item_add_subtree(fattr_item, ett_nfs_fattr);
}
offset = dissect_ftype (pd,offset,fd,fattr_tree,"type");
sattr_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s", name);
if (sattr_item)
- sattr_tree = proto_item_add_subtree(sattr_item, ETT_NFS_SATTR);
+ sattr_tree = proto_item_add_subtree(sattr_item, ett_nfs_sattr);
}
/* some how we should indicate here, that -1 means "do not set" */
mode3_item = proto_tree_add_text(tree, offset, 4,
"%s: 0%o", name, mode3);
if (mode3_item)
- mode3_tree = proto_item_add_subtree(mode3_item, ETT_NFS_MODE3);
+ mode3_tree = proto_item_add_subtree(mode3_item, ett_nfs_mode3);
}
/* RFC 1813, Page 23 */
"%s: %u,%u", name, specdata1, specdata2);
if (specdata3_item)
specdata3_tree = proto_item_add_subtree(specdata3_item,
- ETT_NFS_SPECDATA3);
+ ett_nfs_specdata3);
}
if (specdata3_tree) {
fitem = proto_tree_add_text(tree, offset, 4+fh_len_full,
"%s", name);
if (fitem)
- ftree = proto_item_add_subtree(fitem, ETT_NFS_FH3);
+ ftree = proto_item_add_subtree(fitem, ett_nfs_fh3);
}
if (ftree) {
time_item = proto_tree_add_text(tree, offset, 8,
"%s: %u.%09u", name, seconds, nseconds);
if (time_item)
- time_tree = proto_item_add_subtree(time_item, ETT_NFS_NFSTIME3);
+ time_tree = proto_item_add_subtree(time_item, ett_nfs_nfstime3);
}
if (time_tree) {
fattr3_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s", name);
if (fattr3_item)
- fattr3_tree = proto_item_add_subtree(fattr3_item, ETT_NFS_FATTR3);
+ fattr3_tree = proto_item_add_subtree(fattr3_item, ett_nfs_fattr3);
}
offset = dissect_ftype3 (pd,offset,fd,fattr3_tree,"type");
post_op_attr_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s", name);
if (post_op_attr_item)
- post_op_attr_tree = proto_item_add_subtree(post_op_attr_item, ETT_NFS_POST_OP_ATTR);
+ post_op_attr_tree = proto_item_add_subtree(post_op_attr_item, ett_nfs_post_op_attr);
}
if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
wcc_attr_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s", name);
if (wcc_attr_item)
- wcc_attr_tree = proto_item_add_subtree(wcc_attr_item, ETT_NFS_WCC_ATTR);
+ wcc_attr_tree = proto_item_add_subtree(wcc_attr_item, ett_nfs_wcc_attr);
}
offset = dissect_size3 (pd, offset, fd, wcc_attr_tree, "size" );
pre_op_attr_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s", name);
if (pre_op_attr_item)
- pre_op_attr_tree = proto_item_add_subtree(pre_op_attr_item, ETT_NFS_PRE_OP_ATTR);
+ pre_op_attr_tree = proto_item_add_subtree(pre_op_attr_item, ett_nfs_pre_op_attr);
}
if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
wcc_data_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s", name);
if (wcc_data_item)
- wcc_data_tree = proto_item_add_subtree(wcc_data_item, ETT_NFS_WCC_DATA);
+ wcc_data_tree = proto_item_add_subtree(wcc_data_item, ett_nfs_wcc_data);
}
offset = dissect_pre_op_attr (pd, offset, fd, wcc_data_tree, "before");
set_mode3_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s: %s", name, set_it_name);
if (set_mode3_item)
- set_mode3_tree = proto_item_add_subtree(set_mode3_item, ETT_NFS_SET_MODE3);
+ set_mode3_tree = proto_item_add_subtree(set_mode3_item, ett_nfs_set_mode3);
}
if (set_mode3_tree)
set_uid3_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s: %s", name, set_it_name);
if (set_uid3_item)
- set_uid3_tree = proto_item_add_subtree(set_uid3_item, ETT_NFS_SET_UID3);
+ set_uid3_tree = proto_item_add_subtree(set_uid3_item, ett_nfs_set_uid3);
}
if (set_uid3_tree)
set_gid3_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s: %s", name, set_it_name);
if (set_gid3_item)
- set_gid3_tree = proto_item_add_subtree(set_gid3_item, ETT_NFS_SET_GID3);
+ set_gid3_tree = proto_item_add_subtree(set_gid3_item, ett_nfs_set_gid3);
}
if (set_gid3_tree)
set_size3_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s: %s", name, set_it_name);
if (set_size3_item)
- set_size3_tree = proto_item_add_subtree(set_size3_item, ETT_NFS_SET_SIZE3);
+ set_size3_tree = proto_item_add_subtree(set_size3_item, ett_nfs_set_size3);
}
if (set_size3_tree)
END_OF_FRAME, "%s: %s",
name, set_it_name, set_it);
if (set_atime_item)
- set_atime_tree = proto_item_add_subtree(set_atime_item, ETT_NFS_SET_ATIME);
+ set_atime_tree = proto_item_add_subtree(set_atime_item, ett_nfs_set_atime);
}
if (set_atime_tree)
END_OF_FRAME, "%s: %s",
name, set_it_name, set_it);
if (set_mtime_item)
- set_mtime_tree = proto_item_add_subtree(set_mtime_item, ETT_NFS_SET_MTIME);
+ set_mtime_tree = proto_item_add_subtree(set_mtime_item, ett_nfs_set_mtime);
}
if (set_mtime_tree)
sattr3_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s", name);
if (sattr3_item)
- sattr3_tree = proto_item_add_subtree(sattr3_item, ETT_NFS_SATTR3);
+ sattr3_tree = proto_item_add_subtree(sattr3_item, ett_nfs_sattr3);
}
offset = dissect_set_mode3(pd, offset, fd, sattr3_tree, "mode");
sattrguard3_item = proto_tree_add_text(tree, offset,
END_OF_FRAME, "%s: %s", name, check_name);
if (sattrguard3_item)
- sattrguard3_tree = proto_item_add_subtree(sattrguard3_item, ETT_NFS_SATTRGUARD3);
+ sattrguard3_tree = proto_item_add_subtree(sattrguard3_item, ett_nfs_sattrguard3);
}
if (sattrguard3_tree)
void
proto_register_nfs(void)
{
+ static gint *ett[] = {
+ &ett_nfs,
+ &ett_nfs_fhandle,
+ &ett_nfs_timeval,
+ &ett_nfs_mode,
+ &ett_nfs_fattr,
+ &ett_nfs_sattr,
+ &ett_nfs_mode3,
+ &ett_nfs_specdata3,
+ &ett_nfs_fh3,
+ &ett_nfs_nfstime3,
+ &ett_nfs_fattr3,
+ &ett_nfs_sattr3,
+ &ett_nfs_sattrguard3,
+ &ett_nfs_set_mode3,
+ &ett_nfs_set_uid3,
+ &ett_nfs_set_gid3,
+ &ett_nfs_set_size3,
+ &ett_nfs_set_atime,
+ &ett_nfs_set_mtime,
+ &ett_nfs_pre_op_attr,
+ &ett_nfs_post_op_attr,
+ &ett_nfs_wcc_attr,
+ &ett_nfs_wcc_data,
+ };
proto_nfs = proto_register_protocol("Network File System", "nfs");
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_nfs, NFS_PROGRAM, ETT_NFS);
+ rpc_init_prog(proto_nfs, NFS_PROGRAM, ett_nfs);
/* Register the procedure tables */
rpc_init_proc_table(NFS_PROGRAM, 2, nfs2_proc);
rpc_init_proc_table(NFS_PROGRAM, 3, nfs3_proc);
}
-
/* packet-nlm.c
* Routines for nlm dissection
*
- * $Id: packet-nlm.c,v 1.2 1999/11/15 14:32:16 nneul Exp $
+ * $Id: packet-nlm.c,v 1.3 1999/11/16 11:42:42 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_nlm = -1;
+static gint ett_nlm = -1;
/* proc number, "proc name", dissect_request, dissect_reply */
/* NULL as function pointer means: take the generic one. */
void
proto_register_nlm(void)
{
+ static gint *ett[] = {
+ &ett_nlm,
+ };
+
proto_nlm = proto_register_protocol("Network Lock Manager Protocol", "nlm");
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_nlm, NLM_PROGRAM, ETT_NLM);
+ rpc_init_prog(proto_nlm, NLM_PROGRAM, ett_nlm);
/* Register the procedure table */
rpc_init_proc_table(NLM_PROGRAM, 3, nlm3_proc);
}
* Routines for nntp packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-nntp.c,v 1.5 1999/10/17 14:46:40 deniel Exp $
+ * $Id: packet-nntp.c,v 1.6 1999/11/16 11:42:42 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_nntp_response = -1;
static int hf_nntp_request = -1;
+static gint ett_nntp = -1;
+
void
dissect_nntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
if (tree) {
ti = proto_tree_add_item(tree, proto_nntp, offset, END_OF_FRAME, NULL);
- nntp_tree = proto_item_add_subtree(ti, ETT_NNTP);
+ 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, 0, 0, TRUE);
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"TRUE if NNTP request" }}
};
+ static gint *ett[] = {
+ &ett_nntp,
+ };
proto_nntp = proto_register_protocol("Network News Transfer Protocol",
"nntp");
proto_register_field_array(proto_nntp, hf, array_length(hf));
-
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for NTP packet dissection
* Copyright 1999, Nathan Neulinger <nneul@umr.edu>
*
- * $Id: packet-ntp.c,v 1.4 1999/10/25 20:48:48 guy Exp $
+ * $Id: packet-ntp.c,v 1.5 1999/11/16 11:42:43 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_ntp_keyid = -1;
static int hf_ntp_mac = -1;
+static gint ett_ntp = -1;
+static gint ett_ntp_flags = -1;
+
/* ntm_fmt_ts - converts NTP timestamp to human readable string.
* tsdata - 64bit timestamp (IN)
* buff - string buffer for result (OUT)
if (tree) {
/* Adding NTP item and subtree */
ti = proto_tree_add_item(tree, proto_ntp, offset, END_OF_FRAME, NULL);
- ntp_tree = proto_item_add_subtree(ti, ETT_NTP);
+ ntp_tree = proto_item_add_subtree(ti, ett_ntp);
tf = proto_tree_add_item(ntp_tree, hf_ntp_flags, offset, 1, pkt->flags);
/* Adding flag subtree and items */
- flags_tree = proto_item_add_subtree(tf, ETT_NTP_FLAGS);
+ flags_tree = proto_item_add_subtree(tf, ett_ntp_flags);
proto_tree_add_item_format(flags_tree, hf_ntp_flags_li, offset, 1,
*pkt->flags & NTP_LI_MASK,
decode_enumerated_bitfield(*pkt->flags, NTP_LI_MASK,
"Message Authentication Code", "ntp.mac", FT_BYTES, BASE_HEX,
NULL, 0, "Message Authentication Code" }},
};
+ static gint *ett[] = {
+ &ett_ntp,
+ &ett_ntp_flags,
+ };
proto_ntp = proto_register_protocol("Network Time Protocol", "ntp");
proto_register_field_array(proto_ntp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-null.c
* Routines for null packet disassembly
*
- * $Id: packet-null.c,v 1.16 1999/10/12 06:20:12 gram Exp $
+ * $Id: packet-null.c,v 1.17 1999/11/16 11:42:43 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_null_etype = -1;
static int hf_null_family = -1;
+static gint ett_null = -1;
+
/* Null/loopback structs and definitions */
/* Macro to byte-swap 32-bit quantities. */
if (null_header > IEEE_802_3_MAX_LEN) {
if (tree) {
ti = proto_tree_add_item(tree, proto_null, 0, 4, NULL);
- fh_tree = proto_item_add_subtree(ti, ETT_NULL);
+ fh_tree = proto_item_add_subtree(ti, ett_null);
} else
fh_tree = NULL;
ethertype(null_header, 4, pd, fd, tree, fh_tree, hf_null_etype);
layer (ie none) */
if (tree) {
ti = proto_tree_add_item(tree, proto_null, 0, 4, NULL);
- fh_tree = proto_item_add_subtree(ti, ETT_NULL);
+ fh_tree = proto_item_add_subtree(ti, ett_null);
proto_tree_add_item(fh_tree, hf_null_family, 0, 4, null_header);
}
{ "Family", "null.family", FT_UINT32, BASE_HEX, VALS(family_vals), 0x0,
"" }}
};
+ static gint *ett[] = {
+ &ett_null,
+ };
proto_null = proto_register_protocol ("Null/Loopback", "null" );
proto_register_field_array(proto_null, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-osi.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
- * $Id: packet-osi.c,v 1.11 1999/10/12 06:20:12 gram Exp $
+ * $Id: packet-osi.c,v 1.12 1999/11/16 11:42:44 guy Exp $
* Laurent Deniel <deniel@worldnet.fr>
*
* Ethereal - Network traffic analyzer
static int hf_clnp_src_length = -1;
static int hf_clnp_src = -1;
+static gint ett_clnp = -1;
+
static int proto_cotp = -1;
+static gint ett_cotp = -1;
+
/* Network layer protocol identifiers */
#define ISO8473_CLNP 0x81
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
- cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
+ cotp_tree = proto_item_add_subtree(ti, ett_cotp);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
proto_tree_add_text(cotp_tree, offset + 1, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
- cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
+ cotp_tree = proto_item_add_subtree(ti, ett_cotp);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
proto_tree_add_text(cotp_tree, offset + 1, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
- cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
+ cotp_tree = proto_item_add_subtree(ti, ett_cotp);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
proto_tree_add_text(cotp_tree, offset + 1, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
- cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
+ cotp_tree = proto_item_add_subtree(ti, ett_cotp);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
proto_tree_add_text(cotp_tree, offset + 1, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
- cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
+ cotp_tree = proto_item_add_subtree(ti, ett_cotp);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
proto_tree_add_text(cotp_tree, offset + 1, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
- cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
+ cotp_tree = proto_item_add_subtree(ti, ett_cotp);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
proto_tree_add_text(cotp_tree, offset + 1, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
- cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
+ cotp_tree = proto_item_add_subtree(ti, ett_cotp);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
proto_tree_add_text(cotp_tree, offset + 1, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
- cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
+ cotp_tree = proto_item_add_subtree(ti, ett_cotp);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
proto_tree_add_text(cotp_tree, offset + 1, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
- cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
+ cotp_tree = proto_item_add_subtree(ti, ett_cotp);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
proto_tree_add_text(cotp_tree, offset + 1, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
- cotp_tree = proto_item_add_subtree(ti, ETT_COTP);
+ cotp_tree = proto_item_add_subtree(ti, ett_cotp);
proto_tree_add_text(cotp_tree, offset, 1,
"Length indicator: %d", li);
proto_tree_add_text(cotp_tree, offset + 1, 1,
if (tree) {
ti = proto_tree_add_item(tree, proto_clnp, offset, clnp.cnf_hdr_len, NULL);
- clnp_tree = proto_item_add_subtree(ti, ETT_CLNP);
+ clnp_tree = proto_item_add_subtree(ti, ett_clnp);
proto_tree_add_item_format(clnp_tree, hf_clnp_id, offset, 1,
clnp.cnf_proto_id,
"Protocol identifier: 0x%02x",
{ "Source address", "clnp.ssap", FT_BYTES, BASE_NONE, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_clnp,
+ };
proto_clnp = proto_register_protocol("ISO CLNP", "clnp");
proto_register_field_array(proto_clnp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
void proto_register_cotp(void)
{ &variable,
{ "Name", "cotp.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_cotp,
+ };
proto_cotp = proto_register_protocol("ISO COTP", "cotp");
/* proto_register_field_array(proto_cotp, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for OSPF packet disassembly
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-ospf.c,v 1.15 1999/10/27 03:10:37 guy Exp $
+ * $Id: packet-ospf.c,v 1.16 1999/11/16 11:42:45 guy Exp $
*
* At this time, this module is able to analyze OSPF
* packets as specified in RFC2328. MOSPF (RFC1584) and other
static int proto_ospf = -1;
+static gint ett_ospf = -1;
+static gint ett_ospf_hdr = -1;
+static gint ett_ospf_hello = -1;
+static gint ett_ospf_desc = -1;
+static gint ett_ospf_lsr = -1;
+static gint ett_ospf_lsa = -1;
+static gint ett_ospf_lsa_upd = -1;
+
void
dissect_ospf(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
e_ospfhdr ospfh;
if (tree) {
ti = proto_tree_add_item(tree, proto_ospf, offset, ntohs(ospfh.length), NULL);
- ospf_tree = proto_item_add_subtree(ti, ETT_OSPF);
+ ospf_tree = proto_item_add_subtree(ti, ett_ospf);
ti = proto_tree_add_text(ospf_tree, offset, OSPF_HEADER_LENGTH, "OSPF Header");
- ospf_header_tree = proto_item_add_subtree(ti, ETT_OSPF_HDR);
+ ospf_header_tree = proto_item_add_subtree(ti, ett_ospf_hdr);
proto_tree_add_text(ospf_header_tree, offset, 1, "OSPF Version: %d", ospfh.version);
proto_tree_add_text(ospf_header_tree, offset + 1 , 1, "OSPF Packet Type: %d (%s)",
if (tree) {
ti = proto_tree_add_text(tree, offset, END_OF_FRAME, "OSPF Hello Packet");
- ospf_hello_tree = proto_item_add_subtree(ti, ETT_OSPF_HELLO);
+ ospf_hello_tree = proto_item_add_subtree(ti, ett_ospf_hello);
proto_tree_add_text(ospf_hello_tree, offset , 4, "Network Mask: %s", ip_to_str((guint8 *) &ospfhello.network_mask));
if (tree) {
ti = proto_tree_add_text(tree, offset, END_OF_FRAME, "OSPF DB Description");
- ospf_db_desc_tree = proto_item_add_subtree(ti, ETT_OSPF_DESC);
+ ospf_db_desc_tree = proto_item_add_subtree(ti, ett_ospf_desc);
proto_tree_add_text(ospf_db_desc_tree, offset, 2, "Interface MTU: %d", ntohs(ospf_dbd.interface_mtu) );
while( ((int) (pi.captured_len - offset)) >= OSPF_LS_REQ_LENGTH ){
memcpy(&ospf_lsr, &pd[offset], sizeof(e_ospf_ls_req));
ti = proto_tree_add_text(tree, offset, OSPF_LS_REQ_LENGTH, "Link State Request");
- ospf_lsr_tree = proto_item_add_subtree(ti, ETT_OSPF_LSR);
+ ospf_lsr_tree = proto_item_add_subtree(ti, ett_ospf_lsr);
switch( ntohl( ospf_lsr.ls_type ) ){
case OSPF_LSTYPE_ROUTER:
if (tree) {
ti = proto_tree_add_text(tree, offset, END_OF_FRAME, "LS Update Packet");
- ospf_lsa_upd_tree = proto_item_add_subtree(ti, ETT_OSPF_LSA_UPD);
+ ospf_lsa_upd_tree = proto_item_add_subtree(ti, ett_ospf_lsa_upd);
proto_tree_add_text(ospf_lsa_upd_tree, offset, 4, "Nr oF LSAs: %ld", (long)ntohl(upd_hdr.lsa_nr) );
}
} else {
ti = proto_tree_add_text(tree, offset, OSPF_LSA_HEADER_LENGTH, "LSA Header");
}
- ospf_lsa_tree = proto_item_add_subtree(ti, ETT_OSPF_LSA);
+ ospf_lsa_tree = proto_item_add_subtree(ti, ett_ospf_lsa);
proto_tree_add_text(ospf_lsa_tree, offset, 2, "LS Age: %d seconds", ntohs(lsa_hdr.ls_age));
{ &variable,
{ "Name", "ospf.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_ospf,
+ &ett_ospf_hdr,
+ &ett_ospf_hello,
+ &ett_ospf_desc,
+ &ett_ospf_lsr,
+ &ett_ospf_lsa,
+ &ett_ospf_lsa_upd,
+ };
proto_ospf = proto_register_protocol("Open Shortest Path First", "ospf");
/* proto_register_field_array(proto_ospf, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for PIM disassembly
* (c) Copyright Jun-ichiro itojun Hagino <itojun@itojun.org>
*
- * $Id: packet-pim.c,v 1.6 1999/10/21 15:06:02 gram Exp $
+ * $Id: packet-pim.c,v 1.7 1999/11/16 11:42:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_pim_type = -1;
static int hf_pim_cksum = -1;
+static gint ett_pim = -1;
+
static const char *
dissect_pim_addr(const u_char *bp, const u_char *ep, enum pimv2_addrtype at,
int *advance) {
if (tree) {
ti = proto_tree_add_item(tree, proto_pim, offset, END_OF_FRAME, NULL);
- pim_tree = proto_item_add_subtree(ti, ETT_PIM);
+ pim_tree = proto_item_add_subtree(ti, ett_pim);
proto_tree_add_item(pim_tree, hf_pim_version, offset, 1,
PIM_VER(pim.pim_typever));
tiopt = proto_tree_add_text(pim_tree,
offset + sizeof(struct pim), END_OF_FRAME,
"PIM parameters");
- pimopt_tree = proto_item_add_subtree(tiopt, ETT_PIM);
+ pimopt_tree = proto_item_add_subtree(tiopt, ett_pim);
} else
goto done;
flagoff = offset + sizeof(struct pim);
tiflag = proto_tree_add_text(pimopt_tree, flagoff, 4,
"Flags: 0x%08x", ntohl(*(guint32 *)&pd[flagoff]));
- flag_tree = proto_item_add_subtree(tiflag, ETT_PIM);
+ flag_tree = proto_item_add_subtree(tiflag, ett_pim);
proto_tree_add_text(flag_tree, flagoff, 1, "%s",
decode_boolean_bitfield(pd[flagoff], 0x80000000, 32,
"Border", "Not border"));
goto breakbreak3;
tigroup = proto_tree_add_text(pimopt_tree, offset, advance,
"Group %d: %s", i, s);
- grouptree = proto_item_add_subtree(tigroup, ETT_PIM);
+ grouptree = proto_item_add_subtree(tigroup, ett_pim);
offset += advance;
if (&pd[offset + 4] > ep)
tisub = proto_tree_add_text(grouptree, offset, 2,
"Join: %d", njoin);
- subtree = proto_item_add_subtree(tisub, ETT_PIM);
+ subtree = proto_item_add_subtree(tisub, ett_pim);
off = offset + 4;
for (j = 0; j < nprune; j++) {
s = dissect_pim_addr(&pd[off], ep, pimv2_source,
tisub = proto_tree_add_text(grouptree, offset + 2, 2,
"Prune: %d", nprune);
- subtree = proto_item_add_subtree(tisub, ETT_PIM);
+ subtree = proto_item_add_subtree(tisub, ett_pim);
for (j = 0; j < nprune; j++) {
s = dissect_pim_addr(&pd[off], ep, pimv2_source,
&advance);
goto breakbreak4;
tigroup = proto_tree_add_text(pimopt_tree, offset, advance,
"Group %d: %s", i, s);
- grouptree = proto_item_add_subtree(tigroup, ETT_PIM);
+ grouptree = proto_item_add_subtree(tigroup, ett_pim);
offset += advance;
if (END_OF_FRAME < 2)
{ "Checksum", "pim.cksum",
FT_UINT16, BASE_HEX, NULL, 0x0, "" }},
};
+ static gint *ett[] = {
+ &ett_pim,
+ };
proto_pim = proto_register_protocol("Protocol Independent Multicast",
"pim");
proto_register_field_array(proto_pim, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for pop packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-pop.c,v 1.9 1999/11/14 10:16:25 deniel Exp $
+ * $Id: packet-pop.c,v 1.10 1999/11/16 11:42:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_pop_response = -1;
static int hf_pop_request = -1;
+static gint ett_pop = -1;
+
void
dissect_pop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
if (tree) {
ti = proto_tree_add_item(tree, proto_pop, offset, END_OF_FRAME, NULL);
- pop_tree = proto_item_add_subtree(ti, ETT_POP);
+ 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, offset, i1, TRUE);
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"TRUE if POP request" }}
};
+ static gint *ett[] = {
+ &ett_pop,
+ };
proto_pop = proto_register_protocol("Post Office Protocol", "pop");
proto_register_field_array(proto_pop, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-portmap.c
* Routines for portmap dissection
*
- * $Id: packet-portmap.c,v 1.6 1999/11/15 14:17:19 nneul Exp $
+ * $Id: packet-portmap.c,v 1.7 1999/11/16 11:42:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_portmap_port = -1;
static int hf_portmap_answer = -1;
+static gint ett_portmap = -1;
+
/* Dissect a getport call */
int dissect_getport_call(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree)
"Answer", "portmap.answer", FT_BOOLEAN, BASE_DEC,
NULL, 0, "Answer" }},
};
+ static gint *ett[] = {
+ &ett_portmap,
+ };
proto_portmap = proto_register_protocol("Portmap", "portmap");
proto_register_field_array(proto_portmap, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_portmap, PORTMAP_PROGRAM, ETT_PORTMAP);
+ rpc_init_prog(proto_portmap, PORTMAP_PROGRAM, ett_portmap);
/* Register the procedure tables */
rpc_init_proc_table(PORTMAP_PROGRAM, 1, portmap1_proc);
rpc_init_proc_table(PORTMAP_PROGRAM, 2, portmap2_proc);
rpc_init_proc_table(PORTMAP_PROGRAM, 3, portmap3_proc);
rpc_init_proc_table(PORTMAP_PROGRAM, 4, portmap4_proc);
}
-
/* packet-ppp.c
* Routines for ppp packet disassembly
*
- * $Id: packet-ppp.c,v 1.21 1999/10/12 06:20:14 gram Exp $
+ * $Id: packet-ppp.c,v 1.22 1999/11/16 11:42:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#include "packet-ip.h"
static int proto_ppp = -1;
+
+static gint ett_ppp = -1;
+static gint ett_ipcp = -1;
+static gint ett_ipcp_options = -1;
+static gint ett_ipcp_ipaddrs_opt = -1;
+static gint ett_ipcp_compressprot_opt = -1;
+static gint ett_lcp = -1;
+static gint ett_lcp_options = -1;
+static gint ett_lcp_mru_opt = -1;
+static gint ett_lcp_async_map_opt = -1;
+static gint ett_lcp_authprot_opt = -1;
+static gint ett_lcp_qualprot_opt = -1;
+static gint ett_lcp_magicnum_opt = -1;
+static gint ett_lcp_fcs_alternatives_opt = -1;
+static gint ett_lcp_numbered_mode_opt = -1;
+static gint ett_lcp_callback_opt = -1;
+static gint ett_lcp_multilink_ep_disc_opt = -1;
+static gint ett_lcp_internationalization_opt = -1;
+
static int proto_mp = -1;
static int hf_mp_frag_first = -1;
static int hf_mp_frag_last = -1;
static int hf_mp_sequence_num = -1;
+static int ett_mp = -1;
+static int ett_mp_flags = -1;
+
/* PPP structs and definitions */
typedef struct _e_ppphdr {
{
CI_MRU,
"Maximum Receive Unit",
- ETT_LCP_MRU_OPT,
+ &ett_lcp_mru_opt,
FIXED_LENGTH,
4,
dissect_lcp_mru_opt
{
CI_ASYNCMAP,
"Async Control Character Map",
- ETT_LCP_ASYNC_MAP_OPT,
+ &ett_lcp_async_map_opt,
FIXED_LENGTH,
6,
dissect_lcp_async_map_opt
{
CI_AUTHTYPE,
"Authentication protocol",
- ETT_LCP_AUTHPROT_OPT,
+ &ett_lcp_authprot_opt,
VARIABLE_LENGTH,
4,
dissect_lcp_protocol_opt
{
CI_QUALITY,
"Quality protocol",
- ETT_LCP_QUALPROT_OPT,
+ &ett_lcp_qualprot_opt,
VARIABLE_LENGTH,
4,
dissect_lcp_protocol_opt
{
CI_MAGICNUMBER,
NULL,
- ETT_LCP_MAGICNUM_OPT,
+ &ett_lcp_magicnum_opt,
FIXED_LENGTH,
6,
dissect_lcp_magicnumber_opt
{
CI_PCOMPRESSION,
"Protocol field compression",
- -1,
+ NULL,
FIXED_LENGTH,
2,
NULL
{
CI_ACCOMPRESSION,
"Address/control field compression",
- -1,
+ NULL,
FIXED_LENGTH,
2,
NULL
{
CI_FCS_ALTERNATIVES,
NULL,
- ETT_LCP_FCS_ALTERNATIVES_OPT,
+ &ett_lcp_fcs_alternatives_opt,
FIXED_LENGTH,
3,
dissect_lcp_fcs_alternatives_opt
{
CI_SELF_DESCRIBING_PAD,
NULL,
- -1,
+ NULL,
FIXED_LENGTH,
3,
dissect_lcp_self_describing_pad_opt
{
CI_NUMBERED_MODE,
"Numbered mode",
- ETT_LCP_NUMBERED_MODE_OPT,
+ &ett_lcp_numbered_mode_opt,
VARIABLE_LENGTH,
4,
dissect_lcp_numbered_mode_opt
{
CI_CALLBACK,
"Callback",
- ETT_LCP_CALLBACK_OPT,
+ &ett_lcp_callback_opt,
VARIABLE_LENGTH,
3,
dissect_lcp_callback_opt,
{
CI_COMPOUND_FRAMES,
"Compound frames",
- -1,
+ NULL,
FIXED_LENGTH,
2,
NULL
{
CI_MULTILINK_MRRU,
NULL,
- -1,
+ NULL,
FIXED_LENGTH,
4,
dissect_lcp_multilink_mrru_opt
{
CI_MULTILINK_SSNH,
"Use short sequence number headers",
- -1,
+ NULL,
FIXED_LENGTH,
2,
NULL
{
CI_MULTILINK_EP_DISC,
"Multilink endpoint discriminator",
- ETT_LCP_MULTILINK_EP_DISC_OPT,
+ &ett_lcp_multilink_ep_disc_opt,
VARIABLE_LENGTH,
3,
dissect_lcp_multilink_ep_disc_opt,
{
CI_DCE_IDENTIFIER,
"DCE identifier",
- -1,
+ NULL,
VARIABLE_LENGTH,
2,
NULL
{
CI_MULTILINK_PLUS_PROC,
"Multilink Plus Procedure",
- -1,
+ NULL,
VARIABLE_LENGTH,
2,
NULL
{
CI_LINK_DISC_FOR_BACP,
NULL,
- -1,
+ NULL,
FIXED_LENGTH,
4,
dissect_lcp_bap_link_discriminator_opt
{
CI_LCP_AUTHENTICATION,
"LCP authentication",
- -1,
+ NULL,
VARIABLE_LENGTH,
2,
NULL
{
CI_COBS,
"Consistent Overhead Byte Stuffing",
- -1,
+ NULL,
VARIABLE_LENGTH,
2,
NULL
{
CI_PREFIX_ELISION,
"Prefix elision",
- -1,
+ NULL,
VARIABLE_LENGTH,
2,
NULL
{
CI_MULTILINK_HDR_FMT,
"Multilink header format",
- -1,
+ NULL,
VARIABLE_LENGTH,
2,
NULL
{
CI_INTERNATIONALIZATION,
"Internationalization",
- ETT_LCP_INTERNATIONALIZATION_OPT,
+ &ett_lcp_internationalization_opt,
VARIABLE_LENGTH,
7,
dissect_lcp_internationalization_opt
{
CI_SDL_ON_SONET_SDH,
"Simple data link on SONET/SDH",
- -1,
+ NULL,
VARIABLE_LENGTH,
2,
NULL
{
CI_ADDRS,
"IP addresses (deprecated)",
- ETT_IPCP_IPADDRS_OPT,
+ &ett_ipcp_ipaddrs_opt,
FIXED_LENGTH,
10,
dissect_ipcp_addrs_opt
{
CI_COMPRESSTYPE,
"IP compression protocol",
- ETT_IPCP_COMPRESSPROT_OPT,
+ &ett_ipcp_compressprot_opt,
VARIABLE_LENGTH,
4,
dissect_lcp_protocol_opt
{
CI_ADDR,
"IP address",
- -1,
+ NULL,
FIXED_LENGTH,
6,
dissect_ipcp_addr_opt
{
CI_MOBILE_IPv4,
"Mobile node's home IP address",
- -1,
+ NULL,
FIXED_LENGTH,
6,
dissect_ipcp_addr_opt
{
CI_MS_DNS1,
"Primary DNS server IP address",
- -1,
+ NULL,
FIXED_LENGTH,
6,
dissect_ipcp_addr_opt
{
CI_MS_WINS1,
"Primary WINS server IP address",
- -1,
+ NULL,
FIXED_LENGTH,
6,
dissect_ipcp_addr_opt
{
CI_MS_DNS2,
"Secondary DNS server IP address",
- -1,
+ NULL,
FIXED_LENGTH,
6,
dissect_ipcp_addr_opt
{
CI_MS_WINS2,
"Secondary WINS server IP address",
- -1,
+ NULL,
FIXED_LENGTH,
6,
dissect_ipcp_addr_opt
tf = proto_tree_add_text(tree, offset, length, "%s: %u byte%s",
optp->name, length, plurality(length, "", "s"));
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
offset += 2;
length -= 2;
protocol = pntohs(opd);
alternatives = *opd;
tf = proto_tree_add_text(tree, offset, length, "%s: 0x%02x",
optp->name, alternatives);
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
offset += 2;
if (alternatives & 0x1)
proto_tree_add_text(field_tree, offset + 2, 1, "%s",
tf = proto_tree_add_text(tree, offset, length, "%s: %u byte%s",
optp->name, length, plurality(length, "", "s"));
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
offset += 2;
length -= 2;
proto_tree_add_text(field_tree, offset, 1, "Window: %u", *opd);
tf = proto_tree_add_text(tree, offset, length, "%s: %u byte%s",
optp->name, length, plurality(length, "", "s"));
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
offset += 2;
length -= 2;
proto_tree_add_text(field_tree, offset, 1, "Operation: %s (0x%02x)",
tf = proto_tree_add_text(tree, offset, length, "%s: %u byte%s",
optp->name, length, plurality(length, "", "s"));
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
offset += 2;
length -= 2;
ep_disc_class = *opd;
tf = proto_tree_add_text(tree, offset, length, "%s: %u byte%s",
optp->name, length, plurality(length, "", "s"));
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
offset += 2;
length -= 2;
proto_tree_add_text(field_tree, offset, 4, "Character set: %s (0x%04x)",
tf = proto_tree_add_text(tree, offset, length, "%s: %u byte%s",
optp->name, length, plurality(length, "", "s"));
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
offset += 2;
length -= 2;
proto_tree_add_text(field_tree, offset, 4,
dissect_ipv6(pd, offset, fd, tree);
return TRUE;
case PPP_LCP:
- dissect_cp(pd, offset, "L", "Link", ETT_LCP, lcp_vals, ETT_LCP_OPTIONS,
+ dissect_cp(pd, offset, "L", "Link", ett_lcp, lcp_vals, ett_lcp_options,
lcp_opts, N_LCP_OPTS, fd, tree);
return TRUE;
case PPP_IPCP:
- dissect_cp(pd, offset, "IP", "IP", ETT_IPCP, cp_vals, ETT_IPCP_OPTIONS,
+ dissect_cp(pd, offset, "IP", "IP", ett_ipcp, cp_vals, ett_ipcp_options,
ipcp_opts, N_IPCP_OPTS, fd, tree);
return TRUE;
default:
break;
}
ti = proto_tree_add_item(tree, proto_mp, offset, 4, NULL);
- mp_tree = proto_item_add_subtree(ti, ETT_MP);
+ mp_tree = proto_item_add_subtree(ti, ett_mp);
ti = proto_tree_add_text(mp_tree, offset, 1, "Fragment: 0x%2X (%s)",
flags, flag_str);
- hdr_tree = proto_item_add_subtree(ti, ETT_MP_FLAGS);
+ hdr_tree = proto_item_add_subtree(ti, ett_mp_flags);
proto_tree_add_item_format(hdr_tree, hf_mp_frag_first, offset, 1, first,
"%s", decode_boolean_bitfield(flags, MP_FRAG_FIRST, sizeof(flags) * 8,
"first", "not first"));
if (fd->cap_len > offset) {
if (tree) {
ti = proto_tree_add_item(tree, proto_ppp, offset, 1, NULL);
- fh_tree = proto_item_add_subtree(ti, ETT_PPP);
+ fh_tree = proto_item_add_subtree(ti, ett_ppp);
}
dissect_ppp_stuff(pd, offset, fd, tree, fh_tree);
}
layer (ie none) */
if(tree) {
ti = proto_tree_add_item(tree, proto_ppp, 0+offset, 2, NULL);
- fh_tree = proto_item_add_subtree(ti, ETT_PPP);
+ fh_tree = proto_item_add_subtree(ti, ett_ppp);
}
dissect_ppp_stuff(pd, offset, fd, tree, fh_tree);
layer (ie none) */
if(tree) {
ti = proto_tree_add_item(tree, proto_ppp, 0, 4, NULL);
- fh_tree = proto_item_add_subtree(ti, ETT_PPP);
+ fh_tree = proto_item_add_subtree(ti, ett_ppp);
proto_tree_add_text(fh_tree, 0, 1, "Address: %02x", ph.ppp_addr);
proto_tree_add_text(fh_tree, 1, 1, "Control: %02x", ph.ppp_ctl);
}
{ &variable,
{ "Name", "ppp.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_ppp,
+ &ett_ipcp,
+ &ett_ipcp_options,
+ &ett_ipcp_ipaddrs_opt,
+ &ett_ipcp_compressprot_opt,
+ &ett_lcp,
+ &ett_lcp_options,
+ &ett_lcp_mru_opt,
+ &ett_lcp_async_map_opt,
+ &ett_lcp_authprot_opt,
+ &ett_lcp_qualprot_opt,
+ &ett_lcp_magicnum_opt,
+ &ett_lcp_fcs_alternatives_opt,
+ &ett_lcp_numbered_mode_opt,
+ &ett_lcp_callback_opt,
+ &ett_lcp_multilink_ep_disc_opt,
+ &ett_lcp_internationalization_opt,
+ };
proto_ppp = proto_register_protocol("Point-to-Point Protocol", "ppp");
/* proto_register_field_array(proto_ppp, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
void
{ "Sequence number", "mp.seq", FT_UINT32, BASE_DEC, NULL, 0x0,
"" }}
};
+ static gint *ett[] = {
+ &ett_mp,
+ &ett_mp_flags,
+ };
proto_mp = proto_register_protocol("PPP Multilink Protocol", "mp");
proto_register_field_array(proto_mp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-arp.c
* Routines for ARP packet disassembly
*
- * $Id: packet-pppoe.c,v 1.3 1999/08/24 17:26:13 gram Exp $
+ * $Id: packet-pppoe.c,v 1.4 1999/11/16 11:42:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#include <glib.h>
#include "packet.h"
+static gint ett_pppoed = -1;
+static gint ett_pppoed_tags = -1;
+
/* For lack of a better source, I made up the following defines. -jsj */
#define PPPOE_CODE_SESSION 0x00
if (tree) {
ti = proto_tree_add_text(tree,offset,payload_length,"PPPoE Tags");
- pppoe_tree = proto_item_add_subtree(ti, ETT_PPPOED_TAGS);
+ pppoe_tree = proto_item_add_subtree(ti, ett_pppoed_tags);
tagstart = offset;
while(tagstart <= payload_length-2 ) {
if (tree) {
ti = proto_tree_add_text(tree,offset,pppoe_length+6,"PPPoE Discovery");
- pppoe_tree = proto_item_add_subtree(ti, ETT_PPPOED);
+ pppoe_tree = proto_item_add_subtree(ti, ett_pppoed);
proto_tree_add_text(pppoe_tree,offset,1,
"Version: %d", pppoe_ver);
proto_tree_add_text(pppoe_tree,offset,1,
if (tree) {
ti = proto_tree_add_text(tree,offset,pppoe_length+6,"PPPoE Session");
- pppoe_tree = proto_item_add_subtree(ti, ETT_PPPOED);
+ pppoe_tree = proto_item_add_subtree(ti, ett_pppoed);
proto_tree_add_text(pppoe_tree,offset,1,
"Version: %d", pppoe_ver);
proto_tree_add_text(pppoe_tree,offset,1,
dissect_payload_ppp(pd,offset+6,fd,tree);
}
+
+void
+proto_register_pppoed(void)
+{
+ static gint *ett[] = {
+ &ett_pppoed,
+ &ett_pppoed_tags,
+ };
+
+ proto_register_subtree_array(ett, array_length(ett));
+}
+
* Routines for the Point-to-Point Tunnelling Protocol (PPTP)
* Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
*
- * $Id: packet-pptp.c,v 1.5 1999/09/17 05:56:55 guy Exp $
+ * $Id: packet-pptp.c,v 1.6 1999/11/16 11:42:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
#include <glib.h>
#include "packet.h"
+static gint ett_pptp = -1;
+
#define NUM_MSG_TYPES 3
#define msgtype2str(t) \
((t < NUM_MSG_TYPES) ? msgtypestr[t] : "UNKNOWN-MESSAGES-TYPE")
proto_tree * pptp_tree;
ti = proto_tree_add_text(tree, offset, len, "PPTP Control Channel");
- pptp_tree = proto_item_add_subtree(ti, ETT_PPTP);
+ pptp_tree = proto_item_add_subtree(ti, ett_pptp);
proto_tree_add_text(pptp_tree, offset, sizeof(hdr->len),
"Length: %u", len);
"Recv ACCM: %#08x", hdr->recv_acm);
offset += sizeof(hdr->recv_acm);
}
+
+void
+proto_register_pptp(void)
+{
+ static gint *ett[] = {
+ &ett_pptp,
+ };
+
+ proto_register_subtree_array(ett, array_length(ett));
+}
* Routines for Q.931 frame disassembly
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-q931.c,v 1.5 1999/11/13 10:13:24 guy Exp $
+ * $Id: packet-q931.c,v 1.6 1999/11/16 11:42:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
* http://www.tulatelecom.ru/staff/german/DSSHelp/MessList/InfEl/InfElList.html
*/
-int proto_q931 = -1;
-int hf_q931_discriminator = -1;
-int hf_q931_call_ref_len = -1;
-int hf_q931_call_ref = -1;
-int hf_q931_message_type = -1;
+static int proto_q931 = -1;
+static int hf_q931_discriminator = -1;
+static int hf_q931_call_ref_len = -1;
+static int hf_q931_call_ref = -1;
+static int hf_q931_message_type = -1;
+
+static gint ett_q931 = -1;
+static gint ett_q931_ie = -1;
/*
* Q.931 message types.
if (tree) {
ti = proto_tree_add_item(tree, proto_q931, offset, 3, NULL);
- q931_tree = proto_item_add_subtree(ti, ETT_Q931);
+ q931_tree = proto_item_add_subtree(ti, ett_q931);
proto_tree_add_item(q931_tree, hf_q931_discriminator, offset, 1, pd[offset]);
}
1+1+info_element_len, "%s",
val_to_str(info_element, q931_info_element_vals,
"Unknown information element (0x%02X)"));
- ie_tree = proto_item_add_subtree(ti, ETT_Q931_IE);
+ ie_tree = proto_item_add_subtree(ti, ett_q931_ie);
proto_tree_add_text(ie_tree, offset, 1,
"Information element: %s",
val_to_str(info_element, q931_info_element_vals,
"" }},
};
+ static gint *ett[] = {
+ &ett_q931,
+ &ett_q931_ie,
+ };
proto_q931 = proto_register_protocol ("Q.931", "q931");
proto_register_field_array (proto_q931, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-radius.c
* Routines for RADIUS packet disassembly
*
- * $Id: packet-radius.c,v 1.4 1999/10/12 06:20:15 gram Exp $
+ * $Id: packet-radius.c,v 1.5 1999/11/16 11:42:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Johan Feyaerts
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-int proto_radius = -1;
-int hf_radius_length = -1;
-int hf_radius_code = -1;
-int hf_radius_id =-1;
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "packet.h"
#include "resolv.h"
+static int proto_radius = -1;
+static int hf_radius_length = -1;
+static int hf_radius_code = -1;
+static int hf_radius_id =-1;
+
+static gint ett_radius = -1;
+static gint ett_radius_avp = -1;
+
typedef struct _e_radiushdr {
guint8 rh_code;
guint8 rh_ident;
ti = proto_tree_add_item(tree,proto_radius, offset, rhlength,
NULL);
- radius_tree = proto_item_add_subtree(ti, ETT_RADIUS);
+ radius_tree = proto_item_add_subtree(ti, ett_radius);
proto_tree_add_item_format(radius_tree,hf_radius_code, offset, 1,
rh.rh_code, "Packet code:0x%01x (%s)",rhcode, codestrval);
avptf = proto_tree_add_text(radius_tree
,offset+hdrlength,avplength,
"Attribute value pairs");
- avptree = proto_item_add_subtree(avptf, ETT_RADIUS_AVP);
+ avptree = proto_item_add_subtree(avptf, ett_radius_avp);
if (avptree !=NULL)
{
{ "Length","radius.length", FT_UINT16, BASE_DEC, NULL, 0x0,
"" }}
};
+ static gint *ett[] = {
+ &ett_radius,
+ &ett_radius_avp,
+ };
proto_radius = proto_register_protocol ("Radius Protocol", "radius");
proto_register_field_array(proto_radius, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
-
/* packet-raw.c
* Routines for raw packet disassembly
*
- * $Id: packet-raw.c,v 1.10 1999/07/07 22:51:52 gram Exp $
+ * $Id: packet-raw.c,v 1.11 1999/11/16 11:42:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#include <glib.h>
#include "packet.h"
+static gint ett_raw = -1;
+
void
capture_raw( const u_char *pd, guint32 cap_len, packet_counts *ld ) {
layer (ie none) */
if(tree) {
ti = proto_tree_add_text(tree, 0, 0, "Raw packet data" );
- fh_tree = proto_item_add_subtree(ti, ETT_RAW);
+ fh_tree = proto_item_add_subtree(ti, ett_raw);
proto_tree_add_text(fh_tree, 0, 0, "No link information available");
}
dissect_ip(pd, 0, fd, tree);
}
+void
+proto_register_raw(void)
+{
+ static gint *ett[] = {
+ &ett_raw,
+ };
+
+ proto_register_subtree_array(ett, array_length(ett));
+}
* Routines for RIPv1 and RIPv2 packet disassembly
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-rip.c,v 1.12 1999/08/26 07:34:40 guy Exp $
+ * $Id: packet-rip.c,v 1.13 1999/11/16 11:42:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int proto_rip = -1;
+static gint ett_rip = -1;
+static gint ett_rip_vec = -1;
+
static void dissect_ip_rip_vektor(guint8 version,
const e_rip_vektor *rip_vektor, int offset, proto_tree *tree);
static void dissect_rip_authentication(const e_rip_authentication *rip_authentication,
if (tree) {
ti = proto_tree_add_item(tree, proto_rip, offset, END_OF_FRAME, NULL);
- rip_tree = proto_item_add_subtree(ti, ETT_RIP);
+ rip_tree = proto_item_add_subtree(ti, ett_rip);
proto_tree_add_text(rip_tree, offset, 1, "Command: %d (%s)", rip_header.command, packet_type[rip_header.command]);
proto_tree_add_text(rip_tree, offset + 1, 1, "Version: %d", rip_header.version);
{
proto_tree *rip_vektor_tree;
- rip_vektor_tree = proto_item_add_subtree(tree, ETT_RIP_VEC);
+ rip_vektor_tree = proto_item_add_subtree(tree, ett_rip_vec);
proto_tree_add_text(rip_vektor_tree, offset, 2, "Address Family ID: IP");
if(version == RIPv2)
proto_tree *rip_authentication_tree;
guint16 authtype;
- rip_authentication_tree = proto_item_add_subtree(tree, ETT_RIP_VEC);
+ rip_authentication_tree = proto_item_add_subtree(tree, ett_rip_vec);
authtype = ntohs(rip_authentication->authtype);
proto_tree_add_text(rip_authentication_tree, offset + 2, 2,
{ &variable,
{ "Name", "rip.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_rip,
+ &ett_rip_vec,
+ };
proto_rip = proto_register_protocol("Routing Information Protocol", "rip");
/* proto_register_field_array(proto_rip, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
* (c) Copyright Jun-ichiro itojun Hagino <itojun@itojun.org>
* derived from packet-rip.c
*
- * $Id: packet-ripng.c,v 1.5 1999/10/18 00:37:35 itojun Exp $
+ * $Id: packet-ripng.c,v 1.6 1999/11/16 11:42:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_ripng_cmd = -1;
static int hf_ripng_version = -1;
+static gint ett_ripng = -1;
+static gint ett_ripng_addr = -1;
+
void
dissect_ripng(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
struct rip6 rip6;
if (tree) {
ti = proto_tree_add_item(tree, proto_ripng, offset, END_OF_FRAME, NULL);
- ripng_tree = proto_item_add_subtree(ti, ETT_RIPNG);
+ ripng_tree = proto_item_add_subtree(ti, ett_ripng);
proto_tree_add_item_format(ripng_tree, hf_ripng_cmd, offset, 1,
rip6.rip6_cmd,
ni6.rip6_plen,
ni6.rip6_metric);
}
- subtree = proto_item_add_subtree(ti, ETT_RIPNG_ADDR);
+ subtree = proto_item_add_subtree(ti, ett_ripng_addr);
proto_tree_add_text(subtree,
offset + offsetof(struct netinfo6, rip6_dest),
sizeof(ni6.rip6_dest), "IP Address: %s",
{ "Version", "ripng.version",
FT_UINT8, BASE_DEC, NULL, 0x0, "" }},
};
+ static gint *ett[] = {
+ &ett_ripng,
+ &ett_ripng_addr,
+ };
proto_ripng = proto_register_protocol("RIPng", "ripng");
proto_register_field_array(proto_ripng, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for rpc dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
- * $Id: packet-rpc.c,v 1.15 1999/11/15 17:16:51 nneul Exp $
+ * $Id: packet-rpc.c,v 1.16 1999/11/16 11:42:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
#include "packet-rpc.h"
-const value_string rpc_msg_type[3] = {
+static const value_string rpc_msg_type[3] = {
{ RPC_CALL, "Call" },
{ RPC_REPLY, "Reply" },
{ 0, NULL }
};
-const value_string rpc_reply_state[3] = {
+static const value_string rpc_reply_state[3] = {
{ MSG_ACCEPTED, "accepted" },
{ MSG_DENIED, "denied" },
{ 0, NULL }
};
-const value_string rpc_auth_flavor[5] = {
+static const value_string rpc_auth_flavor[5] = {
{ AUTH_NULL, "AUTH_NULL" },
{ AUTH_UNIX, "AUTH_UNIX" },
{ AUTH_SHORT, "AUTH_SHORT" },
{ 0, NULL }
};
-const value_string rpc_accept_state[6] = {
+static const value_string rpc_accept_state[6] = {
{ SUCCESS, "RPC executed successfully" },
{ PROG_UNAVAIL, "remote hasn't exported program" },
{ PROG_MISMATCH, "remote can't support version #" },
{ 0, NULL }
};
-const value_string rpc_reject_state[3] = {
+static const value_string rpc_reject_state[3] = {
{ RPC_MISMATCH, "RPC_MISMATCH" },
{ AUTH_ERROR, "AUTH_ERROR" },
{ 0, NULL }
};
-const value_string rpc_auth_state[6] = {
+static const value_string rpc_auth_state[6] = {
{ AUTH_BADCRED, "bad credential (seal broken)" },
{ AUTH_REJECTEDCRED, "client must begin new session" },
{ AUTH_BADVERF, "bad verifier (seal broken)" },
static int hf_rpc_state_reject = -1;
static int hf_rpc_state_auth = -1;
+static gint ett_rpc = -1;
+static gint ett_rpc_string = -1;
+static gint ett_rpc_cred = -1;
+static gint ett_rpc_verf = -1;
+static gint ett_rpc_gids = -1;
/* Hash table with info on RPC program numbers */
-GHashTable *rpc_progs;
+static GHashTable *rpc_progs;
/* Hash table with info on RPC procedure numbers */
-GHashTable *rpc_procs;
+static GHashTable *rpc_procs;
/***********************************/
proto_tree_add_item_hidden(tree, hfindex, offset+4,
string_length, string_buffer);
if (string_item) {
- string_tree = proto_item_add_subtree(string_item, ETT_RPC_STRING);
+ string_tree = proto_item_add_subtree(string_item, ett_rpc_string);
}
}
if (string_tree) {
gids_count = EXTRACT_UINT(pd,offset+0);
if (tree) {
gitem = proto_tree_add_text(tree, offset, 4+gids_count*4,
- "Auxilliary GIDs");
- gtree = proto_item_add_subtree(gitem, ETT_RPC_GIDS);
+ "Auxiliary GIDs");
+ gtree = proto_item_add_subtree(gitem, ett_rpc_gids);
}
offset += 4;
if (!BYTES_ARE_IN_FRAME(offset,4*gids_count)) return;
if (tree) {
citem = proto_tree_add_text(tree, offset, 8+length_full,
"Credentials");
- ctree = proto_item_add_subtree(citem, ETT_RPC_CRED);
+ ctree = proto_item_add_subtree(citem, ett_rpc_cred);
dissect_rpc_auth(pd, offset, fd, ctree);
}
offset += 8 + length_full;
if (tree) {
vitem = proto_tree_add_text(tree, offset, 8+length_full,
"Verifier");
- vtree = proto_item_add_subtree(vitem, ETT_RPC_VERF);
+ vtree = proto_item_add_subtree(vitem, ett_rpc_verf);
dissect_rpc_auth(pd, offset, fd, vtree);
}
offset += 8 + length_full;
if (tree) {
rpc_item = proto_tree_add_item(tree, proto_rpc, offset, END_OF_FRAME, NULL);
if (rpc_item) {
- rpc_tree = proto_item_add_subtree(rpc_item, ETT_RPC);
+ rpc_tree = proto_item_add_subtree(rpc_item, ett_rpc);
}
}
"Machine Name", "rpc.auth.machinename", FT_STRING,
BASE_DEC, NULL, 0, "Machine Name" }},
};
-
+ static gint *ett[] = {
+ &ett_rpc,
+ &ett_rpc_string,
+ &ett_rpc_cred,
+ &ett_rpc_verf,
+ &ett_rpc_gids,
+ };
proto_rpc = proto_register_protocol("Remote Procedure Call", "rpc");
proto_register_field_array(proto_rpc, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-rpc.h (c) 1999 Uwe Girlich */
-/* $Id: packet-rpc.h,v 1.6 1999/11/15 17:16:51 nneul Exp $ */
+/* $Id: packet-rpc.h,v 1.7 1999/11/16 11:42:52 guy Exp $ */
#ifndef __PACKET_RPC_H__
#define __PACKET_RPC_H__
typedef int (dissect_function_t)(const u_char* pd, int offset, frame_data* fd, proto_tree* tree);
-extern GHashTable *rpc_progs;
-
typedef struct _vsff {
guint32 value;
gchar *strptr;
*
* (c) Copyright Ashok Narayanan <ashokn@cisco.com>
*
- * $Id: packet-rsvp.c,v 1.9 1999/10/12 06:20:16 gram Exp $
+ * $Id: packet-rsvp.c,v 1.10 1999/11/16 11:42:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int proto_rsvp = -1;
+static gint ett_rsvp = -1;
+static gint ett_rsvp_hdr = -1;
+static gint ett_rsvp_session = -1;
+static gint ett_rsvp_hop = -1;
+static gint ett_rsvp_time_values = -1;
+static gint ett_rsvp_error = -1;
+static gint ett_rsvp_scope = -1;
+static gint ett_rsvp_style = -1;
+static gint ett_rsvp_confirm = -1;
+static gint ett_rsvp_sender_template = -1;
+static gint ett_rsvp_filter_spec = -1;
+static gint ett_rsvp_sender_tspec = -1;
+static gint ett_rsvp_flowspec = -1;
+static gint ett_rsvp_adspec = -1;
+static gint ett_rsvp_adspec_subtree = -1;
+static gint ett_rsvp_integrity = -1;
+static gint ett_rsvp_policy = -1;
+static gint ett_rsvp_unknown_class = -1;
+
/* Stuff for IEEE float handling */
#define IEEE_NUMBER_WIDTH 32 /* bits in number */
if (tree) {
msg_length = pntohs(pd+offset+6);
ti = proto_tree_add_item(tree, proto_rsvp, offset, msg_length, NULL);
- rsvp_tree = proto_item_add_subtree(ti, ETT_RSVP);
+ rsvp_tree = proto_item_add_subtree(ti, ett_rsvp);
ti = proto_tree_add_text(rsvp_tree, offset,
sizeof(rsvp_header), "RSVP Header");
- rsvp_header_tree = proto_item_add_subtree(ti, ETT_RSVP_HDR);
+ rsvp_header_tree = proto_item_add_subtree(ti, ett_rsvp_hdr);
proto_tree_add_text(rsvp_header_tree, offset, 1, "RSVP Version: %d",
(hdr->ver_flags & 0xf0)>>4);
switch(obj->class) {
case RSVP_CLASS_SESSION :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_SESSION);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_session);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
break;
case RSVP_CLASS_HOP :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_HOP);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_hop);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
break;
case RSVP_CLASS_TIME_VALUES :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_TIME_VALUES);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_time_values);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
break;
case RSVP_CLASS_ERROR :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_ERROR);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_error);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
case RSVP_CLASS_SCOPE :
mylen = obj_length;
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_SCOPE);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_scope);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
break;
case RSVP_CLASS_STYLE :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_STYLE);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_style);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
break;
case RSVP_CLASS_CONFIRM :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_CONFIRM);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_confirm);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
break;
case RSVP_CLASS_SENDER_TEMPLATE :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_SENDER_TEMPLATE);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_sender_template);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
obj->class, object_type);
goto common_template;
case RSVP_CLASS_FILTER_SPEC :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_FILTER_SPEC);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_filter_spec);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
char *str;
mylen = obj_length;
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_SENDER_TSPEC);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_sender_tspec);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
char *str;
mylen = obj_length;
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_FLOWSPEC);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_flowspec);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
param_hdr *phdr;
char *str;
- int tree_num;
mylen = obj_length;
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_ADSPEC);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_adspec);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
"Data length: %d words, not including header",
pntohs(pd+offset2+2));
offset2+=4;
- tree_num=ETT_RSVP_ADSPEC_SUBTREE1;
mylen -= 4;
while (mylen > 4) {
shdr = (service_hdr *)(pd + offset2);
ti = proto_tree_add_text(rsvp_object_tree, offset2,
(pntohs(&shdr->length)+1)<<2,
str?str:"Unknown");
- adspec_tree = proto_item_add_subtree(ti, tree_num++);
+ adspec_tree = proto_item_add_subtree(ti,
+ ett_rsvp_adspec_subtree);
proto_tree_add_text(adspec_tree, offset2, 1,
"Service header %d - %s",
shdr->service_num, str);
}
case RSVP_CLASS_INTEGRITY :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_INTEGRITY);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_integrity);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
goto default_class;
case RSVP_CLASS_POLICY :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_POLICY);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_policy);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
goto default_class;
default :
- rsvp_object_tree = proto_item_add_subtree(ti, ETT_RSVP_UNKNOWN_CLASS);
+ rsvp_object_tree = proto_item_add_subtree(ti, ett_rsvp_unknown_class);
proto_tree_add_text(rsvp_object_tree, offset, 2, "Length: %d",
obj_length);
proto_tree_add_text(rsvp_object_tree, offset+2, 1,
void
proto_register_rsvp(void)
{
+ static gint *ett[] = {
+ &ett_rsvp,
+ &ett_rsvp_hdr,
+ &ett_rsvp_session,
+ &ett_rsvp_hop,
+ &ett_rsvp_time_values,
+ &ett_rsvp_error,
+ &ett_rsvp_scope,
+ &ett_rsvp_style,
+ &ett_rsvp_confirm,
+ &ett_rsvp_sender_template,
+ &ett_rsvp_filter_spec,
+ &ett_rsvp_sender_tspec,
+ &ett_rsvp_flowspec,
+ &ett_rsvp_adspec,
+ &ett_rsvp_adspec_subtree,
+ &ett_rsvp_integrity,
+ &ett_rsvp_policy,
+ &ett_rsvp_unknown_class,
+ };
+
proto_rsvp = proto_register_protocol("Resource ReserVation Protocol (RSVP)", "rsvp");
proto_register_field_array(proto_rsvp, rsvpf_info, array_length(rsvpf_info));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Jason Lango <jal@netapp.com>
* Liberally copied from packet-http.c, by Guy Harris <guy@netapp.com>
*
- * $Id: packet-rtsp.c,v 1.3 1999/07/29 05:47:03 gram Exp $
+ * $Id: packet-rtsp.c,v 1.4 1999/11/16 11:42:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int proto_rtsp = -1;
+static gint ett_rtsp = -1;
+
static int is_rtsp_request_or_reply(const u_char *data, int linelen);
static int
if (tree) {
ti = proto_tree_add_item(tree, proto_rtsp, offset, END_OF_FRAME, NULL);
- rtsp_tree = proto_item_add_subtree(ti, ETT_RTSP);
+ rtsp_tree = proto_item_add_subtree(ti, ett_rtsp);
}
while (data < dataend) {
{ &variable,
{ "Name", "rtsp.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_rtsp,
+ };
proto_rtsp = proto_register_protocol("Real Time Streaming Protocol", "rtsp");
/* proto_register_field_array(proto_rtsp, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
* Based on routines from tcpdump patches by
* Ken Hornstein <kenh@cmf.nrl.navy.mil>
*
- * $Id: packet-rx.c,v 1.3 1999/10/28 15:08:42 nneul Exp $
+ * $Id: packet-rx.c,v 1.4 1999/11/16 11:42:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_rx_spare = -1;
static int hf_rx_serviceid = -1;
+static gint ett_rx = -1;
+static gint ett_rx_flags = -1;
+
void
dissect_rx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
if (tree) {
ti = proto_tree_add_item(tree, proto_rx, offset,
sizeof(struct rx_header), NULL);
- rx_tree = proto_item_add_subtree(ti, ETT_RX);
+ rx_tree = proto_item_add_subtree(ti, ett_rx);
proto_tree_add_item(rx_tree, hf_rx_epoch,
offset, 4, ntohl(rxh->epoch));
rx_flags = proto_tree_add_item(rx_tree, hf_rx_flags,
offset+21, 1, rxh->flags);
- rx_tree_flags = proto_item_add_subtree(rx_flags, ETT_RX_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,
offset+21, 1, rxh->flags);
proto_tree_add_item(rx_tree_flags, hf_rx_flags_more_packets,
"Service ID", "rx.serviceid", FT_UINT16, BASE_DEC,
NULL, 0, "Service ID" }},
};
+ static gint *ett[] = {
+ &ett_rx,
+ &ett_rx_flags,
+ };
proto_rx = proto_register_protocol("RX Protocol", "rx");
proto_register_field_array(proto_rx, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Jason Lango <jal@netapp.com>
* Liberally copied from packet-http.c, by Guy Harris <guy@netapp.com>
*
- * $Id: packet-sdp.c,v 1.3 1999/07/29 05:47:03 gram Exp $
+ * $Id: packet-sdp.c,v 1.4 1999/11/16 11:42:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int proto_sdp = -1;
+static int ett_sdp = -1;
+
void dissect_sdp(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree)
{
return;
ti = proto_tree_add_item(tree, proto_sdp, offset, END_OF_FRAME, NULL);
- sdp_tree = proto_item_add_subtree(ti, ETT_SDP);
+ sdp_tree = proto_item_add_subtree(ti, ett_sdp);
section = 0;
for (; data < dataend; offset += linelen, data = lineend) {
{ &variable,
{ "Name", "sdp.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_sdp,
+ };
proto_sdp = proto_register_protocol("Session Description Protocol", "sdp");
/* proto_register_field_array(proto_sdp, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for smb packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-smb.c,v 1.38 1999/11/16 07:58:12 sharpe Exp $
+ * $Id: packet-smb.c,v 1.39 1999/11/16 11:42:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
#include "alignment.h"
static int proto_smb = -1;
+
+static gint ett_smb = -1;
+static gint ett_smb_fileattributes = -1;
+static gint ett_smb_capabilities = -1;
+static gint ett_smb_aflags = -1;
+static gint ett_smb_dialects = -1;
+static gint ett_smb_mode = -1;
+static gint ett_smb_rawmode = -1;
+static gint ett_smb_flags = -1;
+static gint ett_smb_flags2 = -1;
+static gint ett_smb_desiredaccess = -1;
+static gint ett_smb_search = -1;
+static gint ett_smb_file = -1;
+static gint ett_smb_openfunction = -1;
+static gint ett_smb_filetype = -1;
+static gint ett_smb_action = -1;
+static gint ett_smb_writemode = -1;
+static gint ett_smb_lock_type = -1;
+
static int proto_browse = -1;
+static gint ett_browse = -1;
+static gint ett_browse_flags = -1;
+
/*
* Struct passed to each SMB decode routine of info it may need
*/
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Attributes: 0x%02x", Attributes);
- Attributes_tree = proto_item_add_subtree(ti, ETT_SMB_FILEATTRIBUTES);
+ Attributes_tree = proto_item_add_subtree(ti, ett_smb_fileattributes);
proto_tree_add_text(Attributes_tree, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x01, 16, "Read-only file", "Not a read-only file"));
proto_tree_add_text(Attributes_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Attributes: 0x%02x", Attributes);
- Attributes_tree = proto_item_add_subtree(ti, ETT_SMB_FILEATTRIBUTES);
+ Attributes_tree = proto_item_add_subtree(ti, ett_smb_fileattributes);
proto_tree_add_text(Attributes_tree, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x01, 16, "Read-only file", "Not a read-only file"));
proto_tree_add_text(Attributes_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 4, "Capabilities: 0x%04x", Capabilities);
- Capabilities_tree = proto_item_add_subtree(ti, ETT_SMB_CAPABILITIES);
+ Capabilities_tree = proto_item_add_subtree(ti, ett_smb_capabilities);
proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0001, 32, " Raw Mode supported", " Raw Mode not supported"));
proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Additional Flags: 0x%02x", flags);
- flags_tree = proto_item_add_subtree(ti, ETT_SMB_AFLAGS);
+ flags_tree = proto_item_add_subtree(ti, ett_smb_aflags);
proto_tree_add_text(flags_tree, offset, 2, "%s",
decode_boolean_bitfield(flags, 0x01, 16,
"Disconnect TID",
if (tree) {
ti = proto_tree_add_text(tree, offset, END_OF_FRAME, "Dialects");
- dialects = proto_item_add_subtree(ti, ETT_SMB_DIALECTS);
+ dialects = proto_item_add_subtree(ti, ett_smb_dialects);
}
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Security Mode: 0x%04x", mode);
- mode_tree = proto_item_add_subtree(ti, ETT_SMB_MODE);
+ mode_tree = proto_item_add_subtree(ti, ett_smb_mode);
proto_tree_add_text(mode_tree, offset, 2, "%s",
decode_boolean_bitfield(mode, 0x0001, 16,
"Security = User",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Raw Mode: 0x%04x", rawmode);
- rawmode_tree = proto_item_add_subtree(ti, ETT_SMB_RAWMODE);
+ rawmode_tree = proto_item_add_subtree(ti, ett_smb_rawmode);
proto_tree_add_text(rawmode_tree, offset, 2, "%s",
decode_boolean_bitfield(rawmode, 0x01, 16,
"Read Raw supported",
if (tree) {
ti = proto_tree_add_text(tree, offset, 1, "Security Mode: 0x%02x", mode);
- mode_tree = proto_item_add_subtree(ti, ETT_SMB_MODE);
+ mode_tree = proto_item_add_subtree(ti, ett_smb_mode);
proto_tree_add_text(mode_tree, offset, 1, "%s",
decode_boolean_bitfield(mode, 0x01, 8,
"Security = User",
if (tree) {
ti = proto_tree_add_text(tree, offset, 4, "Capabilities: 0x%04x", caps);
- caps_tree = proto_item_add_subtree(ti, ETT_SMB_CAPABILITIES);
+ caps_tree = proto_item_add_subtree(ti, ett_smb_capabilities);
proto_tree_add_text(caps_tree, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0001, 32,
"Raw Mode supported",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Flags: 0x%02x", Flags);
- Flags_tree = proto_item_add_subtree(ti, ETT_SMB_FLAGS);
+ Flags_tree = proto_item_add_subtree(ti, ett_smb_flags);
proto_tree_add_text(Flags_tree, offset, 2, "%s",
decode_boolean_bitfield(Flags, 0x01, 16, "Dont Return Additional Info", "Return Additional Info"));
proto_tree_add_text(Flags_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Desired Access: 0x%02x", DesiredAccess);
- DesiredAccess_tree = proto_item_add_subtree(ti, ETT_SMB_DESIREDACCESS);
+ DesiredAccess_tree = proto_item_add_subtree(ti, ett_smb_desiredaccess);
proto_tree_add_text(DesiredAccess_tree, offset, 2, "%s",
decode_enumerated_bitfield(DesiredAccess, 0x07, 16, DesiredAccess_0x07, "%s"));
proto_tree_add_text(DesiredAccess_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Search: 0x%02x", Search);
- Search_tree = proto_item_add_subtree(ti, ETT_SMB_SEARCH);
+ Search_tree = proto_item_add_subtree(ti, ett_smb_search);
proto_tree_add_text(Search_tree, offset, 2, "%s",
decode_boolean_bitfield(Search, 0x01, 16, "Read only file", "Not a read only file"));
proto_tree_add_text(Search_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "File: 0x%02x", File);
- File_tree = proto_item_add_subtree(ti, ETT_SMB_FILE);
+ File_tree = proto_item_add_subtree(ti, ett_smb_file);
proto_tree_add_text(File_tree, offset, 2, "%s",
decode_boolean_bitfield(File, 0x01, 16, "Read only file", "Not a read only file"));
proto_tree_add_text(File_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Open Function: 0x%02x", OpenFunction);
- OpenFunction_tree = proto_item_add_subtree(ti, ETT_SMB_OPENFUNCTION);
+ OpenFunction_tree = proto_item_add_subtree(ti, ett_smb_openfunction);
proto_tree_add_text(OpenFunction_tree, offset, 2, "%s",
decode_enumerated_bitfield(OpenFunction, 0x10, 16, OpenFunction_0x10, "%s"));
proto_tree_add_text(OpenFunction_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "FileAttributes: 0x%02x", FileAttributes);
- FileAttributes_tree = proto_item_add_subtree(ti, ETT_SMB_FILEATTRIBUTES);
+ FileAttributes_tree = proto_item_add_subtree(ti, ett_smb_fileattributes);
proto_tree_add_text(FileAttributes_tree, offset, 2, "%s",
decode_boolean_bitfield(FileAttributes, 0x01, 16, "Read only file", "Not a read only file"));
proto_tree_add_text(FileAttributes_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "File Type: 0x%02x", FileType);
- FileType_tree = proto_item_add_subtree(ti, ETT_SMB_FILETYPE);
+ FileType_tree = proto_item_add_subtree(ti, ett_smb_filetype);
proto_tree_add_text(FileType_tree, offset, 2, "%s",
decode_enumerated_bitfield(FileType, 0xFFFF, 16, FileType_0xFFFF, "%s"));
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Action: 0x%02x", Action);
- Action_tree = proto_item_add_subtree(ti, ETT_SMB_ACTION);
+ Action_tree = proto_item_add_subtree(ti, ett_smb_action);
proto_tree_add_text(Action_tree, offset, 2, "%s",
decode_enumerated_bitfield(Action, 0x8000, 16, Action_0x8000, "%s"));
proto_tree_add_text(Action_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "WriteMode: 0x%02x", WriteMode);
- WriteMode_tree = proto_item_add_subtree(ti, ETT_SMB_WRITEMODE);
+ WriteMode_tree = proto_item_add_subtree(ti, ett_smb_writemode);
proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
decode_boolean_bitfield(WriteMode, 0x01, 16, "Write through requested", "Write through not requested"));
proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "WriteMode: 0x%02x", WriteMode);
- WriteMode_tree = proto_item_add_subtree(ti, ETT_SMB_WRITEMODE);
+ WriteMode_tree = proto_item_add_subtree(ti, ett_smb_writemode);
proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
decode_boolean_bitfield(WriteMode, 0x01, 16, "Write through requested", "Write through not requested"));
proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Flags: 0x%02x", Flags);
- Flags_tree = proto_item_add_subtree(ti, ETT_SMB_FLAGS);
+ Flags_tree = proto_item_add_subtree(ti, ett_smb_flags);
proto_tree_add_text(Flags_tree, offset, 2, "%s",
decode_enumerated_bitfield(Flags, 0x03, 16, Flags_0x03, "%s"));
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Mode: 0x%02x", Mode);
- Mode_tree = proto_item_add_subtree(ti, ETT_SMB_MODE);
+ Mode_tree = proto_item_add_subtree(ti, ett_smb_mode);
proto_tree_add_text(Mode_tree, offset, 2, "%s",
decode_enumerated_bitfield(Mode, 0x03, 16, Mode_0x03, "%s"));
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Mode: 0x%02x", Mode);
- Mode_tree = proto_item_add_subtree(ti, ETT_SMB_MODE);
+ Mode_tree = proto_item_add_subtree(ti, ett_smb_mode);
proto_tree_add_text(Mode_tree, offset, 2, "%s",
decode_enumerated_bitfield(Mode, 0x03, 16, Mode_0x03, "%s"));
if (tree) {
ti = proto_tree_add_text(tree, offset, 1, "Lock Type: 0x%01x", LockType);
- LockType_tree = proto_item_add_subtree(ti, ETT_SMB_LOCK_TYPE);
+ LockType_tree = proto_item_add_subtree(ti, ett_smb_lock_type);
proto_tree_add_text(LockType_tree, offset, 1, "%s",
decode_boolean_bitfield(LockType, 0x01, 16, "Read-only lock", "Not a Read-only lock"));
proto_tree_add_text(LockType_tree, offset, 1, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Attributes: 0x%02x", Attributes);
- Attributes_tree = proto_item_add_subtree(ti, ETT_SMB_FILEATTRIBUTES);
+ Attributes_tree = proto_item_add_subtree(ti, ett_smb_fileattributes);
proto_tree_add_text(Attributes_tree, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x01, 16, "Read-only file", "Not a read-only file"));
proto_tree_add_text(Attributes_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Attributes: 0x%02x", Attributes);
- Attributes_tree = proto_item_add_subtree(ti, ETT_SMB_FILEATTRIBUTES);
+ Attributes_tree = proto_item_add_subtree(ti, ett_smb_fileattributes);
proto_tree_add_text(Attributes_tree, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x01, 16, "Read-only file", "Not a read-only file"));
proto_tree_add_text(Attributes_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "WriteMode: 0x%02x", WriteMode);
- WriteMode_tree = proto_item_add_subtree(ti, ETT_SMB_WRITEMODE);
+ WriteMode_tree = proto_item_add_subtree(ti, ett_smb_writemode);
proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
decode_boolean_bitfield(WriteMode, 0x01, 16, "Write through requested", "Write through not requested"));
proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Flags: 0x%02x", Flags);
- Flags_tree = proto_item_add_subtree(ti, ETT_SMB_FLAGS);
+ Flags_tree = proto_item_add_subtree(ti, ett_smb_flags);
proto_tree_add_text(Flags_tree, offset, 2, "%s",
decode_boolean_bitfield(Flags, 0x01, 16, "Also disconnect TID", "Dont disconnect TID"));
proto_tree_add_text(Flags_tree, offset, 2, "%s",
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Flags: 0x%02x", Flags);
- Flags_tree = proto_item_add_subtree(ti, ETT_SMB_FLAGS);
+ Flags_tree = proto_item_add_subtree(ti, ett_smb_flags);
proto_tree_add_text(Flags_tree, offset, 2, "%s",
decode_boolean_bitfield(Flags, 0x01, 16, "Also disconnect TID", "Dont disconnect TID"));
proto_tree_add_text(Flags_tree, offset, 2, "%s",
if (tree) { /* Add the browse tree */
ti = proto_tree_add_item(parent, proto_browse, DataOffset, DataCount, NULL);
- browse_tree = proto_item_add_subtree(ti, ETT_BROWSE);
+ browse_tree = proto_item_add_subtree(ti, ett_browse);
proto_tree_add_text(browse_tree, loc_offset, 1, "OpCode: %s", (OpCode > (sizeof(browse_commands)/sizeof(char *))) ? "Error, No Such Command" : browse_commands[OpCode]);
if (tree) {
ti = proto_tree_add_text(browse_tree, loc_offset, 4, "Server Type: 0x%04x", ServerType);
- flags_tree = proto_item_add_subtree(ti, ETT_BROWSE_FLAGS);
+ flags_tree = proto_item_add_subtree(ti, ett_browse_flags);
proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
decode_boolean_bitfield(ServerType, 0x0001, 32, "Workstation", "Not Workstation"));
proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
if (tree) {
ti = proto_tree_add_item(tree, proto_smb, offset, END_OF_FRAME, NULL);
- smb_tree = proto_item_add_subtree(ti, ETT_SMB);
+ smb_tree = proto_item_add_subtree(ti, ett_smb);
/* 0xFFSMB is actually a 1 byte msg type and 3 byte server
* component ... SMB is only one used
tf = proto_tree_add_text(smb_tree, offset, 1, "Flags: 0x%02x", flags);
- flags_tree = proto_item_add_subtree(tf, ETT_SMB_FLAGS);
+ flags_tree = proto_item_add_subtree(tf, ett_smb_flags);
proto_tree_add_text(flags_tree, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x01, 8,
"Lock&Read, Write&Unlock supported",
tf = proto_tree_add_text(smb_tree, offset, 1, "Flags2: 0x%04x", flags2);
- flags2_tree = proto_item_add_subtree(tf, ETT_SMB_FLAGS2);
+ flags2_tree = proto_item_add_subtree(tf, ett_smb_flags2);
proto_tree_add_text(flags2_tree, offset, 1, "%s",
decode_boolean_bitfield(flags2, 0x0001, 16,
"Long file names supported",
{ &variable,
{ "Name", "smb.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_smb,
+ &ett_smb_fileattributes,
+ &ett_smb_capabilities,
+ &ett_smb_aflags,
+ &ett_smb_dialects,
+ &ett_smb_mode,
+ &ett_smb_rawmode,
+ &ett_smb_flags,
+ &ett_smb_flags2,
+ &ett_smb_desiredaccess,
+ &ett_smb_search,
+ &ett_smb_file,
+ &ett_smb_openfunction,
+ &ett_smb_filetype,
+ &ett_smb_action,
+ &ett_smb_writemode,
+ &ett_smb_lock_type,
+ &ett_browse,
+ &ett_browse_flags,
+ };
proto_smb = proto_register_protocol("Server Message Block Protocol", "smb");
proto_browse = proto_register_protocol("Microsoft Windows Browser Protocol", "browser");
/* proto_register_field_array(proto_smb, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for SNA
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-sna.c,v 1.8 1999/10/26 08:08:24 gram Exp $
+ * $Id: packet-sna.c,v 1.9 1999/11/16 11:42:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_sna_rh_cebi = -1;
static int hf_sna_ru = -1;
+static gint ett_sna = -1;
+static gint ett_sna_th = -1;
+static gint ett_sna_th_fid = -1;
+static gint ett_sna_rh = -1;
+static gint ett_sna_rh_0 = -1;
+static gint ett_sna_rh_1 = -1;
+static gint ett_sna_rh_2 = -1;
+
/* Format Identifier */
static const value_string sna_th_fid_vals[] = {
{ 0x0, "SNA device <--> Non-SNA Device" },
/* 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, offset, 0, NULL);
- sna_tree = proto_item_add_subtree(sna_ti, ETT_SNA);
+ 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, offset, 0, NULL);
- th_tree = proto_item_add_subtree(th_ti, ETT_SNA_TH);
+ th_tree = proto_item_add_subtree(th_ti, ett_sna_th);
}
/* Get size of TH */
/* --- RH --- */
if (BYTES_ARE_IN_FRAME(offset, 3)) {
rh_ti = proto_tree_add_item(sna_tree, hf_sna_rh, offset, 3, NULL);
- rh_tree = proto_item_add_subtree(rh_ti, ETT_SNA_RH);
+ rh_tree = proto_item_add_subtree(rh_ti, ett_sna_rh);
dissect_rh(pd, offset, fd, rh_tree);
sna_header_len += 3;
offset += 3;
/* Create the bitfield tree */
bf_item = proto_tree_add_item(tree, hf_sna_th_0, offset, 1, th_0);
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
proto_tree_add_item(bf_tree, hf_sna_th_fid, offset, 1, th_0);
proto_tree_add_item(bf_tree, hf_sna_th_mpf, offset, 1, th_0);
/* Create the bitfield tree */
bf_item = proto_tree_add_item(tree, hf_sna_th_0, offset, 1, th_0);
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
proto_tree_add_item(bf_tree, hf_sna_th_fid, offset, 1, th_0);
proto_tree_add_item(bf_tree, hf_sna_th_mpf, offset, 1, th_0);
/* Create the bitfield tree */
bf_item = proto_tree_add_item(tree, hf_sna_th_0, offset, 1, th_0);
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
proto_tree_add_item(bf_tree, hf_sna_th_fid, offset, 1, th_0);
proto_tree_add_item(bf_tree, hf_sna_th_mpf, offset, 1, th_0);
/* Create the bitfield tree */
bf_item = proto_tree_add_item(tree, hf_sna_th_0, offset, 1, th_byte);
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
/* Byte 0 */
proto_tree_add_item(bf_tree, hf_sna_th_fid, offset, 1, th_byte);
/* Create the bitfield tree */
bf_item = proto_tree_add_text(tree, offset, 1, "Transmision Header Byte 1");
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
/* Byte 1 */
proto_tree_add_item(bf_tree, hf_sna_th_tgsf, offset, 1, th_byte);
/* Create the bitfield tree */
bf_item = proto_tree_add_text(tree, offset, 1, "Transmision Header Byte 2");
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
/* Byte 2 */
if (mft) {
/* Create the bitfield tree */
bf_item = proto_tree_add_text(tree, offset, 1, "Transmision Header Byte 3");
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
/* Byte 3 */
proto_tree_add_item(bf_tree, hf_sna_th_vrn, offset, 1, th_byte);
/* Create the bitfield tree */
bf_item = proto_tree_add_text(tree, offset, 2, "Transmision Header Bytes 4-5");
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ 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, offset, 2, th_word);
/* Create the bitfield tree */
bf_item = proto_tree_add_text(tree, offset, 2, "Transmision Header Bytes 6-7");
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ 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, offset, 2, th_word);
/* Create the bitfield tree */
bf_item = proto_tree_add_text(tree, offset, 2, "Transmision Header Byte 16");
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
/* Byte 16 */
proto_tree_add_item(tree, hf_sna_th_snai, offset, 1, th_byte);
/* Create the bitfield tree */
bf_item = proto_tree_add_item(tree, hf_sna_th_0, offset, 1, th_0);
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
proto_tree_add_item(bf_tree, hf_sna_th_fid, offset, 1, th_0);
proto_tree_add_item(bf_tree, hf_sna_th_mpf, offset, 1, th_0);
/* Create the bitfield tree */
bf_item = proto_tree_add_item(tree, hf_sna_th_0, offset, 1, th_0);
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
proto_tree_add_item(bf_tree, hf_sna_th_fid, offset, 1, th_0);
proto_tree_add_text(tree, offset+1, 1, "Reserved");
/* Create the bitfield tree for byte 0*/
bf_item = proto_tree_add_item(tree, hf_sna_rh_0, offset, 1, rh_0);
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_RH_0);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_rh_0);
proto_tree_add_item(bf_tree, hf_sna_rh_rri, offset, 1, rh_0);
proto_tree_add_item(bf_tree, hf_sna_rh_ru_category, offset, 1, rh_0);
/* Create the bitfield tree for byte 1*/
bf_item = proto_tree_add_item(tree, hf_sna_rh_1, offset, 1, rh_1);
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_RH_1);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_rh_1);
proto_tree_add_item(bf_tree, hf_sna_rh_dr1, offset, 1, rh_1);
bf_item = proto_tree_add_item(tree, hf_sna_rh_2, offset, 1, rh_2);
if (!is_response) {
- bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_RH_2);
+ bf_tree = proto_item_add_subtree(bf_item, ett_sna_rh_2);
proto_tree_add_item(bf_tree, hf_sna_rh_bbi, offset, 1, rh_2);
proto_tree_add_item(bf_tree, hf_sna_rh_ebi, offset, 1, rh_2);
{ "Request/Response Unit", "sna.ru", FT_NONE, BASE_NONE, NULL, 0x0,
""}},
};
+ static gint *ett[] = {
+ &ett_sna,
+ &ett_sna_th,
+ &ett_sna_th_fid,
+ &ett_sna_rh,
+ &ett_sna_rh_0,
+ &ett_sna_rh_1,
+ &ett_sna_rh_2,
+ };
proto_sna = proto_register_protocol("Systems Network Architecture", "sna");
proto_register_field_array(proto_sna, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
-
* Routines for SNMP (simple network management protocol)
* D.Jorand (c) 1998
*
- * $Id: packet-snmp.c,v 1.12 1999/10/27 02:05:09 guy Exp $
+ * $Id: packet-snmp.c,v 1.13 1999/11/16 11:42:58 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_snmp = -1;
+static gint ett_snmp = -1;
+
#ifdef WITH_SNMP_UCD
/* should be defined only if supported in ucd-snmp */
#define OPAQUE_SPECIAL_TYPES 1
/* all_length=header_length+pdu_type_length+request_id_length+error_status_length+error_index_length; */
all_length=fd->pkt_len-offset;
item = proto_tree_add_item(tree, proto_snmp, offset, all_length, NULL);
- snmp_tree = proto_item_add_subtree(item, ETT_SNMP);
+ snmp_tree = proto_item_add_subtree(item, ett_snmp);
proto_tree_add_text(snmp_tree, offset, header_length, "Community: \"%s\", Version: %s", community, val_to_str(version, versions, "Unknown version %#x"));
offset+=header_length;
proto_tree_add_text(snmp_tree, offset, pdu_type_length, "%s", pdu_type_string);
if(tree) {
all_length=fd->pkt_len-offset;
item = proto_tree_add_item(tree, proto_snmp, offset, all_length, NULL);
- snmp_tree = proto_item_add_subtree(item, ETT_SNMP);
+ snmp_tree = proto_item_add_subtree(item, ett_snmp);
proto_tree_add_text(snmp_tree, offset, header_length, "Community: \"%s\", Version: %s", community, val_to_str(version, versions, "Unknown version %#x"));
offset+=header_length;
proto_tree_add_text(snmp_tree, offset, pdu_type_length, "Pdu type: %s", pdu_type_string);
{ &variable,
{ "Name", "snmp.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_snmp,
+ };
init_mib();
proto_snmp = proto_register_protocol("Simple Network Management Protocol", "snmp");
/* proto_register_field_array(proto_snmp, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
#endif /* WITH_SNMP: CMU or UCD */
}
/* packet-stat.c
* Routines for stat dissection
*
- * $Id: packet-stat.c,v 1.1 1999/11/11 21:22:00 nneul Exp $
+ * $Id: packet-stat.c,v 1.2 1999/11/16 11:42:58 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_stat = -1;
+static gint ett_stat = -1;
+
/* proc number, "proc name", dissect_request, dissect_reply */
/* NULL as function pointer means: take the generic one. */
NULL, 0, "Path" }},
#endif
};
+ static gint *ett[] = {
+ &ett_stat,
+ };
proto_stat = proto_register_protocol("Status Service", "stat");
proto_register_field_array(proto_stat, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_stat, STAT_PROGRAM, ETT_STAT);
+ rpc_init_prog(proto_stat, STAT_PROGRAM, ett_stat);
/* Register the procedure tables */
rpc_init_proc_table(STAT_PROGRAM, 1, stat_proc);
}
-
/* packet-tcp.c
* Routines for TCP packet disassembly
*
- * $Id: packet-tcp.c,v 1.43 1999/11/15 14:17:20 nneul Exp $
+ * $Id: packet-tcp.c,v 1.44 1999/11/16 11:42:59 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_tcp_checksum = -1;
static int hf_tcp_urgent_pointer = -1;
+static gint ett_tcp = -1;
+static gint ett_tcp_flags = -1;
+static gint ett_tcp_options = -1;
+static gint ett_tcp_option_sack = -1;
+
/* TCP Ports */
#define TCP_PORT_FTPDATA 20
while (optlen > 0) {
if (field_tree == NULL) {
/* Haven't yet made a subtree out of this option. Do so. */
- field_tree = proto_item_add_subtree(tf, optp->subtree_index);
+ field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
}
if (optlen < 4) {
proto_tree_add_text(field_tree, offset, optlen,
{
TCPOPT_EOL,
"EOL",
- -1,
+ NULL,
NO_LENGTH,
0,
NULL,
{
TCPOPT_NOP,
"NOP",
- -1,
+ NULL,
NO_LENGTH,
0,
NULL,
{
TCPOPT_MSS,
"Maximum segment size",
- -1,
+ NULL,
FIXED_LENGTH,
TCPOLEN_MSS,
dissect_tcpopt_maxseg
{
TCPOPT_WINDOW,
"Window scale",
- -1,
+ NULL,
FIXED_LENGTH,
TCPOLEN_WINDOW,
dissect_tcpopt_wscale
{
TCPOPT_SACK_PERM,
"SACK permitted",
- -1,
+ NULL,
FIXED_LENGTH,
TCPOLEN_SACK_PERM,
NULL,
{
TCPOPT_SACK,
"SACK",
- ETT_TCP_OPTION_SACK,
+ &ett_tcp_option_sack,
VARIABLE_LENGTH,
TCPOLEN_SACK_MIN,
dissect_tcpopt_sack
{
TCPOPT_ECHO,
"Echo",
- -1,
+ NULL,
FIXED_LENGTH,
TCPOLEN_ECHO,
dissect_tcpopt_echo
{
TCPOPT_ECHOREPLY,
"Echo reply",
- -1,
+ NULL,
FIXED_LENGTH,
TCPOLEN_ECHOREPLY,
dissect_tcpopt_echo
{
TCPOPT_TIMESTAMP,
"Time stamp",
- -1,
+ NULL,
FIXED_LENGTH,
TCPOLEN_TIMESTAMP,
dissect_tcpopt_timestamp
{
TCPOPT_CC,
"CC",
- -1,
+ NULL,
FIXED_LENGTH,
TCPOLEN_CC,
dissect_tcpopt_cc
{
TCPOPT_CCNEW,
"CC.NEW",
- -1,
+ NULL,
FIXED_LENGTH,
TCPOPT_CCNEW,
dissect_tcpopt_cc
{
TCPOPT_CCECHO,
"CC.ECHO",
- -1,
+ NULL,
FIXED_LENGTH,
TCPOLEN_CCECHO,
dissect_tcpopt_cc
if (tree) {
ti = proto_tree_add_item(tree, proto_tcp, offset, hlen, NULL);
- tcp_tree = proto_item_add_subtree(ti, ETT_TCP);
+ tcp_tree = proto_item_add_subtree(ti, ett_tcp);
proto_tree_add_item_format(tcp_tree, hf_tcp_srcport, offset, 2, th.th_sport,
"Source port: %s (%u)", get_tcp_port(th.th_sport), th.th_sport);
proto_tree_add_item_format(tcp_tree, hf_tcp_dstport, offset + 2, 2, th.th_dport,
"Header length: %u bytes", hlen);
tf = proto_tree_add_item_format(tcp_tree, hf_tcp_flags, offset + 13, 1,
th.th_flags, "Flags: 0x%04x (%s)", th.th_flags, flags);
- field_tree = proto_item_add_subtree(tf, ETT_TCP_FLAGS);
+ field_tree = proto_item_add_subtree(tf, ett_tcp_flags);
proto_tree_add_item(field_tree, hf_tcp_flags_urg, offset + 13, 1, th.th_flags);
proto_tree_add_item(field_tree, hf_tcp_flags_ack, offset + 13, 1, th.th_flags);
proto_tree_add_item(field_tree, hf_tcp_flags_push, offset + 13, 1, th.th_flags);
optlen = hlen - sizeof (e_tcphdr); /* length of options, in bytes */
tf = proto_tree_add_text(tcp_tree, offset + 20, optlen,
"Options: (%d bytes)", optlen);
- field_tree = proto_item_add_subtree(tf, ETT_TCP_OPTIONS);
+ field_tree = proto_item_add_subtree(tf, ett_tcp_options);
dissect_ip_tcp_options(&pd[offset + 20], offset + 20, optlen,
tcpopts, N_TCP_OPTS, TCPOPT_EOL, field_tree);
}
{ "Urgent pointer", "tcp.urgent_pointer", FT_UINT16, BASE_DEC, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_tcp,
+ &ett_tcp_flags,
+ &ett_tcp_options,
+ &ett_tcp_option_sack,
+ };
proto_tcp = proto_register_protocol ("Transmission Control Protocol", "tcp");
proto_register_field_array(proto_tcp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for telnet packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-telnet.c,v 1.6 1999/08/24 17:26:15 gram Exp $
+ * $Id: packet-telnet.c,v 1.7 1999/11/16 11:42:59 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_telnet = -1;
+static gint ett_telnet = -1;
+static gint ett_telnet_subopt = -1;
+
/* Some defines for Telnet */
#define TN_IAC 255
ti = proto_tree_add_text(telnet_tree, offset, subneg_len, "Suboption Begin: %s", opt);
- option_tree = proto_item_add_subtree(ti, ETT_TELNET_SUBOPT);
+ option_tree = proto_item_add_subtree(ti, ett_telnet_subopt);
proto_tree_add_text(option_tree, offset + 2, subneg_len - 2, "%s %s", (req ? "Send your" : "Here's my"), opt);
memcpy(rr, pd + offset, max_data);
ti = proto_tree_add_item(tree, proto_telnet, offset, END_OF_FRAME, NULL);
- telnet_tree = proto_item_add_subtree(ti, ETT_TELNET);
+ telnet_tree = proto_item_add_subtree(ti, ett_telnet);
i1 = i2 = i3 = 0;
{ &variable,
{ "Name", "telnet.abbreviation", TYPE, VALS_POINTER }},
};*/
+ static gint *ett[] = {
+ &ett_telnet,
+ &ett_telnet_subopt,
+ };
proto_telnet = proto_register_protocol("Telnet", "telnet");
/* proto_register_field_array(proto_telnet, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
}
*
* Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-tftp.c,v 1.6 1999/11/14 10:32:26 deniel Exp $
+ * $Id: packet-tftp.c,v 1.7 1999/11/16 11:43:00 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_tftp_type = -1;
static int hf_tftp_error_code = -1;
+static gint ett_tftp = -1;
+
#define RRQ 1
#define WRQ 2
#define DATA 3
if (tree) {
ti = proto_tree_add_item(tree, proto_tftp, offset, END_OF_FRAME, NULL);
- tftp_tree = proto_item_add_subtree(ti, ETT_TFTP);
+ tftp_tree = proto_item_add_subtree(ti, ett_tftp);
i1 = pntohs(pd+offset);
proto_tree_add_item_hidden(tftp_tree, hf_tftp_type, offset, 2, i1);
FT_UINT16, BASE_DEC, NULL, 0x0,
"Error code in case of TFTP error message" }}
};
+ static gint *ett[] = {
+ &ett_tftp,
+ };
proto_tftp = proto_register_protocol("Trivial File Transfer Protocol", "tftp");
proto_register_field_array(proto_tftp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for Token-Ring packet disassembly
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-tr.c,v 1.30 1999/10/22 07:17:43 guy Exp $
+ * $Id: packet-tr.c,v 1.31 1999/11/16 11:43:00 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_tr_rif_ring = -1;
static int hf_tr_rif_bridge = -1;
+static gint ett_token_ring = -1;
+static gint ett_token_ring_ac = -1;
+static gint ett_token_ring_fc = -1;
+
#define TR_MIN_HEADER_LEN 14
#define TR_MAX_HEADER_LEN 32
if (tree) {
/* Create Token-Ring Tree */
ti = proto_tree_add_item(tree, proto_tr, offset, 14 + actual_rif_bytes, NULL);
- tr_tree = proto_item_add_subtree(ti, ETT_TOKEN_RING);
+ tr_tree = proto_item_add_subtree(ti, ett_token_ring);
/* Create the Access Control bitfield tree */
ti = proto_tree_add_item(tr_tree, hf_tr_ac, offset, 1, trn_ac);
- bf_tree = proto_item_add_subtree(ti, ETT_TOKEN_RING_AC);
+ bf_tree = proto_item_add_subtree(ti, ett_token_ring_ac);
proto_tree_add_item(bf_tree, hf_tr_priority, offset, 1, trn_ac);
proto_tree_add_item(bf_tree, hf_tr_frame, offset, 1, trn_ac);
/* Create the Frame Control bitfield tree */
ti = proto_tree_add_item(tr_tree, hf_tr_fc, offset + 1, 1, trn_fc);
- bf_tree = proto_item_add_subtree(ti, ETT_TOKEN_RING_FC);
+ bf_tree = proto_item_add_subtree(ti, ett_token_ring_fc);
proto_tree_add_item(bf_tree, hf_tr_fc_type, offset + 1, 1, trn_fc);
proto_tree_add_item(bf_tree, hf_tr_fc_pcf, offset + 1, 1, trn_fc);
{ "RIF Bridge", "tr.rif.bridge", FT_UINT8, BASE_HEX, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_token_ring,
+ &ett_token_ring_ac,
+ &ett_token_ring_fc,
+ };
proto_tr = proto_register_protocol("Token-Ring", "tr");
proto_register_field_array(proto_tr, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for Token-Ring Media Access Control
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-trmac.c,v 1.16 1999/10/12 06:20:19 gram Exp $
+ * $Id: packet-trmac.c,v 1.17 1999/11/16 11:43:01 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_trmac_errors_token = -1;
static int hf_trmac_naun = -1;
+static gint ett_tr_mac = -1;
+static gint ett_tr_ierr_cnt = -1;
+static gint ett_tr_nerr_cnt = -1;
+
/* Major Vector */
static value_string major_vector_vs[] = {
{ 0x00, "Response" },
memcpy(errors, &pd[2], 6);
ti = proto_tree_add_item(tree, hf_trmac_errors_iso, 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);
+ sv_tree = proto_item_add_subtree(ti, ett_tr_ierr_cnt);
proto_tree_add_item(sv_tree, hf_trmac_errors_line, pkt_offset+2, 1, errors[0]);
proto_tree_add_item(sv_tree, hf_trmac_errors_internal, pkt_offset+3, 1, errors[1]);
memcpy(errors, &pd[2], 6);
ti = proto_tree_add_item(tree, hf_trmac_errors_noniso, 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);
+ sv_tree = proto_item_add_subtree(ti, ett_tr_nerr_cnt);
proto_tree_add_item(sv_tree, hf_trmac_errors_lost, pkt_offset+2, 1, errors[0]);
proto_tree_add_item(sv_tree, hf_trmac_errors_congestion, pkt_offset+3, 1, errors[1]);
if (tree) {
ti = proto_tree_add_item(tree, proto_trmac, offset, mv_length, NULL);
- mac_tree = proto_item_add_subtree(ti, ETT_TR_MAC);
+ mac_tree = proto_item_add_subtree(ti, ett_tr_mac);
proto_tree_add_item(mac_tree, hf_trmac_mv, offset+3, 1, mv_val);
proto_tree_add_item_format(mac_tree, hf_trmac_length, offset, 2, mv_length,
{ "NAUN", "trmac.naun", FT_ETHER, BASE_DEC, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_tr_mac,
+ &ett_tr_ierr_cnt,
+ &ett_tr_nerr_cnt,
+ };
proto_trmac = proto_register_protocol("Token-Ring Media Access Control", "trmac");
proto_register_field_array(proto_trmac, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-udp.c
* Routines for UDP packet disassembly
*
- * $Id: packet-udp.c,v 1.34 1999/11/14 20:44:51 guy Exp $
+ * $Id: packet-udp.c,v 1.35 1999/11/16 11:43:01 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#include "packet.h"
#include "resolv.h"
-int proto_udp = -1;
-int hf_udp_srcport = -1;
-int hf_udp_dstport = -1;
-int hf_udp_port = -1;
-int hf_udp_length = -1;
-int hf_udp_checksum = -1;
+static int proto_udp = -1;
+static int hf_udp_srcport = -1;
+static int hf_udp_dstport = -1;
+static int hf_udp_port = -1;
+static int hf_udp_length = -1;
+static int hf_udp_checksum = -1;
+
+static gint ett_udp = -1;
/* UDP structs and definitions */
if (tree) {
ti = proto_tree_add_item(tree, proto_udp, offset, 8);
- udp_tree = proto_item_add_subtree(ti, ETT_UDP);
+ udp_tree = proto_item_add_subtree(ti, ett_udp);
proto_tree_add_item_format(udp_tree, hf_udp_srcport, offset, 2, uh_sport,
"Source port: %s (%u)", get_udp_port(uh_sport), uh_sport);
{ "Checksum", "udp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_udp,
+ };
proto_udp = proto_register_protocol("User Datagram Protocol", "udp");
proto_register_field_array(proto_udp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
-
/* packet-vines.c
* Routines for Banyan VINES protocol packet disassembly
*
- * $Id: packet-vines.c,v 1.9 1999/10/22 08:51:04 guy Exp $
+ * $Id: packet-vines.c,v 1.10 1999/11/16 11:43:02 guy Exp $
*
* Don Lafontaine <lafont02@cn.ca>
*
#include "packet.h"
#include "packet-vines.h"
+static gint ett_vines = -1;
+static gint ett_vines_frp = -1;
+static gint ett_vines_spp = -1;
/* AFAIK Vines FRP (Fragmentation Protocol) is used on all media except Ethernet
* and TR (and probably FDDI) - Fragmentation on these media types is not possible
if (tree) {
ti = proto_tree_add_text(tree, offset, 2, "Vines Fragmentation Protocol");
- vines_frp_tree = proto_item_add_subtree(ti, ETT_VINES_FRP);
+ vines_frp_tree = proto_item_add_subtree(ti, ett_vines_frp);
proto_tree_add_text(vines_frp_tree, offset, 1, "Control Flags: 0x%02x = %s fragment", vines_frp_ctrl, frp_flags_str);
proto_tree_add_text(vines_frp_tree, offset + 1, 1, "Sequence Number: 0x%02x", vines_frp_seqno);
}
if (tree)
{
ti = proto_tree_add_text(tree, offset, (viph.vip_pktlen), "Vines IP");
- vip_tree = proto_item_add_subtree(ti, ETT_VINES);
+ vip_tree = proto_item_add_subtree(ti, ett_vines);
proto_tree_add_text(vip_tree, offset, 2, "Packet checksum: 0x%04x", viph.vip_chksum);
proto_tree_add_text(vip_tree, offset + 2, 2, "Packet length: 0x%04x (%d)", viph.vip_pktlen, viph.vip_pktlen);
proto_tree_add_text(vip_tree, offset + 4, 1, "Transport control: 0x%02x",
if (tree)
{
ti = proto_tree_add_text(tree, offset, sizeof(viph), "Vines SPP");
- vspp_tree = proto_item_add_subtree(ti, ETT_VINES_SPP);
+ vspp_tree = proto_item_add_subtree(ti, ett_vines_spp);
proto_tree_add_text(vspp_tree, offset, 2, "Source port: 0x%04x", viph.vspp_sport);
proto_tree_add_text(vspp_tree, offset+2, 2, "Destination port: 0x%04x", viph.vspp_dport);
proto_tree_add_text(vspp_tree, offset+4, 1, "Packet type: 0x%02x", viph.vspp_pkttype);
proto_tree_add_text(vspp_tree, offset+10, 2, "Sequence number: 0x%04x", viph.vspp_seqno);
proto_tree_add_text(vspp_tree, offset+12, 2, "Ack number: 0x%04x", viph.vspp_ack);
proto_tree_add_text(vspp_tree, offset+14, 2, "Window: 0x%04x", viph.vspp_win);
- }
-
+ }
}
+
+void
+proto_register_vines(void)
+{
+ static gint *ett[] = {
+ &ett_vines,
+ &ett_vines_frp,
+ &ett_vines_spp,
+ };
+
+ proto_register_subtree_array(ett, array_length(ett));
+}
/* packet-vlan.c
* Routines for VLAN 802.1Q ethernet header disassembly
*
- * $Id: packet-vlan.c,v 1.3 1999/11/10 05:42:06 guy Exp $
+ * $Id: packet-vlan.c,v 1.4 1999/11/16 11:43:02 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int hf_vlan_id = -1;
static int hf_vlan_cfi = -1;
+static gint ett_vlan = -1;
+
void
dissect_vlan(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
proto_tree *ti, *vlan_tree = NULL;
if (tree) {
ti = proto_tree_add_item(tree, proto_vlan, offset, 4);
- vlan_tree = proto_item_add_subtree(ti, ETT_VLAN);
+ vlan_tree = proto_item_add_subtree(ti, ett_vlan);
proto_tree_add_item(vlan_tree, hf_vlan_priority, offset, 2, tci);
proto_tree_add_item(vlan_tree, hf_vlan_cfi, offset, 2, tci);
"ID", "vlan.id", FT_UINT16, BASE_BIN,
0, 0x0FFF, "ID" }},
};
+ static gint *ett[] = {
+ &ett_vlan,
+ };
proto_vlan = proto_register_protocol("802.1q Virtual LAN", "vlan");
proto_register_field_array(proto_vlan, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for x25 packet disassembly
* Olivier Abad <abad@daba.dhis.org>
*
- * $Id: packet-x25.c,v 1.8 1999/10/18 01:51:25 guy Exp $
+ * $Id: packet-x25.c,v 1.9 1999/11/16 11:43:02 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#define X25_FAC_ADDR_EXT 0xCB
#define X25_FAC_CALL_DEFLECT 0xD1
-int proto_x25 = -1;
-int hf_x25_qbit = -1;
-int hf_x25_dbit = -1;
-int hf_x25_mod = -1;
-int hf_x25_lcn = -1;
-int hf_x25_type = -1;
-int hf_x25_p_r = -1;
-int hf_x25_mbit = -1;
-int hf_x25_p_s = -1;
-int proto_ex25 = -1;
-int hf_ex25_qbit = -1;
-int hf_ex25_dbit = -1;
-int hf_ex25_mod = -1;
-int hf_ex25_lcn = -1;
-int hf_ex25_type = -1;
-int hf_ex25_p_r = -1;
-int hf_ex25_mbit = -1;
-int hf_ex25_p_s = -1;
+static int proto_x25 = -1;
+static int hf_x25_qbit = -1;
+static int hf_x25_dbit = -1;
+static int hf_x25_mod = -1;
+static int hf_x25_lcn = -1;
+static int hf_x25_type = -1;
+static int hf_x25_p_r = -1;
+static int hf_x25_mbit = -1;
+static int hf_x25_p_s = -1;
+static int proto_ex25 = -1;
+static int hf_ex25_qbit = -1;
+static int hf_ex25_dbit = -1;
+static int hf_ex25_mod = -1;
+static int hf_ex25_lcn = -1;
+static int hf_ex25_type = -1;
+static int hf_ex25_p_r = -1;
+static int hf_ex25_mbit = -1;
+static int hf_ex25_p_s = -1;
+
+static gint ett_x25 = -1;
static const value_string vals_modulo[] = {
{ 1, "8" },
if (tree) {
ti = proto_tree_add_item(tree, (modulo == 8) ? proto_x25 : proto_ex25,
localoffset, x25_pkt_len, NULL);
- x25_tree = proto_item_add_subtree(ti, ETT_X25);
+ x25_tree = proto_item_add_subtree(ti, ett_x25);
if (pd[localoffset] & 0x80)
proto_tree_add_item(x25_tree, (modulo == 8) ? hf_x25_qbit : hf_ex25_qbit,
localoffset, 2, pd[localoffset]*256+pd[localoffset+1]);
{ "P(S)", "ex25.p_s", FT_UINT8, BASE_HEX, NULL, 0xFE,
"Packet Send Sequence Number" } },
};
+ static gint *ett[] = {
+ &ett_x25,
+ };
proto_x25 = proto_register_protocol ("X.25", "x25");
proto_ex25 = proto_register_protocol ("Extended X.25 (modulo 128)", "ex25");
proto_register_field_array (proto_x25, hf8, array_length(hf8));
proto_register_field_array (proto_ex25, hf128, array_length(hf128));
+ proto_register_subtree_array(ett, array_length(ett));
}
* Routines for yahoo messenger packet dissection
* Copyright 1999, Nathan Neulinger <nneul@umr.edu>
*
- * $Id: packet-yhoo.c,v 1.3 1999/10/20 16:36:07 gram Exp $
+ * $Id: packet-yhoo.c,v 1.4 1999/11/16 11:43:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_yhoo_nick2 = -1;
static int hf_yhoo_content = -1;
+static gint ett_yhoo = -1;
+
static const value_string yhoo_service_vals[] = {
{YAHOO_SERVICE_LOGON, "Pager Logon"},
{YAHOO_SERVICE_LOGOFF, "Pager Logoff"},
if (tree) {
ti = proto_tree_add_item(tree, proto_yhoo, offset, END_OF_FRAME, NULL);
- yhoo_tree = proto_item_add_subtree(ti, ETT_YHOO);
+ yhoo_tree = proto_item_add_subtree(ti, ett_yhoo);
proto_tree_add_item(yhoo_tree, hf_yhoo_version,
offset, 8, pkt->version);
"Version", "yhoo.version", FT_STRING, 0,
NULL, 0, "Packet version identifier" }},
};
+ static gint *ett[] = {
+ &ett_yhoo,
+ };
proto_yhoo = proto_register_protocol("Yahoo Messenger Protocol", "yhoo");
proto_register_field_array(proto_yhoo, hf, array_length(hf));
+
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet-ypbind.c
* Routines for ypbind dissection
*
- * $Id: packet-ypbind.c,v 1.2 1999/11/10 21:05:11 nneul Exp $
+ * $Id: packet-ypbind.c,v 1.3 1999/11/16 11:43:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_ypbind = -1;
+static gint ett_ypbind = -1;
+
/* proc number, "proc name", dissect_request, dissect_reply */
/* NULL as function pointer means: take the generic one. */
const vsff ypbind1_proc[] = {
void
proto_register_ypbind(void)
{
+ static gint *ett[] = {
+ &ett_ypbind,
+ };
+
proto_ypbind = proto_register_protocol("Yellow Pages Bind", "ypbind");
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_ypbind, YPBIND_PROGRAM, ETT_YPBIND);
+ rpc_init_prog(proto_ypbind, YPBIND_PROGRAM, ett_ypbind);
/* Register the procedure tables */
rpc_init_proc_table(YPBIND_PROGRAM, 1, ypbind1_proc);
rpc_init_proc_table(YPBIND_PROGRAM, 2, ypbind2_proc);
}
-
/* packet-ypserv.c
* Routines for ypserv dissection
*
- * $Id: packet-ypserv.c,v 1.5 1999/11/15 17:16:51 nneul Exp $
+ * $Id: packet-ypserv.c,v 1.6 1999/11/16 11:43:04 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int hf_ypserv_value = -1;
static int hf_ypserv_status = -1;
+static gint ett_ypserv = -1;
+
/* Dissect a domain call */
int dissect_domain_call(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree)
"Status", "ypserv.status", FT_BOOLEAN, BASE_DEC,
&okfailed , 0, "Status" }},
};
+ static gint *ett[] = {
+ &ett_ypserv,
+ };
proto_ypserv = proto_register_protocol("Yellow Pages Service", "ypserv");
proto_register_field_array(proto_ypserv, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_ypserv, YPSERV_PROGRAM, ETT_YPSERV);
+ rpc_init_prog(proto_ypserv, YPSERV_PROGRAM, ett_ypserv);
/* Register the procedure tables */
rpc_init_proc_table(YPSERV_PROGRAM, 1, ypserv1_proc);
rpc_init_proc_table(YPSERV_PROGRAM, 2, ypserv2_proc);
}
-
/* packet-ypxfr.c
* Routines for ypxfr dissection
*
- * $Id: packet-ypxfr.c,v 1.1 1999/11/10 17:23:55 nneul Exp $
+ * $Id: packet-ypxfr.c,v 1.2 1999/11/16 11:43:04 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static int proto_ypxfr = -1;
+static gint ett_ypxfr = -1;
+
/* proc number, "proc name", dissect_request, dissect_reply */
/* NULL as function pointer means: take the generic one. */
const vsff ypxfr1_proc[] = {
void
proto_register_ypxfr(void)
{
+ static gint *ett[] = {
+ &ett_ypxfr
+ };
+
proto_ypxfr = proto_register_protocol("Yellow Pages Transfer", "ypxfr");
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_ypxfr, YPXFR_PROGRAM, ETT_YPXFR);
+ rpc_init_prog(proto_ypxfr, YPXFR_PROGRAM, ett_ypxfr);
/* Register the procedure tables */
rpc_init_proc_table(YPXFR_PROGRAM, 1, ypxfr1_proc);
}
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.53 1999/11/11 05:36:05 gram Exp $
+ * $Id: packet.c,v 1.54 1999/11/16 11:43:04 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
extern capture_file cf;
-gboolean tree_is_expanded[NUM_TREE_TYPES];
+static int proto_frame = -1;
+static int hf_frame_arrival_time = -1;
+static int hf_frame_time_delta = -1;
+static int hf_frame_number = -1;
+static int hf_frame_packet_len = -1;
+static int hf_frame_capture_len = -1;
-int proto_frame = -1;
-int hf_frame_arrival_time = -1;
-int hf_frame_time_delta = -1;
-int hf_frame_number = -1;
-int hf_frame_packet_len = -1;
-int hf_frame_capture_len = -1;
+static gint ett_frame = -1;
gchar *
ether_to_str(const guint8 *ad) {
ti = proto_tree_add_item_format(tree, proto_frame, 0, fd->cap_len,
NULL, "Frame (%d on wire, %d captured)", fd->pkt_len, fd->cap_len);
- fh_tree = proto_item_add_subtree(ti, ETT_FRAME);
+ fh_tree = proto_item_add_subtree(ti, ett_frame);
tv.tv_sec = fd->abs_secs;
tv.tv_usec = fd->abs_usecs;
{ "Capture Frame Length", "frame.cap_len", FT_UINT32, BASE_DEC, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_frame,
+ };
proto_frame = proto_register_protocol("Frame", "frame");
proto_register_field_array(proto_frame, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
/* packet.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet.h,v 1.141 1999/11/15 14:17:20 nneul Exp $
+ * $Id: packet.h,v 1.142 1999/11/16 11:43:05 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
int dport;
} tcp_extra_data;
-/* Tree types. Each dissect_* routine should have one for each
- add_subtree() call. */
-
-enum {
- ETT_NONE,
- ETT_FRAME,
- ETT_IEEE8023,
- ETT_ETHER2,
- ETT_LLC,
- ETT_TOKEN_RING,
- ETT_TOKEN_RING_AC,
- ETT_TOKEN_RING_FC,
- ETT_TR_IERR_CNT,
- ETT_TR_NERR_CNT,
- ETT_TR_MAC,
- ETT_PPP,
- ETT_ARP,
- ETT_BPDU,
- ETT_FDDI,
- ETT_NULL,
- ETT_IP,
- ETT_IP_OPTIONS,
- ETT_IP_OPTION_SEC,
- ETT_IP_OPTION_ROUTE,
- ETT_IP_OPTION_TIMESTAMP,
- ETT_IP_TOS,
- ETT_IP_OFF,
- ETT_UDP,
- ETT_TCP,
- ETT_TCP_OPTIONS,
- ETT_TCP_OPTION_SACK,
- ETT_TCP_FLAGS,
- ETT_ICMP,
- ETT_IGMP,
- ETT_IPX,
- ETT_SPX,
- ETT_NCP,
- ETT_NCP_REQUEST_FIELDS,
- ETT_NCP_REPLY_FIELDS,
- ETT_DNS,
- ETT_DNS_FLAGS,
- ETT_DNS_QRY,
- ETT_DNS_QD,
- ETT_DNS_ANS,
- ETT_DNS_RR,
- ETT_EIGRP,
- ETT_ICQ,
- ETT_ICQ_DECODE,
- ETT_ICQ_HEADER,
- ETT_ICQ_BODY,
- ETT_ICQ_BODY_PARTS,
- ETT_ISAKMP,
- ETT_ISAKMP_FLAGS,
- ETT_ISAKMP_PAYLOAD,
- ETT_RIP,
- ETT_RIP_VEC,
- ETT_RIPNG,
- ETT_RIPNG_ADDR,
- ETT_PIM,
- ETT_OSPF,
- ETT_OSPF_HDR,
- ETT_OSPF_HELLO,
- ETT_OSPF_DESC,
- ETT_OSPF_LSR,
- ETT_OSPF_LSA_UPD,
- ETT_OSPF_LSA,
- ETT_LPD,
- ETT_RAW,
- ETT_CLIP,
- ETT_BOOTP,
- ETT_BOOTP_OPTION,
- ETT_BOOTPARAMS,
- ETT_IPv6,
- ETT_BGP,
- ETT_BGP_OPEN,
- ETT_BGP_UPDATE,
- ETT_BGP_NOTIFICATION,
- ETT_BGP_ATTRS,
- ETT_BGP_ATTR,
- ETT_BGP_ATTR_FLAGS,
- ETT_BGP_UNFEAS,
- ETT_BGP_NLRI,
- ETT_BGP_MP_REACH_NLRI,
- ETT_BGP_MP_UNREACH_NLRI,
- ETT_CLNP,
- ETT_COTP,
- ETT_VINES_FRP,
- ETT_VINES,
- ETT_VINES_ARP,
- ETT_VINES_ICP,
- ETT_VINES_IPC,
- ETT_VINES_RTP,
- ETT_VINES_SPP,
- ETT_VLAN,
- ETT_IPXRIP,
- ETT_IPXSAP,
- ETT_IPXSAP_SERVER,
- ETT_NBNS,
- ETT_NBNS_FLAGS,
- ETT_NBNS_NB_FLAGS,
- ETT_NBNS_NAME_FLAGS,
- ETT_NBNS_QRY,
- ETT_NBNS_QD,
- ETT_NETB,
- ETT_NETB_FLAGS,
- ETT_NETB_STATUS,
- ETT_NETB_NAME,
- ETT_NBNS_ANS,
- ETT_NBNS_RR,
- ETT_NBIPX,
- ETT_NBIPX_NAME_TYPE_FLAGS,
- ETT_AARP,
- ETT_GIOP,
- ETT_NBDGM,
- ETT_CDP,
- ETT_CDP_TLV,
- ETT_HTTP,
- ETT_TFTP,
- ETT_AH,
- ETT_ESP,
- ETT_IPCOMP,
- ETT_ICMPv6,
- ETT_ICMPv6OPT,
- ETT_ICMPv6FLAG,
- ETT_POP,
- ETT_IMAP,
- ETT_MAPI,
- ETT_FTP,
- ETT_TELNET,
- ETT_TELNET_SUBOPT,
- ETT_NNTP,
- ETT_NTP,
- ETT_NTP_FLAGS,
- ETT_SNMP,
- ETT_NBSS,
- ETT_NBSS_FLAGS,
- ETT_RX,
- ETT_RX_FLAGS,
- ETT_AFS,
- ETT_AFS_OP,
- ETT_AFS_FID,
- ETT_AFS_ACL,
- ETT_AFS_CALLBACK,
- ETT_AFS_UBIKVER,
- ETT_SMB,
- ETT_SMB_FLAGS,
- ETT_SMB_FLAGS2,
- ETT_SMB_DIALECTS,
- ETT_SMB_MODE,
- ETT_SMB_CAPABILITIES,
- ETT_SMB_RAWMODE,
- ETT_SMB_AFLAGS,
- ETT_SMB_DESIREDACCESS,
- ETT_SMB_SEARCH,
- ETT_SMB_FILE,
- ETT_SMB_OPENFUNCTION,
- ETT_SMB_FILEATTRIBUTES,
- ETT_SMB_FILETYPE,
- ETT_SMB_ACTION,
- ETT_SMB_WRITEMODE,
- ETT_SMB_LOCK_TYPE,
- ETT_BROWSE,
- ETT_BROWSE_FLAGS,
- ETT_PPTP,
- ETT_GRE,
- ETT_GRE_FLAGS,
- ETT_ICP,
- ETT_ICP_PAYLOAD,
- ETT_PPPOED,
- ETT_PPPOED_TAGS,
- ETT_PPPOES,
- ETT_LCP,
- ETT_LCP_OPTIONS,
- ETT_LCP_MRU_OPT,
- ETT_LCP_ASYNC_MAP_OPT,
- ETT_LCP_AUTHPROT_OPT,
- ETT_LCP_QUALPROT_OPT,
- ETT_LCP_MAGICNUM_OPT,
- ETT_LCP_FCS_ALTERNATIVES_OPT,
- ETT_LCP_NUMBERED_MODE_OPT,
- ETT_LCP_CALLBACK_OPT,
- ETT_LCP_MULTILINK_EP_DISC_OPT,
- ETT_LCP_INTERNATIONALIZATION_OPT,
- ETT_IPCP,
- ETT_IPCP_OPTIONS,
- ETT_IPCP_IPADDRS_OPT,
- ETT_IPCP_COMPRESSPROT_OPT,
- ETT_RSVP,
- ETT_RSVP_UNKNOWN_CLASS,
- ETT_RSVP_HDR,
- ETT_RSVP_SESSION,
- ETT_RSVP_SGROUP,
- ETT_RSVP_HOP,
- ETT_RSVP_INTEGRITY,
- ETT_RSVP_TIME_VALUES,
- ETT_RSVP_ERROR,
- ETT_RSVP_SCOPE,
- ETT_RSVP_STYLE,
- ETT_RSVP_FLOWSPEC,
- ETT_RSVP_FILTER_SPEC,
- ETT_RSVP_SENDER_TEMPLATE,
- ETT_RSVP_SENDER_TSPEC,
- ETT_RSVP_ADSPEC,
- ETT_RSVP_POLICY,
- ETT_RSVP_CONFIRM,
- ETT_RSVP_ADSPEC_SUBTREE1,
- ETT_RSVP_ADSPEC_SUBTREE2,
- ETT_RSVP_ADSPEC_SUBTREE3,
- ETT_RTSP,
- ETT_SDP,
- ETT_RADIUS,
- ETT_RADIUS_AVP,
- ETT_LAPB,
- ETT_LAPD,
- ETT_LAPD_ADDRESS,
- ETT_X25,
- ETT_XDLC_CONTROL,
- ETT_Q931,
- ETT_Q931_IE,
- ETT_ATM,
- ETT_ATM_LANE,
- ETT_ATM_LANE_LC_FLAGS,
- ETT_ATM_LANE_LC_LAN_DEST,
- ETT_ATM_LANE_LC_LAN_DEST_RD,
- ETT_MP,
- ETT_MP_FLAGS,
- ETT_IPP,
- ETT_IPP_AS,
- ETT_IPP_ATTR,
- ETT_SNA,
- ETT_SNA_TH,
- ETT_SNA_TH_FID,
- ETT_SNA_RH,
- ETT_SNA_RH_0,
- ETT_SNA_RH_1,
- ETT_SNA_RH_2,
- ETT_SNA_RU,
- ETT_YHOO,
- ETT_RPC,
- ETT_RPC_STRING,
- ETT_RPC_CRED,
- ETT_RPC_VERF,
- ETT_RPC_GIDS,
- ETT_MOUNT,
- ETT_NFS,
- ETT_NFS_FHANDLE,
- ETT_NFS_TIMEVAL,
- ETT_NFS_MODE,
- ETT_NFS_FATTR,
- ETT_NFS_SATTR,
- ETT_NFS_MODE3,
- ETT_NFS_SPECDATA3,
- ETT_NFS_FH3,
- ETT_NFS_NFSTIME3,
- ETT_NFS_FATTR3,
- ETT_NFS_POST_OP_ATTR,
- ETT_NFS_WCC_ATTR,
- ETT_NFS_PRE_OP_ATTR,
- ETT_NFS_WCC_DATA,
- ETT_NFS_SET_MODE3,
- ETT_NFS_SET_UID3,
- ETT_NFS_SET_GID3,
- ETT_NFS_SET_SIZE3,
- ETT_NFS_SET_ATIME,
- ETT_NFS_SET_MTIME,
- ETT_NFS_SATTR3,
- ETT_NFS_SATTRGUARD3,
- ETT_BOOT,
- ETT_NLM,
- ETT_PORTMAP,
- ETT_STAT,
- ETT_YPBIND,
- ETT_YPSERV,
- ETT_YPXFR,
- ETT_DDP,
- NUM_TREE_TYPES /* last item number plus one */
-};
-
-/* TRUE if subtrees of an item of the specified type are to be expanded. */
-extern gboolean tree_is_expanded[NUM_TREE_TYPES];
-
/* Utility routines used by packet*.c */
gchar* ether_to_str(const guint8 *);
gchar* ip_to_str(const guint8 *);
/* proto.c
* Routines for protocol tree
*
- * $Id: proto.c,v 1.48 1999/11/15 06:32:14 gram Exp $
+ * $Id: proto.c,v 1.49 1999/11/16 11:43:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
/* List which stores protocols and fields that have been registered */
GPtrArray *gpa_hfinfo = NULL;
+/* Points to the first element of an array of Booleans, indexed by
+ a subtree item type; that array element is TRUE if subtrees of
+ an item of that type are to be expanded. */
+gboolean *tree_is_expanded;
+
+/* Number of elements in that array. */
+int num_tree_types;
+
/* Is the parsing being done for a visible proto_tree or an invisible one?
* By setting this correctly, the proto_tree creation is sped up by not
* having to call vsnprintf and copy strings around.
g_mem_chunk_destroy(gmc_item_labels);
if (gpa_hfinfo)
g_ptr_array_free(gpa_hfinfo, FALSE);
+ if (tree_is_expanded != NULL)
+ g_free(tree_is_expanded);
gmc_hfinfo = g_mem_chunk_new("gmc_hfinfo",
sizeof(struct header_field_info), 50 * sizeof(struct
G_ALLOC_AND_FREE);
gpa_hfinfo = g_ptr_array_new();
+ /* Allocate "tree_is_expanded", with one element for ETT_NONE,
+ and initialize that element to FALSE. */
+ tree_is_expanded = g_malloc(sizeof (gint));
+ tree_is_expanded[0] = FALSE;
+ num_tree_types = 1;
+
/* Have each dissector register its protocols and fields. */
register_all_protocols();
converting ethereal to new-style proto_tree. These fields
are merely strings on the GUI tree; they are not filterable */
proto_register_field_array(-1, hf, array_length(hf));
+
+ /* We've assigned all the subtree type values; allocate the array
+ for them, and zero it out. */
+ tree_is_expanded = g_malloc(num_tree_types*sizeof (gint *));
+ memset(tree_is_expanded, '\0', num_tree_types*sizeof (gint *));
}
void
proto_tree*
proto_item_add_subtree(proto_item *pi, gint idx) {
field_info *fi = (field_info*) (((GNode*)pi)->data);
+ g_assert(idx >= 0 && idx < num_tree_types);
fi->tree_type = idx;
return (proto_tree*) pi;
}
return hfinfo->id;
}
+void
+proto_register_subtree_array(gint **indices, int num_indices)
+{
+ int i;
+ gint **ptr = indices;
+
+ /*
+ * Add "num_indices" elements to "tree_is_expanded".
+ */
+ tree_is_expanded = g_realloc(tree_is_expanded,
+ (num_tree_types + num_indices)*sizeof (gint));
+
+ /*
+ * Assign "num_indices" subtree numbers starting at "num_tree_types",
+ * returning the indices through the pointers in the array whose
+ * first element is pointed to by "indices", set to FALSE the
+ * elements to which those subtree numbers refer, and update
+ * "num_tree_types" appropriately.
+ */
+ for (i = 0; i < num_indices; i++, ptr++, num_tree_types++) {
+ tree_is_expanded[num_tree_types] = FALSE;
+ **ptr = num_tree_types;
+ }
+}
+
void
proto_item_fill_label(field_info *fi, gchar *label_str)
{
/* proto.h
* Definitions for protocol display
*
- * $Id: proto.h,v 1.19 1999/11/15 06:32:15 gram Exp $
+ * $Id: proto.h,v 1.20 1999/11/16 11:43:07 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
void
proto_register_field_array(int parent, hf_register_info *hf, int num_records);
+void
+proto_register_subtree_array(gint **indices, int num_indices);
+
proto_item *
proto_tree_add_item(proto_tree *tree, int hfindex, gint start,
gint length, ...);
*/
extern gboolean proto_tree_is_visible;
+/* Points to the first element of an array of Booleans, indexed by
+ a subtree item type; that array element is TRUE if subtrees of
+ an item of that type are to be expanded.
+
+ ETT_NONE is reserved for unregistered subtree types. */
+#define ETT_NONE 0
+extern gboolean *tree_is_expanded;
+
+/* Number of elements in that array. */
+extern int num_tree_types;
+
#endif /* proto.h */
* Routines for use by various SDLC-derived protocols, such as HDLC
* and its derivatives LAPB, IEEE 802.2 LLC, etc..
*
- * $Id: xdlc.c,v 1.9 1999/09/26 20:31:50 guy Exp $
+ * $Id: xdlc.c,v 1.10 1999/11/16 11:43:07 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
int
dissect_xdlc_control(const u_char *pd, int offset, frame_data *fd,
- proto_tree *xdlc_tree, int hf_xdlc_control,
+ proto_tree *xdlc_tree, int hf_xdlc_control, gint ett_xdlc_control,
int is_response, int is_extended)
{
guint16 control;
offset, 2,
frame_type,
"Control field: %s (0x%04X)", info, control);
- control_tree = proto_item_add_subtree(tc, ETT_XDLC_CONTROL);
+ control_tree = proto_item_add_subtree(tc, ett_xdlc_control);
proto_tree_add_text(control_tree, offset, 2,
decode_numeric_bitfield(control, XDLC_N_R_EXT_MASK, 2*8,
"N(R) = %u"));
offset, 1,
frame_type,
"Control field: %s (0x%02X)", info, control);
- control_tree = proto_item_add_subtree(tc, ETT_XDLC_CONTROL);
+ control_tree = proto_item_add_subtree(tc, ett_xdlc_control);
proto_tree_add_text(control_tree, offset, 1,
decode_numeric_bitfield(control, XDLC_N_R_MASK, 1*8,
"N(R) = %u"));
offset, 1,
frame_type,
"Control field: %s (0x%02X)", info, control);
- control_tree = proto_item_add_subtree(tc, ETT_XDLC_CONTROL);
+ control_tree = proto_item_add_subtree(tc, ett_xdlc_control);
if (control & XDLC_P_F) {
proto_tree_add_text(control_tree, offset, 2,
decode_boolean_bitfield(control, XDLC_P_F, 1*8,
(is_extended) ? "Control field: %s (0x%04X)"
: "Control field: %s (0x%02X)",
info, control);
- control_tree = proto_item_add_subtree(tc, ETT_XDLC_CONTROL);
+ control_tree = proto_item_add_subtree(tc, ett_xdlc_control);
if (is_extended) {
proto_tree_add_text(control_tree, offset, 2,
decode_numeric_bitfield(control, XDLC_N_R_EXT_MASK, 2*8,
* Define *DLC frame types, and routine to dissect the control field of
* a *DLC frame.
*
- * $Id: xdlc.h,v 1.9 1999/11/11 08:04:06 guy Exp $
+ * $Id: xdlc.h,v 1.10 1999/11/16 11:43:07 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
int extended);
int dissect_xdlc_control(const u_char *pd, int offset, frame_data *fd,
- proto_tree *xdlc_tree, int hf_xdlc_control, int is_response, int extended);
+ proto_tree *xdlc_tree, int hf_xdlc_control, gint ett_xdlc_control,
+ int is_response, int extended);