--- ethereal-0.10.10.orig/debian/README.debian
+++ ethereal-0.10.10/debian/README.debian
@@ -4,7 +4,7 @@
 Q. Why isn't ethereal linked against libssl ?
 A. Because it can't be linked against libssl.
    See http://www.openssl.org/support/faq.html#LEGAL2
- 
+
 Q. Why isn't ethereal linked against libsnmp ?
 A. Because it would also need to be linked against libssl
 
--- ethereal-0.10.10.orig/debian/changelog
+++ ethereal-0.10.10/debian/changelog
@@ -1,15 +1,928 @@
-ethereal (0.8.3-0unoff) unstable; urgency=low
+ethereal (0.10.10-2sarge6) stable-security; urgency=high
 
-  * New upstream release. (unofficial package)
+  * Non-maintainer upload by the Security Team
+  * Backported fixes for several vulnerabilities:
+  * Format string vulnerabilities in FW-1 and MQ dissectors (CVE-2006-3628)
+  * Memory exhaustion denial of service in MOUNT dissector (CVE-2006-3629)
+  * Off-by-one overflows in NCP NMAS and NDPS dissectors (CVE-2006-3630)
+  * Buffer overflow in NFS dissector (CVE-2006-3632)
+  * Infinite loop denial of service in SSH dissector (CVE-2006-3631)
+
+ -- Moritz Muehlenhoff <jmm@debian.org>  Sun, 23 Jul 2006 21:18:15 +0000
+
+ethereal (0.10.10-2sarge5) stable-security; urgency=high
+
+  * Non-maintainer upload by the Security Team
+  * Backported several vulnerabilities disclosed by upstream
+  * Details: http://anonsvn.ethereal.com/viewcvs/viewcvs.py?rev=REVISION&view=rev
+  * Ethereal's OID printing routine was susceptible to an off-by-one error
+    [epan/to_str.c, r17048, epan/dissectors/packet-ber.c,
+    epan/dissectors/packet-per.c, CVE-2006-1932]
+  * The UMA and BER dissectors could go into an infinite loop
+    [epan/dissectors/packet-gsm_a.c, r17119, r17273,
+    epan/dissectors/packet-ber.c, r17498, r17625, CVE-2006-1933]
+  * The Network Instruments file code could overrun a buffer
+    [wiretap/network_instruments.c, r17520, CVE-2006-1934]
+  * The COPS dissector could overflow a buffer
+    [epan/dissectors/packet-cops.c, epan/dissectors/packet-snmp.c, r17051,
+    CVE-2006-1935]
+  * The telnet dissector could overrun a buffer [r17051, CVE-2006-1936,
+    epan/dissectors/packet-telnet.c]
+  * Bugs in the SRVLOC and AIM dissector, and in the statistics counter
+    could crash ethereal [epan/dissectors/packet-srvloc.c, r17001,
+    epan/dissectors/packet-aim.c, r17512, epan/stats_tree.c, r17497,
+    CVE-2006-1937]
+  * Null pointer dereferences in the SMB PIPE dissector and when reading a
+    malformed Sniffer capture could crash ethereal
+    [epan/dissectors/packet-smb-pipe.c, r17509, r17523, r17621, r17708,
+    wiretap/ngsniffer.c, r17556, CVE-2006-1938]
+  * Null pointer dereferences in the ASN.1, GSM SMS, RPC and
+    ASN.1-based dissector and an invalid display filter could crash
+    ethereal [plugins/asn1/packet-asn1.c, r17710, r17770,
+    epan/dissectors/packet-gsm_sms.c, r17506,
+    epan/dissectors/packet-rpc.c, r17546, epan/asn1.c, r17489,
+    gtk/dfilter_expr_dlg.c, r17555, CVE-2006-1939]
+  * The SNDCP dissector could abort [epan/dissectors/packet-sndcp.c,
+    r17518, CVE-2006-1940]
+  
+ -- Martin Schulze <joey@infodrom.org>  Thu, 27 Apr 2006 18:40:37 +0200
+
+ethereal (0.10.10-2sarge4) stable-security; urgency=high
+
+  * Non-maintainer upload by the Security Team
+  * Backported new upstream version of dissect_ospf_v3_address_prefix() to
+    fix buffer overflow and potential arbitrary code execution
+    [epan/dissectors/packet-ospf.c, CVE-2005-3651]
+
+ -- Martin Schulze <joey@infodrom.org>  Sat, 10 Dec 2005 15:03:54 +0100
+
+ethereal (0.10.10-2sarge3) stable-security; urgency=high
+
+  * Security fixes for sarge:
+    * CAN-2005-2360 - free static memory and crash in LDAP
+    [ epan/dissectors/packet-ldap.c ]
+    * CAN-2005-2361 - crash in several dissectors
+      AgentX: changed plugins/agentx/packet-agentx.c 
+      PER:    changed epan/dissectors/packet-per.c 
+      DOCSIS: changed plugins/docsis/packet-docsis.c
+      RADIUS: changed epan/dissectors/packet-radius.c
+      Telnet: changed epan/dissectors/packet-telnet.c
+      IS-IS:  changed epan/dissectors/packet-isis-lsp.c
+      HTTP:   changed epan/tvbuff.c
+      DCERPC: changed epan/dissectors/packet-dcerpc.c
+      DHCP:   changed epan/dissectors/packet-bootp.c
+      SCTP:   changed gtk/sctp_graph_dlg.c
+      Does not apply: NCP
+    * CAN-2005-2363 - infinite loop in dissectors
+      SMPP:   changed epan/dissectors/packet-smpp.c 
+      802.3:  changed epan/dissectors/packet-ieee8023.c
+      H1:     changed epan/dissectors/packet-h1.c
+      DHCP:   changed epan/dissectors/packet-bootp.c
+      Does not apply: Megaco
+    * CAN-2005-2364 - null pointer dereference 
+      WBXML: Changed epan/dissectors/packet-wbxml.c
+      GIOP:  Changed epan/dissectors/packet-giop.c
+      Does not apply: CAMEL
+    * CAN-2005-2365 - buffer overflow or memory exhaustion in SMB
+      (Changed epan/dissectors/packet-smb.c)
+    * CAN-2005-2366 - abort or infinite loop in BER
+      Changed epan/dissectors/packet-per.c 
+    * CAN-2005-2367 - format strings found by iDEFENSE
+      Changed epan/dissectors/packet-per.c 
+      Changed plugins/irda/packet-irda.c
+      Changed plugins/profinet/packet-pn-dcp.c
+      Changed epan/dissectors/packet-iapp.c
+      Changed epan/dissectors/packet-gsm_a.c
+      Changed epan/dissectors/packet-ansi_map.c
+      Changed epan/dissectors/packet-rsvp.c
+      Changed epan/dissectors/packet-ansi_637.c
+      Changed epan/dissectors/packet-per.c
+      Changed epan/dissectors/packet-ansi_a.c
+      Changed epan/dissectors/packet-afp.c
+      Changed epan/dissectors/packet-dcerpc-spoolss.c
+      Changed epan/dissectors/packet-ncp2222.inc
+      Changed epan/dissectors/packet-slowprotocols.c
+
+ -- Javier Fernandez-Sanguino Pen~a <jfs@computer.org>  Sun, 18 Sep 2005 22:49:08 +0200
+
+ethereal (0.10.10-2sarge2) testing-proposed-updates; urgency=low
+
+  * Removed extraneous backports of some non-security related changes.
+    * completely reverted BACnet, CDP, CHDLC and GSSAPI.
+    * isolated security changes in DCM, MGCP, Kerberos and SPNEGO.
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  9 May 2005 13:35:01 +0200
+
+ethereal (0.10.10-2sarge1) testing-proposed-updates; urgency=high
+
+  * Updated dissectors with upstream (0.10.11) security fixes:
+    * denial of service (abort) in DHCP and Telnet dissectors (CAN-2005-1456)
+    * denial of service (crash) in AIM, LDAP, FibreChannel, GSM_MAP, SRVLOC
+      and NTLMSSP dissectors (CAN-2005-1457)
+    * problems (unknown) in KINK dissector (CAN-2005-1458)
+    * denial of service (assert) in WSP, BER, SMB, NDPS, IAX2, RADIUS, TCAP,
+      MRDISC, 802.3 Slow, SMBMailslot and SMB PIPE dissectors (CAN-2005-1459)
+    * denial of service (assert) in misc dissectors (CAN-2005-1460)
+    * buffer overflows in SIP, CMIP, CMP, CMS, CRMF, ESS, OCSP, X.509, ISIS,
+      DISTCC, FCELS, Q.931, NCP, TCAP, ISUP, MEGACO, PKIX1Explitit,
+      PKIX_Qualified and Presentation dissectors (CAN-2005-1461)
+    * double free in ICEP dissector (CAN-2005-1462)
+    * format string vulnerabities in DHCP and ANSI A dissectors
+      (CAN-2005-1463)
+    * infinite loop in KINK, L2TP, MGCP, EIGRP, DLSw, MEGACO, LMP and RSVP
+      dissectors (CAN-2005-1464)
+    * long loop in NSP dissector (CAN-2005-1465)
+    * large memory allocation in DICOM dissector (CAN-2005-1466)
+    * memory exhaustion in NDPS dissector (CAN-2005-1467)
+    * NULL dereference in WSP, Q.931, H.245, KINK, MGCP, RPC, SMBMailslot and
+      SMB NETLOGON dissectors (CAN-2005-1468)
+    * invalid pointer in GSM dissector (CAN-2005-1469)
+    * segmentation fault in TZSP, MGCP, ISUP, SMB and Bittorrent dissectors
+      (CAN-2005-1470)
+
+ -- Frederic Peters <fpeters@debian.org>  Sat,  7 May 2005 17:52:48 +0200
+
+ethereal (0.10.10-2) unstable; urgency=high
+
+  * Several security fixes from upstream subversion tree for the following
+    dissectors:
+    * DLSw (infinite loop) (part of CAN-2005-1464)
+    * ICEP (double free) (CAN-2005-1462)
+    * NDPS (memory exhaustion) (part of CAN-2005-1459)
+    * Q931 (buffer overflow) (part of CAN-2005-1461)
+    * RSVP (infinite loop) (part of CAN-2005-1464)
+    * SRVLOC (infinite loop)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 25 Apr 2005 15:30:55 +0200
+
+ethereal (0.10.10-1) unstable; urgency=high
+
+  * New upstream release; urgency high since it fixes security issues.
+    * Fixes buffer overflow in Etheric dissector. (CAN-2005-0704)
+    * Fixes crash in GPRS-LLC dissector. (CAN-2005-0705)
+    * Fixes buffer overflow in 3G-A11 dissector. (CAN-2005-0699)
+      (was already fixed in Debian package)
+  * debian/ethereal-dev.header-files: some files moved to epan/
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 14 Mar 2005 10:16:03 +0100
+
+ethereal (0.10.9-2) unstable; urgency=high
+
+  * Backported packet-3g-a11.c from upstream subversion trunk.
+    (fixes buffer overflows in 3G-A11 dissector)
+    (CAN-2005-0699 (under review)) (closes: #298771)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 10 Mar 2005 10:25:08 +0100
+
+ethereal (0.10.9-1) unstable; urgency=high
+
+  * New upstream release; urgency high since it fixes security issues.
+    * Fixes infinite loop in COPS dissector. (CAN-2005-0006)
+    * Fixes assertion in DLSw dissector. (CAN-2005-0007)
+    * Fixes memory corruption in DNP dissector. (CAN-2005-0008)
+    * Fixes assertion in Gnutella dissector. (CAN-2005-0009)
+    * Fixes memory corruption in MMSE dissector. (CAN-2005-0010)
+    * Fixes buffer overflow in X11 dissector. (CAN-2005-0084)
+  * asn2deb and idl2deb manpages relicensed by W. Borgert from GFDL to GPL
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 20 Jan 2005 23:03:19 +0100
+
+ethereal (0.10.8-4) unstable; urgency=low
+
+  * Updated libtool version in wiretap/ directory. (closes: #289962)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 12 Jan 2005 10:14:41 +0100
+
+ethereal (0.10.8-3) unstable; urgency=low
+
+  * Fixed dissect_cmip_InvokeIDType declaration (FTBFS with gcc-4.0)
+    (closes: #288990)
+  * epan/dissectors/packet-giop.c: fixed segfault with some GIOP packets
+    (closes: #288746)
+
+ -- Frederic Peters <fpeters@debian.org>  Fri,  7 Jan 2005 14:43:03 +0100
+
+ethereal (0.10.8-2) unstable; urgency=low
+
+  * Restored lost patch to idl2eth; sorry. (closes: #288740)
+  * ethereal_gen.py: fixed some includes.
+  * epan/prefs.c: Use sensible-brower as default browser.
+  * debian/control: build-depends on libpcap0.8-dev.
+  * debian/control: lower-case first letter of descriptions.
+
+ -- Frederic Peters <fpeters@debian.org>  Wed,  5 Jan 2005 14:34:57 +0100
+
+ethereal (0.10.8-1) unstable; urgency=high
+
+  * New upstream release.
+    * Now parses Auth option in DHCPv6 (closes: #283534)
+    * Urgency high since it fixes security issues with DICOM, RTP, HTTP
+      and SMB <http://www.ethereal.com/appnotes/enpa-sa-00016.html>
+      (CAN-2004-1139, CAN-2004-1140, CAN-2004-1141 and CAN-2004-1142)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 15 Dec 2004 22:13:41 +0100
+
+ethereal (0.10.7-3) unstable; urgency=low
+
+  * epan/prefs.c: changed default font to "monospace 10" (closes: #232408)
+
+ -- Frederic Peters <fpeters@debian.org>  Fri, 19 Nov 2004 18:31:22 +0100
+
+ethereal (0.10.7-2) unstable; urgency=low
+
+  * plugins/opsi/packet-opsi.c: backported resource exhaustion fix
+    (closes: #280556)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 18 Nov 2004 21:50:28 +0100
+
+ethereal (0.10.7-1) unstable; urgency=low
+
+  * New upstream release. (closes: #277923)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  1 Nov 2004 14:11:35 +0100
+
+ethereal (0.10.6-4) unstable; urgency=low
+
+  * Build in clean chroot; stupid me.  (closes: #276560)
+  * debian/rules: remove config.log on clean.
+
+ -- Frederic Peters <fpeters@debian.org>  Fri, 15 Oct 2004 00:12:58 +0200
+
+ethereal (0.10.6-3) unstable; urgency=medium
+
+  * Upgrades libtool (closes: #276515)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 14 Oct 2004 18:40:03 +0200
+
+ethereal (0.10.6-2) unstable; urgency=medium
+
+  * debian/ethereal-dev.header-files: added missing header files
+    (closes: #270581)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed,  8 Sep 2004 10:34:12 +0200
+
+ethereal (0.10.6-1) unstable; urgency=high
+
+  * New upstream realease.
+    * Gtk-Critical messages are fixed (closes: #260341, #263118)
+  * debian/rules: run libtoolize to fix sonames; fix a FTBFS bug
+    (closes: #265379)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 15 Aug 2004 11:58:03 +0200
+
+ethereal (0.10.5-4) unstable; urgency=low
+
+  * link libethereal.so to libadns and libm (closes: #262015)
+    (since this is a private shared library I don't think it was required)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 29 Jul 2004 15:41:02 +0200
+
+ethereal (0.10.5-3) unstable; urgency=low
+
+  * debian/ethereal-dev.header-files: install packet-rpc.h, crc16.h and crc32.h
+    (closes: #259375)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 14 Jul 2004 12:50:34 +0200
+
+ethereal (0.10.5-2) unstable; urgency=low
+
+  * Compile and install plugins (closes: #259199)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 13 Jul 2004 13:40:41 +0000
+
+ethereal (0.10.5-1) unstable; urgency=low
+
+  * New upstream release with security fixes.
+    + <http://www.ethereal.com/appnotes/enpa-sa-00015.html>
+    + Fixed the crash in protocol hierarchy (closes: #244743)
+    + Ethereal can be configured not to bug you about unsaved captures
+      (closes: #235721)
+  * Updated omniorb URL (closes: #257512)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 13 Jul 2004 10:16:55 +0200
+
+ethereal (0.10.4-3) unstable; urgency=low
+
+  * debian/rules: install libethereal in /usr/lib/ethereal, not /usr/lib/
+  * debian/ethereal-dev.header-files: added packet-ber.h
+  * idl2deb: ETH_VER_IMPORT and non-versioned autotools (closes: #255570)
+  * debian/control: updated depends to libpcap0.7-dev, no more libpcap-dev
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 22 Jun 2004 09:02:39 +0200
+
+ethereal (0.10.4-2) unstable; urgency=low
+
+  * Rebuilt against GTK+ 2.4; now in unstable.
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 25 May 2004 22:28:37 +0200
+
+ethereal (0.10.4-1) unstable; urgency=high
+
+  * New upstream release with security fixes.
+    <http://www.ethereal.com/appnotes/enpa-sa-00014.html>
+  * (sorry about the delay; I was away and forgot about this release)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 16 May 2004 00:02:53 +0200
+
+ethereal (0.10.3-3) unstable; urgency=low
+
+  * debian/control: removed dependency on gksu; moved to recommends
+  * debian/EtherealAsRoot.desktop: added TryExec=gksu so that the menu is
+    only shown when gksu is installed
+  * debian/ethereal.menu: removed entry for "ethereal as root" since
+    """running ethereal itself requires some wits, and user possesing
+    such skills would be able to launch it from xterm."""
+  * "Our Priorities are Our Users (...)", but ignore them if they ask
+    about gksu support; it's against the holy Debian Policy Manual and
+    a """300kB dependency *is* a big dependency""".
+  * This closes the bug and everybody is happy (closes: #240682)
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 10 Apr 2004 21:16:30 +0200
+
+ethereal (0.10.3-2) unstable; urgency=high
+
+  * Acknowledge NMU. (sorry)  (urgency high, security fixes)
+  * debian/control: added Build-Conflicts on libsnmp-dev
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 28 Mar 2004 23:14:51 +0200
+
+ethereal (0.10.3-1.0.1) unstable; urgency=low
+
+  * Recompile-only NMU.
+  * i386 package was uploaded with dependencies on GNOME libs from
+    experimental; rebuild using only dependencies from unstable.
+
+ -- Steve Langasek <vorlon@debian.org>  Sat, 27 Mar 2004 21:27:01 -0600
+
+ethereal (0.10.3-1) unstable; urgency=high
+
+  * New upstream release with security fixes. (hence urgency high)
+    http://www.ethereal.com/appnotes/enpa-sa-00013.html
+  * debian/rules: remove upstream debian/menu on build
+  * debian/control: added dependency on gksu
+  * debian/menu: added an entry to start ethereal with gksu
+    (closes: #71994)
+  * added another .desktop entry to start ethereal with gksu from Gnome menu
+  * Upstream changes; libethereal and libwiretap handled differently; they may
+    end up in new packages (but go in ethereal-common for now)
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 27 Mar 2004 14:09:49 +0100
+
+ethereal (0.10.2-2) unstable; urgency=low
+
+  * New files in ethereal-dev (closes: #236702)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun,  7 Mar 2004 21:43:17 +0100
+
+ethereal (0.10.2-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control: added libpcre3-dev to Build-Depends
+
+ -- Frederic Peters <fpeters@debian.org>  Fri,  5 Mar 2004 15:56:50 +0100
+
+ethereal (0.10.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * Include W. Bogert asn2deb (closes: #233603)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 19 Feb 2004 18:02:08 +0100
+
+ethereal (0.10.0-6) unstable; urgency=low
+
+  * debian/ethereal-common.manpages: added ethereal-filter.4
+    (closes: #230256)
+  * debian/control: updated build-depends on docbook-xsl since docbook.xsl
+    moved.
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 29 Jan 2004 18:11:43 +0100
+
+ethereal (0.10.0-5) unstable; urgency=low
+
+  * debian/rules: quotes around CFLAGS. (closes: #228492)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 19 Jan 2004 12:14:02 +0100
+
+ethereal (0.10.0-4) unstable; urgency=low
+
+  * Backported hexdump summary fix from CVS (closes: #226248)
+    http://www.ethereal.com/lists/ethereal-cvs/200312/msg00257.html
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  5 Jan 2004 15:27:06 +0100
+
+ethereal (0.10.0-3) unstable; urgency=low
+
+  * ethereal_gen.py: patched to handle ushort/ulong union discriminators.
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 18 Dec 2003 23:27:51 +0100
+
+ethereal (0.10.0-2) unstable; urgency=low
+
+  * debian/ethereal-dev.header-files: added missing header files.
+    (closes: #224246)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 17 Dec 2003 13:24:21 +0100
+
+ethereal (0.10.0-1) unstable; urgency=low
+
+  * New upstream release. (closes: #223857)
+    * correct fonts with GTK2. (closes: #197571)
+    * Includes missing help/ directory from CVS.
+  * Acknowledge NMU, thanks Ray.
+    * Security issues. (closes: #219590)
+    * idl2deb permissions. (closes: #211506)
+  * New idl2deb version, thanks. (closes: #213962)
+  * debian/ethereal-dev.header-files: include some missing header files
+    (closes the remaining of #211506)
+  * debian/control: versioned build-depends on debhelper.
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 13 Dec 2003 17:11:09 +0100
+
+ethereal (0.9.16-0.1) unstable; urgency=high
+
+  * NMU.
+  * New upstream release (addresses #219590 for sid).
+    Fixes potential security issues with several dissectors:
+    * GTP (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0925)
+    * ISAKMP and MEGACO
+      (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0926)
+    * SOCKS (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0927)
+    The upstream security advisory is enpa-sa-00011, available at
+    http://www.ethereal.com/appnotes/enpa-sa-00011.html
+  * [debian/rules]
+    * Don't remove doc/ethereal.pod and doc/tethereal.pod so the package
+      builds with pbuilder.
+    * Install idl2deb with execute permissions.
+
+ -- J.H.M. Dassen (Ray) <jdassen@debian.org>  Mon, 10 Nov 2003 12:11:55 +0100
+
+ethereal (0.9.15-1) unstable; urgency=low
+
+  * New upstream release. (closes: #210272)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 10 Sep 2003 16:13:17 +0200
+
+ethereal (0.9.14-5) unstable; urgency=low
+
+  * debian/control: versioned build-depends on docbook-xsl (closes: #208734)
+  * debian/rules: compiles with -mieee on alpha
+
+ -- Frederic Peters <fpeters@debian.org>  Sun,  7 Sep 2003 09:57:25 +0200
+
+ethereal (0.9.14-4) unstable; urgency=low
+
+  * debian/rules: install .desktop and images for menu.
+    (closes: #207271)
+  * debian/control: updated policy to 3.6.1.0 (no changes needed)
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 30 Aug 2003 23:27:00 +0200
+
+ethereal (0.9.14-3) unstable; urgency=low
+
+  * Add manpage for idl2deb
+  * Include missing header files. (closes: #197181)
+    - from same bug: remove dependency of ethereal-dev against ethereal-common
+    - from same bug: added dependency to libglib2.0-dev
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 19 Aug 2003 11:55:27 +0200
+
+ethereal (0.9.14-2) unstable; urgency=low
+
+  * Built for Python 2.3 since omniidl4 has been updated quickly.
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 14 Aug 2003 10:19:18 +0200
+
+ethereal (0.9.14-1) unstable; urgency=low
+
+  * The "I'm so happy to be alive I'll fix plenty of bugs" release
+  * New upstream release. (closes: #204345)
+  * Include W. Bogert idl2deb script
+  * debian/control: depends on current versions of omniidl or omniidl4 since
+    they only exist for Python 2.2 and I don't want ethereal-dev to break when
+    they will switch to Python 2.3.  I'll then release a new version.
+  * Several UI issues resolved upstream (closes: #199763)
+  * ethereal can now decode Jabber protocol (closes: #133099)
+  * debian/control: build-depends on libadns1-dev so that it now use the GNU
+    ADNS library for name resolution (closes: #197505)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 13 Aug 2003 00:06:27 +0200
+
+ethereal (0.9.13-1) unstable; urgency=low
+
+  * New upstream release.  Fixing several security issues.
+    (closes: #197107)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 12 Jun 2003 10:00:57 +0200
+
+ethereal (0.9.12-3) unstable; urgency=low
+
+  * Rebuilt with new libpcap. (closes: #196831)
+  * Built with GTK+ 2.2 (instead of GTK+ 1.2). (closes: #193450)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 11 Jun 2003 17:45:07 +0200
+
+ethereal (0.9.12-2) unstable; urgency=low
+
+  * Forgot to update version-depends and it didn't use ${source-version}.
+    Fixed. (closes: #192213)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed,  7 May 2003 01:16:45 +0200
+
+ethereal (0.9.12-1) unstable; urgency=high
+
+  * New upstream release.  Fixing several security issues.
+    (closes: #192107)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue,  6 May 2003 22:03:10 +0200
+
+ethereal (0.9.9-2) unstable; urgency=low
+
+  * Updated config.guess and config.sub to work on mips and mipsel
+    architectures (manually then through the patch provided by
+    Martin Godisch). (closes: #178701)
+  * Update to packet-socks.c
+  * debian/control: ethereal-dev now depends upon omniidl | omniidl4
+    (closes: #182620)
+  * idl2eth no longer needs PYTHONPATH to be set explicitely.
+    (closes: #182621)
+  * debian/ethereal-dev.header-files: included config.h and reassemble.h since
+    they seem necessary. (closes: #183625)
+  * Thanks to W. Borgert for bug reporting.
+
+ -- Frederic Peters <fpeters@debian.org>  Fri,  7 Mar 2003 22:52:27 +0000
+
+ethereal (0.9.9-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control: Tightened ethereal-common dependencies.
+    (closes: #172861, #176236, #178027)
+
+ -- Frederic Peters <fpeters@debian.org>  Fri, 24 Jan 2003 14:38:53 +0100
+
+ethereal (0.9.8-3) unstable; urgency=low
+
+  * debian/control: added versioned dependency between (t)ethereal and
+    ethereal-common to get the plug-ins. (closes: #172861)
+
+ -- Frederic Peters <fpeters@debian.org>  Fri, 13 Dec 2002 10:39:27 +0100
+
+ethereal (0.9.8-2) unstable; urgency=low
+
+  * Updated config.sub and config.guess with the ones from autotools-dev
+    (closes: #172407)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 10 Dec 2002 09:52:45 +0100
+
+ethereal (0.9.8-1) unstable; urgency=low
+
+  * New upstream release.
+  * This added (some) support for counting IPv6 packets during capture.
+    (closes: #164472)
+  * 0.9.7 fixed the LMP dissector. (closes: #163513)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  9 Dec 2002 10:00:51 +0100
+
+ethereal (0.9.7-2) unstable; urgency=low
+
+  * debian/control: added libgtk2.0-dev to build depends.
+  * debian/control: removed libsnmp-dev from build depends (ethereal is
+    compiled without SNMP support since it would link against libssl)
+    (the build-dep caused failure to build on architectures where perl 5.8
+    wasn't ready (dependency on libsnmp-perl))
+  * debian/control: added python, automake and autoconf to build depends.
+  * debian/rules: creating aclocal-missing directory on build.
+      (those bugs closes: #163443) (patch by LaMont Jones)
+  * debian/rules: install Python files to 2.2 directory, not 2.1
+  * debian/ethereal-dev.postinst: fixed Python version (closes: #163153)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  7 Oct 2002 15:06:06 +0200
+
+ethereal (0.9.7-1) unstable; urgency=low
+
+  * New upstream release. (closes: #162972)
+  * debian/copyright: include upstream author name. (closes: #151015)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue,  1 Oct 2002 16:20:45 +0200
+
+ethereal (0.9.6-2) unstable; urgency=low
+
+  * debian/control: changed Python dep to >= 2.2 and << 2.3 since 2.2 is now
+    the default version in sid.
 
- -- Your Name <your.name@your.domain>  Sat,  5 Feb 2000 23:51:26 +0100
+ -- Frederic Peters <fpeters@debian.org>  Sat, 14 Sep 2002 23:29:23 +0200
 
-ethereal (0.8.2-0unoff) unstable; urgency=low
+ethereal (0.9.6-1) unstable; urgency=low
 
-  * New upstream release. (unofficial package)
-  * debian directory added in CVS tree
+  * New upstream release.
+  * Fixes security issue in the ISIS protocol dissector (susceptible to
+    buffer overflow).
+     (see http://www.ethereal.com/appnotes/enpa-sa-00006.html)
+  * Add missing header files (packet-tcp.h and packet-tpkt.h) to ethereal-dev
+    (closes: #158808)
+  * Add default PYTHONPATH to idl2eth (closes: #158909)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  2 Sep 2002 10:13:06 +0200
+
+ethereal (0.9.5-3) unstable; urgency=low
+
+  * Rebuilt with new libpcap0.7. (closes: #156206)
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 10 Aug 2002 19:25:29 +0200
+
+ethereal (0.9.5-2) unstable; urgency=low
+
+  * Do not run libtoolize since it creates a bogus libtool file.
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  8 Jul 2002 16:07:00 +0200
+
+ethereal (0.9.5-1) unstable; urgency=low
+
+  * New upstream release.
+  * Fixes several security issues.
+    (http://www.ethereal.com/appnotes/enpa-sa-00005.html)
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 29 Jun 2002 19:13:30 +0200
+
+ethereal (0.9.4-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Fixes four security issues. (closes: #147595)
+    (http://www.ethereal.com/appnotes/enpa-sa-00004.html)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 20 May 2002 01:10:21 +0200
+
+ethereal (0.9.3-1) unstable; urgency=medium
+
+  * New upstream release
+  * Fixes ASN.1 zero-length g_malloc that could lead to security problems.
+    (see http://www.ethereal.com/appnotes/enpa-sa-00003.html)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 31 Mar 2002 21:45:11 +0200
+
+ethereal (0.9.2-3) unstable; urgency=low
+
+  * debian/rules: fixed typo that could have caused snmp not to be built.
+    (closes: #140147) This would happen if 1) built from the CVS tree and 2)
+    built on a system without libsnmp-dev ("impossible" since we build-depend
+    on it). Anyway it is fixed for correctness.
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 27 Mar 2002 14:00:31 +0100
+
+ethereal (0.9.2-2) unstable; urgency=low
+
+  * Added libwiretap.a to ethereal-dev (closes: #137971)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 12 Mar 2002 11:59:04 +0100
+
+ethereal (0.9.2-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Frederic Peters <fpeters@debian.org>  Tue,  5 Mar 2002 10:30:24 +0100
+
+ethereal (0.9.1-8) unstable; urgency=low
+
+  * debian/control: changed ethereal-dev section to devel.
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 25 Feb 2002 14:50:49 +0100
+
+ethereal (0.9.1-7) unstable; urgency=low
+
+  * debian/control: changed ethereal-dev Depends line to use omniidl-python
+    and no omniorb.
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 25 Feb 2002 13:47:42 +0100
+
+ethereal (0.9.1-6) unstable; urgency=low
+
+  * debian/control: fix Depends line for ethereal-dev (added libpcap-dev)
+  * idl2eth: added PYTHONPATH so that it runs.
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 18 Feb 2002 11:48:01 +0100
 
- -- Your Name <your.name@your.domain>  Wed, 26 Jan 2000 07:40:15 +0100
+ethereal (0.9.1-5) unstable; urgency=low
+
+  * debian/rules: added --disable-ssl so that ethereal is not built with
+    ssl support and may be uploaded to main. (closes: #134273)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 18 Feb 2002 09:33:30 +0100
+
+ethereal (0.9.1-4) unstable; urgency=low
+
+  * debian/rules: added forgotten header files to ethereal-dev.
+    (really closes: #105916)
+
+ -- Frederic Peters <fpeters@debian.org>  Fri, 15 Feb 2002 10:12:15 +0100
+
+ethereal (0.9.1-3) unstable; urgency=low
+
+  * debian/rules: after the quick and dirty repackaging of 0.9.1-1 this one
+    should be much better: 4 packages: ethereal-common, ethereal, tethereal
+    and etherel-dev (last three depending on ethereal-common).
+    This should address Christian Kurz remarks.
+    	(closes: #133798, #133796, #133806)
+    This should also please W. Borgert. (closes: #105916)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 13 Feb 2002 20:36:12 +0100
+
+ethereal (0.9.1-2) unstable; urgency=low
+
+  * debian/control: fixed typo in tethereal description (closes: #133019)
+
+ -- Frederic Peters <fpeters@debian.org>  Fri,  8 Feb 2002 23:55:49 +0100
+
+ethereal (0.9.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * Fixed protocol hierarchy display (closes: #131676)
+  * It is possible to see TOS fields instead of DS fields in IP header.
+    (option in preferences dialog) (closes: #121046)
+  * debian/rules: totally revamped build process: create an additional
+    tethereal package that doesn't depend on GTK+ (closes: #103488)
+    It is not yet perfect but I'm working on it...
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 28 Jan 2002 18:25:25 +0100
+
+ethereal (0.9.0-1) unstable; urgency=low
+
+  * New upstream release.
+  * Upstream fixed SNMP bugs (closes: #114361, #119580)
+  * Upstream fixed Sender->Receiver bug (closes: #112327)
+  * debian/copyright: fixed 'license' spelling.
+  * debian/rules: fixed 'clean' target to remove temporary files.
+  * debian/rules: moved $sysconfdir to /usr/share/ethereal since $sysconfdir
+    is not used here to store config files. (closes: #127638)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu,  3 Jan 2002 19:43:18 +0100
+
+ethereal (0.8.20-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Frederic Peters <fpeters@debian.org>  Fri, 19 Oct 2001 10:49:35 +0200
+
+ethereal (0.8.19-2) unstable; urgency=low
+
+  * debian/rules: added call to libtoolize so that it compiles on hppa.
+    (closes: #108662)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 17 Sep 2001 14:23:34 +0200
+
+ethereal (0.8.19-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control: improved description of package. (closes: #104744)
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 14 Jul 2001 11:57:12 +0200
+
+ethereal (0.8.17-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Frederic Peters <fpeters@debian.org>  Fri, 13 Apr 2001 13:33:35 +0200
+
+ethereal (0.8.16-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Frederic Peters <fpeters@debian.org>  Thu,  8 Mar 2001 09:07:34 +0100
+
+ethereal (0.8.15-2) unstable; urgency=low
+
+  * Rebuilt against libsnmp4.2 (closes: #83720)
+  * It is possible to not go in promiscuous mode (-p) (actually it was for
+    some time...) (closes: #34376)
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 27 Jan 2001 13:39:05 +0100
+
+ethereal (0.8.15-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 13 Jan 2001 19:36:26 +0100
+
+ethereal (0.8.14-2) unstable; urgency=low
+
+  * Fix for the socks dissector. (closes: #81164)
+    (patch by Jeff Foster <jfoste@woodward.com>)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 11 Jan 2001 00:27:02 +0100
+
+ethereal (0.8.14-1) unstable; urgency=low
+
+  * New upstream release.
+  * Officially fixes the buffer overflow exploit mentioned below (as well
+    as other possible ones)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 21 Nov 2000 22:48:16 +0100
+
+ethereal (0.8.13-3) unstable; urgency=low
+
+  * Fixed possible buffer overflow exploit in packet-afs.c (I could not
+    reproduce it so I don't know if my fix really works, please test it)
+    (exploit is on http://www.hacksware.com)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 21 Nov 2000 22:47:59 +0100
+
+ethereal (0.8.13-2) unstable; urgency=low
+
+  * Rebuilt against XFree86 4.0 libs (now that I'm allowed to...)
+  * Rebuilt against zlibg1 1.1.13-1 that has a correct shlibs file
+    (closes: #76533, #76552)
+  
+ -- Frederic Peters <fpeters@debian.org>  Fri, 10 Nov 2000 17:39:40 +0100
+
+ethereal (0.8.13-1) unstable; urgency=low
+
+  * New upstream release.
+  
+ -- Frederic Peters <fpeters@debian.org>  Sun, 29 Oct 2000 23:58:38 +0100
+
+ethereal (0.8.12-1) unstable; urgency=low
+
+  * New upstream release.
+  * Patch for SRVLOC frames has been applied upstrem.
+  
+ -- Frederic Peters <fpeters@debian.org>  Mon, 18 Sep 2000 10:22:27 +0200
+
+ethereal (0.8.11-1) unstable; urgency=low
+
+  * New upstream release.
+  * Applied patch to fix hang on some SRVLOC frames (closes: #68024)
+  
+ -- Frederic Peters <fpeters@debian.org>  Thu, 10 Aug 2000 21:06:52 +0200
+
+ethereal (0.8.10-1) unstable; urgency=low
+
+  * New upstream release.
+  * Added debhelper to Build-depends (closes: #66391)
+  
+ -- Frederic Peters <fpeters@debian.org>  Tue, 11 Jul 2000 22:36:45 +0200
+
+ethereal (0.8.9-2) unstable; urgency=low
+
+  * Updated Build-depends to match libsnmp (closes: #66018) (it's the same
+    entry as for 0.8.7-2; I need some sleep)
+  
+ -- Frederic Peters <fpeters@debian.org>  Thu, 22 Jun 2000 23:59:29 +0200
+
+ethereal (0.8.9-1) unstable; urgency=low
+
+  * New upstream release.
+  
+ -- Frederic Peters <fpeters@debian.org>  Tue, 20 Jun 2000 14:17:00 +0200
+
+ethereal (0.8.8-1) unstable; urgency=low
+
+  * New upstream release.
+  
+ -- Frederic Peters <fpeters@debian.org>  Wed, 10 May 2000 17:20:36 +0200
+
+ethereal (0.8.7-2) unstable; urgency=low
+
+  * Updated Build-depends to match libsnmp (closes: #63753)
+  
+ -- Frederic Peters <fpeters@debian.org>  Mon,  8 May 2000 19:02:29 +0200
+
+ethereal (0.8.7-1) unstable; urgency=low
+
+  * New upstream release.
+  
+ -- Frederic Peters <fpeters@debian.org>  Mon, 17 Apr 2000 18:41:21 +0200
+
+ethereal (0.8.6-1) unstable; urgency=low
+
+  * New upstream release.
+  * Linked against libsnmp4.1 (closes: #62324)
+  
+ -- Frederic Peters <fpeters@debian.org>  Fri, 14 Apr 2000 19:45:53 +0200
+
+ethereal (0.8.4-1) unstable; urgency=low
+
+  * New upstream release.
+  * Applied fix for correct decapsulation of PPP frames (closes: #59663)
+    (patch provided by Thomas Quinot <thomas@cuivre.fr.eu.org>)
+  
+ -- Frederic Peters <fpeters@debian.org>  Sun,  5 Mar 2000 20:04:11 +0100
+
+ethereal (0.8.3-1) unstable; urgency=low
+
+  * New upstream release.
+  * Checked PPTP problems (fix was introduced in 0.8.2) (closes: #55347)
+  
+ -- Frederic Peters <fpeters@debian.org>  Sat,  5 Feb 2000 23:51:26 +0100
+
+ethereal (0.8.2-2) unstable; urgency=low
+
+  * debian/control: fixed Build-Depends line (closes: #56707)
+  
+ -- Frederic Peters <fpeters@debian.org>  Mon, 31 Jan 2000 19:29:21 +0100
+
+ethereal (0.8.2-1) unstable; urgency=low
+
+  * New upstream release.
+  
+ -- Frederic Peters <fpeters@debian.org>  Sat, 29 Jan 2000 01:53:50 +0100
 
 ethereal (0.8.1-2) unstable; urgency=low
 
@@ -164,7 +1077,3 @@
 
  -- Frederic Peters <fpeters@debian.org>  Sun, 13 Sep 1998 23:05:47 +0200
 
-Local variables:
-mode: debian-changelog
-add-log-mailing-address: "fpeters@debian.org"
-End:
--- ethereal-0.10.10.orig/debian/control
+++ ethereal-0.10.10/debian/control
@@ -2,17 +2,18 @@
 Section: net
 Priority: optional
 Maintainer: Frederic Peters <fpeters@debian.org>
-Standards-Version: 3.5.6
-Build-Depends: libgtk1.2-dev, libgtk2.0-dev, libpcap-dev, flex, libz-dev, debhelper, libtool, python, automake, autoconf
+Standards-Version: 3.6.1.0
+Build-Depends: libgtk2.0-dev (>=2.4.0-0), libpcap0.8-dev, flex, libz-dev, debhelper (>= 3.0), libtool, python, automake, autoconf, autotools-dev, libadns1-dev, xsltproc, docbook-xsl (>= 1.64.1.0-0), libpcre3-dev
+Build-Conflicts: libsnmp4.2-dev, libsnmp5-dev
 
 Package: ethereal-common
 Architecture: any
 Depends: ${shlibs:Depends}
 Recommends: ethereal (>= 0.9.1-3) | tethereal (>= 0.9.1-3)
 Conflicts: ethereal (<< 0.9.1-3), tethereal (<< 0.9.1-3)
-Description: Network traffic analyser (common files)
+Description: network traffic analyser (common files)
  Ethereal is a network traffic analyzer, or "sniffer", for Unix and
- Unix-like operating systems. A sniffer is a tool used to capture
+ Unix-like operating systems. A sniffer is a tool used to capture 
  packets off the wire. Ethereal decodes numerous protocols (too many
  to list).
  .
@@ -21,10 +22,11 @@
 
 Package: ethereal
 Architecture: any
-Depends: ${shlibs:Depends}, ethereal-common
-Description: Network traffic analyzer
+Depends: ${shlibs:Depends}, ethereal-common (= ${Source-Version})
+Recommends: gksu
+Description: network traffic analyzer
  Ethereal is a network traffic analyzer, or "sniffer", for Unix and
- Unix-like operating systems. A sniffer is a tool used to capture
+ Unix-like operating systems. A sniffer is a tool used to capture 
  packets off the wire. Ethereal decodes numerous protocols (too many
  to list).
  .
@@ -32,10 +34,10 @@
 
 Package: tethereal
 Architecture: any
-Depends: ${shlibs:Depends}, ethereal-common
-Description: Network traffic analyzer (console)
+Depends: ${shlibs:Depends}, ethereal-common (= ${Source-Version})
+Description: network traffic analyzer (console)
  Ethereal is a network traffic analyzer, or "sniffer", for Unix and
- Unix-like operating systems. A sniffer is a tool used to capture
+ Unix-like operating systems. A sniffer is a tool used to capture 
  packets off the wire. Ethereal decodes numerous protocols (too many
  to list).
  .
@@ -45,10 +47,10 @@
 Package: ethereal-dev
 Architecture: any
 Section: devel
-Depends: ${shlibs:Depends}, ethereal-common, omniidl-python, libpcap-dev, libtool, python (>= 2.2), python (<< 2.3)
-Description: Network traffic analyser (development tools)
+Depends: ${shlibs:Depends}, omniidl (>> 1:3.0.4.1-10) | omniidl4 (>= 4.0.1-2) , libpcap0.8-dev, libtool, libglib2.0-dev, python, snacc, autotools-dev, debhelper, cdbs, automake1.7, autoconf
+Description: network traffic analyser (development tools)
  Ethereal is a network traffic analyzer, or "sniffer", for Unix and
- Unix-like operating systems. A sniffer is a tool used to capture
+ Unix-like operating systems. A sniffer is a tool used to capture 
  packets off the wire. Ethereal decodes numerous protocols (too many
  to list).
  .
--- ethereal-0.10.10.orig/debian/rules
+++ ethereal-0.10.10/debian/rules
@@ -8,21 +8,39 @@
 
 export DH_COMPAT=3
 
+DB2MAN=/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
+
+
+DEB_HOST_GNU_TYPE       ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+# Enable IEEE-conformant floating point math on alphas (not the default)
+ifeq (alpha-linux,$(DEB_HOST_GNU_TYPE))
+  CFLAGS += -mieee
+endif
+
+idl2deb.1: idl2deb.dbk
+	xsltproc --nonet --novalid $(DB2MAN) $<
+
+asn2deb.1: asn2deb.dbk
+	xsltproc --nonet --novalid $(DB2MAN) $<
+
 configure: configure-stamp
 configure-stamp:
 	dh_testdir
 
-	#libtoolize --force --copy
+	cp /usr/share/misc/config.guess /usr/share/misc/config.sub .
+	libtoolize --force --copy
 	-mkdir aclocal-missing
-	(if [ -x ./autogen.sh ]; then \
-	   ./autogen.sh --prefix=/usr --sysconfdir=/usr/share/ethereal --disable-static --disable-ssl --without-ucdsnmp; \
-	else \
-	   ./configure --prefix=/usr --sysconfdir=/usr/share/ethereal --disable-static --disable-ssl --without-ucdsnmp; \
+	(if [ ! -x ./configure ]; then \
+	   ./autogen.sh --prefix=/usr --sysconfdir=/usr/share/ethereal --disable-static --disable-ssl --without-ucdsnmp --enable-gtk2 --libdir=/usr/lib/ethereal --CFLAGS="$(CFLAGS)"; \
 	fi)
 
+	./configure --prefix=/usr --sysconfdir=/usr/share/ethereal --disable-static --disable-ssl --without-ucdsnmp --enable-gtk2 --libdir=/usr/lib/ethereal CFLAGS="$(CFLAGS)"
+
 	touch configure-stamp
 
-build: build-stamp
+build: build-stamp idl2deb.1 asn2deb.1
 build-stamp: configure-stamp
 	$(MAKE)
 
@@ -33,9 +51,11 @@
 	dh_testroot
 	rm -f build-stamp configure-stamp
 
+	cp /usr/share/misc/config.guess /usr/share/misc/config.sub .
 	-$(MAKE) distclean
-	rm -f rdps ethereal.1 tethereal.1 doc/ethereal.pod doc/tethereal.pod
+	rm -f rdps ethereal.1 tethereal.1 idl2deb.1 ethereal-filter.4 asn2deb.1
 	rm -f conftest conftest.c
+	rm -f config.guess config.sub config.log
 
 	dh_clean
 
@@ -52,19 +72,29 @@
 
 	# Add here commands to install the files into debian/tmp
 	$(MAKE) install DESTDIR=`pwd`/debian/tmp
-	mkdir -p `pwd`/debian/tmp/usr/lib/python2.2/site-packages/
+	mkdir -p `pwd`/debian/tmp/usr/share/applications/
+	cp ethereal.desktop `pwd`/debian/tmp/usr/share/applications/
+	cp debian/ethereal-root.desktop `pwd`/debian/tmp/usr/share/applications/
+	mkdir -p `pwd`/debian/tmp/usr/share/pixmaps/
+	cp image/hi48-app-ethereal.png `pwd`/debian/tmp/usr/share/pixmaps/
+	cp image/eicon3d32.xpm `pwd`/debian/tmp/usr/share/pixmaps/
+	mkdir -p `pwd`/debian/tmp/usr/lib/python2.3/site-packages/
+	install -m 755 `pwd`/idl2deb `pwd`/debian/tmp/usr/bin/
+	install -m 755 `pwd`/asn2deb `pwd`/debian/tmp/usr/bin/
 	cp `pwd`/ethereal_be.py `pwd`/ethereal_gen.py \
-			`pwd`/debian/tmp/usr/lib/python2.2/site-packages/
+			`pwd`/debian/tmp/usr/lib/python2.3/site-packages/
 	mkdir -p `pwd`/debian/tmp/usr/include/ethereal/
 	for F in `cat debian/ethereal-dev.header-files`; do \
 		cp --parents $$F `pwd`/debian/tmp/usr/include/ethereal; \
 	done
-	cp `pwd`/wiretap/libwiretap.a `pwd`/debian/tmp/usr/lib/
+	# .a is no longer built; why was is used ?
+	#cp `pwd`/wiretap/libwiretap.a `pwd`/debian/tmp/usr/lib/
 	-rm -rf `pwd`/debian/tmp/usr/man
 	dh_installman
 
 	dh_movefiles
 	dh_installdocs
+	-rm debian/menu   # from upstream debian/ package
 	dh_installmenu
 	dh_installchangelogs NEWS
 	dh_strip
--- ethereal-0.10.10.orig/debian/ethereal-common.manpages
+++ ethereal-0.10.10/debian/ethereal-common.manpages
@@ -0,0 +1,5 @@
+editcap.1
+mergecap.1
+text2pcap.1
+ethereal-filter.4
+
--- ethereal-0.10.10.orig/debian/ethereal-dev.header-files
+++ ethereal-0.10.10/debian/ethereal-dev.header-files
@@ -0,0 +1,42 @@
+color.h
+config.h
+epan/asn1.h
+epan/address.h
+epan/column_info.h
+epan/column-utils.h
+epan/conversation.h
+epan/crc16.h
+epan/crc32.h
+epan/dfilter/dfilter.h
+epan/dfilter/drange.h
+epan/dissectors/packet-ber.h
+epan/dissectors/packet-giop.h
+epan/dissectors/packet-per.h
+epan/dissectors/packet-rpc.h
+epan/dissectors/packet-tcp.h
+epan/dissectors/packet-tpkt.h
+epan/epan.h
+epan/except.h
+epan/exceptions.h
+epan/filesystem.h
+epan/frame_data.h
+epan/ftypes/ftypes.h
+epan/ipv4.h
+epan/nstime.h
+epan/packet.h
+epan/packet_info.h
+epan/pint.h
+epan/prefs.h
+epan/proto.h
+epan/reassemble.h
+epan/report_err.h
+epan/slab.h
+epan/tap.h
+epan/to_str.h
+epan/tvbuff.h
+epan/value_string.h
+epan/xdlc.h
+plugins/plugin_api_defs.h
+plugins/plugin_api.h
+plugins/plugin_table.h
+wiretap/wtap.h
--- ethereal-0.10.10.orig/debian/ethereal-common.files
+++ ethereal-0.10.10/debian/ethereal-common.files
@@ -0,0 +1,9 @@
+/usr/bin/editcap
+/usr/bin/mergecap
+/usr/bin/text2pcap
+/usr/lib/ethereal/libethereal.so.0
+/usr/lib/ethereal/libethereal.so.0.0.1
+/usr/lib/ethereal/libwiretap.so.0
+/usr/lib/ethereal/libwiretap.so.0.0.1
+/usr/lib/ethereal/plugins/*
+/usr/share/ethereal/*
--- ethereal-0.10.10.orig/debian/ethereal.menu
+++ ethereal-0.10.10/debian/ethereal.menu
@@ -0,0 +1,4 @@
+?package(ethereal):needs="X11" section="Apps/Net" title="Ethereal" \
+	command="/usr/bin/ethereal" \
+	icon="/usr/share/pixmaps/eicon3d32.xpm"
+
--- ethereal-0.10.10.orig/debian/ethereal-dev.docs
+++ ethereal-0.10.10/debian/ethereal-dev.docs
@@ -0,0 +1,5 @@
+doc/README.design
+doc/README.developer
+doc/README.idl2eth
+doc/README.plugins
+
--- ethereal-0.10.10.orig/debian/tethereal.manpages
+++ ethereal-0.10.10/debian/tethereal.manpages
@@ -0,0 +1 @@
+tethereal.1
--- ethereal-0.10.10.orig/debian/ethereal.manpages
+++ ethereal-0.10.10/debian/ethereal.manpages
@@ -0,0 +1 @@
+ethereal.1
--- ethereal-0.10.10.orig/debian/tethereal.files
+++ ethereal-0.10.10/debian/tethereal.files
@@ -0,0 +1,2 @@
+/usr/bin/tethereal
+
--- ethereal-0.10.10.orig/debian/ethereal-dev.postinst
+++ ethereal-0.10.10/debian/ethereal-dev.postinst
@@ -0,0 +1,19 @@
+#! /bin/sh -e
+
+PYTHON=python2.3
+
+case "$1" in
+	configure|abort-upgrade|abort-remove|abort-deconfigure)
+		/usr/bin/$PYTHON -O /usr/lib/$PYTHON/compileall.py -q \
+			/usr/lib/$PYTHON/site-packages/
+	;;
+	*)
+		echo "postinst called with unknown argument \`$1'" >&2
+		exit 1
+	;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
--- ethereal-0.10.10.orig/debian/ethereal-dev.manpages
+++ ethereal-0.10.10/debian/ethereal-dev.manpages
@@ -0,0 +1,3 @@
+idl2eth.1
+idl2deb.1
+asn2deb.1
--- ethereal-0.10.10.orig/debian/ethereal.files
+++ ethereal-0.10.10/debian/ethereal.files
@@ -0,0 +1,3 @@
+/usr/bin/ethereal
+/usr/share/applications/
+/usr/share/pixmaps/
--- ethereal-0.10.10.orig/debian/ethereal-dev.files
+++ ethereal-0.10.10/debian/ethereal-dev.files
@@ -0,0 +1,10 @@
+/usr/bin/idl2eth
+/usr/bin/idl2deb
+/usr/bin/asn2deb
+/usr/lib/ethereal/libethereal.so
+/usr/lib/ethereal/libethereal.la
+/usr/lib/ethereal/libwiretap.so
+/usr/lib/ethereal/libwiretap.la
+/usr/lib/python2.3/*
+/usr/include/ethereal/*
+
--- ethereal-0.10.10.orig/debian/ethereal-dev.prerm
+++ ethereal-0.10.10/debian/ethereal-dev.prerm
@@ -0,0 +1,15 @@
+#! /bin/bash -e
+#
+# Debian prerm script for Python x.y hierarchical modules
+# Written by Gregor Hoffleit <flight@debian.org>
+# Extended by Matthias Klose <doko@debian.org>
+#
+
+PACKAGE=`basename $0 | sed -e 's/\.[^.]*$//'`
+
+dpkg --listfiles $PACKAGE |
+	awk '$0~/\.py$/ {print $0"c\n" $0"o"}' |
+	xargs rm -f >&2
+
+#DEBHELPER#
+
--- ethereal-0.10.10.orig/debian/ethereal-root.desktop
+++ ethereal-0.10.10/debian/ethereal-root.desktop
@@ -0,0 +1,84 @@
+[Desktop Entry]
+# $Id: ethereal.desktop 11808 2004-08-22 09:22:15Z jmayer $
+# The format of this file is specified at
+# http://freedesktop.org/Standards/desktop-entry-spec/
+# The entries are in the order they are listed in version 0.9.4
+Type=Application
+Version=1.0
+Encoding=UTF-8
+Name=Ethereal (as root)
+GenericName=Network Analyzer
+GenericName[af]=Netwerk Analiseerder
+GenericName[az]=Şəbəkə Analiz Proqramı
+GenericName[bg]=Анализатор на мрежови трафик
+GenericName[bs]=Mrežni analizer
+GenericName[ca]=Analitzador de xarxa
+GenericName[cs]=Analyzátor sítě
+GenericName[da]=Netværksanalyse
+GenericName[de]=Programm für die Netzwerk-Analyse
+GenericName[el]=Αναλυτής Δικτύων
+GenericName[en_GB]=Network Analyser
+GenericName[eo]=Retanalizilo
+GenericName[es]=Analizador de redes
+GenericName[et]=Võrguliikluse analüsaator
+GenericName[eu]=Sare ikerketaria
+GenericName[fa]=تحلیل‌گر شبکه
+GenericName[fi]=Verkkoanalysaattori
+GenericName[fr]=Analyseur réseau
+GenericName[he]=מאבחן רשת
+GenericName[hr]=Program za analiziranje mreža
+GenericName[hu]=hálózatanalizáló
+GenericName[id]=Analisis jaringan
+GenericName[is]=Netskoðunartól
+GenericName[it]=Analizzatore di rete
+GenericName[ja]=ネットワークアナライザ
+GenericName[ko]=네트웍 분석기
+GenericName[lo]=ເຄື່ອງມືວິເຄາະເຄືອຂ່າຍ
+GenericName[lt]=Tinklo analizatorius
+GenericName[lv]=Tīkla Analizators
+GenericName[mk]=Анализатор на мрежи
+GenericName[mn]=Сүлжээ-шинжлэлийн програм
+GenericName[mt]=Analizzatur tan-network
+GenericName[nb]=Nettverksanalyse
+GenericName[nl]=netwerkanalyseprogramma
+GenericName[nn]=Nettverksanalyse
+GenericName[nso]=Moahlaahli wa Kgokagano
+GenericName[pl]=Analizator sieci
+GenericName[pt]=Analisador de Redes
+GenericName[pt_BR]=Analisador de rede
+GenericName[ro]=Analizor de reţea
+GenericName[ru]=Анализатор сетевого трафика
+GenericName[se]=Fierbmeanalysa
+GenericName[sk]=Analyzátor siete
+GenericName[sl]=Analizator omrežij
+GenericName[sr]=Analizatror mreže
+GenericName[ss]=Sihlatiyi seluchungechunge
+GenericName[sv]=Nätverksanalyserare
+GenericName[ta]=Å¨Ä ¬öÅ¡Ç÷
+GenericName[th]=เครื่องมือวิเคราะห์เครือข่าย
+GenericName[tr]=Ağ Analiz Programı
+GenericName[uk]=Аналізатор мережі
+GenericName[ven]=Musengulusi wa Vhukwamani
+GenericName[vi]=Trình phân tích  mạng
+GenericName[xh]=Umcukucezi Womsebenzi womnatha
+GenericName[zh_CN]=网络分析程序
+GenericName[zh_TW]=網路分析程式
+GenericName[zu]=Umhloli Woxhumano olusakazekile
+Comment=Network traffic analyzer
+Comment[fr]=Analyseur de trafic réseau
+Comment[fi]=Verkkoliikenne analysaattori
+Comment[sv]=Nätverkstrafikanalysator
+Icon=hi48-app-ethereal.png
+TryExec=gksu
+Exec=gksu -u root /usr/bin/ethereal
+Path=
+Terminal=false
+MimeType=
+Categories=GNOME;Application;Network;
+# Found in Suse 9.1:
+X-KDE-SubstituteUID=true
+# Deprecated:
+# TerminalOptions=
+# BinaryPattern=ethereal
+# MapNotify=true
+# Protocols=
--- ethereal-0.10.10.orig/doc/Makefile.in
+++ ethereal-0.10.10/doc/Makefile.in
@@ -63,11 +63,8 @@
 subdir = doc
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/epan/Makefile.in
+++ ethereal-0.10.10/epan/Makefile.in
@@ -91,11 +91,8 @@
 	ChangeLog NEWS
 subdir = epan
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/epan/asn1.c
+++ ethereal-0.10.10/epan/asn1.c
@@ -1078,7 +1078,7 @@
 
     default:
 	snprintf(errstrbuf, sizeof errstrbuf, "Unknown error (%d)", err);
-	errstr = errstrbuf;
+	errstr = strdup(errstrbuf);
 	break;
     }
     return errstr;
--- ethereal-0.10.10.orig/epan/prefs.c
+++ ethereal-0.10.10/epan/prefs.c
@@ -1,7 +1,7 @@
 /* prefs.c
  * Routines for handling preferences
  *
- * $Id: prefs.c 13559 2005-03-01 00:05:57Z guy $
+ * $Id: prefs.c 13889 2005-03-24 03:10:31Z guy $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -895,7 +895,7 @@
  *
  */
 
-#define MAX_VAR_LEN    48
+#define MAX_VAR_LEN    100
 
 #define DEF_NUM_COLS    6
 
@@ -1026,7 +1026,7 @@
      */
     prefs.gui_font_name1 = g_strdup("-misc-fixed-medium-r-semicondensed-*-*-120-*-*-*-*-iso8859-1");
     /* XXX- is this the correct default font name for GTK2 none win32? */
-    prefs.gui_font_name2 = g_strdup("fixed medium 12");
+    prefs.gui_font_name2 = g_strdup("monospace 10");
 #endif
     prefs.gui_marked_fg.pixel        =     65535;
     prefs.gui_marked_fg.red          =     65535;
@@ -1046,7 +1046,7 @@
     prefs.gui_fileopen_preview       = 3;
     prefs.gui_ask_unsaved            = TRUE;
     prefs.gui_find_wrap              = TRUE;
-    prefs.gui_webbrowser             = g_strdup("mozilla %s");
+    prefs.gui_webbrowser             = g_strdup("sensible-browser %s");
     prefs.gui_window_title           = g_strdup("");
     prefs.gui_layout_type            = layout_type_5;
     prefs.gui_layout_content_1       = layout_pane_content_plist;
@@ -1079,6 +1079,7 @@
       /*
        * It doesn't exist by the new name; try the old name.
        */
+      g_free(gpf_path);
       gpf_path = get_datafile_path(OLD_GPF_NAME);
       pf = fopen(gpf_path, "r");
     }
@@ -1156,7 +1157,8 @@
       *pf_errno_return = errno;
       *pf_read_errno_return = 0;
       *pf_path_return = pf_path;
-    }
+    } else
+      g_free(pf_path);
   }
 
   return &prefs;
--- ethereal-0.10.10.orig/epan/proto.c
+++ ethereal-0.10.10/epan/proto.c
@@ -1,7 +1,7 @@
 /* proto.c
  * Routines for protocol tree
  *
- * $Id: proto.c 13180 2005-01-26 23:17:00Z ulfl $
+ * $Id: proto.c 14300 2005-05-03 19:39:24Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -48,6 +48,35 @@
 
 #define cVALS(x) (const value_string*)(x)
 
+#if 1
+#define TRY_TO_FAKE_THIS_ITEM(tree, hfindex) \
+	/* If this item is not referenced we dont have to do much work	\
+	   at all but we should still return a node so that		\
+	   field items below this node ( think proto_item_add_subtree() )\
+	   will still have somewhere to attach to			\
+	   or else filtering will not work (they would be ignored since tree\
+	   would be NULL).						\
+	   DONT try to fake a node where PITEM_FINFO(pi) is NULL	\
+	   since dissectors that want to do proto_item_set_len() ot	\
+	   other operations that dereference this would crash.		\
+	   We dont fake FT_PROTOCOL either since these are cheap and    \
+	   some stuff (proto hier stat) assumes they always exist.	\
+	*/								\
+	if(!(PTREE_DATA(tree)->visible)){				\
+		if(PITEM_FINFO(tree)){					\
+			register header_field_info *hfinfo;		\
+			PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);	\
+			if((hfinfo->ref_count == 0)			\
+			&& (hfinfo->type!=FT_PROTOCOL)){		\
+				/* just return tree back to the caller */\
+				return tree;				\
+			}						\
+		}							\
+	}
+#else
+#define TRY_TO_FAKE_THIS_ITEM(tree, hfindex) ;
+#endif
+
 static gboolean
 proto_tree_free_node(proto_node *node, gpointer data);
 
@@ -187,6 +216,10 @@
 	SLAB_FREE(il, item_label_t)
 
 
+#define PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo) \
+	DISSECTOR_ASSERT((guint)hfindex < gpa_hfinfo.len); \
+	hfinfo=gpa_hfinfo.hfi[hfindex];		
+
 
 /* List which stores protocols and fields that have been registered */
 typedef struct _gpa_hfinfo_t {
@@ -426,6 +459,23 @@
 free_GPtrArray_value(gpointer key _U_, gpointer value, gpointer user_data _U_)
 {
 	GPtrArray   *ptrs = value;
+	gint hfid = (gint)key;
+	header_field_info *hfinfo;
+
+	
+	PROTO_REGISTRAR_GET_NTH(hfid, hfinfo);
+	if(hfinfo->ref_count){
+		/* when a field is referenced by a filter this also 
+		   affects the refcount for the parent protocol so we need
+		   to adjust the refcount for the parent as well
+		*/
+		if( (hfinfo->parent != -1) && (hfinfo->ref_count) ){
+			header_field_info *parent_hfinfo;
+			PROTO_REGISTRAR_GET_NTH(hfinfo->parent, parent_hfinfo);
+			parent_hfinfo->ref_count -= hfinfo->ref_count;
+		}
+		hfinfo->ref_count = 0;
+	}
 
 	g_ptr_array_free(ptrs, TRUE);
 }
@@ -483,9 +533,32 @@
 	PTREE_DATA(tree)->visible = visible;
 }
 
-#define PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo) \
-	g_assert((guint)hfindex < gpa_hfinfo.len); \
-	hfinfo=gpa_hfinfo.hfi[hfindex];		
+/* Assume dissector set only its protocol fields.
+   This function is called by dissectors and allowes to speed up filtering
+   in ethereal, if this function returns FALSE it is safe to reset tree to NULL
+   and thus skip calling most of the expensive proto_tree_add_...()
+   functions.
+   If the tree is visible we implicitely assume the field is referenced.
+*/
+gboolean
+proto_field_is_referenced(proto_tree *tree, int proto_id)
+{
+	register header_field_info *hfinfo;
+
+
+	if (!tree)
+		return FALSE;
+
+	if (PTREE_DATA(tree)->visible)
+		return TRUE;
+
+	PROTO_REGISTRAR_GET_NTH(proto_id, hfinfo);
+	if (hfinfo->ref_count != 0)
+		return TRUE;
+
+	return FALSE;
+}
+
 
 /* Finds a record in the hf_info_records array by id. */
 header_field_info*
@@ -502,7 +575,7 @@
 header_field_info*
 proto_registrar_get_byname(const char *field_name)
 {
-	g_assert(field_name != NULL);
+	DISSECTOR_ASSERT(field_name != NULL);
 	return g_tree_lookup(gpa_name_tree, (gpointer)field_name);
 }
 
@@ -604,7 +677,7 @@
 		break;
 
 	default:
-		g_assert_not_reached();
+		DISSECTOR_ASSERT_NOT_REACHED();
 		value = 0;
 		break;
 	}
@@ -642,7 +715,7 @@
 		break;
 
 	default:
-		g_assert_not_reached();
+		DISSECTOR_ASSERT_NOT_REACHED();
 		value = 0;
 		break;
 	}
@@ -667,6 +740,8 @@
 	if (!tree)
 		return(NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	new_fi = alloc_field_info(tree, hfindex, tvb, start, &length);
 
 	if (new_fi == NULL)
@@ -732,7 +807,7 @@
 
 		case FT_INT64:
 		case FT_UINT64:
-			g_assert(length == 8);
+			DISSECTOR_ASSERT(length == 8);
 			proto_tree_set_uint64_tvb(new_fi, tvb, start, little_endian);
 			break;
 
@@ -746,29 +821,29 @@
 			break;
 
 		case FT_IPv4:
-			g_assert(length == 4);
+			DISSECTOR_ASSERT(length == 4);
 			tvb_memcpy(tvb, (guint8 *)&value, start, 4);
 			proto_tree_set_ipv4(new_fi, little_endian ? GUINT32_SWAP_LE_BE(value) : value);
 			break;
 
 		case FT_IPXNET:
-			g_assert(length == 4);
+			DISSECTOR_ASSERT(length == 4);
 			proto_tree_set_ipxnet(new_fi,
 			    get_uint_value(tvb, start, 4, FALSE));
 			break;
 
 		case FT_IPv6:
-			g_assert(length == 16);
+			DISSECTOR_ASSERT(length == 16);
 			proto_tree_set_ipv6_tvb(new_fi, tvb, start);
 			break;
 
 		case FT_ETHER:
-			g_assert(length == 6);
+			DISSECTOR_ASSERT(length == 6);
 			proto_tree_set_ether_tvb(new_fi, tvb, start);
 			break;
 
 		case FT_FLOAT:
-			g_assert(length == 4);
+			DISSECTOR_ASSERT(length == 4);
 			if (little_endian)
 				floatval = tvb_get_letohieee_float(tvb, start);
 			else
@@ -777,7 +852,7 @@
 			break;
 
 		case FT_DOUBLE:
-			g_assert(length == 8);
+			DISSECTOR_ASSERT(length == 8);
 			if (little_endian)
 				doubleval = tvb_get_letohieee_double(tvb, start);
 			else
@@ -876,7 +951,7 @@
 			g_error("new_fi->hfinfo->type %d (%s) not handled\n",
 					new_fi->hfinfo->type,
 					ftype_name(new_fi->hfinfo->type));
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 			break;
 	}
 
@@ -891,10 +966,12 @@
 
 	/* If the proto_tree wants to keep a record of this finfo
 	 * for quick lookup, then record it. */
-	hash = PTREE_DATA(tree)->interesting_hfids;
-	ptrs = g_hash_table_lookup(hash, GINT_TO_POINTER(hfindex));
-	if (ptrs) {
-		g_ptr_array_add(ptrs, new_fi);
+	if (new_fi->hfinfo->ref_count) {
+		hash = PTREE_DATA(tree)->interesting_hfids;
+		ptrs = g_hash_table_lookup(hash, GINT_TO_POINTER(hfindex));
+		if (ptrs) {
+			g_ptr_array_add(ptrs, new_fi);
+		}
 	}
 
 	return pi;
@@ -929,7 +1006,7 @@
 		return (NULL);
 
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_NONE);
+	DISSECTOR_ASSERT(hfinfo->type == FT_NONE);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, NULL);
 
@@ -962,7 +1039,7 @@
 		return (NULL);
 
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_PROTOCOL);
+	DISSECTOR_ASSERT(hfinfo->type == FT_PROTOCOL);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 
@@ -992,8 +1069,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_BYTES);
+	DISSECTOR_ASSERT(hfinfo->type == FT_BYTES);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 	proto_tree_set_bytes(new_fi, start_ptr, length);
@@ -1065,8 +1144,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_ABSOLUTE_TIME ||
+	DISSECTOR_ASSERT(hfinfo->type == FT_ABSOLUTE_TIME ||
 				hfinfo->type == FT_RELATIVE_TIME);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
@@ -1127,8 +1208,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_IPXNET);
+	DISSECTOR_ASSERT(hfinfo->type == FT_IPXNET);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 	proto_tree_set_ipxnet(new_fi, value);
@@ -1188,8 +1271,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_IPv4);
+	DISSECTOR_ASSERT(hfinfo->type == FT_IPv4);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 	proto_tree_set_ipv4(new_fi, value);
@@ -1249,8 +1334,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_IPv6);
+	DISSECTOR_ASSERT(hfinfo->type == FT_IPv6);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 	proto_tree_set_ipv6(new_fi, value_ptr);
@@ -1334,11 +1421,13 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_STRING || hfinfo->type == FT_STRINGZ);
+	DISSECTOR_ASSERT(hfinfo->type == FT_STRING || hfinfo->type == FT_STRINGZ);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
-	g_assert(length >= 0);
+	DISSECTOR_ASSERT(length >= 0);
 	proto_tree_set_string(new_fi, value, FALSE);
 
 	return pi;
@@ -1395,7 +1484,7 @@
 
 	fi = PITEM_FINFO(pi);
 	hfinfo = fi->hfinfo;
-	g_assert(hfinfo->type == FT_STRING || hfinfo->type == FT_STRINGZ);
+	DISSECTOR_ASSERT(hfinfo->type == FT_STRING || hfinfo->type == FT_STRINGZ);
 	old_str = fvalue_get(&fi->value);
 	new_str = g_malloc(strlen(old_str) + strlen(str) + 1);
 	sprintf(new_str, "%s%s", old_str, str);
@@ -1407,7 +1496,10 @@
 proto_tree_set_string(field_info *fi, const char* value,
 		gboolean already_allocated)
 {
-	fvalue_set(&fi->value, (gpointer) value, already_allocated);
+	if (value)
+		fvalue_set(&fi->value, (gpointer) value, already_allocated);
+	else
+		fvalue_set(&fi->value, (gpointer) "[ Null ]", already_allocated);
 }
 
 static void
@@ -1436,8 +1528,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_ETHER);
+	DISSECTOR_ASSERT(hfinfo->type == FT_ETHER);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 	proto_tree_set_ether(new_fi, value);
@@ -1503,8 +1597,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_BOOLEAN);
+	DISSECTOR_ASSERT(hfinfo->type == FT_BOOLEAN);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 	proto_tree_set_boolean(new_fi, value);
@@ -1564,8 +1660,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_FLOAT);
+	DISSECTOR_ASSERT(hfinfo->type == FT_FLOAT);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 	proto_tree_set_float(new_fi, value);
@@ -1625,8 +1723,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_DOUBLE);
+	DISSECTOR_ASSERT(hfinfo->type == FT_DOUBLE);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 	proto_tree_set_double(new_fi, value);
@@ -1686,6 +1786,8 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
 	switch(hfinfo->type) {
 		case FT_UINT8:
@@ -1699,7 +1801,7 @@
 			break;
 
 		default:
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 	}
 
 	return pi;
@@ -1772,8 +1874,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_UINT64);
+	DISSECTOR_ASSERT(hfinfo->type == FT_UINT64);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 	proto_tree_set_uint64(new_fi, value);
@@ -1811,6 +1915,8 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
 	switch(hfinfo->type) {
 		case FT_INT8:
@@ -1823,7 +1929,7 @@
 			break;
 
 		default:
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 	}
 
 	return pi;
@@ -1896,8 +2002,10 @@
 	if (!tree)
 		return (NULL);
 
+	TRY_TO_FAKE_THIS_ITEM(tree, hfindex);
+
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
-	g_assert(hfinfo->type == FT_INT64);
+	DISSECTOR_ASSERT(hfinfo->type == FT_INT64);
 
 	pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length, &new_fi);
 	proto_tree_set_uint64(new_fi, (guint64)value);
@@ -1948,7 +2056,7 @@
         /* XXX - is it safe to continue here? */
     }
 
-	g_assert(tfi == NULL ||
+	DISSECTOR_ASSERT(tfi == NULL ||
 	    (tfi->tree_type >= 0 && tfi->tree_type < num_tree_types));
 
 	PROTO_NODE_NEW(pnode);
@@ -1958,7 +2066,7 @@
 
 	if (tnode->last_child != NULL) {
 		sibling = tnode->last_child;
-		g_assert(sibling->next == NULL);
+		DISSECTOR_ASSERT(sibling->next == NULL);
 		sibling->next = pnode;
 	} else
 		tnode->first_child = pnode;
@@ -1988,10 +2096,12 @@
 
 	/* If the proto_tree wants to keep a record of this finfo
 	 * for quick lookup, then record it. */
-	hash = PTREE_DATA(tree)->interesting_hfids;
-	ptrs = g_hash_table_lookup(hash, GINT_TO_POINTER(hfindex));
-	if (ptrs) {
-		g_ptr_array_add(ptrs, fi);
+	if (fi->hfinfo->ref_count) {
+		hash = PTREE_DATA(tree)->interesting_hfids;
+		ptrs = g_hash_table_lookup(hash, GINT_TO_POINTER(hfindex));
+		if (ptrs) {
+			g_ptr_array_add(ptrs, fi);
+		}
 	}
 
 	/* Does the caller want to know the fi pointer? */
@@ -2008,15 +2118,25 @@
 {
 	header_field_info	*hfinfo;
 	field_info		*fi;
+	gint			item_length;
+	gint			length_remaining;
 
 	/*
 	 * We only allow a null tvbuff if the item has a zero length,
 	 * i.e. if there's no data backing it.
 	 */
-	g_assert(tvb != NULL || *length == 0);
+	DISSECTOR_ASSERT(tvb != NULL || *length == 0);
 
 	PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
 
+	/*
+	 * XXX - in some protocols, there are 32-bit unsigned length
+	 * fields, so lengths in protocol tree and tvbuff routines
+	 * should really be unsigned.  We should have, for those
+	 * field types for which "to the end of the tvbuff" makes sense,
+	 * additional routines that take no length argument and
+	 * add fields that run to the end of the tvbuff.
+	 */
 	if (*length == -1) {
 		/*
 		 * For FT_NONE, FT_PROTOCOL, FT_BYTES, and FT_STRING fields,
@@ -2077,14 +2197,14 @@
 				 */
 				tvb_ensure_bytes_exist(tvb, start, 0);
 			}
-			g_assert(*length >= 0);
+			DISSECTOR_ASSERT(*length >= 0);
 			break;
 
 		case FT_NONE:
 		case FT_BYTES:
 		case FT_STRING:
 			*length = tvb_ensure_length_remaining(tvb, start);
-			g_assert(*length >= 0);
+			DISSECTOR_ASSERT(*length >= 0);
 			break;
 
 		case FT_STRINGZ:
@@ -2095,13 +2215,31 @@
 			break;
 
 		default:
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 		}
+		item_length = *length;
 	} else {
-		if (*length < 0) {
-			REPORT_DISSECTOR_BUG(g_strdup_printf("\"%s\" - \"%s\" invalid length: %d (%s:%u)",
-			    hfinfo->name, hfinfo->abbrev, *length,
-			    __FILE__, __LINE__));
+		item_length = *length;
+		if (hfinfo->type == FT_PROTOCOL || hfinfo->type == FT_NONE) {
+			/*
+			 * These types are for interior nodes of the
+			 * tree, and don't have data associated with
+			 * them; if the length is negative (XXX - see
+			 * above) or goes past the end of the tvbuff,
+			 * cut it short at the end of the tvbuff.
+			 * That way, if this field is selected in
+			 * Ethereal, we don't highlight stuff past
+			 * the end of the data.
+			 */
+            /* XXX - what to do, if we don't have a tvb? */
+            if(tvb) {
+			    length_remaining = tvb_length_remaining(tvb, start);
+			    if (item_length < 0 || (item_length > 0 && (length_remaining < item_length)))
+				    item_length = length_remaining;
+            }
+		}
+		if (item_length < 0) {
+			THROW(ReportedBoundsError);
 		}
 	}
 
@@ -2110,7 +2248,7 @@
 	fi->hfinfo = hfinfo;
 	fi->start = start;
 	fi->start+=(tvb)?TVB_RAW_OFFSET(tvb):0;
-	fi->length = *length;
+	fi->length = item_length;
 	fi->tree_type = -1;
 	fi->flags = 0;
 	if (!PTREE_DATA(tree)->visible)
@@ -2208,7 +2346,7 @@
 	if (pi == NULL)
 		return;
 	fi = PITEM_FINFO(pi);
-	g_assert(length >= 0);
+	DISSECTOR_ASSERT(length >= 0);
 	fi->length = length;
 }
 
@@ -2228,7 +2366,7 @@
 		return;
 	fi = PITEM_FINFO(pi);
 	end += TVB_RAW_OFFSET(tvb);
-	g_assert(end >= fi->start);
+	DISSECTOR_ASSERT(end >= fi->start);
 	fi->length = end - fi->start;
 }
 
@@ -2269,10 +2407,26 @@
 void
 proto_tree_prime_hfid(proto_tree *tree, gint hfid)
 {
+	header_field_info *hfinfo;
+
 	g_hash_table_insert(PTREE_DATA(tree)->interesting_hfids,
 		GINT_TO_POINTER(hfid), g_ptr_array_new());
-}
 
+	PROTO_REGISTRAR_GET_NTH(hfid, hfinfo);
+	/* this field is referenced by a filter so increase the refcount.
+	   also increase the refcount for the parent, i.e the protocol.
+	*/
+	hfinfo->ref_count++;
+	/* only increase the refcount if there is a parent.
+	   if this is a protocol and not a field then parent will be -1
+	   and there is no parent to add any refcounting for.
+	*/
+	if (hfinfo->parent != -1) {
+		header_field_info *parent_hfinfo;
+		PROTO_REGISTRAR_GET_NTH(hfinfo->parent, parent_hfinfo);
+		parent_hfinfo->ref_count++;
+	}
+}
 
 proto_tree*
 proto_item_add_subtree(proto_item *pi,  gint idx) {
@@ -2282,8 +2436,9 @@
 		return(NULL);
 
 	fi = PITEM_FINFO(pi);
-	g_assert(idx >= 0 && idx < num_tree_types);
+	DISSECTOR_ASSERT(idx >= 0 && idx < num_tree_types);
 	fi->tree_type = idx;
+
 	return (proto_tree*) pi;
 }
 
@@ -2294,21 +2449,23 @@
 	if (!pi)
 		return(NULL);
 	fi = PITEM_FINFO(pi);
-	if (fi->tree_type == -1)
+	if ( (!fi) || (fi->tree_type == -1) )
 		return(NULL);
 	return (proto_tree*) pi;
 }
 
 proto_item*
 proto_item_get_parent(proto_item *ti) {
-	if (!ti)
+	/* dont bother if tree is not visible */
+	if( (!ti) || (!(PTREE_DATA(ti)->visible)) )
 		return (NULL);
 	return ti->parent;
 }
 
 proto_item*
 proto_item_get_parent_nth(proto_item *ti, int gen) {
-	if (!ti)
+	/* dont bother if tree is not visible */
+	if( (!ti) || (!(PTREE_DATA(ti)->visible)) )
 		return (NULL);
 	while (gen--) {
 		ti = ti->parent;
@@ -2321,7 +2478,8 @@
 
 proto_item* 
 proto_tree_get_parent(proto_tree *tree) {
-	if (!tree)
+	/* dont bother if tree is not visible */
+	if( (!tree) || (!(PTREE_DATA(tree)->visible)) )
 		return (NULL);
 	return (proto_item*) tree;
 }
@@ -2330,19 +2488,21 @@
 int
 proto_register_protocol(char *name, char *short_name, char *filter_name)
 {
-	protocol_t *protocol;
-	header_field_info *hfinfo;
-	int proto_id;
+    protocol_t *protocol;
+    header_field_info *hfinfo;
+    int proto_id;
     char *existing_name;
     gint *key;
+    guint i;
+    gboolean found_invalid;
 
-	/*
-	 * Make sure there's not already a protocol with any of those
-	 * names.  Crash if there is, as that's an error in the code
+    /*
+     * Make sure there's not already a protocol with any of those
+     * names.  Crash if there is, as that's an error in the code
      * or an inappropriate plugin.
      * This situation has to be fixed to not register more than one
-	 * protocol with the same name.
-	 *
+     * protocol with the same name.
+     *
      * This is done by reducing the number of strcmp (and alike) calls as much as possible,
      * as this significally slows down startup time.
      *
@@ -2357,7 +2517,7 @@
     existing_name = g_hash_table_lookup(proto_names, key);
     if (existing_name != NULL) {
         /* g_error will terminate the program */
-        g_error("The protocol name \"%s\" is existing more than one time!"
+        g_error("Duplicate protocol name \"%s\"!"
             " This might be caused by an inappropriate plugin or a development error.", name);
     }
     g_hash_table_insert(proto_names, key, name);
@@ -2366,46 +2526,60 @@
     *key = g_str_hash(short_name);
     existing_name = g_hash_table_lookup(proto_short_names, key);
     if (existing_name != NULL) {
-        g_error("The protocol short_name \"%s\" is existing more than one time!"
+        g_error("Duplicate protocol short_name \"%s\"!"
             " This might be caused by an inappropriate plugin or a development error.", short_name);
     }
     g_hash_table_insert(proto_short_names, key, short_name);
 
+    found_invalid = FALSE;
+    for (i = 0; i < strlen(filter_name); i++) {
+        if (! (islower(filter_name[i]) ||
+               isdigit(filter_name[i]) ||
+               filter_name[i] == '-'   ||
+               filter_name[i] == '_'   ||
+               filter_name[i] == '.'   )) {
+            found_invalid = TRUE;
+        }
+    }
+    if (found_invalid) {
+        g_warning("Protocol filter name \"%s\" has one or more invalid characters.", filter_name);
+    }
     key = g_malloc (sizeof(gint));
     *key = g_str_hash(filter_name);
     existing_name = g_hash_table_lookup(proto_filter_names, key);
     if (existing_name != NULL) {
-        g_error("The protocol filter_name \"%s\" is existing more than one time!"
+        g_error("Duplicate protocol filter_name \"%s\"!"
             " This might be caused by an inappropriate plugin or a development error.", filter_name);
     }
     g_hash_table_insert(proto_filter_names, key, filter_name);
 
-	/* Add this protocol to the list of known protocols; the list
-	   is sorted by protocol short name. */
-	protocol = g_malloc(sizeof (protocol_t));
-	protocol->name = name;
-	protocol->short_name = short_name;
-	protocol->filter_name = filter_name;
-	protocol->fields = NULL;
-	protocol->is_enabled = TRUE; /* protocol is enabled by default */
-	protocol->can_toggle = TRUE;
+    /* Add this protocol to the list of known protocols; the list
+       is sorted by protocol short name. */
+    protocol = g_malloc(sizeof (protocol_t));
+    protocol->name = name;
+    protocol->short_name = short_name;
+    protocol->filter_name = filter_name;
+    protocol->fields = NULL;
+    protocol->is_enabled = TRUE; /* protocol is enabled by default */
+    protocol->can_toggle = TRUE;
     /* list will be sorted later by name, when all protocols completed registering */
     protocols = g_list_append(protocols, protocol);
 
-	/* Here we do allocate a new header_field_info struct */
-	hfinfo = g_mem_chunk_alloc(gmc_hfinfo);
-	hfinfo->name = name;
-	hfinfo->abbrev = filter_name;
-	hfinfo->type = FT_PROTOCOL;
-	hfinfo->strings = NULL;
-	hfinfo->bitmask = 0;
-	hfinfo->bitshift = 0;
-	hfinfo->blurb = "";
-	hfinfo->parent = -1; /* this field differentiates protos and fields */
-
-	proto_id = proto_register_field_init(hfinfo, hfinfo->parent);
-	protocol->proto_id = proto_id;
-	return proto_id;
+    /* Here we do allocate a new header_field_info struct */
+    hfinfo = g_mem_chunk_alloc(gmc_hfinfo);
+    hfinfo->name = name;
+    hfinfo->abbrev = filter_name;
+    hfinfo->type = FT_PROTOCOL;
+    hfinfo->strings = protocol;
+    hfinfo->bitmask = 0;
+    hfinfo->bitshift = 0;
+    hfinfo->ref_count = 0;
+    hfinfo->blurb = "";
+    hfinfo->parent = -1; /* this field differentiates protos and fields */
+
+    proto_id = proto_register_field_init(hfinfo, hfinfo->parent);
+    protocol->proto_id = proto_id;
+    return proto_id;
 }
 
 /*
@@ -2470,27 +2644,17 @@
 	return &ptr->hfinfo;
 }
 
-/*
- * Find the protocol list entry for a protocol given its field ID.
- */
-static gint
-compare_proto_id(gconstpointer proto_arg, gconstpointer id_arg)
-{
-	const protocol_t *protocol = proto_arg;
-	const int *id_ptr = id_arg;
-
-	return (protocol->proto_id == *id_ptr) ? 0 : 1;
-}
-
 protocol_t *
 find_protocol_by_id(int proto_id)
 {
-	GList *list_entry;
+	header_field_info *hfinfo;
 
-	list_entry = g_list_find_custom(protocols, &proto_id, compare_proto_id);
-	if (list_entry == NULL)
+	if(proto_id<0)
 		return NULL;
-	return list_entry->data;
+
+	PROTO_REGISTRAR_GET_NTH(proto_id, hfinfo);
+	DISSECTOR_ASSERT(hfinfo->type==FT_PROTOCOL);
+	return (protocol_t *)hfinfo->strings;
 }
 
 static gint compare_filter_name(gconstpointer proto_arg,
@@ -2568,7 +2732,7 @@
 	protocol_t *protocol;
 
 	protocol = find_protocol_by_id(proto_id);
-	g_assert(protocol->can_toggle);
+	DISSECTOR_ASSERT(protocol->can_toggle);
 	protocol->is_enabled = enabled;
 }
 
@@ -2600,7 +2764,7 @@
 		 * 0 (which is unlikely to be the field ID we get back
 		 * from "proto_register_field_init()").
 		 */
-		g_assert(*ptr->p_id == -1 || *ptr->p_id == 0);
+		DISSECTOR_ASSERT(*ptr->p_id == -1 || *ptr->p_id == 0);
 
 		if (proto != NULL) {
 			if (proto->fields == NULL) {
@@ -2620,11 +2784,11 @@
 proto_register_field_init(header_field_info *hfinfo, int parent)
 {
 	/* The field must have names */
-	g_assert(hfinfo->name);
-	g_assert(hfinfo->abbrev);
+	DISSECTOR_ASSERT(hfinfo->name);
+	DISSECTOR_ASSERT(hfinfo->abbrev);
 
-	/* These types of fields are allowed to have value_strings or true_false_strings */
-	g_assert((hfinfo->strings == NULL) || (
+	/* These types of fields are allowed to have value_strings, true_false_strings or a protocol_t struct*/
+	DISSECTOR_ASSERT((hfinfo->strings == NULL) || (
 			(hfinfo->type == FT_UINT8) ||
 			(hfinfo->type == FT_UINT16) ||
 			(hfinfo->type == FT_UINT24) ||
@@ -2634,6 +2798,7 @@
 			(hfinfo->type == FT_INT24) ||
 			(hfinfo->type == FT_INT32) ||
 			(hfinfo->type == FT_BOOLEAN) ||
+			(hfinfo->type == FT_PROTOCOL) ||
 			(hfinfo->type == FT_FRAMENUM) ));
 
 	switch (hfinfo->type) {
@@ -2648,13 +2813,13 @@
 	case FT_INT32:
 		/* Require integral types (other than frame number, which is
 		   always displayed in decimal) to have a number base */
-		g_assert(hfinfo->display != BASE_NONE);
+		DISSECTOR_ASSERT(hfinfo->display != BASE_NONE);
 		break;
 
 	case FT_FRAMENUM:
 		/* Don't allow bitfields or value strings for frame numbers */
-		g_assert(hfinfo->bitmask == 0);
-		g_assert(hfinfo->strings == NULL);
+		DISSECTOR_ASSERT(hfinfo->bitmask == 0);
+		DISSECTOR_ASSERT(hfinfo->strings == NULL);
 		break;
 
 	default:
@@ -2694,7 +2859,7 @@
 		/* Check that the filter name (abbreviation) is legal;
 		 * it must contain only alphanumerics, '-', "_", and ".". */
 		for (p = hfinfo->abbrev; (c = *p) != '\0'; p++)
-			g_assert(isalnum(c) || c == '-' || c == '_' ||
+			DISSECTOR_ASSERT(isalnum(c) || c == '-' || c == '_' ||
 			    c == '.');
 
 		/* We allow multiple hfinfo's to be registered under the same
@@ -2843,7 +3008,7 @@
 		case FT_INT16:
 		case FT_INT24:
 		case FT_INT32:
-			g_assert(!hfinfo->bitmask);
+			DISSECTOR_ASSERT(!hfinfo->bitmask);
 			if (hfinfo->strings) {
 				fill_label_enumerated_int(fi, label_str);
 			}
@@ -2943,7 +3108,7 @@
 			g_error("hfinfo->type %d (%s) not handled\n",
 					hfinfo->type,
 					ftype_name(hfinfo->type));
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 			break;
 	}
 }
@@ -3210,7 +3375,7 @@
 			bitwidth = hfinfo->display; /* hacky? :) */
 			break;
 		default:
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 			;
 	}
 	return bitwidth;
@@ -3243,12 +3408,12 @@
 					format = "%s: %s (0x%08x)";
 					break;
 				default:
-					g_assert_not_reached();
+					DISSECTOR_ASSERT_NOT_REACHED();
 					;
 			}
 			break;
 		default:
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 			;
 	}
 	return format;
@@ -3288,12 +3453,12 @@
 						format = "%s: 0x%08x";
 						break;
 					default:
-						g_assert_not_reached();
+						DISSECTOR_ASSERT_NOT_REACHED();
 						;
 				}
 				break;
 			default:
-				g_assert_not_reached();
+				DISSECTOR_ASSERT_NOT_REACHED();
 				;
 		}
 	}
@@ -3327,12 +3492,12 @@
 					format = "%s: %s (0x%08x)";
 					break;
 				default:
-					g_assert_not_reached();
+					DISSECTOR_ASSERT_NOT_REACHED();
 					;
 			}
 			break;
 		default:
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 			;
 	}
 	return format;
@@ -3355,7 +3520,7 @@
 			format = "%s: 0x%016" PRIx64;
 			break;
 		default:
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 			;
 	}
 	return format;
@@ -3389,12 +3554,12 @@
 					format = "%s: 0x%08x";
 					break;
 				default:
-					g_assert_not_reached();
+					DISSECTOR_ASSERT_NOT_REACHED();
 					;
 			}
 			break;
 		default:
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 			;
 	}
 	return format;
@@ -3417,7 +3582,7 @@
 			format = "%s: 0x%016" PRIx64;
 			break;
 		default:
-			g_assert_not_reached();
+			DISSECTOR_ASSERT_NOT_REACHED();
 			;
 	}
 	return format;
@@ -3909,7 +4074,7 @@
 						format = "%s == %" PRId64;
 						break;
 					default:
-						g_assert_not_reached();
+						DISSECTOR_ASSERT_NOT_REACHED();
 						;
 				}
 				break;
@@ -3931,12 +4096,12 @@
 						format = "%s == 0x%016" PRIx64;
 						break;
 					default:
-						g_assert_not_reached();
+						DISSECTOR_ASSERT_NOT_REACHED();
 						;
 				}
 				break;
 			default:
-				g_assert_not_reached();
+				DISSECTOR_ASSERT_NOT_REACHED();
 				;
 		}
 	}
@@ -3954,7 +4119,7 @@
 	gint			length;
 
 	hfinfo = finfo->hfinfo;
-	g_assert(hfinfo);
+	DISSECTOR_ASSERT(hfinfo);
 
 	switch(hfinfo->type) {
 
@@ -4046,7 +4211,7 @@
 	guint8			c;
 
 	hfinfo = finfo->hfinfo;
-	g_assert(hfinfo);
+	DISSECTOR_ASSERT(hfinfo);
 	abbrev_len = strlen(hfinfo->abbrev);
 
 	/*
--- ethereal-0.10.10.orig/epan/stats_tree.c
+++ ethereal-0.10.10/epan/stats_tree.c
@@ -581,7 +581,7 @@
 	}
 	
 	if ( node == NULL ) 
-		return node->id;
+		g_assert_not_reached();
 	
 	for ( child = node->children; child; child = child->next) {
 		floor =  child->rng->floor;
--- ethereal-0.10.10.orig/epan/to_str.c
+++ ethereal-0.10.10/epan/to_str.c
@@ -1,7 +1,7 @@
 /* to_str.c
  * Routines for utilities to convert various other types to strings.
  *
- * $Id: to_str.c 13270 2005-02-03 23:18:23Z jmayer $
+ * $Id: to_str.c 14216 2005-04-28 09:51:55Z kukosa $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -362,8 +362,9 @@
 /*
  * Maximum length of a string showing days/hours/minutes/seconds.
  * (Does not include the terminating '\0'.)
+ * Includes space for a '-' sign for any negative compunents.
  */
-#define TIME_SECS_LEN	(8+1+4+2+2+5+2+2+7+2+2+7)
+#define TIME_SECS_LEN	(10+1+4+2+2+5+2+2+7+2+2+7+4)
 
 /*
  * Convert a value in seconds and fractions of a second to a string,
@@ -371,15 +372,27 @@
  * into a buffer.
  * "is_nsecs" says that "frac" is microseconds if true and milliseconds
  * if false.
+ * If time is negative, add a '-' to all non-null components.
  */
 static void
-time_secs_to_str_buf(guint32 time, guint32 frac, gboolean is_nsecs,
+time_secs_to_str_buf(gint32 time, guint32 frac, gboolean is_nsecs,
 			   gchar *buf)
 {
   static gchar *p;
   int hours, mins, secs;
+  gchar *msign = "";
   gboolean do_comma = FALSE;
 
+  if(time<0){
+    time= -time;
+    msign="-";
+  }
+
+  if(time<0){	/* We've overflowed. */
+    sprintf(buf, "Unable to cope with time value %d", time);
+    return;
+  }
+
   secs = time % 60;
   time /= 60;
   mins = time % 60;
@@ -387,35 +400,36 @@
   hours = time % 24;
   time /= 24;
 
+  /* This would probably be cleaner if we used GStrings instead. */
   p = buf;
   if (time != 0) {
-    sprintf(p, "%u day%s", time, PLURALIZE(time));
+    sprintf(p, "%s%u day%s", time?msign:"", time, PLURALIZE(time));
     p += strlen(p);
     do_comma = TRUE;
   }
   if (hours != 0) {
-    sprintf(p, "%s%u hour%s", COMMA(do_comma), hours, PLURALIZE(hours));
+    sprintf(p, "%s%s%u hour%s", COMMA(do_comma), hours?msign:"", hours, PLURALIZE(hours));
     p += strlen(p);
     do_comma = TRUE;
   }
   if (mins != 0) {
-    sprintf(p, "%s%u minute%s", COMMA(do_comma), mins, PLURALIZE(mins));
+    sprintf(p, "%s%s%u minute%s", COMMA(do_comma), mins?msign:"", mins, PLURALIZE(mins));
     p += strlen(p);
     do_comma = TRUE;
   }
   if (secs != 0 || frac != 0) {
     if (frac != 0) {
       if (is_nsecs)
-        sprintf(p, "%s%u.%09u seconds", COMMA(do_comma), secs, frac);
+        sprintf(p, "%s%s%u.%09u seconds", COMMA(do_comma), msign, secs, frac);
       else
-        sprintf(p, "%s%u.%03u seconds", COMMA(do_comma), secs, frac);
+        sprintf(p, "%s%s%u.%03u seconds", COMMA(do_comma), msign, secs, frac);
     } else
-      sprintf(p, "%s%u second%s", COMMA(do_comma), secs, PLURALIZE(secs));
+      sprintf(p, "%s%s%u second%s", COMMA(do_comma), msign, secs, PLURALIZE(secs));
   }
 }
 
 gchar *
-time_secs_to_str(guint32 time)
+time_secs_to_str(gint32 time)
 {
   static gchar  str[3][TIME_SECS_LEN+1];
   static gchar *cur;
@@ -438,7 +452,7 @@
 }
 
 gchar *
-time_msecs_to_str(guint32 time)
+time_msecs_to_str(gint32 time)
 {
   static gchar  str[3][TIME_SECS_LEN+1+3+1];
   static gchar *cur;
@@ -457,8 +471,16 @@
     return cur;
   }
 
-  msecs = time % 1000;
-  time /= 1000;
+  if(time<0){
+    /* oops we got passed a negative time */
+    time= -time;
+    msecs = time % 1000;
+    time /= 1000;
+    time= -time;
+  } else {
+    msecs = time % 1000;
+    time /= 1000;
+  }
 
   time_secs_to_str_buf(time, msecs, FALSE, cur);
   return cur;
@@ -580,7 +602,7 @@
 	static char str[3][1+TIME_SECS_LEN+1+6+1];
 	char *p;
 	char *sign;
-	guint32 time;
+	gint32 time;
 	gint32 nsec;
 
 	if (cur == &str[0][0]) {
@@ -870,3 +892,42 @@
     g_assert_not_reached();
   }
 }
+
+gchar* oid_to_str(guint8 *oid, gint oid_len) {
+  /* static buffer */
+  static int cnt = 0;
+  static gchar strbuf[8][MAX_OID_STR_LEN];
+
+  cnt = (cnt + 1) % 8;
+  return oid_to_str_buf(oid, oid_len, strbuf[cnt], MAX_OID_STR_LEN);
+}
+
+#define OID_STR_LIMIT (1 + 10 + 4 + 1) /* "." + 10 digits + ".>>>" + '\0' */
+gchar* oid_to_str_buf(guint8 *oid, gint oid_len, gchar *buf, int buf_len) {
+  gint i;
+  guint8 byte;
+  guint32 value;
+  gchar *bufp;
+
+  bufp = buf; value=0;
+  for (i=0; i<oid_len; i++){
+    byte = oid[i];
+    if ((bufp - buf) > (MAX_OID_STR_LEN - OID_STR_LIMIT)) {
+      bufp += snprintf(bufp, buf_len-(bufp-buf), ".>>>");
+      break;
+    }
+    if (i == 0) {
+      bufp += sprintf(bufp, "%d.%d", byte/40, byte%40);
+      continue;
+    }
+    value = (value << 7) | (byte & 0x7F);
+    if (byte & 0x80) {
+      continue;
+    }
+    bufp += sprintf(bufp, ".%d", value);
+    value = 0;
+  }
+  *bufp = '\0';
+
+  return buf;
+}
--- ethereal-0.10.10.orig/epan/tvbuff.c
+++ ethereal-0.10.10/epan/tvbuff.c
@@ -2405,6 +2405,12 @@
 			inflateReset(strm);
 			next = c;
 			strm->next_in = next;
+			if (c - compr > comprlen) {
+				g_free(strm);
+				g_free(compr);
+				g_free(strmbuf);
+				return NULL;
+			}
 			comprlen -= (c - compr);
 			
 			err = inflateInit2(strm, wbits);
--- ethereal-0.10.10.orig/epan/packet_info.h
+++ ethereal-0.10.10/epan/packet_info.h
@@ -1,7 +1,7 @@
 /* packet_info.h
  * Definitions for packet info structures and routines
  *
- * $Id: packet_info.h 13689 2005-03-10 08:52:59Z sahlberg $
+ * $Id: packet_info.h 14265 2005-05-02 14:07:33Z tuexen $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -33,6 +33,10 @@
 #define P2P_DIR_SENT	0
 #define P2P_DIR_RECV	1
 
+#define MTP2_ANNEX_A_USED_UNKNOWN -1
+#define MTP2_ANNEX_A_NOT_USED      0
+#define MTP2_ANNEX_A_USED          1
+
 #define PINFO_SOF_FIRST_FRAME   0x1
 #define PINFO_SOF_SOFF          0x2
 #define PINFO_EOF_LAST_FRAME    0x80
@@ -132,10 +136,14 @@
   guint16 dcetransportsalt;	/* fid: if transporttype==DCE_CN_TRANSPORT_SMBPIPE */
 
   /* Extra data for handling of decryption of GSSAPI wrapped tvbuffs.
-     Caller sets gssapi_decrypt_tvb if this service is requested.
+     Caller sets decrypt_gssapi_tvb if this service is requested.
      If gssapi_encrypted_tvb is NULL, then the rest of the tvb data following
-     the gssapi blob it self is decrypted othervise the gssapi_encrypted_tvb
+     the gssapi blob itself is decrypted othervise the gssapi_encrypted_tvb
      tvb will be decrypted (DCERPC has the data before the gssapi blob)
+     If, on return, gssapi_data_encrypted is FALSE, the wrapped tvbuff
+     was signed (i.e., an encrypted signature was present, to check
+     whether the data was modified by a man in the middle) but not sealed
+     (i.e., the data itself wasn't encrypted).
   */
 #define DECRYPT_GSSAPI_NORMAL	1
 #define DECRYPT_GSSAPI_DCE	2
@@ -143,12 +151,15 @@
   tvbuff_t *gssapi_wrap_tvb;
   tvbuff_t *gssapi_encrypted_tvb;
   tvbuff_t *gssapi_decrypted_tvb;
+  gboolean gssapi_data_encrypted;
  
   guint32 ppid[MAX_NUMBER_OF_PPIDS]; /* The first NUMBER_OF_PPIDS PPIDS which are present
                                       * in the SCTP packet
                                       */
   void    *private_data;	/* pointer to data passed from one dissector to another */
   GString *layer_names; 	/* layers of each protocol */
+  guint16 link_number;
+  gchar   annex_a_used;
 } packet_info;
 
 #endif /* __PACKET_INFO_H__ */
--- ethereal-0.10.10.orig/epan/proto.h
+++ ethereal-0.10.10/epan/proto.h
@@ -1,7 +1,7 @@
 /* proto.h
  * Definitions for protocol display
  *
- * $Id: proto.h 13079 2005-01-17 00:18:39Z guy $
+ * $Id: proto.h 14051 2005-04-11 08:43:51Z sahlberg $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -101,6 +101,14 @@
   ((void) ((expression) ? 0 : \
    __DISSECTOR_ASSERT (expression, __FILE__, __LINE__)))
 
+/** Same as DISSECTOR_ASSERT(), but will throw DissectorError exception
+ * unconditionally, much like GLIB's g_assert_not_reached works.
+ */
+#define DISSECTOR_ASSERT_NOT_REACHED()  \
+  (REPORT_DISSECTOR_BUG( \
+    g_strdup_printf("%s:%u: failed assertion \"DISSECTOR_ASSERT_NOT_REACHED\"", \
+     __FILE__, __LINE__)))
+
 #define __DISSECTOR_ASSERT_STRINGIFY(s)	# s
 
 #define __DISSECTOR_ASSERT(expression, file, lineno)  \
@@ -139,13 +147,19 @@
 	char				*abbrev;    /**< abbreviated name of this field */
 	enum ftenum			type;       /**< field type, one of FT_ (from ftypes.h) */
 	int					display;	/**< one of BASE_, or number of field bits for FT_BOOLEAN */
-	const void			*strings;	/**< _value_string (or true_false_string for FT_BOOLEAN), typically converted by VALS() or TFS() */
+	const void			*strings;	/**< _value_string (or true_false_string for FT_BOOLEAN), typically converted by VALS() or TFS() If this is an FT_PROTOCOL then it points to the associated protocol_t structure*/
 	guint32				bitmask;    /**< FT_BOOLEAN only: bitmask of interesting bits */
 	char				*blurb;		/**< Brief description of field. */
 
 	/* ------- set by proto routines (prefilled by HFILL macro, see below) ------ */
 	int				id;		/**< Field ID */
 	int				parent;		/**< parent protocol tree */
+		/* This field keeps track of whether a field is 
+		 * referenced in any filter or not and if so how 
+		 * many times. If a filter is being referenced the 
+		 * refcount for the parent protocol is updated as well 
+		 */
+	int				ref_count;	/**< is this field referenced by a filter or not */
 	int				bitshift;	/**< bits to shift (FT_BOOLEAN only) */
 	header_field_info		*same_name_next; /**< Link to next hfinfo with same abbrev*/
 	header_field_info		*same_name_prev; /**< Link to previous hfinfo with same abbrev*/
@@ -156,7 +170,7 @@
  * _header_field_info. If new fields are added or removed, it should
  * be changed as necessary.
  */
-#define HFILL 0, 0, 0, NULL, NULL
+#define HFILL 0, 0, 0, 0, NULL, NULL
 
 /** Used when registering many fields at once, using proto_register_field_array() */
 typedef struct hf_register_info {
@@ -257,6 +271,21 @@
 /** Frees memory used by proto routines. Called at program shutdown */
 extern void proto_cleanup(void);
 
+/** This function takes a tree and a protocol id as parameter and
+    will return TRUE/FALSE for whether the protocol or any of the filterable
+    fields in the protocol is referenced by any fitlers.
+    If this function returns FALSE then it is safe to skip any 
+	proto_tree_add_...() calls and just treat the call as if the 
+    dissector was called with tree==NULL.
+    If you reset the tree to NULL by this dissector returning FALSE,
+    you will still need to call any subdissector with the original value of 
+    tree or filtering will break.
+
+    The purpose of this is to optimize ethereal for speed and make it
+    faster for when filters are being used.
+*/
+extern gboolean proto_field_is_referenced(proto_tree *tree, int proto_id);
+
 
 
 /** Create a subtree under an existing item.
@@ -872,7 +901,19 @@
 
 
 
-/** Append a string to a protocol item.
+/** Append a string to a protocol item.<br>
+    NOTE: this function will break with the TRY_TO_FAKE_THIS_ITEM()
+    speed optimization.
+    Currently only WSP use this function so it is not that bad but try to
+    avoid using this one if possible.
+    IF you must use this function you MUST also disable the
+    TRY_TO_FAKE_THIS_ITEM() optimization for your dissector/function
+    using proto_item_append_string().
+    Do that by faking that the tree is visible by setting :
+    PTREE_DATA(tree)->visible=1;  (see packet-wsp.c)
+    BEFORE you create the item you are later going to use
+    proto_item_append_string() on.
+
  @param pi the item to append the string to
  @param str the string to append */
 extern void
@@ -889,7 +930,7 @@
 
 
 /** Register a new protocol.
- @param name the name of the new protocol
+ @param name the full name of the new protocol
  @param short_name abbreviated name of the new protocol
  @param filter_name protocol name used for a display filter string 
  @return the new protocol handle */
--- ethereal-0.10.10.orig/epan/to_str.h
+++ ethereal-0.10.10/epan/to_str.h
@@ -1,7 +1,7 @@
 /* to_str.h
  * Definitions for utilities to convert various other types to strings.
  *
- * $Id: to_str.h 12911 2005-01-01 12:29:26Z guy $
+ * $Id: to_str.h 14216 2005-04-28 09:51:55Z kukosa $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -30,6 +30,8 @@
 #include "nstime.h"
 #include "epan/packet_info.h"
 
+#define MAX_OID_STR_LEN 256
+
 /*
  * Resolution of a time stamp.
  */
@@ -60,13 +62,15 @@
 extern gchar*	ipxnet_to_str_punct(const guint32 ad, char punct);
 extern gchar*	vines_addr_to_str(const guint8 *addrp);
 extern void	vines_addr_to_str_buf(const guint8 *addrp, gchar *buf);
-extern gchar*	time_secs_to_str(guint32);
-extern gchar*	time_msecs_to_str(guint32);
+extern gchar*	time_secs_to_str(gint32);
+extern gchar*	time_msecs_to_str(gint32);
 extern gchar*	abs_time_to_str(nstime_t*);
 extern gchar*	abs_time_secs_to_str(time_t);
 extern void	display_signed_time(gchar *, int, gint32, gint32, time_res_t);
 extern gchar*	rel_time_to_str(nstime_t*);
 extern gchar*	rel_time_to_secs_str(nstime_t*);
+extern gchar*	oid_to_str(guint8*, gint);
+extern gchar*	oid_to_str_buf(guint8*, gint, gchar*, int buf_len);
 
 
 extern char	*other_decode_bitfield_value(char *buf, guint32 val, guint32 mask,
--- ethereal-0.10.10.orig/epan/ftypes/Makefile.in
+++ ethereal-0.10.10/epan/ftypes/Makefile.in
@@ -63,11 +63,8 @@
 subdir = epan/ftypes
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/epan/dfilter/Makefile.in
+++ ethereal-0.10.10/epan/dfilter/Makefile.in
@@ -63,11 +63,8 @@
 subdir = epan/dfilter
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/epan/dissectors/packet-ber.h
+++ ethereal-0.10.10/epan/dissectors/packet-ber.h
@@ -2,7 +2,7 @@
  * Helpers for ASN.1/BER dissection
  * Ronnie Sahlberg (C) 2004
  *
- * $Id: packet-ber.h 13479 2005-02-23 08:57:47Z sahlberg $
+ * $Id: packet-ber.h 14217 2005-04-28 09:54:03Z kukosa $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -26,6 +26,8 @@
 #ifndef __PACKET_BER_H__
 #define __PACKET_BER_H__
 
+#include <epan/to_str.h>
+
 #define BER_NOT_DECODED_YET(x) \
 proto_tree_add_text(tree, tvb, offset, 0, "something unknown here [%s]",x); \
 fprintf(stderr,"Not decoded yet in packet : %d  [%s]\n", pinfo->fd->num,x); \
@@ -71,6 +73,8 @@
 #define BER_UNI_TAG_CHARACTERSTRING	    29
 #define BER_UNI_TAG_BMPString		    30
 
+#define BER_MAX_OID_STR_LEN MAX_OID_STR_LEN
+
 /* this function dissects the identifier octer of the BER TLV.
  * We only handle TAGs (and LENGTHs) that fit inside 32 bit integers.
  */
@@ -80,7 +84,7 @@
 /* this function dissects the identifier octer of the BER TLV.
  * We only handle (TAGs and) LENGTHs that fit inside 32 bit integers.
  */
-extern int get_ber_length(tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind);
+extern int get_ber_length(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind);
 extern int dissect_ber_length(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind);
 
 extern int dissect_ber_octet_string(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **out_tvb);
@@ -88,6 +92,7 @@
 
 extern int dissect_ber_integer(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, guint32 *value);
 
+extern int dissect_ber_null(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id);
 
 extern int dissect_ber_boolean(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id);
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-gsm_map.h
+++ ethereal-0.10.10/epan/dissectors/packet-gsm_map.h
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* .\packet-gsm_map.h                                                         */
+/* ./packet-gsm_map.h                                                         */
 /* ../../tools/asn2eth.py -X -b -e -p gsm_map -c gsmmap.cnf -s packet-gsm_map-template GSMMAP.asn */
 
 /* Input file: packet-gsm_map-template.h */
@@ -9,7 +9,7 @@
  * Routines for GSM MAP packet dissection
  * Copyright 2004, Anders Broman <anders.broman@ericsson.com>
  *
- * $Id: packet-gsm_map.h 13486 2005-02-23 23:14:42Z etxrab $
+ * $Id: packet-gsm_map.h 14160 2005-04-21 21:37:23Z sahlberg $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -43,6 +43,7 @@
 } gsm_map_tap_rec_t;
 
 ETH_VAR_IMPORT const value_string gsm_map_opr_code_strings[];
+char* unpack_digits(tvbuff_t *tvb, int offset);
 
 /* #include "packet-gsm_map-exp.h"*/
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-iax2.h
+++ ethereal-0.10.10/epan/dissectors/packet-iax2.h
@@ -7,7 +7,7 @@
  *
  * Mark Spencer <markster@linux-support.net>
  *
- * $Id: packet-iax2.h 11410 2004-07-18 18:06:47Z gram $
+ * $Id: packet-iax2.h 14011 2005-04-04 05:10:45Z sahlberg $
  *
  * This program is free software, distributed under the terms of
  * the GNU General Public License
@@ -17,9 +17,9 @@
 #define _PACKET_IAX2_H
 
 /* Max version of IAX protocol we support */
-#define IAX_PROTO_VERSION 2
+#define IAX_PROTO_VERSION	2
 
-#define IAX_MAX_CALLS 32768
+#define IAX_MAX_CALLS		32768
 
 #define IAX_FLAG_FULL		0x8000
 
@@ -29,7 +29,7 @@
 
 #define IAX_MAX_SHIFT		0x1F
 
-#define IAX_WINDOW			64
+#define IAX_WINDOW		64
 
 #define AST_FRAME_DTMF      1       /* A DTMF digit, subclass is the digit */
 #define AST_FRAME_VOICE     2       /* Voice data, subclass is AST_FORMAT_* */
@@ -70,52 +70,121 @@
 #define IAX_COMMAND_TXREL	26	/* Transfer release */
 #define IAX_COMMAND_TXREJ	27	/* Transfer reject */
 #define IAX_COMMAND_QUELCH	28	/* Stop audio/video transmission */
-#define IAX_COMMAND_UNQUELCH 29	/* Resume audio/video transmission */
-#define IAX_COMMAND_POKE    30  /* Like ping, but does not require an open connection */
+#define IAX_COMMAND_UNQUELCH	29	/* Resume audio/video transmission */
+#define IAX_COMMAND_POKE	30	/* Like ping, but does not require an open connection */
 #define IAX_COMMAND_PAGE	31	/* Paging description */
-#define IAX_COMMAND_MWI	32	/* Stand-alone message waiting indicator */
+#define IAX_COMMAND_MWI		32	/* Stand-alone message waiting indicator */
 #define IAX_COMMAND_UNSUPPORT	33	/* Unsupported message received */
 #define IAX_COMMAND_TRANSFER	34	/* Request remote transfer */
+#define IAX_COMMAND_PROVISION   35      /* Provision device */
+#define IAX_COMMAND_FWDOWNL     36      /* Download firmware */
+#define IAX_COMMAND_FWDATA      37      /* Firmware Data */
 
 #define IAX_DEFAULT_REG_EXPIRE  60	/* By default require re-registration once per minute */
 
-#define IAX_LINGER_TIMEOUT		10 /* How long to wait before closing bridged call */
+#define IAX_LINGER_TIMEOUT	10	/* How long to wait before closing bridged call */
 
-#define IAX_DEFAULT_PORTNO		4569
+#define IAX_DEFAULT_PORTNO	4569
 
 /* IAX Information elements */
 #define IAX_IE_CALLED_NUMBER		1		/* Number/extension being called - string */
 #define IAX_IE_CALLING_NUMBER		2		/* Calling number - string */
-#define IAX_IE_CALLING_ANI			3		/* Calling number ANI for billing  - string */
-#define IAX_IE_CALLING_NAME			4		/* Name of caller - string */
+#define IAX_IE_CALLING_ANI		3		/* Calling number ANI for billing  - string */
+#define IAX_IE_CALLING_NAME		4		/* Name of caller - string */
 #define IAX_IE_CALLED_CONTEXT		5		/* Context for number - string */
-#define IAX_IE_USERNAME				6		/* Username (peer or user) for authentication - string */
-#define IAX_IE_PASSWORD				7		/* Password for authentication - string */
-#define IAX_IE_CAPABILITY			8		/* Actual codec capability - unsigned int */
-#define IAX_IE_FORMAT				9		/* Desired codec format - unsigned int */
-#define IAX_IE_LANGUAGE				10		/* Desired language - string */
-#define IAX_IE_VERSION				11		/* Protocol version - short */
-#define IAX_IE_ADSICPE				12		/* CPE ADSI capability - short */
-#define IAX_IE_DNID					13		/* Originally dialed DNID - string */
-#define IAX_IE_AUTHMETHODS			14		/* Authentication method(s) - short */
-#define IAX_IE_CHALLENGE			15		/* Challenge data for MD5/RSA - string */
-#define IAX_IE_MD5_RESULT			16		/* MD5 challenge result - string */
-#define IAX_IE_RSA_RESULT			17		/* RSA challenge result - string */
+#define IAX_IE_USERNAME			6		/* Username (peer or user) for authentication - string */
+#define IAX_IE_PASSWORD			7		/* Password for authentication - string */
+#define IAX_IE_CAPABILITY		8		/* Actual codec capability - unsigned int */
+#define IAX_IE_FORMAT			9		/* Desired codec format - unsigned int */
+#define IAX_IE_LANGUAGE			10		/* Desired language - string */
+#define IAX_IE_VERSION			11		/* Protocol version - short */
+#define IAX_IE_ADSICPE			12		/* CPE ADSI capability - short */
+#define IAX_IE_DNID			13		/* Originally dialed DNID - string */
+#define IAX_IE_AUTHMETHODS		14		/* Authentication method(s) - short */
+#define IAX_IE_CHALLENGE		15		/* Challenge data for MD5/RSA - string */
+#define IAX_IE_MD5_RESULT		16		/* MD5 challenge result - string */
+#define IAX_IE_RSA_RESULT		17		/* RSA challenge result - string */
 #define IAX_IE_APPARENT_ADDR		18		/* Apparent address of peer - struct sockaddr_in */
-#define IAX_IE_REFRESH				19		/* When to refresh registration - short */
-#define IAX_IE_DPSTATUS				20		/* Dialplan status - short */
-#define IAX_IE_CALLNO				21		/* Call number of peer - short */
-#define IAX_IE_CAUSE				22		/* Cause - string */
-#define IAX_IE_IAX_UNKNOWN			23		/* Unknown IAX command - byte */
-#define IAX_IE_MSGCOUNT				24		/* How many messages waiting - short */
-#define IAX_IE_AUTOANSWER			25		/* Request auto-answering -- none */
-#define IAX_IE_MUSICONHOLD			26		/* Request musiconhold with QUELCH -- none or string */
-#define IAX_IE_TRANSFERID			27		/* Transfer Request Identifier -- int */
-#define IAX_IE_RDNIS				28		/* Referring DNIS -- string */
-#define IAX_IE_PROVISIONING			29		/* Provisioning info */
-#define IAX_IE_AESPROVISIONING			30		/* AES Provisioning info */
-#define IAX_IE_DATETIME				31		/* Date/Time */
-#define IAX_IE_DATAFORMAT			255		/* Data call format -- iax_dataformat_t */
+#define IAX_IE_REFRESH			19		/* When to refresh registration - short */
+#define IAX_IE_DPSTATUS			20		/* Dialplan status - short */
+#define IAX_IE_CALLNO			21		/* Call number of peer - short */
+#define IAX_IE_CAUSE			22		/* Cause - string */
+#define IAX_IE_IAX_UNKNOWN		23		/* Unknown IAX command - byte */
+#define IAX_IE_MSGCOUNT			24		/* How many messages waiting - short */
+#define IAX_IE_AUTOANSWER		25		/* Request auto-answering -- none */
+#define IAX_IE_MUSICONHOLD		26		/* Request musiconhold with QUELCH -- none or string */
+#define IAX_IE_TRANSFERID		27		/* Transfer Request Identifier -- int */
+#define IAX_IE_RDNIS			28		/* Referring DNIS -- string */
+#define IAX_IE_PROVISIONING		29		/* Provisioning info */
+#define IAX_IE_AESPROVISIONING		30		/* AES Provisioning info */
+#define IAX_IE_DATETIME			31		/* Date/Time -- unsigned int */
+#define IAX_IE_DEVICETYPE		32		/* Device Type -- string */
+#define IAX_IE_SERVICEIDENT		33		/* Service Identifier -- string */
+#define IAX_IE_FIRMWAREVER		34		/* Firmware revision -- u16 */
+#define IAX_IE_FWBLOCKDESC		35		/* Firmware block description -- u32 */
+#define IAX_IE_FWBLOCKDATA		36		/* Firmware block of data -- raw */
+#define IAX_IE_PROVVER			37		/* Provisioning Version (u32) */
+#define IAX_IE_CALLINGPRES		38		/* Calling presentation (u8) */
+#define IAX_IE_CALLINGTON		39		/* Calling type of number (u8) */
+#define IAX_IE_CALLINGTNS		40		/* Calling transit network select (u16) */
+#define IAX_IE_SAMPLINGRATE		41		/* Supported sampling rates (u16) */
+#define IAX_IE_CAUSECODE		42		/* Hangup cause (u8) */
+#define IAX_IE_ENCRYPTION		43		/* Encryption format (u16) */
+#define IAX_IE_ENCKEY			44		/* Encryption key (raw) */
+#define IAX_IE_CODEC_PREFS		45		/* Codec Negotiation */
+#define IAX_IE_RR_JITTER		46		/* Received jitter (as in RFC1889) u32 */
+#define IAX_IE_RR_LOSS			47		/* Received loss (high byte loss pct, low 24 bits loss count, as in rfc1889 */
+#define IAX_IE_RR_PKTS			48		/* Received frames (total frames received) u32 */
+#define IAX_IE_RR_DELAY			49		/* Max playout delay for received frames (in ms) u16 */
+#define IAX_IE_RR_DROPPED		50		/* Dropped frames (presumably by jitterbuf) u32 */
+#define IAX_IE_RR_OOO			51		/* Frames received Out of Order u32 */
+#define IAX_IE_DATAFORMAT		255		/* Data call format -- iax_dataformat_t */
+
+/* hangup cause codes */
+#define AST_CAUSE_UNALLOCATED				1
+#define AST_CAUSE_NO_ROUTE_TRANSIT_NET			2
+#define AST_CAUSE_NO_ROUTE_DESTINATION			3
+#define AST_CAUSE_CHANNEL_UNACCEPTABLE			6
+#define AST_CAUSE_CALL_AWARDED_DELIVERED		7
+#define AST_CAUSE_NORMAL_CLEARING			16
+#define AST_CAUSE_USER_BUSY				17
+#define AST_CAUSE_NO_USER_RESPONSE			18
+#define AST_CAUSE_NO_ANSWER				19
+#define AST_CAUSE_CALL_REJECTED				21
+#define AST_CAUSE_NUMBER_CHANGED			22
+#define AST_CAUSE_DESTINATION_OUT_OF_ORDER		27
+#define AST_CAUSE_INVALID_NUMBER_FORMAT			28
+#define AST_CAUSE_FACILITY_REJECTED			29
+#define AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY		30
+#define AST_CAUSE_NORMAL_UNSPECIFIED			31
+#define AST_CAUSE_NORMAL_CIRCUIT_CONGESTION		34
+#define AST_CAUSE_NETWORK_OUT_OF_ORDER			38
+#define AST_CAUSE_NORMAL_TEMPORARY_FAILURE		41
+#define AST_CAUSE_SWITCH_CONGESTION			42
+#define AST_CAUSE_ACCESS_INFO_DISCARDED			43
+#define AST_CAUSE_REQUESTED_CHAN_UNAVAIL		44
+#define AST_CAUSE_PRE_EMPTED				45
+#define AST_CAUSE_FACILITY_NOT_SUBSCRIBED		50
+#define AST_CAUSE_OUTGOING_CALL_BARRED			52
+#define AST_CAUSE_INCOMING_CALL_BARRED			54
+#define AST_CAUSE_BEARERCAPABILITY_NOTAUTH		57
+#define AST_CAUSE_BEARERCAPABILITY_NOTAVAIL		58
+#define AST_CAUSE_BEARERCAPABILITY_NOTIMPL		65
+#define AST_CAUSE_CHAN_NOT_IMPLEMENTED			66
+#define AST_CAUSE_FACILITY_NOT_IMPLEMENTED		69
+#define AST_CAUSE_INVALID_CALL_REFERENCE		81
+#define AST_CAUSE_INCOMPATIBLE_DESTINATION		88
+#define AST_CAUSE_INVALID_MSG_UNSPECIFIED		95
+#define AST_CAUSE_MANDATORY_IE_MISSING			96
+#define AST_CAUSE_MESSAGE_TYPE_NONEXIST			97
+#define AST_CAUSE_WRONG_MESSAGE				98
+#define AST_CAUSE_IE_NONEXIST				99
+#define AST_CAUSE_INVALID_IE_CONTENTS			100
+#define AST_CAUSE_WRONG_CALL_STATE			101
+#define AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE		102
+#define AST_CAUSE_MANDATORY_IE_LENGTH_ERROR		103
+#define AST_CAUSE_PROTOCOL_ERROR			111
+#define AST_CAUSE_INTERWORKING				127
 
 #define IAX_AUTH_PLAINTEXT			(1 << 0)
 #define IAX_AUTH_MD5				(1 << 1)
@@ -124,7 +193,7 @@
 #define IAX_META_TRUNK				1		/* Trunk meta-message */
 #define IAX_META_VIDEO				2		/* Video frame */
 
-#define IAX_DPSTATUS_EXISTS			(1 << 0)
+#define IAX_DPSTATUS_EXISTS		(1 << 0)
 #define IAX_DPSTATUS_CANEXIST		(1 << 1)
 #define IAX_DPSTATUS_NONEXISTANT	(1 << 2)
 #define IAX_DPSTATUS_IGNOREPAT		(1 << 14)
--- ethereal-0.10.10.orig/epan/dissectors/packet-isup.h
+++ ethereal-0.10.10/epan/dissectors/packet-isup.h
@@ -1,6 +1,6 @@
 /* packet-isup.h
  *
- * $Id: packet-isup.h 13263 2005-02-03 21:51:35Z etxrab $
+ * $Id: packet-isup.h 14086 2005-04-15 08:14:44Z etxrab $
  *
  * Copyright 2003, Michael Lum <mlum [AT] telostech.com>,
  * In association with Telos Technology Inc.
@@ -42,7 +42,7 @@
  */
 ETH_VAR_IMPORT const value_string isup_message_type_value[];
 ETH_VAR_IMPORT const value_string isup_message_type_value_acro[];
-
+ETH_VAR_IMPORT const value_string q850_cause_code_vals[];
 /*
  * Export some definitions and value_string tables for other dissectors
  */
@@ -133,8 +133,11 @@
 
 extern const value_string isup_parameter_type_value[]; 
 extern const value_string isup_transmission_medium_requirement_value[];
-
 /*
  * Export dissection of some parameters
  */
 void dissect_nsap(tvbuff_t *parameter_tvb,gint offset,gint len, proto_tree *parameter_tree);
+void dissect_isup_called_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item);
+void dissect_isup_calling_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item);
+void dissect_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item);
+
--- ethereal-0.10.10.orig/epan/dissectors/packet-per.h
+++ ethereal-0.10.10/epan/dissectors/packet-per.h
@@ -2,7 +2,7 @@
  * Routines for dissection of ASN.1 Aligned PER
  * 2003  Ronnie Sahlberg
  *
- * $Id: packet-per.h 13337 2005-02-07 08:57:47Z etxrab $
+ * $Id: packet-per.h 14201 2005-04-27 14:17:14Z kukosa $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -27,7 +27,7 @@
 #define __PACKET_PER_H__
 
 #define PER_NOT_DECODED_YET(x) \
-proto_tree_add_text(tree, tvb, offset, 0, "something unknown here [%s]",x); \
+proto_tree_add_text(tree, tvb, 0, 0, "something unknown here [%s]",x); \
 fprintf(stderr,"Not decoded yet in packet : %d  [%s]\n", pinfo->fd->num,x); \
 if (check_col(pinfo->cinfo, COL_INFO)){ \
 	col_append_fstr(pinfo->cinfo, COL_INFO, "[UNKNOWN PER: %s]", x); \
@@ -64,6 +64,8 @@
 
 extern guint32 dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, guint32 *length);
 
+extern guint32 dissect_per_null(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index);
+
 extern guint32 dissect_per_GeneralString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index);
 
 extern guint32 dissect_per_sequence_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, int (*func)(tvbuff_t *, int , packet_info *, proto_tree *));
--- ethereal-0.10.10.orig/epan/dissectors/Makefile.in
+++ ethereal-0.10.10/epan/dissectors/Makefile.in
@@ -89,11 +89,8 @@
 	$(srcdir)/Makefile.common $(srcdir)/Makefile.in
 subdir = epan/dissectors
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/epan/dissectors/packet-acse.c
+++ ethereal-0.10.10/epan/dissectors/packet-acse.c
@@ -2,7 +2,7 @@
 *
 * Routine to dissect OSI ACSE Protocol packets
 *
-* $Id: packet-acse.c 13578 2005-03-03 08:54:00Z guy $
+* $Id: packet-acse.c 13965 2005-03-29 12:27:13Z sahlberg $
 *
 * Yuriy Sidelnikov <YSidelnikov@hotmail.com>
 *
@@ -1099,7 +1099,8 @@
 							*offset = asn->offset;
 							return;
 			}
-			if( *offset == RELEASE_REQUEST_OR_RESPONSE_REASON )  /* is it a reason ? */
+
+			if( tvb_get_guint8(tvb, *offset) == RELEASE_REQUEST_OR_RESPONSE_REASON )  /* is it a reason ? */
 			{
 			itu = proto_tree_add_text(acse_tree, tvb, *offset,ABORT_REASON_LEN,
 					"Reason");
@@ -1111,6 +1112,8 @@
 				if (read_length(asn, acse_tree_pc, 0, &new_item_len) !=
 								ASN1_ERR_NOERROR)
 				{
+				proto_tree_add_text(acse_tree, tvb, *offset, item_len,
+							"Can't decode item length");
 							*offset = asn->offset;
 							return;
 				}
@@ -1132,64 +1135,6 @@
 			(*offset)=start+save_len;
 			asn->offset = (*offset);
 }
-
-static void
-show_finish_pdu(ASN1_SCK *asn,proto_tree *acse_tree,tvbuff_t
-*tvb,int *offset,int item_len)
-{
-	gint		length;
-	gint		value;
-    proto_tree	*acse_tree_pc = NULL;
-	proto_item	*itu;
-	guint		new_item_len;
-	guint		start = *offset;
-	int			save_len = item_len;
-/* do we have enough bytes to dissect this item ? */
-			if( ( length =tvb_reported_length_remaining(tvb, *offset))  < item_len )
-			{
-					proto_tree_add_text(acse_tree, tvb, *offset, item_len,
-							"Wrong Item.Need %u bytes but have %u", item_len,length);
-							*offset = asn->offset;
-							return;
-			}
-
-			if(item_len <= 0)
-			{
-					proto_tree_add_text(acse_tree, tvb, *offset, item_len,
-							"Reason not specified");
-							*offset = asn->offset;
-							return;
-			}
-			itu = proto_tree_add_text(acse_tree, tvb, *offset,ABORT_REASON_LEN,
-					"Reason");
-			acse_tree_pc = proto_item_add_subtree(itu, ett_acse_ms);
-			(*offset)++; /* skip type  */
-			asn->offset =  *offset;
-			item_len--;
-			/* get length  */
-				if (read_length(asn, acse_tree_pc, 0, &new_item_len) !=
-								ASN1_ERR_NOERROR)
-				{
-							*offset = asn->offset;
-							return;
-				}
-			/*  try to get reason  */
-			value	=	get_integer_value(asn,new_item_len,offset);
-
-			proto_tree_add_text(acse_tree_pc, tvb, *offset+1,new_item_len,
-					val_to_str(value,release_request_reason,"Unknown item (0x%02x)"));
-			item_len-=(asn->offset-*offset)+new_item_len;
-			*offset = asn->offset+new_item_len;
-			asn->offset = *offset;
-			/*  do we have User information field  ?  */
-			if(item_len > 0)
-			{
-				show_acse_user_information(asn,acse_tree,tvb,offset,item_len);
-			}
-			/*   align the pointer */
-			(*offset)=start+save_len;
-			asn->offset = (*offset);
-}
 static void
 show_user_data(ASN1_SCK *asn,proto_tree *acse_tree,tvbuff_t *tvb,int
 *offset,int item_len,int tag)
@@ -1518,7 +1463,7 @@
 					}
 				return FALSE;
 				}
-				show_finish_pdu(&asn,acse_tree,tvb,&offset,rest_len);
+				show_disconnect_pdu(&asn,acse_tree,tvb,&offset,rest_len);
 				break;
 		case SES_DISCONNECT:
 			proto_tree_add_uint(acse_tree, hf_acse_type, tvb, offset-1, 1, s_type);
--- ethereal-0.10.10.orig/epan/dissectors/packet-afp.c
+++ ethereal-0.10.10/epan/dissectors/packet-afp.c
@@ -1551,7 +1551,7 @@
 		string = tvb_format_text(tvb,offset, len);
     		break;
 	default:
-		string = "unknow type";
+		string = "Unknown type";
 		break;
     	}
 	return string;
@@ -1730,7 +1730,7 @@
 
 		len  = tvb_get_guint8(tvb, offset) +1;
 		rep = get_name(tvb, offset, 2);
-		proto_item_set_text(item, rep);
+		proto_item_set_text(item, "%s", rep);
 		proto_item_set_len(item, len +1);
 
 		proto_tree_add_item(tree, hf_afp_vol_name, tvb, offset, 1,FALSE);
--- ethereal-0.10.10.orig/epan/dissectors/packet-aim.c
+++ ethereal-0.10.10/epan/dissectors/packet-aim.c
@@ -4,7 +4,7 @@
  * Copyright 2004, Jelmer Vernooij <jelmer@samba.org>
  * Copyright 2004, Devin Heitmueller <dheitmueller@netilla.com>
  *
- * $Id: packet-aim.c 13084 2005-01-17 08:13:02Z guy $
+ * $Id: packet-aim.c 13955 2005-03-28 15:55:47Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -774,7 +774,7 @@
   }
   
   if (check_col(pinfo->cinfo, COL_INFO)) {
-	 if(subtype) {
+	 if(subtype && family) {
 		 col_set_str(pinfo->cinfo, COL_INFO, family->name);
 		 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", subtype->name);
 	 } else {
@@ -1189,6 +1189,11 @@
     
     /* Block length (includes charset and charsubset) */
     blocklen = tvb_get_ntohs(tvb, offset);
+    if (blocklen <= 4) {
+      proto_tree_add_text(entry, tvb, offset, 2, "Invalid block length: %d",
+        blocklen);
+      break;
+    }
     proto_tree_add_item(entry, hf_aim_messageblock_len, tvb, offset, 2,
 			FALSE);
     offset += 2;
--- ethereal-0.10.10.orig/epan/dissectors/packet-ansi_637.c
+++ ethereal-0.10.10/epan/dissectors/packet-ansi_637.c
@@ -1716,7 +1716,7 @@
 
 	    if (ansi_637_add_string[0] != '\0')
 	    {
-		proto_item_append_text(item, ansi_637_add_string);
+		proto_item_append_text(item, "%s", ansi_637_add_string);
 	    }
 	}
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-ansi_a.c
+++ ethereal-0.10.10/epan/dissectors/packet-ansi_a.c
@@ -10,7 +10,7 @@
  *   2000 Access Network Interfaces
  *			3GPP2 A.S0001-1		TIA/EIA-2001
  *
- * $Id: packet-ansi_a.c 12128 2004-09-29 00:06:36Z guy $
+ * $Id: packet-ansi_a.c 13794 2005-03-17 19:44:45Z guy $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -39,9 +39,10 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "epan/packet.h"
+#include <epan/packet.h>
 #include <epan/prefs.h>
 #include <epan/tap.h>
+#include <epan/strutil.h>
 
 #include "packet-bssap.h"
 #include "packet-ansi_a.h"
@@ -1991,7 +1992,7 @@
 
 	if (add_string[0] != '\0')
 	{
-	    proto_item_append_text(item, add_string);
+	    proto_item_append_text(item, "%s", add_string);
 	}
 
 	proto_item_set_len(item, consumed);
@@ -2188,7 +2189,7 @@
 
 	if (add_string[0] != '\0')
 	{
-	    proto_item_append_text(item, add_string);
+	    proto_item_append_text(item, "%s", add_string);
 	}
 
 	proto_item_set_len(item, consumed);
@@ -2336,7 +2337,7 @@
 
     if (add_string[0] != '\0')
     {
-	proto_item_append_text(item, add_string);
+	proto_item_append_text(item, "%s", add_string);
     }
 
     proto_item_set_len(item, consumed);
@@ -2379,7 +2380,7 @@
 
 	if (add_string[0] != '\0')
 	{
-	    proto_item_append_text(item, add_string);
+	    proto_item_append_text(item, "%s", add_string);
 	}
 
 	proto_item_set_len(item, consumed);
@@ -2769,8 +2770,9 @@
 
     proto_tree_add_string_format(tree, hf_ansi_a_clg_party_ascii_num,
 	tvb, curr_offset, len - (curr_offset - offset),
+	poctets,
 	"Digits: %s",
-	poctets);
+	format_text(poctets, len - (curr_offset - offset)));
 
     curr_offset += len - (curr_offset - offset);
 
@@ -5308,8 +5310,9 @@
 
     proto_tree_add_string_format(tree, hf_ansi_a_cld_party_ascii_num,
 	tvb, curr_offset, len - (curr_offset - offset),
+	poctets,
 	"Digits: %s",
-	poctets);
+	format_text(poctets, len - (curr_offset - offset)));
 
     curr_offset += len - (curr_offset - offset);
 
@@ -6052,7 +6055,7 @@
 
 		if (a_add_string[0] != '\0')
 		{
-		    proto_item_append_text(item, a_add_string);
+		    proto_item_append_text(item, "%s", a_add_string);
 		    a_add_string[0] = '\0';
 		}
 	    }
@@ -6114,7 +6117,7 @@
 
 	    if (a_add_string[0] != '\0')
 	    {
-		proto_item_append_text(item, a_add_string);
+		proto_item_append_text(item, "%s", a_add_string);
 		a_add_string[0] = '\0';
 	    }
 	}
@@ -6207,7 +6210,7 @@
 
 	    if (a_add_string[0] != '\0')
 	    {
-		proto_item_append_text(item, a_add_string);
+		proto_item_append_text(item, "%s", a_add_string);
 		a_add_string[0] = '\0';
 	    }
 	}
--- ethereal-0.10.10.orig/epan/dissectors/packet-ansi_map.c
+++ ethereal-0.10.10/epan/dissectors/packet-ansi_map.c
@@ -12810,7 +12810,7 @@
 
 	    if (ansi_map_add_string[0] != '\0')
 	    {
-		proto_item_append_text(item, ansi_map_add_string);
+		proto_item_append_text(item, "%s", ansi_map_add_string);
 		ansi_map_add_string[0] = '\0';
 	    }
 	}
@@ -12868,7 +12868,7 @@
 
     if (ansi_map_add_string[0] != '\0')
     {
-	proto_item_append_text(item, ansi_map_add_string);
+	proto_item_append_text(item, "%s", ansi_map_add_string);
 	ansi_map_add_string[0] = '\0';
     }
 }
--- ethereal-0.10.10.orig/epan/dissectors/packet-ber.c
+++ ethereal-0.10.10/epan/dissectors/packet-ber.c
@@ -1,4 +1,4 @@
-/*#define DEBUG_BER 1*/
+/* #define DEBUG_BER 1 */
 /* TODO: change #.REGISTER signature to new_dissector_t and
  * update call_ber_oid_callback() accordingly.
  */
@@ -6,7 +6,7 @@
  * Helpers for ASN.1/BER dissection
  * Ronnie Sahlberg (C) 2004
  *
- * $Id: packet-ber.c 13479 2005-02-23 08:57:47Z sahlberg $
+ * $Id: packet-ber.c 14217 2005-04-28 09:54:03Z kukosa $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -47,6 +47,7 @@
 #include <epan/packet.h>
 
 #include <epan/strutil.h>
+#include <epan/to_str.h>
 #include <epan/prefs.h>
 #include "packet-ber.h"
 
@@ -211,7 +212,7 @@
 			if(item){
 				next_tree=proto_item_add_subtree(item, ett_ber_SEQUENCE);
 			}
-			offset=dissect_unknown_ber(pinfo, tvb, offset, next_tree);
+			offset+=dissect_unknown_ber(pinfo, tvb, offset, next_tree);
 			break;
 		case BER_UNI_TAG_NumericString:
 			offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, start_offset, hf_ber_unknown_NumericString, NULL);
@@ -232,7 +233,7 @@
 		if(item){
 			next_tree=proto_item_add_subtree(item, ett_ber_SEQUENCE);
 		}
-		offset=dissect_unknown_ber(pinfo, tvb, offset, next_tree);
+		offset+=dissect_unknown_ber(pinfo, tvb, offset, next_tree);
 		break;
 	default:
 		proto_tree_add_text(tree, tvb, offset, len, "BER: Error can not handle class:%d (0x%02x)",class,tvb_get_guint8(tvb, start_offset));
@@ -289,7 +290,9 @@
 
 	id = tvb_get_guint8(tvb, offset);
 	offset += 1;
-	
+#ifdef DEBUG_BER
+printf ("BER ID=%02x", id);
+#endif
 	/* 8.1.2.2 */
 	tmp_class = (id>>6) & 0x03;
 	tmp_pc = (id>>5) & 0x01;
@@ -299,13 +302,19 @@
 		tmp_tag = 0;
 		while (tvb_length_remaining(tvb, offset) > 0) {
 			t = tvb_get_guint8(tvb, offset);
+#ifdef DEBUG_BER
+printf (" %02x", t);
+#endif
 			offset += 1;
 			tmp_tag <<= 7;       
 			tmp_tag |= t & 0x7F;
-			if (t & 0x80) break;
+			if (!(t & 0x80)) break;
 		}
 	}
 
+#ifdef DEBUG_BER
+printf ("\n");
+#endif
 	if (class)
 		*class = tmp_class;
 	if (pc)
@@ -350,10 +359,11 @@
  */
 /* 8.1.3 Length octets */
 int
-get_ber_length(tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind) {
+get_ber_length(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind) {
 	guint8 oct, len;
 	guint32 tmp_length;
 	gboolean tmp_ind;
+	int old_offset=offset;
 
 	tmp_length = 0;
 	tmp_ind = FALSE;
@@ -380,6 +390,13 @@
 		}
 	}
 
+	/* check that the length is sane */
+	if(tmp_length>(guint32)tvb_reported_length_remaining(tvb,offset)){
+		proto_tree_add_text(tree, tvb, old_offset, offset-old_offset, "BER: Error length:%d longer than tvb_reported_length_remaining:%d",tmp_length, tvb_reported_length_remaining(tvb, offset));
+		/* the ignorant mans way to generate [malformed packet] */
+		tvb_get_guint8(tvb, 99999999);
+	}
+
 	if (length)
 		*length = tmp_length;
 	if (ind)
@@ -398,7 +415,7 @@
 	guint32 tmp_length;
 	gboolean tmp_ind;
 
-	offset = get_ber_length(tvb, offset, &tmp_length, &tmp_ind);
+	offset = get_ber_length(tree, tvb, offset, &tmp_length, &tmp_ind);
 	
 	if(show_internal_ber_fields){
 		if(tmp_ind){
@@ -423,6 +440,7 @@
 	guint32 len;
 	int end_offset;
 	proto_item *it;
+  guint32 i;
 
 #ifdef DEBUG_BER
 {
@@ -451,7 +469,9 @@
 		/* sanity check: we only handle Constructed Universal Sequences */
 		if( (class!=BER_CLASS_UNI) 
 		  ||((tag<BER_UNI_TAG_NumericString)&&(tag!=BER_UNI_TAG_OCTETSTRING)&&(tag!=BER_UNI_TAG_UTF8String)) ){
+		    tvb_ensure_bytes_exist(tvb, offset-2, 2);
 	    	    proto_tree_add_text(tree, tvb, offset-2, 2, "BER Error: OctetString expected but Class:%d PC:%d Tag:%d was unexpected", class, pc, tag);
+			if(out_tvb)
 				*out_tvb=NULL;
 			return end_offset;
 		}
@@ -466,12 +486,30 @@
 	if (pc) {
 		/* constructed */
 		/* TO DO */
+    printf("TODO: handle constructed type in packet-ber.c, dissect_ber_octet_string\n");
 	} else {
 		/* primitive */
+		gint length_remaining = tvb_length_remaining(tvb, offset);
+
+		if(length_remaining<1){
+			return end_offset;
+		}
+
 		if (hf_id != -1) {
+			tvb_ensure_bytes_exist(tvb, offset, len);
 			it = proto_tree_add_item(tree, hf_id, tvb, offset, len, FALSE);
 			ber_last_created_item = it;
-		}
+		} else {
+      proto_item *pi;
+      
+      pi=proto_tree_add_text(tree, tvb, offset, len, "Unknown OctetString: Length: 0x%02x, Value: 0x", len);
+      if(pi){
+        for(i=0;i<len;i++){
+          proto_item_append_text(pi,"%02x",tvb_get_guint8(tvb, offset));
+          offset++;
+        }
+      }
+    }
 		if (out_tvb) {
 			if(len<=(guint32)tvb_length_remaining(tvb, offset)){
 				*out_tvb = tvb_new_subset(tvb, offset, len, len);
@@ -485,10 +523,10 @@
 
 int dissect_ber_octet_string_wcb(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, ber_callback func)
 {
-	tvbuff_t *out_tvb;
+	tvbuff_t *out_tvb = NULL;
 
 	offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_id, (func)?&out_tvb:NULL);
-	if (func && (tvb_length(out_tvb)>0)) {
+	if (func && out_tvb && (tvb_length(out_tvb)>0)) {
 		if (hf_id != -1)
 			tree = proto_item_add_subtree(ber_last_created_item, ett_ber_octet_string);
 		func(pinfo, tree, out_tvb, 0);
@@ -496,6 +534,31 @@
 	return offset;
 }
 
+/* 8.8 Encoding of a null value */
+int 
+dissect_ber_null(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id) {
+  guint8 class;
+  gboolean pc;
+  guint32 tag, len;
+  int offset_old;
+
+  offset_old = offset;  
+  offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
+  if ((pc) ||
+      (!implicit_tag && ((class != BER_CLASS_UNI) || (tag != BER_UNI_TAG_NULL)))) {
+    proto_tree_add_text(tree, tvb, offset_old, offset - offset_old, "BER Error: NULL expected but Class:%d(%s) PC:%d Tag:%d was unexpected", class,val_to_str(class,ber_class_codes,"Unknown"), pc, tag);
+  }
+
+  offset_old = offset;  
+  offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
+  if (len) {
+    proto_tree_add_text(tree, tvb, offset_old, offset - offset_old, "BER Error: NULL expect zero length but Length=%d", len);
+    proto_tree_add_text(tree, tvb, offset, len, "BER Error: unexpected data in NULL type");
+    offset += len;
+  }
+
+  return offset;
+}
 
 int
 dissect_ber_integer(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, guint32 *value)
@@ -531,7 +594,8 @@
 	  offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
 	  offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
 	} else {
-	  len=tvb_length_remaining(tvb, offset);
+	  gint32 remaining=tvb_length_remaining(tvb, offset);
+	  len=remaining>0 ? remaining : 0;
 	}
 
 	/* ok,  we cant handle >4 byte integers so lets fake them */
@@ -581,8 +645,12 @@
 	ber_last_created_item=NULL;
 
 	if(hf_id!=-1){	
-		/* XXX - what if "len" is not 1, 2, 3, or 4? */
-		ber_last_created_item=proto_tree_add_item(tree, hf_id, tvb, offset-len, len, FALSE);
+		/*  */
+		if (len < 1 || len > 4) {
+			proto_tree_add_text(tree, tvb, offset-len, len, "Can't handle integer length: %u", len);
+		} else {
+			ber_last_created_item=proto_tree_add_item(tree, hf_id, tvb, offset-len, len, FALSE);
+		}
 	}
 	if(value){
 		*value=val;
@@ -676,7 +744,8 @@
 		if ((!pc)
 		||(!implicit_tag&&((class!=BER_CLASS_UNI)
 							||(tag!=BER_UNI_TAG_SEQUENCE)))) {
-			proto_tree_add_text(tree, tvb, offset-2, 2, "BER Error: Sequence expected but Class:%d PC:%d Tag:%d was unexpected", class, pc, tag);
+			tvb_ensure_bytes_exist(tvb, offset-2, 2);
+			proto_tree_add_text(tree, tvb, offset-2, 2, "BER Error: Sequence expected but Class:%d(%s) PC:%d Tag:%d was unexpected", class,val_to_str(class,ber_class_codes,"Unknown"), pc, tag);
 			return end_offset;
 		}
 	} else {
@@ -712,7 +781,7 @@
 		hoffset = offset;
 		/* read header and len for next field */
 		offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-		offset = get_ber_length(tvb, offset, &len, &ind_field);
+		offset = get_ber_length(tree, tvb, offset, &len, &ind_field);
 		eoffset = offset + len;
 ber_sequence_try_again:
 		/* have we run out of known entries in the sequence ?*/
@@ -744,8 +813,18 @@
 				seq++;
 				goto ber_sequence_try_again;
 			}
-
-			proto_tree_add_text(tree, tvb, offset, len, "BER Error: Wrong field in SEQUENCE  expected class:%d tag:%d but found class:%d tag:%d",seq->class,seq->tag,class,tag);
+			if ( seq->class == BER_CLASS_UNI){
+				proto_tree_add_text(tree, tvb, offset, len,
+				    "BER Error: Wrong field in SEQUENCE  expected class:%d (%s) tag:%d (%s) but found class:%d tag:%d",
+				    seq->class,val_to_str(seq->class,ber_class_codes,"Unknown"),
+				    seq->tag,val_to_str(seq->tag,ber_uni_tag_codes,"Unknown"),
+				    class,tag);
+			}else{
+				proto_tree_add_text(tree, tvb, offset, len,
+				    "BER Error: Wrong field in SEQUENCE  expected class:%d (%s) tag:%d but found class:%d tag:%d",
+				    seq->class,val_to_str(seq->class,ber_class_codes,"Unknown"),
+				    seq->tag,class,tag);
+			}
 			seq++;
 			offset=eoffset;
 			continue;
@@ -762,7 +841,11 @@
 				goto ber_sequence_try_again;
 			}
 
-			proto_tree_add_text(tree, tvb, offset, len, "BER Error: Wrong field in sequence  expected class:%d tag:%d but found class:%d tag:%d",seq->class,seq->tag,class,tag);
+			if ( seq->class == BER_CLASS_UNI){
+				proto_tree_add_text(tree, tvb, offset, len, "BER Error: Wrong field in sequence  expected class:%d (%s) tag:%d(%s) but found class:%d(%s) tag:%d",seq->class,val_to_str(seq->class,ber_class_codes,"Unknown"),seq->tag,val_to_str(seq->tag,ber_uni_tag_codes,"Unknown"),class,val_to_str(class,ber_class_codes,"Unknown"),tag);
+			}else{
+				proto_tree_add_text(tree, tvb, offset, len, "BER Error: Wrong field in sequence  expected class:%d (%s) tag:%d but found class:%d(%s) tag:%d",seq->class,val_to_str(seq->class,ber_class_codes,"Unknown"),seq->tag,class,val_to_str(class,ber_class_codes,"Unknown"),tag);
+			}
 			seq++;
 			offset=eoffset;
 			continue;
@@ -819,17 +902,21 @@
 }
 #endif
 		seq++;
-		offset = hoffset+count;
-		/* if it was optional  and no bytes were eaten,
-		   just try again.
-		*/
-		if((count==0)&&(seq->flags&BER_FLAGS_OPTIONAL)){
-				goto ber_sequence_try_again;
+		if (len==0) {
+			offset = eoffset;
+		} else {
+			offset = hoffset+count;
+		}
+		/* if it was optional and no bytes were eaten and it was */
+		/* supposed to (len<>0), just try again. */
+		if((len!=0)&&(count==0)&&(seq->flags&BER_FLAGS_OPTIONAL)){
+			goto ber_sequence_try_again;
 		}
 	}
 
 	/* if we didnt end up at exactly offset, then we ate too many bytes */
 	if (offset != end_offset) {
+		tvb_ensure_bytes_exist(tvb, offset-2, 2);
 		proto_tree_add_text(tree, tvb, offset-2, 2, "BER Error: Sequence ate %d too many bytes", offset-end_offset);
 	}
 
@@ -879,7 +966,7 @@
 
 	/* read header and len for choice field */
 	offset=get_ber_identifier(tvb, offset, &class, &pc, &tag);
-	offset=get_ber_length(tvb, offset, &len, &ind);
+	offset=get_ber_length(parent_tree, tvb, offset, &len, &ind);
 	if(ind){
 	  /* if the length is indefinite we dont really know (yet) where the
 	   * object ends so assume it spans the rest of the tvb for now.
@@ -1038,6 +1125,7 @@
 	/* sanity check: we only handle Universal GeneralString*/
 	if( (class!=BER_CLASS_UNI)
 	  ||(tag!=BER_UNI_TAG_GENSTR) ){
+		tvb_ensure_bytes_exist(tvb, offset-2, 2);
 	        proto_tree_add_text(tree, tvb, offset-2, 2, "BER Error: GeneralString expected but Class:%d PC:%d Tag:%d was unexpected", class, pc, tag);
 		return end_offset;
 	}
@@ -1085,12 +1173,13 @@
 
 	if (!implicit_tag) {
 		offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-		offset = get_ber_length(tvb, offset, &len, NULL);
+		offset = get_ber_length(tree, tvb, offset, &len, NULL);
 		eoffset = offset + len;
 
 		/* sanity check */
 		if( (class!=BER_CLASS_UNI)
 		  ||(tag != type) ){
+	            tvb_ensure_bytes_exist(tvb, offset-2, 2);
 	    	    proto_tree_add_text(tree, tvb, offset-2, 2, "BER Error: String with tag=%d expected but Class:%d PC:%d Tag:%d was unexpected", type, class, pc, tag);
 			return eoffset;
 		}
@@ -1103,15 +1192,15 @@
 int
 dissect_ber_GeneralString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *name_string, guint name_len)
 {
-	tvbuff_t *out_tvb;
+	tvbuff_t *out_tvb = NULL;
 
 	offset = dissect_ber_restricted_string(FALSE, BER_UNI_TAG_GeneralString, pinfo, tree, tvb, offset, hf_id, (name_string)?&out_tvb:NULL);
 
 	if (name_string) {
-		if (tvb_length(out_tvb) >= name_len) {
+		if (out_tvb && tvb_length(out_tvb) >= name_len) {
 			tvb_memcpy(out_tvb, name_string, 0, name_len-1);
 			name_string[name_len-1] = '\0';
-		} else {
+		} else if (out_tvb) {
 			tvb_memcpy(out_tvb, name_string, 0, -1);
 			name_string[tvb_length(out_tvb)] = '\0';
 		}
@@ -1125,11 +1214,9 @@
 	gint8 class;
 	gboolean pc;
 	gint32 tag;
-	guint32 i, len;
+	guint32 len;
 	int eoffset;
-	guint8 byte;
-	guint32 value;
-	char str[256],*strp, *name;
+	char str[MAX_OID_STR_LEN], *name;
 	proto_item *item;
 
 #ifdef DEBUG_BER
@@ -1161,6 +1248,7 @@
 		eoffset = offset + len;
 		if( (class!=BER_CLASS_UNI)
 		  ||(tag != BER_UNI_TAG_OID) ){
+	            tvb_ensure_bytes_exist(tvb, offset-2, 2);
 	    	    proto_tree_add_text(tree, tvb, offset-2, 2, "BER Error: Object Identifier expected but Class:%d PC:%d Tag:%d was unexpected", class, pc, tag);
 			return eoffset;
 		}
@@ -1169,31 +1257,8 @@
 		eoffset=offset+len;
 	}
 
-	value=0;
-	for (i=0,strp=str; i<len; i++){
-		byte = tvb_get_guint8(tvb, offset);
-		offset++;
-
-		if((strp-str)>200){
-    	    proto_tree_add_text(tree, tvb, offset, eoffset - offset, "BER Error: too long Object Identifier");
-			return offset;
-		}
-
-		/* 8.19.4 */
-		if (i == 0) {
-			strp += sprintf(strp, "%d.%d", byte/40, byte%40);
-			continue;
-		}
-
-		value = (value << 7) | (byte & 0x7F);
-		if (byte & 0x80) {
-			continue;
-		}
-
-		strp += sprintf(strp, ".%d", value);
-		value = 0;
-	}
-	*strp = '\0';
+	oid_to_str_buf(tvb_get_ptr(tvb, offset, len), len, str, MAX_OID_STR_LEN);
+	offset += len;
 
 	if (hf_id != -1) {
 		item=proto_tree_add_string(tree, hf_id, tvb, offset - len, len, str);
@@ -1215,7 +1280,7 @@
 
 static int dissect_ber_sq_of(gboolean implicit_tag, gint32 type, packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_sequence_t *seq, gint hf_id, gint ett_id) {
 	gint8 class;
-	gboolean pc, ind, ind_field;
+	gboolean pc, ind = FALSE, ind_field;
 	gint32 tag;
 	guint32 len;
 	proto_tree *tree = parent_tree;
@@ -1258,6 +1323,7 @@
 		if (!pc
 			||(!implicit_tag&&((class!=BER_CLASS_UNI)
 							||(tag!=type)))) {
+			tvb_ensure_bytes_exist(tvb, offset-2, 2);
 			proto_tree_add_text(tree, tvb, offset-2, 2, "BER Error: %s Of expected but Class:%d PC:%d Tag:%d was unexpected", 
 							(type==BER_UNI_TAG_SEQUENCE)?"Set":"Sequence", class, pc, tag);
 			return end_offset;
@@ -1281,7 +1347,7 @@
 
 		/* read header and len for next field */
 		offset = get_ber_identifier(tvb, offset, NULL, NULL, NULL);
-		offset = get_ber_length(tvb, offset, &len, NULL);
+		offset = get_ber_length(tree, tvb, offset, &len, NULL);
 		offset += len;
 		cnt++;
 	}
@@ -1322,7 +1388,7 @@
 		hoffset = offset;
 		/* read header and len for next field */
 		offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-		offset = get_ber_length(tvb, offset, &len, &ind_field);
+		offset = get_ber_length(tree, tvb, offset, &len, &ind_field);
 		if(ind_field){
 			/* if the length is indefinite we dont really know (yet) where the
 			 * object ends so assume it spans the rest of the tvb for now.
@@ -1367,6 +1433,7 @@
 
 	/* if we didnt end up at exactly offset, then we ate too many bytes */
 	if (offset != end_offset) {
+		tvb_ensure_bytes_exist(tvb, offset-2, 2);
 		proto_tree_add_text(tree, tvb, offset-2, 2, "BER Error: %s Of ate %d too many bytes", 
 							(type==BER_UNI_TAG_SEQUENCE)?"Set":"Sequence", offset-end_offset);
 	}
@@ -1401,6 +1468,7 @@
 	  /* sanity check. we only handle universal/generalized time */
 	  if( (class!=BER_CLASS_UNI)
 	  ||(tag!=BER_UNI_TAG_GeneralizedTime)){
+		tvb_ensure_bytes_exist(tvb, offset-2, 2);
 	        proto_tree_add_text(tree, tvb, offset-2, 2, "BER Error: GeneralizedTime expected but Class:%d PC:%d Tag:%d was unexpected", class, pc, tag);
 		return end_offset;
 		end_offset=offset+len;
@@ -1450,6 +1518,7 @@
 	  if (!implicit_tag) {
 		if( (class!=BER_CLASS_UNI)
 		  ||(tag!=BER_UNI_TAG_BITSTRING) ){
+		    tvb_ensure_bytes_exist(tvb, offset-2, 2);
 	    	    proto_tree_add_text(parent_tree, tvb, offset-2, 2, "BER Error: BitString expected but Class:%d PC:%d Tag:%d was unexpected", class, pc, tag);
 			return end_offset;
 		}
@@ -1525,7 +1594,7 @@
 
 int dissect_ber_bitstring32(gboolean implicit_tag, packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, int **bit_fields, gint hf_id, gint ett_id, tvbuff_t **out_tvb) 
 {
-	tvbuff_t *tmp_tvb;
+	tvbuff_t *tmp_tvb = NULL;
 	proto_tree *tree;
 	guint32 val;
 	int **bf;
@@ -1537,7 +1606,7 @@
 	offset = dissect_ber_bitstring(implicit_tag, pinfo, parent_tree, tvb, offset, NULL, hf_id, ett_id, &tmp_tvb);
 	
 	tree = proto_item_get_subtree(ber_last_created_item);
-	if (bit_fields && tree) {
+	if (bit_fields && tree && tmp_tvb) {
 		/* tmp_tvb points to the actual bitstring (including any pad bits at the end.
 		 * note that this bitstring is not neccessarily always encoded as 4 bytes
 		 * so we have to read it byte by byte.
--- ethereal-0.10.10.orig/epan/dissectors/packet-bootp.c
+++ ethereal-0.10.10/epan/dissectors/packet-bootp.c
@@ -3,7 +3,7 @@
  * Copyright 1998, Gilbert Ramirez <gram@alumni.rice.edu>
  * Copyright 2004, Thomas Anders <thomas.anders [AT] blue-cable.de>
  *
- * $Id: packet-bootp.c 13015 2005-01-13 07:49:31Z guy $
+ * $Id: packet-bootp.c 14141 2005-04-19 20:59:41Z gerald $
  *
  * The information used comes from:
  * RFC  951: Bootstrap Protocol
@@ -24,12 +24,14 @@
  * BOOTP and DHCP Parameters
  *     http://www.iana.org/assignments/bootp-dhcp-parameters
  * DOCSIS(TM) 2.0 Radio Frequency Interface Specification
- *     http://www.cablemodem.com/downloads/specs/CM-SP-RFIv2.0-I06-040804.pdf
- * PacketCable(TM) MTA Device Provisioning Specification
+ *     http://www.cablemodem.com/downloads/specs/CM-SP-RFIv2.0-I08-050408.pdf
+ * PacketCable(TM) 1.0 MTA Device Provisioning Specification
  *     http://www.packetcable.com/downloads/specs/PKT-SP-PROV-I10-040730.pdf
  *     http://www.cablelabs.com/specifications/archives/PKT-SP-PROV-I05-021127.pdf (superseded by above)
+ * PacketCable(TM) 1.5 MTA Device Provisioning Specification
+ *     http://www.packetcable.com/downloads/specs/PKT-SP-PROV1.5-I01-050128.pdf
  * CableHome(TM) 1.1 Specification
- *     http://www.cablelabs.com/projects/cablehome/downloads/specs/CH-SP-CH1.1-I05-040806.pdf
+ *     http://www.cablelabs.com/projects/cablehome/downloads/specs/CH-SP-CH1.1-I08-050408.pdf
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -182,7 +184,7 @@
 };
 
 
-/* PacketCable definitions */
+/* PacketCable/DOCSIS definitions */
 #define PACKETCABLE_MTA_CAP10 "pktc1.0:"
 #define PACKETCABLE_MTA_CAP15 "pktc1.5:"
 #define PACKETCABLE_CM_CAP11  "docsis1.1:"
@@ -1166,7 +1168,7 @@
 
 		case ipv4:
 			if (optlen != 4) {
-				proto_item_append_string(vti,
+				proto_item_append_text(vti,
 				    " - length isn't 4");
 				break;
 			}
@@ -1325,7 +1327,7 @@
 	subopt_len = tvb_get_guint8(tvb, suboptoff);
 	suboptoff++;
 
-	if (suboptoff+subopt_len >= optend) {
+	if (suboptoff+subopt_len > optend) {
 		proto_tree_add_text(v_tree, tvb, optoff, optend-optoff,
 			"Suboption %d: no room left in option for suboption value",
 	 		subopt);
@@ -1408,7 +1410,7 @@
 	subopt_len = tvb_get_guint8(tvb, suboptoff);
 	suboptoff++;
 
-	if (suboptoff+subopt_len >= optend) {
+	if (suboptoff+subopt_len > optend) {
 		proto_tree_add_text(v_tree, tvb, optoff, optend-optoff,
 			"Suboption %d: no room left in option for suboption value",
 	 		subopt);
@@ -1421,7 +1423,7 @@
 			"Suboption %d: %s (%d byte%s)" ,
 	 		subopt, "PXE boot item",
 			subopt_len, plurality(subopt_len, "", "s"));
-	} else if ((subopt < 1) || (subopt > array_length(o43pxeclient_opt))) {
+	} else if ((subopt < 1) || (subopt >= array_length(o43pxeclient_opt))) {
 		proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2,
 			"Unknown suboption %d (%d byte%s)", subopt, subopt_len,
 			plurality(subopt_len, "", "s"));
@@ -1545,7 +1547,7 @@
 		/* 30 */ {"Unassigned (CableHome)", special, NULL},
 		/* *** 31-50: PacketCable *** */
 		/* 31 */ {"MTA MAC Address", special, NULL},
-		/* 32 */ {"Correlation ID", string, NULL},
+		/* 32 */ {"Correlation ID", val_u_long, NULL},
 		/* 33-50 {"Unassigned (PacketCable)", special, NULL}, */
 		/* *** 51-127: CableLabs *** */
 		/* 51-127 {"Unassigned (CableLabs)", special, NULL}, */
@@ -1581,13 +1583,13 @@
 	subopt_len = tvb_get_guint8(tvb, suboptoff);
 	suboptoff++;
 
-	if (suboptoff+subopt_len >= optend) {
+	if (suboptoff+subopt_len > optend) {
 		proto_tree_add_text(v_tree, tvb, optoff, optend-optoff,
 			"Suboption %d: no room left in option for suboption value",
 	 		subopt);
 	 	return (optend);
 	}
-	if ( (subopt < 1 ) || (subopt > array_length(o43cablelabs_opt)) ) {
+	if ( (subopt < 1 ) || (subopt >= array_length(o43cablelabs_opt)) ) {
 		proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2,
 			"Suboption %d: Unassigned (%d byte%s)", subopt, subopt_len,
 			plurality(subopt_len, "", "s"));
@@ -1637,7 +1639,7 @@
 			proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2,
 				"Suboption %d: %s = \"%s\"", subopt,
 				o43cablelabs_opt[subopt].text,
-				tvb_format_stringzpad(tvb, optoff, subopt_len));
+				tvb_format_stringzpad(tvb, suboptoff, subopt_len));
 			break;
 
 		case bytes:
@@ -1647,6 +1649,18 @@
 				tvb_bytes_to_str(tvb, suboptoff, subopt_len));
 			break;
 
+		case val_u_long:
+			if (subopt_len != 4) {
+				proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2,
+					"Suboption %d: suboption length isn't 4", subopt);
+				break;
+			}
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2,
+				"Suboption %d: %s = %u", subopt,
+				o43cablelabs_opt[subopt].text,
+				tvb_get_ntohl(tvb, suboptoff));
+			break;
+
 		default:
 			proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2,"ERROR, please report: Unknown subopt type handler %d", subopt);
 			break;
@@ -1698,7 +1712,7 @@
 	subopt_len = tvb_get_guint8(tvb, suboptoff);
 	suboptoff++;
 
-	if (subopt > array_length(o63_opt)) {
+	if (subopt >= array_length(o63_opt)) {
 		proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "Unknown suboption %d", subopt);
 	} else {
 		switch (o63_opt[subopt].ftype) {
@@ -2018,8 +2032,8 @@
 {
 	guint16 raw_val;
 	unsigned long flow_val = 0;
-	guint off = PKT_MDC_TLV_OFF + voff;
-	guint tlv_len, i;
+	int off = PKT_MDC_TLV_OFF + voff;
+	int tlv_len, i;
 	guint8 asc_val[3] = "  ", flow_val_str[5];
 	static GString *tlv_str = NULL;
 	char bit_fld[64];
@@ -2030,7 +2044,7 @@
 		tlv_str = g_string_new("");
 
 	tvb_memcpy (tvb, asc_val, off, 2);
-	if (sscanf(asc_val, "%x", &tlv_len) != 1) {
+	if (sscanf(asc_val, "%x", &tlv_len) != 1 || tlv_len < 1) {
 		proto_tree_add_text(v_tree, tvb, off, len - off,
 			"Bogus length: %s", asc_val);
 		return;
@@ -2039,7 +2053,7 @@
 				tlv_len, "MTA DC Length: %d", tlv_len);
 		off += 2;
 
-		while ((int) off - voff < len) {
+		while (off - voff < len) {
 			/* Type */
 			raw_val = tvb_get_ntohs (tvb, off);
 			g_string_sprintf(tlv_str, "0x%.2s: %s = ",
@@ -2048,7 +2062,7 @@
 
 			/* Length */
 			tvb_memcpy(tvb, asc_val, off + 2, 2);
-			if (sscanf(asc_val, "%x", &tlv_len) != 1) {
+			if (sscanf(asc_val, "%x", &tlv_len) != 1 || tlv_len < 1) {
 				proto_tree_add_text(v_tree, tvb, off, len - off,
 							"[Bogus length: %s]", asc_val);
 				return;
@@ -2133,7 +2147,7 @@
 						break;
 				}
 			}
-			ti = proto_tree_add_text(v_tree, tvb, off, (tlv_len * 2) + 4, tlv_str->str);
+			ti = proto_tree_add_text(v_tree, tvb, off, (tlv_len * 2) + 4, "%s", tlv_str->str);
 			subtree = proto_item_add_subtree(ti, ett_bootp_option);
 			if (raw_val == PKT_MDC_PROV_FLOWS) {
 				for (i = 0 ; i < 3; i++) {
@@ -2153,8 +2167,8 @@
 dissect_docsis_cm_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len)
 {
 	unsigned long raw_val;
-	guint off = PKT_CM_TLV_OFF + voff;
-	guint tlv_len, i;
+	int off = PKT_CM_TLV_OFF + voff;
+	int tlv_len, i;
 	guint8 asc_val[3] = "  ";
 	static GString *tlv_str = NULL;
 
@@ -2162,7 +2176,7 @@
 		tlv_str = g_string_new("");
 
 	tvb_memcpy (tvb, asc_val, off, 2);
-	if (sscanf(asc_val, "%x", &tlv_len) != 1) {
+	if (sscanf(asc_val, "%x", &tlv_len) != 1 || tlv_len < 1) {
 		proto_tree_add_text(v_tree, tvb, off, len - off,
 				    "Bogus length: %s", asc_val);
 		return;
@@ -2171,7 +2185,7 @@
 				tlv_len, "CM DC Length: %d", tlv_len);
 		off += 2;
 
-		while ((int) off - voff < len) {
+		while (off - voff < len) {
 			/* Type */
 			raw_val = tvb_get_ntohs (tvb, off);
 			g_string_sprintf(tlv_str, "0x%.2s: %s = ",
@@ -2180,7 +2194,7 @@
 
 			/* Length */
 			tvb_memcpy(tvb, asc_val, off + 2, 2);
-			if (sscanf(asc_val, "%x", &tlv_len) != 1) {
+			if (sscanf(asc_val, "%x", &tlv_len) != 1 || tlv_len < 1) {
 				proto_tree_add_text(v_tree, tvb, off, len - off,
 							"[Bogus length: %s]", asc_val);
 				return;
@@ -2242,7 +2256,7 @@
 						break;
 				}
 			}
-			proto_tree_add_text(v_tree, tvb, off, (tlv_len * 2) + 4, tlv_str->str);
+			proto_tree_add_text(v_tree, tvb, off, (tlv_len * 2) + 4, "%s", tlv_str->str);
 			off += (tlv_len * 2) + 4;
 		}
 	}
@@ -2346,7 +2360,7 @@
 					tvb_format_stringzpad(tvb, suboptoff, subopt_len),
 					subopt_len,
 					plurality(subopt_len, "", "s") );
-			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			suboptoff += subopt_len;
 			break;
 
@@ -2363,7 +2377,7 @@
 					subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 1 ? " [Invalid]" : "");
-			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			suboptoff += subopt_len;
 			break;
 
@@ -2380,7 +2394,7 @@
 					subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 1 ? " [Invalid]" : "");
-			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			suboptoff += subopt_len;
 			break;
 
@@ -2394,7 +2408,7 @@
 			g_string_sprintfa(opt_str, "(%u byte%s%s)", subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 12 ? " [Invalid]" : "");
-			vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			if (subopt_len == 12) {
 				pkt_s_tree = proto_item_add_subtree(vti, ett_bootp_option);
 				proto_tree_add_text(pkt_s_tree, tvb, suboptoff, 4,
@@ -2420,7 +2434,7 @@
 			g_string_sprintfa(opt_str, "(%u byte%s%s)", subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 12 ? " [Invalid]" : "");
-			vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			if (subopt_len == 12) {
 				pkt_s_tree = proto_item_add_subtree(vti, ett_bootp_option);
 				proto_tree_add_text(pkt_s_tree, tvb, suboptoff, 4,
@@ -2450,12 +2464,12 @@
 					subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 1 ? " [Invalid]" : "");
-			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			suboptoff += subopt_len;
 			break;
 
 		default:
-			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			suboptoff += subopt_len;
 			break;
 
@@ -2517,7 +2531,7 @@
 					subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 4 ? " [Invalid]" : "");
-			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			suboptoff += subopt_len;
 			break;
 
@@ -2533,11 +2547,11 @@
 			switch (prov_type) {
 				case 0:
 					/* XXX - check suboption length */
-					get_dns_name(tvb, optoff, suboptoff, dns_name,
+					get_dns_name(tvb, suboptoff, suboptoff, dns_name,
 						sizeof(dns_name));
 					g_string_sprintfa(opt_str, "%s (%u byte%s)", dns_name,
 							subopt_len - 1, plurality(subopt_len, "", "s") );
-					proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+					proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 					break;
 				case 1:
 					if (suboptoff+4 > optend) {
@@ -2552,14 +2566,14 @@
 							subopt_len,
 							plurality(subopt_len, "", "s"),
 							subopt_len != 5 ? " [Invalid]" : "");
-					proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+					proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 					break;
 				default:
 					g_string_sprintfa(opt_str, "Invalid type: %u (%u byte%s)",
 							prov_type,
 							subopt_len,
 							plurality(subopt_len, "", "s") );
-					proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+					proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 					break;
 			}
 			suboptoff += subopt_len - 1;
@@ -2575,7 +2589,7 @@
 			g_string_sprintfa(opt_str, "(%u byte%s%s)", subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 12 ? " [Invalid]" : "");
-			vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			if (subopt_len == 12) {
 				pkt_s_tree = proto_item_add_subtree(vti, ett_bootp_option);
 				proto_tree_add_text(pkt_s_tree, tvb, suboptoff, 4,
@@ -2595,7 +2609,7 @@
 			g_string_sprintfa(opt_str, "(%u byte%s%s)", subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 12 ? " [Invalid]" : "");
-			vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			if (subopt_len == 12) {
 				pkt_s_tree = proto_item_add_subtree(vti, ett_bootp_option);
 				proto_tree_add_text(pkt_s_tree, tvb, suboptoff, 4,
@@ -2613,10 +2627,10 @@
 
 		case PKT_CCC_KRB_REALM: /* String values */
 			/* XXX - check suboption length */
-			get_dns_name(tvb, optoff, suboptoff, dns_name, sizeof(dns_name));
+			get_dns_name(tvb, suboptoff, suboptoff, dns_name, sizeof(dns_name));
 			g_string_sprintfa(opt_str, "%s (%u byte%s)", dns_name,
 					subopt_len, plurality(subopt_len, "", "s") );
-			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			suboptoff += subopt_len;
 			break;
 
@@ -2633,7 +2647,7 @@
 					subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 1 ? " [Invalid]" : "");
-			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			suboptoff += 1;
 			break;
 
@@ -2652,7 +2666,7 @@
 					subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 1 ? " [Invalid]" : "");
-			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			suboptoff += 1;
 			break;
 
@@ -2667,7 +2681,7 @@
 			g_string_sprintfa(opt_str, "0x%04x (%u byte%s%s)", sec_tcm, subopt_len,
 					plurality(subopt_len, "", "s"),
 					subopt_len != 2 ? " [Invalid]" : "");
-			vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			if (subopt_len == 2) {
 				pkt_s_tree = proto_item_add_subtree(vti, ett_bootp_option);
 				for (i = 0; i < 2; i++) {
@@ -2682,7 +2696,7 @@
 			break;
 
 		default:
-			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, opt_str->str);
+			proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2, "%s", opt_str->str);
 			suboptoff += subopt_len;
 			break;
 	}
--- ethereal-0.10.10.orig/epan/dissectors/packet-cmip.c
+++ ethereal-0.10.10/epan/dissectors/packet-cmip.c
@@ -280,14 +280,14 @@
 static int attributeform;
 #define ATTRIBUTE_LOCAL_FORM  0
 #define ATTRIBUTE_GLOBAL_FORM 1
-static char attribute_identifier_id[64]; /*64 chars should be long enough? */
+static char attribute_identifier_id[BER_MAX_OID_STR_LEN];
 
-static char object_identifier_id[64]; /*64 chars should be long enough? */
+static char object_identifier_id[BER_MAX_OID_STR_LEN];
 
 static int objectclassform;
 #define OBJECTCLASS_LOCAL_FORM  0
 #define OBJECTCLASS_GLOBAL_FORM 1
-static char objectclass_identifier_id[64]; /*64 chars should be long enough? */
+static char objectclass_identifier_id[BER_MAX_OID_STR_LEN];
 
 
 /*--- Included file: packet-cmip-fn.c ---*/
@@ -1895,7 +1895,8 @@
   return offset;
 }
 
-
+static int
+dissect_cmip_InvokeIDType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_);
 
 static int
 dissect_cmip_Argument(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
--- ethereal-0.10.10.orig/epan/dissectors/packet-cmp.c
+++ ethereal-0.10.10/epan/dissectors/packet-cmp.c
@@ -214,7 +214,7 @@
 /*--- End of included file: packet-cmp-ett.c ---*/
 
 
-static char object_identifier_id[64]; /*64 chars should be long enough? */
+static char object_identifier_id[BER_MAX_OID_STR_LEN];
 
 
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-cms.c
+++ ethereal-0.10.10/epan/dissectors/packet-cms.c
@@ -186,7 +186,7 @@
 static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2eth stops generating these silly wrappers */
 
 
-static char object_identifier_id[64]; /*64 chars should be long enough? */
+static char object_identifier_id[BER_MAX_OID_STR_LEN];
 
 
 /*--- Included file: packet-cms-fn.c ---*/
@@ -330,6 +330,8 @@
   return dissect_cms_T_eContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_eContentType);
 }
 
+static int
+dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_);
 
 static int
 dissect_cms_T_eContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
@@ -342,7 +344,7 @@
   offset = dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent);
 
   pdu_offset = get_ber_identifier(tvb, pdu_offset, &class, &pc, &tag);
-  pdu_offset = get_ber_length(tvb, pdu_offset, &len, &ind);
+  pdu_offset = get_ber_length(tree, tvb, pdu_offset, &len, &ind);
   pdu_offset = call_ber_oid_callback(object_identifier_id, tvb, pdu_offset, pinfo, tree);
 
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-cops.c
+++ ethereal-0.10.10/epan/dissectors/packet-cops.c
@@ -1308,7 +1308,7 @@
   if (!variable->type)
     variable->type=mib_to_asn_type(subtree->type);
 
-  if (!sprint_realloc_by_type(&buf, &buf_len, &out_len, TRUE, variable, subtree->enums, subtree->hint, NULL))
+  if (!sprint_realloc_by_type(&buf, &buf_len, &out_len, FALSE, variable, subtree->enums, subtree->hint, NULL))
     sprintf(buf,"%s","sprint_realloc_by_type failed");
 
   return buf;
@@ -1342,6 +1342,7 @@
 
   subid_t *vb_oid;
   guint vb_oid_length;
+  proto_item *vb_pi;
 
   gchar *vb_display_string;
   gchar *vb_display_string2;
@@ -1485,16 +1486,12 @@
              * We stopped, due to a non-printable character, before we got
              * to the end of the string.
              */
-            vb_display_string = g_malloc(4*vb_length);
-            buf = &vb_display_string[0];
-            len = sprintf(buf, "%03u", vb_octet_string[0]);
-            buf += len;
+            vb_pi = proto_tree_add_text(tree, tvb, offset, length,
+                                "Value: %s: ", vb_type_name);
+            proto_item_append_text(vb_pi, "%03u", vb_octet_string[0]);
             for (i = 1; i < vb_length; i++) {
-              len = sprintf(buf, ".%03u", vb_octet_string[i]);
-              buf += len;
+              proto_item_append_text(vb_pi, ".%03u", vb_octet_string[0]);
             }
-            proto_tree_add_text(tree, asn1.tvb, offset, length,
-                                "Value: %s: %s", vb_type_name, vb_display_string);
             g_free(vb_display_string);
           } else {
             proto_tree_add_text(tree, asn1.tvb, offset, length,
--- ethereal-0.10.10.orig/epan/dissectors/packet-crmf.c
+++ ethereal-0.10.10/epan/dissectors/packet-crmf.c
@@ -153,7 +153,7 @@
 /*--- End of included file: packet-crmf-ett.c ---*/
 
 
-static char object_identifier_id[64]; /*64 chars should be long enough? */
+static char object_identifier_id[BER_MAX_OID_STR_LEN];
 
 
 /*--- Included file: packet-crmf-fn.c ---*/
--- ethereal-0.10.10.orig/epan/dissectors/packet-dcerpc-atsvc.c
+++ ethereal-0.10.10/epan/dissectors/packet-dcerpc-atsvc.c
@@ -1,8 +1,14 @@
+/* DO NOT EDIT
+ * This dissector is autogenerated
+ */
+
 /* packet-dcerpc-atsvc.c
- * Routines for SMB \pipe\atsvc packet disassembly
- * Copyright 2003 Jean-Baptiste Marchand <jbm@hsc.fr>
+ * Routines for ATSVC packet disassembly
+ * based on the original dissector that was
+ *      * Copyright 2003 Jean-Baptiste Marchand <jbm@hsc.fr>
+ * and IDL file from samba 4
  *
- * $Id: packet-dcerpc-atsvc.c 11592 2004-08-03 02:28:49Z guy $
+ * $Id: packet-dcerpc-atsvc.c 13808 2005-03-19 14:30:05Z sahlberg $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -23,660 +29,1615 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
 #include <glib.h>
+#include <string.h>
+
 #include <epan/packet.h>
 #include "packet-dcerpc.h"
 #include "packet-dcerpc-nt.h"
-#include "packet-dcerpc-atsvc.h"
 #include "packet-windows-common.h"
+#include "packet-dcerpc-atsvc.h"
 
+static int proto_atsvc = -1;
 
-static int proto_dcerpc_atsvc = -1;
 
-static int hf_atsvc_server = -1;
-static int hf_atsvc_command = -1;
+/* INCLUDED FILE : ETH_HF */
+static int hf_atsvc_job_time = -1;
+static int hf_atsvc_job_id = -1;
 static int hf_atsvc_opnum = -1;
 static int hf_atsvc_rc = -1;
-static int hf_atsvc_job_id = -1;
-static int hf_atsvc_job_time = -1;
-static int hf_atsvc_job_days_of_month = -1;
-static int hf_atsvc_job_days_of_week = -1;
-static int hf_atsvc_job_flags = -1;
-static int hf_atsvc_min_job_id = -1;
-static int hf_atsvc_max_job_id = -1;
-static int hf_atsvc_job_flags_noninteractive = -1;
-static int hf_atsvc_job_flags_add_current_date = -1;
-static int hf_atsvc_job_flags_runs_today = -1;
-static int hf_atsvc_job_flags_exec_error = -1;
-static int hf_atsvc_job_flags_run_periodically = -1;
-static int hf_atsvc_job_enum_hnd = -1;
-static int hf_atsvc_jobs_count = -1;
-static int hf_atsvc_enum_handle = -1;
-static int hf_atsvc_pref_max = -1;
-static int hf_atsvc_num_entries = -1;
-static int hf_atsvc_total_entries = -1;
-
-static gint ett_dcerpc_atsvc = -1;
-static gint ett_dcerpc_atsvc_job = -1;
-static gint ett_dcerpc_atsvc_job_flags = -1;
-
-
-/* 
-IDL [ uuid(1ff70682-0a51-30e8-076d-740be8cee98b),
-IDL  version(1.0),
-IDL  implicit_handle(handle_t rpc_binding)
-IDL ] interface atsvc
-*/
+static int hf_atsvc_DaysOfMonth_First = -1;
+static int hf_atsvc_DaysOfMonth_Second = -1;
+static int hf_atsvc_DaysOfMonth_Third = -1;
+static int hf_atsvc_DaysOfMonth_Fourth = -1;
+static int hf_atsvc_DaysOfMonth_Fifth = -1;
+static int hf_atsvc_DaysOfMonth_Sixth = -1;
+static int hf_atsvc_DaysOfMonth_Seventh = -1;
+static int hf_atsvc_DaysOfMonth_Eight = -1;
+static int hf_atsvc_DaysOfMonth_Ninth = -1;
+static int hf_atsvc_DaysOfMonth_Tenth = -1;
+static int hf_atsvc_DaysOfMonth_Eleventh = -1;
+static int hf_atsvc_DaysOfMonth_Twelfth = -1;
+static int hf_atsvc_DaysOfMonth_Thitteenth = -1;
+static int hf_atsvc_DaysOfMonth_Fourteenth = -1;
+static int hf_atsvc_DaysOfMonth_Fifteenth = -1;
+static int hf_atsvc_DaysOfMonth_Sixteenth = -1;
+static int hf_atsvc_DaysOfMonth_Seventeenth = -1;
+static int hf_atsvc_DaysOfMonth_Eighteenth = -1;
+static int hf_atsvc_DaysOfMonth_Ninteenth = -1;
+static int hf_atsvc_DaysOfMonth_Twentyth = -1;
+static int hf_atsvc_DaysOfMonth_Twentyfirst = -1;
+static int hf_atsvc_DaysOfMonth_Twentysecond = -1;
+static int hf_atsvc_DaysOfMonth_Twentythird = -1;
+static int hf_atsvc_DaysOfMonth_Twentyfourth = -1;
+static int hf_atsvc_DaysOfMonth_Twentyfifth = -1;
+static int hf_atsvc_DaysOfMonth_Twentysixth = -1;
+static int hf_atsvc_DaysOfMonth_Twentyseventh = -1;
+static int hf_atsvc_DaysOfMonth_Twentyeighth = -1;
+static int hf_atsvc_DaysOfMonth_Twentyninth = -1;
+static int hf_atsvc_DaysOfMonth_Thirtieth = -1;
+static int hf_atsvc_DaysOfMonth_Thirtyfirst = -1;
+static int hf_atsvc_DaysOfWeek_Monday = -1;
+static int hf_atsvc_DaysOfWeek_Tuesday = -1;
+static int hf_atsvc_DaysOfWeek_Wednesday = -1;
+static int hf_atsvc_DaysOfWeek_Thursday = -1;
+static int hf_atsvc_DaysOfWeek_Friday = -1;
+static int hf_atsvc_DaysOfWeek_Saturday = -1;
+static int hf_atsvc_DaysOfWeek_Sunday = -1;
+static int hf_atsvc_Flags_JOB_RUN_PERIODICALLY = -1;
+static int hf_atsvc_Flags_JOB_EXEC_ERROR = -1;
+static int hf_atsvc_Flags_JOB_RUNS_TODAY = -1;
+static int hf_atsvc_Flags_JOB_ADD_CURRENT_DATE = -1;
+static int hf_atsvc_Flags_JOB_NONINTERACTIVE = -1;
+static int hf_atsvc_JobInfo_days_of_month = -1;
+static int hf_atsvc_JobInfo_days_of_week = -1;
+static int hf_atsvc_JobInfo_flags = -1;
+static int hf_atsvc_JobInfo_command = -1;
+static int hf_atsvc_JobAdd_servername = -1;
+static int hf_atsvc_JobAdd_job_info = -1;
+static int hf_atsvc_JobDel_servername = -1;
+static int hf_atsvc_JobDel_min_job_id = -1;
+static int hf_atsvc_JobDel_max_job_id = -1;
+static int hf_atsvc_JobEnumInfo_days_of_month = -1;
+static int hf_atsvc_JobEnumInfo_days_of_week = -1;
+static int hf_atsvc_JobEnumInfo_flags = -1;
+static int hf_atsvc_JobEnumInfo_command = -1;
+static int hf_atsvc_enum_ctr_entries_read = -1;
+static int hf_atsvc_enum_ctr_first_entry = -1;
+static int hf_atsvc_JobEnum_servername = -1;
+static int hf_atsvc_JobEnum_ctr = -1;
+static int hf_atsvc_JobEnum_preferred_max_len = -1;
+static int hf_atsvc_JobEnum_total_entries = -1;
+static int hf_atsvc_JobEnum_resume_handle = -1;
+static int hf_atsvc_JobGetInfo_servername = -1;
+static int hf_atsvc_JobGetInfo_job_info = -1;
+/* END OF INCLUDED FILE : ETH_HF */
 
 
-static e_uuid_t uuid_dcerpc_atsvc = {
-	0x1ff70682, 0x0a51, 0x30e8,
-	{ 0x07, 0x6d, 0x74, 0x0b, 0xe8, 0xce, 0xe9, 0x8b }
-};
 
-static guint16 ver_dcerpc_atsvc = 1; 
 
 
-/*
- IDL typedef struct {
- IDL   long JobTime;
- IDL   long DaysOfMonth;
- IDL   char DaysOfWeek;
- IDL   char Flags;
- IDL   [unique] [string] wchar_t *Command;
- IDL } AT_INFO;
- */
+/* INCLUDED FILE : ETH_ETT */
+static gint ett_atsvc = -1;
+static gint ett_atsvc_DaysOfMonth = -1;
+static gint ett_atsvc_DaysOfWeek = -1;
+static gint ett_atsvc_Flags = -1;
+static gint ett_atsvc_JobInfo = -1;
+static gint ett_atsvc_JobEnumInfo = -1;
+static gint ett_atsvc_enum_ctr = -1;
+/* END OF INCLUDED FILE : ETH_ETT */
 
-static int
-atsvc_dissect_AT_INFO_fields(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+
+
+int
+atsvc_dissect_JobTime(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
 {
-	proto_item *item = NULL;
-	proto_tree *flags_tree = NULL;
 	guint32 job_time;
-	guint8 job_flags;
 	guint8 job_hour, job_min, job_sec;
 	guint16 job_msec;
-	dcerpc_info *di = (dcerpc_info *) pinfo->private_data;
 
 	offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
-			0, &job_time);
+			-1, &job_time);
 
 	job_hour = job_time / 3600000;
 	job_min = (job_time - job_hour * 3600000) / 60000;
 	job_sec = (job_time - (job_hour * 3600000) - (job_min * 60000)) / 1000;
 	job_msec = (job_time - (job_hour * 3600000) - (job_min * 60000) - (job_sec * 1000));
 
-	proto_tree_add_uint_format(tree, hf_atsvc_job_time, tvb, offset - 4,
+	proto_tree_add_uint_format(tree, hf_index, tvb, offset - 4,
 			4, job_time, "Time: %02d:%02d:%02d:%03d", job_hour, job_min, job_sec, job_msec);
 
-	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
-			hf_atsvc_job_days_of_month, NULL);
+	return offset;
+}
 
-	offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep,
-			hf_atsvc_job_days_of_week, NULL);
 
-	offset = dissect_ndr_uint8(tvb, offset, pinfo, NULL, drep,
-			0, &job_flags);
 
-	item = proto_tree_add_text(tree, tvb, offset-1, 1, "Flags: 0x%02x", job_flags);
-	flags_tree = proto_item_add_subtree(item, ett_dcerpc_atsvc_job_flags);
-
-	if (flags_tree) {
-
-#define JOB_RUN_PERIODICALLY 0x01
-#define JOB_EXEC_ERROR 0x02
-#define JOB_RUNS_TODAY 0x04
-#define JOB_ADD_CURRENT_DATE 0x08
-#define JOB_NONINTERACTIVE 0x10
-
-		if (di->call_data->opnum == ATSVC_JOB_ADD) { 
-
-			if (job_flags & JOB_RUN_PERIODICALLY) {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_run_periodically,
-						tvb, offset-1, 1, job_flags);
-			}
-			else {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_run_periodically,
-						tvb, offset-1, 1, 0);
-			}
-
-
-			if (job_flags & JOB_ADD_CURRENT_DATE) {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_add_current_date,
-						tvb, offset-1, 1, job_flags);
-			}
-			else {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_add_current_date,
-						tvb, offset-1, 1, 0);
-			}
-
-
-			if (job_flags & JOB_NONINTERACTIVE) {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_noninteractive,
-						tvb, offset-1, 1, job_flags);
-			}
-			else {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_noninteractive,
-						tvb, offset-1, 1, job_flags);
-			}
-
-		}
-
-		if ((di->call_data->opnum == ATSVC_JOB_GETINFO) 
-				|| (di->call_data->opnum == ATSVC_JOB_ENUM)) {
-
-
-			if (job_flags & JOB_RUN_PERIODICALLY) {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_run_periodically,
-						tvb, offset-1, 1, job_flags);
-			}
-			else {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_run_periodically,
-						tvb, offset-1, 1, 0);
-			}
-
-
-			if (job_flags & JOB_EXEC_ERROR) {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_exec_error,
-						tvb, offset-1, 1, job_flags);
-			}
-			else {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_exec_error,
-						tvb, offset-1, 1, 0);
-			}
-
-
-			if (job_flags & JOB_RUNS_TODAY) {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_runs_today,
-						tvb, offset-1, 1, job_flags);
-			}
-			else {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_runs_today,
-						tvb, offset-1, 1, 0);
-			}
-
-			if (job_flags & JOB_NONINTERACTIVE) {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_noninteractive,
-						tvb, offset-1, 1, job_flags);
-			}
-			else {
-				proto_tree_add_boolean(flags_tree, hf_atsvc_job_flags_noninteractive,
-						tvb, offset-1, 1, job_flags);
-			}
+/* INCLUDED FILE : ETH_CODE */
+static e_uuid_t uuid_dcerpc_atsvc = {
+    0x1ff70682, 0x0a51, 0x30e8,
+    { 0x07, 0x6d, 0x74, 0x0b, 0xe8, 0xce, 0xe9, 0x8b}
+};
 
-		}
+static guint16 ver_atsvc = 1;
 
-	}
+static const true_false_string First_tfs = {
+    "First is SET",
+    "First is NOT set"
+};
 
-	offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
-			NDR_POINTER_UNIQUE, "Command", hf_atsvc_command, 0);
+static const true_false_string Second_tfs = {
+    "Second is SET",
+    "Second is NOT set"
+};
 
-	return offset;
+static const true_false_string Third_tfs = {
+    "Third is SET",
+    "Third is NOT set"
+};
+
+static const true_false_string Fourth_tfs = {
+    "Fourth is SET",
+    "Fourth is NOT set"
+};
+
+static const true_false_string Fifth_tfs = {
+    "Fifth is SET",
+    "Fifth is NOT set"
+};
+
+static const true_false_string Sixth_tfs = {
+    "Sixth is SET",
+    "Sixth is NOT set"
+};
+
+static const true_false_string Seventh_tfs = {
+    "Seventh is SET",
+    "Seventh is NOT set"
+};
+
+static const true_false_string Eight_tfs = {
+    "Eight is SET",
+    "Eight is NOT set"
+};
+
+static const true_false_string Ninth_tfs = {
+    "Ninth is SET",
+    "Ninth is NOT set"
+};
+
+static const true_false_string Tenth_tfs = {
+    "Tenth is SET",
+    "Tenth is NOT set"
+};
+
+static const true_false_string Eleventh_tfs = {
+    "Eleventh is SET",
+    "Eleventh is NOT set"
+};
+
+static const true_false_string Twelfth_tfs = {
+    "Twelfth is SET",
+    "Twelfth is NOT set"
+};
+
+static const true_false_string Thitteenth_tfs = {
+    "Thitteenth is SET",
+    "Thitteenth is NOT set"
+};
+
+static const true_false_string Fourteenth_tfs = {
+    "Fourteenth is SET",
+    "Fourteenth is NOT set"
+};
+
+static const true_false_string Fifteenth_tfs = {
+    "Fifteenth is SET",
+    "Fifteenth is NOT set"
+};
+
+static const true_false_string Sixteenth_tfs = {
+    "Sixteenth is SET",
+    "Sixteenth is NOT set"
+};
+
+static const true_false_string Seventeenth_tfs = {
+    "Seventeenth is SET",
+    "Seventeenth is NOT set"
+};
+
+static const true_false_string Eighteenth_tfs = {
+    "Eighteenth is SET",
+    "Eighteenth is NOT set"
+};
+
+static const true_false_string Ninteenth_tfs = {
+    "Ninteenth is SET",
+    "Ninteenth is NOT set"
+};
+
+static const true_false_string Twentyth_tfs = {
+    "Twentyth is SET",
+    "Twentyth is NOT set"
+};
+
+static const true_false_string Twentyfirst_tfs = {
+    "Twentyfirst is SET",
+    "Twentyfirst is NOT set"
+};
+
+static const true_false_string Twentysecond_tfs = {
+    "Twentysecond is SET",
+    "Twentysecond is NOT set"
+};
+
+static const true_false_string Twentythird_tfs = {
+    "Twentythird is SET",
+    "Twentythird is NOT set"
+};
+
+static const true_false_string Twentyfourth_tfs = {
+    "Twentyfourth is SET",
+    "Twentyfourth is NOT set"
+};
+
+static const true_false_string Twentyfifth_tfs = {
+    "Twentyfifth is SET",
+    "Twentyfifth is NOT set"
+};
+
+static const true_false_string Twentysixth_tfs = {
+    "Twentysixth is SET",
+    "Twentysixth is NOT set"
+};
+
+static const true_false_string Twentyseventh_tfs = {
+    "Twentyseventh is SET",
+    "Twentyseventh is NOT set"
+};
+
+static const true_false_string Twentyeighth_tfs = {
+    "Twentyeighth is SET",
+    "Twentyeighth is NOT set"
+};
+
+static const true_false_string Twentyninth_tfs = {
+    "Twentyninth is SET",
+    "Twentyninth is NOT set"
+};
+
+static const true_false_string Thirtieth_tfs = {
+    "Thirtieth is SET",
+    "Thirtieth is NOT set"
+};
+
+static const true_false_string Thirtyfirst_tfs = {
+    "Thirtyfirst is SET",
+    "Thirtyfirst is NOT set"
+};
+
+
+int
+atsvc_dissect_DaysOfMonth(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
+{
+    proto_item *item=NULL;
+    proto_tree *tree=NULL;
+    guint32 flags;
+
+    ALIGN_TO_4_BYTES;
+
+    if(parent_tree){
+        item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, 4, TRUE);
+        tree=proto_item_add_subtree(item, ett_atsvc_DaysOfMonth);
+    }
+
+    offset=dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &flags);
+
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_First, tvb, offset-4, 4, flags);
+    if(flags&0x00000001){
+        proto_item_append_text(item, " First");
+    }
+    flags&=(~0x00000001);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Second, tvb, offset-4, 4, flags);
+    if(flags&0x00000002){
+        proto_item_append_text(item, " Second");
+    }
+    flags&=(~0x00000002);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Third, tvb, offset-4, 4, flags);
+    if(flags&0x00000004){
+        proto_item_append_text(item, " Third");
+    }
+    flags&=(~0x00000004);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Fourth, tvb, offset-4, 4, flags);
+    if(flags&0x00000008){
+        proto_item_append_text(item, " Fourth");
+    }
+    flags&=(~0x00000008);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Fifth, tvb, offset-4, 4, flags);
+    if(flags&0x00000010){
+        proto_item_append_text(item, " Fifth");
+    }
+    flags&=(~0x00000010);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Sixth, tvb, offset-4, 4, flags);
+    if(flags&0x00000020){
+        proto_item_append_text(item, " Sixth");
+    }
+    flags&=(~0x00000020);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Seventh, tvb, offset-4, 4, flags);
+    if(flags&0x00000040){
+        proto_item_append_text(item, " Seventh");
+    }
+    flags&=(~0x00000040);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Eight, tvb, offset-4, 4, flags);
+    if(flags&0x00000080){
+        proto_item_append_text(item, " Eight");
+    }
+    flags&=(~0x00000080);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Ninth, tvb, offset-4, 4, flags);
+    if(flags&0x00000100){
+        proto_item_append_text(item, " Ninth");
+    }
+    flags&=(~0x00000100);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Tenth, tvb, offset-4, 4, flags);
+    if(flags&0x00000200){
+        proto_item_append_text(item, " Tenth");
+    }
+    flags&=(~0x00000200);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Eleventh, tvb, offset-4, 4, flags);
+    if(flags&0x00000400){
+        proto_item_append_text(item, " Eleventh");
+    }
+    flags&=(~0x00000400);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twelfth, tvb, offset-4, 4, flags);
+    if(flags&0x00000800){
+        proto_item_append_text(item, " Twelfth");
+    }
+    flags&=(~0x00000800);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Thitteenth, tvb, offset-4, 4, flags);
+    if(flags&0x00001000){
+        proto_item_append_text(item, " Thitteenth");
+    }
+    flags&=(~0x00001000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Fourteenth, tvb, offset-4, 4, flags);
+    if(flags&0x00002000){
+        proto_item_append_text(item, " Fourteenth");
+    }
+    flags&=(~0x00002000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Fifteenth, tvb, offset-4, 4, flags);
+    if(flags&0x00004000){
+        proto_item_append_text(item, " Fifteenth");
+    }
+    flags&=(~0x00004000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Sixteenth, tvb, offset-4, 4, flags);
+    if(flags&0x00008000){
+        proto_item_append_text(item, " Sixteenth");
+    }
+    flags&=(~0x00008000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Seventeenth, tvb, offset-4, 4, flags);
+    if(flags&0x00010000){
+        proto_item_append_text(item, " Seventeenth");
+    }
+    flags&=(~0x00010000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Eighteenth, tvb, offset-4, 4, flags);
+    if(flags&0x00020000){
+        proto_item_append_text(item, " Eighteenth");
+    }
+    flags&=(~0x00020000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Ninteenth, tvb, offset-4, 4, flags);
+    if(flags&0x00040000){
+        proto_item_append_text(item, " Ninteenth");
+    }
+    flags&=(~0x00040000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twentyth, tvb, offset-4, 4, flags);
+    if(flags&0x00080000){
+        proto_item_append_text(item, " Twentyth");
+    }
+    flags&=(~0x00080000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twentyfirst, tvb, offset-4, 4, flags);
+    if(flags&0x00100000){
+        proto_item_append_text(item, " Twentyfirst");
+    }
+    flags&=(~0x00100000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twentysecond, tvb, offset-4, 4, flags);
+    if(flags&0x00200000){
+        proto_item_append_text(item, " Twentysecond");
+    }
+    flags&=(~0x00200000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twentythird, tvb, offset-4, 4, flags);
+    if(flags&0x00400000){
+        proto_item_append_text(item, " Twentythird");
+    }
+    flags&=(~0x00400000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twentyfourth, tvb, offset-4, 4, flags);
+    if(flags&0x00800000){
+        proto_item_append_text(item, " Twentyfourth");
+    }
+    flags&=(~0x00800000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twentyfifth, tvb, offset-4, 4, flags);
+    if(flags&0x01000000){
+        proto_item_append_text(item, " Twentyfifth");
+    }
+    flags&=(~0x01000000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twentysixth, tvb, offset-4, 4, flags);
+    if(flags&0x02000000){
+        proto_item_append_text(item, " Twentysixth");
+    }
+    flags&=(~0x02000000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twentyseventh, tvb, offset-4, 4, flags);
+    if(flags&0x04000000){
+        proto_item_append_text(item, " Twentyseventh");
+    }
+    flags&=(~0x04000000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twentyeighth, tvb, offset-4, 4, flags);
+    if(flags&0x08000000){
+        proto_item_append_text(item, " Twentyeighth");
+    }
+    flags&=(~0x08000000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Twentyninth, tvb, offset-4, 4, flags);
+    if(flags&0x10000000){
+        proto_item_append_text(item, " Twentyninth");
+    }
+    flags&=(~0x10000000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Thirtieth, tvb, offset-4, 4, flags);
+    if(flags&0x20000000){
+        proto_item_append_text(item, " Thirtieth");
+    }
+    flags&=(~0x20000000);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfMonth_Thirtyfirst, tvb, offset-4, 4, flags);
+    if(flags&0x40000000){
+        proto_item_append_text(item, " Thirtyfirst");
+    }
+    flags&=(~0x40000000);
+
+    if(flags){
+        proto_item_append_text(item, "UNKNOWN-FLAGS");
+    }
+
+    return offset;
 }
+static const true_false_string Monday_tfs = {
+    "Monday is SET",
+    "Monday is NOT set"
+};
+
+static const true_false_string Tuesday_tfs = {
+    "Tuesday is SET",
+    "Tuesday is NOT set"
+};
+
+static const true_false_string Wednesday_tfs = {
+    "Wednesday is SET",
+    "Wednesday is NOT set"
+};
+
+static const true_false_string Thursday_tfs = {
+    "Thursday is SET",
+    "Thursday is NOT set"
+};
+
+static const true_false_string Friday_tfs = {
+    "Friday is SET",
+    "Friday is NOT set"
+};
+
+static const true_false_string Saturday_tfs = {
+    "Saturday is SET",
+    "Saturday is NOT set"
+};
+
+static const true_false_string Sunday_tfs = {
+    "Sunday is SET",
+    "Sunday is NOT set"
+};
+
+
+int
+atsvc_dissect_DaysOfWeek(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
+{
+    proto_item *item=NULL;
+    proto_tree *tree=NULL;
+    guint8 flags;
+
+
+    if(parent_tree){
+        item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, 1, TRUE);
+        tree=proto_item_add_subtree(item, ett_atsvc_DaysOfWeek);
+    }
+
+    offset=dissect_ndr_uint8(tvb, offset, pinfo, NULL, drep, -1, &flags);
+
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfWeek_Monday, tvb, offset-1, 1, flags);
+    if(flags&0x01){
+        proto_item_append_text(item, " Monday");
+    }
+    flags&=(~0x01);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfWeek_Tuesday, tvb, offset-1, 1, flags);
+    if(flags&0x02){
+        proto_item_append_text(item, " Tuesday");
+    }
+    flags&=(~0x02);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfWeek_Wednesday, tvb, offset-1, 1, flags);
+    if(flags&0x04){
+        proto_item_append_text(item, " Wednesday");
+    }
+    flags&=(~0x04);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfWeek_Thursday, tvb, offset-1, 1, flags);
+    if(flags&0x08){
+        proto_item_append_text(item, " Thursday");
+    }
+    flags&=(~0x08);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfWeek_Friday, tvb, offset-1, 1, flags);
+    if(flags&0x10){
+        proto_item_append_text(item, " Friday");
+    }
+    flags&=(~0x10);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfWeek_Saturday, tvb, offset-1, 1, flags);
+    if(flags&0x20){
+        proto_item_append_text(item, " Saturday");
+    }
+    flags&=(~0x20);
+
+    proto_tree_add_boolean(tree, hf_atsvc_DaysOfWeek_Sunday, tvb, offset-1, 1, flags);
+    if(flags&0x40){
+        proto_item_append_text(item, " Sunday");
+    }
+    flags&=(~0x40);
+
+    if(flags){
+        proto_item_append_text(item, "UNKNOWN-FLAGS");
+    }
+
+    return offset;
+}
+static const true_false_string JOB_RUN_PERIODICALLY_tfs = {
+    "JOB_RUN_PERIODICALLY is SET",
+    "JOB_RUN_PERIODICALLY is NOT set"
+};
 
+static const true_false_string JOB_EXEC_ERROR_tfs = {
+    "JOB_EXEC_ERROR is SET",
+    "JOB_EXEC_ERROR is NOT set"
+};
+
+static const true_false_string JOB_RUNS_TODAY_tfs = {
+    "JOB_RUNS_TODAY is SET",
+    "JOB_RUNS_TODAY is NOT set"
+};
+
+static const true_false_string JOB_ADD_CURRENT_DATE_tfs = {
+    "JOB_ADD_CURRENT_DATE is SET",
+    "JOB_ADD_CURRENT_DATE is NOT set"
+};
+
+static const true_false_string JOB_NONINTERACTIVE_tfs = {
+    "JOB_NONINTERACTIVE is SET",
+    "JOB_NONINTERACTIVE is NOT set"
+};
+
+
+int
+atsvc_dissect_Flags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
+{
+    proto_item *item=NULL;
+    proto_tree *tree=NULL;
+    guint8 flags;
+
+
+    if(parent_tree){
+        item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, 1, TRUE);
+        tree=proto_item_add_subtree(item, ett_atsvc_Flags);
+    }
+
+    offset=dissect_ndr_uint8(tvb, offset, pinfo, NULL, drep, -1, &flags);
+
+
+    proto_tree_add_boolean(tree, hf_atsvc_Flags_JOB_RUN_PERIODICALLY, tvb, offset-1, 1, flags);
+    if(flags&0x01){
+        proto_item_append_text(item, " JOB_RUN_PERIODICALLY");
+    }
+    flags&=(~0x01);
+
+    proto_tree_add_boolean(tree, hf_atsvc_Flags_JOB_EXEC_ERROR, tvb, offset-1, 1, flags);
+    if(flags&0x02){
+        proto_item_append_text(item, " JOB_EXEC_ERROR");
+    }
+    flags&=(~0x02);
+
+    proto_tree_add_boolean(tree, hf_atsvc_Flags_JOB_RUNS_TODAY, tvb, offset-1, 1, flags);
+    if(flags&0x04){
+        proto_item_append_text(item, " JOB_RUNS_TODAY");
+    }
+    flags&=(~0x04);
+
+    proto_tree_add_boolean(tree, hf_atsvc_Flags_JOB_ADD_CURRENT_DATE, tvb, offset-1, 1, flags);
+    if(flags&0x08){
+        proto_item_append_text(item, " JOB_ADD_CURRENT_DATE");
+    }
+    flags&=(~0x08);
+
+    proto_tree_add_boolean(tree, hf_atsvc_Flags_JOB_NONINTERACTIVE, tvb, offset-1, 1, flags);
+    if(flags&0x10){
+        proto_item_append_text(item, " JOB_NONINTERACTIVE");
+    }
+    flags&=(~0x10);
+
+    if(flags){
+        proto_item_append_text(item, "UNKNOWN-FLAGS");
+    }
+
+    return offset;
+}
 static int
-atsvc_dissect_AT_INFO(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+atsvc_dissect_JobInfo_job_time(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
-	proto_item *item = NULL;
-	proto_tree *subtree = NULL;
+    guint32 param=0;
+    offset=atsvc_dissect_JobTime(tvb, offset, pinfo, tree, drep, hf_atsvc_job_time, param);
+    return offset;
+}
 
-	if (tree) {
-		item = proto_tree_add_text(tree, tvb, offset, -1, "Job");
-		subtree = proto_item_add_subtree(item, ett_dcerpc_atsvc_job);
-	}
+static int
+atsvc_dissect_JobInfo_days_of_month(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_DaysOfMonth(tvb, offset, pinfo, tree, drep, hf_atsvc_JobInfo_days_of_month, param);
+    return offset;
+}
 
-	offset = atsvc_dissect_AT_INFO_fields(tvb, offset, pinfo, subtree, drep);
+static int
+atsvc_dissect_JobInfo_days_of_week(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_DaysOfWeek(tvb, offset, pinfo, tree, drep, hf_atsvc_JobInfo_days_of_week, param);
+    return offset;
+}
 
-	return offset;
+static int
+atsvc_dissect_JobInfo_flags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_Flags(tvb, offset, pinfo, tree, drep, hf_atsvc_JobInfo_flags, param);
+    return offset;
 }
 
 
+static int
+atsvc_dissect_unistr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
+{
+    offset=dissect_ndr_cvstring(tvb, offset, pinfo, tree, drep, 2, hf_index, FALSE, NULL);
+    return offset;
+}
 
-/*
- IDL long NetrJobAdd(
- IDL       [in] [unique] [string] wchar_t *Servername,
- IDL       [in] [ref] AT_INFO *element_22,
- IDL      [out] [ref] long *JobId
- IDL );
- */
+static int
+atsvc_dissect_JobInfo_command(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_atsvc_JobInfo_command, param);
+    return offset;
+}
 
 static int
-atsvc_dissect_add_rqst(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+unique_atsvc_dissect_JobInfo_command(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, atsvc_dissect_JobInfo_command, NDR_POINTER_UNIQUE, "command", -1);
+    return offset;
+}
+
+
+int
+atsvc_dissect_JobInfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
 {
-        offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
-			NDR_POINTER_UNIQUE, "Server", hf_atsvc_server, 0);
+    proto_item *item=NULL;
+    proto_tree *tree=NULL;
+    int old_offset;
 
-	offset = atsvc_dissect_AT_INFO(tvb, offset, pinfo, tree, drep);
+    ALIGN_TO_4_BYTES;
 
-	return offset;
+    old_offset=offset;
+    if(parent_tree){
+        item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
+        tree=proto_item_add_subtree(item, ett_atsvc_JobInfo);
+    }
+
+    offset=atsvc_dissect_JobInfo_job_time(tvb, offset, pinfo, tree, drep);
+
+    offset=atsvc_dissect_JobInfo_days_of_month(tvb, offset, pinfo, tree, drep);
+
+    offset=atsvc_dissect_JobInfo_days_of_week(tvb, offset, pinfo, tree, drep);
+
+    offset=atsvc_dissect_JobInfo_flags(tvb, offset, pinfo, tree, drep);
+
+    offset=unique_atsvc_dissect_JobInfo_command(tvb, offset, pinfo, tree, drep);
+
+    proto_item_set_len(item, offset-old_offset);
+
+    return offset;
+}
+static int
+atsvc_dissect_JobAdd_servername(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_atsvc_JobAdd_servername, param);
+    return offset;
+}
+
+static int
+unique_atsvc_dissect_JobAdd_servername(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, atsvc_dissect_JobAdd_servername, NDR_POINTER_UNIQUE, "servername", -1);
+    return offset;
 }
 
 static int
-atsvc_dissect_add_reply(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+atsvc_dissect_JobAdd_job_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
-	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
-			hf_atsvc_job_id, NULL);
-	
-	offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, 
-			hf_atsvc_rc, NULL);
+    guint32 param=0;
+    offset=atsvc_dissect_JobInfo(tvb, offset, pinfo, tree, drep, hf_atsvc_JobAdd_job_info, param);
+    return offset;
+}
 
-	return offset;
+static int
+ref_atsvc_dissect_JobAdd_job_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, atsvc_dissect_JobAdd_job_info, NDR_POINTER_REF, "job_info", -1);
+    return offset;
 }
 
 
-/*
- IDL long NetrJobDel(
- IDL       [in] [unique] [string] wchar_t *Servername,
- IDL       [in] long MinJobId,
- IDL       [in] long MaxJobId,
- IDL );
- */
+static int
+atsvc_dissect_uint32(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param _U_)
+{
+    offset=dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_index, NULL);
+    return offset;
+}
 
 static int
-atsvc_dissect_del_rqst(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+atsvc_dissect_JobAdd_job_id(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
-        offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
-			NDR_POINTER_UNIQUE, "Server", hf_atsvc_server, 0);
+    guint32 param=0;
+    offset=atsvc_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_atsvc_job_id, param);
+    return offset;
+}
 
-	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
-			hf_atsvc_min_job_id, NULL);
 
-	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
-			hf_atsvc_max_job_id, NULL);
+static int
+atsvc_dissect_JobAdd_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
+{
+        offset=unique_atsvc_dissect_JobAdd_servername(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
 
-	return offset;
+        offset=ref_atsvc_dissect_JobAdd_job_info(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+
+   return offset;
 }
 
 static int
-atsvc_dissect_del_reply(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+atsvc_dissect_JobAdd_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
 {
-	offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, 
-			hf_atsvc_rc, NULL);
-	return offset;
+        offset=atsvc_dissect_JobAdd_job_id(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+   offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_atsvc_rc, NULL);
+
+
+   return offset;
+}
+static int
+atsvc_dissect_JobDel_servername(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_atsvc_JobDel_servername, param);
+    return offset;
 }
 
+static int
+unique_atsvc_dissect_JobDel_servername(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, atsvc_dissect_JobDel_servername, NDR_POINTER_UNIQUE, "servername", -1);
+    return offset;
+}
 
-/*
- IDL typedef struct {
- IDL   long JobId;
- IDL   long JobTime;
- IDL   long DaysOfMonth;
- IDL   char DaysOfWeek;
- IDL   char Flags;
- IDL   [unique] [string] wchar_t *Command;
- IDL } AT_ENUM;
- */
+static int
+atsvc_dissect_JobDel_min_job_id(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_atsvc_JobDel_min_job_id, param);
+    return offset;
+}
 
 static int
-atsvc_dissect_AT_ENUM(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+atsvc_dissect_JobDel_max_job_id(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
-	proto_item *item = NULL;
-	proto_tree *subtree = NULL;
-	guint32 job_id;
+    guint32 param=0;
+    offset=atsvc_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_atsvc_JobDel_max_job_id, param);
+    return offset;
+}
 
-	offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
-			0, &job_id);
 
-	if (tree) {
-		item = proto_tree_add_text(tree, tvb, offset, -1, "Job %d", job_id);
-		subtree = proto_item_add_subtree(item, ett_dcerpc_atsvc_job);
-	}
+static int
+atsvc_dissect_JobDel_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
+{
+        offset=unique_atsvc_dissect_JobDel_servername(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
 
-	proto_tree_add_uint_format(subtree, hf_atsvc_job_id, tvb, offset - 4,
-			4, job_id, "Job ID: %d", job_id);
+        offset=atsvc_dissect_JobDel_min_job_id(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
 
-	offset = atsvc_dissect_AT_INFO_fields(tvb, offset, pinfo, subtree, drep);
+        offset=atsvc_dissect_JobDel_max_job_id(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
 
-	return offset;
+
+   return offset;
 }
 
+static int
+atsvc_dissect_JobDel_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
+{
+   offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_atsvc_rc, NULL);
 
+
+   return offset;
+}
 static int
-atsvc_dissect_ENUM_HANDLE(tvbuff_t *tvb, int offset,
-			   packet_info *pinfo, proto_tree *tree,
-			   guint8 *drep)
+atsvc_dissect_JobEnumInfo_job_id(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
-	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
-			      hf_atsvc_enum_handle, 0);
-	return offset;
+    guint32 param=0;
+    offset=atsvc_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_atsvc_job_id, param);
+    return offset;
+}
 
+static int
+atsvc_dissect_JobEnumInfo_job_time(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_JobTime(tvb, offset, pinfo, tree, drep, hf_atsvc_job_time, param);
+    return offset;
 }
 
 static int
-atsvc_dissect_AT_ENUM_array(tvbuff_t *tvb, int offset,
-				     packet_info *pinfo, proto_tree *tree,
-				     guint8 *drep)
+atsvc_dissect_JobEnumInfo_days_of_month(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
-	offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
-			atsvc_dissect_AT_ENUM);
+    guint32 param=0;
+    offset=atsvc_dissect_DaysOfMonth(tvb, offset, pinfo, tree, drep, hf_atsvc_JobEnumInfo_days_of_month, param);
+    return offset;
+}
 
-	return offset;
+static int
+atsvc_dissect_JobEnumInfo_days_of_week(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_DaysOfWeek(tvb, offset, pinfo, tree, drep, hf_atsvc_JobEnumInfo_days_of_week, param);
+    return offset;
 }
 
-/*
- IDL typedef struct {
- IDL   long EntriesRead; 
- IDL   [size_is(EntriesRead)] [unique] AT_ENUM *first_entry;
- IDL } AT_ENUM_CONTAINER;
- */
+static int
+atsvc_dissect_JobEnumInfo_flags(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_Flags(tvb, offset, pinfo, tree, drep, hf_atsvc_JobEnumInfo_flags, param);
+    return offset;
+}
 
 static int
-atsvc_dissect_AT_ENUM_CONTAINER(tvbuff_t *tvb, int offset,
-				     packet_info *pinfo, proto_tree *tree,
-				     guint8 *drep)
-{
-	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
-		hf_atsvc_num_entries, NULL);
-
-	offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
-		atsvc_dissect_AT_ENUM_array, NDR_POINTER_UNIQUE,
-		"AT_ENUM array:", -1);
+atsvc_dissect_JobEnumInfo_command(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_atsvc_JobEnumInfo_command, param);
+    return offset;
+}
 
-	return offset;
+static int
+unique_atsvc_dissect_JobEnumInfo_command(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, atsvc_dissect_JobEnumInfo_command, NDR_POINTER_UNIQUE, "command", -1);
+    return offset;
 }
 
 
-/*
- IDL long NetrJobEnum(
- IDL       [in] [unique] [string] wchar_t *Servername,
- IDL   [in,out] [ref] AT_ENUM_CONTAINER *PointerToBuffer,
- IDL       [in] long PreferredMaximumLength,
- IDL      [out] [ref] long *TotalEntries,
- IDL   [in,out] [unique] long *ResumeHandle
- IDL );
- */
+int
+atsvc_dissect_JobEnumInfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
+{
+    proto_item *item=NULL;
+    proto_tree *tree=NULL;
+    int old_offset;
+
+    ALIGN_TO_4_BYTES;
+
+    old_offset=offset;
+    if(parent_tree){
+        item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
+        tree=proto_item_add_subtree(item, ett_atsvc_JobEnumInfo);
+    }
+
+    offset=atsvc_dissect_JobEnumInfo_job_id(tvb, offset, pinfo, tree, drep);
+
+    offset=atsvc_dissect_JobEnumInfo_job_time(tvb, offset, pinfo, tree, drep);
+
+    offset=atsvc_dissect_JobEnumInfo_days_of_month(tvb, offset, pinfo, tree, drep);
+
+    offset=atsvc_dissect_JobEnumInfo_days_of_week(tvb, offset, pinfo, tree, drep);
+
+    offset=atsvc_dissect_JobEnumInfo_flags(tvb, offset, pinfo, tree, drep);
 
+    offset=unique_atsvc_dissect_JobEnumInfo_command(tvb, offset, pinfo, tree, drep);
+
+    proto_item_set_len(item, offset-old_offset);
+
+    return offset;
+}
 static int
-atsvc_dissect_enum_rqst(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+atsvc_dissect_enum_ctr_entries_read(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
-        offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
-			NDR_POINTER_UNIQUE, "Server", hf_atsvc_server, 0);
+    guint32 param=0;
+    offset=atsvc_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_atsvc_enum_ctr_entries_read, param);
+    return offset;
+}
 
-  	offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
-			atsvc_dissect_AT_ENUM_CONTAINER,
-			NDR_POINTER_REF, "Job list", -1);
-
-	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, 
-			hf_atsvc_pref_max, 0);
-
-	offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, 
-				     atsvc_dissect_ENUM_HANDLE,
-				     NDR_POINTER_UNIQUE, "Enum Handle", -1);
+static int
+atsvc_dissect_enum_ctr_first_entry(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_JobEnumInfo(tvb, offset, pinfo, tree, drep, hf_atsvc_enum_ctr_first_entry, param);
+    return offset;
+}
 
-	return offset;
+static int
+ucarray_atsvc_dissect_enum_ctr_first_entry(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    offset=dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, atsvc_dissect_enum_ctr_first_entry);
+    return offset;
 }
 
 static int
-atsvc_dissect_enum_reply(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+unique_ucarray_atsvc_dissect_enum_ctr_first_entry(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
-  	offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
-			atsvc_dissect_AT_ENUM_CONTAINER,
-			NDR_POINTER_REF, "Job list", -1);
-
-	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
-				    hf_atsvc_total_entries, 0);
-
-	offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, 
-				     atsvc_dissect_ENUM_HANDLE,
-				     NDR_POINTER_UNIQUE, "Enum Handle", -1);
+    offset=dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ucarray_atsvc_dissect_enum_ctr_first_entry, NDR_POINTER_UNIQUE, "first_entry", -1);
+    return offset;
+}
 
-	offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, 
-			hf_atsvc_rc, NULL);
 
-	return offset;
+int
+atsvc_dissect_enum_ctr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)
+{
+    proto_item *item=NULL;
+    proto_tree *tree=NULL;
+    int old_offset;
+
+    ALIGN_TO_4_BYTES;
+
+    old_offset=offset;
+    if(parent_tree){
+        item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
+        tree=proto_item_add_subtree(item, ett_atsvc_enum_ctr);
+    }
+
+    offset=atsvc_dissect_enum_ctr_entries_read(tvb, offset, pinfo, tree, drep);
+
+    offset=unique_ucarray_atsvc_dissect_enum_ctr_first_entry(tvb, offset, pinfo, tree, drep);
+
+    proto_item_set_len(item, offset-old_offset);
+
+    return offset;
+}
+static int
+atsvc_dissect_JobEnum_servername(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_atsvc_JobEnum_servername, param);
+    return offset;
 }
 
+static int
+unique_atsvc_dissect_JobEnum_servername(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, atsvc_dissect_JobEnum_servername, NDR_POINTER_UNIQUE, "servername", -1);
+    return offset;
+}
 
-/*
- IDL long NetrJobGetInfo(
- IDL       [in] [unique] [string] wchar_t *Servername,
- IDL       [in] long JobId,
- IDL      [out] [ref] AT_INFO **PointerToBuffer
- IDL );
- */
+static int
+atsvc_dissect_JobEnum_ctr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_enum_ctr(tvb, offset, pinfo, tree, drep, hf_atsvc_JobEnum_ctr, param);
+    return offset;
+}
 
 static int
-atsvc_dissect_getinfo_rqst(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+ref_atsvc_dissect_JobEnum_ctr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
-        offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
-			NDR_POINTER_UNIQUE, "Server", hf_atsvc_server, 0);
+    offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, atsvc_dissect_JobEnum_ctr, NDR_POINTER_REF, "ctr", -1);
+    return offset;
+}
 
-	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
-			hf_atsvc_job_id, NULL);
+static int
+atsvc_dissect_JobEnum_preferred_max_len(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_atsvc_JobEnum_preferred_max_len, param);
+    return offset;
+}
 
-	return offset;
+static int
+atsvc_dissect_JobEnum_total_entries(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_atsvc_JobEnum_total_entries, param);
+    return offset;
 }
 
 static int
-atsvc_dissect_getinfo_reply(tvbuff_t *tvb, int offset,
-	packet_info *pinfo, proto_tree *tree, guint8 *drep)
+atsvc_dissect_JobEnum_resume_handle(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
-	offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
-			atsvc_dissect_AT_INFO, NDR_POINTER_UNIQUE,
-			"Job info", -1);
+    guint32 param=0;
+    offset=atsvc_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_atsvc_JobEnum_resume_handle, param);
+    return offset;
+}
 
-	offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, 
-			hf_atsvc_rc, NULL);
+static int
+unique_atsvc_dissect_JobEnum_resume_handle(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, atsvc_dissect_JobEnum_resume_handle, NDR_POINTER_UNIQUE, "resume_handle", -1);
+    return offset;
+}
 
-	return offset;
+
+static int
+atsvc_dissect_JobEnum_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
+{
+        offset=unique_atsvc_dissect_JobEnum_servername(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+        offset=ref_atsvc_dissect_JobEnum_ctr(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+        offset=atsvc_dissect_JobEnum_preferred_max_len(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+        offset=unique_atsvc_dissect_JobEnum_resume_handle(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+
+   return offset;
 }
 
-static dcerpc_sub_dissector dcerpc_atsvc_dissectors[] = {
-	{ ATSVC_JOB_ADD, "NetrJobAdd", atsvc_dissect_add_rqst, atsvc_dissect_add_reply },
-	{ ATSVC_JOB_DEL, "NetrJobDel", atsvc_dissect_del_rqst, atsvc_dissect_del_reply },
-	{ ATSVC_JOB_ENUM, "NetrJobEnum", atsvc_dissect_enum_rqst, atsvc_dissect_enum_reply },
-	{ ATSVC_JOB_GETINFO, "NetrJobGetInfo", atsvc_dissect_getinfo_rqst, atsvc_dissect_getinfo_reply },
-        { 0, NULL, NULL,  NULL }
-};
-
-static const value_string atsvc_job_day_of_month[] = {
-	{       0x00, "n/a" },
-	{       0x01, "01" },
-	{       0x02, "02" },
-	{       0x04, "03" },
-	{       0x08, "04" },
-	{       0x10, "05" },
-	{       0x20, "06" },
-	{       0x40, "07" },
-	{       0x80, "08" },
-	{      0x100, "09" },
-	{      0x200, "10" },
-	{      0x400, "11" },
-	{      0x800, "12" },
-	{     0x1000, "13" },
-	{     0x2000, "14" },
-	{     0x4000, "15" },
-	{     0x8000, "16" },
-	{    0x10000, "17" },
-	{    0x20000, "18" },
-	{    0x40000, "19" },
-	{    0x80000, "20" },
-	{   0x100000, "21" },
-	{   0x200000, "22" },
-	{   0x400000, "23" },
-	{   0x800000, "24" },
-	{  0x1000000, "25" },
-	{  0x2000000, "26" },
-	{  0x4000000, "27" },
-	{  0x8000000, "28" },
-	{ 0x10000000, "29" },
-	{ 0x20000000, "30" },
-	{ 0x40000000, "31" },
-	{ 0, NULL }
-};
-
-
-
-static const value_string atsvc_job_day_of_week[] = {
-	{ 0x00, "n/a" },
-	{ 0x01, "Monday" },
-	{ 0x02, "Tuesday" },
-	{ 0x04, "Wednesday" },
-	{ 0x08, "Thursday" },
-	{ 0x10, "Friday" },
-	{ 0x20, "Saturday" },
-	{ 0x40, "Sunday" },
-	{ 0, NULL }
-};
-
-static const true_false_string tfs_job_flags_type = {
-	"Job runs periodically",
-	"Job runs once"
-};
-
-static const true_false_string tfs_job_flags_exec_error = {
-	"Last job execution FAILED",
-	"Last job execution was successful"
-};
-
-static const true_false_string tfs_job_flags_runs_today = {
-	"Job is scheduled to execute today",
-	"Job is NOT scheduled to execute today"
-};
-
-static const true_false_string tfs_job_flags_add_current_date = {
-	"Job is scheduled relative to current day of month",
-	"Job is NOT scheduled relative to current day of month"
-};
-
-static const true_false_string tfs_job_flags_noninteractive = {
-	"Job is NOT interactive", 
-	"Job is interactive"
-};
+static int
+atsvc_dissect_JobEnum_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
+{
+        offset=ref_atsvc_dissect_JobEnum_ctr(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
 
-void
-proto_register_dcerpc_atsvc(void)
+        offset=atsvc_dissect_JobEnum_total_entries(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+        offset=unique_atsvc_dissect_JobEnum_resume_handle(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+   offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_atsvc_rc, NULL);
+
+
+   return offset;
+}
+static int
+atsvc_dissect_JobGetInfo_servername(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_unistr(tvb, offset, pinfo, tree, drep, hf_atsvc_JobGetInfo_servername, param);
+    return offset;
+}
+
+static int
+unique_atsvc_dissect_JobGetInfo_servername(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, atsvc_dissect_JobGetInfo_servername, NDR_POINTER_UNIQUE, "servername", -1);
+    return offset;
+}
+
+static int
+atsvc_dissect_JobGetInfo_job_id(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
+    guint32 param=0;
+    offset=atsvc_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_atsvc_job_id, param);
+    return offset;
+}
 
+static int
+atsvc_dissect_JobGetInfo_job_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    guint32 param=0;
+    offset=atsvc_dissect_JobInfo(tvb, offset, pinfo, tree, drep, hf_atsvc_JobGetInfo_job_info, param);
+    return offset;
+}
+
+static int
+unique_atsvc_dissect_JobGetInfo_job_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)
+{
+    offset=dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, atsvc_dissect_JobGetInfo_job_info, NDR_POINTER_UNIQUE, "job_info", -1);
+    return offset;
+}
+
+
+static int
+atsvc_dissect_JobGetInfo_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
+{
+        offset=unique_atsvc_dissect_JobGetInfo_servername(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+        offset=atsvc_dissect_JobGetInfo_job_id(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+
+   return offset;
+}
+
+static int
+atsvc_dissect_JobGetInfo_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
+{
+        offset=unique_atsvc_dissect_JobGetInfo_job_info(tvb, offset, pinfo, tree, drep);
+        offset=dissect_deferred_pointers(pinfo, tvb, offset, drep);
+
+   offset=dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_atsvc_rc, NULL);
+
+
+   return offset;
+}
+/* END OF INCLUDED FILE : ETH_CODE */
+
+
+
+void
+proto_register_atsvc(void)
+{
         static hf_register_info hf[] = {
 
-	  	{ &hf_atsvc_server,
-		    { "Server", "atsvc.server", FT_STRING, BASE_NONE,
-		      NULL, 0x0, "Server Name", HFILL}},
-
-	  	{ &hf_atsvc_command,
-		    { "Command", "atsvc.command", FT_STRING, BASE_NONE,
-		      NULL, 0x0, "Command to execute", HFILL}},
-
-		{ &hf_atsvc_opnum, 
-		  { "Operation", "atsvc.opnum", FT_UINT16, BASE_DEC,
-		   NULL, 0x0, "Operation", HFILL }},	
-
-		{&hf_atsvc_rc,
-		  { "Return code", "atsvc.rc", FT_UINT32, BASE_HEX,
-		    VALS(NT_errors), 0x0, "atsvc status code", HFILL }}, 
-
-	  	{ &hf_atsvc_job_id,
-		    { "Job ID", "atsvc.job_id", FT_UINT32,
-		      BASE_DEC, NULL, 0x0, "Job ID", HFILL}},
-
-	  	{ &hf_atsvc_job_time,
-		    { "Job time", "atsvc.job_time", FT_UINT32,
-		      BASE_DEC, NULL, 0x0, "Job time", HFILL}},
-
-	  	{ &hf_atsvc_job_days_of_month,
-		    { "Job day of the month", "atsvc.job_day_of_month", FT_UINT32,
-		      BASE_DEC, VALS(atsvc_job_day_of_month), 0x0, "Job day of the month", HFILL}},
-
-	  	{ &hf_atsvc_job_days_of_week,
-		    { "Job day of the week", "atsvc.job_day_of_week", FT_UINT8,
-		      BASE_DEC, VALS(atsvc_job_day_of_week), 0x0, "Job day of the week", HFILL}},
-
-	  	{ &hf_atsvc_job_flags,
-		    { "Job flags", "atsvc.job_flags", FT_UINT8,
-		      BASE_DEC, NULL, 0x0, "Job flags", HFILL}},
-
-	  	{ &hf_atsvc_min_job_id,
-		    { "Min job ID", "atsvc.min_id", FT_UINT32,
-		      BASE_DEC, NULL, 0x0, "Min job ID", HFILL}},
-
-	  	{ &hf_atsvc_max_job_id,
-		    { "Max job ID", "atsvc.max_id", FT_UINT32,
-		      BASE_DEC, NULL, 0x0, "Max job ID", HFILL}},
-
-		{ &hf_atsvc_job_flags_run_periodically,
-		    { "Job type", "atsvc.jobs.flags.type", FT_BOOLEAN, 8,
-	 		TFS(&tfs_job_flags_type), JOB_RUN_PERIODICALLY, "Job type", HFILL }},
-
-		{ &hf_atsvc_job_flags_exec_error,
-		    { "Last job execution status", "atsvc.jobs.flags.exec_error", FT_BOOLEAN, 8,
-	 		TFS(&tfs_job_flags_exec_error), JOB_EXEC_ERROR, "Last job execution status", HFILL }},
-
-		{ &hf_atsvc_job_flags_runs_today,
-		    { "Job schedule", "atsvc.jobs.flags.runs_today", FT_BOOLEAN, 8,
-	 		TFS(&tfs_job_flags_runs_today), JOB_RUNS_TODAY, "Job schedule", HFILL }},
-
-		{ &hf_atsvc_job_flags_add_current_date,
-		    { "Job relative to current day of month", "atsvc.jobs.flags.add_current_date", FT_BOOLEAN, 8,
-	 		TFS(&tfs_job_flags_add_current_date), JOB_ADD_CURRENT_DATE, "Job relative to current day of month", HFILL }},
-
-		{ &hf_atsvc_job_flags_noninteractive,
-		    { "Job interactive status", "atsvc.jobs.flags.noninteractive", FT_BOOLEAN, 8,
-	 		TFS(&tfs_job_flags_noninteractive), JOB_NONINTERACTIVE, "Job interactive status", HFILL }},
-
-        	{ &hf_atsvc_job_enum_hnd,
-	            { "Handle", "atsvc.job.hnd", FT_BYTES, BASE_NONE, NULL, 0x0, "Context handle", HFILL }},
-
-	  	{ &hf_atsvc_jobs_count,
-		    { "Jobs count", "atsvc.jobs_count", FT_UINT32,
-		      BASE_DEC, NULL, 0x0, "Number of jobs", HFILL}},
-
-	      { &hf_atsvc_enum_handle,
-  	            { "Enumeration handle", "atsvc.enum_hnd", FT_BYTES,
-		      BASE_HEX, NULL, 0x0, "Enumeration Handle", HFILL}},
-
-	      { &hf_atsvc_pref_max, 
-		    { "Preferred max length", "atsvc.pref.max.len", FT_INT32,
-     		    BASE_DEC, NULL, 0x0, "Preferred max length", HFILL}},
-
-	      { &hf_atsvc_num_entries, 
-	           { "Returned entries", "atsvc.num.entries", FT_INT32,
-	           BASE_DEC, NULL, 0x0, "Number of returned entries", HFILL}},
-
-   	      { &hf_atsvc_total_entries, 
-	           { "Total entries", "atsvc.total.entries", FT_INT32,
-	           BASE_DEC, NULL, 0x0, "Total number of available entries", HFILL}},
+
+/* INCLUDED FILE : ETH_HFARR */
+        { &hf_atsvc_job_time,
+          { "JobTime", "atsvc.JobTime", FT_UINT32, BASE_HEX,
+          NULL, 0,
+         "Job Time", HFILL }},
+
+        { &hf_atsvc_job_id,
+          { "Job ID", "atsvc.JobId", FT_UINT32, BASE_HEX,
+          NULL, 0,
+         "Job Id", HFILL }},
+
+        { &hf_atsvc_opnum,
+          { "Operation", "atsvc.opnum", FT_UINT16, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_rc,
+          { "Return code", "atsvc.rc", FT_UINT32, BASE_HEX,
+          VALS(NT_errors), 0,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_First,
+          { "First", "atsvc.DaysOfMonth.First", FT_BOOLEAN, 32,
+          TFS(&First_tfs), 0x00000001,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Second,
+          { "Second", "atsvc.DaysOfMonth.Second", FT_BOOLEAN, 32,
+          TFS(&Second_tfs), 0x00000002,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Third,
+          { "Third", "atsvc.DaysOfMonth.Third", FT_BOOLEAN, 32,
+          TFS(&Third_tfs), 0x00000004,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Fourth,
+          { "Fourth", "atsvc.DaysOfMonth.Fourth", FT_BOOLEAN, 32,
+          TFS(&Fourth_tfs), 0x00000008,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Fifth,
+          { "Fifth", "atsvc.DaysOfMonth.Fifth", FT_BOOLEAN, 32,
+          TFS(&Fifth_tfs), 0x00000010,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Sixth,
+          { "Sixth", "atsvc.DaysOfMonth.Sixth", FT_BOOLEAN, 32,
+          TFS(&Sixth_tfs), 0x00000020,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Seventh,
+          { "Seventh", "atsvc.DaysOfMonth.Seventh", FT_BOOLEAN, 32,
+          TFS(&Seventh_tfs), 0x00000040,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Eight,
+          { "Eight", "atsvc.DaysOfMonth.Eight", FT_BOOLEAN, 32,
+          TFS(&Eight_tfs), 0x00000080,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Ninth,
+          { "Ninth", "atsvc.DaysOfMonth.Ninth", FT_BOOLEAN, 32,
+          TFS(&Ninth_tfs), 0x00000100,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Tenth,
+          { "Tenth", "atsvc.DaysOfMonth.Tenth", FT_BOOLEAN, 32,
+          TFS(&Tenth_tfs), 0x00000200,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Eleventh,
+          { "Eleventh", "atsvc.DaysOfMonth.Eleventh", FT_BOOLEAN, 32,
+          TFS(&Eleventh_tfs), 0x00000400,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twelfth,
+          { "Twelfth", "atsvc.DaysOfMonth.Twelfth", FT_BOOLEAN, 32,
+          TFS(&Twelfth_tfs), 0x00000800,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Thitteenth,
+          { "Thitteenth", "atsvc.DaysOfMonth.Thitteenth", FT_BOOLEAN, 32,
+          TFS(&Thitteenth_tfs), 0x00001000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Fourteenth,
+          { "Fourteenth", "atsvc.DaysOfMonth.Fourteenth", FT_BOOLEAN, 32,
+          TFS(&Fourteenth_tfs), 0x00002000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Fifteenth,
+          { "Fifteenth", "atsvc.DaysOfMonth.Fifteenth", FT_BOOLEAN, 32,
+          TFS(&Fifteenth_tfs), 0x00004000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Sixteenth,
+          { "Sixteenth", "atsvc.DaysOfMonth.Sixteenth", FT_BOOLEAN, 32,
+          TFS(&Sixteenth_tfs), 0x00008000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Seventeenth,
+          { "Seventeenth", "atsvc.DaysOfMonth.Seventeenth", FT_BOOLEAN, 32,
+          TFS(&Seventeenth_tfs), 0x00010000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Eighteenth,
+          { "Eighteenth", "atsvc.DaysOfMonth.Eighteenth", FT_BOOLEAN, 32,
+          TFS(&Eighteenth_tfs), 0x00020000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Ninteenth,
+          { "Ninteenth", "atsvc.DaysOfMonth.Ninteenth", FT_BOOLEAN, 32,
+          TFS(&Ninteenth_tfs), 0x00040000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twentyth,
+          { "Twentyth", "atsvc.DaysOfMonth.Twentyth", FT_BOOLEAN, 32,
+          TFS(&Twentyth_tfs), 0x00080000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twentyfirst,
+          { "Twentyfirst", "atsvc.DaysOfMonth.Twentyfirst", FT_BOOLEAN, 32,
+          TFS(&Twentyfirst_tfs), 0x00100000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twentysecond,
+          { "Twentysecond", "atsvc.DaysOfMonth.Twentysecond", FT_BOOLEAN, 32,
+          TFS(&Twentysecond_tfs), 0x00200000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twentythird,
+          { "Twentythird", "atsvc.DaysOfMonth.Twentythird", FT_BOOLEAN, 32,
+          TFS(&Twentythird_tfs), 0x00400000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twentyfourth,
+          { "Twentyfourth", "atsvc.DaysOfMonth.Twentyfourth", FT_BOOLEAN, 32,
+          TFS(&Twentyfourth_tfs), 0x00800000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twentyfifth,
+          { "Twentyfifth", "atsvc.DaysOfMonth.Twentyfifth", FT_BOOLEAN, 32,
+          TFS(&Twentyfifth_tfs), 0x01000000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twentysixth,
+          { "Twentysixth", "atsvc.DaysOfMonth.Twentysixth", FT_BOOLEAN, 32,
+          TFS(&Twentysixth_tfs), 0x02000000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twentyseventh,
+          { "Twentyseventh", "atsvc.DaysOfMonth.Twentyseventh", FT_BOOLEAN, 32,
+          TFS(&Twentyseventh_tfs), 0x04000000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twentyeighth,
+          { "Twentyeighth", "atsvc.DaysOfMonth.Twentyeighth", FT_BOOLEAN, 32,
+          TFS(&Twentyeighth_tfs), 0x08000000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Twentyninth,
+          { "Twentyninth", "atsvc.DaysOfMonth.Twentyninth", FT_BOOLEAN, 32,
+          TFS(&Twentyninth_tfs), 0x10000000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Thirtieth,
+          { "Thirtieth", "atsvc.DaysOfMonth.Thirtieth", FT_BOOLEAN, 32,
+          TFS(&Thirtieth_tfs), 0x20000000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfMonth_Thirtyfirst,
+          { "Thirtyfirst", "atsvc.DaysOfMonth.Thirtyfirst", FT_BOOLEAN, 32,
+          TFS(&Thirtyfirst_tfs), 0x40000000,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfWeek_Monday,
+          { "Monday", "atsvc.DaysOfWeek.Monday", FT_BOOLEAN, 8,
+          TFS(&Monday_tfs), 0x01,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfWeek_Tuesday,
+          { "Tuesday", "atsvc.DaysOfWeek.Tuesday", FT_BOOLEAN, 8,
+          TFS(&Tuesday_tfs), 0x02,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfWeek_Wednesday,
+          { "Wednesday", "atsvc.DaysOfWeek.Wednesday", FT_BOOLEAN, 8,
+          TFS(&Wednesday_tfs), 0x04,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfWeek_Thursday,
+          { "Thursday", "atsvc.DaysOfWeek.Thursday", FT_BOOLEAN, 8,
+          TFS(&Thursday_tfs), 0x08,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfWeek_Friday,
+          { "Friday", "atsvc.DaysOfWeek.Friday", FT_BOOLEAN, 8,
+          TFS(&Friday_tfs), 0x10,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfWeek_Saturday,
+          { "Saturday", "atsvc.DaysOfWeek.Saturday", FT_BOOLEAN, 8,
+          TFS(&Saturday_tfs), 0x20,
+         "", HFILL }},
+
+        { &hf_atsvc_DaysOfWeek_Sunday,
+          { "Sunday", "atsvc.DaysOfWeek.Sunday", FT_BOOLEAN, 8,
+          TFS(&Sunday_tfs), 0x40,
+         "", HFILL }},
+
+        { &hf_atsvc_Flags_JOB_RUN_PERIODICALLY,
+          { "JOB_RUN_PERIODICALLY", "atsvc.Flags.JOB_RUN_PERIODICALLY", FT_BOOLEAN, 8,
+          TFS(&JOB_RUN_PERIODICALLY_tfs), 0x01,
+         "", HFILL }},
+
+        { &hf_atsvc_Flags_JOB_EXEC_ERROR,
+          { "JOB_EXEC_ERROR", "atsvc.Flags.JOB_EXEC_ERROR", FT_BOOLEAN, 8,
+          TFS(&JOB_EXEC_ERROR_tfs), 0x02,
+         "", HFILL }},
+
+        { &hf_atsvc_Flags_JOB_RUNS_TODAY,
+          { "JOB_RUNS_TODAY", "atsvc.Flags.JOB_RUNS_TODAY", FT_BOOLEAN, 8,
+          TFS(&JOB_RUNS_TODAY_tfs), 0x04,
+         "", HFILL }},
+
+        { &hf_atsvc_Flags_JOB_ADD_CURRENT_DATE,
+          { "JOB_ADD_CURRENT_DATE", "atsvc.Flags.JOB_ADD_CURRENT_DATE", FT_BOOLEAN, 8,
+          TFS(&JOB_ADD_CURRENT_DATE_tfs), 0x08,
+         "", HFILL }},
+
+        { &hf_atsvc_Flags_JOB_NONINTERACTIVE,
+          { "JOB_NONINTERACTIVE", "atsvc.Flags.JOB_NONINTERACTIVE", FT_BOOLEAN, 8,
+          TFS(&JOB_NONINTERACTIVE_tfs), 0x10,
+         "", HFILL }},
+
+        { &hf_atsvc_JobInfo_days_of_month,
+          { "days_of_month", "atsvc.JobInfo.days_of_month", FT_UINT32, BASE_HEX,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobInfo_days_of_week,
+          { "days_of_week", "atsvc.JobInfo.days_of_week", FT_UINT8, BASE_HEX,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobInfo_flags,
+          { "flags", "atsvc.JobInfo.flags", FT_UINT8, BASE_HEX,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobInfo_command,
+          { "command", "atsvc.JobInfo.command", FT_STRING, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobAdd_servername,
+          { "servername", "atsvc.JobAdd.servername", FT_STRING, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobAdd_job_info,
+          { "job_info", "atsvc.JobAdd.job_info", FT_NONE, BASE_NONE,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobDel_servername,
+          { "servername", "atsvc.JobDel.servername", FT_STRING, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobDel_min_job_id,
+          { "min_job_id", "atsvc.JobDel.min_job_id", FT_UINT32, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobDel_max_job_id,
+          { "max_job_id", "atsvc.JobDel.max_job_id", FT_UINT32, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobEnumInfo_days_of_month,
+          { "days_of_month", "atsvc.JobEnumInfo.days_of_month", FT_UINT32, BASE_HEX,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobEnumInfo_days_of_week,
+          { "days_of_week", "atsvc.JobEnumInfo.days_of_week", FT_UINT8, BASE_HEX,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobEnumInfo_flags,
+          { "flags", "atsvc.JobEnumInfo.flags", FT_UINT8, BASE_HEX,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobEnumInfo_command,
+          { "command", "atsvc.JobEnumInfo.command", FT_STRING, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_enum_ctr_entries_read,
+          { "entries_read", "atsvc.enum_ctr.entries_read", FT_UINT32, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_enum_ctr_first_entry,
+          { "first_entry", "atsvc.enum_ctr.first_entry", FT_NONE, BASE_NONE,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobEnum_servername,
+          { "servername", "atsvc.JobEnum.servername", FT_STRING, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobEnum_ctr,
+          { "ctr", "atsvc.JobEnum.ctr", FT_NONE, BASE_NONE,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobEnum_preferred_max_len,
+          { "preferred_max_len", "atsvc.JobEnum.preferred_max_len", FT_UINT32, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobEnum_total_entries,
+          { "total_entries", "atsvc.JobEnum.total_entries", FT_UINT32, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobEnum_resume_handle,
+          { "resume_handle", "atsvc.JobEnum.resume_handle", FT_UINT32, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobGetInfo_servername,
+          { "servername", "atsvc.JobGetInfo.servername", FT_STRING, BASE_DEC,
+          NULL, 0,
+         "", HFILL }},
+
+        { &hf_atsvc_JobGetInfo_job_info,
+          { "job_info", "atsvc.JobGetInfo.job_info", FT_NONE, BASE_NONE,
+          NULL, 0,
+         "", HFILL }},
+
+/* END OF INCLUDED FILE : ETH_HFARR */
+
 
 	};
 
         static gint *ett[] = {
-                &ett_dcerpc_atsvc,
-		&ett_dcerpc_atsvc_job,
-		&ett_dcerpc_atsvc_job_flags
-        };
 
 
-	proto_dcerpc_atsvc = proto_register_protocol(
-		"Microsoft Task Scheduler Service", "ATSVC", "atsvc");
+/* INCLUDED FILE : ETH_ETTARR */
+        &ett_atsvc,
+        &ett_atsvc_DaysOfMonth,
+        &ett_atsvc_DaysOfWeek,
+        &ett_atsvc_Flags,
+        &ett_atsvc_JobInfo,
+        &ett_atsvc_JobEnumInfo,
+        &ett_atsvc_enum_ctr,
+/* END OF INCLUDED FILE : ETH_ETTARR */
 
-	proto_register_field_array(proto_dcerpc_atsvc, hf, array_length(hf));
 
-        proto_register_subtree_array(ett, array_length(ett));
+        };
 
+        proto_atsvc = proto_register_protocol(
+                "Microsoft Task Scheduler Service", 
+		"ATSVC", "atsvc");
+	proto_register_field_array(proto_atsvc, hf, array_length(hf));
+        proto_register_subtree_array(ett, array_length(ett));
 }
 
+static dcerpc_sub_dissector function_dissectors[] = {
+
+
+/* INCLUDED FILE : ETH_FT */
+    { 0, "JobAdd",
+        atsvc_dissect_JobAdd_request,
+        atsvc_dissect_JobAdd_response },
+    { 1, "JobDel",
+        atsvc_dissect_JobDel_request,
+        atsvc_dissect_JobDel_response },
+    { 2, "JobEnum",
+        atsvc_dissect_JobEnum_request,
+        atsvc_dissect_JobEnum_response },
+    { 3, "JobGetInfo",
+        atsvc_dissect_JobGetInfo_request,
+        atsvc_dissect_JobGetInfo_response },
+/* END OF INCLUDED FILE : ETH_FT */
+
+
+	{ 0, NULL, NULL, NULL },
+};
 
 void
-proto_reg_handoff_dcerpc_atsvc(void)
+proto_reg_handoff_atsvc(void)
 {
-	/* register protocol as dcerpc */
 
-	dcerpc_init_uuid(
-		proto_dcerpc_atsvc, ett_dcerpc_atsvc, &uuid_dcerpc_atsvc,
-		ver_dcerpc_atsvc, dcerpc_atsvc_dissectors, hf_atsvc_opnum);
+
+/* INCLUDED FILE : ETH_HANDOFF */
+    dcerpc_init_uuid(proto_atsvc, ett_atsvc,
+        &uuid_dcerpc_atsvc, ver_atsvc,
+        function_dissectors, hf_atsvc_opnum);
+/* END OF INCLUDED FILE : ETH_HANDOFF */
+
+
 }
+
--- ethereal-0.10.10.orig/epan/dissectors/packet-dcerpc-samr.c
+++ ethereal-0.10.10/epan/dissectors/packet-dcerpc-samr.c
@@ -1154,17 +1154,17 @@
                 if (server) {
                         if (dcv->opnum == SAMR_CONNECT2)
                                 pol_name = g_strdup_printf("Connect2(%s)", server);
-                        if (dcv->opnum == SAMR_CONNECT3)
+                        else if (dcv->opnum == SAMR_CONNECT3)
                                 pol_name = g_strdup_printf("Connect3(%s)", server);
-                        if (dcv->opnum == SAMR_CONNECT4)
+                        else if (dcv->opnum == SAMR_CONNECT4)
                                 pol_name = g_strdup_printf("Connect4(%s)", server);
                 }
                 else {
                         if (dcv->opnum == SAMR_CONNECT2)
                                 pol_name = g_strdup("Connect2 handle");
-                        if (dcv->opnum == SAMR_CONNECT3)
+                        else if (dcv->opnum == SAMR_CONNECT3)
                                 pol_name = g_strdup("Connect3 handle");
-                        if (dcv->opnum == SAMR_CONNECT4)
+                        else if (dcv->opnum == SAMR_CONNECT4)
                                 pol_name = g_strdup("Connect4 handle");
                 }
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-dcerpc-spoolss.c
+++ ethereal-0.10.10/epan/dissectors/packet-dcerpc-spoolss.c
@@ -1704,7 +1704,7 @@
 
 	relstr_len = relstr_end - relstr_start;
 
-	proto_item_append_text(item, text);
+	proto_item_append_text(item, "%s", text);
 
 	if (data)
 		*data = text;
@@ -6325,7 +6325,7 @@
 
 	subtree = proto_item_add_subtree(item, ett_printer_enumdataex_value);
 
-	proto_item_append_text(item, name);
+	proto_item_append_text(item, "%s", name);
 			       
 	proto_tree_add_text(
 		subtree, tvb, offset - 8, 4, "Name offset: %d", name_offset);
--- ethereal-0.10.10.orig/epan/dissectors/packet-dcerpc.c
+++ ethereal-0.10.10/epan/dissectors/packet-dcerpc.c
@@ -3,7 +3,7 @@
  * Copyright 2001, Todd Sabin <tas@webspan.net>
  * Copyright 2003, Tim Potter <tpot@samba.org>
  *
- * $Id: packet-dcerpc.c 13690 2005-03-10 10:16:49Z sahlberg $
+ * $Id: packet-dcerpc.c 14190 2005-04-26 09:03:30Z sahlberg $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -238,7 +238,10 @@
  */
 static const value_string reject_status_vals[] = {
 	{ 0,          "Stub-defined exception" },
-	{ 0x00000005, "logon failure" },
+	{ 0x00000001, "nca_s_fault_other" },
+	{ 0x00000005, "nca_s_fault_access_denied" },
+	{ 0x000006f7, "nca_s_fault_ndr" },
+	{ 0x000006d8, "nca_s_fault_cant_perform" },
 	{ 0x1c000001, "nca_s_fault_int_div_by_zero" },
 	{ 0x1c000002, "nca_s_fault_addr_error" },
 	{ 0x1c000003, "nca_s_fault_fp_div_zero" },
@@ -593,12 +596,14 @@
 
 	if (fn)
 		fn(auth_tvb, 0, pinfo, tree, hdr->drep);
-	else
+	else {
+		tvb_ensure_bytes_exist(auth_tvb, 0, hdr->auth_len);
 		proto_tree_add_text(tree, auth_tvb, 0, hdr->auth_len,
 				    "%s Verifier", 
 				    val_to_str(auth_info->auth_type, 
 					       authn_protocol_vals,
 					       "Unknown (%u)"));
+	}
 }
 
 /* Hand off payload data to a registered dissector */
@@ -1333,9 +1338,11 @@
     offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
                                 hf_dcerpc_array_actual_count, &len);
 
-    if (tree && len)
+    if (tree && len) {
+        tvb_ensure_bytes_exist(tvb, offset, len);
         proto_tree_add_item(tree, hf_dcerpc_array_buffer,
                             tvb, offset, len, drep[0] & 0x10);
+    }
 
     offset += len;
 
@@ -1404,6 +1411,7 @@
          */
         if (tree && buffer_len) {
             hfinfo = proto_registrar_get_nth(hfindex);
+            tvb_ensure_bytes_exist(tvb, offset, buffer_len);
             if (hfinfo->type == FT_STRING) {
                 proto_tree_add_string(string_tree, hfindex, tvb, offset,
                                       buffer_len, s);
@@ -1421,6 +1429,7 @@
          * but that's another matter; in any case, that would happen only
          * if we had an immensely large tvbuff....)
          */
+        tvb_ensure_bytes_exist(tvb, offset, buffer_len);
         s = tvb_get_string(tvb, offset, buffer_len);
         if (tree && buffer_len)
             proto_tree_add_item(string_tree, hfindex, tvb, offset,
@@ -1538,6 +1547,7 @@
          */
         if (tree && buffer_len) {
             hfinfo = proto_registrar_get_nth(hfindex);
+            tvb_ensure_bytes_exist(tvb, offset, buffer_len);
             if (hfinfo->type == FT_STRING) {
                 proto_tree_add_string(string_tree, hfindex, tvb, offset,
                                       buffer_len, s);
@@ -1555,6 +1565,7 @@
          * but that's another matter; in any case, that would happen only
          * if we had an immensely large tvbuff....)
          */
+        tvb_ensure_bytes_exist(tvb, offset, buffer_len);
         s = tvb_get_string(tvb, offset, buffer_len);
         if (tree && buffer_len)
             proto_tree_add_item(string_tree, hfindex, tvb, offset,
@@ -1663,7 +1674,7 @@
 	pointers_are_top_level=TRUE;
 }
 
-static int
+int
 dissect_deferred_pointers(packet_info *pinfo, tvbuff_t *tvb, int offset, guint8 *drep)
 {
 	int found_new_pointer;
@@ -1892,6 +1903,7 @@
 		/* get the referent id */
 		offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &id);
 
+		tvb_ensure_bytes_exist(tvb, offset-4, 4);
 		/* we got a NULL pointer */
 		if(id==0){
 			proto_tree_add_text(tree, tvb, offset-4, 4,
@@ -1928,6 +1940,7 @@
 		/* get the referent id */
 		offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &id);
 
+		tvb_ensure_bytes_exist(tvb, offset-4, 4);
 		/* we got a NULL pointer */
 		if(id==0){
 			proto_tree_add_text(tree, tvb, offset-4, 4,
@@ -1955,6 +1968,7 @@
 		/* get the referent id */
 		offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &id);
 
+		tvb_ensure_bytes_exist(tvb, offset-4, 4);
 		/* new pointer */
 		item=proto_tree_add_text(tree, tvb, offset-4, 4,
 			"%s",text);
@@ -1975,6 +1989,7 @@
 		/* get the referent id */
 		offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &id);
 
+		tvb_ensure_bytes_exist(tvb, offset-4, 4);
 		/* we got a NULL pointer */
 		if(id==0){
 			proto_tree_add_text(tree, tvb, offset-4, 4,
@@ -2003,6 +2018,7 @@
 		/* get the referent id */
 		offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &id);
 
+		tvb_ensure_bytes_exist(tvb, offset-4, 4);
 		/* we got a NULL pointer */
 		if(id==0){
 			proto_tree_add_text(tree, tvb, offset-4, 4,
@@ -2053,12 +2069,39 @@
 		tvb, offset, pinfo, tree, drep, fnct, type, text, hf_index,
 		NULL, NULL);
 }
+int
+dissect_ndr_toplevel_pointer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
+		    proto_tree *tree, guint8 *drep, dcerpc_dissect_fnct_t *fnct,
+		    int type, char *text, int hf_index)
+{
+	int ret;
+
+	pointers_are_top_level=TRUE;
+	ret=dissect_ndr_pointer_cb(
+		tvb, offset, pinfo, tree, drep, fnct, type, text, hf_index,
+		NULL, NULL);
+	return ret;
+}
+int
+dissect_ndr_embedded_pointer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
+		    proto_tree *tree, guint8 *drep, dcerpc_dissect_fnct_t *fnct,
+		    int type, char *text, int hf_index)
+{
+	int ret;
+
+	pointers_are_top_level=FALSE;
+	ret=dissect_ndr_pointer_cb(
+		tvb, offset, pinfo, tree, drep, fnct, type, text, hf_index,
+		NULL, NULL);
+	return ret;
+}
 
 static void
 show_stub_data (tvbuff_t *tvb, gint offset, proto_tree *dcerpc_tree,
                 dcerpc_auth_info *auth_info, gboolean is_encrypted)
 {
-    int length;
+    int length, plain_length, auth_pad_len;
+    guint auth_pad_offset;
 
     /*
      * We don't show stub data unless we have some in the tvbuff;
@@ -2067,23 +2110,47 @@
      * that happen to be in the tvbuff.
      */
     if (tvb_length_remaining (tvb, offset) > 0) {
+	auth_pad_len = auth_info?auth_info->auth_pad_len:0;
         length = tvb_reported_length_remaining (tvb, offset);
+
+	/* if auth_pad_len is larger than length then we ignore auth_pad_len totally */
+	plain_length = length - auth_pad_len;
+	if (plain_length < 1) {
+	    plain_length = length;
+	    auth_pad_len = 0;
+	}
+	auth_pad_offset = offset + plain_length;
+
         if (auth_info != NULL &&
             auth_info->auth_level == DCE_C_AUTHN_LEVEL_PKT_PRIVACY) {
             if (is_encrypted) {
-                proto_tree_add_text(dcerpc_tree, tvb, offset, -1,
+		tvb_ensure_bytes_exist(tvb, offset, length);
+                proto_tree_add_text(dcerpc_tree, tvb, offset, length,
                                     "Encrypted stub data (%d byte%s)",
                                     length, plurality(length, "", "s"));
+		/* is the padding is still inside the encrypted blob, don't display it explicit */
+		auth_pad_len = 0;
             } else {
-                proto_tree_add_text(dcerpc_tree, tvb, offset, -1,
+		tvb_ensure_bytes_exist(tvb, offset, plain_length);
+                proto_tree_add_text(dcerpc_tree, tvb, offset, plain_length,
                                     "Decrypted stub data (%d byte%s)",
-                                    length, plurality(length, "", "s"));
+                                    plain_length, plurality(plain_length, "", "s"));
             }
         } else {
-            proto_tree_add_text (dcerpc_tree, tvb, offset, -1,
-                                 "Stub data (%d byte%s)", length,
-                                 plurality(length, "", "s"));
+	    tvb_ensure_bytes_exist(tvb, offset, plain_length);
+            proto_tree_add_text (dcerpc_tree, tvb, offset, plain_length,
+                                 "Stub data (%d byte%s)", plain_length,
+                                 plurality(plain_length, "", "s"));
         }
+        /* If there is auth padding at the end of the stub, display it */
+        if (auth_pad_len != 0) {
+		tvb_ensure_bytes_exist(tvb, auth_pad_offset, auth_pad_len);
+                proto_tree_add_text (dcerpc_tree, tvb, auth_pad_offset,
+                                     auth_pad_len,
+                                     "Auth Padding (%u byte%s)",
+                                     auth_pad_len,
+                                     plurality(auth_pad_len, "", "s"));
+            }
     }
 }
 
@@ -2288,6 +2355,7 @@
 
             /* If there is auth padding at the end of the stub, display it */
             if (auth_pad_len != 0) {
+		tvb_ensure_bytes_exist(tvb, auth_pad_offset, auth_pad_len);
                 proto_tree_add_text (sub_tree, decrypted_tvb, auth_pad_offset,
                                      auth_pad_len,
                                      "Auth Padding (%u byte%s)",
@@ -2345,6 +2413,7 @@
 		show_exception(auth_tvb, pinfo, dcerpc_tree, EXCEPT_CODE, GET_MESSAGE);
 	    } ENDTRY;
 	} else {
+            tvb_ensure_bytes_exist(tvb, 0, hdr->auth_len);
 	    proto_tree_add_text (dcerpc_tree, auth_tvb, 0, hdr->auth_len,
 				 "Auth Verifier");
 	}
@@ -2708,6 +2777,7 @@
     offset = dissect_dcerpc_uint16 (tvb, offset, pinfo, dcerpc_tree, hdr->drep,
                                     hf_dcerpc_cn_sec_addr_len, &sec_addr_len);
     if (sec_addr_len != 0) {
+	tvb_ensure_bytes_exist(tvb, offset, sec_addr_len);
         proto_tree_add_item (dcerpc_tree, hf_dcerpc_cn_sec_addr, tvb, offset,
                              sec_addr_len, FALSE);
         offset += sec_addr_len;
@@ -3017,6 +3087,7 @@
     if(!(hdr->flags&PFC_LAST_FRAG)){
 	tot_len = fragment_get_tot_len(pinfo, frame,
 		 dcerpc_co_reassemble_table);
+    tvb_ensure_bytes_exist(tvb, tot_len-alloc_hint, tvb_length(decrypted_tvb));
 	fragment_add(decrypted_tvb, 0, pinfo, frame,
 		 dcerpc_co_reassemble_table,
 		 tot_len-alloc_hint, tvb_length(decrypted_tvb),
@@ -3033,6 +3104,7 @@
     */
     tot_len = fragment_get_tot_len(pinfo, frame,
 		dcerpc_co_reassemble_table);
+    tvb_ensure_bytes_exist(tvb, tot_len-alloc_hint, tvb_length(decrypted_tvb));
     fd_head = fragment_add(decrypted_tvb, 0, pinfo,
 		frame,
 		dcerpc_co_reassemble_table,
@@ -3567,6 +3639,7 @@
 		     */
 		    if (dcerpc_tree) {
 			if (stub_length > 0) {
+			    tvb_ensure_bytes_exist(tvb, offset, stub_length);
 			    proto_tree_add_text (dcerpc_tree, tvb, offset, stub_length,
 						 "Fault stub data (%d byte%s)",
 						 stub_length,
@@ -3581,6 +3654,7 @@
 		    }
 		    if (dcerpc_tree) {
 			if (stub_length > 0) {
+			    tvb_ensure_bytes_exist(tvb, offset, stub_length);
 			    proto_tree_add_text (dcerpc_tree, tvb, offset, stub_length,
 						 "Fragment data (%d byte%s)",
 						 stub_length,
@@ -3595,6 +3669,7 @@
 		   third means we can attempt reassembly. */
 		if (dcerpc_tree) {
 		    if (length > 0) {
+			tvb_ensure_bytes_exist(tvb, offset, stub_length);
 			proto_tree_add_text (dcerpc_tree, tvb, offset, stub_length,
 					     "Fragment data (%d byte%s)",
 					     stub_length,
@@ -3651,6 +3726,7 @@
 			     */
 			    if (dcerpc_tree) {
 				if (length > 0) {
+				    tvb_ensure_bytes_exist(tvb, offset, stub_length);
 				     proto_tree_add_text (dcerpc_tree, tvb, offset, stub_length,
 							  "Fault stub data (%d byte%s)",
 							  stub_length,
@@ -3777,6 +3853,7 @@
 
     if (tree) {
         offset = start_offset;
+	tvb_ensure_bytes_exist(tvb, offset, hdr.frag_len);
         ti = proto_tree_add_item (tree, proto_dcerpc, tvb, offset, hdr.frag_len, FALSE);
         if (ti) {
             dcerpc_tree = proto_item_add_subtree (ti, ett_dcerpc);
@@ -4229,6 +4306,7 @@
 	    }
 	    if (dcerpc_tree) {
 		if (length > 0) {
+		    tvb_ensure_bytes_exist(tvb, offset, stub_length);
 		    proto_tree_add_text (dcerpc_tree, tvb, offset, stub_length,
 					 "Fragment data (%d byte%s)",
 					 stub_length,
@@ -4243,6 +4321,7 @@
 	   third means we can attempt reassembly. */
 	if (dcerpc_tree) {
 	    if (length > 0) {
+		tvb_ensure_bytes_exist(tvb, offset, stub_length);
 		proto_tree_add_text (dcerpc_tree, tvb, offset, stub_length,
 				     "Fragment data (%d byte%s)", stub_length,
 				     plurality(stub_length, "", "s"));
@@ -4448,20 +4527,37 @@
     if (!tvb_bytes_exist (tvb, 0, sizeof (hdr))) {
         return FALSE;
     }
+
+    /* Version must be 4 */
     hdr.rpc_ver = tvb_get_guint8 (tvb, offset++);
     if (hdr.rpc_ver != 4)
         return FALSE;
+
+    /* Type must be <=19 or its not DCE/RPC */
     hdr.ptype = tvb_get_guint8 (tvb, offset++);
     if (hdr.ptype > 19)
         return FALSE;
 
+    /* flags1 has bit 1 and 8 as reserved so if any of them are set, it is 
+       probably not a DCE/RPC packet 
+     */
+    hdr.flags1 = tvb_get_guint8 (tvb, offset++);
+    if(hdr.flags1&0x81)
+        return FALSE;
+
+    /* flags2 has all bits except bit 2 as reserved so if any of them are set
+       it is probably not DCE/RPC.
+     */
+    hdr.flags2 = tvb_get_guint8 (tvb, offset++);
+    if(hdr.flags2&0xfd)
+        return FALSE;
+
+
     if (check_col (pinfo->cinfo, COL_PROTOCOL))
         col_set_str (pinfo->cinfo, COL_PROTOCOL, "DCERPC");
     if (check_col (pinfo->cinfo, COL_INFO))
         col_add_str (pinfo->cinfo, COL_INFO, pckt_vals[hdr.ptype].strptr);
 
-    hdr.flags1 = tvb_get_guint8 (tvb, offset++);
-    hdr.flags2 = tvb_get_guint8 (tvb, offset++);
     tvb_memcpy (tvb, (guint8 *)hdr.drep, offset, sizeof (hdr.drep));
     offset += sizeof (hdr.drep);
     hdr.serial_hi = tvb_get_guint8 (tvb, offset++);
--- ethereal-0.10.10.orig/epan/dissectors/packet-dcm.c
+++ ethereal-0.10.10/epan/dissectors/packet-dcm.c
@@ -145,6 +145,7 @@
 #define DCM_UNK  0xf0
 };
 typedef struct dcmItem dcmItem_t;
+static char *dcm_xfer_unk = "not found - click on ASSOC Request";
 
 struct dcmState {
     dcmItem_t *first, *last;
@@ -460,6 +461,8 @@
 dcm_setSyntax(dcmItem_t *di, char *name)
 {
     if (NULL == di) return;
+    if (di->xfer != dcm_xfer_unk)
+	g_free(di->xfer);	/* free prev allocated xfer */
     di->syntax = 0;
     di->xfer = name;
     if (0 == *name) return;
@@ -659,6 +662,8 @@
 		di = g_chunk_new(dcmItem_t, dcm_pdus);
 		di->id = id;
 		di->valid = 1;
+		di->xfer = dcm_xfer_unk;
+		di->syntax = DCM_UNK;
 		di->next = di->prev = NULL;
 		if (dcm_data->last) {
 		    dcm_data->last->next = di;
@@ -765,10 +770,12 @@
     /* proto_tree_add_item(dcm_tree, hf_dcm_data_ctx, tvb, 10, 1, FALSE); */
     proto_tree_add_uint_format(dcm_tree, hf_dcm_data_ctx, tvb, 10, 1, 
 	ctx, "Context 0x%x (%s)", ctx, di->xfer);
+    if (DCM_UNK == di->syntax)
+      return;
     len = offset = toffset = 11;
     state = D_HEADER;
     nlen = 1;
-    while (len + nlen <= dcm_data->clen) {
+    while (len + nlen <= dcm_data->clen && len + nlen <= dcm_data->clen) {
     switch (state) {
     case D_HEADER: {
 	guint8 flags;
--- ethereal-0.10.10.orig/epan/dissectors/packet-dcom-cba.c
+++ ethereal-0.10.10/epan/dissectors/packet-dcom-cba.c
@@ -548,8 +548,6 @@
 	packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
 
-    offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
-
 	return dissect_get_BSTR_resp(tvb, offset, pinfo, tree, drep, hf_cba_producer);
 }
 
@@ -559,8 +557,6 @@
 	packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
 
-    offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
-
 	return dissect_get_BSTR_resp(tvb, offset, pinfo, tree, drep, hf_cba_product);
 }
 
@@ -737,8 +733,6 @@
 	packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
 
-    offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
-
 	return dissect_get_BSTR_resp(tvb, offset, pinfo, tree, drep, hf_cba_name);
 }
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-dhcp-failover.c
+++ ethereal-0.10.10/epan/dissectors/packet-dhcp-failover.c
@@ -2,7 +2,7 @@
  * Routines for ISC DHCP Server failover protocol dissection
  * Copyright 2004, M. Ortega y Strupp <moys@loplof.de>
  *
- * $Id: packet-dhcp-failover.c 11746 2004-08-16 01:13:11Z guy $
+ * $Id: packet-dhcp-failover.c 14230 2005-04-29 14:40:04Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -529,6 +529,8 @@
 					proto_item_append_text(oi, ", %s ",
 						assigned_ip_address_str);
 
+					if (helpliste->length != 4)
+						THROW(ReportedBoundsError);
 					proto_tree_add_item(option_tree,
 						hf_dhcpfo_assigned_ip_address, tvb,
 						helpliste->actualpoffset + 4, 
@@ -541,6 +543,8 @@
 					
 					proto_item_append_text(oi, ", %s ",
 							sending_server_ip_address_str); 
+					if (helpliste->length != 4)
+						THROW(ReportedBoundsError);
 					proto_tree_add_item(option_tree,
 						hf_dhcpfo_sending_server_ip_address, tvb,
 						helpliste->actualpoffset + 4, 
@@ -553,6 +557,8 @@
 								helpliste->actualpoffset+4);
 
 					proto_item_append_text(oi,", %d",addresses_transfered);	
+					if (helpliste->length != 1)
+						THROW(ReportedBoundsError);
 					proto_tree_add_item(option_tree,
 						hf_dhcpfo_addresses_transfered, tvb,
 						helpliste->actualpoffset + 4, 
@@ -616,6 +622,8 @@
 							reject_reason_str, 
 							reject_reason);
 
+					if (helpliste->length != 1)
+						THROW(ReportedBoundsError);
 					proto_tree_add_item(option_tree,
 						hf_dhcpfo_reject_reason, tvb,
 						helpliste->actualpoffset +4,
@@ -634,6 +642,8 @@
 
 					mclt = tvb_get_ntohl(tvb, helpliste->actualpoffset+4);
 					proto_item_append_text(oi,", %d seconds",mclt);
+					if (helpliste->length != 4)
+						THROW(ReportedBoundsError);
 					proto_tree_add_item(option_tree,
 						hf_dhcpfo_mclt, tvb,
 						helpliste->actualpoffset +4,
@@ -812,6 +822,8 @@
 						tvb_get_ntohl(tvb,helpliste->actualpoffset+4);
 					proto_item_append_text(oi,", %d", max_unacked_bndupd);
 
+					if (helpliste->length != 1)
+						THROW(ReportedBoundsError);
 					proto_tree_add_item(option_tree,
 						hf_dhcpfo_max_unacked_bndupd, tvb,
 						helpliste->actualpoffset + 4, 
@@ -824,6 +836,8 @@
 						tvb_get_ntohl(tvb,helpliste->actualpoffset+4);
 					proto_item_append_text(oi,", %d seconds", receive_timer);
 
+					if (helpliste->length != 1)
+						THROW(ReportedBoundsError);
 					receive_timer_item = proto_tree_add_item(option_tree,
 						hf_dhcpfo_receive_timer, tvb,
 						helpliste->actualpoffset + 4, 
@@ -866,6 +880,8 @@
 
 					proto_item_append_text(oi, ", version: %d", 
 									protocol_version);
+					if (helpliste->length != 1)
+						THROW(ReportedBoundsError);
 					proto_tree_add_item(option_tree,
 						hf_dhcpfo_protocol_version, tvb,
 						helpliste->actualpoffset + 4, 
--- ethereal-0.10.10.orig/epan/dissectors/packet-distcc.c
+++ ethereal-0.10.10/epan/dissectors/packet-distcc.c
@@ -3,7 +3,7 @@
  * Copyright 2003, Brad Hards <bradh@frogmouth.net>
  * Copyright 2003, Ronnie Sahlberg, added TCP desegmentation.
  *
- * $Id: packet-distcc.c 12115 2004-09-27 22:55:15Z guy $
+ * $Id: packet-distcc.c 14016 2005-04-04 21:44:53Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -68,12 +68,13 @@
 extern void proto_reg_handoff_distcc(void);
 
 #define CHECK_PDU_LEN(x) \
-	if(parameter>tvb_length_remaining(tvb, offset)){\
+	if(parameter>tvb_length_remaining(tvb, offset) || parameter < 1){\
 		len=tvb_length_remaining(tvb, offset);\
 		if (check_col(pinfo->cinfo, COL_INFO)) {\
 			col_append_fstr(pinfo->cinfo, COL_INFO, "[Short" x " PDU]");\
 		}\
-	}
+	} \
+	tvb_ensure_bytes_exist(tvb, offset, len);
 
 
 #define DESEGMENT_TCP(x) \
--- ethereal-0.10.10.orig/epan/dissectors/packet-dlsw.c
+++ ethereal-0.10.10/epan/dissectors/packet-dlsw.c
@@ -2,7 +2,7 @@
  * Routines for DLSw packet dissection (Data Link Switching)
  * Copyright 2001, Paul Ionescu <paul@acorp.ro>
  *
- * $Id: packet-dlsw.c 13019 2005-01-13 17:26:10Z guy $
+ * $Id: packet-dlsw.c 14178 2005-04-24 01:15:53Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -400,6 +400,7 @@
   case DLSW_GDSID_SEND:
     while (offset < mlen){
       vlen=tvb_get_guint8(tvb,offset);
+      if (vlen < 3) THROW(ReportedBoundsError);
       vtype=tvb_get_guint8(tvb,offset+1);
       ti=proto_tree_add_text (tree,tvb,offset,vlen,"%s",
          val_to_str(vtype,dlsw_vector_vals,"Unknown vector type"));
--- ethereal-0.10.10.orig/epan/dissectors/packet-eigrp.c
+++ ethereal-0.10.10/epan/dissectors/packet-eigrp.c
@@ -2,7 +2,7 @@
  * Routines for EIGRP dissection
  * Copyright 2000, Paul Ionescu <paul@acorp.ro>
  *
- * $Id: packet-eigrp.c 12130 2004-09-29 00:52:45Z guy $
+ * $Id: packet-eigrp.c 14152 2005-04-20 19:50:11Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -144,8 +144,8 @@
   proto_item *ti;
 
   guint opcode,opcode_tmp;
-  guint16 tlv,size, offset = EIGRP_HEADER_LENGTH;
-  guint32 ack;
+  guint16 tlv;
+  guint32 ack, size, offset = EIGRP_HEADER_LENGTH;
 
   if (check_col(pinfo->cinfo, COL_PROTOCOL))
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "EIGRP");
--- ethereal-0.10.10.orig/epan/dissectors/packet-ess.c
+++ ethereal-0.10.10/epan/dissectors/packet-ess.c
@@ -129,7 +129,7 @@
 /*--- End of included file: packet-ess-ett.c ---*/
 
 
-static char object_identifier_id[64]; /*64 chars should be long enough? */
+static char object_identifier_id[BER_MAX_OID_STR_LEN];
 
 
 /*--- Included file: packet-ess-fn.c ---*/
--- ethereal-0.10.10.orig/epan/dissectors/packet-fc.c
+++ ethereal-0.10.10/epan/dissectors/packet-fc.c
@@ -4,7 +4,7 @@
  *   Copyright 2003  Ronnie Sahlberg, exchange first/last matching and 
  *                                    tap listener and misc updates
  *
- * $Id: packet-fc.c 13366 2005-02-09 23:38:00Z lroland $
+ * $Id: packet-fc.c 14154 2005-04-20 20:07:17Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -361,7 +361,7 @@
 
 static void fc_defragment_init(void)
 {
-  fragment_table_init(&fc_fragment_table);
+  fragment_table_init (&fc_fragment_table);
 }
 
 
@@ -838,7 +838,8 @@
     ftype = fc_get_ftype (fchdr.r_ctl, fchdr.type);
     
     if (check_col (pinfo->cinfo, COL_INFO)) {
-        col_add_str (pinfo->cinfo, COL_INFO, match_strval (ftype, fc_ftype_vals));
+         col_add_str (pinfo->cinfo, COL_INFO, val_to_str (ftype, fc_ftype_vals,
+                                                          "Unknown Type (0x%x)"));
 
         if (ftype == FC_FTYPE_LINKCTL)
             col_append_fstr (pinfo->cinfo, COL_INFO, ", %s",
@@ -1134,12 +1135,19 @@
         is_exchg_resp = ((tvb_get_guint8 (tvb, offset+20) & 0x80) == 0x80);
     }
 
+    if (tvb_reported_length (tvb) <= FC_HEADER_SIZE)
+        THROW(ReportedBoundsError);
+
     frag_size = tvb_reported_length (tvb)-FC_HEADER_SIZE;
 
     /* If there is an MDS header, we need to subtract the MDS trailer size */
     if ((pinfo->ethertype == ETHERTYPE_UNK) || (pinfo->ethertype == ETHERTYPE_FCFT)) {
+        if (frag_size <= MDSHDR_TRAILER_SIZE)
+	    THROW(ReportedBoundsError);
         frag_size -= MDSHDR_TRAILER_SIZE;
     } else if (pinfo->ethertype == ETHERTYPE_BRDWALK) {
+        if (frag_size <= 8)
+	    THROW(ReportedBoundsError);
         frag_size -= 8;         /* 4 byte of FC CRC +
                                    4 bytes of error+EOF = 8 bytes  */
     }
@@ -1204,38 +1212,51 @@
         else {
             real_seqcnt = fchdr.seqcnt;
         }
-        
-        frag_id = ((pinfo->oxid << 16) ^ seq_id) | is_exchg_resp ;
 
-        /* We assume that all frames are of the same max size */
-        fcfrag_head = fragment_add (tvb, FC_HEADER_SIZE, pinfo, frag_id,
-                                    fc_fragment_table,
-                                    real_seqcnt * fc_max_frame_size,
-                                    frag_size,
-                                    !is_lastframe_inseq);
+        /* Verify that this is a valid fragment */
+        if (is_lastframe_inseq && !is_1frame_inseq && !real_seqcnt) {
+             /* This is a frame that purports to be the last frame in a
+              * sequence, is not the first frame, but has a seqcnt that is
+              * 0. This is a bogus frame, don't attempt to reassemble it.
+              */
+             next_tvb = tvb_new_subset (tvb, next_offset, -1, -1);
+             if (check_col (pinfo->cinfo, COL_INFO)) {
+                  col_append_str (pinfo->cinfo, COL_INFO, " (Bogus Fragment)");
+             }
+        } else {
         
-        if (fcfrag_head) {
-            next_tvb = tvb_new_real_data (fcfrag_head->data,
-                                          fcfrag_head->datalen,
-                                          fcfrag_head->datalen);
-            tvb_set_child_real_data_tvbuff(tvb, next_tvb);
-            
-            /* Add the defragmented data to the data source list. */
+             frag_id = ((pinfo->oxid << 16) ^ seq_id) | is_exchg_resp ;
+
+             /* We assume that all frames are of the same max size */
+             fcfrag_head = fragment_add (tvb, FC_HEADER_SIZE, pinfo, frag_id,
+                                         fc_fragment_table,
+                                         real_seqcnt * fc_max_frame_size,
+                                         frag_size,
+                                         !is_lastframe_inseq);
+             
+             if (fcfrag_head) {
+                  next_tvb = tvb_new_real_data (fcfrag_head->data,
+                                                fcfrag_head->datalen,
+                                                fcfrag_head->datalen);
+                  tvb_set_child_real_data_tvbuff(tvb, next_tvb);
+                  
+                  /* Add the defragmented data to the data source list. */
             add_new_data_source(pinfo, next_tvb, "Reassembled FC");
             
             if (tree) {
-                proto_tree_add_boolean_hidden (fc_tree, hf_fc_reassembled,
-                                               tvb, offset+9, 1, 1);
+                 proto_tree_add_boolean_hidden (fc_tree, hf_fc_reassembled,
+                                                tvb, offset+9, 1, 1);
             }
-        }
-        else {
-            if (tree) {
-                proto_tree_add_boolean_hidden (fc_tree, hf_fc_reassembled,
-                                               tvb, offset+9, 1, 0);
+             }
+             else {
+                  if (tree) {
+                       proto_tree_add_boolean_hidden (fc_tree, hf_fc_reassembled,
+                                                      tvb, offset+9, 1, 0);
             }
-            next_tvb = tvb_new_subset (tvb, next_offset, -1, -1);
-            call_dissector (data_handle, next_tvb, pinfo, tree);
-            return;
+                  next_tvb = tvb_new_subset (tvb, next_offset, -1, -1);
+                  call_dissector (data_handle, next_tvb, pinfo, tree);
+                  return;
+             }
         }
     } else {
         if (tree) {
--- ethereal-0.10.10.orig/epan/dissectors/packet-fcels.c
+++ ethereal-0.10.10/epan/dissectors/packet-fcels.c
@@ -2,7 +2,7 @@
  * Routines for FC Extended Link Services
  * Copyright 2001, Dinesh G Dutt <ddutt@cisco.com>
  *
- * $Id: packet-fcels.c 13243 2005-02-02 20:07:03Z etxrab $
+ * $Id: packet-fcels.c 14027 2005-04-08 10:28:44Z sahlberg $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -476,6 +476,9 @@
     }
 }
 
+/* Maximum length of possible string from, construct_*_string
+ * 296 bytes, FIX possible buffer overflow */
+#define FCELS_LOGI_MAXSTRINGLEN 512
 
 static void
 dissect_fcels_logi (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
@@ -487,7 +490,7 @@
         class;
     proto_tree *logi_tree, *cmnsvc_tree;
     proto_item *subti;
-    gchar flagstr[256];
+    gchar flagstr[FCELS_LOGI_MAXSTRINGLEN];
     guint16 flag;
     
     if (tree) {
@@ -1064,6 +1067,10 @@
     }
 }
 
+/* Maximum length of possible string from, dissect_fcels_prlilo_payload
+ * 119 bytes, FIX possible buffer overflow */
+#define FCELS_PRLILO_MAXSTRINGLEN 256
+
 static void
 dissect_fcels_prlilo_payload (tvbuff_t *tvb, packet_info *pinfo _U_,
                               guint8 isreq, proto_item *ti, guint8 opcode)
@@ -1074,7 +1081,7 @@
     proto_tree *prli_tree, *svcpg_tree;
     int num_svcpg, payload_len, i, flag;
     proto_item *subti;
-    gchar flagstr[100];
+    gchar flagstr[FCELS_PRLILO_MAXSTRINGLEN];
 
     /* We're assuming that we're invoked only if tree is not NULL i.e.
      * we don't do the usual "if (tree)" check here, the caller must.
--- ethereal-0.10.10.orig/epan/dissectors/packet-fcp.c
+++ ethereal-0.10.10/epan/dissectors/packet-fcp.c
@@ -2,18 +2,12 @@
  * Routines for Fibre Channel Protocol for SCSI (FCP)
  * Copyright 2001, Dinesh G Dutt <ddutt@cisco.com>
  *
- * $Id: packet-fcp.c 13684 2005-03-09 23:00:21Z ulfl $
+ * $Id: packet-fcp.c 13917 2005-03-26 03:56:54Z guy $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
  *
- * Copied from WHATEVER_FILE_YOU_USED (where "WHATEVER_FILE_YOU_USED"
- * is a dissector file; if you just copied this from README.developer,
- * don't bother with the "Copied from" - you don't even need to put
- * in a "Copied from" if you copied an existing dissector, especially
- * if the bulk of the code in the new dissector is your code)
- * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
@@ -279,6 +273,17 @@
     
     cdata = (fcp_conv_data_t *)g_hash_table_lookup (fcp_req_hash,
                                                     &ckey);
+    /*
+     * XXX - the fetch of the fcp_dl value will throw an exception on
+     * a short frame before we get a chance to dissect the stuff before
+     * it.
+     *
+     * XXX - this doesn't appear to store the data length with the
+     * FCP packet with the data, so this might not work correctly
+     * if you select a command packet, select the corresponding data
+     * packet, and then select another data packet with a different
+     * length.
+     */
     if (cdata) {
         /* Since we never free the memory used by an exchange, this maybe a
          * case of another request using the same exchange as a previous
@@ -396,9 +401,8 @@
 {
     guint32 offset = 0,
         del_usecs = 0;
-    guint len = 0,
-          add_len = 0,
-          rsplen = 0;
+    guint32 snslen = 0,
+           rsplen = 0;
     gchar str[128];
     guint8 flags;
     proto_item *ti;
@@ -430,20 +434,7 @@
     }
     
     if (tree) {
-        /* Determine the length of the FCP part of the packet */
-        len = FCP_DEF_RSP_LEN;
-
-        flags = tvb_get_guint8 (tvb, offset+10);
-        if (flags & 0x2) {
-            add_len = tvb_get_ntohl (tvb, offset+20);
-            len += add_len;
-        }
-        if (flags & 0x1) {
-            add_len = tvb_get_ntohl (tvb, offset+16);
-            len += add_len;
-        }
-
-        ti = proto_tree_add_protocol_format (tree, proto_fcp, tvb, 0, len,
+        ti = proto_tree_add_protocol_format (tree, proto_fcp, tvb, 0, -1,
                                              "FCP_RSP");
         fcp_tree = proto_item_add_subtree (ti, ett_fcp);
         proto_tree_add_uint_hidden (fcp_tree, hf_fcp_type, tvb, offset, 0, 0);
@@ -463,26 +454,42 @@
                 proto_tree_add_uint_hidden (fcp_tree, hf_fcp_singlelun, tvb,
                                             offset, 0, cdata->fcp_lun);
         }
+        flags = tvb_get_guint8 (tvb, offset+10);
         proto_tree_add_uint_format (fcp_tree, hf_fcp_rspflags, tvb, offset+10,
                                     1, flags, "Flags: 0x%02x (%s)", flags,
                                     rspflags_to_str (flags, str));
         proto_tree_add_item (fcp_tree, hf_fcp_scsistatus, tvb, offset+11, 1, 0);
         if (flags & 0xC)
             proto_tree_add_item (fcp_tree, hf_fcp_resid, tvb, offset+12, 4, 0);
-        if (flags & 0x2)
-            proto_tree_add_item (fcp_tree, hf_fcp_snslen, tvb, offset+16, 4, 0);
+        if (flags & 0x2) {
+            snslen = tvb_get_ntohl (tvb, offset+16);
+            proto_tree_add_uint (fcp_tree, hf_fcp_snslen, tvb, offset+16, 4,
+                                 snslen);
+        }
         if (flags & 0x1) {
             rsplen = tvb_get_ntohl (tvb, offset+20);
-            proto_tree_add_item (fcp_tree, hf_fcp_rsplen, tvb, offset+20, 4, 0);
+            proto_tree_add_uint (fcp_tree, hf_fcp_rsplen, tvb, offset+20, 4,
+                                 rsplen);
+            /* XXX - must rsplen be >= 4?  What other than the code is there? */
             proto_tree_add_item (fcp_tree, hf_fcp_rspcode, tvb, offset+27, 1,
                                  0);
         }
+        /* This handles too-large rsplen values (including ones > 2^31-1) */
+        tvb_ensure_bytes_exist (tvb, offset+24, rsplen);
+        offset += 24+rsplen;
         if (flags & 0x2) {
-            dissect_scsi_snsinfo (tvb, pinfo, tree, offset+24+rsplen,
-                                  tvb_get_ntohl (tvb, offset+16), 
+            dissect_scsi_snsinfo (tvb, pinfo, tree, offset,
+                                  snslen,
 				  (guint16) (cdata?cdata->fcp_lun:0xffff) );
         }
+        /* This handles too-large snslen values (including ones > 2^31-1) */
+        tvb_ensure_bytes_exist (tvb, offset, snslen);
+        offset += snslen;
+        proto_item_set_end (ti, tvb, offset);
         if (cdata) {
+            /*
+             * XXX - this isn't done if an exception is thrown.
+             */
             g_mem_chunk_free (fcp_req_vals, cdata);
             g_hash_table_remove (fcp_req_hash, &ckey);
         }
--- ethereal-0.10.10.orig/epan/dissectors/packet-fw1.c
+++ ethereal-0.10.10/epan/dissectors/packet-fw1.c
@@ -200,9 +200,9 @@
   if (tree) {
     if (!fw1_summary_in_tree)
       /* Do not show the summary in Protocol Tree */
-      ti = proto_tree_add_protocol_format(tree, proto_fw1, tvb, 0, ETH_HEADER_SIZE, fw1_header);
+      ti = proto_tree_add_protocol_format(tree, proto_fw1, tvb, 0, ETH_HEADER_SIZE, "%s", fw1_header);
     else
-      ti = proto_tree_add_protocol_format(tree, proto_fw1, tvb, 0, ETH_HEADER_SIZE, header);
+      ti = proto_tree_add_protocol_format(tree, proto_fw1, tvb, 0, ETH_HEADER_SIZE, "%s", header);
 
     /* create display subtree for the protocol */
     fh_tree = proto_item_add_subtree(ti, ett_fw1);
--- ethereal-0.10.10.orig/epan/dissectors/packet-giop.c
+++ ethereal-0.10.10/epan/dissectors/packet-giop.c
@@ -1760,6 +1760,8 @@
 
   if (len == 0)
     return FALSE;
+  if (*offset > header->message_size)
+    return FALSE;
 
   saved_proto = pinfo->current_proto;
   for (i=0; i<len; i++) {
@@ -4787,8 +4789,11 @@
   /* return if zero length sequence */
 
   if (seqlen == 0) {
-    if (tf)
+    if (tf) {
+      if (*offset - start_offset <= 0)
+        THROW(ReportedBoundsError);
       proto_item_set_len(tf, *offset - start_offset);
+    }
 
     return;
   }
@@ -4876,8 +4881,11 @@
 
   } /* for seqlen  */
 
-  if (tf)
+  if (tf) {
+    if (*offset - start_offset <= 0)
+      THROW(ReportedBoundsError);
     proto_item_set_len(tf, *offset - start_offset);
+  }
 
 }
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-gsm_a.c
+++ ethereal-0.10.10/epan/dissectors/packet-gsm_a.c
@@ -1898,10 +1898,10 @@
 	break;
 
     default:
-	proto_tree_add_text(tree, tvb, curr_offset, len - 1,
+	proto_tree_add_text(tree, tvb, curr_offset, len,
 	    "Cell ID - Unknown format");
 
-	curr_offset += (len - 1);
+	curr_offset += (len);
 	break;
     }
 
@@ -2190,7 +2190,7 @@
 
 	if (add_string[0] != '\0')
 	{
-	    proto_item_append_text(item, add_string);
+	    proto_item_append_text(item, "%s", add_string);
 	}
 
 	proto_item_set_len(item, consumed);
@@ -2199,7 +2199,7 @@
 
 	num_cells++;
     }
-    while ((len - (curr_offset - offset)) > 0);
+    while ((len - (curr_offset - offset)) > 0 && consumed > 0);
 
     sprintf(add_string, " - %u cell%s",
 	num_cells, plurality(num_cells, "", "s"));
@@ -11318,7 +11318,7 @@
 
 		if (a_add_string[0] != '\0')
 		{
-		    proto_item_append_text(item, a_add_string);
+		    proto_item_append_text(item, "%s", a_add_string);
 		    a_add_string[0] = '\0';
 		}
 	    }
@@ -11387,7 +11387,7 @@
 
 	    if (a_add_string[0] != '\0')
 	    {
-		proto_item_append_text(item, a_add_string);
+		proto_item_append_text(item, "%s", a_add_string);
 		a_add_string[0] = '\0';
 	    }
 	}
@@ -11460,7 +11460,7 @@
 
 	    if (a_add_string[0] != '\0')
 	    {
-		proto_item_append_text(item, a_add_string);
+		proto_item_append_text(item, "%s", a_add_string);
 		a_add_string[0] = '\0';
 	    }
 	}
@@ -11560,7 +11560,7 @@
 
 	    if (a_add_string[0] != '\0')
 	    {
-		proto_item_append_text(item, a_add_string);
+		proto_item_append_text(item, "%s", a_add_string);
 		a_add_string[0] = '\0';
 	    }
 	}
--- ethereal-0.10.10.orig/epan/dissectors/packet-gsm_map.c
+++ ethereal-0.10.10/epan/dissectors/packet-gsm_map.c
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* .\packet-gsm_map.c                                                         */
+/* ./packet-gsm_map.c                                                         */
 /* ../../tools/asn2eth.py -X -b -e -p gsm_map -c gsmmap.cnf -s packet-gsm_map-template GSMMAP.asn */
 
 /* Input file: packet-gsm_map-template.c */
@@ -12,7 +12,7 @@
  * Felix Fei <felix.fei [AT] utstar.com>
  * and Michael Lum <mlum [AT] telostech.com>
  *
- * $Id: packet-gsm_map.c 13486 2005-02-23 23:14:42Z etxrab $
+ * $Id: packet-gsm_map.c 14211 2005-04-28 03:41:05Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -70,6 +70,7 @@
 static int hf_gsm_map_global_errorCode_oid = -1;
 static int hf_gsm_map_global_errorCode = -1;
 static int hf_gsm_map_SendAuthenticationInfoArg = -1;
+static int hf_gsm_map_SendAuthenticationInfoRes = -1;
 static int hf_gsm_mapSendEndSignal = -1;
 static int hf_gsm_map_getPassword = -1;  
 static int hf_gsm_map_currentPassword = -1;
@@ -201,7 +202,11 @@
 static int hf_gsm_map_ck = -1;                    /* OCTET_STRING_SIZE_16 */
 static int hf_gsm_map_ik = -1;                    /* OCTET_STRING_SIZE_16 */
 static int hf_gsm_map_autn = -1;                  /* OCTET_STRING_SIZE_16 */
-static int hf_gsm_map_bearerService = -1;         /* OCTET_STRING */
+static int hf_gsm_map_imei = -1;                  /* Imei */
+static int hf_gsm_map_requestedEquipmentInfo = -1;  /* T_requestedEquipmentInfo */
+static int hf_gsm_map_equipmentStatus = -1;       /* EquipmentStatus */
+static int hf_gsm_map_bmuef = -1;                 /* T_bmuef */
+static int hf_gsm_map_bearerservice = -1;         /* Bearerservice */
 static int hf_gsm_map_teleservice = -1;           /* Teleservice */
 static int hf_gsm_map_BasicServiceGroupList_item = -1;  /* BasicService */
 static int hf_gsm_map_bcsmTriggerDetectionPoint = -1;  /* BcsmTriggerDetectionPoint */
@@ -214,8 +219,8 @@
 static int hf_gsm_map_msisdn = -1;                /* Msisdn */
 static int hf_gsm_map_category = -1;              /* OCTET_STRING_SIZE_1 */
 static int hf_gsm_map_subscriberStatus = -1;      /* SubscriberStatus */
-static int hf_gsm_map_bearerServiceList = -1;     /* bearerServiceList */
-static int hf_gsm_map_bearerServiceList_item = -1;  /* OCTET_STRING_SIZE_1_5 */
+static int hf_gsm_map_bearerserviceList = -1;     /* bearerServiceList */
+static int hf_gsm_map_bearerserviceList_item = -1;  /* Bearerservice */
 static int hf_gsm_map_teleserviceList = -1;       /* SEQUENCE_SIZE_1_20_OF_Teleservice */
 static int hf_gsm_map_teleserviceList_item = -1;  /* Teleservice */
 static int hf_gsm_map_provisionedSS = -1;         /* T_provisionedSS */
@@ -424,7 +429,6 @@
 static int hf_gsm_map_ps_PDP_ActiveReachableForPaging = -1;  /* T_ps_PDP_ActiveReachableForPaging */
 static int hf_gsm_map_ps_PDP_ActiveReachableForPaging_item = -1;  /* T_ps_PDP_ActiveReachableForPaging_item */
 static int hf_gsm_map_netDetNotReachable = -1;    /* T_netDetNotReachable */
-static int hf_gsm_map_imei = -1;                  /* Imei */
 static int hf_gsm_map_ms_Classmark2 = -1;         /* OCTET_STRING_SIZE_3 */
 static int hf_gsm_map_gprs_MS_Class = -1;         /* T_gprs_MS_Class */
 static int hf_gsm_map_mSNetworkCapability = -1;   /* OCTET_STRING_SIZE_1_8 */
@@ -668,6 +672,8 @@
 static int hf_gsm_map_T_offeredCamel4CSIs_mt_sms_csi = -1;
 static int hf_gsm_map_T_offeredCamel4CSIs_mg_csi = -1;
 static int hf_gsm_map_T_offeredCamel4CSIs_psi_enhancements = -1;
+static int hf_gsm_map_T_requestedEquipmentInfo_equipmentStatus = -1;
+static int hf_gsm_map_T_requestedEquipmentInfo_bmuef = -1;
 static int hf_gsm_map_Odb_GeneralData_allOGCallsBarred = -1;
 static int hf_gsm_map_Odb_GeneralData_internationalOGCallsBarred = -1;
 static int hf_gsm_map_Odb_GeneralData_internationalOGCallsNotToHPLMNCountryBarred = -1;
@@ -812,6 +818,10 @@
 static gint ett_gsm_map_T_tripletList_item = -1;
 static gint ett_gsm_map_T_quintupletList = -1;
 static gint ett_gsm_map_T_quintupletList_item = -1;
+static gint ett_gsm_map_CheckIMEIv2Arg = -1;
+static gint ett_gsm_map_T_requestedEquipmentInfo = -1;
+static gint ett_gsm_map_ChekIMEIv3Res = -1;
+static gint ett_gsm_map_T_bmuef = -1;
 static gint ett_gsm_map_BasicService = -1;
 static gint ett_gsm_map_BasicServiceGroupList = -1;
 static gint ett_gsm_map_Odb_GeneralData = -1;
@@ -1100,25 +1110,20 @@
 static dissector_handle_t data_handle;
 
 /* Preferenc settings default */
-static guint tcap_itu_ssn1 = 6;
-static guint tcap_itu_ssn2 = 7;
-static guint tcap_itu_ssn3 = 8;
-static guint tcap_itu_ssn4 = 9;
-
-static guint global_tcap_itu_ssn1 = 6;
-static guint global_tcap_itu_ssn2 = 7;
-static guint global_tcap_itu_ssn3 = 8;
-static guint global_tcap_itu_ssn4 = 9;
+#define MAX_SSN 254
+static range_t *global_ssn_range;
+static range_t *ssn_range;
+dissector_handle_t	map_handle;
 
 /* Global variables */
 
 static proto_tree *top_tree;
-int application_context_version;
+static int application_context_version;
 gint protocolId;
 static int gsm_map_tap = -1;
 
 
-static char*
+char*
 unpack_digits(tvbuff_t *tvb, int offset){
 
 	int length;
@@ -1127,8 +1132,10 @@
 	char *digit_str;
 
 	length = tvb_length(tvb);
+	if (length < offset)
+		return NULL;
 	length = length - offset;
-	digit_str = g_malloc(length+1);
+	digit_str = g_malloc(length*2+1);
 
 	while ( offset <= length ){
 
@@ -1845,6 +1852,8 @@
  digit_str = unpack_digits(parameter_tvb, 0);
 
  proto_tree_add_string(tree, hf_gsm_map_imsi_digits, parameter_tvb, 0, -1, digit_str);
+ if (digit_str)
+	g_free(digit_str);
  
 
 
@@ -2007,9 +2016,8 @@
  digit_str = unpack_digits(parameter_tvb, 1);
 
  proto_tree_add_string(tree, hf_gsm_map_map_hlr_number_digits, parameter_tvb, 1, -1, digit_str);
-
-
-
+ if (digit_str)
+	g_free(digit_str);
 
   return offset;
 }
@@ -2050,6 +2058,21 @@
 }
 
 
+static int
+dissect_gsm_map_Bearerservice(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
+  offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
+                                    NULL);
+
+  return offset;
+}
+static int dissect_bearerservice_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_Bearerservice(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_bearerservice);
+}
+static int dissect_bearerserviceList_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_Bearerservice(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_bearerserviceList_item);
+}
+
+
 static const value_string gsm_map_CancellationType_vals[] = {
   {   0, "updateProcedure" },
   {   1, "subscriptionWithdraw" },
@@ -3252,6 +3275,9 @@
 
   return offset;
 }
+static int dissect_imei(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_Imei(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_imei);
+}
 static int dissect_imei_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
   return dissect_gsm_map_Imei(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_imei);
 }
@@ -3264,6 +3290,39 @@
   return offset;
 }
 
+static const asn_namedbit T_requestedEquipmentInfo_bits[] = {
+  {  0, &hf_gsm_map_T_requestedEquipmentInfo_equipmentStatus, -1, -1, NULL, NULL },
+  {  1, &hf_gsm_map_T_requestedEquipmentInfo_bmuef, -1, -1, NULL, NULL },
+  { 0, NULL, 0, 0, NULL, NULL }
+};
+
+static int
+dissect_gsm_map_T_requestedEquipmentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
+  offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
+                                 T_requestedEquipmentInfo_bits, hf_index, ett_gsm_map_T_requestedEquipmentInfo,
+                                 NULL);
+
+  return offset;
+}
+static int dissect_requestedEquipmentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_T_requestedEquipmentInfo(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_requestedEquipmentInfo);
+}
+
+static const ber_sequence_t CheckIMEIv2Arg_sequence[] = {
+  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_imei },
+  { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_requestedEquipmentInfo },
+  { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_extensionContainer },
+  { 0, 0, 0, NULL }
+};
+
+static int
+dissect_gsm_map_CheckIMEIv2Arg(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
+  offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
+                                CheckIMEIv2Arg_sequence, hf_index, ett_gsm_map_CheckIMEIv2Arg);
+
+  return offset;
+}
+
 
 static const value_string gsm_map_EquipmentStatus_vals[] = {
   {   0, "whiteListed" },
@@ -3279,6 +3338,41 @@
 
   return offset;
 }
+static int dissect_equipmentStatus(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_EquipmentStatus(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_equipmentStatus);
+}
+
+static const ber_sequence_t T_bmuef_sequence[] = {
+  { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_uesbi_IuA_impl },
+  { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_uesbi_IuB_impl },
+  { 0, 0, 0, NULL }
+};
+
+static int
+dissect_gsm_map_T_bmuef(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
+  offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
+                                T_bmuef_sequence, hf_index, ett_gsm_map_T_bmuef);
+
+  return offset;
+}
+static int dissect_bmuef(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_T_bmuef(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_bmuef);
+}
+
+static const ber_sequence_t ChekIMEIv3Res_sequence[] = {
+  { BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_equipmentStatus },
+  { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_bmuef },
+  { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_extensionContainer_impl },
+  { 0, 0, 0, NULL }
+};
+
+static int
+dissect_gsm_map_ChekIMEIv3Res(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
+  offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
+                                ChekIMEIv3Res_sequence, hf_index, ett_gsm_map_ChekIMEIv3Res);
+
+  return offset;
+}
 
 
 static const value_string gsm_map_OverrideCategory_vals[] = {
@@ -3299,35 +3393,14 @@
 }
 
 
-static int
-dissect_gsm_map_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                    NULL);
-
-  return offset;
-}
-static int dissect_bearerService_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_gsm_map_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_bearerService);
-}
-static int dissect_dataCodingScheme_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_gsm_map_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_dataCodingScheme);
-}
-static int dissect_nameString_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_gsm_map_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_nameString);
-}
-static int dissect_lcsClientDialedByMS_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_gsm_map_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_lcsClientDialedByMS);
-}
-
-
 static const value_string gsm_map_BasicService_vals[] = {
-  {   2, "bearerService" },
+  {   2, "bearerservice" },
   {   3, "teleservice" },
   { 0, NULL }
 };
 
 static const ber_choice_t BasicService_choice[] = {
-  {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_bearerService_impl },
+  {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_bearerservice_impl },
   {   3, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_teleservice_impl },
   { 0, 0, 0, 0, NULL }
 };
@@ -3644,8 +3717,8 @@
  digit_str = unpack_digits(parameter_tvb, 1);
 
  proto_tree_add_string(tree, hf_gsm_map_misdn_digits, parameter_tvb, 1, -1, digit_str);
-
-
+ if (digit_str)
+	g_free(digit_str);
 
 
   return offset;
@@ -3657,29 +3730,8 @@
   return dissect_gsm_map_Msisdn(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_msisdn);
 }
 
-
-static int
-dissect_gsm_map_OCTET_STRING_SIZE_1_5(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                    NULL);
-
-  return offset;
-}
-static int dissect_bearerServiceList_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_gsm_map_OCTET_STRING_SIZE_1_5(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_bearerServiceList_item);
-}
-static int dissect_routeingNumber_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_gsm_map_OCTET_STRING_SIZE_1_5(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_routeingNumber);
-}
-static int dissect_ext_BearerService_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_gsm_map_OCTET_STRING_SIZE_1_5(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_ext_BearerService);
-}
-static int dissect_ext_Teleservice_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_gsm_map_OCTET_STRING_SIZE_1_5(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_ext_Teleservice);
-}
-
 static const ber_sequence_t bearerServiceList_sequence_of[1] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_bearerServiceList_item },
+  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_bearerserviceList_item },
 };
 
 static int
@@ -3689,8 +3741,8 @@
 
   return offset;
 }
-static int dissect_bearerServiceList_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_gsm_map_bearerServiceList(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_bearerServiceList);
+static int dissect_bearerserviceList_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_bearerServiceList(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_bearerserviceList);
 }
 
 static const ber_sequence_t SEQUENCE_SIZE_1_20_OF_Teleservice_sequence_of[1] = {
@@ -3776,6 +3828,8 @@
  digit_str = unpack_digits(parameter_tvb, 1);
 
  proto_tree_add_string(tree, hf_gsm_map_map_ForwardedToNumber_digits, parameter_tvb, 1, -1, digit_str);
+ if (digit_str)
+	g_free(digit_str);
 
 
   return offset;
@@ -5036,7 +5090,7 @@
   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_msisdn_impl },
   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_category_impl },
   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_subscriberStatus_impl },
-  { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_bearerServiceList_impl },
+  { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_bearerserviceList_impl },
   { BER_CLASS_CON, 6, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_teleserviceList_impl },
   { BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_provisionedSS_impl },
   { BER_CLASS_CON, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_odb_Data_impl },
@@ -5101,7 +5155,7 @@
 
 static const ber_sequence_t InsertSubscriberDataRes_sequence[] = {
   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_teleserviceList_impl },
-  { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_bearerServiceList_impl },
+  { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_bearerserviceList_impl },
   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ss_List_impl },
   { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_odb_GeneralData_impl },
   { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_regionalSubscriptionResponse_impl },
@@ -5475,8 +5529,8 @@
  digit_str = unpack_digits(parameter_tvb, 1);
 
  proto_tree_add_string(tree, hf_gsm_map_map_gmsc_address_digits, parameter_tvb, 1, -1, digit_str);
-
-
+ if (digit_str)
+	g_free(digit_str);
 
 
   return offset;
@@ -5619,7 +5673,8 @@
  digit_str = unpack_digits(parameter_tvb, 1);
 
  proto_tree_add_string(tree, hf_gsm_map_map_RoamingNumber_digits, parameter_tvb, 1, -1, digit_str);
-
+ if (digit_str)
+	g_free(digit_str);
 
   return offset;
 }
@@ -6141,6 +6196,24 @@
 }
 
 
+static int
+dissect_gsm_map_OCTET_STRING_SIZE_1_5(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
+  offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
+                                    NULL);
+
+  return offset;
+}
+static int dissect_routeingNumber_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_OCTET_STRING_SIZE_1_5(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_routeingNumber);
+}
+static int dissect_ext_BearerService_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_OCTET_STRING_SIZE_1_5(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_ext_BearerService);
+}
+static int dissect_ext_Teleservice_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_OCTET_STRING_SIZE_1_5(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_ext_Teleservice);
+}
+
+
 static const value_string gsm_map_NumberPortabilityStatus_vals[] = {
   {   0, "notKnownToBePorted" },
   {   1, "ownNumberPortedOut" },
@@ -7105,8 +7178,8 @@
  digit_str = unpack_digits(parameter_tvb, 1);
 
  proto_tree_add_string(tree, hf_gsm_map_servicecentreaddress_digits, parameter_tvb, 1, -1, digit_str);
-
-
+ if (digit_str)
+	g_free(digit_str);
 
 
   return offset;
@@ -9318,6 +9391,24 @@
   return dissect_gsm_map_LcsClientInternalID(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_lcsClientInternalID);
 }
 
+
+static int
+dissect_gsm_map_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
+  offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
+                                    NULL);
+
+  return offset;
+}
+static int dissect_dataCodingScheme_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_dataCodingScheme);
+}
+static int dissect_nameString_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_nameString);
+}
+static int dissect_lcsClientDialedByMS_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_gsm_map_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_lcsClientDialedByMS);
+}
+
 static const ber_sequence_t LcsClientName_sequence[] = {
   { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_dataCodingScheme_impl },
   { BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_nameString_impl },
@@ -10656,7 +10747,13 @@
     offset=dissect_gsm_map_UpdateLocationArg(FALSE, tvb, offset, pinfo, tree, -1);
     break;
   case  3: /*cancelLocation*/
+ 	octet = tvb_get_guint8(tvb,0) & 0xf;
+	if ( octet == 3){ /*   */
+		offset = offset +2;
+		offset=dissect_gsm_map_CancelLocationArg(TRUE, tvb, offset, pinfo, tree, -1);
+	}else{
     offset=dissect_gsm_map_CancelLocationArg(FALSE, tvb, offset, pinfo, tree, -1);
+	}
     break;
   case  4: /*provideRoamingNumber*/
     offset=dissect_gsm_map_ProvideRoamingNumberArg(FALSE, tvb, offset, pinfo, tree, -1);
@@ -10748,13 +10845,17 @@
     offset=dissect_gsm_map_ProcessGroupCallSignallingArg(FALSE, tvb, offset, pinfo, tree, -1);
     break;
   case 43: /*checkIMEI*/
-    offset=dissect_gsm_map_CheckIMEIArg(FALSE, tvb, offset, pinfo, tree, -1);
+	  if (application_context_version < 2 ){
+		  offset=dissect_gsm_map_CheckIMEIArg(FALSE, tvb, offset, pinfo, tree, -1);
+	  }else{
+		  offset=dissect_gsm_map_CheckIMEIv2Arg(FALSE, tvb, offset, pinfo, tree, -1);
+	  }
     break;
   case 44: /*mt-forwardSM*/
     offset=dissect_gsm_map_CheckIMEIArg(FALSE, tvb, offset, pinfo, tree, -1);
     break;
   case 45: /*sendRoutingInfoForSM*/
-    offset=dissect_gsm_map_RoutingInfoForSMRes(FALSE, tvb, offset, pinfo, tree, -1);
+    offset=dissect_gsm_map_RoutingInfoForSMArg(FALSE, tvb, offset, pinfo, tree, -1);
     break;
   case 46: /*mo-forwardSM*/
     offset=dissect_gsm_map_Mo_forwardSM_Arg(FALSE, tvb, offset, pinfo, tree, -1);
@@ -10868,7 +10969,13 @@
   guint8 octet;
   switch(opcode){
   case  2: /*updateLocation*/
+	  octet = tvb_get_guint8(tvb,offset);
+	  /* As it seems like SEQUENCE OF sometimes is omitted, find out if it's there */
+	  if ( octet == 0x30 ){ /* Class 0 Univerasl, P/C 1 Constructed,Tag 16 Sequence OF */
     offset=dissect_gsm_map_UpdateLocationRes(FALSE, tvb, offset, pinfo, tree, -1);
+	  }else{ /* Try decoding with IMPLICIT flag set */ 
+		  offset=dissect_gsm_map_UpdateLocationRes(TRUE, tvb, offset, pinfo, tree, -1);
+	  }
     break;
   case  3: /*cancelLocation*/
     offset=dissect_gsm_map_CancelLocationRes(FALSE, tvb, offset, pinfo, tree, -1);
@@ -10947,7 +11054,7 @@
     dissect_gsm_map_SendGroupCallEndSignalRes(FALSE, tvb, offset, pinfo, tree, -1);
     break;
   case 43: /*checkIMEI*/
-    offset=dissect_gsm_map_EquipmentStatus(FALSE, tvb, offset, pinfo, tree, -1);
+    offset=dissect_gsm_map_EquipmentStatus(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_equipmentStatus);
     break;
   case 45: /*sendRoutingInfoForSM*/
     offset=dissect_gsm_map_RoutingInfoForSMRes(FALSE, tvb, offset, pinfo, tree, -1);
@@ -10956,7 +11063,7 @@
     offset=dissect_gsm_map_Mo_forwardSM_Res(FALSE, tvb, offset, pinfo, tree, -1);
     break;
   case 48: /*reportSM-DeliveryStatus*/
-    offset=dissect_gsm_map_ReportSM_DeliveryStatusArg(FALSE, tvb, offset, pinfo, tree, -1);
+    offset=dissect_gsm_map_ReportSM_DeliveryStatusRes(FALSE, tvb, offset, pinfo, tree, -1);
     break;
   case 50: /*activateTraceMode*/
     offset=dissect_gsm_map_ActivateTraceModeRes(FALSE, tvb, offset, pinfo, tree, -1);
@@ -10967,14 +11074,19 @@
   case 55: /*sendIdentification*/
     offset=dissect_gsm_map_SendIdentificationRes(FALSE, tvb, offset, pinfo, tree, -1);
     break;
-  case 56:
-	  offset = dissect_gsm_map_SendAuthenticationInfoRes(FALSE, tvb, offset, pinfo, tree, -1);
+  case 56: /*sendAuthenticationInfo*/
+	  if (application_context_version < 3 ){
+		  offset=dissect_gsm_map_SendAuthenticationInfoRes(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_SendAuthenticationInfoRes);
+	  }else{
+		  offset=dissect_gsm_map_SendAuthenticationInfoV3Res(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_SendAuthenticationInfoRes);
+	  }
+	  break;
   case 57: /*restoreData*/
-	offset=dissect_gsm_map_RestoreDataRes(FALSE, tvb, offset, pinfo, tree, -1);
-	break;
+    offset=dissect_gsm_map_RestoreDataRes(FALSE, tvb, offset, pinfo, tree, -1);
+    break;
   case 58: /*sendIMSI*/
-	offset=dissect_gsm_map_Imsi(FALSE, tvb, offset, pinfo, tree,hf_gsm_map_imsi);
-	break;
+    offset=dissect_gsm_map_Imsi(FALSE, tvb, offset, pinfo, tree,hf_gsm_map_imsi);
+    break;
   case 59: /*unstructuredSS-Request*/
     offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1);
     break;
@@ -11203,15 +11315,17 @@
 static int
 dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo , proto_tree *tree, int hf_index) {
 
-	char *version_ptr, *version_str;
+  char *version_ptr, *version_str;
 
-	opcode = 0;
-	application_context_version = 0;
-	if (pinfo->private_data != NULL){
-		version_ptr = strrchr(pinfo->private_data,'.');
-		version_str = g_strdup(version_ptr+1);
-		application_context_version = atoi(version_str);
-	}
+  opcode = 0;
+  application_context_version = 0;
+  if (pinfo->private_data != NULL){
+    version_ptr = strrchr(pinfo->private_data,'.');
+    if (version_ptr) {
+      version_str = g_strdup(version_ptr+1);
+      application_context_version = atoi(version_str);
+    }
+  }
 
   gsmmap_pdu_type = tvb_get_guint8(tvb, offset)&0x0f;
   /* Get the length and add 2 */
@@ -11383,33 +11497,103 @@
 {0xdf, "plmn-specificTS-F" },
   { 0, NULL }
 };
+
+static const value_string Bearerservice_vals[] = {
+{0x00, "allBearerServices" },
+{0x10, "allDataCDA-Services" },
+{0x11, "dataCDA-300bps" },
+{0x12, "dataCDA-1200bps" },
+{0x13, "dataCDA-1200-75bps" },
+{0x14, "dataCDA-2400bps" },
+{0x15, "dataCDA-4800bps" },
+{0x16, "dataCDA-9600bps" },
+{0x17, "general-dataCDA" },
+
+{0x18, "allDataCDS-Services" },
+{0x1A, "dataCDS-1200bps" },
+{0x1C, "dataCDS-2400bps" },
+{0x1D, "dataCDS-4800bps" },
+{0x1E, "dataCDS-9600bps" },
+{0x1F, "general-dataCDS" },
+
+{0x20, "allPadAccessCA-Services" },
+{0x21, "padAccessCA-300bps" },
+{0x22, "padAccessCA-1200bps" },
+{0x23, "padAccessCA-1200-75bps" },
+{0x24, "padAccessCA-2400bps" },
+{0x25, "padAccessCA-4800bps" },
+{0x26, "padAccessCA-9600bps" },
+{0x27, "general-padAccessCA" },
+
+{0x28, "allDataPDS-Services" },
+{0x2C, "dataPDS-2400bps" },
+{0x2D, "dataPDS-4800bps" },
+{0x2E, "dataPDS-9600bps" },
+{0x2F, "general-dataPDS" },
+
+{0x30, "allAlternateSpeech-DataCDA" },
+{0x38, "allAlternateSpeech-DataCDS" },
+{0x40, "allSpeechFollowedByDataCDA" },
+{0x48, "allSpeechFollowedByDataCDS" },
+
+{0x50, "allDataCircuitAsynchronous" },
+{0x60, "allAsynchronousServices" },
+{0x58, "allDataCircuitSynchronous" },
+{0x68, "allSynchronousServices" },
+
+{0xD0, "allPLMN-specificBS" },
+{0xD1, "plmn-specificBS-1" },
+{0xD2, "plmn-specificBS-2" },
+{0xD3, "plmn-specificBS-3" },
+{0xD4, "plmn-specificBS-4" },
+{0xD5, "plmn-specificBS-5" },
+{0xD6, "plmn-specificBS-6" },
+{0xD7, "plmn-specificBS-7" },
+{0xD8, "plmn-specificBS-8" },
+{0xD9, "plmn-specificBS-9" },
+{0xDA, "plmn-specificBS-A" },
+{0xDB, "plmn-specificBS-B" },
+{0xDC, "plmn-specificBS-C" },
+{0xDD, "plmn-specificBS-D" },
+{0xDE, "plmn-specificBS-E" },
+{0xDF, "plmn-specificBS-F" },
+
+{ 0, NULL }
+};
+
 /*--- proto_reg_handoff_gsm_map ---------------------------------------*/
+static void range_delete_callback(guint32 ssn)
+{
+    if (ssn) {
+	dissector_delete("tcap.itu_ssn", ssn, map_handle);
+    }
+}
+
+static void range_add_callback(guint32 ssn)
+{
+    if (ssn) {
+	dissector_add("tcap.itu_ssn", ssn, map_handle);
+    }
+}
+
 void proto_reg_handoff_gsm_map(void) {
-    dissector_handle_t	map_handle;
-	static int map_prefs_initialized = FALSE;
 
-    map_handle = create_dissector_handle(dissect_gsm_map, proto_gsm_map);
-	data_handle = find_dissector("data");
+    static int map_prefs_initialized = FALSE;
+    data_handle = find_dissector("data");
+
+    if (!map_prefs_initialized) {
+	map_prefs_initialized = TRUE;
+	map_handle = create_dissector_handle(dissect_gsm_map, proto_gsm_map);
+    }
+    else {
+	range_foreach(ssn_range, range_delete_callback);
+    }
+
+    g_free(ssn_range);
+    ssn_range = range_copy(global_ssn_range);
+
+    range_foreach(ssn_range, range_add_callback);
 
-	if (!map_prefs_initialized) {
-		map_prefs_initialized = TRUE;
-	}
-	else {
-		dissector_delete("tcap.itu_ssn", tcap_itu_ssn1, map_handle);
-		dissector_delete("tcap.itu_ssn", tcap_itu_ssn2, map_handle);
-		dissector_delete("tcap.itu_ssn", tcap_itu_ssn3, map_handle);
-		dissector_delete("tcap.itu_ssn", tcap_itu_ssn4, map_handle);
-	}
-		/* Set our sub system number for future use */
-	tcap_itu_ssn1 = global_tcap_itu_ssn1;
-	tcap_itu_ssn2 = global_tcap_itu_ssn2;
-	tcap_itu_ssn3 = global_tcap_itu_ssn3;
-	tcap_itu_ssn4 = global_tcap_itu_ssn4;
-
-    dissector_add("tcap.itu_ssn", tcap_itu_ssn1, map_handle);
-    dissector_add("tcap.itu_ssn", tcap_itu_ssn2, map_handle);
-    dissector_add("tcap.itu_ssn", tcap_itu_ssn3, map_handle);
-    dissector_add("tcap.itu_ssn", tcap_itu_ssn4, map_handle);
 }
 
 /*--- proto_register_gsm_map -------------------------------------------*/
@@ -11438,6 +11622,10 @@
       { "SendAuthenticationInfoArg", "gsm_map.SendAuthenticationInfoArg",
         FT_BYTES, BASE_NONE, NULL, 0,
         "SendAuthenticationInfoArg", HFILL }},
+	{ &hf_gsm_map_SendAuthenticationInfoRes,
+      { "SendAuthenticationInfoRes", "gsm_map.SendAuthenticationInfoRes",
+        FT_BYTES, BASE_NONE, NULL, 0,
+        "SendAuthenticationInfoRes", HFILL }},
     { &hf_gsm_map_currentPassword,
       { "currentPassword", "gsm_map.currentPassword",
         FT_STRING, BASE_NONE, NULL, 0,
@@ -11535,11 +11723,11 @@
         FT_BOOLEAN, 8, TFS(&gsm_map_Ss_Status_p_values), 0x04,
         "P bit", HFILL }},
 	{ &hf_gsm_map_Ss_Status_r_bit,
-      { "R bit", "ss_status_r_bit",
+      { "R bit", "gsm_map.ss_status_r_bit",
         FT_BOOLEAN, 8, TFS(&gsm_map_Ss_Status_r_values), 0x02,
         "R bit", HFILL }},
 	{ &hf_gsm_map_Ss_Status_a_bit,
-      { "A bit", "ss_status_a_bit",
+      { "A bit", "gsm_map.ss_status_a_bit",
         FT_BOOLEAN, 8, TFS(&gsm_map_Ss_Status_a_values), 0x01,
         "A bit", HFILL }},
 
@@ -11853,11 +12041,11 @@
     { &hf_gsm_map_uesbi_IuA,
       { "uesbi-IuA", "gsm_map.uesbi_IuA",
         FT_BYTES, BASE_HEX, NULL, 0,
-        "PrepareHandoverV3Arg/uesbi-Iu/uesbi-IuA", HFILL }},
+        "", HFILL }},
     { &hf_gsm_map_uesbi_IuB,
       { "uesbi-IuB", "gsm_map.uesbi_IuB",
         FT_BYTES, BASE_HEX, NULL, 0,
-        "PrepareHandoverV3Arg/uesbi-Iu/uesbi-IuB", HFILL }},
+        "", HFILL }},
     { &hf_gsm_map_handoverNumber,
       { "handoverNumber", "gsm_map.handoverNumber",
         FT_BYTES, BASE_HEX, NULL, 0,
@@ -11982,10 +12170,26 @@
       { "autn", "gsm_map.autn",
         FT_BYTES, BASE_HEX, NULL, 0,
         "SendAuthenticationInfoV3Res/authenticationSetList/quintupletList/_item/autn", HFILL }},
-    { &hf_gsm_map_bearerService,
-      { "bearerService", "gsm_map.bearerService",
+    { &hf_gsm_map_imei,
+      { "imei", "gsm_map.imei",
+        FT_BYTES, BASE_HEX, NULL, 0,
+        "", HFILL }},
+    { &hf_gsm_map_requestedEquipmentInfo,
+      { "requestedEquipmentInfo", "gsm_map.requestedEquipmentInfo",
         FT_BYTES, BASE_HEX, NULL, 0,
-        "BasicService/bearerService", HFILL }},
+        "CheckIMEIv2Arg/requestedEquipmentInfo", HFILL }},
+    { &hf_gsm_map_equipmentStatus,
+      { "equipmentStatus", "gsm_map.equipmentStatus",
+        FT_UINT32, BASE_DEC, VALS(gsm_map_EquipmentStatus_vals), 0,
+        "ChekIMEIv3Res/equipmentStatus", HFILL }},
+    { &hf_gsm_map_bmuef,
+      { "bmuef", "gsm_map.bmuef",
+        FT_NONE, BASE_NONE, NULL, 0,
+        "ChekIMEIv3Res/bmuef", HFILL }},
+    { &hf_gsm_map_bearerservice,
+      { "bearerservice", "gsm_map.bearerservice",
+        FT_UINT8, BASE_DEC, VALS(Bearerservice_vals), 0,
+        "BasicService/bearerservice", HFILL }},
     { &hf_gsm_map_teleservice,
       { "teleservice", "gsm_map.teleservice",
         FT_UINT8, BASE_DEC, VALS(Teleservice_vals), 0,
@@ -12034,13 +12238,13 @@
       { "subscriberStatus", "gsm_map.subscriberStatus",
         FT_UINT32, BASE_DEC, VALS(gsm_map_SubscriberStatus_vals), 0,
         "InsertSubscriberDataArg/subscriberStatus", HFILL }},
-    { &hf_gsm_map_bearerServiceList,
-      { "bearerServiceList", "gsm_map.bearerServiceList",
+    { &hf_gsm_map_bearerserviceList,
+      { "bearerserviceList", "gsm_map.bearerserviceList",
         FT_NONE, BASE_NONE, NULL, 0,
         "", HFILL }},
-    { &hf_gsm_map_bearerServiceList_item,
-      { "Item", "gsm_map.bearerServiceList_item",
-        FT_BYTES, BASE_HEX, NULL, 0,
+    { &hf_gsm_map_bearerserviceList_item,
+      { "Item", "gsm_map.bearerserviceList_item",
+        FT_UINT8, BASE_DEC, VALS(Bearerservice_vals), 0,
         "", HFILL }},
     { &hf_gsm_map_teleserviceList,
       { "teleserviceList", "gsm_map.teleserviceList",
@@ -12874,10 +13078,6 @@
       { "netDetNotReachable", "gsm_map.netDetNotReachable",
         FT_UINT32, BASE_DEC, VALS(gsm_map_T_netDetNotReachable_vals), 0,
         "SubscriberInfo/ps-SubscriberState/netDetNotReachable", HFILL }},
-    { &hf_gsm_map_imei,
-      { "imei", "gsm_map.imei",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "", HFILL }},
     { &hf_gsm_map_ms_Classmark2,
       { "ms-Classmark2", "gsm_map.ms_Classmark2",
         FT_BYTES, BASE_HEX, NULL, 0,
@@ -13846,6 +14046,14 @@
       { "psi-enhancements", "gsm_map.psi-enhancements",
         FT_BOOLEAN, 8, NULL, 0x02,
         "", HFILL }},
+    { &hf_gsm_map_T_requestedEquipmentInfo_equipmentStatus,
+      { "equipmentStatus", "gsm_map.equipmentStatus",
+        FT_BOOLEAN, 8, NULL, 0x80,
+        "", HFILL }},
+    { &hf_gsm_map_T_requestedEquipmentInfo_bmuef,
+      { "bmuef", "gsm_map.bmuef",
+        FT_BOOLEAN, 8, NULL, 0x40,
+        "", HFILL }},
     { &hf_gsm_map_Odb_GeneralData_allOGCallsBarred,
       { "allOGCallsBarred", "gsm_map.allOGCallsBarred",
         FT_BOOLEAN, 8, NULL, 0x80,
@@ -14216,6 +14424,10 @@
     &ett_gsm_map_T_tripletList_item,
     &ett_gsm_map_T_quintupletList,
     &ett_gsm_map_T_quintupletList_item,
+    &ett_gsm_map_CheckIMEIv2Arg,
+    &ett_gsm_map_T_requestedEquipmentInfo,
+    &ett_gsm_map_ChekIMEIv3Res,
+    &ett_gsm_map_T_bmuef,
     &ett_gsm_map_BasicService,
     &ett_gsm_map_BasicServiceGroupList,
     &ett_gsm_map_Odb_GeneralData,
@@ -14508,73 +14720,64 @@
   proto_register_field_array(proto_gsm_map, hf, array_length(hf));
   proto_register_subtree_array(ett, array_length(ett));
 
-	sms_dissector_table = register_dissector_table("gsm_map.sms_tpdu", 
-		"GSM SMS TPDU",FT_UINT8, BASE_DEC);
-
-	gsm_map_tap = register_tap("gsm_map");
-	register_ber_oid_name("0.4.0.0.1.0.1.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkLocUp(1) version3(3)" );
-	register_ber_oid_name("0.4.0.0.1.0.1.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkLocUp(1) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.2.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locationCancel(2) version3(3)" );
-	register_ber_oid_name("0.4.0.0.1.0.2.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locationCancel(2) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.2.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locationCancel(2) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.3.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) roamingNbEnquiry(3) version3(3)" );
-	register_ber_oid_name("0.4.0.0.1.0.3.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) roamingNbEnquiry(3) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.3.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) roamingNbEnquiry(3) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.5.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locInfoRetrieval(5) version3(3)" );
-	register_ber_oid_name("0.4.0.0.1.0.5.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locInfoRetrieval(5) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.5.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locInfoRetrieval(5) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.10.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) reset(10) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.10.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) reset(10) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.11.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) handoverControl(11) version3(3)" );
-	register_ber_oid_name("0.4.0.0.1.0.11.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) handoverControl(11) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.11.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) handoverControl(11) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.26.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) imsiRetrieval(26) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.13.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) equipmentMngt(13) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.13.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) equipmentMngt(13) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.14.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) infoRetrieval(14) version3(3)" );
-	register_ber_oid_name("0.4.0.0.1.0.14.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) infoRetrieval(14) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.14.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) infoRetrieval(14) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.15.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) interVlrInfoRetrieval(15) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.16.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) subscriberDataMngt(16) version3(3)" );
-	register_ber_oid_name("0.4.0.0.1.0.16.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) subscriberDataMngt(16) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.16.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) subscriberDataMngt(16) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.17.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) tracing(17) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.17.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) tracing(17) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.18.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkFunctionalSs(18) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.18.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkFunctionalSs(18) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.19.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkUnstructuredSs(19) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.20.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgGateway(20) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.20.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgGateway(20) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.21.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgMO-Relay(21) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.21.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) --shortMsgRelay--21 version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.23.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgAlert(23) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.23.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgAlert(23) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.24.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) mwdMngt(24) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.24.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) mwdMngt(24) version1(1)" );
-	register_ber_oid_name("0.4.0.0.1.0.25.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgMT-Relay(25) version2(2)" );
-	register_ber_oid_name("0.4.0.0.1.0.25.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) msPurging(27) version2(2)" );
-
-	/* Register our configuration options, particularly our ssn:s */
-
-	gsm_map_module = prefs_register_protocol(proto_gsm_map, proto_reg_handoff_gsm_map);
-	prefs_register_uint_preference(gsm_map_module, "tcap.itu_ssn1",
-		"Subsystem number used for GSM MAP 1",
-		"Set Subsystem number used for GSM MAP",
-		10, &global_tcap_itu_ssn1);
-	prefs_register_uint_preference(gsm_map_module, "tcap.itu_ssn2",
-		"Subsystem number used for GSM MAP 2",
-		"Set Subsystem number used for GSM MAP",
-		10, &global_tcap_itu_ssn2);
-	prefs_register_uint_preference(gsm_map_module, "tcap.itu_ssn3",
-		"Subsystem number used for GSM MAP 3",
-		"Set Subsystem number used for GSM MAP",
-		10, &global_tcap_itu_ssn3);
-	prefs_register_uint_preference(gsm_map_module, "tcap.itu_ssn4",
-		"Subsystem number used for GSM MAP 4",
-		"Set Subsystem number used for GSM MAP",
-		10, &global_tcap_itu_ssn4);
-
-
+  sms_dissector_table = register_dissector_table("gsm_map.sms_tpdu", 
+						 "GSM SMS TPDU", FT_UINT8,
+						 BASE_DEC);
+
+  gsm_map_tap = register_tap("gsm_map");
+  register_ber_oid_name("0.4.0.0.1.0.1.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkLocUp(1) version3(3)" );
+  register_ber_oid_name("0.4.0.0.1.0.1.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkLocUp(1) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.2.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locationCancel(2) version3(3)" );
+  register_ber_oid_name("0.4.0.0.1.0.2.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locationCancel(2) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.2.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locationCancel(2) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.3.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) roamingNbEnquiry(3) version3(3)" );
+  register_ber_oid_name("0.4.0.0.1.0.3.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) roamingNbEnquiry(3) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.3.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) roamingNbEnquiry(3) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.5.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locInfoRetrieval(5) version3(3)" );
+  register_ber_oid_name("0.4.0.0.1.0.5.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locInfoRetrieval(5) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.5.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locInfoRetrieval(5) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.10.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) reset(10) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.10.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) reset(10) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.11.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) handoverControl(11) version3(3)" );
+  register_ber_oid_name("0.4.0.0.1.0.11.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) handoverControl(11) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.11.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) handoverControl(11) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.26.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) imsiRetrieval(26) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.13.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) equipmentMngt(13) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.13.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) equipmentMngt(13) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.14.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) infoRetrieval(14) version3(3)" );
+  register_ber_oid_name("0.4.0.0.1.0.14.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) infoRetrieval(14) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.14.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) infoRetrieval(14) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.15.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) interVlrInfoRetrieval(15) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.16.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) subscriberDataMngt(16) version3(3)" );
+  register_ber_oid_name("0.4.0.0.1.0.16.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) subscriberDataMngt(16) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.16.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) subscriberDataMngt(16) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.17.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) tracing(17) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.17.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) tracing(17) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.18.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkFunctionalSs(18) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.18.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkFunctionalSs(18) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.19.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkUnstructuredSs(19) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.20.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgGateway(20) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.20.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgGateway(20) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.21.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgMO-Relay(21) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.21.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) --shortMsgRelay--21 version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.23.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgAlert(23) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.23.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgAlert(23) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.24.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) mwdMngt(24) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.24.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) mwdMngt(24) version1(1)" );
+  register_ber_oid_name("0.4.0.0.1.0.25.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgMT-Relay(25) version2(2)" );
+  register_ber_oid_name("0.4.0.0.1.0.25.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) msPurging(27) version2(2)" );
+
+  /* Register our configuration options, particularly our ssn:s */
+  /* Set default SSNs */
+  range_convert_str(&global_ssn_range, "6-9", MAX_SSN);
+  ssn_range = range_empty();
+
+
+  gsm_map_module = prefs_register_protocol(proto_gsm_map, proto_reg_handoff_gsm_map);
+
+  prefs_register_range_preference(gsm_map_module, "tcap.ssn", "TCAP SSNs",
+				  "TCAP Subsystem numbers used for GSM MAP",
+				  &global_ssn_range, MAX_SSN);
 }
 
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-gsm_sms.c
+++ ethereal-0.10.10/epan/dissectors/packet-gsm_sms.c
@@ -1767,17 +1767,19 @@
 }
 
 /* 9.2.3.24 */
+#define NUM_FILL_BITS_MASKS 6
 static void
 dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gboolean udhi, guint8 udl,
     gboolean seven_bit, gboolean eight_bit, gboolean ucs2, gboolean compressed)
 {
-    static guint8	fill_bits_mask[] = { 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc };
+    static guint8	fill_bits_mask[NUM_FILL_BITS_MASKS] =
+	{ 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc };
     proto_item	*item;
     proto_item	*udh_item;
     proto_tree	*subtree = NULL;
     proto_tree	*udh_subtree = NULL;
-    guint8	oct;
-    guint8	fill_bits;
+    guint	oct;
+    guint	fill_bits;
     guint32	out_len;
     char	*ustr;
 
@@ -1823,7 +1825,7 @@
 	    /* step over fill bits ? */
 
 	    fill_bits = 7 - (((oct + 1) * 8) % 7);
-	    if (fill_bits != 7)
+	    if (fill_bits < NUM_FILL_BITS_MASKS)
 	    {
 		oct = tvb_get_guint8(tvb, offset);
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-gtp.c
+++ ethereal-0.10.10/epan/dissectors/packet-gtp.c
@@ -1364,9 +1364,9 @@
 	for (i = 0; i < 8; i++) {
 		bits8to5 = (ad[i] >> 4) & 0x0F;
 		bits4to1 = ad[i] & 0x0F;
-		if (bits8to5 < 0xA) 
-			str[j++] = hex_digits[bits4to1];
 		if (bits4to1 < 0xA) 
+			str[j++] = hex_digits[bits4to1];
+		if (bits8to5 < 0xA) 
 			str[j++] = hex_digits[bits8to5];
 	}
 	str[j] = '\0';
--- ethereal-0.10.10.orig/epan/dissectors/packet-h1.c
+++ ethereal-0.10.10/epan/dissectors/packet-h1.c
@@ -240,6 +240,8 @@
             return FALSE;
 	    break;
 	}
+	if (tvb_get_guint8(tvb,offset + position + 1) < 1)
+	    THROW(ReportedBoundsError);
 	position += tvb_get_guint8(tvb,offset + position + 1);	/* Goto next section */
     }			/* ..while */
   next_tvb = tvb_new_subset(tvb, offset+tvb_get_guint8(tvb,offset+2), -1, -1);
--- ethereal-0.10.10.orig/epan/dissectors/packet-h245.c
+++ ethereal-0.10.10/epan/dissectors/packet-h245.c
@@ -9,7 +9,7 @@
  * Routines for h245 packet dissection
  * Copyright 2004, Anders Broman <anders.broman@ericsson.com>
  *
- * $Id: packet-h245.c 13717 2005-03-11 14:35:55Z gerald $
+ * $Id: packet-h245.c 14072 2005-04-14 04:26:00Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -9866,7 +9866,7 @@
 		src_addr.len=4;
 		src_addr.data=(char *)&ipv4_address;
 
-		rtp_add_address(pinfo, &src_addr, ipv4_port, 0, "H245", pinfo->fd->num, 0);
+		rtp_add_address(pinfo, &src_addr, ipv4_port, 0, "H245", pinfo->fd->num, NULL);
 	}
 	if((!pinfo->fd->flags.visited) && rtcp_ipv4_address!=0 && rtcp_ipv4_port!=0 && rtcp_handle){
 		address src_addr;
@@ -12539,7 +12539,7 @@
 		src_addr.len=4;
 		src_addr.data=(char *)&ipv4_address;
 
-		rtp_add_address(pinfo, &src_addr, ipv4_port, 0, "H245", pinfo->fd->num, 0);
+		rtp_add_address(pinfo, &src_addr, ipv4_port, 0, "H245", pinfo->fd->num, NULL);
 	}
 	if((!pinfo->fd->flags.visited) && rtcp_ipv4_address!=0 && rtcp_ipv4_port!=0 && rtcp_handle){
 		address src_addr;
@@ -16376,7 +16376,7 @@
 
   if (h245_pi != NULL) h245_pi->msg_type = H245_OpenLogChn;
 
-  if (codec_str){
+  if (codec_str && codec_type){
         strncpy(codec_str, codec_type, 50);
   }
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-iapp.c
+++ ethereal-0.10.10/epan/dissectors/packet-iapp.c
@@ -320,7 +320,7 @@
 					{
 						if (!first)
 							proto_item_append_text(ti, " ");
-						proto_item_append_text(ti, strval);
+						proto_item_append_text(ti, "%s", strval);
 					}
 				}
 			proto_item_append_text(ti, ")");
--- ethereal-0.10.10.orig/epan/dissectors/packet-iax2.c
+++ ethereal-0.10.10/epan/dissectors/packet-iax2.c
@@ -8,7 +8,7 @@
  * IAX2 is a VoIP protocol for the open source PBX Asterisk. Please see
  * http://www.asterisk.org for more information.
  *
- * $Id: packet-iax2.c 13374 2005-02-10 08:07:44Z guy $
+ * $Id: packet-iax2.c 14222 2005-04-28 19:16:54Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -43,7 +43,7 @@
 #include "iax2_codec_type.h"
 
 #define IAX2_PORT		4569
-#define PROTO_TAG_IAX2	"IAX2"
+#define PROTO_TAG_IAX2		"IAX2"
 
 /* #define DEBUG_HASHING */
 
@@ -121,6 +121,30 @@
 static int hf_IAX_IE_MUSICONHOLD = -1;
 static int hf_IAX_IE_TRANSFERID = -1;
 static int hf_IAX_IE_RDNIS = -1;
+static int hf_IAX_IE_PROVISIONING = -1;
+static int hf_IAX_IE_AESPROVISIONING = -1;
+static int hf_IAX_IE_DATETIME = -1;
+static int hf_IAX_IE_DEVICETYPE = -1;
+static int hf_IAX_IE_SERVICEIDENT = -1;
+static int hf_IAX_IE_FIRMWAREVER = -1;
+static int hf_IAX_IE_FWBLOCKDESC = -1;
+static int hf_IAX_IE_FWBLOCKDATA = -1;
+static int hf_IAX_IE_PROVVER = -1;
+static int hf_IAX_IE_CALLINGPRES = -1;
+static int hf_IAX_IE_CALLINGTON = -1;
+static int hf_IAX_IE_CALLINGTNS = -1;
+static int hf_IAX_IE_SAMPLINGRATE = -1;
+static int hf_IAX_IE_CAUSECODE = -1;
+static int hf_IAX_IE_ENCRYPTION = -1;
+static int hf_IAX_IE_ENCKEY = -1;
+static int hf_IAX_IE_CODEC_PREFS = -1;
+static int hf_IAX_IE_RR_JITTER = -1;
+static int hf_IAX_IE_RR_LOSS = -1;
+static int hf_IAX_IE_RR_PKTS = -1;
+static int hf_IAX_IE_RR_DELAY = -1;
+static int hf_IAX_IE_RR_DROPPED = -1;
+static int hf_IAX_IE_RR_OOO = -1;
+
 static int hf_IAX_IE_DATAFORMAT = -1;
 static int hf_IAX_IE_UNKNOWN_BYTE = -1;
 static int hf_IAX_IE_UNKNOWN_I16 = -1;
@@ -193,6 +217,9 @@
   {32, "MWI"},
   {33, "UNSUPPORTED"},
   {34, "TRANSFER"},
+  {35, "PROVISION"},
+  {36, "FWDOWNL"},
+  {37, "FWDATA"},
   {0,NULL}
 };
 
@@ -243,6 +270,26 @@
   {IAX_IE_PROVISIONING, "Provisioning info"},
   {IAX_IE_AESPROVISIONING, "AES Provisioning info"},
   {IAX_IE_DATETIME,"Date/Time"},
+  {IAX_IE_DEVICETYPE, "Device type"},
+  {IAX_IE_SERVICEIDENT, "Service Identifier"},
+  {IAX_IE_FIRMWAREVER, "Firmware revision"},
+  {IAX_IE_FWBLOCKDESC, "Firmware block description"},
+  {IAX_IE_FWBLOCKDATA, "Firmware block of data"},
+  {IAX_IE_PROVVER, "Provisioning version"},
+  {IAX_IE_CALLINGPRES, "Calling presentation"},
+  {IAX_IE_CALLINGTON, "Calling type of number"},
+  {IAX_IE_CALLINGTNS, "Calling transit network select"},
+  {IAX_IE_SAMPLINGRATE, "Supported sampling rates"},
+  {IAX_IE_CAUSECODE, "Hangup cause"},
+  {IAX_IE_ENCRYPTION, "Encryption format"},
+  {IAX_IE_ENCKEY, "Raw encryption key"},
+  {IAX_IE_CODEC_PREFS, "Codec preferences"},
+  {IAX_IE_RR_JITTER, "Received jitter"},
+  {IAX_IE_RR_LOSS, "Received loss"},
+  {IAX_IE_RR_PKTS, "Received frames"},
+  {IAX_IE_RR_DELAY, "Max playout delay in ms for received frames"},
+  {IAX_IE_RR_DROPPED, "Dropped frames"},
+  {IAX_IE_RR_OOO, "Frames received out of order"},
   {IAX_IE_DATAFORMAT, "Data call format"},
   {0,NULL}
 };
@@ -288,6 +335,54 @@
   {0,NULL}
 };
   
+static const value_string iax_causecodes[] = {
+  {AST_CAUSE_UNALLOCATED, "Unallocated"},
+  {AST_CAUSE_NO_ROUTE_TRANSIT_NET, "No route transit net"},
+  {AST_CAUSE_NO_ROUTE_DESTINATION, "No route to destination"},
+  {AST_CAUSE_CHANNEL_UNACCEPTABLE, "Channel unacceptable"},
+  {AST_CAUSE_CALL_AWARDED_DELIVERED, "Call awarded delivered"},
+  {AST_CAUSE_NORMAL_CLEARING, "Normal clearing"},
+  {AST_CAUSE_USER_BUSY, "User busy"},
+  {AST_CAUSE_NO_USER_RESPONSE, "No user response"},
+  {AST_CAUSE_NO_ANSWER, "No answer"},
+  {AST_CAUSE_CALL_REJECTED, "Call rejected"},
+  {AST_CAUSE_NUMBER_CHANGED, "Number changed"},
+  {AST_CAUSE_DESTINATION_OUT_OF_ORDER, "Destination out of order"},
+  {AST_CAUSE_INVALID_NUMBER_FORMAT, "Invalid number format"},
+  {AST_CAUSE_FACILITY_REJECTED, "Facility rejected"},
+  {AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY, "Response to status inquiry"},
+  {AST_CAUSE_NORMAL_UNSPECIFIED, "Normal unspecified"},
+  {AST_CAUSE_NORMAL_CIRCUIT_CONGESTION, "Normal circuit congestion"},
+  {AST_CAUSE_NETWORK_OUT_OF_ORDER, "Network out of order"},
+  {AST_CAUSE_NORMAL_TEMPORARY_FAILURE, "Normal temporary failure"},
+  {AST_CAUSE_SWITCH_CONGESTION, "Switch congestion"},
+  {AST_CAUSE_ACCESS_INFO_DISCARDED, "Access info discarded"},
+  {AST_CAUSE_REQUESTED_CHAN_UNAVAIL, "Requested channel unavailable"},
+  {AST_CAUSE_PRE_EMPTED, "Preempted"},
+  {AST_CAUSE_FACILITY_NOT_SUBSCRIBED, "Facility not subscribed"},
+  {AST_CAUSE_OUTGOING_CALL_BARRED, "Outgoing call barred"},
+  {AST_CAUSE_INCOMING_CALL_BARRED, "Incoming call barred"},
+  {AST_CAUSE_BEARERCAPABILITY_NOTAUTH, "Bearer capability not authorized"},
+  {AST_CAUSE_BEARERCAPABILITY_NOTAVAIL, "Bearer capability not available"},
+  {AST_CAUSE_BEARERCAPABILITY_NOTIMPL, "Bearer capability not implemented"},
+  {AST_CAUSE_CHAN_NOT_IMPLEMENTED, "Channel not implemented"},
+  {AST_CAUSE_FACILITY_NOT_IMPLEMENTED, "Facility not implemented"},
+  {AST_CAUSE_INVALID_CALL_REFERENCE, "Invalid call reference"},
+  {AST_CAUSE_INCOMPATIBLE_DESTINATION, "Incompatible destination"},
+  {AST_CAUSE_INVALID_MSG_UNSPECIFIED, "Invalid message unspecified"},
+  {AST_CAUSE_MANDATORY_IE_MISSING, "Mandatory IE missing"},
+  {AST_CAUSE_MESSAGE_TYPE_NONEXIST, "Message type nonexistent"},
+  {AST_CAUSE_WRONG_MESSAGE, "Wrong message"},
+  {AST_CAUSE_IE_NONEXIST, "IE nonexistent"},
+  {AST_CAUSE_INVALID_IE_CONTENTS, "Invalid IE contents"},
+  {AST_CAUSE_WRONG_CALL_STATE, "Wrong call state"},
+  {AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE, "Recovery on timer expire"},
+  {AST_CAUSE_MANDATORY_IE_LENGTH_ERROR, "Mandatory IE length error"},
+  {AST_CAUSE_PROTOCOL_ERROR, "Protocol error"},
+  {AST_CAUSE_INTERWORKING, "Interworking"},
+  {0, NULL}
+};
+
 
 /* ************************************************************************* */
 
@@ -984,6 +1079,7 @@
 	      proto_tree *codec_tree;
 	      proto_item *codec_base;
 
+	      if (ies_len != 4) THROW(ReportedBoundsError);
 	      codec_base =
 		proto_tree_add_item (ies_tree, hf_IAX_IE_CAPABILITY,
 				     tvb, offset + 2, ies_len, FALSE);
@@ -1008,18 +1104,22 @@
 	      break;
 	    }
 	    case IAX_IE_FORMAT:
+	      if (ies_len != 4) THROW(ReportedBoundsError);
 	      proto_tree_add_item (ies_tree, hf_IAX_IE_FORMAT, tvb,
 				   offset + 2, ies_len, FALSE);
 	      break;
 	    case IAX_IE_VERSION:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
 	      proto_tree_add_item (ies_tree, hf_IAX_IE_VERSION, tvb,
 				   offset + 2, ies_len, FALSE);
 	      break;
 	    case IAX_IE_ADSICPE:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
 	      proto_tree_add_item (ies_tree, hf_IAX_IE_ADSICPE, tvb,
 				   offset + 2, ies_len, FALSE);
 	      break;
 	    case IAX_IE_AUTHMETHODS:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
 	      proto_tree_add_item (ies_tree, hf_IAX_IE_AUTHMETHODS, tvb,
 				   offset + 2, ies_len, FALSE);
 	      break;
@@ -1030,14 +1130,17 @@
 	      proto_tree_add_item(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINPORT, tvb, offset + 4, 2, FALSE);
 	      break;
 	    case IAX_IE_REFRESH:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
 	      proto_tree_add_item (ies_tree, hf_IAX_IE_REFRESH, tvb,
 				   offset + 2, ies_len, FALSE);
 	      break;
 	    case IAX_IE_DPSTATUS:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
 	      proto_tree_add_item (ies_tree, hf_IAX_IE_DPSTATUS, tvb,
 				   offset + 2, ies_len, FALSE);
 	      break;
 	    case IAX_IE_CALLNO:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
 	      proto_tree_add_item (ies_tree, hf_IAX_IE_CALLNO, tvb,
 				   offset + 2, ies_len, FALSE);
 	      break;
@@ -1050,6 +1153,7 @@
 				   offset + 2, ies_len, FALSE);
 	      break;
 	    case IAX_IE_MSGCOUNT:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
 	      proto_tree_add_item (ies_tree, hf_IAX_IE_MSGCOUNT, tvb,
 				   offset + 2, ies_len, FALSE);
 	      break;
@@ -1062,11 +1166,121 @@
 				   offset + 2, ies_len, FALSE);
 	      break;
 	    case IAX_IE_TRANSFERID:
+	      if (ies_len != 4) THROW(ReportedBoundsError);
 	      proto_tree_add_item (ies_tree, hf_IAX_IE_TRANSFERID, tvb,
 				   offset + 2, ies_len, FALSE);
 	      break;
+	    case IAX_IE_PROVISIONING:
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_PROVISIONING, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_AESPROVISIONING:
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_AESPROVISIONING, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_DATETIME:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_DATETIME, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_DEVICETYPE:
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_DEVICETYPE, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_SERVICEIDENT:
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_SERVICEIDENT, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_FIRMWAREVER:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_FIRMWAREVER, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_FWBLOCKDESC:
+	      if (ies_len != 4) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_FWBLOCKDESC, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_FWBLOCKDATA:
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_FWBLOCKDATA, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_PROVVER:
+	      if (ies_len != 4) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_PROVVER, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_CALLINGPRES:
+	      if (ies_len != 1) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_CALLINGPRES, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_CALLINGTON:
+	      if (ies_len != 1) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_CALLINGTON, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_CALLINGTNS:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_CALLINGTNS, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_SAMPLINGRATE:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_SAMPLINGRATE, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_CAUSECODE:
+	      if (ies_len != 1) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_CAUSECODE, tvb,
+				   offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_ENCRYPTION:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_ENCRYPTION, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_ENCKEY:
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_ENCKEY, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_CODEC_PREFS:
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_CODEC_PREFS, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_RR_JITTER:
+	      if (ies_len != 4) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_RR_JITTER, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_RR_LOSS:
+	      if (ies_len != 4) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_RR_LOSS, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_RR_PKTS:
+	      if (ies_len != 4) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_RR_PKTS, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_RR_DELAY:
+	      if (ies_len != 2) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_RR_DELAY, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_RR_DROPPED:
+	      if (ies_len != 4) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_RR_DROPPED, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
+	    case IAX_IE_RR_OOO:
+	      if (ies_len != 4) THROW(ReportedBoundsError);
+	      proto_tree_add_item (ies_tree, hf_IAX_IE_RR_OOO, tvb,
+				  offset +2, ies_len, FALSE);
+	      break;
 	      
       case IAX_IE_DATAFORMAT:
+	if (ies_len != 4) THROW(ReportedBoundsError);
 	proto_tree_add_item (ies_tree, hf_IAX_IE_DATAFORMAT, tvb,
 			     offset + 2, ies_len, FALSE);
 
@@ -1736,6 +1950,79 @@
       0x0, "",
       HFILL}},
 
+    {&hf_IAX_IE_PROVISIONING,
+     {"Provisioning info","iax2.iax.provisioning", FT_STRING, BASE_NONE,
+       NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_AESPROVISIONING,
+     {"AES Provisioning info","iax2.iax.aesprovisioning", FT_STRING, BASE_NONE,
+       NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_DATETIME,
+     {"Date/Time", "iax2.iax.datetime", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_DEVICETYPE,
+     {"Device type", "iax2.iax.devicetype", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_SERVICEIDENT,
+     {"Service identifier", "iax2.iax.serviceident", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_FIRMWAREVER,
+     {"Firmware version", "iax2.iax.firmwarever", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_FWBLOCKDESC,
+     {"Firmware block description", "iax2.iax.fwblockdesc", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_FWBLOCKDATA,
+     {"Firmware block of data", "iax2.iax.fwblockdata", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_PROVVER,
+     {"Provisioning version", "iax2.iax.provver", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_CALLINGPRES,
+     {"Calling presentation", "iax2.iax.callingpres", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_CALLINGTON,
+     {"Calling type of number", "iax2.iax.callington", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_CALLINGTNS,
+     {"Calling transit network select", "iax2.iax.callingtns", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_SAMPLINGRATE,
+     {"Supported sampling rates", "iax2.iax.samplingrate", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_CAUSECODE,
+     {"Hangup cause", "iax2.iax.causecode", FT_UINT8, BASE_HEX, VALS(iax_causecodes),
+       0x0, "", HFILL}},
+
+    {&hf_IAX_IE_ENCRYPTION,
+     {"Encryption format", "iax2.iax.encryption", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_ENCKEY,
+     {"Encryption key", "iax2.iax.enckey", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_CODEC_PREFS,
+     {"Codec negotiation", "iax2.iax.codecprefs", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_RR_JITTER,
+     {"Received jitter (as in RFC1889)", "iax2.iax.rrjitter", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_RR_LOSS,
+     {"Received loss (high byte loss pct, low 24 bits loss count, as in rfc1889)", "iax2.iax.rrloss",
+       FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_RR_PKTS,
+     {"Total frames received", "iax2.iax.rrpkts", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_RR_DELAY,
+     {"Max playout delay in ms for received frames", "iax2.iax.rrdelay", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_RR_DROPPED,
+     {"Dropped frames (presumably by jitterbuffer)", "iax2.iax.rrdropped", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}},
+
+    {&hf_IAX_IE_RR_OOO,
+     {"Frame received out of order", "iax2.iax.rrooo", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}},
+
     {&hf_IAX_IE_DATAFORMAT,
      {"Data call format", "iax2.iax.dataformat", FT_UINT32, BASE_HEX,
       VALS(iax_dataformats), 0x0, "", HFILL}},
--- ethereal-0.10.10.orig/epan/dissectors/packet-icep.c
+++ ethereal-0.10.10/epan/dissectors/packet-icep.c
@@ -3,7 +3,7 @@
  * Copyright 2004 _FF_ 
  * Francesco Fondelli <fondelli dot francesco, tiscali dot it>
  *
- * $Id: packet-icep.c 12223 2004-10-06 17:37:47Z guy $
+ * $Id: packet-icep.c 14176 2005-04-24 00:36:11Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -741,6 +741,8 @@
 			}
 			g_free(opstr);
 			g_free(namestr);
+			opstr = NULL;
+			namestr = NULL;
 		}
 	}
 	
@@ -794,8 +796,10 @@
 	
 error:
 	(*total_consumed) = -1;
-	g_free(namestr);
-	g_free(opstr);
+	if (namestr)
+		g_free(namestr);
+	if (opstr)
+		g_free(opstr);
 }
 
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-ieee8023.c
+++ ethereal-0.10.10/epan/dissectors/packet-ieee8023.c
@@ -70,13 +70,23 @@
 	  creating "trailer_tvb" threw an exception.
 
        In either case, this means that all the data in the frame
-       is within the length value, so we give all the data to the
-       next protocol and have no trailer. */
-    next_tvb = tvb_new_subset(tvb, offset_after_length, -1, length);
+       is within the length value (assuming our offset isn't past
+       the end of the tvb), so we give all the data to the next
+       protocol and have no trailer. */
+
+    if (tvb_length_remaining(tvb, offset_after_length) > 0) {
+      next_tvb = tvb_new_subset(tvb, offset_after_length, -1, length);
+    } else {
+      next_tvb = NULL;
+    }
     trailer_tvb = NULL;
   }
   ENDTRY;
 
+  if (next_tvb == NULL) {
+    THROW(ReportedBoundsError);
+  }
+
   /* Dissect the payload either as IPX or as an LLC frame.
      Catch BoundsError and ReportedBoundsError, so that if the
      reported length of "next_tvb" was reduced by some dissector
--- ethereal-0.10.10.orig/epan/dissectors/packet-isis-clv.c
+++ ethereal-0.10.10/epan/dissectors/packet-isis-clv.c
@@ -1,7 +1,7 @@
 /* packet-isis-clv.c
  * Common CLV decode routines.
  *
- * $Id: packet-isis-clv.c 11410 2004-07-18 18:06:47Z gram $
+ * $Id: packet-isis-clv.c 14161 2005-04-22 04:07:56Z gerald $
  * Stuart Stanley <stuarts@mxmail.net>
  *
  * Ethereal - Network traffic analyzer
@@ -466,8 +466,7 @@
  * Description:
  *	Take apart a NLPID packet and display it.  The NLPID (for intergrated
  *	ISIS, contains n network layer protocol IDs that the box supports.
- *	Our display buffer we use is upto 255 entries, 6 bytes per (0x00, )
- *	plus 1 for zero termination.  We just just 256*6 for simplicity.
+ *	We max out at 256 entries.
  *
  * Input:
  *	tvbuff_t * : tvbuffer for packet data
@@ -478,32 +477,49 @@
  * Output:
  *	void, but we will add to proto tree if !NULL.
  */
+
+#define TRUNCATED_TEXT " [truncated]"
 void
 isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length)
 {
-	char sbuf[256*6];
-	char *s = sbuf;
-	int hlen = length;
-	int old_offset = offset;
+	GString *gstr;
+	int old_offset = offset, old_len = length;
 
 	if ( !tree ) return;		/* nothing to do! */
 
-	while ( length-- > 0 ) {
-		if (s != sbuf ) {
-			s += sprintf ( s, ", " );
+	gstr = g_string_new("NLPID(s): ");
+
+	/*
+	 * Free the GString if we throw an exception.
+	 */
+	CLEANUP_PUSH(free_g_string, gstr);
+
+	if (length <= 0) {
+		g_string_append(gstr, "--none--");
+	} else {
+		while (length-- > 0 && gstr->len < ITEM_LABEL_LENGTH) {
+			if (gstr->len > 10) {
+				g_string_append(gstr, ", ");
+			}
+			g_string_sprintfa(gstr, "%s (0x%02x)",
+				val_to_str(tvb_get_guint8(tvb, offset), nlpid_vals,
+				"Unknown"), tvb_get_guint8(tvb, offset));
+			offset++;
 		}
-		s += sprintf ( s, "%s (0x%02x)",
-		    val_to_str(tvb_get_guint8(tvb, offset), nlpid_vals,
-			"Unknown"), tvb_get_guint8(tvb, offset));
-		offset++;
 	}
 
-	if ( hlen == 0 ) {
-		sprintf ( sbuf, "--none--" );
+	if (gstr->len >= ITEM_LABEL_LENGTH) {
+		g_string_truncate(gstr, ITEM_LABEL_LENGTH - strlen(TRUNCATED_TEXT) - 1);
+		g_string_append(gstr, TRUNCATED_TEXT);
 	}
 
-	proto_tree_add_text ( tree, tvb, old_offset, hlen,
-			"NLPID(s): %s", sbuf );
+	proto_tree_add_text (tree, tvb, old_offset, old_len,
+			"%s", gstr->str);
+	/*
+	 * We're done with the GString, so delete it and get rid of
+	 * the cleanup handler.
+	 */
+	CLEANUP_CALL_AND_POP;
 }
 
 /*
--- ethereal-0.10.10.orig/epan/dissectors/packet-isis-lsp.c
+++ ethereal-0.10.10/epan/dissectors/packet-isis-lsp.c
@@ -528,20 +528,9 @@
 {
 	proto_item 	*ti;
 	proto_tree	*ntree = NULL;
-	guint32		src, mask, prefix_len;
-
-        guint32 bitmasks[33] = {
-	  0x00000000,
-	  0x00000008, 0x0000000c, 0x0000000e, 0x0000000f,
-	  0x000000f8, 0x000000fc, 0x000000fe, 0x000000ff,
-	  0x000008ff, 0x00000cff, 0x00000eff, 0x00000fff,
-	  0x0000f8ff, 0x0000fcff, 0x0000feff, 0x0000ffff,
-	  0x0008ffff, 0x000cffff, 0x000effff, 0x000fffff,
-	  0x00f8ffff, 0x00fcffff, 0x00feffff, 0x00ffffff,
-	  0x08ffffff, 0x0cffffff, 0x0effffff, 0x0fffffff,
-	  0xf8ffffff, 0xfcffffff, 0xfeffffff, 0xffffffff
-	};
-
+	guint32		src, mask, bitmask;
+	int		prefix_len;
+	gboolean	found_mask = FALSE;
 
 	while ( length > 0 ) {
 		if (length<12) {
@@ -554,32 +543,31 @@
 		 */
 		if ( tree ) {
 			tvb_memcpy(tvb, (guint8 *)&src, offset+4, 4);
-			tvb_memcpy(tvb, (guint8 *)&mask, offset+8, 4);
+			mask = tvb_get_ntohl(tvb, offset+8);
 
 			/* find out if the mask matches one of 33 possible prefix lengths */
-
-			prefix_len=0;
-
-			while(prefix_len<=33) {
-			  if (bitmasks[prefix_len++]==mask) {
-			    prefix_len--;
+			bitmask = 0xffffffff;
+			for(prefix_len = 32; prefix_len >= 0; prefix_len--) {
+			  if (bitmask==mask) {
+			    found_mask = TRUE;
 			    break;
 			  }
+			  bitmask = bitmask << 1;
 			}
 
-			/* 34 indicates no match -> must be a discontiguous netmask
-			   lets dump the mask, otherwise print the prefix_len */
+			/* If we have a discontiguous netmask, dump the mask, otherwise print the prefix_len */
+			/* XXX - We should probably have some sort of netmask_to_str() routine in to_str.c that does this. */
 
-			if(prefix_len==34) {
+			if(found_mask) {
 			  ti = proto_tree_add_text ( tree, tvb, offset, 12,
-				"IPv4 prefix: %s mask %s",
+				"IPv4 prefix: %s/%d",
 				ip_to_str((guint8*)&src),
-				ip_to_str((guint8*)&mask));
+				prefix_len );
 			} else {
 			  ti = proto_tree_add_text ( tree, tvb, offset, 12,
-				"IPv4 prefix: %s/%d",
+				"IPv4 prefix: %s mask %s",
 				ip_to_str((guint8*)&src),
-				prefix_len );
+				ip_to_str(tvb_get_ptr(tvb, offset+8, 4)));
 			};
 
 			ntree = proto_item_add_subtree(ti,
--- ethereal-0.10.10.orig/epan/dissectors/packet-isup.c
+++ ethereal-0.10.10/epan/dissectors/packet-isup.c
@@ -1,7 +1,7 @@
 /* packet-isup.c
  * Routines for ISUP dissection
  * Copyright 2001, Martina Obermeier <martina.obermeier@icn.siemens.de>
- * Copyright 2004, Anders Broman <anders.broman@ericsson.com>
+ * Copyright 2004-2005, Anders Broman <anders.broman@ericsson.com>
  * Modified 2003-09-10 by Anders Broman
  *		<anders.broman@ericsson.com>
  * Inserted routines for BICC dissection according to Q.765.5 Q.1902 Q.1970 Q.1990,
@@ -9,7 +9,7 @@
  * Modified 2004-01-10 by Anders Broman to add abillity to dissect
  * Content type application/ISUP RFC 3204 used in SIP-T
  *
- * $Id: packet-isup.c 13580 2005-03-03 10:23:29Z guy $
+ * $Id: packet-isup.c 14268 2005-05-02 14:41:07Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -313,9 +313,7 @@
 #define COMMON_HEADER_LENGTH                   (CIC_LENGTH + MESSAGE_TYPE_LENGTH)
 #define BICC_COMMON_HEADER_LENGTH              (BICC_CIC_LENGTH + MESSAGE_TYPE_LENGTH)
 
-#define MAXLENGTH                            0xFF /* since length field is 8 Bit long - used in number dissectors;
-						     max. number of address digits is 15 digits, but MAXLENGTH used
-						     to avoid runtime errors */
+#define MAXDIGITS                              15 /* Max number of address digits */
 
 #define PARAMETER_TYPE_LENGTH                  1
 #define PARAMETER_POINTER_LENGTH               1
@@ -1408,7 +1406,7 @@
 /* ------------------------------------------------------------------
   Dissector Parameter Called party number
  */
-static void
+void
 dissect_isup_called_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
 {
   proto_item *address_digits_item;
@@ -1418,7 +1416,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char called_number[MAXLENGTH]="";
+  char called_number[MAXDIGITS + 1]="";
   e164_info_t e164_info;
   gint number_plan;
 
@@ -1440,9 +1438,13 @@
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+        THROW(ReportedBoundsError);
     }
     offset++;
   }
@@ -1450,6 +1452,8 @@
   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   called_number[i++] = '\0';
   proto_item_set_text(address_digits_item, "Called Party Number: %s", called_number);
@@ -1481,7 +1485,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char called_number[MAXLENGTH]="";
+  char called_number[MAXDIGITS + 1]="";
 
   indicators1 = tvb_get_guint8(parameter_tvb, 0);
   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
@@ -1496,9 +1500,13 @@
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
     }
     offset++;
   }
@@ -1506,6 +1514,8 @@
   if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   called_number[i++] = '\0';
 
@@ -1598,7 +1608,7 @@
  * dissector, as that has some values not specified by the standard but
  * that appear to be used for purposes other than the ones in Q.850.
  */
-static const value_string q850_cause_code_vals[] = {
+const value_string q850_cause_code_vals[] = {
 	{ 0x00,	"Valid cause code not yet received" },
 	{ 0x01,	"Unallocated (unassigned) number" },
 	{ 0x02,	"No route to specified transit network" },
@@ -1679,7 +1689,7 @@
 
 
 
-static void
+void
 dissect_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
 { guint length = tvb_reported_length(parameter_tvb);
   proto_tree_add_text(parameter_tree, parameter_tvb,0, -1, "Cause indicators (-> Q.850)");
@@ -2813,7 +2823,7 @@
 /* ------------------------------------------------------------------
   Dissector Parameter calling party number
  */
-static void
+void
 dissect_isup_calling_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
 {
   proto_item *address_digits_item;
@@ -2823,7 +2833,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char calling_number[MAXLENGTH]="";
+  char calling_number[MAXDIGITS + 1]="";
   e164_info_t e164_info;
   gint number_plan;
 
@@ -2838,44 +2848,51 @@
   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
   offset = 2;
 
-  address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
-					    offset, -1,
-					    "Calling Party Number");
-  address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
-
   length = tvb_length_remaining(parameter_tvb, offset);
-  while(length > 0){
-    address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
-    proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
-    calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
-    if ((length - 1) > 0 ){
-      proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
-      calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+  if (length > 0) {
+    address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
+  					      offset, -1,
+					      "Calling Party Number");
+    address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
+
+    while(length > 0){
+      address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
+      proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
+      calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+      if (i > MAXDIGITS)
+        THROW(ReportedBoundsError);
+      if ((length - 1) > 0 ){
+        proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
+        calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+        if (i > MAXDIGITS)
+  	  THROW(ReportedBoundsError);
+      }
+      offset++;
+      length = tvb_length_remaining(parameter_tvb, offset);
     }
-    offset++;
-    length = tvb_length_remaining(parameter_tvb, offset);
-  }
 
-  if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
+    if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
+    }
+    proto_item_set_text(address_digits_item, "Calling Party Number: %s", calling_number);
+    calling_number[i++] = '\0';
+    if ( number_plan == 1 ) {
+      e164_info.e164_number_type = CALLING_PARTY_NUMBER;
+      e164_info.nature_of_address = indicators1 & 0x7f;
+      e164_info.E164_number_str = calling_number;
+      e164_info.E164_number_length = i - 1;
+      dissect_e164_number(parameter_tvb, address_digits_tree, 2, (offset - 2), e164_info);
+      proto_tree_add_string_hidden(address_digits_tree, hf_isup_calling, parameter_tvb,
+  	    offset - length, length, calling_number);
+    } else {
+      proto_tree_add_string(address_digits_tree, hf_isup_calling, parameter_tvb,
+ 	  offset - length, length, calling_number);
+    }
   }
-  calling_number[i++] = '\0';
-
-  proto_item_set_text(address_digits_item, "Calling Party Number: %s", calling_number);
   proto_item_set_text(parameter_item, "Calling Party Number: %s", calling_number);
-  if ( number_plan == 1 ) {
-    e164_info.e164_number_type = CALLING_PARTY_NUMBER;
-    e164_info.nature_of_address = indicators1 & 0x7f;
-    e164_info.E164_number_str = calling_number;
-    e164_info.E164_number_length = i - 1;
-    dissect_e164_number(parameter_tvb, address_digits_tree, 2, (offset - 2), e164_info);
-    proto_tree_add_string_hidden(address_digits_tree, hf_isup_calling, parameter_tvb,
-	  offset - length, length, calling_number);
-  } else {
-    proto_tree_add_string(address_digits_tree, hf_isup_calling, parameter_tvb,
-	  offset - length, length, calling_number);
-  }
   tap_calling_number = g_strdup(calling_number);
 }
 /* ------------------------------------------------------------------
@@ -2891,7 +2908,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char calling_number[MAXLENGTH]="";
+  char calling_number[MAXDIGITS + 1]="";
 
   indicators1 = tvb_get_guint8(parameter_tvb, 0);
   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
@@ -2911,9 +2928,13 @@
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
     }
     offset++;
     length = tvb_length_remaining(parameter_tvb, offset);
@@ -2922,6 +2943,8 @@
   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   calling_number[i++] = '\0';
 
@@ -2942,7 +2965,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char calling_number[MAXLENGTH]="";
+  char calling_number[MAXDIGITS + 1]="";
 
   indicators1 = tvb_get_guint8(parameter_tvb, 0);
   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
@@ -2962,9 +2985,13 @@
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
     }
     offset++;
     length = tvb_length_remaining(parameter_tvb, offset);
@@ -2973,6 +3000,8 @@
   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   calling_number[i++] = '\0';
 
@@ -2993,7 +3022,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char called_number[MAXLENGTH]="";
+  char called_number[MAXDIGITS + 1]="";
 
   indicators1 = tvb_get_guint8(parameter_tvb, 0);
   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
@@ -3013,9 +3042,13 @@
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
     }
     offset++;
     length = tvb_length_remaining(parameter_tvb, offset);
@@ -3024,6 +3057,8 @@
   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   called_number[i++] = '\0';
 
@@ -3140,7 +3175,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char calling_number[MAXLENGTH]="";
+  char calling_number[MAXDIGITS + 1]="";
 
   indicators1 = tvb_get_guint8(parameter_tvb, 0);
   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
@@ -3151,19 +3186,25 @@
   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
   offset = 2;
 
+  length = tvb_length_remaining(parameter_tvb, offset);
+  if (length == 0) 
+	return; /* empty connected number */
   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
 					    offset, -1,
 					    "Connected Number");
   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
 
-  length = tvb_length_remaining(parameter_tvb, offset);
   while(length > 0){
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
     }
     offset++;
     length = tvb_length_remaining(parameter_tvb, offset);
@@ -3172,6 +3213,8 @@
   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   calling_number[i++] = '\0';
 
@@ -3192,7 +3235,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char network_id[MAXLENGTH]="";
+  char network_id[MAXDIGITS + 1]="";
 
   indicators = tvb_get_guint8(parameter_tvb, 0);
   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators);
@@ -3210,9 +3253,13 @@
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     network_id[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
     }
     offset++;
     length = tvb_length_remaining(parameter_tvb, offset);
@@ -3221,6 +3268,8 @@
   if  (((indicators & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   network_id[i++] = '\0';
 
@@ -3746,7 +3795,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char calling_number[MAXLENGTH]="";
+  char calling_number[MAXDIGITS + 1]="";
 
   indicators1 = tvb_get_guint8(parameter_tvb, 0);
   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
@@ -3781,9 +3830,13 @@
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
     }
     offset++;
     length = tvb_length_remaining(parameter_tvb, offset);
@@ -3792,6 +3845,8 @@
   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   calling_number[i++] = '\0';
 
@@ -3864,7 +3919,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char calling_number[MAXLENGTH]="";
+  char calling_number[MAXDIGITS + 1]="";
 
   indicators1 = tvb_get_guint8(parameter_tvb, 0);
   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
@@ -3887,9 +3942,13 @@
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
     }
     offset++;
     length = tvb_length_remaining(parameter_tvb, offset);
@@ -3898,6 +3957,8 @@
   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   calling_number[i++] = '\0';
 
@@ -4007,7 +4068,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char calling_number[MAXLENGTH]="";
+  char calling_number[MAXDIGITS + 1]="";
 
   indicators1 = tvb_get_guint8(parameter_tvb, 0);
   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
@@ -4027,9 +4088,13 @@
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
     }
     offset++;
     length = tvb_length_remaining(parameter_tvb, offset);
@@ -4038,6 +4103,8 @@
   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   calling_number[i++] = '\0';
 
@@ -4163,7 +4230,7 @@
   gint offset=0;
   gint i=0;
   gint length;
-  char calling_number[MAXLENGTH]="";
+  char calling_number[MAXDIGITS + 1]="";
 
   nr_qualifier_ind = tvb_get_guint8(parameter_tvb, 0);
   proto_tree_add_text(parameter_tree, parameter_tvb, 0, 1, "Number qualifier indicator: 0x%x (refer to 3.26/Q.763 for detailed decoding)", nr_qualifier_ind);
@@ -4189,9 +4256,13 @@
     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
+    if (i > MAXDIGITS)
+      THROW(ReportedBoundsError);
     if ((length - 1) > 0 ){
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
     }
     offset++;
     length = tvb_length_remaining(parameter_tvb, offset);
@@ -4200,6 +4271,8 @@
   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
+      if (i > MAXDIGITS)
+	THROW(ReportedBoundsError);
   }
   calling_number[i++] = '\0';
 
@@ -5141,6 +5214,7 @@
   guint8 message_type, opt_parameter_pointer;
   gint opt_part_possible = FALSE; /* default setting - for message types allowing optional
 				     params explicitely set to TRUE in case statement */
+  tap_calling_number = NULL;
   offset = 0;
 
   /* Extract message type field */
@@ -5368,7 +5442,7 @@
      proto_tree_add_text(isup_tree, message_tvb, 0, 0, "No optional parameters are possible with this message type");
    /* if there are calling/called number, we'll get them for the tap */
 
-   tap_rec.calling_number=tap_calling_number;
+   tap_rec.calling_number=tap_calling_number?tap_calling_number:g_strdup("");
    tap_rec.called_number=tap_called_number;
    tap_rec.cause_value=tap_cause_value;
    tap_queue_packet(isup_tap, pinfo, &tap_rec);
--- ethereal-0.10.10.orig/epan/dissectors/packet-kerberos.c
+++ ethereal-0.10.10/epan/dissectors/packet-kerberos.c
@@ -3733,7 +3733,7 @@
        All krb5 commands start with an APPL tag and thus is >=0x60
        so if first byte is <=16  just blindly assume it is krb4 then
     */
-    if(tvb_get_guint8(tvb, 0)<=0x10){
+    if(tvb_bytes_exist(tvb, 0, 1) && tvb_get_guint8(tvb, 0)<=0x10){
       if(krb4_handle){ 
 	return call_dissector(krb4_handle, tvb, pinfo, tree);
       }else{
--- ethereal-0.10.10.orig/epan/dissectors/packet-kink.c
+++ ethereal-0.10.10/epan/dissectors/packet-kink.c
@@ -2,9 +2,9 @@
  * Routines for KINK packet disassembly 
  * It is referrenced draft-ietf-kink-kink-jp-04.txt,v 1.14 2003/02/10
  * 
- * Copyright 2004, Taekshi Nakashima <T.Nakashima@jp.yokogawa.com>
+ * Copyright 2004, Takeshi Nakashima <T.Nakashima@jp.yokogawa.com>
  *
- * $Id: packet-kink.c 13671 2005-03-09 03:04:46Z guy $
+ * $Id: packet-kink.c 13896 2005-03-24 21:17:08Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -179,7 +179,7 @@
   guint8 type;
   guint8 major_version, minor_version, version;
   guint32 doi;
-  guint8 chsumlen;
+  guint chsumlen;
   guint8 next_payload;
   guint8 value_a_and_front_reserved;
   guint16 value_a_and_reserved;
@@ -320,7 +320,7 @@
   proto_item *ti;
   guint8 next_payload;
   guint8 reserved;
-  guint16 payload_length;
+  guint payload_length;
   guint16 krb_ap_req_length;
   time_t timer;                  /* For showing utc */
   struct tm *tp;                 /* For showing utc */
@@ -371,7 +371,10 @@
     payload_length += (PADDING - (payload_length % PADDING));
   }
   offset = start_payload_offset + payload_length;
-  control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
+
+  if(payload_length > 0) {
+    control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
+  }
 }
 
 
@@ -381,7 +384,7 @@
   proto_item *ti;
   guint8 next_payload;
   guint8 reserved;
-  guint16 payload_length;
+  guint payload_length;
   guint16 krb_ap_rep_length;
   time_t timer;
   struct tm *tp;
@@ -413,8 +416,12 @@
   /* Analize time by the utc. */ 
   timer = tvb_get_ntohl(tvb, offset);
   tp = gmtime(&timer);
-  proto_tree_add_text(payload_kink_ap_rep_tree, tvb, offset, 4, "EPOCH: month  %u. day %u. year %u.%u.%u.%u by UTC", 
+  if(tp){
+    proto_tree_add_text(payload_kink_ap_rep_tree, tvb, offset, 4, "EPOCH: month  %u. day %u. year %u.%u.%u.%u by UTC", 
 		      (tp->tm_mon)+1, tp->tm_mday, (tp->tm_year)+1900, tp->tm_hour, tp->tm_min, tp->tm_sec);
+  } else {
+    proto_tree_add_text(payload_kink_ap_rep_tree, tvb, offset, 4, "EPOCH: value invalid");
+  }
   offset += 4;
 
   if(payload_length > PAYLOAD_HEADER){
@@ -433,7 +440,10 @@
     payload_length += (PADDING - (payload_length % PADDING));
   }
   offset = start_payload_offset + payload_length;
-  control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
+
+  if(payload_length > 0) {
+    control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
+  }
 }
 
 static void
@@ -442,7 +452,7 @@
   proto_item *ti;
   guint8 next_payload;
   guint8 reserved;
-  guint16 payload_length;
+  guint payload_length;
   guint16 krb_error_length;
   int start_payload_offset = 0; /* Keep the begining of the payload offset  */
 
@@ -484,7 +494,10 @@
     payload_length += (PADDING - (payload_length % PADDING));
   }
   offset = start_payload_offset + payload_length;
-  control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
+
+  if(payload_length > 0) {
+    control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
+  }
 }
 
 static void
@@ -493,7 +506,7 @@
   proto_item *ti;
   guint8 next_payload;
   guint8 reserved;
-  guint16 payload_length;
+  guint payload_length;
   guint16 realm_name_length;
   int start_payload_offset = 0; /* Keep the begining of the payload offset  */
 
@@ -528,7 +541,10 @@
     payload_length += (PADDING - (payload_length % PADDING));
   }
   offset = start_payload_offset + payload_length;
-  control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
+
+  if(payload_length > 0) {
+    control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
+  }
 }
 
 static void
@@ -537,8 +553,8 @@
   proto_item *ti;
   guint8 next_payload;
   guint8 reserved;
-  guint16 payload_length;
-  guint16 princ_name_length;
+  guint payload_length;
+  guint princ_name_length;
   guint16 tgt_length;
   int start_payload_offset = 0; /* Keep the begining of the payload offset  */
 
@@ -587,7 +603,10 @@
     payload_length += (PADDING - (payload_length % PADDING));
   }
   offset = start_payload_offset + payload_length;
-  control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
+
+  if(payload_length > 0) {
+    control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
+  }
 }
 
 static void
@@ -596,7 +615,7 @@
   proto_item *ti;
   guint8 next_payload;
   guint8 reserved;
-  guint16 payload_length;
+  guint payload_length;
   guint8 inner_next_pload;
   guint8 qm, qmmaj, qmmin;
   guint16 reserved2;
@@ -657,7 +676,10 @@
     payload_length += (PADDING - (payload_length % PADDING));
   }
   offset = start_payload_offset + payload_length;
-  control_payload(pinfo, tvb, offset, next_payload, tree);  /* Recur control_payload() */
+
+  if(payload_length > 0) {
+    control_payload(pinfo, tvb, offset, next_payload, tree);  /* Recur control_payload() */
+  }
 }
 
 static void
@@ -666,7 +688,7 @@
   proto_item *ti;
   guint8 next_payload;
   guint8 reserved;
-  guint16 payload_length;
+  guint payload_length;
   guint8 inner_next_pload;
   guint32 reserved2;
   guint16 inner_payload_length;
@@ -713,7 +735,10 @@
     payload_length += (PADDING - (payload_length % PADDING));
   }
   offset = start_payload_offset + payload_length;
-  control_payload(pinfo, tvb, offset, next_payload, tree);  /* Recur control_payload() */
+
+  if(payload_length > 0) {
+    control_payload(pinfo, tvb, offset, next_payload, tree);  /* Recur control_payload() */
+  }
 }
 
 static void
@@ -794,7 +819,7 @@
   proto_tree *payload_kink_not_defined_tree;
   proto_item *ti;
   guint8 next_payload;
-  guint16 payload_length;
+  guint payload_length;
   guint8 reserved;
   int start_payload_offset = 0;   /* Keep the begining of the payload offset */
   
@@ -821,7 +846,11 @@
     payload_length += (PADDING - (payload_length % PADDING));
   }
   offset = start_payload_offset + payload_length;
-  control_payload(pinfo, tvb, offset, next_payload, tree);
+
+  /* XXX - prevent an endless loop if payload_length is 0, don't know the correct way to handle this! */
+  if(payload_length > 0) {
+    control_payload(pinfo, tvb, offset, next_payload, tree);
+  }
 }
 
 /* Output part */
@@ -860,7 +889,7 @@
     { &hf_kink_next_payload,
       { "Next Payload",       "kink.nextPayload", 
 	FT_UINT8,	BASE_DEC,	VALS(kink_next_payload),	0x0,
-      	"the checkSum of kink", HFILL }}
+      	"the next payload of kink", HFILL }}
 
   };
 
@@ -881,7 +910,7 @@
     
   };
   
-  proto_kink = proto_register_protocol("Kerberized Internet Negotiation of Key", "KINK", "KINK");
+  proto_kink = proto_register_protocol("Kerberized Internet Negotiation of Key", "KINK", "kink");
   proto_register_field_array(proto_kink, hf, array_length(hf));
   proto_register_subtree_array(ett, array_length(ett));
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-l2tp.c
+++ ethereal-0.10.10/epan/dissectors/packet-l2tp.c
@@ -7,7 +7,7 @@
  * Laurent Cazalet <laurent.cazalet@mailclub.net>
  * Thomas Parvais <thomas.parvais@advalvas.be>
  *
- * $Id: packet-l2tp.c 13359 2005-02-09 09:25:54Z guy $
+ * $Id: packet-l2tp.c 14232 2005-04-29 14:52:45Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -536,6 +536,12 @@
 			avp_vendor_id	= tvb_get_ntohs(tvb, index + 2);
 			avp_type	= tvb_get_ntohs(tvb, index + 4);
 
+			if (avp_len < 1) {
+				proto_tree_add_text(l2tp_tree, tvb, index, 0,
+						    "AVP length must be >= 1");
+				return;
+			}
+
 			if (avp_vendor_id == VENDOR_IETF) {
 				tf =  proto_tree_add_text(l2tp_tree, tvb, index,
 							  avp_len, "%s AVP",
--- ethereal-0.10.10.orig/epan/dissectors/packet-ldap.c
+++ ethereal-0.10.10/epan/dissectors/packet-ldap.c
@@ -3,7 +3,7 @@
  *
  * See RFC 1777 (LDAP v2), RFC 2251 (LDAP v3), and RFC 2222 (SASL).
  *
- * $Id: packet-ldap.c 13690 2005-03-10 10:16:49Z sahlberg $
+ * $Id: packet-ldap.c 14238 2005-04-30 04:30:32Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -166,7 +166,9 @@
 static int hf_mscldap_netlogon_nt_token = -1;
 
 static gint ett_ldap = -1;
-static gint ett_ldap_gssapi_token = -1;
+static gint ett_ldap_msg = -1;
+static gint ett_ldap_payload = -1;
+static gint ett_ldap_sasl_blob = -1;
 static gint ett_ldap_referrals = -1;
 static gint ett_ldap_attribute = -1;
 static gint ett_ldap_controls = -1;
@@ -517,7 +519,7 @@
     string[length] = '\0';
   }
   else
-    string = "(null)";
+    string = g_strdup("(null)");
 
   if (tree)
     temp_item = proto_tree_add_string(tree, hf_id, a->tvb, start, a->offset - start, string);
@@ -584,7 +586,7 @@
     string[length] = '\0';
   }
   else
-    string = "(null)";
+    string = g_strdup("(null)");
 
   if (tree)
     temp_item = proto_tree_add_bytes(tree, hf_id, a->tvb, start, a->offset - start, string);
@@ -1032,8 +1034,6 @@
   int token_offset;
   gint available_length, reported_length;
   tvbuff_t *new_tvb;
-  proto_item *gitem;
-  proto_tree *gtree = NULL;
 
   if (read_integer(a, tree, hf_ldap_message_bind_version, 0, 0, ASN1_INT) != ASN1_ERR_NOERROR)
     return;
@@ -1120,11 +1120,6 @@
             asn1_err_to_str(ret));
           return;
         }
-        if (tree) {
-          gitem = proto_tree_add_text(tree, tvb, token_offset,
-            (a->offset + length) - token_offset, "GSS-API Token");
-          gtree = proto_item_add_subtree(gitem, ett_ldap_gssapi_token);
-        }
         available_length = tvb_length_remaining(tvb, token_offset);
         reported_length = tvb_reported_length_remaining(tvb, token_offset);
         g_assert(available_length >= 0);
@@ -1136,7 +1131,7 @@
         if ((guint)reported_length > length)
           reported_length = length;
         new_tvb = tvb_new_subset(tvb, a->offset, available_length, reported_length);
-        call_dissector(gssapi_handle, new_tvb, pinfo, gtree);
+        call_dissector(gssapi_handle, new_tvb, pinfo, tree);
         a->offset += length;
       } else if (mechanism != NULL && strcmp(mechanism, "GSSAPI") == 0) {
         /*
@@ -1153,11 +1148,6 @@
             asn1_err_to_str(ret));
           return;
         }
-        if (tree) {
-          gitem = proto_tree_add_text(tree, tvb, token_offset,
-            (a->offset + length) - token_offset, "GSS-API Token");
-          gtree = proto_item_add_subtree(gitem, ett_ldap_gssapi_token);
-        }
         if(length==0){
           /* for GSSAPI the third pdu will sometimes be "empty" */
           return;
@@ -1173,7 +1163,7 @@
         if ((guint)reported_length > length)
           reported_length = length;
         new_tvb = tvb_new_subset(tvb, a->offset, available_length, reported_length);
-        call_dissector(gssapi_handle, new_tvb, pinfo, gtree);
+        call_dissector(gssapi_handle, new_tvb, pinfo, tree);
         a->offset += length;
       } else {
         if (read_bytestring(a, tree, hf_ldap_message_bind_auth_credentials,
@@ -1196,8 +1186,6 @@
   int token_offset;
   gint available_length, reported_length;
   tvbuff_t *new_tvb;
-  proto_item *gitem;
-  proto_tree *gtree = NULL;
 
   end = start + length;
   dissect_ldap_result(a, tree, pinfo);
@@ -1251,11 +1239,6 @@
             asn1_err_to_str(ret));
           return;
         }
-        if (tree) {
-          gitem = proto_tree_add_text(tree, tvb, token_offset,
-            (a->offset + cred_length) - token_offset, "GSS-API Token");
-          gtree = proto_item_add_subtree(gitem, ett_ldap_gssapi_token);
-        }
         available_length = tvb_length_remaining(tvb, token_offset);
         reported_length = tvb_reported_length_remaining(tvb, token_offset);
         g_assert(available_length >= 0);
@@ -1267,7 +1250,7 @@
         if ((guint)reported_length > cred_length)
           reported_length = cred_length;
         new_tvb = tvb_new_subset(tvb, a->offset, available_length, reported_length);
-        call_dissector(gssapi_handle, new_tvb, pinfo, gtree);
+        call_dissector(gssapi_handle, new_tvb, pinfo, tree);
         a->offset += cred_length;
       } else if (ldap_info->auth_mech != NULL &&
           strcmp(ldap_info->auth_mech, "GSSAPI") == 0) {
@@ -1285,11 +1268,6 @@
             asn1_err_to_str(ret));
           return;
         }
-        if (tree) {
-          gitem = proto_tree_add_text(tree, tvb, token_offset,
-            (a->offset + cred_length) - token_offset, "GSS-API Token");
-          gtree = proto_item_add_subtree(gitem, ett_ldap_gssapi_token);
-        }
         available_length = tvb_length_remaining(tvb, token_offset);
         reported_length = tvb_reported_length_remaining(tvb, token_offset);
         g_assert(available_length >= 0);
@@ -1301,7 +1279,7 @@
         if ((guint)reported_length > cred_length)
           reported_length = cred_length;
         new_tvb = tvb_new_subset(tvb, a->offset, available_length, reported_length);
-        call_dissector(gssapi_handle, new_tvb, pinfo, gtree);
+        call_dissector(gssapi_handle, new_tvb, pinfo, tree);
         a->offset += cred_length;
       } else {
         if (read_bytestring(a, tree, hf_ldap_message_bind_server_credentials,
@@ -1387,6 +1365,8 @@
       /* ops its a mscldap compressed string */
 
       new_offset=tvb_get_guint8(tvb, offset);
+      if (new_offset == offset - 1)
+        THROW(ReportedBoundsError);
       offset+=1;
 
       dissect_mscldap_string(tvb, new_offset, str, maxlen, FALSE);
@@ -1632,7 +1612,7 @@
 
     mscldap_rpc=0;
     if(is_mscldap){
-	if(!strncmp(str, "netlogon", 8)){
+	if(str && !strncmp(str, "netlogon", 8)){
 		mscldap_rpc=MSCLDAP_RPC_NETLOGON;
 	}
     }
@@ -1819,6 +1799,7 @@
       proto_tree_add_text(tree, a->tvb, start, 0,
         "ERROR: Couldn't parse compare value: %s", asn1_err_to_str(ret));
     }
+    g_free(string1);
     return;
   }
 
@@ -1953,6 +1934,7 @@
   proto_tree *ctrls_tree = NULL;
   int start = a->offset;
   int end;
+  guint ctrls_length;
 
   ret = asn1_header_decode(a, &cls, &con, &tag, &def, &length);
   if (ret != ASN1_ERR_NOERROR) {
@@ -1968,7 +1950,8 @@
     return;
   }
 
-  ctrls_item = proto_tree_add_text(tree, a->tvb, start, length, "LDAP Controls");
+  ctrls_length = (a->offset - start) + length;
+  ctrls_item = proto_tree_add_text(tree, a->tvb, start, ctrls_length, "LDAP Controls");
   ctrls_tree = proto_item_add_subtree(ctrls_item, ett_ldap_controls);
 
   end = a->offset + length;
@@ -1978,6 +1961,7 @@
     guint seq_length;
     int seq_start = a->offset;
     int seq_end;
+    guint ctrl_length;
 
     ret = read_sequence(a, &seq_length);
     if (ret != ASN1_ERR_NOERROR) {
@@ -1987,7 +1971,8 @@
       return;
     }
 
-    ctrl_item = proto_tree_add_text(ctrls_tree, a->tvb, seq_start, seq_length, "LDAP Control");
+    ctrl_length = (a->offset - seq_start) + seq_length;
+    ctrl_item = proto_tree_add_text(ctrls_tree, a->tvb, seq_start, ctrl_length, "LDAP Control");
     ctrl_tree = proto_item_add_subtree(ctrl_item, ett_ldap_control);
 
     seq_end = a->offset + seq_length;
@@ -2343,34 +2328,158 @@
   asn1_close(&a, &next_offset);	/* XXX - use the new value of next_offset? */
 }
 
-
 static void
-dissect_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_mscldap)
+dissect_ldap_payload(tvbuff_t *tvb, packet_info *pinfo,
+		     proto_tree *tree, ldap_conv_info_t *ldap_info,
+		     gboolean rest_is_pad, gboolean is_mscldap)
 {
   int offset = 0;
   gboolean first_time = TRUE;
-  conversation_t *conversation;
-  gboolean doing_sasl_security = FALSE;
   guint length_remaining;
-  guint32 sasl_length;
-  guint32 message_data_len;
-  proto_item *ti = NULL;
-  proto_tree *ldap_tree = NULL;
   ASN1_SCK a;
   int ret;
-  guint messageLength;
+  guint msg_len;
   int messageOffset;
   guint headerLength;
   guint length;
-  gint available_length, reported_length;
-  int len;
-  proto_item *gitem = NULL;
-  proto_tree *gtree = NULL;
-  tvbuff_t *next_tvb;
-  ldap_conv_info_t *ldap_info=NULL;
-  int tmp_offset;
+  tvbuff_t *msg_tvb = NULL;
+  proto_item *msg_item = NULL;
+  proto_tree *msg_tree = NULL;
+
+  while (tvb_reported_length_remaining(tvb, offset) > 0) {
+    /*
+     * This will throw an exception if we don't have any data left.
+     * That's what we want.  (See "tcp_dissect_pdus()", which is
+     * similar)
+     */
+    length_remaining = tvb_ensure_length_remaining(tvb, offset);
+
+    if (rest_is_pad && length_remaining < 6) return;
+
+    /*
+     * The frame begins
+     * with a "Sequence Of" header.
+     * Can we do reassembly?
+     */
+    if (ldap_desegment && pinfo->can_desegment) {
+        /*
+         * Yes - is the "Sequence Of" header split across segment
+         * boundaries?  We require at least 6 bytes for the header
+         * which allows for a 4 byte length (ASN.1 BER).
+         */
+        if (length_remaining < 6) {
+	  /* stop if the caller says that we are given all data and the rest is padding
+	   * this is for the SASL GSSAPI case when the data is only signed and not sealed
+	   */
+          pinfo->desegment_offset = offset;
+          pinfo->desegment_len = 6 - length_remaining;
+          return;
+        }
+    }
+
+    /*
+     * OK, try to read the "Sequence Of" header; this gets the total
+     * length of the LDAP message.
+     */
+    asn1_open(&a, tvb, offset);
+    ret = read_sequence(&a, &msg_len);
+    asn1_close(&a, &messageOffset);
+
+    if (ret == ASN1_ERR_NOERROR) {
+      	/*
+      	 * Add the length of the "Sequence Of" header to the message
+      	 * length.
+      	 */
+      	headerLength = messageOffset - offset;
+      	msg_len += headerLength;
+        if (msg_len < headerLength) {
+    	    /*
+    	     * The message length was probably so large that the total length
+    	     * overflowed.
+    	     *
+    	     * Report this as an error.
+    	     */
+    	    show_reported_bounds_error(tvb, pinfo, tree);
+    	    return;
+        }
+    } else {
+      	/*
+      	 * We couldn't parse the header; just make it the amount of data
+      	 * remaining in the tvbuff, so we'll give up on this segment
+      	 * after attempting to parse the message - there's nothing more
+      	 * we can do.  "dissect_ldap_message()" will display the error.
+      	 */
+      	msg_len = length_remaining;
+    }
+
+    /*
+     * Is the message split across segment boundaries?
+     */
+    if (length_remaining < msg_len) {
+        /* provide a hint to TCP where the next PDU starts */
+        pinfo->want_pdu_tracking=2;
+        pinfo->bytes_until_next_pdu= msg_len - length_remaining;
+        /*
+         * Can we do reassembly?
+         */
+        if (ldap_desegment && pinfo->can_desegment) {
+	    /*
+	     * Yes.  Tell the TCP dissector where the data for this message
+	     * starts in the data it handed us, and how many more bytes
+	     * we need, and return.
+	     */
+	    pinfo->desegment_offset = offset;
+	    pinfo->desegment_len = msg_len - length_remaining;
+	    return;
+        }
+    }
+
+    /*
+     * Construct a tvbuff containing the amount of the payload we have
+     * available.  Make its reported length the amount of data in the
+     * LDAP message.
+     *
+     * XXX - if reassembly isn't enabled. the subdissector will throw a
+     * BoundsError exception, rather than a ReportedBoundsError exception.
+     * We really want a tvbuff where the length is "length", the reported
+     * length is "plen", and the "if the snapshot length were infinite"
+     * length is the minimum of the reported length of the tvbuff handed
+     * to us and "plen", with a new type of exception thrown if the offset
+     * is within the reported length but beyond that third length, with
+     * that exception getting the "Unreassembled Packet" error.
+     */
+    length = length_remaining;
+    if (length > msg_len) length = msg_len;
+    msg_tvb = tvb_new_subset(tvb, offset, length, msg_len);
+
+    /*
+     * Now dissect the LDAP message.
+     */
+    if (tree) {
+        msg_item = proto_tree_add_text(tree, msg_tvb, 0, msg_len, "LDAP Message");
+        msg_tree = proto_item_add_subtree(msg_item, ett_ldap_msg);
+    }
+
+    dissect_ldap_message(msg_tvb, 0, pinfo, msg_tree, msg_item, first_time, ldap_info, is_mscldap);
+
+    offset += msg_len;
+
+    first_time = FALSE;
+  }
+}
 
 
+static void
+dissect_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_mscldap)
+{
+  int offset = 0;
+  conversation_t *conversation;
+  gboolean doing_sasl_security = FALSE;
+  guint length_remaining;
+  ldap_conv_info_t *ldap_info = NULL;
+  proto_item *ldap_item = NULL;
+  proto_tree *ldap_tree = NULL;
+
   /*
    * Do we have a conversation for this connection?
    */
@@ -2380,16 +2489,18 @@
   if (conversation == NULL) {
     /* We don't yet have a conversation, so create one. */
     conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
-                                    pinfo->ptype, pinfo->srcport,
+    	                    	    pinfo->ptype, pinfo->srcport,
                                     pinfo->destport, 0);
   }
+
   /*
    * Do we already have a type and mechanism?
    */
   ldap_info = conversation_get_proto_data(conversation, proto_ldap);
   if (ldap_info == NULL) {
     /* No.  Attach that information to the conversation, and add
-       it to the list of information structures. */
+     * it to the list of information structures.
+     */
     ldap_info = g_mem_chunk_alloc(ldap_conv_info_chunk);
     ldap_info->auth_type = 0;
     ldap_info->auth_mech = 0;
@@ -2403,18 +2514,17 @@
 
   switch (ldap_info->auth_type) {
     case LDAP_AUTH_SASL:
-      /*
-       * It's SASL; are we using a security layer?
-       */
-      if (ldap_info->first_auth_frame != 0 &&
-          pinfo->fd->num >= ldap_info->first_auth_frame)
-        doing_sasl_security = TRUE;	/* yes */
+    /*
+     * It's SASL; are we using a security layer?
+     */
+    if (ldap_info->first_auth_frame != 0 &&
+       pinfo->fd->num >= ldap_info->first_auth_frame) {
+	doing_sasl_security = TRUE;	/* yes */
+    }
   }
 
-
-
-
   while (tvb_reported_length_remaining(tvb, offset) > 0) {
+
     /*
      * This will throw an exception if we don't have any data left.
      * That's what we want.  (See "tcp_dissect_pdus()", which is
@@ -2427,6 +2537,51 @@
     length_remaining = tvb_ensure_length_remaining(tvb, offset);
 
     /*
+     * Try to find out if we have a plain LDAP buffer
+     * with a "Sequence Of" header or a SASL buffer with
+     * Can we do reassembly?
+     */
+    if (ldap_desegment && pinfo->can_desegment) {
+        /*
+         * Yes - is the "Sequence Of" header split across segment
+         * boundaries?  We require at least 6 bytes for the header
+         * which allows for a 4 byte length (ASN.1 BER).
+	 * For the SASL case we need at least 4 bytes, so this is 
+	 * no problem here because we check for 6 bytes ans sasl buffers
+	 * with less than 2 bytes should not exist...
+         */
+        if (length_remaining < 6) {
+    	    pinfo->desegment_offset = offset;
+    	    pinfo->desegment_len = 6 - length_remaining;
+    	    return;
+        }
+    }
+
+    /* It might still be a packet containing a SASL security layer
+     * but its just that we never saw the BIND packet.
+     * check if it looks like it could be a SASL blob here
+     * and in that case just assume it is GSS-SPNEGO
+     */
+    if(!doing_sasl_security && (tvb_bytes_exist(tvb, offset, 5))
+      &&(tvb_get_ntohl(tvb, offset)<=(guint)(tvb_reported_length_remaining(tvb, offset)-4))
+      &&(tvb_get_guint8(tvb, offset+4)==0x60) ){
+        ldap_info->auth_type=LDAP_AUTH_SASL;
+        ldap_info->first_auth_frame=pinfo->fd->num;
+        ldap_info->auth_mech=g_strdup("GSS-SPNEGO");
+        doing_sasl_security=TRUE;
+    }
+
+    /*
+     * This is the first PDU, set the Protocol column and clear the
+     * Info column.
+     */
+    if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, pinfo->current_proto);
+    if (check_col(pinfo->cinfo, COL_INFO)) col_clear(pinfo->cinfo, COL_INFO);
+
+    ldap_item = proto_tree_add_item(tree, proto_ldap, tvb, 0, -1, FALSE);
+    ldap_tree = proto_item_add_subtree(ldap_item, ett_ldap);
+
+    /*
      * Might we be doing a SASL security layer and, if so, *are* we doing
      * one?
      *
@@ -2442,26 +2597,16 @@
      * but we want to parse garbage as LDAP messages rather than really
      * huge lengths).
      */
+
     if (doing_sasl_security && tvb_get_guint8(tvb, offset) == 0) {
+      proto_item *sasl_item = NULL;
+      proto_tree *sasl_tree = NULL;
+      tvbuff_t *sasl_tvb;
+      guint sasl_len, sasl_msg_len, length;
       /*
        * Yes.  The frame begins with a 4-byte big-endian length.
-       * Can we do reassembly?
+       * And we know we have at least 6 bytes
        */
-      if (ldap_desegment && pinfo->can_desegment) {
-        /*
-         * Yes - is the SASL length split across segment boundaries?
-         */
-        if (length_remaining < 4) {
-          /*
-           * Yes.  Tell the TCP dissector where the data for this message
-           * starts in the data it handed us, and how many more bytes we
-           * need, and return.
-           */
-          pinfo->desegment_offset = offset;
-          pinfo->desegment_len = 4 - length_remaining;
-          return;
-        }
-      }
 
       /*
        * Get the SASL length, which is the length of data in the buffer
@@ -2471,9 +2616,9 @@
        * assume that each LDAP message is entirely contained within
        * a buffer.
        */
-      sasl_length = tvb_get_ntohl(tvb, offset);
-      message_data_len = sasl_length + 4;
-      if (message_data_len < 4) {
+      sasl_len = tvb_get_ntohl(tvb, offset);
+      sasl_msg_len = sasl_len + 4;
+      if (sasl_msg_len < 4) {
         /*
          * The message length was probably so large that the total length
 	 * overflowed.
@@ -2487,10 +2632,10 @@
       /*
        * Is the buffer split across segment boundaries?
        */
-      if (length_remaining < message_data_len) {
+      if (length_remaining < sasl_msg_len) {
         /* provide a hint to TCP where the next PDU starts */
-        pinfo->want_pdu_tracking=2;
-        pinfo->bytes_until_next_pdu=message_data_len-length_remaining;
+        pinfo->want_pdu_tracking = 2;
+        pinfo->bytes_until_next_pdu= sasl_msg_len - length_remaining;
         /*
          * Can we do reassembly?
          */
@@ -2501,7 +2646,7 @@
            * need, and return.
            */
           pinfo->desegment_offset = offset;
-          pinfo->desegment_len = message_data_len - length_remaining;
+          pinfo->desegment_len = sasl_msg_len - length_remaining;
           return;
         }
       }
@@ -2520,34 +2665,23 @@
        * that exception getting the "Unreassembled Packet" error.
        */
       length = length_remaining;
-      if (length > message_data_len)
-        length = message_data_len;
-      next_tvb = tvb_new_subset(tvb, offset, length, message_data_len);
-
-      /*
-       * If this is the first PDU, set the Protocol column and clear the
-       * Info column.
-       */
-      if (first_time)
-      {
-        if (check_col(pinfo->cinfo, COL_PROTOCOL))
-          col_set_str(pinfo->cinfo, COL_PROTOCOL, pinfo->current_proto);
-        if (check_col(pinfo->cinfo, COL_INFO))
-          col_clear(pinfo->cinfo, COL_INFO);
-      }
+      if (length > sasl_msg_len) length = sasl_msg_len;
+      sasl_tvb = tvb_new_subset(tvb, offset, length, sasl_msg_len);
 
-      if (tree)
-      {
-        ti = proto_tree_add_item(tree, proto_ldap, next_tvb, 0, -1, FALSE);
-        ldap_tree = proto_item_add_subtree(ti, ett_ldap);
+      if (ldap_tree) {
+        proto_tree_add_uint(ldap_tree, hf_ldap_sasl_buffer_length, sasl_tvb, 0, 4,
+                            sasl_len);
 
-        proto_tree_add_uint(ldap_tree, hf_ldap_sasl_buffer_length, tvb, 0, 4,
-                            sasl_length);
+        sasl_item = proto_tree_add_text(ldap_tree, sasl_tvb, 0,  sasl_msg_len, "SASL buffer");
+        sasl_tree = proto_item_add_subtree(sasl_item, ett_ldap_sasl_blob);
       }
 
       if (ldap_info->auth_mech != NULL &&
           strcmp(ldap_info->auth_mech, "GSS-SPNEGO") == 0) {
-	  int header_len;
+	  tvbuff_t *gssapi_tvb, *plain_tvb = NULL, *decr_tvb= NULL;
+	  int ver_len;
+	  int length;
+
           /*
            * This is GSS-API (using SPNEGO, but we should be done with
            * the negotiation by now).
@@ -2556,31 +2690,20 @@
            * the token, from which we compute the offset in the tvbuff at
            * which the plaintext data, i.e. the LDAP message, begins.
            */
-          available_length = tvb_length_remaining(tvb, 4);
-          reported_length = tvb_reported_length_remaining(tvb, 4);
-          g_assert(available_length >= 0);
-          g_assert(reported_length >= 0);
-          if (available_length > reported_length) 
-            available_length = reported_length;
-
-          next_tvb = tvb_new_subset(tvb, 4, available_length, reported_length);
-          if (tree)
-          {
-            gitem = proto_tree_add_text(ldap_tree, next_tvb, 0, -1, "GSS-API Token");
-            gtree = proto_item_add_subtree(gitem, ett_ldap_gssapi_token);
-          }
+          length = tvb_length_remaining(sasl_tvb, 4);
+          if ((guint)length > sasl_len)
+              length = sasl_len;
+	  gssapi_tvb = tvb_new_subset(sasl_tvb, 4, length, sasl_len);
 
 	  /* Attempt decryption of the GSSAPI wrapped data if possible */
 	  pinfo->decrypt_gssapi_tvb=DECRYPT_GSSAPI_NORMAL;
 	  pinfo->gssapi_wrap_tvb=NULL;
 	  pinfo->gssapi_encrypted_tvb=NULL;
 	  pinfo->gssapi_decrypted_tvb=NULL;
-          len = call_dissector(gssapi_wrap_handle, next_tvb, pinfo, gtree);
-	  header_len=4+len;
-	  /* if we could decrypt, do a tvb shuffle */
+          ver_len = call_dissector(gssapi_wrap_handle, gssapi_tvb, pinfo, sasl_tree);
+	  /* if we could unwrap, do a tvb shuffle */
 	  if(pinfo->gssapi_decrypted_tvb){
-		tvb=pinfo->gssapi_decrypted_tvb;
-		header_len=0;
+		decr_tvb=pinfo->gssapi_decrypted_tvb;
 	  }
 	  /* tidy up */
 	  pinfo->decrypt_gssapi_tvb=0;
@@ -2592,185 +2715,82 @@
            * if len is 0 it probably mean that we got a PDU that is not
            * aligned to the start of the segment.
            */
-          if(len==0){
+          if(ver_len==0){
              return;
           }
-          if (gitem != NULL)
-              proto_item_set_len(gitem, len);
 
+	  /*
+	   * if we don't have unwrapped data,
+	   * see if the wrapping involved encryption of the
+	   * data; if not, just use the plaintext data.
+	   */
+	  if (!decr_tvb) {
+	    if(!pinfo->gssapi_data_encrypted){
+	      plain_tvb = tvb_new_subset(gssapi_tvb,  ver_len, -1, -1);
+	    }
+	  }
 
-          /*
-           * check if it's LDAP or an encrypted blob (or a decrypted blob)
-           */
+          if (decr_tvb) {
+	    proto_item *enc_item = NULL;
+	    proto_tree *enc_tree = NULL;
 
-          asn1_open(&a, tvb, header_len);
-          ret = check_optional_tag(&a, ASN1_UNI, ASN1_CON, ASN1_SEQ);
-          asn1_close(&a, &tmp_offset);
-          if (ret == ASN1_ERR_NOERROR) {
             /*
-             * Now dissect the LDAP message.
+             * The LDAP message was encrypted in the packet, and has
+             * been decrypted; dissect the decrypted LDAP message.
              */
-            dissect_ldap_message(tvb, header_len, pinfo, ldap_tree, ti, first_time, ldap_info, is_mscldap);
-          } else {
-            if (first_time && check_col(pinfo->cinfo, COL_INFO)) {
-              col_add_fstr(pinfo->cinfo, COL_INFO, "LDAP GSS-API Encrypted payload (%d byte%s)",
-                                sasl_length - len,
-                                plurality(sasl_length - len, "", "s"));
+            if (sasl_tree) {
+	      enc_item = proto_tree_add_text(sasl_tree, gssapi_tvb, ver_len, -1,
+                                "GSS-API Encrypted payload (%d byte%s)",
+                                sasl_len - ver_len,
+                                plurality(sasl_len - ver_len, "", "s"));
+	      enc_tree = proto_item_add_subtree(enc_item, ett_ldap_payload);
             }
-            proto_tree_add_text(ldap_tree, tvb, header_len, -1,
+	    dissect_ldap_payload(decr_tvb, pinfo, enc_tree, ldap_info, TRUE, is_mscldap);
+          } else if (plain_tvb) {
+	    proto_item *plain_item = NULL;
+	    proto_tree *plain_tree = NULL;
+
+	    /*
+	     * The LDAP message wasn't encrypted in the packet;
+	     * dissect the plain LDAP message.
+             */
+	    if (sasl_tree) {
+              plain_item = proto_tree_add_text(sasl_tree, gssapi_tvb, ver_len, -1,
+                                "GSS-API payload (%d byte%s)",
+                                sasl_len - ver_len,
+                                plurality(sasl_len - ver_len, "", "s"));
+	      plain_tree = proto_item_add_subtree(plain_item, ett_ldap_payload);
+            }
+            dissect_ldap_payload(plain_tvb, pinfo, plain_tree, ldap_info, TRUE, is_mscldap);
+	  } else {
+            /*
+             * The LDAP message was encrypted in the packet, and was
+             * not decrypted; just show it as encrypted data.
+             */
+            if (check_col(pinfo->cinfo, COL_INFO)) {
+        	    col_add_fstr(pinfo->cinfo, COL_INFO, "LDAP GSS-API Encrypted payload (%d byte%s)",
+                                 sasl_len - ver_len,
+                                 plurality(sasl_len - ver_len, "", "s"));
+            }
+	    if (sasl_tree) {
+              proto_tree_add_text(sasl_tree, gssapi_tvb, ver_len, -1,
                                 "GSS-API Encrypted payload (%d byte%s)",
-                                sasl_length - len,
-                                plurality(sasl_length - len, "", "s"));
+                                sasl_len - ver_len,
+                                plurality(sasl_len - ver_len, "", "s"));
+	    }
           }
-      } else {
-        /*
-         * We don't know how to handle other authentication mechanisms
-         * yet, so just put in an entry for the SASL buffer.
-         */
-        proto_tree_add_text(ldap_tree, tvb, 4, -1, "SASL buffer");
       }
-      offset += message_data_len;
+      offset += sasl_msg_len;
     } else {
-      /*
-       * No, we're not doing a SASL security layer.  The frame begins
-       * with a "Sequence Of" header.
-       * Can we do reassembly?
-       */
-      if (ldap_desegment && pinfo->can_desegment) {
-        /*
-         * Yes - is the "Sequence Of" header split across segment
-         * boundaries?  We require at least 6 bytes for the header
-         * which allows for a 4 byte length (ASN.1 BER).
-         */
-        if (length_remaining < 6) {
-          pinfo->desegment_offset = offset;
-          pinfo->desegment_len = 6 - length_remaining;
-          return;
-        }
-      }
-
-      /* It might still be a packet containing a SASL security layer
-       * but its just that we never saw the BIND packet.
-       * check if it looks like it could be a SASL blob here
-       * and in that case just assume it is GSS-SPNEGO
-       */
-      if( (tvb_bytes_exist(tvb, offset, 5))
-        &&(tvb_get_ntohl(tvb, offset)<=(guint)(tvb_reported_length_remaining(tvb, offset)-4))
-        &&(tvb_get_guint8(tvb, offset+4)==0x60) ){
-         ldap_info->auth_type=LDAP_AUTH_SASL;
-         ldap_info->first_auth_frame=pinfo->fd->num;
-         ldap_info->auth_mech=g_strdup("GSS-SPNEGO");
-         doing_sasl_security=TRUE;
-         continue;
-      }
-
-
-      /*
-       * OK, try to read the "Sequence Of" header; this gets the total
-       * length of the LDAP message.
-       */
-      asn1_open(&a, tvb, offset);
-      ret = read_sequence(&a, &messageLength);
-      asn1_close(&a, &messageOffset);
-
-      if (ret == ASN1_ERR_NOERROR) {
-      	/*
-      	 * Add the length of the "Sequence Of" header to the message
-      	 * length.
-      	 */
-      	headerLength = messageOffset - offset;
-      	messageLength += headerLength;
-        if (messageLength < headerLength) {
-          /*
-           * The message length was probably so large that the total length
-           * overflowed.
-           *
-           * Report this as an error.
-           */
-          show_reported_bounds_error(tvb, pinfo, tree);
-          return;
-        }
-      } else {
-      	/*
-      	 * We couldn't parse the header; just make it the amount of data
-      	 * remaining in the tvbuff, so we'll give up on this segment
-      	 * after attempting to parse the message - there's nothing more
-      	 * we can do.  "dissect_ldap_message()" will display the error.
-      	 */
-      	messageLength = length_remaining;
-      }
-
-      /*
-       * Is the message split across segment boundaries?
-       */
-      if (length_remaining < messageLength) {
-        /* provide a hint to TCP where the next PDU starts */
-        pinfo->want_pdu_tracking=2;
-        pinfo->bytes_until_next_pdu=messageLength-length_remaining;
-        /*
-         * Can we do reassembly?
-         */
-        if (ldap_desegment && pinfo->can_desegment) {
-	  /*
-	   * Yes.  Tell the TCP dissector where the data for this message
-	   * starts in the data it handed us, and how many more bytes
-	   * we need, and return.
-	   */
-	  pinfo->desegment_offset = offset;
-	  pinfo->desegment_len = messageLength - length_remaining;
-	  return;
-        }
-      }
-
-      /*
-       * If this is the first PDU, set the Protocol column and clear the
-       * Info column.
-       */
-      if (first_time) {
-        if (check_col(pinfo->cinfo, COL_PROTOCOL))
-          col_set_str(pinfo->cinfo, COL_PROTOCOL, pinfo->current_proto);
-        if (check_col(pinfo->cinfo, COL_INFO))
-          col_clear(pinfo->cinfo, COL_INFO);
-      }
-
-      /*
-       * Construct a tvbuff containing the amount of the payload we have
-       * available.  Make its reported length the amount of data in the
-       * LDAP message.
-       *
-       * XXX - if reassembly isn't enabled. the subdissector will throw a
-       * BoundsError exception, rather than a ReportedBoundsError exception.
-       * We really want a tvbuff where the length is "length", the reported
-       * length is "plen", and the "if the snapshot length were infinite"
-       * length is the minimum of the reported length of the tvbuff handed
-       * to us and "plen", with a new type of exception thrown if the offset
-       * is within the reported length but beyond that third length, with
-       * that exception getting the "Unreassembled Packet" error.
-       */
-      length = length_remaining;
-      if (length > messageLength)
-        length = messageLength;
-      next_tvb = tvb_new_subset(tvb, offset, length, messageLength);
-
-      /*
-       * Now dissect the LDAP message.
-       */
-      if (tree) {
-        ti = proto_tree_add_item(tree, proto_ldap, next_tvb, 0, -1, FALSE);
-        ldap_tree = proto_item_add_subtree(ti, ett_ldap);
-      } else
-        ldap_tree = NULL;
-      dissect_ldap_message(next_tvb, 0, pinfo, ldap_tree, ti, first_time, ldap_info, is_mscldap);
-
-      offset += messageLength;
+	/* plain LDAP, so dissect the payload */
+	dissect_ldap_payload(tvb, pinfo, ldap_tree, ldap_info, FALSE, is_mscldap);
+	/* dissect_ldap_payload() has it's own loop so go out here */
+	break;
     }
-
-    first_time = FALSE;
   }
 }
 
 
-
 static void
 dissect_ldap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
@@ -3154,7 +3174,9 @@
 
   static gint *ett[] = {
     &ett_ldap,
-    &ett_ldap_gssapi_token,
+    &ett_ldap_msg,
+    &ett_ldap_payload,
+    &ett_ldap_sasl_blob,
     &ett_ldap_referrals,
     &ett_ldap_attribute,
     &ett_ldap_controls,
--- ethereal-0.10.10.orig/epan/dissectors/packet-lmp.c
+++ ethereal-0.10.10/epan/dissectors/packet-lmp.c
@@ -3,7 +3,7 @@
  *
  * (c) Copyright Ashok Narayanan <ashokn@cisco.com>
  *
- * $Id: packet-lmp.c 12766 2004-12-17 19:27:46Z guy $
+ * $Id: packet-lmp.c 13879 2005-03-23 09:47:11Z guy $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1025,13 +1025,18 @@
 		lmp_object_header_tree = proto_item_add_subtree(ti2, lmp_09_subtree[LMP_TREE_OBJECT_HEADER]);
 		proto_tree_add_text(lmp_object_header_tree, tvb, offset, 1,
 				negotiable ? "Negotiable" : "Not Negotiable");
-		proto_tree_add_text(lmp_object_header_tree, tvb, offset+2, 2,
-				"Length: %u", obj_length);
+		proto_tree_add_item(lmp_object_header_tree, lmp_filter[LMPF_VAL_CTYPE],
+				    tvb, offset, 1, type);
 		proto_tree_add_text(lmp_object_header_tree, tvb, offset+1, 1,
 				"Object Class: %u - %s",
 				class, object_type);
-		proto_tree_add_item(lmp_object_header_tree, lmp_filter[LMPF_VAL_CTYPE],
-				    tvb, offset, 1, type);
+		if (obj_length < 4) {
+		    proto_tree_add_text(lmp_object_header_tree, tvb, offset+2, 2,
+				    "Length: %u (bogus, must be >= 4)", obj_length);
+		    break;
+		}
+		proto_tree_add_text(lmp_object_header_tree, tvb, offset+2, 2,
+				"Length: %u", obj_length);
 		offset2 = offset+4;
 		mylen = obj_length - 4;
 	  } else /* LMP_VER_DRAFT_CCAMP_03 */ {
@@ -1058,13 +1063,18 @@
 		lmp_object_header_tree = proto_item_add_subtree(ti2, lmp_subtree[LMP_TREE_OBJECT_HEADER]);
 		proto_tree_add_text(lmp_object_header_tree, tvb, offset, 1,
 				negotiable ? "Negotiable" : "Not Negotiable");
-		proto_tree_add_text(lmp_object_header_tree, tvb, offset+2, 2,
-				"Length: %u", obj_length);
+		proto_tree_add_item(lmp_object_header_tree, lmp_filter[LMPF_VAL_CTYPE],
+				    tvb, offset, 1, type);
 		proto_tree_add_text(lmp_object_header_tree, tvb, offset+1, 1,
 				"Object Class: %u - %s",
 				class, object_type);
-		proto_tree_add_item(lmp_object_header_tree, lmp_filter[LMPF_VAL_CTYPE],
-				    tvb, offset, 1, type);
+		if (obj_length < 4) {
+		    proto_tree_add_text(lmp_object_header_tree, tvb, offset+2, 2,
+				    "Length: %u (bogus, must be >= 4)", obj_length);
+		    break;
+		}
+		proto_tree_add_text(lmp_object_header_tree, tvb, offset+2, 2,
+				"Length: %u", obj_length);
 		offset2 = offset+4;
 		mylen = obj_length - 4;
 	  }
@@ -1417,6 +1427,11 @@
 		    lmp_subobj_tree = proto_item_add_subtree(ti2, lmp_09_subtree[LMP_TREE_DATA_LINK_SUBOBJ]);
 		    proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 1,
 					"Subobject Type: %d", tvb_get_guint8(tvb, offset2+l));
+		    if (mylen < 2) {
+			proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+1, 1,
+					    "Subobject Length: %d (bogus, must be >= 2)", mylen);
+			break;
+		    }
 		    proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+1, 1,
 					"Subobject Length: %d", mylen);
 		    switch(tvb_get_guint8(tvb, offset2+l)) {
@@ -1445,21 +1460,20 @@
 
 		    case 2:
 			proto_item_set_text(ti2, "Wavelength: %d",
-					    tvb_get_ntohl(tvb, offset2+l+2));
+					    tvb_get_ntohl(tvb, offset2+l+4));
 			proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+4, 4,
 					    "Wavelength: %d",
 					    tvb_get_ntohl(tvb, offset2+l+4));
 			break;
 
 		    default:
-			proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l,
-					    tvb_get_guint8(tvb, offset2+l+1),
-					    "Data (%d bytes)", tvb_get_guint8(tvb, offset2+l+1));
+			proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+2,
+					    mylen-2,
+					    "Data (%d bytes)", mylen-2);
 			break;
 		    }
-		    l += tvb_get_guint8(tvb, offset2+l+1);
+		    l += mylen;
 		}
-
 		break;
 
 	    case LMP_09_CLASS_CHANNEL_STATUS:
@@ -1960,6 +1974,11 @@
 		    lmp_subobj_tree = proto_item_add_subtree(ti2, lmp_subtree[LMP_TREE_DATA_LINK_SUBOBJ]);
 		    proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 1,
 					"Subobject Type: %d", tvb_get_guint8(tvb, offset2+l));
+		    if (mylen < 2) {
+			proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+1, 1,
+					    "Subobject Length: %d (bogus, must be >= 2)", mylen);
+			break;
+		    }
 		    proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+1, 1,
 					"Subobject Length: %d", mylen);
 		    switch(tvb_get_guint8(tvb, offset2+l)) {
@@ -1995,12 +2014,12 @@
 			break;
 			    
 		    default:
-			proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l,
-					    tvb_get_guint8(tvb, offset2+l+1),
-					    "Data (%d bytes)", tvb_get_guint8(tvb, offset2+l+1));
+			proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+2,
+					    mylen,
+					    "Data (%d bytes)", mylen-2);
 			break;
 		    }
-		    l += tvb_get_guint8(tvb, offset2+l+1);
+		    l += mylen;
 		}
 		break;
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-mount.c
+++ ethereal-0.10.10/epan/dissectors/packet-mount.c
@@ -147,6 +147,7 @@
 
 			host=ip_to_str(pinfo->dst.data);
 			len=tvb_get_ntohl(tvb, offset);
+                        DISSECTOR_ASSERT(len < ITEM_LABEL_LENGTH);
 
 			dir=tvb_get_ptr(tvb, offset+4, len);
 			if(dir){
--- ethereal-0.10.10.orig/epan/dissectors/packet-mq.c
+++ ethereal-0.10.10/epan/dissectors/packet-mq.c
@@ -1564,7 +1564,7 @@
 							{
 								guint8* sStructId;
 								sStructId = tvb_get_string(tvb, offset, 4);
-								ti = proto_tree_add_text(mqroot_tree, tvb, offset, 12, (const char*)sStructId);
+								ti = proto_tree_add_text(mqroot_tree, tvb, offset, 12, "%s", sStructId);
 								g_free(sStructId);
 								mq_tree = proto_item_add_subtree(ti, ett_mq_spi_base);
 	
@@ -1607,7 +1607,7 @@
 									/* Dissect the common part of these structures */
 									guint8* sStructId;
 									sStructId = tvb_get_string(tvb, offset, 4);
-									ti = proto_tree_add_text(mqroot_tree, tvb, offset, -1, (const char*)sStructId);
+									ti = proto_tree_add_text(mqroot_tree, tvb, offset, -1, "%s", sStructId);
 									g_free(sStructId);
 									mq_tree = proto_item_add_subtree(ti, ett_mq_spi_base);
 	
--- ethereal-0.10.10.orig/epan/dissectors/packet-mrdisc.c
+++ ethereal-0.10.10/epan/dissectors/packet-mrdisc.c
@@ -1,7 +1,7 @@
 /* packet-mrdisc.c   2001 Ronnie Sahlberg <See AUTHORS for email>
  * Routines for IGMP/MRDISC packet disassembly
  *
- * $Id: packet-mrdisc.c 11410 2004-07-18 18:06:47Z gram $
+ * $Id: packet-mrdisc.c 14227 2005-04-29 03:35:38Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -133,6 +133,8 @@
 					tvb_get_ntohs(tvb, offset));
 			}
 
+			if (len != 2)
+				THROW(ReportedBoundsError);
 			proto_tree_add_item(tree, hf_qi, tvb, offset, len,
 				FALSE);
 			offset += len;
@@ -144,6 +146,8 @@
 					tvb_get_ntohs(tvb, offset));
 			}
 
+			if (len != 2)
+				THROW(ReportedBoundsError);
 			proto_tree_add_item(tree, hf_rv, tvb, offset, len,
 				FALSE);
 			offset += len;
--- ethereal-0.10.10.orig/epan/dissectors/packet-ncp.c
+++ ethereal-0.10.10/epan/dissectors/packet-ncp.c
@@ -9,7 +9,7 @@
  * Portions Copyright (c) by James Coe 2000-2002
  * Portions Copyright (c) Novell, Inc. 2000-2003
  *
- * $Id: packet-ncp.c 13366 2005-02-09 23:38:00Z lroland $
+ * $Id: packet-ncp.c 14197 2005-04-27 04:09:15Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -312,7 +312,7 @@
 	struct ncp_common_header	header;
 	guint16				nw_connection, ncp_burst_seqno, ncp_ack_seqno;
 	guint16				flags = 0;
-	char				flags_str[1+3+1+3+1+3+1+1];
+	char				flags_str[2+3+1+3+1+3+1+3+1+3+1+1];
 	char				*sep;
 	proto_tree			*flags_tree = NULL;
 	int				hdr_offset = 0;
--- ethereal-0.10.10.orig/epan/dissectors/packet-ncp-nmas.c
+++ ethereal-0.10.10/epan/dissectors/packet-ncp-nmas.c
@@ -202,11 +202,11 @@
 {
         int     foffset = offset;
         guint32 str_length;
-        char    buffer[1024];
+        char    buffer[ITEM_LABEL_LENGTH];
         guint32 i;
         guint16 c_char;
         guint32 length_remaining = 0;
-        
+
         if (little) {
             str_length = tvb_get_letohl(tvb, foffset);
         }
@@ -215,7 +215,7 @@
             str_length = tvb_get_ntohl(tvb, foffset);
         }
         foffset += 4;
-        if(str_length > 1024)
+        if(str_length >= ITEM_LABEL_LENGTH)
         {
                 proto_tree_add_string(nmas_tree, hfinfo, tvb, foffset,
                     length_remaining + 4, "<String too long to process>");
--- ethereal-0.10.10.orig/epan/dissectors/packet-ndps.c
+++ ethereal-0.10.10/epan/dissectors/packet-ndps.c
@@ -3,7 +3,7 @@
  * Greg Morris <gmorris@novell.com>
  * Copyright (c) Novell, Inc. 2002-2003
  *
- * $Id: packet-ndps.c 13366 2005-02-09 23:38:00Z lroland $
+ * $Id: packet-ndps.c 14266 2005-05-02 14:12:42Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -39,6 +39,8 @@
 #include <epan/reassemble.h>
 
 #define NDPS_PACKET_INIT_COUNT	200
+/* Limit the number of items we can add to the tree. */
+#define NDPS_MAX_ITEMS 50
 
 /* Tables for reassembly of fragments. */
 static GHashTable *ndps_fragment_table = NULL;
@@ -1591,11 +1593,11 @@
 {
         int     foffset = offset;
         guint32 str_length;
-        char    buffer[1024];
+        char    buffer[ITEM_LABEL_LENGTH];
         guint32 i;
         guint16 c_char;
         guint32 length_remaining = 0;
-        
+
         if (stringval == NULL) {
                 stringval = buffer;
                 buflen = sizeof buffer;
@@ -1603,7 +1605,7 @@
         str_length = tvb_get_ntohl(tvb, foffset);
         foffset += 4;
         length_remaining = tvb_length_remaining(tvb, foffset);
-        if(str_length > (guint)length_remaining || str_length > 1024)
+        if(str_length > (guint)length_remaining || str_length >= ITEM_LABEL_LENGTH)
         {
                 proto_tree_add_string(ndps_tree, hfinfo, tvb, foffset,
                     length_remaining + 4, "<String too long to process>");
@@ -1805,6 +1807,7 @@
         foffset += 1;
         length = tvb_get_guint8(tvb, foffset);
         foffset += 1;
+        tvb_ensure_bytes_exist(tvb, foffset, length);
         proto_tree_add_item(atree, hf_ndps_oid, tvb, foffset, length, FALSE);
         foffset += length;
     }
@@ -1823,6 +1826,10 @@
         }
     }
     global_attribute_name = label;
+    /* XXX - There's probably a better way to handle this */
+    if ((int) (foffset+(length%2)) < 0) {
+        THROW(ReportedBoundsError);
+    }
     return foffset+(length%2);
 }
 
@@ -2031,12 +2038,17 @@
         foffset += 4;
         for (i = 1 ; i <= number_of_items; i++ )
         {
+	    if (i > NDPS_MAX_ITEMS) {
+	        proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	        break;
+	    }
             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Password %d", i);
             atree = proto_item_add_subtree(aitem, ett_ndps);
             length = tvb_get_ntohl(tvb, foffset);
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(atree, hf_ndps_password, tvb, foffset, length, FALSE);
             }
             proto_item_set_end(aitem, tvb, foffset);
@@ -2048,6 +2060,7 @@
         foffset += 4;
         if (length!=0)
         {
+            tvb_ensure_bytes_exist(tvb, foffset, length);
             proto_tree_add_item(ndps_tree, hf_ndps_certified, tvb, foffset, length, FALSE);
         }
         foffset += length;
@@ -2118,6 +2131,10 @@
     foffset += 4;
     for (i = 1 ; i <= number_of_items; i++ )
     {
+	if (i > NDPS_MAX_ITEMS) {
+	    proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	    break;
+	}
         bitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Event %u", i);
         btree = proto_item_add_subtree(bitem, ett_ndps);
         proto_tree_add_item(btree, hf_ndps_event_type, tvb, foffset, 4, FALSE);
@@ -2144,6 +2161,10 @@
                 foffset += 4;
                 for (j = 1 ; j <= number_of_items2; j++ )
                 {
+	            if (j > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(btree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     citem = proto_tree_add_text(btree, tvb, foffset, -1, "Item %u", j);
                     ctree = proto_item_add_subtree(citem, ett_ndps);
                     foffset = objectidentifier(tvb, ctree, foffset);
@@ -2173,16 +2194,23 @@
     foffset += 4;
     for (i = 1 ; i <= number_of_items; i++ )
     {
+	if (i > NDPS_MAX_ITEMS) {
+	    proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	    break;
+	}
         aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Cardinal %u", i);
         atree = proto_item_add_subtree(aitem, ett_ndps);
         length = tvb_get_ntohl(tvb, foffset);
         foffset += 4;
-        if (length!=0)
+        if (length==4)
         {
+            tvb_ensure_bytes_exist(tvb, foffset, length);
             proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
         }
         foffset += length;
         foffset += (length%2);
+        if ((int) foffset <= 0)
+            THROW(ReportedBoundsError);
         proto_item_set_end(aitem, tvb, foffset);
     }
     return foffset;
@@ -2213,6 +2241,10 @@
     foffset += 4;
     for (i = 1 ; i <= number_of_items; i++ )
     {
+	if (i > NDPS_MAX_ITEMS) {
+	    proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	    break;
+	}
         bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Info %u", i);
         btree = proto_item_add_subtree(bitem, ett_ndps);
         data_type = tvb_get_ntohl(tvb, foffset);
@@ -2322,6 +2354,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Item %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = name_or_id(tvb, atree, foffset);
@@ -2339,6 +2375,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Name %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = ndps_string(tvb, hf_object_name, atree, foffset, NULL, 0);
@@ -2372,8 +2412,9 @@
         case 14:         /* Cardinal Seq */
             length = tvb_get_ntohl(tvb, foffset);
             foffset += 4;
-            if (length!=0)
+            if (length==4)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_info_int32, tvb, foffset, length, FALSE);
             }
             foffset += length;
@@ -2401,6 +2442,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Item %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 proto_tree_add_item(atree, hf_ndps_n64, tvb, foffset, 8, FALSE);
@@ -2438,6 +2483,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Object %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = objectidentifier(tvb, atree, foffset);
@@ -2450,6 +2499,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Name %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = ndps_string(tvb, hf_object_name, atree, foffset, NULL, 0);
@@ -2497,7 +2550,7 @@
                 proto_tree_add_item(ndps_tree, hf_ndps_ydimension_n64, tvb, foffset, 8, FALSE);
                 foffset += 8;
             }
-            proto_tree_add_item(ndps_tree, hf_ndps_dim_flag, tvb, foffset, 8, FALSE);
+            proto_tree_add_item(ndps_tree, hf_ndps_dim_flag, tvb, foffset, 4, FALSE);
             foffset += 4;
             proto_tree_add_item(ndps_tree, hf_ndps_n64, tvb, foffset, 8, FALSE);
             foffset += 8;
@@ -2512,6 +2565,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Location %u", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     proto_tree_add_item(atree, hf_ndps_n64, tvb, foffset, 8, FALSE);
@@ -2544,6 +2601,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Area %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 proto_tree_add_item(atree, hf_ndps_xmin_n64, tvb, foffset, 8, FALSE);
@@ -2613,7 +2674,7 @@
             foffset = qualifiedname(tvb, ndps_tree, foffset);
             length = tvb_get_ntohl(tvb, foffset);
             foffset += 4;
-            if (length!=0)
+            if (length==4)
             {
                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
             }
@@ -2627,6 +2688,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Address Item %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = address_item(tvb, atree, foffset);
@@ -2637,6 +2702,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Event %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 proto_tree_add_item(atree, hf_ndps_event_type, tvb, foffset, 4, FALSE);
@@ -2658,6 +2727,10 @@
                         foffset += 4;
                         for (j = 1 ; j <= number_of_items2; j++ )
                         {
+	                    if (j > NDPS_MAX_ITEMS) {
+	                        proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                        break;
+	                    }
                             foffset = objectidentifier(tvb, atree, foffset);
                         }
                         foffset += 4;
@@ -2673,6 +2746,10 @@
                         foffset += 4;
                         for (j = 1 ; j <= number_of_items2; j++ )
                         {
+	                    if (j > NDPS_MAX_ITEMS) {
+	                        proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                        break;
+	                    }
                             bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Object %u", i);
                             btree = proto_item_add_subtree(bitem, ett_ndps);
                             foffset = objectidentifier(tvb, btree, foffset);
@@ -2744,16 +2821,22 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Job %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
                 foffset += (length%2);
+                if ((int) foffset <= 0)
+                    THROW(ReportedBoundsError);
                 proto_item_set_end(aitem, tvb, foffset);
             }
             break;
@@ -2766,6 +2849,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Ignored Attribute %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 ignored_type = tvb_get_ntohl(tvb, foffset);
@@ -2809,6 +2896,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Resource %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 resource_type = tvb_get_ntohl(tvb, foffset);
@@ -2831,6 +2922,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Page Select %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 proto_tree_add_item(atree, hf_ndps_page_flag, tvb, foffset, 4, FALSE);
@@ -2888,6 +2983,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Item %u", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     proto_tree_add_item(atree, hf_ndps_page_flag, tvb, foffset, 4, FALSE);
@@ -2926,6 +3025,8 @@
                 }
                 foffset += length;
                 foffset += (length%2);
+                if ((int) foffset <= 0)
+                    THROW(ReportedBoundsError);
             }
             else
             {
@@ -3025,6 +3126,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Page Information %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 proto_tree_add_item(atree, hf_ndps_page_order, tvb, foffset, 4, FALSE);
@@ -3052,32 +3157,44 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Category %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
                 foffset += (length%2);
+                if ((int) foffset <= 0)
+                    THROW(ReportedBoundsError);
             }
             number_of_items = tvb_get_ntohl(tvb, foffset);
             proto_tree_add_uint(ndps_tree, hf_ndps_num_values, tvb, foffset, 4, number_of_items);
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Value %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
                 foffset += (length%2);
+                if ((int) foffset <= 0)
+                    THROW(ReportedBoundsError);
                 proto_item_set_end(aitem, tvb, foffset);
             }
             break;
@@ -3187,6 +3304,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Name %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = qualifiedname(tvb, atree, foffset);
@@ -3210,6 +3331,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Colorant %u", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     foffset = name_or_id(tvb, atree, foffset);
@@ -3223,6 +3348,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Printer %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = ndps_string(tvb, hf_ndps_printer_type, atree, foffset, NULL, 0);
@@ -3271,6 +3400,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Object %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = ndps_string(tvb, hf_ndps_pa_name, atree, foffset, NULL, 0);
@@ -3284,6 +3417,7 @@
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
             }
             foffset += length;
@@ -3292,16 +3426,20 @@
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
             }
             foffset += length;
             foffset += (length%2);
+            if ((int) foffset <= 0)
+                THROW(ReportedBoundsError);
             break;
         case 107:         /* Octet String Integer Pair */
             length = tvb_get_ntohl(tvb, foffset);
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
             }
             foffset += length;
@@ -3321,6 +3459,7 @@
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
             }
             foffset += length;
@@ -3343,10 +3482,13 @@
                     foffset += 4;
                     if (length!=0)
                     {
+                        tvb_ensure_bytes_exist(tvb, foffset, length);
                         proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
                     }
                     foffset += length;
                     foffset += (length%2);
+                    if ((int) foffset <= 0)
+                        THROW(ReportedBoundsError);
                     break;
                 case 4:     /*DIST_NAME_STRING*/
                     foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset, NULL, 0);
@@ -3365,6 +3507,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Event %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = ndps_string(tvb, hf_object_name, atree, foffset, NULL, 0);
@@ -3380,6 +3526,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Object %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = objectidentifier(tvb, atree, foffset);
@@ -3417,6 +3567,10 @@
     foffset += 4;
     for (i = 1 ; i <= number_of_items; i++ )
     {
+	if (i > NDPS_MAX_ITEMS) {
+	    proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	    break;
+	}
         bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Argument %u", i);
         btree = proto_item_add_subtree(bitem, ett_ndps);
         foffset = attribute_value(tvb, atree, foffset);
@@ -3844,6 +3998,12 @@
         /* Get request value data */
         request_value = p_get_proto_data(pinfo->fd, proto_ndps);
     }
+    if (!request_value)
+    {
+        /* Can't find the original request packet so this is not any fragment packet */
+        dissect_ndps(tvb, pinfo, tree);
+        return;
+    }
     /* Check to see of this is a fragment. If so then mark as a fragment. */
     if (!spx_info->eom) {
         request_value->ndps_frag = TRUE;
@@ -4047,10 +4207,14 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Security %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_uint(atree, hf_bind_security, tvb, foffset, 4, length);
                 }
@@ -4082,6 +4246,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Attribute %u", i);
                     btree = proto_item_add_subtree(bitem, ett_ndps);
                     foffset = objectidentifier(tvb, btree, foffset);
@@ -4090,6 +4258,10 @@
                     foffset += 4;
                     for (j = 1 ; j <= number_of_items2; j++ )
                     {
+	                if (j > NDPS_MAX_ITEMS) {
+	                    proto_tree_add_text(btree, tvb, foffset, -1, "[Truncated]");
+	                    break;
+	                }
                         citem = proto_tree_add_text(btree, tvb, foffset, -1, "Value %u", j);
                         ctree = proto_item_add_subtree(citem, ett_ndps);
                         foffset = attribute_value(tvb, ctree, foffset);
@@ -4107,6 +4279,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Type %u", i);
                     btree = proto_item_add_subtree(bitem, ett_ndps);
                     foffset = objectidentifier(tvb, btree, foffset);
@@ -4121,6 +4297,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Value %u", i);
                     btree = proto_item_add_subtree(bitem, ett_ndps);
                     if (doc_content==0)
@@ -4134,12 +4314,14 @@
                             proto_tree_add_item(btree, hf_ndps_data, tvb, foffset, -1, FALSE);
                             return;
                         }
-                        if (length!=0)
+                        if (length==4)
                         {
                             proto_tree_add_item(btree, hf_ndps_included_doc, tvb, foffset, length, FALSE);
                         }
                         foffset += length;
                         foffset += (length%2);
+                        if ((int) foffset <= 0)
+                            THROW(ReportedBoundsError);
                     }
                     else
                     {
@@ -4160,6 +4342,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Attribute %u", i);
                     btree = proto_item_add_subtree(bitem, ett_ndps);
                     foffset = objectidentifier(tvb, btree, foffset);
@@ -4168,6 +4354,10 @@
                     foffset += 4;
                     for (j = 1 ; j <= number_of_items2; j++ )
                     {
+	                if (j > NDPS_MAX_ITEMS) {
+	                    proto_tree_add_text(btree, tvb, foffset, -1, "[Truncated]");
+	                    break;
+	                }
                         citem = proto_tree_add_text(btree, tvb, foffset, -1, "Value %u", j);
                         ctree = proto_item_add_subtree(citem, ett_ndps);
                         foffset = attribute_value(tvb, ctree, foffset);
@@ -4185,6 +4375,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Attribute %u", i);
                     btree = proto_item_add_subtree(bitem, ett_ndps);
                     foffset = attribute_value(tvb, btree, foffset);  /* Document Attributes */
@@ -4204,6 +4398,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Method %u", i);
                     btree = proto_item_add_subtree(bitem, ett_ndps);
                     foffset = objectidentifier(tvb, btree, foffset); /* Transfer Method */
@@ -4219,6 +4417,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Type %u", i);
                     btree = proto_item_add_subtree(bitem, ett_ndps);
                     foffset = objectidentifier(tvb, btree, foffset); /* Document Type */
@@ -4233,6 +4435,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Attribute %u", i);
                     btree = proto_item_add_subtree(bitem, ett_ndps);
                     foffset = attribute_value(tvb, btree, foffset);  /* Document Attributes */
@@ -4264,6 +4470,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Modification %u", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = attribute_value(tvb, btree, foffset);  /* Job Modifications */
@@ -4277,6 +4487,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Modification %u", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = attribute_value(tvb, btree, foffset);  /* Document Modifications */
@@ -4323,6 +4537,7 @@
                 foffset += 4;
                 if (length!=0)
                 {
+                    tvb_ensure_bytes_exist(tvb, foffset, length);
                     proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
@@ -4334,6 +4549,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Attribute %u", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     foffset = attribute_value(tvb, atree, foffset);
@@ -4360,6 +4579,10 @@
                     foffset += 4;
                     for (i = 1 ; i <= number_of_items; i++ )
                     {
+	                if (i > NDPS_MAX_ITEMS) {
+	                    proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                    break;
+	                }
                         bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Option %u", i);
                         btree = proto_item_add_subtree(bitem, ett_ndps);
                         foffset = objectidentification(tvb, btree, foffset);
@@ -4383,6 +4606,10 @@
                         foffset += 4;
                         for (i = 1 ; i <= number_of_items; i++ )
                         {
+	                    if (i > NDPS_MAX_ITEMS) {
+	                        proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                        break;
+	                    }
                             foffset = filteritem(tvb, ndps_tree, foffset);
                         }
                         proto_item_set_end(aitem, tvb, foffset);
@@ -4400,6 +4627,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Attribute %u", i);
                     btree = proto_item_add_subtree(bitem, ett_ndps);
                     foffset = objectidentifier(tvb, btree, foffset);
@@ -4555,6 +4786,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Attribute %u", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = attribute_value(tvb, btree, foffset);  /* Object Attribute Set */
@@ -4613,6 +4848,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 /* Start of NWDPPrtContainedObjectId */
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Job ID");
                 btree = proto_item_add_subtree(bitem, ett_ndps);
@@ -4631,6 +4870,10 @@
                 foffset += 4;
                 for (j = 1 ; j <= number_of_items2; j++ )
                 {
+	            if (j > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(btree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     citem = proto_tree_add_text(btree, tvb, foffset, -1, "Attribute %u", j);
                     ctree = proto_item_add_subtree(citem, ett_ndps);
                     foffset = attribute_value(tvb, ctree, foffset);  /* Object Attribute Set */
@@ -4646,6 +4889,10 @@
                 foffset += 4;
                 for (j = 1 ; j <= number_of_items2; j++ )
                 {
+	            if (j > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(btree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     citem = proto_tree_add_text(btree, tvb, foffset, -1, "Attribute %u", j);
                     ctree = proto_item_add_subtree(citem, ett_ndps);
                     foffset = attribute_value(tvb, ctree, foffset);  /* Object Attribute Set */
@@ -4681,6 +4928,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Modification %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = attribute_value(tvb, btree, foffset);  /* Object Attribute Set */
@@ -4803,6 +5054,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Address %u", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = address_item(tvb, btree, foffset);
@@ -4832,7 +5087,7 @@
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
                 }
@@ -4922,6 +5177,7 @@
                 foffset += 4;
                 if (length!=0)
                 {
+                    tvb_ensure_bytes_exist(tvb, foffset, length);
                     proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
@@ -4968,6 +5224,7 @@
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_ndps_guid, tvb, foffset, length, FALSE);
             }
             foffset += length;
@@ -5001,6 +5258,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Address %u", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = address_item(tvb, btree, foffset);
@@ -5020,6 +5281,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Attribute %u", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = objectidentifier(tvb, btree, foffset);
@@ -5090,6 +5355,7 @@
                 foffset += 4;
                 if (length!=0)
                 {
+                    tvb_ensure_bytes_exist(tvb, foffset, length);
                     proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
@@ -5114,11 +5380,15 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Security %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(atree, hf_bind_security, tvb, foffset, length, FALSE);
                 }
@@ -5141,10 +5411,15 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
                 if (length!=0)
                 {
+                    tvb_ensure_bytes_exist(tvb, foffset, length);
                     proto_tree_add_item(atree, hf_ndps_item_bytes, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
@@ -5174,11 +5449,15 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Security %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(atree, hf_bind_security, tvb, foffset, length, FALSE);
                 }
@@ -5208,6 +5487,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Entry %u", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = server_entry(tvb, btree, foffset);
@@ -5221,6 +5504,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Entry %u", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = server_entry(tvb, btree, foffset);
@@ -5254,6 +5541,7 @@
                 foffset += 4;
                 if (length!=0)
                 {
+                    tvb_ensure_bytes_exist(tvb, foffset, length);
                     proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
@@ -5277,11 +5565,15 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Security %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(atree, hf_bind_security, tvb, foffset, length, FALSE);
                 }
@@ -5302,6 +5594,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Supplier Alias %u", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = qualifiedname(tvb, atree, foffset);
@@ -5331,7 +5627,7 @@
             proto_item_set_end(aitem, tvb, foffset);
             length = tvb_get_ntohl(tvb, foffset);
             foffset += 4;
-            if (length!=0)
+            if (length==4)
             {
                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
             }
@@ -5351,6 +5647,10 @@
             atree = proto_item_add_subtree(aitem, ett_ndps);
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Address %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = address_item(tvb, btree, foffset);
@@ -5380,7 +5680,7 @@
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
                 }
@@ -5470,6 +5770,7 @@
                 foffset += 4;
                 if (length!=0)
                 {
+                    tvb_ensure_bytes_exist(tvb, foffset, length);
                     proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
@@ -5489,6 +5790,10 @@
             atree = proto_item_add_subtree(aitem, ett_ndps);
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Item %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 /* Start of ReportEventItem */
@@ -5525,6 +5830,10 @@
                 ctree = proto_item_add_subtree(citem, ett_ndps);
                 for (j = 1 ; j <= number_of_items; j++ )
                 {
+	            if (j > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ctree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     ditem = proto_tree_add_text(ctree, tvb, foffset, -1, "Modification %d", j);
                     dtree = proto_item_add_subtree(ditem, ett_ndps);
                     foffset = attribute_value(tvb, dtree, foffset);  /* Object Attribute Set */
@@ -5548,6 +5857,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Destination %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 /* Start of Destination */
@@ -5601,6 +5914,10 @@
             atree = proto_item_add_subtree(aitem, ett_ndps);
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Attribute %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = attribute_value(tvb, btree, foffset);  
@@ -5653,6 +5970,7 @@
                 foffset += 4;
                 if (length!=0)
                 {
+                    tvb_ensure_bytes_exist(tvb, foffset, length);
                     proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
@@ -5690,11 +6008,15 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Security %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(atree, hf_bind_security, tvb, foffset, length, FALSE);
                 }
@@ -5719,6 +6041,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Item %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length=tvb_get_ntohl(tvb, foffset);
@@ -5874,6 +6200,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Item %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 proto_tree_add_item(atree, hf_ndps_session, tvb, foffset, 4, FALSE);
@@ -5882,7 +6212,7 @@
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(btree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
                 }
@@ -5931,6 +6261,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Object %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 proto_tree_add_item(atree, hf_ndps_session, tvb, foffset, 4, FALSE);
@@ -5939,7 +6273,7 @@
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
-                if (length!=0)
+                if (length==4)
                 {
                     proto_tree_add_item(btree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
                 }
@@ -5979,6 +6313,10 @@
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(btree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     foffset = attribute_value(tvb, btree, foffset);  
                 }
                 proto_item_set_end(bitem, tvb, foffset);
@@ -6156,6 +6494,10 @@
         foffset += 4;
         for (i = 1 ; i <= number_of_items; i++ )
         {
+	    if (i > NDPS_MAX_ITEMS) {
+	        proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	        break;
+	    }
             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Item %d", i);
             atree = proto_item_add_subtree(aitem, ett_ndps);
             proto_tree_add_item(atree, hf_problem_type, tvb, foffset, 4, FALSE);
@@ -6368,6 +6710,10 @@
             atree = proto_item_add_subtree(aitem, ett_ndps);
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Attribute %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = attribute_value(tvb, btree, foffset);  /* Object Attribute Set */
@@ -6391,6 +6737,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+		    proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+		    break;
+		}
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Option %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 length=tvb_get_ntohl(tvb, foffset);
@@ -6420,6 +6770,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Result %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = objectidentification(tvb, btree, foffset);
@@ -6428,6 +6782,10 @@
                 foffset += 4;
                 for (j = 1 ; j <= number_of_items2; j++ )
                 {
+	            if (j > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(btree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     citem = proto_tree_add_text(btree, tvb, foffset, -1, "Attribute %d", j);
                     ctree = proto_item_add_subtree(citem, ett_ndps);
                     foffset = objectidentifier(tvb, ctree, foffset);
@@ -6437,6 +6795,10 @@
                     foffset += 4;
                     for (k = 1 ; k <= number_of_items3; k++ )
                     {
+	                if (k > NDPS_MAX_ITEMS) {
+	                    proto_tree_add_text(ctree, tvb, foffset, -1, "[Truncated]");
+	                    break;
+	                }
                         ditem = proto_tree_add_text(ctree, tvb, foffset, -1, "Value %d", k);
                         dtree = proto_item_add_subtree(ditem, ett_ndps);
                         foffset = attribute_value(tvb, dtree, foffset);
@@ -6475,6 +6837,10 @@
             atree = proto_item_add_subtree(aitem, ett_ndps);
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Attribute %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = attribute_value(tvb, btree, foffset);  /* Object Attribute Set */
@@ -6515,6 +6881,10 @@
             atree = proto_item_add_subtree(aitem, ett_ndps);
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Job %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 /* Start of NWDPPrtContainedObjectId */
@@ -6541,6 +6911,10 @@
                 ctree = proto_item_add_subtree(citem, ett_ndps);
                 for (j = 1 ; j <= number_of_items2; j++ )
                 {
+	            if (j > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ctree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     ditem = proto_tree_add_text(ctree, tvb, foffset, -1, "Object %d", j);
                     dtree = proto_item_add_subtree(ditem, ett_ndps);
                     foffset = attribute_value(tvb, dtree, foffset);  /* Object Attribute Set */
@@ -6566,6 +6940,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Object %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = attribute_value(tvb, btree, foffset);  /* Object Attribute Set */
@@ -6588,6 +6966,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Object %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = attribute_value(tvb, atree, foffset);  /* Object Attribute Set */
@@ -6611,7 +6993,7 @@
         case 0x0000001d:    /* List Event Profiles */
             length = tvb_get_ntohl(tvb, foffset);
             foffset += 4;
-            if (length!=0)
+            if (length==4)
             {
                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
             }
@@ -6626,7 +7008,7 @@
             foffset = qualifiedname(tvb, atree, foffset);
             length = tvb_get_ntohl(tvb, foffset);
             foffset += 4;
-            if (length!=0)
+            if (length==4)
             {
                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
             }
@@ -6647,6 +7029,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Address %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = address_item(tvb, btree, foffset);
@@ -6659,6 +7045,7 @@
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_ndps_continuation_option, tvb, foffset, length, FALSE);
             }
             foffset += length;
@@ -6693,6 +7080,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Event %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 /* Start of Eventhandling2 */
@@ -6721,6 +7112,10 @@
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(btree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     citem = proto_tree_add_text(btree, tvb, foffset, -1, "Address %d", i);
                     ctree = proto_item_add_subtree(citem, ett_ndps);
                     foffset = address_item(tvb, ctree, foffset);
@@ -6740,6 +7135,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(btree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     citem = proto_tree_add_text(btree, tvb, foffset, -1, "Attribute %d", i);
                     ctree = proto_item_add_subtree(citem, ett_ndps);
                     foffset = objectidentifier(tvb, ctree, foffset);
@@ -6760,6 +7159,7 @@
                 foffset += 4;
                 if (length!=0)
                 {
+                    tvb_ensure_bytes_exist(tvb, foffset, length);
                     proto_tree_add_item(ndps_tree, hf_ndps_continuation_option, tvb, foffset, length, FALSE);
                 }
                 foffset += length;
@@ -6789,6 +7189,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Service %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 proto_tree_add_item(atree, hf_ndps_service_type, tvb, foffset, 4, FALSE);
@@ -6821,12 +7225,17 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Attribute %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
                 if (length!=0)
                 {
+                    tvb_ensure_bytes_exist(tvb, foffset, length);
                     proto_tree_add_item(atree, hf_ndps_attribute_set, tvb, foffset, length, FALSE);
                 }
                 proto_item_set_end(aitem, tvb, foffset);
@@ -6849,6 +7258,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Item %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset = server_entry(tvb, atree, foffset);
@@ -6858,6 +7271,7 @@
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_ndps_continuation_option, tvb, foffset, length, FALSE);
             }
             foffset += length;
@@ -6869,6 +7283,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_item(ndps_tree, hf_ndps_client_server_type, tvb, foffset, 4, FALSE);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 foffset += 4;
@@ -6879,6 +7297,7 @@
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_ndps_continuation_option, tvb, foffset, length, FALSE);
             }
             foffset += length;
@@ -6911,12 +7330,17 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Attribute %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
                 length = tvb_get_ntohl(tvb, foffset);
                 foffset += 4;
                 if (length!=0)
                 {
+                    tvb_ensure_bytes_exist(tvb, foffset, length);
                     proto_tree_add_item(atree, hf_ndps_attribute_set, tvb, foffset, length, FALSE);
                 }
                 proto_item_set_end(aitem, tvb, foffset);
@@ -6963,7 +7387,7 @@
             proto_item_set_end(aitem, tvb, foffset);
             length = tvb_get_ntohl(tvb, foffset);
             foffset += 4;
-            if (length!=0)
+            if (length==4)
             {
                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
             }
@@ -6983,6 +7407,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Address %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = address_item(tvb, btree, foffset);
@@ -6996,6 +7424,7 @@
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_ndps_continuation_option, tvb, foffset, length, FALSE);
             }
             foffset += length;
@@ -7005,7 +7434,7 @@
             /* Start of IntegerSeq */
             length = tvb_get_ntohl(tvb, foffset);
             foffset += 4;
-            if (length!=0)
+            if (length==4)
             {
                 proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, length, FALSE);
             }
@@ -7029,6 +7458,10 @@
             foffset += 4;
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 /* Start of DeliveryMethod */
                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Method %d", i);
                 atree = proto_item_add_subtree(aitem, ett_ndps);
@@ -7071,6 +7504,10 @@
             atree = proto_item_add_subtree(aitem, ett_ndps);
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Address %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 foffset = address_item(tvb, btree, foffset);
@@ -7106,6 +7543,7 @@
             foffset += 4;
             if (length!=0)
             {
+                tvb_ensure_bytes_exist(tvb, foffset, length);
                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_set, tvb, foffset, length, FALSE);
             }
             break;
@@ -7140,6 +7578,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Definition %d", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     if (tvb_get_ntohl(tvb, foffset)==0) {  /* Offset for old type support */
@@ -7166,6 +7608,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Banner %d", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     foffset = ndps_string(tvb, hf_ndps_banner_name, atree, foffset, NULL, 0);
@@ -7178,6 +7624,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Font %d", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     foffset = ndps_string(tvb, hf_font_type_name, atree, foffset, NULL, 0);
@@ -7190,6 +7640,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Font File %d", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     foffset = ndps_string(tvb, hf_font_file_name, atree, foffset, NULL, 0);
@@ -7204,6 +7658,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "File %d", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     foffset = ndps_string(tvb, hf_ndps_prn_file_name, atree, foffset, NULL, 0);
@@ -7218,6 +7676,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Definition %d", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     foffset = ndps_string(tvb, hf_ndps_prn_file_name, atree, foffset, NULL, 0);
@@ -7230,6 +7692,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Item %d", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     foffset = ndps_string(tvb, hf_ndps_def_file_name, atree, foffset, NULL, 0);
@@ -7240,6 +7706,10 @@
                     foffset += 4;
                     for (i = 1 ; i <= number_of_items2; i++ )
                     {
+	                if (i > NDPS_MAX_ITEMS) {
+	                    proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                    break;
+	                }
                         foffset = ndps_string(tvb, hf_ndps_windows_key, btree, foffset, NULL, 0);
                     }
                     proto_item_set_end(bitem, tvb, foffset);
@@ -7250,6 +7720,10 @@
                     foffset += 4;
                     for (i = 1 ; i <= number_of_items2; i++ )
                     {
+	                if (i > NDPS_MAX_ITEMS) {
+	                    proto_tree_add_text(btree, tvb, foffset, -1, "[Truncated]");
+	                    break;
+	                }
                         foffset = ndps_string(tvb, hf_ndps_windows_key, btree, foffset, NULL, 0);
                     }
                     proto_item_set_end(bitem, tvb, foffset);
@@ -7263,6 +7737,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "OS %d", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     proto_tree_add_item(atree, hf_os_type, tvb, foffset, 4, FALSE);
@@ -7272,6 +7750,10 @@
                     foffset += 4;
                     for (i = 1 ; i <= number_of_items2; i++ )
                     {
+	                if (i > NDPS_MAX_ITEMS) {
+	                    proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	                    break;
+	                }
                         bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Key %d", i);
                         btree = proto_item_add_subtree(bitem, ett_ndps);
                         foffset = ndps_string(tvb, hf_ndps_windows_key, btree, foffset, NULL, 0);
@@ -7288,6 +7770,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Type %d", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     foffset = ndps_string(tvb, hf_ndps_printer_manuf, atree, foffset, NULL, 0);
@@ -7307,6 +7793,10 @@
                 foffset += 4;
                 for (i = 1 ; i <= number_of_items; i++ )
                 {
+	            if (i > NDPS_MAX_ITEMS) {
+	                proto_tree_add_text(ndps_tree, tvb, foffset, -1, "[Truncated]");
+	                break;
+	            }
                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Language %d", i);
                     atree = proto_item_add_subtree(aitem, ett_ndps);
                     proto_tree_add_item(atree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
@@ -7402,6 +7892,10 @@
             atree = proto_item_add_subtree(aitem, ett_ndps);
             for (i = 1 ; i <= number_of_items; i++ )
             {
+	        if (i > NDPS_MAX_ITEMS) {
+	            proto_tree_add_text(atree, tvb, foffset, -1, "[Truncated]");
+	            break;
+	        }
                 bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Item %d", i);
                 btree = proto_item_add_subtree(bitem, ett_ndps);
                 length=tvb_get_ntohl(tvb, foffset);
@@ -7679,6 +8173,11 @@
           FT_UINT32,    BASE_HEX,   NULL,   0x0,
           "Document Number", HFILL }},
 
+        { &hf_ndps_doc_content,
+        { "Document Content",    "ndps.ndps_doc_content",
+          FT_UINT32,    BASE_HEX,   NULL,   0x0,
+          "Document Content", HFILL }},
+
         { &hf_ndps_nameorid,
         { "Name or ID Type",    "ndps.ndps_nameorid",
           FT_UINT32,    BASE_HEX,   VALS(nameorid_enum),   0x0,
--- ethereal-0.10.10.orig/epan/dissectors/packet-nfs.c
+++ ethereal-0.10.10/epan/dissectors/packet-nfs.c
@@ -6004,6 +6004,9 @@
 
 #define FATTR4_BITMAP_ONLY 0
 #define FATTR4_FULL_DISSECT 1
+/* XXX - What's a good maximum?  Linux appears to use 10.
+ * FreeBSD appears to use 2.  OpenSolaris appears to use 2.  */
+#define MAX_BITMAP_LEN 10
 
 static int
 dissect_nfs_attributes(tvbuff_t *tvb, int offset, packet_info *pinfo,
@@ -6022,6 +6025,11 @@
 	int attr_vals_offset;
 
 	bitmap_len = tvb_get_ntohl(tvb, offset);
+	if (bitmap_len > MAX_BITMAP_LEN) {
+		proto_tree_add_text(tree, tvb, offset, 4,
+			"Huge bitmap length: %u", bitmap_len);
+		THROW(ReportedBoundsError);
+	}
         tvb_ensure_bytes_exist(tvb, offset, 4 + bitmap_len * 4);
 	fitem = proto_tree_add_text(tree, tvb, offset, 4 + bitmap_len * 4,
 		"%s", "attrmask");
--- ethereal-0.10.10.orig/epan/dissectors/packet-ocsp.c
+++ ethereal-0.10.10/epan/dissectors/packet-ocsp.c
@@ -139,7 +139,7 @@
 /*--- End of included file: packet-ocsp-ett.c ---*/
 
 
-static char responseType_id[64]; /*64 chars should be long enough? */
+static char responseType_id[BER_MAX_OID_STR_LEN];
 
 
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-ospf.c
+++ ethereal-0.10.10/epan/dissectors/packet-ospf.c
@@ -46,6 +46,7 @@
 #include <epan/packet.h>
 #include <epan/ipproto.h>
 #include <epan/in_cksum.h>
+#include <epan/ipv6-utils.h>
 #include "packet-rsvp.h"
 
 #define OSPF_VERSION_2 2
@@ -2320,37 +2321,28 @@
 static void dissect_ospf_v3_address_prefix(tvbuff_t *tvb, int offset, int prefix_length, proto_tree *tree)
 {
 
-    guint8 value;
-    guint8 position;
-    guint8 bufpos;
-    gchar  buffer[32+7];
-    gchar  bytebuf[3];
-    guint8 bytes_to_process;
-    int start_offset;
+    int bytes_to_process;
+    struct e_in6_addr prefix;
 
-    start_offset=offset;
-    position=0;
-    bufpos=0;
     bytes_to_process=((prefix_length+31)/32)*4;
 
-    while (bytes_to_process > 0 ) {
-
-        value=tvb_get_guint8(tvb, offset);
-
-        if ( (position > 0) && ( (position%2) == 0 ) )
-	    buffer[bufpos++]=':';
-
-        sprintf(bytebuf,"%02x",value);
-        buffer[bufpos++]=bytebuf[0];
-        buffer[bufpos++]=bytebuf[1];
-
-	position++;
-	offset++;
-        bytes_to_process--;
+    if (prefix_length > 128) {
+        proto_tree_add_text(tree, tvb, offset, bytes_to_process,
+            "Address Prefix: length is invalid (%d, should be <= 128)",
+            prefix_length);
+        return;
     }
 
-    buffer[bufpos]=0;
-    proto_tree_add_text(tree, tvb, start_offset, ((prefix_length+31)/32)*4, "Address Prefix: %s",buffer);
+    memset(prefix.u6_addr.u6_addr8, 0, sizeof prefix.u6_addr.u6_addr8);
+    if (bytes_to_process != 0) {
+        tvb_memcpy(tvb, prefix.u6_addr.u6_addr8, offset, bytes_to_process);
+        if (prefix_length % 8) {
+            prefix.u6_addr.u6_addr8[bytes_to_process - 1] &=
+                ((0xff00 >> (prefix_length % 8)) & 0xff);
+        }
+    }
+    proto_tree_add_text(tree, tvb, offset, bytes_to_process,
+        "Address Prefix: %s", ip6_to_str(&prefix));
 
 }
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-per.c
+++ ethereal-0.10.10/epan/dissectors/packet-per.c
@@ -7,7 +7,7 @@
  * Routines for dissection of ASN.1 Aligned PER
  * 2003  Ronnie Sahlberg
  *
- * $Id: packet-per.c 13337 2005-02-07 08:57:47Z etxrab $
+ * $Id: packet-per.c 14217 2005-04-28 09:54:03Z kukosa $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -38,6 +38,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <epan/to_str.h>
 #include <epan/prefs.h>
 #include "packet-per.h"
 #include "packet-ber.h"
@@ -205,6 +206,17 @@
 	return offset;
 }
 
+/* 17 Encoding the null type */
+guint32
+dissect_per_null(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index) {
+  proto_item *ti_tmp;
+
+  ti_tmp = proto_tree_add_item(tree, hf_index, tvb, offset>>8, 0, FALSE);
+  proto_item_append_text(ti_tmp, ": NULL");
+
+  return offset;
+}
+
 /* 19 this function dissects a sequence of */
 static guint32
 dissect_per_sequence_of_helper(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int (*func)(tvbuff_t *, int , packet_info *, proto_tree *), guint32 length)
@@ -400,7 +412,7 @@
 	}
 	str[char_pos]=0;
 	proto_tree_add_string(tree, hf_index, tvb, (old_offset>>3), (offset>>3)-(old_offset>>3), str);
-	if (info_str != NULL) {
+	if (info_str != NULL && info_str_len > 0) {
 		if (info_str_len<length) str[info_str_len-1] = '\0';	
 		strcpy(info_str, str);
 	}
@@ -409,21 +421,21 @@
 guint32
 dissect_per_NumericString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len)
 {
-	offset=dissect_per_restricted_character_string(tvb, offset, pinfo, tree, hf_index, min_len, max_len, " 0123456789", 11, NULL, NULL);
+	offset=dissect_per_restricted_character_string(tvb, offset, pinfo, tree, hf_index, min_len, max_len, " 0123456789", 11, NULL, 0);
 
 	return offset;
 }
 guint32
 dissect_per_PrintableString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len)
 {
-	offset=dissect_per_restricted_character_string(tvb, offset, pinfo, tree, hf_index, min_len, max_len, " '()+,-.*0123456789:=?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 74, NULL, NULL);
+	offset=dissect_per_restricted_character_string(tvb, offset, pinfo, tree, hf_index, min_len, max_len, " '()+,-.*0123456789:=?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 74, NULL, 0);
 	return offset;
 }
 guint32
 dissect_per_VisibleString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len)
 {
 	offset=dissect_per_restricted_character_string(tvb, offset, pinfo, tree, hf_index, min_len, max_len,
-		" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", 95, NULL, NULL);
+		" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", 95, NULL, 0);
 	return offset;
 }
 guint32
@@ -550,14 +562,12 @@
 
 
 
-/* this function reads a OBJECT IDENTIFIER */
+/* 23 Encoding the object identifier type */
 guint32
 dissect_per_object_identifier(tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index, char *value_string)
 {
-	int i,count;
-	char str[256],*strp,*name;
-	guint8 byte;
-	guint32 value;
+	gint length;
+	char str[MAX_OID_STR_LEN], *name;
 	proto_tree *etr=NULL;
 	proto_item *item;
 
@@ -567,48 +577,12 @@
 		etr=tree;
 	}
 
-	/* first byte is the count and it is byte aligned */
-	BYTE_ALIGN_OFFSET(offset);
-	count=tvb_get_guint8(tvb, offset>>3);
-
-
-	proto_tree_add_uint(etr, hf_per_object_identifier_length, tvb, offset>>3, 1, count);
-	offset+=8;
-
-	value=0;
-	for(i=0,strp=str;i<count;i++){
-		byte=tvb_get_guint8(tvb,offset>>3);
-		offset+=8;
-
-		if((strp-str)>200){
-PER_NOT_DECODED_YET("too long octet_string");
-			/*XXX assert here */
-			return offset;
-		}
-
-		if(i==0){
-			/* the first byte contains the first two object identifier components */
-			if(byte<40){
-				strp+=sprintf(strp,"0.%d",byte);
-			} else if (byte<80){
-				strp+=sprintf(strp,"1.%d",byte-40);
-			} else {
-				strp+=sprintf(strp,"2.%d",byte-80);
-			}
-			continue;
-		}
-
-		value=(value<<7)|(byte&0x7f);
-		if(byte&0x80){
-			continue;
-		}
+	offset = dissect_per_length_determinant(tvb, offset, pinfo, etr, hf_per_object_identifier_length, &length);
 
-		strp+=sprintf(strp,".%d",value);
-		value=0;
-	}
-	*strp=0;
+	oid_to_str_buf(tvb_get_ptr(tvb, offset>>3, length), length, str, MAX_OID_STR_LEN);
+	item = proto_tree_add_string(tree, hf_index, tvb, offset>>3, length, str);
+	offset += 8 * length;
 
-	item=proto_tree_add_string(tree, hf_index, tvb, (offset>>3)-count, count, str);
 	/* see if we know the name of this oid */
 	if(item){
 		name = get_ber_oid_name(str);
@@ -899,7 +873,7 @@
 	} else if (IS_FT_TIME(hfi->type)) {
 		it = proto_tree_add_time(tree, hf_index, tvb, val_start, val_length, &timeval);
 	} else {
-		g_assert_not_reached();
+		THROW(ReportedBoundsError);
 	}
 	if (item) *item = it;
 	if (value) *value = val;
@@ -1049,12 +1023,12 @@
 		} else {
 			guint32 new_offset;
 
-			proto_item_set_text(choiceitem, choice[index].name);
+			proto_item_set_text(choiceitem, "%s", choice[index].name);
 			new_offset=choice[index].func(tvb, offset, pinfo, choicetree);
 
 			if((new_offset>(offset+(length*8)))||((new_offset+8)<(offset+length*8))){
 printf("new_offset:%d  offset:%d  length*8:%d\n",new_offset,offset,length*8);
-/*				g_assert_not_reached();*/
+/*				THROW(ReportedBoundsError)*/
 			}
 
 			offset+=length*8;
@@ -1483,7 +1457,7 @@
 				} else if (hfi->type==FT_BYTES) {
 					proto_tree_add_bytes(tree, hf_index, tvb, val_start, val_length, pbytes);
 				} else {
-					g_assert_not_reached();
+					THROW(ReportedBoundsError);
 				}
 			} else {
 				proto_tree_add_item(tree, hf_index, tvb, val_start, val_length, FALSE);
--- ethereal-0.10.10.orig/epan/dissectors/packet-pkix1explicit.c
+++ ethereal-0.10.10/epan/dissectors/packet-pkix1explicit.c
@@ -98,7 +98,7 @@
 
 
 
-static char object_identifier_id[64]; /*64 chars should be long enough? */
+static char object_identifier_id[BER_MAX_OID_STR_LEN];
 
 int
 dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
--- ethereal-0.10.10.orig/epan/dissectors/packet-pkixqualified.c
+++ ethereal-0.10.10/epan/dissectors/packet-pkixqualified.c
@@ -94,7 +94,7 @@
 /*--- End of included file: packet-pkixqualified-ett.c ---*/
 
 
-static char object_identifier_id[64]; /*64 chars should be long enough? */
+static char object_identifier_id[BER_MAX_OID_STR_LEN];
 
 
 /*--- Included file: packet-pkixqualified-fn.c ---*/
--- ethereal-0.10.10.orig/epan/dissectors/packet-pres.c
+++ ethereal-0.10.10/epan/dissectors/packet-pres.c
@@ -2,7 +2,7 @@
 *
 * Routine to dissect ISO 8823 OSI Presentation Protocol packets
 *
-* $Id: packet-pres.c 13452 2005-02-20 22:36:34Z ulfl $
+* $Id: packet-pres.c 14307 2005-05-04 19:55:17Z gerald $
 *
 * Yuriy Sidelnikov <YSidelnikov@hotmail.com>
 *
@@ -247,33 +247,6 @@
 		ENDTRY;
 	}
 }
-static char*
-string_to_hex(const unsigned char * in,char * out,int len)
-{
-	char ascii[MAXSTRING];
-	int  i;
-	memset(&ascii,0x00,sizeof(ascii));
-for(i=0;i<len;i++)
-			{
-	unsigned char o_out = *(in+i);
-    sprintf(out+(i<<1),"%.2x",*  (in+i));
-	if(  ( (o_out) >= 'a') & ( (o_out) <='z')  ||
-		 ( (o_out) >= 'A') & ( (o_out) <='Z')  ||
-		 ( (o_out) >= '0') & ( (o_out) <='9')
-	   )
-					{
-					ascii[i] = o_out;
-					}
-				else
-					{
-					ascii[i] = '.';
-					}
-
-			}
-		strcat(out," ");
-		strcat(out,ascii);
-    return out;
-}
 
 static int read_length(ASN1_SCK *a, proto_tree *tree, int hf_id, guint *len)
 {
@@ -498,17 +471,18 @@
 }
 
 static void
-print_value(ASN1_SCK *asn,proto_tree *pres_tree,tvbuff_t *tvb,int 
-*offset,int item_len)
+print_value(ASN1_SCK *asn,proto_tree *pres_tree, tvbuff_t *tvb, int *offset, int item_len)
 {
-	  gint    start = *offset;
-	  char    tmp[MAXSTRING];
-		*offset = asn->offset;  /* align to data*/
-		string_to_hex(tvb_get_ptr(tvb,*offset,item_len),tmp,item_len);
-		proto_tree_add_text(pres_tree, tvb, *offset, item_len, tmp);
-		(*offset)=start+item_len;
-		asn->offset = (*offset);
+    gint    start = *offset;
+    gchar  *tmp;
+
+    *offset = asn->offset;  /* align to data*/
+    tmp = tvb_bytes_to_str(tvb, *offset, item_len);
+    proto_tree_add_text(pres_tree, tvb, *offset, item_len, tmp);
+    (*offset) = start+item_len;
+    asn->offset = (*offset);
 }
+
 static int
 get_integer_value(ASN1_SCK *asn,int length,int *offset)
 {
@@ -1577,10 +1551,12 @@
 						}
 					}
 				}
+                if( ((gint)rest_len) > 0) {
 				ms = proto_tree_add_text(pres_tree, tvb, offset, rest_len,
 										val_to_str(session->spdu_type, ses_vals, "Unknown Ppdu type (0x%02x)"));
 				pres_tree_ms = proto_item_add_subtree(ms, ett_pres_ms);
 				show_user_data(&asn,pres_tree_ms,tvb,&offset,rest_len,s_type);
+                }
 			}
 	}
 /*    close asn.1 stream    */
--- ethereal-0.10.10.orig/epan/dissectors/packet-q931.c
+++ ethereal-0.10.10/epan/dissectors/packet-q931.c
@@ -2,7 +2,7 @@
  * Routines for Q.931 frame disassembly
  * Guy Harris <guy@alum.mit.edu>
  *
- * $Id: packet-q931.c 13366 2005-02-09 23:38:00Z lroland $
+ * $Id: packet-q931.c 14173 2005-04-23 21:31:25Z gerald $
  *
  * Modified by Andreas Sikkema for possible use with H.323
  *
@@ -173,6 +173,11 @@
 #define	Q931_SEGMENT		0x60
 #define	Q931_STATUS		0x7D
 #define	Q931_STATUS_ENQUIRY	0x75
+#define	Q931_VERSION		0x0a
+#define	Q931_GROUIP_SERVICE	0x06
+#define	Q931_GROUIP_SERVICE_ACK	0x0b
+#define	Q931_RESYNC_REQ		0x08
+#define	Q931_RESYNC_RESP	0x09
 
 static const value_string q931_message_type_vals[] = {
 	{ Q931_ESCAPE,			"ESCAPE" },
@@ -209,6 +214,11 @@
 	{ Q931_SEGMENT,			"SEGMENT" },
 	{ Q931_STATUS,			"STATUS" },
 	{ Q931_STATUS_ENQUIRY,		"STATUS ENQUIRY" },
+	{ Q931_VERSION,			"VERSION" },
+	{ Q931_GROUIP_SERVICE,		"GROUP SERVICE" },
+	{ Q931_GROUIP_SERVICE_ACK,	"GROUP SERVICE ACK" },
+	{ Q931_RESYNC_REQ,		"RESYNC REQ" },
+	{ Q931_RESYNC_RESP,		"RESYNC RESP" },
 	{ 0,				NULL }
 };
 
@@ -296,6 +306,9 @@
 #define	Q931_IE_CUG			0x47	/* Closed user group */
 #define	Q931_IE_REVERSE_CHARGE_IND	0x4A	/* Reverse charging indication */
 #define	Q931_IE_CONNECTED_NUMBER_DEFAULT        0x4C	/* Connected Number */
+#define	Q931_IE_INTERFACE_SERVICE	0x66	/* q931+ Interface Service */
+#define	Q931_IE_CHANNEL_STATUS		0x67	/* q931+ Channel Status */
+#define	Q931_IE_VERSION_INFO		0x68	/* q931+ Version Info */
 #define	Q931_IE_CALLING_PARTY_NUMBER	0x6C	/* Calling Party Number */
 #define	Q931_IE_CALLING_PARTY_SUBADDR	0x6D	/* Calling Party Subaddress */
 #define	Q931_IE_CALLED_PARTY_NUMBER	0x70	/* Called Party Number */
@@ -374,6 +387,9 @@
 	{ Q931_IE_CUG,				"Closed user group" },
 	{ Q931_IE_REVERSE_CHARGE_IND,		"Reverse charging indication" },
 	{ Q931_IE_CONNECTED_NUMBER_DEFAULT,     "Connected number" },
+	{ Q931_IE_INTERFACE_SERVICE,		"Interface Service" },
+	{ Q931_IE_CHANNEL_STATUS,		"Channel Status" },
+	{ Q931_IE_VERSION_INFO,			"Version Info" },
 	{ Q931_IE_CALLING_PARTY_NUMBER,		"Calling party number" },
 	{ Q931_IE_CALLING_PARTY_SUBADDR,	"Calling party subaddress" },
 	{ Q931_IE_CALLED_PARTY_NUMBER,		"Called party number" },
@@ -1448,7 +1464,7 @@
 		proto_tree_add_text(tree, tvb, offset, 1,
 		    "Channel selection: %s",
 		    val_to_str(octet & 0x03, q931_basic_channel_selection_vals,
-		      NULL));
+		      "Unknown (0x%02X)"));
 	}
 	offset += 1;
 	len -= 1;
@@ -1915,7 +1931,7 @@
 	octet = tvb_get_guint8(tvb, offset);
 	proto_tree_add_text(tree, tvb, offset, 1,
 	    "Fast select: %s",
-	    val_to_str(octet & 0x18, q931_fast_selected_vals, NULL));
+	    val_to_str(octet & 0x18, q931_fast_selected_vals, "Unknown (0x%02X)"));
 	proto_tree_add_text(tree, tvb, offset, 1,
 	    "%s",
 	    (octet & 0x04) ? "No request/request denied" :
@@ -2162,7 +2178,7 @@
 	proto_tree_add_text(tree, tvb, offset, 1,
 	    "Odd/even indicator: %s",
 	    val_to_str(octet & 0x10, q931_odd_even_indicator_vals,
-	      NULL));
+	      "Unknown (0x%02X)"));
 	offset += 1;
 	len -= 1;
 
@@ -2412,7 +2428,8 @@
 		{       /* info for the tap */
 			call_ref[0] &= 0x7F;
 		}
-		g_memmove(&(q931_pi->crv), call_ref, call_ref_len);
+		/* XXX - Should crv be something besides a guint32? */
+		g_memmove(&(q931_pi->crv), call_ref, call_ref_len > sizeof(q931_pi->crv) ? sizeof(q931_pi->crv) : call_ref_len );
 		offset += call_ref_len;
 	}
 	message_type = tvb_get_guint8(tvb, offset);
@@ -2721,182 +2738,239 @@
 					info_element_len += tvb_reported_length_remaining(tvb, offset + 4);
 				}
 			} else {
-				/* we move calling, called number and release cause to not check tree=NULL for the tap used in Voip Calls... */
-			    	switch ((codeset << 8) | info_element){
-					case CS0 | Q931_IE_CALLING_PARTY_NUMBER:
-						e164_info.e164_number_type = CALLING_PARTY_NUMBER;
-						dissect_q931_number_ie(tvb,
-							offset + 2, info_element_len,
-							ie_tree,
-							hf_q931_calling_party_number, e164_info);
-						break;
-					case CS0 | Q931_IE_CALLED_PARTY_NUMBER:
-						e164_info.e164_number_type = CALLED_PARTY_NUMBER;
-						dissect_q931_number_ie(tvb,
-							offset + 2, info_element_len,
-							ie_tree,
-							hf_q931_called_party_number, e164_info);
-						break;
-					case CS0 | Q931_IE_CAUSE:
-						dissect_q931_cause_ie(tvb,
-							offset + 2, info_element_len,
-							ie_tree,
-							hf_q931_cause_value, &dummy);
-						break;
-				}
-				if (q931_tree != NULL) {
-					switch ((codeset << 8) | info_element) {
+				/*
+				 * For the calling number, called number,
+				 * and release cause IEs, don't check
+				 * for the tree being null, as
+				 * the dissectors for those IEs also
+				 * supply information for the tap used
+				 * in VoIP calls.
+				 */
+				switch ((codeset << 8) | info_element) {
 
-					case CS0 | Q931_IE_BEARER_CAPABILITY:
-					case CS0 | Q931_IE_LOW_LAYER_COMPAT:
+				case CS0 | Q931_IE_BEARER_CAPABILITY:
+				case CS0 | Q931_IE_LOW_LAYER_COMPAT:
+					if (q931_tree != NULL) {
 						dissect_q931_bearer_capability_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_CALL_STATE:
+				case CS0 | Q931_IE_CAUSE:
+					dissect_q931_cause_ie(tvb,
+						offset + 2, info_element_len,
+						ie_tree,
+						hf_q931_cause_value, &dummy);
+					break;
+
+				case CS0 | Q931_IE_CALL_STATE:
+					if (q931_tree != NULL) {
 						dissect_q931_call_state_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_CHANNEL_IDENTIFICATION:
+				case CS0 | Q931_IE_CHANNEL_IDENTIFICATION:
+					if (q931_tree != NULL) {
 						dissect_q931_channel_identification_ie(
 							tvb, offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_PROGRESS_INDICATOR:
+				case CS0 | Q931_IE_PROGRESS_INDICATOR:
+					if (q931_tree != NULL) {
 						dissect_q931_progress_indicator_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_NETWORK_SPECIFIC_FACIL:
-					case CS0 | Q931_IE_TRANSIT_NETWORK_SEL:
+				case CS0 | Q931_IE_NETWORK_SPECIFIC_FACIL:
+				case CS0 | Q931_IE_TRANSIT_NETWORK_SEL:
+					if (q931_tree != NULL) {
 						dissect_q931_ns_facilities_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_NOTIFICATION_INDICATOR:
+				case CS0 | Q931_IE_NOTIFICATION_INDICATOR:
+					if (q931_tree != NULL) {
 						dissect_q931_notification_indicator_ie(
 							tvb, offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_DISPLAY:
+				case CS0 | Q931_IE_DISPLAY:
+					if (q931_tree != NULL) {
 						dissect_q931_ia5_ie(tvb, offset + 2,
 							info_element_len, ie_tree,
 							"Display information");
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_DATE_TIME:
+				case CS0 | Q931_IE_DATE_TIME:
+					if (q931_tree != NULL) {
 						dissect_q931_date_time_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_KEYPAD_FACILITY:
+				case CS0 | Q931_IE_KEYPAD_FACILITY:
+					if (q931_tree != NULL) {
 						dissect_q931_ia5_ie(tvb, offset + 2,
 							info_element_len, ie_tree,
 							"Keypad facility");
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_SIGNAL:
+				case CS0 | Q931_IE_SIGNAL:
+					if (q931_tree != NULL) {
 						dissect_q931_signal_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_INFORMATION_RATE:
+				case CS0 | Q931_IE_INFORMATION_RATE:
+					if (q931_tree != NULL) {
 						dissect_q931_information_rate_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_E2E_TRANSIT_DELAY:
+				case CS0 | Q931_IE_E2E_TRANSIT_DELAY:
+					if (q931_tree != NULL) {
 						dissect_q931_e2e_transit_delay_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_TD_SELECTION_AND_INT:
+				case CS0 | Q931_IE_TD_SELECTION_AND_INT:
+					if (q931_tree != NULL) {
 						dissect_q931_td_selection_and_int_ie(
 							tvb, offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_PL_BINARY_PARAMETERS:
+				case CS0 | Q931_IE_PL_BINARY_PARAMETERS:
+					if (q931_tree != NULL) {
 						dissect_q931_pl_binary_parameters_ie(
 							tvb, offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_PL_WINDOW_SIZE:
+				case CS0 | Q931_IE_PL_WINDOW_SIZE:
+					if (q931_tree != NULL) {
 						dissect_q931_pl_window_size_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_PACKET_SIZE:
+				case CS0 | Q931_IE_PACKET_SIZE:
+					if (q931_tree != NULL) {
 						dissect_q931_packet_size_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_CUG:
+				case CS0 | Q931_IE_CUG:
+					if (q931_tree != NULL) {
 						dissect_q931_cug_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_REVERSE_CHARGE_IND:
+				case CS0 | Q931_IE_REVERSE_CHARGE_IND:
+					if (q931_tree != NULL) {
 						dissect_q931_reverse_charge_ind_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_CONNECTED_NUMBER_DEFAULT:
+				case CS0 | Q931_IE_CONNECTED_NUMBER_DEFAULT:
+					if (q931_tree != NULL) {
 						dissect_q931_number_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree,
 							hf_q931_connected_number, e164_info);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_REDIRECTING_NUMBER:
-						dissect_q931_number_ie(tvb,
-							offset + 2, info_element_len,
-							ie_tree,
-							hf_q931_redirecting_number, e164_info);
-						break;
 
-					case CS0 | Q931_IE_CALLING_PARTY_SUBADDR:
-					case CS0 | Q931_IE_CALLED_PARTY_SUBADDR:
+				case CS0 | Q931_IE_CALLING_PARTY_NUMBER:
+					e164_info.e164_number_type = CALLING_PARTY_NUMBER;
+					dissect_q931_number_ie(tvb,
+						offset + 2, info_element_len,
+						ie_tree,
+						hf_q931_calling_party_number, e164_info);
+					break;
+
+				case CS0 | Q931_IE_CALLED_PARTY_NUMBER:
+					e164_info.e164_number_type = CALLED_PARTY_NUMBER;
+					dissect_q931_number_ie(tvb,
+						offset + 2, info_element_len,
+						ie_tree,
+						hf_q931_called_party_number, e164_info);
+					break;
+
+				case CS0 | Q931_IE_CALLING_PARTY_SUBADDR:
+				case CS0 | Q931_IE_CALLED_PARTY_SUBADDR:
+					if (q931_tree != NULL) {
 						dissect_q931_party_subaddr_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
+
+				case CS0 | Q931_IE_REDIRECTING_NUMBER:
+					if (q931_tree != NULL) {
+						dissect_q931_number_ie(tvb,
+							offset + 2, info_element_len,
+							ie_tree,
+							hf_q931_redirecting_number, e164_info);
+					}
+					break;
 
-					case CS0 | Q931_IE_RESTART_INDICATOR:
+				case CS0 | Q931_IE_RESTART_INDICATOR:
+					if (q931_tree != NULL) {
 						dissect_q931_restart_indicator_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_HIGH_LAYER_COMPAT:
+				case CS0 | Q931_IE_HIGH_LAYER_COMPAT:
+					if (q931_tree != NULL) {
 						dissect_q931_high_layer_compat_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					case CS0 | Q931_IE_USER_USER:
+				case CS0 | Q931_IE_USER_USER:
+					if (q931_tree != NULL) {
 						dissect_q931_user_user_ie(tvb,
 							offset + 2, info_element_len,
 							ie_tree);
-						break;
+					}
+					break;
 
-					default:
+				default:
+					if (q931_tree != NULL) {
 						proto_tree_add_text(ie_tree, tvb,
 							offset + 2, info_element_len,
 							"Data: %s",
@@ -2904,8 +2978,8 @@
 							  tvb_get_ptr(tvb, offset + 2,
 								  info_element_len),
 							  info_element_len));
-						break;
 					}
+					break;
 				}
 			}
 			offset += 1 + 1 + info_element_len;
@@ -3212,8 +3286,10 @@
         return;
     }
 
-    g_free(pi->calling_number);
-    g_free(pi->called_number);
+    if (pi->calling_number)
+	    g_free(pi->calling_number);
+    if (pi->called_number)
+	    g_free(pi->called_number);
     pi->calling_number = NULL;
     pi->called_number = NULL;
     pi->cause_value = 0xFF;
--- ethereal-0.10.10.orig/epan/dissectors/packet-radius.c
+++ ethereal-0.10.10/epan/dissectors/packet-radius.c
@@ -4,7 +4,7 @@
  * Copyright 1999 Johan Feyaerts
  * Changed 03/12/2003 Rui Carmo (http://the.taoofmac.com - added all 3GPP VSAs, some parsing)
  *
- * $Id: packet-radius.c 13650 2005-03-07 11:35:52Z lego $
+ * $Id: packet-radius.c 14210 2005-04-28 03:31:20Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -3124,7 +3124,8 @@
 
 static const radius_attr_info radius_vendor_3gpp_attrib[] =
 {
-   /* According to 3GPP TS 29.061 V6.3.1 (2005-01 */
+   /* According to 3GPP TS 29.061 V6.3.1 (2005-01) */
+   /* The strings are in UTF-8 */
    {1,  RADIUS_STRING,			"IMSI", NULL, NULL},
    {2,  RADIUS_INTEGER4,		"Charging ID", NULL, NULL},
    {3,  RADIUS_INTEGER4,		"PDP Type", the3gpp_pdp_type_vals, NULL},
@@ -3779,6 +3780,8 @@
 					: "Unknown Type"),
 				vsa_avph->avp_type, vsa_avph->avp_length);
 			cont = &cont[strlen(cont)];
+                	if (!avp_length_check(cont, vsa_avph, 1))
+			  return;
 			rd_value_to_str(cont, vsabuffer, vsa_avph, tvb,
 					offset+vsa_len, next_attr_info,
 					tree);
@@ -3805,7 +3808,7 @@
 		break;
 
         case( RADIUS_INTEGER4_TAGGED ):
-                if (!avp_length_check(cont, avph, 5))
+                if (!avp_length_check(cont, avph, 4))
                   return;
 		tag = tvb_get_guint8(tvb,offset+2);
 		intval = tvb_get_ntoh24(tvb,offset+3);
@@ -4238,7 +4241,7 @@
         rd_value_to_str(textbuffer, &vsabuffer, &avph, tvb, offset,
 			attr_info, vsa_tree);
         proto_item_append_text(ti, ", %s", textbuffer);
-	for (i = 0; vsabuffer[i].str && i < VSABUFFER; i++) {
+	for (i = 0; i < VSABUFFER && vsabuffer[i].str; i++) {
 	    proto_tree_add_text(vsa_tree, tvb, vsabuffer[i].offset,
 				vsabuffer[i].length, "%s", vsabuffer[i].str);
 	}
--- ethereal-0.10.10.orig/epan/dissectors/packet-rpc.c
+++ ethereal-0.10.10/epan/dissectors/packet-rpc.c
@@ -2,7 +2,7 @@
  * Routines for rpc dissection
  * Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
  *
- * $Id: packet-rpc.c 13366 2005-02-09 23:38:00Z lroland $
+ * $Id: packet-rpc.c 14186 2005-04-25 16:54:18Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -2382,6 +2382,7 @@
 
 	/* now we know, that RPC was shorter */
 	if (rpc_item) {
+		tvb_ensure_bytes_exist(tvb, offset, 0);
 		proto_item_set_end(rpc_item, tvb, offset);
 	}
 
@@ -2406,7 +2407,7 @@
 		if (ptree) {
 			proto_tree_add_uint(ptree,
 				hf_rpc_programversion, tvb, 0, 0, vers);
-			if (rpc_prog->procedure_hfs->len > vers)
+			if (rpc_prog && (rpc_prog->procedure_hfs->len > vers))
 				procedure_hf = g_array_index(rpc_prog->procedure_hfs, int, vers);
 			else {
 				/*
@@ -2794,8 +2795,8 @@
     proto_tree *tree, rec_dissector_t dissector, gboolean is_heur,
     int proto, int ett, gboolean defragment, gboolean first_pdu)
 {
-	struct tcpinfo *tcpinfo = pinfo->private_data;
-	guint32 seq = tcpinfo->seq + offset;
+	struct tcpinfo *tcpinfo;
+	guint32 seq;
 	guint32 rpc_rm;
 	volatile gint32 len;
 	gint32 seglen;
@@ -2808,6 +2809,16 @@
 	fragment_data *ipfd_head;
 	tvbuff_t *rec_tvb;
 
+	if (pinfo == NULL || pinfo->private_data == NULL) {
+		return 0;
+	}
+	tcpinfo = pinfo->private_data;
+
+	if (tcpinfo == NULL) {
+		return 0;
+	}
+	seq = tcpinfo->seq + offset;
+
 	/*
 	 * Get the record mark.
 	 */
--- ethereal-0.10.10.orig/epan/dissectors/packet-rsvp.c
+++ ethereal-0.10.10/epan/dissectors/packet-rsvp.c
@@ -3,7 +3,7 @@
  *
  * (c) Copyright Ashok Narayanan <ashokn@cisco.com>
  *
- * $Id: packet-rsvp.c 12130 2004-09-29 00:52:45Z guy $
+ * $Id: packet-rsvp.c 14277 2005-05-02 20:30:56Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1232,7 +1232,7 @@
     proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
 			"Class number: %u - %s",
 			class, type_str);
-    proto_item_set_text(ti, summary_session(tvb, offset));
+    proto_item_set_text(ti, "%s", summary_session(tvb, offset));
 
     switch(type) {
     case RSVP_SESSION_TYPE_IPV4:
@@ -1346,9 +1346,9 @@
 		       tvbuff_t *tvb, int offset, int obj_length, 
 		       int subtree_type)
 {
-    guint16   tlv_off;
+    guint     tlv_off;
     guint16   tlv_type;
-    guint16   tlv_len;
+    guint     tlv_len;
     char     *ifindex_name;
     proto_tree *rsvp_ifid_subtree, *ti2;
     int       offset2 = offset + 4;
@@ -1356,6 +1356,12 @@
     for (tlv_off = 0; tlv_off < obj_length - 12; ) {
 	tlv_type = tvb_get_ntohs(tvb, offset+tlv_off);
 	tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2);
+
+	if (tlv_len == 0) {
+	    proto_tree_add_text(rsvp_object_tree, tvb, offset+tlv_off+2, 2,
+		"Invalid length (0)");
+	    return;
+	}
 	switch(tlv_type) {
 	case 1:
 	    ti2 = proto_tree_add_text(rsvp_object_tree, tvb,
@@ -1855,7 +1861,7 @@
 	break;
     }
 
-     proto_item_set_text(ti, summary_template(tvb, offset));
+     proto_item_set_text(ti, "%s", summary_template(tvb, offset));
      switch(type) {
      case 1:
 	 proto_tree_add_text(rsvp_object_tree, tvb, offset+3, 1,
@@ -1964,6 +1970,8 @@
 	    while (param_len_processed < length) {
 		param_id = tvb_get_guint8(tvb, offset2);
 		param_len = tvb_get_ntohs(tvb, offset2+2) + 1;
+		if (param_len < 1)
+		    THROW(ReportedBoundsError);
 		switch(param_id) {
 		case 127:
 		    /* Token Bucket */
@@ -3330,6 +3338,11 @@
 
 	}
 
+	if (tvb_get_guint8(tvb, offset+l+1) < 1) {
+	    proto_tree_add_text(rsvp_ro_subtree, tvb, offset+l+1, 1,
+		"Invalid length: %u", tvb_get_guint8(tvb, offset+l+1));
+	    return;
+	}
 	l += tvb_get_guint8(tvb, offset+l+1);
 	if (l < obj_length - 4) {
 	    if (i < 4)
@@ -4020,6 +4033,11 @@
 	    }
 
 	    l += tvb_get_guint8(tvb, offset2+l+1);
+	    if (l < 1) {
+		proto_tree_add_text(rsvp_gen_uni_subtree, tvb, offset2+l+1, 1,
+		    "Invalid length: %u", tvb_get_guint8(tvb, offset2+l+1));
+		return;
+	    }
 	    if (l < mylen) {
 		if (i < 4)
 		    proto_item_append_text(ti, ", ");
@@ -4070,7 +4088,7 @@
     proto_tree_add_text(rsvp_object_tree, tvb, offset+2, 1,
 			"Class number: %u - %s",
 			class, type_str);
-    proto_item_set_text(ti, "CALL-ID");
+    proto_item_set_text(ti, "CALL-ID: ");
     type = tvb_get_guint8 (tvb, offset2);
     switch(c_type) {
     case 1:
@@ -4084,6 +4102,8 @@
 			      val_to_str(type, address_type_vals, "Unknown (%u)"));
 	  proto_tree_add_text(rsvp_object_tree, tvb, offset2+1, 3, "Reserved: %u",
 			      tvb_get_ntoh24(tvb, offset2+1));
+	  proto_item_append_text(ti, "Operator-Specific. Addr Type: %s. ", 
+				 val_to_str(type, address_type_vals, "Unknown (%u)"));
 	}
 	else {
 	  offset3 = offset2 + 16;
@@ -4095,10 +4115,13 @@
 	  str = tvb_get_string (tvb, offset2 + 1, 3);  
 	  proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 1, 3,
 			      "International Segment: %s", str); 
+	  proto_item_append_text(ti, "Globally-Unique. Addr Type: %s. Intl Segment: %s. ", 
+				 val_to_str(type, address_type_vals, "Unknown (%u)"), str);
 	  g_free (str);
 	  str = tvb_get_string (tvb, offset2 + 4, 12);  
 	  proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 4, 12,
 			      "National Segment: %s", str); 
+	  proto_item_append_text(ti, "Natl Segment: %s. ", str);
 	  g_free (str);
 	}
 
@@ -4107,30 +4130,36 @@
 	  offset4 = offset3 + 4;
 	  proto_tree_add_text(rsvp_object_tree, tvb, offset3, 4, "Source Transport Network addr: %s",
 			      ip_to_str(tvb_get_ptr(tvb, offset3, 4)));
+	  proto_item_append_text(ti, "Src TNA: %s. ", ip_to_str(tvb_get_ptr(tvb, offset3, 4)));
 	  break;
 	  
 	case 2:
 	  offset4 = offset3 + 16;
 	  proto_tree_add_text(rsvp_object_tree, tvb, offset3, 16, "Source Transport Network addr: %s",
 			      ip6_to_str((const struct e_in6_addr *) tvb_get_ptr(tvb, offset3, 16)));
+	  proto_item_append_text(ti, "Src TNA: %s. ", 
+				 ip6_to_str((const struct e_in6_addr *) tvb_get_ptr(tvb, offset3, 16)));
 	  break;
 	  
 	case 3:
 	  offset4 = offset3 + 20;
 	  proto_tree_add_text(rsvp_object_tree, tvb, offset3, 20, "Source Transport Network addr: %s",
 			      tvb_bytes_to_str(tvb, offset3, 20));
+	  proto_item_append_text(ti, "Src TNA: %s. ", tvb_bytes_to_str(tvb, offset3, 20));
 	  break;
 	  
 	case 4:
 	  offset4 = offset3 + 6;
 	  proto_tree_add_text(rsvp_object_tree, tvb, offset3, 6, "Source Transport Network addr: %s",
 			      tvb_bytes_to_str(tvb, offset3, 6));
+	  proto_item_append_text(ti, "Src TNA: %s. ", tvb_bytes_to_str(tvb, offset3, 6));
 	  break;
 	  
 	case 0x7F:
 	  offset4 = offset3 + len;
 	  proto_tree_add_text(rsvp_object_tree, tvb, offset3, len, "Source Transport Network addr: %s",
 			      tvb_bytes_to_str(tvb, offset3, len));
+	  proto_item_append_text(ti, "Src TNA: %s. ", tvb_bytes_to_str(tvb, offset3, len));
 	  break;
 
 	default:
@@ -4141,6 +4170,7 @@
 
 	proto_tree_add_text(rsvp_object_tree, tvb, offset4, 8, "Local Identifier: %s",
 			    tvb_bytes_to_str(tvb, offset4, 8));
+	proto_item_append_text(ti, "Local ID: %s. ", tvb_bytes_to_str(tvb, offset4, 8));
 	break;
 
     default:
--- ethereal-0.10.10.orig/epan/dissectors/packet-sip.c
+++ ethereal-0.10.10/epan/dissectors/packet-sip.c
@@ -19,7 +19,7 @@
  * Copyright 2001, Jean-Francois Mule <jfm@cablelabs.com>
  * Copyright 2004, Anders Broman <anders.broman@ericsson.com>
  *
- * $Id: packet-sip.c 13225 2005-02-01 12:12:35Z lroland $
+ * $Id: packet-sip.c 14196 2005-04-26 23:38:16Z lroland $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -113,9 +113,9 @@
         "PUBLISH"
 };
 
-/* from RFC 3261 
- * Updated with info from http://www.iana.org/assignments/sip-parameters 
- * (last updated 2004-10-17) 
+/* from RFC 3261
+ * Updated with info from http://www.iana.org/assignments/sip-parameters
+ * (last updated 2004-10-17)
  * Updated with: http://www.ietf.org/internet-drafts/draft-ietf-sip-resource-priority-05.txt
  */
 typedef struct {
@@ -430,6 +430,8 @@
 /* Store the info needed by the SIP tap for one packet */
 static sip_info_value_t *stat_info;
 
+/* The buffer size for the cseq_method name */
+#define MAX_CSEQ_METHOD_SIZE 16
 
 /****************************************************************************
  * Conversation-type definitions
@@ -471,6 +473,7 @@
 {
 	guint32 cseq;
 	transaction_state_t transaction_state;
+	guint32 response_code;
 	gint frame_number;
 } sip_hash_value;
 
@@ -599,13 +602,14 @@
 	guchar contacts = 0, contact_is_star = 0, expires_is_0 = 0;
 	guint32 cseq_number = 0;
 	guchar  cseq_number_set = 0;
-	char    cseq_method[16] = "";
+	char    cseq_method[MAX_CSEQ_METHOD_SIZE] = "";
 	char	call_id[MAX_CALL_ID_SIZE] = "";
 	char *media_type_str = NULL;
 	char *media_type_str_lower_case = NULL;
 	char *content_type_parameter_str = NULL;
 	guint resend_for_packet = 0;
 	char  *string;
+    int   strlen_to_copy;
 
 	/* Initialise stat info for passing to tap */
 	stat_info = g_malloc(sizeof(sip_info_value_t));
@@ -820,7 +824,7 @@
 					if ( parameter_offset != -1){
 						len = parameter_offset - value_offset;
 						if ( len > 1){
-							/* Something in front, must be display info 
+							/* Something in front, must be display info
 							 * TODO: Get rid of trailing space(s)
 							 */
 							proto_tree_add_item(sip_element_tree, hf_sip_display, tvb, value_offset,
@@ -857,7 +861,7 @@
 						stat_info->tap_to_addr=tvb_get_string(tvb, parameter_offset, parameter_len);
 
 						parameter_offset = parameter_end_offset + 1;
-						/*  
+						/*
 						 * URI parameters ?
 						 */
 						parameter_end_offset = tvb_find_guint8(tvb, parameter_offset,( line_end_offset - parameter_offset), ';');
@@ -875,7 +879,7 @@
 						parameter_offset++;
 					len = parameter_offset - value_offset;
 					if ( len > 1){
-						/* Something in front, must be display info 
+						/* Something in front, must be display info
 						 * TODO: Get rid of trailing space(s)
 						 */
 						proto_tree_add_item(sip_element_tree, hf_sip_display, tvb, value_offset,
@@ -894,7 +898,7 @@
 					}
 					/* Find parameter tag if present.
 					 * TODO make this generic to find any interesting parameter
-					 * use the same method as for SIP headers ? 
+					 * use the same method as for SIP headers ?
 					 */
 
 					parameter_offset = offset;
@@ -930,7 +934,7 @@
 					if ( parameter_offset != -1){
 						len = parameter_offset - value_offset;
 						if ( len > 1){
-							/* Something in front, must be display info 
+							/* Something in front, must be display info
 							 * TODO: Get rid of trailing space(s)
 							 */
 							proto_tree_add_item(sip_element_tree, hf_sip_display, tvb, value_offset,
@@ -961,12 +965,12 @@
 						}
 	separator_found2:
 						parameter_len = parameter_end_offset - parameter_offset;
-						dfilter_store_sip_from_addr(tvb, sip_element_tree, 
+						dfilter_store_sip_from_addr(tvb, sip_element_tree,
 							parameter_offset, parameter_len);
 						/*info for the tap for voip_calls.c*/
 						stat_info->tap_from_addr=tvb_get_string(tvb, parameter_offset, parameter_len);
 						parameter_offset = parameter_end_offset + 1;
-						/*  
+						/*
 						 * URI parameters ?
 						 */
 						parameter_end_offset = tvb_find_guint8(tvb, parameter_offset,( line_end_offset - parameter_offset), ';');
@@ -984,7 +988,7 @@
 						parameter_offset++;
 					len = parameter_offset - value_offset;
 					if ( len > 1){
-						/* Something in front, must be display info 
+						/* Something in front, must be display info
 						 * TODO: Get rid of trailing space(s)
 						 */
 						proto_tree_add_item(sip_element_tree, hf_sip_display, tvb, value_offset,
@@ -1003,7 +1007,7 @@
 					}
 					/* Find parameter tag if present.
 					 * TODO make this generic to find any interesting parameter
-					 * use the same method as for SIP headers ? 
+					 * use the same method as for SIP headers ?
 					 */
 
 					parameter_offset = offset;
@@ -1029,22 +1033,47 @@
 					cseq_number_set = 1;
 					stat_info->tap_cseq_number=cseq_number;
 
-					/* Extract method name from value */
-					for (value_offset = 0; value_offset < (gint)strlen(value); value_offset++)
+					/* Walk past number and spaces characters to get to start
+					   of method name */
+					for (value_offset=0; value_offset < (gint)strlen(value); value_offset++)
 					{
 						if (isalpha((guchar)value[value_offset]))
 						{
-							strcpy(cseq_method,value+value_offset);
 							break;
 						}
 					}
-					/* Add 'CSeq' string item to tree */
-					if(hdr_tree) {
-						proto_tree_add_string_format(hdr_tree,
-						    hf_header_array[hf_index], tvb,
-						    offset, next_offset - offset,
-						    value, "%s",
-						    tvb_format_text(tvb, offset, linelen));
+					if (value_offset == (gint)strlen(value))
+					{
+						THROW(ReportedBoundsError);
+						return TRUE;
+					}
+
+					/* Extract method name from value */
+					strlen_to_copy = strlen(value)-value_offset+1;
+					if (strlen_to_copy > MAX_CSEQ_METHOD_SIZE) {
+						/* Note the error in the protocol tree */
+						if(hdr_tree) {
+							proto_tree_add_string_format(hdr_tree,
+							    hf_header_array[hf_index], tvb,
+							    offset, next_offset - offset,
+							    value+value_offset, "%s String too big: %d bytes",
+							    sip_headers[POS_CSEQ].name,
+							    strlen_to_copy);
+						}
+						THROW(ReportedBoundsError);
+						return TRUE;
+					}
+					else {
+						strncpy(cseq_method, value+value_offset, MIN(strlen_to_copy, MAX_CSEQ_METHOD_SIZE));
+
+						/* Add 'CSeq' string item to tree */
+						if(hdr_tree) {
+							proto_tree_add_string_format(hdr_tree,
+							    hf_header_array[hf_index], tvb,
+							    offset, next_offset - offset,
+							    value, "%s",
+							    tvb_format_text(tvb, offset, linelen));
+						}
 					}
 					break;
 
@@ -1055,7 +1084,7 @@
 							strlen(value)+1 :
 							MAX_CALL_ID_SIZE);
 					stat_info->tap_call_id = g_strdup(call_id);
-					
+
 					/* Add 'Call-id' string item to tree */
 					if(hdr_tree) {
 						proto_tree_add_string_format(hdr_tree,
@@ -1163,110 +1192,110 @@
 				g_free(value);
 			}/*if HF_index */
 		}/* if colon_offset */
-                offset = next_offset;
-        }/* End while */
+		offset = next_offset;
+		}/* End while */
 
-        if (tvb_offset_exists(tvb, next_offset)) {
+		if (tvb_offset_exists(tvb, next_offset)) {
 
-                /*
-                 * There's a message body starting at "next_offset".
-                 * Set the length of the header item.
-                 */
-                proto_item_set_end(th, tvb, next_offset);
-                next_tvb = tvb_new_subset(tvb, next_offset, -1, -1);
-                if(sip_tree) {
-               		ti = proto_tree_add_text(sip_tree, next_tvb, 0, -1,
-                	                         "Message body");
-               		message_body_tree = proto_item_add_subtree(ti, ett_sip_message_body);
-		}
+			/*
+			 * There's a message body starting at "next_offset".
+			 * Set the length of the header item.
+			 */
+			proto_item_set_end(th, tvb, next_offset);
+			next_tvb = tvb_new_subset(tvb, next_offset, -1, -1);
+			if(sip_tree) {
+				ti = proto_tree_add_text(sip_tree, next_tvb, 0, -1,
+				                         "Message body");
+				message_body_tree = proto_item_add_subtree(ti, ett_sip_message_body);
+			}
 
-		/* give the content type parameters to sub dissectors */
+			/* give the content type parameters to sub dissectors */
 
-		if ( media_type_str_lower_case != NULL ) {
-			void *save_private_data = pinfo->private_data;
-			pinfo->private_data = content_type_parameter_str;
-			found_match = dissector_try_string(media_type_dissector_table,
-							   media_type_str_lower_case,
-							   next_tvb, pinfo,
-							   message_body_tree);
-			g_free(media_type_str_lower_case);
-			pinfo->private_data = save_private_data;
-			/* If no match dump as text */
-		}
-		g_free(content_type_parameter_str);
-		if ( found_match != TRUE )
-		{
-			offset = 0;
-	        	while (tvb_offset_exists(next_tvb, offset)) {
-	                	tvb_find_line_end(next_tvb, offset, -1, &next_offset, FALSE);
-	                	linelen = next_offset - offset;
-	                	if(message_body_tree) {
-	                		proto_tree_add_text(message_body_tree, next_tvb, offset, linelen,
-	                   			"%s", tvb_format_text(next_tvb, offset, linelen));
-	                   	}
- 	        		offset = next_offset;
- 	 		}/* end while */
+			if ( media_type_str_lower_case != NULL ) {
+				void *save_private_data = pinfo->private_data;
+				pinfo->private_data = content_type_parameter_str;
+				found_match = dissector_try_string(media_type_dissector_table,
+				                                   media_type_str_lower_case,
+				                                   next_tvb, pinfo,
+				                                   message_body_tree);
+				g_free(media_type_str_lower_case);
+				pinfo->private_data = save_private_data;
+				/* If no match dump as text */
+			}
+			g_free(content_type_parameter_str);
+			if ( found_match != TRUE )
+			{
+				offset = 0;
+				while (tvb_offset_exists(next_tvb, offset)) {
+					tvb_find_line_end(next_tvb, offset, -1, &next_offset, FALSE);
+					linelen = next_offset - offset;
+					if(message_body_tree) {
+						proto_tree_add_text(message_body_tree, next_tvb, offset, linelen,
+						                    "%s", tvb_format_text(next_tvb, offset, linelen));
+					}
+					offset = next_offset;
+				}/* end while */
+			}
 		}
-        }
 
 
-	/* Add to info column interesting things learned from header fields. */
-	if (check_col(pinfo->cinfo, COL_INFO))
-	{
-		/* Registration requests */
-		if (strcmp(sip_methods[current_method_idx], "REGISTER") == 0)
+		/* Add to info column interesting things learned from header fields. */
+		if (check_col(pinfo->cinfo, COL_INFO))
 		{
-			if (contact_is_star && expires_is_0)
+			/* Registration requests */
+			if (strcmp(sip_methods[current_method_idx], "REGISTER") == 0)
 			{
-				col_append_str(pinfo->cinfo, COL_INFO, "    (remove all bindings)");
+				if (contact_is_star && expires_is_0)
+				{
+					col_append_str(pinfo->cinfo, COL_INFO, "    (remove all bindings)");
+				}
+				else
+					if (!contacts)
+				{
+					col_append_str(pinfo->cinfo, COL_INFO, "    (fetch bindings)");
+				}
 			}
-			else
-			if (!contacts)
+
+			/* Registration responses */
+			if (line_type == STATUS_LINE && (strcmp(cseq_method, "REGISTER") == 0))
 			{
-				col_append_str(pinfo->cinfo, COL_INFO, "    (fetch bindings)");
+				col_append_fstr(pinfo->cinfo, COL_INFO, "    (%d bindings)", contacts);
 			}
 		}
 
-		/* Registration responses */
-		if (line_type == STATUS_LINE && (strcmp(cseq_method, "REGISTER") == 0))
-		{
-			col_append_fstr(pinfo->cinfo, COL_INFO, "    (%d bindings)", contacts);
-		}
-	}
-
-	/* Check if this packet is a resend. */
-	resend_for_packet = sip_is_packet_resend(pinfo, cseq_method, call_id,
-						cseq_number_set, cseq_number,
-						line_type);
-	/* Mark whether this is a resend for the tap */
-	stat_info->resend = (resend_for_packet > 0);
+		/* Check if this packet is a resend. */
+		resend_for_packet = sip_is_packet_resend(pinfo, cseq_method, call_id,
+		                    cseq_number_set, cseq_number,
+		                    line_type);
+		/* Mark whether this is a resend for the tap */
+		stat_info->resend = (resend_for_packet > 0);
 
-	/* And add the filterable field to the request/response line */
-	if (reqresp_tree)
-	{
-		proto_item *item;
-		item = proto_tree_add_boolean(reqresp_tree, hf_sip_resend, tvb, 0, 0,
-						resend_for_packet > 0);
-		PROTO_ITEM_SET_GENERATED(item);
-		if (resend_for_packet > 0)
+		/* And add the filterable field to the request/response line */
+		if (reqresp_tree)
 		{
-			item = proto_tree_add_uint(reqresp_tree, hf_sip_original_frame,
-						tvb, 0, 0, resend_for_packet);
+			proto_item *item;
+			item = proto_tree_add_boolean(reqresp_tree, hf_sip_resend, tvb, 0, 0,
+			                              resend_for_packet > 0);
 			PROTO_ITEM_SET_GENERATED(item);
+			if (resend_for_packet > 0)
+			{
+				item = proto_tree_add_uint(reqresp_tree, hf_sip_original_frame,
+				                           tvb, 0, 0, resend_for_packet);
+				PROTO_ITEM_SET_GENERATED(item);
+			}
 		}
-	}
 
 
-        if (global_sip_raw_text)
-                tvb_raw_text_add(tvb, tree);
+		if (global_sip_raw_text)
+			tvb_raw_text_add(tvb, tree);
 
-	/* Report this packet to the tap */
-	if (!pinfo->in_error_pkt)
-	{
-		tap_queue_packet(sip_tap, pinfo, stat_info);
-	}
+		/* Report this packet to the tap */
+		if (!pinfo->in_error_pkt)
+		{
+			tap_queue_packet(sip_tap, pinfo, stat_info);
+		}
 
-        return TRUE;
+		return TRUE;
 }
 
 /* Display filter for SIP Request-Line */
@@ -1275,20 +1304,20 @@
 {
 	char	*string;
 
-        /*
-         * We know we have the entire method; otherwise, "sip_parse_line()"
-         * would have returned OTHER_LINE.
-         */
-        string = tvb_get_string(tvb, 0, meth_len);
-        if (tree) {
-        	proto_tree_add_string(tree, hf_Method, tvb, 0, meth_len, string);
+	/*
+	 * We know we have the entire method; otherwise, "sip_parse_line()"
+	 * would have returned OTHER_LINE.
+	 */
+	string = tvb_get_string(tvb, 0, meth_len);
+	if (tree) {
+		proto_tree_add_string(tree, hf_Method, tvb, 0, meth_len, string);
 	}
 	/* Copy request method for telling tap */
 	stat_info->request_method = g_malloc(meth_len+1);
 	strncpy(stat_info->request_method, string, meth_len+1);
 
-        /* String no longer needed */
-        g_free(string);
+	/* String no longer needed */
+	g_free(string);
 }
 
 /* Display filter for SIP Status-Line */
@@ -1298,27 +1327,27 @@
 	char string[3+1];
 	gint response_code = 0;
 
-        /*
-         * We know we have the entire status code; otherwise,
-         * "sip_parse_line()" would have returned OTHER_LINE.
-         * We also know that we have a version string followed by a
-         * space at the beginning of the line, for the same reason.
-         */
-        tvb_memcpy(tvb, (guint8 *)string, SIP2_HDR_LEN + 1, 3);
-        string[3] = '\0';
+	/*
+	 * We know we have the entire status code; otherwise,
+	 * "sip_parse_line()" would have returned OTHER_LINE.
+	 * We also know that we have a version string followed by a
+	 * space at the beginning of the line, for the same reason.
+	 */
+	tvb_memcpy(tvb, (guint8 *)string, SIP2_HDR_LEN + 1, 3);
+	string[3] = '\0';
 	response_code = atoi(string);
 
 	/* Add numerical response code to tree */
-        if (tree) {
+	if (tree) {
 		proto_tree_add_uint(tree, hf_Status_Code, tvb, SIP2_HDR_LEN + 1,
-					3, response_code);
+		                    3, response_code);
 	}
 
-        /* Add response code for sending to tap */
-        stat_info->response_code = response_code;
+	/* Add response code for sending to tap */
+	stat_info->response_code = response_code;
 }
 
-void dfilter_store_sip_from_addr(tvbuff_t *tvb,proto_tree *tree,guint parameter_offset, 
+void dfilter_store_sip_from_addr(tvbuff_t *tvb,proto_tree *tree,guint parameter_offset,
 					  guint parameter_len)
 {
 	proto_tree_add_item(tree, hf_sip_from_addr, tvb, parameter_offset,
@@ -1611,10 +1640,11 @@
 	/******************************************/
 	/* Is it a resend???                      */
 
-	/* Does this look like a resent request ? */
+	/* Does this look like a resent request (discount ACK, CANCEL) ? */
 	if ((line_type == REQUEST_LINE) && (cseq_number == cseq_to_compare) &&
 		(p_val->transaction_state == request_seen) &&
-		(strcmp(cseq_method, "ACK") != 0))
+		(strcmp(cseq_method, "ACK") != 0) &&
+		(strcmp(cseq_method, "CANCEL") != 0))
 	{
 		result = p_val->frame_number;
 	}
@@ -1622,7 +1652,8 @@
 	/* Does this look like a resent final response ? */
 	if ((line_type == STATUS_LINE) && (cseq_number == cseq_to_compare) &&
 		(p_val->transaction_state == final_response_seen) &&
-		(stat_info->response_code >= 200))
+		(stat_info->response_code >= 200) &&
+		(stat_info->response_code == p_val->response_code))
 	{
 		result = p_val->frame_number;
 	}
@@ -1642,6 +1673,7 @@
 		case STATUS_LINE:
 			if (stat_info->response_code >= 200)
 			{
+				p_val->response_code = stat_info->response_code;
 				p_val->transaction_state = final_response_seen;
 				if (!result)
 				{
@@ -2118,7 +2150,7 @@
 		       FT_STRING, BASE_NONE,NULL,0x0,
 			"RFC 3261: To Header", HFILL }
 		},
-					
+
 		{ &hf_header_array[POS_UNSUPPORTED],
 			{ "Unsupported", 		"sip.Unsupported",
 		       FT_STRING, BASE_NONE,NULL,0x0,
@@ -2139,7 +2171,7 @@
 		       FT_STRING, BASE_NONE,NULL,0x0,
 			"RFC 3261: Warning Header", HFILL }
 		},
-		
+
 		{ &hf_header_array[POS_WWW_AUTHENTICATE],
 			{ "WWW-Authenticate", 		"sip.WWW-Authenticate",
 		       FT_STRING, BASE_NONE,NULL,0x0,
--- ethereal-0.10.10.orig/epan/dissectors/packet-slowprotocols.c
+++ ethereal-0.10.10/epan/dissectors/packet-slowprotocols.c
@@ -1,7 +1,7 @@
 /* packet-slowprotocols.c
  * Routines for EtherType (0x8809) Slow Protocols disassembly.
  *
- * $Id: packet-slowprotocols.c 13287 2005-02-04 10:48:03Z guy $
+ * $Id: packet-slowprotocols.c 13950 2005-03-28 02:03:45Z gerald $
  *
  * Copyright 2002 Steve Housley <steve_housley@3com.com>
  * Copyright 2005 Dominique Bastien <dbastien@accedian.com>
@@ -841,7 +841,7 @@
         if(item){                        \
             string = get_manuf_name(mac); \
             proto_item_append_text(item, " (");    \
-            proto_item_append_text(item, string);    \
+            proto_item_append_text(item, "%s", string);    \
             proto_item_append_text(item, ")");    \
         }
 
@@ -1702,7 +1702,7 @@
             else
                 state_tree = proto_item_add_subtree(state_item, ett_oampdu_remote_info_state);
 
-            proto_tree_add_boolean(state_tree, hf_oampdu_info_state_parser,
+            proto_tree_add_uint(state_tree, hf_oampdu_info_state_parser,
                     tvb, offset, 1, raw_octet);
 
             proto_tree_add_boolean(state_tree, hf_oampdu_info_state_mux,
@@ -2699,7 +2699,7 @@
 
     { &hf_oampdu_info_state_parser,
       { "Parser Action",        "oam.info.state.parser",
-        FT_BOOLEAN,    8,        VALS(&parser_vals),    0x03,
+        FT_UINT8,    BASE_HEX,    VALS(&parser_vals),    0x03,
         "Parser Action", HFILL }},
 
     { &hf_oampdu_info_state_mux,
--- ethereal-0.10.10.orig/epan/dissectors/packet-smb-logon.c
+++ ethereal-0.10.10/epan/dissectors/packet-smb-logon.c
@@ -2,7 +2,7 @@
  * Routines for SMB net logon packet dissection
  * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
  *
- * $Id: packet-smb-logon.c 13215 2005-01-31 09:56:42Z sahlberg $
+ * $Id: packet-smb-logon.c 14224 2005-04-28 22:02:05Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -769,7 +769,7 @@
 #define LOGON_SAM_AD_USER_UNKNOWN		0x17
 #define LOGON_SAM_UNKNOWN_18			0x18
 #define LOGON_SAM_AD_LOGON_RESPONSE		0x19
-#define LOGON_LAST_CMD				0x20
+#define LOGON_LAST_CMD				0x19
 
 static const value_string commands[] = {
 	{LOGON_LM10_LOGON_REQUEST,	"LM1.0/LM2.0 LOGON Request"},
--- ethereal-0.10.10.orig/epan/dissectors/packet-smb-mailslot.c
+++ ethereal-0.10.10/epan/dissectors/packet-smb-mailslot.c
@@ -2,7 +2,7 @@
  * Routines for SMB mailslot packet dissection
  * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
  *
- * $Id: packet-smb-mailslot.c 13230 2005-02-01 23:33:04Z sahlberg $
+ * $Id: packet-smb-mailslot.c 14129 2005-04-18 18:57:37Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -105,7 +105,9 @@
 
 	if ((tvb==NULL) || (tvb_reported_length(tvb)==0)) {
 		/* Interim reply */
-		col_set_str(pinfo->cinfo, COL_INFO, "Interim reply");
+		if (check_col (pinfo->cinfo, COL_INFO)) {
+			col_set_str(pinfo->cinfo, COL_INFO, "Interim reply");
+		}
 		return TRUE;
 	}
 
@@ -114,7 +116,7 @@
 	}
 
 	smb_info = pinfo->private_data;
-	if (smb_info->sip != NULL)
+	if (smb_info != NULL && smb_info->sip != NULL && smb_info->sip->extra_info_type == SMB_EI_TRI)
 		tri = smb_info->sip->extra_info;
 	else
 		tri = NULL;
--- ethereal-0.10.10.orig/epan/dissectors/packet-smb-pipe.c
+++ ethereal-0.10.10/epan/dissectors/packet-smb-pipe.c
@@ -8,7 +8,7 @@
  * significant rewrite to tvbuffify the dissector, Ronnie Sahlberg and
  * Guy Harris 2001
  *
- * $Id: packet-smb-pipe.c 13515 2005-02-25 10:30:21Z sahlberg $
+ * $Id: packet-smb-pipe.c 14237 2005-04-30 04:09:28Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -279,10 +279,16 @@
     proto_tree *tree, int convert _U_, int hf_index)
 {
 	guint8 BParam;
+	header_field_info *hfinfo;
 
-	if (hf_index != -1)
+	if (hf_index != -1) {
+		hfinfo = proto_registrar_get_nth(hf_index);
+		if (hfinfo && count != 1 && 
+				(hfinfo->type == FT_INT8 || hfinfo->type == FT_UINT8)) {
+			THROW(ReportedBoundsError);
+		}
 		proto_tree_add_item(tree, hf_index, tvb, offset, count, TRUE);
-	else {
+	} else {
 		if (count == 1) {
 			BParam = tvb_get_guint8(tvb, offset);
 			proto_tree_add_text(tree, tvb, offset, count,
@@ -438,11 +444,15 @@
     proto_tree *tree, int convert _U_, int hf_index)
 {
 	struct smb_info *smb_info = pinfo->private_data;
-	smb_transact_info_t *trp = smb_info->sip->extra_info;
+	smb_transact_info_t *trp = NULL;
 	guint16 level;
 
+	if (smb_info->sip->extra_info_type == SMB_EI_TRI)
+		trp = smb_info->sip->extra_info;
+
 	level = tvb_get_letohs(tvb, offset);
 	if (!pinfo->fd->flags.visited)
+	    if (trp)
 		trp->info_level = level;	/* remember this for the response */
 	proto_tree_add_uint(tree, hf_index, tvb, offset, 2, level);
 	offset += 2;
@@ -1711,6 +1721,10 @@
 				offset += count;
 				items++;
 			} else {
+				if (items->type == PARAM_WORD && count != 2 ||
+						items->type == PARAM_DWORD && count != 4) {
+					THROW(ReportedBoundsError);
+				}
 				offset = (*items->func)(tvb, offset, count,
 				    pinfo, tree, 0, *items->hf_index);
 				items++;
@@ -1867,6 +1881,10 @@
 				offset += count;
 				items++;
 			} else {
+				if (items->type == PARAM_WORD && count != 2 ||
+						items->type == PARAM_DWORD && count != 4) {
+					THROW(ReportedBoundsError);
+				}
 				offset = (*items->func)(tvb, offset, count,
 				    pinfo, tree, 0, *items->hf_index);
 				items++;
@@ -2069,6 +2087,10 @@
 				offset += count;
 				items++;
 			} else {
+				if (items->type == PARAM_WORD && count != 2 ||
+						items->type == PARAM_DWORD && count != 4) {
+					THROW(ReportedBoundsError);
+				}
 				offset = (*items->func)(tvb, offset, count,
 				    pinfo, tree, convert, *items->hf_index);
 				items++;
@@ -2162,6 +2184,10 @@
 				    tvb_bytes_to_str(tvb, cptr, count));
 				items++;
 			} else {
+				if (items->type == PARAM_WORD && count != 2 ||
+						items->type == PARAM_DWORD && count != 4) {
+					THROW(ReportedBoundsError);
+				}
 				offset = (*items->func)(tvb, offset, count,
 				    pinfo, tree, convert, *items->hf_index);
 				items++;
@@ -2459,7 +2485,7 @@
     const struct lanman_desc *lanman, gboolean has_ent_count,
     guint16 ent_count)
 {
-	smb_transact_info_t *trp = smb_info->sip->extra_info;
+	smb_transact_info_t *trp = NULL;
 	const item_list_t *resp_data_list;
 	int offset, start_offset;
 	const char *label;
@@ -2472,6 +2498,9 @@
 	guint i, j;
 	guint16 aux_count;
 
+	if (smb_info->sip->extra_info_type == SMB_EI_TRI)
+		trp = smb_info->sip->extra_info;
+
 	/*
 	 * Find the item table for the matching request's detail level.
 	 */
@@ -2607,7 +2636,7 @@
 		    packet_info *pinfo, proto_tree *parent_tree)
 {
 	smb_info_t *smb_info = pinfo->private_data;
-	smb_transact_info_t *trp = smb_info->sip->extra_info;
+	smb_transact_info_t *trp = NULL;
 	int offset = 0, start_offset;
 	guint16 cmd;
 	guint16 status;
@@ -2624,9 +2653,12 @@
 	proto_item *data_item;
 	proto_tree *data_tree;
 
+	if (smb_info->sip->extra_info_type == SMB_EI_TRI)
+		trp = smb_info->sip->extra_info;
+
 	if (!proto_is_protocol_enabled(find_protocol_by_id(proto_smb_lanman)))
 		return FALSE;
-	if (smb_info->request && p_tvb == NULL) {
+	if (p_tvb == NULL) {
 		/*
 		 * Requests must have parameters.
 		 */
@@ -2654,6 +2686,10 @@
 		    cmd);
 		offset += 2;
 
+		if(!trp){
+			return FALSE; /* cant dissect this request */
+		}
+
 		/*
 		 * If we haven't already done so, save the function code in
 		 * the structure we were handed, so that it's available to
@@ -3514,7 +3550,7 @@
 	proto_item *pipe_item = NULL;
 	proto_tree *pipe_tree = NULL;
 	int offset;
-	int trans_subcmd;
+	int trans_subcmd=0;
 	int function;
 	int fid = -1;
 	guint16 info_level;
@@ -3536,7 +3572,7 @@
 		    smb_info->request ? "Request" : "Response");
 	}
 
-	if (smb_info->sip != NULL)
+	if (smb_info->sip != NULL && smb_info->sip->extra_info_type == SMB_EI_TRI)
 		tri = smb_info->sip->extra_info;
 	else
 		tri = NULL;
@@ -3655,9 +3691,16 @@
 		}
 
 		if (!pinfo->fd->flags.visited)
+		{
+			if (tri == NULL)
+				return FALSE;
 			tri->trans_subcmd = trans_subcmd;
-	} else
+		}
+	} else {
+		if(tri == NULL)
+			return FALSE;
 		trans_subcmd = tri->trans_subcmd;
+        }
 
 	if (tri == NULL) {
 		/*
--- ethereal-0.10.10.orig/epan/dissectors/packet-smb.c
+++ ethereal-0.10.10/epan/dissectors/packet-smb.c
@@ -3,7 +3,7 @@
  * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
  * 2001  Rewrite by Ronnie Sahlberg and Guy Harris
  *
- * $Id: packet-smb.c 13635 2005-03-06 20:13:58Z guy $
+ * $Id: packet-smb.c 14309 2005-05-04 19:58:41Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -754,6 +754,7 @@
 			bc=bc_remaining; \
 		} \
 		if(bc){ \
+			tvb_ensure_bytes_exist(tvb, offset, bc); \
 			proto_tree_add_text(tree, tvb, offset, bc, \
 			    "Extra byte parameters");		\
 		} \
@@ -834,6 +835,8 @@
 	more_frags=totlen>(pos+count);
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
+
 	if (si->sip == NULL) {
 		/*
 		 * We don't have the frame number of the request.
@@ -1441,10 +1444,7 @@
 	proto_tree *tree = NULL;
 
 	if (bytes != 2 && bytes != 4) {
-
-		fprintf(stderr, "Incorrect number of bytes passed to dissect_file_attributes.\nMust be 2 or 4, was %d\n", bytes);
-		exit(1);
-
+		THROW(ReportedBoundsError);
 	}
 
 	/*
@@ -1955,6 +1955,7 @@
 	BYTE_COUNT;
 
 	if(tree){
+		tvb_ensure_bytes_exist(tvb, offset, bc);
 		it = proto_tree_add_text(tree, tvb, offset, bc,
 				"Requested Dialects");
 		tr = proto_item_add_subtree(it, ett_smb_dialects);
@@ -1967,6 +1968,7 @@
 		proto_tree *dtr = NULL;
 
 		/* XXX - what if this runs past bc? */
+		tvb_ensure_bytes_exist(tvb, offset+1, 1);
 		len = tvb_strsize(tvb, offset+1);
 		str = tvb_get_ptr(tvb, offset+1, len);
 
@@ -2007,6 +2009,8 @@
 	guint32 caps=0;
 	gint16 tz;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* Dialect Index */
@@ -2033,6 +2037,7 @@
 			"Dialect Index: %u, greater than LANMAN2.1", dialect);
 		break;
 	default:
+		tvb_ensure_bytes_exist(tvb, offset, wc*2);
 		proto_tree_add_text(tree, tvb, offset, wc*2,
 			"Words for unknown response format");
 		offset += wc*2;
@@ -2307,6 +2312,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	BYTE_COUNT;
@@ -2410,6 +2417,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	BYTE_COUNT;
@@ -2626,6 +2635,8 @@
 	guint8 wc;
 	const char *fn;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* tid */
@@ -2695,6 +2706,8 @@
 	guint8 wc;
 	const char *fn;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* tid */
@@ -2764,6 +2777,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* # of files moved */
@@ -2800,6 +2815,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* desired access */
@@ -2907,6 +2924,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* file attributes */
@@ -2973,6 +2992,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* search attributes */
@@ -3013,6 +3034,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* search attributes */
@@ -3072,6 +3095,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* search attributes */
@@ -3138,6 +3163,8 @@
 	const char *fn;
 	int fn_len;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	BYTE_COUNT;
@@ -3204,6 +3231,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* file attributes */
@@ -3260,7 +3289,11 @@
 	if (!pinfo->fd->flags.visited) {
 		/* remember the FID for the processing of the response */
 		si = (smb_info_t *)pinfo->private_data;
-		si->sip->extra_info=GUINT_TO_POINTER(fid);
+		if (!si) THROW(DissectorError);
+		if (si->sip) {
+			si->sip->extra_info=GUINT_TO_POINTER(fid);
+			si->sip->extra_info_type=SMB_EI_FID;
+		}
 	}
 
 	/* read count */
@@ -3353,6 +3386,8 @@
 {
 	smb_info_t *si = (smb_info_t *)pinfo->private_data;
 
+	if (!si) THROW(DissectorError);
+
 	if( (si->sip && si->sip->flags&SMB_SIF_TID_IS_IPC) && (ofs==0) ){
 		/* dcerpc call */
 		return dissect_file_data_dcerpc(tvb, pinfo, tree,
@@ -3371,6 +3406,8 @@
 	smb_info_t *si = (smb_info_t *)pinfo->private_data;
 	int fid=0;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* read count */
@@ -3384,7 +3421,7 @@
 
 	/* If we have seen the request, then print which FID this refers to */
 	/* first check if we have seen the request */
-	if(si->sip != NULL && si->sip->frame_req>0){
+	if(si->sip != NULL && si->sip->frame_req>0 && si->sip->extra_info_type == SMB_EI_FID){
 		fid=GPOINTER_TO_INT(si->sip->extra_info);
 		add_fid(tvb, pinfo, tree, 0, 0, (guint16) fid);
 	}
@@ -3566,6 +3603,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* 2 reserved bytes */
@@ -3610,6 +3649,8 @@
 	guint8 wc;
 	guint16 bc, fid;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* fid */
@@ -4256,6 +4297,8 @@
 	const char *fn;
 	char fname[11+1];
 
+	if (!si) THROW(DissectorError);
+
 	if(parent_tree){
 		item = proto_tree_add_text(parent_tree, tvb, offset, 21,
 			"Resume Key");
@@ -4316,6 +4359,8 @@
 	const char *fn;
 	char fname[13+1];
 
+	if (!si) THROW(DissectorError);
+
 	if(parent_tree){
 		item = proto_tree_add_text(parent_tree, tvb, offset, 46,
 			"Directory Information");
@@ -4376,6 +4421,8 @@
 	guint16 bc;
 	gboolean trunc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* max count */
@@ -4953,6 +5000,8 @@
 	int fn_len;
 	const char *fn;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* next smb command */
@@ -5190,7 +5239,11 @@
 	if (!pinfo->fd->flags.visited) {
 		/* remember the FID for the processing of the response */
 		si = (smb_info_t *)pinfo->private_data;
-		si->sip->extra_info=GUINT_TO_POINTER(fid);
+		if (!si) THROW(DissectorError);
+		if (si->sip) {
+			si->sip->extra_info=GUINT_TO_POINTER(fid);
+			si->sip->extra_info_type=SMB_EI_FID;
+		}
 	}
 
 	/* offset */
@@ -5277,6 +5330,8 @@
 	smb_info_t *si = (smb_info_t *)pinfo->private_data;
 	int fid=0;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* next smb command */
@@ -5299,7 +5354,7 @@
 
 	/* If we have seen the request, then print which FID this refers to */
 	/* first check if we have seen the request */
-	if(si->sip != NULL && si->sip->frame_req>0){
+	if(si->sip != NULL && si->sip->frame_req>0 && si->sip->extra_info_type==SMB_EI_FID){
 		fid=GPOINTER_TO_INT(si->sip->extra_info);
 		add_fid(tvb, pinfo, tree, 0, 0, (guint16) fid);
 	}
@@ -5378,6 +5433,8 @@
 	unsigned int fid=0;
 	guint16 mode = 0;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* next smb command */
@@ -5404,7 +5461,10 @@
 	offset += 2;
 	if (!pinfo->fd->flags.visited) {
 		/* remember the FID for the processing of the response */
-		si->sip->extra_info=GUINT_TO_POINTER(fid);
+		if (si->sip) {
+			si->sip->extra_info=GUINT_TO_POINTER(fid);
+			si->sip->extra_info_type=SMB_EI_FID;
+		}
 	}
 
 	/* offset */
@@ -5532,8 +5592,9 @@
 
 	/* If we have seen the request, then print which FID this refers to */
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
 	/* first check if we have seen the request */
-	if(si->sip != NULL && si->sip->frame_req>0){
+	if(si->sip != NULL && si->sip->frame_req>0 && si->sip->extra_info_type==SMB_EI_FID){
 		add_fid(tvb, pinfo, tree, 0, 0, (guint16) GPOINTER_TO_UINT(si->sip->extra_info));
 	}
 
@@ -5619,6 +5680,8 @@
 	guint16 apwlen=0, upwlen=0;
 	gboolean unicodeflag;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* next smb command */
@@ -5950,6 +6013,8 @@
 	int an_len;
 	const char *an;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* next smb command */
@@ -6171,6 +6236,8 @@
 	int an_len;
 	const char *an;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* next smb command */
@@ -6255,6 +6322,8 @@
 	const char *an;
 	smb_info_t *si = pinfo->private_data;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	wleft = wc;	/* this is at least 1 */
@@ -7162,7 +7231,10 @@
 
 	si = (smb_info_t *)pinfo->private_data;
 
+	if (!si) THROW(DissectorError);
+
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, bc);
 		item = proto_tree_add_text(parent_tree, tvb, offset, bc,
 				"%s Data",
 				val_to_str(ntd->subcmd, nt_cmd_vals, "Unknown NT transaction (%u)"));
@@ -7240,6 +7312,8 @@
 
 	si = (smb_info_t *)pinfo->private_data;
 
+	if (!si) THROW(DissectorError);
+
 	if(parent_tree){
 		item = proto_tree_add_text(parent_tree, tvb, offset, len,
 				"%s Parameters",
@@ -7373,7 +7447,10 @@
 
 	si = (smb_info_t *)pinfo->private_data;
 
+	if (!si) THROW(DissectorError);
+
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, len);
 		item = proto_tree_add_text(parent_tree, tvb, offset, len,
 				"%s Setup",
 				val_to_str(ntd->subcmd, nt_cmd_vals, "Unknown NT transaction (%u)"));
@@ -7458,6 +7535,7 @@
 	smb_nt_transact_info_t *nti;
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
 	sip = si->sip;
 
 	WORD_COUNT;
@@ -7562,7 +7640,7 @@
 		}
 		ntd.subcmd = subcmd;
 		if (!si->unidir) {
-			if(!pinfo->fd->flags.visited){
+			if(!pinfo->fd->flags.visited && sip){
 				/*
 				 * Allocate a new smb_nt_transact_info_t
 				 * structure.
@@ -7570,6 +7648,7 @@
 				nti = g_mem_chunk_alloc(smb_nt_transact_info_chunk);
 				nti->subcmd = subcmd;
 				sip->extra_info = nti;
+				sip->extra_info_type = SMB_EI_NTI;
 			}
 		}
 	} else {
@@ -7647,12 +7726,15 @@
 	guint16 bcp;
 
 	si = (smb_info_t *)pinfo->private_data;
-	if (si->sip != NULL)
+	if (!si) THROW(DissectorError);
+
+	if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_NTI)
 		nti = si->sip->extra_info;
 	else
 		nti = NULL;
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, len);
 		if(nti != NULL){
 			item = proto_tree_add_text(parent_tree, tvb, offset, len,
 				"%s Data",
@@ -7727,12 +7809,15 @@
 	int padcnt;
 
 	si = (smb_info_t *)pinfo->private_data;
-	if (si->sip != NULL)
+	if (!si) THROW(DissectorError);
+
+	if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_NTI)
 		nti = si->sip->extra_info;
 	else
 		nti = NULL;
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, len);
 		if(nti != NULL){
 			item = proto_tree_add_text(parent_tree, tvb, offset, len,
 				"%s Parameters",
@@ -7914,12 +7999,15 @@
 	smb_nt_transact_info_t *nti;
 
 	si = (smb_info_t *)pinfo->private_data;
-	if (si->sip != NULL)
+	if (!si) THROW(DissectorError);
+
+	if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_NTI)
 		nti = si->sip->extra_info;
 	else
 		nti = NULL;
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, len);
 		if(nti != NULL){
 			item = proto_tree_add_text(parent_tree, tvb, offset, len,
 				"%s Setup",
@@ -7980,7 +8068,9 @@
 	gboolean save_fragmented;
 
 	si = (smb_info_t *)pinfo->private_data;
-	if (si->sip != NULL)
+	if (!si) THROW(DissectorError);
+
+	if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_NTI)
 		nti = si->sip->extra_info;
 	else
 		nti = NULL;
@@ -8112,6 +8202,7 @@
 	    padcnt = po-offset;
 	    if (padcnt > bc)
 	      padcnt = bc;
+	    tvb_ensure_bytes_exist(tvb, offset, padcnt);
 	    proto_tree_add_item(tree, hf_smb_padding, tvb, offset, padcnt, TRUE);
 	    COUNT_BYTES(padcnt);
 	  }
@@ -8163,6 +8254,8 @@
 	guint8 wc;
 	guint16 bc;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* setup len */
@@ -8273,6 +8366,8 @@
 	int fn_len;
 	const char *fn;
 
+	if (!si) THROW(DissectorError);
+
 	if(parent_tree){
 		item = proto_tree_add_text(parent_tree, tvb, offset, 28,
 			"Queue entry");
@@ -8589,6 +8684,8 @@
 	int fn_len;
 	const char *fn;
 
+	if (!si) THROW(DissectorError);
+
 	WORD_COUNT;
 
 	/* next smb command */
@@ -9122,7 +9219,9 @@
 	mask = tvb_get_letohs(tvb, offset);
 
 	si = (smb_info_t *)pinfo->private_data;
-	if (si->sip != NULL) {
+	if (!si) THROW(DissectorError);
+
+	if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_T2I) {
 		t2i = si->sip->extra_info;
 		if (t2i != NULL) {
 			if (!pinfo->fd->flags.visited)
@@ -9191,12 +9290,15 @@
 	const char *fn;
 
 	si = (smb_info_t *)pinfo->private_data;
-	if (si->sip != NULL)
+	if (!si) THROW(DissectorError);
+
+	if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_T2I)
 		t2i = si->sip->extra_info;
 	else
 		t2i = NULL;
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, bc);
 		item = proto_tree_add_text(parent_tree, tvb, offset, bc,
 				"%s Parameters",
 				val_to_str(subcmd, trans2_cmd_vals,
@@ -9280,7 +9382,7 @@
 		/* Find First2 information level */
 		CHECK_BYTE_COUNT_TRANS(2);
 		si->info_level = tvb_get_letohs(tvb, offset);
-		if (!pinfo->fd->flags.visited)
+		if (t2i != NULL && !pinfo->fd->flags.visited)
 			t2i->info_level = si->info_level;
 		proto_tree_add_uint(tree, hf_smb_ff2_information_level, tvb, offset, 2, si->info_level);
 		COUNT_BYTES_TRANS(2);
@@ -9317,7 +9419,7 @@
 		/* Find First2 information level */
 		CHECK_BYTE_COUNT_TRANS(2);
 		si->info_level = tvb_get_letohs(tvb, offset);
-		if (!pinfo->fd->flags.visited)
+		if (t2i != NULL && !pinfo->fd->flags.visited)
 			t2i->info_level = si->info_level;
 		proto_tree_add_uint(tree, hf_smb_ff2_information_level, tvb, offset, 2, si->info_level);
 		COUNT_BYTES_TRANS(2);
@@ -9349,7 +9451,7 @@
 		/* level of interest */
 		CHECK_BYTE_COUNT_TRANS(2);
 		si->info_level = tvb_get_letohs(tvb, offset);
-		if (!pinfo->fd->flags.visited)
+		if (t2i != NULL && !pinfo->fd->flags.visited)
 			t2i->info_level = si->info_level;
 		proto_tree_add_uint(tree, hf_smb_qfsi_information_level, tvb, offset, 2, si->info_level);
 		COUNT_BYTES_TRANS(2);
@@ -9364,7 +9466,7 @@
 		/* level of interest */
 		CHECK_BYTE_COUNT_TRANS(2);
 		si->info_level = tvb_get_letohs(tvb, offset);
-		if (!pinfo->fd->flags.visited)
+		if (t2i != NULL && !pinfo->fd->flags.visited)
 			t2i->info_level = si->info_level;
 		proto_tree_add_uint(tree, hf_smb_qpi_loi, tvb, offset, 2, si->info_level);
 		COUNT_BYTES_TRANS(2);
@@ -9398,7 +9500,7 @@
 		/* level of interest */
 		CHECK_BYTE_COUNT_TRANS(2);
 		si->info_level = tvb_get_letohs(tvb, offset);
-		if (!pinfo->fd->flags.visited)
+		if (t2i != NULL && !pinfo->fd->flags.visited)
 			t2i->info_level = si->info_level;
 		proto_tree_add_uint(tree, hf_smb_spi_loi, tvb, offset, 2, si->info_level);
 		COUNT_BYTES_TRANS(2);
@@ -9433,7 +9535,7 @@
 		/* level of interest */
 		CHECK_BYTE_COUNT_TRANS(2);
 		si->info_level = tvb_get_letohs(tvb, offset);
-		if (!pinfo->fd->flags.visited)
+		if (t2i != NULL && !pinfo->fd->flags.visited)
 			t2i->info_level = si->info_level;
 		proto_tree_add_uint(tree, hf_smb_qpi_loi, tvb, offset, 2, si->info_level);
 		COUNT_BYTES_TRANS(2);
@@ -9459,7 +9561,7 @@
 		/* level of interest */
 		CHECK_BYTE_COUNT_TRANS(2);
 		si->info_level = tvb_get_letohs(tvb, offset);
-		if (!pinfo->fd->flags.visited)
+		if (t2i != NULL && !pinfo->fd->flags.visited)
 			t2i->info_level = si->info_level;
 		proto_tree_add_uint(tree, hf_smb_spi_loi, tvb, offset, 2, si->info_level);
 		COUNT_BYTES_TRANS(2);
@@ -9528,7 +9630,7 @@
 		/* Find Notify information level */
 		CHECK_BYTE_COUNT_TRANS(2);
 		si->info_level = tvb_get_letohs(tvb, offset);
-		if (!pinfo->fd->flags.visited)
+		if (t2i != NULL && !pinfo->fd->flags.visited)
 			t2i->info_level = si->info_level;
 		proto_tree_add_uint(tree, hf_smb_fn_information_level, tvb, offset, 2, si->info_level);
 		COUNT_BYTES_TRANS(2);
@@ -9716,6 +9818,8 @@
 	int fn_len;
 	const char *fn;
 
+	if (!si) THROW(DissectorError);
+
 	/*XXX shouldn this data hold version and size? unclear from doc*/
 	/* referral version */
 	CHECK_BYTE_COUNT_TRANS_SUBR(2);
@@ -9768,6 +9872,8 @@
 	int ucstring_end;
 	int ucstring_len;
 
+	if (!si) THROW(DissectorError);
+
 	/* path consumed */
 	CHECK_BYTE_COUNT_TRANS_SUBR(2);
 	proto_tree_add_item(tree, hf_smb_dfs_path_consumed, tvb, offset, 2, TRUE);
@@ -9798,6 +9904,7 @@
 		int old_offset=offset;
 
 		if(tree){
+			tvb_ensure_bytes_exist(tvb, offset, *bcp);
 			ref_item = proto_tree_add_text(tree,
 				tvb, offset, *bcp, "Referrals");
 			ref_tree = proto_item_add_subtree(ref_item,
@@ -9812,6 +9919,7 @@
 			guint16 version;
 
 			if(tree){
+				tvb_ensure_bytes_exist(tvb, offset, *bcp);
 				ri = proto_tree_add_text(ref_tree,
 					tvb, offset, *bcp, "Referral");
 				rt = proto_item_add_subtree(ri,
@@ -10153,6 +10261,8 @@
 	int fn_len;
 	const char *fn;
 
+	if (!si) THROW(DissectorError);
+
 	/* file name */
 	fn = get_unicode_or_ascii_string(tvb, &offset, si->unicode, &fn_len, FALSE, FALSE, bcp);
 	CHECK_STRING_SUBR(fn);
@@ -10251,6 +10361,8 @@
 	int fn_len;
 	const char *fn;
 
+	if (!si) THROW(DissectorError);
+
 	/* file name len */
 	CHECK_BYTE_COUNT_SUBR(4);
 	proto_tree_add_item(tree, hf_smb_file_name_len, tvb, offset, 4, TRUE);
@@ -10339,12 +10451,15 @@
 	const char *fn;
 	int padcnt;
 
+	if (!si) THROW(DissectorError);
+
 	for (;;) {
 		old_offset = offset;
 
 		/* next entry offset */
 		CHECK_BYTE_COUNT_SUBR(4);
 		if(parent_tree){
+			tvb_ensure_bytes_exist(tvb, offset, *bcp);
 			item = proto_tree_add_text(parent_tree, tvb, offset, *bcp, "Stream Info");
 			tree = proto_item_add_subtree(item, ett_smb_ff2_data);
 		} else {
@@ -10544,6 +10659,8 @@
 	const char *fn;
 	int fn_len;
 
+	if (!si) THROW(DissectorError);
+
 	/* Link destination */
 
 	fn = get_unicode_or_ascii_string(
@@ -10659,6 +10776,8 @@
 	guint32 target_name_len;
 	int fn_len;
 
+	if (!si) THROW(DissectorError);
+
 	/* Replace flag */
 	CHECK_BYTE_COUNT_SUBR(4);
 	proto_tree_add_item(tree, hf_smb_replace, tvb, offset, 4, TRUE);
@@ -10703,6 +10822,8 @@
 	}
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
+
 	switch(si->info_level){
 	case 1:		/*Info Standard*/
 		offset = dissect_4_2_16_1(tvb, pinfo, tree, offset, bcp,
@@ -10796,6 +10917,8 @@
 	}
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
+
 	switch(si->info_level){
 	case 1:		/*Info Standard*/
 		offset = dissect_4_2_16_1(tvb, pinfo, tree, offset, bcp,
@@ -10952,8 +11075,10 @@
 	smb_info_t *si;
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, dc);
 		item = proto_tree_add_text(parent_tree, tvb, offset, dc,
 				"%s Data",
 				val_to_str(subcmd, trans2_cmd_vals,
@@ -11150,6 +11275,7 @@
 	gboolean dissected_trans;
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
 
 	WORD_COUNT;
 
@@ -11311,7 +11437,7 @@
 						"Unknown (0x%02x)"));
 				}
 				if (!si->unidir) {
-					if(!pinfo->fd->flags.visited){
+					if(!pinfo->fd->flags.visited && si->sip){
 						/*
 						 * Allocate a new
 						 * smb_transact2_info_t
@@ -11322,6 +11448,7 @@
 						t2i->info_level = -1;
 						t2i->resume_keys = FALSE;
 						si->sip->extra_info = t2i;
+						si->sip->extra_info_type = SMB_EI_T2I;
 					}
 				}
 
@@ -11351,6 +11478,7 @@
 				si->unicode, &an_len, FALSE, FALSE, &bc);
 			if (an == NULL)
 				goto endofcommand;
+			tvb_ensure_bytes_exist(tvb, offset, an_len);
 			proto_tree_add_string(tree, hf_smb_trans_name, tvb,
 				offset, an_len, an);
 			COUNT_BYTES(an_len);
@@ -11373,6 +11501,7 @@
 		padcnt = po-offset;
 		if (padcnt > bc)
 			padcnt = bc;
+		tvb_ensure_bytes_exist(tvb, offset, padcnt);
 		proto_tree_add_item(tree, hf_smb_padding, tvb, offset, padcnt, TRUE);
 		COUNT_BYTES(padcnt);
 	}
@@ -11401,6 +11530,7 @@
 		padcnt = od-offset;
 		if (padcnt > bc)
 			padcnt = bc;
+		tvb_ensure_bytes_exist(tvb, offset, padcnt);
 		proto_tree_add_item(tree, hf_smb_padding, tvb, offset, padcnt, TRUE);
 		COUNT_BYTES(padcnt);
 	}
@@ -11459,7 +11589,7 @@
 			}
 
 			if (!si->unidir) {
-				if(!pinfo->fd->flags.visited){
+				if(!pinfo->fd->flags.visited && si->sip){
 					/*
 					 * Allocate a new smb_transact_info_t
 					 * structure.
@@ -11475,6 +11605,7 @@
 					tri->aux_data_descrip = NULL;
 					tri->info_level = -1;
 					si->sip->extra_info = tri;
+					si->sip->extra_info_type = SMB_EI_TRI;
 				} else {
 					/*
 					 * We already filled the structure
@@ -11492,6 +11623,8 @@
 				tri = NULL;
 			}
 			dissected_trans = FALSE;
+			if (an == NULL)
+				goto endofcommand;
 			if(strncmp("\\PIPE\\", an, 6) == 0){
 				if (tri != NULL)
 					tri->subcmd=TRANSACTION_PIPE;
@@ -11564,13 +11697,16 @@
 	gboolean resume_keys = FALSE;
 
 	si = (smb_info_t *)pinfo->private_data;
-	if (si->sip != NULL) {
+	if (!si) THROW(DissectorError);
+
+	if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_T2I) {
 		t2i = si->sip->extra_info;
 		if (t2i != NULL)
 			resume_keys = t2i->resume_keys;
 	}
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, *bcp);
 		item = proto_tree_add_text(parent_tree, tvb, offset, *bcp, "%s",
 		    val_to_str(si->info_level, ff2_il_vals, "Unknown (0x%02x)"));
 		tree = proto_item_add_subtree(item, ett_smb_ff2_data);
@@ -11662,13 +11798,16 @@
 	gboolean resume_keys = FALSE;
 
 	si = (smb_info_t *)pinfo->private_data;
-	if (si->sip != NULL) {
+	if (!si) THROW(DissectorError);
+
+	if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_T2I) {
 		t2i = si->sip->extra_info;
 		if (t2i != NULL)
 			resume_keys = t2i->resume_keys;
 	}
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, *bcp);
 		item = proto_tree_add_text(parent_tree, tvb, offset, *bcp, "%s",
 		    val_to_str(si->info_level, ff2_il_vals, "Unknown (0x%02x)"));
 		tree = proto_item_add_subtree(item, ett_smb_ff2_data);
@@ -11765,8 +11904,10 @@
 	int padcnt;
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, *bcp);
 		item = proto_tree_add_text(parent_tree, tvb, offset, *bcp, "%s",
 		    val_to_str(si->info_level, ff2_il_vals, "Unknown (0x%02x)"));
 		tree = proto_item_add_subtree(item, ett_smb_ff2_data);
@@ -11862,8 +12003,10 @@
 	int padcnt;
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, *bcp);
 		item = proto_tree_add_text(parent_tree, tvb, offset, *bcp, "%s",
 		    val_to_str(si->info_level, ff2_il_vals, "Unknown (0x%02x)"));
 		tree = proto_item_add_subtree(item, ett_smb_ff2_data);
@@ -11965,8 +12108,10 @@
 	int padcnt;
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, *bcp);
 		item = proto_tree_add_text(parent_tree, tvb, offset, *bcp, "%s",
 		    val_to_str(si->info_level, ff2_il_vals, "Unknown (0x%02x)"));
 		tree = proto_item_add_subtree(item, ett_smb_ff2_data);
@@ -12094,8 +12239,10 @@
 	int padcnt;
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
 
 	if(parent_tree){
+		tvb_ensure_bytes_exist(tvb, offset, *bcp);
 		item = proto_tree_add_text(parent_tree, tvb, offset, *bcp, "%s",
 		    val_to_str(si->info_level, ff2_il_vals, "Unknown (0x%02x)"));
 		tree = proto_item_add_subtree(item, ett_smb_ff2_data);
@@ -12168,6 +12315,8 @@
 	const char *fn;
 	int fn_len;
 
+	if (!si) THROW(DissectorError);
+
 	/* NextEntryOffset */
 	CHECK_BYTE_COUNT_SUBR(4);
 	proto_tree_add_item(tree, hf_smb_unix_find_file_nextoffset, tvb, offset, 4, TRUE);
@@ -12274,6 +12423,8 @@
 	}
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
+
 	switch(si->info_level){
 	case 1:		/*Info Standard*/
 		offset = dissect_4_3_4_1(tvb, pinfo, tree, offset, bcp,
@@ -12461,6 +12612,8 @@
 	}
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
+
 	switch(si->info_level){
 	case 1:		/* SMB_INFO_ALLOCATION */
 		/* filesystem id */
@@ -12814,7 +12967,9 @@
 	dc = tvb_reported_length(tvb);
 
 	si = (smb_info_t *)pinfo->private_data;
-	if (si->sip != NULL)
+	if (!si) THROW(DissectorError);
+
+	if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_T2I)
 		t2i = si->sip->extra_info;
 	else
 		t2i = NULL;
@@ -12860,6 +13015,12 @@
 		/* returned data */
 		count = si->info_count;
 
+        if(count == -1) {
+            break;
+        }
+        if(count == -1) {
+            break;
+        }
 		if (count && check_col(pinfo->cinfo, COL_INFO)) {
 			col_append_fstr(pinfo->cinfo, COL_INFO,
 			", Files:");
@@ -12981,7 +13142,9 @@
 	pc = tvb_reported_length(tvb);
 
 	si = (smb_info_t *)pinfo->private_data;
-	if (si->sip != NULL)
+	if (!si) THROW(DissectorError);
+
+	if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_T2I)
 		t2i = si->sip->extra_info;
 	else
 		t2i = NULL;
@@ -13240,11 +13403,12 @@
 	gboolean save_fragmented;
 
 	si = (smb_info_t *)pinfo->private_data;
+	if (!si) THROW(DissectorError);
 
 	switch(si->cmd){
 	case SMB_COM_TRANSACTION2:
 		/* transaction2 */
-		if (si->sip != NULL) {
+		if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_T2I) {
 			t2i = si->sip->extra_info;
 		} else
 			t2i = NULL;
@@ -13490,7 +13654,7 @@
 		smb_transact_info_t *tri;
 
 		dissected_trans = FALSE;
-		if (si->sip != NULL)
+		if (si->sip != NULL && si->sip->extra_info_type == SMB_EI_TRI)
 			tri = si->sip->extra_info;
 		else
 			tri = NULL;
@@ -13577,6 +13741,7 @@
 	WORD_COUNT;
 
 	if (wc != 0) {
+		tvb_ensure_bytes_exist(tvb, offset, wc*2);
 		proto_tree_add_text(tree, tvb, offset, wc*2, "Word parameters");
 		offset += wc*2;
 	}
@@ -13584,6 +13749,7 @@
 	BYTE_COUNT;
 
 	if (bc != 0) {
+		tvb_ensure_bytes_exist(tvb, offset, bc);
 		proto_tree_add_text(tree, tvb, offset, bc, "Byte parameters");
 		offset += bc;
 		bc = 0;
@@ -13879,6 +14045,8 @@
 	smb_info_t *si;
 
 	si = pinfo->private_data;
+	if (!si) THROW(DissectorError);
+
 	if(cmd!=0xff){
 		proto_item *cmd_item;
 		proto_tree *cmd_tree;
@@ -14829,6 +14997,7 @@
 				}
 				sip->cmd = si->cmd;
 				sip->extra_info = NULL;
+				sip->extra_info_type = SMB_EI_NONE;
 				g_hash_table_insert(si->ct->unmatched, GUINT_TO_POINTER(pid_mid), sip);
 				new_key = g_mem_chunk_alloc(smb_saved_info_key_chunk);
 				new_key->frame = sip->frame_req;
--- ethereal-0.10.10.orig/epan/dissectors/packet-smpp.c
+++ ethereal-0.10.10/epan/dissectors/packet-smpp.c
@@ -1692,6 +1692,9 @@
 	    gint pdu_real_len = tvb_length_remaining(tvb, offset);
     	    tvbuff_t *pdu_tvb;
 
+            if (pdu_len < 1)
+                THROW(ReportedBoundsError);
+
 	    if (pdu_real_len <= 0)
 		return;
 	    if (pdu_real_len > pdu_len)
--- ethereal-0.10.10.orig/epan/dissectors/packet-sna.c
+++ ethereal-0.10.10/epan/dissectors/packet-sna.c
@@ -3,7 +3,7 @@
  * Gilbert Ramirez <gram@alumni.rice.edu>
  * Jochen Friedrich <jochen@scram.de>
  *
- * $Id: packet-sna.c 13366 2005-02-09 23:38:00Z lroland $
+ * $Id: packet-sna.c 13933 2005-03-27 12:28:03Z ulfl $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -2384,9 +2384,12 @@
 		if (len) {
 			dissect_control(tvb, offset, len, tree, hpr, parse);
 			pad = (len+3) & 0xfffc;
-			if (pad > len)
+            if (pad > len) {
+                /* XXX - fix this, ensure tvb is large enough for pad */
+                tvb_ensure_bytes_exist(tvb, offset+len, pad-len);
 				proto_tree_add_text(tree, tvb, offset+len,
 				    pad-len, "Padding");
+            }
 			offset += pad;
 		} else {
 			return;
--- ethereal-0.10.10.orig/epan/dissectors/packet-sndcp.c
+++ ethereal-0.10.10/epan/dissectors/packet-sndcp.c
@@ -199,7 +199,7 @@
   guint8         addr_field, comp_field, npdu_field1, nsapi, dcomp=0, pcomp=0;
   guint16        offset=0, npdu=0, segment=0, npdu_field2;
   tvbuff_t	*next_tvb, *npdu_tvb;
-  guint32        len;
+  gint           len;
   gboolean       first, more_frags, unack;
 
   /* Set up structures needed to add the protocol subtree and manage it 
@@ -328,6 +328,10 @@
     gboolean        save_fragmented = pinfo->fragmented;
     
     len = tvb_length_remaining(tvb, offset);
+    if(len<=0){
+        return;
+    }
+
     pinfo->fragmented = TRUE;
 
     if (unack) 
--- ethereal-0.10.10.orig/epan/dissectors/packet-snmp.c
+++ ethereal-0.10.10/epan/dissectors/packet-snmp.c
@@ -589,7 +589,7 @@
 	oid_string = g_malloc(oid_string_len);
 	*oid_string = '\0';
 	oid_out_len = 0;
-	sprint_realloc_objid(&oid_string, &oid_string_len, &oid_out_len, 1,
+	sprint_realloc_objid(&oid_string, &oid_string_len, &oid_out_len, TRUE,
 	    oid, oid_length);
 	result_len += strlen(oid_string) + 3;
 #endif
@@ -638,7 +638,7 @@
 	oid_string = g_malloc(oid_string_len);
 	*oid_string = '\0';
 	oid_out_len = 0;
-	sprint_realloc_objid(&oid_string, &oid_string_len, &oid_out_len, 1,
+	sprint_realloc_objid(&oid_string, &oid_string_len, &oid_out_len, TRUE,
 			     oid, oid_length);
 	*decoded = oid_string;
 #else
@@ -761,7 +761,7 @@
 	buf = g_malloc(buf_len);
 	*buf = '\0';
 	out_len = 0;
-	sprint_realloc_value(&buf, &buf_len, &out_len, 1,  variable_oid,
+	sprint_realloc_value(&buf, &buf_len, &out_len, TRUE,  variable_oid,
 	    variable_oid_length, variable);
 	return buf;
 }
--- ethereal-0.10.10.orig/epan/dissectors/packet-spnego.c
+++ ethereal-0.10.10/epan/dissectors/packet-spnego.c
@@ -730,11 +730,11 @@
 				ek->key.keyblock.keyvalue.length,
 				ek->key.keyblock.keytype
 					    );
-		if (ret == 0) {
+		if (ret >= 0) {
 			proto_tree_add_text(tree, NULL, 0, 0, "[Decrypted using: %s]", ek->key_origin);
 			pinfo->gssapi_decrypted_tvb=tvb_new_real_data(
 				output_message_buffer,
-				length, length);
+				ret, ret);
 			tvb_set_child_real_data_tvbuff(tvb, pinfo->gssapi_decrypted_tvb);
 			add_new_data_source(pinfo, pinfo->gssapi_decrypted_tvb, "Decrypted GSS-Krb5");
 			return;
--- ethereal-0.10.10.orig/epan/dissectors/packet-srvloc.c
+++ ethereal-0.10.10/epan/dissectors/packet-srvloc.c
@@ -9,7 +9,7 @@
  *       In particular I have not had an opportunity to see how it
  *       responds to SRVLOC over TCP.
  *
- * $Id: packet-srvloc.c 13366 2005-02-09 23:38:00Z lroland $
+ * $Id: packet-srvloc.c 14182 2005-04-25 03:02:50Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -381,10 +381,13 @@
 dissect_authblk_v2(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
     guint16 length;
+    nstime_t ts;
     
     proto_tree_add_item(tree, hf_srvloc_authblkv2_bsd, tvb, offset, 2, FALSE);
     proto_tree_add_item(tree, hf_srvloc_authblkv2_len, tvb, offset+2, 2, FALSE);
-    proto_tree_add_item(tree, hf_srvloc_authblkv2_timestamp, tvb, offset+4, 4, FALSE);
+    ts.nsecs = 0;
+    ts.secs = tvb_get_ntohl(tvb, offset + 4);
+    proto_tree_add_time(tree, hf_srvloc_authblkv2_timestamp, tvb, offset+4, 4, &ts);
     length = tvb_get_ntohs(tvb, offset + 8);
     proto_tree_add_uint(tree, hf_srvloc_authblkv2_slpspilen, tvb, offset + 8, 2, length);
     offset += 10;
@@ -427,10 +430,14 @@
 unicode_to_bytes(tvbuff_t *tvb, int offset, int length, gboolean endianness)
 {
   const char	*ascii_text = tvb_get_ptr(tvb, offset, length);
-  guint8	i, j=0;
+  int	i, j=0;
   guint8	c_char, c_char1;
   static guint8 byte_array[255];
 
+  /* XXX - Is this the correct behavior? */
+  if (length < 1)
+    return "";
+
   if (endianness) {
       for (i = length; i > 0; i--) {
         c_char = ascii_text[i];
--- ethereal-0.10.10.orig/epan/dissectors/packet-ssh.c
+++ ethereal-0.10.10/epan/dissectors/packet-ssh.c
@@ -350,6 +350,7 @@
 			}
 		}
 
+                DISSECTOR_ASSERT(offset > last_offset);
 		if(need_desegmentation) return;
 	}
 }
--- ethereal-0.10.10.orig/epan/dissectors/packet-tcap.c
+++ ethereal-0.10.10/epan/dissectors/packet-tcap.c
@@ -9,7 +9,7 @@
  *
  * (append your name here for newer version)
  *
- * $Id: packet-tcap.c 13366 2005-02-09 23:38:00Z lroland $
+ * $Id: packet-tcap.c 14297 2005-05-03 18:40:06Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -196,6 +196,7 @@
 tcap_find_eoc(ASN1_SCK *asn1)
 {
     guint	saved_offset;
+    gint        prev_offset;
     guint	tag;
     guint	len;
     gboolean	def_len;
@@ -204,6 +205,7 @@
 
     while (!asn1_eoc(asn1, -1))
     {
+	prev_offset = asn1->offset;
 	asn1_id_decode1(asn1, &tag);
 	asn1_length_decode(asn1, &def_len, &len);
 
@@ -216,6 +218,8 @@
 	    asn1->offset += tcap_find_eoc(asn1);
 	    asn1_eoc_decode(asn1, -1);
 	}
+	if (prev_offset >= asn1->offset)
+	    THROW(ReportedBoundsError);
     }
 
     len = asn1->offset - saved_offset;
@@ -501,7 +505,7 @@
 static int
 dissect_tcap_param(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
 {
-    guint orig_offset, saved_offset, len_offset;
+    gint orig_offset, saved_offset, len_offset;
     guint tag, len;
     gboolean def_len;
     proto_item *item;
@@ -592,6 +596,8 @@
 	    asn1->offset, len, "Parameter Data");
 
 	asn1->offset += len;
+	if (saved_offset >= asn1->offset)
+	    THROW(ReportedBoundsError);
     }
 
     return TC_DS_OK;
@@ -1496,7 +1502,7 @@
 {
     proto_tree	*subtree;
     proto_item	*comps_item;
-    guint	saved_offset, comps_start;
+    gint	saved_offset, comps_start;
     guint	len, comp_len;
     gint	keep_len;
     gboolean	comps_def_len, def_len;
@@ -1598,6 +1604,8 @@
 		break;
 	    }
 	}
+	if (saved_offset >= asn1->offset)
+	    THROW(ReportedBoundsError);
     }
 
     if (!comps_def_len)
@@ -1647,7 +1655,7 @@
     guint name_len, len, len2;
     guint tag;
     subid_t *oid;
-	char oid_str[64]; /*64 chars should be long enough? */
+    char oid_str[BER_MAX_OID_STR_LEN];
     int ret;
     gboolean def_len;
 
@@ -1818,7 +1826,7 @@
 	int ret;
 	proto_item *para_item;
 	proto_tree *sub_tree;
-	char oid_str[64]; /*64 chars should be long enough? */
+	char oid_str[BER_MAX_OID_STR_LEN];
 	tvbuff_t *next_tvb;
 
 #define TC_USR_INFO_TAG 0xbe
@@ -2041,6 +2049,7 @@
 
     if (portion_def_len)
     {
+	tvb_ensure_bytes_exist(asn1->tvb, saved_offset, len);
 	proto_item_set_len(dlg_item, len);
     }
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-telnet.c
+++ ethereal-0.10.10/epan/dissectors/packet-telnet.c
@@ -2,7 +2,7 @@
  * Routines for Telnet packet dissection; see RFC 854 and RFC 855
  * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
  *
- * $Id: packet-telnet.c 11482 2004-07-23 08:36:07Z guy $
+ * $Id: packet-telnet.c 13740 2005-03-13 07:53:19Z guy $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1166,7 +1166,7 @@
   guint8 opt_byte;
   int subneg_len;
   const char *opt;
-  gint ett;
+  gint ett = ett_telnet_subopt;
   int iac_offset;
   guint len;
   void (*dissect)(packet_info *, const char *, tvbuff_t *, int, int, proto_tree *);
@@ -1177,16 +1177,13 @@
 
   /* Get the option code */
   opt_byte = tvb_get_guint8(tvb, offset);
-  if (opt_byte > NOPTIONS) {
+  if (opt_byte >= NOPTIONS) {
     opt = "<unknown option>";
-    ett = ett_telnet_subopt;
     dissect = NULL;
   } else {
     opt = options[opt_byte].name;
     if (options[opt_byte].subtree_index != NULL)
       ett = *(options[opt_byte].subtree_index);
-    else
-      ett = ett_telnet_subopt;
     dissect = options[opt_byte].dissect;
   }
   offset++;
@@ -1227,37 +1224,39 @@
   subneg_len -= 3;
 
   if (subneg_len > 0) {
-    switch (options[opt_byte].len_type) {
 
-    case NO_LENGTH:
-      /* There isn't supposed to *be* sub-option negotiation for this. */
-      proto_tree_add_text(option_tree, tvb, start_offset, subneg_len,
-                          "Bogus suboption data");
-      return offset;
+    /* Now dissect the suboption parameters. */
+    if (dissect != NULL) {
 
-    case FIXED_LENGTH:
-      /* Make sure the length is what it's supposed to be. */
-      if (subneg_len != options[opt_byte].optlen) {
-        proto_tree_add_text(option_tree, tvb, start_offset, subneg_len,
-                          "Suboption parameter length is %d, should be %d",
-                          subneg_len, options[opt_byte].optlen);
-        return offset;
-      }
-      break;
+      switch (options[opt_byte].len_type) {
+
+      case NO_LENGTH:
+	/* There isn't supposed to *be* sub-option negotiation for this. */
+	proto_tree_add_text(option_tree, tvb, start_offset, subneg_len,
+			    "Bogus suboption data");
+	return offset;
+
+      case FIXED_LENGTH:
+	/* Make sure the length is what it's supposed to be. */
+	if (subneg_len != options[opt_byte].optlen) {
+	  proto_tree_add_text(option_tree, tvb, start_offset, subneg_len,
+			    "Suboption parameter length is %d, should be %d",
+			    subneg_len, options[opt_byte].optlen);
+	  return offset;
+	}
+	break;
 
-    case VARIABLE_LENGTH:
-      /* Make sure the length is greater than the minimum. */
-      if (subneg_len < options[opt_byte].optlen) {
-        proto_tree_add_text(option_tree, tvb, start_offset, subneg_len,
-                            "Suboption parameter length is %d, should be at least %d",
-                            subneg_len, options[opt_byte].optlen);
-        return offset;
+      case VARIABLE_LENGTH:
+	/* Make sure the length is greater than the minimum. */
+	if (subneg_len < options[opt_byte].optlen) {
+	  proto_tree_add_text(option_tree, tvb, start_offset, subneg_len,
+			      "Suboption parameter length is %d, should be at least %d",
+			      subneg_len, options[opt_byte].optlen);
+	  return offset;
+	}
+	break;
       }
-      break;
-    }
 
-    /* Now dissect the suboption parameters. */
-    if (dissect != NULL) {
       /* We have a dissector for this suboption's parameters; call it. */
       (*dissect)(pinfo, opt, tvb, start_offset, subneg_len, option_tree);
     } else {
@@ -1279,7 +1278,7 @@
 
   offset += 2;	/* skip IAC and WILL,WONT,DO,DONT} */
   opt_byte = tvb_get_guint8(tvb, offset);
-  if (opt_byte > NOPTIONS)
+  if (opt_byte >= NOPTIONS)
     opt = "<unknown option>";
   else
     opt = options[opt_byte].name;
--- ethereal-0.10.10.orig/epan/dissectors/packet-tzsp.c
+++ ethereal-0.10.10/epan/dissectors/packet-tzsp.c
@@ -1,6 +1,6 @@
 /* packet-tzsp.c
  *
- * $Id: packet-tzsp.c 13594 2005-03-05 01:03:22Z guy $
+ * $Id: packet-tzsp.c 13790 2005-03-17 05:14:01Z gerald $
  *
  * Copyright 2002, Tazmen Technologies Inc
  *
@@ -312,7 +312,7 @@
 	else {
 		wtap_encap = -1;
 		encap_name = "Nothing";
-		info = tzsp_type[type].strptr;
+		info = val_to_str(type, tzsp_type, "Unknown (%u)");
 	}
 
 	if (check_col(pinfo->cinfo, COL_INFO))
--- ethereal-0.10.10.orig/epan/dissectors/packet-wbxml.c
+++ ethereal-0.10.10/epan/dissectors/packet-wbxml.c
@@ -5109,13 +5109,13 @@
 	/* Compose the summary line */
 	if ( publicid ) {
 		summary = g_strdup_printf("%s, Public ID: \"%s\"",
-				match_strval (version, vals_wbxml_versions),
-				match_strval (publicid, vals_wbxml_public_ids));
+				val_to_str (version, vals_wbxml_versions, "(unknown 0x%x)"),
+				val_to_str (publicid, vals_wbxml_public_ids, "(unknown 0x%x)"));
 	} else {
 		/* Read length of Public ID from string table */
 		len = tvb_strsize (tvb, str_tbl + publicid_index);
 		summary = g_strdup_printf("%s, Public ID: \"%s\"",
-				match_strval (version, vals_wbxml_versions),
+				val_to_str (version, vals_wbxml_versions, "(unknown 0x%x)"),
 				tvb_format_text (tvb, str_tbl + publicid_index, len - 1));
 	}
 
@@ -6351,7 +6351,7 @@
 						"| %-10s     (Invalid Token!) "
 						"| WBXML parsing stops here.",
 						level, *codepage_attr,
-						match_strval (peek, vals_wbxml1x_global_tokens));
+						val_to_str (peek, vals_wbxml1x_global_tokens, "(unknown 0x%x)"));
 				/* Move to end of buffer */
 				off = tvb_len;
 				break;
@@ -6538,7 +6538,7 @@
 						"| %-10s     (Invalid Token!) "
 						"| WBXML parsing stops here.",
 						level, *codepage_attr,
-						match_strval (peek, vals_wbxml1x_global_tokens));
+						val_to_str (peek, vals_wbxml1x_global_tokens, "(unknown 0x%x)"));
 				/* Move to end of buffer */
 				off = tvb_len;
 				break;
--- ethereal-0.10.10.orig/epan/dissectors/packet-windows-common.c
+++ ethereal-0.10.10/epan/dissectors/packet-windows-common.c
@@ -1313,10 +1313,10 @@
             rid_present=TRUE;
             rid_offset=offset;
 	    offset+=4;
-            sprintf(sid_string, "S-1-%u-%s-%u", auth, gstr->str, rid);
+            g_snprintf(sid_string, sizeof(sid_string), "S-1-%u-%s-%u", auth, gstr->str, rid);
 	  } else {
             rid_present=FALSE;
-            sprintf(sid_string, "S-1-%u-%s", auth, gstr->str);
+            g_snprintf(sid_string, sizeof(sid_string), "S-1-%u-%s", auth, gstr->str);
           }
 
           sid_name=NULL;
--- ethereal-0.10.10.orig/epan/dissectors/packet-wsp.c
+++ ethereal-0.10.10/epan/dissectors/packet-wsp.c
@@ -2,7 +2,7 @@
  *
  * Routines to dissect WSP component of WAP traffic.
  *
- * $Id: packet-wsp.c 13243 2005-02-02 20:07:03Z etxrab $
+ * $Id: packet-wsp.c 14111 2005-04-17 05:11:25Z gerald $
  *
  * Refer to the AUTHORS file or the AUTHORS section in the man page
  * for contacting the author(s) of this file.
@@ -1281,7 +1281,6 @@
 #define get_text_string(str,tvb,start,len,ok) \
 	if (is_text_string(tvb_get_guint8(tvb,start))) { \
 		str = (gchar *)tvb_get_stringz(tvb,start,(gint *)&len); \
-		g_assert (str); \
 		ok = TRUE; \
 	} else { len = 0; str = NULL; ok = FALSE; }
 #define get_token_text(str,tvb,start,len,ok) \
@@ -1794,8 +1793,8 @@
 			/* Call header value dissector for given header */
 			if (val_id >= 0x20 && val_id <=0x7E) { /* OK! */
 				val_str = (gchar *)tvb_get_stringz(tvb, val_start, (gint *)&val_len);
-				g_assert(val_str);
 				offset = val_start + val_len;
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset-hdr_start);
 				proto_tree_add_text(wsp_headers,tvb,hdr_start,offset-hdr_start,
 						"%s: %s", hdr_str, val_str);
 				g_free (val_str);
@@ -1814,7 +1813,6 @@
 							tv.secs = val;
 							tv.nsecs = 0;
 							val_str = abs_time_to_str(&tv);
-							g_assert (val_str);
 							ti = proto_tree_add_string (wsp_headers,
 									hf_hdr_x_wap_tod,
 									tvb, hdr_start, hdr_len + val_len, val_str);
@@ -1835,6 +1833,7 @@
 				}
 				offset = tvb_len;
 			}
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			proto_tree_add_string_hidden(wsp_headers, hf_hdr_name,
 					tvb, hdr_start, offset - hdr_start, hdr_str);
 		} else if (hdr_id > 0) { /* Shorthand HCP switch */
@@ -1915,7 +1914,6 @@
 		/* END */ \
 	} else if ((val_id == 0) || (val_id >= 0x20)) { /* Textual value */ \
 		val_str = (gchar *)tvb_get_stringz (tvb, val_start, (gint *)&val_len); \
-		g_assert(val_str); \
 		offset = val_start + val_len; \
 		/* Textual value processing starts HERE \
 		 * \
@@ -1951,10 +1949,12 @@
 			proto_item_append_text(ti, \
 					" <Error: Invalid header value>"); \
 		} else if (hf > 0) { /* Create protocol tree item */ \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			proto_tree_add_string(tree, hf, \
 					tvb, hdr_start, offset - hdr_start, \
 					" <Error: Invalid header value>"); \
 		} else { /* Create anonymous header field entry */ \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			proto_tree_add_text(tree, tvb, hdr_start, offset - hdr_start, \
 					"%s: <Error: Invalid header value>", \
 					val_to_str (hdr_id, vals_field_names, \
@@ -1976,16 +1976,19 @@
 	ok = TRUE; /* Bypass error checking as we don't parse the values! */
 
 	wkh_1_WellKnownValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_text (tree, tvb, hdr_start, offset - hdr_start,
 				"%s: (Undecoded well-known value 0x%02x)",
 				val_to_str (hdr_id, vals_field_names,
 					"<Unknown WSP header field 0x%02X>"), val_id & 0x7F);
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_text(tree, tvb, hdr_start, offset - hdr_start,
 				"%s: %s",
 				val_to_str (hdr_id, vals_field_names,
 					"<Unknown WSP header field 0x%02X>"), val_str);
 	wkh_3_ValueWithLength;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_text (tree, tvb, hdr_start, offset - hdr_start,
 				"%s: (Undecoded value in general form with length indicator)",
 				val_to_str (hdr_id, vals_field_names,
@@ -2007,6 +2010,7 @@
 	proto_tree *parameter_tree = NULL; \
 	\
 	wkh_1_WellKnownValue; \
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 		ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 				tvb, hdr_start, offset - hdr_start, \
 				val_to_str(val_id & 0x7F, vals_content_types, \
@@ -2016,10 +2020,12 @@
 		/* Sometimes with a No-Content response, a NULL content type \
 		 * is reported. Process this correctly! */ \
 		if (*val_str) { \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 					tvb, hdr_start, offset - hdr_start, \
 					val_str); \
 		} else { \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 					tvb, hdr_start, offset - hdr_start, \
 					"<no content type has been specified>"); \
@@ -2032,11 +2038,13 @@
 			get_extension_media(val_str, tvb, off, len, ok); \
 			/* As we're using val_str, it is automatically g_free()d */ \
 			off += len; /* off now points to 1st byte after string */ \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string (tree, hf_hdr_ ## underscored, \
 					tvb, hdr_start, offset - hdr_start, val_str); \
 		} else if (is_integer_value(peek)) { \
 			get_integer_value(val, tvb, off, len, ok); \
 			if (ok) { \
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 				ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 						tvb, hdr_start, offset - hdr_start, \
 						val_to_str(val, vals_content_types, \
@@ -2116,6 +2124,7 @@
 		DebugLog(("add_content_type() - Well-known - Start\n"));
 		*textual_content = val_to_str(val_id & 0x7F, vals_content_types,
 				"<Unknown media type identifier 0x%X>");
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_content_type,
 				tvb, hdr_start, offset - hdr_start,
 				*textual_content);
@@ -2127,6 +2136,7 @@
 		/* Sometimes with a No-Content response, a NULL content type
 		 * is reported. Process this correctly! */
 		if (*val_str) {
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_content_type,
 					tvb, hdr_start, offset - hdr_start,
 					val_str);
@@ -2134,6 +2144,7 @@
 			*textual_content = g_strdup(val_str);
 			*well_known_content = 0;
 		} else {
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_content_type,
 					tvb, hdr_start, offset - hdr_start,
 					"<no media type has been specified>");
@@ -2152,6 +2163,7 @@
 			/* As we're using val_str, it is automatically g_free()d */
 			/* ??? Not sure anymore, we're in wkh_3, not in wkh_2 ! */
 			off += len; /* off now points to 1st byte after string */
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string (tree, hf_hdr_content_type,
 					tvb, hdr_start, offset - hdr_start, val_str);
 			/* Following statement: required? */
@@ -2163,6 +2175,7 @@
 			if (ok) {
 				*textual_content = val_to_str(val, vals_content_types,
 						"<Unknown media type identifier 0x%X>");
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_content_type,
 						tvb, hdr_start, offset - hdr_start,
 						*textual_content);
@@ -2201,12 +2214,14 @@
 	proto_tree *parameter_tree = NULL; \
 	\
 	wkh_1_WellKnownValue; \
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 		ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 				tvb, hdr_start, offset - hdr_start, \
 				val_to_str(val_id & 0x7F, valueString, \
 					"<Unknown " valueName " identifier 0x%X>")); \
 		ok = TRUE; \
 	wkh_2_TextualValue; \
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 		ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 				tvb, hdr_start, offset - hdr_start, val_str); \
 		ok = TRUE; \
@@ -2217,11 +2232,13 @@
 			get_token_text(val_str, tvb, off, len, ok); \
 			/* As we're using val_str, it is automatically g_free()d */ \
 			off += len; /* off now points to 1st byte after string */ \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string (tree, hf_hdr_ ## underscored, \
 					tvb, hdr_start, offset - hdr_start, val_str); \
 		} else if (is_integer_value(peek)) { \
 			get_integer_value(val, tvb, off, len, ok); \
 			if (ok) { \
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 				ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 						tvb, hdr_start, offset - hdr_start, \
 						val_to_str(val, valueString, \
@@ -2266,6 +2283,7 @@
 	proto_tree *subtree = NULL;
 
 	wkh_1_WellKnownValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_push_flag,
 				tvb, hdr_start, offset - hdr_start, "");
 		subtree = proto_item_add_subtree(ti, ett_header);
@@ -2311,6 +2329,7 @@
 	wkh_2_TextualValue;
 		/* Invalid */
 	wkh_3_ValueWithLength;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_profile_diff, tvb, hdr_start, offset - hdr_start,
 				"(Profile-Diff value as WBXML)");
 		subtree = proto_item_add_subtree(ti, ett_header);
@@ -2333,6 +2352,7 @@
 	wkh_1_WellKnownValue;
 		val_id &= 0x7F;
 		if (val_id >= 0x40) { /* Valid WSP method */
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_allow,
 					tvb, hdr_start, offset - hdr_start,
 					val_to_str(val_id & 0x7F, vals_pdu_type,
@@ -2359,6 +2379,7 @@
 	wkh_1_WellKnownValue;
 		val_id &= 0x7F;
 		if (val_id >= 0x40) { /* Valid WSP method */
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_public,
 					tvb, hdr_start, offset - hdr_start,
 					val_to_str(val_id & 0x7F, vals_pdu_type,
@@ -2366,6 +2387,7 @@
 			ok = TRUE;
 		}
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_public,
 				tvb, hdr_start, offset - hdr_start, val_str);
 		ok = TRUE;
@@ -2385,12 +2407,14 @@
 	wkh_0_Declarations;
 
 	wkh_1_WellKnownValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_vary,
 				tvb, hdr_start, offset - hdr_start,
 				val_to_str(val_id & 0x7F, vals_field_names,
 					"<Unknown WSP header field 0x%02X>"));
 		ok = TRUE;
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_vary,
 				tvb, hdr_start, offset - hdr_start,
 				val_str);
@@ -2411,6 +2435,7 @@
 
 	wkh_1_WellKnownValue;
 		if (val_id == 0x80) {
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_x_wap_security,
 					tvb, hdr_start, offset - hdr_start, "close-subordinate");
 			ok = TRUE;
@@ -2433,11 +2458,13 @@
 
 	wkh_1_WellKnownValue;
 		if (val_id == 0x80) {
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_connection,
 					tvb, hdr_start, offset - hdr_start, "close");
 			ok = TRUE;
 		}
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_connection,
 				tvb, hdr_start, offset - hdr_start, val_str);
 		ok = TRUE;
@@ -2457,11 +2484,13 @@
 
 	wkh_1_WellKnownValue;
 		if (val_id == 0x80) {
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_transfer_encoding,
 					tvb, hdr_start, offset - hdr_start, "chunked");
 			ok = TRUE;
 		}
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_transfer_encoding,
 				tvb, hdr_start, offset - hdr_start, val_str);
 		ok = TRUE;
@@ -2482,17 +2511,20 @@
 	wkh_1_WellKnownValue;
 		switch (val_id) {
 			case 0x80: /* none */
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_accept_ranges,
 						tvb, hdr_start, offset - hdr_start, "none");
 				ok = TRUE;
 				break;
 			case 0x81: /* bytes */
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_accept_ranges,
 						tvb, hdr_start, offset - hdr_start, "bytes");
 				ok = TRUE;
 				break;
 		}
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_accept_ranges,
 				tvb, hdr_start, offset - hdr_start, val_str);
 		ok = TRUE;
@@ -2513,22 +2545,26 @@
 	wkh_1_WellKnownValue;
 		switch (val_id) {
 			case 0x80: /* gzip */
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_content_encoding,
 						tvb, hdr_start, offset - hdr_start, "gzip");
 				ok = TRUE;
 				break;
 			case 0x81: /* compress */
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_content_encoding,
 						tvb, hdr_start, offset - hdr_start, "compress");
 				ok = TRUE;
 				break;
 			case 0x82: /* deflate */
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_content_encoding,
 						tvb, hdr_start, offset - hdr_start, "deflate");
 				ok = TRUE;
 				break;
 		}
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_content_encoding,
 				tvb, hdr_start, offset - hdr_start, val_str);
 		ok = TRUE;
@@ -2556,22 +2592,26 @@
 	wkh_1_WellKnownValue;
 		switch (val_id) {
 			case 0x80: /* gzip */
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_accept_encoding,
 						tvb, hdr_start, offset - hdr_start, "gzip");
 				ok = TRUE;
 				break;
 			case 0x81: /* compress */
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_accept_encoding,
 						tvb, hdr_start, offset - hdr_start, "compress");
 				ok = TRUE;
 				break;
 			case 0x82: /* deflate */
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_accept_encoding,
 						tvb, hdr_start, offset - hdr_start, "deflate");
 				ok = TRUE;
 				break;
 		}
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		proto_tree_add_string(tree, hf_hdr_accept_encoding,
 				tvb, hdr_start, offset - hdr_start, val_str);
 		ok = TRUE;
@@ -2581,21 +2621,25 @@
 		if (is_short_integer(peek)) {
 			switch (val_id) {
 				case 0x80: /* gzip */
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 					ti = proto_tree_add_string(tree, hf_hdr_accept_encoding,
 							tvb, hdr_start, offset - hdr_start, "gzip");
 					ok = TRUE;
 					break;
 				case 0x81: /* compress */
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 					ti = proto_tree_add_string(tree, hf_hdr_accept_encoding,
 							tvb, hdr_start, offset - hdr_start, "compress");
 					ok = TRUE;
 					break;
 				case 0x82: /* deflate */
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 					ti = proto_tree_add_string(tree, hf_hdr_accept_encoding,
 							tvb, hdr_start, offset - hdr_start, "deflate");
 					ok = TRUE;
 					break;
 				case 0x83: /* any */
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 					ti = proto_tree_add_string(tree, hf_hdr_accept_encoding,
 							tvb, hdr_start, offset - hdr_start, "*");
 					ok = TRUE;
@@ -2605,6 +2649,7 @@
 		} else {
 			get_token_text(str, tvb, off, len, ok);
 			if (ok) {
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_accept_encoding,
 						tvb, hdr_start, offset - hdr_start, str);
 				g_free(str);
@@ -2650,16 +2695,19 @@
 		if (is_short_integer(peek)) {
 			switch (peek) {
 				case 0x80: /* form-data */
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 					ti = proto_tree_add_string(tree, hf_hdr_content_disposition,
 							tvb, hdr_start, offset - hdr_start, "form-data");
 					ok = TRUE;
 					break;
 				case 0x81: /* attachment */
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 					ti = proto_tree_add_string(tree, hf_hdr_content_disposition,
 							tvb, hdr_start, offset - hdr_start, "attachment");
 					ok = TRUE;
 					break;
 				case 0x82: /* inline */
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 					ti = proto_tree_add_string(tree, hf_hdr_content_disposition,
 							tvb, hdr_start, offset - hdr_start, "inline");
 					ok = TRUE;
@@ -2669,6 +2717,7 @@
 		} else {
 			get_token_text(str, tvb, off, len, ok);
 			if (ok) {
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_content_disposition,
 						tvb, hdr_start, offset - hdr_start, str);
 				g_free(str);
@@ -2699,6 +2748,7 @@
 	wkh_1_WellKnownValue; \
 		/* Invalid */ \
 	wkh_2_TextualValue; \
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 		ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 				tvb, hdr_start, offset - hdr_start, val_str); \
 		ok = TRUE; \
@@ -2745,10 +2795,12 @@
 			} else { /* OK (no trailing quote) */ \
 				str = g_strdup_printf("%s\"", val_str); \
 			} \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 					tvb, hdr_start, offset - hdr_start, str); \
 			g_free(str); \
 		} else { \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 					tvb, hdr_start, offset - hdr_start, val_str); \
 			proto_item_append_text(ti, \
@@ -2779,6 +2831,7 @@
 	wkh_1_WellKnownValue; \
 		/* Invalid */ \
 	wkh_2_TextualValue; \
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 		ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 				tvb, hdr_start, offset - hdr_start, val_str); \
 		ok = TRUE; \
@@ -2789,7 +2842,7 @@
 				tv.secs = val; \
 				tv.nsecs = 0; \
 				str = abs_time_to_str(&tv); \
-				g_assert(str); \
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 				ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 						tvb, hdr_start, offset - hdr_start, str); \
 				/* BEHOLD: do NOT try to free str, as this generates a core
@@ -2828,7 +2881,7 @@
 				tv.secs = val; \
 				tv.nsecs = 0; \
 				str = abs_time_to_str(&tv); \
-				g_assert(str); \
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 				ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 						tvb, hdr_start, offset - hdr_start, str); \
 				/* BEHOLD: do NOT try to free str, as this generates a core
@@ -2859,6 +2912,7 @@
 	\
 	wkh_1_WellKnownValue; \
 		if (val_id == 0x80) { /* Openwave TOD header uses this format */ \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 					tvb, hdr_start, offset - hdr_start, \
 					"Requesting Time Of Day"); \
@@ -2876,6 +2930,7 @@
 			get_date_value(val, tvb, off, len, ok); \
 			if (ok) { \
 				if (val == 0) { \
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 					ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 							tvb, hdr_start, offset - hdr_start, \
 							"Requesting Time Of Day"); \
@@ -2883,7 +2938,7 @@
 					tv.secs = val; \
 					tv.nsecs = 0; \
 					str = abs_time_to_str(&tv); \
-					g_assert(str); \
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 					ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 							tvb, hdr_start, offset - hdr_start, str); \
 				} \
@@ -2907,6 +2962,7 @@
 	wkh_1_WellKnownValue;
 		val = val_id & 0x7F;
 		val_str = g_strdup_printf("%u second%s", val, plurality(val, "", "s"));
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_age,
 				tvb, hdr_start, offset - hdr_start, val_str);
 		g_free(val_str); /* proto_XXX creates a copy */
@@ -2918,6 +2974,7 @@
 			get_long_integer(val, tvb, off, len, ok);
 			if (ok) {
 				val_str = g_strdup_printf("%u second%s", val, plurality(val, "", "s"));
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_age,
 						tvb, hdr_start, offset - hdr_start, val_str);
 				g_free(val_str); /* proto_XXX creates a copy */
@@ -2938,12 +2995,14 @@
 	guint32 val = 0, off = val_start, len; \
 	\
 	wkh_1_WellKnownValue; \
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 		ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 				tvb, hdr_start, offset - hdr_start, \
 				val_to_str(val_id & 0x7F, valueString, \
 				"(Unknown " valueName " identifier 0x%X)")); \
 		ok = TRUE; \
 	wkh_2_TextualValue; \
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 		ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 				tvb, hdr_start, offset - hdr_start, val_str); \
 		ok = TRUE; \
@@ -2951,6 +3010,7 @@
 		if (val_id <= 4) { /* Length field already parsed by macro! */ \
 			get_long_integer(val, tvb, off, len, ok); \
 			if (ok) { \
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 				ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 						tvb, hdr_start, offset - hdr_start, \
 						val_to_str(val_id & 0x7F, valueString, \
@@ -3002,6 +3062,7 @@
 		off = val_start + val_len_len; \
 		peek = tvb_get_guint8(tvb, off); \
 		if (peek == 0x80) { /* Basic */ \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 					tvb, hdr_start, offset - hdr_start, "basic"); \
 			subtree = proto_item_add_subtree(ti, ett_header); \
@@ -3023,9 +3084,11 @@
 		} else { /* Authentication-scheme: token-text */ \
 			get_token_text(str, tvb, off, len, ok); \
 			if (ok) { \
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 				ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 						tvb, hdr_start, off - hdr_start, str); \
 				subtree = proto_item_add_subtree(ti, ett_header); \
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 				proto_tree_add_string(subtree, \
 						hf_hdr_ ## underscored ## _scheme, \
 						tvb, hdr_start, off - hdr_start, str); \
@@ -3083,6 +3146,7 @@
 		off = val_start + val_len_len; \
 		peek = tvb_get_guint8(tvb, off); \
 		if (peek == 0x80) { /* Basic */ \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 					tvb, hdr_start, offset - hdr_start, "basic"); \
 			subtree = proto_item_add_subtree(ti, ett_header); \
@@ -3116,6 +3180,7 @@
 		} else { /* Authentication-scheme: token-text */ \
 			get_token_text(str, tvb, off, len, ok); \
 			if (ok) { \
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 				ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 						tvb, hdr_start, off - hdr_start, str); \
 				subtree = proto_item_add_subtree(ti, ett_header); \
@@ -3173,6 +3238,7 @@
 					tvb_get_guint8(tvb, off + 14),
 					tvb_get_guint8(tvb, off + 15)
 			);
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_content_md5,
 					tvb, hdr_start, offset - hdr_start, val_str);
 			g_free(val_str);
@@ -3193,6 +3259,7 @@
 
 	wkh_1_WellKnownValue;
 		if (val_id == 0x80) {
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_pragma,
 					tvb, hdr_start, offset - hdr_start, "no-cache");
 			ok = TRUE;
@@ -3201,6 +3268,7 @@
 		/* Invalid */
 	wkh_3_ValueWithLength;
 		off = val_start + val_len_len;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_pragma,
 				tvb, hdr_start, off - hdr_start, "");
 		/* NULL subtree for parameter() results in no subtree
@@ -3225,6 +3293,7 @@
 	\
 	wkh_1_WellKnownValue; \
 		str = g_strdup_printf("%u", val_id & 0x7F); \
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 		ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 				tvb, hdr_start, offset - hdr_start, str); \
 		g_free(str); \
@@ -3236,6 +3305,7 @@
 			get_long_integer(val, tvb, off, len, ok); \
 			if (ok) { \
 				str = g_strdup_printf("%u", val); \
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 				ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 						tvb, hdr_start, offset - hdr_start, str); \
 				g_free(str); \
@@ -3258,10 +3328,12 @@
 	wkh_1_WellKnownValue; \
 		val_str = match_strval(val_id & 0x7F, valueString); \
 		if (val_str) { \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 				tvb, hdr_start, offset - hdr_start, val_str); \
 			ok = TRUE; \
 		} else { \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 				tvb, hdr_start, offset - hdr_start, \
 				"<Unknown " valueName ">"); \
@@ -3274,10 +3346,12 @@
 			if (ok) { \
 				val_str = match_strval(val_id & 0x7F, valueString); \
 				if (val_str) { \
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 					ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 						tvb, hdr_start, offset - hdr_start, val_str); \
 					ok = TRUE; \
 				} else { \
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 					ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
 						tvb, hdr_start, offset - hdr_start, \
 						"<Unknown " valueName ">"); \
@@ -3306,11 +3380,13 @@
 		val = val_id & 0x7F;
 		val_str = match_strval(val, vals_cache_control);
 		if (val_str) {
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_cache_control,
 					tvb, hdr_start, offset - hdr_start, val_str);
 			ok = TRUE;
 		}
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_string(tree, hf_hdr_cache_control,
 				tvb, hdr_start, offset - hdr_start, val_str);
 		ok = TRUE;
@@ -3328,6 +3404,7 @@
 			switch (cache_control_directive & 0x7F) {
 				case CACHE_CONTROL_NO_CACHE:
 				case CACHE_CONTROL_PRIVATE:
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 					ti = proto_tree_add_string(tree, hf_hdr_cache_control,
 							tvb, hdr_start, offset - hdr_start,
 							val_to_str (cache_control_directive & 0x7F, vals_cache_control,
@@ -3356,6 +3433,7 @@
 				case CACHE_CONTROL_MAX_STALE:
 				case CACHE_CONTROL_MIN_FRESH:
 				case CACHE_CONTROL_S_MAXAGE:
+					tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 					ti = proto_tree_add_string(tree, hf_hdr_cache_control,
 							tvb, hdr_start, offset - hdr_start,
 							val_to_str (cache_control_directive & 0x7F, vals_cache_control,
@@ -3376,6 +3454,7 @@
 		} else if (is_token_text(cache_control_directive)) {
 			get_token_text(val_str, tvb, off, len, ok);
 			if (ok) {
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_cache_control,
 						tvb, hdr_start, offset - hdr_start, val_str);
 				g_free(val_str);
@@ -3430,6 +3509,7 @@
 		val = val_id & 0x7F;
 		val_str = match_strval(val, vals_wsp_warning_code);
 		if (val_str) {
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_warning,
 					tvb, hdr_start, offset - hdr_start, val_str);
 			subtree = proto_item_add_subtree(ti, ett_header);
@@ -3448,6 +3528,7 @@
 			val_str = match_strval(val, vals_wsp_warning_code_short);
 			if (val_str) { /* OK */
 				str = g_strdup_printf("code=%s", val_str);
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_warning,
 						tvb, hdr_start, offset - hdr_start, str);
 				g_free(str);
@@ -3500,6 +3581,7 @@
 		val = val_id & 0x7F;
 		val_str = match_strval(val, vals_wsp_profile_warning_code);
 		if (val_str) {
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_profile_warning,
 					tvb, hdr_start, offset - hdr_start, val_str);
 			ok = TRUE;
@@ -3512,6 +3594,7 @@
 		if (warn_code & 0x80) { /* Well known warn code */
 			val_str = match_strval(val, vals_wsp_profile_warning_code);
 			if (val_str) { /* OK */
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_profile_warning,
 						tvb, hdr_start, offset - hdr_start, val_str);
 				get_uri_value(str, tvb, off, len, ok);
@@ -3528,7 +3611,6 @@
 							tv.secs = val;
 							tv.nsecs = 0;
 							val_str = abs_time_to_str(&tv);
-							g_assert(val_str);
 							str = g_strdup_printf("; date=%s", val_str);
 							proto_item_append_string(ti, str);
 							g_free(str); /* proto_XXX creates a copy */
@@ -3560,11 +3642,13 @@
 	wkh_1_WellKnownValue;
 		val = val_id & 0x7F;
 		val_str = g_strdup_printf("%u.%u", val >> 4, val & 0x0F);
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		proto_tree_add_string(tree, hf_hdr_encoding_version,
 				tvb, hdr_start, offset - hdr_start, val_str);
 		g_free(val_str);
 		ok = TRUE;
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		proto_tree_add_string(tree, hf_hdr_encoding_version,
 				tvb, hdr_start, offset - hdr_start, val_str);
 		ok = TRUE;
@@ -3573,6 +3657,7 @@
 		val = tvb_get_guint8(tvb, off);
 		if (val & 0x80) { /* Header Code Page */
 			val_str = g_strdup_printf("code-page=%u", val & 0x7F);
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_encoding_version,
 					tvb, hdr_start, offset - hdr_start, val_str);
 			g_free(val_str);
@@ -3612,6 +3697,7 @@
 		get_uintvar_integer (val, tvb, off, len, ok); /* Uintvar start */
 		if (ok) {
 			val_str = g_strdup_printf("first-byte-pos=%u", val);
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_content_range,
 					tvb, hdr_start, offset - hdr_start, val_str);
 			subtree = proto_item_add_subtree(ti, ett_header);
@@ -3660,6 +3746,7 @@
 		off = val_start + val_len_len;
 		val = tvb_get_guint8(tvb, off);
 		if (val == 0x80) { /* Byte-range */
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_range,
 					tvb, hdr_start, offset - hdr_start, "byte-range");
 			subtree = proto_item_add_subtree(ti, ett_header);
@@ -3686,6 +3773,7 @@
 				}
 			}
 		} else if (val == 0x81) { /* Suffix-byte-range */
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			ti = proto_tree_add_string(tree, hf_hdr_range,
 					tvb, hdr_start, offset - hdr_start, "suffix-byte-range");
 			subtree = proto_item_add_subtree(ti, ett_header);
@@ -3715,6 +3803,7 @@
 
 	wkh_1_WellKnownValue;
 		if (val_id == 0x81) {
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 			proto_tree_add_string(tree, hf_hdr_encoding_version,
 					tvb, hdr_start, offset - hdr_start, "trailers");
 			ok = TRUE;
@@ -3727,6 +3816,7 @@
 		if (val & 0x80) { /* Well-known-TE */
 			val_str = match_strval((val & 0x7F), vals_well_known_te);
 			if (val_str) {
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 				ti = proto_tree_add_string(tree, hf_hdr_te,
 						tvb, hdr_start, off - hdr_start, val_str);
 				off++;
@@ -3734,11 +3824,13 @@
 			}
 		} else { /* TE in Token-text format */
 			get_token_text(val_str, tvb, off, len, ok);
-			ti = proto_tree_add_string(tree, hf_hdr_te,
-					tvb, hdr_start, off - hdr_start, val_str);
-			g_free(val_str);
-			off += len;
-			ok = TRUE;
+			if (ok) {
+				tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
+				ti = proto_tree_add_string(tree, hf_hdr_te,
+						tvb, hdr_start, off - hdr_start, val_str);
+				g_free(val_str);
+				off += len;
+			}
 		}
 		if ((ok) && (off < offset)) { /* Q-token Q-value */
 			/* TODO */
@@ -3761,6 +3853,7 @@
  */
 #undef wkh_1_WellKnownValue
 #define wkh_1_WellKnownValue			/* Parse Well Known Value */ \
+	tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 	proto_tree_add_string_hidden(tree, hf_hdr_name, \
 			tvb, hdr_start, offset - hdr_start, \
 			val_to_str (hdr_id, vals_openwave_field_names, \
@@ -3785,10 +3878,12 @@
 			proto_item_append_text(ti, \
 					"<Error: Invalid header value>"); \
 		} else if (hf > 0) { /* Create protocol tree item */ \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			proto_tree_add_string(tree, hf, \
 					tvb, hdr_start, offset - hdr_start, \
 					" <Error: Invalid header value>"); \
 		} else { /* Create anonymous header field entry */ \
+			tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
 			proto_tree_add_text(tree, tvb, hdr_start, offset - hdr_start, \
 					"%s: <Error: Invalid header value>", \
 					val_to_str (hdr_id, vals_openwave_field_names, \
@@ -3807,16 +3902,19 @@
 	ok = TRUE; /* Bypass error checking as we don't parse the values! */
 
 	wkh_1_WellKnownValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_text(tree, tvb, hdr_start, offset - hdr_start,
 				"%s: (Undecoded well-known value 0x%02x)",
 				val_to_str (hdr_id, vals_openwave_field_names,
 					"<Unknown WSP header field 0x%02X>"), val_id & 0x7F);
 	wkh_2_TextualValue;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_text(tree,tvb,hdr_start, offset - hdr_start,
 				"%s: %s",
 				val_to_str (hdr_id, vals_openwave_field_names,
 					"<Unknown WSP header field 0x%02X>"), val_str);
 	wkh_3_ValueWithLength;
+		tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
 		ti = proto_tree_add_text(tree, tvb, hdr_start, offset - hdr_start,
 				"%s: (Undecoded value in general form with length indicator)",
 				val_to_str (hdr_id, vals_openwave_field_names,
@@ -3921,7 +4019,7 @@
 		offset += val_len; \
 	} else { \
 		DebugLog(("\tError: invalid parameter value!\n")); \
-		proto_tree_add_string(tree, hf, tvb, start, len - start, \
+		proto_tree_add_string(tree, hf, tvb, start, len, \
 				InvalidParameterValue(Uppercase, value)); \
 		offset = start + len; /* Skip to end of buffer */ \
 	} \
@@ -3957,7 +4055,7 @@
 		g_free(val_str); \
 		offset += val_len; \
 	} else { \
-		proto_tree_add_string(tree, hf, tvb, start, len - start, \
+		proto_tree_add_string(tree, hf, tvb, start, len, \
 				InvalidParameterValue(Uppercase, value)); \
 		offset = start + len; /* Skip to end of buffer */ \
 	}
@@ -4003,10 +4101,12 @@
 				if (is_quoted_string(val_str[0])) { /* Add trailing quote! */
 					if (is_quoted_string(val_str[val_len-2])) {
 						/* Trailing quote - issue a warning */
+						tvb_ensure_bytes_exist(tvb, start, offset - start);
 						proto_tree_add_text(tree, tvb, start, offset - start,
 								"%s: %s" TrailingQuoteWarning, str, val_str);
 						s = g_strdup_printf("; %s=%s", str, val_str);
 					} else { /* OK (no trailing quote) */
+						tvb_ensure_bytes_exist(tvb, start, offset - start);
 						proto_tree_add_text(tree, tvb, start, offset - start,
 								"%s: %s\"", str, val_str);
 						s = g_strdup_printf("; %s=%s\"", str, val_str);
@@ -4014,6 +4114,7 @@
 				} else { /* Token-text | 0x00 */
 					/* TODO - verify that it is either Token-text or 0x00
 					 * and flag with warning if invalid */
+					tvb_ensure_bytes_exist(tvb, start, offset - start);
 					proto_tree_add_text(tree, tvb, start, offset - start,
 							"%s: %s", str, val_str);
 					s = g_strdup_printf("; %s=%s", str, val_str);
@@ -4032,6 +4133,7 @@
 				get_integer_value (val,tvb,offset,val_len,ok);
 				if (ok) { /* Also found a valid integer parameter value: val */
 					offset += val_len;
+					tvb_ensure_bytes_exist(tvb, start, offset - start);
 					proto_tree_add_text(tree, tvb, start, offset - start,
 							"%s: %u", str, val);
 					s = g_strdup_printf("; %s=%u", str, val);
@@ -4042,6 +4144,7 @@
 					 * protocol tree for the untyped parameter case */
 				} else { /* Error: neither token-text not Integer-value */
 					DebugLog(("Invalid untyped parameter value!\n"));
+					tvb_ensure_bytes_exist(tvb, start, offset - start);
 					proto_tree_add_text (tree, tvb, start, offset - start,
 							"<Error: Invalid untyped parameter definition>");
 					offset = start + len; /* Skip to end of buffer */
@@ -4058,6 +4161,7 @@
 	DebugLog(("parameter() - Typed - Start\n"));
 	get_integer_value (type,tvb,start,type_len,ok);
 	if (!ok) {
+		tvb_ensure_bytes_exist(tvb, start, offset - start);
 		proto_tree_add_text (tree, tvb, start, offset - start,
 				"<Error: Invalid typed parameter definition>");
 		return (start + len); /* Skip to end of buffer */
@@ -4136,13 +4240,14 @@
 				} /* Else: invalid parameter value */
 			}
 			if (ok) {
+				tvb_ensure_bytes_exist(tvb, start, offset - start);
 				proto_tree_add_string (tree, hf_wsp_parameter_upart_type,
 						tvb, start, offset - start, val_str);
 				str = g_strdup_printf("; type=%s", val_str);
 				proto_item_append_string(ti, str);
 				g_free(str);
 			} else { /* Invalid parameter value */
-				proto_tree_add_text (tree, tvb, start, len - start,
+				proto_tree_add_text (tree, tvb, start, len,
 						InvalidParameterValue("Type",
 							"Constrained-encoding"));
 				offset = start + len; /* Skip the parameters */
@@ -4206,7 +4311,7 @@
 				g_free(s);
 				offset++;
 			} else { /* Error */
-				proto_tree_add_text (tree, tvb, start, len - start,
+				proto_tree_add_text (tree, tvb, start, len,
 						InvalidParameterValue("SEC", "Short-integer"));
 				offset = start + len; /* Skip to end of buffer */
 			}
@@ -4227,7 +4332,7 @@
 				g_free(s);
 				offset += val_len;
 			} else {
-				proto_tree_add_text (tree, tvb, start, len - start,
+				proto_tree_add_text (tree, tvb, start, len,
 						InvalidParameterValue("Level", "Version-value"));
 				offset = start + len; /* Skip to end of buffer */
 			}
@@ -4259,48 +4364,56 @@
 
 		case 0x07:	/* WSP 1.1 encoding - Differences: Field-name */
 			DebugLog(("Skipping remaining parameters from here\n"));
+			tvb_ensure_bytes_exist(tvb, start, offset - start);
 			proto_tree_add_text(tree, tvb, start, offset - start, 
 					"Undecoded parameter Differences - decoding stopped");
 			break;
 
 		case 0x08:	/* WSP 1.1 encoding - Padding: Short-integer */
 			DebugLog(("Skipping remaining parameters from here\n"));
+			tvb_ensure_bytes_exist(tvb, start, offset - start);
 			proto_tree_add_text(tree, tvb, start, offset - start, 
 					"Undecoded parameter Padding - decoding stopped");
 			break;
 
 		case 0x0E:	/* WSP 1.3 encoding - Max-Age: Delta-seconds-value */
 			DebugLog(("Skipping remaining parameters from here\n"));
+			tvb_ensure_bytes_exist(tvb, start, offset - start);
 			proto_tree_add_text(tree, tvb, start, offset - start, 
 					"Undecoded parameter Max-Age - decoding stopped");
 			break;
 
 		case 0x10:	/* WSP 1.3 encoding - Secure: No-value */
 			DebugLog(("Skipping remaining parameters from here\n"));
+			tvb_ensure_bytes_exist(tvb, start, offset - start);
 			proto_tree_add_text(tree, tvb, start, offset - start, 
 					"Undecoded parameter Secure - decoding stopped");
 			break;
 
 		case 0x13:	/* WSP 1.4 encoding - Creation-date: Date-value */
 			DebugLog(("Skipping remaining parameters from here\n"));
+			tvb_ensure_bytes_exist(tvb, start, offset - start);
 			proto_tree_add_text(tree, tvb, start, offset - start, 
 					"Undecoded parameter Creation-Date - decoding stopped");
 			break;
 
 		case 0x14:	/* WSP 1.4 encoding - Modification-date: Date-value */
 			DebugLog(("Skipping remaining parameters from here\n"));
+			tvb_ensure_bytes_exist(tvb, start, offset - start);
 			proto_tree_add_text(tree, tvb, start, offset - start, 
 					"Undecoded parameter Modification-Date - decoding stopped");
 			break;
 
 		case 0x15:	/* WSP 1.4 encoding - Read-date: Date-value */
 			DebugLog(("Skipping remaining parameters from here\n"));
+			tvb_ensure_bytes_exist(tvb, start, offset - start);
 			proto_tree_add_text(tree, tvb, start, offset - start, 
 					"Undecoded parameter Read-Date - decoding stopped");
 			break;
 
 		default:
 			DebugLog(("Skipping remaining parameters from here\n"));
+			tvb_ensure_bytes_exist(tvb, start, offset - start);
 			proto_tree_add_text(tree, tvb, start, offset - start, 
 					"Undecoded parameter type 0x%02x - decoding stopped",
 					type);
@@ -5437,6 +5550,7 @@
 		capaValueLen = tvb_get_guintvar(tvb, offset, &len);
 		capaLen = capaValueLen + len;
 		offset += len;
+		tvb_ensure_bytes_exist(tvb, offset, capaLen);
 		/*
 		 * Now offset points to the 1st byte of the capability type.
 		 * Get the capability identifier.
@@ -5845,6 +5959,7 @@
 		DataLen = tvb_get_guintvar (tvb, offset, &count);
 		offset += count;
 		if (tree) {
+			tvb_ensure_bytes_exist(tvb, part_start, HeadersLen + DataLen + (offset - part_start));
 			ti = proto_tree_add_uint(sub_tree, hf_wsp_mpart, tvb, part_start,
 					HeadersLen + DataLen + (offset - part_start), partnr);
 			mpart_tree = proto_item_add_subtree(ti, ett_multiparts);
--- ethereal-0.10.10.orig/epan/dissectors/packet-x509af.c
+++ ethereal-0.10.10/epan/dissectors/packet-x509af.c
@@ -170,10 +170,10 @@
 /*--- End of included file: packet-x509af-ett.c ---*/
 
 
-static char algorithm_id[64]; /*64 chars should be long enough? */
+static char algorithm_id[BER_MAX_OID_STR_LEN];
 
 
-static char extension_id[64]; /*64 chars should be long enough? */
+static char extension_id[BER_MAX_OID_STR_LEN];
 
 
 
--- ethereal-0.10.10.orig/epan/dissectors/packet-x509ce.c
+++ ethereal-0.10.10/epan/dissectors/packet-x509ce.c
@@ -260,7 +260,7 @@
 /*--- End of included file: packet-x509ce-ett.c ---*/
 
 
-static char object_identifier_id[64]; /*64 chars should be long enough? */
+static char object_identifier_id[BER_MAX_OID_STR_LEN];
 
 
 /*--- Included file: packet-x509ce-fn.c ---*/
--- ethereal-0.10.10.orig/epan/dissectors/packet-x509if.c
+++ ethereal-0.10.10/epan/dissectors/packet-x509if.c
@@ -275,7 +275,7 @@
 /*--- End of included file: packet-x509if-ett.c ---*/
 
 
-static char object_identifier_id[64]; /*64 chars should be long enough? */
+static char object_identifier_id[BER_MAX_OID_STR_LEN];
 
 
 /*--- Included file: packet-x509if-fn.c ---*/
--- ethereal-0.10.10.orig/epan/dissectors/packet-dcerpc-nt.c
+++ ethereal-0.10.10/epan/dissectors/packet-dcerpc-nt.c
@@ -834,7 +834,7 @@
 		      e_ctx_hnd *pdata, proto_item **pitem,
 		      gboolean is_open, gboolean is_close)
 {
-	proto_item *item;
+	proto_item *item=NULL;
 	proto_tree *subtree;
 	e_ctx_hnd hnd;
 	guint32 open_frame = 0, close_frame = 0;
--- ethereal-0.10.10.orig/epan/dissectors/register.c
+++ ethereal-0.10.10/epan/dissectors/register.c
@@ -54,6 +54,7 @@
   {extern void proto_register_asf (void); proto_register_asf ();}
   {extern void proto_register_atalk (void); proto_register_atalk ();}
   {extern void proto_register_atm (void); proto_register_atm ();}
+  {extern void proto_register_atsvc (void); proto_register_atsvc ();}
   {extern void proto_register_auto_rp (void); proto_register_auto_rp ();}
   {extern void proto_register_ax4000 (void); proto_register_ax4000 ();}
   {extern void proto_register_bacapp (void); proto_register_bacapp ();}
@@ -113,7 +114,6 @@
   {extern void proto_register_dccp (void); proto_register_dccp ();}
   {extern void proto_register_dce_update (void); proto_register_dce_update ();}
   {extern void proto_register_dcerpc (void); proto_register_dcerpc ();}
-  {extern void proto_register_dcerpc_atsvc (void); proto_register_dcerpc_atsvc ();}
   {extern void proto_register_dcerpc_browser (void); proto_register_dcerpc_browser ();}
   {extern void proto_register_dcerpc_dfs (void); proto_register_dcerpc_dfs ();}
   {extern void proto_register_dcerpc_dnsserver (void); proto_register_dcerpc_dnsserver ();}
@@ -620,6 +620,7 @@
   {extern void proto_reg_handoff_asf (void); proto_reg_handoff_asf ();}
   {extern void proto_reg_handoff_atalk (void); proto_reg_handoff_atalk ();}
   {extern void proto_reg_handoff_atm (void); proto_reg_handoff_atm ();}
+  {extern void proto_reg_handoff_atsvc (void); proto_reg_handoff_atsvc ();}
   {extern void proto_reg_handoff_auto_rp (void); proto_reg_handoff_auto_rp ();}
   {extern void proto_reg_handoff_ax4000 (void); proto_reg_handoff_ax4000 ();}
   {extern void proto_reg_handoff_bacapp (void); proto_reg_handoff_bacapp ();}
@@ -676,7 +677,6 @@
   {extern void proto_reg_handoff_dccp (void); proto_reg_handoff_dccp ();}
   {extern void proto_reg_handoff_dce_update (void); proto_reg_handoff_dce_update ();}
   {extern void proto_reg_handoff_dcerpc (void); proto_reg_handoff_dcerpc ();}
-  {extern void proto_reg_handoff_dcerpc_atsvc (void); proto_reg_handoff_dcerpc_atsvc ();}
   {extern void proto_reg_handoff_dcerpc_browser (void); proto_reg_handoff_dcerpc_browser ();}
   {extern void proto_reg_handoff_dcerpc_dfs (void); proto_reg_handoff_dcerpc_dfs ();}
   {extern void proto_reg_handoff_dcerpc_dnsserver (void); proto_reg_handoff_dcerpc_dnsserver ();}
--- ethereal-0.10.10.orig/epan/dissectors/packet-ncp2222.inc
+++ ethereal-0.10.10/epan/dissectors/packet-ncp2222.inc
@@ -1103,7 +1103,7 @@
 
 	uint_to_nwdate(get_item_value(item), &nw_date);
 	
-	proto_item_set_text(item, get_item_name(item)); 
+	proto_item_set_text(item, "%s", get_item_name(item)); 
 	proto_item_append_text(item, ": %04u/%02u/%02u",
 			nw_date.year, nw_date.month, nw_date.day);
 	return item;
@@ -1123,7 +1123,7 @@
 
 	uint_to_nwtime(get_item_value(item), &nw_time);
 	
-	proto_item_set_text(item, get_item_name(item)); 
+	proto_item_set_text(item, "%s", get_item_name(item)); 
 	proto_item_append_text(item, ": %02u:%02u:%02u",
 			nw_time.hour, nw_time.minute, nw_time.second);
 	return item;
@@ -1146,7 +1146,7 @@
 	item = ptvcursor_add(ptvc, *rec->hf_ptr,
 		rec->length, rec->endianness);
 
-        proto_item_set_text(item, get_item_name(item)); 
+        proto_item_set_text(item, "%s", get_item_name(item)); 
 	proto_item_append_text(item, " %s",
 			nw_uni.buffer);
                                 
@@ -4180,6 +4180,9 @@
                 break;
         }
     }
+    if (i > 99)
+        return;
+
     frag_count = i;
     
     /* is this the end of an existing fragment or just another reply */
@@ -4262,6 +4265,8 @@
                                      break;
                              }
                          }
+                         if (i > 99)
+                             return;
                          if (frags[i].nds_frag == 0xffffffff)
                          {
                                  /* Error can't find fragment */
--- ethereal-0.10.10.orig/gtk/Makefile.in
+++ ethereal-0.10.10/gtk/Makefile.in
@@ -91,11 +91,8 @@
 	$(srcdir)/doxygen.cfg.in
 subdir = gtk
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/gtk/dfilter_expr_dlg.c
+++ ethereal-0.10.10/gtk/dfilter_expr_dlg.c
@@ -787,12 +787,8 @@
     gtk_label_get(GTK_LABEL(item_label), &item_str);
 #else
     if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(relation_list)),
-                                        &model, &iter))
+                                        &model, &iter)) {
         gtk_tree_model_get(model, &iter, 0, &item_str, -1);
-    else {
-    	/* XXX - the relation list is in GTK_SELECTION_BROWSE mode; how
-    	   can this ever be null? */
-        item_str = NULL;
     }
 #endif
 
--- ethereal-0.10.10.orig/gtk/sctp_graph_dlg.c
+++ ethereal-0.10.10/gtk/sctp_graph_dlg.c
@@ -199,7 +199,8 @@
 				tsnumber = ntohl(sack_header->cum_tsn_ack);
 				if (nr>0)
 				{
-					gap = (struct gaps *)(sack_header->tsns+(4*(nr-1)));
+					/* FIXME: Only the first gap report is considered */
+					gap = (struct gaps *)&(sack_header->tsns);
 					gap_start=ntohs(gap->start);
 					gap_end = ntohs(gap->end);
 					max_num=gap_end+tsnumber;
--- ethereal-0.10.10.orig/packaging/rpm/SPECS/Makefile.in
+++ ethereal-0.10.10/packaging/rpm/SPECS/Makefile.in
@@ -38,11 +38,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(srcdir)/ethereal.spec.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/packaging/rpm/Makefile.in
+++ ethereal-0.10.10/packaging/rpm/Makefile.in
@@ -37,11 +37,8 @@
 subdir = packaging/rpm
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/packaging/svr4/Makefile.in
+++ ethereal-0.10.10/packaging/svr4/Makefile.in
@@ -38,11 +38,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(srcdir)/checkinstall.in $(srcdir)/pkginfo.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/packaging/Makefile.in
+++ ethereal-0.10.10/packaging/Makefile.in
@@ -37,11 +37,8 @@
 subdir = packaging
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/packaging/nsis/Makefile.in
+++ ethereal-0.10.10/packaging/nsis/Makefile.in
@@ -37,11 +37,8 @@
 subdir = packaging/nsis
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/configure.in
+++ ethereal-0.10.10/configure.in
@@ -1158,7 +1158,7 @@
 dnl check whether plugins should be enabled and, if they should be,
 dnl check for plugins directory - stolen from Amanda's configure.in
 dnl
-plugindir="$libdir/ethereal/plugins/$VERSION"
+plugindir="$libdir/plugins/$VERSION"
 AC_ARG_WITH(plugins,
 changequote(<<, >>)dnl
 <<  --with-plugins[=DIR]    support plugins (installed in DIR, if supplied).>>,
@@ -1202,7 +1202,7 @@
 #
 # The plugin dissectors reside in ./plugins/PROTO/
 #
-PLUGIN_LIBS="-L../../epan -lethereal $GLIB_LIBS"
+PLUGIN_LIBS="-L../../epan $GLIB_LIBS"
 AC_SUBST(PLUGIN_LIBS)
 
 dnl libtool defs
--- ethereal-0.10.10.orig/aclocal.m4
+++ ethereal-0.10.10/aclocal.m4
@@ -11,9 +11,815 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+# Configure paths for GLIB
+# Owen Taylor     1997-2001
+
+dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or 
+dnl gthread is specified in MODULES, pass to pkg-config
+dnl
+AC_DEFUN([AM_PATH_GLIB_2_0],
+[dnl 
+dnl Get the cflags and libraries from pkg-config
+dnl
+AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
+		    , enable_glibtest=yes)
+
+  pkg_config_args=glib-2.0
+  for module in . $4
+  do
+      case "$module" in
+         gmodule) 
+             pkg_config_args="$pkg_config_args gmodule-2.0"
+         ;;
+         gmodule-no-export) 
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
+         gobject) 
+             pkg_config_args="$pkg_config_args gobject-2.0"
+         ;;
+         gthread) 
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+      esac
+  done
+
+  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+
+  no_glib=""
+
+  if test x$PKG_CONFIG != xno ; then
+    if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
+      :
+    else
+      echo *** pkg-config too old; version 0.7 or better required.
+      no_glib=yes
+      PKG_CONFIG=no
+    fi
+  else
+    no_glib=yes
+  fi
+
+  min_glib_version=ifelse([$1], ,2.0.0,$1)
+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+	  echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+	  enable_glibtest=no
+    fi
+
+    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
+	  :
+    else
+	  no_glib=yes
+    fi
+  fi
+
+  if test x"$no_glib" = x ; then
+    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
+    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+
+    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+dnl
+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
+dnl checks the results of pkg-config to some extent)
+dnl
+      rm -f conf.glibtest
+      AC_TRY_RUN([
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.glibtest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    } 
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+	   (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          ac_save_CFLAGS="$CFLAGS"
+          ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          AC_TRY_LINK([
+#include <glib.h>
+#include <stdio.h>
+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     GLIB_GENMARSHAL=""
+     GOBJECT_QUERY=""
+     GLIB_MKENUMS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GLIB_CFLAGS)
+  AC_SUBST(GLIB_LIBS)
+  AC_SUBST(GLIB_GENMARSHAL)
+  AC_SUBST(GOBJECT_QUERY)
+  AC_SUBST(GLIB_MKENUMS)
+  rm -f conf.glibtest
+])
+
+# Configure paths for GLIB
+# Owen Taylor     97-11-3
+
+dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or 
+dnl gthread is specified in MODULES, pass to glib-config
+dnl
+AC_DEFUN(AM_PATH_GLIB,
+[dnl 
+dnl Get the cflags and libraries from the glib-config script
+dnl
+AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
+            glib_config_prefix="$withval", glib_config_prefix="")
+AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
+            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
+AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
+		    , enable_glibtest=yes)
+
+  if test x$glib_config_exec_prefix != x ; then
+     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
+     if test x${GLIB_CONFIG+set} != xset ; then
+        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
+     fi
+  fi
+  if test x$glib_config_prefix != x ; then
+     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
+     if test x${GLIB_CONFIG+set} != xset ; then
+        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
+     fi
+  fi
+
+  for module in . $4
+  do
+      case "$module" in
+         gmodule) 
+             glib_config_args="$glib_config_args gmodule"
+         ;;
+         gthread) 
+             glib_config_args="$glib_config_args gthread"
+         ;;
+      esac
+  done
+
+  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
+  min_glib_version=ifelse([$1], ,0.99.7,$1)
+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+  no_glib=""
+  if test "$GLIB_CONFIG" = "no" ; then
+    no_glib=yes
+  else
+    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
+    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
+    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+dnl
+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
+dnl checks the results of glib-config to some extent
+dnl
+      rm -f conf.glibtest
+      AC_TRY_RUN([
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.glibtest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If glib-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
+      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    } 
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+	   (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
+        printf("*** correct copy of glib-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$GLIB_CONFIG" = "no" ; then
+       echo "*** The glib-config script installed by GLIB could not be found"
+       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
+       echo "*** full path to glib-config."
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          AC_TRY_LINK([
+#include <glib.h>
+#include <stdio.h>
+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***"
+          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
+          echo "*** came with the system with the command"
+          echo "***"
+          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
+          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
+          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GLIB_CFLAGS)
+  AC_SUBST(GLIB_LIBS)
+  rm -f conf.glibtest
+])
+
+# Configure paths for GTK+
+# Owen Taylor     1997-2001
+
+dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 
+dnl pass to pkg-config
+dnl
+AC_DEFUN([AM_PATH_GTK_2_0],
+[dnl 
+dnl Get the cflags and libraries from pkg-config
+dnl
+AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
+		    , enable_gtktest=yes)
+
+  pkg_config_args=gtk+-2.0
+  for module in . $4
+  do
+      case "$module" in
+         gthread) 
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+      esac
+  done
+
+  no_gtk=""
+
+  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+
+  if test x$PKG_CONFIG != xno ; then
+    if pkg-config --atleast-pkgconfig-version 0.7 ; then
+      :
+    else
+      echo "*** pkg-config too old; version 0.7 or better required."
+      no_gtk=yes
+      PKG_CONFIG=no
+    fi
+  else
+    no_gtk=yes
+  fi
+
+  min_gtk_version=ifelse([$1], ,2.0.0,$1)
+  AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
+
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+	  echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
+	  enable_gtktest=no
+    fi
+
+    if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
+	  :
+    else
+	  no_gtk=yes
+    fi
+  fi
+
+  if test x"$no_gtk" = x ; then
+    GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
+    GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
+    gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_gtktest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GTK_CFLAGS"
+      LIBS="$GTK_LIBS $LIBS"
+dnl
+dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
+dnl checks the results of pkg-config to some extent)
+dnl
+      rm -f conf.gtktest
+      AC_TRY_RUN([
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.gtktest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_gtk_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_gtk_version");
+     exit(1);
+   }
+
+  if ((gtk_major_version != $gtk_config_major_version) ||
+      (gtk_minor_version != $gtk_config_minor_version) ||
+      (gtk_micro_version != $gtk_config_micro_version))
+    {
+      printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
+             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
+             gtk_major_version, gtk_minor_version, gtk_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    } 
+  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
+	   (gtk_minor_version != GTK_MINOR_VERSION) ||
+           (gtk_micro_version != GTK_MICRO_VERSION))
+    {
+      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
+	     GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     gtk_major_version, gtk_minor_version, gtk_micro_version);
+    }
+  else
+    {
+      if ((gtk_major_version > major) ||
+        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
+               gtk_major_version, gtk_minor_version, gtk_micro_version);
+        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_gtk" = x ; then
+     AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://pkgconfig.sourceforge.net"
+     else
+       if test -f conf.gtktest ; then
+        :
+       else
+          echo "*** Could not run GTK+ test program, checking why..."
+	  ac_save_CFLAGS="$CFLAGS"
+	  ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GTK_CFLAGS"
+          LIBS="$LIBS $GTK_LIBS"
+          AC_TRY_LINK([
+#include <gtk/gtk.h>
+#include <stdio.h>
+],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
+          echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GTK_CFLAGS=""
+     GTK_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GTK_CFLAGS)
+  AC_SUBST(GTK_LIBS)
+  rm -f conf.gtktest
+])
+
+# Configure paths for GTK+
+# Owen Taylor     97-11-3
+
+dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
+dnl
+AC_DEFUN(AM_PATH_GTK,
+[dnl 
+dnl Get the cflags and libraries from the gtk-config script
+dnl
+AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
+            gtk_config_prefix="$withval", gtk_config_prefix="")
+AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
+            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
+AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
+		    , enable_gtktest=yes)
+
+  for module in . $4
+  do
+      case "$module" in
+         gthread) 
+             gtk_config_args="$gtk_config_args gthread"
+         ;;
+      esac
+  done
+
+  if test x$gtk_config_exec_prefix != x ; then
+     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
+     if test x${GTK_CONFIG+set} != xset ; then
+        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
+     fi
+  fi
+  if test x$gtk_config_prefix != x ; then
+     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
+     if test x${GTK_CONFIG+set} != xset ; then
+        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
+     fi
+  fi
+
+  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
+  min_gtk_version=ifelse([$1], ,0.99.7,$1)
+  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
+  no_gtk=""
+  if test "$GTK_CONFIG" = "no" ; then
+    no_gtk=yes
+  else
+    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
+    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
+    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_gtktest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GTK_CFLAGS"
+      LIBS="$GTK_LIBS $LIBS"
+dnl
+dnl Now check if the installed GTK is sufficiently new. (Also sanity
+dnl checks the results of gtk-config to some extent
+dnl
+      rm -f conf.gtktest
+      AC_TRY_RUN([
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.gtktest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_gtk_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_gtk_version");
+     exit(1);
+   }
+
+  if ((gtk_major_version != $gtk_config_major_version) ||
+      (gtk_minor_version != $gtk_config_minor_version) ||
+      (gtk_micro_version != $gtk_config_micro_version))
+    {
+      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
+             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
+             gtk_major_version, gtk_minor_version, gtk_micro_version);
+      printf ("*** was found! If gtk-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
+      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    } 
+#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
+  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
+	   (gtk_minor_version != GTK_MINOR_VERSION) ||
+           (gtk_micro_version != GTK_MICRO_VERSION))
+    {
+      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
+	     GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     gtk_major_version, gtk_minor_version, gtk_micro_version);
+    }
+#endif /* defined (GTK_MAJOR_VERSION) ... */
+  else
+    {
+      if ((gtk_major_version > major) ||
+        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
+               gtk_major_version, gtk_minor_version, gtk_micro_version);
+        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
+        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_gtk" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$GTK_CONFIG" = "no" ; then
+       echo "*** The gtk-config script installed by GTK could not be found"
+       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GTK_CONFIG environment variable to the"
+       echo "*** full path to gtk-config."
+     else
+       if test -f conf.gtktest ; then
+        :
+       else
+          echo "*** Could not run GTK test program, checking why..."
+          CFLAGS="$CFLAGS $GTK_CFLAGS"
+          LIBS="$LIBS $GTK_LIBS"
+          AC_TRY_LINK([
+#include <gtk/gtk.h>
+#include <stdio.h>
+],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GTK or finding the wrong"
+          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***"
+          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
+          echo "*** came with the system with the command"
+          echo "***"
+          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
+          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
+          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GTK_CFLAGS=""
+     GTK_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GTK_CFLAGS)
+  AC_SUBST(GTK_LIBS)
+  rm -f conf.gtktest
+])
+
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 
 # serial 47 AC_PROG_LIBTOOL
+# Debian $Rev: 214 $
 
 
 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
@@ -220,7 +1026,6 @@
 tagname=
 AC_LIBTOOL_LANG_C_CONFIG
 _LT_AC_TAGCONFIG
-_LT_AC_SHARED_EXT
 ])# AC_LIBTOOL_SETUP
 
 
@@ -524,20 +1329,6 @@
   rm -rf conftest*
   ;;
 
-*-*-linux*)
-  # Test if the compiler is 64bit
-  echo 'int i;' > conftest.$ac_ext
-  lt_cv_cc_64bit_output=no
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *"ELF 64"*)
-      lt_cv_cc_64bit_output=yes
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-  
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   SAVE_CFLAGS="$CFLAGS"
@@ -647,7 +1438,7 @@
 AC_MSG_CHECKING([the maximum length of command line arguments])
 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   i=0
-  testring="ABCD"
+  teststring="ABCD"
 
   case $build_os in
   msdosdjgpp*)
@@ -686,16 +1477,16 @@
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
-    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
-	       = "XX$testring") >/dev/null 2>&1 &&
-	    new_result=`expr "X$testring" : ".*" 2>&1` &&
+    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
 	    lt_cv_sys_max_cmd_len=$new_result &&
 	    test $i != 17 # 1/2 MB should be enough
     do
       i=`expr $i + 1`
-      testring=$testring$testring
+      teststring=$teststring$teststring
     done
-    testring=
+    teststring=
     # Add a significant safety factor because C++ compilers can tack on massive
     # amounts of additional arguments before passing them to the linker.
     # It appears as though 1/2 is a usable value.
@@ -1091,7 +1882,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext=".so"
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -1204,7 +1995,7 @@
 
 cygwin* | mingw* | pw32*)
   version_type=windows
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -1251,30 +2042,6 @@
     esac
     ;;
 
-  linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        $archive_expsym_cmds="$archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
   *)
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
@@ -1293,7 +2060,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -1376,7 +2143,7 @@
   need_version=no
   case "$host_cpu" in
   ia64*)
-    shrext='.so'
+    shrext_cmds='.so'
     hardcode_into_libs=yes
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
@@ -1391,7 +2158,7 @@
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
    hppa*64*)
-     shrext='.sl'
+     shrext_cmds='.sl'
      hardcode_into_libs=yes
      dynamic_linker="$host_os dld.sl"
      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
@@ -1402,7 +2169,7 @@
      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
      ;;
    *)
-    shrext='.sl'
+    shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
@@ -1473,17 +2240,10 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+    lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
-    ;;
-  esac
-
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
   # GNU dynamic linker.  Since this was broken with cross compilers,
@@ -1491,26 +2251,18 @@
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
   dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-  # Find out which ABI we are using (multilib Linux x86_64 hack).
-  libsuff=
-  case "$host_cpu" in
-  x86_64*)
-    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-    if AC_TRY_EVAL(ac_compile); then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  *)
-    ;;
-  esac
-  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
-  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
   ;;
 
 knetbsd*-gnu)
@@ -1583,7 +2335,7 @@
 
 os2*)
   libname_spec='$name'
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_lib_prefix=no
   library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
@@ -1780,24 +2532,6 @@
 fi
 ])# _LT_AC_TAGCONFIG
 
-# _LT_AC_SHARED_EXT
-# ----------------
-AC_DEFUN([_LT_AC_SHARED_EXT],[
-  if test ! -f "${ofile}"; then
-    AC_MSG_WARN([output file `$ofile' does not exist])
-  fi
-  if test -z "`grep -e 'shared_ext.*shrext' $ofile`"; then
-    # Make sure $shared_ext gets set to $shrext
-    if sed -e 's/shared_ext/shrext/g' "$ofile" > "${ofile}T"; then
-      mv "${ofile}T" "$ofile"
-      chmod +x "$ofile"
-    else
-      rm -f "${ofile}T"
-      AC_MSG_ERROR([unable to update shared_ext.])
-    fi
-  fi
-])# _LT_AC_SHARED_EXT
-
 
 # AC_LIBTOOL_DLOPEN
 # -----------------
@@ -2192,14 +2926,14 @@
   ;;
 
 cygwin*)
-  # win32_libid is a shell function defined in ltmain.sh
+  # func_win32_libid is a shell function defined in ltmain.sh
   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='win32_libid'
+  lt_cv_file_magic_cmd='func_win32_libid'
   ;;
 
 mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
-  # win32_libid shell function, so use a weaker test based on 'objdump'.
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
   lt_cv_file_magic_cmd='$OBJDUMP -f'
   ;;
@@ -2258,19 +2992,10 @@
 
 # This must be Linux ELF.
 linux*)
-  case $host_cpu in
-  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64*)
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -2619,7 +3344,7 @@
   fi
   ;;
 
-aix4*)
+aix4* | aix5*)
   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
     test "$enable_shared" = yes && enable_static=no
   fi
@@ -3067,7 +3792,7 @@
       # explicitly linking system object files so we need to strip them
       # from the output so that they don't get included in the library
       # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -3264,7 +3989,7 @@
 	;;
     esac
     ;;
-  netbsd*)
+  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
       wlarc=
@@ -3770,7 +4495,7 @@
     postinstall_cmds='$RANLIB $lib'
   fi
   ;;
-aix4*)
+aix4* | aix5*)
   test "$enable_shared" = yes && enable_static=no
   ;;
 esac
@@ -4125,7 +4850,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -4754,7 +5479,7 @@
 	    ;;
 	esac
 	;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
@@ -5065,6 +5790,9 @@
   cygwin* | mingw*)
     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
+  linux*)
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
+  ;;
   *)
     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
@@ -5194,7 +5922,7 @@
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -5233,7 +5961,7 @@
       ;;
 
   linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	_LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
       supports_anon_versioning=no
@@ -5252,6 +5980,7 @@
       else
         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
       fi
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=no
     else
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
     fi
@@ -5433,7 +6162,7 @@
       # Tell ltmain to make .lib files, not .a files.
       libext=lib
       # Tell ltmain to make .dll files, not .so files.
-      shrext=".dll"
+      shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
@@ -5611,7 +6340,7 @@
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -6955,8 +7684,4 @@
 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-m4_include([./aclocal-fallback/glib-2.0.m4])
-m4_include([./aclocal-fallback/glib.m4])
-m4_include([./aclocal-fallback/gtk-2.0.m4])
-m4_include([./aclocal-fallback/gtk.m4])
 m4_include([acinclude.m4])
--- ethereal-0.10.10.orig/smb.h
+++ ethereal-0.10.10/smb.h
@@ -2,7 +2,7 @@
  * Defines for smb packet dissection
  * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
  *
- * $Id: smb.h 12145 2004-09-30 01:04:33Z guy $
+ * $Id: smb.h 14107 2005-04-16 21:54:32Z gerald $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -194,12 +194,20 @@
  */
 #define SMB_SIF_TID_IS_IPC	0x0001
 #define SMB_SIF_IS_CONTINUED	0x0002
+typedef enum {
+	SMB_EI_NONE,	/* Unassigned / NULL */
+	SMB_EI_FID,	/* FID */
+	SMB_EI_NTI,	/* smb_nt_transact_info_t * */
+	SMB_EI_TRI,	/* smb_transact_info_t * */
+	SMB_EI_T2I	/* smb_transact2_info_t * */
+} smb_extra_info_t;
 typedef struct {
 	guint32 frame_req, frame_res;
 	nstime_t req_time;
 	guint16 flags;
 	guint8 cmd;
 	void *extra_info;
+	smb_extra_info_t extra_info_type;
 } smb_saved_info_t;
 
 /*
--- ethereal-0.10.10.orig/Makefile.in
+++ ethereal-0.10.10/Makefile.in
@@ -102,11 +102,8 @@
 	depcomp install-sh ltmain.sh missing text2pcap-scanner.c
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
--- ethereal-0.10.10.orig/configure
+++ ethereal-0.10.10/configure
@@ -1182,7 +1182,7 @@
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 
@@ -2635,8 +2635,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2694,8 +2693,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2811,8 +2809,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2866,8 +2863,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2912,8 +2908,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2957,8 +2952,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3743,14 +3737,14 @@
   ;;
 
 cygwin*)
-  # win32_libid is a shell function defined in ltmain.sh
+  # func_win32_libid is a shell function defined in ltmain.sh
   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='win32_libid'
+  lt_cv_file_magic_cmd='func_win32_libid'
   ;;
 
 mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
-  # win32_libid shell function, so use a weaker test based on 'objdump'.
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
   lt_cv_file_magic_cmd='$OBJDUMP -f'
   ;;
@@ -3809,19 +3803,10 @@
 
 # This must be Linux ELF.
 linux*)
-  case $host_cpu in
-  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64*)
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -3938,7 +3923,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3941 "configure"' > conftest.$ac_ext
+  echo '#line 3926 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -4019,24 +4004,6 @@
   rm -rf conftest*
   ;;
 
-*-*-linux*)
-  # Test if the compiler is 64bit
-  echo 'int i;' > conftest.$ac_ext
-  lt_cv_cc_64bit_output=no
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *"ELF 64"*)
-      lt_cv_cc_64bit_output=yes
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   SAVE_CFLAGS="$CFLAGS"
@@ -4076,8 +4043,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4152,8 +4118,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4323,8 +4288,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4391,8 +4355,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4652,8 +4615,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4711,8 +4673,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4783,8 +4744,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4828,8 +4788,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5294,7 +5253,7 @@
 
 
 # Provide some information about the compiler.
-echo "$as_me:5297:" \
+echo "$as_me:5256:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -5340,8 +5299,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5390,8 +5348,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5449,7 +5406,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
     i=0
-  testring="ABCD"
+  teststring="ABCD"
 
   case $build_os in
   msdosdjgpp*)
@@ -5488,16 +5445,16 @@
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
-    while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
-	       = "XX$testring") >/dev/null 2>&1 &&
-	    new_result=`expr "X$testring" : ".*" 2>&1` &&
+    while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
 	    lt_cv_sys_max_cmd_len=$new_result &&
 	    test $i != 17 # 1/2 MB should be enough
     do
       i=`expr $i + 1`
-      testring=$testring$testring
+      teststring=$teststring$teststring
     done
-    testring=
+    teststring=
     # Add a significant safety factor because C++ compilers can tack on massive
     # amounts of additional arguments before passing them to the linker.
     # It appears as though 1/2 is a usable value.
@@ -6328,11 +6285,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6331: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6288: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6335: \$? = $ac_status" >&5
+   echo "$as_me:6292: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -6561,11 +6518,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6564: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6521: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6568: \$? = $ac_status" >&5
+   echo "$as_me:6525: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -6621,11 +6578,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6624: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6581: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6628: \$? = $ac_status" >&5
+   echo "$as_me:6585: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -6798,7 +6755,7 @@
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -6837,7 +6794,7 @@
       ;;
 
   linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_cmds="$tmp_archive_cmds"
       supports_anon_versioning=no
@@ -6856,6 +6813,7 @@
       else
         archive_expsym_cmds="$tmp_archive_cmds"
       fi
+      link_all_deplibs=no
     else
       ld_shlibs=no
     fi
@@ -7012,8 +6970,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7073,8 +7030,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7139,7 +7095,7 @@
       # Tell ltmain to make .lib files, not .a files.
       libext=lib
       # Tell ltmain to make .dll files, not .so files.
-      shrext=".dll"
+      shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
       archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
@@ -7317,7 +7273,7 @@
       link_all_deplibs=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -7595,7 +7551,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext=".so"
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -7708,7 +7664,7 @@
 
 cygwin* | mingw* | pw32*)
   version_type=windows
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -7755,30 +7711,6 @@
     esac
     ;;
 
-  linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        $archive_expsym_cmds="$archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
   *)
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
@@ -7797,7 +7729,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -7880,7 +7812,7 @@
   need_version=no
   case "$host_cpu" in
   ia64*)
-    shrext='.so'
+    shrext_cmds='.so'
     hardcode_into_libs=yes
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
@@ -7895,7 +7827,7 @@
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
    hppa*64*)
-     shrext='.sl'
+     shrext_cmds='.sl'
      hardcode_into_libs=yes
      dynamic_linker="$host_os dld.sl"
      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
@@ -7906,7 +7838,7 @@
      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
      ;;
    *)
-    shrext='.sl'
+    shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
@@ -7977,17 +7909,10 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
-    ;;
-  esac
-
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
   # GNU dynamic linker.  Since this was broken with cross compilers,
@@ -7995,30 +7920,18 @@
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
   dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-  # Find out which ABI we are using (multilib Linux x86_64 hack).
-  libsuff=
-  case "$host_cpu" in
-  x86_64*)
-    echo '#line 8003 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  *)
-    ;;
-  esac
-  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
-  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
   ;;
 
 knetbsd*-gnu)
@@ -8091,7 +8004,7 @@
 
 os2*)
   libname_spec='$name'
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_lib_prefix=no
   library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
@@ -8320,8 +8233,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8424,8 +8336,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8490,8 +8401,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8584,8 +8494,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8650,8 +8559,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8717,8 +8625,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8784,8 +8691,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8860,7 +8766,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8863 "configure"
+#line 8769 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -8958,7 +8864,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8961 "configure"
+#line 8867 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9083,7 +8989,7 @@
   fi
   ;;
 
-aix4*)
+aix4* | aix5*)
   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
     test "$enable_shared" = yes && enable_static=no
   fi
@@ -9359,7 +9265,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -10030,8 +9936,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10092,8 +9997,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10274,7 +10178,7 @@
       # explicitly linking system object files so we need to strip them
       # from the output so that they don't get included in the library
       # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -10471,7 +10375,7 @@
 	;;
     esac
     ;;
-  netbsd*)
+  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
       archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
       wlarc=
@@ -11026,7 +10930,7 @@
 	    ;;
 	esac
 	;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
@@ -11137,11 +11041,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11140: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11044: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11144: \$? = $ac_status" >&5
+   echo "$as_me:11048: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -11197,11 +11101,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11200: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11104: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11204: \$? = $ac_status" >&5
+   echo "$as_me:11108: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -11267,6 +11171,9 @@
   cygwin* | mingw*)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
+  linux*)
+    link_all_deplibs_CXX=no
+  ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
@@ -11348,7 +11255,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext=".so"
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -11461,7 +11368,7 @@
 
 cygwin* | mingw* | pw32*)
   version_type=windows
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -11508,30 +11415,6 @@
     esac
     ;;
 
-  linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        $archive_expsym_cmds="$archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
   *)
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
@@ -11550,7 +11433,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -11633,7 +11516,7 @@
   need_version=no
   case "$host_cpu" in
   ia64*)
-    shrext='.so'
+    shrext_cmds='.so'
     hardcode_into_libs=yes
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
@@ -11648,7 +11531,7 @@
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
    hppa*64*)
-     shrext='.sl'
+     shrext_cmds='.sl'
      hardcode_into_libs=yes
      dynamic_linker="$host_os dld.sl"
      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
@@ -11659,7 +11542,7 @@
      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
      ;;
    *)
-    shrext='.sl'
+    shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
@@ -11730,17 +11613,10 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
-    ;;
-  esac
-
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
   # GNU dynamic linker.  Since this was broken with cross compilers,
@@ -11748,30 +11624,18 @@
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
   dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-  # Find out which ABI we are using (multilib Linux x86_64 hack).
-  libsuff=
-  case "$host_cpu" in
-  x86_64*)
-    echo '#line 11756 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  *)
-    ;;
-  esac
-  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
-  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
   ;;
 
 knetbsd*-gnu)
@@ -11844,7 +11708,7 @@
 
 os2*)
   libname_spec='$name'
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_lib_prefix=no
   library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
@@ -12073,8 +11937,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12177,8 +12040,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12243,8 +12105,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12337,8 +12198,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12403,8 +12263,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12470,8 +12329,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12537,8 +12395,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12613,7 +12470,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12616 "configure"
+#line 12473 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12711,7 +12568,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12714 "configure"
+#line 12571 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12990,7 +12847,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -13312,7 +13169,7 @@
     postinstall_cmds='$RANLIB $lib'
   fi
   ;;
-aix4*)
+aix4* | aix5*)
   test "$enable_shared" = yes && enable_static=no
   ;;
 esac
@@ -13538,11 +13395,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13541: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13398: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13545: \$? = $ac_status" >&5
+   echo "$as_me:13402: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -13598,11 +13455,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13601: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13458: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13605: \$? = $ac_status" >&5
+   echo "$as_me:13462: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -13775,7 +13632,7 @@
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -13814,7 +13671,7 @@
       ;;
 
   linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_cmds_F77="$tmp_archive_cmds"
       supports_anon_versioning=no
@@ -13833,6 +13690,7 @@
       else
         archive_expsym_cmds_F77="$tmp_archive_cmds"
       fi
+      link_all_deplibs_F77=no
     else
       ld_shlibs_F77=no
     fi
@@ -13979,8 +13837,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14030,8 +13887,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14096,7 +13952,7 @@
       # Tell ltmain to make .lib files, not .a files.
       libext=lib
       # Tell ltmain to make .dll files, not .so files.
-      shrext=".dll"
+      shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
       archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
@@ -14274,7 +14130,7 @@
       link_all_deplibs_F77=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -14552,7 +14408,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext=".so"
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -14665,7 +14521,7 @@
 
 cygwin* | mingw* | pw32*)
   version_type=windows
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -14712,30 +14568,6 @@
     esac
     ;;
 
-  linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        $archive_expsym_cmds="$archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
   *)
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
@@ -14754,7 +14586,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -14837,7 +14669,7 @@
   need_version=no
   case "$host_cpu" in
   ia64*)
-    shrext='.so'
+    shrext_cmds='.so'
     hardcode_into_libs=yes
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
@@ -14852,7 +14684,7 @@
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
    hppa*64*)
-     shrext='.sl'
+     shrext_cmds='.sl'
      hardcode_into_libs=yes
      dynamic_linker="$host_os dld.sl"
      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
@@ -14863,7 +14695,7 @@
      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
      ;;
    *)
-    shrext='.sl'
+    shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
@@ -14934,17 +14766,10 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
-    ;;
-  esac
-
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
   # GNU dynamic linker.  Since this was broken with cross compilers,
@@ -14952,30 +14777,18 @@
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
   dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-  # Find out which ABI we are using (multilib Linux x86_64 hack).
-  libsuff=
-  case "$host_cpu" in
-  x86_64*)
-    echo '#line 14960 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  *)
-    ;;
-  esac
-  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
-  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
   ;;
 
 knetbsd*-gnu)
@@ -15048,7 +14861,7 @@
 
 os2*)
   libname_spec='$name'
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_lib_prefix=no
   library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
@@ -15389,7 +15202,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -15687,11 +15500,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15690: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15503: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15694: \$? = $ac_status" >&5
+   echo "$as_me:15507: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -15920,11 +15733,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15923: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15736: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15927: \$? = $ac_status" >&5
+   echo "$as_me:15740: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -15980,11 +15793,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15983: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15796: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15987: \$? = $ac_status" >&5
+   echo "$as_me:15800: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16157,7 +15970,7 @@
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -16196,7 +16009,7 @@
       ;;
 
   linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_cmds_GCJ="$tmp_archive_cmds"
       supports_anon_versioning=no
@@ -16215,6 +16028,7 @@
       else
         archive_expsym_cmds_GCJ="$tmp_archive_cmds"
       fi
+      link_all_deplibs_GCJ=no
     else
       ld_shlibs_GCJ=no
     fi
@@ -16371,8 +16185,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16432,8 +16245,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16498,7 +16310,7 @@
       # Tell ltmain to make .lib files, not .a files.
       libext=lib
       # Tell ltmain to make .dll files, not .so files.
-      shrext=".dll"
+      shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
       archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
@@ -16676,7 +16488,7 @@
       link_all_deplibs_GCJ=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -16954,7 +16766,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext=".so"
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -17067,7 +16879,7 @@
 
 cygwin* | mingw* | pw32*)
   version_type=windows
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -17114,30 +16926,6 @@
     esac
     ;;
 
-  linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        $archive_expsym_cmds="$archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
   *)
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
@@ -17156,7 +16944,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -17239,7 +17027,7 @@
   need_version=no
   case "$host_cpu" in
   ia64*)
-    shrext='.so'
+    shrext_cmds='.so'
     hardcode_into_libs=yes
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
@@ -17254,7 +17042,7 @@
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
    hppa*64*)
-     shrext='.sl'
+     shrext_cmds='.sl'
      hardcode_into_libs=yes
      dynamic_linker="$host_os dld.sl"
      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
@@ -17265,7 +17053,7 @@
      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
      ;;
    *)
-    shrext='.sl'
+    shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
@@ -17336,17 +17124,10 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
-    ;;
-  esac
-
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
   # GNU dynamic linker.  Since this was broken with cross compilers,
@@ -17354,30 +17135,18 @@
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
   dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-  # Find out which ABI we are using (multilib Linux x86_64 hack).
-  libsuff=
-  case "$host_cpu" in
-  x86_64*)
-    echo '#line 17362 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  *)
-    ;;
-  esac
-  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
-  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
   ;;
 
 knetbsd*-gnu)
@@ -17450,7 +17219,7 @@
 
 os2*)
   libname_spec='$name'
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_lib_prefix=no
   library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
@@ -17679,8 +17448,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17783,8 +17551,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17849,8 +17616,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17943,8 +17709,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18009,8 +17774,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18076,8 +17840,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18143,8 +17906,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18219,7 +17981,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18222 "configure"
+#line 17984 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18317,7 +18079,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18320 "configure"
+#line 18082 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18596,7 +18358,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -19041,7 +18803,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -19303,24 +19065,6 @@
 fi
 
 
-  if test ! -f "${ofile}"; then
-    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
-  fi
-  if test -z "`grep -e 'shared_ext.*shrext' $ofile`"; then
-    # Make sure $shared_ext gets set to $shrext
-    if sed -e 's/shared_ext/shrext/g' "$ofile" > "${ofile}T"; then
-      mv "${ofile}T" "$ofile"
-      chmod +x "$ofile"
-    else
-      rm -f "${ofile}T"
-      { { echo "$as_me:$LINENO: error: unable to update shared_ext." >&5
-echo "$as_me: error: unable to update shared_ext." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-  fi
-
-
 
 # This can be used to rebuild libtool when needed
 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
@@ -19471,8 +19215,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19538,8 +19281,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -19628,8 +19370,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20660,8 +20401,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20972,7 +20712,7 @@
     if pkg-config --atleast-pkgconfig-version 0.7 ; then
       :
     else
-      echo *** pkg-config too old; version 0.7 or better required.
+      echo "*** pkg-config too old; version 0.7 or better required."
       no_gtk=yes
       PKG_CONFIG=no
     fi
@@ -21167,8 +20907,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21476,8 +21215,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21561,6 +21299,9 @@
          gmodule)
              pkg_config_args="$pkg_config_args gmodule-2.0"
          ;;
+         gmodule-no-export)
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
          gobject)
              pkg_config_args="$pkg_config_args gobject-2.0"
          ;;
@@ -21816,8 +21557,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -22133,8 +21873,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -22207,6 +21946,9 @@
          gmodule)
              pkg_config_args="$pkg_config_args gmodule-2.0"
          ;;
+         gmodule-no-export)
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
          gobject)
              pkg_config_args="$pkg_config_args gobject-2.0"
          ;;
@@ -22462,8 +22204,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -22779,8 +22520,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -22942,8 +22682,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -23091,8 +22830,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -23655,8 +23393,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -23721,8 +23458,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -23829,8 +23565,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -23895,8 +23630,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -24065,8 +23799,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -24229,8 +23962,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -24298,8 +24030,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -24378,8 +24109,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -24481,8 +24211,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -24562,8 +24291,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -24674,8 +24402,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -24778,8 +24505,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -24913,8 +24639,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -25123,8 +24848,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -25252,8 +24976,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -25385,8 +25108,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -25577,8 +25299,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -25906,8 +25627,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -26079,8 +25799,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -26237,8 +25956,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -26387,8 +26105,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -26538,8 +26255,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -26688,8 +26404,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -26875,8 +26590,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -27065,8 +26779,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -27283,8 +26996,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -27453,8 +27165,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -27522,8 +27233,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -27792,8 +27502,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -27998,8 +27707,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -28220,8 +27928,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -28311,8 +28018,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -28380,8 +28086,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -28423,8 +28128,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -28481,8 +28185,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -28698,8 +28401,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -28807,8 +28509,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -28916,8 +28617,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29019,8 +28719,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29122,8 +28821,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29230,8 +28928,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29344,8 +29041,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29430,8 +29126,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29485,8 +29180,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29625,8 +29319,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29680,8 +29373,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29743,8 +29435,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29799,8 +29490,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -29914,8 +29604,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -30028,8 +29717,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -30064,7 +29752,7 @@
 
 
 
-plugindir="$libdir/ethereal/plugins/$VERSION"
+plugindir="$libdir/plugins/$VERSION"
 
 # Check whether --with-plugins or --without-plugins was given.
 if test "${with_plugins+set}" = set; then
@@ -30134,7 +29822,7 @@
 #
 # The plugin dissectors reside in ./plugins/PROTO/
 #
-PLUGIN_LIBS="-L../../epan -lethereal $GLIB_LIBS"
+PLUGIN_LIBS="-L../../epan $GLIB_LIBS"
 
 
 #
@@ -31346,11 +31034,6 @@
   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -31389,6 +31072,12 @@
 	 fi;;
       esac
     done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
@@ -32074,7 +31763,7 @@
    { (exit 1); exit 1; }; }
     fi
 
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 
--- ethereal-0.10.10.orig/ltmain.sh
+++ ethereal-0.10.10/ltmain.sh
@@ -1,7 +1,7 @@
 # ltmain.sh - Provide generalized library-building support services.
 # NOTE: Changing this file will not affect anything until you rerun configure.
 #
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
 # Free Software Foundation, Inc.
 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
@@ -24,6 +24,29 @@
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.6
+TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 224 $"
+
+
 # Check that we have a working $echo.
 if test "X$1" = X--no-reexec; then
   # Discard the --no-reexec flag, and continue.
@@ -36,7 +59,7 @@
   :
 else
   # Restart under the correct shell, and then maybe $echo will work.
-  exec $SHELL "$0" --no-reexec ${1+"$@"}
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
 fi
 
 if test "X$1" = X--fallback-echo; then
@@ -45,22 +68,9 @@
   cat <<EOF
 $*
 EOF
-  exit 0
+  exit $EXIT_SUCCESS
 fi
 
-# define SED for historic ltconfig's generated by Libtool 1.3
-test -z "$SED" && SED=sed
-
-# The name of this program.
-progname=`$echo "$0" | ${SED} 's%^.*/%%'`
-modename="$progname"
-
-# Constants.
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION=1.5.2
-TIMESTAMP=" (1.1220.2.60 2004/01/25 12:25:08)"
-
 default_mode=
 help="Try \`$progname --help' for more information."
 magic="%%%MAGIC variable%%%"
@@ -103,7 +113,7 @@
 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
   $echo "$modename: not configured to build any kind of library" 1>&2
   $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-  exit 1
+  exit $EXIT_FAILURE
 fi
 
 # Global variables.
@@ -118,38 +128,17 @@
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
 
-if test -z "$max_cmd_len"; then
-  i=0
-  testring="ABCD"
-  new_result=
-  
-  # If test is not a shell built-in, we'll probably end up computing a
-  # maximum length that is only half of the actual maximum length, but
-  # we can't tell.
-  while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
-             = "XX$testring") >/dev/null 2>&1 &&
-          new_result=`expr "X$testring" : ".*" 2>&1` &&
-          max_cmd_len="$new_result" &&
-          test "$i" != 17 # 1/2 MB should be enough
-  do
-    i=`expr $i + 1`
-    testring="$testring$testring"
-  done
-  testring=
-  # Add a significant safety factor because C++ compilers can tack on massive
-  # amounts of additional arguments before passing them to the linker.
-  # It appears as though 1/2 is a usable value.
-  max_cmd_len=`expr $max_cmd_len \/ 2`
-fi
-
 #####################################
 # Shell function definitions:
 # This seems to be the best place for them
 
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
 # Need a lot of goo to handle *both* DLLs and import libs
 # Has to be a shell function in order to 'eat' the argument
 # that is supplied when $file_magic_command is called.
-win32_libid () {
+func_win32_libid () {
   win32_libid_type="unknown"
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
@@ -158,7 +147,7 @@
     ;;
   *ar\ archive*) # could be an import, or static
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
-      grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
       win32_nmres=`eval $NM -f posix -A $1 | \
 	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
       if test "X$win32_nmres" = "Ximport" ; then
@@ -168,7 +157,7 @@
       fi
     fi
     ;;
-  *DLL*) 
+  *DLL*)
     win32_libid_type="x86 DLL"
     ;;
   *executable*) # but shell scripts are "executable" too...
@@ -182,9 +171,76 @@
   $echo $win32_libid_type
 }
 
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag () {
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+	case $arg in
+	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	CC_quoted="$CC_quoted $arg"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	    # Double-quote args containing other shell metacharacters.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    CC_quoted="$CC_quoted $arg"
+	  done
+	    case "$@ " in
+	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  $echo "$modename: unable to infer tagged configuration"
+	  $echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit $EXIT_FAILURE
+#        else
+#          $echo "$modename: using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
 # End of Shell function definitions
 #####################################
 
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
+
 # Parse our command line options once, thoroughly.
 while test "$#" -gt 0
 do
@@ -210,7 +266,7 @@
       case $tagname in
       *[!-_A-Za-z0-9,/]*)
 	$echo "$progname: invalid tag name: $tagname" 1>&2
-	exit 1
+	exit $EXIT_FAILURE
 	;;
       esac
 
@@ -220,10 +276,10 @@
 	# not specially marked.
 	;;
       *)
-	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
+	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
 	  taglist="$taglist $tagname"
 	  # Evaluate the configuration.
-	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
+	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
 	else
 	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
 	fi
@@ -252,16 +308,16 @@
     $echo "Copyright (C) 2003  Free Software Foundation, Inc."
     $echo "This is free software; see the source for copying conditions.  There is NO"
     $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-    exit 0
+    exit $EXIT_SUCCESS
     ;;
 
   --config)
-    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
     # Now print the configurations for the tags.
     for tagname in $taglist; do
-      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
+      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
     done
-    exit 0
+    exit $EXIT_SUCCESS
     ;;
 
   --debug)
@@ -286,7 +342,7 @@
     else
       $echo "disable static libraries"
     fi
-    exit 0
+    exit $EXIT_SUCCESS
     ;;
 
   --finish) mode="finish" ;;
@@ -317,7 +373,7 @@
   -*)
     $echo "$modename: unrecognized option \`$arg'" 1>&2
     $echo "$help" 1>&2
-    exit 1
+    exit $EXIT_FAILURE
     ;;
 
   *)
@@ -330,7 +386,7 @@
 if test -n "$prevopt"; then
   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
   $echo "$help" 1>&2
-  exit 1
+  exit $EXIT_FAILURE
 fi
 
 # If this variable is set in any of the actions, the command in it
@@ -386,7 +442,7 @@
   if test -n "$execute_dlfiles" && test "$mode" != execute; then
     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
     $echo "$help" 1>&2
-    exit 1
+    exit $EXIT_FAILURE
   fi
 
   # Change the help message to a mode-specific one.
@@ -428,7 +484,7 @@
 	-o)
 	  if test -n "$libobj" ; then
 	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
 	  arg_mode=target
 	  continue
@@ -453,7 +509,7 @@
 	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
 	  lastarg=
 	  save_ifs="$IFS"; IFS=','
-	  for arg in $args; do
+ 	  for arg in $args; do
 	    IFS="$save_ifs"
 
 	    # Double-quote args containing other shell metacharacters.
@@ -503,11 +559,11 @@
     case $arg_mode in
     arg)
       $echo "$modename: you must specify an argument for -Xcompile"
-      exit 1
+      exit $EXIT_FAILURE
       ;;
     target)
       $echo "$modename: you must specify a target with \`-o'" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
       ;;
     *)
       # Get the name of the library object.
@@ -540,50 +596,11 @@
     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
     *)
       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
       ;;
     esac
 
-    # Infer tagged configuration to use if any are available and
-    # if one wasn't chosen via the "--tag" command line option.
-    # Only attempt this if the compiler in the base compile
-    # command doesn't match the default compiler.
-    if test -n "$available_tags" && test -z "$tagname"; then
-      case $base_compile in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
-      *)
-	for z in $available_tags; do
-	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
-	    case "$base_compile " in
-	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  $echo "$modename: unable to infer tagged configuration"
-	  $echo "$modename: specify a tag with \`--tag'" 1>&2
-	  exit 1
-#        else
-#          $echo "$modename: using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
+    func_infer_tag $base_compile
 
     for arg in $later; do
       case $arg in
@@ -616,7 +633,7 @@
     if test -z "$base_compile"; then
       $echo "$modename: you must specify a compilation command" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     # Delete any leftover library objects.
@@ -627,7 +644,7 @@
     fi
 
     $run $rm $removelist
-    trap "$run $rm $removelist; exit 1" 1 2 15
+    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
 
     # On Cygwin there's no "real" PIC flag so we must build both object types
     case $host_os in
@@ -646,7 +663,7 @@
       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
       lockfile="$output_obj.lock"
       removelist="$removelist $output_obj $lockfile"
-      trap "$run $rm $removelist; exit 1" 1 2 15
+      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
     else
       output_obj=
       need_locks=no
@@ -656,7 +673,7 @@
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
     if test "$need_locks" = yes; then
-      until $run ln "$0" "$lockfile" 2>/dev/null; do
+      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
 	$show "Waiting for $lockfile to be removed"
 	sleep 2
       done
@@ -674,7 +691,7 @@
 compiler."
 
 	$run $rm $removelist
-	exit 1
+	exit $EXIT_FAILURE
       fi
       $echo $srcfile > "$lockfile"
     fi
@@ -729,7 +746,7 @@
       if $run eval "$command"; then :
       else
 	test -n "$output_obj" && $run $rm $removelist
-	exit 1
+	exit $EXIT_FAILURE
       fi
 
       if test "$need_locks" = warn &&
@@ -749,7 +766,7 @@
 compiler."
 
 	$run $rm $removelist
-	exit 1
+	exit $EXIT_FAILURE
       fi
 
       # Just move the object if needed, then go on to compile the next one
@@ -801,7 +818,7 @@
       if $run eval "$command"; then :
       else
 	$run $rm $removelist
-	exit 1
+	exit $EXIT_FAILURE
       fi
 
       if test "$need_locks" = warn &&
@@ -821,7 +838,7 @@
 compiler."
 
 	$run $rm $removelist
-	exit 1
+	exit $EXIT_FAILURE
       fi
 
       # Just move the object if needed
@@ -859,7 +876,7 @@
       $run $rm "$lockfile"
     fi
 
-    exit 0
+    exit $EXIT_SUCCESS
     ;;
 
   # libtool link mode
@@ -931,46 +948,7 @@
     vinfo=
     vinfo_number=no
 
-    # Infer tagged configuration to use if any are available and
-    # if one wasn't chosen via the "--tag" command line option.
-    # Only attempt this if the compiler in the base link
-    # command doesn't match the default compiler.
-    if test -n "$available_tags" && test -z "$tagname"; then
-      case $base_compile in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
-      *)
-	for z in $available_tags; do
-	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
-	    case $base_compile in
-	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
-	      # The compiler in $compile_command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  $echo "$modename: unable to infer tagged configuration"
-	  $echo "$modename: specify a tag with \`--tag'" 1>&2
-	  exit 1
-#       else
-#         $echo "$modename: using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
+    func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
     for arg
@@ -1066,7 +1044,7 @@
 	  export_symbols="$arg"
 	  if test ! -f "$arg"; then
 	    $echo "$modename: symbol file \`$arg' does not exist"
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
 	  prev=
 	  continue
@@ -1118,7 +1096,7 @@
 		   test "$pic_object" = none && \
 		   test "$non_pic_object" = none; then
 		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-		  exit 1
+		  exit $EXIT_FAILURE
 		fi
 
 		# Extract subdirectory from the argument.
@@ -1171,7 +1149,7 @@
 		# Only an error if not doing a dry-run.
 		if test -z "$run"; then
 		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-		  exit 1
+		  exit $EXIT_FAILURE
 		else
 		  # Dry-run case.
 
@@ -1192,7 +1170,7 @@
 	    done
 	  else
 	    $echo "$modename: link input file \`$save_arg' does not exist"
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
 	  arg=$save_arg
 	  prev=
@@ -1204,7 +1182,7 @@
 	  [\\/]* | [A-Za-z]:[\\/]*) ;;
 	  *)
 	    $echo "$modename: only absolute run-paths are allowed" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	    ;;
 	  esac
 	  if test "$prev" = rpath; then
@@ -1244,6 +1222,11 @@
 	  finalize_command="$finalize_command $qarg"
 	  continue
 	  ;;
+	shrext)
+  	  shrext_cmds="$arg"
+	  prev=
+	  continue
+	  ;;
 	*)
 	  eval "$prev=\"\$arg\""
 	  prev=
@@ -1292,7 +1275,7 @@
       -export-symbols | -export-symbols-regex)
 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
 	  $echo "$modename: more than one -exported-symbols argument is not allowed"
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 	if test "X$arg" = "X-export-symbols"; then
 	  prev=expsyms
@@ -1328,7 +1311,7 @@
 	  absdir=`cd "$dir" && pwd`
 	  if test -z "$absdir"; then
 	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
 	  dir="$absdir"
 	  ;;
@@ -1479,7 +1462,7 @@
 	[\\/]* | [A-Za-z]:[\\/]*) ;;
 	*)
 	  $echo "$modename: only absolute run-paths are allowed" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	  ;;
 	esac
 	case "$xrpath " in
@@ -1565,11 +1548,6 @@
 	continue
 	;;
 
-      -Kthread | -mthreads | -mt | -pthread | -pthreads | -threads | -qthreaded | -kthread )
-        compiler_flags="$compiler_flags $arg"
-        continue
-        ;;
-
       # Some other compiler flag.
       -* | +*)
 	# Unknown arguments in both finalize_command and compile_command need
@@ -1607,7 +1585,7 @@
 	     test "$pic_object" = none && \
 	     test "$non_pic_object" = none; then
 	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
 
 	  # Extract subdirectory from the argument.
@@ -1660,7 +1638,7 @@
 	  # Only an error if not doing a dry-run.
 	  if test -z "$run"; then
 	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	  else
 	    # Dry-run case.
 
@@ -1727,7 +1705,7 @@
     if test -n "$prev"; then
       $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
@@ -1771,7 +1749,7 @@
     "")
       $echo "$modename: you must specify an output file" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
       ;;
     *.$libext) linkmode=oldlib ;;
     *.lo | *.$objext) linkmode=obj ;;
@@ -1781,7 +1759,7 @@
 
     case $host in
     *cygwin* | *mingw* | *pw32*)
-      # don't eliminate duplcations in $postdeps and $predeps
+      # don't eliminate duplications in $postdeps and $predeps
       duplicate_compiler_generated_deps=yes
       ;;
     *)
@@ -1834,7 +1812,7 @@
 	  *.la) ;;
 	  *)
 	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	    ;;
 	  esac
 	done
@@ -1860,7 +1838,10 @@
 	case $pass in
 	dlopen) libs="$dlfiles" ;;
 	dlpreopen) libs="$dlprefiles" ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	link)
+	  libs="$deplibs %DEPLIBS%"
+	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+	  ;;
 	esac
       fi
       if test "$pass" = dlopen; then
@@ -1886,13 +1867,9 @@
 	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
 	    continue
 	  fi
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	    continue
-	  fi
 	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
 	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
-	    for search_ext in .la $shrext .so .a; do
+	    for search_ext in .la $std_shrext .so .a; do
 	      # Search the libtool library
 	      lib="$searchdir/lib${name}${search_ext}"
 	      if test -f "$lib"; then
@@ -1968,11 +1945,11 @@
 	    fi
 	    if test "$pass" = scan; then
 	      deplibs="$deplib $deplibs"
-	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
 	      finalize_deplibs="$deplib $finalize_deplibs"
 	    fi
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
 	    ;;
 	  *)
 	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
@@ -2051,14 +2028,14 @@
 	if test "$found" = yes || test -f "$lib"; then :
 	else
 	  $echo "$modename: cannot find the library \`$lib'" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 
 	# Check to see that this really is a libtool archive.
 	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
 	else
 	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 
 	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
@@ -2094,7 +2071,7 @@
 	  if test -z "$libdir"; then
 	    if test -z "$old_library"; then
 	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-	      exit 1
+	      exit $EXIT_FAILURE
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
 	    convenience="$convenience $ladir/$objdir/$old_library"
@@ -2111,12 +2088,12 @@
 	    done
 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
 	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
 	  continue
 	fi # $pass = conv
 
-    
+
 	# Get the name of the library we link against.
 	linklib=
 	for l in $old_library $library_names; do
@@ -2124,16 +2101,18 @@
 	done
 	if test -z "$linklib"; then
 	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 
 	# This library was specified with -dlopen.
 	if test "$pass" = dlopen; then
 	  if test -z "$libdir"; then
 	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
-	  if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	  if test -z "$dlname" ||
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
 	    # If there is no dlname, no dlopen support or we're linking
 	    # statically, we need to preload.  We also need to preload any
 	    # dependent libraries so libltdl's deplib preloader doesn't
@@ -2182,7 +2161,7 @@
 	if test "$pass" = dlpreopen; then
 	  if test -z "$libdir"; then
 	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
 	  # Prefer using a static library (so that no silly _DYNAMIC symbols
 	  # are required to link).
@@ -2209,7 +2188,7 @@
 	  continue
 	fi
 
-    
+
 	if test "$linkmode" = prog && test "$pass" != link; then
 	  newlib_search_path="$newlib_search_path $ladir"
 	  deplibs="$lib $deplibs"
@@ -2296,17 +2275,18 @@
 	    need_relink=yes
 	  fi
 	  # This is a shared library
-	
-      # Warn about portability, can't link against -module's on some systems (darwin)
-      if test "$shouldnotlink" = yes && test "$pass" = link ; then
+
+	  # Warn about portability, can't link against -module's on
+	  # some systems (darwin)
+	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
 	    $echo
 	    if test "$linkmode" = prog; then
 	      $echo "*** Warning: Linking the executable $output against the loadable module"
 	    else
 	      $echo "*** Warning: Linking the shared library $output against the loadable module"
 	    fi
-	    $echo "*** $linklib is not portable!"    
-      fi	  
+	    $echo "*** $linklib is not portable!"
+	  fi
 	  if test "$linkmode" = lib &&
 	     test "$hardcode_into_libs" = yes; then
 	    # Hardcode the library path.
@@ -2404,9 +2384,9 @@
 		case $host in
 		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
 		  *-*-darwin* )
-		    # if the lib is a module then we can not link against it, someone
-		    # is ignoring the new warnings I added
-		    if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
+		    # if the lib is a module then we can not link against
+		    # it, someone is ignoring the new warnings I added
+		    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
 		      $echo "** Warning, lib $linklib is a module, not a shared library"
 		      if test -z "$old_library" ; then
 		        $echo
@@ -2414,7 +2394,7 @@
 		        $echo "** The link will probably fail, sorry"
 		      else
 		        add="$dir/$old_library"
-		      fi 
+		      fi
 		    fi
 		esac
 	      elif test "$hardcode_minus_L" = no; then
@@ -2456,7 +2436,7 @@
 
 	    if test "$lib_linked" != yes; then
 	      $echo "$modename: configuration error: unsupported hardcode properties"
-	      exit 1
+	      exit $EXIT_FAILURE
 	    fi
 
 	    if test -n "$add_shlibpath"; then
@@ -2499,7 +2479,8 @@
 	      esac
 	      add="-l$name"
 	    elif test "$hardcode_automatic" = yes; then
-	      if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
 	        add="$inst_prefix_dir$libdir/$linklib"
 	      else
 	        add="$libdir/$linklib"
@@ -2579,7 +2560,8 @@
 
 	if test "$linkmode" = lib; then
 	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
 	       test "$link_static" = yes; }; then
 	    # Extract -R from dependency_libs
 	    temp_deplibs=
@@ -2636,7 +2618,7 @@
 		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		  if test -z "$libdir"; then
 		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-		    exit 1
+		    exit $EXIT_FAILURE
 		  fi
 		  if test "$absdir" != "$libdir"; then
 		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
@@ -2646,7 +2628,8 @@
 		depdepl=
 		case $host in
 		*-*-darwin*)
-		  # we do not want to link against static libs, but need to link against shared
+		  # we do not want to link against static libs,
+		  # but need to link against shared
 		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
 		  if test -n "$deplibrary_names" ; then
 		    for tmp in $deplibrary_names ; do
@@ -2654,7 +2637,7 @@
 		    done
 		    if test -f "$path/$depdepl" ; then
 		      depdepl="$path/$depdepl"
-		   fi
+		    fi
 		    # do not add paths which are already there
 		    case " $newlib_search_path " in
 		    *" $path "*) ;;
@@ -2664,33 +2647,32 @@
 		  path=""
 		  ;;
 		*)
-		path="-L$path"
-		;;
-		esac 
-		
+		  path="-L$path"
+		  ;;
+		esac
 		;;
-		  -l*)
+	      -l*)
 		case $host in
 		*-*-darwin*)
-		 # Again, we only want to link against shared libraries
-		 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
-		 for tmp in $newlib_search_path ; do
-		     if test -f "$tmp/lib$tmp_libs.dylib" ; then
-		       eval depdepl="$tmp/lib$tmp_libs.dylib"
-		       break
-		     fi  
-         done
-         path=""
+		  # Again, we only want to link against shared libraries
+		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+		  for tmp in $newlib_search_path ; do
+		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
+		      eval depdepl="$tmp/lib$tmp_libs.dylib"
+		      break
+		    fi
+		  done
+		  path=""
 		  ;;
 		*) continue ;;
-		esac  		  
+		esac
 		;;
 	      *) continue ;;
 	      esac
 	      case " $deplibs " in
 	      *" $depdepl "*) ;;
-	      *) deplibs="$deplibs $depdepl" ;;
-	      esac	      
+	      *) deplibs="$depdepl $deplibs" ;;
+	      esac
 	      case " $deplibs " in
 	      *" $path "*) ;;
 	      *) deplibs="$deplibs $path" ;;
@@ -2780,7 +2762,8 @@
 	  eval $var=\"$tmp_libs\"
 	done # for var
       fi
-      # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
       tmp_libs=
       for i in $dependency_libs ; do
 	case " $predeps $postdeps $compiler_lib_search_path " in
@@ -2840,19 +2823,19 @@
       case $outputname in
       lib*)
 	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
-	eval shared_ext=\"$shrext\"
+	eval shared_ext=\"$shrext_cmds\"
 	eval libname=\"$libname_spec\"
 	;;
       *)
 	if test "$module" = no; then
 	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
 	  $echo "$help" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 	if test "$need_lib_prefix" != no; then
 	  # Add the "lib" prefix for modules if required
 	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
-	  eval shared_ext=\"$shrext\"
+	  eval shared_ext=\"$shrext_cmds\"
 	  eval libname=\"$libname_spec\"
 	else
 	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
@@ -2863,7 +2846,7 @@
       if test -n "$objs"; then
 	if test "$deplibs_check_method" != pass_all; then
 	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
-	  exit 1
+	  exit $EXIT_FAILURE
 	else
 	  $echo
 	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
@@ -2911,13 +2894,13 @@
 	if test -n "$8"; then
 	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
 	  $echo "$help" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 
 	# convert absolute version numbers to libtool ages
 	# this retains compatibility with .la files and attempts
 	# to make the code below a bit more comprehensible
-	
+
 	case $vinfo_number in
 	yes)
 	  number_major="$2"
@@ -2946,6 +2929,11 @@
 	    age="$number_minor"
 	    revision="$number_minor"
 	    ;;
+	  *)
+	    $echo "$modename: unknown library version type \`$version_type'" 1>&2
+	    $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+	    exit $EXIT_FAILURE
+	    ;;
 	  esac
 	  ;;
 	no)
@@ -2957,36 +2945,36 @@
 
 	# Check that each of the things are valid numbers.
 	case $current in
-	[0-9]*) ;;
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
 	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	  ;;
 	esac
 
 	case $revision in
-	[0-9]*) ;;
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
 	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	  ;;
 	esac
 
 	case $age in
-	[0-9]*) ;;
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
 	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	  ;;
 	esac
 
 	if test "$age" -gt "$current"; then
 	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 
 	# Calculate the version variables.
@@ -3075,7 +3063,7 @@
 	*)
 	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
 	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	  ;;
 	esac
 
@@ -3129,9 +3117,11 @@
 	    *.$objext)
 	       ;;
 	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-	       then
-		 continue
+	       if test "X$precious_files_regex" != "X"; then
+	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+	         then
+		   continue
+		 fi
 	       fi
 	       removelist="$removelist $p"
 	       ;;
@@ -3380,13 +3370,6 @@
 			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
 			esac
 		      done
-		      # It is ok to link against an archive when
-		      # building a shared library.
-		      if $AR -t $potlib > /dev/null 2>&1; then
-		        newdeplibs="$newdeplibs $a_deplib"
-		        a_deplib=""
-		        break 2
-		      fi
 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
 			 | ${SED} 10q \
 			 | $EGREP "$file_magic_regex" > /dev/null; then
@@ -3619,7 +3602,7 @@
 	fi
 
 	# Get the real and link names of the library.
-	eval shared_ext=\"$shrext\"
+	eval shared_ext=\"$shrext_cmds\"
 	eval library_names=\"$library_names_spec\"
 	set dummy $library_names
 	realname="$2"
@@ -3683,12 +3666,12 @@
 	for test_deplib in $deplibs; do
 		case " $convenience " in
 		*" $test_deplib "*) ;;
-		*) 
+		*)
 			tmp_deplibs="$tmp_deplibs $test_deplib"
 			;;
 		esac
 	done
-	deplibs="$tmp_deplibs" 
+	deplibs="$tmp_deplibs"
 
 	if test -n "$convenience"; then
 	  if test -n "$whole_archive_flag_spec"; then
@@ -3871,7 +3854,6 @@
 	  save_ifs="$IFS"; IFS='~'
 	  for cmd in $concat_cmds; do
 	    IFS="$save_ifs"
-	    eval cmd=\"$cmd\"
 	    $show "$cmd"
 	    $run eval "$cmd" || exit $?
 	  done
@@ -3918,7 +3900,7 @@
 	# Restore the uninstalled library and exit
 	if test "$mode" = relink; then
 	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
-	  exit 0
+	  exit $EXIT_SUCCESS
 	fi
 
 	# Create links to the real library.
@@ -3966,7 +3948,7 @@
       *.lo)
 	if test -n "$objs$old_deplibs"; then
 	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 	libobj="$output"
 	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
@@ -4077,7 +4059,7 @@
 	  $run ${rm}r $gentop
 	fi
 
-	exit 0
+	exit $EXIT_SUCCESS
       fi
 
       if test "$build_libtool_libs" != yes; then
@@ -4090,7 +4072,7 @@
 	# accidentally link it into a program.
 	# $show "echo timestamp > $libobj"
 	# $run eval "echo timestamp > $libobj" || exit $?
-	exit 0
+	exit $EXIT_SUCCESS
       fi
 
       if test -n "$pic_flag" || test "$pic_mode" != default; then
@@ -4113,7 +4095,7 @@
 	$run ${rm}r $gentop
       fi
 
-      exit 0
+      exit $EXIT_SUCCESS
       ;;
 
     prog)
@@ -4431,7 +4413,7 @@
 	  ;;
 	*)
 	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	  ;;
 	esac
       else
@@ -4519,7 +4501,7 @@
 	# Link the executable and exit
 	$show "$link_command"
 	$run eval "$link_command" || exit $?
-	exit 0
+	exit $EXIT_SUCCESS
       fi
 
       if test "$hardcode_action" = relink; then
@@ -4574,10 +4556,10 @@
       fi
 
       # Quote $echo for shipping.
-      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
-	case $0 in
-	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
-	*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
+	case $progpath in
+	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
 	esac
 	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
       else
@@ -4603,7 +4585,7 @@
 	    cwrappersource=`$echo ${objdir}/lt-${output}.c`
 	    cwrapper=`$echo ${output}.exe`
 	    $rm $cwrappersource $cwrapper
-	    trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
+	    trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
 	    cat > $cwrappersource <<EOF
 
@@ -4612,7 +4594,7 @@
 
    The $output program cannot be directly executed until all the libtool
    libraries that it depends on are installed.
-   
+
    This wrapper executable should never be moved out of the build directory.
    If it is, it will not operate correctly.
 
@@ -4644,7 +4626,7 @@
 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
   defined (__OS2__)
 #define HAVE_DOS_BASED_FILE_SYSTEM
-#ifndef DIR_SEPARATOR_2 
+#ifndef DIR_SEPARATOR_2
 #define DIR_SEPARATOR_2 '\\'
 #endif
 #endif
@@ -4675,7 +4657,7 @@
 {
   char **newargz;
   int i;
-  
+
   program_name = (char *) xstrdup ((char *) basename (argv[0]));
   newargz = XMALLOC(char *, argc+2);
 EOF
@@ -4688,7 +4670,7 @@
   newargz[1] = fnqualify(argv[0]);
   /* we know the script has the same name, without the .exe */
   /* so make sure newargz[1] doesn't end in .exe */
-  strendzap(newargz[1],".exe"); 
+  strendzap(newargz[1],".exe");
   for (i = 1; i < argc; i++)
     newargz[i+1] = xstrdup(argv[i]);
   newargz[argc+1] = NULL;
@@ -4711,7 +4693,7 @@
   return p;
 }
 
-char * 
+char *
 xstrdup (const char *string)
 {
   return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
@@ -4725,7 +4707,7 @@
 
 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
   /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha (name[0]) && name[1] == ':') 
+  if (isalpha (name[0]) && name[1] == ':')
     name += 2;
 #endif
 
@@ -4735,7 +4717,7 @@
   return (char *) base;
 }
 
-char * 
+char *
 fnqualify(const char *path)
 {
   size_t size;
@@ -4763,7 +4745,7 @@
 }
 
 char *
-strendzap(char *str, const char *pat) 
+strendzap(char *str, const char *pat)
 {
   size_t len, patlen;
 
@@ -4783,7 +4765,7 @@
 }
 
 static void
-lt_error_core (int exit_status, const char * mode, 
+lt_error_core (int exit_status, const char * mode,
           const char * message, va_list ap)
 {
   fprintf (stderr, "%s: %s: ", program_name, mode);
@@ -4812,7 +4794,7 @@
 	  ;;
 	esac
 	$rm $output
-	trap "$rm $output; exit 1" 1 2 15
+	trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
 	$echo > $output "\
 #! $SHELL
@@ -4912,7 +4894,7 @@
       else
 	$echo \"\$relink_command_output\" >&2
 	$rm \"\$progdir/\$file\"
-	exit 1
+	exit $EXIT_FAILURE
       fi
     fi
 
@@ -4974,20 +4956,20 @@
 	esac
 	$echo >> $output "\
       \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
-      exit 1
+      exit $EXIT_FAILURE
     fi
   else
     # The program doesn't exist.
     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
     \$echo \"This script is just a wrapper for \$program.\" 1>&2
     $echo \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit 1
+    exit $EXIT_FAILURE
   fi
 fi\
 "
 	chmod +x $output
       fi
-      exit 0
+      exit $EXIT_SUCCESS
       ;;
     esac
 
@@ -5106,7 +5088,7 @@
 	  for obj in $save_oldobjs
 	  do
 	    last_oldobj=$obj
-	  done  
+	  done
 	  for obj in $save_oldobjs
 	  do
 	    oldobjs="$objlist $obj"
@@ -5120,7 +5102,7 @@
 	      oldobjs=$objlist
 	      if test "$obj" = "$last_oldobj" ; then
 	        RANLIB=$save_RANLIB
-	      fi  
+	      fi
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
 	      objlist=
@@ -5169,11 +5151,13 @@
 	fi
       done
       # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       if test "$hardcode_automatic" = yes ; then
-        relink_command=
-      fi  
+	relink_command=
+      fi
+
+
       # Only create the output if not a dry run.
       if test -z "$run"; then
 	for installed in no yes; do
@@ -5191,48 +5175,11 @@
 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		if test -z "$libdir"; then
 		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-		  exit 1
-		fi
-		# We do not want portage's install root ($D) present.  Check only for
-		# this if the .la is being installed.
-		if test "$installed" = yes && test "$D"; then
-		  eval mynewdependency_lib="`echo "$libdir/$name" |sed -e "s:$D::g" -e 's://:/:g'`"
-		else
-		  mynewdependency_lib="$libdir/$name"
-		fi
-		# Do not add duplicates
-		if test "$mynewdependency_lib"; then
-		  if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
-		    newdependency_libs="$newdependency_libs $mynewdependency_lib"
-		  fi
-		fi
-		;;
-		  *)
-		if test "$installed" = yes; then
-   	  # Rather use S=WORKDIR if our version of portage supports it.
-   	  # This is because some ebuild (gcc) do not use $S as buildroot.
-		  if test "$PWORKDIR"; then
-		    S="$PWORKDIR"
-		  fi
-		  # We do not want portage's build root ($S) present.
-		  if test -n "`echo $deplib |grep -e "$S"`" && test "$S"; then
-		    mynewdependency_lib=""
-		  # We do not want portage's install root ($D) present.
-		  elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; then
-		    eval mynewdependency_lib="`echo "$deplib" |sed -e "s:$D::g" -e 's://:/:g'`"
-		  else
-		    mynewdependency_lib="$deplib"
-		  fi
-		else
-		  mynewdependency_lib="$deplib"
-		fi
-		# Do not add duplicates
-		if test "$mynewdependency_lib"; then
-		  if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
-			newdependency_libs="$newdependency_libs $mynewdependency_lib"
-		  fi
+		  exit $EXIT_FAILURE
 		fi
+		newdependency_libs="$newdependency_libs $libdir/$name"
 		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
 	      esac
 	    done
 	    dependency_libs="$newdependency_libs"
@@ -5242,7 +5189,7 @@
 	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 	      if test -z "$libdir"; then
 		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-		exit 1
+		exit $EXIT_FAILURE
 	      fi
 	      newdlfiles="$newdlfiles $libdir/$name"
 	    done
@@ -5253,7 +5200,7 @@
 	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 	      if test -z "$libdir"; then
 		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-		exit 1
+		exit $EXIT_FAILURE
 	      fi
 	      newdlprefiles="$newdlprefiles $libdir/$name"
 	    done
@@ -5261,7 +5208,7 @@
 	  else
 	    newdlfiles=
 	    for lib in $dlfiles; do
-	      case $lib in 
+	      case $lib in
 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
@@ -5270,7 +5217,7 @@
 	    dlfiles="$newdlfiles"
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
-	      case $lib in 
+	      case $lib in
 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
@@ -5284,10 +5231,6 @@
 	  case $host,$output,$installed,$module,$dlname in
 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
 	  esac
-	  # Do not add duplicates
-	  if test "$installed" = yes && test "$D"; then
-	    install_libdir="`echo "$install_libdir" |sed -e "s:$D::g" -e 's://:/:g'`"
-	  fi
 	  $echo > $output "\
 # $outputname - a libtool library file
 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
@@ -5337,7 +5280,7 @@
       $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
       ;;
     esac
-    exit 0
+    exit $EXIT_SUCCESS
     ;;
 
   # libtool install mode
@@ -5426,13 +5369,13 @@
     if test -z "$install_prog"; then
       $echo "$modename: you must specify an install program" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     if test -n "$prev"; then
       $echo "$modename: the \`$prev' option requires an argument" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     if test -z "$files"; then
@@ -5442,7 +5385,7 @@
 	$echo "$modename: you must specify a destination" 1>&2
       fi
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     # Strip any trailing slash from the destination.
@@ -5463,7 +5406,7 @@
       if test "$#" -gt 2; then
 	$echo "$modename: \`$dest' is not a directory" 1>&2
 	$echo "$help" 1>&2
-	exit 1
+	exit $EXIT_FAILURE
       fi
     fi
     case $destdir in
@@ -5475,7 +5418,7 @@
 	*)
 	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
 	  $echo "$help" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	  ;;
 	esac
       done
@@ -5504,7 +5447,7 @@
 	else
 	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
 	  $echo "$help" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 
 	library_names=
@@ -5546,7 +5489,7 @@
 	  # but it's something to keep an eye on.
 	  if test "$inst_prefix_dir" = "$destdir"; then
 	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
 
 	  if test -n "$inst_prefix_dir"; then
@@ -5561,7 +5504,7 @@
 	  if $run eval "$relink_command"; then :
 	  else
 	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
 	fi
 
@@ -5640,7 +5583,7 @@
 	*)
 	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
 	  $echo "$help" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	  ;;
 	esac
 
@@ -5658,7 +5601,7 @@
 	  $show "$install_prog $staticobj $staticdest"
 	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
 	fi
-	exit 0
+	exit $EXIT_SUCCESS
 	;;
 
       *)
@@ -5712,7 +5655,7 @@
 	  # Check the variables that should have been set.
 	  if test -z "$notinst_deplibs"; then
 	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
-	    exit 1
+	    exit $EXIT_FAILURE
 	  fi
 
 	  finalize=yes
@@ -5753,8 +5696,12 @@
 	      tmpdir="/tmp"
 	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
 	      tmpdir="$tmpdir/libtool-$$"
-	      if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
+	      save_umask=`umask`
+	      umask 0077
+	      if $mkdir "$tmpdir"; then
+	        umask $save_umask
 	      else
+	        umask $save_umask
 		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
 		continue
 	      fi
@@ -5837,9 +5784,9 @@
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       test -n "$run" && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs'
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
     else
-      exit 0
+      exit $EXIT_SUCCESS
     fi
     ;;
 
@@ -5879,7 +5826,7 @@
     fi
 
     # Exit here if they wanted silent mode.
-    test "$show" = : && exit 0
+    test "$show" = : && exit $EXIT_SUCCESS
 
     $echo "----------------------------------------------------------------------"
     $echo "Libraries have been installed in:"
@@ -5915,7 +5862,7 @@
     $echo "See any operating system documentation about shared libraries for"
     $echo "more information, such as the ld(1) and ld.so(8) manual pages."
     $echo "----------------------------------------------------------------------"
-    exit 0
+    exit $EXIT_SUCCESS
     ;;
 
   # libtool execute mode
@@ -5927,7 +5874,7 @@
     if test -z "$cmd"; then
       $echo "$modename: you must specify a COMMAND" 1>&2
       $echo "$help"
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     # Handle -dlopen flags immediately.
@@ -5935,7 +5882,7 @@
       if test ! -f "$file"; then
 	$echo "$modename: \`$file' is not a file" 1>&2
 	$echo "$help" 1>&2
-	exit 1
+	exit $EXIT_FAILURE
       fi
 
       dir=
@@ -5946,7 +5893,7 @@
 	else
 	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
 	  $echo "$help" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 
 	# Read the libtool library.
@@ -5973,7 +5920,7 @@
 	  dir="$dir/$objdir"
 	else
 	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
-	  exit 1
+	  exit $EXIT_FAILURE
 	fi
 	;;
 
@@ -6053,7 +6000,7 @@
 	$echo "export $shlibpath_var"
       fi
       $echo "$cmd$args"
-      exit 0
+      exit $EXIT_SUCCESS
     fi
     ;;
 
@@ -6081,7 +6028,7 @@
     if test -z "$rm"; then
       $echo "$modename: you must specify an RM program" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     rmdirs=
@@ -6195,7 +6142,7 @@
 	if test "$mode" = clean ; then
 	  noexename=$name
 	  case $file in
-	  *.exe) 
+	  *.exe)
 	    file=`$echo $file|${SED} 's,.exe$,,'`
 	    noexename=`$echo $name|${SED} 's,.exe$,,'`
 	    # $file with .exe has already been added to rmfiles,
@@ -6240,20 +6187,20 @@
   "")
     $echo "$modename: you must specify a MODE" 1>&2
     $echo "$generic_help" 1>&2
-    exit 1
+    exit $EXIT_FAILURE
     ;;
   esac
 
   if test -z "$exec_cmd"; then
     $echo "$modename: invalid operation mode \`$mode'" 1>&2
     $echo "$generic_help" 1>&2
-    exit 1
+    exit $EXIT_FAILURE
   fi
 fi # test -z "$show_help"
 
 if test -n "$exec_cmd"; then
   eval exec $exec_cmd
-  exit 1
+  exit $EXIT_FAILURE
 fi
 
 # We need to display help for each of the modes.
@@ -6289,7 +6236,7 @@
 a more detailed description of MODE.
 
 Report bugs to <bug-libtool@gnu.org>."
-  exit 0
+  exit $EXIT_SUCCESS
   ;;
 
 clean)
@@ -6444,14 +6391,14 @@
 *)
   $echo "$modename: invalid operation mode \`$mode'" 1>&2
   $echo "$help" 1>&2
-  exit 1
+  exit $EXIT_FAILURE
   ;;
 esac
 
 $echo
 $echo "Try \`$modename --help' for more information about other modes."
 
-exit 0
+exit $EXIT_SUCCESS
 
 # The TAGs below are defined such that we never get into a situation
 # in which we disable both kinds of libraries.  Given conflicting
--- ethereal-0.10.10.orig/ethereal_gen.py
+++ ethereal-0.10.10/ethereal_gen.py
@@ -2188,7 +2188,8 @@
 #include <glib.h>
 #include <epan/packet.h>
 #include <epan/proto.h>
-#include "packet-giop.h"
+#include <epan/dissectors/packet-giop.h>
+#include <plugins/plugin_api_defs.h>
 
 #ifndef ENABLE_STATIC
 G_MODULE_EXPORT const gchar version[] = "0.0.1";
--- ethereal-0.10.10.orig/ethereal.desktop
+++ ethereal-0.10.10/ethereal.desktop
@@ -68,15 +68,16 @@
 GenericName[zh_TW]=網路分析程式
 GenericName[zu]=Umhloli Woxhumano olusakazekile
 Comment=Network traffic analyzer
+Comment[fr]=Analyseur de trafic réseau
 Comment[fi]=Verkkoliikenne analysaattori
 Comment[sv]=Nätverkstrafikanalysator
-Icon=ethereal.png
+Icon=hi48-app-ethereal.png
 TryExec=ethereal
 Exec=ethereal
 Path=
 Terminal=false
 MimeType=
-Categories=Application;GTK;Network;X-Red-Hat-Extra;
+Categories=GNOME;Application;Network;
 # Found in Suse 9.1:
 X-KDE-SubstituteUID=true
 # Deprecated:
--- ethereal-0.10.10.orig/idl2eth.sh
+++ ethereal-0.10.10/idl2eth.sh
@@ -48,34 +48,5 @@
     exit 1;
 fi
 
-#
-# Run ethereal backend, looking for ethereal_be.py and ethereal_gen.py
-# in pythons's "site-packages" directory. If cannot find that, then
-# try looking in current directory. If still cannot, then exit with
-# error.
-
-if [ -f $PYTHONPATH/site-packages/ethereal_be.py ] && [ -f $PYTHONPATH/site-packages/ethereal_gen.py ]; then
-    omniidl  -p $PYTHONPATH/site-packages -b ethereal_be $1
-    exit $?
-fi
-
-# Try current directory.
-
-if [ -f ./ethereal_be.py ] && [ -f ./ethereal_gen.py ]; then
-    omniidl  -p ./ -b ethereal_be $1
-    exit $?
-fi
-
-# Could not find both ethereal_be.py AND ethereal_gen.py
-
-echo "idl2eth Error: Could not find both ethereal_be.py AND ethereal_gen.py."
-echo "Please ensure you have the PYTHONPATH variable set, or that ethereal_be.py "
-echo "and ethereal_gen.py exist in the current directory. "
-echo
-echo "On this system, PYTHONPATH is : $PYTHONPATH"
-echo
-
-exit 2
-
-
+omniidl -b ethereal_be $1
 
--- ethereal-0.10.10.orig/tools/Makefile.in
+++ ethereal-0.10.10/tools/Makefile.in
@@ -60,11 +60,8 @@
 subdir = tools
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/tools/lemon/Makefile.in
+++ ethereal-0.10.10/tools/lemon/Makefile.in
@@ -69,11 +69,8 @@
 subdir = tools/lemon
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/tools/lemon/lemon.c
+++ ethereal-0.10.10/tools/lemon/lemon.c
@@ -2628,8 +2628,8 @@
     (*lineno)++;
     iStart = 0;
     if( name ){
-      for(i=0; line[i]; i++){
-        if( line[i]=='P' && strncmp(&line[i],"Parse",5)==0
+      for(i=0; line[i] && i<LINESIZE; i++){
+        if( line[i]=='P' && i<(LINESIZE-5) && strncmp(&line[i],"Parse",5)==0
           && (i==0 || !safe_isalpha(line[i-1]))
         ){
           if( i>iStart ) fprintf(out,"%.*s",i-iStart,&line[iStart]);
--- ethereal-0.10.10.orig/wiretap/aclocal.m4
+++ ethereal-0.10.10/wiretap/aclocal.m4
@@ -11,9 +11,423 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+# Configure paths for GLIB
+# Owen Taylor     1997-2001
+
+dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or 
+dnl gthread is specified in MODULES, pass to pkg-config
+dnl
+AC_DEFUN([AM_PATH_GLIB_2_0],
+[dnl 
+dnl Get the cflags and libraries from pkg-config
+dnl
+AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
+		    , enable_glibtest=yes)
+
+  pkg_config_args=glib-2.0
+  for module in . $4
+  do
+      case "$module" in
+         gmodule) 
+             pkg_config_args="$pkg_config_args gmodule-2.0"
+         ;;
+         gmodule-no-export) 
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
+         gobject) 
+             pkg_config_args="$pkg_config_args gobject-2.0"
+         ;;
+         gthread) 
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+      esac
+  done
+
+  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+
+  no_glib=""
+
+  if test x$PKG_CONFIG != xno ; then
+    if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
+      :
+    else
+      echo *** pkg-config too old; version 0.7 or better required.
+      no_glib=yes
+      PKG_CONFIG=no
+    fi
+  else
+    no_glib=yes
+  fi
+
+  min_glib_version=ifelse([$1], ,2.0.0,$1)
+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+	  echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+	  enable_glibtest=no
+    fi
+
+    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
+	  :
+    else
+	  no_glib=yes
+    fi
+  fi
+
+  if test x"$no_glib" = x ; then
+    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
+    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+
+    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+dnl
+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
+dnl checks the results of pkg-config to some extent)
+dnl
+      rm -f conf.glibtest
+      AC_TRY_RUN([
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.glibtest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    } 
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+	   (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          ac_save_CFLAGS="$CFLAGS"
+          ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          AC_TRY_LINK([
+#include <glib.h>
+#include <stdio.h>
+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     GLIB_GENMARSHAL=""
+     GOBJECT_QUERY=""
+     GLIB_MKENUMS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GLIB_CFLAGS)
+  AC_SUBST(GLIB_LIBS)
+  AC_SUBST(GLIB_GENMARSHAL)
+  AC_SUBST(GOBJECT_QUERY)
+  AC_SUBST(GLIB_MKENUMS)
+  rm -f conf.glibtest
+])
+
+# Configure paths for GLIB
+# Owen Taylor     97-11-3
+
+dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or 
+dnl gthread is specified in MODULES, pass to glib-config
+dnl
+AC_DEFUN(AM_PATH_GLIB,
+[dnl 
+dnl Get the cflags and libraries from the glib-config script
+dnl
+AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
+            glib_config_prefix="$withval", glib_config_prefix="")
+AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
+            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
+AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
+		    , enable_glibtest=yes)
+
+  if test x$glib_config_exec_prefix != x ; then
+     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
+     if test x${GLIB_CONFIG+set} != xset ; then
+        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
+     fi
+  fi
+  if test x$glib_config_prefix != x ; then
+     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
+     if test x${GLIB_CONFIG+set} != xset ; then
+        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
+     fi
+  fi
+
+  for module in . $4
+  do
+      case "$module" in
+         gmodule) 
+             glib_config_args="$glib_config_args gmodule"
+         ;;
+         gthread) 
+             glib_config_args="$glib_config_args gthread"
+         ;;
+      esac
+  done
+
+  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
+  min_glib_version=ifelse([$1], ,0.99.7,$1)
+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+  no_glib=""
+  if test "$GLIB_CONFIG" = "no" ; then
+    no_glib=yes
+  else
+    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
+    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
+    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+dnl
+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
+dnl checks the results of glib-config to some extent
+dnl
+      rm -f conf.glibtest
+      AC_TRY_RUN([
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.glibtest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If glib-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
+      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    } 
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+	   (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
+        printf("*** correct copy of glib-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$GLIB_CONFIG" = "no" ; then
+       echo "*** The glib-config script installed by GLIB could not be found"
+       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
+       echo "*** full path to glib-config."
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          AC_TRY_LINK([
+#include <glib.h>
+#include <stdio.h>
+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***"
+          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
+          echo "*** came with the system with the command"
+          echo "***"
+          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
+          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
+          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GLIB_CFLAGS)
+  AC_SUBST(GLIB_LIBS)
+  rm -f conf.glibtest
+])
+
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 
 # serial 47 AC_PROG_LIBTOOL
+# Debian $Rev: 214 $
 
 
 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
@@ -220,7 +634,6 @@
 tagname=
 AC_LIBTOOL_LANG_C_CONFIG
 _LT_AC_TAGCONFIG
-_LT_AC_SHARED_EXT
 ])# AC_LIBTOOL_SETUP
 
 
@@ -524,20 +937,6 @@
   rm -rf conftest*
   ;;
 
-*-*-linux*)
-  # Test if the compiler is 64bit
-  echo 'int i;' > conftest.$ac_ext
-  lt_cv_cc_64bit_output=no
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *"ELF 64"*)
-      lt_cv_cc_64bit_output=yes
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-  
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   SAVE_CFLAGS="$CFLAGS"
@@ -647,7 +1046,7 @@
 AC_MSG_CHECKING([the maximum length of command line arguments])
 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   i=0
-  testring="ABCD"
+  teststring="ABCD"
 
   case $build_os in
   msdosdjgpp*)
@@ -686,16 +1085,16 @@
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
-    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
-	       = "XX$testring") >/dev/null 2>&1 &&
-	    new_result=`expr "X$testring" : ".*" 2>&1` &&
+    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
 	    lt_cv_sys_max_cmd_len=$new_result &&
 	    test $i != 17 # 1/2 MB should be enough
     do
       i=`expr $i + 1`
-      testring=$testring$testring
+      teststring=$teststring$teststring
     done
-    testring=
+    teststring=
     # Add a significant safety factor because C++ compilers can tack on massive
     # amounts of additional arguments before passing them to the linker.
     # It appears as though 1/2 is a usable value.
@@ -1091,7 +1490,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext=".so"
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -1204,7 +1603,7 @@
 
 cygwin* | mingw* | pw32*)
   version_type=windows
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -1251,30 +1650,6 @@
     esac
     ;;
 
-  linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        $archive_expsym_cmds="$archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
   *)
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
@@ -1293,7 +1668,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -1376,7 +1751,7 @@
   need_version=no
   case "$host_cpu" in
   ia64*)
-    shrext='.so'
+    shrext_cmds='.so'
     hardcode_into_libs=yes
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
@@ -1391,7 +1766,7 @@
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
    hppa*64*)
-     shrext='.sl'
+     shrext_cmds='.sl'
      hardcode_into_libs=yes
      dynamic_linker="$host_os dld.sl"
      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
@@ -1402,7 +1777,7 @@
      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
      ;;
    *)
-    shrext='.sl'
+    shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
@@ -1473,17 +1848,10 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+    lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
-    ;;
-  esac
-
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
   # GNU dynamic linker.  Since this was broken with cross compilers,
@@ -1491,26 +1859,18 @@
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
   dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-  # Find out which ABI we are using (multilib Linux x86_64 hack).
-  libsuff=
-  case "$host_cpu" in
-  x86_64*)
-    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-    if AC_TRY_EVAL(ac_compile); then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  *)
-    ;;
-  esac
-  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
-  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
   ;;
 
 knetbsd*-gnu)
@@ -1583,7 +1943,7 @@
 
 os2*)
   libname_spec='$name'
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_lib_prefix=no
   library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
@@ -1780,24 +2140,6 @@
 fi
 ])# _LT_AC_TAGCONFIG
 
-# _LT_AC_SHARED_EXT
-# ----------------
-AC_DEFUN([_LT_AC_SHARED_EXT],[
-  if test ! -f "${ofile}"; then
-    AC_MSG_WARN([output file `$ofile' does not exist])
-  fi
-  if test -z "`grep -e 'shared_ext.*shrext' $ofile`"; then
-    # Make sure $shared_ext gets set to $shrext
-    if sed -e 's/shared_ext/shrext/g' "$ofile" > "${ofile}T"; then
-      mv "${ofile}T" "$ofile"
-      chmod +x "$ofile"
-    else
-      rm -f "${ofile}T"
-      AC_MSG_ERROR([unable to update shared_ext.])
-    fi
-  fi
-])# _LT_AC_SHARED_EXT
-
 
 # AC_LIBTOOL_DLOPEN
 # -----------------
@@ -2192,14 +2534,14 @@
   ;;
 
 cygwin*)
-  # win32_libid is a shell function defined in ltmain.sh
+  # func_win32_libid is a shell function defined in ltmain.sh
   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='win32_libid'
+  lt_cv_file_magic_cmd='func_win32_libid'
   ;;
 
 mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
-  # win32_libid shell function, so use a weaker test based on 'objdump'.
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
   lt_cv_file_magic_cmd='$OBJDUMP -f'
   ;;
@@ -2258,19 +2600,10 @@
 
 # This must be Linux ELF.
 linux*)
-  case $host_cpu in
-  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64*)
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -2619,7 +2952,7 @@
   fi
   ;;
 
-aix4*)
+aix4* | aix5*)
   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
     test "$enable_shared" = yes && enable_static=no
   fi
@@ -3067,7 +3400,7 @@
       # explicitly linking system object files so we need to strip them
       # from the output so that they don't get included in the library
       # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -3264,7 +3597,7 @@
 	;;
     esac
     ;;
-  netbsd*)
+  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
       wlarc=
@@ -3770,7 +4103,7 @@
     postinstall_cmds='$RANLIB $lib'
   fi
   ;;
-aix4*)
+aix4* | aix5*)
   test "$enable_shared" = yes && enable_static=no
   ;;
 esac
@@ -4125,7 +4458,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -4754,7 +5087,7 @@
 	    ;;
 	esac
 	;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
@@ -5065,6 +5398,9 @@
   cygwin* | mingw*)
     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
+  linux*)
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
+  ;;
   *)
     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
@@ -5194,7 +5530,7 @@
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -5233,7 +5569,7 @@
       ;;
 
   linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	_LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
       supports_anon_versioning=no
@@ -5252,6 +5588,7 @@
       else
         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
       fi
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=no
     else
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
     fi
@@ -5433,7 +5770,7 @@
       # Tell ltmain to make .lib files, not .a files.
       libext=lib
       # Tell ltmain to make .dll files, not .so files.
-      shrext=".dll"
+      shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
@@ -5611,7 +5948,7 @@
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -6955,6 +7292,4 @@
 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-m4_include([../aclocal-fallback/glib-2.0.m4])
-m4_include([../aclocal-fallback/glib.m4])
 m4_include([acinclude.m4])
--- ethereal-0.10.10.orig/wiretap/Makefile.in
+++ ethereal-0.10.10/wiretap/Makefile.in
@@ -95,9 +95,8 @@
 	ascend-scanner.c
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/../aclocal-fallback/glib.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -644,7 +643,7 @@
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
 	mkdir $(distdir)
-	$(mkdir_p) $(distdir)/.. $(distdir)/../aclocal-fallback
+	$(mkdir_p) $(distdir)/..
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
 	list='$(DISTFILES)'; for file in $$list; do \
--- ethereal-0.10.10.orig/wiretap/configure
+++ ethereal-0.10.10/wiretap/configure
@@ -1158,7 +1158,7 @@
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 
@@ -2613,8 +2613,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2672,8 +2671,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2789,8 +2787,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2844,8 +2841,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2890,8 +2886,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2935,8 +2930,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3506,8 +3500,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3573,8 +3566,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3663,8 +3655,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4037,14 +4028,14 @@
   ;;
 
 cygwin*)
-  # win32_libid is a shell function defined in ltmain.sh
+  # func_win32_libid is a shell function defined in ltmain.sh
   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='win32_libid'
+  lt_cv_file_magic_cmd='func_win32_libid'
   ;;
 
 mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
-  # win32_libid shell function, so use a weaker test based on 'objdump'.
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
   lt_cv_file_magic_cmd='$OBJDUMP -f'
   ;;
@@ -4103,19 +4094,10 @@
 
 # This must be Linux ELF.
 linux*)
-  case $host_cpu in
-  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64*)
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -4231,7 +4213,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 4234 "configure"' > conftest.$ac_ext
+  echo '#line 4216 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -4312,24 +4294,6 @@
   rm -rf conftest*
   ;;
 
-*-*-linux*)
-  # Test if the compiler is 64bit
-  echo 'int i;' > conftest.$ac_ext
-  lt_cv_cc_64bit_output=no
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *"ELF 64"*)
-      lt_cv_cc_64bit_output=yes
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   SAVE_CFLAGS="$CFLAGS"
@@ -4369,8 +4333,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4445,8 +4408,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4616,8 +4578,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4684,8 +4645,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4945,8 +4905,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5004,8 +4963,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5076,8 +5034,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5121,8 +5078,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5587,7 +5543,7 @@
 
 
 # Provide some information about the compiler.
-echo "$as_me:5590:" \
+echo "$as_me:5546:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -5633,8 +5589,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5683,8 +5638,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5742,7 +5696,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
     i=0
-  testring="ABCD"
+  teststring="ABCD"
 
   case $build_os in
   msdosdjgpp*)
@@ -5781,16 +5735,16 @@
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
-    while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
-	       = "XX$testring") >/dev/null 2>&1 &&
-	    new_result=`expr "X$testring" : ".*" 2>&1` &&
+    while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
 	    lt_cv_sys_max_cmd_len=$new_result &&
 	    test $i != 17 # 1/2 MB should be enough
     do
       i=`expr $i + 1`
-      testring=$testring$testring
+      teststring=$teststring$teststring
     done
-    testring=
+    teststring=
     # Add a significant safety factor because C++ compilers can tack on massive
     # amounts of additional arguments before passing them to the linker.
     # It appears as though 1/2 is a usable value.
@@ -6621,11 +6575,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6624: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6578: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6628: \$? = $ac_status" >&5
+   echo "$as_me:6582: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -6854,11 +6808,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6857: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6811: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6861: \$? = $ac_status" >&5
+   echo "$as_me:6815: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -6914,11 +6868,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6917: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6871: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6921: \$? = $ac_status" >&5
+   echo "$as_me:6875: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -7091,7 +7045,7 @@
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -7130,7 +7084,7 @@
       ;;
 
   linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_cmds="$tmp_archive_cmds"
       supports_anon_versioning=no
@@ -7149,6 +7103,7 @@
       else
         archive_expsym_cmds="$tmp_archive_cmds"
       fi
+      link_all_deplibs=no
     else
       ld_shlibs=no
     fi
@@ -7305,8 +7260,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7366,8 +7320,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7432,7 +7385,7 @@
       # Tell ltmain to make .lib files, not .a files.
       libext=lib
       # Tell ltmain to make .dll files, not .so files.
-      shrext=".dll"
+      shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
       archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
@@ -7610,7 +7563,7 @@
       link_all_deplibs=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -7888,7 +7841,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext=".so"
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -8001,7 +7954,7 @@
 
 cygwin* | mingw* | pw32*)
   version_type=windows
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -8048,30 +8001,6 @@
     esac
     ;;
 
-  linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        $archive_expsym_cmds="$archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
   *)
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
@@ -8090,7 +8019,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -8173,7 +8102,7 @@
   need_version=no
   case "$host_cpu" in
   ia64*)
-    shrext='.so'
+    shrext_cmds='.so'
     hardcode_into_libs=yes
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
@@ -8188,7 +8117,7 @@
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
    hppa*64*)
-     shrext='.sl'
+     shrext_cmds='.sl'
      hardcode_into_libs=yes
      dynamic_linker="$host_os dld.sl"
      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
@@ -8199,7 +8128,7 @@
      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
      ;;
    *)
-    shrext='.sl'
+    shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
@@ -8270,17 +8199,10 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
-    ;;
-  esac
-
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
   # GNU dynamic linker.  Since this was broken with cross compilers,
@@ -8288,30 +8210,18 @@
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
   dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-  # Find out which ABI we are using (multilib Linux x86_64 hack).
-  libsuff=
-  case "$host_cpu" in
-  x86_64*)
-    echo '#line 8296 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  *)
-    ;;
-  esac
-  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
-  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
   ;;
 
 knetbsd*-gnu)
@@ -8384,7 +8294,7 @@
 
 os2*)
   libname_spec='$name'
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_lib_prefix=no
   library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
@@ -8613,8 +8523,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8717,8 +8626,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8783,8 +8691,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8877,8 +8784,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8943,8 +8849,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9010,8 +8915,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9077,8 +8981,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9153,7 +9056,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9156 "configure"
+#line 9059 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9251,7 +9154,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9254 "configure"
+#line 9157 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9376,7 +9279,7 @@
   fi
   ;;
 
-aix4*)
+aix4* | aix5*)
   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
     test "$enable_shared" = yes && enable_static=no
   fi
@@ -9652,7 +9555,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -10323,8 +10226,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10385,8 +10287,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10567,7 +10468,7 @@
       # explicitly linking system object files so we need to strip them
       # from the output so that they don't get included in the library
       # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -10764,7 +10665,7 @@
 	;;
     esac
     ;;
-  netbsd*)
+  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
       archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
       wlarc=
@@ -11319,7 +11220,7 @@
 	    ;;
 	esac
 	;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
@@ -11430,11 +11331,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11433: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11334: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11437: \$? = $ac_status" >&5
+   echo "$as_me:11338: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -11490,11 +11391,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11493: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11394: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11497: \$? = $ac_status" >&5
+   echo "$as_me:11398: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -11560,6 +11461,9 @@
   cygwin* | mingw*)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
+  linux*)
+    link_all_deplibs_CXX=no
+  ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
@@ -11641,7 +11545,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext=".so"
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -11754,7 +11658,7 @@
 
 cygwin* | mingw* | pw32*)
   version_type=windows
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -11801,30 +11705,6 @@
     esac
     ;;
 
-  linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        $archive_expsym_cmds="$archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
   *)
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
@@ -11843,7 +11723,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -11926,7 +11806,7 @@
   need_version=no
   case "$host_cpu" in
   ia64*)
-    shrext='.so'
+    shrext_cmds='.so'
     hardcode_into_libs=yes
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
@@ -11941,7 +11821,7 @@
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
    hppa*64*)
-     shrext='.sl'
+     shrext_cmds='.sl'
      hardcode_into_libs=yes
      dynamic_linker="$host_os dld.sl"
      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
@@ -11952,7 +11832,7 @@
      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
      ;;
    *)
-    shrext='.sl'
+    shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
@@ -12023,17 +11903,10 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
-    ;;
-  esac
-
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
   # GNU dynamic linker.  Since this was broken with cross compilers,
@@ -12041,30 +11914,18 @@
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
   dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-  # Find out which ABI we are using (multilib Linux x86_64 hack).
-  libsuff=
-  case "$host_cpu" in
-  x86_64*)
-    echo '#line 12049 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  *)
-    ;;
-  esac
-  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
-  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
   ;;
 
 knetbsd*-gnu)
@@ -12137,7 +11998,7 @@
 
 os2*)
   libname_spec='$name'
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_lib_prefix=no
   library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
@@ -12366,8 +12227,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12470,8 +12330,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12536,8 +12395,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12630,8 +12488,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12696,8 +12553,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12763,8 +12619,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12830,8 +12685,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12906,7 +12760,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12909 "configure"
+#line 12763 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13004,7 +12858,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 13007 "configure"
+#line 12861 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13283,7 +13137,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -13605,7 +13459,7 @@
     postinstall_cmds='$RANLIB $lib'
   fi
   ;;
-aix4*)
+aix4* | aix5*)
   test "$enable_shared" = yes && enable_static=no
   ;;
 esac
@@ -13831,11 +13685,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13834: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13688: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13838: \$? = $ac_status" >&5
+   echo "$as_me:13692: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -13891,11 +13745,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13894: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13748: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13898: \$? = $ac_status" >&5
+   echo "$as_me:13752: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -14068,7 +13922,7 @@
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -14107,7 +13961,7 @@
       ;;
 
   linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_cmds_F77="$tmp_archive_cmds"
       supports_anon_versioning=no
@@ -14126,6 +13980,7 @@
       else
         archive_expsym_cmds_F77="$tmp_archive_cmds"
       fi
+      link_all_deplibs_F77=no
     else
       ld_shlibs_F77=no
     fi
@@ -14272,8 +14127,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14323,8 +14177,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14389,7 +14242,7 @@
       # Tell ltmain to make .lib files, not .a files.
       libext=lib
       # Tell ltmain to make .dll files, not .so files.
-      shrext=".dll"
+      shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
       archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
@@ -14567,7 +14420,7 @@
       link_all_deplibs_F77=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -14845,7 +14698,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext=".so"
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -14958,7 +14811,7 @@
 
 cygwin* | mingw* | pw32*)
   version_type=windows
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -15005,30 +14858,6 @@
     esac
     ;;
 
-  linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        $archive_expsym_cmds="$archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
   *)
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
@@ -15047,7 +14876,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -15130,7 +14959,7 @@
   need_version=no
   case "$host_cpu" in
   ia64*)
-    shrext='.so'
+    shrext_cmds='.so'
     hardcode_into_libs=yes
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
@@ -15145,7 +14974,7 @@
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
    hppa*64*)
-     shrext='.sl'
+     shrext_cmds='.sl'
      hardcode_into_libs=yes
      dynamic_linker="$host_os dld.sl"
      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
@@ -15156,7 +14985,7 @@
      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
      ;;
    *)
-    shrext='.sl'
+    shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
@@ -15227,17 +15056,10 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
-    ;;
-  esac
-
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
   # GNU dynamic linker.  Since this was broken with cross compilers,
@@ -15245,30 +15067,18 @@
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
   dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-  # Find out which ABI we are using (multilib Linux x86_64 hack).
-  libsuff=
-  case "$host_cpu" in
-  x86_64*)
-    echo '#line 15253 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  *)
-    ;;
-  esac
-  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
-  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
   ;;
 
 knetbsd*-gnu)
@@ -15341,7 +15151,7 @@
 
 os2*)
   libname_spec='$name'
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_lib_prefix=no
   library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
@@ -15682,7 +15492,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -15980,11 +15790,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15983: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15793: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15987: \$? = $ac_status" >&5
+   echo "$as_me:15797: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -16213,11 +16023,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16216: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16026: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16220: \$? = $ac_status" >&5
+   echo "$as_me:16030: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -16273,11 +16083,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16276: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16086: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16280: \$? = $ac_status" >&5
+   echo "$as_me:16090: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16450,7 +16260,7 @@
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -16489,7 +16299,7 @@
       ;;
 
   linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_cmds_GCJ="$tmp_archive_cmds"
       supports_anon_versioning=no
@@ -16508,6 +16318,7 @@
       else
         archive_expsym_cmds_GCJ="$tmp_archive_cmds"
       fi
+      link_all_deplibs_GCJ=no
     else
       ld_shlibs_GCJ=no
     fi
@@ -16664,8 +16475,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16725,8 +16535,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16791,7 +16600,7 @@
       # Tell ltmain to make .lib files, not .a files.
       libext=lib
       # Tell ltmain to make .dll files, not .so files.
-      shrext=".dll"
+      shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
       archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
@@ -16969,7 +16778,7 @@
       link_all_deplibs_GCJ=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -17247,7 +17056,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext=".so"
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -17360,7 +17169,7 @@
 
 cygwin* | mingw* | pw32*)
   version_type=windows
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -17407,30 +17216,6 @@
     esac
     ;;
 
-  linux*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        $archive_expsym_cmds="$archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
   *)
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
@@ -17449,7 +17234,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -17532,7 +17317,7 @@
   need_version=no
   case "$host_cpu" in
   ia64*)
-    shrext='.so'
+    shrext_cmds='.so'
     hardcode_into_libs=yes
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
@@ -17547,7 +17332,7 @@
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
    hppa*64*)
-     shrext='.sl'
+     shrext_cmds='.sl'
      hardcode_into_libs=yes
      dynamic_linker="$host_os dld.sl"
      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
@@ -17558,7 +17343,7 @@
      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
      ;;
    *)
-    shrext='.sl'
+    shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
@@ -17629,17 +17414,10 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
-    ;;
-  esac
-
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
   # GNU dynamic linker.  Since this was broken with cross compilers,
@@ -17647,30 +17425,18 @@
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
   dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-  # Find out which ABI we are using (multilib Linux x86_64 hack).
-  libsuff=
-  case "$host_cpu" in
-  x86_64*)
-    echo '#line 17655 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  *)
-    ;;
-  esac
-  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
-  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
   ;;
 
 knetbsd*-gnu)
@@ -17743,7 +17509,7 @@
 
 os2*)
   libname_spec='$name'
-  shrext=".dll"
+  shrext_cmds=".dll"
   need_lib_prefix=no
   library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
@@ -17972,8 +17738,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18076,8 +17841,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18142,8 +17906,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18236,8 +17999,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18302,8 +18064,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18369,8 +18130,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18436,8 +18196,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18512,7 +18271,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18515 "configure"
+#line 18274 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18610,7 +18369,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18613 "configure"
+#line 18372 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18889,7 +18648,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -19334,7 +19093,7 @@
 libext="$libext"
 
 # Shared library suffix (normally ".so").
-shrext='$shrext'
+shrext_cmds='$shrext_cmds'
 
 # Executable file suffix (normally "").
 exeext="$exeext"
@@ -19596,24 +19355,6 @@
 fi
 
 
-  if test ! -f "${ofile}"; then
-    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
-  fi
-  if test -z "`grep -e 'shared_ext.*shrext' $ofile`"; then
-    # Make sure $shared_ext gets set to $shrext
-    if sed -e 's/shared_ext/shrext/g' "$ofile" > "${ofile}T"; then
-      mv "${ofile}T" "$ofile"
-      chmod +x "$ofile"
-    else
-      rm -f "${ofile}T"
-      { { echo "$as_me:$LINENO: error: unable to update shared_ext." >&5
-echo "$as_me: error: unable to update shared_ext." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-  fi
-
-
 
 # This can be used to rebuild libtool when needed
 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
@@ -19839,6 +19580,9 @@
          gmodule)
              pkg_config_args="$pkg_config_args gmodule-2.0"
          ;;
+         gmodule-no-export)
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
          gobject)
              pkg_config_args="$pkg_config_args gobject-2.0"
          ;;
@@ -20094,8 +19838,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20409,8 +20152,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20538,8 +20280,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20710,8 +20451,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20863,8 +20603,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20906,8 +20645,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -20964,8 +20702,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21172,8 +20909,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21387,8 +21123,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21597,8 +21332,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -21726,8 +21460,7 @@
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -22666,11 +22399,6 @@
   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -22709,6 +22437,12 @@
 	 fi;;
       esac
     done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
--- ethereal-0.10.10.orig/wiretap/network_instruments.c
+++ ethereal-0.10.10/wiretap/network_instruments.c
@@ -343,8 +343,8 @@
 	/* Per-packet encapsulations aren't supported. */
 	if (encap == WTAP_ENCAP_PER_PACKET)
 		return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
-
-	if (encap < 0 || (unsigned) encap > NUM_FROM_WTAP_ENCAPS || from_wtap_encap[encap] == OBSERVER_UNDEFINED)
+	
+	if (encap < 0 || (unsigned) encap >= NUM_FROM_WTAP_ENCAPS || from_wtap_encap[encap] == OBSERVER_UNDEFINED)
 		return WTAP_ERR_UNSUPPORTED_ENCAP;
 
 	return 0;
--- ethereal-0.10.10.orig/wiretap/ngsniffer.c
+++ ethereal-0.10.10/wiretap/ngsniffer.c
@@ -2484,7 +2484,7 @@
 	       the uncompressed byte stream, starting with the blob
 	       following the current blob. */
 	    new = g_list_next(ngsniffer->current_blob);
-	    for (;;) {
+	    while (new) {
 		next = g_list_next(new);
 		if (next == NULL) {
 		    /* No more blobs; the current one is it. */
@@ -2508,7 +2508,7 @@
 	       the uncompressed byte stream, starting with the blob
 	       preceding the current blob. */
 	    new = g_list_previous(ngsniffer->current_blob);
-	    for (;;) {
+	    while (new) {
 		/* Does this blob start at or before the target offset?
 		   If so, the current blob is the one we want. */
 		new_blob = new->data;
--- ethereal-0.10.10.orig/plugins/Makefile.in
+++ ethereal-0.10.10/plugins/Makefile.in
@@ -60,11 +60,8 @@
 subdir = plugins
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/acn/Makefile.in
+++ ethereal-0.10.10/plugins/acn/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/agentx/Makefile.in
+++ ethereal-0.10.10/plugins/agentx/Makefile.in
@@ -64,11 +64,8 @@
 subdir = plugins/agentx
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/agentx/packet-agentx.c
+++ ethereal-0.10.10/plugins/agentx/packet-agentx.c
@@ -2,7 +2,7 @@
  * Routines for Agent Extensibility (AgentX) Protocol disassembly
  * RFC 2257
  *
- * $Id: packet-agentx.c 13644 2005-03-07 02:44:41Z guy $
+ * $Id: packet-agentx.c 13930 2005-03-27 02:40:05Z ulfl $
  *
  * Copyright (c) 2005 by Oleg Terletsky <oleg.terletsky@comverse.com>
  *
@@ -156,6 +156,7 @@
         { AGENTX_ADD_AGENT_CAPS_PDU, 	"AddAgentCaps-PDU" },
         { AGENTX_REM_AGENT_CAPS_PDU, 	"RemoveAgentCaps-PDU" },
         { AGENTX_RESPONSE_PDU, 		"Response-PDU" },
+        { 0, NULL }
 };
 
 
@@ -189,7 +190,8 @@
  	{ VB_COUNTER64,		"Counter64" },
  	{ VB_NOSUCHOBJ,		"noSuchObject" },
  	{ VB_NOSUCHINST,	"noSuchInstance" },
- 	{ VB_ENDOFMIB,		"endOfMibView" },
+	{ VB_ENDOFMIB,		"endOfMibView" },
+	{ 0, NULL }
 };
 
 
@@ -209,6 +211,7 @@
 	{ CREASON_TIMEOUTS, 		"reasonTimeouts" },
 	{ CREASON_SHUTDOWN , 		"reasonShutdown" },
 	{ CREASON_BY_MANAGER, 		"reasonByManager" },
+	{ 0, NULL }
 };
 
 
@@ -274,6 +277,7 @@
   { AGENTX_DUP_REGISTR, 	"duplicateRegistration" },
   { AGENTX_UNKNOWN_REG, 	"unknownRegistration" },
   { AGENTX_UNKNOWN_CAPS, 	"unknownAgentCaps" },
+  { 0, NULL }
 };
 
 
@@ -290,18 +294,26 @@
 #define PDU_HDR_LEN	20
 #define PADDING(x) ((((x) + 3) >> 2) << 2)
 
-#define NORHL(FLAGS,VAR) VAR = (FLAGS & NETWORK_BYTE_ORDER) ? VAR : g_htonl(VAR)
-#define NORHS(FLAGS,VAR) VAR = (FLAGS & NETWORK_BYTE_ORDER) ? VAR : g_htons(VAR)
+#define NORLEL(flags,var,tvb,offset) \
+	var = (flags & NETWORK_BYTE_ORDER) ? \
+		tvb_get_ntohl(tvb, offset) : \
+		tvb_get_letohl(tvb, offset)
+#define NORLES(flags,var,tvb,offset) \
+	var = (flags & NETWORK_BYTE_ORDER) ? \
+		tvb_get_ntohs(tvb, offset) : \
+		tvb_get_letohs(tvb, offset)
 
+/* XXX - Is there a particular reason we're not using oid_to_str() here? */
 static int dissect_octet_string(tvbuff_t *tvb, proto_tree *tree, int offset, char flags)
 {
 	guint32 n_oct, p_noct;
 	char context[1024];
 
-	n_oct = tvb_get_ntohl(tvb, offset);
-	NORHL(flags,n_oct);
+	NORLEL(flags, n_oct, tvb, offset);
 	
 	p_noct = PADDING(n_oct);
+	if (n_oct >= 1024)
+		THROW(ReportedBoundsError);
 	tvb_get_nstringz(tvb, offset + 4, n_oct, context);
 	context[n_oct]='\0';
 
@@ -327,7 +339,6 @@
 	}
 
 	for(i=0; i < len; i++) {
-		printf("->%d<-\n",oid[i]);
 		tlen += sprintf(str+tlen,".%d",oid[i]);
 	}
 	return tlen;
@@ -353,8 +364,7 @@
 	tvb_get_guint8(tvb, offset + 3);
 
 	for(i=0; i<n_subid; i++) {
-		oid[i] = tvb_get_ntohl(tvb,(offset+4) + (i*4));
-		NORHL(flags,oid[i]);
+		NORLEL(flags, oid[i], tvb, (offset+4) + (i*4));
 	}
 
 	if(!(slen = convert_oid_to_str(&oid[0], n_subid, &str_oid[0], 2048, prefix)))
@@ -386,26 +396,20 @@
 
 static int dissect_val64(tvbuff_t *tvb, proto_tree *tree, int offset, char flags)
 {
-	guint64 val;
+	gboolean little_endian = !(flags & NETWORK_BYTE_ORDER);
 
-	val = tvb_get_ntoh64(tvb, offset);
-	NORHL(flags,val);
-
-	proto_tree_add_uint64(tree,hf_val64, tvb, offset, 8, val);
+	proto_tree_add_item(tree, hf_val64, tvb, offset, 8, little_endian);
 	
-	return sizeof(val);
+	return 8;
 }
 
 static int dissect_val32(tvbuff_t *tvb, proto_tree *tree, int offset, char flags)
 {
-	guint32 val;
-	val = tvb_get_ntohl(tvb, offset);
-	NORHL(flags,val);
-
+	gboolean little_endian = !(flags & NETWORK_BYTE_ORDER);
 
-	proto_tree_add_uint(tree,hf_val32, tvb, offset, sizeof(val), val);
+	proto_tree_add_item(tree, hf_val32, tvb, offset, 4, little_endian);
 	
-	return sizeof(val);
+	return 4;
 }
 
 static int dissect_varbind(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char flags)
@@ -415,10 +419,8 @@
 	proto_item* item;
 	proto_tree* subtree;
 	
-	vtag = tvb_get_ntohs(tvb, offset);
-	tvb_get_ntohs(tvb, offset + 2);
-
-	NORHS(flags,vtag);
+	NORLES(flags, vtag, tvb, offset);
+	/* 2 reserved bytes after this */
 
 	if(tree) {
 		item = proto_tree_add_text(tree,tvb, offset, len, "Value Representation");
@@ -464,25 +466,19 @@
 {	
 	proto_item* item;
         proto_tree* subtree;
+	gboolean little_endian = !(flags & NETWORK_BYTE_ORDER);
 	guint32 r_uptime;
-	guint16 r_error;
-	guint16 r_index;
 
 	item = proto_tree_add_text(tree, tvb, offset, len, "Response-PDU");
 	subtree = proto_item_add_subtree(item, ett_response);
 
-	r_uptime = tvb_get_ntohl(tvb, offset);
-	r_error  = tvb_get_ntohs(tvb, offset + 4);
-	r_index  = tvb_get_ntohs(tvb, offset + 6);
-
-	NORHL(flags,r_uptime);
-	NORHS(flags,r_error);
-	NORHS(flags,r_index);
+	r_uptime = little_endian ? \
+	    tvb_get_letohl(tvb, offset) : tvb_get_ntohl(tvb, offset);
 
 	proto_tree_add_uint_format(subtree, hf_resp_uptime, tvb, offset, 4, r_uptime, 
 			"sysUptime: %s", time_msecs_to_str(r_uptime));
-	proto_tree_add_uint(subtree, hf_resp_error,  tvb, offset + 4, 2, r_error);
-	proto_tree_add_uint(subtree, hf_resp_index,  tvb, offset + 6, 2, r_index);
+	proto_tree_add_item(subtree, hf_resp_error,  tvb, offset + 4, 2, little_endian);
+	proto_tree_add_item(subtree, hf_resp_index,  tvb, offset + 6, 2, little_endian);
 	offset += 8;
 		
 	while(len > offset) {
@@ -531,8 +527,7 @@
 {
 	proto_item* item;
         proto_tree* subtree;
-	guint16 non_repeaters;
-	guint16 max_repetitions;
+	gboolean little_endian = !(flags & NETWORK_BYTE_ORDER);
 
 	item = proto_tree_add_text(tree, tvb, offset, len, "GetBulk-PDU");
 	subtree = proto_item_add_subtree(item, ett_getbulk);
@@ -542,14 +537,8 @@
                 offset += dissect_octet_string(tvb, subtree, offset, flags);
         }
 
-	non_repeaters = tvb_get_ntohs(tvb, offset);
-	max_repetitions = tvb_get_ntohs(tvb, offset + 2);
-
-	NORHS(flags,non_repeaters);
-	NORHS(flags,max_repetitions);
-
-	proto_tree_add_uint(subtree, hf_gbulk_nrepeat,  tvb, offset, 2, non_repeaters);
-	proto_tree_add_uint(subtree, hf_gbulk_mrepeat,  tvb, offset + 2, 2, max_repetitions);
+	proto_tree_add_item(subtree, hf_gbulk_nrepeat,  tvb, offset, 2, little_endian);
+	proto_tree_add_item(subtree, hf_gbulk_mrepeat,  tvb, offset + 2, 2, little_endian);
 	offset+=4;
 
 	while(len >= offset) {
@@ -600,10 +589,7 @@
 {
 	proto_item* item;
         proto_tree* subtree;
-	guint8 timeout;
-	guint8 priority;
-	guint8 range_subid;
-	guint32 upper_bound;
+	gboolean little_endian = !(flags & NETWORK_BYTE_ORDER);
 
 	item = proto_tree_add_text(tree, tvb, offset, len, "Register-PDU");
 	subtree = proto_item_add_subtree(item, ett_register);
@@ -613,14 +599,9 @@
                 offset += dissect_octet_string(tvb, subtree, offset, flags);
         }
 
-	timeout = tvb_get_guint8(tvb, offset);
-	priority = tvb_get_guint8(tvb, offset+1);
-	range_subid = tvb_get_guint8(tvb, offset+2);
-	tvb_get_guint8(tvb, offset + 4);
-
-	proto_tree_add_uint(subtree, hf_reg_timeout, tvb, offset, 1, timeout);
-	proto_tree_add_uint(subtree, hf_reg_prio, tvb, offset+1, 1, priority);
-	proto_tree_add_uint(subtree, hf_reg_rsid, tvb, offset+2, 1, range_subid);
+	proto_tree_add_item(subtree, hf_reg_timeout, tvb, offset, 1, FALSE);
+	proto_tree_add_item(subtree, hf_reg_prio, tvb, offset+1, 1, FALSE);
+	proto_tree_add_item(subtree, hf_reg_rsid, tvb, offset+2, 1, FALSE);
 	offset+=4;
 
 	/* Region */
@@ -628,11 +609,8 @@
 	offset += dissect_object_id(tvb, subtree, offset, flags);
 	
 	if(len > offset) {
-	/* Upper bound (opt) */
-	upper_bound = tvb_get_ntohl(tvb, offset);
-	NORHL(flags,upper_bound);
-
-		proto_tree_add_uint(subtree, hf_reg_ubound, tvb, offset, 4, upper_bound); 
+		/* Upper bound (opt) */
+		proto_tree_add_item(subtree, hf_reg_ubound, tvb, offset, 4, little_endian);
 		offset += 4;
 	}
 }
@@ -642,10 +620,7 @@
 {
 	proto_item* item;
         proto_tree* subtree;
-	guint8 timeout;
-        guint8 priority;
-        guint8 range_subid;
-        guint32 upper_bound;
+	gboolean little_endian = !(flags & NETWORK_BYTE_ORDER);
 
 	item = proto_tree_add_text(tree, tvb, offset, len, "Unregister-PDU");
 	subtree = proto_item_add_subtree(item, ett_unregister);
@@ -655,25 +630,17 @@
                 offset += dissect_octet_string(tvb, subtree, offset, flags);
         }
 
-        timeout = tvb_get_guint8(tvb, offset);
-        priority = tvb_get_guint8(tvb, offset+1);
-        range_subid = tvb_get_guint8(tvb, offset+2);
-        tvb_get_guint8(tvb, offset + 4);
-
-        proto_tree_add_uint(subtree, hf_unreg_timeout, tvb, offset, 1, timeout);
-        proto_tree_add_uint(subtree, hf_unreg_prio, tvb, offset+1, 1, priority);
-        proto_tree_add_uint(subtree, hf_unreg_rsid, tvb, offset+2, 1, range_subid);
+        proto_tree_add_item(subtree, hf_unreg_timeout, tvb, offset, 1, FALSE);
+        proto_tree_add_item(subtree, hf_unreg_prio, tvb, offset+1, 1, FALSE);
+        proto_tree_add_item(subtree, hf_unreg_rsid, tvb, offset+2, 1, FALSE);
         offset+=4;
 
         /* Region */
         offset += dissect_object_id(tvb, subtree, offset, flags);
 
         if(len > offset) {
-        /* Upper bound (opt) */
-        upper_bound = tvb_get_ntohl(tvb, offset);
-        NORHL(flags,upper_bound);
-
-                proto_tree_add_uint(subtree, hf_unreg_ubound, tvb, offset, 4, upper_bound);
+	        /* Upper bound (opt) */
+                proto_tree_add_item(subtree, hf_unreg_ubound, tvb, offset, 4, little_endian);
                 offset += 4;
         }
 }
@@ -802,13 +769,15 @@
 
 static guint get_agentx_pdu_len(tvbuff_t *tvb, int offset)
 {
+	guint8  flags;
 	guint32 plen;
 
 	/*
 	 * Get the payload length.
 	 */
-	plen = tvb_get_ntohl(tvb, offset+16);
-
+	flags = tvb_get_guint8(tvb, offset + 2);
+	NORLEL(flags, plen, tvb, offset + 16);
+	
 	/*
 	 * Arbitrarily limit it to 2^24, so we don't have to worry about
 	 * overflow.
@@ -840,18 +809,12 @@
 	type = tvb_get_guint8(tvb,1); offset+=1;
 	flags = tvb_get_guint8(tvb,2); offset+=1;
 	/* skip reserved byte */ 
-	tvb_get_guint8(tvb,3); offset+=1;
-
-	session_id = tvb_get_ntohl(tvb, 4); offset+=4;
-	trans_id   = tvb_get_ntohl(tvb, 8); offset+=4;
-	packet_id  = tvb_get_ntohl(tvb, 12); offset+=4;
-	payload_len = tvb_get_ntohl(tvb, 16); offset+=4;
-
-	NORHL(flags,session_id);
-	NORHL(flags,trans_id);
-	NORHL(flags,packet_id);
-	NORHL(flags,payload_len);
+	offset+=1;
 
+	NORLEL(flags, session_id, tvb, 4); offset+=4;
+	NORLEL(flags, trans_id, tvb, 8); offset+=4;
+	NORLEL(flags, packet_id, tvb, 12); offset+=4;
+	NORLEL(flags, payload_len, tvb, 16); offset+=4;
 
         if (check_col(pinfo->cinfo, COL_PROTOCOL))
                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "AgentX");
--- ethereal-0.10.10.orig/plugins/artnet/Makefile.in
+++ ethereal-0.10.10/plugins/artnet/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/asn1/Makefile.in
+++ ethereal-0.10.10/plugins/asn1/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/asn1/packet-asn1.c
+++ ethereal-0.10.10/plugins/asn1/packet-asn1.c
@@ -169,9 +169,9 @@
 static int pcount = 0;
 
 static tvbuff_t *asn1_desc;	/* the PDU description */
-static GNode *asn1_nodes = 0;	/* GNode tree pointing to every asn1 data element */
-static GNode *data_nodes = 0;	/* GNode tree describing the syntax data */
-static GNode *PDUtree = 0;	/* GNode tree describing the expected PDU format */
+static GNode *asn1_nodes = NULL;	/* GNode tree pointing to every asn1 data element */
+static GNode *data_nodes = NULL;	/* GNode tree describing the syntax data */
+static GNode *PDUtree = NULL;	/* GNode tree describing the expected PDU format */
 
 static guint PDUerrcount = 0;   /* count of parse errors in one ASN.1 message */
 
@@ -516,7 +516,7 @@
 	if (count > 32)
 		return "*too many bits, no names...*";
 
-	if (val != 0) {
+	if (val != NULL) {
 		for(i=0; i<count; i++) {
 			if (val[i>>3] & (0x80 >> (i & 7))) { /* bit i is set */
 				p += sprintf(p,"%s,", getPDUenum(props, offset, 0, 0, i));
@@ -540,7 +540,7 @@
 	guint i;
 	char *p = str;
 
-	if (oid != 0) {
+	if (oid != NULL) {
 		for(i=0; i<len; i++) {
 			if (i) *p++ = '.';
 			p += sprintf(p, "%lu", (unsigned long)oid[i]);
@@ -3994,7 +3994,7 @@
 
 #undef CHECKP
 #define CHECKP(p) {if ((p==0)||(PDUstatec<0)){g_warning("pointer==0, line %d **********", __LINE__);\
-				pos.node=0;PUSHNODE(pos);return ret;}}
+				pos.node=NULL;PUSHNODE(pos);return ret;}}
 
 
 static void
@@ -4131,7 +4131,7 @@
 	PDUstatec = 0; /* stackpointer */
 	PDUerrcount = 0; /* error counter per asn.1 message */
 	
-	pos.node = 0; /* sentinel */
+	pos.node = NULL; /* sentinel */
 	pos.name = "sentinel";
 	pos.type = TBL_SEQUENCEOF;
 	pos.offset = 0;
@@ -4275,8 +4275,8 @@
 
 
 		pos = POPSTATE;	/* this is pushed back on the stack later */
-		if (pos.node == 0) {
-			if (asn1_verbose) g_message("  EOI, pos.node == 0");
+		if (pos.node == NULL) {
+			if (asn1_verbose) g_message("  EOI, pos.node == NULL");
 			out->name = "*no-name-EOI*";
 			out->flags |= OUT_FLAG_noname;
 			PDUerrcount++;
@@ -4315,8 +4315,8 @@
 
 		/* find appropriate node for this tag */
 
-		if (pos.node == 0) {
-			if (asn1_verbose) g_message("  pos.node == 0");
+		if (pos.node == NULL) {
+			if (asn1_verbose) g_message("  pos.node == NULL");
 			out->name = "*no-name*";
 			out->flags |= OUT_FLAG_noname;
 			PDUerrcount++;
@@ -4461,7 +4461,7 @@
 					g_message("    choice [push], %c%d, %s",
 						  tag_class[info->tclass], info->tag, GETNAME);
 				pos.node = makechoice(pos.node, class, tag);
-				if (pos.node == 0) {
+				if (pos.node == NULL) {
 					pos = POPSTATE;
 					out->flags |= OUT_FLAG_noname;
 					PDUerrcount++;
@@ -4496,7 +4496,7 @@
 			}
 		}
 
-		if (pos.node == 0) {
+		if (pos.node == NULL) {
 			ret = "*no-name-2*";
 			if (asn1_verbose) g_message("  return '%s'", ret);
 			out->name = ret;
@@ -4520,7 +4520,7 @@
 					g_message("    got %c%d, found %c%d", tag_class[class], tag,
 							tag_class[info->tclass], info->tag);
 				NEXT;
-				if (pos.node == 0) {
+				if (pos.node == NULL) {
 					ret = "------";
 					if (cons) {
 						pos = save_pos; /* reset for next time */
@@ -4560,11 +4560,11 @@
 					typeflags &= ~TBL_CHOICE_made;
 				}
 
-				if (asn1_verbose)
+				if (asn1_verbose && info)
 					g_message("    immediate choice [push], %c%d, %s",
 						  tag_class[info->tclass], info->tag, GETNAME);
 				pos.node = makechoice(pos.node, class, tag);
-				if (pos.node == 0) {
+				if (pos.node == NULL) {
 					pos = POPSTATE;
 					PDUerrcount++;
 				}
@@ -4619,7 +4619,7 @@
 		}
 		
 		/* must follow references now */
-		if (pos.type == TBL_TYPEREF) {
+		if (pos.type == TBL_TYPEREF && info) {
 			out->typename = info->typename;
 			out->type_id = info->typenum;
 			out->flags |= OUT_FLAG_typename;
@@ -4636,7 +4636,7 @@
 					tmp = asn1_tag[info->tag];
 					pos.type = asn1_uni_type[info->tag]; /* get univsrsal type */
 				}
-				if (asn1_verbose)
+				if (asn1_verbose && info)
 					g_message("  indirect typeref to %s:%s, %s [%c%d]",
 						  TBLTYPE(pos.type), info->typename, tmp,
 						  tag_class[info->tclass], info->tag );
--- ethereal-0.10.10.orig/plugins/ciscosm/Makefile.in
+++ ethereal-0.10.10/plugins/ciscosm/Makefile.in
@@ -66,11 +66,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/docsis/Makefile.in
+++ ethereal-0.10.10/plugins/docsis/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	AUTHORS ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/docsis/packet-docsis.c
+++ ethereal-0.10.10/plugins/docsis/packet-docsis.c
@@ -194,7 +194,7 @@
 {
   proto_tree *ehdr_tree;
   proto_item *it;
-  guint8 ehdrlen;
+  gint ehdrlen;
   int pos;
   guint8 type;
   guint8 len;
@@ -207,7 +207,7 @@
 
   it = proto_tree_add_text (tree, tvb, pos, ehdrlen, "Extended Header");
   ehdr_tree = proto_item_add_subtree (it, ett_ehdr);
-  while (pos < (int)(ehdrlen + 4))
+  while (pos < ehdrlen + 4)
     {
       type = (tvb_get_guint8 (tvb, pos) & 0xF0);
       len = (tvb_get_guint8 (tvb, pos) & 0x0F);
@@ -322,13 +322,14 @@
   guint8 fctype;
   guint8 fcparm;
   guint8 ehdron;
-  guint8 mac_parm;
-  guint8 hdrlen;
+  gint mac_parm;
+  gint hdrlen;
   guint16 len_sid;
   tvbuff_t *next_tvb, *mgt_tvb;
   gint pdulen, captured_length;
-  guint16 framelen;
+  gint framelen;
   gboolean isfrag = FALSE;
+  gint oldconcatlen;
 
 /* Set up structures needed to add the protocol subtree and manage it */
   proto_item *ti;
@@ -336,8 +337,8 @@
 /* concatlen and concatpos are declared static to allow for recursive calls to
  * the dissect_docsis routine when dissecting Concatenated frames
  */
-  static guint16 concatlen;
-  static guint16 concatpos;
+  static gint concatlen;
+  static gint concatpos;
 
 /* Extract important fields */
   fc = tvb_get_guint8 (tvb, 0);	/* Frame Control Byte */
@@ -563,8 +564,11 @@
 	   * docsis frames are dissected. */
 	  while (concatlen > 0)
 	    {
+	      oldconcatlen = concatlen;
 	      next_tvb = tvb_new_subset (tvb, concatpos, -1, concatlen);
 	      call_dissector (docsis_handle, next_tvb, pinfo, tree);
+	      if (oldconcatlen <= concatlen)
+		THROW(ReportedBoundsError);
 	    }
 	  concatlen = 0;
 	  concatpos = 0;
--- ethereal-0.10.10.orig/plugins/enttec/Makefile.in
+++ ethereal-0.10.10/plugins/enttec/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/giop/Makefile.in
+++ ethereal-0.10.10/plugins/giop/Makefile.in
@@ -68,11 +68,8 @@
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	AUTHORS COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/gryphon/Makefile.in
+++ ethereal-0.10.10/plugins/gryphon/Makefile.in
@@ -67,11 +67,8 @@
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	AUTHORS COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/irda/Makefile.in
+++ ethereal-0.10.10/plugins/irda/Makefile.in
@@ -64,11 +64,8 @@
 subdir = plugins/irda
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/irda/packet-irda.c
+++ ethereal-0.10.10/plugins/irda/packet-irda.c
@@ -949,7 +949,7 @@
         if (tree)
         {
             proto_item* ti = proto_tree_add_item(tree, hf_iap_invaloctet, tvb, offset, 0, FALSE);
-            proto_item_append_text(ti, attr_name);
+            proto_item_append_text(ti, "%s", attr_name);
             proto_item_append_text(ti, "\" attribute must be octet sequence!");
         }
 
@@ -975,7 +975,7 @@
         if (tree)
         {
             proto_item* ti = proto_tree_add_item(tree, hf_iap_invallsap, tvb, offset, 0, FALSE);
-            proto_item_append_text(ti, attr_name);
+            proto_item_append_text(ti, "%s", attr_name);
             proto_item_append_text(ti, "\" attribute must be integer value between 0x01 and 0x6F!");
         }
 
--- ethereal-0.10.10.orig/plugins/lwres/Makefile.in
+++ ethereal-0.10.10/plugins/lwres/Makefile.in
@@ -64,11 +64,8 @@
 subdir = plugins/lwres
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/mate/Makefile.in
+++ ethereal-0.10.10/plugins/mate/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/megaco/Makefile.in
+++ ethereal-0.10.10/plugins/megaco/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/megaco/packet-megaco.c
+++ ethereal-0.10.10/plugins/megaco/packet-megaco.c
@@ -2,7 +2,7 @@
 * Routines for megaco packet disassembly
 * RFC 3015
 *
-* $Id: packet-megaco.c 13644 2005-03-07 02:44:41Z guy $
+* $Id: packet-megaco.c 14291 2005-05-03 18:19:56Z gerald $
 *
 * Christian Falckenberg, 2002/10/17
 * Copyright (c) 2002 by Christian Falckenberg
@@ -598,8 +598,13 @@
 		tvb_previous_offset = tvb_find_guint8(tvb, tvb_current_offset,
 			tvb_len, '=')+1;
 		tvb_previous_offset = tvb_skip_wsp(tvb, tvb_previous_offset);
-		tvb_current_offset = tvb_find_guint8(tvb, tvb_previous_offset,
+		tvb_next_offset = tvb_find_guint8(tvb, tvb_previous_offset,
 			tvb_len, '{');
+		if (tvb_current_offset >= tvb_next_offset) {
+			proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Invalid offset ]");
+			return;
+		}
+		tvb_current_offset = tvb_next_offset;
 		
 		
 		tokenlen = tvb_current_offset - tvb_previous_offset;
@@ -857,6 +862,7 @@
 									
 									default:
 										tokenlen =  (tvb_RBRKT+1) - tvb_previous_offset;
+										tvb_ensure_bytes_exist(tvb, tvb_previous_offset, tokenlen);
 										proto_tree_add_string(megaco_tree, hf_megaco_error_Frame, tvb,
 											tvb_previous_offset, tokenlen,
 											"No Command detectable !");
@@ -883,6 +889,10 @@
 					switch ( tempchar ){
 						
 					case 'E':
+						if ((tokenlen+1 > (int) sizeof(TermID)) || (tokenlen+1 <= 0)) {
+							proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Invalid TermID length (%d) ]", tokenlen+1);
+							return;
+						}
 						tvb_get_nstringz0(tvb,tvb_offset,tokenlen+1,TermID);
 						TermID[0] = 'e';
 						my_proto_tree_add_string(megaco_tree_command_line, hf_megaco_termid, tvb,
@@ -996,6 +1006,10 @@
 			tvb_current_offset = tvb_descriptors_end_offset;
 			
 		}
+		if (tvb_current_offset <= tvb_previous_offset) {
+			proto_tree_add_text(megaco_tree_command_line, tvb, 0, 0, "[ Parse error: Invalid offset ]");
+			return;
+		}
 		
 		
 		
--- ethereal-0.10.10.orig/plugins/mgcp/packet-mgcp.c
+++ ethereal-0.10.10/plugins/mgcp/packet-mgcp.c
@@ -1416,7 +1416,7 @@
  */
 static void dissect_mgcp_params(tvbuff_t *tvb, proto_tree *tree){
   int linelen, tokenlen, *my_param;
-  gint tvb_lineend,tvb_current_len, tvb_linebegin,tvb_len;
+  gint tvb_lineend,tvb_current_len, tvb_linebegin,tvb_len, old_lineend;
   gint tvb_tokenbegin;
   proto_tree *mgcp_param_ti, *mgcp_param_tree;
   proto_item* (*my_proto_tree_add_string)(proto_tree*, int, tvbuff_t*, gint,
@@ -1443,11 +1443,12 @@
 
     /* Parse the parameters */
     while(tvb_lineend < tvb_len){
+      old_lineend = tvb_lineend;
       linelen = tvb_find_line_end(tvb, tvb_linebegin, -1,&tvb_lineend,FALSE);
       tvb_tokenbegin = tvb_parse_param(tvb, tvb_linebegin, linelen,
 				       &my_param);
 
-      if (*my_param == hf_mgcp_param_connectionparam) {
+      if (my_param && *my_param == hf_mgcp_param_connectionparam) {
 	tokenlen = tvb_find_line_end(tvb,tvb_tokenbegin,-1,&tvb_lineend,FALSE);
 	dissect_mgcp_connectionparams(mgcp_param_tree, tvb, tvb_linebegin, tvb_tokenbegin - tvb_linebegin, tokenlen);
       } else {
@@ -1458,6 +1459,8 @@
 						 tokenlen));
       }
       tvb_linebegin = tvb_lineend;
+      if (old_lineend <= tvb_lineend)
+        THROW(ReportedBoundsError);
     }
   }
 }
--- ethereal-0.10.10.orig/plugins/opsi/Makefile.in
+++ ethereal-0.10.10/plugins/opsi/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/pcli/Makefile.in
+++ ethereal-0.10.10/plugins/pcli/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/rdm/Makefile.in
+++ ethereal-0.10.10/plugins/rdm/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/rdm/packet-rdm.c
+++ ethereal-0.10.10/plugins/rdm/packet-rdm.c
@@ -1,7 +1,7 @@
 /* packet-rdm.c
  * Routines for RDM packet disassembly
  *
- * $Id: packet-rdm.c 13644 2005-03-07 02:44:41Z guy $
+ * $Id: packet-rdm.c 14008 2005-04-04 03:01:40Z gerald $
  *
  * Copyright (c) 2003 by Erwin Rol <erwin@erwinrol.com>
  *
@@ -111,6 +111,13 @@
     offset += 1;
 
     mdb_size = tvb_get_guint8(tvb, offset) - 19;
+
+    if (mdb_size < 20) {
+      proto_tree_add_text(rdm_tree, tvb, offset, 1, "Invalid MDB size: %d", 
+			mdb_size + 19);
+      return;
+    }
+
     proto_tree_add_item(rdm_tree, hf_rdm_slot_count, tvb,
                         offset, 1, FALSE);
     offset += 1;
@@ -139,6 +146,7 @@
                         offset, 1, FALSE);
     offset += 1;
 
+    tvb_ensure_bytes_exist(tvb, offset, mdb_size);
     proto_tree_add_item(rdm_tree, hf_rdm_mdb, tvb,
                         offset, mdb_size, FALSE);
     offset += mdb_size;
--- ethereal-0.10.10.orig/plugins/rlm/Makefile.in
+++ ethereal-0.10.10/plugins/rlm/Makefile.in
@@ -66,11 +66,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/rtnet/Makefile.in
+++ ethereal-0.10.10/plugins/rtnet/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/rudp/Makefile.in
+++ ethereal-0.10.10/plugins/rudp/Makefile.in
@@ -66,11 +66,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/stats_tree/Makefile.in
+++ ethereal-0.10.10/plugins/stats_tree/Makefile.in
@@ -64,11 +64,8 @@
 subdir = plugins/stats_tree
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/v5ua/Makefile.in
+++ ethereal-0.10.10/plugins/v5ua/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/xml/Makefile.in
+++ ethereal-0.10.10/plugins/xml/Makefile.in
@@ -65,11 +65,8 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \
 	COPYING xml_lexer.c
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/plugins/xml/packet-xml.c
+++ ethereal-0.10.10/plugins/xml/packet-xml.c
@@ -3,7 +3,7 @@
 *
 * Copyright 2004, Luis E. Garcia Ontanon <luis.ontanon@gmail.com>
 *
-* $Id: packet-xml.c 13698 2005-03-10 20:17:34Z gerald $
+* $Id: packet-xml.c 13741 2005-03-13 10:26:56Z guy $
 *
 * Ethereal - Network traffic analyzer
 * By Gerald Combs <gerald@ethereal.com>
@@ -56,7 +56,7 @@
 	txt = tvb_get_string(tvb,offset,len);
 
 	if ( hfid ) {
-		pi = proto_tree_add_string_format(tree,hfid,tvb,offset,len,txt,format_text(txt, len));
+		pi = proto_tree_add_string_format(tree,hfid,tvb,offset,len,txt,"%s",format_text(txt, len));
 	} else {
 		pi = proto_tree_add_text(tree,tvb,offset,len,"%s",format_text(txt, len));
 	}
--- ethereal-0.10.10.orig/help/Makefile.in
+++ ethereal-0.10.10/help/Makefile.in
@@ -61,11 +61,8 @@
 subdir = help
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/./aclocal-fallback/glib-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/glib.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk-2.0.m4 \
-	$(top_srcdir)/./aclocal-fallback/gtk.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(mkdir_p)
--- ethereal-0.10.10.orig/asn2deb.dbk
+++ ethereal-0.10.10/asn2deb.dbk
@@ -0,0 +1,158 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+  <!ENTITY command     "<command>asn2deb</command>">
+  <!ENTITY email       "<email>debacle@debian.org</email>">
+  <!ENTITY author      "W. Borgert">
+  <!ENTITY debian      "<productname>Debian GNU/Linux</productname>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &email;
+    </address>
+    <author>
+      <firstname>W.</firstname>
+      <surname>Borgert</surname>
+    </author>
+    <copyright>
+      <year>2003</year>
+      <year>2005</year>
+      <holder>&author;</holder>
+    </copyright>
+    <date>2004-02-18</date>
+    <keywordset>
+      <keyword>ASN.1</keyword>
+      <keyword>BER</keyword>
+      <keyword>Ethereal</keyword>
+    </keywordset>
+    <revhistory>
+      <revision>
+	<revnumber>1</revnumber>
+	<date>2004-02-18</date>
+	<authorinitials>debacle</authorinitials>
+	<revremark>First version.</revremark>
+      </revision>
+    </revhistory>
+  </refentryinfo>
+  <refmeta>
+    <refentrytitle>asn2deb</refentrytitle>
+
+    <manvolnum>1</manvolnum>
+  </refmeta>
+  <refnamediv>
+    <refname>asn2deb</refname>
+
+    <refpurpose>create a Debian package for BER monitoring from ASN.1</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      &command;
+      <arg>-a <replaceable>ASN.1 file</replaceable></arg>
+      <arg>--asn=<replaceable>ASN.1 file</replaceable></arg>
+      <arg><option>-d <replaceable>opts</replaceable></option></arg>
+      <arg><option>--dbopts=<replaceable>opts</replaceable></option></arg>
+      <arg><option>-e <replaceable>address</replaceable></option></arg>
+      <arg><option>--email=<replaceable>address</replaceable></option></arg>
+      <arg><option>-h</option></arg>
+      <arg><option>--help</option></arg>
+      <arg><option>-n <replaceable>name</replaceable></option></arg>
+      <arg><option>--name=<replaceable>name</replaceable></option></arg>
+      <arg><option>-p</option></arg>
+      <arg><option>--preserve</option></arg>
+      <arg><option>-v</option></arg>
+      <arg><option>--version</option></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+  <refsect1>
+    <title>Description</title>
+
+    <para>This manual page documents briefly the
+      <command>asn2deb</command> command.</para>
+
+    <para>&command; takes an ASN.1 file as input and creates a Debian
+    package from it.  The package contains a loadable type table file
+    for the ethereal network analyser.  The type table is generated by
+    the ASN.1 compiler <command>snacc</command>.</para>
+  </refsect1>
+  <refsect1>
+    <title>Options</title>
+
+    <variablelist>
+      <varlistentry>
+        <term><option>-a <replaceable>ASN.1 file</replaceable></option>
+          <option>--asn=<replaceable>ASN.1 file</replaceable></option></term>
+        <listitem>
+          <para>ASN.1 file to use (mandatory).</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-d <replaceable>opts</replaceable></option>
+          <option>--dbopts=<replaceable>opts</replaceable></option></term>
+        <listitem>
+          <para>options for dpkg-buildpackage.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-e <replaceable>address</replaceable></option>
+          <option>--email=<replaceable>address</replaceable></option></term>
+        <listitem>
+          <para>use e-mail address.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-h</option>
+          <option>--help</option>
+        </term>
+        <listitem>
+          <para>print help and exit.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-n <replaceable>name</replaceable></option>
+          <option>--name=<replaceable>name</replaceable></option></term>
+        <listitem>
+          <para>use user name.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-p</option>
+          <option>--preserve</option></term>
+        <listitem>
+          <para>do not overwrite files.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-v</option>
+          <option>--version</option></term>
+        <listitem>
+          <para>print version and exit.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+
+    <para>Example:</para>
+
+    <programlisting>/usr/bin/asn2deb -e me@foo.net -a bar.asn1 \
+-n &quot;My Name&quot; -d &quot;-rfakeroot -uc -us&quot;</programlisting>
+
+  </refsect1>
+  <refsect1>
+    <title>See Also</title>
+
+    <para>A lot of tools are used, which you have to
+    <command>apt-get install</command>: ethereal-dev, python,
+    cdbs, autotools-dev, debhelper, dpkg-dev, snacc.</para>
+  </refsect1>
+
+  <refsect1>
+    <title>Copying</title>
+
+    <para>This manual page was written by &author; &email; for
+      &debian; (but may be used by others).  Permission is granted to
+      copy, distribute and/or modify this document under the terms of
+      the GNU General Public License, Version 2 or any later
+      version published by the Free Software Foundation.</para>
+  </refsect1>
+</refentry>
--- ethereal-0.10.10.orig/idl2deb.dbk
+++ ethereal-0.10.10/idl2deb.dbk
@@ -0,0 +1,157 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+  <!ENTITY command     "<command>idl2deb</command>">
+  <!ENTITY email       "<email>debacle@debian.org</email>">
+  <!ENTITY author      "W. Borgert">
+  <!ENTITY debian      "<productname>Debian GNU/Linux</productname>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &email;
+    </address>
+    <author>
+      <firstname>W.</firstname>
+      <surname>Borgert</surname>
+    </author>
+    <copyright>
+      <year>2003</year>
+      <year>2005</year>
+      <holder>&author;</holder>
+    </copyright>
+    <date>2003-08-17</date>
+    <keywordset>
+      <keyword>CORBA</keyword>
+      <keyword>IDL</keyword>
+      <keyword>Ethereal</keyword>
+    </keywordset>
+    <revhistory>
+      <revision>
+	<revnumber>2003-08-17</revnumber>
+	<date>2003-08-17</date>
+	<authorinitials>debacle</authorinitials>
+	<revremark>First version.</revremark>
+      </revision>
+    </revhistory>
+  </refentryinfo>
+  <refmeta>
+    <refentrytitle>idl2deb</refentrytitle>
+
+    <manvolnum>1</manvolnum>
+  </refmeta>
+  <refnamediv>
+    <refname>idl2deb</refname>
+
+    <refpurpose>create a Debian package for CORBA monitoring from IDL</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      &command;
+      <arg><option>-d <replaceable>opts</replaceable></option></arg>
+      <arg><option>--dbopts=<replaceable>opts</replaceable></option></arg>
+      <arg><option>-e <replaceable>address</replaceable></option></arg>
+      <arg><option>--email=<replaceable>address</replaceable></option></arg>
+      <arg>-i <replaceable>idlfile</replaceable></arg>
+      <arg>--idl=<replaceable>idlfile</replaceable></arg>
+      <arg><option>-h</option></arg>
+      <arg><option>--help</option></arg>
+      <arg><option>-n <replaceable>name</replaceable></option></arg>
+      <arg><option>--name=<replaceable>name</replaceable></option></arg>
+      <arg><option>-p</option></arg>
+      <arg><option>--preserve</option></arg>
+      <arg><option>-v</option></arg>
+      <arg><option>--version</option></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+  <refsect1>
+    <title>Description</title>
+
+    <para>This manual page documents briefly the
+      <command>idl2deb</command> command.</para>
+
+    <para>&command; takes an CORBA IDL file as input and creates a
+    Debian package from it.  The package contains a loadable module
+    for the ethereal network analyser.</para>
+  </refsect1>
+  <refsect1>
+    <title>Options</title>
+
+    <variablelist>
+      <varlistentry>
+        <term><option>-d <replaceable>opts</replaceable></option>
+          <option>--dbopts=<replaceable>opts</replaceable></option></term>
+        <listitem>
+          <para>options for dpkg-buildpackage.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-e <replaceable>address</replaceable></option>
+          <option>--email=<replaceable>address</replaceable></option></term>
+        <listitem>
+          <para>use e-mail address.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-i <replaceable>idlfile</replaceable></option>
+          <option>--idl=<replaceable>idlfile</replaceable></option></term>
+        <listitem>
+          <para>IDL file to use (mandatory).</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-h</option>
+          <option>--help</option>
+        </term>
+        <listitem>
+          <para>print help and exit.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-n <replaceable>name</replaceable></option>
+          <option>--name=<replaceable>name</replaceable></option></term>
+        <listitem>
+          <para>use user name.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-p</option>
+          <option>--preserve</option></term>
+        <listitem>
+          <para>do not overwrite files.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-v</option>
+          <option>--version</option></term>
+        <listitem>
+          <para>print version and exit.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+
+    <para>Example:</para>
+
+    <programlisting>/usr/bin/idl2deb -e me@foo.net -i bar.idl \
+-n &quot;My Name&quot; -d &quot;-rfakeroot -uc -us&quot;</programlisting>
+
+  </refsect1>
+  <refsect1>
+    <title>See Also</title>
+
+    <para>A lot of tools are used, which you have to
+    <command>apt-get install</command>: ethereal-dev, python,
+    cdbs, autotools-dev, debhelper, dpkg-dev.</para>
+  </refsect1>
+
+  <refsect1>
+    <title>Copying</title>
+
+    <para>This manual page was written by &author; &email; for
+      &debian; (but may be used by others).  Permission is granted to
+      copy, distribute and/or modify this document under the terms of
+      the GNU General Public License, Version 2 or any later
+      version published by the Free Software Foundation.</para>
+  </refsect1>
+</refentry>
--- ethereal-0.10.10.orig/idl2deb
+++ ethereal-0.10.10/idl2deb
@@ -0,0 +1,252 @@
+#!/usr/bin/env python
+
+# idl2deb - quick hack by W. Borgert <debacle@debian.org> to create
+# Debian GNU/Linux packages from idl2eth modules for Ethereal.
+# Copyright 2003, W. Borgert
+
+# Makefile.am and configure.ac code by:
+# Copyright 2001, Ericsson Inc.
+# Frank Singleton <frank.singleton@ericsson.com>
+#
+# Ethereal - Network traffic analyzer
+# By Gerald Combs <gerald@ethereal.com>
+# Copyright 1998 Gerald Combs
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+import getopt, os, string, sys, time
+
+scriptinfo = """idl2deb version 2003-10-03
+Copyright 2003, W. Borgert
+Free software, released under the terms of the GPL."""
+
+options = {'dbopts':   "",
+           'email':    "invalid@invalid.invalid",
+           'help':     0,
+           'idl':      None,
+           'name':     "No Name",
+           'preserve': 0,
+           'version':  0}
+
+def bootstrap():
+    """Generate Makefile.in and configure script."""
+    os.system("aclocal")
+    os.system("autoconf")
+    os.system("libtoolize --automake --copy --force")
+    os.system("automake --add-missing --copy --foreign")
+
+def create_file(filename, content, mode = None):
+    """Create a file with given content."""
+    global options
+    if options['preserve'] and os.path.isfile(filename):
+        return
+    f = open(filename, 'w')
+    f.write(content)
+    f.close()
+    if mode:
+        os.chmod(filename, mode)
+
+def create_files(version, deb, email, idl, name, iso, rfc):
+    """Create all files for the .deb build process."""
+    base = idl.lower()[:-4]
+    create_file("Makefile.am", """#
+
+plugindir = @plugindir@
+
+plugin_LTLIBRARIES = %s.la
+%s_la_SOURCES = packet-%s.c
+%s_la_LDFLAGS = -module -avoid-version
+
+GLIB_CFLAGS = `pkg-config --cflags glib-2.0`
+GLIB_LIBS = `pkg-config --libs glib-2.0`
+BUILT_SOURCES = packet-%s.c
+INCLUDES = -DHAVE_CONFIG -DHAVE_SYS_TYPES_H -DHAVE_SYS_TIME_H \\
+    -DHAVE_STDARG_H -D_U_=\"__attribute__((unused))\" \\
+    -I/usr/include/ethereal -DETH_VAR_IMPORT=extern $(GLIB_CFLAGS)
+LDADD = $(GLIB_LIBS)
+
+# Libs must be cleared, or else libtool won't create a shared module.
+# If your module needs to be linked against any particular libraries,
+# add them here.
+LIBS =
+
+%s_la_DEPENDENCIES = packet-%s-static.o
+
+packet-%s-static.o: packet-%s.c
+	$(LTCOMPILE) -c -o packet-%s-static.o \\
+	  -D__ETHEREAL_STATIC__ packet-%s.c
+
+packet-%s.c: """  % ((base,) * 12) + idl + """
+	$(IDL2ETH) $< > $@
+""")
+
+    create_file("configure.ac", """AC_INIT(%s, 1.0)
+AC_PROG_LIBTOOL
+AM_INIT_AUTOMAKE
+AM_MAINTAINER_MODE
+AC_PROG_CC
+AC_STDC_HEADERS
+AC_PROG_INSTALL
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(LDFLAGS)
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.2.2)
+AC_SUBST(GLIB_CFLAGS)
+AC_SUBST(GLIB_LIBS)
+IDL2ETH=\"`type -p idl2eth`\"
+AC_SUBST(IDL2ETH)
+ETHEREAL_VERSION=\"%s\"
+plugindir=\"$libdir/ethereal/plugins/$ETHEREAL_VERSION\"
+AC_SUBST(plugindir)
+AC_OUTPUT([Makefile])
+""" % (base, version))
+
+    if not os.path.isdir("debian"):
+        os.mkdir("debian")
+
+    create_file("debian/rules", """#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+
+PREFIX=`pwd`/debian/ethereal-giop-%s
+
+binary-post-install/ethereal-giop-%s::
+	rm -f $(PREFIX)/usr/lib/ethereal/plugins/%s/*.a
+""" % (base, base, version), 0755)
+
+    create_file("debian/control", """Source: ethereal-giop-%s
+Section: net
+Priority: optional
+Maintainer: %s <%s>
+Standards-Version: 3.6.1.0
+Build-Depends: ethereal-dev, autotools-dev, debhelper, cdbs
+
+Package: ethereal-giop-%s
+Architecture: any
+Depends: ethereal (= %s), ${shlibs:Depends}
+Description: GIOP dissector for CORBA interface %s
+ This package provides a dissector for GIOP (General Inter-ORB
+ Protocol) for the Ethereal protocol analyser.  It decodes the CORBA
+ (Common Object Request Broker Architecture) interfaces described
+ in the IDL (Interface Definition Language) file '%s.idl'.
+""" % (base, name, email, base, deb, base, base))
+
+    create_file("debian/changelog",
+            """ethereal-giop-%s (0.0.1-1) unstable; urgency=low
+
+  * Automatically created package.
+
+ -- %s <%s>  %s
+""" % (base, name, email, rfc + "\n    (" + iso + ")"))
+
+    create_file("debian/copyright",
+            """This package has been created automatically be idl2deb on
+%s for Debian GNU/Linux.
+
+Ethereal: http://www.ethereal.com/
+
+Copyright:
+
+GPL, as evidenced by existence of GPL license file \"COPYING\".
+(the GNU GPL may be viewed on Debian systems in
+/usr/share/common-licenses/GPL)
+""" % (iso))
+
+def get_eth_version():
+    """Detect version of ethereal-dev package."""
+    deb = os.popen(
+        "dpkg-query -W --showformat='${Version}' ethereal-dev").read()
+    debv = string.find(deb, "-")
+    if debv == -1: debv = len(deb)
+    version = deb[string.find(deb, ":")+1:debv]
+    return version, deb
+
+def get_time():
+    """Detect current time and return ISO and RFC time string."""
+    currenttime = time.gmtime()
+    return time.strftime("%Y-%m-%d %H:%M:%S +0000", currenttime), \
+           time.strftime("%a, %d %b %Y %H:%M:%S +0000", currenttime)
+
+def main():
+    global options
+    process_opts(sys.argv)
+    iso, rfc = get_time()
+    version, deb = get_eth_version()
+    create_files(version, deb,
+                 options['email'], options['idl'], options['name'],
+                 iso, rfc)
+    bootstrap()
+    os.system("dpkg-buildpackage " + options['dbopts'])
+
+def process_opts(argv):
+    """Process command line options."""
+    global options
+    try:
+        opts, args = getopt.getopt(argv[1:], "d:e:hi:n:pv",
+                                   ["dbopts=",
+                                    "email=",
+                                    "help",
+                                    "idl=",
+                                    "name=",
+                                    "preserve",
+                                    "version"])
+    except getopt.GetoptError:
+        usage(argv[0])
+        sys.exit(1)
+    for o, a in opts:
+        if o in ("-d", "--dbopts"):
+            options['dbopts'] = a
+        if o in ("-e", "--email"):
+            options['email'] = a
+        if o in ("-h", "--help"):
+            options['help'] = 1
+        if o in ("-i", "--idl"):
+            options['idl'] = a
+        if o in ("-n", "--name"):
+            options['name'] = a
+        if o in ("-p", "--preserve"):
+            options['preserve'] = 1
+        if o in ("-v", "--version"):
+            options['version'] = 1
+    if options['help']:
+        usage(argv[0])
+        sys.exit(0)
+    if options['version']:
+        print scriptinfo
+        sys.exit(0)
+    if not options['idl']:
+        print "mandatory IDL file parameter missing"
+        sys.exit(1)
+    if not os.access(options['idl'], os.R_OK):
+        print "IDL file not accessible"
+        sys.exit(1)
+
+def usage(name):
+    """Print usage help."""
+    print "Usage: " + name + " <parameters>\n" + \
+          "Parameters are\n" + \
+          "  --dbopts   -d opts,    options for dpkg-buildpackage\n" + \
+          "  --email    -e address, use e-mail address\n" + \
+          "  --idl      -i idlfile, IDL file to use (mandatory)\n" + \
+          "  --help     -h,         print help and exit\n" + \
+          "  --name     -n name,    use user name\n" + \
+          "  --preserve -p,         do not overwrite files\n" + \
+          "  --version  -v,         print version and exit\n" + \
+          "Example:\n" + \
+          name + " -e me@foo.net -i bar.idl -n \"My Name\" " + \
+          "-d \"-rfakeroot -uc -us\""
+if __name__ == '__main__':
+    main()
--- ethereal-0.10.10.orig/asn2deb
+++ ethereal-0.10.10/asn2deb
@@ -0,0 +1,219 @@
+#!/usr/bin/env python
+
+# asn2deb - quick hack by W. Borgert <debacle@debian.org> to create
+# Debian GNU/Linux packages from ASN.1 files for Ethereal.
+# Copyright 2004, W. Borgert
+
+# ASN.1 module for Ethereal, use of snacc type table:
+# Copyright 2003, Matthijs Melchior <matthijs.melchior@xs4all.nl>
+#
+# Ethereal - Network traffic analyzer
+# By Gerald Combs <gerald@ethereal.com>
+# Copyright 1998 Gerald Combs
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+import getopt, os, string, sys, time
+
+scriptinfo = """asn2deb version 2004-02-17
+Copyright 2004, W. Borgert
+Free software, released under the terms of the GPL."""
+
+options = {'asn':      None,
+           'dbopts':   "",
+           'email':    "invalid@invalid.invalid",
+           'help':     0,
+           'name':     "No Name",
+           'preserve': 0,
+           'version':  0}
+
+def bootstrap():
+    """Generate Makefile.in and configure script."""
+    os.system("aclocal-1.7")
+    os.system("autoconf")
+    os.system("automake-1.7 --add-missing --copy --foreign")
+
+def create_file(filename, content, mode = None):
+    """Create a file with given content."""
+    global options
+    if options['preserve'] and os.path.isfile(filename):
+        return
+    f = open(filename, 'w')
+    f.write(content)
+    f.close()
+    if mode:
+        os.chmod(filename, mode)
+
+def create_files(version, deb, email, asn, name, iso, rfc):
+    """Create all files for the .deb build process."""
+    base = asn.lower()[:-5]
+    create_file("Makefile.am", """#
+
+BUILT_SOURCES = %s.tt
+asn1ttdir = $(datadir)/ethereal/asn1
+asn1tt_DATA = %s.tt
+
+%s.tt: """  % ((base,) * 3) + asn + """
+	snacc -u /usr/include/snacc/asn1/asn-useful.asn1 -T $@ $<
+""")
+
+    create_file("configure.ac", """AC_INIT(%s, 1.0)
+AM_INIT_AUTOMAKE
+AM_MAINTAINER_MODE
+AC_PROG_INSTALL
+SNACC=\"`type -p snacc`\"
+AC_SUBST(SNACC)
+dnl ETHEREAL_VERSION=\"%s\"
+dnl plugindir=\"$prefix/share/ethereal/asn.1\"
+dnl AC_SUBST(plugindir)
+AC_OUTPUT([Makefile])
+""" % (base, version))
+
+    if not os.path.isdir("debian"):
+        os.mkdir("debian")
+
+    create_file("debian/rules", """#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+
+PREFIX=`pwd`/debian/ethereal-asn1-%s
+
+binary-post-install/ethereal-asn1-%s::
+	rm -f $(PREFIX)/usr/lib/ethereal/plugins/%s/*.a
+""" % (base, base, version), 0755)
+
+    create_file("debian/control", """Source: ethereal-asn1-%s
+Section: net
+Priority: optional
+Maintainer: %s <%s>
+Standards-Version: 3.6.1.0
+Build-Depends: snacc, autotools-dev, debhelper, cdbs
+
+Package: ethereal-asn1-%s
+Architecture: all
+Depends: ethereal (= %s)
+Description: ASN.1/BER dissector for %s
+ This package provides a type table for decoding BER (Basic Encoding
+ Rules) data over TCP or UDP, described by an ASN.1 (Abstract Syntax
+ Notation 1) file '%s.asn1'.
+""" % (base, name, email, base, deb, base, base))
+
+    create_file("debian/changelog",
+            """ethereal-asn1-%s (0.0.1-1) unstable; urgency=low
+
+  * Automatically created package.
+
+ -- %s <%s>  %s
+""" % (base, name, email, rfc + "\n    (" + iso + ")"))
+
+    create_file("debian/copyright",
+            """This package has been created automatically be asn2deb on
+%s for Debian GNU/Linux.
+
+Ethereal: http://www.ethereal.com/
+
+Copyright:
+
+GPL, as evidenced by existence of GPL license file \"COPYING\".
+(the GNU GPL may be viewed on Debian systems in
+/usr/share/common-licenses/GPL)
+""" % (iso))
+
+def get_eth_version():
+    """Detect version of ethereal-dev package."""
+    deb = os.popen(
+        "dpkg-query -W --showformat='${Version}' ethereal-dev").read()
+    debv = string.find(deb, "-")
+    if debv == -1: debv = len(deb)
+    version = deb[string.find(deb, ":")+1:debv]
+    return version, deb
+
+def get_time():
+    """Detect current time and return ISO and RFC time string."""
+    currenttime = time.gmtime()
+    return time.strftime("%Y-%m-%d %H:%M:%S +0000", currenttime), \
+           time.strftime("%a, %d %b %Y %H:%M:%S +0000", currenttime)
+
+def main():
+    global options
+    process_opts(sys.argv)
+    iso, rfc = get_time()
+    version, deb = get_eth_version()
+    create_files(version, deb,
+                 options['email'], options['asn'], options['name'],
+                 iso, rfc)
+    bootstrap()
+    os.system("dpkg-buildpackage " + options['dbopts'])
+
+def process_opts(argv):
+    """Process command line options."""
+    global options
+    try:
+        opts, args = getopt.getopt(argv[1:], "a:d:e:hn:pv",
+                                   ["asn=",
+                                    "dbopts=",
+                                    "email=",
+                                    "help",
+                                    "name=",
+                                    "preserve",
+                                    "version"])
+    except getopt.GetoptError:
+        usage(argv[0])
+        sys.exit(1)
+    for o, a in opts:
+        if o in ("-a", "--asn"):
+            options['asn'] = a
+        if o in ("-d", "--dbopts"):
+            options['dbopts'] = a
+        if o in ("-e", "--email"):
+            options['email'] = a
+        if o in ("-h", "--help"):
+            options['help'] = 1
+        if o in ("-n", "--name"):
+            options['name'] = a
+        if o in ("-p", "--preserve"):
+            options['preserve'] = 1
+        if o in ("-v", "--version"):
+            options['version'] = 1
+    if options['help']:
+        usage(argv[0])
+        sys.exit(0)
+    if options['version']:
+        print scriptinfo
+        sys.exit(0)
+    if not options['asn']:
+        print "mandatory ASN.1 file parameter missing"
+        sys.exit(1)
+    if not os.access(options['asn'], os.R_OK):
+        print "ASN.1 file not accessible"
+        sys.exit(1)
+
+def usage(name):
+    """Print usage help."""
+    print "Usage: " + name + " <parameters>\n" + \
+          "Parameters are\n" + \
+          "  --asn      -a asn1file, ASN.1 file to use (mandatory)\n" + \
+          "  --dbopts   -d opts,     options for dpkg-buildpackage\n" + \
+          "  --email    -e address,  use e-mail address\n" + \
+          "  --help     -h,          print help and exit\n" + \
+          "  --name     -n name,     use user name\n" + \
+          "  --preserve -p,          do not overwrite files\n" + \
+          "  --version  -v,          print version and exit\n" + \
+          "Example:\n" + \
+          name + " -e me@foo.net -a bar.asn1 -n \"My Name\" " + \
+          "-d \"-rfakeroot -uc -us\""
+if __name__ == '__main__':
+    main()
