guy 2002/04/17 19:29:19 CDT
Modified files:
. Makefile.am Makefile.nmake
packet-dcerpc-netlogon.c
packet-dcerpc-nt.c packet-dcerpc-nt.h
packet-dcerpc-samr.c
packet-dcerpc-spoolss.c
Log:
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".
Revision Changes Path
1.422 +3 -3 ethereal/Makefile.am
1.180 +3 -3 ethereal/Makefile.nmake
1.16 +1 -12 ethereal/packet-dcerpc-netlogon.c
1.27 +16 -11 ethereal/packet-dcerpc-nt.c
1.21 +6 -4 ethereal/packet-dcerpc-nt.h
1.32 +1 -10 ethereal/packet-dcerpc-samr.c
1.17 +1 -10 ethereal/packet-dcerpc-spoolss.c