aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dcerpc-nt.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-04-18 00:29:17 +0000
committerGuy Harris <guy@alum.mit.edu>2002-04-18 00:29:17 +0000
commit92e27e03c14844a3a7f559ea7e70c2ad8e5482d8 (patch)
treea1c94f2a9a8e62f393b8ad3c5a7e1bf8082aad61 /packet-dcerpc-nt.h
parenta7c4e209cb65cfdef6881760c97c845fa81821ac (diff)
Add a "proto_register_dcerpc_smb()" which registers ett_ values for
"packet-dcerpc-nt.c", and registers "dcerpc_smb_init()" as an initialization routine. Take the ett_ registration out of the latter routine, and also take out the "do this only once" stuff. Get rid of the initialization routines for netlogon, samr, and spoolss; they just call "dcerpc_smb_init()", which is now an initialization routine of its own. The policy hash initialization should be done before every capture, so it should be done in an initialization routine, and should not do any "do this only once" stuff. It should also be called only once before every capture, rather than 3 times. The ett_ initialization should, however, be done at the same time all other ett_ initialization is done - at protocol registration time - so it should be done in a "proto_register_" routine. This fixes a bug I saw wherein 1) the tree for Unicode strings was open by default and 2) if you closed one and then exited, Ethereal would crash. The problem is that "proto_register_subtree_array()" doesn't expand the array, it just bumps the number of registered ett_ values; the array is allocated in "proto_init()". As such, if you register ett_ values with "proto_register_subtree_array()" *after* "proto_init()" is called - and, even for the first capture, initialization routines are called after "proto_init()" is called - you will get ett_ numbers that go past the number of elements in the array. Move the declaration of "ett_nt_unicode_string" to "packet-dcerpc-nt.h", as it's exported from "packet-dcerpc-nt.c". Get rid of the declaration of "dcerpc_smb_init()" in "packet-dcerpc-nt.h", and make it static, as it's no longer called from outside "packet-dcerpc-nt.c". svn path=/trunk/; revision=5196
Diffstat (limited to 'packet-dcerpc-nt.h')
-rw-r--r--packet-dcerpc-nt.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/packet-dcerpc-nt.h b/packet-dcerpc-nt.h
index 49dffb2649..4a7dfb08e4 100644
--- a/packet-dcerpc-nt.h
+++ b/packet-dcerpc-nt.h
@@ -2,7 +2,7 @@
* Routines for DCERPC over SMB packet disassembly
* Copyright 2001, Tim Potter <tpot@samba.org>
*
- * $Id: packet-dcerpc-nt.h,v 1.20 2002/04/17 10:29:09 sahlberg Exp $
+ * $Id: packet-dcerpc-nt.h,v 1.21 2002/04/18 00:29:17 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -26,6 +26,11 @@
#ifndef __PACKET_DCERPC_NT_H
#define __PACKET_DCEPRC_NT_H
+/*
+ * ett_ value for Unicode strings.
+ */
+extern gint ett_nt_unicode_string;
+
/* Routines for parsing simple types */
int prs_align(int offset, int n);
@@ -143,9 +148,6 @@ void
dcerpc_smb_check_long_frame(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree);
-void
-dcerpc_smb_init(void);
-
/* Dissect NT specific things */
int