diff -Nru wireshark-1.12.0~201310251247/.bzrignore wireshark-1.12.0~201311020920/.bzrignore --- wireshark-1.12.0~201310251247/.bzrignore 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/.bzrignore 2013-11-02 02:12:36.000000000 +0000 @@ -170,6 +170,7 @@ *~ .DS_Store cscope.* +tags packaging/macosx/COPYING.txt packaging/macosx/Info.plist packaging/macosx/osx-dmg.sh diff -Nru wireshark-1.12.0~201310251247/.gitignore wireshark-1.12.0~201311020920/.gitignore --- wireshark-1.12.0~201310251247/.gitignore 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/.gitignore 2013-11-02 02:12:36.000000000 +0000 @@ -170,6 +170,7 @@ *~ .DS_Store cscope.* +tags packaging/macosx/COPYING.txt packaging/macosx/Info.plist packaging/macosx/osx-dmg.sh diff -Nru wireshark-1.12.0~201310251247/AUTHORS wireshark-1.12.0~201311020920/AUTHORS --- wireshark-1.12.0~201310251247/AUTHORS 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/AUTHORS 2013-11-02 02:12:36.000000000 +0000 @@ -3533,6 +3533,10 @@ Support for MACSEC ethertype/dissector } +Ishraq Ibne Ashraf { + tfp (Tinkerforge) dissector +} + and by: diff -Nru wireshark-1.12.0~201310251247/CMakeLists.txt wireshark-1.12.0~201311020920/CMakeLists.txt --- wireshark-1.12.0~201310251247/CMakeLists.txt 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/CMakeLists.txt 2013-11-02 02:12:36.000000000 +0000 @@ -338,7 +338,7 @@ # - set HAVE_XXX #The minimum package list -set(PACKAGELIST GLIB2 GMODULE2 GTHREAD2 M LEX YACC Perl SH PythonInterp) +set(PACKAGELIST Gettext GLIB2 GMODULE2 GTHREAD2 M LEX YACC Perl SH PythonInterp) set(GLIB2_FIND_REQUIRED) set(GLIB2_MIN_VERSION 2.14.0) set(GTHREAD2_REQUIRED) @@ -641,6 +641,8 @@ include(gmxTestLargeFiles) gmx_test_large_files(GMX_LARGEFILES) +add_definitions( -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\" ) + if(APPLE) # # We assume that APPLE means OS X so that we have the OS X diff -Nru wireshark-1.12.0~201310251247/Makefile.am wireshark-1.12.0~201311020920/Makefile.am --- wireshark-1.12.0~201310251247/Makefile.am 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/Makefile.am 2013-11-02 02:12:36.000000000 +0000 @@ -579,7 +579,7 @@ # Common headers AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap \ $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) $(LIBSMI_CFLAGS) $(PY_CFLAGS) \ - @LUA_INCLUDES@ + @LUA_INCLUDES@ -DTOP_SRCDIR=\"$(abs_top_srcdir)\" # # Build the version string diff -Nru wireshark-1.12.0~201310251247/Makefile.nmake wireshark-1.12.0~201311020920/Makefile.nmake --- wireshark-1.12.0~201310251247/Makefile.nmake 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/Makefile.nmake 2013-11-02 02:12:36.000000000 +0000 @@ -219,15 +219,6 @@ @exit 1 !ENDIF -packaging_u3: all - cd packaging - cd u3 - cd win32 - $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake - cd .. - cd .. - cd .. - packaging_papps: all cd packaging cd portableapps @@ -580,9 +571,7 @@ $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean cd ../packaging/nsis $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean - cd ../u3/win32 - $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean - cd ../../portableapps/win32 + cd ../portableapps/win32 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean cd ../../.. @@ -634,9 +623,7 @@ $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean cd ../packaging/nsis $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean - cd ../u3/win32 - $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean - cd ../../portableapps/win32 + cd ../portableapps/win32 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean cd ../../.. @@ -681,9 +668,7 @@ $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean cd ../packaging/nsis $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean - cd ../u3/win32 - $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean - cd ../../portableapps/win32 + cd ../portableapps/win32 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean cd ../../.. diff -Nru wireshark-1.12.0~201310251247/NEWS wireshark-1.12.0~201311020920/NEWS --- wireshark-1.12.0~201310251247/NEWS 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/NEWS 2013-11-02 02:12:36.000000000 +0000 @@ -1,4 +1,5 @@ - Wireshark 1.9.2 Release Notes + + Wireshark 1.11.1 Release Notes __________________________________________________________________ What is Wireshark? @@ -12,65 +13,49 @@ Bug Fixes The following bugs have been fixed: + * "Follow TCP Stream" shows only the first HTTP req+res. ([1]Bug + 9044) + * Files with pcap-ng Simple Packet Blocks can't be read. ([2]Bug + 9200) New and Updated Features The following features are new (or have been significantly updated) - since version 1.8: - * Wireshark on 32- and 64-bit Windows supports automatic updates. - * The packet bytes view is faster. - * You can now display a list of resolved host names in "hosts" format - within Wireshark. - * The wireless toolbar has been updated. - * Wireshark on Linux does a better job of detecting interface - addition and removal. - * It is now possible to compare two fields in a display filter (for - example: udp.srcport != udp.dstport). The two fields must be of the - same type for this to work. - * The Windows installers ship with WinPcap 4.1.3, which supports - Windows 8. - * USB type and product name support has been improved. - * Wireshark now calculates HTTP response times and presents the - result in a new field in the HTTP response. Links from the - request's frame to the response's frame and vice-versa are also - added. - * The main welcome screen and status bar now display file sizes using - strict SI prefixes instead of old-style binary prefixes. - * Capinfos now prints human-readable statistics with SI suffixes by - default. - * It is now possible to open a referenced packet (such as the matched - request or response packet) in a new window. - * It is now possible for tshark to display only the hex/ascii packet - data without also requiring that the packet summary and/or packet - details are also displayed. If you want the old behavior, use -Px - instead of just -x. - * The Wireshark application icon, capture toolbar icons, and other - icons have been updated. + since version 1.10: + * Wireshark now uses the Qt application framework. The new UI should + provide a significantly better user experience, particularly on Mac + OS X and Windows. + * A more flexible, modular memory manger (wmem) has been added. It + was available experimentally in 1.10 but is now mature and has + mostly replaced the old API. + * Expert info is now filterable and now requires a new API. + * The Windows installer now uninstalls the previous version of + Wireshark silently. You can still run the uninstaller manually + beforehand if you wish to run it interactively. + * The "Number" column shows related packets and protocol conversation + spans (Qt only). + * When manipulating packets with editcap using the -C + and/or -s options, it is now possible to also adjust the + original frame length using the -L option. + * You can now pass the -C option to editcap multiple times, + which allows you to chop bytes from the beginning of a packet as + well as at the end of a packet in a single step. + * You can now specify an optional offset to the -C option for + editcap, which allows you to start chopping from that offset + instead of from the absolute packet beginning or end. + * "malformed" display filter has been renamed to "_ws.malformed". A + handful of other filters have been given the "_ws." prefix to note + they are Wireshark application specific filters and not dissector + filters. New Protocol Support - Amateur Radio AX.25, Amateur Radio BPQ, Amateur Radio NET/ROM, America - Online (AOL), AR Drone, Automatic Position Reporting System (APRS), - AX.25 KISS, AX.25 no Layer 3, Bitcoin Protocol, Bluetooth Attribute - Protocol, Bluetooth AVCTP Protocol, Bluetooth AVDTP Protocol, Bluetooth - AVRCP Profile, Bluetooth BNEP Protocol, Bluetooth HCI USB Transport, - Bluetooth HCRP Profile, Bluetooth HID Profile, Bluetooth MCAP Protocol, - Bluetooth SAP Profile, Bluetooth SBC Codec, Bluetooth Security Manager - Protocol, Cisco GED-125 Protocol, Clique Reliable Multicast Protocol - (CliqueRM), D-Bus, Digital Transmission Content Protection over IP, - DVB-S2 Baseband, FlexNet, Forwarding and Control Element Separation - Protocol (ForCES), Foundry Discovery Protocol (FDP), Gearman Protocol, - GEO-Mobile Radio (1) RACH, HoneyPot Feeds Protocol (HPFEEDS), LTE - Positioning Protocol Extensions (LLPe), Media Resource Control Protocol - Version 2 (MRCPv2), Media-Independent Handover (MIH), MIDI System - Exclusive (SYSEX), Mojito DHT, MPLS-TP Fault-Management, MPLS-TP - Lock-Instruct, NASDAQ's OUCH 4.x, NASDAQ's SoupBinTCP, OpenVPN - Protocol, Pseudo-Wire OAM, RPKI-Router Protocol, SEL Fast Message, - Simple Packet Relay Transport (SPRT), Skype, Smart Message Language - (SML), SPNEGO Extended Negotiation Security Mechanism (NEGOEX), - UHD/USRP, USB Audio, USB Video, v.150.1 State Signaling Event (SSE), - VITA 49 Radio Transport, VNTAG, WebRTC Datachannel Protocol (RTCDC), - and WiMAX OFDMA PHY SAP + 802.1AE Secure tag, ASTERIX, ATN, BT 3DS, CARP, Cisco MetaData, + EXPORTED PDU, HTTP2, IDRP, ILP, Kafka, MBIM, MiNT, MP4 / ISOBMFF file + format, NXP PN532 HCI, OpenFlow, Picture Transfer Protocol Over IP, SEL + RTAC (Real Time Automation Controller) EIA-232 Serial-Line Dissection, + Sippy RTPproxy, STANAG 4607, STANAG 5066 SIS, Tinkerforge, UDT, URL + Encoded Form Data, and Wi-Fi Display Updated Protocol Support @@ -78,23 +63,20 @@ New and Updated Capture File Support - AIX iptrace, Catapult DCT2000, Citrix NetScaler, DBS Etherwatch (VMS), - Endace ERF, HP-UX nettl, IBM iSeries, Ixia IxVeriWave, NA Sniffer - (DOS), Netscreen, Network Instruments Observer, pcap, pcap-ng, Symbian - OS btsnoop, TamoSoft CommView, and Tektronix K12xx + Netscaler 2.6, and STANAG 4607 __________________________________________________________________ Getting Wireshark Wireshark source code and installation packages are available from - [1]http://www.wireshark.org/download.html. + [3]http://www.wireshark.org/download.html. Vendor-supplied Packages Most Linux and Unix vendors supply their own Wireshark packages. You can usually install or upgrade Wireshark using the package management system specific to that platform. A list of third-party packages can be - found on the [2]download page on the Wireshark web site. + found on the [4]download page on the Wireshark web site. __________________________________________________________________ File Locations @@ -107,62 +89,73 @@ Known Problems - Dumpcap might not quit if Wireshark or TShark crashes. ([3]Bug 1419) + Dumpcap might not quit if Wireshark or TShark crashes. ([5]Bug 1419) - The BER dissector might infinitely loop. ([4]Bug 1516) + The BER dissector might infinitely loop. ([6]Bug 1516) Capture filters aren't applied when capturing from named pipes. (ws-buglink:1814) - Filtering tshark captures with display filters (-R) no longer works. - ([5]Bug 2234) + Filtering tshark captures with read filters (-R) no longer works. + ([7]Bug 2234) The 64-bit Windows installer does not support Kerberos decryption. - ([6]Win64 development page) + ([8]Win64 development page) + + Resolving ([9]Bug 9044) reopens ([10]Bug 3528) so that Wireshark no + longer automatically decodes gzip data when following a TCP stream. - Application crash when changing real-time option. ([7]Bug 4035) + Application crash when changing real-time option. ([11]Bug 4035) - Hex pane display issue after startup. ([8]Bug 4056) + Hex pane display issue after startup. ([12]Bug 4056) - Packet list rows are oversized. ([9]Bug 4357) + Packet list rows are oversized. ([13]Bug 4357) - Summary pane selected frame highlighting not maintained. ([10]Bug 4445) + Summary pane selected frame highlighting not maintained. ([14]Bug 4445) Wireshark and TShark will display incorrect delta times in some cases. - ([11]Bug 4985) + ([15]Bug 4985) + + The 64-bit Mac OS X installer doesn't support Mac OS X 10.9 ([16]Bug + 9242) __________________________________________________________________ Getting Help - Community support is available on [12]Wireshark's Q&A site and on the + Community support is available on [17]Wireshark's Q&A site and on the wireshark-users mailing list. Subscription information and archives for - all of Wireshark's mailing lists can be found on [13]the web site. + all of Wireshark's mailing lists can be found on [18]the web site. Official Wireshark training and certification are available from - [14]Wireshark University. + [19]Wireshark University. __________________________________________________________________ Frequently Asked Questions - A complete FAQ is available on the [15]Wireshark web site. + A complete FAQ is available on the [20]Wireshark web site. __________________________________________________________________ - Last updated 2013-03-27 11:36:52 PDT + Last updated 2013-10-28 22:19:21 CET References - 1. http://www.wireshark.org/download.html - 2. http://www.wireshark.org/download.html#thirdparty - 3. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1419 - 4. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1516 - 5. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2234 - 6. https://wiki.wireshark.org/Development/Win64 - 7. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4035 - 8. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4056 - 9. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4357 - 10. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4445 - 11. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4985 - 12. http://ask.wireshark.org/ - 13. http://www.wireshark.org/lists/ - 14. http://www.wiresharktraining.com/ - 15. http://www.wireshark.org/faq.html + 1. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9044 + 2. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9200 + 3. http://www.wireshark.org/download.html + 4. http://www.wireshark.org/download.html#thirdparty + 5. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1419 + 6. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1516 + 7. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2234 + 8. https://wiki.wireshark.org/Development/Win64 + 9. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9044 + 10. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3528 + 11. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4035 + 12. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4056 + 13. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4357 + 14. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4445 + 15. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4985 + 16. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9242 + 17. http://ask.wireshark.org/ + 18. http://www.wireshark.org/lists/ + 19. http://www.wiresharktraining.com/ + 20. http://www.wireshark.org/faq.html diff -Nru wireshark-1.12.0~201310251247/README.cmake wireshark-1.12.0~201311020920/README.cmake --- wireshark-1.12.0~201310251247/README.cmake 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/README.cmake 2013-11-02 02:12:36.000000000 +0000 @@ -111,7 +111,6 @@ - Add back platform specific objects. - Fix places in the cmake files marked as todo. - Guides are not installed. -- Release notes are not built. - Build source package (using CPack). This is obsolete if we decide to release VCS snapshots instead - Build rpm package (using CPack). @@ -121,7 +120,12 @@ - Add back checkAPI target. - Test and add support for other platforms (BSDs, OSX, Solaris, Win32, Win64, ...) -- Add support for cmake configurations +- Add support for cmake configurations. +- Get plugins loading when running *shark from the build directory. +- Automatically figure out if *shark is running from the build directory + (making WIRESHARK_RUN_FROM_BUILD_DIRECTORY unnecessary like it is with + autofoo). +- Get cross-compilation working (or ensure it does). It works with autofoo. ... Links regarding cmake diff -Nru wireshark-1.12.0~201310251247/aclocal-fallback/glib-2.0.m4 wireshark-1.12.0~201311020920/aclocal-fallback/glib-2.0.m4 --- wireshark-1.12.0~201310251247/aclocal-fallback/glib-2.0.m4 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/aclocal-fallback/glib-2.0.m4 2013-11-02 02:12:36.000000000 +0000 @@ -1,5 +1,6 @@ # Configure paths for GLIB # Owen Taylor 1997-2001 +# $Id$ 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 diff -Nru wireshark-1.12.0~201310251247/aclocal-fallback/libgcrypt.m4 wireshark-1.12.0~201311020920/aclocal-fallback/libgcrypt.m4 --- wireshark-1.12.0~201310251247/aclocal-fallback/libgcrypt.m4 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/aclocal-fallback/libgcrypt.m4 2013-11-02 02:12:36.000000000 +0000 @@ -1,5 +1,6 @@ dnl Autoconf macros for libgcrypt dnl Copyright (C) 2002, 2004 Free Software Foundation, Inc. +dnl $Id$ dnl dnl This file is free software; as a special exception the author gives dnl unlimited permission to copy and/or distribute it, with or without diff -Nru wireshark-1.12.0~201310251247/aclocal-fallback/libsmi.m4 wireshark-1.12.0~201311020920/aclocal-fallback/libsmi.m4 --- wireshark-1.12.0~201310251247/aclocal-fallback/libsmi.m4 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/aclocal-fallback/libsmi.m4 2013-11-02 02:12:36.000000000 +0000 @@ -1,5 +1,6 @@ # Configure paths for libsmi # Shamelessly stolen from http://autoconf-archive.cryp.to/ax_lib_sqlite3.html +# $Id$ # Synopsis: AX_LIBSMI([minimum library version]) # The default minimum library version is 2 diff -Nru wireshark-1.12.0~201310251247/asn1/acse/acse.cnf wireshark-1.12.0~201311020920/asn1/acse/acse.cnf --- wireshark-1.12.0~201310251247/asn1/acse/acse.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/acse/acse.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -46,7 +46,7 @@ FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY Authentication-value-other/other-mechanism-value - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree, NULL); #.FN_BODY PDV-list/presentation-data-values/simple-ASN1-type /*XXX not implemented yet */ @@ -85,23 +85,23 @@ FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY EXTERNALt/_untag/encoding/single-ASN1-type - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree ? top_tree : tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree ? top_tree : tree, NULL); #.FN_BODY EXTERNALt/_untag/encoding/octet-aligned - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree ? top_tree : tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree ? top_tree : tree, NULL); #.FN_BODY AARQ-apdu - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "A-Associate-Request"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "A-Associate-Request"); %(DEFAULT_BODY)s #.FN_BODY AARE-apdu - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "A-Associate-Response"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "A-Associate-Response"); %(DEFAULT_BODY)s #.FN_BODY RLRQ-apdu - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Release-Request"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Release-Request"); %(DEFAULT_BODY)s @@ -117,7 +117,7 @@ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s)", val_to_str(reason, acse_Release_request_reason_vals, "reason(%%d)")); #.FN_BODY RLRE-apdu - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Release-Response"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Release-Response"); %(DEFAULT_BODY)s @@ -133,7 +133,7 @@ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s)", val_to_str(reason, acse_Release_response_reason_vals, "reason(%%d)")); #.FN_BODY ABRT-apdu - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Abort"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Abort"); %(DEFAULT_BODY)s diff -Nru wireshark-1.12.0~201310251247/asn1/acse/packet-acse-template.c wireshark-1.12.0~201311020920/asn1/acse/packet-acse-template.c --- wireshark-1.12.0~201310251247/asn1/acse/packet-acse-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/acse/packet-acse-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -214,7 +214,7 @@ "Invalid OID: %s", ACSE_APDU_OID); THROW(ReportedBoundsError); } - call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree); + call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree, NULL); } else { proto_tree_add_expert(parent_tree, pinfo, &ei_acse_dissector_not_available, tvb, offset, -1); diff -Nru wireshark-1.12.0~201310251247/asn1/ansi_map/packet-ansi_map-template.c wireshark-1.12.0~201311020920/asn1/ansi_map/packet-ansi_map-template.c --- wireshark-1.12.0~201310251247/asn1/ansi_map/packet-ansi_map-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/ansi_map/packet-ansi_map-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -401,9 +401,8 @@ /* Store Invoke information needed for the corresponding reply */ static void -update_saved_invokedata(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){ +update_saved_invokedata(packet_info *pinfo, struct ansi_tcap_private_t *p_private_tcap){ struct ansi_map_invokedata_t *ansi_map_saved_invokedata; - struct ansi_tcap_private_t *p_private_tcap; address* src = &(pinfo->src); address* dst = &(pinfo->dst); guint8 *src_str; @@ -414,39 +413,35 @@ dst_str = ep_address_to_str(dst); /* Data from the TCAP dissector */ - if (pinfo->private_data != NULL){ - p_private_tcap=(struct ansi_tcap_private_t *)pinfo->private_data; - if ((!pinfo->fd->flags.visited)&&(p_private_tcap->TransactionID_str)){ - /* Only do this once XXX I hope it's the right thing to do */ - /* The hash string needs to contain src and dest to distiguish differnt flows */ - switch(ansi_map_response_matching_type){ - case ANSI_MAP_TID_ONLY: - buf = wmem_strdup(wmem_packet_scope(), p_private_tcap->TransactionID_str); - break; - case 1: - buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s",p_private_tcap->TransactionID_str,src_str); - break; - default: - buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s%s",p_private_tcap->TransactionID_str,src_str,dst_str); - break; - } - /* If the entry allready exists don't owervrite it */ - ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)g_hash_table_lookup(TransactionId_table,buf); - if(ansi_map_saved_invokedata) - return; + if ((!pinfo->fd->flags.visited)&&(p_private_tcap->TransactionID_str)){ + /* Only do this once XXX I hope it's the right thing to do */ + /* The hash string needs to contain src and dest to distiguish differnt flows */ + switch(ansi_map_response_matching_type){ + case ANSI_MAP_TID_ONLY: + buf = wmem_strdup(wmem_packet_scope(), p_private_tcap->TransactionID_str); + break; + case 1: + buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s",p_private_tcap->TransactionID_str,src_str); + break; + default: + buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s%s",p_private_tcap->TransactionID_str,src_str,dst_str); + break; + } + /* If the entry allready exists don't owervrite it */ + ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)g_hash_table_lookup(TransactionId_table,buf); + if(ansi_map_saved_invokedata) + return; - ansi_map_saved_invokedata = wmem_new(wmem_file_scope(), struct ansi_map_invokedata_t); - ansi_map_saved_invokedata->opcode = p_private_tcap->d.OperationCode_private; - ansi_map_saved_invokedata->ServiceIndicator = ServiceIndicator; - - g_hash_table_insert(TransactionId_table, - wmem_strdup(wmem_file_scope(), buf), - ansi_map_saved_invokedata); + ansi_map_saved_invokedata = wmem_new(wmem_file_scope(), struct ansi_map_invokedata_t); + ansi_map_saved_invokedata->opcode = p_private_tcap->d.OperationCode_private; + ansi_map_saved_invokedata->ServiceIndicator = ServiceIndicator; + + g_hash_table_insert(TransactionId_table, + wmem_strdup(wmem_file_scope(), buf), + ansi_map_saved_invokedata); - /*g_warning("Invoke Hash string %s pkt: %u",buf,pinfo->fd->num);*/ - } + /*g_warning("Invoke Hash string %s pkt: %u",buf,pinfo->fd->num);*/ } - } /* value strings */ const value_string ansi_map_opr_code_strings[] = { @@ -603,10 +598,12 @@ "Number is not available", "Number is available" }; +#if 0 static const true_false_string ansi_map_si_bool_val = { "User provided, screening passed", "User provided, not screened" }; +#endif static const value_string ansi_map_si_vals[] = { { 0, "User provided, not screened"}, { 1, "User provided, screening passed"}, @@ -780,10 +777,12 @@ } /* 6.5.3.13. Subaddress */ +#if 0 static const true_false_string ansi_map_Odd_Even_Ind_bool_val = { "Odd", "Even" }; +#endif /* Type of Subaddress (octet 1, bits E-G) */ static const value_string ansi_map_sub_addr_type_vals[] = { { 0, "NSAP (CCITT Rec. X.213 or ISO 8348 AD2)"}, @@ -1739,17 +1738,21 @@ } +#if 0 /* 6.5.2.79 MessageWaitingNotificationType */ /* Pip Tone (PT) (octet 1, bit A) */ static const true_false_string ansi_map_MessageWaitingNotificationType_pt_bool_val = { "Pip Tone (PT) notification is required", "Pip Tone (PT) notification is not authorized or no notification is required" }; +#endif +#if 0 /* Alert Pip Tone (APT) (octet 1, bit B) */ static const true_false_string ansi_map_MessageWaitingNotificationType_apt_bool_val = { "Alert Pip Tone (APT) notification is required", "Alert Pip Tone (APT) notification is not authorized or notification is not required" }; +#endif /* Message Waiting Indication (MWI) (octet 1, bits C and D) */ static const value_string ansi_map_MessageWaitingNotificationType_mwi_vals[] = { { 0, "No MWI. Message Waiting Indication (MWI) notification is not authorized or notification is not required"}, @@ -1869,6 +1872,7 @@ } +#if 0 /* 6.5.2.88 OneTimeFeatureIndicator */ /* updated with N.S0012 */ /* Call Waiting for Future Incoming Call (CWFI) (octet 1, bits A and B) */ @@ -1881,6 +1885,8 @@ { 3, "Priority CW"}, { 0, NULL } }; +#endif +#if 0 /* MessageWaitingNotification (MWN) (octet 1, bits E and F) */ static const value_string ansi_map_onetimefeatureindicator_mwn_vals[] = { { 0, "Ignore"}, @@ -1889,6 +1895,8 @@ { 3, "Reserved"}, { 0, NULL } }; +#endif +#if 0 /* Calling Number Identification Restriction (CNIR) (octet 1, bits G and H)*/ static const value_string ansi_map_onetimefeatureindicator_cnir_vals[] = { { 0, "Ignore"}, @@ -1897,7 +1905,9 @@ { 3, "Reserved"}, { 0, NULL } }; +#endif +#if 0 /* Priority Access and Channel Assignment (PACA) (octet 2, bits A and B)*/ static const value_string ansi_map_onetimefeatureindicator_paca_vals[] = { { 0, "Ignore"}, @@ -1906,7 +1916,9 @@ { 3, "Reserved"}, { 0, NULL } }; +#endif +#if 0 /* Flash Privileges (Flash) (octet 2, bits C and D) */ static const value_string ansi_map_onetimefeatureindicator_flash_vals[] = { { 0, "Ignore"}, @@ -1915,6 +1927,8 @@ { 3, "Reserved"}, { 0, NULL } }; +#endif +#if 0 /* Calling Name Restriction (CNAR) (octet 2, bits E and F) */ static const value_string ansi_map_onetimefeatureindicator_cnar_vals[] = { { 0, "Ignore"}, @@ -1923,6 +1937,7 @@ { 3, "Blocking Toggle"}, { 0, NULL } }; +#endif static void dissect_ansi_map_onetimefeatureindicator(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, asn1_ctx_t *actx _U_){ /* @@ -2424,6 +2439,7 @@ /* 6.5.2.137 SMS_TeleserviceIdentifier */ /* Updated with N.S0011-0 v 1.0 */ +#if 0 /* SMS Teleservice Identifier (octets 1 and 2) */ static const value_string ansi_map_SMS_TeleserviceIdentifier_vals[] = { { 0, "Not used"}, @@ -2440,6 +2456,7 @@ { 32584, "TDMA Segmented System Assisted Mobile Positioning Service" }, { 0, NULL } }; +#endif /* 6.5.2.140 SPINITriggers */ /* All Origination (All) (octet 1, bit A) */ @@ -2866,6 +2883,7 @@ { 7, "STU-III"}, { 0, NULL } }; +#if 0 /* 6.5.2.j (IS-730) TDMATerminalCapability N.S0008-0 v 1.0 Updted with N.S0015-0 */ /* Supported Frequency Band (octet 1) */ /* Voice Coder (octet 2) */ @@ -2881,6 +2899,7 @@ { 7, "PV 3 as published in TIA/EIA-136-A."}, { 0, NULL } }; +#endif /* Asynchronous Data (ADS) (octet 4, bit A) N.S0007-0*/ /* Group 3 Fax (G3FAX) (octet 4, bit B) */ /* Secure Telephone Unit III (STU3) (octet 4, bit C) */ @@ -3054,6 +3073,7 @@ proto_tree_add_item(subtree, hf_ansi_map_tmn, tvb, offset, 1, ENC_BIG_ENDIAN); } */ +#if 0 /* 6.5.2.as ChangeServiceAttributes N.S0008-0 v 1.0 */ /* Change Facilities Flag (CHGFAC)(octet 1, bits A - B) */ static const value_string ansi_map_ChangeServiceAttributes_chgfac_vals[] = { @@ -3063,6 +3083,8 @@ { 3, "Change Facilities Operation Not Used"}, { 0, NULL } }; +#endif +#if 0 /* Service Negotiate Flag (SRVNEG)(octet 1, bits C - D) */ static const value_string ansi_map_ChangeServiceAttributes_srvneg_vals[] = { { 0, "Service Negotiation Used"}, @@ -3071,6 +3093,8 @@ { 3, "Service Negotiation Not Required"}, { 0, NULL } }; +#endif +#if 0 /* 6.5.2.au DataPrivacyParameters N.S0008-0 v 1.0*/ /* Privacy Mode (PM) (octet 1, Bits A and B) */ static const value_string ansi_map_DataPrivacyParameters_pm_vals[] = { @@ -3080,12 +3104,15 @@ { 3, "Reserved. Treat reserved values the same as value 0, Privacy inactive or not supported."}, { 0, NULL } }; +#endif +#if 0 /* Data Privacy Version (PM) (octet 2) */ static const value_string ansi_map_DataPrivacyParameters_data_priv_ver_vals[] = { { 0, "Not used"}, { 1, "Data Privacy Version 1"}, { 0, NULL } }; +#endif /* 6.5.2.av ISLPInformation N.S0008-0 v 1.0*/ /* ISLP Type (octet 1) */ @@ -3128,6 +3155,7 @@ /* 6.5.2.bw CallingPartyName N.S0012-0 v 1.0*/ +#if 0 /* Presentation Status (octet 1, bits A and B) */ static const value_string ansi_map_Presentation_Status_vals[] = { { 0, "Presentation allowed"}, @@ -3136,11 +3164,14 @@ { 3, "No indication"}, { 0, NULL } }; +#endif +#if 0 /* Availability (octet 1, bit E) N.S0012-0 v 1.0*/ static const true_false_string ansi_map_Availability_bool_val = { "Name not available", "Name available/unknown" }; +#endif static void dissect_ansi_map_callingpartyname(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, asn1_ctx_t *actx _U_){ @@ -3170,6 +3201,7 @@ /* Global Title Octet 2 - n */ +#if 0 /* 6.5.2.dc SpecializedResource N.S0013-0 v 1.0*/ /* Resource Type (octet 1) */ static const value_string ansi_map_resource_type_vals[] = { @@ -3179,6 +3211,7 @@ { 3, "Automatic Speech Recognition - Speaker Independent - Speech User Interface Version 1"}, { 0, NULL } }; +#endif /* 6.5.2.df TriggerCapability */ /* Updated with N.S0004 N.S0013-0 v 1.0*/ @@ -3336,6 +3369,7 @@ /* 6.5.2.ff NewMINExtension N.S0015-0 */ +#if 0 /* 6.5.2.fv ACGEncountered N.S0023-0 v 1.0 */ /* ACG Encountered (octet 1, bits A-F) */ static const value_string ansi_ACGEncountered_vals[] = { @@ -3357,6 +3391,8 @@ { 15, "15-digit control"}, { 0, NULL } }; +#endif +#if 0 /* Control Type (octet 1, bits G-H) */ static const value_string ansi_ACGEncountered_cntrl_type_vals[] = { { 0, "Not used."}, @@ -3365,11 +3401,13 @@ { 3, "Reserved. Treat the same as value 0, Not used."}, { 0, NULL } }; +#endif /* 6.5.2.fw ControlType N.S0023-0 v 1.0 */ +#if 0 /* 6.5.2.ge QoSPriority N.S0029-0 v1.0*/ /* 6.5.2.xx QOSPriority */ /* Non-Assured Priority (octet 1, bits A-D) */ @@ -3392,6 +3430,7 @@ { 15, "Reserved"}, { 0, NULL } }; +#endif /* Assured Priority (octet 1, bits E-H)*/ @@ -3496,6 +3535,7 @@ { 0, NULL } }; */ +#if 0 /* 6.5.2.bp-1 ServiceRedirectionCause value */ static const value_string ansi_map_ServiceRedirectionCause_vals[] = { { 0, "Not used"}, @@ -3507,6 +3547,7 @@ { 6, "WrongNID"}, { 0, NULL } }; +#endif /* 6.5.2.mT AuthenticationResponseReauthentication N.S0011-0 v 1.0*/ /* 6.5.2.vT ReauthenticationReport N.S0011-0 v 1.0*/ @@ -3521,6 +3562,7 @@ +#if 0 /* 6.5.2.lB AKeyProtocolVersion N.S0011-0 v 1.0 */ @@ -3532,6 +3574,7 @@ { 4, "Diffie Hellman with 768-bit modulus, 32-bit primitive, and 160-bit exponents"}, { 0, NULL } }; +#endif /* 6.5.2.sB OTASP_ResultCode N.S0011-0 v 1.0 */ @@ -4282,9 +4325,8 @@ } static int -find_saved_invokedata(asn1_ctx_t *actx){ +find_saved_invokedata(asn1_ctx_t *actx, struct ansi_tcap_private_t *p_private_tcap){ struct ansi_map_invokedata_t *ansi_map_saved_invokedata; - struct ansi_tcap_private_t *p_private_tcap; address* src = &(actx->pinfo->src); address* dst = &(actx->pinfo->dst); guint8 *src_str; @@ -4294,45 +4336,40 @@ buf=(char *)wmem_alloc(wmem_packet_scope(), 1024); /* Data from the TCAP dissector */ - if (actx->pinfo->private_data != NULL){ - p_private_tcap=(struct ansi_tcap_private_t *)actx->pinfo->private_data; - /* The hash string needs to contain src and dest to distiguish differnt flows */ - src_str = ep_address_to_str(src); - dst_str = ep_address_to_str(dst); - /* Reverse order to invoke */ - switch(ansi_map_response_matching_type){ - case ANSI_MAP_TID_ONLY: - g_snprintf(buf,1024,"%s",p_private_tcap->TransactionID_str); - break; - case 1: - g_snprintf(buf,1024,"%s%s",p_private_tcap->TransactionID_str,dst_str); - break; - default: - g_snprintf(buf,1024,"%s%s%s",p_private_tcap->TransactionID_str,dst_str,src_str); - break; - } + /* The hash string needs to contain src and dest to distiguish differnt flows */ + src_str = ep_address_to_str(src); + dst_str = ep_address_to_str(dst); + /* Reverse order to invoke */ + switch(ansi_map_response_matching_type){ + case ANSI_MAP_TID_ONLY: + g_snprintf(buf,1024,"%s",p_private_tcap->TransactionID_str); + break; + case 1: + g_snprintf(buf,1024,"%s%s",p_private_tcap->TransactionID_str,dst_str); + break; + default: + g_snprintf(buf,1024,"%s%s%s",p_private_tcap->TransactionID_str,dst_str,src_str); + break; + } - /*g_warning("Find Hash string %s pkt: %u",buf,actx->pinfo->fd->num);*/ - ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)g_hash_table_lookup(TransactionId_table, buf); - if(ansi_map_saved_invokedata){ - OperationCode = ansi_map_saved_invokedata->opcode & 0xff; - ServiceIndicator = ansi_map_saved_invokedata->ServiceIndicator; - }else{ - OperationCode = OperationCode & 0x00ff; - } + /*g_warning("Find Hash string %s pkt: %u",buf,actx->pinfo->fd->num);*/ + ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)g_hash_table_lookup(TransactionId_table, buf); + if(ansi_map_saved_invokedata){ + OperationCode = ansi_map_saved_invokedata->opcode & 0xff; + ServiceIndicator = ansi_map_saved_invokedata->ServiceIndicator; }else{ - /*g_warning("No private data pkt: %u",actx->pinfo->fd->num);*/ OperationCode = OperationCode & 0x00ff; } + return OperationCode; } -static void -dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { proto_item *ansi_map_item; proto_tree *ansi_map_tree = NULL; - struct ansi_tcap_private_t *p_private_tcap; + struct ansi_tcap_private_t *p_private_tcap = (struct ansi_tcap_private_t *)data; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -4346,9 +4383,9 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI MAP"); /* Data from the TCAP dissector */ - if (pinfo->private_data == NULL){ - proto_tree_add_text(tree, tvb, 0, -1, "Dissector ERROR this dissector relays on private data"); - return; + if (data == NULL){ + proto_tree_add_text(tree, tvb, 0, -1, "Dissector ERROR this dissector relies on dissector data"); + return 0; } /* @@ -4361,8 +4398,6 @@ is801_pld = FALSE; ServiceIndicator = 0; - p_private_tcap=(struct ansi_tcap_private_t *)pinfo->private_data; - switch(p_private_tcap->d.pdu){ /* 1 : invoke, @@ -4376,10 +4411,10 @@ col_add_fstr(pinfo->cinfo, COL_INFO,"%s Invoke ", val_to_str_ext(OperationCode, &ansi_map_opr_code_strings_ext, "Unknown ANSI-MAP PDU (%u)")); proto_item_append_text(p_private_tcap->d.OperationCode_item," %s",val_to_str_ext(OperationCode, &ansi_map_opr_code_strings_ext, "Unknown ANSI-MAP PDU (%u)")); dissect_invokeData(ansi_map_tree, tvb, 0, &asn1_ctx); - update_saved_invokedata(pinfo, ansi_map_tree, tvb); + update_saved_invokedata(pinfo, p_private_tcap); break; case 2: - OperationCode = find_saved_invokedata(&asn1_ctx); + OperationCode = find_saved_invokedata(&asn1_ctx, p_private_tcap); col_add_fstr(pinfo->cinfo, COL_INFO,"%s ReturnResult ", val_to_str_ext(OperationCode, &ansi_map_opr_code_strings_ext, "Unknown ANSI-MAP PDU (%u)")); proto_item_append_text(p_private_tcap->d.OperationCode_item," %s",val_to_str_ext(OperationCode, &ansi_map_opr_code_strings_ext, "Unknown ANSI-MAP PDU (%u)")); dissect_returnData(ansi_map_tree, tvb, 0, &asn1_ctx); @@ -4395,6 +4430,8 @@ DISSECTOR_ASSERT_NOT_REACHED(); break; } + + return tvb_length(tvb); } static void range_delete_callback(guint32 ssn) @@ -5287,7 +5324,7 @@ proto_register_field_array(proto_ansi_map, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("ansi_map", dissect_ansi_map, proto_ansi_map); + new_register_dissector("ansi_map", dissect_ansi_map, proto_ansi_map); is637_tele_id_dissector_table = register_dissector_table("ansi_map.tele_id", "IS-637 Teleservice ID", diff -Nru wireshark-1.12.0~201310251247/asn1/ansi_tcap/packet-ansi_tcap-template.c wireshark-1.12.0~201311020920/asn1/ansi_tcap/packet-ansi_tcap-template.c --- wireshark-1.12.0~201310251247/asn1/ansi_tcap/packet-ansi_tcap-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/ansi_tcap/packet-ansi_tcap-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -290,7 +290,7 @@ * points to the subdissector this code can be used. * if(ansi_tcap_private.d.oid_is_present){ - call_ber_oid_callback(ansi_tcap_private.objectApplicationId_oid, tvb, 0, actx-pinfo, tree); + call_ber_oid_callback(ansi_tcap_private.objectApplicationId_oid, tvb, 0, actx-pinfo, tree, NULL); return TRUE; } */ @@ -343,7 +343,7 @@ * Operation Family is coded as decimal 9. Bit H of the Operation Family is always * coded as 0. */ - call_dissector(ansi_map_handle, tvb, actx->pinfo, tcap_top_tree); + call_dissector_with_data(ansi_map_handle, tvb, actx->pinfo, tcap_top_tree, &ansi_tcap_private); return TRUE; } @@ -383,7 +383,6 @@ cur_oid = NULL; tcapext_oid = NULL; - pinfo->private_data = &ansi_tcap_private; gp_tcapsrt_info=tcapsrt_razinfo(); tcap_subdissector_used=FALSE; gp_tcap_context=NULL; diff -Nru wireshark-1.12.0~201310251247/asn1/atn-cpdlc/atn-cpdlc.cnf wireshark-1.12.0~201311020920/asn1/atn-cpdlc/atn-cpdlc.cnf --- wireshark-1.12.0~201310251247/asn1/atn-cpdlc/atn-cpdlc.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/atn-cpdlc/atn-cpdlc.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -78,7 +78,7 @@ #.FN_BODY AlgorithmIdentifier proto_tree *top_tree=NULL; - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree, NULL); #.END diff -Nru wireshark-1.12.0~201310251247/asn1/atn-ulcs/atn-ulcs.cnf wireshark-1.12.0~201311020920/asn1/atn-ulcs/atn-ulcs.cnf --- wireshark-1.12.0~201310251247/asn1/atn-ulcs/atn-ulcs.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/atn-ulcs/atn-ulcs.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -141,7 +141,7 @@ tvb, offset, actx->pinfo, - tree); + tree, NULL); #.END @@ -165,7 +165,7 @@ tvb, offset, actx->pinfo, - tree); + tree, NULL); #.END diff -Nru wireshark-1.12.0~201310251247/asn1/c1222/packet-c1222-template.c wireshark-1.12.0~201311020920/asn1/c1222/packet-c1222-template.c --- wireshark-1.12.0~201310251247/asn1/c1222/packet-c1222-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/c1222/packet-c1222-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -673,7 +673,7 @@ { FALSE, FALSE, 0x0, TRUE, NULL, NULL } }; -static void +static void clear_canon(void) { const TOP_ELEMENT_CONTROL *t = canonifyTable; @@ -736,10 +736,10 @@ c1222_uat_data_t* new_rec = (c1222_uat_data_t *)n; if (new_rec->keynum > 0xff) { - *err = "Invalid key number; must be less than 256"; + *err = g_strdup("Invalid key number; must be less than 256"); } if (new_rec->keylen != EAX_SIZEOF_KEY) { - *err = "Invalid key size; must be 16 bytes"; + *err = g_strdup("Invalid key size; must be 16 bytes"); } } diff -Nru wireshark-1.12.0~201310251247/asn1/camel/camel.cnf wireshark-1.12.0~201311020920/asn1/camel/camel.cnf --- wireshark-1.12.0~201310251247/asn1/camel/camel.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/camel/camel.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -224,7 +224,7 @@ #.FN_BODY ExtensionField/value /*XXX handle local form here */ if(camel_obj_id){ - offset=call_ber_oid_callback(camel_obj_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(camel_obj_id, tvb, offset, actx->pinfo, tree, NULL); } is_ExtensionField = FALSE; diff -Nru wireshark-1.12.0~201310251247/asn1/camel/packet-camel-template.c wireshark-1.12.0~201311020920/asn1/camel/packet-camel-template.c --- wireshark-1.12.0~201310251247/asn1/camel/packet-camel-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/camel/packet-camel-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -331,16 +331,14 @@ static int -dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_,proto_tree *tree, int hf_index) { +dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_,proto_tree *tree, + int hf_index, struct tcap_private_t * p_private_tcap) { char *version_ptr; - struct tcap_private_t * p_private_tcap; opcode = 0; application_context_version = 0; - if (actx->pinfo->private_data != NULL){ - p_private_tcap=(struct tcap_private_t *)actx->pinfo->private_data; - + if (p_private_tcap != NULL){ if (p_private_tcap->acv==TRUE ){ version_ptr = strrchr((char *)p_private_tcap->oid,'.'); if (version_ptr) @@ -365,13 +363,12 @@ return offset; } -static void -dissect_camel_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +static int +dissect_camel_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { - proto_item *item=NULL; - proto_tree *tree=NULL; - proto_item *stat_item=NULL; - proto_tree *stat_tree=NULL; + proto_item *item, *stat_item; + proto_tree *tree = NULL, *stat_tree = NULL; + struct tcap_private_t * p_private_tcap = (struct tcap_private_t*)data; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -388,7 +385,7 @@ to store service response time related data */ gp_camelsrt_info=camelsrt_razinfo(); - dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1); + dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1, p_private_tcap); /* If a Tcap context is associated to this transaction */ if (gcamel_HandleSRT && @@ -401,15 +398,15 @@ tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info); } + return tvb_length(tvb); } -static void -dissect_camel_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +static int +dissect_camel_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { - proto_item *item=NULL; - proto_tree *tree=NULL; - proto_item *stat_item=NULL; - proto_tree *stat_tree=NULL; + proto_item *item, *stat_item; + proto_tree *tree = NULL, *stat_tree = NULL; + struct tcap_private_t * p_private_tcap = (struct tcap_private_t*)data; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -426,7 +423,7 @@ to store service response time related data */ gp_camelsrt_info=camelsrt_razinfo(); - dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1); + dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1, p_private_tcap); /* If a Tcap context is associated to this transaction */ if (gcamel_HandleSRT && @@ -439,15 +436,15 @@ tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info); } + return tvb_length(tvb); } -static void -dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +static int +dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { - proto_item *item=NULL; - proto_tree *tree=NULL; - proto_item *stat_item=NULL; - proto_tree *stat_tree=NULL; + proto_item *item, *stat_item; + proto_tree *tree, *stat_tree = NULL; + struct tcap_private_t * p_private_tcap = (struct tcap_private_t*)data; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -457,14 +454,13 @@ camel_ver = 0; /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_item(parent_tree, proto_camel, tvb, 0, -1, ENC_NA); - tree = proto_item_add_subtree(item, ett_camel); - } + item = proto_tree_add_item(parent_tree, proto_camel, tvb, 0, -1, ENC_NA); + tree = proto_item_add_subtree(item, ett_camel); + /* camelsrt reset counter, and initialise global pointer to store service response time related data */ gp_camelsrt_info=camelsrt_razinfo(); - dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1); + dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1, p_private_tcap); /* If a Tcap context is associated to this transaction */ if (gcamel_HandleSRT && @@ -476,6 +472,8 @@ camelsrt_call_matching(tvb, pinfo, stat_tree, gp_camelsrt_info); tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info); } + + return tvb_length(tvb); } /*--- proto_reg_handoff_camel ---------------------------------------*/ @@ -719,9 +717,9 @@ /* Register protocol */ proto_camel = proto_register_protocol(PNAME, PSNAME, PFNAME); - register_dissector("camel", dissect_camel, proto_camel); - register_dissector("camel-v1", dissect_camel_v1, proto_camel); - register_dissector("camel-v2", dissect_camel_v2, proto_camel); + new_register_dissector("camel", dissect_camel, proto_camel); + new_register_dissector("camel-v1", dissect_camel_v1, proto_camel); + new_register_dissector("camel-v2", dissect_camel_v2, proto_camel); proto_register_field_array(proto_camel, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); diff -Nru wireshark-1.12.0~201310251247/asn1/cmip/CMIP-A-ASSOCIATE-Information.asn wireshark-1.12.0~201311020920/asn1/cmip/CMIP-A-ASSOCIATE-Information.asn --- wireshark-1.12.0~201310251247/asn1/cmip/CMIP-A-ASSOCIATE-Information.asn 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/cmip/CMIP-A-ASSOCIATE-Information.asn 2013-11-02 02:12:36.000000000 +0000 @@ -1,3 +1,4 @@ +-- $Id$ -- Module CMIP-A-ASSOCIATE-Information (X.711:10/1997) CMIP-A-ASSOCIATE-Information {joint-iso-itu-t ms(9) cmip(1) modules(0) aAssociateUserInfo(1)} DEFINITIONS ::= diff -Nru wireshark-1.12.0~201310251247/asn1/cmip/cmip.cnf wireshark-1.12.0~201311020920/asn1/cmip/cmip.cnf --- wireshark-1.12.0~201310251247/asn1/cmip/cmip.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/cmip/cmip.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -272,7 +272,7 @@ #.FN_BODY Attribute/value if(attributeform==ATTRIBUTE_GLOBAL_FORM){ - offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree, NULL); } else if (dissector_try_uint(attribute_id_dissector_table, attribute_local_id, tvb, actx->pinfo, tree)) { offset=tvb_length (tvb); } else { @@ -283,7 +283,7 @@ FN_VARIANT = _str VAL_PTR = &attributevalueassertion_id #.FN_BODY AttributeValueAssertion/value - offset=call_ber_oid_callback(attributevalueassertion_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(attributevalueassertion_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY Invoke/argument switch(opcode){ @@ -438,20 +438,20 @@ FN_VARIANT = _str HF_INDEX = hf_cmip_actionType_OID VAL_PTR = &object_identifier_id #.FN_BODY ActionInfo/actionInfoArg - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS EventTypeId/globalForm FN_VARIANT = _str HF_INDEX = hf_cmip_eventType_OID VAL_PTR = &object_identifier_id #.FN_BODY EventReportArgument/eventInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY EventReply/eventReplyInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY SetArgument/modificationList/_item/attributeValue if(attributeform==ATTRIBUTE_GLOBAL_FORM){ - offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree, NULL); } else if (dissector_try_uint(attribute_id_dissector_table, attribute_local_id, tvb, actx->pinfo, tree)) { offset=tvb_length (tvb); } else { @@ -462,39 +462,39 @@ FN_VARIANT = _str HF_INDEX = hf_cmip_errorId_OID VAL_PTR = &object_identifier_id #.FN_BODY SpecificErrorInfo/errorInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY AttributeError/attributeValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY InvalidArgumentValue/eventValue/eventInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY ActionReply/actionReplyInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); # X.721 #.FN_PARS ManagementExtension/identifier FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY ManagementExtension/information - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY AttributeValueChangeDefinition/_item/oldAttributeValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY AttributeValueChangeDefinition/_item/newAttributeValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS ServiceUser/identifier FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY ServiceUser/details - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS SupportedFeatures/_item/featureIdentifier FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY SupportedFeatures/_item/featureInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.END diff -Nru wireshark-1.12.0~201310251247/asn1/cmp/cmp.cnf wireshark-1.12.0~201311020920/asn1/cmp/cmp.cnf --- wireshark-1.12.0~201310251247/asn1/cmp/cmp.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/cmp/cmp.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -87,7 +87,7 @@ FN_VARIANT = _str HF_INDEX = hf_cmp_type_oid VAL_PTR = &actx->external.direct_reference #.FN_BODY InfoTypeAndValue/infoValue - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS PKIBody VAL_PTR = &branch_taken diff -Nru wireshark-1.12.0~201310251247/asn1/cms/cms.cnf wireshark-1.12.0~201311020920/asn1/cms/cms.cnf --- wireshark-1.12.0~201310251247/asn1/cms/cms.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/cms/cms.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -97,7 +97,7 @@ } #.FN_BODY ContentInfo/content - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY EncapsulatedContentInfo/eContent @@ -105,24 +105,24 @@ offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &content_tvb); proto_item_set_text(actx->created_item, "eContent (%%u bytes)", tvb_length (content_tvb)); - call_ber_oid_callback(object_identifier_id, content_tvb, 0, actx->pinfo, top_tree ? top_tree : tree); + call_ber_oid_callback(object_identifier_id, content_tvb, 0, actx->pinfo, top_tree ? top_tree : tree, NULL); #.FN_PARS OtherRecipientInfo/oriType FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY OtherRecipientInfo/oriValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS OtherKeyAttribute/keyAttrId FN_VARIANT = _str HF_INDEX = hf_cms_ci_contentType VAL_PTR = &object_identifier_id #.FN_BODY OtherKeyAttribute/keyAttr - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS OtherRevocationInfoFormat/otherRevInfoFormat FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY OtherRevocationInfoFormat/otherRevInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS Attribute/attrType FN_VARIANT = _str HF_INDEX = hf_cms_attrType VAL_PTR = &object_identifier_id @@ -139,7 +139,7 @@ #.FN_BODY AttributeValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY MessageDigest proto_item *pi; @@ -172,7 +172,7 @@ #.FN_BODY SMIMECapability/parameters - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS RC2ParameterVersion VAL_PTR = &length diff -Nru wireshark-1.12.0~201310251247/asn1/crmf/crmf.cnf wireshark-1.12.0~201311020920/asn1/crmf/crmf.cnf --- wireshark-1.12.0~201310251247/asn1/crmf/crmf.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/crmf/crmf.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -71,7 +71,7 @@ FN_VARIANT = _str HF_INDEX = hf_crmf_type_oid VAL_PTR = &actx->external.direct_reference #.FN_BODY AttributeTypeAndValue/value - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.END diff -Nru wireshark-1.12.0~201310251247/asn1/ess/ess.cnf wireshark-1.12.0~201311020920/asn1/ess/ess.cnf --- wireshark-1.12.0~201310251247/asn1/ess/ess.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/ess/ess.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -48,7 +48,7 @@ FN_VARIANT = _str HF_INDEX = hf_ess_SecurityCategory_type_OID VAL_PTR = &object_identifier_id #.FN_BODY SecurityCategory/value - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS RestrictiveTag/tagName FN_VARIANT = _str VAL_PTR = &object_identifier_id diff -Nru wireshark-1.12.0~201310251247/asn1/ftam/ftam.cnf wireshark-1.12.0~201311020920/asn1/ftam/ftam.cnf --- wireshark-1.12.0~201310251247/asn1/ftam/ftam.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/ftam/ftam.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -73,16 +73,16 @@ FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY Contents-Type-Attribute/document-type/parameter - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY Extension-Attribute/extension-attribute - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS Attribute-Extensions-Pattern/_item/extension-set-attribute-Patterns/_item/extension-attribute-identifier FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY Attribute-Extensions-Pattern/_item/extension-set-attribute-Patterns/_item/extension-attribute-Pattern - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY AP-title /* XXX have no idea about this one */ diff -Nru wireshark-1.12.0~201310251247/asn1/gsm_map/gsm_map.cnf wireshark-1.12.0~201311020920/asn1/gsm_map/gsm_map.cnf --- wireshark-1.12.0~201310251247/asn1/gsm_map/gsm_map.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/gsm_map/gsm_map.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -189,7 +189,7 @@ %(DEFAULT_BODY)s col_append_str(actx->pinfo->cinfo, COL_INFO, gsm_map_opr_code(opcode)); - col_append_fstr(actx->pinfo->cinfo, COL_INFO, " "); + col_append_str(actx->pinfo->cinfo, COL_INFO, " "); #.FN_PARS GSMMAPLocalErrorcode @@ -202,7 +202,7 @@ #.FN_BODY PrivateExtension/extType proto_tree_add_text(tree, tvb, offset, -1, "Extension Data"); if (obj_id){ - offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree, NULL); }else{ call_dissector(data_handle, tvb, actx->pinfo, tree); offset = tvb_length_remaining(tvb,offset); diff -Nru wireshark-1.12.0~201310251247/asn1/gsm_map/packet-gsm_map-template.c wireshark-1.12.0~201311020920/asn1/gsm_map/packet-gsm_map-template.c --- wireshark-1.12.0~201310251247/asn1/gsm_map/packet-gsm_map-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/gsm_map/packet-gsm_map-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -1847,16 +1847,15 @@ static guint8 gsm_map_pdu_size = 0; static int -dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) { +dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, + int hf_index _U_, struct tcap_private_t * p_private_tcap) { char *version_ptr; - struct tcap_private_t * p_private_tcap; opcode = 0; if (pref_application_context_version == APPLICATON_CONTEXT_FROM_TRACE) { application_context_version = 0; - if (actx->pinfo->private_data != NULL){ - p_private_tcap = (struct tcap_private_t *)actx->pinfo->private_data; + if (p_private_tcap != NULL){ if (p_private_tcap->acv==TRUE ){ version_ptr = strrchr((const char*)p_private_tcap->oid,'.'); if (version_ptr){ @@ -1872,8 +1871,8 @@ /* Get the length and add 2 */ gsm_map_pdu_size = tvb_get_guint8(tvb, offset+1)+2; - col_add_str(actx->pinfo->cinfo, COL_INFO, val_to_str_const(gsmmap_pdu_type, gsm_old_Component_vals, "Unknown GSM-MAP Component")); - col_append_fstr(actx->pinfo->cinfo, COL_INFO, " "); + col_set_str(actx->pinfo->cinfo, COL_INFO, val_to_str_const(gsmmap_pdu_type, gsm_old_Component_vals, "Unknown GSM-MAP Component")); + col_append_str(actx->pinfo->cinfo, COL_INFO, " "); offset = dissect_gsm_old_Component(FALSE, tvb, 0, actx, tree, hf_gsm_map_old_Component_PDU); /* offset = dissect_ber_choice(pinfo, tree, tvb, offset, @@ -1883,14 +1882,15 @@ return offset; } -static void -dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +static int +dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { proto_item *item=NULL; proto_tree *tree=NULL; /* Used for gsm_map TAP */ static gsm_map_tap_rec_t tap_rec; gint op_idx; + struct tcap_private_t * p_private_tcap = (struct tcap_private_t *)data; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -1900,12 +1900,10 @@ top_tree = parent_tree; /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, ENC_NA); - tree = proto_item_add_subtree(item, ett_gsm_map); - } + item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, ENC_NA); + tree = proto_item_add_subtree(item, ett_gsm_map); - dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, &asn1_ctx, tree, -1); + dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, &asn1_ctx, tree, -1, p_private_tcap); try_val_to_str_idx(opcode, gsm_map_opr_code_strings, &op_idx); if (op_idx != -1) { @@ -1915,6 +1913,8 @@ tap_queue_packet(gsm_map_tap, pinfo, &tap_rec); } + + return tvb_length(tvb); } const value_string ssCode_vals[] = { @@ -2657,7 +2657,7 @@ /* Register protocol */ proto_gsm_map_dialogue =proto_gsm_map = proto_register_protocol(PNAME, PSNAME, PFNAME); - register_dissector("gsm_map", dissect_gsm_map, proto_gsm_map); + new_register_dissector("gsm_map", dissect_gsm_map, proto_gsm_map); /* Register fields and subtrees */ proto_register_field_array(proto_gsm_map, hf, array_length(hf)); diff -Nru wireshark-1.12.0~201310251247/asn1/inap/inap.cnf wireshark-1.12.0~201311020920/asn1/inap/inap.cnf --- wireshark-1.12.0~201310251247/asn1/inap/inap.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/inap/inap.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -214,7 +214,7 @@ #.FN_BODY ExtensionField/value proto_tree_add_text(tree, tvb, offset, -1, "Extension Data"); if (obj_id){ - offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree, NULL); }else{ call_dissector(data_handle, tvb, actx->pinfo, tree); offset = tvb_length_remaining(tvb,offset); diff -Nru wireshark-1.12.0~201310251247/asn1/ldap/ldap.cnf wireshark-1.12.0~201311020920/asn1/ldap/ldap.cnf --- wireshark-1.12.0~201310251247/asn1/ldap/ldap.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/ldap/ldap.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -741,7 +741,7 @@ offset=dissect_ber_identifier(actx->pinfo, NULL, tvb, offset, &ber_class, &pc, &tag); offset=dissect_ber_length(actx->pinfo, NULL, tvb, offset, &len, &ind); - call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); offset += len; } else { @@ -752,7 +752,7 @@ #.FN_BODY ExtendedRequest/_untag/requestValue if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) { - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); } else { %(DEFAULT_BODY)s } @@ -769,7 +769,7 @@ proto_item_append_text(ldm_tree, " (%%s)", name); } if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) { - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); } else { %(DEFAULT_BODY)s } diff -Nru wireshark-1.12.0~201310251247/asn1/ldap/packet-ldap-template.c wireshark-1.12.0~201311020920/asn1/ldap/packet-ldap-template.c --- wireshark-1.12.0~201310251247/asn1/ldap/packet-ldap-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/ldap/packet-ldap-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -408,13 +408,13 @@ char c; if (rec->attribute_type == NULL) { - *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty"); + *err = g_strdup("Attribute type can't be empty"); return; } g_strstrip(rec->attribute_type); if (rec->attribute_type[0] == 0) { - *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty"); + *err = g_strdup("Attribute type can't be empty"); return; } @@ -423,7 +423,7 @@ */ c = proto_check_field_name(rec->attribute_type); if (c) { - *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't contain '%c'", c); + *err = g_strdup_printf("Attribute type can't contain '%c'", c); return; } diff -Nru wireshark-1.12.0~201310251247/asn1/lte-rrc/lte-rrc.cnf wireshark-1.12.0~201311020920/asn1/lte-rrc/lte-rrc.cnf --- wireshark-1.12.0~201310251247/asn1/lte-rrc/lte-rrc.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/lte-rrc/lte-rrc.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -1510,3 +1510,31 @@ set_mac_lte_drx_config_release(p_mac_lte_info->ueid, actx->pinfo); } %(DEFAULT_BODY)s + + +#.FN_BODY SecurityAlgorithmConfig + pdcp_lte_info *p_pdcp_lte_info; + pdcp_security_info_t *p_security_algorithms; +%(DEFAULT_BODY)s + p_security_algorithms = private_data_pdcp_security_algorithms(actx); + p_security_algorithms->configuration_frame = actx->pinfo->fd->num; + /* Look for UE identifier */ + p_pdcp_lte_info = (pdcp_lte_info *)p_get_proto_data(actx->pinfo->fd, proto_pdcp_lte, 0); + if (p_pdcp_lte_info != NULL) { + /* Configure algorithms */ + set_pdcp_lte_security_algorithms(p_pdcp_lte_info->ueid, p_security_algorithms); + } + +#.FN_BODY SecurityAlgorithmConfig/cipheringAlgorithm VAL_PTR=&value + guint32 value; + pdcp_security_info_t *p_security_algorithms; +%(DEFAULT_BODY)s + p_security_algorithms = private_data_pdcp_security_algorithms(actx); + p_security_algorithms->ciphering = (enum security_ciphering_algorithm_e)value; + +#.FN_BODY SecurityAlgorithmConfig/integrityProtAlgorithm VAL_PTR=&value + guint32 value; + pdcp_security_info_t *p_security_algorithms; +%(DEFAULT_BODY)s + p_security_algorithms = private_data_pdcp_security_algorithms(actx); + p_security_algorithms->integrity = (enum security_integrity_algorithm_e)value; diff -Nru wireshark-1.12.0~201310251247/asn1/lte-rrc/packet-lte-rrc-template.c wireshark-1.12.0~201311020920/asn1/lte-rrc/packet-lte-rrc-template.c --- wireshark-1.12.0~201310251247/asn1/lte-rrc/packet-lte-rrc-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/lte-rrc/packet-lte-rrc-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -43,6 +43,7 @@ #include "packet-cell_broadcast.h" #include "packet-mac-lte.h" #include "packet-rlc-lte.h" +#include "packet-pdcp-lte.h" #define PNAME "LTE Radio Resource Control (RRC) protocol" #define PSNAME "LTE RRC" @@ -63,6 +64,7 @@ extern int proto_mac_lte; +extern int proto_pdcp_lte; /* Include constants */ @@ -1804,6 +1806,7 @@ guint16 message_identifier; drb_mapping_t drb_mapping; drx_config_t drx_config; + pdcp_security_info_t pdcp_security; } lte_rrc_private_data_t; /* Helper function to get or create a struct that will be actx->private_data */ @@ -1904,6 +1907,16 @@ lte_rrc_private_data_t *private_data = (lte_rrc_private_data_t*)lte_rrc_get_private_data(actx); private_data->ra_preambles = ra_preambles; } + + +/* PDCP Security info */ +static pdcp_security_info_t* private_data_pdcp_security_algorithms(asn1_ctx_t *actx) +{ + lte_rrc_private_data_t *private_data = (lte_rrc_private_data_t*)lte_rrc_get_private_data(actx); + return &private_data->pdcp_security; +} + + /*****************************************************************************/ diff -Nru wireshark-1.12.0~201310251247/asn1/ocsp/ocsp.cnf wireshark-1.12.0~201311020920/asn1/ocsp/ocsp.cnf --- wireshark-1.12.0~201310251247/asn1/ocsp/ocsp.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/ocsp/ocsp.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -48,6 +48,6 @@ /* skip past the T and L */ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag); offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); - offset=call_ber_oid_callback(responseType_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(responseType_id, tvb, offset, actx->pinfo, tree, NULL); #.END diff -Nru wireshark-1.12.0~201310251247/asn1/p1/p1.cnf wireshark-1.12.0~201311020920/asn1/p1/p1.cnf --- wireshark-1.12.0~201310251247/asn1/p1/p1.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/p1/p1.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -549,7 +549,7 @@ expert_add_info(actx->pinfo, item, &ei_p1_unknown_standard_extension); } } else if (actx->external.direct_ref_present) { - offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); name = oid_resolved_from_string(actx->external.direct_reference); proto_item_append_text(tree, " (%%s)", name ? name : actx->external.direct_reference); } @@ -562,7 +562,7 @@ const char *name; if (actx->external.direct_reference) { - offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); name = oid_resolved_from_string(actx->external.direct_reference); proto_item_append_text(tree, " (%%s)", name ? name : actx->external.direct_reference); } else { @@ -673,7 +673,7 @@ if (next_tvb) { if (ctx && ctx->content_type_id) { - (void) call_ber_oid_callback(ctx->content_type_id, next_tvb, 0, actx->pinfo, actx->subtree.top_tree ? actx->subtree.top_tree : tree); + (void) call_ber_oid_callback(ctx->content_type_id, next_tvb, 0, actx->pinfo, actx->subtree.top_tree ? actx->subtree.top_tree : tree, NULL); } else if (ctx && ctx->report_unknown_content_type) { proto_item *item = NULL; proto_tree *next_tree = NULL; @@ -1153,7 +1153,7 @@ #.FN_BODY TokenTypeData if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS Credentials VAL_PTR = &credentials diff -Nru wireshark-1.12.0~201310251247/asn1/p22/p22.cnf wireshark-1.12.0~201311020920/asn1/p22/p22.cnf --- wireshark-1.12.0~201310251247/asn1/p22/p22.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/p22/p22.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -227,7 +227,7 @@ #.FN_BODY IPMSExtension/value - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY IPM diff -Nru wireshark-1.12.0~201310251247/asn1/p7/p7.cnf wireshark-1.12.0~201311020920/asn1/p7/p7.cnf --- wireshark-1.12.0~201310251247/asn1/p7/p7.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/p7/p7.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -306,41 +306,41 @@ #.FN_BODY Attribute/attribute-values/_item if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY AttributeValueAssertion/attribute-value if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY FilterItem/substrings/strings/_item/initial if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY FilterItem/substrings/strings/_item/any if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY FilterItem/substrings/strings/_item/final if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY MatchingRuleAssertion/match-value if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY Summary/present/_item/value if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY OrderedAttribute/attribute-values/_item/value if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS AutoActionType FN_VARIANT = _str VAL_PTR = &actx->external.direct_reference #.FN_BODY AutoActionRegistration/registration-parameter if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY AutoActionError/error-code @@ -358,11 +358,11 @@ #.FN_BODY AutoActionError/error-parameter if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY PAR-attribute-error/problems/_item/value if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY MSBindArgument/initiator-name diff -Nru wireshark-1.12.0~201310251247/asn1/pkcs12/packet-pkcs12-template.c wireshark-1.12.0~201311020920/asn1/pkcs12/packet-pkcs12-template.c --- wireshark-1.12.0~201310251247/asn1/pkcs12/packet-pkcs12-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/pkcs12/packet-pkcs12-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -371,7 +371,7 @@ g_string_free(name, TRUE); /* now try and decode it */ - call_ber_oid_callback(object_identifier_id_param, clear_tvb, 0, actx->pinfo, tree); + call_ber_oid_callback(object_identifier_id_param, clear_tvb, 0, actx->pinfo, tree, NULL); return TRUE; #else diff -Nru wireshark-1.12.0~201310251247/asn1/pkcs12/pkcs12.cnf wireshark-1.12.0~201311020920/asn1/pkcs12/pkcs12.cnf --- wireshark-1.12.0~201310251247/asn1/pkcs12/pkcs12.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/pkcs12/pkcs12.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -108,23 +108,23 @@ #.FN_BODY SafeBag/bagValue if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY PKCS12Attribute/attrValues/_item if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY CertBag/certValue if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY CRLBag/crlValue if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY SecretBag/secretValue if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_HDR PBEParameter /* initialise the encryption parameters */ diff -Nru wireshark-1.12.0~201310251247/asn1/pkix1explicit/pkix1explicit.cnf wireshark-1.12.0~201311020920/asn1/pkix1explicit/pkix1explicit.cnf --- wireshark-1.12.0~201310251247/asn1/pkix1explicit/pkix1explicit.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/pkix1explicit/pkix1explicit.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -41,13 +41,13 @@ FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id #.FN_BODY Attribute/values/_item - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS AttributeTypeAndValue/value FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id #.FN_BODY AttributeTypeAndValue/value - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS Extension/extnId FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id @@ -60,7 +60,7 @@ /* skip past the T and L */ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag); offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); # IPAddrAndASCertExtn diff -Nru wireshark-1.12.0~201310251247/asn1/pkixac/pkixac.cnf wireshark-1.12.0~201311020920/asn1/pkixac/pkixac.cnf --- wireshark-1.12.0~201310251247/asn1/pkixac/pkixac.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/pkixac/pkixac.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -61,7 +61,7 @@ #.FN_BODY SecurityCategory/value if (object_identifier_id) - offset = call_ber_oid_callback (object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback (object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.END diff -Nru wireshark-1.12.0~201310251247/asn1/pkixqualified/pkixqualified.cnf wireshark-1.12.0~201311020920/asn1/pkixqualified/pkixqualified.cnf --- wireshark-1.12.0~201310251247/asn1/pkixqualified/pkixqualified.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/pkixqualified/pkixqualified.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -31,7 +31,7 @@ FN_VARIANT = _str HF_INDEX = hf_pkixqualified_statementId VAL_PTR = &object_identifier_id #.FN_BODY QCStatement/statementInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); #.END diff -Nru wireshark-1.12.0~201310251247/asn1/pres/packet-pres-template.c wireshark-1.12.0~201311020920/asn1/pres/packet-pres-template.c --- wireshark-1.12.0~201310251247/asn1/pres/packet-pres-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/pres/packet-pres-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -348,7 +348,7 @@ /* This is a reassembly initiated in packet-ses */ char *oid = find_oid_by_pres_ctx_id (pinfo, session->pres_ctx_id); if (oid) { - call_ber_oid_callback (oid, tvb, offset, pinfo, parent_tree); + call_ber_oid_callback (oid, tvb, offset, pinfo, parent_tree, NULL); } else { proto_tree_add_text(parent_tree, tvb, offset, tvb_reported_length_remaining(tvb,offset),"User data"); diff -Nru wireshark-1.12.0~201310251247/asn1/pres/pres.cnf wireshark-1.12.0~201311020920/asn1/pres/pres.cnf --- wireshark-1.12.0~201310251247/asn1/pres/pres.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/pres/pres.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -41,7 +41,7 @@ oid=find_oid_by_pres_ctx_id(actx->pinfo, presentation_context_identifier); if(oid){ next_tvb = tvb_new_subset_remaining(tvb, offset); - call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); + call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree, NULL); } else { proto_tree_add_expert(tree, actx->pinfo, &ei_pres_dissector_not_available, tvb, offset, -1); @@ -55,7 +55,7 @@ oid=find_oid_by_pres_ctx_id(actx->pinfo, presentation_context_identifier); if(oid){ dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &next_tvb); - call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); + call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree, NULL); } else { proto_tree_add_expert(tree, actx->pinfo, &ei_pres_dissector_not_available, tvb, offset, -1); diff -Nru wireshark-1.12.0~201310251247/asn1/rnsap/packet-rnsap-template.c wireshark-1.12.0~201311020920/asn1/rnsap/packet-rnsap-template.c --- wireshark-1.12.0~201310251247/asn1/rnsap/packet-rnsap-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/rnsap/packet-rnsap-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -100,7 +100,7 @@ static int dissect_PrivateIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - return (call_ber_oid_callback(obj_id, tvb, 0, pinfo, tree)) ? tvb_length(tvb) : 0; + return (call_ber_oid_callback(obj_id, tvb, 0, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) diff -Nru wireshark-1.12.0~201310251247/asn1/rtse/rtse.cnf wireshark-1.12.0~201311020920/asn1/rtse/rtse.cnf --- wireshark-1.12.0~201310251247/asn1/rtse/rtse.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/rtse/rtse.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -129,7 +129,7 @@ #.FN_BODY RTTPapdu VAL_PTR=&priority int priority = -1; - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Turn-Please"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Turn-Please"); %(DEFAULT_BODY)s @@ -137,7 +137,7 @@ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%d)", priority); #.FN_BODY RTORJapdu - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Refuse"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Refuse"); %(DEFAULT_BODY)s @@ -153,7 +153,7 @@ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s)", val_to_str(reason, rtse_RefuseReason_vals, "reason(%%d)")); #.FN_BODY RTABapdu - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Abort"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Abort"); %(DEFAULT_BODY)s diff -Nru wireshark-1.12.0~201310251247/asn1/snmp/packet-snmp-template.c wireshark-1.12.0~201311020920/asn1/snmp/packet-snmp-template.c --- wireshark-1.12.0~201310251247/asn1/snmp/packet-snmp-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/snmp/packet-snmp-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -1479,7 +1479,7 @@ msg[i] = '\0'; } - calc_auth = (guint8*)ep_alloc(16); + calc_auth = (guint8*)wmem_alloc(wmem_packet_scope(), 16); md5_hmac(msg, msg_len, key, key_len, calc_auth); @@ -1543,7 +1543,7 @@ msg[i] = '\0'; } - calc_auth = (guint8*)ep_alloc(20); + calc_auth = (guint8*)wmem_alloc(wmem_packet_scope(), 20); sha1_hmac(key, key_len, msg, msg_len, calc_auth); @@ -2230,7 +2230,7 @@ snmp_users_update_cb(void* p _U_, const char** err) { snmp_ue_assoc_t* ue = (snmp_ue_assoc_t*)p; - emem_strbuf_t* es = ep_strbuf_new(""); + GString* es = g_string_new(""); unsigned int i; *err = NULL; @@ -2240,14 +2240,14 @@ return; if (! ue->user.userName.len) - ep_strbuf_append_printf(es,"no userName\n"); + g_string_append_printf(es,"no userName\n"); for (i=0; iengine.len > 0) && (u->engine.len < 5 || u->engine.len > 32)) { - ep_strbuf_append_printf(es, "Invalid engineId length (%u). Must be between 5 and 32 (10 and 64 hex digits)\n", u->engine.len); + g_string_append_printf(es, "Invalid engineId length (%u). Must be between 5 and 32 (10 and 64 hex digits)\n", u->engine.len); } @@ -2257,21 +2257,21 @@ if (u->engine.len > 0 && memcmp( u->engine.data, ue->engine.data, u->engine.len ) == 0) { if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) { /* XXX: make a string for the engineId */ - ep_strbuf_append_printf(es,"Duplicate key (userName='%s')\n",ue->user.userName.data); + g_string_append_printf(es,"Duplicate key (userName='%s')\n",ue->user.userName.data); } } if (u->engine.len == 0) { if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) { - ep_strbuf_append_printf(es,"Duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data); + g_string_append_printf(es,"Duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data); } } } } if (es->len) { - es = ep_strbuf_truncate(es,es->len-1); - *err = ep_strdup(es->str); + es = g_string_truncate(es,es->len-1); + *err = g_string_free(es, FALSE); } return; diff -Nru wireshark-1.12.0~201310251247/asn1/t38/t38.cnf wireshark-1.12.0~201311020920/asn1/t38/t38.cnf --- wireshark-1.12.0~201310251247/asn1/t38/t38.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/t38/t38.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -127,9 +127,8 @@ /* Now reset fragmentation information in pinfo */ actx->pinfo->fragmented = save_fragmented; - actx->pinfo->private_data = t38_info; - if (new_tvb) call_dissector((t30_hdlc_handle) ? t30_hdlc_handle : data_handle, new_tvb, actx->pinfo, tree); + if (new_tvb) call_dissector_with_data((t30_hdlc_handle) ? t30_hdlc_handle : data_handle, new_tvb, actx->pinfo, tree, t38_info); } } else { if(tree){ diff -Nru wireshark-1.12.0~201310251247/asn1/tcap/packet-tcap-template.c wireshark-1.12.0~201311020920/asn1/tcap/packet-tcap-template.c --- wireshark-1.12.0~201310251247/asn1/tcap/packet-tcap-template.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/tcap/packet-tcap-template.c 2013-11-02 02:12:36.000000000 +0000 @@ -211,7 +211,7 @@ tcapext_oid = NULL; raz_tcap_private(&tcap_private); - pinfo->private_data = &tcap_private; + asn1_ctx.value_ptr = &tcap_private; gp_tcapsrt_info=tcapsrt_razinfo(); tcap_subdissector_used=FALSE; gp_tcap_context=NULL; @@ -634,7 +634,7 @@ /* Call the sub dissector if present, and not already called */ if (is_subdissector) - call_dissector(subdissector_handle, tvb, actx->pinfo, tree); + call_dissector_with_data(subdissector_handle, tvb, actx->pinfo, tree, actx->value_ptr); return offset; } diff -Nru wireshark-1.12.0~201310251247/asn1/x509af/x509af.cnf wireshark-1.12.0~201311020920/asn1/x509af/x509af.cnf --- wireshark-1.12.0~201310251247/asn1/x509af/x509af.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/x509af/x509af.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -79,7 +79,7 @@ } #.FN_BODY AlgorithmIdentifier/parameters - offset=call_ber_oid_callback(algorithm_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(algorithm_id, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS Extension/extnId FN_VARIANT = _str HF_INDEX = hf_x509af_extension_id VAL_PTR = &actx->external.direct_reference @@ -103,7 +103,7 @@ /* skip past the T and L */ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag); offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY SubjectName diff -Nru wireshark-1.12.0~201310251247/asn1/x509ce/x509ce.cnf wireshark-1.12.0~201311020920/asn1/x509ce/x509ce.cnf --- wireshark-1.12.0~201310251247/asn1/x509ce/x509ce.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/x509ce/x509ce.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -168,7 +168,7 @@ FN_VARIANT = _str HF_INDEX = hf_x509ce_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY PolicyQualifierInfo/qualifier - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY GeneralName/iPAddress proto_tree_add_item(tree, hf_x509ce_IPAddress, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -178,7 +178,7 @@ FN_VARIANT = _str VAL_PTR = &actx->external.direct_reference #.FN_BODY OtherNameValue - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_FTR GeneralName/uniformResourceIdentifier diff -Nru wireshark-1.12.0~201310251247/asn1/x509if/x509if.cnf wireshark-1.12.0~201311020920/asn1/x509if/x509if.cnf --- wireshark-1.12.0~201310251247/asn1/x509if/x509if.cnf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/asn1/x509if/x509if.cnf 2013-11-02 02:12:36.000000000 +0000 @@ -183,7 +183,7 @@ FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY ContextAssertion/contextValues/_item - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS AttributeTypeAndDistinguishedValue/type FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference @@ -230,7 +230,7 @@ const char *name = NULL; const char *orig_oid = actx->external.direct_reference; - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); /* in dissecting the value we may have overridden the OID of the value - which is a problem if there are multiple values */ @@ -273,61 +273,61 @@ FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY RequestAttribute/selectedValues/_item - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS RequestAttribute/defaultValues/_item/entryType FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY RequestAttribute/defaultValues/_item/values/_item - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY Attribute/valuesWithContext/_item/value - offset=call_ber_oid_callback("unknown", tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback("unknown", tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS ResultAttribute/attributeType FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY ResultAttribute/outputValues/selectedValues/_item - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS Context/contextType FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY Context/contextValues/_item - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS AttributeType FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY AttributeValue - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS AttributeValueAssertion/type FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY AttributeValueAssertion/assertion - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS Attribute/type FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY Attribute/values/_item - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS ContextProfile/contextType FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY ContextProfile/contextValue/_item - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS MatchingUse/restrictionType FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference #.FN_BODY MatchingUse/restrictionValue - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY AttributeTypeAndDistinguishedValue/valuesWithContext/_item/distingAttrValue - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY RelativeDistinguishedName char *temp_dn; diff -Nru wireshark-1.12.0~201310251247/cmake/modules/FindASCIIDOC.cmake wireshark-1.12.0~201311020920/cmake/modules/FindASCIIDOC.cmake --- wireshark-1.12.0~201310251247/cmake/modules/FindASCIIDOC.cmake 1970-01-01 00:00:00.000000000 +0000 +++ wireshark-1.12.0~201311020920/cmake/modules/FindASCIIDOC.cmake 2013-11-02 02:12:36.000000000 +0000 @@ -0,0 +1,107 @@ +# +# $Id$ +# +# - Find unix commands from cygwin +# This module looks for some usual Unix commands. +# + +INCLUDE(FindCygwin) + +FIND_PROGRAM(A2X_EXECUTABLE + NAMES + a2x + PATHS + ${CYGWIN_INSTALL_PATH}/bin + /bin + /usr/bin + /usr/local/bin + /sbin +) + +# Make sure we don't get language specific quotes +set( A2X_EXECUTABLE LC_ALL=C ${A2X_EXECUTABLE} ) + +# Handle the QUIETLY and REQUIRED arguments and set A2X_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(A2X DEFAULT_MSG A2X_EXECUTABLE) + +MARK_AS_ADVANCED(A2X_EXECUTABLE) + +MACRO( ASCIIDOC2HTML _output _asciidocsource _conffile ) + GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE ) + set( A2X_HTML_OPTS --stylesheet=ws.css ) + ADD_CUSTOM_COMMAND( + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT + ${_output} + COMMAND ${A2X_EXECUTABLE} + --format=xhtml + --destination-dir=${CMAKE_CURRENT_BINARY_DIR} + # --conf-file=${_conffile} + ${A2X_HTML_OPTS} + ${_asciidocsource} + # Replacing file with itself will fail + # COMMAND mv + # ${CMAKE_CURRENT_BINARY_DIR}/${_source_base_name}.html + # ${CMAKE_CURRENT_BINARY_DIR}/${_output} + DEPENDS + ${_asciidocsources} + ${_otherdependencies} + ) +ENDMACRO() + +MACRO( ASCIIDOC2TXT _output _asciidocsource _conffile ) + GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE ) + if( LYNX_EXECUTABLE MATCHES lynx ) + set( A2X_TEXT_OPTS --lynx ) + else() + set( A2X_TEXT_OPTS ) + endif() + ADD_CUSTOM_COMMAND( + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT + ${_output} + COMMAND ${A2X_EXECUTABLE} + --format=text + --destination-dir=${CMAKE_CURRENT_BINARY_DIR} + # --conf-file=${_conffile} + ${A2X_TEXT_OPTS} + --xsltproc-opts '--stringparam generate.toc "article nop"' + ${_asciidocsource} + COMMAND mv + ${CMAKE_CURRENT_BINARY_DIR}/${_source_base_name}.text + ${CMAKE_CURRENT_BINARY_DIR}/${_output} + DEPENDS + ${_asciidocsource} + ${_conffile} + ) +ENDMACRO() + +# news: release-notes.txt +# cp release-notes.txt ../NEWS + +MACRO( ASCIIDOC2PDF _output _asciidocsource _conffile _paper ) + GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE ) + set( A2X_HTML_OPTS --stylesheet=ws.css ) + ADD_CUSTOM_COMMAND( + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT + ${_output} + COMMAND ${A2X_EXECUTABLE} + --format=pdf + --destination-dir=${CMAKE_CURRENT_BINARY_DIR} + # --conf-file=${_conffile} + ${A2X_HTML_OPTS} + --xsltproc-opts "--stringparam paper.type ${_paper} --nonet" + --xsl-file=custom_layer_pdf.xsl + ${_asciidocsource} + COMMAND mv + ${CMAKE_CURRENT_BINARY_DIR}/${_source_base_name}.pdf + ${CMAKE_CURRENT_BINARY_DIR}/${_output} + DEPENDS + ${_asciidocsources} + ${_otherdependencies} + ) +ENDMACRO() + diff -Nru wireshark-1.12.0~201310251247/cmake/modules/FindLYNX.cmake wireshark-1.12.0~201311020920/cmake/modules/FindLYNX.cmake --- wireshark-1.12.0~201310251247/cmake/modules/FindLYNX.cmake 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/cmake/modules/FindLYNX.cmake 2013-11-02 02:12:36.000000000 +0000 @@ -27,14 +27,14 @@ MARK_AS_ADVANCED(LYNX_EXECUTABLE) # Convert html to text -IF(LYNX_EXECUTABLE MATCHES lynx$) +IF(LYNX_EXECUTABLE MATCHES lynx) # (See Bug # 1446 for note re 'force-html' below) set(HTML2TXT "lynx -dump -width=72 -nolist -stdin -force-html") -ELSEIF(LYNX_EXECUTABLE MATCHES elinks$) +ELSEIF(LYNX_EXECUTABLE MATCHES elinks) set(HTML2TXT "elinks -dump -dump-width 72") -ELSEIF(LYNX_EXECUTABLE MATCHES links$) +ELSEIF(LYNX_EXECUTABLE MATCHES links) set(HTML2TXT "links -dump -width 72") -ELSEIF(LYNX_EXECUTABLE MATCHES true$) +ELSEIF(LYNX_EXECUTABLE MATCHES true) set(HTML2TXT "true") ELSE() message(ERROR "Should never be reached - please report!") diff -Nru wireshark-1.12.0~201310251247/cmake/modules/UseMakeDissectorReg.cmake wireshark-1.12.0~201311020920/cmake/modules/UseMakeDissectorReg.cmake --- wireshark-1.12.0~201310251247/cmake/modules/UseMakeDissectorReg.cmake 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/cmake/modules/UseMakeDissectorReg.cmake 2013-11-02 02:12:36.000000000 +0000 @@ -2,19 +2,6 @@ # $Id$ # MACRO(REGISTER_DISSECTOR_FILES _outputfile _registertype ) - # FIXME: Only the Python stuff has been implemented - # Make this into a MACRO, to avoid duplication with plugins/.../ - #register.c: $(plugin_src) $(ALL_DISSECTORS_SRC) $(top_srcdir)/tools/make-dissector-reg \ - # $(top_srcdir)/tools/make-dissector-reg.py - # @if test -n "$(PYTHON)"; then \ - # echo Making register.c with python ; \ - # $(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \ - # dissectors $(ALL_DISSECTORS_SRC) ; \ - # else \ - # echo Making register.c with shell script ; \ - # $(top_srcdir)/tools/make-dissector-reg $(srcdir) \ - # dissectors $(plugin_src) $(ALL_DISSECTORS_SRC) ; \ - # fi set( _sources ${ARGN} ) ADD_CUSTOM_COMMAND( OUTPUT diff -Nru wireshark-1.12.0~201310251247/cmake/modules/readme.txt wireshark-1.12.0~201311020920/cmake/modules/readme.txt --- wireshark-1.12.0~201310251247/cmake/modules/readme.txt 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/cmake/modules/readme.txt 2013-11-02 02:12:36.000000000 +0000 @@ -1,3 +1,3 @@ -The following modules have been copied from CMake trunk _without_ modifications: - -* FindZLIB.cmake +The following modules have been copied from CMake trunk _without_ modifications: + +* FindZLIB.cmake diff -Nru wireshark-1.12.0~201310251247/configure.ac wireshark-1.12.0~201311020920/configure.ac --- wireshark-1.12.0~201310251247/configure.ac 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/configure.ac 2013-11-02 02:12:36.000000000 +0000 @@ -51,6 +51,7 @@ AM_PROG_CC_C_O AC_PROG_CXX AC_PROG_CPP +AC_PROG_MKDIR_P AC_WIRESHARK_CLANG_CHECK dnl Work around libtool bug (fixed in the version 1.5a?) diff -Nru wireshark-1.12.0~201310251247/debian/changelog wireshark-1.12.0~201311020920/debian/changelog --- wireshark-1.12.0~201310251247/debian/changelog 2013-10-25 08:49:15.000000000 +0000 +++ wireshark-1.12.0~201311020920/debian/changelog 2013-11-02 05:22:06.000000000 +0000 @@ -1,4 +1,4 @@ -wireshark (1.12.0~201310251247-1ppa1~precise) precise; urgency=high +wireshark (1.12.0~201311020920-1ppa1~precise) precise; urgency=high * Autobuild. diff -Nru wireshark-1.12.0~201310251247/doc/README.developer wireshark-1.12.0~201311020920/doc/README.developer --- wireshark-1.12.0~201310251247/doc/README.developer 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/doc/README.developer 2013-11-02 02:12:36.000000000 +0000 @@ -687,7 +687,7 @@ 5. White space convention. -Avoid using tab expansions different from 8 column widths, as not all +Please avoid using tab expansions different from 8 column widths, as not all text editors in use by the developers support this. For a detailed discussion of tabs, spaces, and indentation, see @@ -696,9 +696,9 @@ When creating a new file, you are free to choose an indentation logic. Most of the files in Wireshark tend to use 2-space or 4-space indentation. You are encouraged to write a short comment on the -indentation logic at the beginning of this new file, especially if -you're using non-mod-8 tabs. The tabs-vs-spaces document above provides -examples of Emacs and vi modelines for this purpose. +indentation logic at the beginning of this new files. The +tabs-vs-spaces document above provides examples of Emacs and vi +modelines for this purpose. Please do not leave trailing whitespace (spaces/tabs) on lines. diff -Nru wireshark-1.12.0~201310251247/doc/README.dissector wireshark-1.12.0~201311020920/doc/README.dissector --- wireshark-1.12.0~201310251247/doc/README.dissector 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/doc/README.dissector 2013-11-02 02:12:36.000000000 +0000 @@ -1009,6 +1009,14 @@ This way a filter expression can match a header field, irrespective of the representation of it in the specific protocol context. This is interesting for protocols with variable-width header fields. +Note that the formats used must all belong to the same list as defined below: +- FT_INT8, FT_INT16, FT_INT24 and FT_INT32 +- FT_UINT8, FT_UINT16, FT_UINT24, FT_UINT32, FT_IPXNET and FT_FRAMENUM +- FT_UINT64 and FT_EUI64 +- FT_STRING, FT_STRINGZ and FT_UINT_STRING +- FT_FLOAT and FT_DOUBLE +- FT_BYTES, FT_UINT_BYTES, FT_AX25, FT_ETHER, FT_VINES, FT_OID and FT_REL_OID +- FT_ABSOLUTE_TIME and FT_RELATIVE_TIME The HFILL macro at the end of the struct will set reasonable default values for internally used fields. @@ -1332,7 +1340,7 @@ from the tvbuff by proto_tree_add_item(), based on the type of the field and the encoding of the value as specified by the "encoding" argument. -For FT_NONE, FT_BYTES, FT_ETHER, FT_IPv6, FT_IPXNET, FT_OID, FT_REL_OID +For FT_NONE, FT_BYTES, FT_ETHER, FT_IPv6, FT_IPXNET, FT_OID, FT_REL_OID fields, and 'protocol' fields the encoding is not relevant; the 'encoding' argument should be ENC_NA (Not Applicable). @@ -1506,7 +1514,8 @@ 48-bit MAC address. For proto_tree_add_string(), the 'value_ptr' argument is a pointer to a -text string. +text string; this string must be NULL terminated even if the string in the +TVB is not (as may be the case with FT_STRINGs). For proto_tree_add_boolean(), the 'value' argument is a 32-bit integer. It is masked and shifted as defined by the field info after which zero diff -Nru wireshark-1.12.0~201310251247/doc/README.python wireshark-1.12.0~201311020920/doc/README.python --- wireshark-1.12.0~201310251247/doc/README.python 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/doc/README.python 2013-11-02 02:12:36.000000000 +0000 @@ -9,7 +9,7 @@ DESCRIPTION # wspy_dissector.py # - # $Id: $ + # $Id$ # # Wireshark Protocol Python Binding # diff -Nru wireshark-1.12.0~201310251247/doc/README.request_response_tracking wireshark-1.12.0~201311020920/doc/README.request_response_tracking --- wireshark-1.12.0~201310251247/doc/README.request_response_tracking 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/doc/README.request_response_tracking 2013-11-02 02:12:36.000000000 +0000 @@ -33,14 +33,14 @@ management. #include - #include + #include Then we also need a few header fields to show the relations between request and response as well as the response time. static int hf_pana_response_in = -1; static int hf_pana_response_to = -1; - static int hf_pana_time = -1; + static int hf_pana_response_time = -1; We need a structure that holds all the information we need to remember between the request and the responses. One such structure will be allocated @@ -68,7 +68,7 @@ around. typedef struct _pana_conv_info_t { - emem_tree_t *pdus; + wmem_tree_t *pdus; } pana_conv_info_t; Finally for the meat of it, add the conversation and tracking code to the @@ -100,32 +100,31 @@ * No. Attach that information to the conversation, and add * it to the list of information structures. */ - pana_info = se_alloc(sizeof(pana_conv_info_t)); - pana_info->pdus = se_tree_create_non_persistent( - EMEM_TREE_TYPE_RED_BLACK, "pana_pdus"); + pana_info = wmem_new(wmem_file_scope(), pana_conv_info_t); + pana_info->pdus=wmem_tree_new(wmem_file_scope()); conversation_add_proto_data(conversation, proto_pana, pana_info); } if (!pinfo->fd->flags.visited) { if (flags&PANA_FLAG_R) { /* This is a request */ - pana_trans = se_alloc(sizeof(pana_transaction_t)); + pana_trans=wmem_new(wmem_file_scope(), pana_transaction_t); pana_trans->req_frame = pinfo->fd->num; pana_trans->rep_frame = 0; pana_trans->req_time = pinfo->fd->abs_ts; - se_tree_insert32(pana_info->pdus, seq_num, (void *)pana_trans); + wmem_tree_insert32(pana_info->pdus, seq_num, (void *)pana_trans); } else { - pana_trans = se_tree_lookup32(pana_info->pdus, seq_num); + pana_trans=(pana_transaction_t *)wmem_tree_lookup32(pana_info->pdus, seq_num); if (pana_trans) { pana_trans->rep_frame = pinfo->fd->num; } } } else { - pana_trans = se_tree_lookup32(pana_info->pdus, seq_num); + pana_trans=(pana_transaction_t *)wmem_tree_lookup32(pana_info->pdus, seq_num); } if (!pana_trans) { /* create a "fake" pana_trans structure */ - pana_trans = ep_alloc(sizeof(pana_transaction_t)); + pana_trans=wmem_new(wmem_packet_scope(), pana_transaction_t); pana_trans->req_frame = 0; pana_trans->rep_frame = 0; pana_trans->req_time = pinfo->fd->abs_ts; @@ -152,7 +151,7 @@ PROTO_ITEM_SET_GENERATED(it); nstime_delta(&ns, &pinfo->fd->abs_ts, &pana_trans->req_time); - it = proto_tree_add_time(pana_tree, hf_pana_time, tvb, 0, 0, &ns); + it = proto_tree_add_time(pana_tree, hf_pana_response_time, tvb, 0, 0, &ns); PROTO_ITEM_SET_GENERATED(it); } } @@ -161,16 +160,16 @@ { &hf_pana_response_in, { "Response In", "pana.response_in", - FT_FRAMENUM, BASE_DEC, NULL, 0x0, + FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The response to this PANA request is in this frame", HFILL } }, { &hf_pana_response_to, { "Request In", "pana.response_to", - FT_FRAMENUM, BASE_DEC, NULL, 0x0, + FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This is a response to the PANA request in this frame", HFILL } }, - { &hf_pana_time, - { "Time", "pana.time", + { &hf_pana_response_time, + { "Response Time", "pana.response_time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "The time between the Call and the Reply", HFILL } }, diff -Nru wireshark-1.12.0~201310251247/docbook/CMakeLists.txt wireshark-1.12.0~201311020920/docbook/CMakeLists.txt --- wireshark-1.12.0~201310251247/docbook/CMakeLists.txt 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/docbook/CMakeLists.txt 2013-11-02 02:12:36.000000000 +0000 @@ -222,11 +222,6 @@ ${WSDG_GRAPHICS} ) -set(RELEASE_NOTES_SOURCE - release-notes.xml - svn_version.xml -) - set(WSLUA_MODULES ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_dumper.c ${CMAKE_SOURCE_DIR}/epan/wslua/wslua_field.c @@ -243,6 +238,7 @@ find_package( LYNX ) find_package( XSLTPROC ) find_package( XMLLINT ) +find_package( ASCIIDOC ) ADD_CUSTOM_COMMAND( OUTPUT @@ -349,6 +345,52 @@ # release_notes: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf +add_custom_target( + release_notes ALL + DEPENDS + release-notes.html + release-notes.txt + release-notes-a4.pdf + release-notes-us.pdf + ${CMAKE_SOURCE_DIR}/NEWS +) + +ADD_CUSTOM_COMMAND( + OUTPUT + ${CMAKE_SOURCE_DIR}/NEWS + COMMAND cp + ${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt + ${CMAKE_SOURCE_DIR}/NEWS + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt +) + +ASCIIDOC2HTML( + release-notes.html + release-notes.asciidoc + asciidoc.conf +) + +ASCIIDOC2TXT( + release-notes.txt + release-notes.asciidoc + asciidoc.conf +) + +ASCIIDOC2PDF( + release-notes-a4.pdf + release-notes.asciidoc + asciidoc.conf + A4 +) + +ASCIIDOC2PDF( + release-notes-us.pdf + release-notes.asciidoc + asciidoc.conf + letter +) + # wsluarm ADD_CUSTOM_COMMAND( OUTPUT diff -Nru wireshark-1.12.0~201310251247/docbook/asciidoc.conf wireshark-1.12.0~201311020920/docbook/asciidoc.conf --- wireshark-1.12.0~201310251247/docbook/asciidoc.conf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/docbook/asciidoc.conf 2013-11-02 02:12:36.000000000 +0000 @@ -32,7 +32,7 @@ {0=Bug} {target} [ws-salink-inlinemacro] -{0=}wnpa-sec-{target} +{0=}wnpa-sec-{target} [cve-idlink-inlinemacro] CVE-{target} @@ -46,7 +46,7 @@ {0=Bug} {target} [ws-salink-inlinemacro] -{0=}wnpa-sec-{target} +{0=}wnpa-sec-{target} [cve-idlink-inlinemacro] CVE-{target} diff -Nru wireshark-1.12.0~201310251247/docbook/release-notes.asciidoc wireshark-1.12.0~201311020920/docbook/release-notes.asciidoc --- wireshark-1.12.0~201310251247/docbook/release-notes.asciidoc 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/docbook/release-notes.asciidoc 2013-11-02 02:12:36.000000000 +0000 @@ -66,12 +66,14 @@ MBIM MiNT MP4 / ISOBMFF file format +NXP PN532 HCI OpenFlow Picture Transfer Protocol Over IP SEL RTAC (Real Time Automation Controller) EIA-232 Serial-Line Dissection Sippy RTPproxy STANAG 4607 STANAG 5066 SIS +Tinkerforge UDT URL Encoded Form Data Wi-Fi Display diff -Nru wireshark-1.12.0~201310251247/echld/Makefile.am wireshark-1.12.0~201311020920/echld/Makefile.am --- wireshark-1.12.0~201310251247/echld/Makefile.am 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/echld/Makefile.am 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Makefile.am # -# $Id: Makefile.am 48716 2013-04-03 07:38:44Z guy $ +# $Id$ # # Wireshark - Network traffic analyzer # By Gerald Combs diff -Nru wireshark-1.12.0~201310251247/echld/Makefile.common wireshark-1.12.0~201311020920/echld/Makefile.common --- wireshark-1.12.0~201310251247/echld/Makefile.common 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/echld/Makefile.common 2013-11-02 02:12:36.000000000 +0000 @@ -3,7 +3,7 @@ # a) common to both files and # b) portable between both files # -# $Id: Makefile.common 47104 2013-01-15 21:54:41Z guy $ +# $Id$ # # Wireshark - Network traffic analyzer # By Gerald Combs diff -Nru wireshark-1.12.0~201310251247/echld/Makefile.nmake wireshark-1.12.0~201311020920/echld/Makefile.nmake --- wireshark-1.12.0~201310251247/echld/Makefile.nmake 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/echld/Makefile.nmake 2013-11-02 02:12:36.000000000 +0000 @@ -1,7 +1,7 @@ ## Makefile for building wireshark.exe with Microsoft C and nmake ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake # -# $Id: Makefile.nmake 47938 2013-02-28 14:09:46Z rbalint $ +# $Id$ include ..\config.nmake include diff -Nru wireshark-1.12.0~201310251247/editcap.c wireshark-1.12.0~201311020920/editcap.c --- wireshark-1.12.0~201310251247/editcap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/editcap.c 2013-11-02 02:12:36.000000000 +0000 @@ -276,29 +276,34 @@ if (++max_selected >= MAX_SELECTIONS) { /* Let the user know we stopped selecting */ - printf("Out of room for packet selections!\n"); + fprintf(stderr, "Out of room for packet selections!\n"); return(FALSE); } - printf("Add_Selected: %s\n", sel); + if (verbose) + fprintf(stderr, "Add_Selected: %s\n", sel); if ((locn = strchr(sel, '-')) == NULL) { /* No dash, so a single number? */ - printf("Not inclusive ..."); + if (verbose) + fprintf(stderr, "Not inclusive ..."); selectfrm[max_selected].inclusive = 0; selectfrm[max_selected].first = atoi(sel); - printf(" %i\n", selectfrm[max_selected].first); + if (verbose) + fprintf(stderr, " %i\n", selectfrm[max_selected].first); } else { - printf("Inclusive ..."); + if (verbose) + fprintf(stderr, "Inclusive ..."); next = locn + 1; selectfrm[max_selected].inclusive = 1; selectfrm[max_selected].first = atoi(sel); selectfrm[max_selected].second = atoi(next); - printf(" %i, %i\n", selectfrm[max_selected].first, - selectfrm[max_selected].second); + if (verbose) + fprintf(stderr, " %i, %i\n", selectfrm[max_selected].first, + selectfrm[max_selected].second); } return(TRUE); @@ -1120,7 +1125,7 @@ } #ifdef DEBUG - printf("Optind = %i, argc = %i\n", optind, argc); + fprintf(stderr, "Optind = %i, argc = %i\n", optind, argc); #endif if ((argc - optind) < 1) { @@ -1300,7 +1305,7 @@ || (selected(count) && keep_em))) { if (verbose && !dup_detect && !dup_detect_by_time) - printf("Packet: %u\n", count); + fprintf(stderr, "Packet: %u\n", count); /* We simply write it, perhaps after truncating it; we could * do other things, like modify it. */ diff -Nru wireshark-1.12.0~201310251247/epan/CMakeLists.txt wireshark-1.12.0~201311020920/epan/CMakeLists.txt --- wireshark-1.12.0~201310251247/epan/CMakeLists.txt 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/CMakeLists.txt 2013-11-02 02:12:36.000000000 +0000 @@ -1065,6 +1065,7 @@ dissectors/packet-rfid-felica.c dissectors/packet-rfid-mifare.c dissectors/packet-rfid-pn532.c + dissectors/packet-rfid-pn532-hci.c dissectors/packet-rgmp.c dissectors/packet-rip.c dissectors/packet-ripng.c @@ -1199,6 +1200,7 @@ dissectors/packet-telnet.c dissectors/packet-teredo.c dissectors/packet-text-media.c + dissectors/packet-tfp.c dissectors/packet-tftp.c dissectors/packet-time.c dissectors/packet-tipc.c @@ -1671,6 +1673,8 @@ ) endif() +add_definitions( -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\" ) + # # Editor modelines - http://www.wireshark.org/tools/modelines.html # diff -Nru wireshark-1.12.0~201310251247/epan/Makefile.am wireshark-1.12.0~201311020920/epan/Makefile.am --- wireshark-1.12.0~201310251247/epan/Makefile.am 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/Makefile.am 2013-11-02 02:12:36.000000000 +0000 @@ -62,7 +62,8 @@ AM_CPPFLAGS = -I$(srcdir)/.. -I$(srcdir)/$(LEMON) -I$(builddir)/wslua \ @LUA_INCLUDES@ $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) \ - $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) $(PY_CFLAGS) + $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) $(PY_CFLAGS) \ + -DTOP_SRCDIR=\"$(abs_top_srcdir)\" AM_NON_GENERATED_CFLAGS =-DWS_BUILD_DLL diff -Nru wireshark-1.12.0~201310251247/epan/circuit.c wireshark-1.12.0~201311020920/epan/circuit.c --- wireshark-1.12.0~201310251247/epan/circuit.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/circuit.c 2013-11-02 02:12:36.000000000 +0000 @@ -293,7 +293,7 @@ */ gboolean try_circuit_dissector(circuit_type ctype, guint32 circuit_id, guint32 frame, - tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) + tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { circuit_t *circuit; @@ -302,8 +302,8 @@ if (circuit != NULL) { if (circuit->dissector_handle == NULL) return FALSE; - call_dissector(circuit->dissector_handle, tvb, pinfo, - tree); + call_dissector_with_data(circuit->dissector_handle, tvb, pinfo, + tree, data); return TRUE; } return FALSE; diff -Nru wireshark-1.12.0~201310251247/epan/circuit.h wireshark-1.12.0~201311020920/epan/circuit.h --- wireshark-1.12.0~201310251247/epan/circuit.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/circuit.h 2013-11-02 02:12:36.000000000 +0000 @@ -99,7 +99,7 @@ */ extern gboolean try_circuit_dissector(circuit_type ctype, guint32 circuit_id, guint32 frame, - tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); + tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data); #ifdef __cplusplus } diff -Nru wireshark-1.12.0~201310251247/epan/column-utils.c wireshark-1.12.0~201311020920/epan/column-utils.c --- wireshark-1.12.0~201310251247/epan/column-utils.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/column-utils.c 2013-11-02 02:12:36.000000000 +0000 @@ -1813,11 +1813,6 @@ col_set_port(pinfo, i, FALSE, FALSE, fill_col_exprs); break; - case COL_VSAN: - guint32_to_str_buf(pinfo->vsan, pinfo->cinfo->col_buf[i], COL_MAX_LEN); - pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i]; - break; - case NUM_COL_FMTS: /* keep compiler happy - shouldn't get here */ g_assert_not_reached(); break; @@ -2025,13 +2020,13 @@ set_circuit_id(pinfo); break; case COL_SRCIDX: - fdata->col_text[i] = (gchar *)(GUINT_TO_POINTER((guint)pinfo->src_idx)); + fdata->col_text[i] = (gchar *)-1; /* !! DEPRECATED !!*/ break; case COL_DSTIDX: - fdata->col_text[i] = (gchar *)(GUINT_TO_POINTER((guint)pinfo->dst_idx)); + fdata->col_text[i] = (gchar *)-1; /* !! DEPRECATED !!*/ break; case COL_VSAN: - fdata->col_text[i] = (gchar *)(GUINT_TO_POINTER((guint)pinfo->vsan)); + fdata->col_text[i] = (gchar *)-1; /* !! DEPRECATED !!*/ break; case NUM_COL_FMTS: /* keep compiler happy - shouldn't get here */ diff -Nru wireshark-1.12.0~201310251247/epan/column.c wireshark-1.12.0~201311020920/epan/column.c --- wireshark-1.12.0~201310251247/epan/column.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/column.c 2013-11-02 02:12:36.000000000 +0000 @@ -48,9 +48,9 @@ "%Yt", /* 1) COL_ABS_DATE_TIME */ "%At", /* 2) COL_ABS_TIME */ "%c", /* 3) COL_CIRCUIT_ID */ - "%Xd", /* 4) COL_DSTIDX */ - "%Xs", /* 5) COL_SRCIDX */ - "%V", /* 6) COL_VSAN */ + "%Xd", /* 4) COL_DSTIDX - !! DEPRECATED !!*/ + "%Xs", /* 5) COL_SRCIDX - !! DEPRECATED !!*/ + "%V", /* 6) COL_VSAN - !! DEPRECATED !!*/ "%B", /* 7) COL_CUMULATIVE_BYTES */ "%Cus", /* 8) COL_CUSTOM */ "%y", /* 9) COL_DCE_CALL */ @@ -525,7 +525,7 @@ break; case COL_SRCIDX: case COL_DSTIDX: - return "0000000"; + return "00000000"; break; case COL_VSAN: return "000000"; diff -Nru wireshark-1.12.0~201310251247/epan/conversation.c wireshark-1.12.0~201311020920/epan/conversation.c --- wireshark-1.12.0~201310251247/epan/conversation.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/conversation.c 2013-11-02 02:12:36.000000000 +0000 @@ -1254,7 +1254,7 @@ gboolean try_conversation_dissector(const address *addr_a, const address *addr_b, const port_type ptype, const guint32 port_a, const guint32 port_b, tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree) + proto_tree *tree, void* data) { conversation_t *conversation; @@ -1266,7 +1266,7 @@ if (conversation->dissector_handle == NULL) return FALSE; ret=call_dissector_only(conversation->dissector_handle, tvb, pinfo, - tree, NULL); + tree, data); if(!ret) { /* this packet was rejected by the dissector * so return FALSE in case our caller wants diff -Nru wireshark-1.12.0~201310251247/epan/conversation.h wireshark-1.12.0~201311020920/epan/conversation.h --- wireshark-1.12.0~201310251247/epan/conversation.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/conversation.h 2013-11-02 02:12:36.000000000 +0000 @@ -176,7 +176,7 @@ extern gboolean try_conversation_dissector(const address *addr_a, const address *addr_b, const port_type ptype, const guint32 port_a, const guint32 port_b, tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree); + proto_tree *tree, void* data); /* These routines are used to set undefined values for a conversation */ diff -Nru wireshark-1.12.0~201310251247/epan/dfilter/dfilter-macro.c wireshark-1.12.0~201311020920/epan/dfilter/dfilter-macro.c --- wireshark-1.12.0~201310251247/epan/dfilter/dfilter-macro.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dfilter/dfilter-macro.c 2013-11-02 02:12:36.000000000 +0000 @@ -408,7 +408,7 @@ if (m == &(macros[i])) continue; if ( g_str_equal(m->name,macros[i].name) ) { - *error = ep_strdup_printf("macro '%s' exists already", m->name); + *error = g_strdup_printf("macro '%s' exists already", m->name); m->usable = FALSE; return; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/Makefile.common wireshark-1.12.0~201311020920/epan/dissectors/Makefile.common --- wireshark-1.12.0~201310251247/epan/dissectors/Makefile.common 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/Makefile.common 2013-11-02 02:12:36.000000000 +0000 @@ -993,6 +993,7 @@ packet-rfid-felica.c \ packet-rfid-mifare.c \ packet-rfid-pn532.c \ + packet-rfid-pn532-hci.c \ packet-rgmp.c \ packet-rip.c \ packet-ripng.c \ @@ -1126,6 +1127,7 @@ packet-telnet.c \ packet-teredo.c \ packet-text-media.c \ + packet-tfp.c \ packet-tftp.c \ packet-time.c \ packet-tipc.c \ @@ -1630,7 +1632,6 @@ packet-zbee-zdp.h \ packet-zep.h \ packet-ziop.h \ - rpc_defrag.h \ $(GENERATED_HEADER_FILES) \ $(CUSTOM_HEADER_FILES) diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/file-elf.c wireshark-1.12.0~201311020920/epan/dissectors/file-elf.c --- wireshark-1.12.0~201310251247/epan/dissectors/file-elf.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/file-elf.c 2013-11-02 02:12:36.000000000 +0000 @@ -6,6 +6,7 @@ * http://refspecs.linuxfoundation.org/ * http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html * http://dwarfstd.org/doc/DWARF4.pdf + * http://www.sco.com/developers/devspecs/ * * Copyright 2013, Michal Labedzki for Tieto Corporation * @@ -19,7 +20,7 @@ * 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. - *http://www.sco.com/developers/devspecs/ + * * 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 @@ -641,7 +642,8 @@ return 0; } -static const guint8 *get_section_name_offset(tvbuff_t *tvb, guint64 shoff, guint16 shnum, guint16 shentsize, guint16 shndx, guint64 shstrtab_offset, guint machine_encoding) +static const guint8 * +get_section_name_offset(tvbuff_t *tvb, guint64 shoff, guint16 shnum, guint16 shentsize, guint16 shndx, guint64 shstrtab_offset, guint machine_encoding) { gint offset; guint32 sh_name; @@ -654,6 +656,7 @@ return tvb_get_const_stringz(tvb, value_guard(shstrtab_offset + sh_name), NULL); } +#define MAX_TAG_TO_TYPE 34 static gint dissect_dynamic(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *entry_tree, proto_item *entry_item, gint offset, gint register_size, guint machine_encoding) @@ -666,7 +669,7 @@ }; guint64 tag; - static const enum enum_tag_type tag_to_type[34] = { + static const enum enum_tag_type tag_to_type[MAX_TAG_TO_TYPE] = { DYNAMIC_TYPE_IGNORED, DYNAMIC_TYPE_VALUE, DYNAMIC_TYPE_VALUE, @@ -708,11 +711,11 @@ tag = (machine_encoding == ENC_BIG_ENDIAN) ? tvb_get_ntohl(tvb, offset) : tvb_get_letohl(tvb, offset); offset += 4; - if (tag < sizeof(tag_to_type) && tag_to_type[tag] == DYNAMIC_TYPE_VALUE) + if (tag < MAX_TAG_TO_TYPE && tag_to_type[tag] == DYNAMIC_TYPE_VALUE) proto_tree_add_item(entry_tree, hf_elf_dynamic_value, tvb, offset, 4, machine_encoding); - else if (tag < sizeof(tag_to_type) && tag_to_type[tag] == DYNAMIC_TYPE_POINTER) + else if (tag < MAX_TAG_TO_TYPE && tag_to_type[tag] == DYNAMIC_TYPE_POINTER) proto_tree_add_item(entry_tree, hf_elf_dynamic_pointer, tvb, offset, 4, machine_encoding); - else if (tag < sizeof(tag_to_type) && tag_to_type[tag] == DYNAMIC_TYPE_IGNORED) + else if (tag < MAX_TAG_TO_TYPE && tag_to_type[tag] == DYNAMIC_TYPE_IGNORED) proto_tree_add_item(entry_tree, hf_elf_dynamic_ignored, tvb, offset, 4, machine_encoding); else proto_tree_add_item(entry_tree, hf_elf_dynamic_unspecified, tvb, offset, 4, machine_encoding); @@ -1258,7 +1261,7 @@ proto_tree_add_item(header_tree, hf_elf_shstrndx, tvb, offset, 2, machine_encoding); shstrndx = (machine_encoding == ENC_BIG_ENDIAN) ? tvb_get_ntohs(tvb, offset) : tvb_get_letohs(tvb, offset); - offset += 2; + /*offset += 2;*/ program_header_item = proto_tree_add_text(main_tree, tvb, value_guard(phoff), phnum * phentsize, "Program Header Table [%d entries]", phnum); @@ -1387,8 +1390,7 @@ name = wmem_strdup_printf(wmem_packet_scope(), "ProgramHeaderEntry #%u", phnum - i_16 - 1); - segment_item = proto_tree_add_text(ph_entry_tree, tvb, - value_guard(p_offset), value_guard(segment_size), "Segment"); + proto_tree_add_text(ph_entry_tree, tvb, value_guard(p_offset), value_guard(segment_size), "Segment"); file_size += segment_size; @@ -1410,9 +1412,6 @@ offset += 4; - sh_type = (machine_encoding == ENC_BIG_ENDIAN) ? - tvb_get_ntohl(tvb, offset) : tvb_get_letohl(tvb, offset); - offset += 4; length = shoff + shstrndx * shentsize + 2 * 4 + 2 * register_size; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-acse.c wireshark-1.12.0~201311020920/epan/dissectors/packet-acse.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-acse.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-acse.c 2013-11-02 02:12:36.000000000 +0000 @@ -362,7 +362,7 @@ static int dissect_acse_T_single_ASN1_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 88 "../../asn1/acse/acse.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree ? top_tree : tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree ? top_tree : tree, NULL); @@ -374,7 +374,7 @@ static int dissect_acse_T_octet_aligned(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 91 "../../asn1/acse/acse.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree ? top_tree : tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree ? top_tree : tree, NULL); @@ -680,7 +680,7 @@ static int dissect_acse_T_other_mechanism_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 49 "../../asn1/acse/acse.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree, NULL); @@ -960,7 +960,7 @@ static int dissect_acse_AARQ_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 94 "../../asn1/acse/acse.cnf" - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "A-Associate-Request"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "A-Associate-Request"); offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 0, TRUE, dissect_acse_AARQ_apdu_U); @@ -1192,7 +1192,7 @@ static int dissect_acse_AARE_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 99 "../../asn1/acse/acse.cnf" - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "A-Associate-Response"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "A-Associate-Response"); offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 1, TRUE, dissect_acse_AARE_apdu_U); @@ -1251,7 +1251,7 @@ static int dissect_acse_RLRQ_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 104 "../../asn1/acse/acse.cnf" - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Release-Request"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Release-Request"); offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 2, TRUE, dissect_acse_RLRQ_apdu_U); @@ -1310,7 +1310,7 @@ static int dissect_acse_RLRE_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 120 "../../asn1/acse/acse.cnf" - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Release-Response"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Release-Response"); offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 3, TRUE, dissect_acse_RLRE_apdu_U); @@ -1389,7 +1389,7 @@ static int dissect_acse_ABRT_apdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 136 "../../asn1/acse/acse.cnf" - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Abort"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Abort"); offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 4, TRUE, dissect_acse_ABRT_apdu_U); @@ -1754,7 +1754,7 @@ "Invalid OID: %s", ACSE_APDU_OID); THROW(ReportedBoundsError); } - call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree); + call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree, NULL); } else { proto_tree_add_expert(parent_tree, pinfo, &ei_acse_dissector_not_available, tvb, offset, -1); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ansi_637.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ansi_637.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ansi_637.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ansi_637.c 2013-11-02 02:12:36.000000000 +0000 @@ -205,7 +205,6 @@ static char gsm_637_bigbuf[1024]; static char ia5_637_bigbuf[1024]; static dissector_table_t tele_dissector_table; -static packet_info *g_pinfo; static proto_tree *g_tree; /* FUNCTIONS */ @@ -322,7 +321,7 @@ } static void -tele_param_msg_id(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_msg_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data) { EXACT_DATA_CHECK(len, 3); @@ -332,7 +331,7 @@ proto_tree_add_item(tree, hf_ansi_637_tele_msg_ind, tvb, offset, 3, ENC_BIG_ENDIAN); if ((tvb_get_guint8(tvb, offset+2) & 0x08) == 0x08) { - g_pinfo->private_data = GUINT_TO_POINTER((guint) TRUE); + *has_private_data = TRUE; } proto_tree_add_item(tree, hf_ansi_637_tele_msg_rsvd, tvb, offset, 3, ENC_BIG_ENDIAN); @@ -340,7 +339,7 @@ /* Adamek Jan - IS637C Message status decoding procedure */ static void -tele_param_msg_status(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_msg_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { /* Declare some variables */ guint8 oct; @@ -439,7 +438,7 @@ static void -tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data) { guint8 oct, oct2; guint8 encoding; @@ -570,7 +569,7 @@ saved_offset = offset - 1; i = num_fields * 7; required_octs = (i / 8) + ((i % 8) ? 1 : 0); - buf = (gchar*)wmem_alloc(g_pinfo->pool, required_octs); + buf = (gchar*)wmem_alloc(pinfo->pool, required_octs); for (i=0; i < required_octs; i++) { oct = tvb_get_guint8(tvb, saved_offset); @@ -579,10 +578,10 @@ saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, required_octs, required_octs); - add_new_data_source(g_pinfo, tvb_out, "Characters"); + add_new_data_source(pinfo, tvb_out, "Characters"); offset = 0; bit = 0; - if (g_pinfo->private_data && (GPOINTER_TO_UINT(g_pinfo->private_data) == TRUE)) { + if (*has_private_data == TRUE) { dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, TRUE, &bit); } @@ -632,7 +631,7 @@ saved_offset = offset - 1; i = num_fields * 7; required_octs = (i / 8) + ((i % 8) ? 1 : 0); - buf = (gchar*)wmem_alloc(g_pinfo->pool, required_octs); + buf = (gchar*)wmem_alloc(pinfo->pool, required_octs); for (i=0; i < required_octs; i++) { oct = tvb_get_guint8(tvb, saved_offset); @@ -641,10 +640,10 @@ saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, required_octs, required_octs); - add_new_data_source(g_pinfo, tvb_out, "Characters"); + add_new_data_source(pinfo, tvb_out, "Characters"); offset = 0; bit = 0; - if (g_pinfo->private_data && (GPOINTER_TO_UINT(g_pinfo->private_data) == TRUE)) { + if (*has_private_data == TRUE) { dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, TRUE, &bit); } saved_offset = offset; @@ -662,7 +661,7 @@ { saved_offset = offset - 1; required_octs = 2*num_fields; - buf = (gchar*)wmem_alloc(g_pinfo->pool, required_octs); + buf = (gchar*)wmem_alloc(pinfo->pool, required_octs); for (i=0; i < required_octs; i++) { oct = tvb_get_guint8(tvb, saved_offset); @@ -671,9 +670,9 @@ saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, required_octs, required_octs); - add_new_data_source(g_pinfo, tvb_out, "Characters"); + add_new_data_source(pinfo, tvb_out, "Characters"); offset = 0; - if (g_pinfo->private_data && (GPOINTER_TO_UINT(g_pinfo->private_data) == TRUE)) { + if (*has_private_data == TRUE) { dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, FALSE, &bit); } @@ -697,7 +696,7 @@ else if (encoding == 0x07)/* Latin/Hebrew */ { saved_offset = offset - 1; - buf = (gchar*)wmem_alloc(g_pinfo->pool, num_fields); + buf = (gchar*)wmem_alloc(pinfo->pool, num_fields); for (i=0; i < num_fields; i++) { oct = tvb_get_guint8(tvb, saved_offset); @@ -706,10 +705,10 @@ saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, num_fields, num_fields); - add_new_data_source(g_pinfo, tvb_out, "Characters"); + add_new_data_source(pinfo, tvb_out, "Characters"); offset = 0; required_octs = len - used; - if (g_pinfo->private_data && (GPOINTER_TO_UINT(g_pinfo->private_data) == TRUE)) { + if (*has_private_data == TRUE) { dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, FALSE, &bit); } @@ -733,7 +732,7 @@ else if (encoding == 0x08) /* ISO 8859-1 (a/k/a ISO Latin 1) */ { saved_offset = offset - 1; - buf = (gchar*)wmem_alloc(g_pinfo->pool, num_fields); + buf = (gchar*)wmem_alloc(pinfo->pool, num_fields); for (i=0; i < num_fields; i++) { oct = tvb_get_guint8(tvb, saved_offset); @@ -742,10 +741,10 @@ saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, num_fields, num_fields); - add_new_data_source(g_pinfo, tvb_out, "Characters"); + add_new_data_source(pinfo, tvb_out, "Characters"); offset = 0; required_octs = len - used; - if (g_pinfo->private_data && (GPOINTER_TO_UINT(g_pinfo->private_data) == TRUE)) { + if (*has_private_data == TRUE) { dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, FALSE, &bit); } @@ -783,7 +782,7 @@ saved_offset = offset - 1; i = num_fields * 7; required_octs = (i / 8) + ((i % 8) ? 1 : 0); - buf = (gchar*)wmem_alloc(g_pinfo->pool, required_octs); + buf = (gchar*)wmem_alloc(pinfo->pool, required_octs); for (i=0; i < required_octs; i++) { oct = tvb_get_guint8(tvb, saved_offset); @@ -792,10 +791,10 @@ saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, required_octs, required_octs); - add_new_data_source(g_pinfo, tvb_out, "Characters"); + add_new_data_source(pinfo, tvb_out, "Characters"); offset = 0; bit = 0; - if (g_pinfo->private_data && (GPOINTER_TO_UINT(g_pinfo->private_data) == TRUE)) { + if (*has_private_data == TRUE) { dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, TRUE, &bit); } @@ -814,7 +813,7 @@ } static void -tele_param_rsp_code(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_rsp_code(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct; @@ -831,7 +830,7 @@ } static void -tele_param_timestamp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_timestamp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct, oct2, oct3; @@ -867,7 +866,7 @@ } static void -tele_param_rel_timestamp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_rel_timestamp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct; guint32 value = 0; @@ -914,7 +913,7 @@ }; static void -tele_param_pri_ind(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_pri_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct; const gchar *str = NULL; @@ -938,7 +937,7 @@ } static void -tele_param_priv_ind(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_priv_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct; const gchar *str = NULL; @@ -968,7 +967,7 @@ } static void -tele_param_reply_opt(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_reply_opt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct; @@ -995,7 +994,7 @@ } static void -tele_param_num_messages(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_num_messages(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct; @@ -1010,7 +1009,7 @@ } static void -tele_param_alert(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_alert(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct; const gchar *str = NULL; @@ -1040,7 +1039,7 @@ } static void -tele_param_lang_ind(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_lang_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct; const gchar *str = NULL; @@ -1067,7 +1066,7 @@ } static void -tele_param_cb_num(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_cb_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct, oct2, num_fields, odd; guint32 saved_offset; @@ -1205,7 +1204,7 @@ } static void -tele_param_disp_mode(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) +tele_param_disp_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data _U_) { guint8 oct; const gchar *str = NULL; @@ -1236,7 +1235,7 @@ #define NUM_TELE_PARAM (sizeof(ansi_tele_param_strings)/sizeof(value_string)) static gint ett_ansi_637_tele_param[NUM_TELE_PARAM]; -static void (*ansi_637_tele_param_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) = { +static void (*ansi_637_tele_param_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len, guint32 offset, gboolean* has_private_data) = { tele_param_msg_id, /* Message Identifier */ tele_param_user_data, /* User Data */ tele_param_rsp_code, /* User Response Code */ @@ -1258,7 +1257,7 @@ }; static void -trans_param_tele_id(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) +trans_param_tele_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) { guint32 value; const gchar *str = NULL; @@ -1337,7 +1336,7 @@ } static void -trans_param_srvc_cat(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) +trans_param_srvc_cat(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) { guint32 value; const gchar *str = NULL; @@ -1355,7 +1354,7 @@ } static void -trans_param_address(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string _U_, int string_len _U_) +trans_param_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gchar *add_string _U_, int string_len _U_) { guint8 oct, oct2, num_fields, odd; gboolean email_addr; @@ -1629,7 +1628,7 @@ } static void -trans_param_subaddress(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string _U_, int string_len _U_) +trans_param_subaddress(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gchar *add_string _U_, int string_len _U_) { guint8 oct, oct2, num_fields; guint32 i; @@ -1720,7 +1719,7 @@ } static void -trans_param_bearer_reply_opt(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 offset, gchar *add_string, int string_len) +trans_param_bearer_reply_opt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len _U_, guint32 offset, gchar *add_string, int string_len) { guint8 oct; @@ -1741,7 +1740,7 @@ } static void -trans_param_cause_codes(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) +trans_param_cause_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) { guint8 oct; const gchar *str = NULL; @@ -1829,7 +1828,7 @@ } static void -trans_param_bearer_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string _U_, int string_len _U_) +trans_param_bearer_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len, guint32 offset, gchar *add_string _U_, int string_len _U_) { tvbuff_t *tele_tvb; @@ -1842,12 +1841,12 @@ tele_tvb = tvb_new_subset(tvb, offset, len, len); dissector_try_uint(tele_dissector_table, ansi_637_trans_tele_id, - tele_tvb, g_pinfo, g_tree); + tele_tvb, pinfo, g_tree); } #define NUM_TRANS_PARAM (sizeof(ansi_trans_param_strings)/sizeof(value_string)) static gint ett_ansi_637_trans_param[NUM_TRANS_PARAM]; -static void (*ansi_637_trans_param_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) = { +static void (*ansi_637_trans_param_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) = { trans_param_tele_id, /* Teleservice Identifier */ trans_param_srvc_cat, /* Service Category */ trans_param_address, /* Originating Address */ @@ -1866,9 +1865,9 @@ /* GENERIC IS-637 DISSECTOR FUNCTIONS */ static gboolean -dissect_ansi_637_tele_param(tvbuff_t *tvb, proto_tree *tree, guint32 *offset) +dissect_ansi_637_tele_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 *offset, gboolean* has_private_data) { - void (*param_fcn)(tvbuff_t *, proto_tree *, guint, guint32) = NULL; + void (*param_fcn)(tvbuff_t *, packet_info *, proto_tree *, guint, guint32, gboolean*) = NULL; guint8 oct; guint8 len; guint32 curr_offset; @@ -1919,7 +1918,7 @@ } else { - (*param_fcn)(tvb, subtree, len, curr_offset); + (*param_fcn)(tvb, pinfo, subtree, len, curr_offset, has_private_data); } curr_offset += len; @@ -1931,7 +1930,7 @@ } static void -dissect_ansi_637_tele_message(tvbuff_t *tvb, proto_tree *ansi_637_tree) +dissect_ansi_637_tele_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ansi_637_tree, gboolean* has_private_data) { guint8 len; guint32 curr_offset; @@ -1941,7 +1940,7 @@ while ((len - curr_offset) > 0) { - if (!dissect_ansi_637_tele_param(tvb, ansi_637_tree, &curr_offset)) + if (!dissect_ansi_637_tele_param(tvb, pinfo, ansi_637_tree, &curr_offset, has_private_data)) { proto_tree_add_text(ansi_637_tree, tvb, curr_offset, len - curr_offset, "Unknown Parameter Data"); @@ -1957,7 +1956,7 @@ proto_tree *ansi_637_tree = NULL; const gchar *str = NULL; guint32 value; - void *pd_save; + gboolean has_private_data = FALSE; col_set_str(pinfo->cinfo, COL_PROTOCOL, ansi_proto_name_short); @@ -1966,9 +1965,6 @@ */ if (tree) { - pd_save = pinfo->private_data; - pinfo->private_data = NULL; - g_pinfo = pinfo; g_tree = tree; value = pinfo->match_uint; @@ -2054,15 +2050,14 @@ ansi_637_tree = proto_item_add_subtree(ansi_637_item, ett_ansi_637_tele); - dissect_ansi_637_tele_message(tvb, ansi_637_tree); - pinfo->private_data = pd_save; + dissect_ansi_637_tele_message(tvb, pinfo, ansi_637_tree, &has_private_data); } } static gboolean -dissect_ansi_637_trans_param(tvbuff_t *tvb, proto_tree *tree, guint32 *offset) +dissect_ansi_637_trans_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 *offset) { - void (*param_fcn)(tvbuff_t *, proto_tree *, guint, guint32, gchar *, int) = NULL; + void (*param_fcn)(tvbuff_t *, packet_info *, proto_tree *, guint, guint32, gchar *, int) = NULL; guint8 oct; guint8 len; guint32 curr_offset; @@ -2116,7 +2111,7 @@ ansi_637_add_string = (gchar *)wmem_alloc(wmem_packet_scope(), 1024); ansi_637_add_string[0] = '\0'; - (*param_fcn)(tvb, subtree, len, curr_offset, ansi_637_add_string, 1024); + (*param_fcn)(tvb, pinfo, subtree, len, curr_offset, ansi_637_add_string, 1024); if (ansi_637_add_string[0] != '\0') { @@ -2143,7 +2138,6 @@ const gchar *str = NULL; guint8 oct; guint8 len; - void *pd_save; col_set_str(pinfo->cinfo, COL_PROTOCOL, ansi_proto_name_short); @@ -2152,9 +2146,6 @@ */ if (tree) { - pd_save = pinfo->private_data; - pinfo->private_data = NULL; - g_pinfo = pinfo; g_tree = tree; /* @@ -2209,14 +2200,13 @@ while ((len - curr_offset) > 0) { - if (!dissect_ansi_637_trans_param(tvb, ansi_637_tree, &curr_offset)) + if (!dissect_ansi_637_trans_param(tvb, pinfo, ansi_637_tree, &curr_offset)) { proto_tree_add_text(ansi_637_tree, tvb, curr_offset, len - curr_offset, "Unknown Parameter Data"); break; } } - pinfo->private_data = pd_save; } } /* Dissect SMS embedded in SIP */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ansi_a.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ansi_a.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ansi_a.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ansi_a.c 2013-11-02 02:12:36.000000000 +0000 @@ -9168,9 +9168,9 @@ if (curr_len <= 0) return; \ } -#define ELEM_MAND_LV(elem_idx, elem_name_addition) \ +#define ELEM_MAND_LV(elem_idx, elem_name_addition, from_sip) \ {\ - if ((consumed = (GPOINTER_TO_UINT(pinfo->private_data) ? \ + if ((consumed = (from_sip ? \ elem_tlv(tvb, pinfo, tree, elem_idx, curr_offset, curr_len, elem_name_addition) : \ elem_lv(tvb, pinfo, tree, elem_idx, curr_offset, curr_len, elem_name_addition))) > 0) \ { \ @@ -9184,9 +9184,9 @@ if (curr_len <= 0) return; \ } -#define ELEM_MAND_V(elem_idx) \ +#define ELEM_MAND_V(elem_idx, from_sip) \ {\ - if ((consumed = (GPOINTER_TO_UINT(pinfo->private_data) ? \ + if ((consumed = (from_sip ? \ elem_tv(tvb, pinfo, tree, elem_idx, curr_offset, "") : \ elem_v(tvb, pinfo, tree, elem_idx, curr_offset))) > 0) \ { \ @@ -9205,7 +9205,7 @@ * IOS 6.1.2.1 */ static void -bsmap_cl3_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_cl3_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint16 consumed; guint32 curr_offset; @@ -9214,7 +9214,7 @@ curr_offset = offset; curr_len = len; - if (!GPOINTER_TO_UINT(pinfo->private_data)) { + if (!from_sip) { /* With femtoInterfaceMsg application, the Information Elements for the Complete Layer 3 Information message shall not be included */ ELEM_MAND_TLV(ANSI_A_E_CELL_ID, ""); @@ -9229,7 +9229,7 @@ * IOS 6.1.2.2 */ static void -dtap_cm_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_cm_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -9280,9 +9280,9 @@ curr_offset++; curr_len--; - ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, ""); + ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, "", from_sip); - ELEM_MAND_LV(ANSI_A_E_MID, ""); + ELEM_MAND_LV(ANSI_A_E_MID, "", from_sip); ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, ""); @@ -9348,7 +9348,7 @@ * IOS 5 3.1.3 */ static void -dtap_cm_srvc_req_cont(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_cm_srvc_req_cont(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9370,7 +9370,7 @@ * IOS 6.1.2.3 */ static void -bsmap_page_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_page_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9413,7 +9413,7 @@ * IOS 6.1.2.4 */ static void -dtap_page_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_page_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -9422,9 +9422,9 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, ""); + ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, "", from_sip); - ELEM_MAND_LV(ANSI_A_E_MID, ""); + ELEM_MAND_LV(ANSI_A_E_MID, "", from_sip); ELEM_OPT_TV(ANSI_A_E_TAG, ""); @@ -9476,7 +9476,7 @@ * IOS 6.1.2.12 */ static void -dtap_progress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_progress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9498,7 +9498,7 @@ * IOS 5 3.8.1 */ static void -dtap_srvc_redirection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_srvc_redirection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9526,7 +9526,7 @@ * IOS 5 3.1.11 */ static void -dtap_srvc_release(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_srvc_release(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9548,7 +9548,7 @@ * IOS 5 3.1.12 */ static void -dtap_srvc_release_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_srvc_release_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9566,7 +9566,7 @@ * IOS 6.1.2.15 */ static void -bsmap_ass_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ass_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint16 consumed; guint32 curr_offset; @@ -9619,7 +9619,7 @@ * IOS 6.1.2.16 */ static void -bsmap_ass_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ass_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint16 consumed; guint32 curr_offset; @@ -9654,7 +9654,7 @@ * IOS 6.1.2.17 */ static void -bsmap_ass_failure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ass_failure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint16 consumed; guint32 curr_offset; @@ -9674,7 +9674,7 @@ * IOS 6.1.2.20 */ static void -bsmap_clr_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_clr_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint16 consumed; guint32 curr_offset; @@ -9694,7 +9694,7 @@ * IOS 6.1.2.21 */ static void -bsmap_clr_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_clr_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint16 consumed; guint32 curr_offset; @@ -9714,7 +9714,7 @@ * IOS 6.1.2.22 */ static void -bsmap_clr_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_clr_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint16 consumed; guint32 curr_offset; @@ -9734,7 +9734,7 @@ * IOS 6.1.2.24 */ static void -dtap_alert_with_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_alert_with_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9754,7 +9754,7 @@ * IOS 6.1.2.28 */ static void -bsmap_bs_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_bs_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9784,7 +9784,7 @@ * IOS 6.1.2.29 */ static void -bsmap_bs_srvc_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_bs_srvc_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9810,7 +9810,7 @@ * IOS 5 3.1.19 */ static void -bsmap_add_srvc_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_add_srvc_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9832,7 +9832,7 @@ * IOS 5 3.1.20 */ static void -dtap_add_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_add_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9866,7 +9866,7 @@ * IOS 5 3.1.10 */ static void -dtap_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9884,7 +9884,7 @@ * IOS 6.1.3.7 */ static void -dtap_flash_with_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_flash_with_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9923,7 +9923,7 @@ * IOS 6.1.3.8 */ static void -dtap_flash_with_info_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_flash_with_info_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9943,7 +9943,7 @@ * IOS 6.1.3.9 */ static void -bsmap_feat_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_feat_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -9983,7 +9983,7 @@ * IOS 6.1.3.10 */ static void -bsmap_feat_noti_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_feat_noti_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10003,7 +10003,7 @@ * IOS 6.1.3.11 */ static void -bsmap_paca_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_paca_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10023,7 +10023,7 @@ * IOS 6.1.3.12 */ static void -bsmap_paca_command_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_paca_command_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10041,7 +10041,7 @@ * IOS 6.1.3.13 */ static void -bsmap_paca_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_paca_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10079,7 +10079,7 @@ * IOS 6.1.3.14 */ static void -bsmap_paca_update_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_paca_update_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10101,7 +10101,7 @@ * IOS 5 3.2.9 */ static void -bsmap_rm_pos_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_rm_pos_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10119,7 +10119,7 @@ * IOS 5 3.2.10 */ static void -bsmap_rm_pos_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_rm_pos_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10143,7 +10143,7 @@ * IOS 6.1.4.1 */ static void -bsmap_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10174,7 +10174,7 @@ } static void -dtap_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -10183,7 +10183,7 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, ""); + ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "", from_sip); ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, ""); @@ -10194,7 +10194,7 @@ * IOS 6.1.4.2 */ static void -bsmap_auth_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_auth_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10221,7 +10221,7 @@ * Section 3.1.21 */ static void -bsmap_bearer_upd_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_bearer_upd_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10242,7 +10242,7 @@ * Section 3.1.22 */ static void -bsmap_bearer_upd_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_bearer_upd_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10265,7 +10265,7 @@ * Section 3.1.23 */ static void -bsmap_bearer_upd_reqd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_bearer_upd_reqd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10284,7 +10284,7 @@ } static void -dtap_auth_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_auth_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -10293,7 +10293,7 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, ""); + ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, "", from_sip); EXTRANEOUS_DATA_CHECK(curr_len, 0); } @@ -10302,7 +10302,7 @@ * IOS 6.1.4.3 */ static void -bsmap_user_zone_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_user_zone_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10320,7 +10320,7 @@ * IOS 5 3.3.16 */ static void -dtap_user_zone_update_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_user_zone_update_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10338,7 +10338,7 @@ * IOS 5 3.3.17 */ static void -dtap_user_zone_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_user_zone_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10356,7 +10356,7 @@ * IOS 5 3.3.18 */ static void -bsmap_user_zone_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_user_zone_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10388,7 +10388,7 @@ * IOS 5 3.3.18 */ static void -dtap_user_zone_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_user_zone_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10406,7 +10406,7 @@ * IOS 5 3.3.19 */ static void -bsmap_reg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_reg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10436,7 +10436,7 @@ * IOS 5 3.3.20 */ static void -bsmap_ms_reg_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ms_reg_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10454,7 +10454,7 @@ * IOS 5 3.3.21 */ static void -bsmap_bs_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_bs_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10472,7 +10472,7 @@ * IOS 5 3.3.22 */ static void -bsmap_bs_auth_req_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_bs_auth_req_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10490,7 +10490,7 @@ * IOS 6.1.4.4 */ static void -dtap_ssd_update_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_ssd_update_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -10499,7 +10499,7 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, ""); + ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "", from_sip); EXTRANEOUS_DATA_CHECK(curr_len, 0); } @@ -10508,7 +10508,7 @@ * IOS 6.1.4.5 */ static void -dtap_bs_challenge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_bs_challenge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -10517,7 +10517,7 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, ""); + ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "", from_sip); EXTRANEOUS_DATA_CHECK(curr_len, 0); } @@ -10526,7 +10526,7 @@ * IOS 6.1.4.6 */ static void -dtap_bs_challenge_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_bs_challenge_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -10535,7 +10535,7 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, ""); + ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, "", from_sip); EXTRANEOUS_DATA_CHECK(curr_len, 0); } @@ -10544,7 +10544,7 @@ * IOS 6.1.4.7 */ static void -dtap_ssd_update_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_ssd_update_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10562,7 +10562,7 @@ * IOS 6.1.4.8 */ static void -dtap_lu_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_lu_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -10571,7 +10571,7 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_LV(ANSI_A_E_MID, ""); + ELEM_MAND_LV(ANSI_A_E_MID, "", from_sip); ELEM_OPT_TV(ANSI_A_E_LAI, ""); @@ -10612,7 +10612,7 @@ * IOS 6.1.4.9 */ static void -dtap_lu_accept(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_lu_accept(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10643,7 +10643,7 @@ * IOS 6.1.4.10 */ static void -dtap_lu_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_lu_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -10652,7 +10652,7 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_V(ANSI_A_E_REJ_CAUSE); + ELEM_MAND_V(ANSI_A_E_REJ_CAUSE, from_sip); switch (global_a_variant) { @@ -10670,7 +10670,7 @@ * IOS 6.1.4.18 */ static void -bsmap_priv_mode_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_priv_mode_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10688,7 +10688,7 @@ * IOS 6.1.4.19 */ static void -bsmap_priv_mode_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_priv_mode_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10708,7 +10708,7 @@ * IOS 5 3.3.14 */ static void -bsmap_status_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_status_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10746,7 +10746,7 @@ * IOS 5 3.3.14 */ static void -dtap_status_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_status_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -10755,7 +10755,7 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_LV(ANSI_A_E_IE_REQD, ""); + ELEM_MAND_LV(ANSI_A_E_IE_REQD, "", from_sip); EXTRANEOUS_DATA_CHECK(curr_len, 0); } @@ -10765,7 +10765,7 @@ * IOS 5 3.3.15 */ static void -bsmap_status_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_status_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10791,7 +10791,7 @@ * IOS 5 3.3.15 */ static void -dtap_status_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_status_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -10800,7 +10800,7 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_LV(ANSI_A_E_REV_MS_INFO_RECS, ""); + ELEM_MAND_LV(ANSI_A_E_REV_MS_INFO_RECS, "", from_sip); EXTRANEOUS_DATA_CHECK(curr_len, 0); } @@ -10809,7 +10809,7 @@ * IOS 6.1.5.4 */ static void -bsmap_ho_reqd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ho_reqd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10892,7 +10892,7 @@ * IOS 6.1.5.5 */ static void -bsmap_ho_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ho_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -10986,7 +10986,7 @@ * IOS 6.1.5.6 */ static void -bsmap_ho_req_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ho_req_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11035,7 +11035,7 @@ * IOS 6.1.5.7 */ static void -bsmap_ho_failure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ho_failure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11053,7 +11053,7 @@ * IOS 6.1.5.8 */ static void -bsmap_ho_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ho_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11106,7 +11106,7 @@ * IOS 5 3.4.6 */ static void -bsmap_ho_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ho_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11124,7 +11124,7 @@ * IOS 6.1.5.9 */ static void -bsmap_ho_reqd_rej(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ho_reqd_rej(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11142,7 +11142,7 @@ * IOS 6.1.5.12 */ static void -bsmap_ho_performed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_ho_performed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11168,7 +11168,7 @@ * IOS 6.1.6.2 */ static void -bsmap_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11190,7 +11190,7 @@ * IOS 6.1.6.3 */ static void -bsmap_block_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_block_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11208,7 +11208,7 @@ * IOS 6.1.6.4 */ static void -bsmap_unblock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_unblock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11228,7 +11228,7 @@ * IOS 6.1.6.5 */ static void -bsmap_unblock_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_unblock_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11246,7 +11246,7 @@ * IOS 6.1.6.6 */ static void -bsmap_reset(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_reset(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11266,7 +11266,7 @@ * IOS 6.1.6.7 */ static void -bsmap_reset_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_reset_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11284,7 +11284,7 @@ * IOS 6.1.6.8 */ static void -bsmap_reset_cct(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_reset_cct(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11306,7 +11306,7 @@ * IOS 6.1.6.9 */ static void -bsmap_reset_cct_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_reset_cct_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11324,7 +11324,7 @@ * IOS 6.1.6.10 */ static void -bsmap_xmode_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_xmode_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11342,7 +11342,7 @@ * IOS 6.1.6.11 */ static void -bsmap_xmode_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_xmode_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11360,7 +11360,7 @@ * IOS 6.1.7.1 */ static void -bsmap_adds_page(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_adds_page(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11394,7 +11394,7 @@ * IOS 6.1.7.2 */ static void -bsmap_adds_transfer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_adds_transfer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11448,7 +11448,7 @@ * IOS 5 3.6.4 */ static void -bsmap_adds_transfer_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_adds_transfer_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11470,7 +11470,7 @@ * IOS 6.1.7.3 */ static void -dtap_adds_deliver(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_adds_deliver(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) { guint32 curr_offset; guint32 consumed; @@ -11479,7 +11479,7 @@ curr_offset = offset; curr_len = len; - ELEM_MAND_LV(ANSI_A_E_ADDS_USER_PART, ""); + ELEM_MAND_LV(ANSI_A_E_ADDS_USER_PART, "", from_sip); ELEM_OPT_TV(ANSI_A_E_TAG, ""); @@ -11492,7 +11492,7 @@ * IOS 6.1.7.4 */ static void -bsmap_adds_page_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_adds_page_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11520,7 +11520,7 @@ * IOS 6.1.7.5 */ static void -dtap_adds_deliver_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_adds_deliver_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11540,7 +11540,7 @@ * IOS 6.1.8.1 */ static void -bsmap_rejection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +bsmap_rejection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11561,7 +11561,7 @@ } static void -dtap_rejection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) +dtap_rejection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip _U_) { guint32 curr_offset; guint32 consumed; @@ -11584,7 +11584,7 @@ #define ANSI_A_IOS401_BSMAP_NUM_MSG (sizeof(ansi_a_ios401_bsmap_strings)/sizeof(ext_value_string_t)) #define ANSI_A_IOS501_BSMAP_NUM_MSG (sizeof(ansi_a_ios501_bsmap_strings)/sizeof(ext_value_string_t)) static gint ett_bsmap_msg[MAX(ANSI_A_IOS401_BSMAP_NUM_MSG, ANSI_A_IOS501_BSMAP_NUM_MSG)]; -static void (*bsmap_msg_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) = +static void (*bsmap_msg_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) = { bsmap_add_srvc_noti, /* Additional Service Notification */ bsmap_adds_page, /* ADDS Page */ @@ -11654,7 +11654,7 @@ #define ANSI_A_IOS401_DTAP_NUM_MSG (sizeof(ansi_a_ios401_dtap_strings)/sizeof(ext_value_string_t)) #define ANSI_A_IOS501_DTAP_NUM_MSG (sizeof(ansi_a_ios501_dtap_strings)/sizeof(ext_value_string_t)) static gint ett_dtap_msg[MAX(ANSI_A_IOS401_DTAP_NUM_MSG, ANSI_A_IOS501_DTAP_NUM_MSG)]; -static void (*dtap_msg_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) = +static void (*dtap_msg_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gboolean from_sip) = { dtap_add_srvc_req, /* Additional Service Request */ dtap_adds_deliver, /* ADDS Deliver */ @@ -11752,7 +11752,6 @@ proto_item *bsmap_item = NULL; proto_tree *bsmap_tree = NULL; const gchar *msg_str; - void *pd_save; col_append_str(pinfo->cinfo, COL_INFO, "(BSMAP) "); @@ -11822,8 +11821,6 @@ if ((len - offset) <= 0) return; a_meid_configured = FALSE; - pd_save = pinfo->private_data; - pinfo->private_data = GUINT_TO_POINTER((guint)from_sip); /* * decode elements @@ -11836,10 +11833,8 @@ } else { - (*bsmap_msg_fcn[dec_idx])(tvb, pinfo, bsmap_tree, offset, len - offset); + (*bsmap_msg_fcn[dec_idx])(tvb, pinfo, bsmap_tree, offset, len - offset, from_sip); } - - pinfo->private_data = pd_save; } static void @@ -11865,7 +11860,6 @@ proto_tree *oct_1_tree = NULL; const gchar *msg_str; const gchar *str; - void *pd_save; len = tvb_length(tvb); @@ -12025,8 +12019,6 @@ if ((len - offset) <= 0) return; a_meid_configured = FALSE; - pd_save = pinfo->private_data; - pinfo->private_data = GUINT_TO_POINTER((guint)from_sip); /* * decode elements @@ -12039,10 +12031,8 @@ } else { - (*dtap_msg_fcn[dec_idx])(tvb, pinfo, dtap_tree, offset, len - offset); + (*dtap_msg_fcn[dec_idx])(tvb, pinfo, dtap_tree, offset, len - offset, from_sip); } - - pinfo->private_data = pd_save; } static void diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ansi_map.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ansi_map.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ansi_map.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ansi_map.c 2013-11-02 02:12:36.000000000 +0000 @@ -1189,9 +1189,8 @@ /* Store Invoke information needed for the corresponding reply */ static void -update_saved_invokedata(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){ +update_saved_invokedata(packet_info *pinfo, struct ansi_tcap_private_t *p_private_tcap){ struct ansi_map_invokedata_t *ansi_map_saved_invokedata; - struct ansi_tcap_private_t *p_private_tcap; address* src = &(pinfo->src); address* dst = &(pinfo->dst); guint8 *src_str; @@ -1202,39 +1201,35 @@ dst_str = ep_address_to_str(dst); /* Data from the TCAP dissector */ - if (pinfo->private_data != NULL){ - p_private_tcap=(struct ansi_tcap_private_t *)pinfo->private_data; - if ((!pinfo->fd->flags.visited)&&(p_private_tcap->TransactionID_str)){ - /* Only do this once XXX I hope it's the right thing to do */ - /* The hash string needs to contain src and dest to distiguish differnt flows */ - switch(ansi_map_response_matching_type){ - case ANSI_MAP_TID_ONLY: - buf = wmem_strdup(wmem_packet_scope(), p_private_tcap->TransactionID_str); - break; - case 1: - buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s",p_private_tcap->TransactionID_str,src_str); - break; - default: - buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s%s",p_private_tcap->TransactionID_str,src_str,dst_str); - break; - } - /* If the entry allready exists don't owervrite it */ - ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)g_hash_table_lookup(TransactionId_table,buf); - if(ansi_map_saved_invokedata) - return; + if ((!pinfo->fd->flags.visited)&&(p_private_tcap->TransactionID_str)){ + /* Only do this once XXX I hope it's the right thing to do */ + /* The hash string needs to contain src and dest to distiguish differnt flows */ + switch(ansi_map_response_matching_type){ + case ANSI_MAP_TID_ONLY: + buf = wmem_strdup(wmem_packet_scope(), p_private_tcap->TransactionID_str); + break; + case 1: + buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s",p_private_tcap->TransactionID_str,src_str); + break; + default: + buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s%s",p_private_tcap->TransactionID_str,src_str,dst_str); + break; + } + /* If the entry allready exists don't owervrite it */ + ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)g_hash_table_lookup(TransactionId_table,buf); + if(ansi_map_saved_invokedata) + return; - ansi_map_saved_invokedata = wmem_new(wmem_file_scope(), struct ansi_map_invokedata_t); - ansi_map_saved_invokedata->opcode = p_private_tcap->d.OperationCode_private; - ansi_map_saved_invokedata->ServiceIndicator = ServiceIndicator; - - g_hash_table_insert(TransactionId_table, - wmem_strdup(wmem_file_scope(), buf), - ansi_map_saved_invokedata); + ansi_map_saved_invokedata = wmem_new(wmem_file_scope(), struct ansi_map_invokedata_t); + ansi_map_saved_invokedata->opcode = p_private_tcap->d.OperationCode_private; + ansi_map_saved_invokedata->ServiceIndicator = ServiceIndicator; + + g_hash_table_insert(TransactionId_table, + wmem_strdup(wmem_file_scope(), buf), + ansi_map_saved_invokedata); - /*g_warning("Invoke Hash string %s pkt: %u",buf,pinfo->fd->num);*/ - } + /*g_warning("Invoke Hash string %s pkt: %u",buf,pinfo->fd->num);*/ } - } /* value strings */ const value_string ansi_map_opr_code_strings[] = { @@ -1391,10 +1386,12 @@ "Number is not available", "Number is available" }; +#if 0 static const true_false_string ansi_map_si_bool_val = { "User provided, screening passed", "User provided, not screened" }; +#endif static const value_string ansi_map_si_vals[] = { { 0, "User provided, not screened"}, { 1, "User provided, screening passed"}, @@ -1568,10 +1565,12 @@ } /* 6.5.3.13. Subaddress */ +#if 0 static const true_false_string ansi_map_Odd_Even_Ind_bool_val = { "Odd", "Even" }; +#endif /* Type of Subaddress (octet 1, bits E-G) */ static const value_string ansi_map_sub_addr_type_vals[] = { { 0, "NSAP (CCITT Rec. X.213 or ISO 8348 AD2)"}, @@ -2527,17 +2526,21 @@ } +#if 0 /* 6.5.2.79 MessageWaitingNotificationType */ /* Pip Tone (PT) (octet 1, bit A) */ static const true_false_string ansi_map_MessageWaitingNotificationType_pt_bool_val = { "Pip Tone (PT) notification is required", "Pip Tone (PT) notification is not authorized or no notification is required" }; +#endif +#if 0 /* Alert Pip Tone (APT) (octet 1, bit B) */ static const true_false_string ansi_map_MessageWaitingNotificationType_apt_bool_val = { "Alert Pip Tone (APT) notification is required", "Alert Pip Tone (APT) notification is not authorized or notification is not required" }; +#endif /* Message Waiting Indication (MWI) (octet 1, bits C and D) */ static const value_string ansi_map_MessageWaitingNotificationType_mwi_vals[] = { { 0, "No MWI. Message Waiting Indication (MWI) notification is not authorized or notification is not required"}, @@ -2657,6 +2660,7 @@ } +#if 0 /* 6.5.2.88 OneTimeFeatureIndicator */ /* updated with N.S0012 */ /* Call Waiting for Future Incoming Call (CWFI) (octet 1, bits A and B) */ @@ -2669,6 +2673,8 @@ { 3, "Priority CW"}, { 0, NULL } }; +#endif +#if 0 /* MessageWaitingNotification (MWN) (octet 1, bits E and F) */ static const value_string ansi_map_onetimefeatureindicator_mwn_vals[] = { { 0, "Ignore"}, @@ -2677,6 +2683,8 @@ { 3, "Reserved"}, { 0, NULL } }; +#endif +#if 0 /* Calling Number Identification Restriction (CNIR) (octet 1, bits G and H)*/ static const value_string ansi_map_onetimefeatureindicator_cnir_vals[] = { { 0, "Ignore"}, @@ -2685,7 +2693,9 @@ { 3, "Reserved"}, { 0, NULL } }; +#endif +#if 0 /* Priority Access and Channel Assignment (PACA) (octet 2, bits A and B)*/ static const value_string ansi_map_onetimefeatureindicator_paca_vals[] = { { 0, "Ignore"}, @@ -2694,7 +2704,9 @@ { 3, "Reserved"}, { 0, NULL } }; +#endif +#if 0 /* Flash Privileges (Flash) (octet 2, bits C and D) */ static const value_string ansi_map_onetimefeatureindicator_flash_vals[] = { { 0, "Ignore"}, @@ -2703,6 +2715,8 @@ { 3, "Reserved"}, { 0, NULL } }; +#endif +#if 0 /* Calling Name Restriction (CNAR) (octet 2, bits E and F) */ static const value_string ansi_map_onetimefeatureindicator_cnar_vals[] = { { 0, "Ignore"}, @@ -2711,6 +2725,7 @@ { 3, "Blocking Toggle"}, { 0, NULL } }; +#endif static void dissect_ansi_map_onetimefeatureindicator(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, asn1_ctx_t *actx _U_){ /* @@ -3212,6 +3227,7 @@ /* 6.5.2.137 SMS_TeleserviceIdentifier */ /* Updated with N.S0011-0 v 1.0 */ +#if 0 /* SMS Teleservice Identifier (octets 1 and 2) */ static const value_string ansi_map_SMS_TeleserviceIdentifier_vals[] = { { 0, "Not used"}, @@ -3228,6 +3244,7 @@ { 32584, "TDMA Segmented System Assisted Mobile Positioning Service" }, { 0, NULL } }; +#endif /* 6.5.2.140 SPINITriggers */ /* All Origination (All) (octet 1, bit A) */ @@ -3654,6 +3671,7 @@ { 7, "STU-III"}, { 0, NULL } }; +#if 0 /* 6.5.2.j (IS-730) TDMATerminalCapability N.S0008-0 v 1.0 Updted with N.S0015-0 */ /* Supported Frequency Band (octet 1) */ /* Voice Coder (octet 2) */ @@ -3669,6 +3687,7 @@ { 7, "PV 3 as published in TIA/EIA-136-A."}, { 0, NULL } }; +#endif /* Asynchronous Data (ADS) (octet 4, bit A) N.S0007-0*/ /* Group 3 Fax (G3FAX) (octet 4, bit B) */ /* Secure Telephone Unit III (STU3) (octet 4, bit C) */ @@ -3842,6 +3861,7 @@ proto_tree_add_item(subtree, hf_ansi_map_tmn, tvb, offset, 1, ENC_BIG_ENDIAN); } */ +#if 0 /* 6.5.2.as ChangeServiceAttributes N.S0008-0 v 1.0 */ /* Change Facilities Flag (CHGFAC)(octet 1, bits A - B) */ static const value_string ansi_map_ChangeServiceAttributes_chgfac_vals[] = { @@ -3851,6 +3871,8 @@ { 3, "Change Facilities Operation Not Used"}, { 0, NULL } }; +#endif +#if 0 /* Service Negotiate Flag (SRVNEG)(octet 1, bits C - D) */ static const value_string ansi_map_ChangeServiceAttributes_srvneg_vals[] = { { 0, "Service Negotiation Used"}, @@ -3859,6 +3881,8 @@ { 3, "Service Negotiation Not Required"}, { 0, NULL } }; +#endif +#if 0 /* 6.5.2.au DataPrivacyParameters N.S0008-0 v 1.0*/ /* Privacy Mode (PM) (octet 1, Bits A and B) */ static const value_string ansi_map_DataPrivacyParameters_pm_vals[] = { @@ -3868,12 +3892,15 @@ { 3, "Reserved. Treat reserved values the same as value 0, Privacy inactive or not supported."}, { 0, NULL } }; +#endif +#if 0 /* Data Privacy Version (PM) (octet 2) */ static const value_string ansi_map_DataPrivacyParameters_data_priv_ver_vals[] = { { 0, "Not used"}, { 1, "Data Privacy Version 1"}, { 0, NULL } }; +#endif /* 6.5.2.av ISLPInformation N.S0008-0 v 1.0*/ /* ISLP Type (octet 1) */ @@ -3916,6 +3943,7 @@ /* 6.5.2.bw CallingPartyName N.S0012-0 v 1.0*/ +#if 0 /* Presentation Status (octet 1, bits A and B) */ static const value_string ansi_map_Presentation_Status_vals[] = { { 0, "Presentation allowed"}, @@ -3924,11 +3952,14 @@ { 3, "No indication"}, { 0, NULL } }; +#endif +#if 0 /* Availability (octet 1, bit E) N.S0012-0 v 1.0*/ static const true_false_string ansi_map_Availability_bool_val = { "Name not available", "Name available/unknown" }; +#endif static void dissect_ansi_map_callingpartyname(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, asn1_ctx_t *actx _U_){ @@ -3958,6 +3989,7 @@ /* Global Title Octet 2 - n */ +#if 0 /* 6.5.2.dc SpecializedResource N.S0013-0 v 1.0*/ /* Resource Type (octet 1) */ static const value_string ansi_map_resource_type_vals[] = { @@ -3967,6 +3999,7 @@ { 3, "Automatic Speech Recognition - Speaker Independent - Speech User Interface Version 1"}, { 0, NULL } }; +#endif /* 6.5.2.df TriggerCapability */ /* Updated with N.S0004 N.S0013-0 v 1.0*/ @@ -4124,6 +4157,7 @@ /* 6.5.2.ff NewMINExtension N.S0015-0 */ +#if 0 /* 6.5.2.fv ACGEncountered N.S0023-0 v 1.0 */ /* ACG Encountered (octet 1, bits A-F) */ static const value_string ansi_ACGEncountered_vals[] = { @@ -4145,6 +4179,8 @@ { 15, "15-digit control"}, { 0, NULL } }; +#endif +#if 0 /* Control Type (octet 1, bits G-H) */ static const value_string ansi_ACGEncountered_cntrl_type_vals[] = { { 0, "Not used."}, @@ -4153,11 +4189,13 @@ { 3, "Reserved. Treat the same as value 0, Not used."}, { 0, NULL } }; +#endif /* 6.5.2.fw ControlType N.S0023-0 v 1.0 */ +#if 0 /* 6.5.2.ge QoSPriority N.S0029-0 v1.0*/ /* 6.5.2.xx QOSPriority */ /* Non-Assured Priority (octet 1, bits A-D) */ @@ -4180,6 +4218,7 @@ { 15, "Reserved"}, { 0, NULL } }; +#endif /* Assured Priority (octet 1, bits E-H)*/ @@ -4284,6 +4323,7 @@ { 0, NULL } }; */ +#if 0 /* 6.5.2.bp-1 ServiceRedirectionCause value */ static const value_string ansi_map_ServiceRedirectionCause_vals[] = { { 0, "Not used"}, @@ -4295,6 +4335,7 @@ { 6, "WrongNID"}, { 0, NULL } }; +#endif /* 6.5.2.mT AuthenticationResponseReauthentication N.S0011-0 v 1.0*/ /* 6.5.2.vT ReauthenticationReport N.S0011-0 v 1.0*/ @@ -4309,6 +4350,7 @@ +#if 0 /* 6.5.2.lB AKeyProtocolVersion N.S0011-0 v 1.0 */ @@ -4320,6 +4362,7 @@ { 4, "Diffie Hellman with 768-bit modulus, 32-bit primitive, and 160-bit exponents"}, { 0, NULL } }; +#endif /* 6.5.2.sB OTASP_ResultCode N.S0011-0 v 1.0 */ @@ -15463,7 +15506,7 @@ /*--- End of included file: packet-ansi_map-fn.c ---*/ -#line 3589 "../../asn1/ansi_map/packet-ansi_map-template.c" +#line 3632 "../../asn1/ansi_map/packet-ansi_map-template.c" /* * 6.5.2.dk N.S0013-0 v 1.0,X.S0004-550-E v1.0 2.301 @@ -16160,9 +16203,8 @@ } static int -find_saved_invokedata(asn1_ctx_t *actx){ +find_saved_invokedata(asn1_ctx_t *actx, struct ansi_tcap_private_t *p_private_tcap){ struct ansi_map_invokedata_t *ansi_map_saved_invokedata; - struct ansi_tcap_private_t *p_private_tcap; address* src = &(actx->pinfo->src); address* dst = &(actx->pinfo->dst); guint8 *src_str; @@ -16172,45 +16214,40 @@ buf=(char *)wmem_alloc(wmem_packet_scope(), 1024); /* Data from the TCAP dissector */ - if (actx->pinfo->private_data != NULL){ - p_private_tcap=(struct ansi_tcap_private_t *)actx->pinfo->private_data; - /* The hash string needs to contain src and dest to distiguish differnt flows */ - src_str = ep_address_to_str(src); - dst_str = ep_address_to_str(dst); - /* Reverse order to invoke */ - switch(ansi_map_response_matching_type){ - case ANSI_MAP_TID_ONLY: - g_snprintf(buf,1024,"%s",p_private_tcap->TransactionID_str); - break; - case 1: - g_snprintf(buf,1024,"%s%s",p_private_tcap->TransactionID_str,dst_str); - break; - default: - g_snprintf(buf,1024,"%s%s%s",p_private_tcap->TransactionID_str,dst_str,src_str); - break; - } + /* The hash string needs to contain src and dest to distiguish differnt flows */ + src_str = ep_address_to_str(src); + dst_str = ep_address_to_str(dst); + /* Reverse order to invoke */ + switch(ansi_map_response_matching_type){ + case ANSI_MAP_TID_ONLY: + g_snprintf(buf,1024,"%s",p_private_tcap->TransactionID_str); + break; + case 1: + g_snprintf(buf,1024,"%s%s",p_private_tcap->TransactionID_str,dst_str); + break; + default: + g_snprintf(buf,1024,"%s%s%s",p_private_tcap->TransactionID_str,dst_str,src_str); + break; + } - /*g_warning("Find Hash string %s pkt: %u",buf,actx->pinfo->fd->num);*/ - ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)g_hash_table_lookup(TransactionId_table, buf); - if(ansi_map_saved_invokedata){ - OperationCode = ansi_map_saved_invokedata->opcode & 0xff; - ServiceIndicator = ansi_map_saved_invokedata->ServiceIndicator; - }else{ - OperationCode = OperationCode & 0x00ff; - } + /*g_warning("Find Hash string %s pkt: %u",buf,actx->pinfo->fd->num);*/ + ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)g_hash_table_lookup(TransactionId_table, buf); + if(ansi_map_saved_invokedata){ + OperationCode = ansi_map_saved_invokedata->opcode & 0xff; + ServiceIndicator = ansi_map_saved_invokedata->ServiceIndicator; }else{ - /*g_warning("No private data pkt: %u",actx->pinfo->fd->num);*/ OperationCode = OperationCode & 0x00ff; } + return OperationCode; } -static void -dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { proto_item *ansi_map_item; proto_tree *ansi_map_tree = NULL; - struct ansi_tcap_private_t *p_private_tcap; + struct ansi_tcap_private_t *p_private_tcap = (struct ansi_tcap_private_t *)data; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -16224,9 +16261,9 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI MAP"); /* Data from the TCAP dissector */ - if (pinfo->private_data == NULL){ - proto_tree_add_text(tree, tvb, 0, -1, "Dissector ERROR this dissector relays on private data"); - return; + if (data == NULL){ + proto_tree_add_text(tree, tvb, 0, -1, "Dissector ERROR this dissector relies on dissector data"); + return 0; } /* @@ -16239,8 +16276,6 @@ is801_pld = FALSE; ServiceIndicator = 0; - p_private_tcap=(struct ansi_tcap_private_t *)pinfo->private_data; - switch(p_private_tcap->d.pdu){ /* 1 : invoke, @@ -16254,10 +16289,10 @@ col_add_fstr(pinfo->cinfo, COL_INFO,"%s Invoke ", val_to_str_ext(OperationCode, &ansi_map_opr_code_strings_ext, "Unknown ANSI-MAP PDU (%u)")); proto_item_append_text(p_private_tcap->d.OperationCode_item," %s",val_to_str_ext(OperationCode, &ansi_map_opr_code_strings_ext, "Unknown ANSI-MAP PDU (%u)")); dissect_invokeData(ansi_map_tree, tvb, 0, &asn1_ctx); - update_saved_invokedata(pinfo, ansi_map_tree, tvb); + update_saved_invokedata(pinfo, p_private_tcap); break; case 2: - OperationCode = find_saved_invokedata(&asn1_ctx); + OperationCode = find_saved_invokedata(&asn1_ctx, p_private_tcap); col_add_fstr(pinfo->cinfo, COL_INFO,"%s ReturnResult ", val_to_str_ext(OperationCode, &ansi_map_opr_code_strings_ext, "Unknown ANSI-MAP PDU (%u)")); proto_item_append_text(p_private_tcap->d.OperationCode_item," %s",val_to_str_ext(OperationCode, &ansi_map_opr_code_strings_ext, "Unknown ANSI-MAP PDU (%u)")); dissect_returnData(ansi_map_tree, tvb, 0, &asn1_ctx); @@ -16273,6 +16308,8 @@ DISSECTOR_ASSERT_NOT_REACHED(); break; } + + return tvb_length(tvb); } static void range_delete_callback(guint32 ssn) @@ -19309,7 +19346,7 @@ NULL, HFILL }}, /*--- End of included file: packet-ansi_map-hfarr.c ---*/ -#line 5242 "../../asn1/ansi_map/packet-ansi_map-template.c" +#line 5279 "../../asn1/ansi_map/packet-ansi_map-template.c" }; /* List of subtrees */ @@ -19570,7 +19607,7 @@ &ett_ansi_map_ReturnData, /*--- End of included file: packet-ansi_map-ettarr.c ---*/ -#line 5275 "../../asn1/ansi_map/packet-ansi_map-template.c" +#line 5312 "../../asn1/ansi_map/packet-ansi_map-template.c" }; static const enum_val_t ansi_map_response_matching_type_values[] = { @@ -19586,7 +19623,7 @@ proto_register_field_array(proto_ansi_map, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("ansi_map", dissect_ansi_map, proto_ansi_map); + new_register_dissector("ansi_map", dissect_ansi_map, proto_ansi_map); is637_tele_id_dissector_table = register_dissector_table("ansi_map.tele_id", "IS-637 Teleservice ID", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ansi_tcap.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ansi_tcap.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ansi_tcap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ansi_tcap.c 2013-11-02 02:12:36.000000000 +0000 @@ -381,7 +381,7 @@ * points to the subdissector this code can be used. * if(ansi_tcap_private.d.oid_is_present){ - call_ber_oid_callback(ansi_tcap_private.objectApplicationId_oid, tvb, 0, actx-pinfo, tree); + call_ber_oid_callback(ansi_tcap_private.objectApplicationId_oid, tvb, 0, actx-pinfo, tree, NULL); return TRUE; } */ @@ -434,7 +434,7 @@ * Operation Family is coded as decimal 9. Bit H of the Operation Family is always * coded as 0. */ - call_dissector(ansi_map_handle, tvb, actx->pinfo, tcap_top_tree); + call_dissector_with_data(ansi_map_handle, tvb, actx->pinfo, tcap_top_tree, &ansi_tcap_private); return TRUE; } @@ -1429,7 +1429,6 @@ cur_oid = NULL; tcapext_oid = NULL; - pinfo->private_data = &ansi_tcap_private; gp_tcapsrt_info=tcapsrt_razinfo(); tcap_subdissector_used=FALSE; gp_tcap_context=NULL; @@ -1740,7 +1739,7 @@ NULL, HFILL }}, /*--- End of included file: packet-ansi_tcap-hfarr.c ---*/ -#line 489 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c" +#line 488 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c" }; /* Setup protocol subtree array */ @@ -1778,7 +1777,7 @@ &ett_ansi_tcap_T_paramSet, /*--- End of included file: packet-ansi_tcap-ettarr.c ---*/ -#line 500 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c" +#line 499 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c" }; static const enum_val_t ansi_tcap_response_matching_type_values[] = { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-applemidi.c wireshark-1.12.0~201311020920/epan/dissectors/packet-applemidi.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-applemidi.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-applemidi.c 2013-11-02 02:12:36.000000000 +0000 @@ -132,9 +132,6 @@ col_set_str( pinfo->cinfo, COL_PROTOCOL, APPLEMIDI_DISSECTOR_SHORTNAME ); - /* Clear out stuff in the info column */ - col_clear( pinfo->cinfo, COL_INFO ); - col_add_fstr( pinfo->cinfo, COL_INFO, "%s", val_to_str( command, applemidi_commands, applemidi_unknown_command ) ); if ( tree ) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-aprs.c wireshark-1.12.0~201311020920/epan/dissectors/packet-aprs.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-aprs.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-aprs.c 2013-11-02 02:12:36.000000000 +0000 @@ -776,7 +776,7 @@ mic_e_msg_table[ (msg_a << 2) + (msg_b << 1) + msg_c ].std ); - col_add_str( pinfo->cinfo, COL_INFO, "MIC-E " ); + col_set_str( pinfo->cinfo, COL_INFO, "MIC-E " ); col_append_str( pinfo->cinfo, COL_INFO, info_buffer ); if ( parent_tree ) diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-asterix.c wireshark-1.12.0~201311020920/epan/dissectors/packet-asterix.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-asterix.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-asterix.c 2013-11-02 02:12:36.000000000 +0000 @@ -34,11 +34,11 @@ #include "wmem/wmem.h" #include -#define PROTO_TAG_ASTERIX "ASTERIX" +#define PROTO_TAG_ASTERIX "ASTERIX" #define ASTERIX_PORT 8600 -#define MAX_DISSECT_STR 1024 -#define MAX_BUFFER 256 +#define MAX_DISSECT_STR 1024 +#define MAX_BUFFER 256 static int proto_asterix = -1; @@ -1547,8 +1547,8 @@ static gint ett_065_030 = -1; static gint ett_065_040 = -1; static gint ett_065_050 = -1; -static gint ett_065_RE = -1; -static gint ett_065_SP = -1; +static gint ett_065_RE = -1; +static gint ett_065_SP = -1; static dissector_handle_t asterix_handle; @@ -1571,22 +1571,22 @@ typedef struct FieldPart_s FieldPart; struct FieldPart_s { - guint8 bit_length; /* length of field in bits */ - double scaling_factor; /* scaling factor of the field (for instance: 1/128) */ - guint8 type; /* Pre-defined type for proper presentation */ - gint *hf; /* Pointer to hf representing this kind of data */ - const char* format_string; /* format string for showing float values */ + guint8 bit_length; /* length of field in bits */ + double scaling_factor; /* scaling factor of the field (for instance: 1/128) */ + guint8 type; /* Pre-defined type for proper presentation */ + gint *hf; /* Pointer to hf representing this kind of data */ + const char *format_string; /* format string for showing float values */ }; typedef struct AsterixField_s AsterixField; struct AsterixField_s { - guint8 type; /* type of field */ - guint length; /* fixed length */ - guint repetition_counter_size; /* size of repetition counter, length of one item is in length */ - guint header_length; /* the size is in first header_length bytes of the field */ - gint *hf; /* pointer to Wireshark hf_register_info */ - const FieldPart **part; /* Look declaration and description of FieldPart above. */ - const AsterixField *field[]; /* subfields */ + guint8 type; /* type of field */ + guint length; /* fixed length */ + guint repetition_counter_size; /* size of repetition counter, length of one item is in length */ + guint header_length; /* the size is in first header_length bytes of the field */ + gint *hf; /* pointer to Wireshark hf_register_info */ + const FieldPart **part; /* Look declaration and description of FieldPart above. */ + const AsterixField *field[]; /* subfields */ }; static void dissect_asterix (tvbuff_t *, packet_info *, proto_tree *); @@ -1617,7 +1617,7 @@ }; static const FieldPart IXXX_FX = { 1, 1.0, FIELD_PART_FX, &hf_XXX_FX, NULL }; /*static const FieldPart IXXX_2FX = { 1, 1.0, FIELD_PART_FX, &hf_XXX_2FX, NULL };*/ -static const FieldPart IXXX_3FX = { 1, 1.0, FIELD_PART_FX, &hf_XXX_3FX, NULL }; +static const FieldPart IXXX_3FX = { 1, 1.0, FIELD_PART_FX, &hf_XXX_3FX, NULL }; static const FieldPart IXXX_1bit_spare = { 1, 1.0, FIELD_PART_UINT, NULL, NULL }; static const FieldPart IXXX_2bit_spare = { 2, 1.0, FIELD_PART_UINT, NULL, NULL }; static const FieldPart IXXX_3bit_spare = { 3, 1.0, FIELD_PART_UINT, NULL, NULL }; @@ -1731,14 +1731,14 @@ /* Warning/Error Conditions */ static const value_string valstr_001_030_WE[] = { - { 0, "no warning nor error condition" }, - { 1, "garbled reply" }, - { 2, "reflection" }, - { 3, "sidelobe reply" }, - { 4, "split plot" }, - { 5, "second time around reply" }, - { 6, "angels" }, - { 7, "terrestrial vehicles" }, + { 0, "no warning nor error condition" }, + { 1, "garbled reply" }, + { 2, "reflection" }, + { 3, "sidelobe reply" }, + { 4, "split plot" }, + { 5, "second time around reply" }, + { 6, "angels" }, + { 7, "terrestrial vehicles" }, { 64, "possible wrong code in Mode-3/A" }, { 65, "possible wrong altitude information, transmitted when the Code C credibility check fails together with the Mode-C code in binary notation" }, { 66, "possible phantom MSSR plot" }, @@ -2074,11 +2074,9 @@ static const FieldPart I008_040_ORG = { 1, 1.0, FIELD_PART_UINT, &hf_008_040_ORG, NULL }; static const FieldPart I008_040_INT = { 3, 1.0, FIELD_PART_UINT, &hf_008_040_INT, NULL }; static const FieldPart I008_040_FST_LST = { 2, 1.0, FIELD_PART_UINT, &hf_008_040_FST_LST, NULL }; -#if 0 static const FieldPart I008_040_CSN = { 8, 1.0, FIELD_PART_UINT, &hf_008_040_CSN, NULL }; -#endif static const FieldPart *I008_040_PARTS[] = { &I008_040_ORG, &I008_040_INT, &IXXX_2bit_spare, &I008_040_FST_LST, - &I008_040_FST_LST, NULL }; + &I008_040_CSN, NULL }; /* Sequence of Contour Points in SPF Notation */ static const FieldPart I008_050_X1 = { 8, 1.0/64.0, FIELD_PART_FLOAT, &hf_008_050_X1, NULL }; @@ -2421,16 +2419,16 @@ /* Plot Count Values */ static const value_string valstr_034_070_TYP[] = { - { 0, "No detection (number of misses)" }, - { 1, "Single PSR target reports" }, - { 2, "Single SSR target reports (Non-Mode S)" }, - { 3, "SSR+PSR target reports (Non-Mode S)" }, - { 4, "Single All-Call target reports (Mode S)" }, - { 5, "Single Roll-Call target reports (Mode S)" }, - { 6, "All-Call + PSR (Mode S) target reports" }, - { 7, "Roll-Call + PSR (Mode S) target reports" }, - { 8, "Filter for Weather data" }, - { 9, "Filter for Jamming Strobe" }, + { 0, "No detection (number of misses)" }, + { 1, "Single PSR target reports" }, + { 2, "Single SSR target reports (Non-Mode S)" }, + { 3, "SSR+PSR target reports (Non-Mode S)" }, + { 4, "Single All-Call target reports (Mode S)" }, + { 5, "Single Roll-Call target reports (Mode S)" }, + { 6, "All-Call + PSR (Mode S) target reports" }, + { 7, "Roll-Call + PSR (Mode S) target reports" }, + { 8, "Filter for Weather data" }, + { 9, "Filter for Jamming Strobe" }, { 10, "Filter for PSR data" }, { 11, "Filter for SSR/Mode S data" }, { 12, "Filter for SSR/Mode S+PSR data" }, @@ -2591,16 +2589,16 @@ /* Warning/Error Conditions */ static const value_string valstr_048_030_WE[] = { - { 0, "Not defined; never used." }, - { 1, "Multipath Reply (Reflection)" }, - { 2, "Reply due to sidelobe interrogation/reception" }, - { 3, "Split plot" }, - { 4, "Second time around reply" }, - { 5, "Angel" }, - { 6, "Slow moving target correlated with road infrastructure (terrestrial vehicle)" }, - { 7, "Fixed PSR plot" }, - { 8, "Slow PSR target" }, - { 9, "Low quality PSR plot" }, + { 0, "Not defined; never used." }, + { 1, "Multipath Reply (Reflection)" }, + { 2, "Reply due to sidelobe interrogation/reception" }, + { 3, "Split plot" }, + { 4, "Second time around reply" }, + { 5, "Angel" }, + { 6, "Slow moving target correlated with road infrastructure (terrestrial vehicle)" }, + { 7, "Fixed PSR plot" }, + { 8, "Slow PSR target" }, + { 9, "Low quality PSR plot" }, { 10, "Phantom SSR plot" }, { 11, "Non-Matching Mode-3/A Code" }, { 12, "Mode C code / Mode S altitude code abnormal value compared to the track" }, @@ -3279,7 +3277,7 @@ /* Calculated Track Barometric Altitude */ static const value_string valstr_062_135_QNH[] = { - { 0, "No QNH correction applied" }, + { 0, "No QNH correction applied" }, { 1, "QNH correction applied" }, { 0, NULL } }; @@ -3434,16 +3432,16 @@ /* Vehicle Fleet Identification */ static const value_string valstr_062_300_VFI[] = { - { 0, "Unknown" }, - { 1, "ATC equipment maintenance" }, - { 2, "Airport maintenance" }, - { 3, "Fire" }, - { 4, "Bird scarer" }, - { 5, "Snow plough" }, - { 6, "Runway sweeper" }, - { 7, "Emergency" }, - { 8, "Police" }, - { 9, "Bus" }, + { 0, "Unknown" }, + { 1, "ATC equipment maintenance" }, + { 2, "Airport maintenance" }, + { 3, "Fire" }, + { 4, "Bird scarer" }, + { 5, "Snow plough" }, + { 6, "Runway sweeper" }, + { 7, "Emergency" }, + { 8, "Police" }, + { 9, "Bus" }, { 10, "Tug (push/tow)" }, { 11, "Grass cutter" }, { 12, "Fuel" }, @@ -3513,18 +3511,18 @@ { 0, NULL } }; static const value_string valstr_062_340_06_SIM[] = { - { 0, "Actual target report" }, - { 1, "Simulated target report" }, + { 0, "Actual target report" }, + { 1, "Simulated target report" }, { 0, NULL } }; static const value_string valstr_062_340_06_RAB[] = { - { 0, "Report from target transponder" }, - { 1, "Report from field monitor (fixed transponder)" }, + { 0, "Report from target transponder" }, + { 1, "Report from field monitor (fixed transponder)" }, { 0, NULL } }; static const value_string valstr_062_340_06_TST[] = { - { 0, "Real target report" }, - { 1, "Test target report" }, + { 0, "Real target report" }, + { 1, "Test target report" }, { 0, NULL } }; static const FieldPart I062_340_06_TYP = { 3, 1.0, FIELD_PART_UINT, &hf_062_340_06_TYP, NULL }; @@ -3607,37 +3605,35 @@ { 0, NULL } }; static const value_string valstr_062_380_09_PTYP[] = { - { 0, "Unknown" }, - { 1, "Fly by waypoint " }, - { 2, "Fly over waypoint" }, - { 3, "Hold Pattern" }, - { 4, "Procedure hold" }, - { 5, "Procedure turn" }, - { 6, "RF leg" }, - { 7, "Top of climb" }, - { 8, "Top of descend"}, - { 9, "Start of level" }, + { 0, "Unknown" }, + { 1, "Fly by waypoint " }, + { 2, "Fly over waypoint" }, + { 3, "Hold Pattern" }, + { 4, "Procedure hold" }, + { 5, "Procedure turn" }, + { 6, "RF leg" }, + { 7, "Top of climb" }, + { 8, "Top of descend"}, + { 9, "Start of level" }, { 10, "Cross-over altitude" }, { 11, "Transition altitude" }, { 0, NULL } }; -#if 0 static const value_string valstr_062_380_09_TD[] = { - { 0, "N/A" }, - { 1, "Turn right" }, - { 2, "Turn left" }, - { 3, "No turn" }, + { 0, "N/A" }, + { 1, "Turn right" }, + { 2, "Turn left" }, + { 3, "No turn" }, { 0, NULL } }; -#endif static const value_string valstr_062_380_09_TRA[] = { - { 0, "TTR not available" }, - { 1, "TTR available" }, + { 0, "TTR not available" }, + { 1, "TTR available" }, { 0, NULL } }; static const value_string valstr_062_380_09_TOA[] = { - { 0, "TOV available" }, - { 1, "TOV not available" }, + { 0, "TOV available" }, + { 1, "TOV not available" }, { 0, NULL } }; static const FieldPart I062_380_09_TCA = { 1, 1.0, FIELD_PART_UINT, &hf_062_380_09_TCA, NULL }; @@ -3816,15 +3812,15 @@ /* Emitter Category */ static const value_string valstr_062_380_21_ECAT[] = { - { 1, "light aircraft <= 7000 kg" }, - { 2, "reserved" }, - { 3, "7000 kg < medium aircraft < 136000 kg" }, - { 4, "reserved" }, - { 5, "136000 kg <= heavy aircraft" }, - { 6, "highly manoeuvrable (5g acceleration capability) and high speed (>400 knots cruise)" }, - { 7, "reserved" }, - { 8, "reserved" }, - { 9, "reserved" }, + { 1, "light aircraft <= 7000 kg" }, + { 2, "reserved" }, + { 3, "7000 kg < medium aircraft < 136000 kg" }, + { 4, "reserved" }, + { 5, "136000 kg <= heavy aircraft" }, + { 6, "highly manoeuvrable (5g acceleration capability) and high speed (>400 knots cruise)" }, + { 7, "reserved" }, + { 8, "reserved" }, + { 9, "reserved" }, { 10, "rotocraft" }, { 11, "glider / sailplane" }, { 12, "lighter-than-air" }, @@ -3953,16 +3949,16 @@ /* Time of Departure / Arrival */ static const value_string valstr_062_390_12_TYP[] = { - { 0, "Scheduled off-block time" }, - { 1, "Estimated off-block time" }, - { 2, "Estimated take-off time" }, - { 3, "Actual off-block time" }, - { 4, "Predicted time at runway hold" }, - { 5, "Actual time at runway hold" }, - { 6, "Actual line-up time" }, - { 7, "Actual take-off time" }, - { 8, "Estimated time of arrival" }, - { 9, "Predicted landing time" }, + { 0, "Scheduled off-block time" }, + { 1, "Estimated off-block time" }, + { 2, "Estimated take-off time" }, + { 3, "Actual off-block time" }, + { 4, "Predicted time at runway hold" }, + { 5, "Actual time at runway hold" }, + { 6, "Actual line-up time" }, + { 7, "Actual take-off time" }, + { 8, "Estimated time of arrival" }, + { 9, "Predicted landing time" }, { 10, "Actual landing time" }, { 11, "Actual time off runway" }, { 12, "Predicted time to gate" }, @@ -5525,7 +5521,7 @@ { &hf_062_380_09_LAT, { "LAT[deg]", "asterix.062_380_09_LAT", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_062_380_09_LON, { "LON[deg]", "asterix.062_380_09_LON", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_062_380_09_PTYP, { "PTYP", "asterix.062_380_09_PTYP", FT_UINT8, BASE_DEC, VALS (valstr_062_380_09_PTYP), 0xf0, NULL, HFILL } }, - { &hf_062_380_09_TD, { "TD", "asterix.062_380_09_TD", FT_UINT8, BASE_DEC, VALS (valstr_062_380_09_PTYP), 0x0c, NULL, HFILL } }, + { &hf_062_380_09_TD, { "TD", "asterix.062_380_09_TD", FT_UINT8, BASE_DEC, VALS (valstr_062_380_09_TD), 0x0c, NULL, HFILL } }, { &hf_062_380_09_TRA, { "TRA", "asterix.062_380_09_TRA", FT_UINT8, BASE_DEC, VALS (valstr_062_380_09_TRA), 0x02, NULL, HFILL } }, { &hf_062_380_09_TOA, { "TOA", "asterix.062_380_09_TOA", FT_UINT8, BASE_DEC, VALS (valstr_062_380_09_TOA), 0x01, NULL, HFILL } }, { &hf_062_380_09_TOV, { "TOV[s]", "asterix.062_380_09_TOV", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-atalk.c wireshark-1.12.0~201311020920/epan/dissectors/packet-atalk.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-atalk.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-atalk.c 2013-11-02 02:12:36.000000000 +0000 @@ -936,7 +936,7 @@ conversation_set_dissector(conversation, sub); } else if (!try_conversation_dissector(&pinfo->src, &pinfo->dst, pinfo->ptype, - pinfo->srcport, pinfo->destport, new_tvb,pinfo, tree)) { + pinfo->srcport, pinfo->destport, new_tvb,pinfo, tree, NULL)) { call_dissector(data_handle, new_tvb, pinfo, tree); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-atm.c wireshark-1.12.0~201311020920/epan/dissectors/packet-atm.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-atm.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-atm.c 2013-11-02 02:12:36.000000000 +0000 @@ -952,7 +952,7 @@ static void dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *atm_ti, - proto_tree *atm_tree, gboolean truncated) + proto_tree *atm_tree, gboolean truncated, gboolean pseudowire_mode) { guint length, reported_length; guint16 aal5_length; @@ -961,13 +961,6 @@ guint32 crc; guint32 calc_crc; gint type; - /* - * ATM dissector is used as "sub-dissector" for ATM pseudowires. - * In such cases, pinfo->private_data is used to pass info from/to - * PW dissector to ATM dissector. For decoding normal ATM traffic - * private_data should be NULL. - */ - gboolean pseudowire_mode = (NULL != pinfo->private_data); /* * This is reassembled traffic, so the cell headers are missing; @@ -1578,7 +1571,7 @@ static void dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *atm_tree, guint aal, gboolean nni, - gboolean crc_stripped) + gboolean crc_stripped, const pwatm_private_data_t *pwpd) { int offset; proto_tree *aal_tree; @@ -1588,7 +1581,6 @@ guint16 vpi, vci, aal3_4_hdr, crc10; gint length; tvbuff_t *next_tvb; - const pwatm_private_data_t *pwpd = (const pwatm_private_data_t *)pinfo->private_data; if (NULL == pwpd) { if (!nni) { @@ -1675,7 +1667,6 @@ else { offset = 0; /* For PWs. Header is decoded by PW dissector.*/ - pwpd = (const pwatm_private_data_t *)pinfo->private_data; /* Not used ! vpi = pwpd->vpi; */ @@ -1796,13 +1787,13 @@ } } -static void +static int dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - gboolean truncated) + gboolean truncated, const pwatm_private_data_t *pwpd) { proto_tree *atm_tree = NULL; proto_item *atm_ti = NULL; - gboolean pseudowire_mode = (NULL != pinfo->private_data); + gboolean pseudowire_mode = (NULL != pwpd); if ( pinfo->pseudo_header->atm.aal == AAL_5 && pinfo->pseudo_header->atm.type == TRAF_LANE && @@ -1862,42 +1853,55 @@ } dissect_atm_cell(tvb, pinfo, tree, atm_tree, pinfo->pseudo_header->atm.aal, FALSE, - pinfo->pseudo_header->atm.flags & ATM_NO_HEC); + pinfo->pseudo_header->atm.flags & ATM_NO_HEC, pwpd); } else { /* This is a reassembled PDU. */ - dissect_reassembled_pdu(tvb, pinfo, tree, atm_tree, atm_ti, truncated); + + /* + * ATM dissector is used as "sub-dissector" for ATM pseudowires. + * In such cases, the dissector data parameter is used to pass info from/to + * PW dissector to ATM dissector. For decoding normal ATM traffic + * data parameter should be NULL. + */ + dissect_reassembled_pdu(tvb, pinfo, tree, atm_tree, atm_ti, truncated, pwpd != NULL); } + + return tvb_length(tvb); } -static void -dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - dissect_atm_common(tvb, pinfo, tree, TRUE); + const pwatm_private_data_t *pwpd = (const pwatm_private_data_t *)data; + + return dissect_atm_common(tvb, pinfo, tree, TRUE, pwpd); } -static void -dissect_atm_untruncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_atm_untruncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - dissect_atm_common(tvb, pinfo, tree, FALSE); + const pwatm_private_data_t *pwpd = (const pwatm_private_data_t *)data; + + return dissect_atm_common(tvb, pinfo, tree, FALSE, pwpd); } -static void -dissect_atm_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_atm_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { proto_tree *atm_tree = NULL; proto_item *atm_ti = NULL; - gboolean pseudowire_mode = (NULL != pinfo->private_data); + const pwatm_private_data_t *pwpd = (const pwatm_private_data_t *)data; + gboolean pseudowire_mode = (NULL != pwpd); col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATM"); if (!pseudowire_mode) { - if (tree) { - atm_ti = proto_tree_add_protocol_format(tree, proto_atm, tvb, 0, 0, "ATM"); + atm_ti = proto_tree_add_item(tree, proto_atm, tvb, 0, 0, ENC_NA); atm_tree = proto_item_add_subtree(atm_ti, ett_atm); - } } - dissect_atm_cell(tvb, pinfo, tree, atm_tree, AAL_OAMCELL, FALSE, FALSE); + dissect_atm_cell(tvb, pinfo, tree, atm_tree, AAL_OAMCELL, FALSE, FALSE, pwpd); + return tvb_length(tvb); } @@ -2151,9 +2155,9 @@ "ATM LANE", "lane"); register_dissector("lane", dissect_lane, proto_atm_lane); - atm_handle = register_dissector("atm_truncated", dissect_atm, proto_atm); - atm_untruncated_handle = register_dissector("atm_untruncated", dissect_atm_untruncated, proto_atm); - register_dissector("atm_oam_cell", dissect_atm_oam_cell, proto_oamaal); + atm_handle = new_register_dissector("atm_truncated", dissect_atm, proto_atm); + atm_untruncated_handle = new_register_dissector("atm_untruncated", dissect_atm_untruncated, proto_atm); + new_register_dissector("atm_oam_cell", dissect_atm_oam_cell, proto_oamaal); atm_module = prefs_register_protocol ( proto_atm, NULL ); prefs_register_bool_preference(atm_module, "dissect_lane_as_sscop", "Dissect LANE as SSCOP", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-atmtcp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-atmtcp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-atmtcp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-atmtcp.c 2013-11-02 02:12:36.000000000 +0000 @@ -92,11 +92,11 @@ length = tvb_get_ntohl(tvb, offset); if(length == ATMTCP_HDR_MAGIC) { - col_append_fstr(pinfo->cinfo, COL_INFO, " Command"); + col_append_str(pinfo->cinfo, COL_INFO, " Command"); } else { - col_append_fstr(pinfo->cinfo, COL_INFO, " Data"); + col_append_str(pinfo->cinfo, COL_INFO, " Data"); } offset += 4; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-atn-cpdlc.c wireshark-1.12.0~201311020920/epan/dissectors/packet-atn-cpdlc.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-atn-cpdlc.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-atn-cpdlc.c 2013-11-02 02:12:36.000000000 +0000 @@ -5111,7 +5111,7 @@ dissect_atn_cpdlc_AlgorithmIdentifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { proto_tree *top_tree=NULL; - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree, NULL); return offset; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-atn-ulcs.c wireshark-1.12.0~201311020920/epan/dissectors/packet-atn-ulcs.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-atn-ulcs.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-atn-ulcs.c 2013-11-02 02:12:36.000000000 +0000 @@ -1004,7 +1004,7 @@ tvb, offset, actx->pinfo, - tree); + tree, NULL); offset=call_ber_oid_callback( @@ -1012,7 +1012,7 @@ tvb, offset, actx->pinfo, - tree); + tree, NULL); return offset; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ax25-kiss.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ax25-kiss.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ax25-kiss.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ax25-kiss.c 2013-11-02 02:12:36.000000000 +0000 @@ -206,7 +206,6 @@ int kiss_param_len; const char *frame_type_text; char *info_buffer; - void *saved_private_data; tvbuff_t *next_tvb = NULL; info_buffer = (char *)wmem_alloc( wmem_packet_scope(), STRLEN ); @@ -261,7 +260,7 @@ proto_tree_add_uint( kiss_tree, hf_ax25_kiss_cmd, tvb, offset, KISS_HEADER_SIZE, kiss_cmd ); proto_tree_add_uint( kiss_tree, hf_ax25_kiss_port, tvb, offset, KISS_HEADER_SIZE, - kiss_cmd ); + kiss_port ); offset += KISS_HEADER_SIZE; switch ( kiss_type ) @@ -306,10 +305,8 @@ if ( kiss_type == KISS_DATA_FRAME ) { - saved_private_data = pinfo->private_data; next_tvb = tvb_new_subset_remaining( tvb, offset ); call_dissector( ax25_handle, next_tvb, pinfo, parent_tree ); - pinfo->private_data = saved_private_data; } } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ax25-nol3.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ax25-nol3.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ax25-nol3.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ax25-nol3.c 2013-11-02 02:12:36.000000000 +0000 @@ -96,7 +96,6 @@ data_len = tvb_length_remaining( tvb, offset ); col_set_str( pinfo->cinfo, COL_PROTOCOL, "DX" ); - col_clear( pinfo->cinfo, COL_INFO ); col_add_fstr( pinfo->cinfo, COL_INFO, "%s", tvb_format_text( tvb, offset, 15 ) ); @@ -158,7 +157,6 @@ proto_tree *ax25_nol3_tree; char *info_buffer; int offset; - void *saved_private_data; tvbuff_t *next_tvb = NULL; guint8 dti = 0; gboolean dissected; @@ -200,9 +198,7 @@ "AX.25 No Layer 3 - (%s)", info_buffer ); ax25_nol3_tree = proto_item_add_subtree( ti, ett_ax25_nol3 ); - saved_private_data = pinfo->private_data; next_tvb = tvb_new_subset_remaining(tvb, offset); - dissected = FALSE; if ( gPREF_APRS ) { @@ -223,7 +219,6 @@ if ( ! dissected ) call_dissector( default_handle , next_tvb, pinfo, ax25_nol3_tree ); - pinfo->private_data = saved_private_data; } } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ax25.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ax25.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ax25.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ax25.c 2013-11-02 02:12:36.000000000 +0000 @@ -148,7 +148,6 @@ guint8 pid = AX25_P_NO_L3; guint8 src_ssid; guint8 dst_ssid; - void *saved_private_data; tvbuff_t *next_tvb = NULL; @@ -254,16 +253,12 @@ proto_item_set_end(ti, tvb, offset); - saved_private_data = pinfo->private_data; - next_tvb = tvb_new_subset_remaining(tvb, offset); if (!dissector_try_uint(ax25_dissector_table, pid, next_tvb, pinfo, parent_tree)) { call_dissector(data_handle, next_tvb, pinfo, parent_tree); } - - pinfo->private_data = saved_private_data; } else proto_item_set_end(ti, tvb, offset); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ber.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ber.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ber.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ber.c 2013-11-02 02:12:36.000000000 +0000 @@ -1011,7 +1011,7 @@ } int -call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) +call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data) { tvbuff_t *next_tvb; const char *syntax = NULL; @@ -1024,9 +1024,9 @@ if (oid == NULL || ((((syntax = get_ber_oid_syntax(oid)) == NULL) || /* First see if a syntax has been registered for this oid (user defined) */ - !dissector_try_string(ber_syntax_dissector_table, syntax, next_tvb, pinfo, tree)) && + !dissector_try_string_new(ber_syntax_dissector_table, syntax, next_tvb, pinfo, tree, data)) && /* Then try registered oid's */ - (!dissector_try_string(ber_oid_dissector_table, oid, next_tvb, pinfo, tree)))) { + (!dissector_try_string_new(ber_oid_dissector_table, oid, next_tvb, pinfo, tree, data)))) { proto_item *item = NULL; proto_tree *next_tree = NULL; gint length_remaining; @@ -4993,7 +4993,7 @@ offset = actx->external.u.ber.ber_callback(FALSE, tvb, offset, actx, tree, hf_index); } else if (actx->external.direct_ref_present && dissector_get_string_handle(ber_oid_dissector_table, actx->external.direct_reference)) { - offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); } else { offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->external.octet_aligned); } @@ -5025,7 +5025,7 @@ if (actx->external.u.ber.ber_callback) { offset = actx->external.u.ber.ber_callback(FALSE, tvb, offset, actx, tree, hf_index); } else { - offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); } return offset; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ber.h wireshark-1.12.0~201311020920/epan/dissectors/packet-ber.h --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ber.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ber.h 2013-11-02 02:12:36.000000000 +0000 @@ -232,7 +232,7 @@ extern int dissect_ber_bitstring32(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *parent_tree, tvbuff_t *tvb, int offset, int **bit_fields, gint hf_id, gint ett_id, tvbuff_t **out_tvb); WS_DLL_PUBLIC -int call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); +int call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data); WS_DLL_PUBLIC void register_ber_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto, const char *name); WS_DLL_PUBLIC diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-bootp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-bootp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-bootp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-bootp.c 2013-11-02 02:12:36.000000000 +0000 @@ -1212,7 +1212,7 @@ uat_bootp_record_t* rec = (uat_bootp_record_t *)r; if ((rec->opt == 0) || (rec->opt >=BOOTP_OPT_NUM-1)) - *err = ep_strdup_printf("Option must be between 1 and %d", BOOTP_OPT_NUM-2); + *err = g_strdup_printf("Option must be between 1 and %d", BOOTP_OPT_NUM-2); } static void uat_bootp_record_free_cb(void*r) { @@ -5320,7 +5320,7 @@ /* Now apply the custom options */ for (i = 0; i < num_bootp_records_uat; i++) { - bootp_opt[uat_bootp_records[i].opt].text = se_strdup(uat_bootp_records[i].text); + bootp_opt[uat_bootp_records[i].opt].text = wmem_strdup(wmem_file_scope(), uat_bootp_records[i].text); bootp_opt[uat_bootp_records[i].opt].ftype = uat_bootp_records[i].ftype; bootp_opt[uat_bootp_records[i].opt].phf = NULL; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-bpq.c wireshark-1.12.0~201311020920/epan/dissectors/packet-bpq.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-bpq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-bpq.c 2013-11-02 02:12:36.000000000 +0000 @@ -66,7 +66,6 @@ proto_tree *bpq_tree; int offset; guint16 bpq_len; - void *saved_private_data; tvbuff_t *next_tvb; @@ -100,11 +99,9 @@ offset += BPQ_HEADER_SIZE; - saved_private_data = pinfo->private_data; /* XXX - use the length */ next_tvb = tvb_new_subset_remaining( tvb, offset ); call_dissector( ax25_handle, next_tvb, pinfo, parent_tree ); - pinfo->private_data = saved_private_data; } void diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-brdwlk.c wireshark-1.12.0~201311020920/epan/dissectors/packet-brdwlk.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-brdwlk.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-brdwlk.c 2013-11-02 02:12:36.000000000 +0000 @@ -225,7 +225,6 @@ col_clear(pinfo->cinfo, COL_INFO); - pinfo->vsan = (tvb_get_ntohs(tvb, offset) & 0xFFF); sof = (tvb_get_guint8(tvb, offset) & 0xF0) >> 4; if ((sof == FCM_DELIM_SOFI3) || (sof == FCM_DELIM_SOFI2) || (sof == FCM_DELIM_SOFI1) diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-bt3ds.c wireshark-1.12.0~201311020920/epan/dissectors/packet-bt3ds.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-bt3ds.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-bt3ds.c 2013-11-02 02:12:36.000000000 +0000 @@ -66,14 +66,13 @@ guint8 value; col_set_str(pinfo->cinfo, COL_PROTOCOL, "3DS"); - col_clear(pinfo->cinfo, COL_INFO); switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btamp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btamp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btamp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btamp.c 2013-11-02 02:12:36.000000000 +0000 @@ -392,10 +392,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btatt.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btatt.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btatt.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btatt.c 2013-11-02 02:12:36.000000000 +0000 @@ -57,6 +57,8 @@ static int hf_btatt_flags = -1; static int hf_btatt_sign_counter = -1; static int hf_btatt_signature = -1; +static int hf_btatt_attribute_data = -1; +static int hf_btatt_handles_info = -1; /* Initialize the subtree pointers */ static gint ett_btatt = -1; @@ -267,10 +269,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -288,7 +290,7 @@ opcode = tvb_get_guint8(tvb, 0); offset++; - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(opcode, opcode_vals, "")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(opcode, opcode_vals, "")); switch (opcode) { case 0x01: /* Error Response */ @@ -370,7 +372,7 @@ case 0x07: /* Find By Type Value Response */ while( tvb_length_remaining(tvb, offset) > 0 ) { - item = proto_tree_add_text(st, tvb, offset, 4, + item = proto_tree_add_none_format(st, hf_btatt_handles_info, tvb, offset, 4, "Handles Info, Handle: 0x%04x, Group End Handle: 0x%04x", tvb_get_letohs(tvb, offset), tvb_get_letohs(tvb, offset+2)); @@ -419,7 +421,8 @@ while (tvb_length_remaining(tvb, offset) >= length) { - item = proto_tree_add_text(st, tvb, offset, length, "Attribute Data, Handle: 0x%04x", + item = proto_tree_add_none_format(st, hf_btatt_attribute_data, tvb, + offset, length, "Attribute Data, Handle: 0x%04x", tvb_get_letohs(tvb, offset)); ltree = proto_item_add_subtree(item, ett_btatt_list); @@ -479,7 +482,7 @@ col_append_fstr(pinfo->cinfo, COL_INFO, ", Attribute List Length: %u", tvb_length_remaining(tvb, offset)/length); while (tvb_length_remaining(tvb, offset) >= length) { - item = proto_tree_add_text(st, tvb, offset, length, + item = proto_tree_add_none_format(st, hf_btatt_attribute_data, tvb, offset, length, "Attribute Data, Handle: 0x%04x, Group End Handle: 0x%04x", tvb_get_letohs(tvb, offset), tvb_get_letohs(tvb, offset+2)); @@ -560,6 +563,16 @@ FT_UINT8, BASE_HEX, VALS(opcode_vals), 0x0, NULL, HFILL} }, + {&hf_btatt_handles_info, + {"Handles Info", "btatt.handles_info", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL} + }, + {&hf_btatt_attribute_data, + {"Attribute Data", "btatt.attribute_data", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL} + }, {&hf_btatt_handle, {"Handle", "btatt.handle", FT_UINT16, BASE_HEX, NULL, 0x0, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btavctp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btavctp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btavctp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btavctp.c 2013-11-02 02:12:36.000000000 +0000 @@ -126,10 +126,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btavdtp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btavdtp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btavdtp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btavdtp.c 2013-11-02 02:12:36.000000000 +0000 @@ -105,6 +105,7 @@ static int hf_btavdtp_message_type = -1; static int hf_btavdtp_packet_type = -1; static int hf_btavdtp_transaction = -1; +static int hf_btavdtp_signal = -1; static int hf_btavdtp_signal_id = -1; static int hf_btavdtp_rfa0 = -1; static int hf_btavdtp_number_of_signal_packets = -1; @@ -115,6 +116,9 @@ static int hf_btavdtp_sep_type = -1; static int hf_btavdtp_sep_rfa1 = -1; static int hf_btavdtp_error_code = -1; +static int hf_btavdtp_acp_sep = -1; +static int hf_btavdtp_acp_seid_item = -1; +static int hf_btavdtp_int_seid_item = -1; static int hf_btavdtp_acp_seid = -1; static int hf_btavdtp_int_seid = -1; static int hf_btavdtp_service_category = -1; @@ -221,6 +225,9 @@ static int hf_btavdtp_vendor_id = -1; static int hf_btavdtp_vendor_specific_codec_id = -1; static int hf_btavdtp_vendor_specific_value = -1; +static int hf_btavdtp_capabilities = -1; +static int hf_btavdtp_service = -1; +static int hf_btavdtp_service_multiplexing_entry = -1; static gint ett_btavdtp = -1; static gint ett_btavdtp_sep = -1; @@ -490,7 +497,7 @@ seid = seid >> 2; media_type = tvb_get_guint8(tvb, offset + 1) >> 4; type = (tvb_get_guint8(tvb, offset + 1) & 0x08) >> 3; - sep_item = proto_tree_add_text(tree, tvb, offset, 2, "ACP SEP [%u - %s %s] item %u/%u", + sep_item = proto_tree_add_none_format(tree, hf_btavdtp_acp_sep, tvb, offset, 2, "ACP SEP [%u - %s %s] item %u/%u", seid, val_to_str_const(media_type, media_type_vals, "unknown"), val_to_str_const(type, sep_type_vals, "unknown"), i_sep, items); sep_tree = proto_item_add_subtree(sep_item, ett_btavdtp_sep); @@ -709,7 +716,7 @@ gint media_type = 0; gint media_codec_type = 0; - capabilities_item = proto_tree_add_text(tree, tvb, offset, tvb_length(tvb) - offset, "Capabilities"); + capabilities_item = proto_tree_add_item(tree, hf_btavdtp_capabilities, tvb, offset, tvb_length(tvb) - offset, ENC_NA); capabilities_tree = proto_item_add_subtree(capabilities_item, ett_btavdtp_capabilities); if (codec) { @@ -719,7 +726,7 @@ while (tvb_length_remaining(tvb, offset) > 0) { service_category = tvb_get_guint8(tvb, offset); losc = tvb_get_guint8(tvb, offset + 1); - service_item = proto_tree_add_text(capabilities_tree, tvb, offset, 2 + losc, "Service: %s", val_to_str_const(service_category, service_category_vals, "RFD")); + service_item = proto_tree_add_none_format(capabilities_tree, hf_btavdtp_service, tvb, offset, 2 + losc, "Service: %s", val_to_str_const(service_category, service_category_vals, "RFD")); service_tree = proto_item_add_subtree(service_item, ett_btavdtp_service); proto_tree_add_item(service_tree, hf_btavdtp_service_category, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -821,7 +828,7 @@ losc -= 1; if (losc >= 2) { - pitem = proto_tree_add_text(service_tree, tvb, offset, 1 + losc, "Entry: Media Transport Session"); + pitem = proto_tree_add_none_format(service_tree, hf_btavdtp_service_multiplexing_entry, tvb, offset, 1 + losc, "Entry: Media Transport Session"); ptree = proto_item_add_subtree(pitem, ett_btavdtp_service); proto_tree_add_item(ptree, hf_btavdtp_multiplexing_tsid, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -835,7 +842,7 @@ } if (losc >= 2) { - pitem = proto_tree_add_text(service_tree, tvb, offset, 1 + losc, "Entry: Reporting Transport Session"); + pitem = proto_tree_add_none_format(service_tree, hf_btavdtp_service_multiplexing_entry, tvb, offset, 1 + losc, "Entry: Reporting Transport Session"); ptree = proto_item_add_subtree(pitem, ett_btavdtp_service); proto_tree_add_item(ptree, hf_btavdtp_multiplexing_tsid, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -849,7 +856,7 @@ } if (losc >= 2) { - pitem = proto_tree_add_text(service_tree, tvb, offset, 1 + losc, "Entry: Recovery Transport Session"); + pitem = proto_tree_add_none_format(service_tree, hf_btavdtp_service_multiplexing_entry, tvb, offset, 1 + losc, "Entry: Recovery Transport Session"); ptree = proto_item_add_subtree(pitem, ett_btavdtp_service); proto_tree_add_item(ptree, hf_btavdtp_multiplexing_tsid, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -894,7 +901,7 @@ } if (seid_side == SEID_ACP) { - seid_item = proto_tree_add_text(tree, tvb, offset, 1, + seid_item = proto_tree_add_none_format(tree, hf_btavdtp_acp_seid_item, tvb, offset, 1, "ACP SEID [%u - %s %s]", seid, get_sep_media_type(pinfo->fd->num, seid), get_sep_type(pinfo->fd->num, seid)); seid_tree = proto_item_add_subtree(seid_item, ett_btavdtp_sep); proto_tree_add_item(seid_tree, hf_btavdtp_acp_seid, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -903,7 +910,7 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " - ACP SEID [%u - %s %s]", seid, get_sep_media_type(pinfo->fd->num, seid), get_sep_type(pinfo->fd->num, seid)); } else { - seid_item = proto_tree_add_text(tree, tvb, offset, 1, + seid_item = proto_tree_add_none_format(tree, hf_btavdtp_int_seid_item, tvb, offset, 1, "INT SEID [%u - %s %s]", seid, get_sep_media_type(pinfo->fd->num, seid), get_sep_type(pinfo->fd->num, seid)); seid_tree = proto_item_add_subtree(seid_item, ett_btavdtp_sep); proto_tree_add_item(seid_tree, hf_btavdtp_int_seid, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -912,6 +919,7 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " - INT SEID [%u - %s %s]", seid, get_sep_media_type(pinfo->fd->num, seid), get_sep_type(pinfo->fd->num, seid)); } + proto_tree_add_item(seid_tree, hf_btavdtp_rfa_seid, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -945,17 +953,16 @@ gint codec; col_set_str(pinfo->cinfo, COL_PROTOCOL, "AVDTP"); - col_clear(pinfo->cinfo, COL_INFO); l2cap_data = (btl2cap_data_t *) pinfo->private_data; switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -1072,7 +1079,8 @@ message_type = (tvb_get_guint8(tvb, offset) & AVDTP_MESSAGE_TYPE_MASK); packet_type = (tvb_get_guint8(tvb, offset) & AVDTP_PACKET_TYPE_MASK) >> 2; - signal_item = proto_tree_add_text(btavdtp_tree, tvb, offset, (packet_type == PACKET_TYPE_START) ? 3 : 2, "Signal: "); + signal_item = proto_tree_add_item(btavdtp_tree, hf_btavdtp_signal, tvb, offset, + (packet_type == PACKET_TYPE_START) ? 3 : 2, ENC_NA); signal_tree = proto_item_add_subtree(signal_item, ett_btavdtp_sep); proto_tree_add_item(signal_tree, hf_btavdtp_transaction, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -1091,7 +1099,7 @@ proto_tree_add_item(signal_tree, hf_btavdtp_signal_id, tvb, offset, 1, ENC_BIG_ENDIAN); signal_id = tvb_get_guint8(tvb, offset) & AVDTP_SIGNAL_ID_MASK; - proto_item_append_text(signal_item, "%s (%s)", + proto_item_append_text(signal_item, ": %s (%s)", val_to_str_const(signal_id, signal_id_vals, "Unknown signal"), val_to_str_const(message_type, message_type_vals, "Unknown message type")); @@ -1317,6 +1325,11 @@ module_t *module; static hf_register_info hf[] = { + { &hf_btavdtp_signal, + { "Signal", "btavdtp.signal", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, { &hf_btavdtp_message_type, { "Message Type", "btavdtp.message_type", FT_UINT8, BASE_HEX, VALS(message_type_vals), AVDTP_MESSAGE_TYPE_MASK, @@ -1333,7 +1346,7 @@ NULL, HFILL } }, { &hf_btavdtp_signal_id, - { "Signal", "btavdtp.sinal_id", + { "Signal", "btavdtp.signal_id", FT_UINT8, BASE_HEX, VALS(signal_id_vals), AVDTP_SIGNAL_ID_MASK, NULL, HFILL } }, @@ -1382,7 +1395,21 @@ FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL } }, - + { &hf_btavdtp_acp_sep, + { "ACP SEP", "btavdtp.acp_sep", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavdtp_acp_seid_item, + { "ACP SEID", "btavdtp.acp_seid_item", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavdtp_int_seid_item, + { "INT SEID", "btavdtp.int_seid_item", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, { &hf_btavdtp_acp_seid, { "ACP SEID", "btavdtp.acp_seid", FT_UINT8, BASE_DEC, NULL, 0xFC, @@ -1913,11 +1940,26 @@ FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + { &hf_btavdtp_capabilities, + { "Capabilities", "btavdtp.capabilities", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_btavdtp_service, + { "Service", "btavdtp.service", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_btavdtp_service_multiplexing_entry, + { "Entry", "btavdtp.service_multiplexing_entry", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, { &hf_btavdtp_data, { "Data", "btavdtp.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, + } }; static gint *ett[] = { @@ -1983,11 +2025,11 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; case P2P_DIR_UNKNOWN: @@ -2100,11 +2142,11 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; case P2P_DIR_UNKNOWN: diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btavrcp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btavrcp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btavrcp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btavrcp.c 2013-11-02 02:12:36.000000000 +0000 @@ -62,6 +62,8 @@ static int hf_btavrcp_unit_id = -1; static int hf_btavrcp_subunit_page = -1; static int hf_btavrcp_subunit_extention_code = -1; +static int hf_btavrcp_item = -1; +static int hf_btavrcp_folder = -1; static int hf_btavrcp_player_id = -1; static int hf_btavrcp_status = -1; static int hf_btavrcp_uid_counter = -1; @@ -74,9 +76,6 @@ static int hf_btavrcp_search = -1; static int hf_btavrcp_search_length = -1; static int hf_btavrcp_number_of_attributes = -1; -static int hf_btavrcp_attribute_count = -1; -static int hf_btavrcp_attribute_value = -1; -static int hf_btavrcp_attribute_value_length = -1; static int hf_btavrcp_uid = -1; static int hf_btavrcp_scope = -1; static int hf_btavrcp_start_item = -1; @@ -100,7 +99,6 @@ static int hf_btavrcp_number_of_settings = -1; static int hf_btavrcp_settings_attribute = -1; static int hf_btavrcp_settings_value = -1; -static int hf_btavrcp_attribute = -1; static int hf_btavrcp_displayable_name = -1; static int hf_btavrcp_displayable_name_length = -1; static int hf_btavrcp_media_type = -1; @@ -108,10 +106,20 @@ static int hf_btavrcp_folder_playable = -1; static int hf_btavrcp_major_player_type = -1; static int hf_btavrcp_player_subtype = -1; +static int hf_btavrcp_player_item = -1; +static int hf_btavrcp_attribute = -1; +static int hf_btavrcp_attribute_count = -1; +static int hf_btavrcp_attribute_value = -1; +static int hf_btavrcp_attribute_value_length = -1; +static int hf_btavrcp_attribute_item = -1; +static int hf_btavrcp_attribute_list = -1; +static int hf_btavrcp_attribute_entries = -1; static int hf_btavrcp_attribute_name_length = -1; static int hf_btavrcp_attribute_name = -1; static int hf_btavrcp_setting_value_length = -1; static int hf_btavrcp_setting_value = -1; +static int hf_btavrcp_features = -1; +static int hf_btavrcp_not_used_features = -1; static int hf_btavrcp_feature_reserved_0 = -1; static int hf_btavrcp_feature_reserved_1 = -1; static int hf_btavrcp_feature_reserved_2 = -1; @@ -187,7 +195,8 @@ static int hf_btavrcp_feature_only_searchable_when_addressed = -1; static int hf_btavrcp_feature_nowplaying = -1; static int hf_btavrcp_feature_uid_persistency = -1; - +static int hf_btavrcp_reassembled = -1; +static int hf_btavrcp_currect_path = -1; static int hf_btavrcp_response_time = -1; static int hf_btavrcp_data = -1; @@ -588,7 +597,7 @@ proto_item *pitem; proto_tree *ptree; - pitem = proto_tree_add_text(tree, tvb, offset, count * 4, "Attribute List"); + pitem = proto_tree_add_item(tree, hf_btavrcp_attribute_list, tvb, offset, count * 4, ENC_NA); ptree = proto_item_add_subtree(pitem, ett_btavrcp_attribute_list); for (i_attribute = 0; i_attribute < count; ++i_attribute) { @@ -619,7 +628,7 @@ length += 4 + 2 + 2 + tvb_get_ntohs(tvb, offset + length + 4 + 2); } - pitem = proto_tree_add_text(tree, tvb, offset, length, "Attribute Entries"); + pitem = proto_tree_add_item(tree, hf_btavrcp_attribute_entries, tvb, offset, length, ENC_NA); ptree = proto_item_add_subtree(pitem, ett_btavrcp_attribute_entries); for (i_entry = 0; i_entry < count; ++i_entry) { @@ -629,7 +638,7 @@ if (attribute_id == 0x01) col_append_fstr(pinfo->cinfo, COL_INFO, " - Title: \"%s\"", value); - entry_item = proto_tree_add_text(ptree, tvb, offset, 4 + 2 + 2 + value_length, "Attribute [%21s]: %s", val_to_str_const(attribute_id, attribute_id_vals, "Unknown"), value); + entry_item = proto_tree_add_none_format(ptree, hf_btavrcp_attribute_item, tvb, offset, 4 + 2 + 2 + value_length, "Attribute [%21s]: %s", val_to_str_const(attribute_id, attribute_id_vals, "Unknown"), value); entry_tree = proto_item_add_subtree(entry_item, ett_btavrcp_attribute_entry); proto_tree_add_item(entry_tree, hf_btavrcp_attribute, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -665,7 +674,7 @@ displayable_name_length = tvb_get_ntohs(tvb, offset + 1 + 2 + 1 + 1 + 4 + 16 + 1 + 2); displayable_name = tvb_get_string(NULL, tvb, offset + 1 + 2 + 1 + 1 + 4 + 16 + 1 + 2 + 2, displayable_name_length); - pitem = proto_tree_add_text(tree, tvb, offset, 1 + 2 + item_length, "Player: %s", displayable_name); + pitem = proto_tree_add_none_format(tree, hf_btavrcp_player_item, tvb, offset, 1 + 2 + item_length, "Player: %s", displayable_name); ptree = proto_item_add_subtree(pitem, ett_btavrcp_player); proto_tree_add_item(ptree, hf_btavrcp_item_type, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -683,10 +692,10 @@ offset += 4; /* feature bit mask */ - features_item = proto_tree_add_text(ptree, tvb, offset, 16, "Features"); + features_item = proto_tree_add_item(ptree, hf_btavrcp_features, tvb, offset, 16, ENC_NA); features_tree = proto_item_add_subtree(features_item, ett_btavrcp_features); - features_not_set_item = proto_tree_add_text(features_tree, tvb, offset, 16, "Not Used Features"); + features_not_set_item = proto_tree_add_item(features_tree, hf_btavrcp_not_used_features, tvb, offset, 16, ENC_NA); features_not_set_tree = proto_item_add_subtree(features_not_set_item, ett_btavrcp_features_not_used); feature_octet = tvb_get_guint8(tvb, offset + 0); @@ -827,7 +836,7 @@ displayable_name_length = tvb_get_ntohs(tvb, offset + 1 + 2 + 8 + 1 + 2); displayable_name = tvb_get_string(NULL, tvb, offset + 1 + 2 + 8 + 1 + 2 + 2, displayable_name_length); - pitem = proto_tree_add_text(tree, tvb, offset, 1 + 2 + item_length, "Element: %s", displayable_name); + pitem = proto_tree_add_none_format(tree, hf_btavrcp_item , tvb, offset, 1 + 2 + item_length, "Element: %s", displayable_name); ptree = proto_item_add_subtree(pitem, ett_btavrcp_element); proto_tree_add_item(ptree, hf_btavrcp_item_type, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -879,7 +888,7 @@ displayable_name_length = tvb_get_ntohs(tvb, offset + 1 + 2 + 8 + 1 + 1 + 2); displayable_name = tvb_get_string(NULL, tvb, offset + 1 + 2 + 8 + 1 + 1 + 2 + 2, displayable_name_length); - pitem = proto_tree_add_text(tree, tvb, offset, 1 + 2 + item_length, "Folder : %s", displayable_name); + pitem = proto_tree_add_none_format(tree, hf_btavrcp_folder, tvb, offset, 1 + 2 + item_length, "Folder : %s", displayable_name); ptree = proto_item_add_subtree(pitem, ett_btavrcp_folder); proto_tree_add_item(ptree, hf_btavrcp_item_type, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -1112,7 +1121,7 @@ wmem_tree_insert32_array(reassembling, key, fragment); } - col_append_fstr(pinfo->cinfo, COL_INFO, " [start]"); + col_append_str(pinfo->cinfo, COL_INFO, " [start]"); return offset; } else if (packet_type == PACKET_TYPE_CONTINUE) { if (pinfo->fd->flags.visited == 0) { @@ -1156,13 +1165,13 @@ } } - col_append_fstr(pinfo->cinfo, COL_INFO, " [continue]"); + col_append_str(pinfo->cinfo, COL_INFO, " [continue]"); return offset; } else if (packet_type == PACKET_TYPE_END) { guint i_frame; tvbuff_t *next_tvb; - col_append_fstr(pinfo->cinfo, COL_INFO, " [end]"); + col_append_str(pinfo->cinfo, COL_INFO, " [end]"); k_interface_id = interface_id; k_adapter_id = adapter_id; @@ -1232,7 +1241,7 @@ tvb = next_tvb; offset = 0; - pitem = proto_tree_add_text(tree, tvb, offset, 0, "Reassembled"); + pitem = proto_tree_add_item(tree, hf_btavrcp_reassembled, tvb, offset, 0, ENC_NA); PROTO_ITEM_SET_GENERATED(pitem); } } @@ -1484,7 +1493,7 @@ offset += 8; col_append_fstr(pinfo->cinfo, COL_INFO, " - 0x%08X%08X", (guint) (identifier >> 32), (guint) (identifier & 0xFFFFFFFF)); - if (identifier == 0x00) col_append_fstr(pinfo->cinfo, COL_INFO, " (PLAYING)"); + if (identifier == 0x00) col_append_str(pinfo->cinfo, COL_INFO, " (PLAYING)"); pitem = proto_tree_add_item(tree, hf_btavrcp_number_of_attributes, tvb, offset, 1, ENC_BIG_ENDIAN); number_of_attributes = tvb_get_guint8(tvb, offset); @@ -1561,10 +1570,10 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " - 0x%08X%08X", (guint) (identifier >> 32), (guint) (identifier & 0xFFFFFFFF)); if (identifier == G_GINT64_CONSTANT(0x0000000000000000)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " (SELECTED)"); + col_append_str(pinfo->cinfo, COL_INFO, " (SELECTED)"); proto_item_append_text(pitem, " (SELECTED)"); } else if (identifier == G_GINT64_CONSTANT(0xFFFFFFFFFFFFFFFF)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " (NOT SELECTED)"); + col_append_str(pinfo->cinfo, COL_INFO, " (NOT SELECTED)"); proto_item_append_text(pitem, " (NOT SELECTED)"); } @@ -1582,7 +1591,7 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " - SongPosition: %ums", song_position); if (song_position == 0xFFFFFFFF) { proto_item_append_text(pitem, " (NOT SELECTED)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (NOT SELECTED)"); + col_append_str(pinfo->cinfo, COL_INFO, " (NOT SELECTED)"); } break; case EVENT_BATTERY_STATUS_CHANGED: @@ -1894,8 +1903,8 @@ folder_depth = tvb_get_guint8(tvb, offset); offset += 1; - pitem = proto_tree_add_text(tree, tvb, offset, -1, "Current Path: /"); - col_append_fstr(pinfo->cinfo, COL_INFO, "Current Path: /"); + pitem = proto_tree_add_none_format(tree, hf_btavrcp_currect_path, tvb, offset, -1, "Current Path: /"); + col_append_str(pinfo->cinfo, COL_INFO, "Current Path: /"); ptree = proto_item_add_subtree(pitem, ett_btavrcp_path); for (i_folder = 0; i_folder < folder_depth; ++i_folder) { @@ -2092,14 +2101,13 @@ avctp_data = (btavctp_data_t *) pinfo->private_data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "AVRCP"); - col_clear(pinfo->cinfo, COL_INFO); switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -2611,6 +2619,46 @@ FT_UINT8, BASE_HEX, VALS(system_status_vals), 0x00, NULL, HFILL } }, + { &hf_btavrcp_player_item, + { "Player", "btavrcp.player_item", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavrcp_folder, + { "Folder", "btavrcp.folder", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavrcp_item, + { "Item", "btavrcp.item", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavrcp_features, + { "Features", "btavrcp.features", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavrcp_not_used_features, + { "Not Used Features", "btavrcp.not_used_features", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavrcp_attribute_list, + { "Attribute List", "btavrcp.attribute_list", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavrcp_attribute_item, + { "Attribute", "btavrcp.attribute_item", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavrcp_attribute_entries, + { "Attribute Entries", "btavrcp.attribute_entries", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, { &hf_btavrcp_attribute, { "Attribute ID", "btavrcp.attribute", FT_UINT32, BASE_HEX, VALS(attribute_id_vals), 0x00, @@ -3058,12 +3106,21 @@ NULL, HFILL } }, /* end of features */ + { &hf_btavrcp_currect_path, + { "Currect Path", "btavrcp.currect_path", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavrcp_reassembled, + { "Reassembled", "btavrcp.reassembled", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, { &hf_btavrcp_response_time, { "Response Time", "btavrcp.response_time", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, - { &hf_btavrcp_data, { "Data", "btavrcp.data", FT_NONE, BASE_NONE, NULL, 0x0, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btbnep.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btbnep.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btbnep.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btbnep.c 2013-11-02 02:12:36.000000000 +0000 @@ -292,10 +292,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -313,8 +313,8 @@ bnep_type = bnep_type & 0x7F; offset += 1; - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(bnep_type, bnep_type_vals, "Unknown type")); - if (extension_flag) col_append_fstr(pinfo->cinfo, COL_INFO, "+E"); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(bnep_type, bnep_type_vals, "Unknown type")); + if (extension_flag) col_append_str(pinfo->cinfo, COL_INFO, "+E"); if (bnep_type == BNEP_TYPE_GENERAL_ETHERNET || bnep_type == BNEP_TYPE_COMPRESSED_ETHERNET_DESTINATION_ONLY) { dst_addr = tvb_get_ptr(tvb, offset, 6); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-bthci_acl.c wireshark-1.12.0~201311020920/epan/dissectors/packet-bthci_acl.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-bthci_acl.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-bthci_acl.c 2013-11-02 02:12:36.000000000 +0000 @@ -121,10 +121,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-bthci_cmd.c wireshark-1.12.0~201311020920/epan/dissectors/packet-bthci_cmd.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-bthci_cmd.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-bthci_cmd.c 2013-11-02 02:12:36.000000000 +0000 @@ -371,6 +371,9 @@ static int hf_bthci_cmd_eir_ad_advertising_interval = -1; static int hf_bthci_cmd_eir_ad_ssp_oob_length = -1; static int hf_bthci_cmd_eir_ad_company_id = -1; +static int hf_eir_ad_item = -1; +static int hf_extended_inquiry_response_data = -1; +static int hf_advertising_data = -1; static int hf_3ds_association_notification = -1; static int hf_3ds_battery_level_reporting = -1; static int hf_3ds_send_battery_level_report_on_startup = -1; @@ -1584,8 +1587,9 @@ proto_item *sub_item; if (tree) { - ti_data=proto_tree_add_text(tree, tvb, offset, data_size, (size==240)?"Extended Inquiry Response Data":"Advertising Data"); - ti_data_subtree=proto_item_add_subtree(ti_data, ett_eir_subtree); + ti_data = proto_tree_add_item(tree, (size == 240) ? hf_extended_inquiry_response_data : hf_advertising_data, + tvb, offset, data_size, ENC_NA); + ti_data_subtree = proto_item_add_subtree(ti_data, ett_eir_subtree); } i=0; @@ -1596,15 +1600,14 @@ proto_item *ti_data_struct; proto_tree *ti_data_struct_subtree; - ti_data_struct = proto_tree_add_text(ti_data_subtree, tvb, offset + i, length + 1, "%s", ""); - ti_data_struct_subtree = proto_item_add_subtree(ti_data_struct, ett_eir_struct_subtree); - type = tvb_get_guint8(tvb, offset + i + 1); - proto_item_append_text(ti_data_struct, "%s", val_to_str_const(type, bthci_cmd_eir_data_type_vals, "Unknown")); + ti_data_struct = proto_tree_add_none_format(ti_data_subtree, hf_eir_ad_item, tvb, offset + i, length + 1, "%s", + val_to_str_const(type, bthci_cmd_eir_data_type_vals, "Unknown")); + ti_data_struct_subtree = proto_item_add_subtree(ti_data_struct, ett_eir_struct_subtree); - proto_tree_add_item(ti_data_struct_subtree,hf_bthci_cmd_eir_struct_length, tvb, offset + i, 1, ENC_LITTLE_ENDIAN); - proto_tree_add_item(ti_data_struct_subtree,hf_bthci_cmd_eir_struct_type, tvb, offset + i + 1, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(ti_data_struct_subtree, hf_bthci_cmd_eir_struct_length, tvb, offset + i, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(ti_data_struct_subtree, hf_bthci_cmd_eir_struct_type, tvb, offset + i + 1, 1, ENC_LITTLE_ENDIAN); switch (type) { case 0x01: /* flags */ @@ -3214,10 +3217,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -4972,6 +4975,21 @@ FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_evt_comp_id_ext, 0x0, NULL, HFILL } }, + { &hf_eir_ad_item, + { "Item", "bthci_cmd.eir_ad", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_extended_inquiry_response_data, + { "Extended Inquiry Response Data", "bthci_cmd.extended_inquiry_response_data", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_advertising_data, + { "Advertising Data", "bthci_cmd.advertising_data", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, { &hf_3ds_association_notification, { "3DS Association Notification", "bthci_cmd.eir_ad.3ds.association_notification", FT_BOOLEAN, 8, NULL, 0x01, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-bthci_evt.c wireshark-1.12.0~201311020920/epan/dissectors/packet-bthci_evt.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-bthci_evt.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-bthci_evt.c 2013-11-02 02:12:36.000000000 +0000 @@ -332,6 +332,7 @@ static int hf_bthci_evt_le_simultaneous_host = -1; static int hf_bthci_evt_le_acl_data_pkt_len = -1; static int hf_bthci_evt_total_num_le_acl_data_pkts = -1; +static int hf_bthci_evt_le_features = -1; static int hf_bthci_evt_le_feature_00 = -1; static int hf_bthci_evt_white_list_size = -1; static int hf_bthci_evt_le_channel_map = -1; @@ -358,6 +359,7 @@ static int hf_bthci_evt_oob_flags_le_supported_host = -1; static int hf_bthci_evt_oob_flags_simultaneous_le_and_br_edr_host = -1; static int hf_bthci_evt_oob_flags_address_type = -1; +static int hf_bthci_evt_le_states = -1; static int hf_bthci_evt_le_states_00 = -1; static int hf_bthci_evt_le_states_01 = -1; static int hf_bthci_evt_le_states_02 = -1; @@ -390,6 +392,10 @@ static int hf_bthci_evt_eir_ad_ssp_oob_length = -1; static int hf_bthci_evt_eir_ad_advertising_interval = -1; static int hf_bthci_evt_eir_ad_company_id = -1; +static int hf_eir_ad_item = -1; +static int hf_extended_inquiry_response_data = -1; +static int hf_advertising_data = -1; +static int hf_usable_packet_types = -1; static int hf_3ds_association_notification = -1; static int hf_3ds_battery_level_reporting = -1; static int hf_3ds_send_battery_level_report_on_startup = -1; @@ -1583,7 +1589,7 @@ proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; - handle_tree = proto_tree_add_text(tree, tvb, offset, 2, "Usable packet types: "); + handle_tree = proto_tree_add_item(tree, hf_usable_packet_types, tvb, offset, 2, ENC_NA); ti_ptype_subtree = proto_item_add_subtree(handle_tree, ett_ptype_subtree); if (flags & 0x0008) @@ -1760,12 +1766,8 @@ hci_data_t *hci_data = (hci_data_t *) pinfo->private_data; if(tree){ - if(size == 240 ) { /* EIR data */ - ti_eir=proto_tree_add_text(tree, tvb, offset, 240, "Extended Inquiry Response Data"); - } - else { /* Advertising data */ - ti_eir=proto_tree_add_text(tree, tvb, offset, size, "Advertising Data"); - } + ti_eir = proto_tree_add_item(tree, (size == 240) ? hf_extended_inquiry_response_data : hf_advertising_data, + tvb, offset, size, ENC_NA); ti_eir_subtree=proto_item_add_subtree(ti_eir, ett_eir_subtree); } @@ -1777,11 +1779,12 @@ proto_item *ti_eir_struct; proto_tree *ti_eir_struct_subtree; - ti_eir_struct = proto_tree_add_text(ti_eir_subtree, tvb, offset + i, length + 1, "%s", ""); - ti_eir_struct_subtree = proto_item_add_subtree(ti_eir_struct, ett_eir_struct_subtree); - type = tvb_get_guint8(tvb, offset + i + 1); + ti_eir_struct = proto_tree_add_none_format(ti_eir_subtree, hf_eir_ad_item, tvb, offset + i, length + 1, "%s", + val_to_str_ext_const(type, &bthci_cmd_eir_data_type_vals_ext, "Unknown")); + ti_eir_struct_subtree = proto_item_add_subtree(ti_eir_struct, ett_eir_struct_subtree); + proto_item_append_text(ti_eir_struct,"%s", val_to_str_ext_const(type, &bthci_cmd_eir_data_type_vals_ext, "Unknown")); proto_tree_add_item(ti_eir_struct_subtree,hf_bthci_evt_eir_struct_length, tvb, offset + i, 1, ENC_LITTLE_ENDIAN); @@ -3223,7 +3226,7 @@ proto_item *ti_le_features; proto_item *ti_le_subtree; - ti_le_features = proto_tree_add_text(tree, tvb, offset, 8, "LE Features"); + ti_le_features = proto_tree_add_item(tree, hf_bthci_evt_le_features, tvb, offset, 8, ENC_NA); ti_le_subtree = proto_item_add_subtree(ti_le_features, ett_lmp_subtree); proto_tree_add_item(ti_le_subtree,hf_bthci_evt_le_feature_00, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -3285,7 +3288,7 @@ proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; - ti_le_states=proto_tree_add_text(tree, tvb, offset, 8, "Supported LE States"); + ti_le_states=proto_tree_add_item(tree, hf_bthci_evt_le_states, tvb, offset, 8, ENC_NA); ti_le_states_subtree=proto_item_add_subtree(ti_le_states, ett_le_state_subtree); proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_00, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -3642,10 +3645,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -3672,7 +3675,7 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_EVT"); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(evt_code, evt_code_vals, "Unknown 0x%08x")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(evt_code, evt_code_vals, "Unknown 0x%08x")); if (param_length > 0) { switch(evt_code) { @@ -5399,8 +5402,13 @@ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_bthci_evt_le_features, + { "Supported LE Features", "bthci_evt.le_features", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, { &hf_bthci_evt_le_feature_00, - { "LE Encryption", "bthci_evt.le_feature", + { "LE Encryption", "bthci_evt.le_features.encryption", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, @@ -5529,6 +5537,11 @@ FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x08, NULL, HFILL } }, + { &hf_bthci_evt_le_states, + { "Supported LE States", "bthci_evt.le_states", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, { &hf_bthci_evt_le_states_00, { "Non-connectable Advertising State", "bthci_evt.le_states_00", FT_BOOLEAN, 8, NULL, 0x01, @@ -5689,6 +5702,26 @@ FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_evt_comp_id_ext, 0x0, NULL, HFILL } }, + { &hf_eir_ad_item, + { "Item", "bthci_evt.eir_ad", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_extended_inquiry_response_data, + { "Extended Inquiry Response Data", "bthci_evt.extended_inquiry_response_data", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_advertising_data, + { "Advertising Data", "bthci_evt.advertising_data", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_usable_packet_types, + { "Usable Packet Types", "bthci_evt.usable_packet_types", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, { &hf_3ds_association_notification, { "3DS Association Notification", "bthci_evt.eir_ad.3ds.association_notification", FT_BOOLEAN, 8, NULL, 0x01, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-bthci_sco.c wireshark-1.12.0~201311020920/epan/dissectors/packet-bthci_sco.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-bthci_sco.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-bthci_sco.c 2013-11-02 02:12:36.000000000 +0000 @@ -54,10 +54,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-bthcrp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-bthcrp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-bthcrp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-bthcrp.c 2013-11-02 02:12:36.000000000 +0000 @@ -133,10 +133,10 @@ if (control_pdu_id >= 0x8000) { proto_item_append_text(pitem, " (Vendor Specific)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Vendor Specific)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Vendor Specific)"); } else if (control_pdu_id == 0x0000 || control_pdu_id >= 0x000B ) { proto_item_append_text(pitem, " (Reserved)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Reserved)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Reserved)"); } proto_tree_add_item(tree, hf_bthcrp_control_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -293,7 +293,7 @@ /* flow: server <-> client */ tvbuff_t *next_tvb; - col_append_fstr(pinfo->cinfo, COL_INFO, "HCRP data stream"); + col_append_str(pinfo->cinfo, COL_INFO, "HCRP data stream"); next_tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(data_handle, next_tvb, pinfo, tree); @@ -313,7 +313,7 @@ proto_item *pitem; if (is_client_message) { - col_append_fstr(pinfo->cinfo, COL_INFO, "Notification: unexpected notification stream"); + col_append_str(pinfo->cinfo, COL_INFO, "Notification: unexpected notification stream"); return offset; } @@ -325,14 +325,14 @@ if (notification_pdu_id >= 0x8000) { proto_item_append_text(pitem, " (Vendor Specific)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Vendor Specific)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Vendor Specific)"); if (tvb_length_remaining(tvb, offset)) { proto_tree_add_item(tree, hf_bthcrp_data, tvb, offset, -1, ENC_NA); offset += tvb_length_remaining(tvb, offset); } } else if (notification_pdu_id != 0x001) { proto_item_append_text(pitem, " (Reserved)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Reserved)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Reserved)"); } switch(notification_pdu_id) { @@ -357,14 +357,13 @@ l2cap_data = (btl2cap_data_t *) pinfo->private_data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCRP"); - col_clear(pinfo->cinfo, COL_INFO); switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-bthfp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-bthfp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-bthfp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-bthfp.c 2013-11-02 02:12:36.000000000 +0000 @@ -44,6 +44,7 @@ static int proto_bthfp = -1; +static int hf_command = -1; static int hf_role = -1; static int hf_at_cmd = -1; static int hf_at_cmd_type = -1; @@ -909,7 +910,7 @@ i_char += 1; } - command_item = proto_tree_add_text(tree, tvb, + command_item = proto_tree_add_none_format(tree, hf_command, tvb, offset, 0, "Command %u", command_number); command_tree = proto_item_add_subtree(command_item, ett_bthfp_command); @@ -1170,14 +1171,13 @@ dlci = rfcomm_data->dlci; col_set_str(pinfo->cinfo, COL_PROTOCOL, "HFP"); - col_clear(pinfo->cinfo, COL_INFO); switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", pinfo->p2p_dir); @@ -1251,8 +1251,8 @@ service_info->bd_addr_id == 0)) && service_info->type == BTSDP_RFCOMM_PROTOCOL_UUID && service_info->channel == (rfcomm_data->dlci >> 1)) { - if ((service_info->uuid == BTSDP_HFP_GW_SERVICE_UUID && pinfo->p2p_dir == P2P_DIR_SENT) || - (service_info->uuid == BTSDP_HFP_SERVICE_UUID && pinfo->p2p_dir == P2P_DIR_RECV)) { + if ((service_info->uuid.bt_uuid == BTSDP_HFP_GW_SERVICE_UUID && pinfo->p2p_dir == P2P_DIR_SENT) || + (service_info->uuid.bt_uuid == BTSDP_HFP_SERVICE_UUID && pinfo->p2p_dir == P2P_DIR_RECV)) { role = ROLE_HS; } else { role = ROLE_AG; @@ -1541,6 +1541,11 @@ expert_module_t *expert_bthfp; static hf_register_info hf[] = { + { &hf_command, + { "Command", "bthfp.command", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL} + }, { &hf_data, { "AT Stream", "bthfp.data", FT_STRING, BASE_NONE, NULL, 0, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-bthid.c wireshark-1.12.0~201311020920/epan/dissectors/packet-bthid.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-bthid.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-bthid.c 2013-11-02 02:12:36.000000000 +0000 @@ -431,48 +431,48 @@ proto_tree_add_item(tree, hf_bthid_data_keyboard_leds_num_lock, tvb, offset, 1, ENC_BIG_ENDIAN); leds = tvb_get_guint8(tvb, offset); - col_append_fstr(pinfo->cinfo, COL_INFO, " - LEDs: "); + col_append_str(pinfo->cinfo, COL_INFO, " - LEDs: "); if (leds & 0x01) { - col_append_fstr(pinfo->cinfo, COL_INFO, "NumLock"); + col_append_str(pinfo->cinfo, COL_INFO, "NumLock"); shortcut_helper = TRUE; } if (leds & 0x02) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, ", "); - col_append_fstr(pinfo->cinfo, COL_INFO, "CapsLock"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); + col_append_str(pinfo->cinfo, COL_INFO, "CapsLock"); shortcut_helper = TRUE; } if (leds & 0x04) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, ", "); - col_append_fstr(pinfo->cinfo, COL_INFO, "ScrollLock"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); + col_append_str(pinfo->cinfo, COL_INFO, "ScrollLock"); shortcut_helper = TRUE; } if (leds & 0x08) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, ", "); - col_append_fstr(pinfo->cinfo, COL_INFO, "Compose"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); + col_append_str(pinfo->cinfo, COL_INFO, "Compose"); shortcut_helper = TRUE; } if (leds & 0x10) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, ", "); - col_append_fstr(pinfo->cinfo, COL_INFO, "Kana"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); + col_append_str(pinfo->cinfo, COL_INFO, "Kana"); shortcut_helper = TRUE; } if (leds & 0x20) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, ", "); - col_append_fstr(pinfo->cinfo, COL_INFO, "Constant1"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); + col_append_str(pinfo->cinfo, COL_INFO, "Constant1"); shortcut_helper = TRUE; } if (leds & 0x40) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, ", "); - col_append_fstr(pinfo->cinfo, COL_INFO, "Constant2"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); + col_append_str(pinfo->cinfo, COL_INFO, "Constant2"); shortcut_helper = TRUE; } if (leds & 0x80) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, ", "); - col_append_fstr(pinfo->cinfo, COL_INFO, "Constant3"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); + col_append_str(pinfo->cinfo, COL_INFO, "Constant3"); /*shortcut_helper = TRUE;*/ } if (!leds) { - col_append_fstr(pinfo->cinfo, COL_INFO, "none"); + col_append_str(pinfo->cinfo, COL_INFO, "none"); } offset += 1; @@ -491,44 +491,44 @@ proto_tree_add_item(tree, hf_bthid_data_keyboard_modifier_left_ctrl, tvb, offset, 1, ENC_BIG_ENDIAN); modifier = tvb_get_guint8(tvb, offset); - col_append_fstr(pinfo->cinfo, COL_INFO, " - "); + col_append_str(pinfo->cinfo, COL_INFO, " - "); if (modifier & 0x80) { - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "RIGHT GUI"); + col_append_str(pinfo->cinfo, COL_INFO, "RIGHT GUI"); shortcut_helper = TRUE; } if (modifier & 0x40) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "RIGHT ALT"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "RIGHT ALT"); shortcut_helper = TRUE; } if (modifier & 0x20) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "RIGHT SHIFT"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "RIGHT SHIFT"); shortcut_helper = TRUE; } if (modifier & 0x10) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "RIGHT CTRL"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "RIGHT CTRL"); shortcut_helper = TRUE; } if (modifier & 0x08) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "LEFT GUI"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "LEFT GUI"); shortcut_helper = TRUE; } if (modifier & 0x04) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "LEFT ALT"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "LEFT ALT"); shortcut_helper = TRUE; } if (modifier & 0x02) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "LEFT SHIFT"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "LEFT SHIFT"); shortcut_helper = TRUE; } if (modifier & 0x01) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "LEFT CTRL"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "LEFT CTRL"); shortcut_helper = TRUE; } offset += 1; @@ -541,7 +541,7 @@ offset += 1; if (keycode) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_ext(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } @@ -551,7 +551,7 @@ offset += 1; if (keycode) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_ext(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } @@ -561,7 +561,7 @@ offset += 1; if (keycode) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_ext(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } @@ -571,7 +571,7 @@ offset += 1; if (keycode) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_ext(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } @@ -581,7 +581,7 @@ offset += 1; if (keycode) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_ext(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } @@ -591,13 +591,13 @@ offset += 1; if (keycode) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_ext(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } if (shortcut_helper == FALSE) { - col_append_fstr(pinfo->cinfo, COL_INFO, ""); + col_append_str(pinfo->cinfo, COL_INFO, ""); } break; @@ -613,43 +613,43 @@ buttons = tvb_get_guint8(tvb, offset); offset += 1; - if (buttons) col_append_fstr(pinfo->cinfo, COL_INFO, " - "); + if (buttons) col_append_str(pinfo->cinfo, COL_INFO, " - "); if (buttons & 0x01) { - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "Button LEFT"); + col_append_str(pinfo->cinfo, COL_INFO, "Button LEFT"); shortcut_helper = TRUE; } if (buttons & 0x02) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "Button RIGHT"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "Button RIGHT"); shortcut_helper = TRUE; } if (buttons & 0x04) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "Button MIDDLE"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "Button MIDDLE"); } if (buttons & 0x08) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "Button 4"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "Button 4"); shortcut_helper = TRUE; } if (buttons & 0x10) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "Button 5"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "Button 5"); shortcut_helper = TRUE; } if (buttons & 0x20) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "Button 6"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "Button 6"); shortcut_helper = TRUE; } if (buttons & 0x40) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "Button 7"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "Button 7"); shortcut_helper = TRUE; } if (buttons & 0x80) { - if (shortcut_helper) col_append_fstr(pinfo->cinfo, COL_INFO, " + "); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", "Button 8"); + if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); + col_append_str(pinfo->cinfo, COL_INFO, "Button 8"); /* Not necessary, this is the last case where it is used * shortcut_helper = TRUE; */ @@ -701,10 +701,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -720,7 +720,7 @@ parameter = transaction_type & 0x0F; transaction_type = transaction_type >> 4; - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(transaction_type, transaction_type_vals, "Unknown TransactionType")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(transaction_type, transaction_type_vals, "Unknown TransactionType")); switch(transaction_type) { case 0x00: /* HANDSHAKE */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btl2cap.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btl2cap.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btl2cap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btl2cap.c 2013-11-02 02:12:36.000000000 +0000 @@ -372,7 +372,6 @@ void proto_register_btl2cap(void); void proto_reg_handoff_btl2cap(void); - static guint16 get_service_uuid(packet_info *pinfo, guint16 psm, gboolean is_local_psm) { @@ -453,7 +452,7 @@ service_info->bd_addr_id == 0)) && service_info->type == BTSDP_L2CAP_PROTOCOL_UUID && service_info->channel == psm) { - return service_info->uuid; + return service_info->uuid.bt_uuid; } return 0; @@ -1575,10 +1574,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -1644,7 +1643,7 @@ cmd_str = val_to_str_const(cmd_code, command_code_vals, "Unknown cmd"); proto_item_append_text(ti_command, "%s", cmd_str); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", cmd_str); + col_append_str(pinfo->cinfo, COL_INFO, cmd_str); switch (cmd_code) { case 0x01: /* Command Reject */ @@ -1890,7 +1889,7 @@ void proto_register_btl2cap(void) { - + expert_module_t *expert_btl2cap; /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_btl2cap_length, @@ -2331,8 +2330,6 @@ { &ei_btl2cap_length_bad, { "btl2cap.length.bad", PI_MALFORMED, PI_WARN, "Length bad", EXPFILL }}, }; - expert_module_t* expert_btl2cap; - /* Register the protocol name and description */ proto_btl2cap = proto_register_protocol("Bluetooth L2CAP Protocol", "BT L2CAP", "btl2cap"); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btmcap.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btmcap.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btmcap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btmcap.c 2013-11-02 02:12:36.000000000 +0000 @@ -113,14 +113,13 @@ guint64 timestamp_sync_time; col_set_str(pinfo->cinfo, COL_PROTOCOL, "MCAP"); - col_clear(pinfo->cinfo, COL_INFO); switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -138,10 +137,10 @@ col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(op_code, op_code_vals, "Unknown Op Code")); if (op_code >= 0x11 && op_code <= 0x20) { proto_item_append_text(pitem, " (Clock Sync)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Clock Sync)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Clock Sync)"); } else { proto_item_append_text(pitem, " (Standard)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Standard)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Standard)"); } if (op_code & 0x01) { @@ -164,7 +163,7 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " (Dynamic Range)"); } else if (mdl_id == 0x0000) { proto_item_append_text(pitem, " (Reserved)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Reserved)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Reserved)"); } if (op_code != 0x07 && mdl_id == 0xFFFF) { @@ -286,13 +285,13 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " - %u", mdl_id); if (mdl_id == 0xFFFF) { proto_item_append_text(pitem, " (Indicates all MDLs)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Indicates all MDLs)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Indicates all MDLs)"); } else if (mdl_id >= 0x0001 && mdl_id <= 0xFEFF) { proto_item_append_text(pitem, " (Dynamic Range)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Dynamic Range)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Dynamic Range)"); } else if (mdl_id == 0x0000) { proto_item_append_text(pitem, " (Reserved)"); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Reserved)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Reserved)"); } if ((op_code == 0x03 || op_code == 0x05 || op_code == 0x07) && tvb_length_remaining(tvb, offset)) { @@ -320,7 +319,7 @@ proto_register_btmcap(void) { module_t *module; - expert_module_t* expert_btmcap; + expert_module_t *expert_btmcap; static hf_register_info hf[] = { { &hf_btmcap_op_code, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btobex.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btobex.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btobex.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btobex.c 2013-11-02 02:12:36.000000000 +0000 @@ -49,12 +49,15 @@ static int hf_max_pkt_len = -1; static int hf_set_path_flags_0 = -1; static int hf_set_path_flags_1 = -1; +static int hf_headers = -1; +static int hf_header = -1; static int hf_hdr_id = -1; static int hf_hdr_length = -1; static int hf_hdr_val_unicode = -1; static int hf_hdr_val_byte_seq = -1; static int hf_hdr_val_byte = -1; static int hf_hdr_val_long = -1; +static int hf_application_parameter = -1; static int hf_application_parameter_id = -1; static int hf_application_parameter_length = -1; static int hf_application_parameter_data = -1; @@ -632,7 +635,7 @@ while (parameters_length > 0) { parameter_id = tvb_get_guint8(tvb, offset); - parameter_item = proto_tree_add_text(tree, tvb, offset, + parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, -1, "Parameter: 0x%02x", parameter_id); parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters); @@ -643,7 +646,7 @@ proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN); parameter_length = tvb_get_guint8(tvb, offset); - proto_item_set_len(parameter_item, parameter_length + 2); + proto_item_set_len(parameter_item, parameter_length + 2); offset += 1; proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, @@ -670,7 +673,7 @@ parameter_id = tvb_get_guint8(tvb, offset); parameter_length = tvb_get_guint8(tvb, offset + 1); - parameter_item = proto_tree_add_text(tree, tvb, offset, parameter_length + 2, + parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2, "Parameter: %s", val_to_str_const(parameter_id, bpp_application_parameters_vals, "Unknown")); parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters); @@ -724,7 +727,7 @@ parameter_id = tvb_get_guint8(tvb, offset); parameter_length = tvb_get_guint8(tvb, offset + 1); - parameter_item = proto_tree_add_text(tree, tvb, offset, parameter_length + 2, + parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2, "Parameter: %s", val_to_str_const(parameter_id, bip_application_parameters_vals, "Unknown")); parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters); @@ -798,7 +801,7 @@ parameter_id = tvb_get_guint8(tvb, offset); parameter_length = tvb_get_guint8(tvb, offset + 1); - parameter_item = proto_tree_add_text(tree, tvb, offset, parameter_length + 2, + parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2, "Parameter: %s", val_to_str_const(parameter_id, pbap_application_parameters_vals, "Unknown")); parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters); @@ -833,40 +836,40 @@ proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_list_start_offset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN); break; case 0x06: - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_version, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_fn, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_n, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_photo, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_birthday, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_adr, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_label, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_tel, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_email, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_mailer, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_time_zone, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_geographic_position, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_title, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_role, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_logo, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_agent, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_name_of_organization, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_comments, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_revision, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_pronunciation_of_name, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_url, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_uid, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_key, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_nickname, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_categories, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_product_id, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_class, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_sort_string, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_reserved_29_31, tvb, offset, 4, ENC_BIG_ENDIAN); - - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_reserved_32_38, tvb, offset + 4, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_proprietary_filter, tvb, offset + 4, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_reserved_32_38, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_proprietary_filter, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage, tvb, offset, 4, ENC_BIG_ENDIAN); + + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_version, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_fn, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_n, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_photo, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_birthday, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_adr, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_label, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_tel, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_email, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_mailer, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_time_zone, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_geographic_position, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_title, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_role, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_logo, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_agent, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_name_of_organization, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_comments, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_revision, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_pronunciation_of_name, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_url, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_uid, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_key, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_nickname, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_categories, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_product_id, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_class, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_sort_string, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_timestamp, tvb, offset + 4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_reserved_29_31, tvb, offset + 4, 4, ENC_BIG_ENDIAN); break; case 0x07: proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_format, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN); @@ -903,7 +906,7 @@ parameter_id = tvb_get_guint8(tvb, offset); parameter_length = tvb_get_guint8(tvb, offset + 1); - parameter_item = proto_tree_add_text(tree, tvb, offset, parameter_length + 2, + parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2, "Parameter: %s", val_to_str_const(parameter_id, map_application_parameters_vals, "Unknown")); parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters); @@ -1057,7 +1060,7 @@ if (tvb_length_remaining(tvb, offset) > 0) { proto_item *hdrs; - hdrs = proto_tree_add_text(tree, tvb, offset, item_length, "Headers"); + hdrs = proto_tree_add_item(tree, hf_headers, tvb, offset, item_length, ENC_NA); hdrs_tree = proto_item_add_subtree(hdrs, ett_btobex_hdrs); } else { @@ -1083,7 +1086,7 @@ break; } - hdr = proto_tree_add_text(hdrs_tree, tvb, offset, item_length, "%s", + hdr = proto_tree_add_none_format(hdrs_tree, hf_header, tvb, offset, item_length, "%s", val_to_str_ext_const(hdr_id, &header_id_vals_ext, "Unknown")); hdr_tree = proto_item_add_subtree(hdr, ett_btobex_hdr); @@ -1394,10 +1397,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -1405,7 +1408,7 @@ break; } - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(code, &code_vals_ext, "Unknown")); if (code < BTOBEX_CODE_VALS_CONTINUE || code == BTOBEX_CODE_VALS_ABORT) { @@ -1586,6 +1589,8 @@ void proto_register_btobex(void) { + expert_module_t *expert_btobex; + static hf_register_info hf[] = { { &hf_opcode, { "Opcode", "btobex.opcode", @@ -1637,36 +1642,51 @@ FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL} }, + { &hf_headers, + { "Headers", "btobex.headers", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, + { &hf_header, + { "Header", "btobex.header", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, { &hf_hdr_id, - { "Header Id", "btobex.hdr_id", + { "Header Id", "btobex.header.id", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &header_id_vals_ext, 0x00, NULL, HFILL} }, { &hf_hdr_length, - { "Length", "btobex.pkt_hdr_len", + { "Length", "btobex.header.length", FT_UINT16, BASE_DEC, NULL, 0, "Header Length", HFILL} }, { &hf_hdr_val_unicode, - { "Value", "btobex.pkt_hdr_val_uc", + { "Value", "btobex.header.value.unicode", FT_STRING, BASE_NONE, NULL, 0, "Unicode Value", HFILL } }, { &hf_hdr_val_byte_seq, - { "Value", "btobex.hdr_val_byte_seq", + { "Value", "btobex.header.value.byte_sequence", FT_BYTES, BASE_NONE, NULL, 0, "Byte Value", HFILL} }, { &hf_hdr_val_byte, - { "Value", "btobex.hdr_val_byte", + { "Value", "btobex.header.value.byte", FT_UINT8, BASE_HEX, NULL, 0, "Byte Sequence Value", HFILL} }, { &hf_hdr_val_long, - { "Value", "btobex.hdr_val_long", + { "Value", "btobex.header.value.long", FT_UINT32, BASE_DEC, NULL, 0, "4-byte Value", HFILL} }, + { &hf_application_parameter, + { "Parameter", "btobex.parameter", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, { &hf_application_parameter_id, { "Parameter Id", "btobex.parameter.id", FT_UINT8, BASE_HEX, NULL, 0x00, @@ -1942,12 +1962,12 @@ }, { &hf_pbap_application_parameter_data_filter_reserved_29_31, { "Reserved", "btobex.parameter.value.filter.reserved_29_31", - FT_BOOLEAN, 32, NULL, 0xE0000000, + FT_UINT32, BASE_HEX, NULL, 0xE0000000, NULL, HFILL} }, { &hf_pbap_application_parameter_data_filter_reserved_32_38, { "Reserved", "btobex.parameter.value.filter.reserved_32_38", - FT_BOOLEAN, 32, NULL, 0x0000007F, + FT_UINT32, BASE_HEX, NULL, 0x0000007F, NULL, HFILL} }, { &hf_pbap_application_parameter_data_filter_proprietary_filter, @@ -1957,7 +1977,7 @@ }, { &hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage, { "Reserved for Proprietary Filter Usage", "btobex.parameter.value.filter.reserved_for_proprietary_filter_usage", - FT_BOOLEAN, 32, NULL, 0x7FFFFF00, + FT_UINT32, BASE_HEX, NULL, 0xFFFFFF00, NULL, HFILL} }, { &hf_pbap_application_parameter_data_format, @@ -1993,7 +2013,7 @@ }, { &hf_map_application_parameter_data_filter_message_type_reserved, { "Reserved", "btobex.parameter.value.filter_message_type.reserved", - FT_BOOLEAN, 8, NULL, 0xF0, + FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL} }, { &hf_map_application_parameter_data_filter_message_type_mms, @@ -2028,7 +2048,7 @@ }, { &hf_map_application_parameter_data_filter_read_status_reserved_6, { "Filter Read Status: Reserved", "btobex.parameter.value.filter_read_status.reserved", - FT_BOOLEAN, 8, NULL, 0xFC, + FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL} }, { &hf_map_application_parameter_data_filter_read_status_get_read, @@ -2053,7 +2073,7 @@ }, { &hf_map_application_parameter_data_filter_priority_reserved_6, { "Filter Priority: Reserved", "btobex.parameter.value.filter_priority.reserved", - FT_BOOLEAN, 8, NULL, 0xFC, + FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL} }, { &hf_map_application_parameter_data_filter_priority_get_high, @@ -2068,7 +2088,7 @@ }, { &hf_map_application_parameter_data_reserved_7, { "Reserved", "btobex.parameter.value.reserved", - FT_BOOLEAN, 8, NULL, 0xFE, + FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL} }, { &hf_map_application_parameter_data_attachment, @@ -2103,7 +2123,7 @@ }, { &hf_map_application_parameter_data_parameter_mask_reserved, { "Parameter Mask: Reserved", "btobex.parameter.value.parameter_mask.reserved", - FT_BOOLEAN, 32, NULL, 0xFFFF0000, + FT_UINT32, BASE_HEX, NULL, 0xFFFF0000, NULL, HFILL} }, { &hf_map_application_parameter_data_parameter_mask_reply_to_addressing, @@ -2292,8 +2312,6 @@ { &ei_application_parameter_length_bad, { "btobex.parameter.length.bad", PI_PROTOCOL, PI_WARN, "Parameter length bad", EXPFILL }}, }; - expert_module_t* expert_btobex; - obex_profile = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); obex_last_opcode = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); obex_over_l2cap = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btrfcomm.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btrfcomm.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btrfcomm.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btrfcomm.c 2013-11-02 02:12:36.000000000 +0000 @@ -57,20 +57,25 @@ static int hf_max_retrans = -1; static int hf_fc_credits = -1; +static int hf_mcc_pn_parameters = -1; static int hf_pn_i14 = -1; static int hf_pn_c14 = -1; +static int hf_mcc = -1; +static int hf_mcc_types = -1; static int hf_mcc_len = -1; static int hf_mcc_ea = -1; static int hf_mcc_cr = -1; static int hf_mcc_cmd = -1; +static int hf_msc_parameters = -1; static int hf_msc_fc = -1; static int hf_msc_rtc = -1; static int hf_msc_rtr = -1; static int hf_msc_ic = -1; static int hf_msc_dv = -1; static int hf_msc_l = -1; +static int hf_msc_break_bits = -1; static int hf_fcs = -1; @@ -82,11 +87,16 @@ static int hf_mcc_channel = -1; static int hf_mcc_direction = -1; static int hf_mcc_const_1 = -1; + static int hf_mcc_pn_dlci = -1; static int hf_mcc_pn_channel = -1; static int hf_mcc_pn_direction = -1; static int hf_mcc_pn_zeros_padding = -1; +static int hf_acknowledgement_timer_t1 = -1; +static int hf_address = -1; +static int hf_control = -1; + /* Initialize the protocol and registered fields */ static int proto_btrfcomm = -1; static int proto_btdun = -1; @@ -286,6 +296,7 @@ proto_item *ti; proto_tree *dlci_tree; proto_item *dlci_item; + proto_item *item; int mcc_dlci; guint8 flags; @@ -305,7 +316,7 @@ flags = tvb_get_guint8(tvb, offset); - ti = proto_tree_add_text(t, tvb, offset, 1, "I1-I4: 0x%x, C1-C4: 0x%x", flags & 0xf, (flags >> 4) & 0xf); + ti = proto_tree_add_none_format(t, hf_mcc_pn_parameters, tvb, offset, 1, "I1-I4: 0x%x, C1-C4: 0x%x", flags & 0xf, (flags >> 4) & 0xf); st = proto_item_add_subtree(ti, ett_ctrl_pn_ci); proto_tree_add_item(st, hf_pn_c14, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -317,7 +328,8 @@ offset += 1; /* Ack timer */ - proto_tree_add_text(t, tvb, offset, 1, "Acknowledgement timer (T1): %d ms", (guint32)tvb_get_guint8(tvb, offset) * 100); + item = proto_tree_add_item(t, hf_acknowledgement_timer_t1, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_item_append_text(item, "(%d ms)", (guint32)tvb_get_guint8(tvb, offset) * 100); offset += 1; /* max frame size */ @@ -364,7 +376,7 @@ start_offset = offset; status = tvb_get_guint8(tvb, offset); - it = proto_tree_add_text(t, tvb, offset, 1, "V.24 Signals: FC = %d, RTC = %d, RTR = %d, IC = %d, DV = %d", (status >> 1) & 1, + it = proto_tree_add_none_format(t, hf_msc_parameters, tvb, offset, 1, "V.24 Signals: FC = %d, RTC = %d, RTR = %d, IC = %d, DV = %d", (status >> 1) & 1, (status >> 2) & 1, (status >> 3) & 1, (status >> 6) & 1, (status >> 7) & 1); st = proto_item_add_subtree(it, ett_ctrl_pn_v24); @@ -377,7 +389,7 @@ offset += 1; if (length == 3) { - proto_tree_add_text(t, tvb, offset, 1, "Break bits B1-B3: 0x%x", (tvb_get_guint8(tvb, offset) & 0xf) >> 1); + proto_tree_add_item(t, hf_msc_break_bits, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(t, hf_msc_l, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; } @@ -413,7 +425,7 @@ *dlcip = dlci; } - ti = proto_tree_add_text(tree, tvb, offset, 1, "Address: E/A flag: %d, C/R flag: %d, Direction: %d, Channel: %u", ea_flag, cr_flag, dlci & 0x01, dlci >> 1); + ti = proto_tree_add_none_format(tree, hf_address, tvb, offset, 1, "Address: E/A flag: %d, C/R flag: %d, Direction: %d, Channel: %u", ea_flag, cr_flag, dlci & 0x01, dlci >> 1); addr_tree = proto_item_add_subtree(ti, ett_addr); dlci_item = proto_tree_add_item(addr_tree, hf_dlci, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -449,7 +461,7 @@ *frame_typep = frame_type; } - ti = proto_tree_add_text(tree, tvb, offset, 1, "Control: Frame type: %s (0x%x), P/F flag: %d", + ti = proto_tree_add_none_format(tree, hf_control, tvb, offset, 1, "Control: Frame type: %s (0x%x), P/F flag: %d", val_to_str_const(frame_type, vs_frame_type, "Unknown"), frame_type, pf_flag); hctl_tree = proto_item_add_subtree(ti, ett_control); @@ -515,7 +527,7 @@ *mcc_typep = mcc_type; } - ti = proto_tree_add_text(tree, tvb, start_offset, offset - start_offset, + ti = proto_tree_add_none_format(tree, hf_mcc_types, tvb, start_offset, offset - start_offset, "Type: %s (0x%x), C/R flag = %d, E/A flag = %d", val_to_str_const(mcc_type, vs_ctl, "Unknown"), mcc_type, mcc_cr_flag, mcc_ea_flag); @@ -555,10 +567,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -645,7 +657,7 @@ val_to_str_const(frame_type, vs_frame_type_short, "Unknown"), dlci >> 1); if (dlci && (frame_type == 0x2f)) col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", - val_to_str_ext_const(service_info->uuid, &vs_service_classes_ext, "Unknown")); + val_to_str_ext_const(service_info->uuid.bt_uuid, &vs_service_classes_ext, "Unknown")); /* UID frame */ if ((frame_type == 0xef) && dlci && pf_flag) { @@ -671,7 +683,7 @@ guint8 mcc_dlci; int start_offset = offset; - mcc_ti = proto_tree_add_text(rfcomm_tree, tvb, offset, 1, "Multiplexer Control Command"); + mcc_ti = proto_tree_add_item(rfcomm_tree, hf_mcc, tvb, offset, 1, ENC_NA); ctrl_tree = proto_item_add_subtree(mcc_ti, ett_btrfcomm_ctrl); /* mcc type */ @@ -748,7 +760,7 @@ if (!dissector_try_uint(rfcomm_channel_dissector_table, (guint32) dlci >> 1, next_tvb, pinfo, tree)) { - if (!dissector_try_uint(rfcomm_service_dissector_table, service_info->uuid, + if (!dissector_try_uint(rfcomm_service_dissector_table, service_info->uuid.bt_uuid, next_tvb, pinfo, tree)) { decode_by_dissector = find_proto_by_channel(dlci >> 1); if (rfcomm_channels_enabled && decode_by_dissector) { @@ -768,7 +780,7 @@ proto_register_btrfcomm(void) { module_t *module; - expert_module_t* expert_btrfcomm; + expert_module_t *expert_btrfcomm; static hf_register_info hf[] = { { &hf_dlci, @@ -816,6 +828,21 @@ FT_UINT8, BASE_HEX, VALS(vs_cr), 0x02, "Command/Response flag", HFILL} }, + { &hf_mcc, + { "Multiplexer Control Command", "btrfcomm.mcc", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, + { &hf_mcc_pn_parameters, + { "Parameters", "btrfcomm.mcc.pn_parameters", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, + { &hf_mcc_types, + { "Types", "btrfcomm.mcc.types", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, { &hf_mcc_ea, { "EA Flag", "btrfcomm.mcc.ea", FT_UINT8, BASE_HEX, VALS(vs_ea), 0x01, @@ -876,6 +903,11 @@ FT_UINT8, BASE_HEX, VALS(vs_frame_type), 0xEF, "Command/Response flag", HFILL} }, + { &hf_acknowledgement_timer_t1, + { "Acknowledgement Timer T1", "btrfcomm.acknowledgement_timer_t1", + FT_UINT8, BASE_DEC, NULL, 0x00, + NULL, HFILL} + }, { &hf_pf, { "P/F flag", "btrfcomm.pf", FT_UINT8, BASE_HEX, NULL, 0x10, @@ -907,6 +939,11 @@ FT_UINT8, BASE_HEX, NULL, 0, "Checksum over frame", HFILL} }, + { &hf_msc_parameters, + { "Parameters", "btrfcomm.mcc.msc_parameters", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, { &hf_msc_fc, { "Flow Control (FC)", "btrfcomm.msc.fc", FT_UINT8, BASE_HEX, NULL, 0x02, @@ -937,6 +974,21 @@ FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL} }, + { &hf_msc_break_bits, + { "Break Bits", "btrfcomm.msc.break_bits", + FT_UINT8, BASE_DEC, NULL, 0xE0, + NULL, HFILL} + }, + { &hf_address, + { "Address", "btrfcomm.address", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, + { &hf_control, + { "Control", "btrfcomm.control", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, { &hf_fc_credits, { "Credits", "btrfcomm.credits", FT_UINT8, BASE_DEC, NULL, 0, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btsap.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btsap.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btsap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btsap.c 2013-11-02 02:12:36.000000000 +0000 @@ -58,6 +58,7 @@ static int hf_btsap_header_msg_id = -1; static int hf_btsap_header_number_of_parameters = -1; static int hf_btsap_header_reserved = -1; +static int hf_btsap_parameter = -1; static int hf_btsap_parameter_id = -1; static int hf_btsap_parameter_reserved = -1; static int hf_btsap_parameter_length = -1; @@ -201,7 +202,9 @@ if (parameter_padding_length > 0) parameter_padding_length = 4 - parameter_padding_length; - parameter_item = proto_tree_add_text(tree, tvb, offset, 2 + 2 + parameter_length + parameter_padding_length, "Parameter: %s: ", val_to_str_const(parameter_id, parameter_id_vals, "Unknown ParameterID")); + parameter_item = proto_tree_add_none_format(tree, hf_btsap_parameter, tvb, offset, + 2 + 2 + parameter_length + parameter_padding_length, "Parameter: %s: ", + val_to_str_const(parameter_id, parameter_id_vals, "Unknown ParameterID")); ptree = proto_item_add_subtree(parameter_item, ett_btsap_parameter); proto_tree_add_item(ptree, hf_btsap_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -396,14 +399,13 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SAP"); - col_clear(pinfo->cinfo, COL_INFO); switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -416,7 +418,7 @@ proto_tree_add_item(btsap_tree, hf_btsap_header_msg_id, tvb, offset, 1, ENC_BIG_ENDIAN); msg_id = tvb_get_guint8(tvb, offset); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(msg_id, msg_id_vals, "Unknown MsgID")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(msg_id, msg_id_vals, "Unknown MsgID")); offset += 1; proto_tree_add_item(btsap_tree, hf_btsap_header_number_of_parameters, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -587,7 +589,7 @@ proto_register_btsap(void) { module_t *module; - expert_module_t* expert_btsap; + expert_module_t *expert_btsap; static hf_register_info hf[] = { { &hf_btsap_header_msg_id, @@ -605,6 +607,11 @@ FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL } }, + { &hf_btsap_parameter, + { "Parameter", "btsap.parameter", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, { &hf_btsap_parameter_id, { "Parameter ID", "btsap.parameter_id", FT_UINT8, BASE_HEX, VALS(parameter_id_vals), 0x00, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btsdp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btsdp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btsdp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btsdp.c 2013-11-02 02:12:36.000000000 +0000 @@ -39,6 +39,7 @@ #include #include #include +#include #include "packet-btsdp.h" #include "packet-btl2cap.h" @@ -52,16 +53,46 @@ static gint hf_ssr_total_count = -1; static gint hf_ssr_current_count = -1; static gint hf_error_code = -1; +static gint hf_attribute_id_list = -1; +static gint hf_attribute_id_range = -1; +static gint hf_attribute_id_range_from = -1; +static gint hf_attribute_id_range_to = -1; static gint hf_attribute_list_byte_count = -1; static gint hf_maximum_service_record_count = -1; static gint hf_maximum_attribute_byte_count = -1; +static gint hf_continuation_state = -1; static gint hf_continuation_state_length = -1; static gint hf_continuation_state_value = -1; static gint hf_fragment = -1; +static gint hf_partial_record_handle_list = -1; +static gint hf_reassembled_record_handle_list = -1; +static gint hf_partial_attribute_list = -1; +static gint hf_reassembled_attribute_list = -1; +static gint hf_data_element = -1; static gint hf_data_element_size = -1; static gint hf_data_element_type = -1; static gint hf_data_element_var_size = -1; static gint hf_data_element_value = -1; +static gint hf_data_element_value_nil = -1; +static gint hf_data_element_value_boolean = -1; +static gint hf_data_element_value_signed_int = -1; +static gint hf_data_element_value_unsigned_int = -1; +static gint hf_data_element_value_uuid_16 = -1; +static gint hf_data_element_value_uuid_32 = -1; +static gint hf_data_element_value_uuid_128 = -1; +static gint hf_data_element_value_uuid = -1; +static gint hf_data_element_value_string = -1; +static gint hf_data_element_value_url = -1; +static gint hf_data_element_value_alternative = -1; +static gint hf_data_element_value_sequence = -1; +static gint hf_profile_descriptor_list = -1; +static gint hf_attribute_list = -1; +static gint hf_attribute_lists = -1; +static gint hf_service_search_pattern = -1; +static gint hf_service_record_handle_list = -1; +static gint hf_service_attribute = -1; +static gint hf_service_attribute_id = -1; +static gint hf_service_attribute_value = -1; static gint hf_service_attribute_id_generic = -1; static gint hf_service_attribute_id_a2dp = -1; static gint hf_service_attribute_id_avrcp = -1; @@ -156,6 +187,11 @@ static gint hf_hdp_support_procedure_reconnect_acceptance = -1; static gint hf_hdp_support_procedure_reconnect_initiation = -1; static gint hf_hdp_support_procedure_reserved = -1; +static gint hf_hdp_supported_features_data = -1; +static gint hf_hdp_supported_features_data_mdep_id = -1; +static gint hf_hdp_supported_features_data_mdep_data_type = -1; +static gint hf_hdp_supported_features_data_mdep_role = -1; +static gint hf_hdp_supported_features_data_mdep_description = -1; static gint hf_hdp_supported_features_mdep_id = -1; static gint hf_hdp_supported_features_mdep_data_type = -1; static gint hf_hdp_supported_features_mdep_role = -1; @@ -184,8 +220,8 @@ static gint hf_hfp_gw_supported_features_voice_recognition_function = -1; static gint hf_hfp_gw_supported_features_ec_and_or_nr_function = -1; static gint hf_hfp_gw_supported_features_three_way_calling = -1; -static gint hf_sdp_service_uuid = -1; -static gint hf_sdp_service_long_uuid = -1; +static gint hf_sdp_protocol_item = -1; +static gint hf_sdp_protocol = -1; static gint hf_sdp_protocol_psm = -1; static gint hf_sdp_protocol_channel = -1; static gint hf_sdp_protocol_gatt_handle_start = -1; @@ -202,10 +238,13 @@ static gint hf_sdp_service_name = -1; static gint hf_sdp_service_description = -1; static gint hf_sdp_service_provider_name = -1; +static gint hf_sdp_lang = -1; static gint hf_sdp_lang_id = -1; static gint hf_sdp_lang_code = -1; static gint hf_sdp_lang_encoding = -1; static gint hf_sdp_lang_attribute_base = -1; +static gint hf_hid_descriptor_list_descriptor_data = -1; +static gint hf_hid_lang = -1; static gint hf_hid_device_release_number = -1; static gint hf_hid_parser_version = -1; static gint hf_hid_device_subclass_type = -1; @@ -310,26 +349,29 @@ static gint btsdp_tap = -1; -static wmem_tree_t *tid_requests = NULL; -static wmem_tree_t *continuation_states = NULL; -static wmem_tree_t *service_infos = NULL; - +static wmem_tree_t *tid_requests = NULL; +static wmem_tree_t *continuation_states = NULL; +static wmem_tree_t *record_handle_services = NULL; +static wmem_tree_t *service_infos = NULL; static sdp_package_t sdp_package; typedef struct _tid_request_t { - guint32 interface_id; - guint32 adapter_id; - guint32 chandle; - guint32 psm; - guint32 tid; - guint32 pdu_type; + guint32 interface_id; + guint32 adapter_id; + guint32 chandle; + guint32 psm; + guint32 tid; + guint32 pdu_type; - guint8 *continuation_state; - guint8 continuation_state_length; + wmem_array_t *uuid_array; + guint32 record_handle; - guint32 data_length; - guint8 *data; + guint8 *continuation_state; + guint8 continuation_state_length; + + guint32 data_length; + guint8 *data; } tid_request_t; typedef struct _continuation_state_data_t { @@ -344,6 +386,21 @@ guint8 *data; } continuation_state_data_t; +typedef struct _record_handle_service_t { + guint32 interface_id; + guint32 adapter_id; + guint32 chandle; + guint32 psm; + guint32 record_handle; + + wmem_array_t *uuid_array; +} record_handle_service_t; + +typedef struct _custom_uuid_t { + const guint8 uuid[16]; + const gchar *name; +} custom_uuid_t; + #define PDU_TYPE_SERVICE_SEARCH 0x00 #define PDU_TYPE_SERVICE_ATTRIBUTE 0x01 #define PDU_TYPE_SERVICE_SEARCH_ATTRIBUTE 0x02 @@ -841,6 +898,8 @@ { 0x1137, "3D Display" }, { 0x1138, "3D Glasses" }, { 0x1139, "3D Synchronization Profile" }, + { 0x113A, "Multi-Profile" }, + { 0x113B, "Multi-Profile SC" }, { 0x1200, "PnP Information" }, { 0x1201, "Generic Networking" }, { 0x1202, "Generic File Transfer" }, @@ -899,6 +958,11 @@ { 0, NULL } }; +static const custom_uuid_t custom_uuid[] = { + { {0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x02, 0xEE, 0x00, 0x00, 0x02}, "SyncML Server" }, + { {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x02, 0xEE, 0x00, 0x00, 0x02}, "SyncML Client" } +}; + extern value_string_ext ext_psm_vals; extern value_string_ext wap_mib_enum_vals_character_sets_ext; extern value_string_ext usb_langid_vals_ext; @@ -906,6 +970,110 @@ void proto_register_btsdp(void); void proto_reg_handoff_btsdp(void); + +static uuid_t +get_most_specified_uuid(wmem_array_t *uuid_array) +{ + uuid_t uuid; + +/* TODO: For now try to use first (most specified) UUID, this may sometimes fail */ + if (uuid_array) { + uuid_t *p_uuid = NULL; + + if (wmem_array_get_count(uuid_array) > 0) + p_uuid = (uuid_t *) wmem_array_index(uuid_array, 0); + + if (p_uuid) return *p_uuid; + } + + memset(&uuid, 0, sizeof(uuid_t)); + return uuid; +} + + +static gchar * +print_uuid(uuid_t *uuid) +{ + if (uuid->bt_uuid) { + return wmem_strdup(wmem_packet_scope(), val_to_str_const(uuid->bt_uuid, vs_service_classes, "Unknown")); + } else { + if (uuid->size == 16) { + unsigned int i_uuid; + + for (i_uuid = 0; i_uuid < sizeof(custom_uuid) / sizeof(custom_uuid_t); ++i_uuid) { + if (memcmp(uuid->data, custom_uuid[i_uuid].uuid, 16) == 0) { + return wmem_strdup(wmem_packet_scope(), custom_uuid[i_uuid].name); + } + } + } + + return bytes_to_str(uuid->data, uuid->size); + } +} + + +static wmem_array_t * +get_uuids(packet_info *pinfo, guint32 record_handle) +{ + btl2cap_data_t *l2cap_data; + record_handle_service_t *record_handle_service; + wmem_tree_key_t key[7]; + guint32 k_interface_id; + guint32 k_adapter_id; + guint32 k_chandle; + guint32 k_psm; + guint32 k_record_handle; + guint32 k_frame_number; + guint32 interface_id; + guint32 adapter_id; + guint32 chandle; + guint32 psm; + guint32 frame_number; + + l2cap_data = (btl2cap_data_t *) pinfo->private_data; + + interface_id = l2cap_data->interface_id; + adapter_id = l2cap_data->adapter_id; + chandle = l2cap_data->chandle; + psm = l2cap_data->psm; + frame_number = pinfo->fd->num; + + k_interface_id = interface_id; + k_adapter_id = adapter_id; + k_chandle = chandle; + k_psm = psm; + k_record_handle = record_handle; + k_frame_number = frame_number; + + + key[0].length = 1; + key[0].key = &k_interface_id; + key[1].length = 1; + key[1].key = &k_adapter_id; + key[2].length = 1; + key[2].key = &k_chandle; + key[3].length = 1; + key[3].key = &k_psm; + key[4].length = 1; + key[4].key = &k_record_handle; + key[5].length = 1; + key[5].key = &k_frame_number; + key[6].length = 0; + key[6].key = NULL; + + record_handle_service = (record_handle_service_t *) wmem_tree_lookup32_array_le(record_handle_services, key); + if (record_handle_service && record_handle_service->interface_id == interface_id && + record_handle_service->adapter_id == adapter_id && + record_handle_service->chandle == chandle && + record_handle_service->psm == psm && + record_handle_service->record_handle == record_handle) { + return record_handle_service->uuid_array; + } + + return NULL; +} + + static void save_channel(packet_info *pinfo, guint32 protocol, guint32 channel, gint protocol_order, service_info_t *parent_service_info) { @@ -973,6 +1141,7 @@ wmem_tree_insert32_array(service_infos, key, service_info); } + static gint get_type_length(tvbuff_t *tvb, gint offset, gint *length) { @@ -1054,6 +1223,49 @@ } } +static gint +dissect_uuid(proto_tree *tree, tvbuff_t *tvb, gint offset, gint size, uuid_t *uuid) +{ + proto_item *item; + + DISSECTOR_ASSERT(uuid); + + if (size == 2) { + proto_tree_add_item(tree, hf_data_element_value_uuid_16, tvb, offset, size, ENC_BIG_ENDIAN); + uuid->bt_uuid = tvb_get_ntohs(tvb, offset); + } else if (size == 4 && tvb_get_ntohs(tvb, offset) == 0x0000) { + proto_tree_add_item(tree, hf_data_element_value_uuid_32, tvb, offset, size, ENC_BIG_ENDIAN); + uuid->bt_uuid = tvb_get_ntohs(tvb, offset + 2); + } else if (size == 16 && tvb_get_ntohs(tvb, offset) == 0x0000 && tvb_get_ntohl(tvb, offset + 4) == 0x1000 && tvb_get_ntoh64(tvb, offset + 8) == G_GUINT64_CONSTANT(0x800000805F9B34FB)) { + item = proto_tree_add_item(tree, hf_data_element_value_uuid_128, tvb, offset, size, ENC_NA); + uuid->bt_uuid = tvb_get_ntohs(tvb, offset + 2); + proto_item_append_text(item, " (%s)", val_to_str_const(uuid->bt_uuid, vs_service_classes, "Unknown")); + } else { + item = proto_tree_add_item(tree, hf_data_element_value_uuid, tvb, offset, size, ENC_NA); + + if (size == 16) { + unsigned int i_uuid; + + for (i_uuid = 0; i_uuid < sizeof(custom_uuid) / sizeof(custom_uuid_t); ++i_uuid) { + if (tvb_memeql(tvb, offset, custom_uuid[i_uuid].uuid, 16) == 0) { + proto_item_append_text(item, " (%s)", custom_uuid[i_uuid].name); + break; + } + } + } + + uuid->bt_uuid = 0; + } + + if (size == 2 || size == 4 || size == 16) { + uuid->size = size; + tvb_memcpy(tvb, uuid->data, offset, size); + } else { + uuid->size = 0; + } + + return offset + size; +} static gint @@ -1069,7 +1281,8 @@ } else if (length > 17) { proto_tree_add_expert(tree, pinfo, &ei_btsdp_continuation_state_large, tvb, offset, -1); } else if (length == 1 && tvb_get_guint8(tvb, offset) == 0x00) { - proto_tree_add_text(tree, tvb, offset, -1, "Continuation State: no (0x00)"); + cont_item = proto_tree_add_none_format(tree, hf_continuation_state, tvb, + offset, -1, "Continuation State: no (00)"); } else { proto_item *cont_tree; guint data; @@ -1077,8 +1290,8 @@ guint8 continuation_state_length; continuation_state_length = tvb_get_guint8(tvb, offset); - cont_item = proto_tree_add_text(tree, tvb, offset, - 1 + continuation_state_length, "Continuation State: "); + cont_item = proto_tree_add_none_format(tree, hf_continuation_state, tvb, offset, + 1 + continuation_state_length, "Continuation State: yes ("); cont_tree = proto_item_add_subtree(cont_item, ett_btsdp_continuation_state); proto_tree_add_item(cont_tree, hf_continuation_state_length, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -1086,7 +1299,6 @@ proto_tree_add_item(cont_tree, hf_continuation_state_value, tvb, offset, continuation_state_length, ENC_NA); - proto_item_append_text(cont_item, "yes ("); for (i_data = 0; i_data < continuation_state_length - 1; ++i_data) { data = tvb_get_guint8(tvb, offset); proto_item_append_text(cont_item, "%02X ", data); @@ -1106,7 +1318,7 @@ gint offset, guint tid, gboolean is_request, gint attribute_list_byte_offset, gint attribute_list_byte_count, guint32 pdu_type, tvbuff_t **new_tvb, gboolean *is_first, - gboolean *is_continued) + gboolean *is_continued, wmem_array_t **uuid_array, guint32 *record_handle) { guint length; btl2cap_data_t *l2cap_data; @@ -1179,6 +1391,15 @@ tid_request->psm = psm; tid_request->tid = tid; + if (uuid_array) + tid_request->uuid_array = *uuid_array; + else + tid_request->uuid_array = NULL; + if (record_handle) + tid_request->record_handle = *record_handle; + else + tid_request->record_handle = 0; + tid_request->data = NULL; tid_request->data_length = 0; @@ -1261,6 +1482,9 @@ tvb_memcpy(tvb, tid_request->data, attribute_list_byte_offset, attribute_list_byte_count); } + + if (uuid_array) *uuid_array = tid_request->uuid_array; + if (record_handle) *record_handle = tid_request->record_handle; } } @@ -1302,6 +1526,9 @@ if (new_tvb) *new_tvb = next_tvb; if (tid_request->continuation_state_length) *is_first = FALSE; + + if (uuid_array) *uuid_array = tid_request->uuid_array; + if (record_handle) *record_handle = tid_request->record_handle; } } } else { @@ -1325,6 +1552,16 @@ tid_request->psm = psm; tid_request->tid = tid; + if (uuid_array) + tid_request->uuid_array = *uuid_array; + else + tid_request->uuid_array = NULL; + + if (record_handle) + tid_request->record_handle = *record_handle; + else + tid_request->record_handle = 0; + /* fetch data saved in continuation_state */ tid_request->data = NULL; tid_request->data_length = 0; @@ -1411,6 +1648,9 @@ tvb_memcpy(tvb, tid_request->data, attribute_list_byte_offset, attribute_list_byte_count); } + if (uuid_array) *uuid_array = tid_request->uuid_array; + if (record_handle) *record_handle = tid_request->record_handle; + /* save tid_request in continuation_state data */ k_continuation_state = (guint8 *) wmem_alloc0(wmem_packet_scope(), 20); k_continuation_state[0] = continuation_state_length; @@ -1509,6 +1749,9 @@ if (new_tvb) *new_tvb = next_tvb; if (tid_request->continuation_state_length) *is_first = FALSE; + + if (uuid_array) *uuid_array = tid_request->uuid_array; + if (record_handle) *record_handle = tid_request->record_handle; } } @@ -1534,16 +1777,13 @@ size = type & 0x07; type = type >> 3; - - pitem = proto_tree_add_text(tree, tvb, offset, 0, - "Data Element: %s %s", + pitem = proto_tree_add_none_format(tree, hf_data_element, tvb, offset, 0, "Data Element: %s %s", val_to_str_const(type, vs_data_element_type, "Unknown Type"), val_to_str_const(size, vs_data_element_size, "Unknown Size")); ptree = proto_item_add_subtree(pitem, ett_btsdp_data_element); len = (new_offset - offset) + length; - proto_item_set_len(pitem, len + 1); proto_tree_add_item(ptree, hf_data_element_type, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -1563,6 +1803,8 @@ length = 0; } proto_item_set_len(pitem, length); + if (length == 0) + proto_item_append_text(pitem, ": MISSING"); if (next_tree) *next_tree = proto_item_add_subtree(pitem, ett_btsdp_data_element_value); offset += length; @@ -1572,69 +1814,68 @@ static gint -dissect_attribute_id_list(proto_tree *tree, tvbuff_t *tvb, gint offset, packet_info *pinfo) +findDidVendorIdSource(tvbuff_t *tvb, gint service_offset, + gint number_of_attributes) { - proto_item *list_item; - proto_tree *list_tree; - proto_tree *next_tree; - gint start_offset; - gint bytes_to_go; - guint16 id; - const gchar *att_name; - - start_offset = offset; - list_item = proto_tree_add_text(tree, tvb, offset, 2, "Attribute ID List"); - list_tree = proto_item_add_subtree(list_item, ett_btsdp_attribute_idlist); - - dissect_data_element(list_tree, &next_tree, pinfo, tvb, offset); - - offset = get_type_length(tvb, offset, &bytes_to_go); - proto_item_set_len(list_item, offset - start_offset + bytes_to_go); + gint result = 0; + gint search_length; + gint search_offset; + gint i_number_of_attributes; + guint16 attribute; - while (bytes_to_go > 0) { - guint8 byte0 = tvb_get_guint8(tvb, offset); - dissect_data_element(next_tree, &next_tree, pinfo, tvb, offset); - offset += 1; - bytes_to_go -= 1; + search_offset = service_offset; + i_number_of_attributes = 0; - if (byte0 == 0x09) { /* 16 bit attribute id */ - id = tvb_get_ntohs(tvb, offset); + while (i_number_of_attributes < number_of_attributes) { + search_offset = get_type_length(tvb, search_offset, &search_length); + attribute = tvb_get_ntohs(tvb, search_offset); - /* Attribute id can be profile/service specific (not unique), - the list can be requested for various profiles/services, - so solve only generic attribute ids */ - att_name = val_to_str_const(id, vs_general_attribute_id, "Unknown"); - proto_tree_add_text(next_tree, tvb, offset, 2, "%s (0x%04x)", att_name, id); - offset += 2; - bytes_to_go -= 2; - - col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%04x (%s) ", id, att_name); - } else if (byte0 == 0x0a) { /* 32 bit attribute range */ - col_append_fstr(pinfo->cinfo, COL_INFO, " (0x%04x - 0x%04x) ", - tvb_get_ntohs(tvb, offset), tvb_get_ntohs(tvb, offset + 2)); + search_offset += search_length; + search_offset = get_type_length(tvb, search_offset, &search_length); - proto_tree_add_text(next_tree, tvb, offset, 4, "0x%04x - 0x%04x", - tvb_get_ntohs(tvb, offset), - tvb_get_ntohs(tvb, offset + 2)); - offset += 4; - bytes_to_go -= 4; - } else { - break; + if (attribute == 0x205) { + result = get_uint_by_size(tvb, search_offset, 1); } + + search_offset += search_length; + i_number_of_attributes += 1; } - return offset - start_offset; -} + return result; +} static gint -dissect_sdp_error_response(proto_tree *tree, tvbuff_t *tvb, gint offset) +findDidVendorId(tvbuff_t *tvb, gint service_offset, + gint number_of_attributes) { - proto_tree_add_item(tree, hf_error_code, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; + gint result = 0; + gint search_length; + gint search_offset; + gint i_number_of_attributes; + guint16 attribute; - return offset; + search_offset = service_offset; + i_number_of_attributes = 0; + + while (i_number_of_attributes < number_of_attributes) { + search_offset = get_type_length(tvb, search_offset, &search_length); + attribute = tvb_get_ntohs(tvb, search_offset); + + search_offset += search_length; + search_offset = get_type_length(tvb, search_offset, &search_length); + + if (attribute == 0x201) { + result = get_uint_by_size(tvb, search_offset, 1); + } + + search_offset += search_length; + i_number_of_attributes += 1; + } + + return result; } + static void dissect_protocol_descriptor_list(proto_tree *next_tree, tvbuff_t *tvb, packet_info *pinfo, gint offset, gint size, wmem_strbuf_t *info_buf, @@ -1653,35 +1894,32 @@ guint32 value; gint length; guint32 i_protocol; - guint16 uuid; + uuid_t uuid; list_offset = offset; i_protocol = 1; while (list_offset - offset < size) { - feature_item = proto_tree_add_text(next_tree, tvb, list_offset, 0, "Protocol #%u", i_protocol); + gchar *uuid_str; + + feature_item = proto_tree_add_none_format(next_tree, hf_sdp_protocol_item, tvb, list_offset, 0, "Protocol #%u", i_protocol); feature_tree = proto_item_add_subtree(feature_item, ett_btsdp_protocol); entry_offset = get_type_length(tvb, list_offset, &entry_length); proto_item_set_len(feature_item, entry_length + (entry_offset - list_offset)); dissect_data_element(feature_tree, &sub_tree, pinfo, tvb, list_offset); - entry_item = proto_tree_add_text(sub_tree, tvb, entry_offset, entry_length, "Protocol Entry"); + entry_item = proto_tree_add_item(sub_tree, hf_sdp_protocol, tvb, entry_offset, entry_length, ENC_NA); entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_supported_features_mdep_id); dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, entry_offset); new_offset = get_type_length(tvb, entry_offset, &length); entry_offset = new_offset; - if (length == 2) { - proto_tree_add_item(sub_tree, hf_sdp_service_uuid, tvb, entry_offset, 2, ENC_BIG_ENDIAN); - uuid = tvb_get_ntohs(tvb, entry_offset); - } else { - proto_tree_add_item(sub_tree, hf_sdp_service_long_uuid, tvb, entry_offset, length, ENC_NA); - uuid = 0; - } + dissect_uuid(sub_tree, tvb, entry_offset, length, &uuid); - wmem_strbuf_append(info_buf, val_to_str_const(uuid, vs_service_classes, "Unknown")); - proto_item_append_text(feature_item, ": %s", val_to_str_const(uuid, vs_service_classes, "Unknown")); - proto_item_append_text(entry_item, ": %s", val_to_str_const(uuid, vs_service_classes, "Unknown")); + uuid_str = print_uuid(&uuid); + wmem_strbuf_append(info_buf, uuid_str); + proto_item_append_text(feature_item, ": %s", uuid_str); + proto_item_append_text(entry_item, ": %s", uuid_str); entry_offset += length; @@ -1691,7 +1929,7 @@ entry_offset = new_offset; value = get_int_by_size(tvb, entry_offset, length / 2); - if (uuid == BTSDP_L2CAP_PROTOCOL_UUID) { + if (uuid.bt_uuid == BTSDP_L2CAP_PROTOCOL_UUID) { wmem_strbuf_append_printf(info_buf, ":%u", value); proto_item_append_text(feature_item, ", PSM: %u", value); proto_item_append_text(entry_item, ", PSM: %u", value); @@ -1699,7 +1937,7 @@ if (!pinfo->fd->flags.visited && service_info) save_channel(pinfo, BTSDP_L2CAP_PROTOCOL_UUID, value, *protocol_order, service_info); *protocol_order += 1; - } else if (uuid == BTSDP_RFCOMM_PROTOCOL_UUID) { + } else if (uuid.bt_uuid == BTSDP_RFCOMM_PROTOCOL_UUID) { wmem_strbuf_append_printf(info_buf, ":%u", value); proto_item_append_text(feature_item, ", RFCOMM Channel: %u", value); proto_item_append_text(entry_item, ", RFCOMM Channel: %u", value); @@ -1707,7 +1945,7 @@ if (!pinfo->fd->flags.visited && service_info) save_channel(pinfo, BTSDP_RFCOMM_PROTOCOL_UUID, value, *protocol_order, service_info); *protocol_order += 1; - } else if (uuid == BTSDP_ATT_PROTOCOL_UUID) { + } else if (uuid.bt_uuid == BTSDP_ATT_PROTOCOL_UUID) { proto_item_append_text(feature_item, ", GATT Handle Start: 0x%04x", value); proto_item_append_text(entry_item, ", GATT Handle Start: 0x%04x", value); wmem_strbuf_append_printf(info_buf, ":0x%04x.", value); @@ -1742,7 +1980,7 @@ dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, entry_offset); new_offset = get_type_length(tvb, entry_offset, &length); - if (uuid == BTSDP_BNEP_PROTOCOL_UUID) { + if (uuid.bt_uuid == BTSDP_BNEP_PROTOCOL_UUID) { wmem_strbuf_append(info_buf, " ("); value_offset = new_offset; while (value_offset - new_offset < length) { @@ -1773,9 +2011,10 @@ } + static gint dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, - gint offset, gint attribute, guint16 service_uuid, + gint offset, gint attribute, uuid_t service_uuid, gint service_did_vendor_id, gint service_did_vendor_id_source, service_info_t *service_info, wmem_strbuf_t **pinfo_buf) { @@ -1812,6 +2051,8 @@ guint8 *new_str; guint32 value; guint64 value_64; + uuid_t uuid; + gchar *uuid_str; gint length; gint protocol_order; wmem_strbuf_t *info_buf; @@ -1830,7 +2071,7 @@ offset = get_type_length(tvb, offset, &size); found = TRUE; - switch(service_uuid) { + switch(service_uuid.bt_uuid) { case BTSDP_DID_SERVICE_UUID: switch (attribute) { case 0x200: @@ -2045,8 +2286,8 @@ supported_features = tvb_get_guint8(tvb, offset); wmem_strbuf_append_printf(info_buf, "%s%s", - (supported_features & 0x01) ? "SIM " : "", - (supported_features & 0x02) ? "LocalPhonebook " : ""); + (supported_features & 0x01) ? "LocalPhonebook " : "", + (supported_features & 0x02) ? "SIM " : ""); break; default: found = FALSE; @@ -2181,12 +2422,12 @@ list_offset = offset; while (list_offset - offset < size) { entry_offset = get_type_length(tvb, list_offset, &entry_length); - feature_item = proto_tree_add_text(next_tree, tvb, entry_offset, entry_length, "Supported Feature #%u", i_feature); + feature_item = proto_tree_add_none_format(next_tree, hf_hdp_supported_features_data, tvb, entry_offset, entry_length, "Supported Feature #%u", i_feature); feature_tree = proto_item_add_subtree(feature_item, ett_btsdp_supported_features); dissect_data_element(feature_tree, &sub_tree, pinfo, tvb, list_offset); - entry_item = proto_tree_add_text(sub_tree, tvb, entry_offset, 0, "MDEP ID"); + entry_item = proto_tree_add_item(sub_tree, hf_hdp_supported_features_data_mdep_id, tvb, entry_offset, 0, ENC_NA); entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_supported_features_mdep_id); dissect_data_element(entry_tree, &next_tree, pinfo, tvb, entry_offset); new_offset = get_type_length(tvb, entry_offset, &length); @@ -2198,7 +2439,7 @@ proto_item_append_text(entry_item, ": %u (0x%02x)", mdep_id, mdep_id); entry_offset += length; - entry_item = proto_tree_add_text(sub_tree, tvb, entry_offset, 0, "MDEP Data Type"); + entry_item = proto_tree_add_item(sub_tree, hf_hdp_supported_features_data_mdep_data_type, tvb, entry_offset, 0, ENC_NA); entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_supported_features_mdep_data_type); dissect_data_element(entry_tree, &next_tree, pinfo, tvb, entry_offset); @@ -2210,7 +2451,7 @@ proto_item_append_text(entry_item, ": %u (0x%04x)", value, value); entry_offset += length; - entry_item = proto_tree_add_text(sub_tree, tvb, entry_offset, 0, "MDEP Role"); + entry_item = proto_tree_add_item(sub_tree, hf_hdp_supported_features_data_mdep_role, tvb, entry_offset, 0, ENC_NA); entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_supported_features_mdep_role); dissect_data_element(entry_tree, &next_tree, pinfo, tvb, entry_offset); @@ -2224,7 +2465,7 @@ entry_offset += length; if (entry_length - (entry_offset - list_offset) > 0) { - entry_item = proto_tree_add_text(sub_tree, tvb, entry_offset, entry_length, "MDEP Description"); + entry_item = proto_tree_add_item(sub_tree, hf_hdp_supported_features_data_mdep_description, tvb, entry_offset, entry_length, ENC_NA); entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_supported_features_mdep_description); dissect_data_element(entry_tree, &next_tree, pinfo, tvb, entry_offset); @@ -2463,7 +2704,7 @@ list_offset = offset; i_feature = 1; while (list_offset - offset < size) { - entry_item = proto_tree_add_text(next_tree, tvb, list_offset, size, "Descriptor #%u", i_feature); + entry_item = proto_tree_add_none_format(next_tree, hf_hid_descriptor_list_descriptor_data, tvb, list_offset, size, "Descriptor #%u", i_feature); entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_data_element); dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, list_offset); @@ -2493,7 +2734,7 @@ i_feature = 1; while (list_offset - offset < size) { wmem_strbuf_append(info_buf, "["); - entry_item = proto_tree_add_text(next_tree, tvb, list_offset, size, "Language #%u", i_feature); + entry_item = proto_tree_add_none_format(next_tree, hf_hid_lang, tvb, list_offset, size, "Language #%u", i_feature); entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_data_element); dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, list_offset); @@ -2858,15 +3099,9 @@ dissect_data_element(next_tree, &entry_tree, pinfo, tvb, list_offset); list_offset = get_type_length(tvb, list_offset, &list_length); - if (list_length == 2) { - proto_tree_add_item(entry_tree, hf_sdp_service_uuid, tvb, list_offset, list_length, ENC_BIG_ENDIAN); - value = tvb_get_ntohs(tvb, list_offset); - } else { - proto_tree_add_item(entry_tree, hf_sdp_service_long_uuid, tvb, list_offset, list_length, ENC_NA); - value = 0; - } + dissect_uuid(entry_tree, tvb, list_offset, list_length, &uuid); - wmem_strbuf_append(info_buf, val_to_str_const(value, vs_service_classes, "Unknown")); + wmem_strbuf_append(info_buf, print_uuid(&uuid)); list_offset += list_length; if (list_offset - offset < size) @@ -2879,14 +3114,8 @@ wmem_strbuf_append_printf(info_buf, "0x%08x (%u)", value, value); break; case 0x003: - if (size == 2) { - proto_tree_add_item(next_tree, hf_sdp_service_uuid, tvb, offset, size, ENC_BIG_ENDIAN); - value = tvb_get_ntohs(tvb, offset); - } else { - proto_tree_add_item(next_tree, hf_sdp_service_long_uuid, tvb, offset, size, ENC_NA); - value = 0; - } - wmem_strbuf_append(info_buf, val_to_str_const(value, vs_service_classes, "Unknown")); + dissect_uuid(next_tree, tvb, offset, size, &uuid); + wmem_strbuf_append(info_buf, print_uuid(&uuid)); break; case 0x004: protocol_order = 0; @@ -2899,15 +3128,9 @@ dissect_data_element(next_tree, &entry_tree, pinfo, tvb, list_offset); list_offset = get_type_length(tvb, list_offset, &list_length); - if (list_length == 2) { - proto_tree_add_item(entry_tree, hf_sdp_service_uuid, tvb, list_offset, list_length, ENC_BIG_ENDIAN); - value = tvb_get_ntohs(tvb, list_offset); - } else { - proto_tree_add_item(entry_tree, hf_sdp_service_long_uuid, tvb, list_offset, list_length, ENC_NA); - value = 0; - } + dissect_uuid(entry_tree, tvb, list_offset, list_length, &uuid); - wmem_strbuf_append(info_buf, val_to_str_const(value, vs_service_classes, "Unknown")); + wmem_strbuf_append(info_buf, print_uuid(&uuid)); list_offset += list_length; if (list_offset - offset < size) @@ -2919,7 +3142,7 @@ i_feature = 1; while (list_offset - offset < size) { wmem_strbuf_append(info_buf, "("); - entry_item = proto_tree_add_text(next_tree, tvb, list_offset, size, "Language #%u", i_feature); + entry_item = proto_tree_add_none_format(next_tree, hf_sdp_lang, tvb, list_offset, size, "Language #%u", i_feature); entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_data_element); dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, list_offset); @@ -2969,22 +3192,17 @@ while (list_offset - offset < size) { entry_offset = get_type_length(tvb, list_offset, &entry_length); dissect_data_element(next_tree, &sub_tree, pinfo, tvb, list_offset); - entry_item = proto_tree_add_text(sub_tree, tvb, entry_offset, entry_length, "Profile Descriptor List #%u", i_protocol); + entry_item = proto_tree_add_none_format(sub_tree, hf_profile_descriptor_list, tvb, entry_offset, entry_length, "Profile Descriptor List #%u", i_protocol); entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_data_element); dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, entry_offset); entry_offset = get_type_length(tvb, entry_offset, &entry_length); - if (entry_length == 2) { - proto_tree_add_item(sub_tree, hf_sdp_service_uuid, tvb, entry_offset, entry_length, ENC_BIG_ENDIAN); - value = tvb_get_ntohs(tvb, entry_offset); - } else { - proto_tree_add_item(sub_tree, hf_sdp_service_long_uuid, tvb, entry_offset, entry_length, ENC_NA); - value = 0; - } + dissect_uuid(sub_tree, tvb, entry_offset, entry_length, &uuid); - wmem_strbuf_append(info_buf, val_to_str_const(value, vs_service_classes, "Unknown")); - proto_item_append_text(entry_item, ": %s", val_to_str_const(value, vs_service_classes, "Unknown")); + uuid_str = print_uuid(&uuid); + wmem_strbuf_append(info_buf, uuid_str); + proto_item_append_text(entry_item, ": %s", uuid_str); entry_offset += entry_length; @@ -3027,7 +3245,7 @@ while (list_offset - offset < size) { entry_offset = get_type_length(tvb, list_offset, &entry_length); dissect_data_element(next_tree, &sub_tree, pinfo, tvb, list_offset); - entry_item = proto_tree_add_text(sub_tree, tvb, entry_offset, entry_length, "Protocol Descriptor List #%u", i_protocol); + entry_item = proto_tree_add_none_format(sub_tree, hf_profile_descriptor_list, tvb, entry_offset, entry_length, "Protocol Descriptor List #%u", i_protocol); entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_data_element); list_offset = get_type_length(tvb, list_offset, &list_length); @@ -3065,54 +3283,37 @@ if (!found) switch (type) { case 0: - proto_tree_add_text(next_tree, tvb, offset, size, "Nil "); + proto_tree_add_item(next_tree, hf_data_element_value_nil, tvb, offset, size, ENC_NA); wmem_strbuf_append(info_buf, "Nil "); break; case 1: { guint32 val = get_uint_by_size(tvb, offset, size_index); - proto_tree_add_text(next_tree, tvb, offset, size, - "unsigned int %d ", val); + proto_tree_add_item(next_tree, hf_data_element_value_unsigned_int, tvb, offset, size, ENC_BIG_ENDIAN); wmem_strbuf_append_printf(info_buf, "%u ", val); break; } case 2: { guint32 val = get_int_by_size(tvb, offset, size_index); - proto_tree_add_text(next_tree, tvb, offset, size, - "signed int %d ", val); + proto_tree_add_item(next_tree, hf_data_element_value_signed_int, tvb, offset, size, ENC_BIG_ENDIAN); wmem_strbuf_append_printf(info_buf, "%d ", val); break; } - case 3: { - guint32 id; - const gchar *uuid_name; - gchar *ptr = tvb_bytes_to_str(tvb, offset, size); - - if (size == 2) { - id = tvb_get_ntohs(tvb, offset); - } else { - id = tvb_get_ntohl(tvb, offset); - } - uuid_name = val_to_str_ext_const(id, &vs_service_classes_ext, "Unknown service"); - - proto_tree_add_text(next_tree, tvb, offset, size, "%s (0x%s) ", uuid_name, ptr); - - wmem_strbuf_append_printf(info_buf, ": %s", uuid_name); + case 3: + dissect_uuid(next_tree, tvb, offset, size, &uuid); + wmem_strbuf_append_printf(info_buf, ": %s", print_uuid(&uuid)); break; - } case 8: /* fall through */ case 4: { gchar *ptr = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset, size); - proto_tree_add_text(next_tree, tvb, offset, size, "%s \"%s\"", - type == 8 ? "URL" : "String", ptr); + proto_tree_add_item(next_tree, (type == 8) ? hf_data_element_value_url : hf_data_element_value_string, tvb, offset, size, ENC_NA | ENC_ASCII); wmem_strbuf_append_printf(info_buf, "%s ", ptr); break; } case 5: { guint8 var = tvb_get_guint8(tvb, offset); - proto_tree_add_text(next_tree, tvb, offset, size, "%s", - var ? "true" : "false"); + proto_tree_add_item(next_tree, hf_data_element_value_boolean, tvb, offset, size, ENC_BIG_ENDIAN); wmem_strbuf_append_printf(info_buf, "%s ", var ? "true" : "false"); break; } @@ -3124,9 +3325,8 @@ gint first = 1; wmem_strbuf_t *substr; - ti = proto_tree_add_text(next_tree, tvb, offset, size, "%s", - type == 6 ? "Data Element sequence" : - "Data Element alternative"); + ti = proto_tree_add_item(next_tree, (type == 6) ? hf_data_element_value_sequence : hf_data_element_value_alternative, + tvb, offset, size, ENC_NA); st = proto_item_add_subtree(ti, ett_btsdp_des); wmem_strbuf_append(info_buf, "{ "); @@ -3138,7 +3338,7 @@ first = 0; } - size = dissect_sdp_type(st, pinfo, tvb, offset, attribute, service_uuid, service_did_vendor_id, service_did_vendor_id_source, service_info, &substr); + size = dissect_sdp_type(st, pinfo, tvb, offset, attribute, uuid, service_did_vendor_id, service_did_vendor_id_source, service_info, &substr); if (size < 1) { break; } @@ -3155,73 +3355,11 @@ return new_offset - start_offset; } -static gint -findDidVendorIdSource(tvbuff_t *tvb, gint service_offset, - gint number_of_attributes) -{ - gint result = 0; - gint search_length; - gint search_offset; - gint i_number_of_attributes; - guint16 attribute; - - search_offset = service_offset; - i_number_of_attributes = 0; - - while (i_number_of_attributes < number_of_attributes) { - search_offset = get_type_length(tvb, search_offset, &search_length); - attribute = tvb_get_ntohs(tvb, search_offset); - - search_offset += search_length; - search_offset = get_type_length(tvb, search_offset, &search_length); - - if (attribute == 0x205) { - result = get_uint_by_size(tvb, search_offset, 1); - } - - search_offset += search_length; - i_number_of_attributes += 1; - } - - return result; -} - -static gint -findDidVendorId(tvbuff_t *tvb, gint service_offset, - gint number_of_attributes) -{ - gint result = 0; - gint search_length; - gint search_offset; - gint i_number_of_attributes; - guint16 attribute; - - search_offset = service_offset; - i_number_of_attributes = 0; - - while (i_number_of_attributes < number_of_attributes) { - search_offset = get_type_length(tvb, search_offset, &search_length); - attribute = tvb_get_ntohs(tvb, search_offset); - - search_offset += search_length; - search_offset = get_type_length(tvb, search_offset, &search_length); - - if (attribute == 0x201) { - result = get_uint_by_size(tvb, search_offset, 1); - } - - search_offset += search_length; - i_number_of_attributes += 1; - } - - return result; -} - static gint dissect_sdp_service_attribute(proto_tree *tree, tvbuff_t *tvb, gint offset, - packet_info *pinfo, guint16 service_uuid, gint service_offset, - service_info_t *service_info, gint number_of_attributes) + packet_info *pinfo, uuid_t uuid, gint service_offset, + service_info_t *service_info, gint number_of_attributes, gboolean attribute_only) { proto_tree *attribute_tree; proto_item *attribute_item; @@ -3230,7 +3368,7 @@ proto_tree *attribute_value_tree; proto_item *attribute_value_item; proto_tree *next_tree; - gint size; + gint size = 0; const gchar *attribute_name; wmem_strbuf_t *attribute_value = NULL; guint16 id; @@ -3241,10 +3379,12 @@ const guint8 *profile_speficic = ""; gint new_offset; gint old_offset; + guint8 type; + type = tvb_get_guint8(tvb, offset); id = tvb_get_ntohs(tvb, offset + 1); - switch (service_uuid) { + switch (uuid.bt_uuid) { case BTSDP_DID_SERVICE_UUID: name_vals = vs_did_attribute_id; hfx_attribute_id = hf_service_attribute_id_did; @@ -3411,39 +3551,112 @@ hfx_attribute_id = hf_service_attribute_id_generic; } - attribute_item = proto_tree_add_text(tree, tvb, offset, -1, - "Service Attribute: %s%s (0x%x)", profile_speficic, attribute_name, id); - attribute_tree = proto_item_add_subtree(attribute_item, ett_btsdp_attribute); - - attribute_id_item = proto_tree_add_text(attribute_tree, tvb, offset, 3, "Attribute ID: %s", attribute_name); - attribute_id_tree = proto_item_add_subtree(attribute_id_item, ett_btsdp_attribute_id); - - new_offset = dissect_data_element(attribute_id_tree, &next_tree, pinfo, tvb, offset); - proto_tree_add_item(next_tree, hfx_attribute_id, tvb, offset + 1, 2, ENC_BIG_ENDIAN); - offset = new_offset; - - attribute_value_item = proto_tree_add_text(attribute_tree, tvb, offset, -1, "Attribute Value"); - attribute_value_tree = proto_item_add_subtree(attribute_value_item, ett_btsdp_attribute_value); - - dissect_sdp_type(attribute_value_tree, pinfo, tvb, offset, id, service_uuid, - service_did_vendor_id, service_did_vendor_id_source, service_info, &attribute_value); - old_offset = offset; - offset = get_type_length(tvb, offset, &size); - proto_item_append_text(attribute_item, ", value = %s", wmem_strbuf_get_str(attribute_value)); + if (!attribute_only) { + attribute_item = proto_tree_add_none_format(tree, hf_service_attribute, tvb, offset, -1, + "Service Attribute: %s%s (0x%x)", profile_speficic, attribute_name, id); + attribute_tree = proto_item_add_subtree(attribute_item, ett_btsdp_attribute); + } else { + attribute_tree = tree; + } - proto_item_set_len(attribute_item, 3 + size + (offset - old_offset)); - proto_item_set_len(attribute_value_item, size + (offset - old_offset)); + if (attribute_only && type == 0x0a) { + dissect_data_element(attribute_tree, &next_tree, pinfo, tvb, offset); + offset += 1; - return offset + size; -} + attribute_id_item = proto_tree_add_item(next_tree, hf_attribute_id_range, tvb, offset, 4, ENC_BIG_ENDIAN); + attribute_id_tree = proto_item_add_subtree(attribute_id_item, ett_btsdp_attribute_id); + col_append_fstr(pinfo->cinfo, COL_INFO, "Attribute Range (0x%04x - 0x%04x) ", + tvb_get_ntohs(tvb, offset), tvb_get_ntohs(tvb, offset + 2)); -static gint -dissect_sdp_service_attribute_list(proto_tree *tree, tvbuff_t *tvb, gint offset, - packet_info *pinfo, gint length _U_) -{ - proto_item *list_item; - proto_tree *list_tree; + proto_tree_add_item(attribute_id_tree, hf_attribute_id_range_from, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + + proto_tree_add_item(attribute_id_tree, hf_attribute_id_range_to, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + } else { + attribute_id_item = proto_tree_add_none_format(attribute_tree, hf_service_attribute_id, tvb, offset, 3, "Attribute ID: %s", attribute_name); + attribute_id_tree = proto_item_add_subtree(attribute_id_item, ett_btsdp_attribute_id); + + new_offset = dissect_data_element(attribute_id_tree, &next_tree, pinfo, tvb, offset); + proto_tree_add_item(next_tree, hfx_attribute_id, tvb, offset + 1, 2, ENC_BIG_ENDIAN); + offset = new_offset; + + if (!attribute_only){ + attribute_value_item = proto_tree_add_item(attribute_tree, hf_service_attribute_value, tvb, offset, -1, ENC_NA); + attribute_value_tree = proto_item_add_subtree(attribute_value_item, ett_btsdp_attribute_value); + + dissect_sdp_type(attribute_value_tree, pinfo, tvb, offset, id, uuid, + service_did_vendor_id, service_did_vendor_id_source, service_info, &attribute_value); + old_offset = offset; + offset = get_type_length(tvb, offset, &size); + proto_item_append_text(attribute_item, ", value = %s", wmem_strbuf_get_str(attribute_value)); + + proto_item_set_len(attribute_item, 3 + size + (offset - old_offset)); + proto_item_set_len(attribute_value_item, size + (offset - old_offset)); + } else { + proto_item_append_text(attribute_id_item, " %s", profile_speficic); + col_append_fstr(pinfo->cinfo, COL_INFO, "[%s%s 0x%04x] ", profile_speficic, attribute_name, id); + } + } + + return offset + size; +} + + +static gint +dissect_attribute_id_list(proto_tree *tree, tvbuff_t *tvb, gint offset, + packet_info *pinfo, uuid_t *uuid) +{ + proto_item *list_item; + proto_tree *list_tree; + proto_tree *sub_tree; + gint start_offset; + gint previous_offset; + gint service_offset; + gint bytes_to_go; + uuid_t empty_uuid; + + if (!uuid) + memset(&empty_uuid, 0, sizeof(uuid_t)); + + start_offset = offset; + list_item = proto_tree_add_item(tree, hf_attribute_id_list, tvb, offset, 0, ENC_NA); + list_tree = proto_item_add_subtree(list_item, ett_btsdp_attribute_idlist); + + dissect_data_element(list_tree, &sub_tree, pinfo, tvb, offset); + + offset = get_type_length(tvb, offset, &bytes_to_go); + service_offset = offset; + proto_item_set_len(list_item, offset - start_offset + bytes_to_go); + + previous_offset = offset; + while (bytes_to_go > 0) { + offset = dissect_sdp_service_attribute(sub_tree, tvb, offset, pinfo, (uuid) ? *uuid : empty_uuid, service_offset, NULL, 1, TRUE); + bytes_to_go -= offset - previous_offset; + previous_offset = offset; + } + + return offset - start_offset; +} + + +static gint +dissect_sdp_error_response(proto_tree *tree, tvbuff_t *tvb, gint offset) +{ + proto_tree_add_item(tree, hf_error_code, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + + return offset; +} + + +static gint +dissect_sdp_service_attribute_list(proto_tree *tree, tvbuff_t *tvb, gint offset, + packet_info *pinfo, uuid_t *service_uuid) +{ + proto_item *list_item; + proto_tree *list_tree; proto_tree *next_tree; gint start_offset = offset; gint search_offset; @@ -3453,8 +3666,8 @@ guint16 attribute; gint element_length; gint new_offset; - guint16 service_uuid = 0; gint service_offset; + uuid_t uuid; wmem_tree_key_t key[10]; guint32 k_interface_id; guint32 k_adapter_id; @@ -3466,18 +3679,25 @@ guint32 k_service_channel; guint32 k_frame_number; service_info_t *service_info; - btl2cap_data_t *l2cap_data = (btl2cap_data_t *) pinfo->private_data; + btl2cap_data_t *l2cap_data; + wmem_array_t *uuid_array; + + uuid_array = wmem_array_new(wmem_packet_scope(), sizeof(uuid_t)); + + l2cap_data = (btl2cap_data_t *) pinfo->private_data; offset = get_type_length(tvb, offset, &len); + memset(&uuid, 0, sizeof(uuid_t)); - list_item = proto_tree_add_text(tree, tvb, - start_offset, len + (offset - start_offset), "Attribute List"); + list_item = proto_tree_add_item(tree, hf_attribute_list, tvb, + start_offset, len + (offset - start_offset), ENC_NA); list_tree = proto_item_add_subtree(list_item, ett_btsdp_attribute); dissect_data_element(list_tree, &next_tree, pinfo, tvb, start_offset); /* search for main service uuid */ search_offset = offset; number_of_attributes = 0; + while ((search_offset - start_offset) < len) { search_offset = get_type_length(tvb, search_offset, &search_length); attribute = tvb_get_ntohs(tvb, search_offset); @@ -3487,14 +3707,10 @@ if (attribute == 0x01) { new_offset = 0; - while (new_offset < search_offset) { + while (new_offset <= search_offset) { new_offset = get_type_length(tvb, search_offset, &element_length); - if (element_length == 2) { - service_uuid = get_uint_by_size(tvb, new_offset, 1); - } else { - /* Currently we do not support service uuid longer then 2 */ - service_uuid = 0; - } + dissect_uuid(NULL, tvb, new_offset, element_length, &uuid); + wmem_array_append_one(uuid_array, uuid); new_offset += element_length; } } @@ -3503,6 +3719,10 @@ number_of_attributes += 1; } + uuid = get_most_specified_uuid(uuid_array); + if (uuid.size == 0 && service_uuid) + uuid = *service_uuid; + if (!pinfo->fd->flags.visited) { service_info = (service_info_t *) wmem_new(wmem_file_scope(), service_info_t); service_info->interface_id = l2cap_data->interface_id; @@ -3517,7 +3737,7 @@ service_info->bd_addr_id = 0; } - service_info->uuid = service_uuid; + service_info->uuid = uuid; service_info->type = 0; service_info->channel = 0; @@ -3530,7 +3750,7 @@ service_offset = offset; while ((offset - start_offset) < len) { offset = dissect_sdp_service_attribute(next_tree, tvb, offset, pinfo, - service_uuid, service_offset, service_info, number_of_attributes); + uuid, service_offset, service_info, number_of_attributes, FALSE); } if (!pinfo->fd->flags.visited) { @@ -3569,8 +3789,13 @@ } proto_item_set_len(list_item, offset - start_offset); - proto_item_append_text(list_tree, " [count = %2u] (%s)", - number_of_attributes, val_to_str_const(service_uuid, vs_service_classes, "Unknown Service")); + + if (uuid.size) + proto_item_append_text(list_tree, " [count = %2u] (%s%s)", + number_of_attributes, (uuid.bt_uuid) ? "" : "CustomUUID: ", print_uuid(&uuid)); + else + proto_item_append_text(list_tree, " [count = %2u]", + number_of_attributes); return offset; } @@ -3578,13 +3803,13 @@ static gint dissect_sdp_service_attribute_list_array(proto_tree *tree, tvbuff_t *tvb, - gint offset, packet_info *pinfo, gint attribute_list_byte_count) + gint offset, packet_info *pinfo, gint attribute_list_byte_count, + uuid_t *service_uuid) { proto_item *lists_item; proto_tree *lists_tree; proto_tree *next_tree; gint start_offset; - gint length; gint len; guint number_of_attributes; @@ -3592,8 +3817,8 @@ offset = get_type_length(tvb, offset, &len); - lists_item = proto_tree_add_text(tree, tvb, start_offset, - attribute_list_byte_count, "Attribute Lists"); + lists_item = proto_tree_add_item(tree, hf_attribute_lists, tvb, start_offset, + attribute_list_byte_count, ENC_NA); lists_tree = proto_item_add_subtree(lists_item, ett_btsdp_attribute); dissect_data_element(lists_tree, &next_tree, pinfo, tvb, start_offset); @@ -3602,10 +3827,8 @@ while (offset - start_offset < attribute_list_byte_count) { number_of_attributes += 1; - get_type_length(tvb, offset, &length); - offset = dissect_sdp_service_attribute_list(next_tree, tvb, offset, - pinfo, length); + pinfo, service_uuid); } proto_item_append_text(lists_tree, " [count = %2u]", number_of_attributes); @@ -3615,52 +3838,199 @@ static gint -dissect_sdp_service_search_attribute_response(proto_tree *tree, tvbuff_t *tvb, +dissect_sdp_service_search_request(proto_tree *tree, tvbuff_t *tvb, gint offset, + packet_info *pinfo, guint16 tid) +{ + gint start_offset; + gint bytes_to_go; + gint size; + proto_item *ti; + proto_tree *st; + proto_tree *sub_tree = NULL; + uuid_t empty_uuid; + wmem_array_t *uuid_array = NULL; + + start_offset = offset; + memset(&empty_uuid, 0, sizeof(uuid_t)); + if (!pinfo->fd->flags.visited) + uuid_array = wmem_array_new(wmem_file_scope(), sizeof(uuid_t)); + + ti = proto_tree_add_item(tree, hf_service_search_pattern, tvb, offset, 0, ENC_NA); + st = proto_item_add_subtree(ti, ett_btsdp_service_search_pattern); + + dissect_data_element(st, &sub_tree, pinfo, tvb, offset); + offset = get_type_length(tvb, offset, &bytes_to_go); + proto_item_set_len(ti, offset - start_offset + bytes_to_go); + + while (bytes_to_go > 0) { + wmem_strbuf_t *str = NULL; + gint entry_offset; + gint entry_size; + uuid_t uuid; + + size = dissect_sdp_type(sub_tree, pinfo, tvb, offset, -1, empty_uuid, 0, 0, NULL, &str); + + entry_offset = get_type_length(tvb, offset, &entry_size); + dissect_uuid(NULL, tvb, entry_offset, entry_size, &uuid); + if (uuid_array) + wmem_array_append_one(uuid_array, uuid); + + proto_item_append_text(ti, " %s", wmem_strbuf_get_str(str)); + col_append_fstr(pinfo->cinfo, COL_INFO, "%s", wmem_strbuf_get_str(str)); + + if (size < 1) + break; + + offset += size; + bytes_to_go -= size; + } + + proto_tree_add_item(tree, hf_maximum_service_record_count, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + + reassemble_continuation_state(tvb, pinfo, offset, tid, TRUE, + 0, 0, PDU_TYPE_SERVICE_SEARCH, NULL, NULL, NULL, &uuid_array, NULL); + + offset = dissect_continuation_state(tvb, tree, pinfo, offset); + + return offset; +} + + +static gint +dissect_sdp_service_search_response(proto_tree *tree, tvbuff_t *tvb, gint offset, packet_info *pinfo, guint16 tid) { - gint attribute_list_byte_count; - gboolean is_first; - gboolean is_continued; - tvbuff_t *new_tvb; + proto_tree *st; + proto_item *ti; + guint16 current_count; + gboolean is_first; + gboolean is_continued; + tvbuff_t *new_tvb; + guint i_record; + wmem_array_t *uuid_array = NULL; + wmem_array_t *record_handle_array = NULL; - proto_tree_add_item(tree, hf_attribute_list_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN); - attribute_list_byte_count = tvb_get_ntohs(tvb, offset); + proto_tree_add_item(tree, hf_ssr_total_count, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - reassemble_continuation_state(tvb, pinfo, - offset + attribute_list_byte_count, tid, FALSE, - offset, attribute_list_byte_count, - PDU_TYPE_SERVICE_SEARCH_ATTRIBUTE, &new_tvb, &is_first, - &is_continued); + current_count = tvb_get_ntohs(tvb, offset); + proto_tree_add_item(tree, hf_ssr_current_count, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; - if (is_first && !is_continued) { - dissect_sdp_service_attribute_list_array(tree, tvb, offset, pinfo, - attribute_list_byte_count); - } else { - proto_tree_add_item(tree, hf_fragment, tvb, offset, - attribute_list_byte_count, ENC_NA); + ti = proto_tree_add_none_format(tree, hf_service_record_handle_list, tvb, offset, + current_count * 4, "Service Record Handle List [count = %u]", current_count); + st = proto_item_add_subtree(ti, ett_btsdp_ssr); + + if (!pinfo->fd->flags.visited) + record_handle_array = wmem_array_new(wmem_packet_scope(), sizeof(guint32)); + + while (current_count > 0) { + proto_tree_add_item(st, hf_sdp_service_record_handle, tvb, offset, 4, ENC_BIG_ENDIAN); + + if (record_handle_array) { + guint32 value; + + value = tvb_get_ntohl(tvb, offset); + wmem_array_append_one(record_handle_array, value); + } + + offset += 4; + current_count -= 1; } - if (is_continued) { - col_append_fstr(pinfo->cinfo, COL_INFO, "(fragment)"); + reassemble_continuation_state(tvb, pinfo, offset, tid, FALSE, + offset - current_count * 4, current_count * 4, PDU_TYPE_SERVICE_SEARCH, + &new_tvb, &is_first, &is_continued, &uuid_array, NULL); + + if (is_continued) + col_append_str(pinfo->cinfo, COL_INFO, "(fragment)"); + + if (!pinfo->fd->flags.visited) { + btl2cap_data_t *l2cap_data; + record_handle_service_t *record_handle_service; + wmem_tree_key_t key[7]; + guint32 k_interface_id; + guint32 k_adapter_id; + guint32 k_chandle; + guint32 k_psm; + guint32 k_record_handle; + guint32 k_frame_number; + guint32 interface_id; + guint32 adapter_id; + guint32 chandle; + guint32 psm; + guint32 record_handle; + guint32 frame_number; + + l2cap_data = (btl2cap_data_t *) pinfo->private_data; + + interface_id = l2cap_data->interface_id; + adapter_id = l2cap_data->adapter_id; + chandle = l2cap_data->chandle; + psm = l2cap_data->psm; + frame_number = pinfo->fd->num; + + k_interface_id = interface_id; + k_adapter_id = adapter_id; + k_chandle = chandle; + k_psm = psm; + k_frame_number = frame_number; + + for (i_record = 0; i_record < wmem_array_get_count(record_handle_array); ++i_record) { + + record_handle = *((guint32 *)wmem_array_index(record_handle_array, i_record)); + k_record_handle = record_handle; + + key[0].length = 1; + key[0].key = &k_interface_id; + key[1].length = 1; + key[1].key = &k_adapter_id; + key[2].length = 1; + key[2].key = &k_chandle; + key[3].length = 1; + key[3].key = &k_psm; + key[4].length = 1; + key[4].key = &k_record_handle; + key[5].length = 1; + key[5].key = &k_frame_number; + key[6].length = 0; + key[6].key = NULL; + + record_handle_service = (record_handle_service_t *) wmem_new(wmem_file_scope(), record_handle_service_t); + record_handle_service->interface_id = interface_id; + record_handle_service->adapter_id = adapter_id; + record_handle_service->chandle = chandle; + record_handle_service->psm = psm; + record_handle_service->record_handle = record_handle; + + record_handle_service->uuid_array = uuid_array; + + wmem_tree_insert32_array(record_handle_services, key, record_handle_service); + } } - offset = dissect_continuation_state(tvb, tree, pinfo, offset + attribute_list_byte_count); + offset = dissect_continuation_state(tvb, tree, pinfo, offset); if (!is_first && new_tvb) { proto_item *reassembled_item; proto_tree *reassembled_tree; + gint new_offset = 0; + gint new_length; - add_new_data_source(pinfo, new_tvb, (is_continued) ? "Partial Reassembled SDP" : "Reassembled SDP"); + new_length = tvb_length(new_tvb); - reassembled_item = proto_tree_add_text(tree, new_tvb, 0, tvb_length(new_tvb), - (is_continued) ? "Partial Attribute List" : "Reassembled Attribute List"); + reassembled_item = proto_tree_add_item(tree, (is_continued) ? hf_partial_record_handle_list : hf_reassembled_record_handle_list,new_tvb, 0, new_length, ENC_NA); + proto_item_append_text(reassembled_item, " [count = %u]", new_length / 4); reassembled_tree = proto_item_add_subtree(reassembled_item, ett_btsdp_reassembled); PROTO_ITEM_SET_GENERATED(reassembled_item); - if (!is_continued) - dissect_sdp_service_attribute_list_array(reassembled_tree, new_tvb, 0, - pinfo, tvb_length(new_tvb)); + while (new_length > 0) { + proto_tree_add_item(reassembled_tree, hf_sdp_service_record_handle, new_tvb, + new_offset, 4, ENC_BIG_ENDIAN); + new_offset += 4; + new_length -= 4; + } } return offset; @@ -3668,41 +4038,28 @@ static gint -dissect_sdp_service_search_attribute_request(proto_tree *tree, tvbuff_t *tvb, +dissect_sdp_service_attribute_request(proto_tree *tree, tvbuff_t *tvb, gint offset, packet_info *pinfo, guint16 tid) { - proto_tree *ptree; - proto_item *pitem; - proto_tree *next_tree; - gint start_offset; - gint size; - gint bytes_to_go; - wmem_strbuf_t *info_buf = NULL; + guint32 record_handle; + wmem_array_t *uuid_array; + uuid_t uuid; - start_offset = offset; - pitem = proto_tree_add_text(tree, tvb, offset, 2, "Service Search Pattern"); - ptree = proto_item_add_subtree(pitem, ett_btsdp_attribute); - - dissect_data_element(ptree, &next_tree, pinfo, tvb, offset); - offset = get_type_length(tvb, offset, &bytes_to_go); - proto_item_set_len(pitem, bytes_to_go + (offset - start_offset)); - - while (bytes_to_go > 0) { - size = dissect_sdp_type(next_tree, pinfo, tvb, offset, -1, 0, 0, 0, NULL, &info_buf); - proto_item_append_text(ptree, "%s", wmem_strbuf_get_str(info_buf)); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", wmem_strbuf_get_str(info_buf)); - - offset += size; - bytes_to_go -= size; - } + proto_tree_add_item(tree, hf_sdp_service_record_handle, tvb, offset, 4, ENC_BIG_ENDIAN); + record_handle = tvb_get_ntohl(tvb, offset); + col_append_fstr(pinfo->cinfo, COL_INFO, ": 0x%08x - ", record_handle); + offset += 4; proto_tree_add_item(tree, hf_maximum_attribute_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - offset += dissect_attribute_id_list(tree, tvb, offset, pinfo); + uuid_array = get_uuids(pinfo, record_handle); + uuid = get_most_specified_uuid(uuid_array); + + offset += dissect_attribute_id_list(tree, tvb, offset, pinfo, &uuid); reassemble_continuation_state(tvb, pinfo, offset, tid, TRUE, - 0, 0, PDU_TYPE_SERVICE_SEARCH_ATTRIBUTE, NULL, NULL, NULL); + 0, 0, PDU_TYPE_SERVICE_ATTRIBUTE, NULL, NULL, NULL, NULL, &record_handle); offset = dissect_continuation_state(tvb, tree, pinfo, offset); @@ -3714,10 +4071,12 @@ dissect_sdp_service_attribute_response(proto_tree *tree, tvbuff_t *tvb, gint offset, packet_info *pinfo, guint16 tid) { - gint attribute_list_byte_count; - gboolean is_first; - gboolean is_continued; - tvbuff_t *new_tvb; + gint attribute_list_byte_count; + gboolean is_first; + gboolean is_continued; + tvbuff_t *new_tvb; + guint32 record_handle = 0; + uuid_t uuid; proto_tree_add_item(tree, hf_attribute_list_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN); attribute_list_byte_count = tvb_get_ntohs(tvb, offset); @@ -3727,19 +4086,26 @@ offset + attribute_list_byte_count, tid, FALSE, offset, attribute_list_byte_count, PDU_TYPE_SERVICE_ATTRIBUTE, &new_tvb, &is_first, - &is_continued); + &is_continued, NULL, &record_handle); + + if (!is_continued) { + wmem_array_t *uuid_array; + + uuid_array = get_uuids(pinfo, record_handle); + uuid = get_most_specified_uuid(uuid_array); + } else { + memset(&uuid, 0, sizeof(uuid_t)); + } if (is_first && !is_continued) { - dissect_sdp_service_attribute_list(tree, tvb, offset, pinfo, - attribute_list_byte_count); + dissect_sdp_service_attribute_list(tree, tvb, offset, pinfo, &uuid); } else { proto_tree_add_item(tree, hf_fragment, tvb, offset, attribute_list_byte_count, ENC_NA); } - if (is_continued) { - col_append_fstr(pinfo->cinfo, COL_INFO, "(fragment)"); - } + if (is_continued) + col_append_str(pinfo->cinfo, COL_INFO, "(fragment)"); offset = dissect_continuation_state(tvb, tree, pinfo, offset + attribute_list_byte_count); @@ -3749,13 +4115,16 @@ add_new_data_source(pinfo, new_tvb, (is_continued) ? "Partial Reassembled SDP" : "Reassembled SDP"); - reassembled_item = proto_tree_add_text(tree, new_tvb, 0, tvb_length(new_tvb), - (is_continued) ? "Partial Attribute List" : "Reassembled Attribute List"); + reassembled_item = proto_tree_add_item(tree, + (is_continued) ? hf_partial_attribute_list : hf_reassembled_attribute_list, + new_tvb, 0, tvb_length(new_tvb), ENC_NA); reassembled_tree = proto_item_add_subtree(reassembled_item, ett_btsdp_reassembled); PROTO_ITEM_SET_GENERATED(reassembled_item); - if (!is_continued) - dissect_sdp_service_attribute_list(reassembled_tree, new_tvb, 0, pinfo, tvb_length(new_tvb)); + if (!is_continued) { + dissect_sdp_service_attribute_list(reassembled_tree, new_tvb, 0, + pinfo, &uuid); + } } return offset; @@ -3763,69 +4132,65 @@ static gint -dissect_sdp_service_attribute_request(proto_tree *tree, tvbuff_t *tvb, +dissect_sdp_service_search_attribute_request(proto_tree *tree, tvbuff_t *tvb, gint offset, packet_info *pinfo, guint16 tid) { - guint32 value; - - proto_tree_add_item(tree, hf_sdp_service_record_handle, tvb, offset, 4, ENC_BIG_ENDIAN); - value = tvb_get_ntohl(tvb, offset); - col_append_fstr(pinfo->cinfo, COL_INFO, ": 0x%08x - ", value); - offset += 4; - - proto_tree_add_item(tree, hf_maximum_attribute_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - - offset += dissect_attribute_id_list(tree, tvb, offset, pinfo); - - reassemble_continuation_state(tvb, pinfo, offset, tid, TRUE, - 0, 0, PDU_TYPE_SERVICE_ATTRIBUTE, NULL, NULL, NULL); - - offset = dissect_continuation_state(tvb, tree, pinfo, offset); - - return offset; -} - - -static gint -dissect_sdp_service_search_request(proto_tree *tree, tvbuff_t *tvb, gint offset, - packet_info *pinfo, guint16 tid) -{ - gint start_offset; - gint bytes_to_go; - gint size; - proto_item *ti; - proto_tree *st; + proto_tree *ptree; + proto_item *pitem; + proto_tree *next_tree; + gint start_offset; + gint size; + gint bytes_to_go; + wmem_strbuf_t *info_buf = NULL; + uuid_t empty_uuid; + wmem_array_t *uuid_array = NULL; + uuid_t uuid; + + memset(&empty_uuid, 0, sizeof(uuid_t)); + if (!pinfo->fd->flags.visited) + uuid_array = wmem_array_new(wmem_file_scope(), sizeof(uuid_t)); + else + uuid_array = wmem_array_new(wmem_packet_scope(), sizeof(uuid_t)); start_offset = offset; + pitem = proto_tree_add_item(tree, hf_service_search_pattern, tvb, offset, 0, ENC_NA); + ptree = proto_item_add_subtree(pitem, ett_btsdp_attribute); - ti = proto_tree_add_text(tree, tvb, offset, 2, "Service Search Pattern"); - st = proto_item_add_subtree(ti, ett_btsdp_service_search_pattern); - - dissect_data_element(st, NULL, pinfo, tvb, offset); + dissect_data_element(ptree, &next_tree, pinfo, tvb, offset); offset = get_type_length(tvb, offset, &bytes_to_go); - proto_item_set_len(ti, offset - start_offset + bytes_to_go); + proto_item_set_len(pitem, bytes_to_go + (offset - start_offset)); while (bytes_to_go > 0) { - wmem_strbuf_t *str = NULL; + gint entry_offset; + gint entry_size; + uuid_t a_uuid; - size = dissect_sdp_type(st, pinfo, tvb, offset, -1, 0, 0, 0, NULL, &str); + memset(&a_uuid, 0, sizeof(uuid_t)); - proto_item_append_text(st, " %s", wmem_strbuf_get_str(str)); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", wmem_strbuf_get_str(str)); + size = dissect_sdp_type(next_tree, pinfo, tvb, offset, -1, empty_uuid, 0, 0, NULL, &info_buf); + proto_item_append_text(pitem,"%s", wmem_strbuf_get_str(info_buf)); + col_append_fstr(pinfo->cinfo, COL_INFO, "%s", wmem_strbuf_get_str(info_buf)); - if (size < 1) - break; + entry_offset = get_type_length(tvb, offset, &entry_size); + dissect_uuid(NULL, tvb, entry_offset, entry_size, &a_uuid); + if (uuid_array) + wmem_array_append_one(uuid_array, a_uuid); offset += size; bytes_to_go -= size; } - proto_tree_add_item(tree, hf_maximum_service_record_count, tvb, offset, 2, ENC_BIG_ENDIAN); + col_append_fstr(pinfo->cinfo, COL_INFO, ": "); + + proto_tree_add_item(tree, hf_maximum_attribute_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; + uuid = get_most_specified_uuid(uuid_array); + + offset += dissect_attribute_id_list(tree, tvb, offset, pinfo, &uuid); + reassemble_continuation_state(tvb, pinfo, offset, tid, TRUE, - 0, 0, PDU_TYPE_SERVICE_SEARCH, NULL, NULL, NULL); + 0, 0, PDU_TYPE_SERVICE_SEARCH_ATTRIBUTE, NULL, NULL, NULL, &uuid_array, NULL); offset = dissect_continuation_state(tvb, tree, pinfo, offset); @@ -3834,59 +4199,56 @@ static gint -dissect_sdp_service_search_response(proto_tree *tree, tvbuff_t *tvb, +dissect_sdp_service_search_attribute_response(proto_tree *tree, tvbuff_t *tvb, gint offset, packet_info *pinfo, guint16 tid) { - proto_tree *st; - proto_item *ti; - guint16 current_count; - gboolean is_first; - gboolean is_continued; - tvbuff_t *new_tvb; + gint attribute_list_byte_count; + gboolean is_first; + gboolean is_continued; + tvbuff_t *new_tvb; + uuid_t uuid; + wmem_array_t *uuid_array = NULL; - proto_tree_add_item(tree, hf_ssr_total_count, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_attribute_list_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN); + attribute_list_byte_count = tvb_get_ntohs(tvb, offset); offset += 2; - current_count = tvb_get_ntohs(tvb, offset); - proto_tree_add_item(tree, hf_ssr_current_count, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; + reassemble_continuation_state(tvb, pinfo, + offset + attribute_list_byte_count, tid, FALSE, + offset, attribute_list_byte_count, + PDU_TYPE_SERVICE_SEARCH_ATTRIBUTE, &new_tvb, &is_first, + &is_continued, &uuid_array, NULL); - ti = proto_tree_add_text(tree, tvb, offset, - current_count * 4, "Service Record Handle List [count = %u]", current_count); - st = proto_item_add_subtree(ti, ett_btsdp_ssr); + uuid = get_most_specified_uuid(uuid_array);; - while (current_count > 0) { - proto_tree_add_item(st, hf_sdp_service_record_handle, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - current_count -= 1; + if (is_first && !is_continued) { + dissect_sdp_service_attribute_list_array(tree, tvb, offset, pinfo, + attribute_list_byte_count, &uuid); + } else { + proto_tree_add_item(tree, hf_fragment, tvb, offset, + attribute_list_byte_count, ENC_NA); } - reassemble_continuation_state(tvb, pinfo, offset, tid, FALSE, - offset - current_count * 4, current_count * 4, PDU_TYPE_SERVICE_SEARCH, - &new_tvb, &is_first, &is_continued); + if (is_continued) + col_append_str(pinfo->cinfo, COL_INFO, "(fragment)"); - offset = dissect_continuation_state(tvb, tree, pinfo, offset); + offset = dissect_continuation_state(tvb, tree, pinfo, offset + attribute_list_byte_count); if (!is_first && new_tvb) { proto_item *reassembled_item; proto_tree *reassembled_tree; - gint new_offset = 0; - gint new_length; - new_length = tvb_length(new_tvb); + add_new_data_source(pinfo, new_tvb, (is_continued) ? "Partial Reassembled SDP" : "Reassembled SDP"); - reassembled_item = proto_tree_add_text(tree, new_tvb, 0, new_length, - (is_continued) ? "Partial Record Handle List" : "Reassembled Record Handle List"); - proto_item_append_text(reassembled_item, " [count = %u]", new_length / 4); + reassembled_item = proto_tree_add_item(tree, + (is_continued) ? hf_partial_attribute_list : hf_reassembled_attribute_list, + new_tvb, 0, tvb_length(new_tvb), ENC_NA); reassembled_tree = proto_item_add_subtree(reassembled_item, ett_btsdp_reassembled); PROTO_ITEM_SET_GENERATED(reassembled_item); - while (new_length > 0) { - proto_tree_add_item(reassembled_tree, hf_sdp_service_record_handle, new_tvb, - new_offset, 4, ENC_BIG_ENDIAN); - new_offset += 4; - new_length -= 4; - } + if (!is_continued) + dissect_sdp_service_attribute_list_array(reassembled_tree, new_tvb, 0, + pinfo, tvb_length(new_tvb), &uuid); } return offset; @@ -3911,10 +4273,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -3967,7 +4329,7 @@ proto_register_btsdp(void) { module_t *module; - expert_module_t* expert_btsdp; + expert_module_t *expert_btsdp; static hf_register_info hf[] = { { &hf_pdu_id, @@ -4000,6 +4362,26 @@ FT_UINT16, BASE_DEC, NULL, 0, "Count of service records in this message", HFILL} }, + { &hf_attribute_id_list, + { "Attribute ID List", "btsdp.attribute_id_list", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_attribute_id_range, + { "Attribute Range", "btsdp.attribute_range", + FT_UINT32, BASE_HEX, NULL, 0, + NULL, HFILL } + }, + { &hf_attribute_id_range_from, + { "Attribute Range From", "btsdp.attribute_range.from", + FT_UINT16, BASE_HEX, NULL, 0, + NULL, HFILL } + }, + { &hf_attribute_id_range_to, + { "Attribute Range To", "btsdp.attribute_range.to", + FT_UINT16, BASE_HEX, NULL, 0, + NULL, HFILL } + }, { &hf_attribute_list_byte_count, { "Attribute List Byte Count", "btsdp.attribute_list_byte_count", FT_UINT16, BASE_DEC, NULL, 0, @@ -4015,14 +4397,64 @@ FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL} }, + { &hf_service_attribute, + { "Service Attribute", "btsdp.service_attribute", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_service_attribute_id, + { "Attribute", "btsdp.service_attribute.attribute", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_service_attribute_value, + { "Value", "btsdp.service_attribute.value", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_profile_descriptor_list, + { "Profile Descriptor List", "btsdp.profile_descriptor_list", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_attribute_list, + { "Attribute List", "btsdp.attribute_list", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_attribute_lists, + { "Attribute Lists", "btsdp.attribute_lists", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_service_search_pattern, + { "Service Search Pattern", "btsdp.service_search_pattern", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_service_record_handle_list, + { "Service Record Handle List", "btsdp.service_record_handle_list", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_continuation_state, + { "Continuation State", "btsdp.continuation_state", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, { &hf_continuation_state_length, - { "Continuation State Length", "btsdp.continuation_state_length", + { "Continuation State Length", "btsdp.continuation_state.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_continuation_state_value, - { "Continuation State Value", "btsdp.continuation_state_value", - FT_BYTES, BASE_NONE, NULL, 0, + { "Continuation State Value", "btsdp.continuation_state.value", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_data_element, + { "Data Element", "btsdp.data_element", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_data_element_type, @@ -4045,11 +4477,91 @@ FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_data_element_value_nil, + { "Value: Nil", "btsdp.data_element.value.nil", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_data_element_value_signed_int, + { "Value: Signed Int", "btsdp.data_element.value.signed_int", + FT_INT64, BASE_DEC, NULL, 0, + NULL, HFILL } + }, + { &hf_data_element_value_unsigned_int, + { "Value: Unsigned Int", "btsdp.data_element.value.unsigned_int", + FT_UINT64, BASE_DEC_HEX, NULL, 0, + NULL, HFILL } + }, + { &hf_data_element_value_boolean, + { "Value: Boolean", "btsdp.data_element.value.boolean", + FT_BOOLEAN, 8, NULL, 0, + NULL, HFILL } + }, + { &hf_data_element_value_string, + { "Value: String", "btsdp.data_element.value.string", + FT_STRING, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_data_element_value_url, + { "Value: URL", "btsdp.data_element.value.url", + FT_STRING, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_data_element_value_uuid_16, + { "Value: UUID", "btsdp.data_element.value.uuid_16", + FT_UINT16, BASE_HEX, VALS(vs_service_classes), 0, + NULL, HFILL } + }, + { &hf_data_element_value_uuid_32, + { "Value: UUID", "btsdp.data_element.value.uuid_32", + FT_UINT16, BASE_HEX, VALS(vs_service_classes), 0, + NULL, HFILL } + }, + { &hf_data_element_value_uuid_128, + { "Value: UUID", "btsdp.data_element.value.uuid_128", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_data_element_value_uuid, + { "Value: Custom UUID", "btsdp.data_element.value.custom_uuid", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_data_element_value_sequence, + { "Value: Sequence", "btsdp.data_element.value.sequence", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_data_element_value_alternative, + { "Value: Alternative", "btsdp.data_element.value.alternative", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, { &hf_fragment, { "Data Fragment", "btsdp.fragment", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_partial_attribute_list, + { "Partial Attribute List", "btsdp.partial_attribute_list", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_reassembled_attribute_list, + { "Reassembled Attribute List", "btsdp.reassembled_attribute_list", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_partial_record_handle_list, + { "Partial Record Handle List", "btsdp.partial_record_handle_list", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_reassembled_record_handle_list, + { "Reassembled Record Handle List", "btsdp.reassembled_attribute_list", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, { &hf_service_attribute_id_generic, { "Attribute ID", "btsdp.service.attribute", FT_UINT16, BASE_HEX, VALS(vs_general_attribute_id), 0, @@ -4496,12 +5008,12 @@ NULL, HFILL } }, { &hf_hdp_support_procedure_reserved_5_7, - { "Support: Reserved", "btsdp.hdp.support.reserved", + { "Support: Reserved", "btsdp.hdp.support.reserved", FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL } }, { &hf_hdp_support_procedure_sync_master_role, - { "Support: SyncMaster Role", "btsdp.hdp.support.sync_master_role", + { "Support: SyncMaster Role", "btsdp.hdp.support.sync_master_role", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, @@ -4511,25 +5023,50 @@ NULL, HFILL } }, { &hf_hdp_support_procedure_reconnect_acceptance, - { "Support: Reconnect Acceptance", "btsdp.hdp.support.reconnect_acceptance", + { "Support: Reconnect Acceptance", "btsdp.hdp.support.reconnect_acceptance", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_hdp_support_procedure_reconnect_initiation, - { "Support: Reconnect Initiation", "btsdp.hdp.support.reconnect_initiation", + { "Support: Reconnect Initiation", "btsdp.hdp.support.reconnect_initiation", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_hdp_support_procedure_reserved, - { "Support: Reserved", "btsdp.hdp.support.reserved", + { "Support: Reserved", "btsdp.hdp.support.reserved", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_hdp_data_exchange, - { "Data Exchange Specification", "btsdp.hdp.data_exchange_specification", + { "Data Exchange Specification", "btsdp.hdp.data_exchange_specification", FT_UINT8, BASE_HEX, VALS(hdp_data_exchange_specification_vals), 0, NULL, HFILL } }, + { &hf_hdp_supported_features_data, + { "Supported Features", "btsdp.hdp.supported_features_data", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_hdp_supported_features_data_mdep_id, + { "MDEP ID", "btsdp.hdp.supported_features_data.mdep_id", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_hdp_supported_features_data_mdep_data_type, + { "MDEP Data Type", "btsdp.hdp.supported_features_data.mdep_data_type", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_hdp_supported_features_data_mdep_role, + { "MDEP Role", "btsdp.hdp.supported_features_data.mdep_role", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_hdp_supported_features_data_mdep_description, + { "MDEP Description", "btsdp.hdp.supported_features_data.mdep_description", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, { &hf_hdp_supported_features_mdep_id, { "MDEP ID", "btsdp.hdp.supported_features.mdep_id", FT_UINT8, BASE_DEC_HEX|BASE_RANGE_STRING, RVALS(hdp_mdep_id_rvals), 0, @@ -4660,19 +5197,19 @@ FT_UINT8, BASE_HEX, VALS(hfp_gw_network_vals), 0, NULL, HFILL } }, - { &hf_sdp_service_uuid, - { "Service UUID", "btsdp.service_uuid", - FT_UINT16, BASE_HEX, VALS(vs_service_classes), 0, + { &hf_sdp_protocol_item, + { "Protocol", "btsdp.protocol_item", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, - { &hf_sdp_service_long_uuid, - { "Service UUID", "btsdp.service_long_uuid", - FT_BYTES, BASE_NONE, NULL, 0, + { &hf_sdp_protocol, + { "Protocol Entry", "btsdp.protocol", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_sdp_protocol_psm, { "L2CAP PSM", "btsdp.protocol.psm", - FT_UINT16, BASE_DEC_HEX, &ext_psm_vals, 0, + FT_UINT16, BASE_DEC_HEX | BASE_EXT_STRING, &ext_psm_vals, 0, NULL, HFILL } }, { &hf_sdp_protocol_channel, @@ -4751,6 +5288,11 @@ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_sdp_lang, + { "Language", "btsdp.lang", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, { &hf_sdp_lang_code, { "Language Code", "btsdp.lang.code", FT_STRING, BASE_NONE, NULL, 0, @@ -4861,6 +5403,16 @@ FT_UINT8, BASE_HEX, VALS(descriptor_list_type_vals), 0, NULL, HFILL } }, + { &hf_hid_lang, + { "Language", "btsdp.service.hid.lang", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_hid_descriptor_list_descriptor_data, + { "Descriptor", "btsdp.service.hid.descriptor_list.descriptor_data", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, { &hf_hid_descriptor_list_descriptor, { "Descriptor", "btsdp.service.hid.descriptor_list.descriptor", FT_BYTES, BASE_NONE, NULL, 0, @@ -5185,9 +5737,9 @@ }; static ei_register_info ei[] = { - { &ei_btsdp_continuation_state_none, { "btsdp.continuation_state_none", PI_MALFORMED, PI_WARN, "There is no Continuation State", EXPFILL }}, - { &ei_btsdp_continuation_state_large, { "btsdp.continuation_state_large", PI_MALFORMED, PI_WARN, "Continuation State data is longer then 16", EXPFILL }}, - { &ei_data_element_value_large, { "btavctp.data_element.value.large", PI_MALFORMED, PI_WARN, "Data size exceeds the length of payload", EXPFILL }}, + { &ei_btsdp_continuation_state_none, { "btsdp.expert.continuation_state_none", PI_MALFORMED, PI_WARN, "There is no Continuation State", EXPFILL }}, + { &ei_btsdp_continuation_state_large, { "btsdp.expert.continuation_state_large", PI_MALFORMED, PI_WARN, "Continuation State data is longer then 16", EXPFILL }}, + { &ei_data_element_value_large, { "btsdp.expert.data_element.value.large", PI_MALFORMED, PI_WARN, "Data size exceeds the length of payload", EXPFILL }}, }; proto_btsdp = proto_register_protocol("Bluetooth SDP Protocol", "BT SDP", "btsdp"); @@ -5200,6 +5752,7 @@ tid_requests = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); continuation_states = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); + record_handle_services = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); service_infos = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); sdp_package.service_infos = service_infos; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btsdp.h wireshark-1.12.0~201311020920/epan/dissectors/packet-btsdp.h --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btsdp.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btsdp.h 2013-11-02 02:12:36.000000000 +0000 @@ -159,6 +159,12 @@ #define BTSDP_LOCAL_SERVICE_FLAG_MASK 0x0001 #define BTSDP_SECONDARY_CHANNEL_FLAG_MASK 0x0002 +typedef struct _uuid_t { + guint16 bt_uuid; + guint8 size; + guint8 data[16]; +} uuid_t; + /* This structure is passed to other dissectors through the tap interface * and contains information about the relation between service, PSM/server * channel, local/remote service. The btrfcomm and btl2cap dissectors @@ -188,7 +194,7 @@ guint32 type; guint32 channel; - guint32 uuid; + uuid_t uuid; gint protocol_order; /* main service protocol has 0, goep -1, additional protocol 1, 2... */ void *data; /* Used to transfer service record data to profiles */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-btsmp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-btsmp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-btsmp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-btsmp.c 2013-11-02 02:12:36.000000000 +0000 @@ -52,6 +52,9 @@ static int hf_btsmp_key_dist_id = -1; static int hf_btsmp_key_dist_sign = -1; static int hf_btsmp_ediv = -1; +static int hf_btsmp_authreq = -1; +static int hf_btsmp_initiator_key_distribution = -1; +static int hf_btsmp_responder_key_distribution = -1; /* Initialize the subtree pointers */ static gint ett_btsmp = -1; @@ -124,7 +127,7 @@ guint8 param; param = tvb_get_guint8(tvb, offset); - ti_param = proto_tree_add_text(tree, tvb, offset, 1, "AuthReq: "); + ti_param = proto_tree_add_item(tree, hf_btsmp_authreq, tvb, offset, 1, ENC_NA); st_param = proto_item_add_subtree(ti_param, ett_btsmp_auth_req); proto_tree_add_item(st_param, hf_btsmp_bonding_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(ti_param, "%s, ", val_to_str_const(param & 0x03, bonding_flag_vals, "")); @@ -145,12 +148,12 @@ param = tvb_get_guint8(tvb, offset); if (initiator) { - col_append_fstr(pinfo->cinfo, COL_INFO, ", Initiator Key(s): "); - ti_param = proto_tree_add_text(tree, tvb, offset, 1, "Initiator Key Distribution: "); + col_append_str(pinfo->cinfo, COL_INFO, ", Initiator Key(s): "); + ti_param = proto_tree_add_item(tree, hf_btsmp_initiator_key_distribution, tvb, offset, 1, ENC_NA); } else { - col_append_fstr(pinfo->cinfo, COL_INFO, ", Responder Key(s): "); - ti_param = proto_tree_add_text(tree, tvb, offset, 1, "Responder Key Distribution: "); + col_append_str(pinfo->cinfo, COL_INFO, ", Responder Key(s): "); + ti_param = proto_tree_add_item(tree, hf_btsmp_responder_key_distribution, tvb, offset, 1, ENC_NA); } st_param = proto_item_add_subtree(ti_param, ett_btsmp_key_dist); @@ -159,15 +162,15 @@ proto_tree_add_item(st_param, hf_btsmp_key_dist_sign, tvb, offset, 1, ENC_LITTLE_ENDIAN); if (param & 0x01) { proto_item_append_text(ti_param, "LTK "); - col_append_fstr(pinfo->cinfo, COL_INFO, "LTK "); + col_append_str(pinfo->cinfo, COL_INFO, "LTK "); } if (param & 0x02) { proto_item_append_text(ti_param, "IRK "); - col_append_fstr(pinfo->cinfo, COL_INFO, "IRK "); + col_append_str(pinfo->cinfo, COL_INFO, "IRK "); } if (param & 0x04) { proto_item_append_text(ti_param, "CSRK "); - col_append_fstr(pinfo->cinfo, COL_INFO, "CSRK "); + col_append_str(pinfo->cinfo, COL_INFO, "CSRK "); } return offset + 1; @@ -185,10 +188,10 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent "); + col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd "); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ", @@ -206,13 +209,13 @@ opcode = tvb_get_guint8(tvb, 0); offset++; - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(opcode, opcode_vals, "")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(opcode, opcode_vals, "")); switch (opcode) { case 0x01: /* Pairing Request */ case 0x02: /* Pairing Response */ { - col_append_fstr(pinfo->cinfo, COL_INFO, ": "); + col_append_str(pinfo->cinfo, COL_INFO, ": "); proto_tree_add_item(st, hf_btsmp_io_capabilities, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; @@ -268,7 +271,7 @@ break; case 0x0b: /* Security Request */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": "); + col_append_str(pinfo->cinfo, COL_INFO, ": "); offset = dissect_btsmp_auth_req(tvb, offset, pinfo, st); break; @@ -362,6 +365,21 @@ {"Encrypted Diversifier (EDIV)", "btsmp.ediv", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL} + }, + {&hf_btsmp_authreq, + {"AuthReq", "btsmp.authreq", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, + {&hf_btsmp_initiator_key_distribution, + {"Initiator Key Distribution", "btsmp.initiator_key_distribution", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} + }, + {&hf_btsmp_responder_key_distribution, + {"Responder Key Distribution", "btsmp.responder_key_distribution", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL} } }; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-c1222.c wireshark-1.12.0~201311020920/epan/dissectors/packet-c1222.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-c1222.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-c1222.c 2013-11-02 02:12:36.000000000 +0000 @@ -724,7 +724,7 @@ { FALSE, FALSE, 0x0, TRUE, NULL, NULL } }; -static void +static void clear_canon(void) { const TOP_ELEMENT_CONTROL *t = canonifyTable; @@ -787,10 +787,10 @@ c1222_uat_data_t* new_rec = (c1222_uat_data_t *)n; if (new_rec->keynum > 0xff) { - *err = "Invalid key number; must be less than 256"; + *err = g_strdup("Invalid key number; must be less than 256"); } if (new_rec->keylen != EAX_SIZEOF_KEY) { - *err = "Invalid key size; must be 16 bytes"; + *err = g_strdup("Invalid key size; must be 16 bytes"); } } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-camel.c wireshark-1.12.0~201311020920/epan/dissectors/packet-camel.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-camel.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-camel.c 2013-11-02 02:12:36.000000000 +0000 @@ -2244,7 +2244,7 @@ dissect_camel_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { /*XXX handle local form here */ if(camel_obj_id){ - offset=call_ber_oid_callback(camel_obj_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(camel_obj_id, tvb, offset, actx->pinfo, tree, NULL); } is_ExtensionField = FALSE; @@ -7221,16 +7221,14 @@ static int -dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_,proto_tree *tree, int hf_index) { +dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_,proto_tree *tree, + int hf_index, struct tcap_private_t * p_private_tcap) { char *version_ptr; - struct tcap_private_t * p_private_tcap; opcode = 0; application_context_version = 0; - if (actx->pinfo->private_data != NULL){ - p_private_tcap=(struct tcap_private_t *)actx->pinfo->private_data; - + if (p_private_tcap != NULL){ if (p_private_tcap->acv==TRUE ){ version_ptr = strrchr((char *)p_private_tcap->oid,'.'); if (version_ptr) @@ -7255,13 +7253,12 @@ return offset; } -static void -dissect_camel_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +static int +dissect_camel_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { - proto_item *item=NULL; - proto_tree *tree=NULL; - proto_item *stat_item=NULL; - proto_tree *stat_tree=NULL; + proto_item *item, *stat_item; + proto_tree *tree = NULL, *stat_tree = NULL; + struct tcap_private_t * p_private_tcap = (struct tcap_private_t*)data; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -7278,7 +7275,7 @@ to store service response time related data */ gp_camelsrt_info=camelsrt_razinfo(); - dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1); + dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1, p_private_tcap); /* If a Tcap context is associated to this transaction */ if (gcamel_HandleSRT && @@ -7291,15 +7288,15 @@ tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info); } + return tvb_length(tvb); } -static void -dissect_camel_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +static int +dissect_camel_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { - proto_item *item=NULL; - proto_tree *tree=NULL; - proto_item *stat_item=NULL; - proto_tree *stat_tree=NULL; + proto_item *item, *stat_item; + proto_tree *tree = NULL, *stat_tree = NULL; + struct tcap_private_t * p_private_tcap = (struct tcap_private_t*)data; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -7316,7 +7313,7 @@ to store service response time related data */ gp_camelsrt_info=camelsrt_razinfo(); - dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1); + dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1, p_private_tcap); /* If a Tcap context is associated to this transaction */ if (gcamel_HandleSRT && @@ -7329,15 +7326,15 @@ tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info); } + return tvb_length(tvb); } -static void -dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +static int +dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { - proto_item *item=NULL; - proto_tree *tree=NULL; - proto_item *stat_item=NULL; - proto_tree *stat_tree=NULL; + proto_item *item, *stat_item; + proto_tree *tree, *stat_tree = NULL; + struct tcap_private_t * p_private_tcap = (struct tcap_private_t*)data; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -7347,14 +7344,13 @@ camel_ver = 0; /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_item(parent_tree, proto_camel, tvb, 0, -1, ENC_NA); - tree = proto_item_add_subtree(item, ett_camel); - } + item = proto_tree_add_item(parent_tree, proto_camel, tvb, 0, -1, ENC_NA); + tree = proto_item_add_subtree(item, ett_camel); + /* camelsrt reset counter, and initialise global pointer to store service response time related data */ gp_camelsrt_info=camelsrt_razinfo(); - dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1); + dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1, p_private_tcap); /* If a Tcap context is associated to this transaction */ if (gcamel_HandleSRT && @@ -7366,6 +7362,8 @@ camelsrt_call_matching(tvb, pinfo, stat_tree, gp_camelsrt_info); tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info); } + + return tvb_length(tvb); } /*--- proto_reg_handoff_camel ---------------------------------------*/ @@ -7414,7 +7412,7 @@ /*--- End of included file: packet-camel-dis-tab.c ---*/ -#line 520 "../../asn1/camel/packet-camel-template.c" +#line 518 "../../asn1/camel/packet-camel-template.c" } else { range_foreach(ssn_range, range_delete_callback); g_free(ssn_range); @@ -9528,7 +9526,7 @@ "InvokeId_present", HFILL }}, /*--- End of included file: packet-camel-hfarr.c ---*/ -#line 693 "../../asn1/camel/packet-camel-template.c" +#line 691 "../../asn1/camel/packet-camel-template.c" }; /* List of subtrees */ @@ -9743,7 +9741,7 @@ &ett_camel_InvokeId, /*--- End of included file: packet-camel-ettarr.c ---*/ -#line 709 "../../asn1/camel/packet-camel-template.c" +#line 707 "../../asn1/camel/packet-camel-template.c" }; static ei_register_info ei[] = { @@ -9757,9 +9755,9 @@ /* Register protocol */ proto_camel = proto_register_protocol(PNAME, PSNAME, PFNAME); - register_dissector("camel", dissect_camel, proto_camel); - register_dissector("camel-v1", dissect_camel_v1, proto_camel); - register_dissector("camel-v2", dissect_camel_v2, proto_camel); + new_register_dissector("camel", dissect_camel, proto_camel); + new_register_dissector("camel-v1", dissect_camel_v1, proto_camel); + new_register_dissector("camel-v2", dissect_camel_v2, proto_camel); proto_register_field_array(proto_camel, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-capwap.c wireshark-1.12.0~201311020920/epan/dissectors/packet-capwap.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-capwap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-capwap.c 2013-11-02 02:12:36.000000000 +0000 @@ -1563,7 +1563,7 @@ } else if (payload_type == 0xff) { /* CAPWAP Keep-Alive Payload */ - /*offset +=*/ dissect_capwap_data_keep_alive(next_tvb, pinfo, capwap_data_tree, 0); + dissect_capwap_data_keep_alive(next_tvb, pinfo, capwap_data_tree, 0); } else { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-cmip.c wireshark-1.12.0~201311020920/epan/dissectors/packet-cmip.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-cmip.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-cmip.c 2013-11-02 02:12:36.000000000 +0000 @@ -792,7 +792,7 @@ static int dissect_cmip_T_attributeValueAssertionvalue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 286 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(attributevalueassertion_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(attributevalueassertion_id, tvb, offset, actx->pinfo, tree, NULL); @@ -956,7 +956,7 @@ dissect_cmip_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 274 "../../asn1/cmip/cmip.cnf" if(attributeform==ATTRIBUTE_GLOBAL_FORM){ - offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree, NULL); } else if (dissector_try_uint(attribute_id_dissector_table, attribute_local_id, tvb, actx->pinfo, tree)) { offset=tvb_length (tvb); } else { @@ -1129,7 +1129,7 @@ static int dissect_cmip_T_actionInfoArg(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 441 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -1286,7 +1286,7 @@ static int dissect_cmip_T_eventInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 471 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -1391,7 +1391,7 @@ static int dissect_cmip_T_actionReplyInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 474 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -1473,7 +1473,7 @@ static int dissect_cmip_T_attributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 468 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -1701,7 +1701,7 @@ static int dissect_cmip_T_eventReplyInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 450 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -1728,7 +1728,7 @@ static int dissect_cmip_EventReportArgumentEventInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 447 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -1995,7 +1995,7 @@ static int dissect_cmip_T_errorInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 465 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -2105,7 +2105,7 @@ dissect_cmip_T_attributevalue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 453 "../../asn1/cmip/cmip.cnf" if(attributeform==ATTRIBUTE_GLOBAL_FORM){ - offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree, NULL); } else if (dissector_try_uint(attribute_id_dissector_table, attribute_local_id, tvb, actx->pinfo, tree)) { offset=tvb_length (tvb); } else { @@ -2348,7 +2348,7 @@ static int dissect_cmip_T_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 481 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -2445,7 +2445,7 @@ static int dissect_cmip_T_oldAttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 484 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -2457,7 +2457,7 @@ static int dissect_cmip_T_newAttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 487 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -3233,7 +3233,7 @@ static int dissect_cmip_T_details(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 492 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -3356,7 +3356,7 @@ static int dissect_cmip_T_featureInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 497 "../../asn1/cmip/cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-cmp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-cmp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-cmp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-cmp.c 2013-11-02 02:12:36.000000000 +0000 @@ -395,7 +395,7 @@ static int dissect_cmp_T_infoValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 90 "../../asn1/cmp/cmp.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-cms.c wireshark-1.12.0~201311020920/epan/dissectors/packet-cms.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-cms.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-cms.c 2013-11-02 02:12:36.000000000 +0000 @@ -356,7 +356,7 @@ static int dissect_cms_T_content(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 100 "../../asn1/cms/cms.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -437,7 +437,7 @@ offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &content_tvb); proto_item_set_text(actx->created_item, "eContent (%u bytes)", tvb_length (content_tvb)); - call_ber_oid_callback(object_identifier_id, content_tvb, 0, actx->pinfo, top_tree ? top_tree : tree); + call_ber_oid_callback(object_identifier_id, content_tvb, 0, actx->pinfo, top_tree ? top_tree : tree, NULL); @@ -485,7 +485,7 @@ dissect_cms_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 141 "../../asn1/cms/cms.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -746,7 +746,7 @@ static int dissect_cms_T_otherRevInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 125 "../../asn1/cms/cms.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -1083,7 +1083,7 @@ static int dissect_cms_T_keyAttr(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 120 "../../asn1/cms/cms.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); return offset; @@ -1271,7 +1271,7 @@ static int dissect_cms_T_oriValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 114 "../../asn1/cms/cms.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -1663,7 +1663,7 @@ dissect_cms_T_parameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 174 "../../asn1/cms/cms.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-coap.c wireshark-1.12.0~201311020920/epan/dissectors/packet-coap.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-coap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-coap.c 2013-11-02 02:12:36.000000000 +0000 @@ -786,7 +786,7 @@ /* initialize the CoAP length and the content-Format */ /* * the length of CoAP message is not specified in the CoAP header. - * It has to be from the lower layer. the iplen of packet_info is not accurate. + * It has to be from the lower layer. * Currently, the length is just copied from the reported length of the tvbuffer. */ coap_length = tvb_reported_length(tvb); @@ -838,7 +838,6 @@ /* add informations to the packet list */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "CoAP"); - col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(ttype, vals_ttype_short, "Unknown %d")); col_append_fstr(pinfo->cinfo, COL_INFO, ", MID:%u", mid); col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(code, vals_code, "Unknown %d")); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-componentstatus.c wireshark-1.12.0~201311020920/epan/dissectors/packet-componentstatus.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-componentstatus.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-componentstatus.c 2013-11-02 02:12:36.000000000 +0000 @@ -194,7 +194,7 @@ guint8 type; type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET); - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, message_type_values, "Unknown ComponentStatusProtocol type")); + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, message_type_values, "Unknown ComponentStatusProtocol type")); proto_tree_add_item(componentstatusprotocol_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN); flags_item = proto_tree_add_item(componentstatusprotocol_tree, hf_message_flags, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, ENC_BIG_ENDIAN); flags_tree = proto_item_add_subtree(flags_item, ett_message_flags); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-cops.c wireshark-1.12.0~201311020920/epan/dissectors/packet-cops.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-cops.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-cops.c 2013-11-02 02:12:36.000000000 +0000 @@ -3024,7 +3024,6 @@ g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"), val_to_str_const(code16,table_cops_dqos_transaction_id, "Unknown")); - col_clear(pinfo->cinfo, COL_INFO); col_add_str(pinfo->cinfo, COL_INFO,info); } @@ -3417,7 +3416,6 @@ g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"), val_to_str_const(code16,table_cops_mm_transaction_id, "Unknown")); - col_clear(pinfo->cinfo, COL_INFO); col_add_str(pinfo->cinfo, COL_INFO,info); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-crmf.c wireshark-1.12.0~201311020920/epan/dissectors/packet-crmf.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-crmf.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-crmf.c 2013-11-02 02:12:36.000000000 +0000 @@ -236,7 +236,7 @@ static int dissect_crmf_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 74 "../../asn1/crmf/crmf.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-dbus.c wireshark-1.12.0~201311020920/epan/dissectors/packet-dbus.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-dbus.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-dbus.c 2013-11-02 02:12:36.000000000 +0000 @@ -481,7 +481,7 @@ offset += 1; type = tvb_get_guint8(tvb, offset); - col_add_str(dinfo->pinfo->cinfo, COL_INFO, val_to_str_const(type, message_type_vals, "")); + col_set_str(dinfo->pinfo->cinfo, COL_INFO, val_to_str_const(type, message_type_vals, "")); proto_tree_add_item(hdr_tree, &hfi_dbus_hdr_type, tvb, offset, 1, dinfo->enc); offset += 1; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-dccp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-dccp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-dccp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-dccp.c 2013-11-02 02:12:36.000000000 +0000 @@ -211,7 +211,7 @@ * for the conversation if available */ if (try_conversation_dissector(&pinfo->src, &pinfo->dst, PT_DCCP, sport, - dport, next_tvb, pinfo, tree)) { + dport, next_tvb, pinfo, tree, NULL)) { return; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-dcerpc.c wireshark-1.12.0~201311020920/epan/dissectors/packet-dcerpc.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-dcerpc.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-dcerpc.c 2013-11-02 02:12:36.000000000 +0000 @@ -1522,7 +1522,6 @@ /* real run, dissect the elements */ if (fnct_block) { - old_offset = offset; offset = (*fnct_block)(tvb, offset, di->array_actual_count, pinfo, tree, drep); } else { for(i=0 ;iarray_actual_count; i++) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-dcm.c wireshark-1.12.0~201311020920/epan/dissectors/packet-dcm.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-dcm.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-dcm.c 2013-11-02 02:12:36.000000000 +0000 @@ -4874,7 +4874,6 @@ proto_item_set_text(assoc_header_pitem, "%s", buf_desc); col_append_str(pinfo->cinfo, COL_INFO, buf_desc); - col_clear(pinfo->cinfo, COL_INFO); col_set_str(pinfo->cinfo, COL_INFO, wmem_strdup(wmem_file_scope(), buf_desc)); /* requires SE not EP memory */ /* proto_item and proto_tree are one and the same */ @@ -7045,7 +7044,7 @@ } if (pdu_type == 4) { - col_add_str(pinfo->cinfo, COL_INFO, "P-DATA"); + col_set_str(pinfo->cinfo, COL_INFO, "P-DATA"); offset = dissect_dcm_pdu_data(tvb, pinfo, dcm_ptree, assoc, offset, pdu_len, &pdu_data_description); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-dect.c wireshark-1.12.0~201311020920/epan/dissectors/packet-dect.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-dect.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-dect.c 2013-11-02 02:12:36.000000000 +0000 @@ -1951,8 +1951,7 @@ proto_item *columnstreeti; proto_tree *ColumnsTree; - col_clear(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_INFO, "Use Custom Columns for Infos"); + col_set_str(pinfo->cinfo, COL_INFO, "Use Custom Columns for Infos"); col_set_str(pinfo->cinfo, COL_PROTOCOL, "DECT"); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-dhcp-failover.c wireshark-1.12.0~201311020920/epan/dissectors/packet-dhcp-failover.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-dhcp-failover.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-dhcp-failover.c 2013-11-02 02:12:36.000000000 +0000 @@ -414,7 +414,7 @@ proto_tree_add_uint(dhcpfo_tree, hf_dhcpfo_type, tvb, offset, 1, type); } - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, failover_vals, "Unknown Packet")); offset += 1; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-diameter.c wireshark-1.12.0~201311020920/epan/dissectors/packet-diameter.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-diameter.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-diameter.c 2013-11-02 02:12:36.000000000 +0000 @@ -115,7 +115,7 @@ typedef struct _diam_avp_t diam_avp_t; typedef struct _avp_type_t avp_type_t; -typedef const char *(*diam_avp_dissector_t)(diam_ctx_t *, diam_avp_t *, tvbuff_t *); +typedef const char *(*diam_avp_dissector_t)(diam_ctx_t *, diam_avp_t *, tvbuff_t *, diam_sub_dis_t *); typedef struct _diam_vnd_t { @@ -186,7 +186,7 @@ avp_reassemble_mode_t reassemble_mode; } proto_avp_t; -static const char *simple_avp(diam_ctx_t *, diam_avp_t *, tvbuff_t *); +static const char *simple_avp(diam_ctx_t *, diam_avp_t *, tvbuff_t *, diam_sub_dis_t *); static diam_vnd_t unknown_vendor = { 0xffffffff, NULL, NULL, NULL }; static diam_vnd_t no_vnd = { 0, NULL, NULL, NULL }; @@ -411,7 +411,7 @@ * variables as volatile and deal with casting them). */ static void -call_avp_subdissector(guint32 vendorid, guint32 code, tvbuff_t *subtvb, packet_info *pinfo, proto_tree *avp_tree) +call_avp_subdissector(guint32 vendorid, guint32 code, tvbuff_t *subtvb, packet_info *pinfo, proto_tree *avp_tree, diam_sub_dis_t *diam_sub_dis_inf) { TRY { switch (vendorid) { @@ -422,7 +422,7 @@ dissector_try_uint(diameter_ericsson_avp_dissector_table, code, subtvb, pinfo, avp_tree); break; case VENDOR_THE3GPP: - dissector_try_uint(diameter_3gpp_avp_dissector_table, code, subtvb, pinfo, avp_tree); + dissector_try_uint_new(diameter_3gpp_avp_dissector_table, code, subtvb, pinfo, avp_tree, FALSE, diam_sub_dis_inf); break; default: break; @@ -440,7 +440,7 @@ /* Dissect an AVP at offset */ static int -dissect_diameter_avp(diam_ctx_t *c, tvbuff_t *tvb, int offset) +dissect_diameter_avp(diam_ctx_t *c, tvbuff_t *tvb, int offset, diam_sub_dis_t *diam_sub_dis_inf) { guint32 code = tvb_get_ntohl(tvb,offset); guint32 len = tvb_get_ntohl(tvb,offset+4); @@ -562,15 +562,15 @@ save_tree = c->tree; c->tree = avp_tree; if (c->version_rfc) { - avp_str = a->dissector_rfc(c,a,subtvb); + avp_str = a->dissector_rfc(c,a,subtvb, diam_sub_dis_inf); } else { - avp_str = a->dissector_v16(c,a,subtvb); + avp_str = a->dissector_v16(c,a,subtvb, diam_sub_dis_inf); } c->tree = save_tree; if (avp_str) proto_item_append_text(avp_item," val=%s", avp_str); - call_avp_subdissector(vendorid, code, subtvb, c->pinfo, avp_tree); + call_avp_subdissector(vendorid, code, subtvb, c->pinfo, avp_tree, diam_sub_dis_inf); if (pad_len) { guint8 i; @@ -588,7 +588,7 @@ } static const char * -address_rfc_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +address_rfc_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { char *label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1); address_avp_t *t = (address_avp_t *)a->type_data; @@ -624,7 +624,7 @@ } static const char * -proto_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +proto_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf) { proto_avp_t *t = (proto_avp_t *)a->type_data; @@ -636,7 +636,7 @@ } TRY { - call_dissector(t->handle, tvb, c->pinfo, c->tree); + call_dissector_with_data(t->handle, tvb, c->pinfo, c->tree, diam_sub_dis_inf); } CATCH_NONFATAL_ERRORS { show_exception(tvb, c->pinfo, c->tree, EXCEPT_CODE, GET_MESSAGE); @@ -647,7 +647,7 @@ } static const char * -time_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +time_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { int len = tvb_length(tvb); char *label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1); @@ -666,7 +666,7 @@ } static const char * -address_v16_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +address_v16_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { char *label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1); address_avp_t *t = (address_avp_t *)a->type_data; @@ -695,7 +695,7 @@ } static const char * -simple_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +simple_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { char *label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1); proto_item *pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length(tvb),ENC_BIG_ENDIAN); @@ -705,7 +705,7 @@ } static const char * -utf8_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +utf8_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { char *label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1); proto_item *pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length(tvb),ENC_UTF_8|ENC_BIG_ENDIAN); @@ -715,7 +715,7 @@ } static const char * -integer32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +integer32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { char *label; proto_item *pi; @@ -741,7 +741,7 @@ } static const char * -integer64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +integer64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { char *label; proto_item *pi; @@ -767,7 +767,7 @@ } static const char * -unsigned32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +unsigned32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { char *label; proto_item *pi; @@ -793,7 +793,7 @@ } static const char * -unsigned64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +unsigned64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { char *label; proto_item *pi; @@ -819,7 +819,7 @@ } static const char * -float32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +float32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { char *label; proto_item *pi; @@ -845,7 +845,7 @@ } static const char * -float64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +float64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_) { char *label; proto_item *pi; @@ -871,7 +871,7 @@ } static const char * -grouped_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb) +grouped_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf) { int offset = 0; int len = tvb_length(tvb); @@ -881,7 +881,7 @@ c->tree = proto_item_add_subtree(pi,a->ett); while (offset < len) { - offset += dissect_diameter_avp(c, tvb, offset); + offset += dissect_diameter_avp(c, tvb, offset, diam_sub_dis_inf); } c->tree = pt; @@ -917,13 +917,11 @@ wmem_tree_t *pdus_tree; proto_item *it; nstime_t ns; - void *pd_save; diam_sub_dis_t *diam_sub_dis_inf = wmem_new0(wmem_packet_scope(), diam_sub_dis_t); diam_sub_dis_inf->application_id = tvb_get_ntohl(tvb,8); - pd_save = pinfo->private_data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "DIAMETER"); pi = proto_tree_add_item(tree,proto_diameter,tvb,0,-1,ENC_NA); @@ -974,8 +972,6 @@ cmd_vs = (value_string *)(void *)all_cmds->data; app_item = proto_tree_add_item(diam_tree, hf_diameter_application_id, tvb, 8, 4, ENC_BIG_ENDIAN); - /* Store the application id to be used by subdissectors */ - pinfo->private_data = diam_sub_dis_inf; if (try_val_to_str(diam_sub_dis_inf->application_id, dictionary.applications) == NULL) { proto_tree *tu = proto_item_add_subtree(app_item,ett_unknown); @@ -1121,28 +1117,26 @@ /* TODO: Populate result_code in tap record from AVP 268 */ } } - + offset = 20; - + /* Dissect AVPs until the end of the packet is reached */ while (offset < packet_len) { - offset += dissect_diameter_avp(c, tvb, offset); + offset += dissect_diameter_avp(c, tvb, offset, diam_sub_dis_inf); } - - /* Handle requests for which no answers were found and - * anawers for which no requests were found in the tap listener. - * In case if you don't need unpaired requests/answers use: - * if(diameter_pair->processing_request || !diameter_pair->req_frame) - * return; - */ - tap_queue_packet(diameter_tap, pinfo, diameter_pair); } + + /* Handle requests for which no answers were found and + * anawers for which no requests were found in the tap listener. + * In case if you don't need unpaired requests/answers use: + * if(diameter_pair->processing_request || !diameter_pair->req_frame) + * return; + */ + tap_queue_packet(diameter_tap, pinfo, diameter_pair); if(have_tap_listener(exported_pdu_tap)){ export_diameter_pdu(pinfo,tvb); } - - pinfo->private_data = pd_save; } static guint diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-diameter_3gpp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-diameter_3gpp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-diameter_3gpp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-diameter_3gpp.c 2013-11-02 02:12:36.000000000 +0000 @@ -274,12 +274,11 @@ */ static int -dissect_diameter_3gpp_feature_list_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) +dissect_diameter_3gpp_feature_list_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void *data) { - diam_sub_dis_t *diam_sub_dis_inf; + diam_sub_dis_t *diam_sub_dis_inf = (diam_sub_dis_t*)data; - if(pinfo->private_data){ - diam_sub_dis_inf = (diam_sub_dis_t*)pinfo->private_data; + if(diam_sub_dis_inf){ diam_sub_dis_inf->feature_list_id = tvb_get_ntohl(tvb,0); } @@ -320,19 +319,18 @@ */ static int -dissect_diameter_3gpp_feature_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { +dissect_diameter_3gpp_feature_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data) { proto_item* item; proto_tree *sub_tree; int offset = 0; guint32 bit_offset, application_id = 0, feature_list_id = 0; - diam_sub_dis_t *diam_sub_dis_inf; + diam_sub_dis_t *diam_sub_dis_inf = (diam_sub_dis_t*)data; item = proto_tree_add_item(tree, hf_diameter_3gpp_feature_list_flags, tvb, offset, 4, ENC_BIG_ENDIAN); sub_tree = proto_item_add_subtree(item, diameter_3gpp_feature_list_ett); - if(pinfo->private_data){ - diam_sub_dis_inf = (diam_sub_dis_t*)pinfo->private_data; + if(diam_sub_dis_inf){ application_id = diam_sub_dis_inf->application_id; feature_list_id = diam_sub_dis_inf->feature_list_id; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-dvb-ait.c wireshark-1.12.0~201311020920/epan/dissectors/packet-dvb-ait.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-dvb-ait.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-dvb-ait.c 2013-11-02 02:12:36.000000000 +0000 @@ -365,7 +365,6 @@ guint32 org_id; guint16 app_id; - col_clear(pinfo->cinfo, COL_INFO); col_set_str(pinfo->cinfo, COL_INFO, "Application Information Table (AIT)"); if (tree) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-dvb-bat.c wireshark-1.12.0~201311020920/epan/dissectors/packet-dvb-bat.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-dvb-bat.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-dvb-bat.c 2013-11-02 02:12:36.000000000 +0000 @@ -179,7 +179,7 @@ static hf_register_info hf[] = { { &hf_dvb_bat_bouquet_id, { - "Service ID", "dvb_bat.sid", + "Bouquet ID", "dvb_bat.bouquet_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-dvbci.c wireshark-1.12.0~201311020920/epan/dissectors/packet-dvbci.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-dvbci.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-dvbci.c 2013-11-02 02:12:36.000000000 +0000 @@ -2715,7 +2715,7 @@ if (pmt_flag) { pmt_tvb = tvb_new_subset_remaining(tvb, offset); if (mpeg_pmt_handle) { - col_append_fstr(pinfo->cinfo, COL_INFO, ", "); + col_append_str(pinfo->cinfo, COL_INFO, ", "); /* prevent mpeg_pmt dissector from clearing col_info */ col_set_fence(pinfo->cinfo, COL_INFO); call_dissector(mpeg_pmt_handle, pmt_tvb, pinfo, tree); @@ -3604,9 +3604,9 @@ break; if (dvbci_dissect_lsc_msg && circuit && circuit->dissector_handle) { msg_handle = circuit->dissector_handle; - col_append_fstr(pinfo->cinfo, COL_INFO, ", "); + col_append_str(pinfo->cinfo, COL_INFO, ", "); col_set_fence(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_PROTOCOL, ", "); + col_append_str(pinfo->cinfo, COL_PROTOCOL, ", "); col_set_fence(pinfo->cinfo, COL_PROTOCOL); } else { @@ -3656,7 +3656,7 @@ break; } /* prevent dvb_nit dissector from clearing the dvb-ci infos */ - col_append_fstr(pinfo->cinfo, COL_INFO, ", "); + col_append_str(pinfo->cinfo, COL_INFO, ", "); col_set_fence(pinfo->cinfo, COL_INFO); do { table_id = tvb_get_guint8(nit_loop_tvb, nit_loop_offset); @@ -3982,7 +3982,7 @@ tag = tvb_get_guint8(tvb,0); tag_str = try_val_to_str(tag, dvbci_spdu_tag); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(tag, dvbci_spdu_tag, "Invalid SPDU")); pi = proto_tree_add_item(sess_tree, hf_dvbci_spdu_tag, tvb, 0, 1, ENC_BIG_ENDIAN); if (tag_str == NULL) { @@ -4309,7 +4309,7 @@ if (!payload_tvb) { if (hdr_tag == T_DATA_MORE) { pinfo->fragmented = TRUE; - col_append_fstr(pinfo->cinfo, COL_INFO, " (Message fragment)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Message fragment)"); } else { payload_tvb = body_tvb; } @@ -4350,7 +4350,7 @@ payload_len = tvb_reported_length(tvb); - col_add_str(pinfo->cinfo, COL_INFO, "LPDU"); + col_set_str(pinfo->cinfo, COL_INFO, "LPDU"); ti = proto_tree_add_text(tree, tvb, 0, 2, "Link Layer"); link_tree = proto_item_add_subtree(ti, ett_dvbci_link); @@ -4382,7 +4382,7 @@ if (!payload_tvb) { if (more_last == ML_MORE) { pinfo->fragmented = TRUE; - col_append_fstr(pinfo->cinfo, COL_INFO, " (Message fragment)"); + col_append_str(pinfo->cinfo, COL_INFO, " (Message fragment)"); } else payload_tvb = tvb_new_subset_remaining(tvb, 2); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ehs.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ehs.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ehs.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ehs.c 2013-11-02 02:12:36.000000000 +0000 @@ -861,13 +861,13 @@ /* AOS/LOS data zone dissector */ static void -aoslos_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo ) +aoslos_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo _U_) { proto_item *ehs_data_zone; proto_tree *ehs_data_zone_tree; /* create the data zone tree */ - ehs_data_zone = proto_tree_add_text ( ehs_tree, tvb, *offset, pinfo->iplen - IP_HEADER_LENGTH - *offset, "AOS/LOS Data Zone" ); + ehs_data_zone = proto_tree_add_text ( ehs_tree, tvb, *offset, tvb_reported_length(tvb) - *offset, "AOS/LOS Data Zone" ); ehs_data_zone_tree = proto_item_add_subtree ( ehs_data_zone, ett_ehs_data_zone ); /* since the aos/los EHS packet data zone is well known, format it for display as well @@ -894,7 +894,7 @@ /* UDSM data zone dissector */ static void -udsm_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo ) +udsm_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo _U_) { proto_item *ehs_data_zone; proto_tree *ehs_data_zone_tree; @@ -902,7 +902,7 @@ int year, jday, hour, minute, second; /* create the data zone tree */ - ehs_data_zone = proto_tree_add_text ( ehs_tree, tvb, *offset, pinfo->iplen - IP_HEADER_LENGTH - *offset, "UDSM Data Zone" ); + ehs_data_zone = proto_tree_add_text ( ehs_tree, tvb, *offset, tvb_reported_length(tvb) - *offset, "UDSM Data Zone" ); ehs_data_zone_tree = proto_item_add_subtree ( ehs_data_zone, ett_ehs_data_zone ); proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_ccsds_vs_bpdu, tvb, *offset, 1, ENC_BIG_ENDIAN ); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-enip.c wireshark-1.12.0~201311020920/epan/dissectors/packet-enip.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-enip.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-enip.c 2013-11-02 02:12:36.000000000 +0000 @@ -1930,8 +1930,6 @@ proto_tree_add_item(item_tree, hf_enip_cpf_sai_seqnum, tvb, offset+10, 4, ENC_LITTLE_ENDIAN ); /* Add info to column */ - col_clear(pinfo->cinfo, COL_INFO); - col_add_fstr(pinfo->cinfo, COL_INFO, "Connection: ID=0x%08X, SEQ=%010d", tvb_get_letohl( tvb, offset+6 ), tvb_get_letohl( tvb, offset+10 ) ); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-epl.c wireshark-1.12.0~201311020920/epan/dissectors/packet-epl.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-epl.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-epl.c 2013-11-02 02:12:36.000000000 +0000 @@ -1634,7 +1634,7 @@ if (!response) { /* request */ - col_append_fstr(pinfo->cinfo, COL_INFO, "Write Multiple Parameter by Index" ); + col_append_str(pinfo->cinfo, COL_INFO, "Write Multiple Parameter by Index" ); while ( !lastentry && tvb_reported_length_remaining(tvb, offset) > 0 ) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-erldp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-erldp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-erldp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-erldp.c 2013-11-02 02:12:36.000000000 +0000 @@ -455,13 +455,13 @@ offset += 4; proto_tree_add_item(tree, hf_erldp_digest, tvb, offset, 16, ENC_NA); /*offset += 16;*/ - col_add_str(pinfo->cinfo, COL_INFO, "SEND_CHALLENGE_REPLY"); + col_set_str(pinfo->cinfo, COL_INFO, "SEND_CHALLENGE_REPLY"); break; case 'a' : proto_tree_add_item(tree, hf_erldp_digest, tvb, offset, 16, ENC_NA); /*offset += 16;*/ - col_add_str(pinfo->cinfo, COL_INFO, "SEND_CHALLENGE_ACK"); + col_set_str(pinfo->cinfo, COL_INFO, "SEND_CHALLENGE_ACK"); break; case 's' : @@ -499,7 +499,7 @@ offset += 4; if (msg_len == 0) { - col_add_str(pinfo->cinfo, COL_INFO, "KEEP_ALIVE"); + col_set_str(pinfo->cinfo, COL_INFO, "KEEP_ALIVE"); return; } @@ -525,7 +525,7 @@ default: proto_tree_add_item(erldp_tree, hf_erldp_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - col_add_str(pinfo->cinfo, COL_INFO, "unknown header format"); + col_set_str(pinfo->cinfo, COL_INFO, "unknown header format"); return; } } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-esio.c wireshark-1.12.0~201311020920/epan/dissectors/packet-esio.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-esio.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-esio.c 2013-11-02 02:12:36.000000000 +0000 @@ -155,7 +155,7 @@ "Data transfer: Src ID: %d, Dst ID(s): %d", esio_src_id, esio_dst_id); if (esio_nbr_data_transfers > 1) { - col_append_fstr( pinfo->cinfo, COL_INFO, + col_append_str( pinfo->cinfo, COL_INFO, " ..."); } break; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ess.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ess.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ess.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ess.c 2013-11-02 02:12:36.000000000 +0000 @@ -546,7 +546,7 @@ static int dissect_ess_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 51 "../../asn1/ess/ess.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-fc.c wireshark-1.12.0~201311020920/epan/dissectors/packet-fc.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-fc.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-fc.c 2013-11-02 02:12:36.000000000 +0000 @@ -729,7 +729,6 @@ * standardized in FC-FS-2. See section 10.2.4. */ if (fchdr.r_ctl == FC_RCTL_VFT) { - pinfo->vsan = (tvb_get_ntohs(tvb, offset + 2) >> 1) & 0xfff; vft_offset = offset; offset += 8; fchdr.r_ctl = tvb_get_guint8 (tvb, offset); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-fcsb3.c wireshark-1.12.0~201311020920/epan/dissectors/packet-fcsb3.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-fcsb3.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-fcsb3.c 2013-11-02 02:12:36.000000000 +0000 @@ -119,10 +119,12 @@ static dissector_handle_t data_handle; +#if 0 typedef struct { guint32 conv_id; guint32 task_id; } sb3_task_id_t; +#endif static const value_string fc_sbccs_iu_val[] = { {FC_SBCCS_IU_DATA, "Data"}, @@ -707,13 +709,14 @@ proto_tree_add_item (tree, hf_sbccs_dib_iucnt, tvb, offset+9, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_sbccs_dib_datacnt, tvb, offset+10, 2, ENC_BIG_ENDIAN); - supp_status_cnt = tvb_get_ntohs (tvb, offset+10); proto_tree_add_item (tree, hf_sbccs_lrc, tvb, offset+12, 4, ENC_BIG_ENDIAN); + } - if (supp_status_cnt) { - next_tvb = tvb_new_subset_remaining (tvb, offset+FC_SBCCS_DIB_LRC_HDR_SIZE); - call_dissector (data_handle, next_tvb, pinfo, tree); - } + supp_status_cnt = tvb_get_ntohs (tvb, offset+10); + + if (supp_status_cnt) { + next_tvb = tvb_new_subset_remaining (tvb, offset+FC_SBCCS_DIB_LRC_HDR_SIZE); + call_dissector (data_handle, next_tvb, pinfo, tree); } } @@ -840,8 +843,9 @@ proto_tree *dib_tree = NULL; tvbuff_t *next_tvb; conversation_t *conversation; +#if 0 sb3_task_id_t task_key; - void *pd_save; +#endif /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "FC-SB3"); @@ -857,23 +861,20 @@ conversation = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_SBCCS, ch_cu_id, dev_addr, 0); - pd_save = pinfo->private_data; if (conversation) { +#if 0 task_key.conv_id = conversation->index; task_key.task_id = ccw; - pinfo->private_data = (void *)&task_key; - +#endif } else if ((type == FC_SBCCS_IU_CMD_HDR) || (type != FC_SBCCS_IU_CMD_DATA)) { conversation = conversation_new (pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_SBCCS, ch_cu_id, dev_addr, 0); +#if 0 task_key.conv_id = conversation->index; task_key.task_id = ccw; - pinfo->private_data = (void *)&task_key; - } - else { - pinfo->private_data = NULL; +#endif } if (tree) { @@ -920,7 +921,6 @@ next_tvb = tvb_new_subset_remaining (tvb, offset+FC_SBCCS_DIB_LRC_HDR_SIZE); call_dissector (data_handle, next_tvb, pinfo, tree); } - pinfo->private_data = pd_save; } /* Register the protocol with Wireshark */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-flexnet.c wireshark-1.12.0~201311020920/epan/dissectors/packet-flexnet.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-flexnet.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-flexnet.c 2013-11-02 02:12:36.000000000 +0000 @@ -60,7 +60,6 @@ static void dissect_flexnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - void *saved_private_data; tvbuff_t *next_tvb; col_set_str( pinfo->cinfo, COL_PROTOCOL, "Flexnet"); @@ -92,12 +91,8 @@ /* Call sub-dissectors here */ - saved_private_data = pinfo->private_data; next_tvb = tvb_new_subset_remaining(tvb, FLEXNET_HDRLEN); - call_dissector( default_handle , next_tvb, pinfo, parent_tree ); - - pinfo->private_data = saved_private_data; } void diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-frame.c wireshark-1.12.0~201311020920/epan/dissectors/packet-frame.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-frame.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-frame.c 2013-11-02 02:12:36.000000000 +0000 @@ -403,7 +403,6 @@ ti = proto_tree_add_boolean(fh_tree, hf_frame_ignored, tvb, 0, 0,pinfo->fd->flags.ignored); PROTO_ITEM_SET_GENERATED(ti); - pinfo->curr_layer_num = 0; if(proto_field_is_referenced(tree, hf_frame_protocols)) { /* we are going to be using proto_item_append_string() on * hf_frame_protocols, and we must therefore disable the diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ftam.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ftam.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ftam.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ftam.c 2013-11-02 02:12:36.000000000 +0000 @@ -1702,7 +1702,7 @@ static int dissect_ftam_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 76 "../../asn1/ftam/ftam.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -2071,7 +2071,7 @@ static int dissect_ftam_T_extension_attribute(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 79 "../../asn1/ftam/ftam.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -3780,7 +3780,7 @@ static int dissect_ftam_T_extension_attribute_Pattern(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 85 "../../asn1/ftam/ftam.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ged125.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ged125.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ged125.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ged125.c 2013-11-02 02:12:36.000000000 +0000 @@ -998,7 +998,6 @@ message_type = tvb_get_ntohl(tvb, 4); col_set_str(pinfo->cinfo, COL_PROTOCOL, "GED125"); - col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "%s %u bytes", val_to_str(message_type, base_message_values, "Unknown %d"), size); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-gopher.c wireshark-1.12.0~201311020920/epan/dissectors/packet-gopher.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-gopher.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-gopher.c 2013-11-02 02:12:36.000000000 +0000 @@ -169,7 +169,7 @@ while (find_dir_tokens(tvb, offset + 1, &sel_start, &host_start, &port_start, &line_len, &next_offset)) { if (!is_dir) { /* First time */ proto_item_append_text(ti, "[Directory list]"); - col_append_fstr(pinfo->cinfo, COL_INFO, ": [Directory list]"); + col_append_str(pinfo->cinfo, COL_INFO, ": [Directory list]"); } name = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, sel_start - offset - 2); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-gsm_a_rr.c wireshark-1.12.0~201311020920/epan/dissectors/packet-gsm_a_rr.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-gsm_a_rr.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-gsm_a_rr.c 2013-11-02 02:12:36.000000000 +0000 @@ -10743,12 +10743,12 @@ if (short_pd == 0) { - col_append_fstr(pinfo->cinfo, COL_INFO, "(RR) "); + col_append_str(pinfo->cinfo, COL_INFO, "(RR) "); get_rr_short_pd_msg_params(mess_type, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p); } else { - col_append_fstr(pinfo->cinfo, COL_INFO, "(Unknown) "); + col_append_str(pinfo->cinfo, COL_INFO, "(Unknown) "); } /* diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-gsm_map.c wireshark-1.12.0~201311020920/epan/dissectors/packet-gsm_map.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-gsm_map.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-gsm_map.c 2013-11-02 02:12:36.000000000 +0000 @@ -3119,7 +3119,7 @@ #line 203 "../../asn1/gsm_map/gsm_map.cnf" proto_tree_add_text(tree, tvb, offset, -1, "Extension Data"); if (obj_id){ - offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree, NULL); }else{ call_dissector(data_handle, tvb, actx->pinfo, tree); offset = tvb_length_remaining(tvb,offset); @@ -16241,7 +16241,7 @@ &opcode); col_append_str(actx->pinfo->cinfo, COL_INFO, gsm_map_opr_code(opcode)); - col_append_fstr(actx->pinfo->cinfo, COL_INFO, " "); + col_append_str(actx->pinfo->cinfo, COL_INFO, " "); @@ -19695,16 +19695,15 @@ static guint8 gsm_map_pdu_size = 0; static int -dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) { +dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, + int hf_index _U_, struct tcap_private_t * p_private_tcap) { char *version_ptr; - struct tcap_private_t * p_private_tcap; opcode = 0; if (pref_application_context_version == APPLICATON_CONTEXT_FROM_TRACE) { application_context_version = 0; - if (actx->pinfo->private_data != NULL){ - p_private_tcap = (struct tcap_private_t *)actx->pinfo->private_data; + if (p_private_tcap != NULL){ if (p_private_tcap->acv==TRUE ){ version_ptr = strrchr((const char*)p_private_tcap->oid,'.'); if (version_ptr){ @@ -19720,8 +19719,8 @@ /* Get the length and add 2 */ gsm_map_pdu_size = tvb_get_guint8(tvb, offset+1)+2; - col_add_str(actx->pinfo->cinfo, COL_INFO, val_to_str_const(gsmmap_pdu_type, gsm_old_Component_vals, "Unknown GSM-MAP Component")); - col_append_fstr(actx->pinfo->cinfo, COL_INFO, " "); + col_set_str(actx->pinfo->cinfo, COL_INFO, val_to_str_const(gsmmap_pdu_type, gsm_old_Component_vals, "Unknown GSM-MAP Component")); + col_append_str(actx->pinfo->cinfo, COL_INFO, " "); offset = dissect_gsm_old_Component(FALSE, tvb, 0, actx, tree, hf_gsm_map_old_Component_PDU); /* offset = dissect_ber_choice(pinfo, tree, tvb, offset, @@ -19731,14 +19730,15 @@ return offset; } -static void -dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +static int +dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { proto_item *item=NULL; proto_tree *tree=NULL; /* Used for gsm_map TAP */ static gsm_map_tap_rec_t tap_rec; gint op_idx; + struct tcap_private_t * p_private_tcap = (struct tcap_private_t *)data; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -19748,12 +19748,10 @@ top_tree = parent_tree; /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, ENC_NA); - tree = proto_item_add_subtree(item, ett_gsm_map); - } + item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, ENC_NA); + tree = proto_item_add_subtree(item, ett_gsm_map); - dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, &asn1_ctx, tree, -1); + dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, &asn1_ctx, tree, -1, p_private_tcap); try_val_to_str_idx(opcode, gsm_map_opr_code_strings, &op_idx); if (op_idx != -1) { @@ -19763,6 +19761,8 @@ tap_queue_packet(gsm_map_tap, pinfo, &tap_rec); } + + return tvb_length(tvb); } const value_string ssCode_vals[] = { @@ -27253,7 +27253,7 @@ /* Register protocol */ proto_gsm_map_dialogue =proto_gsm_map = proto_register_protocol(PNAME, PSNAME, PFNAME); - register_dissector("gsm_map", dissect_gsm_map, proto_gsm_map); + new_register_dissector("gsm_map", dissect_gsm_map, proto_gsm_map); /* Register fields and subtrees */ proto_register_field_array(proto_gsm_map, hf, array_length(hf)); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-gsm_rlcmac.c wireshark-1.12.0~201311020920/epan/dissectors/packet-gsm_rlcmac.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-gsm_rlcmac.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-gsm_rlcmac.c 2013-11-02 02:12:36.000000000 +0000 @@ -7254,7 +7254,7 @@ { guint64 e; - col_add_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); ti = proto_tree_add_protocol_format(tree, proto_gsm_rlcmac, tvb, bit_offset >> 3, -1, "GPRS DL DATA (CS%d)", data->block_format & 0x0F); @@ -7317,7 +7317,7 @@ } } data->u.MESSAGE_TYPE = tvb_get_bits8(tvb, message_type_offset, 6); - col_add_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); col_append_sep_fstr(pinfo->cinfo, COL_INFO, ":", "GPRS DL:%s", val_to_str_ext(data->u.MESSAGE_TYPE, &dl_rlc_message_type_vals_ext, "Unknown Messsage Type")); ti = proto_tree_add_protocol_format(tree, proto_gsm_rlcmac, tvb, message_type_offset >> 3, -1, "GSM RLC/MAC: %s (%d) (Downlink)", @@ -7383,7 +7383,7 @@ guint16 bit_length = tvb_length(tvb) * 8; - col_add_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); col_append_sep_str(pinfo->cinfo, COL_INFO, ":", "EGPRS DL:HEADER"); /* Dissect the MAC header */ ti = proto_tree_add_protocol_format(tree, proto_gsm_rlcmac, tvb, 0, -1, @@ -7428,7 +7428,7 @@ csnStream_t ar; guint16 bit_length = tvb_length(tvb) * 8; - col_add_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); col_append_sep_str(pinfo->cinfo, COL_INFO, ":", "PACCH ACCESS BURST"); ti = proto_tree_add_protocol_format(tree, proto_gsm_rlcmac, tvb, 0, -1, "GPRS UL PACCH ACCESS BURST"); @@ -7474,7 +7474,7 @@ length_indicator_t li_array[10]; guint8 li_count = array_length(li_array); - col_add_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); col_append_sep_str(pinfo->cinfo, COL_INFO, ":", "GPRS UL"); if(payload_type == PAYLOAD_TYPE_DATA) { @@ -7557,7 +7557,7 @@ guint16 bit_offset = 0; guint16 bit_length = tvb_length(tvb) * 8; - col_add_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC"); col_append_sep_str(pinfo->cinfo, COL_INFO, ":", "EGPRS UL:HEADER"); ti = proto_tree_add_protocol_format(tree, proto_gsm_rlcmac, tvb, bit_offset >> 3, -1, "GSM RLC/MAC: EGPRS UL HEADER"); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-gsm_sim.c wireshark-1.12.0~201311020920/epan/dissectors/packet-gsm_sim.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-gsm_sim.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-gsm_sim.c 2013-11-02 02:12:36.000000000 +0000 @@ -1170,7 +1170,7 @@ break; switch (p1) { case 0x03: /* parent DF */ - col_append_fstr(pinfo->cinfo, COL_INFO, "Parent DF "); + col_append_str(pinfo->cinfo, COL_INFO, "Parent DF "); break; case 0x04: /* select by AID */ col_append_fstr(pinfo->cinfo, COL_INFO, "Application %s ", @@ -1179,7 +1179,7 @@ break; case 0x09: /* select by relative path */ - col_append_fstr(pinfo->cinfo, COL_INFO, "."); + col_append_str(pinfo->cinfo, COL_INFO, "."); /* fallthrough */ case 0x08: /* select by absolute path */ for (i = 0; i < p3; i += 2) { @@ -1188,7 +1188,7 @@ val_to_str(g16, mf_dfs, "%04x")); proto_tree_add_item(tree, hf_file_id, tvb, offset+DATA_OFFS+i, 2, ENC_BIG_ENDIAN); } - col_append_fstr(pinfo->cinfo, COL_INFO, " "); + col_append_str(pinfo->cinfo, COL_INFO, " "); break; default: g16 = tvb_get_ntohs(tvb, offset+DATA_OFFS); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-gtp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-gtp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-gtp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-gtp.c 2013-11-02 02:12:36.000000000 +0000 @@ -1686,8 +1686,6 @@ static dissector_handle_t bssgp_handle; static dissector_table_t bssap_pdu_type_table; -static gtp_msg_hash_t *gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint seq_nr, guint msgtype); - static int decode_gtp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree); static int decode_gtp_imsi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree); static int decode_gtp_rai(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree); @@ -3038,11 +3036,9 @@ } static gtp_msg_hash_t * -gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint seq_nr, guint msgtype) +gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint seq_nr, guint msgtype, gtp_conv_info_t *gtp_info) { gtp_msg_hash_t gcr, *gcrp = NULL; - gtp_conv_info_t *gtp_info = (gtp_conv_info_t *)pinfo->private_data; - gcr.seq_nr=seq_nr; switch (msgtype) { @@ -7839,7 +7835,6 @@ gtp_msg_hash_t *gcrp = NULL; conversation_t *conversation; gtp_conv_info_t *gtp_info; - void* pd_save; /* Do we have enough bytes for the version and message type? */ if (!tvb_bytes_exist(tvb, 0, 2)) { @@ -7891,8 +7886,6 @@ gtp_info->next = gtp_info_items; gtp_info_items = gtp_info; } - pd_save = pinfo->private_data; - pinfo->private_data = gtp_info; gtp_hdr->flags = tvb_get_guint8(tvb, offset); @@ -7973,7 +7966,7 @@ default: break; } - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(gtp_hdr->message, >p_message_type_ext, "Unknown")); + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(gtp_hdr->message, >p_message_type_ext, "Unknown")); if (tree) { proto_tree_add_uint(gtp_tree, hf_gtp_message_type, tvb, offset, 1, gtp_hdr->message); } @@ -8182,7 +8175,7 @@ /*Use sequence number to track Req/Resp pairs*/ if (seq_no) { - gcrp = gtp_match_response(tvb, pinfo, gtp_tree, seq_no, gtp_hdr->message); + gcrp = gtp_match_response(tvb, pinfo, gtp_tree, seq_no, gtp_hdr->message, gtp_info); /*pass packet to tap for response time reporting*/ if (gcrp) { tap_queue_packet(gtp_tap,pinfo,gcrp); @@ -8235,7 +8228,7 @@ col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "GTP <"); col_append_str(pinfo->cinfo, COL_PROTOCOL, ">"); } - pinfo->private_data = pd_save; + tap_queue_packet(gtpv1_tap,pinfo, gtp_hdr); return tvb_length(tvb); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-gtpv2.c wireshark-1.12.0~201311020920/epan/dissectors/packet-gtpv2.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-gtpv2.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-gtpv2.c 2013-11-02 02:12:36.000000000 +0000 @@ -4444,9 +4444,7 @@ int offset = 0; tvbuff_t *next_tvb; guint16 ext_id; - void *save_private_data = pinfo->private_data; - pinfo->private_data = GUINT_TO_POINTER((guint32)instance); /* oct 5 -7 Enterprise ID */ ext_id = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_gtpv2_enterprise_id, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -4455,11 +4453,9 @@ proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(ext_id, &sminmpec_values_ext, "Unknown"), ext_id); next_tvb = tvb_new_subset(tvb, offset, length-2, length-2); - if (dissector_try_uint(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree)){ - pinfo->private_data = save_private_data; + if (dissector_try_uint_new(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree, FALSE, GUINT_TO_POINTER((guint32)instance))){ return; } - pinfo->private_data = save_private_data; proto_tree_add_text(tree, tvb, offset, length-2, "Proprietary value"); } @@ -5229,7 +5225,7 @@ /* message type is in octet 2 */ message_type = tvb_get_guint8(tvb, 1); - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, >pv2_message_type_vals_ext, "Unknown")); + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, >pv2_message_type_vals_ext, "Unknown")); p_flag = (tvb_get_guint8(tvb, offset) & 0x10) >> 4; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-hazelcast.c wireshark-1.12.0~201311020920/epan/dissectors/packet-hazelcast.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-hazelcast.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-hazelcast.c 2013-11-02 02:12:36.000000000 +0000 @@ -333,7 +333,6 @@ proto_tree_add_item(hcast_tree, hf_hazelcast_operation, tvb, offset, 1, ENC_BIG_ENDIAN); operation = tvb_get_guint8(tvb, offset); - col_clear(pinfo->cinfo,COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(operation, operationTypes, "Unknown (0x%02x)")); offset += 1; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-hci_usb.c wireshark-1.12.0~201311020920/epan/dissectors/packet-hci_usb.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-hci_usb.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-hci_usb.c 2013-11-02 02:12:36.000000000 +0000 @@ -36,6 +36,9 @@ static int proto_hci_usb = -1; static int hf_bthci_usb_data = -1; +static int hf_bthci_usb_packet_fragment = -1; +static int hf_bthci_usb_packet_complete = -1; +static int hf_bthci_usb_packet_unknown_fragment = -1; static gint ett_hci_usb = -1; static gint ett_hci_usb_msg_fragment = -1; @@ -111,9 +114,9 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_USB"); - col_clear(pinfo->cinfo, COL_INFO); usb_data = (usb_data_t *)data; + DISSECTOR_ASSERT(usb_data); p2p_dir_save = pinfo->p2p_dir; pinfo->p2p_dir = usb_data->direction; @@ -121,11 +124,11 @@ switch (pinfo->p2p_dir) { case P2P_DIR_SENT: - col_add_str(pinfo->cinfo, COL_INFO, "Sent"); + col_set_str(pinfo->cinfo, COL_INFO, "Sent"); break; case P2P_DIR_RECV: - col_add_str(pinfo->cinfo, COL_INFO, "Rcvd"); + col_set_str(pinfo->cinfo, COL_INFO, "Rcvd"); break; default: @@ -186,12 +189,12 @@ reassembled = fragment_get_reassembled_id(&hci_usb_reassembly_table, pinfo, session_id); if (reassembled && pinfo->fd->num < reassembled->reassembled_in) { - pitem = proto_tree_add_text(ttree, tvb, offset, -1, "Fragment"); + pitem = proto_tree_add_item(ttree, hf_bthci_usb_packet_fragment, tvb, offset, -1, ENC_NA); PROTO_ITEM_SET_GENERATED(pitem); - col_append_fstr(pinfo->cinfo, COL_INFO, " Fragment"); + col_append_str(pinfo->cinfo, COL_INFO, " Fragment"); } else if (reassembled && pinfo->fd->num == reassembled->reassembled_in) { - pitem = proto_tree_add_text(ttree, tvb, offset, -1, "Complete"); + pitem = proto_tree_add_item(ttree, hf_bthci_usb_packet_complete, tvb, offset, -1, ENC_NA); PROTO_ITEM_SET_GENERATED(pitem); if (reassembled->len > tvb_ensure_length_remaining(tvb, offset)) { @@ -209,7 +212,7 @@ call_dissector(find_dissector("bthci_acl"), next_tvb, pinfo, tree); } } else { - pitem = proto_tree_add_text(ttree, tvb, offset, -1, "Unknown Fragment"); + pitem = proto_tree_add_item(ttree, hf_bthci_usb_packet_unknown_fragment, tvb, offset, -1, ENC_NA); PROTO_ITEM_SET_GENERATED(pitem); } @@ -283,6 +286,21 @@ FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, + { &hf_bthci_usb_packet_fragment, + { "Packet Fragment", "hci_usb.packet.fragment", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_bthci_usb_packet_complete, + { "Packet Complete", "hci_usb.packet.complete", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_bthci_usb_packet_unknown_fragment, + { "Unknown Packet Fragment", "hci_usb.packet.unknown_fragment", + FT_NONE, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, { &hf_bthci_usb_data, { "Unknown Data", "hci_usb.data", FT_NONE, BASE_NONE, NULL, 0x00, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-hpfeeds.c wireshark-1.12.0~201311020920/epan/dissectors/packet-hpfeeds.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-hpfeeds.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-hpfeeds.c 2013-11-02 02:12:36.000000000 +0000 @@ -263,7 +263,6 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "HPFEEDS"); /* Clear out stuff in the info column */ - col_clear(pinfo->cinfo,COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "Type %s", val_to_str(opcode, opcode_vals, "Unknown (0x%02x)")); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-hsrp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-hsrp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-hsrp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-hsrp.c 2013-11-02 02:12:36.000000000 +0000 @@ -347,7 +347,7 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "HSRP"); opcode = tvb_get_guint8(tvb, 1); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(opcode, hsrp_opcode_vals, "Unknown")); if (opcode < 3) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-http.c wireshark-1.12.0~201311020920/epan/dissectors/packet-http.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-http.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-http.c 2013-11-02 02:12:36.000000000 +0000 @@ -157,13 +157,13 @@ char c; if (rec->header_name == NULL) { - *err = wmem_strdup_printf(wmem_packet_scope(), "Header name can't be empty"); + *err = g_strdup("Header name can't be empty"); return; } g_strstrip(rec->header_name); if (rec->header_name[0] == 0) { - *err = wmem_strdup_printf(wmem_packet_scope(), "Header name can't be empty"); + *err = g_strdup("Header name can't be empty"); return; } @@ -172,7 +172,7 @@ */ c = proto_check_field_name(rec->header_name); if (c) { - *err = wmem_strdup_printf(wmem_packet_scope(), "Header name can't contain '%c'", c); + *err = g_strdup_printf("Header name can't contain '%c'", c); return; } @@ -1916,7 +1916,7 @@ /* Call a subdissector to handle HTTP CONNECT's traffic */ static void http_payload_subdissector(tvbuff_t *tvb, proto_tree *tree, - packet_info *pinfo, http_conv_t *conv_data) + packet_info *pinfo, http_conv_t *conv_data, void* data) { guint32 *ptr = NULL; guint32 uri_port, saved_port, srcport, destport; @@ -1982,7 +1982,8 @@ saved_port = *ptr; *ptr = uri_port; decode_tcp_ports(tvb, 0, pinfo, tree, - pinfo->srcport, pinfo->destport, NULL); + pinfo->srcport, pinfo->destport, NULL, + (struct tcpinfo *)data); *ptr = saved_port; } } @@ -2366,12 +2367,14 @@ if (!hf_id) { if (http_type == HTTP_REQUEST || http_type == HTTP_RESPONSE) { - proto_tree_add_string_format(tree, + it = proto_tree_add_item(tree, http_type == HTTP_RESPONSE ? hf_http_response_line : hf_http_request_line, - tvb, offset, len, line, "%s", - format_text(line, len)); + tvb, offset, len, + ENC_NA|ENC_ASCII); + proto_item_set_text(it, "%s", + format_text(line, len)); } else { proto_tree_add_text(tree, tvb, offset, len, "%s", format_text(line, len)); @@ -2383,12 +2386,14 @@ value, "%s", format_text(line, len)); if (http_type == HTTP_REQUEST || http_type == HTTP_RESPONSE) { - it = proto_tree_add_string_format(tree, + it = proto_tree_add_item(tree, http_type == HTTP_RESPONSE ? hf_http_response_line : hf_http_request_line, - tvb, offset, len, line, "%s", - format_text(line, len)); + tvb, offset, len, + ENC_NA|ENC_ASCII); + proto_item_set_text(it, "%s", + format_text(line, len)); PROTO_ITEM_SET_HIDDEN(it); } } @@ -2416,11 +2421,13 @@ hdr_item = proto_tree_add_uint(tree, *headers[hf_index].hf, tvb, offset, len, tmp); if (http_type == HTTP_REQUEST || http_type == HTTP_RESPONSE) { - it = proto_tree_add_string_format(tree, + it = proto_tree_add_item(tree, http_type == HTTP_RESPONSE ? hf_http_response_line : hf_http_request_line, - tvb, offset, len, line, "%d", tmp); + tvb, offset, len, + ENC_NA|ENC_ASCII); + proto_item_set_text(it, "%d", tmp); PROTO_ITEM_SET_HIDDEN(it); } break; @@ -2430,12 +2437,14 @@ value, "%s", format_text(line, len)); if (http_type == HTTP_REQUEST || http_type == HTTP_RESPONSE) { - it = proto_tree_add_string_format(tree, + it = proto_tree_add_item(tree, http_type == HTTP_RESPONSE ? hf_http_response_line : hf_http_request_line, - tvb, offset, len, line, "%s", - format_text(line, len)); + tvb, offset, len, + ENC_NA|ENC_ASCII); + proto_item_set_text(it, "%s", + format_text(line, len)); PROTO_ITEM_SET_HIDDEN(it); } } @@ -2669,8 +2678,8 @@ return FALSE; } -static void -dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { http_conv_t *conv_data; int offset = 0; @@ -2688,7 +2697,7 @@ conv_data->request_uri) { if(conv_data->startframe == 0 && !pinfo->fd->flags.visited) conv_data->startframe = pinfo->fd->num; - http_payload_subdissector(tvb, tree, pinfo, conv_data); + http_payload_subdissector(tvb, tree, pinfo, conv_data, data); } else { while (tvb_reported_length_remaining(tvb, offset) > 0) { if (conv_data->upgrade == UPGRADE_WEBSOCKET && pinfo->fd->num >= conv_data->startframe) { @@ -2714,10 +2723,12 @@ col_set_fence(pinfo->cinfo, COL_INFO); } } + + return tvb_length(tvb); } static gboolean -dissect_http_heur_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_http_heur_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { gint offset = 0, next_offset, linelen; conversation_t *conversation; @@ -2738,7 +2749,7 @@ if((tvb_strncaseeql(tvb, linelen-8, "HTTP/1.1", 8) == 0)||(tvb_strncaseeql(tvb, 0, "HTTP/1.1", 8) == 0)){ conversation = find_or_create_conversation(pinfo); conversation_set_dissector(conversation,http_handle); - dissect_http(tvb, pinfo, tree); + dissect_http(tvb, pinfo, tree, data); return TRUE; } @@ -3018,7 +3029,7 @@ expert_http = expert_register_protocol(proto_http); expert_register_field_array(expert_http, ei, array_length(ei)); - http_handle = register_dissector("http", dissect_http, proto_http); + http_handle = new_register_dissector("http", dissect_http, proto_http); http_module = prefs_register_protocol(proto_http, reinit_http); prefs_register_bool_preference(http_module, "desegment_headers", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ieee80211-radiotap-iter.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ieee80211-radiotap-iter.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ieee80211-radiotap-iter.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ieee80211-radiotap-iter.c 2013-11-02 02:12:36.000000000 +0000 @@ -10,10 +10,20 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * Alternatively, this software may be distributed under the terms of BSD - * license. + * Alternatively, this software may be distributed under the terms of ISC + * license: * - * See COPYING for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ieee80211-radiotap-iter.h wireshark-1.12.0~201311020920/epan/dissectors/packet-ieee80211-radiotap-iter.h --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ieee80211-radiotap-iter.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ieee80211-radiotap-iter.h 2013-11-02 02:12:36.000000000 +0000 @@ -10,10 +10,20 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * Alternatively, this software may be distributed under the terms of BSD - * license. + * Alternatively, this software may be distributed under the terms of ISC + * license: * - * See COPYING for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef __RADIOTAP_ITER_H diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ieee80211.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ieee80211.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ieee80211.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ieee80211.c 2013-11-02 02:12:36.000000000 +0000 @@ -172,7 +172,7 @@ decryption_key_t* dk; if (rec->string == NULL) { - *err = ep_strdup_printf("Key can't be blank"); + *err = g_strdup("Key can't be blank"); } else { g_strstrip(rec->string); dk = parse_key_string(rec->string, rec->key); @@ -183,25 +183,25 @@ case AIRPDCAP_KEY_TYPE_WEP_40: case AIRPDCAP_KEY_TYPE_WEP_104: if (rec->key != AIRPDCAP_KEY_TYPE_WEP) { - *err = ep_strdup_printf("Invalid key format"); + *err = g_strdup("Invalid key format"); } break; case AIRPDCAP_KEY_TYPE_WPA_PWD: if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PWD) { - *err = ep_strdup_printf("Invalid key format"); + *err = g_strdup("Invalid key format"); } break; case AIRPDCAP_KEY_TYPE_WPA_PSK: if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PSK) { - *err = ep_strdup_printf("Invalid key format"); + *err = g_strdup("Invalid key format"); } break; default: - *err = ep_strdup_printf("Invalid key format"); + *err = g_strdup("Invalid key format"); break; } } else { - *err = ep_strdup_printf("Invalid key format"); + *err = g_strdup("Invalid key format"); } } } @@ -5727,7 +5727,7 @@ val_to_str(subtype, hs20_anqp_subtype_vals, "Unknown (%u)")); } else if (idx == 1) { - col_append_fstr(pinfo->cinfo, COL_INFO, ", .."); + col_append_str(pinfo->cinfo, COL_INFO, ", .."); } proto_tree_add_item(tree, hf_hs20_anqp_subtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -5787,7 +5787,7 @@ val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)")); } else if (idx == 1) { proto_item_append_text(tree, ", .."); - col_append_fstr(pinfo->cinfo, COL_INFO, ", .."); + col_append_str(pinfo->cinfo, COL_INFO, ", .."); } } tree = proto_item_add_subtree(item, ett_gas_anqp); @@ -12445,6 +12445,7 @@ case TAG_VENDOR_SPECIFIC_IE: /* 7.3.2.26 Vendor Specific information element (221) */ case TAG_CISCO_VENDOR_SPECIFIC: /* This Cisco proprietary IE seems to mimic 221 */ + case TAG_SYMBOL_PROPRIETARY: /* This Symbol proprietary IE seems to mimic 221 */ if (tag_len < 3) { expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 3", tag_len); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ieee802154.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ieee802154.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ieee802154.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ieee802154.c 2013-11-02 02:12:36.000000000 +0000 @@ -134,15 +134,18 @@ static_addr_t *map = (static_addr_t *)r; /* Ensure a valid short address */ if (map->addr16 >= IEEE802154_NO_ADDR16) { - *err = "Invalid short address"; + *err = g_strdup("Invalid short address"); + return; } /* Ensure a valid PAN identifier. */ if (map->pan >= IEEE802154_BCAST_PAN) { - *err = "Invalid PAN identifier"; + *err = g_strdup("Invalid PAN identifier"); + return; } /* Ensure a valid EUI-64 length */ if (map->eui64_len != sizeof(guint64)) { - *err = "Invalid EUI-64 length"; + *err = g_strdup("Invalid EUI-64 length"); + return; } } /* ieee802154_addr_uat_update_cb */ @@ -476,7 +479,6 @@ /* Add the protocol name. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "IEEE 802.15.4 non-ASK PHY"); /* Add the packet length. */ - col_clear(pinfo->cinfo, COL_PACKET_LENGTH); col_add_fstr(pinfo->cinfo, COL_PACKET_LENGTH, "%i", tvb_length(tvb)); preamble=tvb_get_letohl(tvb,offset); @@ -643,7 +645,6 @@ /* Add the protocol name. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "IEEE 802.15.4"); /* Add the packet length. */ - col_clear(pinfo->cinfo, COL_PACKET_LENGTH); col_add_fstr(pinfo->cinfo, COL_PACKET_LENGTH, "%i", tvb_length(tvb)); /* Add the packet length to the filter field */ @@ -1530,7 +1531,7 @@ } else { /* Association was unsuccessful. */ - col_append_fstr(pinfo->cinfo, COL_INFO, ", Unsuccessful"); + col_append_str(pinfo->cinfo, COL_INFO, ", Unsuccessful"); } /* Update the address table. */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-igmp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-igmp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-igmp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-igmp.c 2013-11-02 02:12:36.000000000 +0000 @@ -589,7 +589,7 @@ /* number of group records */ num = tvb_get_ntohs(tvb, offset); if (!num) - col_append_fstr(pinfo->cinfo, COL_INFO, " - General query"); + col_append_str(pinfo->cinfo, COL_INFO, " - General query"); proto_tree_add_uint(tree, hf_num_grp_recs, tvb, offset, 2, num); offset += 2; @@ -621,7 +621,7 @@ maddr = tvb_get_ipv4(tvb, offset); if (! maddr) { - col_append_fstr(pinfo->cinfo, COL_INFO, ", general"); + col_append_str(pinfo->cinfo, COL_INFO, ", general"); } else { col_append_fstr(pinfo->cinfo, COL_INFO, ", specific for group %s", ip_to_str((guint8*)&maddr)); @@ -675,7 +675,7 @@ maddr = tvb_get_ipv4(tvb, offset); if (! maddr) { - col_append_fstr(pinfo->cinfo, COL_INFO, ", general"); + col_append_str(pinfo->cinfo, COL_INFO, ", general"); } else { if (type == IGMP_V2_LEAVE_GROUP) { col_append_fstr(pinfo->cinfo, COL_INFO, @@ -909,7 +909,7 @@ switch (type) { case IGMP_V1_HOST_MEMBERSHIP_QUERY: /* 0x11 v1/v2/v3 */ - if ( (pinfo->iplen-pinfo->iphdrlen)>=12 ) { + if ( tvb_reported_length(tvb)>=12 ) { /* version 3 */ offset = dissect_igmp_v3_query(tvb, pinfo, tree, type, offset); } else { @@ -967,7 +967,7 @@ break; case IGMP_TYPE_0x25: - if ( (pinfo->iplen-pinfo->iphdrlen)>=8 ) { + if ( tvb_reported_length(tvb)>=8 ) { /* if len of igmp packet>=8 we assume it is MSNIP */ offset = dissect_msnip(tvb, pinfo, parent_tree, offset); } else { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-imf.c wireshark-1.12.0~201311020920/epan/dissectors/packet-imf.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-imf.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-imf.c 2013-11-02 02:12:36.000000000 +0000 @@ -288,13 +288,13 @@ char c; if (rec->header_name == NULL) { - *err = ep_strdup_printf("Header name can't be empty"); + *err = g_strdup("Header name can't be empty"); return; } g_strstrip(rec->header_name); if (rec->header_name[0] == 0) { - *err = ep_strdup_printf("Header name can't be empty"); + *err = g_strdup("Header name can't be empty"); return; } @@ -303,7 +303,7 @@ */ c = proto_check_field_name(rec->header_name); if (c) { - *err = ep_strdup_printf("Header name can't contain '%c'", c); + *err = g_strdup_printf("Header name can't contain '%c'", c); return; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-inap.c wireshark-1.12.0~201311020920/epan/dissectors/packet-inap.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-inap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-inap.c 2013-11-02 02:12:36.000000000 +0000 @@ -1515,7 +1515,7 @@ #line 215 "../../asn1/inap/inap.cnf" proto_tree_add_text(tree, tvb, offset, -1, "Extension Data"); if (obj_id){ - offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree, NULL); }else{ call_dissector(data_handle, tvb, actx->pinfo, tree); offset = tvb_length_remaining(tvb,offset); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-infiniband.c wireshark-1.12.0~201311020920/epan/dissectors/packet-infiniband.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-infiniband.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-infiniband.c 2013-11-02 02:12:36.000000000 +0000 @@ -2065,7 +2065,6 @@ /* Mark the Packet type as Infiniband in the wireshark UI */ /* Clear other columns */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "InfiniBand Link"); - col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(operand, Operand_Description, "Unknown (0x%1x)")); @@ -2987,8 +2986,7 @@ label = val_to_str_const(MadData.attributeID, CM_Attributes, "(Unknown CM Attribute)"); proto_item_set_text(CM_header_item, "CM %s", label); - col_clear(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_INFO, "CM: %s", label); + col_add_fstr(pinfo->cinfo, COL_INFO, "CM: %s", label); CM_header_tree = proto_item_add_subtree(CM_header_item, ett_cm); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ip.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ip.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ip.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ip.c 2013-11-02 02:12:36.000000000 +0000 @@ -2314,8 +2314,6 @@ } pinfo->ipproto = iph->ip_p; - pinfo->iplen = iph->ip_len; - pinfo->iphdrlen = hlen; tap_queue_packet(ip_tap, pinfo, iph); /* Skip over header + options */ @@ -2328,14 +2326,14 @@ */ save_fragmented = pinfo->fragmented; if (ip_defragment && (iph->ip_off & (IP_MF|IP_OFFSET)) && - tvb_bytes_exist(tvb, offset, pinfo->iplen - pinfo->iphdrlen) && + tvb_bytes_exist(tvb, offset, iph->ip_len - hlen) && ipsum == 0) { ipfd_head = fragment_add_check(&ip_reassembly_table, tvb, offset, pinfo, iph->ip_p ^ iph->ip_id ^ src32 ^ dst32, NULL, (iph->ip_off & IP_OFFSET) * 8, - pinfo->iplen - pinfo->iphdrlen, + iph->ip_len - hlen, iph->ip_off & IP_MF); next_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled IPv4", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ipmi-picmg.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ipmi-picmg.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ipmi-picmg.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ipmi-picmg.c 2013-11-02 02:12:36.000000000 +0000 @@ -472,6 +472,7 @@ { 0, NULL } }; +#if 0 static const value_string vals_21_addr_type[] = { { 0x01, "IPv4" }, { 0x60, "OEM" }, { 0x61, "OEM" }, { 0x62, "OEM" }, { 0x63, "OEM" }, @@ -484,6 +485,7 @@ { 0x7c, "OEM" }, { 0x7d, "OEM" }, { 0x7e, "OEM" }, { 0x7f, "OEM" }, { 0, NULL } }; +#endif static const value_string vals_prop00_rollback[] = { { 0x00, "Not supported" }, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ipv6.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ipv6.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ipv6.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ipv6.c 2013-11-02 02:12:36.000000000 +0000 @@ -2093,8 +2093,6 @@ /* collect packet info */ pinfo->ipproto = nxt; - pinfo->iplen = (int)sizeof(ipv6) + plen + offset; - pinfo->iphdrlen = offset; tap_queue_packet(ipv6_tap, pinfo, &ipv6); if (offlg & IP6F_OFF_MASK || (ipv6_reassemble && offlg & IP6F_MORE_FRAG)) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-irc.c wireshark-1.12.0~201311020920/epan/dissectors/packet-irc.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-irc.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-irc.c 2013-11-02 02:12:36.000000000 +0000 @@ -529,7 +529,7 @@ { &hf_irc_response_command, { "Command", "irc.response.command", FT_STRING, BASE_NONE, NULL, 0x0, "Response command", HFILL }}, - { &hf_irc_response_num_command, { "Command", "irc.response.command", FT_UINT16, BASE_DEC, + { &hf_irc_response_num_command, { "Command", "irc.response.num_command", FT_UINT16, BASE_DEC, NULL, 0x0, "Response (numeric) command", HFILL }}, { &hf_irc_response_command_param, { "Parameter", "irc.response.command_parameter", FT_STRING, BASE_NONE, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-isakmp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-isakmp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-isakmp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-isakmp.c 2013-11-02 02:12:36.000000000 +0000 @@ -1736,8 +1736,7 @@ } static tvbuff_t * -decrypt_payload(tvbuff_t *tvb, packet_info *pinfo, const guint8 *buf, guint buf_len, isakmp_hdr_t *hdr) { - decrypt_data_t *decr = (decrypt_data_t *) pinfo->private_data; +decrypt_payload(tvbuff_t *tvb, packet_info *pinfo, const guint8 *buf, guint buf_len, isakmp_hdr_t *hdr, decrypt_data_t *decr) { guint8 *decrypted_data = NULL; gint gcry_md_algo, gcry_cipher_algo; gcry_md_hd_t md_ctx; @@ -1887,10 +1886,10 @@ static proto_tree *dissect_payload_header(tvbuff_t *, int, int, int, guint8, guint8 *, guint16 *, proto_tree *); -static void dissect_sa(tvbuff_t *, int, int, proto_tree *, int, packet_info *); -static void dissect_proposal(tvbuff_t *, int, int, proto_tree *, int, packet_info *); -static void dissect_transform(tvbuff_t *, int, int, proto_tree *, packet_info *, int, int); -static void dissect_key_exch(tvbuff_t *, int, int, proto_tree *, int, packet_info *); +static void dissect_sa(tvbuff_t *, int, int, proto_tree *, int, packet_info *, void*); +static void dissect_proposal(tvbuff_t *, int, int, proto_tree *, int, void*); +static void dissect_transform(tvbuff_t *, int, int, proto_tree *, int, int, void*); +static void dissect_key_exch(tvbuff_t *, int, int, proto_tree *, int, packet_info *, void*); static void dissect_id(tvbuff_t *, int, int, proto_tree *, int, packet_info *); static void dissect_cert(tvbuff_t *, int, int, proto_tree *, int, packet_info *); static void dissect_certreq(tvbuff_t *, int, int, proto_tree *, int, packet_info *); @@ -1905,7 +1904,7 @@ static void dissect_nat_discovery(tvbuff_t *, int, int, proto_tree * ); static void dissect_nat_original_address(tvbuff_t *, int, int, proto_tree *, int ); static void dissect_ts(tvbuff_t *, int, int, proto_tree *); -static void dissect_enc(tvbuff_t *, int, int, proto_tree *, packet_info *, guint8); +static void dissect_enc(tvbuff_t *, int, int, proto_tree *, packet_info *, guint8, void*); static void dissect_eap(tvbuff_t *, int, int, proto_tree *, packet_info *); static void dissect_gspm(tvbuff_t *, int, int, proto_tree *); static void dissect_cisco_fragmentation(tvbuff_t *, int, int, proto_tree *, packet_info *); @@ -2589,7 +2588,7 @@ static void dissect_payloads(tvbuff_t *tvb, proto_tree *tree, proto_tree *parent_tree _U_, int isakmp_version, guint8 initial_payload, int offset, int length, - packet_info *pinfo) + packet_info *pinfo, void* decr_data) { guint8 payload, next_payload; guint16 payload_length; @@ -2613,14 +2612,14 @@ switch(payload){ case PLOAD_IKE_SA: case PLOAD_IKE2_SA: - dissect_sa(tvb, offset + 4, payload_length - 4, ntree, isakmp_version, pinfo ); + dissect_sa(tvb, offset + 4, payload_length - 4, ntree, isakmp_version, pinfo, decr_data); break; case PLOAD_IKE_P: - dissect_proposal(tvb, offset + 4, payload_length - 4, ntree, isakmp_version, pinfo ); + dissect_proposal(tvb, offset + 4, payload_length - 4, ntree, isakmp_version, decr_data ); break; case PLOAD_IKE_KE: case PLOAD_IKE2_KE: - dissect_key_exch(tvb, offset + 4, payload_length - 4, ntree, isakmp_version, pinfo ); + dissect_key_exch(tvb, offset + 4, payload_length - 4, ntree, isakmp_version, pinfo, decr_data ); break; case PLOAD_IKE_ID: case PLOAD_IKE2_IDI: @@ -2670,7 +2669,7 @@ break; case PLOAD_IKE2_SK: if(isakmp_version == 2) - dissect_enc(tvb, offset + 4, payload_length - 4, ntree, pinfo, next_payload); + dissect_enc(tvb, offset + 4, payload_length - 4, ntree, pinfo, next_payload, decr_data); break; case PLOAD_IKE2_EAP: dissect_eap(tvb, offset + 4, payload_length - 4, ntree, pinfo ); @@ -2721,7 +2720,7 @@ packet_info *pinfo) { dissect_payloads(tvb, tree, tree, isakmp_version, initial_payload, offset, length, - pinfo); + pinfo, NULL); } static void @@ -2732,14 +2731,13 @@ proto_item * ti, *vers_item; proto_tree * isakmp_tree = NULL, *vers_tree; int isakmp_version; + void* decr_data = NULL; #ifdef HAVE_LIBGCRYPT guint8 i_cookie[COOKIE_SIZE], *ic_key; decrypt_data_t *decr = NULL; tvbuff_t *decr_tvb; proto_tree *decr_tree; address null_addr; - void *pd_save = NULL; - gboolean pd_changed = FALSE; #endif /* HAVE_LIBGCRYPT */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISAKMP"); @@ -2788,9 +2786,7 @@ SE_COPY_ADDRESS(&decr->initiator, &pinfo->src); } - pd_save = pinfo->private_data; - pinfo->private_data = decr; - pd_changed = TRUE; + decr_data = decr; } else if (isakmp_version == 2) { ikev2_uat_data_key_t hash_key; ikev2_uat_data_t *ike_sa_data = NULL; @@ -2814,13 +2810,7 @@ ikev2_dec_data->encr_spec = ike_sa_data->encr_spec; ikev2_dec_data->auth_spec = ike_sa_data->auth_spec; - pd_save = pinfo->private_data; - pinfo->private_data = ikev2_dec_data; - pd_changed = TRUE; - } else if (pinfo->private_data) { - pd_save = pinfo->private_data; - pinfo->private_data = NULL; - pd_changed = TRUE; + decr_data = ikev2_dec_data; } } #endif /* HAVE_LIBGCRYPT */ @@ -2887,9 +2877,6 @@ proto_tree_add_uint_format_value(isakmp_tree, hf_isakmp_length, tvb, offset, 4, hdr.length, "(bogus, length is %u, should be at least %lu)", hdr.length, (unsigned long)ISAKMP_HDR_SIZE); -#ifdef HAVE_LIBGCRYPT - if (pd_changed) pinfo->private_data = pd_save; -#endif /* HAVE_LIBGCRYPT */ return; } @@ -2899,9 +2886,6 @@ proto_tree_add_uint_format_value(isakmp_tree, hf_isakmp_length, tvb, offset, 4, hdr.length, "(bogus, length is %u, which is too large)", hdr.length); -#ifdef HAVE_LIBGCRYPT - if (pd_changed) pinfo->private_data = pd_save; -#endif /* HAVE_LIBGCRYPT */ return; } tvb_ensure_bytes_exist(tvb, offset, len); @@ -2916,11 +2900,11 @@ #ifdef HAVE_LIBGCRYPT if (decr) { - decr_tvb = decrypt_payload(tvb, pinfo, tvb_get_ptr(tvb, offset, len), len, &hdr); + decr_tvb = decrypt_payload(tvb, pinfo, tvb_get_ptr(tvb, offset, len), len, &hdr, decr); if (decr_tvb) { decr_tree = proto_item_add_subtree(ti, ett_isakmp); dissect_payloads(decr_tvb, decr_tree, tree, isakmp_version, - hdr.next_payload, 0, tvb_length(decr_tvb), pinfo); + hdr.next_payload, 0, tvb_length(decr_tvb), pinfo, decr_data); } } @@ -2928,12 +2912,9 @@ } } else { dissect_payloads(tvb, isakmp_tree, tree, isakmp_version, hdr.next_payload, - offset, len, pinfo); + offset, len, pinfo, decr_data); } } -#ifdef HAVE_LIBGCRYPT - if (pd_changed) pinfo->private_data = pd_save; -#endif /* HAVE_LIBGCRYPT */ } @@ -2972,7 +2953,7 @@ } static void -dissect_sa(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_version, packet_info *pinfo ) +dissect_sa(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_version, packet_info *pinfo, void* decr_data) { guint32 doi; proto_item *sti; @@ -3006,19 +2987,19 @@ length -= 4; dissect_payloads(tvb, tree, tree, isakmp_version, PLOAD_IKE_P, offset, - length, pinfo); + length, pinfo, decr_data); } else { /* Unknown */ proto_tree_add_item(tree, hf_isakmp_sa_situation, tvb, offset, length, ENC_NA); } } else if (isakmp_version == 2) { dissect_payloads(tvb, tree, tree, isakmp_version, PLOAD_IKE_P, offset, - length, pinfo); + length, pinfo, decr_data); } } static void -dissect_proposal(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_version, packet_info *pinfo ) +dissect_proposal(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_version, void* decr_data) { guint8 protocol_id; guint8 spi_size; @@ -3075,7 +3056,7 @@ "Not enough room in payload for all transforms"); break; } - dissect_transform(tvb, offset + 4, payload_length - 4, ntree, pinfo, isakmp_version, protocol_id); + dissect_transform(tvb, offset + 4, payload_length - 4, ntree, isakmp_version, protocol_id, decr_data); offset += payload_length; length -= payload_length; @@ -3502,18 +3483,18 @@ return 2+len+optlen; } static void -dissect_transform(tvbuff_t *tvb, int offset, int length, proto_tree *tree, packet_info *pinfo +dissect_transform(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_version, int protocol_id, void* decr_data #ifndef HAVE_LIBGCRYPT -_U_ + _U_ #endif -, int isakmp_version, int protocol_id ) +) { if (isakmp_version == 1) { guint8 transform_id; guint8 transform_num; #ifdef HAVE_LIBGCRYPT - decrypt_data_t *decr = (decrypt_data_t *) pinfo->private_data; + decrypt_data_t *decr = (decrypt_data_t *)decr_data; #endif /* HAVE_LIBGCRYPT */ int offset_end = 0; offset_end = offset + length; @@ -3608,14 +3589,18 @@ } static void -dissect_key_exch(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_version, packet_info *pinfo -#ifndef HAVE_LIBGCRYPT -_U_ +dissect_key_exch(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_version, +#ifdef HAVE_LIBGCRYPT + packet_info* pinfo, + void* decr_data +#else + packet_info* pinfo _U_, + void* decr_data _U_ #endif ) { #ifdef HAVE_LIBGCRYPT - decrypt_data_t *decr = (decrypt_data_t *) pinfo->private_data; + decrypt_data_t *decr = (decrypt_data_t *)decr_data; #endif /* HAVE_LIBGCRYPT */ if (isakmp_version == 2) { @@ -4614,10 +4599,12 @@ proto_tree *tree, #ifdef HAVE_LIBGCRYPT packet_info *pinfo, - guint8 inner_payload) + guint8 inner_payload, + void* decr_info) #else packet_info *pinfo _U_, - guint8 inner_payload _U_) + guint8 inner_payload _U_, + void* decr_info _U_) #endif { #ifdef HAVE_LIBGCRYPT @@ -4633,8 +4620,8 @@ gint payloads_len; proto_tree *decr_tree = NULL, *decr_payloads_tree = NULL; - if (pinfo->private_data) { - key_info = (ikev2_decrypt_data_t*)(pinfo->private_data); + if (decr_info) { + key_info = (ikev2_decrypt_data_t*)(decr_info); iv_len = key_info->encr_spec->iv_len; icd_len = key_info->auth_spec->trunc_len; encr_data_len = length - iv_len - icd_len; @@ -4807,7 +4794,7 @@ * even if the dissection fails. This may occur when the user specify wrong encryption key. */ if (decr_payloads_tree) { - dissect_payloads(decr_tvb, decr_payloads_tree, decr_tree, 2, inner_payload, 0, payloads_len, pinfo); + dissect_payloads(decr_tvb, decr_payloads_tree, decr_tree, 2, inner_payload, 0, payloads_len, pinfo, decr_info); } }else{ #endif /* HAVE_LIBGCRYPT */ @@ -4965,17 +4952,17 @@ ikev1_uat_data_key_t *ud = (ikev1_uat_data_key_t *)p; if (ud->icookie_len != COOKIE_SIZE) { - *err = ep_strdup_printf("Length of Initiator's COOKIE must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2); + *err = g_strdup_printf("Length of Initiator's COOKIE must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2); return; } if (ud->key_len == 0) { - *err = ep_strdup_printf("Must have Encryption key."); + *err = g_strdup_printf("Must have Encryption key."); return; } if (ud->key_len > MAX_KEY_SIZE) { - *err = ep_strdup_printf("Length of Encryption key limited to %d octets (%d hex characters).", MAX_KEY_SIZE, MAX_KEY_SIZE * 2); + *err = g_strdup_printf("Length of Encryption key limited to %d octets (%d hex characters).", MAX_KEY_SIZE, MAX_KEY_SIZE * 2); return; } @@ -4994,12 +4981,12 @@ ikev2_uat_data_t *ud = (ikev2_uat_data_t *)p; if (ud->key.spii_len != COOKIE_SIZE) { - *err = ep_strdup_printf("Length of Initiator's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2); + *err = g_strdup_printf("Length of Initiator's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2); return; } if (ud->key.spir_len != COOKIE_SIZE) { - *err = ep_strdup_printf("Length of Responder's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2); + *err = g_strdup_printf("Length of Responder's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2); return; } @@ -5012,25 +4999,25 @@ } if (ud->sk_ei_len != ud->encr_spec->key_len) { - *err = ep_strdup_printf("Length of SK_ei (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.", + *err = g_strdup_printf("Length of SK_ei (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.", ud->sk_ei_len, ud->encr_spec->key_len); return; } if (ud->sk_er_len != ud->encr_spec->key_len) { - *err = ep_strdup_printf("Length of SK_er (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.", + *err = g_strdup_printf("Length of SK_er (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.", ud->sk_er_len, ud->encr_spec->key_len); return; } if (ud->sk_ai_len != ud->auth_spec->key_len) { - *err = ep_strdup_printf("Length of SK_ai (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.", + *err = g_strdup_printf("Length of SK_ai (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.", ud->sk_ai_len, ud->auth_spec->key_len); return; } if (ud->sk_ar_len != ud->auth_spec->key_len) { - *err = ep_strdup_printf("Length of SK_ar (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.", + *err = g_strdup_printf("Length of SK_ar (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.", ud->sk_ar_len, ud->auth_spec->key_len); return; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-isdn.c wireshark-1.12.0~201311020920/epan/dissectors/packet-isdn.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-isdn.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-isdn.c 2013-11-02 02:12:36.000000000 +0000 @@ -197,7 +197,7 @@ } if (!try_circuit_dissector(pinfo->ctype, pinfo->circuit_id, - pinfo->fd->num, tvb, pinfo, tree)) + pinfo->fd->num, tvb, pinfo, tree, NULL)) call_dissector(data_handle, tvb, pinfo, tree); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ismacryp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ismacryp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ismacryp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ismacryp.c 2013-11-02 02:12:36.000000000 +0000 @@ -263,7 +263,7 @@ if (pref_user_mode == FALSE){ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",val_to_str_const(mode, modetypenames, "user mode")); } else { - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode"); + col_append_str(pinfo->cinfo, COL_INFO, ", user mode"); } user_mode = pref_user_mode; } @@ -271,7 +271,7 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_20); user_mode = TRUE; /* display mode */ - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode"); + col_append_str(pinfo->cinfo, COL_INFO, ", user mode"); } /* select correct AU values depending on version & selected mode in preferences menu if not in user_mode */ if (user_mode == TRUE){ /* use values set in preference menu */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-iwarp-mpa.c wireshark-1.12.0~201311020920/epan/dissectors/packet-iwarp-mpa.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-iwarp-mpa.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-iwarp-mpa.c 2013-11-02 02:12:36.000000000 +0000 @@ -780,20 +780,18 @@ * Main dissection routine. */ static gboolean -dissect_iwarp_mpa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_iwarp_mpa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { tvbuff_t *next_tvb = NULL; conversation_t *conversation = NULL; mpa_state_t *state = NULL; - struct tcpinfo *tcpinfo = NULL; + struct tcpinfo *tcpinfo = (struct tcpinfo *)data; guint8 endpoint = 3; guint16 ulpdu_length = 0; /* FPDU */ if (tvb_length(tvb) >= MPA_SMALLEST_FPDU_LEN && is_mpa_fpdu(pinfo)) { - tcpinfo = (struct tcpinfo *)pinfo->private_data; - conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-json.c wireshark-1.12.0~201311020920/epan/dissectors/packet-json.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-json.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-json.c 2013-11-02 02:12:36.000000000 +0000 @@ -101,8 +101,8 @@ } json_parser_data_t; -static void -dissect_json(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_json(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { proto_tree *json_tree = NULL; proto_item *ti = NULL; @@ -114,16 +114,22 @@ int offset; data_name = pinfo->match_string; - if (!(data_name && data_name[0])) { + if (! (data_name && data_name[0])) { /* * No information from "match_string" */ - data_name = (char *)(pinfo->private_data); - if (!(data_name && data_name[0])) { + data_name = (char *)data; + if (! (data_name && data_name[0])) { /* - * No information from "private_data" + * No information from dissector data */ - data_name = NULL; + data_name = (char *)(pinfo->private_data); + if (! (data_name && data_name[0])) { + /* + * No information from "private_data" + */ + data_name = NULL; + } } } @@ -164,6 +170,8 @@ } else if (data_name) { col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "(%s)", data_name); } + + return tvb_length(tvb); } static void before_object(void *tvbparse_data, const void *wanted_data _U_, tvbparse_elem_t *tok) { @@ -578,7 +586,7 @@ proto_register_fields(proto_json, hfi, array_length(hfi)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("json", dissect_json, proto_json); + new_register_dissector("json", dissect_json, proto_json); init_json_parser(); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-k12.c wireshark-1.12.0~201311020920/epan/dissectors/packet-k12.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-k12.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-k12.c 2013-11-02 02:12:36.000000000 +0000 @@ -310,7 +310,7 @@ gchar** protos; guint num_protos, i; - protos = ep_strsplit(h->protos,":",0); + protos = g_strsplit(h->protos,":",0); for (num_protos = 0; protos[num_protos]; num_protos++) g_strstrip(protos[num_protos]); @@ -321,11 +321,13 @@ for (i = 0; i < num_protos; i++) { if ( ! (h->handles[i] = find_dissector(protos[i])) ) { h->handles[i] = data_handle; - *err = ep_strdup_printf("Could not find dissector for: '%s'",protos[i]); + g_strfreev(protos); + *err = g_strdup_printf("Could not find dissector for: '%s'",protos[i]); return; } } + g_strfreev(protos); *err = NULL; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-kafka.c wireshark-1.12.0~201311020920/epan/dissectors/packet-kafka.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-kafka.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-kafka.c 2013-11-02 02:12:36.000000000 +0000 @@ -70,6 +70,9 @@ static int hf_kafka_broker_nodeid = -1; static int hf_kafka_broker_host = -1; static int hf_kafka_broker_port = -1; +static int hf_kafka_min_bytes = -1; +static int hf_kafka_max_bytes = -1; +static int hf_kafka_max_wait_time = -1; static gint ett_kafka = -1; static gint ett_kafka_message = -1; @@ -264,8 +267,14 @@ if (raw) { payload = tvb_child_uncompress(tvb, raw, 0, tvb_length(raw)); - add_new_data_source(pinfo, payload, "Uncompressed Message"); - proto_tree_add_item(subtree, hf_kafka_message_value, payload, 0, -1, ENC_NA); + if (payload) { + add_new_data_source(pinfo, payload, "Uncompressed Message"); + proto_tree_add_item(subtree, hf_kafka_message_value, payload, 0, -1, ENC_NA); + } else { + /* TODO make this an expert item */ + proto_tree_add_text(subtree, tvb, 0, tvb_length(raw), "[Failed to decompress message!]"); + proto_tree_add_item(subtree, hf_kafka_message_value, raw, 0, -1, ENC_NA); + } offset += tvb_length(raw); } else { @@ -291,6 +300,10 @@ proto_tree *subtree; int offset = start_offset; + if (tvb_reported_length_remaining(tvb, offset) <= 0) { + return offset; + } + ti = proto_tree_add_text(tree, tvb, offset, -1, "Message Set"); subtree = proto_item_add_subtree(ti, ett_kafka_message_set); @@ -548,6 +561,119 @@ return offset; } +/* FETCH REQUEST */ + +static int +dissect_kafka_fetch_request_partition(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +{ + proto_item *ti; + proto_tree *subtree; + + ti = proto_tree_add_text(tree, tvb, offset, 16, "Fetch Request Partition"); + subtree = proto_item_add_subtree(ti, ett_kafka_request_partition); + + proto_tree_add_item(subtree, hf_kafka_partition_id, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + proto_tree_add_item(subtree, hf_kafka_offset, tvb, offset, 8, ENC_BIG_ENDIAN); + offset += 8; + + proto_tree_add_item(subtree, hf_kafka_max_bytes, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + return offset; +} + +static int +dissect_kafka_fetch_request_topic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int start_offset) +{ + proto_item *ti; + proto_tree *subtree; + int offset = start_offset; + + ti = proto_tree_add_text(tree, tvb, offset, -1, "Fetch Request Topic"); + subtree = proto_item_add_subtree(ti, ett_kafka_request_topic); + + offset = dissect_kafka_string(subtree, hf_kafka_topic_name, tvb, pinfo, offset); + offset = dissect_kafka_array(subtree, tvb, pinfo, offset, &dissect_kafka_fetch_request_partition); + + proto_item_set_len(ti, offset - start_offset); + + return offset; +} + +static int +dissect_kafka_fetch_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) +{ + proto_tree_add_item(tree, hf_kafka_replica, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + proto_tree_add_item(tree, hf_kafka_max_wait_time, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + proto_tree_add_item(tree, hf_kafka_min_bytes, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + offset = dissect_kafka_array(tree, tvb, pinfo, offset, &dissect_kafka_fetch_request_topic); + + return offset; +} + +/* FETCH RESPONSE */ + +static int +dissect_kafka_fetch_response_partition(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int start_offset) +{ + proto_item *ti; + proto_tree *subtree; + int offset = start_offset; + + ti = proto_tree_add_text(tree, tvb, offset, -1, "Fetch Response Partition"); + subtree = proto_item_add_subtree(ti, ett_kafka_response_partition); + + proto_tree_add_item(subtree, hf_kafka_partition_id, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + proto_tree_add_item(subtree, hf_kafka_error, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + + proto_tree_add_item(subtree, hf_kafka_offset, tvb, offset, 8, ENC_BIG_ENDIAN); + offset += 8; + + proto_tree_add_item(subtree, hf_kafka_message_set_size, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + offset = dissect_kafka_message_set(tvb, pinfo, subtree, offset); + + proto_item_set_len(ti, offset - start_offset); + + return offset; +} + +static int +dissect_kafka_fetch_response_topic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int start_offset) +{ + proto_item *ti; + proto_tree *subtree; + int offset = start_offset; + + ti = proto_tree_add_text(tree, tvb, offset, -1, "Fetch Response Topic"); + subtree = proto_item_add_subtree(ti, ett_kafka_response_topic); + + offset = dissect_kafka_string(subtree, hf_kafka_topic_name, tvb, pinfo, offset); + offset = dissect_kafka_array(subtree, tvb, pinfo, offset, &dissect_kafka_fetch_response_partition); + + proto_item_set_len(ti, offset - start_offset); + + return offset; +} + +static int +dissect_kafka_fetch_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) +{ + return dissect_kafka_array(tree, tvb, pinfo, offset, &dissect_kafka_fetch_response_topic); +} + /* PRODUCE REQUEST */ static int @@ -741,6 +867,9 @@ case KAFKA_METADATA: /*offset =*/ dissect_kafka_metadata_request(tvb, pinfo, kafka_tree, offset); break; + case KAFKA_FETCH: + /*offset =*/ dissect_kafka_fetch_request(tvb, pinfo, kafka_tree, offset); + break; } } else { @@ -786,6 +915,9 @@ case KAFKA_METADATA: /*offset =*/ dissect_kafka_metadata_response(tvb, pinfo, kafka_tree, offset); break; + case KAFKA_FETCH: + /*offset =*/ dissect_kafka_fetch_response(tvb, pinfo, kafka_tree, offset); + break; } } @@ -915,7 +1047,7 @@ }, { &hf_kafka_message_crc, { "CRC32", "kafka.message_crc", - FT_BYTES, BASE_NONE, 0, 0, + FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL } }, { &hf_kafka_message_magic, @@ -963,6 +1095,28 @@ FT_INT32, BASE_DEC, 0, 0, NULL, HFILL } }, + { &hf_kafka_min_bytes, + { "Min Bytes", "kafka.min_bytes", + FT_INT32, BASE_DEC, 0, 0, + "The minimum number of bytes of messages that must be available" + " to give a response.", + HFILL } + }, + { &hf_kafka_max_bytes, + { "Max Bytes", "kafka.max_bytes", + FT_INT32, BASE_DEC, 0, 0, + "The maximum bytes to include in the message set for this" + " partition. This helps bound the size of the response.", + HFILL } + }, + { &hf_kafka_max_wait_time, + { "Max Wait Time", "kafka.max_wait_time", + FT_INT32, BASE_DEC, 0, 0, + "The maximum amount of time in milliseconds to block waiting if" + " insufficient data is available at the time the request is" + " issued.", + HFILL } + }, { &hf_kafka_response_frame, { "Response Frame", "kafka.reponse_frame", FT_FRAMENUM, BASE_NONE, 0, 0, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-kdsp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-kdsp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-kdsp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-kdsp.c 2013-11-02 02:12:36.000000000 +0000 @@ -262,8 +262,8 @@ { guint32 offset = 0; guint32 command, length, numChan, bitmap, cptbitmap; - guint32 i, datalink_type, payload_len; - guint16 type, reported_payload_len, data_hdr_len, data_hdr_len_check; + guint32 i, datalink_type=0, payload_len; + guint16 type, reported_payload_len=0, data_hdr_len, data_hdr_len_check; proto_item *kdsp_item, *sub_item, *subsub_item, *data_len_item, *command_item; proto_tree *kdsp_tree, *sub_tree, *subsub_tree; tvbuff_t *payload_tvb; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-kink.c wireshark-1.12.0~201311020920/epan/dissectors/packet-kink.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-kink.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-kink.c 2013-11-02 02:12:36.000000000 +0000 @@ -211,7 +211,7 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "KINK"); /* It shows kink type by the type value. */ - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, kink_type_vals, "unknown")); + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, kink_type_vals, "unknown")); /* Make the kink tree */ ti = proto_tree_add_item(tree, proto_kink, tvb, offset, -1, ENC_NA); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-knet.c wireshark-1.12.0~201311020920/epan/dissectors/packet-knet.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-knet.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-knet.c 2013-11-02 02:12:36.000000000 +0000 @@ -54,6 +54,8 @@ #define CONNECTACK 251 /*!< Message ID definition: Connect Acknowledge */ /**@}*/ +#define UDP_DATAGRAM_RELIABLE_FLAG 0x40 +#define UDP_MSG_BLOCK_RELIABLE_FLAG 0x10 void proto_reg_handoff_knet(void); /* Forward declaration for use in preferences registration */ @@ -73,9 +75,10 @@ /* Fields used by the TCP/SCTP dissector */ static int hf_knet_message_tree = -1; /*!< Message tree */ -static int hf_knet_content_length = -1; /*!< Content Length */ +static int hf_knet_content_length_vle = -1; /*!< Content Length */ /* Fields used by the UDP dissector */ +static int hf_knet_content_length = -1; /*!< Content Length */ static int hf_knet_datagram_tree = -1; /*!< Datagram subtree */ static int hf_knet_flags = -1; /*!< UDP Flags subtree */ static int hf_knet_inorder = -1; /*!< Inorder Flag */ @@ -116,10 +119,6 @@ static dissector_handle_t knet_handle_tcp; static dissector_handle_t knet_handle_udp; -/* Few Utility Variables */ -static int messageindex = 0; /*!< Index of the kNet message inside a datagram */ -static int current_protocol = 0; /*!< Protocol currently dissected */ - /* Ports used by the dissectors */ static guint32 knet_sctp_port = PORT; /*!< Port used by kNet SCTP */ static guint32 knet_tcp_port = PORT; /*!< Port used by kNet TCP */ @@ -149,13 +148,11 @@ static int count_vle_bytes(tvbuff_t *tvb, int offset) { - int byte_count; - - byte_count = 1; + int byte_count = 1; - if((tvb_get_bits8(tvb, (offset) * 8, 8) & 128) > 0) /* If the first bit of the first byte is 1 */ + if(tvb_get_guint8(tvb, offset) & 0x80) /* If the first bit of the first byte is 1 */ byte_count = 2; /* There's at least 2 bytes of content length */ - if((tvb_get_bits8(tvb, (offset) * 8 + 8, 8) & 128) > 0) /* If the next one is also 1 */ + if(tvb_get_guint8(tvb, offset+1) & 0x80) /* If the next one is also 1 */ byte_count = 4; return byte_count; @@ -177,17 +174,16 @@ * @return int returns the new offset * */ -static int +static guint32 dissect_packetid(tvbuff_t *buffer, int offset, proto_tree *tree) { guint32 packetid; - packetid = tvb_get_bits8(buffer, offset * 8 + 16, 8) << 14; - packetid += tvb_get_bits8(buffer, offset * 8 + 8, 8) << 6; - packetid += tvb_get_bits8(buffer, offset * 8, 8) & 63; - if(offset == 0 && tree != NULL) - proto_tree_add_uint(tree, hf_knet_packetid, buffer, 0, 3, packetid); + packetid = tvb_get_guint8(buffer, offset+2) << 14; + packetid += tvb_get_guint8(buffer, offset+1) << 6; + packetid += tvb_get_guint8(buffer, offset) & 63; + proto_tree_add_uint(tree, hf_knet_packetid, buffer, 0, 3, packetid); return packetid; } @@ -210,15 +206,12 @@ static int dissect_reliable_message_index_base(tvbuff_t *buffer, int offset, proto_tree *tree) { - int byte_count; + int byte_count = 2; - byte_count = 2; - - if((tvb_get_bits8(buffer, offset * 8 + 8, 8) & 128) > 0) + if(tvb_get_guint8(buffer, offset+1) & 0x80) byte_count = 4; - if(tree != NULL) - proto_tree_add_item(tree, hf_knet_rmib, buffer, offset, byte_count, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tree, hf_knet_rmib, buffer, offset, byte_count, ENC_LITTLE_ENDIAN); return byte_count; } @@ -251,25 +244,22 @@ switch(byte_count) /*We must calculate length by hand because we use the length later */ { case 4: - length = tvb_get_bits8(buffer, ((*offset) + 3) * 8, 8) <<23; - length += tvb_get_bits8(buffer, ((*offset) + 2) * 8, 8) <<15; + length = tvb_get_guint8(buffer, (*offset) + 3) << 23; + length += (tvb_get_guint8(buffer, (*offset) + 2) << 15); /* FALLTHRU */ case 2: - length +=(tvb_get_bits8(buffer, ((*offset) + 1) * 8, 8) & 127) <<7; + length += (tvb_get_guint8(buffer, (*offset) + 1) << 7); /* FALLTHRU */ case 1: - length +=(tvb_get_bits8(buffer, (*offset) * 8, 8) & 127); + length += (tvb_get_guint8(buffer, (*offset)) & 0x7F); break; default: REPORT_DISSECTOR_BUG("Error in Content Length calculation"); break; } - if(tree != NULL) - { - proto_tree_add_uint(tree, hf_knet_content_length, buffer, (*offset), byte_count, length); - (*offset) += byte_count; - } + proto_tree_add_uint(tree, hf_knet_content_length_vle, buffer, (*offset), byte_count, length); + (*offset) += byte_count; return length; } @@ -305,10 +295,10 @@ msgflags_ti = proto_tree_add_item(tree, hf_knet_msg_flags, buffer, offset + 1, 1, ENC_NA); msgflags_tree = proto_item_add_subtree(msgflags_ti, ett_knet_message_flags); - proto_tree_add_bits_item(msgflags_tree, hf_knet_msg_fs, buffer, offset * 8 + 8, 1, ENC_LITTLE_ENDIAN); /* Fragment start flag */ - proto_tree_add_bits_item(msgflags_tree, hf_knet_msg_ff, buffer, offset * 8 + 9, 1, ENC_LITTLE_ENDIAN); /* Fragment flag */ - proto_tree_add_bits_item(msgflags_tree, hf_knet_msg_inorder, buffer, offset * 8 + 10, 1, ENC_LITTLE_ENDIAN); /* Inorder flag */ - proto_tree_add_bits_item(msgflags_tree, hf_knet_msg_reliable, buffer, offset * 8 + 11, 1, ENC_LITTLE_ENDIAN); /* Reliable flag */ + proto_tree_add_item(msgflags_tree, hf_knet_msg_fs, buffer, offset+1, 1, ENC_NA); /* Fragment start flag */ + proto_tree_add_item(msgflags_tree, hf_knet_msg_ff, buffer, offset+1, 1, ENC_NA); /* Fragment flag */ + proto_tree_add_item(msgflags_tree, hf_knet_msg_inorder, buffer, offset+1, 1, ENC_NA); /* Inorder flag */ + proto_tree_add_item(msgflags_tree, hf_knet_msg_reliable, buffer, offset+1, 1, ENC_NA); /* Reliable flag */ proto_tree_add_uint(tree, hf_knet_content_length, buffer, offset, 2, length); } @@ -335,15 +325,12 @@ static int dissect_reliable_message_number(tvbuff_t *buffer, int offset, proto_tree *tree) { - int byte_count; - - byte_count = 1; + int byte_count = 1; - if((tvb_get_bits8(buffer, offset * 8, 8) & 128) > 0) + if(tvb_get_guint8(buffer, offset) & 0x80) byte_count = 2; - if(tree != NULL) - proto_tree_add_item(tree, hf_knet_msg_reliable_message_number, buffer, offset, byte_count, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tree, hf_knet_msg_reliable_message_number, buffer, offset, byte_count, ENC_LITTLE_ENDIAN); return byte_count; } @@ -364,12 +351,13 @@ * */ static int -dissect_messageid(tvbuff_t *buffer, int *offset, proto_tree *tree, packet_info *pinfo, wmem_strbuf_t* info_field) +dissect_messageid(tvbuff_t *buffer, int *offset, proto_tree *tree, packet_info *pinfo, gboolean separator) { gint messageid_length; guint8 messageid; + gboolean col_write; - messageid = tvb_get_bits8(buffer, (*offset) * 8, 8); + messageid = tvb_get_guint8(buffer, (*offset)); switch(messageid) { @@ -385,15 +373,27 @@ break; } - proto_tree_add_bytes_format_value(tree, hf_knet_messageid, buffer, *offset, messageid_length, NULL, - "%s (%d)", val_to_str_const(messageid, packettypenames, "AppData or Malformed Message ID"), messageid); + proto_tree_add_uint_format_value(tree, hf_knet_messageid, buffer, *offset, messageid_length, messageid, + "%s (%d)", val_to_str_const(messageid, packettypenames, "AppData or Malformed Message ID"), messageid); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(messageid, packettypenames, "AppData ")); + /* XXX - TCP reassembly disables writing columns which prevents populating COL_INFO if multiple KNET messages + appear in a single packet that needed to be reassembled. + Force making columns writable. + */ + if (separator) + { + col_write = col_get_writable(pinfo->cinfo); + col_set_writable(pinfo->cinfo, TRUE); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (%d)", val_to_str_const(messageid, packettypenames, "AppData"), messageid); + col_set_writable(pinfo->cinfo, col_write); + } + else + { + col_append_fstr(pinfo->cinfo, COL_INFO, "%s (%d)", val_to_str_const(messageid, packettypenames, "AppData"), messageid); + } *offset += messageid_length; - wmem_strbuf_append_printf(info_field, "Msg ID (%d) ", messageid); - return messageid; } @@ -444,10 +444,10 @@ case CONNECTSYN: /*TODO: Not yet implemented, implement when available*/ case CONNECTSYNACK: /*TODO: Not yet implemented, implement when available*/ case CONNECTACK: /*TODO: Not yet implemented, implement when available*/ - proto_tree_add_item(payload_tree, hf_knet_payload, buffer, offset, 0, ENC_NA); + proto_tree_add_item(payload_tree, hf_knet_payload, buffer, offset, content_length-1, ENC_NA); break; default: /* Application Specific Message */ - proto_tree_add_item(payload_tree, hf_knet_payload, buffer, offset, 0, ENC_NA); + proto_tree_add_item(payload_tree, hf_knet_payload, buffer, offset, content_length-1, ENC_NA); break; } @@ -466,41 +466,33 @@ * @param tree the parent tree where the dissected data is going to be inserted * */ -static void -dissect_knet_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, wmem_strbuf_t* info_field) +static int +dissect_knet_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int messageindex) { - int offset; - int content_length; - int total_length; - int messageid; + int content_length, total_length, messageid; + int start_offset = offset; proto_item *msgblock_ti; proto_tree *msgblock_tree; - offset = 0; - - total_length = dissect_content_length(tvb, offset, NULL) + 2; - - if(tvb_get_bits8(tvb, 11, 1) > 0) /* If reliable flag is 1 */ - total_length += dissect_reliable_message_number(tvb, offset + 2, NULL); /* We add the RMN into the length of the message */ - - msgblock_ti = proto_tree_add_item(tree, hf_knet_message_tree, tvb, offset, total_length, ENC_NA); + msgblock_ti = proto_tree_add_item(tree, hf_knet_message_tree, tvb, offset, -1, ENC_NA); msgblock_tree = proto_item_add_subtree(msgblock_ti, ett_knet_message); content_length = dissect_content_length(tvb, offset, msgblock_tree); /* Calculates the Content Length of this packet. */ - wmem_strbuf_append_printf(info_field, "%d: ", messageindex + 1); + if(tvb_get_guint8(tvb, offset+1) & UDP_MSG_BLOCK_RELIABLE_FLAG) /* If the reliable flag is 1 then calculate RMN */ + offset += dissect_reliable_message_number(tvb, offset+2, msgblock_tree); offset += 2; /* Move the offset the amount of contentlength and flags fields */ - if(tvb_get_bits8(tvb, 11, 1) > 0) /* If the reliable flag is 1 then calculate RMN */ - offset += dissect_reliable_message_number(tvb, offset, msgblock_tree); + total_length = (offset-start_offset)+content_length; + proto_item_set_len(msgblock_ti, total_length); - messageid = dissect_messageid(tvb, &offset, msgblock_tree, pinfo, info_field); + messageid = dissect_messageid(tvb, &offset, msgblock_tree, pinfo, messageindex != 0); dissect_payload(tvb, offset, messageid, msgblock_tree, content_length); - messageindex++; + return total_length; } /** @@ -518,136 +510,29 @@ * */ static void -dissect_knet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +dissect_knet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int current_protocol) { - /* Common subtrees */ - proto_item *knet_ti; - proto_tree *knet_tree; - - /* Subtrees used in kNet UDP dissector */ - proto_item *datagram_ti; - proto_tree *datagram_tree; /* Tree containing all header related info */ - proto_item *udpflags_ti; - proto_tree *udpflags_tree; /* Tree containing UDP Datagram Flags */ - - /* Subtrees used by SCTP and TCP dissectors */ - proto_item *message_ti; - proto_tree *message_tree; - - tvbuff_t *next_tvb; - gboolean bytes_left; - - /* String that is going to be displayed in the info column in Wireshark */ - wmem_strbuf_t *info_field = wmem_strbuf_new(wmem_packet_scope(), ""); - - int offset; - int length; - int content_length; - int messageid; - int packetid; /* Variable used by the UDP dissector. Contains info about PacketID */ - - offset = 0; - messageindex = 0; - bytes_left = TRUE; - - col_clear(pinfo->cinfo, COL_INFO); - col_add_str(pinfo->cinfo, COL_PROTOCOL, "KNET"); - - if((current_protocol == KNET_SCTP_PACKET) || (current_protocol == KNET_TCP_PACKET)) - { - /* Attach kNet main tree to Wireshark tree */ - knet_ti = proto_tree_add_item(tree, proto_knet, tvb, 0, -1, ENC_NA); - knet_tree = proto_item_add_subtree(knet_ti, ett_knet_main); - - next_tvb = tvb_new_subset_remaining(tvb, offset); /* Prepare the next tvb for the next message */ - - if((tvb_length_remaining(next_tvb, offset)) > 0) /* If there's at least 2 bytes available in the buffer */ - { - length = dissect_content_length_vle(next_tvb, &offset, NULL); /* Calculate the length so we can use it below */ - - /* Attach message tree to kNet tree */ - message_ti = proto_tree_add_item(knet_tree, hf_knet_message_tree, next_tvb, offset, - (current_protocol == KNET_SCTP_PACKET ? length + 1 : length + 2), ENC_NA); - - message_tree = proto_item_add_subtree(message_ti, ett_knet_message); - - content_length = dissect_content_length_vle(next_tvb, &offset, message_tree); /* Calculate length and add it to the tree-view */ - - if(tree == NULL) - offset += count_vle_bytes(next_tvb, offset); - - wmem_strbuf_append_printf(info_field, "%d: ", messageindex + 1); - - messageid = dissect_messageid(next_tvb, &offset, message_tree, pinfo, info_field); /* Calculate messageid and add it to the tree-view */ - - dissect_payload(next_tvb, offset, messageid, message_tree, content_length); /* Calculate payload and add it to the tree-view */ - - offset += content_length - 1; /* Move the offset the amount of the payload */ - } - } - else /* This is an UDP packet */ - { - /*kNet UDP Tree*/ - knet_ti = proto_tree_add_item(tree, proto_knet, tvb, 0, -1, ENC_NA); /* Attach kNet tree to wireshark main tree */ - knet_tree = proto_item_add_subtree(knet_ti, ett_knet_main); - - /*Datagram Header Tree*/ - datagram_ti = proto_tree_add_item(knet_ti, hf_knet_datagram_tree, tvb, 0, 3, ENC_NA); /* Attach Header tree to wireshark main tree */ - datagram_tree = proto_item_add_subtree(datagram_ti, ett_knet_datagram); - - /*UDPFlags Tree*/ - udpflags_ti = proto_tree_add_item(datagram_ti, hf_knet_flags, tvb, 0, 1, ENC_NA); /* Attach UDP Flags tree to kNet tree */ - udpflags_tree = proto_item_add_subtree(udpflags_ti, ett_knet_flags); + proto_item *knet_ti, *message_ti; + proto_tree *knet_tree, *message_tree; - proto_tree_add_bits_item(udpflags_tree, hf_knet_inorder, tvb, 0, 1, ENC_LITTLE_ENDIAN); /* Add inorder flag to UDP Flags tree */ - proto_tree_add_bits_item(udpflags_tree, hf_knet_reliable, tvb, 1, 1, ENC_LITTLE_ENDIAN); /* Add reliable flag to UDP Flags tree */ + int offset = 0, content_length, messageid; - packetid = dissect_packetid(tvb, 0, datagram_tree); /* Lets calculate our packetid! */ + /* Attach kNet main tree to Wireshark tree */ + knet_ti = proto_tree_add_item(tree, proto_knet, tvb, 0, -1, ENC_NA); + knet_tree = proto_item_add_subtree(knet_ti, ett_knet_main); - wmem_strbuf_append_printf(info_field, "Packet ID: %d ", packetid); + /* Attach message tree to kNet tree */ + message_ti = proto_tree_add_item(knet_tree, hf_knet_message_tree, tvb, offset, -1, ENC_NA); + message_tree = proto_item_add_subtree(message_ti, ett_knet_message); - offset += 3; + content_length = dissect_content_length_vle(tvb, &offset, message_tree); /* Calculate length and add it to the tree-view */ + proto_item_set_len(message_ti, (current_protocol == KNET_SCTP_PACKET ? content_length + 1 : content_length + 2)); - if(tvb_get_bits8(tvb, 1, 1) == 1) /* If Reliable flag is 1 */ - offset += dissect_reliable_message_index_base(tvb, 3, datagram_tree); /* Calculate RMIB */ + messageid = dissect_messageid(tvb, &offset, message_tree, pinfo, TRUE); /* Calculate messageid and add it to the tree-view */ - next_tvb = tvb_new_subset_remaining(tvb, offset); + dissect_payload(tvb, offset, messageid, message_tree, content_length); /* Calculate payload and add it to the tree-view */ - while(bytes_left) - { - offset = 0; - - if((tvb_length_remaining(next_tvb, offset)) > 2) /* If theres at least 2 bytes available in the buffer */ - { - length = dissect_content_length(next_tvb, offset, NULL); /* Lets calculate how much data the whole message contains including the Payload and the Message ID */ - - if(length == 0) /* Empty data Abort */ - { - break; - } - - else length += 2; /* 2 is the length of contentlength field + flags */ - - if(tvb_get_bits8(next_tvb, 11, 1) == 1) /* If reliable flag is 1 */ - length += dissect_reliable_message_number(next_tvb, offset + 2, NULL); /* We add the RMN into the length of the message */ - - dissect_knet_message(next_tvb, pinfo, knet_tree, info_field); /* Call the message subdissector */ - - offset += length; /* Move the offset the amount of the payload */ - - next_tvb = tvb_new_subset_remaining(next_tvb, offset); /* Prepare the next tvb for the next message */ - } - - else bytes_left = FALSE; /* We dont have any bytes left to process... Hopefully */ - } - } - - if(current_protocol == KNET_TCP_PACKET && ((struct tcpinfo*)(pinfo->private_data))->is_reassembled) - col_add_str(pinfo->cinfo, COL_INFO, "REASSEMBLED PACKET"); - else - col_add_fstr(pinfo->cinfo, COL_INFO, "Messages: %d %s", messageindex + 1, wmem_strbuf_get_str(info_field)); - - messageindex++; + col_set_fence(pinfo->cinfo, COL_INFO); } /** @@ -663,7 +548,7 @@ static guint get_knet_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { - return dissect_content_length_vle(tvb, &offset, NULL) + count_vle_bytes(tvb, offset); + return count_vle_bytes(tvb, offset) + dissect_content_length_vle(tvb, &offset, NULL); } /** @@ -676,11 +561,18 @@ * */ static void +dissect_knet_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_knet(tvb, pinfo, tree, KNET_TCP_PACKET); +} + +static void dissect_knet_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - current_protocol = KNET_TCP_PACKET; + col_clear(pinfo->cinfo, COL_INFO); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "KNET"); - tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 2, get_knet_pdu_len, dissect_knet); + tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 2, get_knet_pdu_len, dissect_knet_tcp_pdu); } /** @@ -695,9 +587,10 @@ static void dissect_knet_sctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - current_protocol = KNET_SCTP_PACKET; + col_clear(pinfo->cinfo, COL_INFO); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "KNET"); - dissect_knet(tvb, pinfo, tree); + dissect_knet(tvb, pinfo, tree, KNET_SCTP_PACKET); } /** @@ -712,9 +605,51 @@ static void dissect_knet_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - current_protocol = KNET_UDP_PACKET; + /* Common subtrees */ + proto_item *knet_ti; + proto_tree *knet_tree; - dissect_knet(tvb, pinfo, tree); + /* Subtrees used in kNet UDP dissector */ + proto_item *datagram_ti, *udpflags_ti; + proto_tree *datagram_tree, /* Tree containing all header related info */ + *udpflags_tree; /* Tree containing UDP Datagram Flags */ + + int offset = 0; + guint32 packetid; /* Contains info about PacketID */ + int messageindex = 0; /*!< Index of the kNet message inside a datagram */ + + col_clear(pinfo->cinfo, COL_INFO); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "KNET"); + + /*kNet UDP Tree*/ + knet_ti = proto_tree_add_item(tree, proto_knet, tvb, 0, -1, ENC_NA); /* Attach kNet tree to wireshark main tree */ + knet_tree = proto_item_add_subtree(knet_ti, ett_knet_main); + + /*Datagram Header Tree*/ + datagram_ti = proto_tree_add_item(knet_ti, hf_knet_datagram_tree, tvb, 0, 3, ENC_NA); /* Attach Header tree to wireshark main tree */ + datagram_tree = proto_item_add_subtree(datagram_ti, ett_knet_datagram); + + packetid = dissect_packetid(tvb, 0, datagram_tree); /* Lets calculate our packetid! */ + col_add_fstr(pinfo->cinfo, COL_INFO, "Packet ID %d: ", packetid); + + /*UDPFlags Tree*/ + udpflags_ti = proto_tree_add_item(datagram_ti, hf_knet_flags, tvb, 0, 1, ENC_NA); /* Attach UDP Flags tree to kNet tree */ + udpflags_tree = proto_item_add_subtree(udpflags_ti, ett_knet_flags); + + proto_tree_add_item(udpflags_tree, hf_knet_inorder, tvb, 0, 1, ENC_NA); /* Add inorder flag to UDP Flags tree */ + proto_tree_add_item(udpflags_tree, hf_knet_reliable, tvb, 0, 1, ENC_NA); /* Add reliable flag to UDP Flags tree */ + + offset += 3; + + if(tvb_get_guint8(tvb, 0) & UDP_DATAGRAM_RELIABLE_FLAG) + offset += dissect_reliable_message_index_base(tvb, 3, datagram_tree); /* Calculate RMIB */ + + while ((tvb_length_remaining(tvb, offset) > 2) && /* If theres at least 2 bytes available in the buffer */ + (dissect_content_length(tvb, offset, NULL) > 0)) /* Empty data Abort */ + { + offset += dissect_knet_message(tvb, pinfo, knet_tree, offset, messageindex); /* Call the message subdissector */ + messageindex++; + } } /** * proto_register_knet registers our kNet protocol, @@ -729,7 +664,7 @@ static hf_register_info hf_knet[] = { /* TCP & SCTP Header */ - {&hf_knet_content_length, + {&hf_knet_content_length_vle, {"Content Length", "knet.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, {&hf_knet_message_tree, @@ -745,10 +680,10 @@ FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_knet_inorder, {"Inorder Flag", "knet.datagram.inorder", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_knet_reliable, {"Reliable Flag", "knet.datagram.reliable", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + FT_BOOLEAN, 8, NULL, UDP_DATAGRAM_RELIABLE_FLAG, NULL, HFILL}}, {&hf_knet_packetid, {"Packet ID", "knet.datagram.packetid", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}}, @@ -760,16 +695,19 @@ FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_knet_msg_fs, {"Fragment Start", "knet.msg.flags.fs", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_knet_msg_ff, {"Fragment Flag", "knet.msg.flags.ff", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, {&hf_knet_msg_inorder, {"Inorder Flag", "knet.msg.flags.inorder", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, {&hf_knet_msg_reliable, {"Reliable Flag", "knet.msg.flags.reliable", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + FT_BOOLEAN, 8, NULL, UDP_MSG_BLOCK_RELIABLE_FLAG, NULL, HFILL}}, + {&hf_knet_content_length, + {"Content Length", "knet.length", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, {&hf_knet_msg_reliable_message_number, {"Reliable Message Number", "knet.msg.reliable_number", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}}, @@ -783,7 +721,7 @@ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_knet_messageid, {"Message ID", "knet.payload.messageid", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + FT_UINT32, BASE_DEC, VALS(packettypenames), 0x0, NULL, HFILL}}, {&hf_knet_pingid, {"Ping ID", "knet.payload.pingid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-kpasswd.c wireshark-1.12.0~201311020920/epan/dissectors/packet-kpasswd.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-kpasswd.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-kpasswd.c 2013-11-02 02:12:36.000000000 +0000 @@ -232,7 +232,7 @@ proto_tree_add_uint(kpasswd_tree, hf_kpasswd_message_len, tvb, offset, 2, message_len); proto_tree_add_uint(kpasswd_tree, hf_kpasswd_version, tvb, offset+2, 2, version); - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(version, vers_vals, "Unknown command")); + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(version, vers_vals, "Unknown command")); proto_tree_add_uint(kpasswd_tree, hf_kpasswd_ap_req_len, tvb, offset+4, 2, ap_req_len); offset+=6; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-l2tp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-l2tp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-l2tp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-l2tp.c 2013-11-02 02:12:36.000000000 +0000 @@ -332,6 +332,7 @@ { MESSAGE_TYPE_SCCRP, "Start_Control_Reply" }, { MESSAGE_TYPE_SCCCN, "Start_Control_Connected" }, { MESSAGE_TYPE_StopCCN, "Stop_Control_Notification" }, + { MESSAGE_TYPE_Reserved_5, "Reserved" }, { MESSAGE_TYPE_HELLO, "Hello" }, { MESSAGE_TYPE_OCRQ, "Outgoing_Call_Request" }, { MESSAGE_TYPE_OCRP, "Outgoing_Call_Reply" }, @@ -339,6 +340,7 @@ { MESSAGE_TYPE_ICRQ, "Incoming_Call_Request" }, { MESSAGE_TYPE_ICRP, "Incoming_Call_Reply" }, { MESSAGE_TYPE_ICCN, "Incoming_Call_Connected" }, + { MESSAGE_TYPE_Reserved_13, "Reserved" }, { MESSAGE_TYPE_CDN, "Call_Disconnect_Notification" }, { MESSAGE_TYPE_WEN, "WAN_Error_Notify" }, { MESSAGE_TYPE_SLI, "Set_Link_Info" }, @@ -357,6 +359,7 @@ { MESSAGE_TYPE_MSEN, "Multicast-Session-End-Notify" }, { 0, NULL }, }; +static value_string_ext message_type_vals_ext = VALUE_STRING_EXT_INIT(message_type_vals); static const value_string l2tp_message_type_short_str_vals[] = { { MESSAGE_TYPE_SCCRQ, "SCCRQ" }, @@ -390,6 +393,7 @@ { MESSAGE_TYPE_MSEN, "MSEN" }, { 0, NULL }, }; +static value_string_ext l2tp_message_type_short_str_vals_ext = VALUE_STRING_EXT_INIT(l2tp_message_type_short_str_vals); static const char *control_msg = "Control Message"; @@ -497,6 +501,8 @@ { 31, "Sequencing not supported", }, /* [RFC6073] */ { 0, NULL } }; +static value_string_ext result_code_cdn_vals_ext = VALUE_STRING_EXT_INIT(result_code_cdn_vals); + static const value_string error_code_vals[] = { { 0, "No General Error", }, @@ -573,6 +579,7 @@ #define TX_CONNECT_SPEED_V3 74 #define RX_CONNECT_SPEED_V3 75 +/* http://www.iana.org/assignments/l2tp-parameters/l2tp-parameters.xhtml */ #define NUM_AVP_TYPES 102 static const value_string avp_type_vals[] = { { CONTROL_MESSAGE, "Control Message" }, @@ -595,6 +602,7 @@ { MAXIMUM_BPS, "Maximum BPS" }, { BEARER_TYPE, "Bearer Type" }, { FRAMING_TYPE, "Framing Type" }, + { 20, "Reserved" }, { CALLED_NUMBER, "Called Number" }, { CALLING_NUMBER, "Calling Number" }, { SUB_ADDRESS, "Sub-Address" }, @@ -662,6 +670,8 @@ { 0, NULL } }; +static value_string_ext avp_type_vals_ext = VALUE_STRING_EXT_INIT(avp_type_vals); + #define CISCO_ASSIGNED_CONNECTION_ID 1 #define CISCO_PW_CAPABILITY_LIST 2 #define CISCO_LOCAL_SESSION_ID 3 @@ -1566,7 +1576,7 @@ /* IETF AVP:s */ tf = proto_tree_add_text(l2tp_tree, tvb, idx, avp_len, "%s AVP", - val_to_str(avp_type, avp_type_vals, "Unknown (%u)")); + val_to_str_ext(avp_type, &avp_type_vals_ext, "Unknown (%u)")); l2tp_avp_tree = proto_item_add_subtree(tf, ett_l2tp_avp); @@ -2345,7 +2355,7 @@ col_add_fstr(pinfo->cinfo, COL_INFO, "%s - %s (tunnel id=%u)", control_msg , - val_to_str(msg_type, l2tp_message_type_short_str_vals, "Unknown (%u)"), + val_to_str_ext(msg_type, &l2tp_message_type_short_str_vals_ext, "Unknown (%u)"), ccid); } else { @@ -2567,7 +2577,7 @@ col_add_fstr(pinfo->cinfo, COL_INFO, "%s - %s (tunnel id=%u, session id=%u)", control_msg, - val_to_str(msg_type, l2tp_message_type_short_str_vals, "Unknown (%u)"), + val_to_str_ext(msg_type, &l2tp_message_type_short_str_vals_ext, "Unknown (%u)"), tid, cid); } else @@ -2811,8 +2821,8 @@ "AVP Vendor ID", HFILL }}, { &hf_l2tp_avp_type, - { "Type", "l2tp.avp.type", FT_UINT16, BASE_DEC, VALS(avp_type_vals), 0, - "AVP Type", HFILL }}, + { "AVP Type", "l2tp.avp.type", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &avp_type_vals_ext, 0, + NULL, HFILL }}, { &hf_l2tp_tie_breaker, { "Tie Breaker", "l2tp.tie_breaker", FT_UINT64, BASE_HEX, NULL, 0, @@ -2887,7 +2897,7 @@ "AVP Type", HFILL }}, { &hf_l2tp_avp_message_type, - { "Message Type", "l2tp.avp.message_type", FT_UINT16, BASE_DEC, VALS(message_type_vals), 0, + { "Message Type", "l2tp.avp.message_type", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &message_type_vals_ext, 0, NULL, HFILL }}, { &hf_l2tp_avp_assigned_tunnel_id, @@ -2961,7 +2971,7 @@ { &hf_l2tp_cisco_nonce, { "Nonce", "l2tp.cisco.nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_l2tp_cisco_interface_mtu, { "Interface MTU", "l2tp.cisco.interface_mtu", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_l2tp_stop_ccn_result_code, { "Result code", "l2tp.result_code", FT_UINT16, BASE_DEC, VALS(result_code_stopccn_vals), 0x0, NULL, HFILL }}, - { &hf_l2tp_result_code, { "Result code", "l2tp.result_code", FT_UINT16, BASE_DEC, VALS(result_code_cdn_vals), 0x0, NULL, HFILL }}, + { &hf_l2tp_result_code, { "Result code", "l2tp.result_code", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &result_code_cdn_vals_ext, 0x0, NULL, HFILL }}, { &hf_l2tp_avp_error_code, { "Error code", "l2tp.avp.error_code", FT_UINT16, BASE_DEC, VALS(error_code_vals), 0x0, NULL, HFILL }}, { &hf_l2tp_avp_error_message, { "Error Message", "l2tp.avp.error_message", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_l2tp_avp_protocol_version, { "Version", "l2tp.avp.protocol_version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-lapd.c wireshark-1.12.0~201311020920/epan/dissectors/packet-lapd.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-lapd.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-lapd.c 2013-11-02 02:12:36.000000000 +0000 @@ -565,7 +565,7 @@ next_tvb = tvb_new_subset_remaining(tvb, lapd_header_len); /* Dissection done, append " | " to COL_INFO */ - col_append_fstr(pinfo->cinfo, COL_INFO, " | "); + col_append_str(pinfo->cinfo, COL_INFO, " | "); col_set_fence(pinfo->cinfo, COL_INFO); if (XDLC_IS_INFORMATION(control)) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ldap.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ldap.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ldap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ldap.c 2013-11-02 02:12:36.000000000 +0000 @@ -627,13 +627,13 @@ char c; if (rec->attribute_type == NULL) { - *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty"); + *err = g_strdup("Attribute type can't be empty"); return; } g_strstrip(rec->attribute_type); if (rec->attribute_type[0] == 0) { - *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty"); + *err = g_strdup("Attribute type can't be empty"); return; } @@ -642,7 +642,7 @@ */ c = proto_check_field_name(rec->attribute_type); if (c) { - *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't contain '%c'", c); + *err = g_strdup_printf("Attribute type can't contain '%c'", c); return; } @@ -2915,7 +2915,7 @@ #line 753 "../../asn1/ldap/ldap.cnf" if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) { - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); } else { offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); @@ -3074,7 +3074,7 @@ proto_item_append_text(ldm_tree, " (%s)", name); } if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) { - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); } else { offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); @@ -3258,7 +3258,7 @@ offset=dissect_ber_identifier(actx->pinfo, NULL, tvb, offset, &ber_class, &pc, &tag); offset=dissect_ber_length(actx->pinfo, NULL, tvb, offset, &len, &ind); - call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); offset += len; } else { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ldss.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ldss.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ldss.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ldss.c 2013-11-02 02:12:36.000000000 +0000 @@ -206,7 +206,8 @@ static int ett_ldss_transfer = -1; static int ett_ldss_transfer_req = -1; -static dissector_handle_t ldss_handle; +static dissector_handle_t ldss_udp_handle; +static dissector_handle_t ldss_tcp_handle; /* Global variables associated with the preferences for ldss */ static guint global_udp_port_ldss = UDP_PORT_LDSS; @@ -230,7 +231,7 @@ transfer_conv = conversation_new (broadcast->num, &broadcast->broadcaster->addr, &broadcast->broadcaster->addr, PT_TCP, broadcast->broadcaster->port, broadcast->broadcaster->port, NO_ADDR2|NO_PORT2); conversation_add_proto_data(transfer_conv, proto_ldss, transfer_info); - conversation_set_dissector(transfer_conv, ldss_handle); + conversation_set_dissector(transfer_conv, ldss_tcp_handle); } /* Broadcasts are searches, offers or promises. @@ -454,22 +455,23 @@ * file the implementation sends searches for is on a different TCP port * on the searcher's machine. */ static int -dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { conversation_t *transfer_conv; ldss_transfer_info_t *transfer_info; - struct tcpinfo *transfer_tcpinfo; + struct tcpinfo *transfer_tcpinfo = (struct tcpinfo *)data; proto_tree *ti, *line_tree = NULL, *ldss_tree = NULL; nstime_t broadcast_response_time; + col_set_str(pinfo->cinfo, COL_PROTOCOL, "LDSS"); + /* Look for the transfer conversation; this was created during * earlier broadcast dissection (see prepate_ldss_transfer_conv) */ transfer_conv = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_TCP, pinfo->srcport, pinfo->destport, 0); transfer_info = (ldss_transfer_info_t *)conversation_get_proto_data(transfer_conv, proto_ldss); - transfer_tcpinfo = (struct tcpinfo *)pinfo->private_data; /* For a pull, the first packet in the TCP connection is the file request. * First packet is identified by relative seq/ack numbers of 1. @@ -802,21 +804,14 @@ static int dissect_ldss (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - if (is_broadcast(&pinfo->dl_dst) && - pinfo->ipproto == IP_PROTO_UDP) { + if (is_broadcast(&pinfo->dl_dst)) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "LDSS"); return dissect_ldss_broadcast(tvb, pinfo, tree); } - else if (pinfo->ipproto == IP_PROTO_TCP) { - col_set_str(pinfo->cinfo, COL_PROTOCOL, "LDSS"); - return dissect_ldss_transfer(tvb, pinfo, tree); - } - else { - /* Definitely not LDSS */ - return 0; - } + /* Definitely not LDSS */ + return 0; } /* Initialize the highest num seen each time a @@ -979,13 +974,11 @@ module_t *ldss_module; - proto_ldss = proto_register_protocol( "Local Download Sharing Service", - "LDSS", "ldss"); + proto_ldss = proto_register_protocol("Local Download Sharing Service", "LDSS", "ldss"); proto_register_field_array(proto_ldss, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - ldss_module = prefs_register_protocol( proto_ldss, - proto_reg_handoff_ldss); + ldss_module = prefs_register_protocol( proto_ldss, proto_reg_handoff_ldss); prefs_register_uint_preference( ldss_module, "udp_port", "LDSS UDP Port", "The UDP port on which " @@ -1005,12 +998,13 @@ static gboolean ldss_initialized = FALSE; if (!ldss_initialized) { - ldss_handle = new_create_dissector_handle(dissect_ldss, proto_ldss); + ldss_udp_handle = new_create_dissector_handle(dissect_ldss, proto_ldss); + ldss_tcp_handle = new_create_dissector_handle(dissect_ldss_transfer, proto_ldss); ldss_initialized = TRUE; } else { - dissector_delete_uint("udp.port", saved_udp_port_ldss, ldss_handle); + dissector_delete_uint("udp.port", saved_udp_port_ldss, ldss_udp_handle); } - dissector_add_uint("udp.port", global_udp_port_ldss, ldss_handle); + dissector_add_uint("udp.port", global_udp_port_ldss, ldss_udp_handle); saved_udp_port_ldss = global_udp_port_ldss; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-lte-rrc.c wireshark-1.12.0~201311020920/epan/dissectors/packet-lte-rrc.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-lte-rrc.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-lte-rrc.c 2013-11-02 02:12:36.000000000 +0000 @@ -51,6 +51,7 @@ #include "packet-cell_broadcast.h" #include "packet-mac-lte.h" #include "packet-rlc-lte.h" +#include "packet-pdcp-lte.h" #define PNAME "LTE Radio Resource Control (RRC) protocol" #define PSNAME "LTE RRC" @@ -71,6 +72,7 @@ extern int proto_mac_lte; +extern int proto_pdcp_lte; /* Include constants */ @@ -171,7 +173,7 @@ } RAT_Type_enum; /*--- End of included file: packet-lte-rrc-val.h ---*/ -#line 70 "../../asn1/lte-rrc/packet-lte-rrc-template.c" +#line 72 "../../asn1/lte-rrc/packet-lte-rrc-template.c" /* Initialize the protocol and registered fields */ static int proto_lte_rrc = -1; @@ -2310,7 +2312,7 @@ static int hf_lte_rrc_dummy_eag_field = -1; /* never registered */ /*--- End of included file: packet-lte-rrc-hf.c ---*/ -#line 75 "../../asn1/lte-rrc/packet-lte-rrc-template.c" +#line 77 "../../asn1/lte-rrc/packet-lte-rrc-template.c" static int hf_lte_rrc_eutra_cap_feat_group_ind_1 = -1; static int hf_lte_rrc_eutra_cap_feat_group_ind_2 = -1; @@ -3508,7 +3510,7 @@ static gint ett_lte_rrc_CandidateCellInfo_r10 = -1; /*--- End of included file: packet-lte-rrc-ett.c ---*/ -#line 185 "../../asn1/lte-rrc/packet-lte-rrc-template.c" +#line 187 "../../asn1/lte-rrc/packet-lte-rrc-template.c" static gint ett_lte_rrc_featureGroupIndicators = -1; static gint ett_lte_rrc_featureGroupIndRel9Add = -1; @@ -5131,6 +5133,7 @@ guint16 message_identifier; drb_mapping_t drb_mapping; drx_config_t drx_config; + pdcp_security_info_t pdcp_security; } lte_rrc_private_data_t; /* Helper function to get or create a struct that will be actx->private_data */ @@ -5231,6 +5234,16 @@ lte_rrc_private_data_t *private_data = (lte_rrc_private_data_t*)lte_rrc_get_private_data(actx); private_data->ra_preambles = ra_preambles; } + + +/* PDCP Security info */ +static pdcp_security_info_t* private_data_pdcp_security_algorithms(asn1_ctx_t *actx) +{ + lte_rrc_private_data_t *private_data = (lte_rrc_private_data_t*)lte_rrc_get_private_data(actx); + return &private_data->pdcp_security; +} + + /*****************************************************************************/ @@ -18772,6 +18785,8 @@ ett_lte_rrc_RRCConnectionSetup, RRCConnectionSetup_sequence); + + return offset; } @@ -22197,8 +22212,14 @@ static int dissect_lte_rrc_T_cipheringAlgorithm(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + guint32 value; + pdcp_security_info_t *p_security_algorithms; offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, - 8, NULL, TRUE, 0, NULL); + 8, &value, TRUE, 0, NULL); + + p_security_algorithms = private_data_pdcp_security_algorithms(actx); + p_security_algorithms->ciphering = (enum security_ciphering_algorithm_e)value; + return offset; } @@ -22219,8 +22240,13 @@ static int dissect_lte_rrc_T_integrityProtAlgorithm(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + guint32 value; + pdcp_security_info_t *p_security_algorithms; offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, - 8, NULL, TRUE, 0, NULL); + 8, &value, TRUE, 0, NULL); + + p_security_algorithms = private_data_pdcp_security_algorithms(actx); + p_security_algorithms->integrity = (enum security_integrity_algorithm_e)value; return offset; } @@ -22234,9 +22260,21 @@ static int dissect_lte_rrc_SecurityAlgorithmConfig(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + pdcp_lte_info *p_pdcp_lte_info; + pdcp_security_info_t *p_security_algorithms; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_lte_rrc_SecurityAlgorithmConfig, SecurityAlgorithmConfig_sequence); + p_security_algorithms = private_data_pdcp_security_algorithms(actx); + p_security_algorithms->configuration_frame = actx->pinfo->fd->num; + /* Look for UE identifier */ + p_pdcp_lte_info = (pdcp_lte_info *)p_get_proto_data(actx->pinfo->fd, proto_pdcp_lte, 0); + if (p_pdcp_lte_info != NULL) { + /* Configure algorithms */ + set_pdcp_lte_security_algorithms(p_pdcp_lte_info->ueid, p_security_algorithms); + } + + return offset; } @@ -34697,7 +34735,7 @@ /*--- End of included file: packet-lte-rrc-fn.c ---*/ -#line 2176 "../../asn1/lte-rrc/packet-lte-rrc-template.c" +#line 2189 "../../asn1/lte-rrc/packet-lte-rrc-template.c" static void dissect_lte_rrc_DL_CCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -43361,7 +43399,7 @@ NULL, HFILL }}, /*--- End of included file: packet-lte-rrc-hfarr.c ---*/ -#line 2323 "../../asn1/lte-rrc/packet-lte-rrc-template.c" +#line 2336 "../../asn1/lte-rrc/packet-lte-rrc-template.c" { &hf_lte_rrc_eutra_cap_feat_group_ind_1, { "Indicator 1", "lte-rrc.eutra_cap_feat_group_ind_1", @@ -44872,7 +44910,7 @@ &ett_lte_rrc_CandidateCellInfo_r10, /*--- End of included file: packet-lte-rrc-ettarr.c ---*/ -#line 2746 "../../asn1/lte-rrc/packet-lte-rrc-template.c" +#line 2759 "../../asn1/lte-rrc/packet-lte-rrc-template.c" &ett_lte_rrc_featureGroupIndicators, &ett_lte_rrc_featureGroupIndRel9Add, @@ -44939,7 +44977,7 @@ /*--- End of included file: packet-lte-rrc-dis-reg.c ---*/ -#line 2797 "../../asn1/lte-rrc/packet-lte-rrc-template.c" +#line 2810 "../../asn1/lte-rrc/packet-lte-rrc-template.c" register_init_routine(<e_rrc_init_protocol); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ltp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ltp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ltp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ltp.c 2013-11-02 02:12:36.000000000 +0000 @@ -714,7 +714,7 @@ proto_tree_add_uint(ltp_header_tree,hf_ltp_trl_extn_cnt,tvb,frame_offset,1,trl_extn_cnt); frame_offset++; - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(ltp_type,ltp_type_col_info,"Protocol Error")); + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(ltp_type,ltp_type_col_info,"Protocol Error")); if((unsigned)frame_offset >= tvb_length(tvb)){ col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error"); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-lwres.c wireshark-1.12.0~201311020920/epan/dissectors/packet-lwres.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-lwres.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-lwres.c 2013-11-02 02:12:36.000000000 +0000 @@ -907,8 +907,6 @@ message_type = (flags & LWRES_LWPACKETFLAG_RESPONSE) ? 2 : 1; - col_clear(pinfo->cinfo, COL_INFO); - if(flags & LWRES_LWPACKETFLAG_RESPONSE) { col_add_fstr(pinfo->cinfo, COL_INFO, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-mac-lte.h wireshark-1.12.0~201311020920/epan/dissectors/packet-mac-lte.h --- wireshark-1.12.0~201310251247/epan/dissectors/packet-mac-lte.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-mac-lte.h 2013-11-02 02:12:36.000000000 +0000 @@ -154,7 +154,7 @@ } ul_info; struct mac_lte_dl_phy_info { - guint8 present; /* Remaining UL fields are present and should be displayed */ + guint8 present; /* Remaining DL fields are present and should be displayed */ guint8 dci_format; guint8 resource_allocation_type; guint8 aggregation_level; @@ -222,9 +222,7 @@ /* provided at http://wiki.wireshark.org/MAC-LTE */ /* */ /* A heuristic dissecter (enabled by a preference) will */ -/* recognise a signature at the beginning of these frames . */ -/* Until someone is using this format, suggestions for changes */ -/* are welcome. */ +/* recognise a signature at the beginning of these frames. */ /*****************************************************************/ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-mbim.c wireshark-1.12.0~201311020920/epan/dissectors/packet-mbim.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-mbim.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-mbim.c 2013-11-02 02:12:36.000000000 +0000 @@ -1739,7 +1739,7 @@ offset += 4; hw_info_size = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_device_caps_info_hw_info_size, tvb, offset, 4, hw_info_size); - offset += 4; + /*offset += 4;*/ if (custom_class_offset && custom_class_size) { proto_tree_add_item(tree, hf_mbim_device_caps_info_custom_data_class, tvb, base_offset + custom_class_offset, custom_class_size, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -1838,7 +1838,7 @@ offset += 4; new_pin_size = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_set_pin_new_pin_size, tvb, offset, 4, new_pin_size); - offset += 4; + /*offset += 4;*/ if (pin_offset && pin_size) { proto_tree_add_item(tree, hf_mbim_set_pin_pin, tvb, base_offset + pin_offset, pin_size, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -1913,7 +1913,7 @@ proto_tree_add_item (tree, hf_mbim_provider_rssi, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item (tree, hf_mbim_provider_error_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN); - offset += 4; + /*offset += 4;*/ if (provider_id_offset && provider_id_size) { proto_tree_add_item(tree, hf_mbim_provider_provider_id, tvb, base_offset + provider_id_offset, provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -1976,7 +1976,7 @@ offset += 4; proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_register_state_data_class, ett_mbim_bitmap, mbim_data_class_fields, ENC_LITTLE_ENDIAN); - offset += 4; + /*offset += 4;*/ if (provider_id_offset && provider_id_size) { proto_tree_add_item(tree, hf_mbim_set_register_state_provider_id, tvb, base_offset + provider_id_offset, provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -2027,7 +2027,7 @@ offset += 4; proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_registration_state_info_registration_flags, ett_mbim_bitmap, mbim_registration_state_info_registration_flags_fields, ENC_LITTLE_ENDIAN); - offset += 4; + /*offset += 4;*/ if (provider_id_offset && provider_id_size) { proto_tree_add_item(tree, hf_mbim_registration_state_info_provider_id, tvb, base_offset + provider_id_offset, provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -2065,7 +2065,7 @@ offset += 8; ti = proto_tree_add_item(tree, hf_mbim_packet_service_info_downlink_speed, tvb, offset, 8, ENC_LITTLE_ENDIAN); proto_item_append_text(ti, " b/s"); - offset += 8; + /*offset += 8;*/ } static void @@ -2664,7 +2664,7 @@ offset += 4; packet_mask_offset = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_single_packet_filter_packet_mask_offset, tvb, offset, 4, packet_mask_offset); - offset += 4; + /*offset += 4;*/ if (filter_size) { if (packet_filter_offset) { proto_tree_add_item(tree, hf_mbim_single_packet_filter_packet_filter, tvb, base_offset + packet_filter_offset, @@ -2730,7 +2730,7 @@ offset += 4; sc_address_size = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_set_sms_configuration_sc_address_size, tvb, offset, 4, sc_address_size); - offset += 4; + /*offset += 4;*/ if (sc_address_offset && sc_address_size) { proto_tree_add_item(tree, hf_mbim_set_sms_configuration_sc_address, tvb, base_offset + sc_address_offset, sc_address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -2757,7 +2757,7 @@ offset += 4; sc_address_size = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_sms_configuration_info_sc_address_size, tvb, offset, 4, sc_address_size); - offset += 4; + /*offset += 4;*/ if (sc_address_offset && sc_address_size) { proto_tree_add_item(tree, hf_mbim_sms_configuration_info_sc_address, tvb, base_offset + sc_address_offset, sc_address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -2784,7 +2784,7 @@ offset += 4; pdu_data_size = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_sms_pdu_record_pdu_data_size, tvb, offset, 4, pdu_data_size); - offset += 4; + /*offset += 4;*/ if (pdu_data_offset && pdu_data_size) { ti = proto_tree_add_item(tree, hf_mbim_sms_pdu_record_pdu_data, tvb, base_offset + pdu_data_offset, pdu_data_size, ENC_NA); @@ -2834,7 +2834,7 @@ proto_tree_add_uint(tree, hf_mbim_sms_cdma_record_size_in_bytes, tvb, offset, 4, size_in_bytes); offset += 4; proto_tree_add_item(tree, hf_mbim_sms_cdma_record_size_in_characters, tvb, offset, 4, ENC_LITTLE_ENDIAN); - offset += 4; + /*offset += 4;*/ if (address_offset && address_size) { proto_tree_add_item(tree, hf_mbim_sms_cdma_record_address, tvb, base_offset + address_offset, address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -2923,7 +2923,7 @@ offset += 4; pdu_data_size = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_sms_send_pdu_pdu_data_size, tvb, offset, 4, pdu_data_size); - offset += 4; + /*offset += 4;*/ if (pdu_data_offset && pdu_data_size) { ti = proto_tree_add_item(tree, hf_mbim_sms_send_pdu_pdu_data, tvb, base_offset + pdu_data_offset, pdu_data_size, ENC_NA); @@ -2962,7 +2962,7 @@ proto_tree_add_uint(tree, hf_mbim_sms_send_cdma_size_in_bytes, tvb, offset, 4, size_in_bytes); offset += 4; proto_tree_add_item(tree, hf_mbim_sms_send_cdma_size_in_characters, tvb, offset, 4, ENC_LITTLE_ENDIAN); - offset += 4; + /*offset += 4;*/ if (address_offset && address_size) { proto_tree_add_item(tree, hf_mbim_sms_send_cdma_address, tvb, base_offset + address_offset, address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -3017,7 +3017,7 @@ offset += 4; ussd_payload_length = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_set_ussd_ussd_ussd_payload_length, tvb, offset, 4, ussd_payload_length); - offset += 4; + /*offset += 4;*/ if (ussd_payload_offset && ussd_payload_length) { ti = proto_tree_add_item(tree, hf_mbim_set_ussd_ussd_ussd_payload, tvb, base_offset + ussd_payload_offset, ussd_payload_length, ENC_NA); @@ -3083,7 +3083,7 @@ offset += 4; ussd_payload_length = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_ussd_info_ussd_payload_length, tvb, offset, 4, ussd_payload_length); - offset += 4; + /*offset += 4;*/ if (ussd_payload_offset && ussd_payload_length) { ti = proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_payload, tvb, base_offset + ussd_payload_offset, ussd_payload_length, ENC_NA); @@ -3155,7 +3155,7 @@ offset += 4; name_length = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_phonebook_entry_name_length, tvb, offset, 4, name_length); - offset += 4; + /*offset += 4;*/ if (number_offset && number_length) { proto_tree_add_item(tree, hf_mbim_phonebook_entry_number, tvb, base_offset + number_offset, number_length, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -3225,7 +3225,7 @@ offset += 4; name_length = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_set_phonebook_write_name_length, tvb, offset, 4, name_length); - offset += 4; + /*offset += 4;*/ if (number_offset && number_length) { proto_tree_add_item(tree, hf_mbim_set_phonebook_write_number, tvb, base_offset + number_offset, number_length, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -3316,7 +3316,7 @@ offset += 4; network_name_length = tvb_get_letohl(tvb, offset); proto_tree_add_uint(tree, hf_mbim_akap_auth_req_network_name_length, tvb, offset, 4, network_name_length); - offset += 4; + /*offset += 4;*/ if (network_name_offset && network_name_length) { proto_tree_add_item(tree, hf_mbim_akap_auth_req_network_name, tvb, base_offset + network_name_offset, network_name_length, ENC_LITTLE_ENDIAN|ENC_UTF_16); @@ -4570,9 +4570,9 @@ datagram_index, datagram_length, ENC_NA); datagram_tvb = tvb_new_subset_length(tvb, datagram_index, datagram_length); if (total) { - col_add_str(pinfo->cinfo, COL_PROTOCOL, "|"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "|"); col_set_fence(pinfo->cinfo, COL_PROTOCOL); - col_add_str(pinfo->cinfo, COL_INFO, " | "); + col_set_str(pinfo->cinfo, COL_INFO, " | "); col_set_fence(pinfo->cinfo, COL_INFO); } call_dissector(dissector, datagram_tvb, pinfo, tree); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-mdshdr.c wireshark-1.12.0~201311020920/epan/dissectors/packet-mdshdr.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-mdshdr.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-mdshdr.c 2013-11-02 02:12:36.000000000 +0000 @@ -142,8 +142,6 @@ guint pktlen; tvbuff_t *next_tvb; guint8 sof, eof; - guint16 vsan; - guint8 span_id; int trailer_start = 0; /*0 means "no trailer found"*/ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MDS Header"); @@ -152,8 +150,6 @@ sof = tvb_get_guint8(tvb, offset+MDSHDR_SOF_OFFSET) & 0x0F; pktlen = tvb_get_ntohs(tvb, offset+MDSHDR_PKTLEN_OFFSET) & 0x1FFF; - vsan = tvb_get_ntohs(tvb, offset+MDSHDR_VSAN_OFFSET) & 0x0FFF; - span_id = (tvb_get_ntohs(tvb, offset+MDSHDR_VSAN_OFFSET) & 0xF000) >> 12; /* The Mdshdr trailer is at the end of the frame */ if ((tvb_length(tvb) >= (MDSHDR_HEADER_SIZE + pktlen)) @@ -168,9 +164,6 @@ eof = MDSHDR_EOF_UNKNOWN; } - pinfo->src_idx = (tvb_get_ntohs(tvb, MDSHDR_SIDX_OFFSET) & 0x3FF); - pinfo->dst_idx = (tvb_get_ntohs(tvb, MDSHDR_DIDX_OFFSET) & 0xFFC) >> 2; - pinfo->vsan = vsan; pinfo->sof_eof = 0; if ((sof == MDSHDR_SOFi3) || (sof == MDSHDR_SOFi2) || (sof == MDSHDR_SOFi1) @@ -213,9 +206,9 @@ MDSHDR_SIZE_INT16, ENC_BIG_ENDIAN); proto_tree_add_item(mdshdr_tree_hdr, hf_mdshdr_vsan, tvb, MDSHDR_VSAN_OFFSET, MDSHDR_SIZE_INT16, ENC_BIG_ENDIAN); - hidden_item = proto_tree_add_uint(mdshdr_tree_hdr, hf_mdshdr_span, + hidden_item = proto_tree_add_item(mdshdr_tree_hdr, hf_mdshdr_span, tvb, MDSHDR_VSAN_OFFSET, - MDSHDR_SIZE_BYTE, span_id); + MDSHDR_SIZE_INT16, ENC_BIG_ENDIAN); PROTO_ITEM_SET_HIDDEN(hidden_item); /* Add Mdshdr Trailer part */ @@ -279,7 +272,7 @@ {"EOF", "mdshdr.eof", FT_UINT8, BASE_DEC, VALS(eof_vals), 0x0, NULL, HFILL}}, { &hf_mdshdr_span, - {"SPAN Frame", "mdshdr.span", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + {"SPAN Frame", "mdshdr.span", FT_UINT16, BASE_DEC, NULL, 0xF000, NULL, HFILL}}, { &hf_mdshdr_fccrc, {"CRC", "mdshdr.crc", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-mint.c wireshark-1.12.0~201311020920/epan/dissectors/packet-mint.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-mint.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-mint.c 2013-11-02 02:12:36.000000000 +0000 @@ -64,7 +64,6 @@ static int ett_mint_header = -1; static int ett_mint_ctrl = -1; static int ett_mint_data = -1; -static int ett_mint_eth = -1; static dissector_handle_t mint_control_handle; static dissector_handle_t mint_data_handle; @@ -90,6 +89,35 @@ { 0, NULL } }; + +static const value_string mint_0x0c_csnp_tlv_vals[] = { + + { 0, NULL } +}; + +static const value_string mint_0x0c_helo_tlv_vals[] = { + { 1, "MiNT ID" }, + { 8, "IPv4 address" }, + + { 0, NULL } +}; + +static const value_string mint_0x0c_lsp_tlv_vals[] = { + { 8, "MiNT ID" }, + + { 0, NULL } +}; + +static const value_string mint_0x0c_psnp_tlv_vals[] = { + + { 0, NULL } +}; + +static const value_string mint_0x22_tlv_vals[] = { + + { 0, NULL } +}; + /* hfi elements */ #define MINT_HF_INIT HFI_INIT(proto_mint) static header_field_info *hfi_mint = NULL; @@ -148,23 +176,110 @@ { "DataUnk1", "mint.data.unknown1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }; -/* MiNT Control */ +/* MiNT Control common */ static header_field_info hfi_mint_control MINT_HF_INIT = { "Control Frame", "mint.control", FT_PROTOCOL, BASE_NONE, NULL, 0x0, NULL, HFILL }; +static header_field_info hfi_mint_control_32zerobytes MINT_HF_INIT = + { "Zero Bytes", "mint.control.32zerobytes", FT_BYTES, BASE_NONE, NULL, + 0x0, NULL, HFILL }; + static header_field_info hfi_mint_control_unknown1 MINT_HF_INIT = { "CtrlUnk1", "mint.control.unknown1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }; -/* MiNT Eth */ -static header_field_info hfi_mint_eth MINT_HF_INIT = - { "Ethernet Frame", "mint.eth", FT_PROTOCOL, BASE_NONE, NULL, +/* MiNT Control type 0x0c */ +static header_field_info hfi_mint_control_0x0c_unknown1 MINT_HF_INIT = + { "Unknown1", "mint.control.0x0c.unknown1", FT_UINT8, BASE_HEX, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_unknown2 MINT_HF_INIT = + { "Unknown2", "mint.control.0x0c.unknown2", FT_UINT8, BASE_DEC, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_unknown3 MINT_HF_INIT = + { "Unknown3", "mint.control.0x0c.unknown3", FT_UINT8, BASE_HEX, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_unknown4 MINT_HF_INIT = + { "Unknown4", "mint.control.0x0c.unknown4", FT_UINT8, BASE_HEX, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_header_length MINT_HF_INIT = + { "Headerlength", "mint.control.0x0c.header.length", FT_UINT8, BASE_HEX, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_message_type MINT_HF_INIT = + { "Message type", "mint.control.0x0c.message.type", FT_STRING, BASE_NONE, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_header_sender MINT_HF_INIT = + { "Sender ID", "mint.control.0x0c.header.sender", FT_BYTES, BASE_NONE, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_header_unknown MINT_HF_INIT = + { "Header unknown", "mint.control.0x0c.header.unknown", FT_BYTES, BASE_NONE, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_type_unknown MINT_HF_INIT = + { "TLV Type", "mint.control.0x0c.tlvtype", FT_UINT8, BASE_DEC, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_type_csnp MINT_HF_INIT = + { "TLV Type", "mint.control.0x0c.tlvtype", FT_UINT8, BASE_DEC, VALS(mint_0x0c_csnp_tlv_vals), + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_type_helo MINT_HF_INIT = + { "TLV Type", "mint.control.0x0c.tlvtype", FT_UINT8, BASE_DEC, VALS(mint_0x0c_helo_tlv_vals), + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_type_lsp MINT_HF_INIT = + { "TLV Type", "mint.control.0x0c.tlvtype", FT_UINT8, BASE_DEC, VALS(mint_0x0c_lsp_tlv_vals), + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_type_psnp MINT_HF_INIT = + { "TLV Type", "mint.control.0x0c.tlvtype", FT_UINT8, BASE_DEC, VALS(mint_0x0c_psnp_tlv_vals), 0x0, NULL, HFILL }; -static header_field_info hfi_mint_eth_unknown1 MINT_HF_INIT = - { "EthUnk1", "mint.eth.unknown1", FT_BYTES, BASE_NONE, NULL, +static header_field_info hfi_mint_control_0x0c_length MINT_HF_INIT = + { "TLV Length", "mint.control.0x0c.tlvlength", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_array MINT_HF_INIT = + { "Array indicator", "mint.control.0x0c.array", FT_UINT8, BASE_DEC, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_element MINT_HF_INIT = + { "Array element", "mint.control.0x0c.element", FT_BYTES, BASE_NONE, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x0c_value MINT_HF_INIT = + { "TLV Value", "mint.control.0x0c.tlvvalue", FT_BYTES, BASE_NONE, NULL, + 0x0, NULL, HFILL }; + +/* MiNT Control type 0x1e */ +static header_field_info hfi_mint_control_0x1e_unknown MINT_HF_INIT = + { "Unknown", "mint.control.0x22.unknown", FT_BYTES, BASE_NONE, NULL, + 0x0, NULL, HFILL }; + +/* MiNT Control type 0x22 */ +static header_field_info hfi_mint_control_0x22_message MINT_HF_INIT = + { "Message", "mint.control.0x22.message", FT_UINT16, BASE_HEX, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x22_type MINT_HF_INIT = + { "TLV Type", "mint.control.0x22.tlvtype", FT_UINT8, BASE_DEC, VALS(mint_0x22_tlv_vals), + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x22_length MINT_HF_INIT = + { "TLV Length", "mint.control.0x22.tlvlength", FT_UINT8, BASE_DEC, NULL, + 0x0, NULL, HFILL }; + +static header_field_info hfi_mint_control_0x22_value MINT_HF_INIT = + { "TLV Value", "mint.control.0x22.tlvvalue", FT_BYTES, BASE_NONE, NULL, + 0x0, NULL, HFILL }; + /* End hfi elements */ static int @@ -201,9 +316,12 @@ proto_tree *mint_header_tree = NULL; proto_tree *mint_data_tree = NULL; proto_tree *mint_ctrl_tree = NULL; - proto_tree *mint_eth_tree = NULL; guint16 bytes_remaining; guint16 packet_type; + guint8 type, length, header_length; + guint32 message_type; + guint8 element_length; + static header_field_info *display_hfi_tlv_vals; if (!tree) return packet_length; @@ -275,29 +393,137 @@ offset, packet_length - offset); break; case MINT_TYPE_CTRL_0x0c: - case MINT_TYPE_CTRL_0x0e: + ti = proto_tree_add_item(mint_tree, &hfi_mint_control, tvb, + offset, packet_length - 16, ENC_NA); + mint_ctrl_tree = proto_item_add_subtree(ti, ett_mint_ctrl); + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_32zerobytes, tvb, + offset, 32, ENC_NA); + offset += 32; + + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_unknown1, tvb, + offset, 1, ENC_NA); + offset += 1; + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_unknown2, tvb, + offset, 1, ENC_NA); + offset += 1; + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_unknown3, tvb, + offset, 1, ENC_NA); + offset += 1; + header_length = tvb_get_guint8(tvb, offset); + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_header_length, tvb, + offset, 1, ENC_NA); + offset += 1; + message_type = tvb_get_ntohl(tvb, offset); + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_message_type, tvb, + offset, 4, ENC_NA); + offset += 4; + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_header_sender, tvb, + offset, 4, ENC_NA); + offset += 4; + switch (message_type) { + case 0x43534E50: /* CSNP */ + element_length = 12; + display_hfi_tlv_vals = &hfi_mint_control_0x0c_type_csnp; + break; + case 0x48454C4F: /* HELO */ + element_length = 0; + display_hfi_tlv_vals = &hfi_mint_control_0x0c_type_helo; + break; + case 0x4C535000: /* LSP */ + element_length = 8; + display_hfi_tlv_vals = &hfi_mint_control_0x0c_type_lsp; + break; + case 0x50534E50: /* PSNP */ + element_length = 4; + display_hfi_tlv_vals = &hfi_mint_control_0x0c_type_psnp; + break; + default: + element_length = 0; + display_hfi_tlv_vals = &hfi_mint_control_0x0c_type_unknown; + } + /* FIXME: This should go into the per message_type switch above */ + if (header_length > 12) { + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_header_unknown, tvb, + offset, header_length - 12, ENC_NA); + offset += header_length - 12; + } + while (offset < packet_length - 2) { + type = tvb_get_guint8(tvb, offset); + proto_tree_add_item(mint_ctrl_tree, display_hfi_tlv_vals, tvb, + offset, 1, ENC_NA); + offset += 1; + length = tvb_get_guint8(tvb, offset); + /* FIXME: This is a hack - reliable array detection missing */ + if (type == 1 && length == 128) { + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_array, tvb, + offset, 1, ENC_NA); + offset += 1; + length = tvb_get_guint8(tvb, offset); + } + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_length, tvb, + offset, 1, ENC_NA); + offset += 1; + if (offset + length > packet_length) { + /* FIXME: print expert information */ + break; + } + if (type == 1 && element_length) { + guint32 end_offset = offset + length; + for (; offset < end_offset; offset += element_length) { + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_element, tvb, + offset, element_length, ENC_NA); + } + } else { + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x0c_value, tvb, + offset, length, ENC_NA); + offset += length; + } + } + break; case MINT_TYPE_CTRL_0x1e: ti = proto_tree_add_item(mint_tree, &hfi_mint_control, tvb, offset, packet_length - 16, ENC_NA); mint_ctrl_tree = proto_item_add_subtree(ti, ett_mint_ctrl); + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_32zerobytes, tvb, + offset, 32, ENC_NA); + offset += 32; bytes_remaining = packet_length - offset; - proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_unknown1, tvb, + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x1e_unknown, tvb, offset, bytes_remaining, ENC_NA); offset += bytes_remaining; break; case MINT_TYPE_ETH_0x22: - ti = proto_tree_add_item(mint_tree, &hfi_mint_eth, tvb, + ti = proto_tree_add_item(mint_tree, &hfi_mint_control, tvb, offset, packet_length - 16, ENC_NA); - mint_eth_tree = proto_item_add_subtree(ti, ett_mint_eth); - bytes_remaining = packet_length - offset; - proto_tree_add_item(mint_eth_tree, &hfi_mint_eth_unknown1, tvb, - offset, bytes_remaining, ENC_NA); - offset += bytes_remaining; + mint_ctrl_tree = proto_item_add_subtree(ti, ett_mint_ctrl); + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_32zerobytes, tvb, + offset, 32, ENC_NA); + offset += 32; + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x22_message, tvb, + offset, 2, ENC_BIG_ENDIAN); + offset += 2; + while (offset < packet_length - 2) { + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x22_type, tvb, + offset, 1, ENC_NA); + offset += 1; + length = tvb_get_guint8(tvb, offset); + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x22_length, tvb, + offset, 1, ENC_NA); + offset += 1; + if (offset + length > packet_length) { + /* print expert information */ + break; + } + proto_tree_add_item(mint_ctrl_tree, &hfi_mint_control_0x22_value, tvb, + offset, length, ENC_NA); + offset += length; + } break; default: bytes_remaining = packet_length - offset; switch(received_via) { case PORT_MINT_CONTROL_TUNNEL: + case ETHERTYPE_MINT: proto_tree_add_item(mint_tree, &hfi_mint_control_unknown1, tvb, offset, bytes_remaining, ENC_NA); break; @@ -305,10 +531,6 @@ proto_tree_add_item(mint_tree, &hfi_mint_data_unknown1, tvb, offset, bytes_remaining, ENC_NA); break; - case ETHERTYPE_MINT: - proto_tree_add_item(mint_tree, &hfi_mint_eth_unknown1, tvb, - offset, bytes_remaining, ENC_NA); - break; default: DISSECTOR_ASSERT_NOT_REACHED(); } @@ -316,11 +538,11 @@ break; } #if defined MINT_DEVELOPMENT - /* tree_expanded_set(ett_mint, TRUE); */ + tree_expanded_set(ett_mint, TRUE); + tree_expanded_set(ett_mint_ethshim, TRUE); tree_expanded_set(ett_mint_header, TRUE); tree_expanded_set(ett_mint_ctrl, TRUE); tree_expanded_set(ett_mint_data, TRUE); - tree_expanded_set(ett_mint_eth, TRUE); #endif return offset; } @@ -350,7 +572,7 @@ } static int -dissect_mint_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +dissect_mint_ethshim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti; proto_tree *mint_ethshim_tree = NULL; @@ -441,12 +663,12 @@ } static int -dissect_mint_eth_static(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_mint_ethshim_static(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if ( !test_mint_eth(tvb) ) { return 0; } - return dissect_mint_eth(tvb, pinfo, tree); + return dissect_mint_ethshim(tvb, pinfo, tree); } void @@ -465,17 +687,40 @@ &hfi_mint_header_dstid, &hfi_mint_header_srcdatatype, &hfi_mint_header_dstdatatype, - /* MiNT Control */ - &hfi_mint_control, - &hfi_mint_control_unknown1, /* MiNT Data */ &hfi_mint_data, &hfi_mint_data_vlan, &hfi_mint_data_seqno, &hfi_mint_data_unknown1, - /* MiNT Eth */ - &hfi_mint_eth, - &hfi_mint_eth_unknown1, + /* MiNT Control */ + &hfi_mint_control, + &hfi_mint_control_32zerobytes, + &hfi_mint_control_unknown1, + /* MiNT Control 0x0c */ + &hfi_mint_control_0x0c_message_type, + &hfi_mint_control_0x0c_header_sender, + &hfi_mint_control_0x0c_unknown1, + &hfi_mint_control_0x0c_unknown2, + &hfi_mint_control_0x0c_unknown3, + &hfi_mint_control_0x0c_unknown4, + &hfi_mint_control_0x0c_header_length, + &hfi_mint_control_0x0c_header_unknown, + &hfi_mint_control_0x0c_type_unknown, + &hfi_mint_control_0x0c_type_csnp, + &hfi_mint_control_0x0c_type_helo, + &hfi_mint_control_0x0c_type_lsp, + &hfi_mint_control_0x0c_type_psnp, + &hfi_mint_control_0x0c_length, + &hfi_mint_control_0x0c_array, + &hfi_mint_control_0x0c_element, + &hfi_mint_control_0x0c_value, + /* MiNT Control 0x1e */ + &hfi_mint_control_0x1e_unknown, + /* MiNT Control 0x22 */ + &hfi_mint_control_0x22_message, + &hfi_mint_control_0x22_type, + &hfi_mint_control_0x22_length, + &hfi_mint_control_0x22_value, }; static gint *ett[] = { &ett_mint_ethshim, @@ -483,7 +728,6 @@ &ett_mint_header, &ett_mint_ctrl, &ett_mint_data, - &ett_mint_eth, }; int proto_mint; @@ -495,7 +739,7 @@ mint_control_handle = new_create_dissector_handle(dissect_mint_control_static, proto_mint); mint_data_handle = new_create_dissector_handle(dissect_mint_data_static, proto_mint); - mint_eth_handle = new_create_dissector_handle(dissect_mint_eth_static, proto_mint); + mint_eth_handle = new_create_dissector_handle(dissect_mint_ethshim_static, proto_mint); } void diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-mmse.c wireshark-1.12.0~201311020920/epan/dissectors/packet-mmse.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-mmse.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-mmse.c 2013-11-02 02:12:36.000000000 +0000 @@ -667,7 +667,6 @@ /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MMSE"); - col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "MMS %s", message_type); dissect_mmse(tvb, pinfo, tree, pdut, message_type); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-mp2t.c wireshark-1.12.0~201311020920/epan/dissectors/packet-mp2t.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-mp2t.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-mp2t.c 2013-11-02 02:12:36.000000000 +0000 @@ -42,10 +42,10 @@ /* The MPEG2 TS packet size */ #define MP2T_PACKET_SIZE 188 -#define MP2T_SYNC_BYTE 0x47 +#define MP2T_SYNC_BYTE 0x47 -#define MP2T_PID_DOCSIS 0x1FFE -#define MP2T_PID_NULL 0x1FFF +#define MP2T_PID_DOCSIS 0x1FFE +#define MP2T_PID_NULL 0x1FFF static dissector_handle_t mp2t_handle; @@ -77,23 +77,23 @@ static int hf_mp2t_analysis_skips = -1; static int hf_mp2t_analysis_drops = -1; -#define MP2T_SYNC_BYTE_MASK 0xFF000000 -#define MP2T_TEI_MASK 0x00800000 -#define MP2T_PUSI_MASK 0x00400000 -#define MP2T_TP_MASK 0x00200000 -#define MP2T_PID_MASK 0x001FFF00 -#define MP2T_TSC_MASK 0x000000C0 -#define MP2T_AFC_MASK 0x00000030 -#define MP2T_CC_MASK 0x0000000F - -#define MP2T_SYNC_BYTE_SHIFT 24 -#define MP2T_TEI_SHIFT 23 -#define MP2T_PUSI_SHIFT 22 -#define MP2T_TP_SHIFT 21 -#define MP2T_PID_SHIFT 8 -#define MP2T_TSC_SHIFT 6 -#define MP2T_AFC_SHIFT 4 -#define MP2T_CC_SHIFT 0 +#define MP2T_SYNC_BYTE_MASK 0xFF000000 +#define MP2T_TEI_MASK 0x00800000 +#define MP2T_PUSI_MASK 0x00400000 +#define MP2T_TP_MASK 0x00200000 +#define MP2T_PID_MASK 0x001FFF00 +#define MP2T_TSC_MASK 0x000000C0 +#define MP2T_AFC_MASK 0x00000030 +#define MP2T_CC_MASK 0x0000000F + +#define MP2T_SYNC_BYTE_SHIFT 24 +#define MP2T_TEI_SHIFT 23 +#define MP2T_PUSI_SHIFT 22 +#define MP2T_TP_SHIFT 21 +#define MP2T_PID_SHIFT 8 +#define MP2T_TSC_SHIFT 6 +#define MP2T_AFC_SHIFT 4 +#define MP2T_CC_SHIFT 0 static int hf_mp2t_af = -1; static int hf_mp2t_af_length = -1; @@ -106,23 +106,23 @@ static int hf_mp2t_af_tpd_flag = -1; static int hf_mp2t_af_afe_flag = -1; -#define MP2T_AF_DI_MASK 0x80 -#define MP2T_AF_RAI_MASK 0x40 -#define MP2T_AF_ESPI_MASK 0x20 -#define MP2T_AF_PCR_MASK 0x10 -#define MP2T_AF_OPCR_MASK 0x08 -#define MP2T_AF_SP_MASK 0x04 -#define MP2T_AF_TPD_MASK 0x02 -#define MP2T_AF_AFE_MASK 0x01 - -#define MP2T_AF_DI_SHIFT 7 -#define MP2T_AF_RAI_SHIFT 6 -#define MP2T_AF_ESPI_SHIFT 5 -#define MP2T_AF_PCR_SHIFT 4 -#define MP2T_AF_OPCR_SHIFT 3 -#define MP2T_AF_SP_SHIFT 2 -#define MP2T_AF_TPD_SHIFT 1 -#define MP2T_AF_AFE_SHIFT 0 +#define MP2T_AF_DI_MASK 0x80 +#define MP2T_AF_RAI_MASK 0x40 +#define MP2T_AF_ESPI_MASK 0x20 +#define MP2T_AF_PCR_MASK 0x10 +#define MP2T_AF_OPCR_MASK 0x08 +#define MP2T_AF_SP_MASK 0x04 +#define MP2T_AF_TPD_MASK 0x02 +#define MP2T_AF_AFE_MASK 0x01 + +#define MP2T_AF_DI_SHIFT 7 +#define MP2T_AF_RAI_SHIFT 6 +#define MP2T_AF_ESPI_SHIFT 5 +#define MP2T_AF_PCR_SHIFT 4 +#define MP2T_AF_OPCR_SHIFT 3 +#define MP2T_AF_SP_SHIFT 2 +#define MP2T_AF_TPD_SHIFT 1 +#define MP2T_AF_AFE_SHIFT 0 static int hf_mp2t_af_pcr = -1; static int hf_mp2t_af_opcr = -1; @@ -138,9 +138,9 @@ static int hf_mp2t_af_e_ss_flag = -1; static int hf_mp2t_af_e_reserved = -1; -#define MP2T_AF_E_LTW_FLAG_MASK 0x80 -#define MP2T_AF_E_PR_FLAG_MASK 0x40 -#define MP2T_AF_E_SS_FLAG_MASK 0x20 +#define MP2T_AF_E_LTW_FLAG_MASK 0x80 +#define MP2T_AF_E_PR_FLAG_MASK 0x40 +#define MP2T_AF_E_SS_FLAG_MASK 0x20 static int hf_mp2t_af_e_reserved_bytes = -1; static int hf_mp2t_af_stuffing_bytes = -1; @@ -161,51 +161,52 @@ /* static int hf_mp2t_payload = -1; */ static int hf_mp2t_stuff_bytes = -1; +static int hf_mp2t_pointer = -1; static const value_string mp2t_sync_byte_vals[] = { - { MP2T_SYNC_BYTE, "Correct" }, - { 0, NULL } + { MP2T_SYNC_BYTE, "Correct" }, + { 0, NULL } }; static const value_string mp2t_pid_vals[] = { - { 0x0000, "Program Association Table" }, - { 0x0001, "Conditional Access Table" }, - { 0x0002, "Transport Stream Description Table" }, - { 0x0003, "Reserved" }, - { 0x0004, "Reserved" }, - { 0x0005, "Reserved" }, - { 0x0006, "Reserved" }, - { 0x0007, "Reserved" }, - { 0x0008, "Reserved" }, - { 0x0009, "Reserved" }, - { 0x000A, "Reserved" }, - { 0x000B, "Reserved" }, - { 0x000C, "Reserved" }, - { 0x000D, "Reserved" }, - { 0x000E, "Reserved" }, - { 0x000F, "Reserved" }, - { 0x1FFE, "DOCSIS Data-over-cable well-known PID" }, - { 0x1FFF, "Null packet" }, - { 0, NULL } + { 0x0000, "Program Association Table" }, + { 0x0001, "Conditional Access Table" }, + { 0x0002, "Transport Stream Description Table" }, + { 0x0003, "Reserved" }, + { 0x0004, "Reserved" }, + { 0x0005, "Reserved" }, + { 0x0006, "Reserved" }, + { 0x0007, "Reserved" }, + { 0x0008, "Reserved" }, + { 0x0009, "Reserved" }, + { 0x000A, "Reserved" }, + { 0x000B, "Reserved" }, + { 0x000C, "Reserved" }, + { 0x000D, "Reserved" }, + { 0x000E, "Reserved" }, + { 0x000F, "Reserved" }, + { 0x1FFE, "DOCSIS Data-over-cable well-known PID" }, + { 0x1FFF, "Null packet" }, + { 0, NULL } }; /* Values below according ETSI ETR 289 */ static const value_string mp2t_tsc_vals[] = { - { 0, "Not scrambled" }, - { 1, "Reserved" }, - { 2, "Packet scrambled with Even Key" }, - { 3, "Packet scrambled with Odd Key" }, - { 0, NULL } + { 0, "Not scrambled" }, + { 1, "Reserved" }, + { 2, "Packet scrambled with Even Key" }, + { 3, "Packet scrambled with Odd Key" }, + { 0, NULL } }; static const value_string mp2t_afc_vals[] = { - { 0, "Reserved" }, - { 1, "Payload only" }, - { 2, "Adaptation Field only" }, - { 3, "Adaptation Field and Payload" }, - { 0, NULL } + { 0, "Reserved" }, + { 1, "Payload only" }, + { 2, "Adaptation Field only" }, + { 3, "Adaptation Field and Payload" }, + { 0, NULL } }; static gint ett_msg_fragment = -1; @@ -225,26 +226,26 @@ static expert_field ei_mp2t_cc_drop = EI_INIT; static const fragment_items mp2t_msg_frag_items = { - /* Fragment subtrees */ - &ett_msg_fragment, - &ett_msg_fragments, - /* Fragment fields */ - &hf_msg_fragments, - &hf_msg_fragment, - &hf_msg_fragment_overlap, - &hf_msg_fragment_overlap_conflicts, - &hf_msg_fragment_multiple_tails, - &hf_msg_fragment_too_long_fragment, - &hf_msg_fragment_error, - &hf_msg_fragment_count, - /* Reassembled in field */ - &hf_msg_reassembled_in, - /* Reassembled length field */ - &hf_msg_reassembled_length, - /* Reassembled data field */ - NULL, - /* Tag */ - "Message fragments" + /* Fragment subtrees */ + &ett_msg_fragment, + &ett_msg_fragments, + /* Fragment fields */ + &hf_msg_fragments, + &hf_msg_fragment, + &hf_msg_fragment_overlap, + &hf_msg_fragment_overlap_conflicts, + &hf_msg_fragment_multiple_tails, + &hf_msg_fragment_too_long_fragment, + &hf_msg_fragment_error, + &hf_msg_fragment_count, + /* Reassembled in field */ + &hf_msg_reassembled_in, + /* Reassembled length field */ + &hf_msg_reassembled_length, + /* Reassembled data field */ + NULL, + /* Tag */ + "Message fragments" }; @@ -273,152 +274,152 @@ typedef struct mp2t_analysis_data { - /* This structure contains a tree containing data for the - * individual pid's, this is only used when packets are - * processed sequencially. - */ - wmem_tree_t *pid_table; - - /* When detecting a CC drop, store that information for the - * given frame. This info is needed, when clicking around in - * wireshark, as the pid table data only makes sence during - * sequencial processing. The flag pinfo->fd->flags.visited is - * used to tell the difference. - * - */ - wmem_tree_t *frame_table; - - /* Total counters per conversation / multicast stream */ - guint32 total_skips; - guint32 total_discontinuity; + /* This structure contains a tree containing data for the + * individual pid's, this is only used when packets are + * processed sequencially. + */ + wmem_tree_t *pid_table; + + /* When detecting a CC drop, store that information for the + * given frame. This info is needed, when clicking around in + * wireshark, as the pid table data only makes sense during + * sequential processing. The flag pinfo->fd->flags.visited is + * used to tell the difference. + * + */ + wmem_tree_t *frame_table; + + /* Total counters per conversation / multicast stream */ + guint32 total_skips; + guint32 total_discontinuity; } mp2t_analysis_data_t; enum pid_payload_type { - pid_pload_unknown, - pid_pload_docsis, - pid_pload_pes, - pid_pload_sect, - pid_pload_null + pid_pload_unknown, + pid_pload_docsis, + pid_pload_pes, + pid_pload_sect, + pid_pload_null }; typedef struct subpacket_analysis_data { - guint32 frag_cur_pos; - guint32 frag_tot_len; - gboolean fragmentation; - guint32 frag_id; + guint32 frag_cur_pos; + guint32 frag_tot_len; + gboolean fragmentation; + guint32 frag_id; } subpacket_analysis_data_t; typedef struct packet_analysis_data { - /* Contain information for each MPEG2-TS packet in the current big packet */ - wmem_tree_t *subpacket_table; -} packed_analysis_data_t; + /* Contain information for each MPEG2-TS packet in the current big packet */ + wmem_tree_t *subpacket_table; +} packet_analysis_data_t; /* Analysis TS frame info needed during sequential processing */ typedef struct pid_analysis_data { - guint16 pid; - gint8 cc_prev; /* Previous CC number */ - enum pid_payload_type pload_type; - - /* Fragments information used for first pass */ - gboolean fragmentation; - guint32 frag_cur_pos; - guint32 frag_tot_len; - guint32 frag_id; + guint16 pid; + gint8 cc_prev; /* Previous CC number */ + enum pid_payload_type pload_type; + + /* Fragments information used for first pass */ + gboolean fragmentation; + guint32 frag_cur_pos; + guint32 frag_tot_len; + guint32 frag_id; } pid_analysis_data_t; /* Analysis info stored for a TS frame */ typedef struct ts_analysis_data { - guint16 pid; - gint8 cc_prev; /* Previous CC number */ - guint8 skips; /* Skips between CCs max 14 */ + guint16 pid; + gint8 cc_prev; /* Previous CC number */ + guint8 skips; /* Skips between CCs max 14 */ } ts_analysis_data_t; typedef struct frame_analysis_data { - /* As each frame has several pid's, thus need a pid data - * structure per TS frame. - */ - wmem_tree_t *ts_table; + /* As each frame has several pid's, thus need a pid data + * structure per TS frame. + */ + wmem_tree_t *ts_table; } frame_analysis_data_t; static mp2t_analysis_data_t * init_mp2t_conversation_data(void) { - mp2t_analysis_data_t *mp2t_data = NULL; + mp2t_analysis_data_t *mp2t_data = NULL; - mp2t_data = wmem_new0(wmem_file_scope(), struct mp2t_analysis_data); + mp2t_data = wmem_new0(wmem_file_scope(), struct mp2t_analysis_data); - mp2t_data->pid_table = wmem_tree_new(wmem_file_scope()); + mp2t_data->pid_table = wmem_tree_new(wmem_file_scope()); - mp2t_data->frame_table = wmem_tree_new(wmem_file_scope()); + mp2t_data->frame_table = wmem_tree_new(wmem_file_scope()); - mp2t_data->total_skips = 0; - mp2t_data->total_discontinuity = 0; + mp2t_data->total_skips = 0; + mp2t_data->total_discontinuity = 0; - return mp2t_data; + return mp2t_data; } static mp2t_analysis_data_t * get_mp2t_conversation_data(conversation_t *conv) { - mp2t_analysis_data_t *mp2t_data = NULL; + mp2t_analysis_data_t *mp2t_data = NULL; - mp2t_data = (mp2t_analysis_data_t *)conversation_get_proto_data(conv, proto_mp2t); - if (!mp2t_data) { - mp2t_data = init_mp2t_conversation_data(); - conversation_add_proto_data(conv, proto_mp2t, mp2t_data); - } + mp2t_data = (mp2t_analysis_data_t *)conversation_get_proto_data(conv, proto_mp2t); + if (!mp2t_data) { + mp2t_data = init_mp2t_conversation_data(); + conversation_add_proto_data(conv, proto_mp2t, mp2t_data); + } - return mp2t_data; + return mp2t_data; } static frame_analysis_data_t * init_frame_analysis_data(mp2t_analysis_data_t *mp2t_data, packet_info *pinfo) { - frame_analysis_data_t *frame_analysis_data_p = NULL; + frame_analysis_data_t *frame_analysis_data_p = NULL; - frame_analysis_data_p = wmem_new0(wmem_file_scope(), struct frame_analysis_data); - frame_analysis_data_p->ts_table = wmem_tree_new(wmem_file_scope()); - /* Insert into mp2t tree */ - wmem_tree_insert32(mp2t_data->frame_table, pinfo->fd->num, - (void *)frame_analysis_data_p); + frame_analysis_data_p = wmem_new0(wmem_file_scope(), struct frame_analysis_data); + frame_analysis_data_p->ts_table = wmem_tree_new(wmem_file_scope()); + /* Insert into mp2t tree */ + wmem_tree_insert32(mp2t_data->frame_table, pinfo->fd->num, + (void *)frame_analysis_data_p); - return frame_analysis_data_p; + return frame_analysis_data_p; } static frame_analysis_data_t * get_frame_analysis_data(mp2t_analysis_data_t *mp2t_data, packet_info *pinfo) { - frame_analysis_data_t *frame_analysis_data_p = NULL; - frame_analysis_data_p = (frame_analysis_data_t *)wmem_tree_lookup32(mp2t_data->frame_table, pinfo->fd->num); - return frame_analysis_data_p; + frame_analysis_data_t *frame_analysis_data_p = NULL; + frame_analysis_data_p = (frame_analysis_data_t *)wmem_tree_lookup32(mp2t_data->frame_table, pinfo->fd->num); + return frame_analysis_data_p; } static pid_analysis_data_t * get_pid_analysis(guint32 pid, conversation_t *conv) { + pid_analysis_data_t *pid_data = NULL; + mp2t_analysis_data_t *mp2t_data = NULL; - pid_analysis_data_t *pid_data = NULL; - mp2t_analysis_data_t *mp2t_data = NULL; + mp2t_data = get_mp2t_conversation_data(conv); - mp2t_data = get_mp2t_conversation_data(conv); - - pid_data = (pid_analysis_data_t *)wmem_tree_lookup32(mp2t_data->pid_table, pid); - if (!pid_data) { - pid_data = wmem_new0(wmem_file_scope(), struct pid_analysis_data); - pid_data->cc_prev = -1; - pid_data->pid = pid; - pid_data->frag_id = (pid << (32 - 13)) | 0x1; - - wmem_tree_insert32(mp2t_data->pid_table, pid, (void *)pid_data); - } - return pid_data; + pid_data = (pid_analysis_data_t *)wmem_tree_lookup32(mp2t_data->pid_table, pid); + if (!pid_data) { + pid_data = wmem_new0(wmem_file_scope(), struct pid_analysis_data); + pid_data->cc_prev = -1; + pid_data->pid = pid; + pid_data->frag_id = (pid << (32 - 13)) | 0x1; + + wmem_tree_insert32(mp2t_data->pid_table, pid, (void *)pid_data); + } + return pid_data; } + /* Structure to handle packets, spanned across * multiple MPEG packets */ @@ -426,138 +427,127 @@ static void mp2t_dissect_packet(tvbuff_t *tvb, enum pid_payload_type pload_type, - packet_info *pinfo, proto_tree *tree) + packet_info *pinfo, proto_tree *tree) { - dissector_handle_t handle = NULL; - - - switch (pload_type) { - case pid_pload_docsis: - handle = docsis_handle; - break; - case pid_pload_pes: - handle = mpeg_pes_handle; - break; - case pid_pload_sect: - handle = mpeg_sect_handle; - break; - default: - /* Should not happen */ - break; - - } - - if (handle) - call_dissector(handle, tvb, pinfo, tree); - else - call_dissector(data_handle, tvb, pinfo, tree); - + dissector_handle_t handle = NULL; + switch (pload_type) { + case pid_pload_docsis: + handle = docsis_handle; + break; + case pid_pload_pes: + handle = mpeg_pes_handle; + break; + case pid_pload_sect: + handle = mpeg_sect_handle; + break; + default: + /* Should not happen */ + break; + } + + if (handle) + call_dissector(handle, tvb, pinfo, tree); + else + call_dissector(data_handle, tvb, pinfo, tree); } guint mp2t_get_packet_length(tvbuff_t *tvb, guint offset, packet_info *pinfo, - guint32 frag_id, enum pid_payload_type pload_type) + guint32 frag_id, enum pid_payload_type pload_type) { + fragment_head *frag = NULL; + tvbuff_t *len_tvb = NULL, *frag_tvb = NULL, *data_tvb = NULL; + gint pkt_len = 0; + guint remaining_len; + + remaining_len = tvb_length_remaining(tvb, offset); + frag = fragment_get(&mp2t_reassembly_table, pinfo, frag_id, NULL); + if (frag) + frag = frag->next; + + if (!frag) { /* First frame */ + if ( (pload_type == pid_pload_docsis && remaining_len < 4) || + (pload_type == pid_pload_sect && remaining_len < 3) || + (pload_type == pid_pload_pes && remaining_len < 5) ) { + /* Not enough info to determine the size of the encapulated packet */ + /* Just add the fragment and we'll check out the length later */ + return -1; + } + + len_tvb = tvb; + } else { + /* Create a composite tvb out of the two */ + frag_tvb = tvb_new_proxy(frag->tvb_data); + len_tvb = tvb_new_composite(); + tvb_composite_append(len_tvb, frag_tvb); + + data_tvb = tvb_new_subset_remaining(tvb, offset); + tvb_composite_append(len_tvb, data_tvb); + tvb_composite_finalize(len_tvb); + + offset = frag->offset; + } + + /* Get the next packet's size if possible */ + switch (pload_type) { + case pid_pload_docsis: + pkt_len = tvb_get_ntohs(len_tvb, offset + 2) + 6; + break; + case pid_pload_pes: + pkt_len = tvb_get_ntohs(len_tvb, offset + 4); + if (pkt_len) /* A size of 0 means size not bounded */ + pkt_len += 6; + break; + case pid_pload_sect: + pkt_len = (tvb_get_ntohs(len_tvb, offset + 1) & 0xFFF) + 3; + break; + default: + /* Should not happen */ + break; + } - fragment_head *frag = NULL; - tvbuff_t *len_tvb = NULL, *frag_tvb = NULL, *data_tvb = NULL; - gint pkt_len = 0; - guint remaining_len; - - - remaining_len = tvb_length_remaining(tvb, offset); - frag = fragment_get(&mp2t_reassembly_table, pinfo, frag_id, NULL); - if (frag) - frag = frag->next; - - if (!frag) { /* First frame */ - - if ( (pload_type == pid_pload_docsis && remaining_len < 4) || - (pload_type == pid_pload_sect && remaining_len < 3) || - (pload_type == pid_pload_pes && remaining_len < 5) ) { - /* Not enough info to determine the size of the encapulated packet */ - /* Just add the fragment and we'll check out the length later */ - return -1; - } - - len_tvb = tvb; - - } else { - /* Create a composite tvb out of the two */ - frag_tvb = tvb_new_proxy(frag->tvb_data); - len_tvb = tvb_new_composite(); - tvb_composite_append(len_tvb, frag_tvb); - - data_tvb = tvb_new_subset_remaining(tvb, offset); - tvb_composite_append(len_tvb, data_tvb); - tvb_composite_finalize(len_tvb); - - offset = frag->offset; - - } - - /* Get the next packet's size if possible */ - - switch (pload_type) { - case pid_pload_docsis: - pkt_len = tvb_get_ntohs(len_tvb, offset + 2) + 6; - break; - case pid_pload_pes: - pkt_len = tvb_get_ntohs(len_tvb, offset + 4); - if (pkt_len) /* A size of 0 means size not bounded */ - pkt_len += 6; - break; - case pid_pload_sect: - pkt_len = (tvb_get_ntohs(len_tvb, offset + 1) & 0xFFF) + 3; - break; - default: - /* Should not happen */ - break; - } - - if (frag_tvb) - tvb_free(frag_tvb); + if (frag_tvb) + tvb_free(frag_tvb); - return pkt_len; + return pkt_len; } static void mp2t_fragment_handle(tvbuff_t *tvb, guint offset, packet_info *pinfo, - proto_tree *tree, guint32 frag_id, - guint frag_offset, guint frag_len, - gboolean fragment_last, enum pid_payload_type pload_type) + proto_tree *tree, guint32 frag_id, + guint frag_offset, guint frag_len, + gboolean fragment_last, enum pid_payload_type pload_type) { - /* proto_item *ti; */ - fragment_head *frag_msg = NULL; - tvbuff_t *new_tvb = NULL; - gboolean save_fragmented; - - save_fragmented = pinfo->fragmented; - pinfo->fragmented = TRUE; - - /* check length; send frame for reassembly */ - frag_msg = fragment_add_check(&mp2t_reassembly_table, - tvb, offset, pinfo, frag_id, NULL, - frag_offset, - frag_len, - !fragment_last); - - new_tvb = process_reassembled_data(tvb, offset, pinfo, - "Reassembled MP2T", - frag_msg, &mp2t_msg_frag_items, - NULL, tree); - - if (new_tvb) { - /* ti = */ proto_tree_add_text(tree, tvb, 0, 0, "MPEG TS Packet (reassembled)"); - mp2t_dissect_packet(new_tvb, pload_type, pinfo, tree); - } - - pinfo->fragmented = save_fragmented; + /* proto_item *ti; */ + fragment_head *frag_msg = NULL; + tvbuff_t *new_tvb = NULL; + gboolean save_fragmented; + + save_fragmented = pinfo->fragmented; + pinfo->fragmented = TRUE; + + /* check length; send frame for reassembly */ + frag_msg = fragment_add_check(&mp2t_reassembly_table, + tvb, offset, pinfo, frag_id, NULL, + frag_offset, + frag_len, + !fragment_last); + + new_tvb = process_reassembled_data(tvb, offset, pinfo, + "Reassembled MP2T", + frag_msg, &mp2t_msg_frag_items, + NULL, tree); + + if (new_tvb) { + /* ti = */ proto_tree_add_text(tree, tvb, 0, 0, "MPEG TS Packet (reassembled)"); + mp2t_dissect_packet(new_tvb, pload_type, pinfo, tree); + } - return; + pinfo->fragmented = save_fragmented; } + /* Decoding of DOCSIS MAC frames within MPEG packets. MAC frames may begin anywhere * within an MPEG packet or span multiple MPEG packets. * payload_unit_start_indicator bit in MPEG header, and pointer field are used to @@ -579,223 +569,214 @@ */ static void mp2t_process_fragmented_payload(tvbuff_t *tvb, gint offset, guint remaining_len, packet_info *pinfo, - proto_tree *tree, proto_tree *header_tree, guint32 pusi_flag, - pid_analysis_data_t *pid_analysis) + proto_tree *tree, proto_tree *header_tree, guint32 pusi_flag, + pid_analysis_data_t *pid_analysis) { - tvbuff_t *next_tvb; - guint8 pointer = 0; - proto_item *pi; - guint stuff_len = 0; - proto_item *si; - proto_tree *stuff_tree; - packed_analysis_data_t *pdata = NULL; - subpacket_analysis_data_t *spdata = NULL; - guint32 frag_cur_pos = 0, frag_tot_len = 0; - gboolean fragmentation = FALSE; - guint32 frag_id = 0; - - if (pusi_flag && pid_analysis->pload_type == pid_pload_unknown - && remaining_len > 3) { - /* We should already have identified if it was a DOCSIS packet - * Remaining possibility is PES or SECT */ - if (tvb_get_ntoh24(tvb, offset) == 0x000001) { - /* Looks like a PES packet to me ... */ - pid_analysis->pload_type = pid_pload_pes; - } else { - /* Most probably a SECT packet */ - pid_analysis->pload_type = pid_pload_sect; - } - - } - - /* Unable to determine the payload type, do nothing */ - if (pid_analysis->pload_type == pid_pload_unknown) - return; - - /* PES packet don't have pointer fields, others do */ - if (pusi_flag && pid_analysis->pload_type != pid_pload_pes) { - pointer = tvb_get_guint8(tvb, offset); - pi = proto_tree_add_text(header_tree, tvb, offset, 1, - "Pointer: %u", tvb_get_guint8(tvb, offset)); - offset++; - remaining_len--; - if (pointer > remaining_len) { - /* Bogus pointer */ - expert_add_info_format(pinfo, pi, &ei_mp2t_pointer, - "Pointer value is too large (> remaining data length %u)", - remaining_len); - } - - } - - if (!pinfo->fd->flags.visited) { - /* Get values from our current PID analysis */ - frag_cur_pos = pid_analysis->frag_cur_pos; - frag_tot_len = pid_analysis->frag_tot_len; - fragmentation = pid_analysis->fragmentation; - frag_id = pid_analysis->frag_id; - pdata = (packed_analysis_data_t *)p_get_proto_data(pinfo->fd, proto_mp2t, 0); - if (!pdata) { - pdata = wmem_new0(wmem_file_scope(), packed_analysis_data_t); - pdata->subpacket_table = wmem_tree_new(wmem_file_scope()); - p_add_proto_data(pinfo->fd, proto_mp2t, 0, pdata); - - } else { - spdata = (subpacket_analysis_data_t *)wmem_tree_lookup32(pdata->subpacket_table, offset); - } - - if (!spdata) { - spdata = wmem_new0(wmem_file_scope(), subpacket_analysis_data_t); - /* Save the info into pdata from pid_analysis */ - spdata->frag_cur_pos = frag_cur_pos; - spdata->frag_tot_len = frag_tot_len; - spdata->fragmentation = fragmentation; - spdata->frag_id = frag_id; - wmem_tree_insert32(pdata->subpacket_table, offset, (void *)spdata); - - } - - } else { - /* Get saved values */ - pdata = (packed_analysis_data_t *)p_get_proto_data(pinfo->fd, proto_mp2t, 0); - if (!pdata) { - /* Occurs for the first packets in the capture which cannot be reassembled */ - return; - } - - spdata = (subpacket_analysis_data_t *)wmem_tree_lookup32(pdata->subpacket_table, offset); - if (!spdata) { - /* Occurs for the first sub packets in the capture which cannot be reassembled */ - return; - } - - frag_cur_pos = spdata->frag_cur_pos; - frag_tot_len = spdata->frag_tot_len; - fragmentation = spdata->fragmentation; - frag_id = spdata->frag_id; - } - - if (frag_tot_len == (guint)-1) { - frag_tot_len = mp2t_get_packet_length(tvb, offset, pinfo, frag_id, pid_analysis->pload_type); - - if (frag_tot_len == (guint)-1) { - return; - } - - } - - - /* The beginning of a new packet is present */ - if (pusi_flag) { - - if (pointer > remaining_len) { - /* - * Quit, so we don't use the bogus pointer value; - * that could cause remaining_len to become - * "negative", meaning it becomes a very large - * positive value. - */ - return; - } - - /* Looks like we already have some stuff in the buffer */ - if (fragmentation) { - mp2t_fragment_handle(tvb, offset, pinfo, tree, frag_id, frag_cur_pos, - pointer, TRUE, pid_analysis->pload_type); - frag_id++; - } - - offset += pointer; - remaining_len -= pointer; - fragmentation = FALSE; - frag_cur_pos = 0; - frag_tot_len = 0; - - if (!remaining_len) { - /* Shouldn't happen */ - goto save_state; - } - - while (remaining_len > 0) { - - /* Skip stuff bytes */ - stuff_len = 0; - while ((tvb_get_guint8(tvb, offset + stuff_len) == 0xFF)) { - stuff_len++; - if (stuff_len >= remaining_len) { - remaining_len = 0; - break; - } - } - - if (stuff_len) { - si = proto_tree_add_text(tree, tvb, offset, stuff_len, "Stuffing"); - stuff_tree = proto_item_add_subtree(si, ett_stuff); - proto_tree_add_item(stuff_tree, hf_mp2t_stuff_bytes, tvb, offset, stuff_len, ENC_NA); - offset += stuff_len; - if (stuff_len >= remaining_len) { - goto save_state; - } - remaining_len -= stuff_len; - - } - - - /* Get the next packet's size if possible */ - frag_tot_len = mp2t_get_packet_length(tvb, offset, pinfo, frag_id, pid_analysis->pload_type); - if (frag_tot_len == (guint)-1 || !frag_tot_len) { - mp2t_fragment_handle(tvb, offset, pinfo, tree, frag_id, 0, remaining_len, FALSE, pid_analysis->pload_type); - fragmentation = TRUE; - /*offset += remaining_len;*/ - frag_cur_pos += remaining_len; - goto save_state; - } - - /* Check for full packets within this TS frame */ - if (frag_tot_len && - frag_tot_len <= remaining_len) { - next_tvb = tvb_new_subset(tvb, offset, frag_tot_len, frag_tot_len); - mp2t_dissect_packet(next_tvb, pid_analysis->pload_type, pinfo, tree); - remaining_len -= frag_tot_len; - offset += frag_tot_len; - frag_tot_len = 0; - } else { - break; - } - - } - - if (remaining_len == 0) { - pid_analysis->frag_cur_pos = 0; - pid_analysis->frag_tot_len = 0; - goto save_state; - - } - - } - - /* There are remaining bytes. Add them to the fragment list */ - - if ((frag_tot_len && frag_cur_pos + remaining_len >= frag_tot_len) || (!frag_tot_len && pusi_flag)) { - mp2t_fragment_handle(tvb, offset, pinfo, tree, frag_id, frag_cur_pos, remaining_len, TRUE, pid_analysis->pload_type); - frag_id++; - fragmentation = FALSE; - frag_cur_pos = 0; - frag_tot_len = 0; - } else { - mp2t_fragment_handle(tvb, offset, pinfo, tree, frag_id, frag_cur_pos, remaining_len, FALSE, pid_analysis->pload_type); - fragmentation = TRUE; - frag_cur_pos += remaining_len; - } + tvbuff_t *next_tvb; + guint8 pointer = 0; + proto_item *pi; + guint stuff_len = 0; + proto_item *si; + proto_tree *stuff_tree; + packet_analysis_data_t *pdata = NULL; + subpacket_analysis_data_t *spdata = NULL; + guint32 frag_cur_pos = 0, frag_tot_len = 0; + gboolean fragmentation = FALSE; + guint32 frag_id = 0; + + if (pusi_flag && pid_analysis->pload_type == pid_pload_unknown + && remaining_len > 3) { + /* We should already have identified if it was a DOCSIS packet + * Remaining possibility is PES or SECT */ + if (tvb_get_ntoh24(tvb, offset) == 0x000001) { + /* Looks like a PES packet to me ... */ + pid_analysis->pload_type = pid_pload_pes; + } else { + /* Most probably a SECT packet */ + pid_analysis->pload_type = pid_pload_sect; + } + } -save_state: + /* Unable to determine the payload type, do nothing */ + if (pid_analysis->pload_type == pid_pload_unknown) + return; - pid_analysis->fragmentation = fragmentation; - pid_analysis->frag_cur_pos = frag_cur_pos; - pid_analysis->frag_tot_len = frag_tot_len; - pid_analysis->frag_id = frag_id; + /* PES packet don't have pointer fields, others do */ + if (pusi_flag && pid_analysis->pload_type != pid_pload_pes) { + pointer = tvb_get_guint8(tvb, offset); + pi = proto_tree_add_item(header_tree, hf_mp2t_pointer, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + remaining_len--; + if (pointer > remaining_len) { + /* Bogus pointer */ + expert_add_info_format(pinfo, pi, &ei_mp2t_pointer, + "Pointer value is too large (> remaining data length %u)", + remaining_len); + } + } + + if (!pinfo->fd->flags.visited) { + /* Get values from our current PID analysis */ + frag_cur_pos = pid_analysis->frag_cur_pos; + frag_tot_len = pid_analysis->frag_tot_len; + fragmentation = pid_analysis->fragmentation; + frag_id = pid_analysis->frag_id; + pdata = (packet_analysis_data_t *)p_get_proto_data(pinfo->fd, proto_mp2t, 0); + if (!pdata) { + pdata = wmem_new0(wmem_file_scope(), packet_analysis_data_t); + pdata->subpacket_table = wmem_tree_new(wmem_file_scope()); + p_add_proto_data(pinfo->fd, proto_mp2t, 0, pdata); + + } else { + spdata = (subpacket_analysis_data_t *)wmem_tree_lookup32(pdata->subpacket_table, offset); + } + + if (!spdata) { + spdata = wmem_new0(wmem_file_scope(), subpacket_analysis_data_t); + /* Save the info into pdata from pid_analysis */ + spdata->frag_cur_pos = frag_cur_pos; + spdata->frag_tot_len = frag_tot_len; + spdata->fragmentation = fragmentation; + spdata->frag_id = frag_id; + wmem_tree_insert32(pdata->subpacket_table, offset, (void *)spdata); + } + } else { + /* Get saved values */ + pdata = (packet_analysis_data_t *)p_get_proto_data(pinfo->fd, proto_mp2t, 0); + if (!pdata) { + /* Occurs for the first packets in the capture which cannot be reassembled */ + return; + } + + spdata = (subpacket_analysis_data_t *)wmem_tree_lookup32(pdata->subpacket_table, offset); + if (!spdata) { + /* Occurs for the first sub packets in the capture which cannot be reassembled */ + return; + } + + frag_cur_pos = spdata->frag_cur_pos; + frag_tot_len = spdata->frag_tot_len; + fragmentation = spdata->fragmentation; + frag_id = spdata->frag_id; + } + + if (frag_tot_len == (guint)-1) { + frag_tot_len = mp2t_get_packet_length(tvb, offset, pinfo, frag_id, pid_analysis->pload_type); + + if (frag_tot_len == (guint)-1) { + return; + } + } + + + /* The beginning of a new packet is present */ + if (pusi_flag) { + if (pointer > remaining_len) { + /* + * Quit, so we don't use the bogus pointer value; + * that could cause remaining_len to become + * "negative", meaning it becomes a very large + * positive value. + */ + return; + } + + /* "pointer" contains the number of bytes until the + * start of the new section + * if the new section does not start immediately after the + * pointer field (i.e. pointer>0), the remaining bytes before the + * start of the section are another fragment of the + * current packet */ + if (pointer>0 && fragmentation) { + mp2t_fragment_handle(tvb, offset, pinfo, tree, frag_id, frag_cur_pos, + pointer, TRUE, pid_analysis->pload_type); + frag_id++; + } + + offset += pointer; + remaining_len -= pointer; + fragmentation = FALSE; + frag_cur_pos = 0; + frag_tot_len = 0; + + if (!remaining_len) { + /* Shouldn't happen */ + goto save_state; + } + + while (remaining_len > 0) { + /* Skip stuff bytes */ + stuff_len = 0; + while ((tvb_get_guint8(tvb, offset + stuff_len) == 0xFF)) { + stuff_len++; + if (stuff_len >= remaining_len) { + remaining_len = 0; + break; + } + } + + if (stuff_len) { + si = proto_tree_add_text(tree, tvb, offset, stuff_len, "Stuffing"); + stuff_tree = proto_item_add_subtree(si, ett_stuff); + proto_tree_add_item(stuff_tree, hf_mp2t_stuff_bytes, tvb, offset, stuff_len, ENC_NA); + offset += stuff_len; + if (stuff_len >= remaining_len) { + goto save_state; + } + remaining_len -= stuff_len; + } + + /* Get the next packet's size if possible */ + frag_tot_len = mp2t_get_packet_length(tvb, offset, pinfo, frag_id, pid_analysis->pload_type); + if (frag_tot_len == (guint)-1 || !frag_tot_len) { + mp2t_fragment_handle(tvb, offset, pinfo, tree, frag_id, 0, remaining_len, FALSE, pid_analysis->pload_type); + fragmentation = TRUE; + /*offset += remaining_len;*/ + frag_cur_pos += remaining_len; + goto save_state; + } + + /* Check for full packets within this TS frame */ + if (frag_tot_len && + frag_tot_len <= remaining_len) { + next_tvb = tvb_new_subset(tvb, offset, frag_tot_len, frag_tot_len); + mp2t_dissect_packet(next_tvb, pid_analysis->pload_type, pinfo, tree); + remaining_len -= frag_tot_len; + offset += frag_tot_len; + frag_tot_len = 0; + } else { + break; + } + } + + if (remaining_len == 0) { + pid_analysis->frag_cur_pos = 0; + pid_analysis->frag_tot_len = 0; + goto save_state; + + } + + } + + /* There are remaining bytes. Add them to the fragment list */ + + if ((frag_tot_len && frag_cur_pos + remaining_len >= frag_tot_len) || (!frag_tot_len && pusi_flag)) { + mp2t_fragment_handle(tvb, offset, pinfo, tree, frag_id, frag_cur_pos, remaining_len, TRUE, pid_analysis->pload_type); + frag_id++; + fragmentation = FALSE; + frag_cur_pos = 0; + frag_tot_len = 0; + } else { + mp2t_fragment_handle(tvb, offset, pinfo, tree, frag_id, frag_cur_pos, remaining_len, FALSE, pid_analysis->pload_type); + fragmentation = TRUE; + frag_cur_pos += remaining_len; + } - return; +save_state: + pid_analysis->fragmentation = fragmentation; + pid_analysis->frag_cur_pos = frag_cur_pos; + pid_analysis->frag_tot_len = frag_tot_len; + pid_analysis->frag_id = frag_id; } @@ -807,755 +788,756 @@ static guint32 calc_skips(gint32 curr, gint32 prev) { - int res = 0; + int res = 0; - /* Only count the missing TS frames in between prev and curr. - * The "prev" frame CC number seen is confirmed received, it's - * the next frames CC counter which is the first known missing - * TS frame - */ - prev += 1; - - /* Calc missing TS frame 'skips' */ - res = curr - prev; - - /* Handle wrap around */ - if (res < 0) - res += 16; + /* Only count the missing TS frames in between prev and curr. + * The "prev" frame CC number seen is confirmed received, it's + * the next frames CC counter which is the first known missing + * TS frame + */ + prev += 1; + + /* Calc missing TS frame 'skips' */ + res = curr - prev; + + /* Handle wrap around */ + if (res < 0) + res += 16; - return res; + return res; } #define KEY(pid, cc) ((pid << 4)|cc) static guint32 detect_cc_drops(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, - guint32 pid, gint32 cc_curr, conversation_t *conv) + guint32 pid, gint32 cc_curr, conversation_t *conv) { - gint32 cc_prev = -1; - pid_analysis_data_t *pid_data = NULL; - ts_analysis_data_t *ts_data = NULL; - mp2t_analysis_data_t *mp2t_data = NULL; - frame_analysis_data_t *frame_analysis_data_p = NULL; - proto_item *flags_item; - - guint32 detected_drop = 0; - guint32 skips = 0; - - mp2t_data = get_mp2t_conversation_data(conv); - - /* The initial sequencial processing stage */ - if (!pinfo->fd->flags.visited) { - - /* This is the sequencial processing stage */ - pid_data = get_pid_analysis(pid, conv); - - cc_prev = pid_data->cc_prev; - pid_data->cc_prev = cc_curr; - - /* Null packet always have a CC value equal 0 */ - if (pid == 0x1fff) - return 0; - - /* Its allowed that (cc_prev == cc_curr) if adaptation field */ - if (cc_prev == cc_curr) - return 0; - - /* Have not seen this pid before */ - if (cc_prev == -1) - return 0; - - /* Detect if CC is not increasing by one all the time */ - if (cc_curr != ((cc_prev+1) & MP2T_CC_MASK)) { - detected_drop = 1; - - skips = calc_skips(cc_curr, cc_prev); - - mp2t_data->total_skips += skips; - mp2t_data->total_discontinuity++; - /* TODO: if (skips > 7) signal_loss++; ??? */ - } - } - - /* Save the info about the dropped packet */ - if (detected_drop && !pinfo->fd->flags.visited) { - - /* Lookup frame data, contains TS pid data objects */ - frame_analysis_data_p = get_frame_analysis_data(mp2t_data, pinfo); - if (!frame_analysis_data_p) - frame_analysis_data_p = init_frame_analysis_data(mp2t_data, pinfo); - - /* Create and store a new TS frame pid_data object. - This indicate that we have a drop - */ - ts_data = wmem_new0(wmem_file_scope(), struct ts_analysis_data); - ts_data->cc_prev = cc_prev; - ts_data->pid = pid; - ts_data->skips = skips; - wmem_tree_insert32(frame_analysis_data_p->ts_table, KEY(pid, cc_curr), - (void *)ts_data); - } - - /* See if we stored info about drops */ - if (pinfo->fd->flags.visited) { - - /* Lookup frame data, contains TS pid data objects */ - frame_analysis_data_p = get_frame_analysis_data(mp2t_data, pinfo); - if (!frame_analysis_data_p) - return 0; /* No stored frame data -> no drops*/ - else { - ts_data = (struct ts_analysis_data *)wmem_tree_lookup32(frame_analysis_data_p->ts_table, - KEY(pid, cc_curr)); - - if (ts_data) { - if (ts_data->skips > 0) { - detected_drop = 1; - cc_prev = ts_data->cc_prev; - skips = ts_data->skips; - } - } - } - - } - - /* Add info to the proto tree about drops */ - if (detected_drop) { - expert_add_info_format(pinfo, tree, &ei_mp2t_cc_drop, - "Detected %d missing TS frames before this (last_cc:%d total skips:%d discontinuity:%d)", - skips, cc_prev, - mp2t_data->total_skips, - mp2t_data->total_discontinuity - ); - - flags_item = proto_tree_add_uint(tree, hf_mp2t_analysis_skips, - tvb, 0, 0, skips); - PROTO_ITEM_SET_GENERATED(flags_item); - - flags_item = proto_tree_add_uint(tree, hf_mp2t_analysis_drops, + gint32 cc_prev = -1; + pid_analysis_data_t *pid_data = NULL; + ts_analysis_data_t *ts_data = NULL; + mp2t_analysis_data_t *mp2t_data = NULL; + frame_analysis_data_t *frame_analysis_data_p = NULL; + proto_item *flags_item; + + guint32 detected_drop = 0; + guint32 skips = 0; + + mp2t_data = get_mp2t_conversation_data(conv); + + /* The initial sequencial processing stage */ + if (!pinfo->fd->flags.visited) { + /* This is the sequencial processing stage */ + pid_data = get_pid_analysis(pid, conv); + + cc_prev = pid_data->cc_prev; + pid_data->cc_prev = cc_curr; + + /* Null packet always have a CC value equal 0 */ + if (pid == 0x1fff) + return 0; + + /* Its allowed that (cc_prev == cc_curr) if adaptation field */ + if (cc_prev == cc_curr) + return 0; + + /* Have not seen this pid before */ + if (cc_prev == -1) + return 0; + + /* Detect if CC is not increasing by one all the time */ + if (cc_curr != ((cc_prev+1) & MP2T_CC_MASK)) { + detected_drop = 1; + + skips = calc_skips(cc_curr, cc_prev); + + mp2t_data->total_skips += skips; + mp2t_data->total_discontinuity++; + /* TODO: if (skips > 7) signal_loss++; ??? */ + } + } + + /* Save the info about the dropped packet */ + if (detected_drop && !pinfo->fd->flags.visited) { + /* Lookup frame data, contains TS pid data objects */ + frame_analysis_data_p = get_frame_analysis_data(mp2t_data, pinfo); + if (!frame_analysis_data_p) + frame_analysis_data_p = init_frame_analysis_data(mp2t_data, pinfo); + + /* Create and store a new TS frame pid_data object. + This indicate that we have a drop + */ + ts_data = wmem_new0(wmem_file_scope(), struct ts_analysis_data); + ts_data->cc_prev = cc_prev; + ts_data->pid = pid; + ts_data->skips = skips; + wmem_tree_insert32(frame_analysis_data_p->ts_table, KEY(pid, cc_curr), + (void *)ts_data); + } + + /* See if we stored info about drops */ + if (pinfo->fd->flags.visited) { + + /* Lookup frame data, contains TS pid data objects */ + frame_analysis_data_p = get_frame_analysis_data(mp2t_data, pinfo); + if (!frame_analysis_data_p) + return 0; /* No stored frame data -> no drops*/ + else { + ts_data = (struct ts_analysis_data *)wmem_tree_lookup32(frame_analysis_data_p->ts_table, + KEY(pid, cc_curr)); + + if (ts_data) { + if (ts_data->skips > 0) { + detected_drop = 1; + cc_prev = ts_data->cc_prev; + skips = ts_data->skips; + } + } + } + } + + /* Add info to the proto tree about drops */ + if (detected_drop) { + expert_add_info_format(pinfo, tree, &ei_mp2t_cc_drop, + "Detected %d missing TS frames before this (last_cc:%d total skips:%d discontinuity:%d)", + skips, cc_prev, + mp2t_data->total_skips, + mp2t_data->total_discontinuity + ); + + flags_item = proto_tree_add_uint(tree, hf_mp2t_analysis_skips, + tvb, 0, 0, skips); + PROTO_ITEM_SET_GENERATED(flags_item); + + flags_item = proto_tree_add_uint(tree, hf_mp2t_analysis_drops, + tvb, 0, 0, 1); + PROTO_ITEM_SET_GENERATED(flags_item); + } + return skips; +} - tvb, 0, 0, 1); - PROTO_ITEM_SET_GENERATED(flags_item); +static gint +dissect_mp2t_adaptation_field(tvbuff_t *tvb, gint offset, guint8 af_length, + packet_info *pinfo _U_, proto_tree *tree) +{ + gint af_start_offset; + proto_item *hi; + proto_tree *mp2t_af_tree; + guint8 af_flags; + gint stuffing_len; + + + af_start_offset = offset; + + hi = proto_tree_add_item( tree, hf_mp2t_af, tvb, offset, af_length, ENC_NA); + mp2t_af_tree = proto_item_add_subtree( hi, ett_mp2t_af ); + + af_flags = tvb_get_guint8(tvb, offset); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_di, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_rai, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_espi, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_pcr_flag, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_opcr_flag, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_sp_flag, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_tpd_flag, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_afe_flag, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + + if (af_flags & MP2T_AF_PCR_MASK) { + guint64 pcr_base = 0; + guint32 pcr_ext = 0; + guint8 tmp; + + tmp = tvb_get_guint8(tvb, offset); + pcr_base = (pcr_base << 8) | tmp; + offset += 1; + + tmp = tvb_get_guint8(tvb, offset); + pcr_base = (pcr_base << 8) | tmp; + offset += 1; + + tmp = tvb_get_guint8(tvb, offset); + pcr_base = (pcr_base << 8) | tmp; + offset += 1; + + tmp = tvb_get_guint8(tvb, offset); + pcr_base = (pcr_base << 8) | tmp; + offset += 1; + + tmp = tvb_get_guint8(tvb, offset); + pcr_base = (pcr_base << 1) | ((tmp >> 7) & 0x01); + pcr_ext = (tmp & 0x01); + offset += 1; + + tmp = tvb_get_guint8(tvb, offset); + pcr_ext = (pcr_ext << 8) | tmp; + offset += 1; + + proto_tree_add_none_format(mp2t_af_tree, hf_mp2t_af_pcr, tvb, offset - 6, 6, + "Program Clock Reference: base(%" G_GINT64_MODIFIER "u) * 300 + ext(%u) = %" G_GINT64_MODIFIER "u", + pcr_base, pcr_ext, pcr_base * 300 + pcr_ext); + } + + if (af_flags & MP2T_AF_OPCR_MASK) { + guint64 opcr_base = 0; + guint32 opcr_ext = 0; + guint8 tmp = 0; + + tmp = tvb_get_guint8(tvb, offset); + opcr_base = (opcr_base << 8) | tmp; + offset += 1; + + tmp = tvb_get_guint8(tvb, offset); + opcr_base = (opcr_base << 8) | tmp; + offset += 1; + + tmp = tvb_get_guint8(tvb, offset); + opcr_base = (opcr_base << 8) | tmp; + offset += 1; + + tmp = tvb_get_guint8(tvb, offset); + opcr_base = (opcr_base << 8) | tmp; + offset += 1; + + tmp = tvb_get_guint8(tvb, offset); + opcr_base = (opcr_base << 1) | ((tmp >> 7) & 0x01); + opcr_ext = (tmp & 0x01); + offset += 1; + + tmp = tvb_get_guint8(tvb, offset); + opcr_ext = (opcr_ext << 8) | tmp; + offset += 1; + + proto_tree_add_none_format(mp2t_af_tree, hf_mp2t_af_opcr, tvb, offset - 6, 6, + "Original Program Clock Reference: base(%" G_GINT64_MODIFIER "u) * 300 + ext(%u) = %" G_GINT64_MODIFIER "u", + opcr_base, opcr_ext, opcr_base * 300 + opcr_ext); + + offset += 6; + } + + if (af_flags & MP2T_AF_SP_MASK) { + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_sc, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + } + + if (af_flags & MP2T_AF_TPD_MASK) { + guint8 tpd_len; + + tpd_len = tvb_get_guint8(tvb, offset); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_tpd_length, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_tpd, tvb, offset, tpd_len, ENC_NA); + offset += tpd_len; + } + + if (af_flags & MP2T_AF_AFE_MASK) { + guint8 e_len; + guint8 e_flags; + gint e_start_offset = offset; + gint reserved_len = 0; + + e_len = tvb_get_guint8(tvb, offset); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_length, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + + e_flags = tvb_get_guint8(tvb, offset); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_ltw_flag, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_pr_flag, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_ss_flag, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + + if (e_flags & MP2T_AF_E_LTW_FLAG_MASK) { + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_ltwv_flag, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_ltwo, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + } + + if (e_flags & MP2T_AF_E_PR_FLAG_MASK) { + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_pr_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_pr, tvb, offset, 3, ENC_BIG_ENDIAN); + offset += 3; + } + + if (e_flags & MP2T_AF_E_SS_FLAG_MASK) { + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_st, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_dnau_32_30, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_m_1, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_dnau_29_15, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_m_2, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_dnau_14_0, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_m_3, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + } + + reserved_len = (e_len + 1) - (offset - e_start_offset); + if (reserved_len > 0) { + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_reserved_bytes, tvb, offset, reserved_len, ENC_NA); + offset += reserved_len; + } + } + + stuffing_len = af_length - (offset - af_start_offset); + if (stuffing_len > 0) { + proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_stuffing_bytes, tvb, offset, stuffing_len, ENC_NA); + offset += stuffing_len; + } - } - return skips; + return offset-af_start_offset; } - static void dissect_tsp(tvbuff_t *tvb, volatile gint offset, packet_info *pinfo, - proto_tree *tree, conversation_t *conv) + proto_tree *tree, conversation_t *conv) { - guint32 header; - guint afc; - gint start_offset = offset; - volatile gint payload_len; - pid_analysis_data_t *pid_analysis; - - guint32 skips; - guint32 pid; - guint32 cc; - guint32 pusi_flag; - - guint32 tsc; - - proto_item *ti = NULL; - proto_item *hi = NULL; - proto_item *item = NULL; - proto_tree *mp2t_tree = NULL; - proto_tree *mp2t_header_tree = NULL; - proto_tree *mp2t_af_tree = NULL; - proto_tree *mp2t_analysis_tree = NULL; - proto_item *afci = NULL; - - ti = proto_tree_add_item( tree, proto_mp2t, tvb, offset, MP2T_PACKET_SIZE, ENC_NA ); - mp2t_tree = proto_item_add_subtree( ti, ett_mp2t ); - - header = tvb_get_ntohl(tvb, offset); - - pid = (header & MP2T_PID_MASK) >> MP2T_PID_SHIFT; - cc = (header & MP2T_CC_MASK) >> MP2T_CC_SHIFT; - tsc = (header & MP2T_TSC_MASK); - pusi_flag = (header & 0x00400000); - proto_item_append_text(ti, " PID=0x%x CC=%d", pid, cc); - col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPEG TS"); - - hi = proto_tree_add_item( mp2t_tree, hf_mp2t_header, tvb, offset, 4, ENC_BIG_ENDIAN); - mp2t_header_tree = proto_item_add_subtree( hi, ett_mp2t_header ); - - proto_tree_add_item( mp2t_header_tree, hf_mp2t_sync_byte, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_header_tree, hf_mp2t_tei, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_header_tree, hf_mp2t_pusi, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_header_tree, hf_mp2t_tp, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_header_tree, hf_mp2t_pid, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_header_tree, hf_mp2t_tsc, tvb, offset, 4, ENC_BIG_ENDIAN); - afci = proto_tree_add_item( mp2t_header_tree, hf_mp2t_afc, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_header_tree, hf_mp2t_cc, tvb, offset, 4, ENC_BIG_ENDIAN); - - afc = (header & MP2T_AFC_MASK) >> MP2T_AFC_SHIFT; - - pid_analysis = get_pid_analysis(pid, conv); - - /* Find out the payload type based on the payload */ - if (pid_analysis->pload_type == pid_pload_unknown) { - if (pid == MP2T_PID_NULL) { - pid_analysis->pload_type = pid_pload_null; - } else if (pid == MP2T_PID_DOCSIS) { - pid_analysis->pload_type = pid_pload_docsis; - } - } - - if (pid_analysis->pload_type == pid_pload_docsis && afc) { - /* DOCSIS packets should not have an adaptation field */ - proto_item_append_text(afci, " (Invalid for DOCSIS packets, should be 0)"); - } - - if (pid_analysis->pload_type == pid_pload_null) { - /* Nothing more to do */ - col_set_str(pinfo->cinfo, COL_INFO, "NULL packet"); - proto_item_append_text(afci, " (Should be 0 for NULL packets)"); - return; - } - - offset += 4; - - /* Create a subtree for analysis stuff */ - item = proto_tree_add_text(mp2t_tree, tvb, offset, 0, "MPEG2 PCR Analysis"); - PROTO_ITEM_SET_GENERATED(item); - mp2t_analysis_tree = proto_item_add_subtree(item, ett_mp2t_analysis); - - skips = detect_cc_drops(tvb, mp2t_analysis_tree, pinfo, pid, cc, conv); - if (skips > 0) - proto_item_append_text(ti, " skips=%d", skips); - - if (afc == 2 || afc == 3) - { - gint af_start_offset = offset; - - guint8 af_length; - guint8 af_flags; - gint stuffing_len; - - - af_length = tvb_get_guint8(tvb, offset); - - proto_tree_add_item( mp2t_tree, hf_mp2t_af_length, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; - /* fix issues where afc==3 but af_length==0 - * Adaptaion field...spec section 2.4.3.5: The value 0 is for inserting a single - * stuffing byte in a Transport Stream packet. When the adaptation_field_control - * value is '11', the value of the adaptation_field_length shall be in the range 0 to 182. - */ - if (af_length > 0 ) { - hi = proto_tree_add_item( mp2t_tree, hf_mp2t_af, tvb, offset, af_length, ENC_NA); - mp2t_af_tree = proto_item_add_subtree( hi, ett_mp2t_af ); - - af_flags = tvb_get_guint8(tvb, offset); - - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_di, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_rai, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_espi, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_pcr_flag, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_opcr_flag, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_sp_flag, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_tpd_flag, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_afe_flag, tvb, offset, 1, ENC_BIG_ENDIAN); - - offset += 1; - - if (af_flags & MP2T_AF_PCR_MASK) { - guint64 pcr_base = 0; - guint32 pcr_ext = 0; - guint8 tmp; - - tmp = tvb_get_guint8(tvb, offset); - pcr_base = (pcr_base << 8) | tmp; - offset += 1; - - tmp = tvb_get_guint8(tvb, offset); - pcr_base = (pcr_base << 8) | tmp; - offset += 1; - - tmp = tvb_get_guint8(tvb, offset); - pcr_base = (pcr_base << 8) | tmp; - offset += 1; - - tmp = tvb_get_guint8(tvb, offset); - pcr_base = (pcr_base << 8) | tmp; - offset += 1; - - tmp = tvb_get_guint8(tvb, offset); - pcr_base = (pcr_base << 1) | ((tmp >> 7) & 0x01); - pcr_ext = (tmp & 0x01); - offset += 1; - - tmp = tvb_get_guint8(tvb, offset); - pcr_ext = (pcr_ext << 8) | tmp; - offset += 1; - - proto_tree_add_none_format(mp2t_af_tree, hf_mp2t_af_pcr, tvb, offset - 6, 6, - "Program Clock Reference: base(%" G_GINT64_MODIFIER "u) * 300 + ext(%u) = %" G_GINT64_MODIFIER "u", - pcr_base, pcr_ext, pcr_base * 300 + pcr_ext); - } - - if (af_flags & MP2T_AF_OPCR_MASK) { - guint64 opcr_base = 0; - guint32 opcr_ext = 0; - guint8 tmp = 0; - - tmp = tvb_get_guint8(tvb, offset); - opcr_base = (opcr_base << 8) | tmp; - offset += 1; - - tmp = tvb_get_guint8(tvb, offset); - opcr_base = (opcr_base << 8) | tmp; - offset += 1; - - tmp = tvb_get_guint8(tvb, offset); - opcr_base = (opcr_base << 8) | tmp; - offset += 1; - - tmp = tvb_get_guint8(tvb, offset); - opcr_base = (opcr_base << 8) | tmp; - offset += 1; - - tmp = tvb_get_guint8(tvb, offset); - opcr_base = (opcr_base << 1) | ((tmp >> 7) & 0x01); - opcr_ext = (tmp & 0x01); - offset += 1; - - tmp = tvb_get_guint8(tvb, offset); - opcr_ext = (opcr_ext << 8) | tmp; - offset += 1; - - proto_tree_add_none_format(mp2t_af_tree, hf_mp2t_af_opcr, tvb, offset - 6, 6, - "Original Program Clock Reference: base(%" G_GINT64_MODIFIER "u) * 300 + ext(%u) = %" G_GINT64_MODIFIER "u", - opcr_base, opcr_ext, opcr_base * 300 + opcr_ext); - - offset += 6; - } - - if (af_flags & MP2T_AF_SP_MASK) { - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_sc, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; - } - - if (af_flags & MP2T_AF_TPD_MASK) { - guint8 tpd_len; - - tpd_len = tvb_get_guint8(tvb, offset); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_tpd_length, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; - - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_tpd, tvb, offset, tpd_len, ENC_NA); - offset += tpd_len; - } - - if (af_flags & MP2T_AF_AFE_MASK) { - guint8 e_len; - guint8 e_flags; - gint e_start_offset = offset; - gint reserved_len = 0; - - e_len = tvb_get_guint8(tvb, offset); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_length, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; - - e_flags = tvb_get_guint8(tvb, offset); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_ltw_flag, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_pr_flag, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_ss_flag, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; - - if (e_flags & MP2T_AF_E_LTW_FLAG_MASK) { - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_ltwv_flag, tvb, offset, 2, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_ltwo, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - } - - if (e_flags & MP2T_AF_E_PR_FLAG_MASK) { - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_pr_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_pr, tvb, offset, 3, ENC_BIG_ENDIAN); - offset += 3; - } - - if (e_flags & MP2T_AF_E_SS_FLAG_MASK) { - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_st, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_dnau_32_30, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_m_1, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_dnau_29_15, tvb, offset, 2, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_m_2, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_dnau_14_0, tvb, offset, 2, ENC_BIG_ENDIAN); - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_m_3, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - } - - reserved_len = (e_len + 1) - (offset - e_start_offset); - if (reserved_len > 0) { - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_e_reserved_bytes, tvb, offset, reserved_len, ENC_NA); - offset += reserved_len; - } - } - - stuffing_len = (af_length + 1) - (offset - af_start_offset); - if (stuffing_len > 0) { - proto_tree_add_item( mp2t_af_tree, hf_mp2t_af_stuffing_bytes, tvb, offset, stuffing_len, ENC_NA); - offset += stuffing_len; - } - } - } - - if ((offset - start_offset) < MP2T_PACKET_SIZE) - payload_len = MP2T_PACKET_SIZE - (offset - start_offset); - else - payload_len = 0; - - if (!payload_len) - return; - - if (afc == 2) { - col_set_str(pinfo->cinfo, COL_INFO, "Adaptation field only"); - /* The rest of the packet is stuffing bytes */ - proto_tree_add_item( mp2t_tree, hf_mp2t_stuff_bytes, tvb, offset, payload_len, ENC_NA); - offset += payload_len; - } - - if (!tsc) { - mp2t_process_fragmented_payload(tvb, offset, payload_len, pinfo, tree, mp2t_tree, pusi_flag, pid_analysis); - } else { - /* Payload is scrambled */ - col_set_str(pinfo->cinfo, COL_INFO, "Scrambled TS payload"); - } + guint32 header; + guint afc; + guint8 af_length; + gint start_offset = offset; + volatile gint payload_len; + pid_analysis_data_t *pid_analysis; + + guint32 skips; + guint32 pid; + guint32 cc; + guint32 pusi_flag; + + guint32 tsc; + + proto_item *ti = NULL; + proto_item *hi = NULL; + proto_item *item = NULL; + proto_tree *mp2t_tree = NULL; + proto_tree *mp2t_header_tree = NULL; + proto_tree *mp2t_analysis_tree = NULL; + proto_item *afci = NULL; + + ti = proto_tree_add_item( tree, proto_mp2t, tvb, offset, MP2T_PACKET_SIZE, ENC_NA ); + mp2t_tree = proto_item_add_subtree( ti, ett_mp2t ); + + header = tvb_get_ntohl(tvb, offset); + + pid = (header & MP2T_PID_MASK) >> MP2T_PID_SHIFT; + cc = (header & MP2T_CC_MASK) >> MP2T_CC_SHIFT; + tsc = (header & MP2T_TSC_MASK); + pusi_flag = (header & 0x00400000); + proto_item_append_text(ti, " PID=0x%x CC=%d", pid, cc); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPEG TS"); + + hi = proto_tree_add_item( mp2t_tree, hf_mp2t_header, tvb, offset, 4, ENC_BIG_ENDIAN); + mp2t_header_tree = proto_item_add_subtree( hi, ett_mp2t_header ); + + proto_tree_add_item( mp2t_header_tree, hf_mp2t_sync_byte, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_header_tree, hf_mp2t_tei, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_header_tree, hf_mp2t_pusi, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_header_tree, hf_mp2t_tp, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_header_tree, hf_mp2t_pid, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_header_tree, hf_mp2t_tsc, tvb, offset, 4, ENC_BIG_ENDIAN); + afci = proto_tree_add_item( mp2t_header_tree, hf_mp2t_afc, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item( mp2t_header_tree, hf_mp2t_cc, tvb, offset, 4, ENC_BIG_ENDIAN); + + afc = (header & MP2T_AFC_MASK) >> MP2T_AFC_SHIFT; + + pid_analysis = get_pid_analysis(pid, conv); + + /* Find out the payload type based on the payload */ + if (pid_analysis->pload_type == pid_pload_unknown) { + if (pid == MP2T_PID_NULL) { + pid_analysis->pload_type = pid_pload_null; + } else if (pid == MP2T_PID_DOCSIS) { + pid_analysis->pload_type = pid_pload_docsis; + } + } + + if (pid_analysis->pload_type == pid_pload_docsis && afc) { + /* DOCSIS packets should not have an adaptation field */ + proto_item_append_text(afci, " (Invalid for DOCSIS packets, should be 0)"); + } + + if (pid_analysis->pload_type == pid_pload_null) { + /* Nothing more to do */ + col_set_str(pinfo->cinfo, COL_INFO, "NULL packet"); + proto_item_append_text(afci, " (Should be 0 for NULL packets)"); + return; + } + + offset += 4; + + /* Create a subtree for analysis stuff */ + item = proto_tree_add_text(mp2t_tree, tvb, offset, 0, "MPEG2 PCR Analysis"); + PROTO_ITEM_SET_GENERATED(item); + mp2t_analysis_tree = proto_item_add_subtree(item, ett_mp2t_analysis); + + skips = detect_cc_drops(tvb, mp2t_analysis_tree, pinfo, pid, cc, conv); + if (skips > 0) + proto_item_append_text(ti, " skips=%d", skips); + + if (afc == 2 || afc == 3) { + af_length = tvb_get_guint8(tvb, offset); + proto_tree_add_item( mp2t_tree, hf_mp2t_af_length, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + /* fix issues where afc==3 but af_length==0 + * Adaptaion field...spec section 2.4.3.5: The value 0 is for inserting a single + * stuffing byte in a Transport Stream packet. When the adaptation_field_control + * value is '11', the value of the adaptation_field_length shall be in the range 0 to 182. + */ + if (af_length>0) + offset += dissect_mp2t_adaptation_field(tvb, offset, af_length, pinfo, mp2t_tree); + } + + if ((offset - start_offset) < MP2T_PACKET_SIZE) + payload_len = MP2T_PACKET_SIZE - (offset - start_offset); + else + payload_len = 0; - return; + if (!payload_len) + return; + + if (afc == 2) { + col_set_str(pinfo->cinfo, COL_INFO, "Adaptation field only"); + /* The rest of the packet is stuffing bytes */ + proto_tree_add_item( mp2t_tree, hf_mp2t_stuff_bytes, tvb, offset, payload_len, ENC_NA); + offset += payload_len; + } + + if (!tsc) { + mp2t_process_fragmented_payload(tvb, offset, payload_len, pinfo, tree, mp2t_tree, pusi_flag, pid_analysis); + } else { + /* Payload is scrambled */ + col_set_str(pinfo->cinfo, COL_INFO, "Scrambled TS payload"); + } } static void dissect_mp2t( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { - guint offset = 0; - conversation_t *conv; - - conv = find_or_create_conversation(pinfo); + guint offset = 0; + conversation_t *conv; - for (; tvb_reported_length_remaining(tvb, offset) >= MP2T_PACKET_SIZE; offset += MP2T_PACKET_SIZE) { + conv = find_or_create_conversation(pinfo); - dissect_tsp(tvb, offset, pinfo, tree, conv); - } + for (; tvb_reported_length_remaining(tvb, offset) >= MP2T_PACKET_SIZE; offset += MP2T_PACKET_SIZE) { + dissect_tsp(tvb, offset, pinfo, tree, conv); + } } static gboolean heur_dissect_mp2t( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ ) { - gint length; - guint offset = 0; + gint length; + guint offset = 0; - length = tvb_length_remaining(tvb, offset); - if (length == 0) { - /* Nothing to check for */ - return FALSE; - } - if ((length % MP2T_PACKET_SIZE) != 0) { - /* Not a multiple of the MPEG-2 transport packet size */ - return FALSE; - } else { - while (tvb_offset_exists(tvb, offset)) { - if (tvb_get_guint8(tvb, offset) != MP2T_SYNC_BYTE) { - /* No sync byte at the appropriate offset */ - return FALSE; - } - offset += MP2T_PACKET_SIZE; - } - } + length = tvb_length_remaining(tvb, offset); + if (length == 0) { + /* Nothing to check for */ + return FALSE; + } + if ((length % MP2T_PACKET_SIZE) != 0) { + /* Not a multiple of the MPEG-2 transport packet size */ + return FALSE; + } else { + while (tvb_offset_exists(tvb, offset)) { + if (tvb_get_guint8(tvb, offset) != MP2T_SYNC_BYTE) { + /* No sync byte at the appropriate offset */ + return FALSE; + } + offset += MP2T_PACKET_SIZE; + } + } - dissect_mp2t(tvb, pinfo, tree); - return TRUE; + dissect_mp2t(tvb, pinfo, tree); + return TRUE; } static void mp2t_init(void) { - reassembly_table_init(&mp2t_reassembly_table, - &addresses_reassembly_table_functions); + reassembly_table_init(&mp2t_reassembly_table, + &addresses_reassembly_table_functions); } void proto_register_mp2t(void) { - static hf_register_info hf[] = { - { &hf_mp2t_header, { - "Header", "mp2t.header", - FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL - } } , - { &hf_mp2t_sync_byte, { - "Sync Byte", "mp2t.sync_byte", - FT_UINT32, BASE_HEX, VALS(mp2t_sync_byte_vals), MP2T_SYNC_BYTE_MASK, NULL, HFILL - } } , - { &hf_mp2t_tei, { - "Transport Error Indicator", "mp2t.tei", - FT_UINT32, BASE_DEC, NULL, MP2T_TEI_MASK, NULL, HFILL - } } , - { &hf_mp2t_pusi, { - "Payload Unit Start Indicator", "mp2t.pusi", - FT_UINT32, BASE_DEC, NULL, MP2T_PUSI_MASK, NULL, HFILL - } } , - { &hf_mp2t_tp, { - "Transport Priority", "mp2t.tp", - FT_UINT32, BASE_DEC, NULL, MP2T_TP_MASK, NULL, HFILL - } } , - { &hf_mp2t_pid, { - "PID", "mp2t.pid", - FT_UINT32, BASE_HEX, VALS(mp2t_pid_vals), MP2T_PID_MASK, NULL, HFILL - } } , - { &hf_mp2t_tsc, { - "Transport Scrambling Control", "mp2t.tsc", - FT_UINT32, BASE_HEX, VALS(mp2t_tsc_vals), MP2T_TSC_MASK, NULL, HFILL - } } , - { &hf_mp2t_afc, { - "Adaptation Field Control", "mp2t.afc", - FT_UINT32, BASE_HEX, VALS(mp2t_afc_vals) , MP2T_AFC_MASK, NULL, HFILL - } } , - { &hf_mp2t_cc, { - "Continuity Counter", "mp2t.cc", - FT_UINT32, BASE_DEC, NULL, MP2T_CC_MASK, NULL, HFILL - } } , + static hf_register_info hf[] = { + { &hf_mp2t_header, { + "Header", "mp2t.header", + FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL + } } , + { &hf_mp2t_sync_byte, { + "Sync Byte", "mp2t.sync_byte", + FT_UINT32, BASE_HEX, VALS(mp2t_sync_byte_vals), MP2T_SYNC_BYTE_MASK, NULL, HFILL + } } , + { &hf_mp2t_tei, { + "Transport Error Indicator", "mp2t.tei", + FT_UINT32, BASE_DEC, NULL, MP2T_TEI_MASK, NULL, HFILL + } } , + { &hf_mp2t_pusi, { + "Payload Unit Start Indicator", "mp2t.pusi", + FT_UINT32, BASE_DEC, NULL, MP2T_PUSI_MASK, NULL, HFILL + } } , + { &hf_mp2t_tp, { + "Transport Priority", "mp2t.tp", + FT_UINT32, BASE_DEC, NULL, MP2T_TP_MASK, NULL, HFILL + } } , + { &hf_mp2t_pid, { + "PID", "mp2t.pid", + FT_UINT32, BASE_HEX, VALS(mp2t_pid_vals), MP2T_PID_MASK, NULL, HFILL + } } , + { &hf_mp2t_tsc, { + "Transport Scrambling Control", "mp2t.tsc", + FT_UINT32, BASE_HEX, VALS(mp2t_tsc_vals), MP2T_TSC_MASK, NULL, HFILL + } } , + { &hf_mp2t_afc, { + "Adaptation Field Control", "mp2t.afc", + FT_UINT32, BASE_HEX, VALS(mp2t_afc_vals) , MP2T_AFC_MASK, NULL, HFILL + } } , + { &hf_mp2t_cc, { + "Continuity Counter", "mp2t.cc", + FT_UINT32, BASE_DEC, NULL, MP2T_CC_MASK, NULL, HFILL + } } , #if 0 - { &hf_mp2t_analysis_flags, { - "MPEG2-TS Analysis Flags", "mp2t.analysis.flags", - FT_NONE, BASE_NONE, NULL, 0x0, - "This frame has some of the MPEG2 analysis flags set", HFILL - } } , + { &hf_mp2t_analysis_flags, { + "MPEG2-TS Analysis Flags", "mp2t.analysis.flags", + FT_NONE, BASE_NONE, NULL, 0x0, + "This frame has some of the MPEG2 analysis flags set", HFILL + } } , #endif - { &hf_mp2t_analysis_skips, { - "TS Continuity Counter Skips", "mp2t.analysis.skips", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Missing TS frames according to CC counter values", HFILL - } } , - { &hf_mp2t_analysis_drops, { - "Some frames dropped", "mp2t.analysis.drops", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Discontinuity: A number of TS frames were dropped", HFILL - } } , - { &hf_mp2t_af, { - "Adaptation Field", "mp2t.af", - FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL - } } , - { &hf_mp2t_af_length, { - "Adaptation Field Length", "mp2t.af.length", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } } , - { &hf_mp2t_af_di, { - "Discontinuity Indicator", "mp2t.af.di", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_DI_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_rai, { - "Random Access Indicator", "mp2t.af.rai", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_RAI_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_espi, { - "Elementary Stream Priority Indicator", "mp2t.af.espi", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_ESPI_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_pcr_flag, { - "PCR Flag", "mp2t.af.pcr_flag", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_PCR_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_opcr_flag, { - "OPCR Flag", "mp2t.af.opcr_flag", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_OPCR_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_sp_flag, { - "Splicing Point Flag", "mp2t.af.sp_flag", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_SP_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_tpd_flag, { - "Transport Private Data Flag", "mp2t.af.tpd_flag", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_TPD_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_afe_flag, { - "Adaptation Field Extension Flag", "mp2t.af.afe_flag", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_AFE_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_pcr, { - "Program Clock Reference", "mp2t.af.pcr", - FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL - } } , - { &hf_mp2t_af_opcr, { - "Original Program Clock Reference", "mp2t.af.opcr", - FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL - } } , - { &hf_mp2t_af_sc, { - "Splice Countdown", "mp2t.af.sc", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } } , - { &hf_mp2t_af_tpd_length, { - "Transport Private Data Length", "mp2t.af.tpd_length", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } } , - { &hf_mp2t_af_tpd, { - "Transport Private Data", "mp2t.af.tpd", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } } , - { &hf_mp2t_af_e_length, { - "Adaptation Field Extension Length", "mp2t.af.e_length", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } } , - { &hf_mp2t_af_e_ltw_flag, { - "LTW Flag", "mp2t.af.e.ltw_flag", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_E_LTW_FLAG_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_e_pr_flag, { - "Piecewise Rate Flag", "mp2t.af.e.pr_flag", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_E_PR_FLAG_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_e_ss_flag, { - "Seamless Splice Flag", "mp2t.af.e.ss_flag", - FT_UINT8, BASE_DEC, NULL, MP2T_AF_E_SS_FLAG_MASK, NULL, HFILL - } } , - { &hf_mp2t_af_e_reserved, { - "Reserved", "mp2t.af.e.reserved", - FT_UINT8, BASE_DEC, NULL, 0x1F, NULL, HFILL - } } , - { &hf_mp2t_af_e_reserved_bytes, { - "Reserved", "mp2t.af.e.reserved_bytes", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } } , - { &hf_mp2t_af_stuffing_bytes, { - "Stuffing", "mp2t.af.stuffing_bytes", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } } , - { &hf_mp2t_af_e_ltwv_flag, { - "LTW Valid Flag", "mp2t.af.e.ltwv_flag", - FT_UINT16, BASE_DEC, NULL, 0x8000, NULL, HFILL - } } , - { &hf_mp2t_af_e_ltwo, { - "LTW Offset", "mp2t.af.e.ltwo", - FT_UINT16, BASE_DEC, NULL, 0x7FFF, NULL, HFILL - } } , - { &hf_mp2t_af_e_pr_reserved, { - "Reserved", "mp2t.af.e.pr_reserved", - FT_UINT24, BASE_DEC, NULL, 0xC00000, NULL, HFILL - } } , - { &hf_mp2t_af_e_pr, { - "Piecewise Rate", "mp2t.af.e.pr", - FT_UINT24, BASE_DEC, NULL, 0x3FFFFF, NULL, HFILL - } } , - { &hf_mp2t_af_e_st, { - "Splice Type", "mp2t.af.e.st", - FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL - } } , - { &hf_mp2t_af_e_dnau_32_30, { - "DTS Next AU[32...30]", "mp2t.af.e.dnau_32_30", - FT_UINT8, BASE_DEC, NULL, 0x0E, NULL, HFILL - } } , - { &hf_mp2t_af_e_m_1, { - "Marker Bit", "mp2t.af.e.m_1", - FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL - } } , - { &hf_mp2t_af_e_dnau_29_15, { - "DTS Next AU[29...15]", "mp2t.af.e.dnau_29_15", - FT_UINT16, BASE_DEC, NULL, 0xFFFE, NULL, HFILL - } } , - { &hf_mp2t_af_e_m_2, { - "Marker Bit", "mp2t.af.e.m_2", - FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL - } } , - { &hf_mp2t_af_e_dnau_14_0, { - "DTS Next AU[14...0]", "mp2t.af.e.dnau_14_0", - FT_UINT16, BASE_DEC, NULL, 0xFFFE, NULL, HFILL - } } , - { &hf_mp2t_af_e_m_3, { - "Marker Bit", "mp2t.af.e.m_3", - FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL - } } , + { &hf_mp2t_analysis_skips, { + "TS Continuity Counter Skips", "mp2t.analysis.skips", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Missing TS frames according to CC counter values", HFILL + } } , + { &hf_mp2t_analysis_drops, { + "Some frames dropped", "mp2t.analysis.drops", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Discontinuity: A number of TS frames were dropped", HFILL + } } , + { &hf_mp2t_af, { + "Adaptation Field", "mp2t.af", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL + } } , + { &hf_mp2t_af_length, { + "Adaptation Field Length", "mp2t.af.length", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } } , + { &hf_mp2t_af_di, { + "Discontinuity Indicator", "mp2t.af.di", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_DI_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_rai, { + "Random Access Indicator", "mp2t.af.rai", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_RAI_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_espi, { + "Elementary Stream Priority Indicator", "mp2t.af.espi", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_ESPI_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_pcr_flag, { + "PCR Flag", "mp2t.af.pcr_flag", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_PCR_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_opcr_flag, { + "OPCR Flag", "mp2t.af.opcr_flag", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_OPCR_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_sp_flag, { + "Splicing Point Flag", "mp2t.af.sp_flag", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_SP_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_tpd_flag, { + "Transport Private Data Flag", "mp2t.af.tpd_flag", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_TPD_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_afe_flag, { + "Adaptation Field Extension Flag", "mp2t.af.afe_flag", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_AFE_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_pcr, { + "Program Clock Reference", "mp2t.af.pcr", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL + } } , + { &hf_mp2t_af_opcr, { + "Original Program Clock Reference", "mp2t.af.opcr", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL + } } , + { &hf_mp2t_af_sc, { + "Splice Countdown", "mp2t.af.sc", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } } , + { &hf_mp2t_af_tpd_length, { + "Transport Private Data Length", "mp2t.af.tpd_length", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } } , + { &hf_mp2t_af_tpd, { + "Transport Private Data", "mp2t.af.tpd", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } } , + { &hf_mp2t_af_e_length, { + "Adaptation Field Extension Length", "mp2t.af.e_length", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } } , + { &hf_mp2t_af_e_ltw_flag, { + "LTW Flag", "mp2t.af.e.ltw_flag", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_E_LTW_FLAG_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_e_pr_flag, { + "Piecewise Rate Flag", "mp2t.af.e.pr_flag", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_E_PR_FLAG_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_e_ss_flag, { + "Seamless Splice Flag", "mp2t.af.e.ss_flag", + FT_UINT8, BASE_DEC, NULL, MP2T_AF_E_SS_FLAG_MASK, NULL, HFILL + } } , + { &hf_mp2t_af_e_reserved, { + "Reserved", "mp2t.af.e.reserved", + FT_UINT8, BASE_DEC, NULL, 0x1F, NULL, HFILL + } } , + { &hf_mp2t_af_e_reserved_bytes, { + "Reserved", "mp2t.af.e.reserved_bytes", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } } , + { &hf_mp2t_af_stuffing_bytes, { + "Stuffing", "mp2t.af.stuffing_bytes", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } } , + { &hf_mp2t_af_e_ltwv_flag, { + "LTW Valid Flag", "mp2t.af.e.ltwv_flag", + FT_UINT16, BASE_DEC, NULL, 0x8000, NULL, HFILL + } } , + { &hf_mp2t_af_e_ltwo, { + "LTW Offset", "mp2t.af.e.ltwo", + FT_UINT16, BASE_DEC, NULL, 0x7FFF, NULL, HFILL + } } , + { &hf_mp2t_af_e_pr_reserved, { + "Reserved", "mp2t.af.e.pr_reserved", + FT_UINT24, BASE_DEC, NULL, 0xC00000, NULL, HFILL + } } , + { &hf_mp2t_af_e_pr, { + "Piecewise Rate", "mp2t.af.e.pr", + FT_UINT24, BASE_DEC, NULL, 0x3FFFFF, NULL, HFILL + } } , + { &hf_mp2t_af_e_st, { + "Splice Type", "mp2t.af.e.st", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL + } } , + { &hf_mp2t_af_e_dnau_32_30, { + "DTS Next AU[32...30]", "mp2t.af.e.dnau_32_30", + FT_UINT8, BASE_DEC, NULL, 0x0E, NULL, HFILL + } } , + { &hf_mp2t_af_e_m_1, { + "Marker Bit", "mp2t.af.e.m_1", + FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL + } } , + { &hf_mp2t_af_e_dnau_29_15, { + "DTS Next AU[29...15]", "mp2t.af.e.dnau_29_15", + FT_UINT16, BASE_DEC, NULL, 0xFFFE, NULL, HFILL + } } , + { &hf_mp2t_af_e_m_2, { + "Marker Bit", "mp2t.af.e.m_2", + FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL + } } , + { &hf_mp2t_af_e_dnau_14_0, { + "DTS Next AU[14...0]", "mp2t.af.e.dnau_14_0", + FT_UINT16, BASE_DEC, NULL, 0xFFFE, NULL, HFILL + } } , + { &hf_mp2t_af_e_m_3, { + "Marker Bit", "mp2t.af.e.m_3", + FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL + } } , #if 0 - { &hf_mp2t_payload, { - "Payload", "mp2t.payload", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } } , + { &hf_mp2t_payload, { + "Payload", "mp2t.payload", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } } , #endif - { &hf_mp2t_stuff_bytes, { - "Stuffing", "mp2t.stuff_bytes", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } }, - { &hf_msg_fragments, { - "Message fragments", "mp2t.msg.fragments", - FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL - } }, - { &hf_msg_fragment, { - "Message fragment", "mp2t.msg.fragment", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL - } }, - { &hf_msg_fragment_overlap, { - "Message fragment overlap", "mp2t.msg.fragment.overlap", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL - } }, - { &hf_msg_fragment_overlap_conflicts, { - "Message fragment overlapping with conflicting data", - "mp2t.msg.fragment.overlap.conflicts", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL - } }, - { &hf_msg_fragment_multiple_tails, { - "Message has multiple tail fragments", - "mp2t.msg.fragment.multiple_tails", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL - } }, - { &hf_msg_fragment_too_long_fragment, { - "Message fragment too long", "mp2t.msg.fragment.too_long_fragment", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL - } }, - { &hf_msg_fragment_error, { - "Message defragmentation error", "mp2t.msg.fragment.error", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL - } }, - { &hf_msg_fragment_count, { - "Message fragment count", "mp2t.msg.fragment.count", - FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL - } }, - { &hf_msg_reassembled_in, { - "Reassembled in", "mp2t.msg.reassembled.in", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL - } }, - { &hf_msg_reassembled_length, { - "Reassembled MP2T length", "mp2t.msg.reassembled.length", - FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL - } } - }; - - static gint *ett[] = - { - &ett_mp2t, - &ett_mp2t_header, - &ett_mp2t_af, - &ett_mp2t_analysis, - &ett_stuff, - &ett_msg_fragment, - &ett_msg_fragments - }; - - static ei_register_info ei[] = { - { &ei_mp2t_pointer, { "mp2t.pointer", PI_MALFORMED, PI_ERROR, "Pointer value is too large", EXPFILL }}, - { &ei_mp2t_cc_drop, { "mp2t.cc.drop", PI_MALFORMED, PI_ERROR, "Detected missing TS frames", EXPFILL }}, - }; - - expert_module_t* expert_mp2t; - - proto_mp2t = proto_register_protocol("ISO/IEC 13818-1", "MP2T", "mp2t"); - - mp2t_handle = register_dissector("mp2t", dissect_mp2t, proto_mp2t); - - proto_register_field_array(proto_mp2t, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - expert_mp2t = expert_register_protocol(proto_mp2t); - expert_register_field_array(expert_mp2t, ei, array_length(ei)); - - register_heur_dissector_list("mp2t.pid", &heur_subdissector_list); - /* Register init of processing of fragmented DEPI packets */ - register_init_routine(mp2t_init); + { &hf_mp2t_stuff_bytes, { + "Stuffing", "mp2t.stuff_bytes", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } }, + { &hf_mp2t_pointer, { + "Pointer", "mp2t.pointer", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } }, + { &hf_msg_fragments, { + "Message fragments", "mp2t.msg.fragments", + FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL + } }, + { &hf_msg_fragment, { + "Message fragment", "mp2t.msg.fragment", + FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL + } }, + { &hf_msg_fragment_overlap, { + "Message fragment overlap", "mp2t.msg.fragment.overlap", + FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL + } }, + { &hf_msg_fragment_overlap_conflicts, { + "Message fragment overlapping with conflicting data", + "mp2t.msg.fragment.overlap.conflicts", + FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL + } }, + { &hf_msg_fragment_multiple_tails, { + "Message has multiple tail fragments", + "mp2t.msg.fragment.multiple_tails", + FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL + } }, + { &hf_msg_fragment_too_long_fragment, { + "Message fragment too long", "mp2t.msg.fragment.too_long_fragment", + FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL + } }, + { &hf_msg_fragment_error, { + "Message defragmentation error", "mp2t.msg.fragment.error", + FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL + } }, + { &hf_msg_fragment_count, { + "Message fragment count", "mp2t.msg.fragment.count", + FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL + } }, + { &hf_msg_reassembled_in, { + "Reassembled in", "mp2t.msg.reassembled.in", + FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL + } }, + { &hf_msg_reassembled_length, { + "Reassembled MP2T length", "mp2t.msg.reassembled.length", + FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL + } } + }; + + static gint *ett[] = + { + &ett_mp2t, + &ett_mp2t_header, + &ett_mp2t_af, + &ett_mp2t_analysis, + &ett_stuff, + &ett_msg_fragment, + &ett_msg_fragments + }; + + static ei_register_info ei[] = { + { &ei_mp2t_pointer, { "mp2t.pointer", PI_MALFORMED, PI_ERROR, "Pointer value is too large", EXPFILL }}, + { &ei_mp2t_cc_drop, { "mp2t.cc.drop", PI_MALFORMED, PI_ERROR, "Detected missing TS frames", EXPFILL }}, + }; + + expert_module_t* expert_mp2t; + + proto_mp2t = proto_register_protocol("ISO/IEC 13818-1", "MP2T", "mp2t"); + + mp2t_handle = register_dissector("mp2t", dissect_mp2t, proto_mp2t); + + proto_register_field_array(proto_mp2t, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + expert_mp2t = expert_register_protocol(proto_mp2t); + expert_register_field_array(expert_mp2t, ei, array_length(ei)); + + register_heur_dissector_list("mp2t.pid", &heur_subdissector_list); + /* Register init of processing of fragmented DEPI packets */ + register_init_routine(mp2t_init); } @@ -1563,16 +1545,28 @@ void proto_reg_handoff_mp2t(void) { - heur_dissector_add("udp", heur_dissect_mp2t, proto_mp2t); + heur_dissector_add("udp", heur_dissect_mp2t, proto_mp2t); - dissector_add_uint("rtp.pt", PT_MP2T, mp2t_handle); - dissector_add_handle("udp.port", mp2t_handle); /* for decode-as */ - heur_dissector_add("usb.bulk", heur_dissect_mp2t, proto_mp2t); - dissector_add_uint("wtap_encap", WTAP_ENCAP_MPEG_2_TS, mp2t_handle); - - docsis_handle = find_dissector("docsis"); - mpeg_pes_handle = find_dissector("mpeg-pes"); - mpeg_sect_handle = find_dissector("mpeg_sect"); - data_handle = find_dissector("data"); + dissector_add_uint("rtp.pt", PT_MP2T, mp2t_handle); + dissector_add_handle("udp.port", mp2t_handle); /* for decode-as */ + heur_dissector_add("usb.bulk", heur_dissect_mp2t, proto_mp2t); + dissector_add_uint("wtap_encap", WTAP_ENCAP_MPEG_2_TS, mp2t_handle); + + docsis_handle = find_dissector("docsis"); + mpeg_pes_handle = find_dissector("mpeg-pes"); + mpeg_sect_handle = find_dissector("mpeg_sect"); + data_handle = find_dissector("data"); } +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-mpeg-descriptor.c wireshark-1.12.0~201311020920/epan/dissectors/packet-mpeg-descriptor.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-mpeg-descriptor.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-mpeg-descriptor.c 2013-11-02 02:12:36.000000000 +0000 @@ -1930,14 +1930,16 @@ /* 0x5F Private Data Specifier */ static int hf_mpeg_descr_private_data_specifier_id = -1; -#define PRIVATE_DATA_SPECIFIER_RESERVED 0x00000000 -#define PRIVATE_DATA_SPECIFIER_NORDIG 0x00000029 -#define PRIVATE_DATA_SPECIFIER_CIPLUS_LLP 0x00000040 +#define PRIVATE_DATA_SPECIFIER_RESERVED 0x00000000 +#define PRIVATE_DATA_SPECIFIER_NORDIG 0x00000029 +#define PRIVATE_DATA_SPECIFIER_CIPLUS_LLP 0x00000040 +#define PRIVATE_DATA_SPECIFIER_EUTELSAT_SA 0x0000055F static const value_string mpeg_descr_data_specifier_id_vals[] = { { PRIVATE_DATA_SPECIFIER_RESERVED, "reserved" }, { PRIVATE_DATA_SPECIFIER_NORDIG, "NorDig" }, { PRIVATE_DATA_SPECIFIER_CIPLUS_LLP, "CI+ LLP" }, + { PRIVATE_DATA_SPECIFIER_EUTELSAT_SA, "Eutelsat S.A." }, /* See dvbservices.com for complete and current list */ { 0, NULL } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-mpeg-dsmcc.c wireshark-1.12.0~201311020920/epan/dissectors/packet-mpeg-dsmcc.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-mpeg-dsmcc.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-mpeg-dsmcc.c 2013-11-02 02:12:36.000000000 +0000 @@ -1224,6 +1224,7 @@ proto_register_subtree_array(ett, array_length(ett)); expert_dsmcc = expert_register_protocol(proto_dsmcc); expert_register_field_array(expert_dsmcc, ei, array_length(ei)); + new_register_dissector("mp2t-dsmcc", dissect_dsmcc_ts, proto_dsmcc); dsmcc_module = prefs_register_protocol(proto_dsmcc, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-mrcpv2.c wireshark-1.12.0~201311020920/epan/dissectors/packet-mrcpv2.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-mrcpv2.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-mrcpv2.c 2013-11-02 02:12:36.000000000 +0000 @@ -509,7 +509,7 @@ switch(line_type){ case REQUEST_LINE: { - col_add_str(pinfo->cinfo, COL_INFO, "Request: "); + col_set_str(pinfo->cinfo, COL_INFO, "Request: "); line_item = proto_tree_add_item(mrcpv2_tree, hf_mrcpv2_Request_Line, tvb, offset, linelen, ENC_UTF_8); request_line_item = proto_item_add_subtree(line_item, ett_Request_Line); /* version */ @@ -533,7 +533,7 @@ break; case RESPONSE_LINE: { - col_add_str(pinfo->cinfo, COL_INFO, "Response: "); + col_set_str(pinfo->cinfo, COL_INFO, "Response: "); line_item = proto_tree_add_item(mrcpv2_tree, hf_mrcpv2_Response_Line, tvb, offset, linelen, ENC_UTF_8); response_line_item = proto_item_add_subtree(line_item, ett_Response_Line); /* version */ @@ -563,7 +563,7 @@ break; case EVENT_LINE: { - col_add_str(pinfo->cinfo, COL_INFO, "Event: "); + col_set_str(pinfo->cinfo, COL_INFO, "Event: "); line_item = proto_tree_add_item(mrcpv2_tree, hf_mrcpv2_Event_Line, tvb, offset, linelen, ENC_UTF_8); event_line_item = proto_item_add_subtree(line_item, ett_Event_Line); /* version */ @@ -592,7 +592,7 @@ default: { /* mark whole packet as unknown and return */ - col_add_str(pinfo->cinfo, COL_INFO, "UNKNOWN message"); + col_set_str(pinfo->cinfo, COL_INFO, "UNKNOWN message"); proto_tree_add_item(mrcpv2_tree, hf_mrcpv2_Unknown_Message, tvb, offset, tvb_len, ENC_UTF_8); return tvb_len; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-msdp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-msdp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-msdp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-msdp.c 2013-11-02 02:12:36.000000000 +0000 @@ -183,7 +183,7 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MSDP"); - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(tvb, 0), + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(tvb, 0), msdp_types, "")); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-msproxy.c wireshark-1.12.0~201311020920/epan/dissectors/packet-msproxy.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-msproxy.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-msproxy.c 2013-11-02 02:12:36.000000000 +0000 @@ -243,7 +243,7 @@ if ( redirect_info->proto == PT_TCP) decode_tcp_ports( tvb, 0, pinfo, tree, pinfo->srcport, - pinfo->destport, NULL); + pinfo->destport, NULL, NULL); else decode_udp_ports( tvb, 0, pinfo, tree, pinfo->srcport, pinfo->destport, -1); @@ -1271,8 +1271,7 @@ expert_module_t* expert_msproxy; - proto_msproxy = proto_register_protocol( "MS Proxy Protocol", - "MS Proxy", "msproxy"); + proto_msproxy = proto_register_protocol( "MS Proxy Protocol", "MS Proxy", "msproxy"); proto_register_field_array(proto_msproxy, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-mux27010.c wireshark-1.12.0~201311020920/epan/dissectors/packet-mux27010.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-mux27010.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-mux27010.c 2013-11-02 02:12:36.000000000 +0000 @@ -421,16 +421,16 @@ proto_tree_add_uint(field_tree, hf_mux27010_direction, tvb, offset, 1, direction_in_out & 3); switch (direction_in_out & 3) { case (0):/*Application >> Module*/ - col_add_str(pinfo->cinfo, COL_DEF_SRC, "Application DLCI "); - col_add_str(pinfo->cinfo, COL_DEF_DST, "Module"); + col_set_str(pinfo->cinfo, COL_DEF_SRC, "Application DLCI "); + col_set_str(pinfo->cinfo, COL_DEF_DST, "Module"); break; case (1):/*Module >> Application*/ - col_add_str(pinfo->cinfo, COL_DEF_SRC, "Module DLCI "); - col_add_str(pinfo->cinfo, COL_DEF_DST, "Application"); + col_set_str(pinfo->cinfo, COL_DEF_SRC, "Module DLCI "); + col_set_str(pinfo->cinfo, COL_DEF_DST, "Application"); break; default:/*?? >> ??*/ - col_add_str(pinfo->cinfo, COL_DEF_SRC, "Direction not valid "); - col_add_str(pinfo->cinfo, COL_DEF_DST, "Direction not valid "); + col_set_str(pinfo->cinfo, COL_DEF_SRC, "Direction not valid "); + col_set_str(pinfo->cinfo, COL_DEF_DST, "Direction not valid "); break; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-nasdaq-itch.c wireshark-1.12.0~201311020920/epan/dissectors/packet-nasdaq-itch.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-nasdaq-itch.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-nasdaq-itch.c 2013-11-02 02:12:36.000000000 +0000 @@ -290,7 +290,6 @@ } rep = val_to_str(nasdaq_itch_type, message_types_val, "Unknown packet type (0x%02x) "); - col_clear(pinfo->cinfo, COL_INFO); col_add_str(pinfo->cinfo, COL_INFO, rep); if (tree) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-nbipx.c wireshark-1.12.0~201311020920/epan/dissectors/packet-nbipx.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-nbipx.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-nbipx.c 2013-11-02 02:12:36.000000000 +0000 @@ -333,7 +333,7 @@ case NBIPX_SESSION_DATA: case NBIPX_SESSION_END: case NBIPX_SESSION_END_ACK: - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown")); dissect_conn_control(tvb, offset, nbipx_tree); @@ -373,7 +373,7 @@ break; case NBIPX_DIRECTED_DATAGRAM: - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown")); dissect_conn_control(tvb, offset, nbipx_tree); @@ -399,7 +399,7 @@ break; default: - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown")); /* diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-nbns.c wireshark-1.12.0~201311020920/epan/dissectors/packet-nbns.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-nbns.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-nbns.c 2013-11-02 02:12:36.000000000 +0000 @@ -1620,10 +1620,30 @@ return length + 4; } -static void -dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_continuation_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - struct tcpinfo *tcpinfo = (struct tcpinfo *)pinfo->private_data; + proto_tree *nbss_tree; + proto_item *ti; + + /* + * It looks like a continuation. + */ + col_set_str(pinfo->cinfo, COL_INFO, "NBSS Continuation Message"); + + if (tree) { + ti = proto_tree_add_item(tree, proto_nbss, tvb, 0, -1, ENC_NA); + nbss_tree = proto_item_add_subtree(ti, ett_nbss); + proto_tree_add_text(nbss_tree, tvb, 0, -1, "Continuation data"); + } + + return tvb_length(tvb); +} + +static int +dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) +{ + struct tcpinfo *tcpinfo = (struct tcpinfo *)data; int offset = 0; int max_data; guint8 msg_type; @@ -1631,8 +1651,6 @@ guint32 length; int len; gboolean is_cifs; - proto_tree *nbss_tree; - proto_item *ti; col_set_str(pinfo->cinfo, COL_PROTOCOL, "NBSS"); col_clear(pinfo->cinfo, COL_INFO); @@ -1679,7 +1697,7 @@ * attempt to reassemble the data, if the first byte * is a valid message type. */ - goto continuation; + return dissect_continuation_packet(tvb, pinfo, tree); } /* @@ -1721,7 +1739,7 @@ /* * A bogus flag was set; assume it's a continuation. */ - goto continuation; + return dissect_continuation_packet(tvb, pinfo, tree); } switch (msg_type) { @@ -1735,7 +1753,7 @@ * protocols have them.) */ if (length == 0) - goto continuation; + return dissect_continuation_packet(tvb, pinfo, tree); break; @@ -1759,7 +1777,7 @@ * bytes of data. */ if (length < 2 || length > 256) - goto continuation; + return dissect_continuation_packet(tvb, pinfo, tree); break; case POSITIVE_SESSION_RESPONSE: @@ -1767,7 +1785,7 @@ * This has no data, so the length must be zero. */ if (length != 0) - goto continuation; + return dissect_continuation_packet(tvb, pinfo, tree); break; case NEGATIVE_SESSION_RESPONSE: @@ -1775,7 +1793,7 @@ * This has 1 byte of data. */ if (length != 1) - goto continuation; + return dissect_continuation_packet(tvb, pinfo, tree); break; case RETARGET_SESSION_RESPONSE: @@ -1783,7 +1801,7 @@ * This has 6 bytes of data. */ if (length != 6) - goto continuation; + return dissect_continuation_packet(tvb, pinfo, tree); break; case SESSION_KEEP_ALIVE: @@ -1791,14 +1809,14 @@ * This has no data, so the length must be zero. */ if (length != 0) - goto continuation; + return dissect_continuation_packet(tvb, pinfo, tree); break; default: /* * Unknown message type; assume it's a continuation. */ - goto continuation; + return dissect_continuation_packet(tvb, pinfo, tree); } } @@ -1819,24 +1837,12 @@ */ pinfo->desegment_offset = offset; pinfo->desegment_len = -len; - return; + return tvb_length(tvb); } offset += len; } - return; - -continuation: - /* - * It looks like a continuation. - */ - col_set_str(pinfo->cinfo, COL_INFO, "NBSS Continuation Message"); - - if (tree) { - ti = proto_tree_add_item(tree, proto_nbss, tvb, 0, -1, ENC_NA); - nbss_tree = proto_item_add_subtree(ti, ett_nbss); - proto_tree_add_text(nbss_tree, tvb, 0, -1, "Continuation data"); - } + return tvb_length(tvb); } void @@ -2043,7 +2049,7 @@ nbdgm_handle = create_dissector_handle(dissect_nbdgm, proto_nbdgm); dissector_add_uint("udp.port", UDP_PORT_NBDGM, nbdgm_handle); - nbss_handle = create_dissector_handle(dissect_nbss, proto_nbss); + nbss_handle = new_create_dissector_handle(dissect_nbss, proto_nbss); dissector_add_uint("tcp.port", TCP_PORT_NBSS, nbss_handle); dissector_add_uint("tcp.port", TCP_PORT_CIFS, nbss_handle); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ndmp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ndmp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ndmp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ndmp.c 2013-11-02 02:12:36.000000000 +0000 @@ -44,7 +44,6 @@ #include "packet-scsi.h" #include #include -#include #define TCP_PORT_NDMP 10000 @@ -3164,7 +3163,7 @@ */ DISSECTOR_ASSERT((pinfo != NULL) && (pinfo->private_data != NULL)); - tcpinfo = (struct tcpinfo *)pinfo->private_data; + tcpinfo = (struct tcpinfo *)p_get_proto_data(pinfo->fd, proto_ndmp, 0); seq = tcpinfo->seq; len = (ndmp_rm & RPC_RM_FRAGLEN) + 4; @@ -3256,8 +3255,7 @@ */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDMP"); - col_clear(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_INFO, "[NDMP fragment] "); + col_set_str(pinfo->cinfo, COL_INFO, "[NDMP fragment] "); /* * Add the record marker information to the tree @@ -3509,12 +3507,18 @@ * as the protocol dissector for this conversation. */ static int -dissect_ndmp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_ndmp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { if (tvb_length(tvb) < 28) return 0; if (!check_if_ndmp(tvb, pinfo)) return 0; + + /* XXX - tcp_dissect_pdus() doesn't have a way to pass dissector data, so store + the tcpinfo structure from the TCP dissector as proto_data to be retrieved + in dissect_ndmp_message() */ + p_add_proto_data(pinfo->fd, proto_ndmp, 0, data); + tcp_dissect_pdus(tvb, pinfo, tree, ndmp_desegment, 28, get_ndmp_pdu_len, dissect_ndmp_message); return tvb_length(tvb); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-netrom.c wireshark-1.12.0~201311020920/epan/dissectors/packet-netrom.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-netrom.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-netrom.c 2013-11-02 02:12:36.000000000 +0000 @@ -208,7 +208,6 @@ guint8 op_code; guint8 cct_index; guint8 cct_id; - void *saved_private_data; tvbuff_t *next_tvb = NULL; col_set_str( pinfo->cinfo, COL_PROTOCOL, "NET/ROM" ); @@ -448,7 +447,6 @@ /* Call sub-dissectors here */ - saved_private_data = pinfo->private_data; next_tvb = tvb_new_subset_remaining(tvb, offset); switch ( op_code ) @@ -465,14 +463,11 @@ call_dissector( default_handle , next_tvb, pinfo, tree ); break; } - - pinfo->private_data = saved_private_data; } static void dissect_netrom_routing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - void *saved_private_data; tvbuff_t *next_tvb; col_set_str( pinfo->cinfo, COL_PROTOCOL, "NET/ROM"); @@ -492,13 +487,9 @@ proto_tree_add_item( netrom_tree, hf_netrom_mnemonic, tvb, 1, 6, ENC_ASCII|ENC_NA ); } - saved_private_data = pinfo->private_data; next_tvb = tvb_new_subset_remaining(tvb, 7); call_dissector( default_handle , next_tvb, pinfo, tree ); - - pinfo->private_data = saved_private_data; - } /* Code to actually dissect the packets */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-nfs.c wireshark-1.12.0~201311020920/epan/dissectors/packet-nfs.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-nfs.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-nfs.c 2013-11-02 02:12:36.000000000 +0000 @@ -4899,7 +4899,7 @@ } if (mtype!='S' && mtype!='R') { if (nfsv3) { - col_append_fstr(pinfo->cinfo, COL_INFO,"]"); + col_append_str(pinfo->cinfo, COL_INFO,"]"); } else { g_string_append_printf (optext, "]"); } @@ -9388,7 +9388,7 @@ if (first_operation==0) /* Seperator between operation text */ - col_append_fstr(pinfo->cinfo, COL_INFO, " |"); + col_append_str(pinfo->cinfo, COL_INFO, " |"); if (op_summary[summary_counter].optext->len > 0) col_append_fstr(pinfo->cinfo, COL_INFO, " %s", @@ -9828,7 +9828,7 @@ if (first_operation==0) /* Seperator between operation text */ - col_append_fstr(pinfo->cinfo, COL_INFO, " |"); + col_append_str(pinfo->cinfo, COL_INFO, " |"); if (op_summary[summary_counter].optext->len > 0) col_append_fstr(pinfo->cinfo, COL_INFO, " %s", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-nsip.c wireshark-1.12.0~201311020920/epan/dissectors/packet-nsip.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-nsip.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-nsip.c 2013-11-02 02:12:36.000000000 +0000 @@ -986,7 +986,7 @@ } if (!nsip_is_recursive) { - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(pdu_type, tab_nsip_pdu_types, "Unknown PDU type")); } else { col_append_sep_fstr(pinfo->cinfo, COL_INFO, NSIP_SEP, "%s", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ocsp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ocsp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ocsp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ocsp.c 2013-11-02 02:12:36.000000000 +0000 @@ -328,7 +328,7 @@ /* skip past the T and L */ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag); offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); - offset=call_ber_oid_callback(responseType_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(responseType_id, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-openflow.c wireshark-1.12.0~201311020920/epan/dissectors/packet-openflow.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-openflow.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-openflow.c 2013-11-02 02:12:36.000000000 +0000 @@ -885,12 +885,12 @@ col_clear(pinfo->cinfo,COL_INFO); if((version&0x80)==0x80){ + /* XXX COL_INFO ? */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "OpenFlow experimental version"); proto_tree_add_text(tree, tvb, offset, -1, "Experimental versions not dissected"); return 0; } version = version & 0x7f; - col_set_str(pinfo->cinfo, COL_PROTOCOL, "OpenFlow"); switch(version){ case OFP_VERSION_1_0: diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-openflow_v4.c wireshark-1.12.0~201311020920/epan/dissectors/packet-openflow_v4.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-openflow_v4.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-openflow_v4.c 2013-11-02 02:12:36.000000000 +0000 @@ -35,6 +35,9 @@ void proto_register_openflow_v4(void); void proto_reg_handoff_openflow_v4(void); + +static dissector_handle_t eth_withoutfcs_handle; + static int proto_openflow_v4 = -1; static int hf_openflow_v4_version = -1; static int hf_openflow_v4_type = -1; @@ -100,6 +103,91 @@ static int hf_openflow_v4_instruction_actions_pad = -1; static int hf_openflow_v4_instruction_meter_meter_id = -1; static int hf_openflow_v4_instruction_meter_meter_id_reserved = -1; +static int hf_openflow_v4_port_port_no = -1; +static int hf_openflow_v4_port_port_no_reserved = -1; +static int hf_openflow_v4_port_pad = -1; +static int hf_openflow_v4_port_hw_addr = -1; +static int hf_openflow_v4_port_pad2 = -1; +static int hf_openflow_v4_port_name = -1; +static int hf_openflow_v4_port_config = -1; +static int hf_openflow_v4_port_config_port_down = -1; +static int hf_openflow_v4_port_config_no_recv = -1; +static int hf_openflow_v4_port_config_no_fwd = -1; +static int hf_openflow_v4_port_config_no_packet_in = -1; +static int hf_openflow_v4_port_state = -1; +static int hf_openflow_v4_port_state_link_down = -1; +static int hf_openflow_v4_port_state_blocked = -1; +static int hf_openflow_v4_port_state_live = -1; +static int hf_openflow_v4_port_current = -1; +static int hf_openflow_v4_port_current_10mb_hd = -1; +static int hf_openflow_v4_port_current_10mb_fd = -1; +static int hf_openflow_v4_port_current_100mb_hd = -1; +static int hf_openflow_v4_port_current_100mb_fd = -1; +static int hf_openflow_v4_port_current_1gb_hd = -1; +static int hf_openflow_v4_port_current_1gb_fd = -1; +static int hf_openflow_v4_port_current_10gb_fd = -1; +static int hf_openflow_v4_port_current_40gb_fd = -1; +static int hf_openflow_v4_port_current_100gb_fd = -1; +static int hf_openflow_v4_port_current_1tb_fd = -1; +static int hf_openflow_v4_port_current_other = -1; +static int hf_openflow_v4_port_current_copper = -1; +static int hf_openflow_v4_port_current_fiber = -1; +static int hf_openflow_v4_port_current_autoneg = -1; +static int hf_openflow_v4_port_current_pause = -1; +static int hf_openflow_v4_port_current_pause_asym = -1; +static int hf_openflow_v4_port_advertised = -1; +static int hf_openflow_v4_port_advertised_10mb_hd = -1; +static int hf_openflow_v4_port_advertised_10mb_fd = -1; +static int hf_openflow_v4_port_advertised_100mb_hd = -1; +static int hf_openflow_v4_port_advertised_100mb_fd = -1; +static int hf_openflow_v4_port_advertised_1gb_hd = -1; +static int hf_openflow_v4_port_advertised_1gb_fd = -1; +static int hf_openflow_v4_port_advertised_10gb_fd = -1; +static int hf_openflow_v4_port_advertised_40gb_fd = -1; +static int hf_openflow_v4_port_advertised_100gb_fd = -1; +static int hf_openflow_v4_port_advertised_1tb_fd = -1; +static int hf_openflow_v4_port_advertised_other = -1; +static int hf_openflow_v4_port_advertised_copper = -1; +static int hf_openflow_v4_port_advertised_fiber = -1; +static int hf_openflow_v4_port_advertised_autoneg = -1; +static int hf_openflow_v4_port_advertised_pause = -1; +static int hf_openflow_v4_port_advertised_pause_asym = -1; +static int hf_openflow_v4_port_supported = -1; +static int hf_openflow_v4_port_supported_10mb_hd = -1; +static int hf_openflow_v4_port_supported_10mb_fd = -1; +static int hf_openflow_v4_port_supported_100mb_hd = -1; +static int hf_openflow_v4_port_supported_100mb_fd = -1; +static int hf_openflow_v4_port_supported_1gb_hd = -1; +static int hf_openflow_v4_port_supported_1gb_fd = -1; +static int hf_openflow_v4_port_supported_10gb_fd = -1; +static int hf_openflow_v4_port_supported_40gb_fd = -1; +static int hf_openflow_v4_port_supported_100gb_fd = -1; +static int hf_openflow_v4_port_supported_1tb_fd = -1; +static int hf_openflow_v4_port_supported_other = -1; +static int hf_openflow_v4_port_supported_copper = -1; +static int hf_openflow_v4_port_supported_fiber = -1; +static int hf_openflow_v4_port_supported_autoneg = -1; +static int hf_openflow_v4_port_supported_pause = -1; +static int hf_openflow_v4_port_supported_pause_asym = -1; +static int hf_openflow_v4_port_peer = -1; +static int hf_openflow_v4_port_peer_10mb_hd = -1; +static int hf_openflow_v4_port_peer_10mb_fd = -1; +static int hf_openflow_v4_port_peer_100mb_hd = -1; +static int hf_openflow_v4_port_peer_100mb_fd = -1; +static int hf_openflow_v4_port_peer_1gb_hd = -1; +static int hf_openflow_v4_port_peer_1gb_fd = -1; +static int hf_openflow_v4_port_peer_10gb_fd = -1; +static int hf_openflow_v4_port_peer_40gb_fd = -1; +static int hf_openflow_v4_port_peer_100gb_fd = -1; +static int hf_openflow_v4_port_peer_1tb_fd = -1; +static int hf_openflow_v4_port_peer_other = -1; +static int hf_openflow_v4_port_peer_copper = -1; +static int hf_openflow_v4_port_peer_fiber = -1; +static int hf_openflow_v4_port_peer_autoneg = -1; +static int hf_openflow_v4_port_peer_pause = -1; +static int hf_openflow_v4_port_peer_pause_asym = -1; +static int hf_openflow_v4_port_curr_speed = -1; +static int hf_openflow_v4_port_max_speed = -1; static int hf_openflow_v4_hello_element_type = -1; static int hf_openflow_v4_hello_element_length = -1; static int hf_openflow_v4_hello_element_version_bitmap = -1; @@ -124,6 +212,8 @@ static int hf_openflow_v4_error_data_body = -1; static int hf_openflow_v4_error_experimenter = -1; static int hf_openflow_v4_echo_data = -1; +static int hf_openflow_v4_experimenter_experimenter = -1; +static int hf_openflow_v4_experimenter_exp_type = -1; static int hf_openflow_v4_datapath_id = -1; static int hf_openflow_datapath_v4_mac = -1; static int hf_openflow_v4_datapath_impl = -1; @@ -140,6 +230,35 @@ static int hf_openflow__v4_ip_reasm = -1; static int hf_openflow_v4_queue_stats = -1; static int hf_openflow_v4_port_blocked = -1; +static int hf_openflow_v4_switch_config_flags = -1; +static int hf_openflow_v4_switch_config_flags_fragments = -1; +static int hf_openflow_v4_switch_config_miss_send_len = -1; +static int hf_openflow_v4_switch_config_miss_send_len_reserved = -1; +static int hf_openflow_v4_packet_in_buffer_id = -1; +static int hf_openflow_v4_packet_in_buffer_id_reserved = -1; +static int hf_openflow_v4_packet_in_total_len = -1; +static int hf_openflow_v4_packet_in_reason = -1; +static int hf_openflow_v4_packet_in_table_id = -1; +static int hf_openflow_v4_packet_in_cookie = -1; +static int hf_openflow_v4_packet_in_pad = -1; +static int hf_openflow_v4_flow_removed_cookie = -1; +static int hf_openflow_v4_flow_removed_priority = -1; +static int hf_openflow_v4_flow_removed_reason = -1; +static int hf_openflow_v4_flow_removed_table_id = -1; +static int hf_openflow_v4_flow_removed_duration_sec = -1; +static int hf_openflow_v4_flow_removed_duration_nsec = -1; +static int hf_openflow_v4_flow_removed_idle_timeout = -1; +static int hf_openflow_v4_flow_removed_hard_timeout = -1; +static int hf_openflow_v4_flow_removed_packet_count = -1; +static int hf_openflow_v4_flow_removed_byte_count = -1; +static int hf_openflow_v4_port_status_reason = -1; +static int hf_openflow_v4_port_status_pad = -1; +static int hf_openflow_v4_packet_out_buffer_id = -1; +static int hf_openflow_v4_packet_out_buffer_id_reserved = -1; +static int hf_openflow_v4_packet_out_in_port = -1; +static int hf_openflow_v4_packet_out_in_port_reserved = -1; +static int hf_openflow_v4_packet_out_acts_len = -1; +static int hf_openflow_v4_packet_out_pad = -1; static int hf_openflow_v4_flowmod_cookie = -1; static int hf_openflow_v4_flowmod_cookie_mask = -1; static int hf_openflow_v4_flowmod_table_id = -1; @@ -190,8 +309,18 @@ static gint ett_openflow_v4_action = -1; static gint ett_openflow_v4_instruction = -1; static gint ett_openflow_v4_instruction_actions_actions = -1; +static gint ett_openflow_v4_port = -1; +static gint ett_openflow_v4_port_config = -1; +static gint ett_openflow_v4_port_state = -1; +static gint ett_openflow_v4_port_current = -1; +static gint ett_openflow_v4_port_advertised = -1; +static gint ett_openflow_v4_port_supported = -1; +static gint ett_openflow_v4_port_peer = -1; static gint ett_openflow_v4_hello_element = -1; static gint ett_openflow_v4_error_data = -1; +static gint ett_openflow_v4_switch_config_flags = -1; +static gint ett_openflow_v4_packet_in_data = -1; +static gint ett_openflow_v4_packet_out_data = -1; static expert_field ei_openflow_v4_match_undecoded = EI_INIT; static expert_field ei_openflow_v4_oxm_undecoded = EI_INIT; @@ -199,6 +328,7 @@ static expert_field ei_openflow_v4_instruction_undecoded = EI_INIT; static expert_field ei_openflow_v4_hello_element_undecoded = EI_INIT; static expert_field ei_openflow_v4_error_undecoded = EI_INIT; +static expert_field ei_openflow_v4_experimenter_undecoded = EI_INIT; static const value_string openflow_v4_version_values[] = { { 0x01, "1.0" }, @@ -1053,6 +1183,25 @@ } } + +static void +dissect_openflow_experimenter_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length) +{ + /* uint32_t experimenter; */ + proto_tree_add_item(tree, hf_openflow_v4_experimenter_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint32_t exp_type; */ + proto_tree_add_item(tree, hf_openflow_v4_experimenter_exp_type, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* data */ + if (offset < length) { + proto_tree_add_expert_format(tree, pinfo, &ei_openflow_v4_experimenter_undecoded, + tvb, offset, length - 16, "Experimenter body."); + } +} + #define OFPC_V4_FLOW_STATS 1<<0 /* Flow statistics. */ #define OFPC_V4_TABLE_STATS 1<<1 /* Table statistics. */ #define OFPC_V4_PORT_STATS 1<<2 /* Port statistics. */ @@ -1124,6 +1273,179 @@ } +static const value_string openflow_v4_switch_config_fragments_values[] = { + { 0, "OFPC_FRAG_NORMAL" }, + { 1, "OFPC_FRAG_DROP" }, + { 2, "OFPC_FRAG_REASM" }, + { 0, NULL } +}; + +#define OFPCML_MAX 0xffe5 /* Maximum max_len value. */ +static const value_string openflow_v4_controller_max_len_reserved_values[] = { + { 0xffff, "OFPCML_NO_BUFFER" }, + { 0, NULL } +}; + +static void +dissect_openflow_switch_config_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_) +{ + proto_item *ti; + proto_tree *flags_tree; + + /* uint16_t flags; */ + ti = proto_tree_add_item(tree, hf_openflow_v4_switch_config_flags, tvb, offset, 2, ENC_BIG_ENDIAN); + flags_tree = proto_item_add_subtree(ti, ett_openflow_v4_switch_config_flags); + + /* fragments */ + proto_tree_add_bits_item(flags_tree, hf_openflow_v4_switch_config_flags_fragments, tvb, (offset * 8) + 14, 2, ENC_NA); + offset+=2; + + /* uint16_t miss_send_len; */ + if (tvb_get_ntohs(tvb, offset) <= OFPCML_MAX) { + proto_tree_add_item(tree, hf_openflow_v4_switch_config_miss_send_len, tvb, offset, 2, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(tree, hf_openflow_v4_switch_config_miss_send_len_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + } + /*offset+=2;*/ +} + + +static const value_string openflow_v4_packet_in_reason_values[] = { + { 0, "OFPR_NO_MATCH" }, + { 1, "OFPR_ACTION" }, + { 2, "OFPR_INVALID_TTL" }, + { 0, NULL } +}; + +static void +dissect_openflow_packet_in_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_) +{ + proto_item *ti; + proto_tree *data_tree; + tvbuff_t *next_tvb; + gboolean save_writable; + gboolean save_in_error_pkt; + address save_dl_src, save_dl_dst, save_net_src, save_net_dst, save_src, save_dst; + + /* uint32_t buffer_id; */ + if (tvb_get_ntohl(tvb, offset) != OFP_NO_BUFFER) { + proto_tree_add_item(tree, hf_openflow_v4_packet_in_buffer_id, tvb, offset, 4, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(tree, hf_openflow_v4_packet_in_buffer_id_reserved, tvb, offset, 4, ENC_BIG_ENDIAN); + } + offset+=4; + + /* uint16_t total_len; */ + proto_tree_add_item(tree, hf_openflow_v4_packet_in_total_len, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; + + /* uint8_t reason; */ + proto_tree_add_item(tree, hf_openflow_v4_packet_in_reason, tvb, offset, 1, ENC_BIG_ENDIAN); + offset+=1; + + /* uint8_t table_id; */ + proto_tree_add_item(tree, hf_openflow_v4_packet_in_table_id, tvb, offset, 1, ENC_BIG_ENDIAN); + offset+=1; + + /* uint64_t cookie; */ + proto_tree_add_item(tree, hf_openflow_v4_packet_in_cookie, tvb, offset, 8, ENC_BIG_ENDIAN); + offset+=8; + + /* struct ofp_match match; */ + offset = dissect_openflow_match_v4(tvb, pinfo, tree, offset, length); + + /* uint8_t pad[2]; */ + proto_tree_add_item(tree, hf_openflow_v4_packet_in_pad, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; + + /* uint8_t data[0]; */ + if (offset < length) { + ti = proto_tree_add_text(tree, tvb, offset, length - offset, "Data"); + data_tree = proto_item_add_subtree(ti, ett_openflow_v4_packet_in_data); + + /* save some state */ + save_writable = col_get_writable(pinfo->cinfo); + save_in_error_pkt = pinfo->flags.in_error_pkt; + save_dl_src = pinfo->dl_src; + save_dl_dst = pinfo->dl_dst; + save_net_src = pinfo->net_src; + save_net_dst = pinfo->net_dst; + save_src = pinfo->src; + save_dst = pinfo->dst; + + /* dissect data */ + col_set_writable(pinfo->cinfo, FALSE); + next_tvb = tvb_new_subset(tvb, offset, length - offset, length - offset); + call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, data_tree); + + /* restore saved state */ + col_set_writable(pinfo->cinfo, save_writable); + pinfo->flags.in_error_pkt = save_in_error_pkt; + pinfo->dl_src = save_dl_src; + pinfo->dl_dst = save_dl_dst; + pinfo->net_src = save_net_src; + pinfo->net_dst = save_net_dst; + pinfo->src = save_src; + pinfo->dst = save_dst; + } +} + + +static const value_string openflow_v4_flow_removed_reason_values[] = { + { 0, "OFPRR_IDLE_TIMEOUT" }, + { 1, "OFPRR_HARD_TIMEOUT" }, + { 2, "OFPRR_DELETE" }, + { 3, "OFPRR_GROUP_DELETE" }, + { 0, NULL } +}; + +static void +dissect_openflow_flow_removed_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_) +{ + /* uint64_t cookie; */ + proto_tree_add_item(tree, hf_openflow_v4_flow_removed_cookie, tvb, offset, 8, ENC_BIG_ENDIAN); + offset+=8; + + /* uint16_t priority; */ + proto_tree_add_item(tree, hf_openflow_v4_flow_removed_priority, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; + + /* uint8_t reason; */ + proto_tree_add_item(tree, hf_openflow_v4_flow_removed_reason, tvb, offset, 1, ENC_BIG_ENDIAN); + offset+=1; + + /* uint8_t table_id; */ + proto_tree_add_item(tree, hf_openflow_v4_flow_removed_table_id, tvb, offset, 1, ENC_BIG_ENDIAN); + offset+=1; + + /* uint32_t duration_sec; */ + proto_tree_add_item(tree, hf_openflow_v4_flow_removed_duration_sec, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint32_t duration_nsec; */ + proto_tree_add_item(tree, hf_openflow_v4_flow_removed_duration_nsec, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint16_t idle_timeout; */ + proto_tree_add_item(tree, hf_openflow_v4_flow_removed_idle_timeout, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; + + /* uint16_t hard_timeout; */ + proto_tree_add_item(tree, hf_openflow_v4_flow_removed_hard_timeout, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; + + /* uint64_t packet_count; */ + proto_tree_add_item(tree, hf_openflow_v4_flow_removed_packet_count, tvb, offset, 8, ENC_BIG_ENDIAN); + offset+=8; + + /* uint64_t byte_count; */ + proto_tree_add_item(tree, hf_openflow_v4_flow_removed_byte_count, tvb, offset, 8, ENC_BIG_ENDIAN); + offset+=8; + + /* struct ofp_match match; */ + dissect_openflow_match_v4(tvb, pinfo, tree, offset, length); +} + #define OFPAT_OUTPUT 0 /* Output to switch port. */ #define OFPAT_COPY_TTL_OUT 11 /* Copy TTL "outwards" */ #define OFPAT_COPY_TTL_IN 12 /* Copy TTL "inwards" */ @@ -1163,12 +1485,6 @@ { 0, NULL} }; -#define OFPCML_MAX 0xffe5 /* Maximum max_len value. */ -static const value_string openflow_v4_action_output_max_len_reserved_values[] = { - { 0xffff, "OFPCML_NO_BUFFER" }, - { 0, NULL } -}; - static int dissect_openflow_action_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_) { @@ -1356,6 +1672,287 @@ } +#define OFPPC_PORT_DOWN 1 << 0 +#define OFPPC_NO_RECV 1 << 2 +#define OFPPC_NO_FWD 1 << 5 +#define OFPPC_NO_PACKET_IN 1 << 6 + +#define OFPPS_LINK_DOWN 1 << 0 +#define OFPPS_BLOCKED 1 << 1 +#define OFPPS_LIVE 1 << 2 + +#define OFPPF_10MB_HD 1 << 0 +#define OFPPF_10MB_FD 1 << 1 +#define OFPPF_100MB_HD 1 << 2 +#define OFPPF_100MB_FD 1 << 3 +#define OFPPF_1GB_HD 1 << 4 +#define OFPPF_1GB_FD 1 << 5 +#define OFPPF_10GB_FD 1 << 6 +#define OFPPF_40GB_FD 1 << 7 +#define OFPPF_100GB_FD 1 << 8 +#define OFPPF_1TB_FD 1 << 9 +#define OFPPF_OTHER 1 << 10 + +#define OFPPF_COPPER 1 << 11 +#define OFPPF_FIBER 1 << 12 +#define OFPPF_AUTONEG 1 << 13 +#define OFPPF_PAUSE 1 << 14 +#define OFPPF_PAUSE_ASYM 1 << 15 + +#define OFP_ETH_ALEN 6 +#define OFP_MAX_PORT_NAME_LEN 16 +static int +dissect_openflow_port_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_) +{ + proto_item *ti; + proto_tree *port_tree, *conf_tree, *state_tree, *curr_tree, *adv_tree, *supp_tree, *peer_tree; + + ti = proto_tree_add_text(tree, tvb, offset, -1, "Port"); + port_tree = proto_item_add_subtree(ti, ett_openflow_v4_port); + + /* uint32_t port_no; */ + if (tvb_get_ntohl(tvb, offset) <= OFPP_MAX) { + proto_tree_add_item(port_tree, hf_openflow_v4_port_port_no, tvb, offset, 4, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(port_tree, hf_openflow_v4_port_port_no_reserved, tvb, offset, 4, ENC_BIG_ENDIAN); + } + offset+=4; + + /* uint8_t pad[4]; */ + proto_tree_add_item(port_tree, hf_openflow_v4_port_pad, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint8_t hw_addr[OFP_ETH_ALEN]; */ + proto_tree_add_item(port_tree, hf_openflow_v4_port_hw_addr, tvb, offset, OFP_ETH_ALEN, ENC_BIG_ENDIAN); + offset+=OFP_ETH_ALEN; + + /* uint8_t pad2[2]; */ + proto_tree_add_item(port_tree, hf_openflow_v4_port_pad2, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; + + /* char name[OFP_MAX_PORT_NAME_LEN]; Null-terminated */ + proto_tree_add_item(port_tree, hf_openflow_v4_port_name, tvb, offset, OFP_MAX_PORT_NAME_LEN, ENC_BIG_ENDIAN); + offset+=OFP_MAX_PORT_NAME_LEN; + + /* uint32_t config; */ + ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_config, tvb, offset, 4, ENC_BIG_ENDIAN); + conf_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_config); + + proto_tree_add_item(conf_tree, hf_openflow_v4_port_config_port_down, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(conf_tree, hf_openflow_v4_port_config_no_recv, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(conf_tree, hf_openflow_v4_port_config_no_fwd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(conf_tree, hf_openflow_v4_port_config_no_packet_in, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint32_t state; */ + ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_state, tvb, offset, 4, ENC_BIG_ENDIAN); + state_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_state); + + proto_tree_add_item(state_tree, hf_openflow_v4_port_state_link_down, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(state_tree, hf_openflow_v4_port_state_blocked, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(state_tree, hf_openflow_v4_port_state_live, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint32_t curr; */ + ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_current, tvb, offset, 4, ENC_BIG_ENDIAN); + curr_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_current); + + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_10mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_10mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_100mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_100mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_1gb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_1gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_10gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_40gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_100gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_1tb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_other, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_copper, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_fiber, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_autoneg, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_pause, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_pause_asym, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint32_t advertised; */ + ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_advertised, tvb, offset, 4, ENC_BIG_ENDIAN); + adv_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_advertised); + + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_10mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_10mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_100mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_100mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_1gb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_1gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_10gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_40gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_100gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_1tb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_other, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_copper, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_fiber, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_autoneg, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_pause, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_pause_asym, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint32_t supported; */ + ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_supported, tvb, offset, 4, ENC_BIG_ENDIAN); + supp_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_supported); + + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_10mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_10mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_100mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_100mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_1gb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_1gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_10gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_40gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_100gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_1tb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_other, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_copper, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_fiber, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_autoneg, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_pause, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_pause_asym, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint32_t peer; */ + ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_peer, tvb, offset, 4, ENC_BIG_ENDIAN); + peer_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_peer); + + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_10mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_10mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_100mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_100mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_1gb_hd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_1gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_10gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_40gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_100gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_1tb_fd, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_other, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_copper, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_fiber, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_autoneg, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_pause, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_pause_asym, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint32_t curr_speed; */ + proto_tree_add_item(port_tree, hf_openflow_v4_port_curr_speed, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + /* uint32_t max_speed; */ + proto_tree_add_item(port_tree, hf_openflow_v4_port_max_speed, tvb, offset, 4, ENC_BIG_ENDIAN); + offset+=4; + + return offset; +}; + + + +static const value_string openflow_v4_port_status_reason_values[] = { + { 0, "OFPPR_ADD" }, + { 1, "OFPPR_DELETE" }, + { 2, "OFPPR_MODIFY" }, + { 0, NULL } +}; + +static void +dissect_openflow_port_status_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_) +{ + /* uint8_t reason; */ + proto_tree_add_item(tree, hf_openflow_v4_port_status_reason, tvb, offset, 1, ENC_BIG_ENDIAN); + offset+=1; + + /* uint8_t pad[7]; */ + proto_tree_add_item(tree, hf_openflow_v4_port_status_pad, tvb, offset, 7, ENC_BIG_ENDIAN); + offset+=7; + + /* struct ofp_port desc; */ + dissect_openflow_port_v4(tvb, pinfo, tree, offset, length); +} + + +static void +dissect_openflow_packet_out_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_) +{ + proto_item *ti; + proto_tree *data_tree; + guint16 acts_len, acts_end; + tvbuff_t *next_tvb; + gboolean save_writable; + gboolean save_in_error_pkt; + address save_dl_src, save_dl_dst, save_net_src, save_net_dst, save_src, save_dst; + + /* uint32_t buffer_id; */ + if (tvb_get_ntohl(tvb, offset) != OFP_NO_BUFFER) { + proto_tree_add_item(tree, hf_openflow_v4_packet_out_buffer_id, tvb, offset, 4, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(tree, hf_openflow_v4_packet_out_buffer_id_reserved, tvb, offset, 4, ENC_BIG_ENDIAN); + } + offset+=4; + + /* uint32_t in_port; */ + if (tvb_get_ntohl(tvb, offset) <= OFPP_MAX) { + proto_tree_add_item(tree, hf_openflow_v4_packet_out_in_port, tvb, offset, 4, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(tree, hf_openflow_v4_packet_out_in_port_reserved, tvb, offset, 4, ENC_BIG_ENDIAN); + } + offset+=4; + + /* uint16_t actions_len; */ + acts_len = tvb_get_ntohs(tvb, offset); + proto_tree_add_item(tree, hf_openflow_v4_packet_out_acts_len, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; + + /* uint8_t pad[6]; */ + proto_tree_add_item(tree, hf_openflow_v4_packet_out_pad, tvb, offset, 6, ENC_BIG_ENDIAN); + offset+=6; + + /* struct ofp_action_header actions[0]; */ + acts_end = offset + acts_len; + + while (offset < acts_end) { + offset = dissect_openflow_action_v4(tvb, pinfo, tree, offset, length); + } + + /* uint8_t data[0]; */ + if (offset < length) { + ti = proto_tree_add_text(tree, tvb, offset, length - offset, "Data"); + data_tree = proto_item_add_subtree(ti, ett_openflow_v4_packet_out_data); + + /* save some state */ + save_writable = col_get_writable(pinfo->cinfo); + save_in_error_pkt = pinfo->flags.in_error_pkt; + save_dl_src = pinfo->dl_src; + save_dl_dst = pinfo->dl_dst; + save_net_src = pinfo->net_src; + save_net_dst = pinfo->net_dst; + save_src = pinfo->src; + save_dst = pinfo->dst; + + /* dissect data */ + col_set_writable(pinfo->cinfo, FALSE); + next_tvb = tvb_new_subset(tvb, offset, length - offset, length - offset); + call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, data_tree); + + /* restore saved state */ + col_set_writable(pinfo->cinfo, save_writable); + pinfo->flags.in_error_pkt = save_in_error_pkt; + pinfo->dl_src = save_dl_src; + pinfo->dl_dst = save_dl_dst; + pinfo->net_src = save_net_src; + pinfo->net_dst = save_net_dst; + pinfo->src = save_src; + pinfo->dst = save_dst; + } +} + + #define OFPIT_GOTO_TABLE 1 /* Setup the next table in the lookup */ #define OFPIT_WRITE_METADATA 2 /* Setup the metadata field for use later in */ #define OFPIT_WRITE_ACTIONS 3 /* Write the action(s) onto the datapath action */ @@ -1865,11 +2462,6 @@ col_append_fstr(pinfo->cinfo, COL_INFO, "Type: %s", val_to_str_const(type, openflow_v4_type_values, "Unknown Messagetype")); - /* Stop the Ethernet frame from overwriting the columns */ - if((type == OFPT_V4_PACKET_IN) || (type == OFPT_V4_PACKET_OUT)){ - col_set_writable(pinfo->cinfo, FALSE); - } - /* Create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_openflow_v4, tvb, 0, -1, ENC_NA); openflow_tree = proto_item_add_subtree(ti, ett_openflow_v4); @@ -1884,20 +2476,38 @@ case OFPT_V4_ERROR: /* 1 */ dissect_openflow_error_v4(tvb, pinfo, openflow_tree, offset, length); break; - case OFPT_V4_ECHO_REQUEST: /* 3 */ - case OFPT_V4_ECHO_REPLY: /* 4 */ + case OFPT_V4_ECHO_REQUEST: /* 2 */ + case OFPT_V4_ECHO_REPLY: /* 3 */ dissect_openflow_echo_v4(tvb, pinfo, openflow_tree, offset, length); break; + case OFPT_V4_EXPERIMENTER: /* 4 */ + dissect_openflow_experimenter_v4(tvb, pinfo, openflow_tree, offset, length); + break; case OFPT_V4_FEATURES_REQUEST: /* 5 */ - /* 5.3.1 Handshake - * Upon TLS session establishment, the controller sends an OFPT_FEATURES_REQUEST - * message. This message does not contain a body beyond the OpenFlow header. - */ + /* message has no body */ break; case OFPT_V4_FEATURES_REPLY: /* 6 */ dissect_openflow_features_reply_v4(tvb, pinfo, openflow_tree, offset, length); break; - + case OFPT_V4_GET_CONFIG_REQUEST: /* 7 */ + /* mesage has no body */ + break; + case OFPT_V4_GET_CONFIG_REPLY: /* 8 */ + case OFPT_V4_SET_CONFIG: /* 9 */ + dissect_openflow_switch_config_v4(tvb, pinfo, openflow_tree, offset, length); + break; + case OFPT_V4_PACKET_IN: /* 10 */ + dissect_openflow_packet_in_v4(tvb, pinfo, openflow_tree, offset, length); + break; + case OFPT_V4_FLOW_REMOVED: /* 11 */ + dissect_openflow_flow_removed_v4(tvb, pinfo, openflow_tree, offset, length); + break; + case OFPT_V4_PORT_STATUS: /* 12 */ + dissect_openflow_port_status_v4(tvb, pinfo, openflow_tree, offset, length); + break; + case OFPT_V4_PACKET_OUT: /* 13 */ + dissect_openflow_packet_out_v4(tvb, pinfo, openflow_tree, offset, length); + break; case OFPT_V4_FLOW_MOD: /* 14 */ dissect_openflow_flowmod_v4(tvb, pinfo, openflow_tree, offset, length); break; @@ -2085,7 +2695,7 @@ }, { &hf_openflow_v4_action_output_max_len_reserved, { "Max length", "openflow_v4.action.output.max_len", - FT_UINT16, BASE_HEX, VALS(openflow_v4_action_output_max_len_reserved_values), 0x0, + FT_UINT16, BASE_HEX, VALS(openflow_v4_controller_max_len_reserved_values), 0x0, NULL, HFILL } }, { &hf_openflow_v4_action_output_pad, @@ -2253,6 +2863,431 @@ FT_UINT32, BASE_HEX, VALS(openflow_v4_meter_id_reserved_values), 0x0, NULL, HFILL } }, + { &hf_openflow_v4_port_port_no, + { "Port no", "openflow_v4.port.port_no", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_port_no_reserved, + { "Port no", "openflow_v4.port.port_no", + FT_UINT32, BASE_HEX, VALS(openflow_v4_port_reserved_values), 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_pad, + { "Padding", "openflow_v4.port.pad", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_hw_addr, + { "Hw addr", "openflow_v4.port.hw_addr", + FT_ETHER, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_pad2, + { "Padding", "openflow_v4.port.pad2", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_name, + { "Name", "openflow_v4.port.name", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_config, + { "Config", "openflow_v4.port.config", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_config_port_down, + { "OFPPC_PORT_DOWN", "openflow_v4.port.config.port_down", + FT_BOOLEAN, 32, NULL, OFPPC_PORT_DOWN, + NULL, HFILL } + }, + { &hf_openflow_v4_port_config_no_recv, + { "OFPPC_NO_RECV", "openflow_v4.port.config.no_recv", + FT_BOOLEAN, 32, NULL, OFPPC_NO_RECV, + NULL, HFILL } + }, + { &hf_openflow_v4_port_config_no_fwd, + { "OFPPC_NO_FWD", "openflow_v4.port.config.no_fwd", + FT_BOOLEAN, 32, NULL, OFPPC_NO_FWD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_config_no_packet_in, + { "OFPPC_NO_PACKET_IN", "openflow_v4.port.config.no_packet_in", + FT_BOOLEAN, 32, NULL, OFPPC_NO_PACKET_IN, + NULL, HFILL } + }, + { &hf_openflow_v4_port_state, + { "State", "openflow_v4.port.sate", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_state_link_down, + { "OFPPS_LINK_DOWN", "openflow_v4.port.state.link_down", + FT_BOOLEAN, 32, NULL, OFPPS_LINK_DOWN, + NULL, HFILL } + }, + { &hf_openflow_v4_port_state_blocked, + { "OFPPS_BLOCKED", "openflow_v4.port.state.blocked", + FT_BOOLEAN, 32, NULL, OFPPS_BLOCKED, + NULL, HFILL } + }, + { &hf_openflow_v4_port_state_live, + { "OFPPS_LIVE", "openflow_v4.port.state.live", + FT_BOOLEAN, 32, NULL, OFPPS_LIVE, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current, + { "Current", "openflow_v4.port.current", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_10mb_hd, + { "OFPPF_10MB_HD", "openflow_v4.port.current.10mb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_10MB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_10mb_fd, + { "OFPPF_10MB_FD", "openflow_v4.port.current.10mb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_10MB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_100mb_hd, + { "OFPPF_100MB_HD", "openflow_v4.port.current.100mb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_100MB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_100mb_fd, + { "OFPPF_100MB_FD", "openflow_v4.port.current.100mb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_100MB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_1gb_hd, + { "OFPPF_1GB_HD", "openflow_v4.port.current.1gb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_1GB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_1gb_fd, + { "OFPPF_1GB_FD", "openflow_v4.port.current.1gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_1GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_10gb_fd, + { "OFPPF_10_GB_FD", "openflow_v4.port.current.10gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_10GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_40gb_fd, + { "OFPPF_40GB_FD", "openflow_v4.port.current.40gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_40GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_100gb_fd, + { "OFPPF_100_GB_FD", "openflow_v4.port.current.100_gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_100GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_1tb_fd, + { "OFPPF_1TB_FD", "openflow_v4.port.current.1tb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_1TB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_other, + { "OFPPF_OTHER", "openflow_v4.port.current.other", + FT_BOOLEAN, 32, NULL, OFPPF_OTHER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_copper, + { "OFPPF_COPPER", "openflow_v4.port.current.copper", + FT_BOOLEAN, 32, NULL, OFPPF_COPPER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_fiber, + { "OFPPF_FIBER", "openflow_v4.port.current.fiber", + FT_BOOLEAN, 32, NULL, OFPPF_FIBER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_autoneg, + { "OFPPF_AUTONEG", "openflow_v4.port.current.autoneg", + FT_BOOLEAN, 32, NULL, OFPPF_AUTONEG, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_pause, + { "OFPPF_PAUSE", "openflow_v4.port.current.pause", + FT_BOOLEAN, 32, NULL, OFPPF_PAUSE, + NULL, HFILL } + }, + { &hf_openflow_v4_port_current_pause_asym, + { "OFPPF_PAUSE_ASYM", "openflow_v4.port.current.pause_asym", + FT_BOOLEAN, 32, NULL, OFPPF_PAUSE_ASYM, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised, + { "Advertised", "openflow_v4.port.advertised", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_10mb_hd, + { "OFPPF_10MB_HD", "openflow_v4.port.advertised.10mb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_10MB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_10mb_fd, + { "OFPPF_10MB_FD", "openflow_v4.port.advertised.10mb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_10MB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_100mb_hd, + { "OFPPF_100MB_HD", "openflow_v4.port.advertised.100mb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_100MB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_100mb_fd, + { "OFPPF_100MB_FD", "openflow_v4.port.advertised.100mb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_100MB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_1gb_hd, + { "OFPPF_1GB_HD", "openflow_v4.port.advertised.1gb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_1GB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_1gb_fd, + { "OFPPF_1GB_FD", "openflow_v4.port.advertised.1gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_1GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_10gb_fd, + { "OFPPF_10_GB_FD", "openflow_v4.port.advertised.10gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_10GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_40gb_fd, + { "OFPPF_40GB_FD", "openflow_v4.port.advertised.40gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_40GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_100gb_fd, + { "OFPPF_100GB_FD", "openflow_v4.port.advertised.100gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_100GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_1tb_fd, + { "OFPPF_1TB_FD", "openflow_v4.port.advertised.1tb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_1TB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_other, + { "OFPPF_OTHER", "openflow_v4.port.advertised.other", + FT_BOOLEAN, 32, NULL, OFPPF_OTHER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_copper, + { "OFPPF_COPPER", "openflow_v4.port.advertised.copper", + FT_BOOLEAN, 32, NULL, OFPPF_COPPER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_fiber, + { "OFPPF_FIBER", "openflow_v4.port.advertised.fiber", + FT_BOOLEAN, 32, NULL, OFPPF_FIBER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_autoneg, + { "OFPPF_AUTONEG", "openflow_v4.port.advertised.autoneg", + FT_BOOLEAN, 32, NULL, OFPPF_AUTONEG, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_pause, + { "OFPPF_PAUSE", "openflow_v4.port.advertised.pause", + FT_BOOLEAN, 32, NULL, OFPPF_PAUSE, + NULL, HFILL } + }, + { &hf_openflow_v4_port_advertised_pause_asym, + { "OFPPF_PAUSE_ASYM", "openflow_v4.port.advertised.pause_asym", + FT_BOOLEAN, 32, NULL, OFPPF_PAUSE_ASYM, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported, + { "Supported", "openflow_v4.port.supported", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_10mb_hd, + { "OFPPF_10MB_HD", "openflow_v4.port.supported.10mb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_10MB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_10mb_fd, + { "OFPPF_10MB_FD", "openflow_v4.port.supported.10mb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_10MB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_100mb_hd, + { "OFPPF_100MB_HD", "openflow_v4.port.supported.100mb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_100MB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_100mb_fd, + { "OFPPF_100MB_FD", "openflow_v4.port.supported.100mb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_100MB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_1gb_hd, + { "OFPPF_1GB_HD", "openflow_v4.port.supported.1gb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_1GB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_1gb_fd, + { "OFPPF_1GB_FD", "openflow_v4.port.supported.1gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_1GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_10gb_fd, + { "OFPPF_10_GB_FD", "openflow_v4.port.supported.10gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_10GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_40gb_fd, + { "OFPPF_40GB_FD", "openflow_v4.port.supported.40gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_40GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_100gb_fd, + { "OFPPF_100GB_FD", "openflow_v4.port.supported.100gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_100GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_1tb_fd, + { "OFPPF_1TB_FD", "openflow_v4.port.supported.1tb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_1TB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_other, + { "OFPPF_OTHER", "openflow_v4.port.supported.other", + FT_BOOLEAN, 32, NULL, OFPPF_OTHER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_copper, + { "OFPPF_COPPER", "openflow_v4.port.supported.copper", + FT_BOOLEAN, 32, NULL, OFPPF_COPPER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_fiber, + { "OFPPF_FIBER", "openflow_v4.port.supported.fiber", + FT_BOOLEAN, 32, NULL, OFPPF_FIBER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_autoneg, + { "OFPPF_AUTONEG", "openflow_v4.port.supported.autoneg", + FT_BOOLEAN, 32, NULL, OFPPF_AUTONEG, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_pause, + { "OFPPF_PAUSE", "openflow_v4.port.supported.pause", + FT_BOOLEAN, 32, NULL, OFPPF_PAUSE, + NULL, HFILL } + }, + { &hf_openflow_v4_port_supported_pause_asym, + { "OFPPF_PAUSE_ASYM", "openflow_v4.port.supported.pause_asym", + FT_BOOLEAN, 32, NULL, OFPPF_PAUSE_ASYM, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer, + { "Peer", "openflow_v4.port.peer", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_10mb_hd, + { "OFPPF_10MB_HD", "openflow_v4.port.peer.10mb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_10MB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_10mb_fd, + { "OFPPF_10MB_FD", "openflow_v4.port.peer.10mb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_10MB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_100mb_hd, + { "OFPPF_100MB_HD", "openflow_v4.port.peer.100mb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_100MB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_100mb_fd, + { "OFPPF_100MB_FD", "openflow_v4.port.peer.100mb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_100MB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_1gb_hd, + { "OFPPF_1GB_HD", "openflow_v4.port.peer.1gb_hd", + FT_BOOLEAN, 32, NULL, OFPPF_1GB_HD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_1gb_fd, + { "OFPPF_1GB_FD", "openflow_v4.port.peer.1gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_1GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_10gb_fd, + { "OFPPF_10_GB_FD", "openflow_v4.port.peer.10gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_10GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_40gb_fd, + { "OFPPF_40GB_FD", "openflow_v4.port.peer.40gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_40GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_100gb_fd, + { "OFPPF_100GB_FD", "openflow_v4.port.peer.100gb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_100GB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_1tb_fd, + { "OFPPF_1TB_FD", "openflow_v4.port.peer.1tb_fd", + FT_BOOLEAN, 32, NULL, OFPPF_1TB_FD, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_other, + { "OFPPF_OTHER", "openflow_v4.port.peer.other", + FT_BOOLEAN, 32, NULL, OFPPF_OTHER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_copper, + { "OFPPF_COPPER", "openflow_v4.port.peer.copper", + FT_BOOLEAN, 32, NULL, OFPPF_COPPER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_fiber, + { "OFPPF_FIBER", "openflow_v4.port.peer.fiber", + FT_BOOLEAN, 32, NULL, OFPPF_FIBER, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_autoneg, + { "OFPPF_AUTONEG", "openflow_v4.port.peer.autoneg", + FT_BOOLEAN, 32, NULL, OFPPF_AUTONEG, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_pause, + { "OFPPF_PAUSE", "openflow_v4.port.peer.pause", + FT_BOOLEAN, 32, NULL, OFPPF_PAUSE, + NULL, HFILL } + }, + { &hf_openflow_v4_port_peer_pause_asym, + { "OFPPF_PAUSE_ASYM", "openflow_v4.port.peer.pause_asym", + FT_BOOLEAN, 32, NULL, OFPPF_PAUSE_ASYM, + NULL, HFILL } + }, + { &hf_openflow_v4_port_curr_speed, + { "Curr speed", "openflow_v4.port.curr_speed", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_max_speed, + { "Max speed", "openflow_v4.port.max_speed", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, { &hf_openflow_v4_hello_element_type, { "Type", "openflow_v4.hello_element.type", FT_UINT16, BASE_DEC, VALS(openflow_v4_hello_element_type_values), 0x0, @@ -2373,6 +3408,16 @@ FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_openflow_v4_experimenter_experimenter, + { "Experimenter", "openflow_v4.experimenter.experimenter", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_experimenter_exp_type, + { "Experimenter type", "openflow_v4.experimenter.exp_type", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, { &hf_openflow_v4_datapath_id, { "Datapath unique ID", "openflow_v4.datapath_id", FT_UINT64, BASE_HEX, NULL, 0x0, @@ -2453,6 +3498,152 @@ FT_BOOLEAN, 32, NULL, OFPC_V4_PORT_BLOCKED, NULL, HFILL } }, + { &hf_openflow_v4_switch_config_flags, + { "Flags", "openflow_v4.switch_config.flags", + FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_switch_config_flags_fragments, + { "IP Fragments", "openflow_v4.switch_config.flags.fragments", + FT_UINT16, BASE_DEC, VALS(openflow_v4_switch_config_fragments_values), 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_switch_config_miss_send_len, + { "Miss send length", "openflow_v4.switch_config.miss_send_len", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_switch_config_miss_send_len_reserved, + { "Miss send length", "openflow_v4.switch_config.miss_send_len", + FT_UINT16, BASE_HEX, VALS(openflow_v4_controller_max_len_reserved_values), 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_in_buffer_id, + { "Buffer ID", "openflow_v4.packet_in.buffer_id", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_in_buffer_id_reserved, + { "Buffer ID", "openflow_v4.packet_in.buffer_id", + FT_UINT32, BASE_HEX, VALS(openflow_v4_buffer_reserved_values), 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_in_total_len, + { "Total length", "openflow_v4.packet_in.total_len", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_in_reason, + { "Reason", "openflow_v4.packet_in.buffer_id", + FT_UINT8, BASE_DEC, VALS(openflow_v4_packet_in_reason_values), 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_in_table_id, + { "Table ID", "openflow_v4.packet_in.table_id", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_in_cookie, + { "Cookie", "openflow_v4.packet_in.cookie", + FT_UINT64, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_in_pad, + { "Padding", "openflow_v4.packet_in.pad", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_flow_removed_cookie, + { "Cookie", "openflow_v4.flow_removed.cookie", + FT_UINT64, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_flow_removed_priority, + { "Priority", "openflow_v4.flow_removed.priority", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_flow_removed_reason, + { "Reason", "openflow_v4.flow_removed.reason", + FT_UINT8, BASE_DEC, VALS(openflow_v4_flow_removed_reason_values), 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_flow_removed_table_id, + { "Table ID", "openflow_v4.flow_removed.table_id", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_flow_removed_duration_sec, + { "Duration sec", "openflow_v4.flow_removed.duration_sec", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_flow_removed_duration_nsec, + { "Duration nsec", "openflow_v4.flow_removed.duration_nsec", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_flow_removed_idle_timeout, + { "Idle timeout", "openflow_v4.flow_removed.idle_timeout", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_flow_removed_hard_timeout, + { "Hard timeout", "openflow_v4.flow_removed.hard_timeout", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_flow_removed_packet_count, + { "Packet count", "openflow_v4.flow_removed.packet_count", + FT_UINT64, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_flow_removed_byte_count, + { "Byte count", "openflow_v4.flow_removed.byte_count", + FT_UINT64, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_status_reason, + { "Reason", "openflow_v4.port_status.reason", + FT_UINT8, BASE_DEC, VALS(openflow_v4_port_status_reason_values), 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_port_status_pad, + { "Padding", "openflow_v4.port_status.pad", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + + { &hf_openflow_v4_packet_out_buffer_id, + { "Buffer ID", "openflow_v4.packet_out.buffer_id", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_out_buffer_id_reserved, + { "Buffer ID", "openflow_v4.packet_out.buffer_id", + FT_UINT32, BASE_HEX, VALS(openflow_v4_buffer_reserved_values), 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_out_in_port, + { "In port", "openflow_v4.packet_out.in_port", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_out_in_port_reserved, + { "In port", "openflow_v4.packet_out.in_port", + FT_UINT32, BASE_HEX, VALS(openflow_v4_port_reserved_values), 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_out_acts_len, + { "Actions length", "openflow_v4.packet_out.acts_len", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_openflow_v4_packet_out_pad, + { "Padding", "openflow_v4.packet_out.pad", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, { &hf_openflow_v4_flowmod_cookie, { "Cookie", "openflow_v4.flowmod.cookie", FT_UINT64, BASE_HEX, NULL, 0x0, @@ -2480,17 +3671,17 @@ }, { &hf_openflow_v4_flowmod_idle_timeout, { "Idle timeout", "openflow_v4.flowmod.idle_timeout", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_openflow_v4_flowmod_hard_timeout, { "Hard timeout", "openflow_v4.flowmod.hard_timeout", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_openflow_v4_flowmod_priority, { "Priority", "openflow_v4.flowmod.priority", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_openflow_v4_flowmod_buffer_id, @@ -2650,8 +3841,18 @@ &ett_openflow_v4_action, &ett_openflow_v4_instruction, &ett_openflow_v4_instruction_actions_actions, + &ett_openflow_v4_port, + &ett_openflow_v4_port_config, + &ett_openflow_v4_port_state, + &ett_openflow_v4_port_current, + &ett_openflow_v4_port_advertised, + &ett_openflow_v4_port_supported, + &ett_openflow_v4_port_peer, &ett_openflow_v4_hello_element, - &ett_openflow_v4_error_data + &ett_openflow_v4_error_data, + &ett_openflow_v4_switch_config_flags, + &ett_openflow_v4_packet_in_data, + &ett_openflow_v4_packet_out_data }; static ei_register_info ei[] = { @@ -2678,6 +3879,10 @@ { &ei_openflow_v4_error_undecoded, { "openflow_v4.error.undecoded", PI_UNDECODED, PI_NOTE, "Unknown error data.", EXPFILL } + }, + { &ei_openflow_v4_experimenter_undecoded, + { "openflow_v4.experimenter.undecoded", PI_UNDECODED, PI_NOTE, + "Unknown experimenter body.", EXPFILL } } }; @@ -2689,6 +3894,8 @@ new_register_dissector("openflow_v4", dissect_openflow_v4, proto_openflow_v4); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); + /* Required function calls to register the header fields and subtrees */ proto_register_field_array(proto_openflow_v4, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-opensafety.c wireshark-1.12.0~201311020920/epan/dissectors/packet-opensafety.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-opensafety.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-opensafety.c 2013-11-02 02:12:36.000000000 +0000 @@ -184,15 +184,21 @@ { 0, NULL } }; -/* Values 5-255 are reserved for future use. They will be presented as "Reserved [%d]" +/* Values 6-255 are reserved for future use. They will be presented as "Reserved [%d]" * during dissection */ +#define OPENSAFETY_ERROR_GROUP_APPLICATION 0x01 +#define OPENSAFETY_ERROR_GROUP_PARAMETER 0x02 +#define OPENSAFETY_ERROR_GROUP_VENDOR_SPECIFIC 0x03 +#define OPENSAFETY_ERROR_GROUP_OPENSAFETY_STACK 0x04 +#define OPENSAFETY_ERROR_GROUP_ADD_PARAMETER 0x05 + static const value_string sn_fail_error_group[] = { - { 1, "Application" }, - { 2, "Parameter" }, - { 3, "Vendor specific" }, - { 4, "openSAFETY Stack" }, - { 5, "Additional parameter needed" }, + { OPENSAFETY_ERROR_GROUP_APPLICATION, "Application" }, + { OPENSAFETY_ERROR_GROUP_PARAMETER, "Parameter" }, + { OPENSAFETY_ERROR_GROUP_VENDOR_SPECIFIC, "Vendor specific" }, + { OPENSAFETY_ERROR_GROUP_OPENSAFETY_STACK, "openSAFETY Stack" }, + { OPENSAFETY_ERROR_GROUP_ADD_PARAMETER, "Additional parameter needed" }, { 0, NULL } }; @@ -410,6 +416,8 @@ #define OPENSAFETY_REQUEST TRUE #define OPENSAFETY_RESPONSE FALSE +static const true_false_string opensafety_addparam_request = { "Header only", "Header & Data" }; + #define OSS_FRAME_POS_ADDR 0 #define OSS_FRAME_POS_ID 1 #define OSS_FRAME_POS_LEN 2 @@ -484,6 +492,9 @@ static int hf_oss_snmt_service_id = -1; static int hf_oss_snmt_error_group = -1; static int hf_oss_snmt_error_code = -1; +static int hf_oss_snmt_param_type = -1; +static int hf_oss_snmt_ext_addsaddr = -1; +static int hf_oss_snmt_ext_addtxspdo = -1; static int hf_oss_ssdo_server = -1; static int hf_oss_ssdo_client = -1; @@ -1444,7 +1455,7 @@ proto_tree *snmt_tree; guint32 entry = 0; guint16 addr, taddr, sdn; - guint8 db0, byte; + guint8 db0, byte, errcode; guint dataLength; char *tempString; @@ -1497,25 +1508,51 @@ } else if ( (OSS_FRAME_ID_T(message_tvb, frameStart1) ^ OPENSAFETY_MSG_SNMT_SERVICE_RESPONSE) == 0 ) { - proto_tree_add_uint(snmt_tree, hf_oss_snmt_service_id, message_tvb, OSS_FRAME_POS_DATA + frameStart1, 1, db0); - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(db0, message_service_type, "Unknown")); + byte = tvb_get_guint8(message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 1); + + if ( ! ( (db0 ^ OPENSAFETY_MSG_SNMT_EXT_SN_FAIL) == 0 && byte == OPENSAFETY_ERROR_GROUP_ADD_PARAMETER ) ) + { + proto_tree_add_uint(snmt_tree, hf_oss_snmt_service_id, message_tvb, OSS_FRAME_POS_DATA + frameStart1, 1, db0); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(db0, message_service_type, "Unknown")); + } + else + { + proto_tree_add_uint_format_value(snmt_tree, hf_oss_snmt_service_id, message_tvb, OSS_FRAME_POS_DATA + frameStart1, 1, + db0, "%s [Request via SN Fail] (0x%02X)", val_to_str_const(byte, sn_fail_error_group, "Unknown"), db0); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(byte, sn_fail_error_group, "Unknown")); + } proto_tree_add_uint(snmt_tree, hf_oss_snmt_master, message_tvb, OSS_FRAME_POS_ADDR + frameStart1, 2, addr); proto_tree_add_uint(snmt_tree, hf_oss_snmt_slave, message_tvb, frameStart2 + 3, 2, taddr); + if ( (db0 ^ OPENSAFETY_MSG_SNMT_EXT_SN_FAIL) == 0 ) { - byte = tvb_get_guint8(message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 1); - proto_tree_add_uint_format_value(snmt_tree, hf_oss_snmt_error_group, message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 1, 1, - byte, "%s", ( byte == 0 ? "Device" : val_to_str(byte, sn_fail_error_group, "Reserved [%d]" ) ) ); - - byte = tvb_get_guint8(message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 2); - proto_tree_add_uint_format_value(snmt_tree, hf_oss_snmt_error_code, message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 2, 1, - byte, "%s [%d]", ( byte == 0 ? "Default" : "Vendor Specific" ), byte ); - - col_append_fstr(pinfo->cinfo, COL_INFO, " - Group: %s; Code: %s", - ( byte == 0 ? "Device" : val_to_str(byte, sn_fail_error_group, "Reserved [%d]" ) ), - ( byte == 0 ? "Default" : "Vendor Specific" ) - ); + /* Handle a normal SN Fail */ + if ( byte != OPENSAFETY_ERROR_GROUP_ADD_PARAMETER ) + { + proto_tree_add_uint_format_value(snmt_tree, hf_oss_snmt_error_group, message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 1, 1, + byte, "%s", ( byte == 0 ? "Device" : val_to_str(byte, sn_fail_error_group, "Reserved [%d]" ) ) ); + + errcode = tvb_get_guint8(message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 2); + proto_tree_add_uint_format_value(snmt_tree, hf_oss_snmt_error_code, message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 2, 1, + errcode, "%s [%d]", ( errcode == 0 ? "Default" : "Vendor Specific" ), errcode ); + + col_append_fstr(pinfo->cinfo, COL_INFO, " - Group: %s; Code: %s", + ( byte == 0 ? "Device" : val_to_str(byte, sn_fail_error_group, "Reserved [%d]" ) ), + ( errcode == 0 ? "Default" : "Vendor Specific" ) + ); + } + else + { + errcode = tvb_get_guint8(message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 2); + + /* Handle an additional parameter request */ + proto_tree_add_uint(snmt_tree, hf_oss_ssdo_extpar_parset, message_tvb, + OSS_FRAME_POS_DATA + frameStart1 + 2, 1, ( errcode & 0x0F ) + 1 ); + + proto_tree_add_boolean(snmt_tree, hf_oss_snmt_param_type, message_tvb, + OSS_FRAME_POS_DATA + frameStart1 + 2, 1, ( ( errcode & 0xF0 ) != 0xF0 ) ); + } } else if ( (db0 ^ OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_UDID_SCM) == 0 ) { @@ -1529,12 +1566,23 @@ { local_scm_udid = (char *)wmem_alloc0(wmem_file_scope(), 18 * sizeof(char)); g_snprintf(local_scm_udid, 18, "%s", tempString ); - expert_add_info_format(pinfo, item, &ei_scmudid_autodetected, "Auto detected payload as SCM UDID [%s].", tempString); + expert_add_info_format(pinfo, item, &ei_scmudid_autodetected, "Auto detected payload as SCM UDID [%s].", local_scm_udid); } } } + else if ( ( db0 ^ OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_ADDITIONAL_SADR) == 0 ) + { + proto_tree_add_uint(snmt_tree, hf_oss_snmt_ext_addsaddr, message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 1, 2, + OSS_FRAME_ADDR_T(message_tvb, frameStart1 + OSS_FRAME_POS_DATA + 1)); + proto_tree_add_uint(snmt_tree, hf_oss_snmt_ext_addtxspdo, message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 3, 2, + OSS_FRAME_ADDR_T(message_tvb, frameStart1 + OSS_FRAME_POS_DATA + 3)); + + col_append_fstr(pinfo->cinfo, COL_INFO, " [0x%04X => 0x%04X]", + OSS_FRAME_ADDR_T(message_tvb, frameStart1 + OSS_FRAME_POS_DATA + 1), + OSS_FRAME_ADDR_T(message_tvb, frameStart1 + OSS_FRAME_POS_DATA + 3)); + } } else if ( (OSS_FRAME_ID_T(message_tvb, frameStart1) ^ OPENSAFETY_MSG_SNMT_SERVICE_REQUEST) == 0 ) { @@ -1576,6 +1624,19 @@ proto_tree_add_uint_format_value ( snmt_tree, hf_oss_sod_par_timestamp, message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 1, 4, entry, "0x%08X", entry ); } + else if ( ( db0 ^ OPENSAFETY_MSG_SNMT_EXT_ASSIGN_ADDITIONAL_SADR) == 0 ) + { + proto_tree_add_uint(snmt_tree, hf_oss_snmt_ext_addsaddr, message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 1, 2, + OSS_FRAME_ADDR_T(message_tvb, frameStart1 + OSS_FRAME_POS_DATA + 1)); + + proto_tree_add_uint(snmt_tree, hf_oss_snmt_ext_addtxspdo, message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 3, 2, + OSS_FRAME_ADDR_T(message_tvb, frameStart1 + OSS_FRAME_POS_DATA + 3)); + + col_append_fstr(pinfo->cinfo, COL_INFO, " [0x%04X => 0x%04X]", + OSS_FRAME_ADDR_T(message_tvb, frameStart1 + OSS_FRAME_POS_DATA + 1), + OSS_FRAME_ADDR_T(message_tvb, frameStart1 + OSS_FRAME_POS_DATA + 3)); + } + } } else if ( (OSS_FRAME_ID_T(message_tvb, frameStart1) ^ OPENSAFETY_MSG_SNMT_SADR_ASSIGNED) == 0 ) @@ -2364,6 +2425,15 @@ { &hf_oss_snmt_error_code, { "Error Code", "opensafety.snmt.error_code", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_oss_snmt_param_type, + { "Parameter Request Type", "opensafety.snmt.parameter_type", + FT_BOOLEAN, BASE_NONE, TFS(&opensafety_addparam_request), 0x0, NULL, HFILL } }, + { &hf_oss_snmt_ext_addsaddr, + { "Additional SADDR", "opensafety.snmt.additional.saddr", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_oss_snmt_ext_addtxspdo, + { "Additional TxSPDO", "opensafety.snmt.additional.txspdo", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* SSDO Specific fields */ { &hf_oss_ssdo_server, @@ -2411,19 +2481,19 @@ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_oss_ssdo_extpar_parset, - { "Set Nr", "opensafety.ssdo.extpar.setnr", + { "Additional Parameter Set", "opensafety.ssdo.extpar.setnr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_oss_ssdo_extpar_version, - { "Version", "opensafety.ssdo.extpar.version", + { "Parameter Set Version", "opensafety.ssdo.extpar.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_oss_ssdo_extpar_saddr, - { "SADDR", "opensafety.ssdo.extpar.saddr", + { "Parameter Set for SADDR", "opensafety.ssdo.extpar.saddr", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_oss_ssdo_extpar_length, - { "Set Length", "opensafety.ssdo.extpar.length", + { "Parameter Set Length", "opensafety.ssdo.extpar.length", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_oss_ssdo_extpar_crc, - { "Set CRC", "opensafety.ssdo.extpar.crc", + { "Parameter Set CRC", "opensafety.ssdo.extpar.crc", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_oss_ssdo_extpar_tstamp, { "Timestamp", "opensafety.ssdo.extpar.timestamp", diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-openvpn.c wireshark-1.12.0~201311020920/epan/dissectors/packet-openvpn.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-openvpn.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-openvpn.c 2013-11-02 02:12:36.000000000 +0000 @@ -374,7 +374,7 @@ new_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled Message", frag_msg, &openvpn_frag_items, NULL, openvpn_tree); if (frag_msg->next != NULL) { /* multiple frags ? */ - col_append_fstr(pinfo->cinfo, COL_INFO, " (Message Reassembled "); /* overwritten by next dissector */ + col_append_str(pinfo->cinfo, COL_INFO, " (Message Reassembled "); /* overwritten by next dissector */ } } else { /* Not last packet of reassembled Short Message */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ouch.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ouch.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ouch.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ouch.c 2013-11-02 02:12:36.000000000 +0000 @@ -642,7 +642,6 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "OUCH"); /* Set the packet name in the info column */ - col_clear(pinfo->cinfo, COL_INFO); col_add_str(pinfo->cinfo, COL_INFO, pkt_name); if (tree) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-p1.c wireshark-1.12.0~201311020920/epan/dissectors/packet-p1.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-p1.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-p1.c 2013-11-02 02:12:36.000000000 +0000 @@ -1052,7 +1052,7 @@ #line 1154 "../../asn1/p1/p1.cnf" if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -1243,7 +1243,7 @@ const char *name; if (actx->external.direct_reference) { - offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); name = oid_resolved_from_string(actx->external.direct_reference); proto_item_append_text(tree, " (%s)", name ? name : actx->external.direct_reference); } else { @@ -3060,7 +3060,7 @@ expert_add_info(actx->pinfo, item, &ei_p1_unknown_standard_extension); } } else if (actx->external.direct_ref_present) { - offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); name = oid_resolved_from_string(actx->external.direct_reference); proto_item_append_text(tree, " (%s)", name ? name : actx->external.direct_reference); } @@ -3235,7 +3235,7 @@ if (next_tvb) { if (ctx && ctx->content_type_id) { - (void) call_ber_oid_callback(ctx->content_type_id, next_tvb, 0, actx->pinfo, actx->subtree.top_tree ? actx->subtree.top_tree : tree); + (void) call_ber_oid_callback(ctx->content_type_id, next_tvb, 0, actx->pinfo, actx->subtree.top_tree ? actx->subtree.top_tree : tree, NULL); } else if (ctx && ctx->report_unknown_content_type) { proto_item *item = NULL; proto_tree *next_tree = NULL; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-p22.c wireshark-1.12.0~201311020920/epan/dissectors/packet-p22.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-p22.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-p22.c 2013-11-02 02:12:36.000000000 +0000 @@ -1052,7 +1052,7 @@ dissect_p22_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 229 "../../asn1/p22/p22.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-p7.c wireshark-1.12.0~201311020920/epan/dissectors/packet-p7.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-p7.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-p7.c 2013-11-02 02:12:36.000000000 +0000 @@ -703,7 +703,7 @@ static int dissect_p7_AttributeItem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); return offset; @@ -761,7 +761,7 @@ static int dissect_p7_T_registration_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -800,7 +800,7 @@ static int dissect_p7_T_error_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); return offset; @@ -1406,7 +1406,7 @@ static int dissect_p7_T_attribute_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); return offset; @@ -1432,7 +1432,7 @@ static int dissect_p7_T_initial(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); return offset; @@ -1443,7 +1443,7 @@ static int dissect_p7_T_any(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); return offset; @@ -1454,7 +1454,7 @@ static int dissect_p7_T_final(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); return offset; @@ -1517,7 +1517,7 @@ static int dissect_p7_T_match_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); return offset; @@ -1886,7 +1886,7 @@ static int dissect_p7_SummaryPresentItemValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); return offset; @@ -2602,7 +2602,7 @@ static int dissect_p7_OrderedAttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); return offset; @@ -2892,7 +2892,7 @@ static int dissect_p7_T_attr_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(actx->external.direct_reference) - call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pcli.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pcli.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pcli.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pcli.c 2013-11-02 02:12:36.000000000 +0000 @@ -69,65 +69,63 @@ static void dissect_pcli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - guint32 cccid; - proto_tree *ti,*pcli_tree; - tvbuff_t * next_tvb; - - /* Set the protocol column */ - col_set_str(pinfo->cinfo, COL_PROTOCOL, "PCLI"); - - /* Get the CCCID */ - cccid = tvb_get_ntohl(tvb,0); - - /* Set the info column */ - col_add_fstr(pinfo->cinfo, COL_INFO, "CCCID: %u",cccid); - - /* - *If we have a non-null tree (ie we are building the proto_tree - * instead of just filling out the columns ), then add a PLCI - * tree node and put a CCCID header element under it. - */ - if(tree) { - ti = proto_tree_add_item(tree,proto_pcli,tvb,0,0,ENC_NA); - pcli_tree = proto_item_add_subtree(ti,ett_pcli); - proto_tree_add_uint(pcli_tree,hf_pcli_cccid,tvb, - 0,4,cccid); - } - - /* - * Hand off to the IP dissector. - */ - next_tvb = tvb_new_subset_remaining(tvb,4); - call_dissector(ip_handle,next_tvb,pinfo,tree); + guint32 cccid; + proto_tree *ti,*pcli_tree; + tvbuff_t * next_tvb; + + /* Set the protocol column */ + col_set_str(pinfo->cinfo, COL_PROTOCOL, "PCLI"); + + /* Get the CCCID */ + cccid = tvb_get_ntohl(tvb,0); + + /* Set the info column */ + col_add_fstr(pinfo->cinfo, COL_INFO, "CCCID: %u",cccid); + + /* + *If we have a non-null tree (ie we are building the proto_tree + * instead of just filling out the columns ), then add a PLCI + * tree node and put a CCCID header element under it. + */ + if(tree) { + ti = proto_tree_add_item(tree, proto_pcli, tvb, 0, 0, ENC_NA); + pcli_tree = proto_item_add_subtree(ti,ett_pcli); + proto_tree_add_uint(pcli_tree, hf_pcli_cccid, tvb, 0, 4, cccid); + } + + /* + * Hand off to the IP dissector. + */ + next_tvb = tvb_new_subset_remaining(tvb,4); + call_dissector(ip_handle,next_tvb,pinfo,tree); } void proto_register_pcli(void) { - static hf_register_info hf[] = { - { &hf_pcli_cccid, - { "CCCID", "pcli.cccid", FT_UINT32, BASE_DEC, NULL, 0x0, - "Call Content Connection Identifier", HFILL }}, - }; - - static gint *ett[] = { - &ett_pcli, - }; - - module_t *pcli_module; - - proto_pcli = proto_register_protocol("Packet Cable Lawful Intercept", - "PCLI","pcli"); - proto_register_field_array(proto_pcli,hf,array_length(hf)); - proto_register_subtree_array(ett,array_length(ett)); - - pcli_module = prefs_register_protocol(proto_pcli, - proto_reg_handoff_pcli); - prefs_register_uint_preference(pcli_module, "udp_port", - "PCLI UDP Port", - "The UDP port on which " - "Packet Cable Lawful Intercept " - "packets will be sent", - 10,&global_udp_port_pcli); + static hf_register_info hf[] = { + { &hf_pcli_cccid, + { "CCCID", "pcli.cccid", FT_UINT32, BASE_DEC, NULL, 0x0, + "Call Content Connection Identifier", HFILL }}, + }; + + static gint *ett[] = { + &ett_pcli, + }; + + module_t *pcli_module; + + proto_pcli = proto_register_protocol("Packet Cable Lawful Intercept", + "PCLI","pcli"); + proto_register_field_array(proto_pcli,hf,array_length(hf)); + proto_register_subtree_array(ett,array_length(ett)); + + pcli_module = prefs_register_protocol(proto_pcli, proto_reg_handoff_pcli); + prefs_register_uint_preference(pcli_module, "udp_port", + "PCLI UDP Port", + "The UDP port on which " + "Packet Cable Lawful Intercept " + "packets will be sent", + 10,&global_udp_port_pcli); } @@ -135,19 +133,32 @@ void proto_reg_handoff_pcli(void) { - static gboolean pcli_initialized = FALSE; - static dissector_handle_t pcli_handle; - static guint udp_port_pcli; - - if(!pcli_initialized) { - pcli_handle = create_dissector_handle(dissect_pcli,proto_pcli); - ip_handle = find_dissector("ip"); - pcli_initialized = TRUE; - } else { - dissector_delete_uint("udp.port",udp_port_pcli,pcli_handle); - } + static gboolean pcli_initialized = FALSE; + static dissector_handle_t pcli_handle; + static guint udp_port_pcli; + + if(!pcli_initialized) { + pcli_handle = create_dissector_handle(dissect_pcli,proto_pcli); + ip_handle = find_dissector("ip"); + pcli_initialized = TRUE; + } else { + dissector_delete_uint("udp.port",udp_port_pcli,pcli_handle); + } - udp_port_pcli = global_udp_port_pcli; + udp_port_pcli = global_udp_port_pcli; - dissector_add_uint("udp.port",global_udp_port_pcli,pcli_handle); + dissector_add_uint("udp.port",global_udp_port_pcli,pcli_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pcp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pcp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pcp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pcp.c 2013-11-02 02:12:36.000000000 +0000 @@ -1393,9 +1393,9 @@ /* check if we are the client requesting or the server */ if (pinfo->srcport == PCP_PORT) { - col_add_str(pinfo->cinfo, COL_INFO, "Server > Client "); + col_set_str(pinfo->cinfo, COL_INFO, "Server > Client "); } else { - col_add_str(pinfo->cinfo, COL_INFO, "Client > Server "); + col_set_str(pinfo->cinfo, COL_INFO, "Client > Server "); } /* PCP packet length */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pdcp-lte.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pdcp-lte.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pdcp-lte.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pdcp-lte.c 2013-11-02 02:12:36.000000000 +0000 @@ -102,7 +102,11 @@ static int hf_pdcp_lte_sequence_analysis_repeated = -1; static int hf_pdcp_lte_sequence_analysis_skipped = -1; - +/* Security Settings */ +static int hf_pdcp_lte_security = -1; +static int hf_pdcp_lte_security_setup_frame = -1; +static int hf_pdcp_lte_security_integrity_algorithm = -1; +static int hf_pdcp_lte_security_ciphering_algorithm = -1; /* Protocol subtree. */ @@ -111,6 +115,7 @@ static int ett_pdcp_packet = -1; static int ett_pdcp_lte_sequence_analysis = -1; static int ett_pdcp_report_bitmap = -1; +static int ett_pdcp_security = -1; static expert_field ei_pdcp_lte_sequence_analysis_wrong_sequence_number = EI_INIT; static expert_field ei_pdcp_lte_reserved_bits_not_zero = EI_INIT; @@ -175,49 +180,25 @@ { 0, NULL } }; -#if 0 -static const value_string feedback_ack_vals[] = { - { 0, "ACK" }, - { 1, "NACK" }, - { 2, "STATIC-NACK" }, - { 0, NULL } -}; -#endif - -#if 0 -static const value_string feedback_option_vals[] = { - { 1, "CRC" }, - { 2, "REJECT" }, - { 3, "SN-Not-Valid" }, - { 4, "SN" }, - { 5, "Clock" }, - { 6, "Jitter" }, - { 7, "Loss" }, - { 0, NULL } -}; -#endif - static const value_string control_pdu_type_vals[] = { { 0, "PDCP Status report" }, { 1, "Header Compression Feedback Information" }, { 0, NULL } }; -#if 0 -static const value_string t_vals[] = { - { 0, "ID message format" }, - { 1, "TS message format" }, +static const value_string integrity_algorithm_vals[] = { + { 0, "EIA0" }, + { 1, "EIA1" }, + { 2, "EIA2" }, { 0, NULL } }; -#endif -#if 0 -static const value_string ip_protocol_vals[] = { - { 6, "TCP" }, - { 17, "UDP" }, +static const value_string ciphering_algorithm_vals[] = { + { 0, "EEA0" }, + { 1, "EEA1" }, + { 2, "EEA2" }, { 0, NULL } }; -#endif static dissector_handle_t ip_handle; @@ -654,6 +635,64 @@ } + +/* Hash table for security state for a UE + Maps UEId -> pdcp_security_info_t* */ +static gint pdcp_lte_ueid_hash_equal(gconstpointer v, gconstpointer v2) +{ + return (v == v2); +} +static guint pdcp_lte_ueid_hash_func(gconstpointer v) +{ + return GPOINTER_TO_UINT(v); +} +static GHashTable *pdcp_security_hash = NULL; + +/* Result is (ueid, framenum) -> pdcp_security_info_t* */ +typedef struct ueid_frame_t { + guint32 framenum; + guint16 ueid; +} ueid_frame_t; + +/* Convenience function to get a pointer for the hash_func to work with */ +static gpointer get_ueid_frame_hash_key(guint16 ueid, guint32 frameNumber, + gboolean do_persist) +{ + static ueid_frame_t key; + ueid_frame_t *p_key; + + /* Only allocate a struct when will be adding entry */ + if (do_persist) { + p_key = wmem_new(wmem_file_scope(), ueid_frame_t); + } + else { + memset(&key, 0, sizeof(ueid_frame_t)); + p_key = &key; + } + + /* Fill in details, and return pointer */ + p_key->framenum = frameNumber; + p_key->ueid = ueid; + + return p_key; +} + +static gint pdcp_lte_ueid_frame_hash_equal(gconstpointer v, gconstpointer v2) +{ + ueid_frame_t *ueid_frame_1 = (ueid_frame_t *)v; + ueid_frame_t *ueid_frame_2 = (ueid_frame_t *)v2; + return ((ueid_frame_1->framenum == ueid_frame_2->framenum) && (ueid_frame_1->ueid == ueid_frame_2->ueid)); +} +static guint pdcp_lte_ueid_frame_hash_func(gconstpointer v) +{ + ueid_frame_t *ueid_frame = (ueid_frame_t *)v; + return ueid_frame->framenum + 100*ueid_frame->ueid; +} +static GHashTable *pdcp_security_result_hash = NULL; + + + + /* Write the given formatted text to: - the info column - the top-level RLC PDU item */ @@ -992,6 +1031,17 @@ return TRUE; } +/* Called from control protocol to configure security algorithms for the given UE */ +void set_pdcp_lte_security_algorithms(guint16 ueid, pdcp_security_info_t *security_info) +{ + /* Copy security struct */ + pdcp_security_info_t *p_security = wmem_new(wmem_file_scope(), pdcp_security_info_t); + *p_security = *security_info; + + /* And add into security table */ + g_hash_table_insert(pdcp_security_hash, GUINT_TO_POINTER((guint)ueid), p_security); +} + /******************************/ /* Main dissection function. */ @@ -1005,8 +1055,11 @@ struct pdcp_lte_info *p_pdcp_info; rohc_info *p_rohc_info; tvbuff_t *rohc_tvb = NULL; + pdcp_security_info_t *current_security = NULL; /* current security for this UE */ + pdcp_security_info_t *pdu_security; /* security in place for this PDU */ + - /* Append this protocol name rather than replace. */ + /* Set protocol name. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "PDCP-LTE"); /* Look for attached packet info! */ @@ -1037,6 +1090,7 @@ /* Set mode string */ mode = val_to_str_const(p_pdcp_info->mode, rohc_mode_vals, "Error"); + /*****************************************************/ /* Show configuration (attached packet) info in tree */ if (pdcp_tree) { show_pdcp_config(pinfo, tvb, pdcp_tree, p_pdcp_info); @@ -1047,7 +1101,58 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " (mode=%c)", mode[0]); } + /***************************************/ + /* UE security algorithms */ + if (!pinfo->fd->flags.visited) { + /* Look up current state by UEID */ + current_security = (pdcp_security_info_t*)g_hash_table_lookup(pdcp_security_hash, + GUINT_TO_POINTER((guint)p_pdcp_info->ueid)); + if (current_security != NULL) { + /* Store any result for this frame in the result table */ + pdcp_security_info_t *security_to_store = wmem_new(wmem_file_scope(), pdcp_security_info_t); + *security_to_store = *current_security; + g_hash_table_insert(pdcp_security_result_hash, + get_ueid_frame_hash_key(p_pdcp_info->ueid, pinfo->fd->num, TRUE), + security_to_store); + } + } + /* Show security settings for this PDU */ + pdu_security = (pdcp_security_info_t*)g_hash_table_lookup(pdcp_security_result_hash, get_ueid_frame_hash_key(p_pdcp_info->ueid, pinfo->fd->num, FALSE)); + if (pdu_security != NULL) { + proto_tree *security_tree; + proto_item *security_ti, *ti; + + /* Create subtree */ + security_ti = proto_tree_add_string_format(pdcp_tree, + hf_pdcp_lte_security, + tvb, 0, 0, + "", "UE Security"); + security_tree = proto_item_add_subtree(security_ti, + ett_pdcp_security); + PROTO_ITEM_SET_GENERATED(security_ti); + + /* Setup frame */ + ti = proto_tree_add_uint(security_tree, hf_pdcp_lte_security_setup_frame, + tvb, 0, 0, pdu_security->configuration_frame); + PROTO_ITEM_SET_GENERATED(ti); + + /* Ciphering */ + ti = proto_tree_add_uint(security_tree, hf_pdcp_lte_security_ciphering_algorithm, + tvb, 0, 0, pdu_security->ciphering); + PROTO_ITEM_SET_GENERATED(ti); + + /* Integrity */ + ti = proto_tree_add_uint(security_tree, hf_pdcp_lte_security_integrity_algorithm, + tvb, 0, 0, pdu_security->integrity); + PROTO_ITEM_SET_GENERATED(ti); + + proto_item_append_text(security_ti, " (ciphering=%s, integrity=%s)", + val_to_str_const(pdu_security->ciphering, ciphering_algorithm_vals, "Unknown"), + val_to_str_const(pdu_security->integrity, integrity_algorithm_vals, "Unknown")); + } + + /***********************************/ /* Handle PDCP header (if present) */ if (!p_pdcp_info->no_header_pdu) { @@ -1086,7 +1191,8 @@ /* RRC data is all but last 4 bytes. Call lte-rrc dissector (according to direction and channel type) */ - if (global_pdcp_dissect_signalling_plane_as_rrc) { + if ((global_pdcp_dissect_signalling_plane_as_rrc) && + ((pdu_security == NULL) || (pdu_security->ciphering == 0) || !pdu_security->seen_next_ul_pdu)){ /* Get appropriate dissector handle */ dissector_handle_t rrc_handle = lookup_rrc_dissector_handle(p_pdcp_info); @@ -1110,6 +1216,15 @@ proto_tree_add_item(pdcp_tree, hf_pdcp_lte_signalling_data, tvb, offset, tvb_length_remaining(tvb, offset) - 4, ENC_NA); } + + if (!pinfo->fd->flags.visited && + (current_security != NULL) && !current_security->seen_next_ul_pdu && + p_pdcp_info->direction == DIRECTION_UPLINK) + { + /* i.e. we have already seen SecurityModeResponse! */ + current_security->seen_next_ul_pdu = TRUE; + } + } else { /* Just show as unparsed data */ @@ -1127,7 +1242,6 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " MAC=0x%08x (%u bytes data)", mac, data_length); - } else if (p_pdcp_info->plane == USER_PLANE) { @@ -1324,7 +1438,12 @@ gint payload_length = tvb_length_remaining(tvb, offset); if (payload_length > 0) { if (p_pdcp_info->plane == USER_PLANE) { - if (global_pdcp_dissect_user_plane_as_ip) { + + /* Not attempting to decode payload if ciphering is enabled + (and NULL ciphering is not being used) */ + if (global_pdcp_dissect_user_plane_as_ip && + ((pdu_security == NULL) || (pdu_security->ciphering == 0))) + { tvbuff_t *payload_tvb = tvb_new_subset_remaining(tvb, offset); /* Don't update info column for ROHC unless configured to */ @@ -1354,37 +1473,17 @@ proto_tree_add_item(pdcp_tree, hf_pdcp_lte_user_plane_data, tvb, offset, -1, ENC_NA); } } - else { - if (global_pdcp_dissect_signalling_plane_as_rrc) { - /* Get appropriate dissector handle */ - dissector_handle_t rrc_handle = lookup_rrc_dissector_handle(p_pdcp_info); - - if (rrc_handle != 0) { - /* Call RRC dissector if have one */ - tvbuff_t *payload_tvb = tvb_new_subset(tvb, offset, - payload_length, - payload_length); - - call_dissector_only(rrc_handle, payload_tvb, pinfo, pdcp_tree, NULL); - } - else { - /* Just show data */ - proto_tree_add_item(pdcp_tree, hf_pdcp_lte_signalling_data, tvb, offset, - payload_length, ENC_NA); - } - } - else { - proto_tree_add_item(pdcp_tree, hf_pdcp_lte_signalling_data, tvb, offset, -1, ENC_NA); - } - } write_pdu_label_and_info(root_ti, pinfo, "(%u bytes data)", payload_length); } + /* (there will be no signalling data left at this point) */ + /* Let RLC write to columns again */ col_set_writable(pinfo->cinfo, global_pdcp_lte_layer_to_show == ShowRLCLayer); + /* DROPPING OUT HERE IF NOT DOING ROHC! */ return; } @@ -1443,11 +1542,18 @@ if (pdcp_lte_sequence_analysis_report_hash) { g_hash_table_destroy(pdcp_lte_sequence_analysis_report_hash); } - + if (pdcp_security_hash) { + g_hash_table_destroy(pdcp_security_hash); + } + if (pdcp_security_result_hash) { + g_hash_table_destroy(pdcp_security_result_hash); + } /* Now create them over */ pdcp_sequence_analysis_channel_hash = g_hash_table_new(pdcp_channel_hash_func, pdcp_channel_equal); pdcp_lte_sequence_analysis_report_hash = g_hash_table_new(pdcp_result_hash_func, pdcp_result_hash_equal); + pdcp_security_hash = g_hash_table_new(pdcp_lte_ueid_hash_func, pdcp_lte_ueid_hash_equal); + pdcp_security_result_hash = g_hash_table_new(pdcp_lte_ueid_frame_hash_func, pdcp_lte_ueid_frame_hash_equal); } @@ -1685,7 +1791,30 @@ } }, - + { &hf_pdcp_lte_security, + { "Security Config", + "pdcp-lte.security-cofig", FT_STRING, BASE_NONE, 0, 0x0, + NULL, HFILL + } + }, + { &hf_pdcp_lte_security_setup_frame, + { "Configuration frame", + "pdcp-lte.security-config.setup-frame", FT_FRAMENUM, BASE_NONE, 0, 0x0, + NULL, HFILL + } + }, + { &hf_pdcp_lte_security_integrity_algorithm, + { "Integrity Algorithm", + "pdcp-lte.security-config.integrity", FT_UINT16, BASE_DEC, VALS(integrity_algorithm_vals), 0x0, + NULL, HFILL + } + }, + { &hf_pdcp_lte_security_ciphering_algorithm, + { "Ciphering Algorithm", + "pdcp-lte.security-config.ciphering", FT_UINT16, BASE_DEC, VALS(ciphering_algorithm_vals), 0x0, + NULL, HFILL + } + }, }; static gint *ett[] = @@ -1694,7 +1823,8 @@ &ett_pdcp_configuration, &ett_pdcp_packet, &ett_pdcp_lte_sequence_analysis, - &ett_pdcp_report_bitmap + &ett_pdcp_report_bitmap, + &ett_pdcp_security }; static ei_register_info ei[] = { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pdcp-lte.h wireshark-1.12.0~201311020920/epan/dissectors/packet-pdcp-lte.h --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pdcp-lte.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pdcp-lte.h 2013-11-02 02:12:36.000000000 +0000 @@ -58,6 +58,16 @@ #define PDCP_SN_LENGTH_12_BITS 12 #define PDCP_SN_LENGTH_15_BITS 15 +enum security_integrity_algorithm_e { eia0, eia1, eia2, eia3 }; +enum security_ciphering_algorithm_e { eea0, eea1, eea2 }; + +typedef struct pdcp_security_info_t +{ + guint32 configuration_frame; + gboolean seen_next_ul_pdu; + enum security_integrity_algorithm_e integrity; + enum security_ciphering_algorithm_e ciphering; +} pdcp_security_info_t; /* Info attached to each LTE PDCP/RoHC packet */ @@ -170,3 +180,9 @@ /* PDCP PDU. Following this tag comes the actual PDCP PDU (there is no length, the PDU continues until the end of the frame) */ #define PDCP_LTE_PAYLOAD_TAG 0x01 + + + +/* Function to configure ciphering & integrity algorithms */ +void set_pdcp_lte_security_algorithms(guint16 ueid, pdcp_security_info_t *security_info); + diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pkcs12.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pkcs12.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pkcs12.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pkcs12.c 2013-11-02 02:12:36.000000000 +0000 @@ -463,7 +463,7 @@ g_string_free(name, TRUE); /* now try and decode it */ - call_ber_oid_callback(object_identifier_id_param, clear_tvb, 0, actx->pinfo, tree); + call_ber_oid_callback(object_identifier_id_param, clear_tvb, 0, actx->pinfo, tree, NULL); return TRUE; #else @@ -616,7 +616,7 @@ dissect_pkcs12_T_bagValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 110 "../../asn1/pkcs12/pkcs12.cnf" if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -641,7 +641,7 @@ dissect_pkcs12_T_attrValues_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 114 "../../asn1/pkcs12/pkcs12.cnf" if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -852,7 +852,7 @@ dissect_pkcs12_T_certValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 118 "../../asn1/pkcs12/pkcs12.cnf" if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -892,7 +892,7 @@ dissect_pkcs12_T_crlValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 122 "../../asn1/pkcs12/pkcs12.cnf" if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -932,7 +932,7 @@ dissect_pkcs12_T_secretValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 126 "../../asn1/pkcs12/pkcs12.cnf" if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pkix1explicit.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pkix1explicit.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pkix1explicit.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pkix1explicit.c 2013-11-02 02:12:36.000000000 +0000 @@ -291,7 +291,7 @@ /* skip past the T and L */ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag); offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -396,7 +396,7 @@ static int dissect_pkix1explicit_T_values_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 44 "../../asn1/pkix1explicit/pkix1explicit.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -436,7 +436,7 @@ static int dissect_pkix1explicit_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 50 "../../asn1/pkix1explicit/pkix1explicit.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pkixac.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pkixac.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pkixac.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pkixac.c 2013-11-02 02:12:36.000000000 +0000 @@ -403,7 +403,7 @@ dissect_pkixac_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 63 "../../asn1/pkixac/pkixac.cnf" if (object_identifier_id) - offset = call_ber_oid_callback (object_identifier_id, tvb, offset, actx->pinfo, tree); + offset = call_ber_oid_callback (object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pkixqualified.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pkixqualified.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pkixqualified.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pkixqualified.c 2013-11-02 02:12:36.000000000 +0000 @@ -237,7 +237,7 @@ static int dissect_pkixqualified_T_statementInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 34 "../../asn1/pkixqualified/pkixqualified.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ppp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ppp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ppp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ppp.c 2013-11-02 02:12:36.000000000 +0000 @@ -3801,7 +3801,7 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_get_protocol_short_name(find_protocol_by_id(proto_id))); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(code, proto_vals, "Unknown")); if (tree) { @@ -4054,7 +4054,7 @@ length = tvb_get_ntohs(tvb, 2); col_set_str(pinfo->cinfo, COL_PROTOCOL, "VSNCP"); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(code, cp_vals, "Unknown")); if (tree) { @@ -4316,7 +4316,7 @@ length = tvb_get_ntohs(tvb, 2); col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP BAP"); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, bap_vals, "Unknown")); if (tree) { @@ -5215,7 +5215,7 @@ code = tvb_get_guint8(tvb, 0); col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP PAP"); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(code, pap_vals, "Unknown")); ti = proto_tree_add_item(tree, proto_pap, tvb, 0, -1, ENC_NA); @@ -5301,7 +5301,7 @@ code = tvb_get_guint8(tvb, 0); col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP CHAP"); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(code, chap_vals, "Unknown")); if (tree) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pppoe.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pppoe.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pppoe.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pppoe.c 2013-11-02 02:12:36.000000000 +0000 @@ -1062,7 +1062,7 @@ /* Start Decoding Here. */ pppoe_code = tvb_get_guint8(tvb, 1); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(pppoe_code, code_vals, "Unknown")); reported_payload_length = tvb_get_ntohs(tvb, 4); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pres.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pres.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pres.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pres.c 2013-11-02 02:12:36.000000000 +0000 @@ -642,7 +642,7 @@ oid=find_oid_by_pres_ctx_id(actx->pinfo, presentation_context_identifier); if(oid){ next_tvb = tvb_new_subset_remaining(tvb, offset); - call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); + call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree, NULL); } else { proto_tree_add_expert(tree, actx->pinfo, &ei_pres_dissector_not_available, tvb, offset, -1); @@ -665,7 +665,7 @@ oid=find_oid_by_pres_ctx_id(actx->pinfo, presentation_context_identifier); if(oid){ dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &next_tvb); - call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); + call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree, NULL); } else { proto_tree_add_expert(tree, actx->pinfo, &ei_pres_dissector_not_available, tvb, offset, -1); @@ -1484,7 +1484,7 @@ /* This is a reassembly initiated in packet-ses */ char *oid = find_oid_by_pres_ctx_id (pinfo, session->pres_ctx_id); if (oid) { - call_ber_oid_callback (oid, tvb, offset, pinfo, parent_tree); + call_ber_oid_callback (oid, tvb, offset, pinfo, parent_tree, NULL); } else { proto_tree_add_text(parent_tree, tvb, offset, tvb_reported_length_remaining(tvb,offset),"User data"); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ptpip.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ptpip.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ptpip.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ptpip.c 2013-11-02 02:12:36.000000000 +0000 @@ -321,7 +321,7 @@ guint16 opcode=0; guint16 transactionID_offset = *offset; /*need to save this to output transaction id in pinfo*/ - col_add_str( + col_set_str( pinfo->cinfo, COL_INFO, "Operation Request Packet "); @@ -380,7 +380,7 @@ */ void dissect_ptpIP_operation_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 *offset) { - col_add_str( + col_set_str( pinfo->cinfo, COL_INFO, "Operation Response Packet "); @@ -400,7 +400,7 @@ */ void dissect_ptpIP_event(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 *offset) { - col_add_str( + col_set_str( pinfo->cinfo, COL_INFO, "Event Packet "); @@ -421,7 +421,7 @@ { guint64 dataLen=0; - col_add_str( + col_set_str( pinfo->cinfo, COL_INFO, "Start Data Packet "); @@ -444,7 +444,7 @@ void dissect_ptpIP_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 *offset) { - col_add_str( + col_set_str( pinfo->cinfo, COL_INFO, "Data Packet "); @@ -462,7 +462,7 @@ void dissect_ptpIP_end_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 *offset) { - col_add_str( + col_set_str( pinfo->cinfo, COL_INFO, "End Data Packet "); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pw-atm.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pw-atm.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pw-atm.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pw-atm.c 2013-11-02 02:12:36.000000000 +0000 @@ -298,15 +298,9 @@ col_append_pw_info(packet_info * pinfo ,const int payload_size ,const int cells - ,const int padding_size) + ,const int padding_size + ,pwatm_private_data_t * pd) { - pwatm_private_data_t * pd; - - DISSECTOR_ASSERT(pinfo != NULL); - - pd = (pwatm_private_data_t *)pinfo->private_data; - DISSECTOR_ASSERT(pd != NULL); - if (pd->props & PWC_ANYOF_CW_BAD) { col_append_str(pinfo->cinfo, COL_INFO, "CW:Bad"); @@ -394,22 +388,18 @@ ,packet_info * pinfo ,proto_tree * tree ,const gint payload_size - ,const gint padding_size) + ,const gint padding_size + ,pwatm_private_data_t * pd) { int dissected; tvbuff_t * tvb_2; - pwatm_private_data_t * pd; - - DISSECTOR_ASSERT(NULL != pinfo); - pd = (pwatm_private_data_t *)pinfo->private_data; - DISSECTOR_ASSERT(NULL != pd); for(dissected = 0, pd->pw_cell_number = 0; payload_size > dissected; ++(pd->pw_cell_number)) { tvb_2 = tvb_new_subset_remaining(tvb, dissected); - dissected += call_dissector(dh_cell_header, tvb_2, pinfo, tree); + dissected += call_dissector_with_data(dh_cell_header, tvb_2, pinfo, tree, pd); tvb_2 = tvb_new_subset_remaining(tvb, dissected); @@ -445,7 +435,7 @@ pinfo->pseudo_header = &ph; prepare_pseudo_header_atm(&ph, pd, AAL_OAMCELL); - call_dissector(dh_atm_oam_cell, tvb_3, pinfo, tree); + call_dissector_with_data(dh_atm_oam_cell, tvb_3, pinfo, tree, pd); dissected += bytes_to_dissect; /* restore pseudo header */ pinfo->pseudo_header = pseudo_header_save; @@ -518,8 +508,6 @@ gint payload_size; int cells; pwatm_private_data_t pd = PWATM_PRIVATE_DATA_T_INITIALIZER; - void * pd_save = pinfo->private_data; - pinfo->private_data = &pd; proto_name_column = &shortname_11_or_aal5_pdu[0]; if (too_small_packet_or_notpw(tvb, pinfo, tree, proto_11_or_aal5_pdu, proto_name_column)) @@ -615,7 +603,7 @@ /* sub-dissectors _may_ overwrite columns in aal5_pdu mode */ col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column); col_clear(pinfo->cinfo, COL_INFO); - col_append_pw_info(pinfo, payload_size, cells, 0); + col_append_pw_info(pinfo, payload_size, cells, 0, &pd); } { @@ -659,12 +647,12 @@ { tvbuff_t* tvb_2; tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW); - call_dissector(dh_control_word, tvb_2, pinfo, tree); + call_dissector_with_data(dh_control_word, tvb_2, pinfo, tree, &pd); tvb_2 = tvb_new_subset_remaining(tvb, (PWC_SIZEOF_CW-1)); if (MODE_11(pd.mode)) { - dissect_payload_and_padding(tvb_2, pinfo, tree, payload_size, 0); + dissect_payload_and_padding(tvb_2, pinfo, tree, payload_size, 0, &pd); } else { /*aal5_pdu mode*/ @@ -679,7 +667,7 @@ pseudo_header_save = pinfo->pseudo_header; pinfo->pseudo_header = &ph; prepare_pseudo_header_atm(&ph, &pd, AAL_5); - call_dissector(dh_atm_untruncated, tvb_3, pinfo, tree); + call_dissector_with_data(dh_atm_untruncated, tvb_3, pinfo, tree, &pd); /* restore pseudo header */ pinfo->pseudo_header = pseudo_header_save; } @@ -691,10 +679,9 @@ /* overwrite everything written by sub-dissectors in 1:1 modes*/ col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column); col_clear(pinfo->cinfo, COL_INFO); - col_append_pw_info(pinfo, payload_size, cells, 0); + col_append_pw_info(pinfo, payload_size, cells, 0, &pd); } - pinfo->private_data = pd_save; return; } @@ -707,9 +694,7 @@ gint padding_size; int cells; pwatm_private_data_t pd = PWATM_PRIVATE_DATA_T_INITIALIZER; - void * pd_save = pinfo->private_data; - pinfo->private_data = &pd; pd.mode = PWATM_MODE_AAL5_SDU; proto_name_column = &shortname_aal5_sdu[0]; @@ -844,7 +829,7 @@ } col_clear(pinfo->cinfo, COL_INFO); - col_append_pw_info(pinfo, payload_size, cells, padding_size); + col_append_pw_info(pinfo, payload_size, cells, padding_size, &pd); { proto_item* item; @@ -870,12 +855,12 @@ { tvbuff_t* tvb_2; tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW); - call_dissector(dh_control_word, tvb_2, pinfo, tree); + call_dissector_with_data(dh_control_word, tvb_2, pinfo, tree, &pd); tvb_2 = tvb_new_subset_remaining(tvb, PWC_SIZEOF_CW); if (PWATM_SUBMODE_ADMIN_CELL == pd.submode) { - dissect_payload_and_padding(tvb_2, pinfo, tree, payload_size, padding_size); + dissect_payload_and_padding(tvb_2, pinfo, tree, payload_size, padding_size, &pd); } else /*AAL5 payload*/ { @@ -890,7 +875,7 @@ pseudo_header_save = pinfo->pseudo_header; pinfo->pseudo_header = &ph; prepare_pseudo_header_atm(&ph, &pd, AAL_5); - call_dissector(dh_atm_truncated, tvb_3, pinfo, tree); /* no PAD and trailer */ + call_dissector_with_data(dh_atm_truncated, tvb_3, pinfo, tree, &pd); /* no PAD and trailer */ /* restore pseudo header */ pinfo->pseudo_header = pseudo_header_save; } @@ -902,9 +887,6 @@ } } } - - pinfo->private_data = pd_save; - return; } @@ -916,9 +898,7 @@ gint padding_size; int cells; pwatm_private_data_t pd = PWATM_PRIVATE_DATA_T_INITIALIZER; - void * pd_save = pinfo->private_data; - pinfo->private_data = &pd; pd.mode = PWATM_MODE_N1_CW; proto_name_column = &shortname_n1_cw[0]; @@ -1057,10 +1037,10 @@ { tvbuff_t* tvb_2; tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW); - call_dissector(dh_control_word, tvb_2, pinfo, tree); + call_dissector_with_data(dh_control_word, tvb_2, pinfo, tree, &pd); tvb_2 = tvb_new_subset_remaining(tvb, PWC_SIZEOF_CW); - dissect_payload_and_padding(tvb_2, pinfo, tree, payload_size, padding_size); + dissect_payload_and_padding(tvb_2, pinfo, tree, payload_size, padding_size, &pd); } /* fill columns in Packet List */ @@ -1068,10 +1048,7 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column); col_clear(pinfo->cinfo, COL_INFO); - col_append_pw_info(pinfo, payload_size, cells, padding_size); - - pinfo->private_data = pd_save; - return; + col_append_pw_info(pinfo, payload_size, cells, padding_size, &pd); } @@ -1082,9 +1059,7 @@ gint payload_size; int cells; pwatm_private_data_t pd = PWATM_PRIVATE_DATA_T_INITIALIZER; - void * pd_save = pinfo->private_data; - pinfo->private_data = &pd; pd.mode = PWATM_MODE_N1_NOCW; pd.packet_size = tvb_reported_length_remaining(tvb, 0); @@ -1135,17 +1110,14 @@ } } - dissect_payload_and_padding(tvb, pinfo, tree, payload_size, 0); + dissect_payload_and_padding(tvb, pinfo, tree, payload_size, 0, &pd); /* fill columns in Packet List */ /* overwrite everything written by sub-dissectors */ col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column); col_clear(pinfo->cinfo, COL_INFO); - col_append_pw_info(pinfo, payload_size, cells, 0); - - pinfo->private_data = pd_save; - return; + col_append_pw_info(pinfo, payload_size, cells, 0, &pd); } @@ -1170,11 +1142,10 @@ } -static void -dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) +static int +dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data) { - pwatm_private_data_t* pd; - pd = (pwatm_private_data_t *)pinfo->private_data; + pwatm_private_data_t* pd = (pwatm_private_data_t *)data; DISSECTOR_ASSERT(pd != NULL); /* @@ -1191,7 +1162,7 @@ expert_add_info_format(pinfo, item, &ei_pw_payload_size_invalid_error, "Packet (size: %d) is too small to carry MPLS PW Control Word" ,(int)size); - return; + return tvb_length(tvb); } } @@ -1347,12 +1318,13 @@ { tvbuff_t* tvb_2; tvb_2 = tvb_new_subset_remaining(tvb, (PWC_SIZEOF_CW-1)); - call_dissector(dh_cell_header, tvb_2, pinfo, tree2); + call_dissector_with_data(dh_cell_header, tvb_2, pinfo, tree2, pd); proto_item_append_text(item_top, ", "); proto_item_append_text_cwb3_fields(item_top, pd); } } - return; + + return tvb_length(tvb); } @@ -1360,13 +1332,12 @@ * This function is also used to dissect 3rd byte of CW in AAL5 PDU mode. */ static int -dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data _U_) +dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data) { - pwatm_private_data_t * pd; + pwatm_private_data_t * pd = (pwatm_private_data_t *)data; gboolean is_enough_data; int dissect_size; - pd = (pwatm_private_data_t *)pinfo->private_data; DISSECTOR_ASSERT (NULL != pd); pd->vpi = pd->vci = pd->pti = -1; pd->cwb3.clp = pd->cwb3.m = pd->cwb3.v = pd->cwb3.rsv = pd->cwb3.u = pd->cwb3.e = -1; @@ -1606,59 +1577,52 @@ static int -dissect_cell(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data _U_) +dissect_cell(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data) { gboolean is_enough_data; int dissect_size; + gint size; + proto_item* item; + pwatm_private_data_t * pd = (pwatm_private_data_t *)data; + size = tvb_reported_length_remaining(tvb, 0); + if (size < SIZEOF_ATM_CELL_PAYLOAD) { - gint size; - size = tvb_reported_length_remaining(tvb, 0); - if (size < SIZEOF_ATM_CELL_PAYLOAD) - { - is_enough_data = FALSE; - dissect_size = size; - } - else - { - is_enough_data = TRUE; - dissect_size = SIZEOF_ATM_CELL_PAYLOAD; - } + is_enough_data = FALSE; + dissect_size = size; + } + else + { + is_enough_data = TRUE; + dissect_size = SIZEOF_ATM_CELL_PAYLOAD; } /* * NB: do not touch columns -- keep info from previous dissector */ - { - proto_item* item; - item = proto_tree_add_item(tree, proto_cell, tvb, 0, dissect_size, ENC_NA); - { - pwatm_private_data_t * pd; - pd = (pwatm_private_data_t *)pinfo->private_data; - if (NULL != pd) - { - proto_item_append_text(item, " [%.3d]", pd->pw_cell_number); - } - } - pwc_item_append_text_n_items(item, dissect_size, "byte"); - if (!is_enough_data) - { - expert_add_info_format(pinfo, item, &ei_pw_payload_size_invalid_error, - "Bad length of cell payload: must be == %d", - (int)SIZEOF_ATM_CELL_PAYLOAD); - } + item = proto_tree_add_item(tree, proto_cell, tvb, 0, dissect_size, ENC_NA); + if (NULL != pd) + proto_item_append_text(item, " [%.3d]", pd->pw_cell_number); + + pwc_item_append_text_n_items(item, dissect_size, "byte"); + if (!is_enough_data) + { + expert_add_info_format(pinfo, item, &ei_pw_payload_size_invalid_error, + "Bad length of cell payload: must be == %d", + (int)SIZEOF_ATM_CELL_PAYLOAD); + } - { - proto_tree* tree2; - tvbuff_t* tvb_d; - tree2 = proto_item_add_subtree(item, ett_cell); - tvb_d = tvb_new_subset(tvb, 0, dissect_size, -1); - call_dissector(dh_data, tvb_d, pinfo, tree2); - item = proto_tree_add_int(tree2, hf_cell_payload_len, tvb, 0, 0, dissect_size); - PROTO_ITEM_SET_HIDDEN(item); - } + { + proto_tree* tree2; + tvbuff_t* tvb_d; + tree2 = proto_item_add_subtree(item, ett_cell); + tvb_d = tvb_new_subset(tvb, 0, dissect_size, -1); + call_dissector(dh_data, tvb_d, pinfo, tree2); + item = proto_tree_add_int(tree2, hf_cell_payload_len, tvb, 0, 0, dissect_size); + PROTO_ITEM_SET_HIDDEN(item); } + return dissect_size; } @@ -1937,7 +1901,7 @@ register_dissector("mpls_pw_atm_11_or_aal5_pdu" ,dissect_11_or_aal5_pdu ,proto_11_or_aal5_pdu); register_dissector("mpls_pw_atm_n1_cw" ,dissect_n1_cw ,proto_n1_cw); register_dissector("mpls_pw_atm_n1_nocw" ,dissect_n1_nocw ,proto_n1_nocw); - register_dissector("mpls_pw_atm_control_word" ,dissect_control_word ,proto_control_word); + new_register_dissector("mpls_pw_atm_control_word" ,dissect_control_word ,proto_control_word); new_register_dissector("mpls_pw_atm_cell" ,dissect_cell ,proto_cell); new_register_dissector("mpls_pw_atm_cell_header",dissect_cell_header ,proto_cell_header); { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pw-cesopsn.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pw-cesopsn.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pw-cesopsn.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pw-cesopsn.c 2013-11-02 02:12:36.000000000 +0000 @@ -232,7 +232,7 @@ col_clear(pinfo->cinfo, COL_INFO); if (properties & PWC_ANYOF_CW_BAD) { - col_append_str(pinfo->cinfo, COL_INFO, "CW:Bad, "); + col_set_str(pinfo->cinfo, COL_INFO, "CW:Bad, "); } else if (properties & PWC_ANYOF_CW_SUSPECT) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pw-fr.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pw-fr.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pw-fr.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pw-fr.c 2013-11-02 02:12:36.000000000 +0000 @@ -170,7 +170,7 @@ col_clear(pinfo->cinfo, COL_INFO); if (packet_quality & PQ_CW_BAD) { - col_append_str(pinfo->cinfo, COL_INFO, "CW:Malformed, "); + col_set_str(pinfo->cinfo, COL_INFO, "CW:Malformed, "); } col_append_fstr(pinfo->cinfo, COL_INFO, "%d payload octets", (int)payload_size); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-pw-satop.c wireshark-1.12.0~201311020920/epan/dissectors/packet-pw-satop.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-pw-satop.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-pw-satop.c 2013-11-02 02:12:36.000000000 +0000 @@ -230,7 +230,7 @@ col_clear(pinfo->cinfo, COL_INFO); if (properties & PWC_ANYOF_CW_BAD) { - col_append_str(pinfo->cinfo, COL_INFO, "CW:Bad, "); + col_set_str(pinfo->cinfo, COL_INFO, "CW:Bad, "); } if (properties & PWC_PAY_SIZE_BAD) diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-qllc.c wireshark-1.12.0~201311020920/epan/dissectors/packet-qllc.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-qllc.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-qllc.c 2013-11-02 02:12:36.000000000 +0000 @@ -71,12 +71,12 @@ }; -static void -dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - proto_tree *qllc_tree = NULL; - proto_item *qllc_ti = NULL; - gboolean *q_bit_set = (gboolean *)pinfo->private_data; + proto_tree *qllc_tree; + proto_item *qllc_ti; + gboolean *q_bit_set = (gboolean *)data; guint8 addr, ctrl; gboolean command = FALSE; @@ -84,25 +84,21 @@ * If the Q bit isn't set, this is just SNA data. */ if (!(*q_bit_set)) { - call_dissector(sna_handle, tvb, pinfo, tree); - return; + call_dissector(sna_handle, tvb, pinfo, tree); + return tvb_length(tvb); } /* Summary information */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "QLLC"); col_clear(pinfo->cinfo, COL_INFO); - if (tree) { - qllc_ti = proto_tree_add_item(tree, proto_qllc, tvb, 0, -1, ENC_NA); - qllc_tree = proto_item_add_subtree(qllc_ti, ett_qllc); - } + qllc_ti = proto_tree_add_item(tree, proto_qllc, tvb, 0, -1, ENC_NA); + qllc_tree = proto_item_add_subtree(qllc_ti, ett_qllc); /* Get the address; we need it to determine if this is a * COMMAND or a RESPONSE */ addr = tvb_get_guint8(tvb, 0); - if (tree) { proto_tree_add_item(qllc_tree, hf_qllc_address, tvb, 0, 1, ENC_BIG_ENDIAN); - } /* The address field equals X'FF' in commands (except QRR) * and anything in responses. */ @@ -116,14 +112,14 @@ * a COMMAND or RESPONSE. */ if (ctrl == QRD_QDISC_VALUE) { if (command) { - col_set_str(pinfo->cinfo, COL_INFO, QDISC_TEXT); + col_set_str(pinfo->cinfo, COL_INFO, QDISC_TEXT); if (tree) { proto_tree_add_text(qllc_tree, tvb, 1, 1, "Control Field: %s (0x%02x)", QDISC_TEXT, ctrl); } } else { - col_set_str(pinfo->cinfo, COL_INFO, QRD_TEXT); + col_set_str(pinfo->cinfo, COL_INFO, QRD_TEXT); if (tree) { proto_tree_add_text(qllc_tree, tvb, 1, 1, "Control Field: %s (0x%02x)", QRD_TEXT, ctrl); @@ -154,6 +150,8 @@ if (ctrl == QXID || ctrl == QTEST || ctrl == QFRMR) { /* yes */ } + + return tvb_length(tvb); } void @@ -173,11 +171,10 @@ &ett_qllc, }; - proto_qllc = proto_register_protocol("Qualified Logical Link Control", - "QLLC", "qllc"); + proto_qllc = proto_register_protocol("Qualified Logical Link Control", "QLLC", "qllc"); proto_register_field_array(proto_qllc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("qllc", dissect_qllc, proto_qllc); + new_register_dissector("qllc", dissect_qllc, proto_qllc); } void diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-radius.c wireshark-1.12.0~201311020920/epan/dissectors/packet-radius.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-radius.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-radius.c 2013-11-02 02:12:36.000000000 +0000 @@ -1195,7 +1195,7 @@ } offset += avp_vsa_len; - }; /* while (offset < max_offset) */ + } /* while (offset < max_offset) */ continue; /* while (length > 0) */ } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-retix-bpdu.c wireshark-1.12.0~201311020920/epan/dissectors/packet-retix-bpdu.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-retix-bpdu.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-retix-bpdu.c 2013-11-02 02:12:36.000000000 +0000 @@ -61,7 +61,6 @@ proto_tree *ti; col_set_str(pinfo->cinfo, COL_PROTOCOL, "R-STP"); - col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "Bridge MAC %s", tvb_ether_to_str(tvb, 10)); retix_bpdu_tree = NULL; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rfid-pn532-hci.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rfid-pn532-hci.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rfid-pn532-hci.c 1970-01-01 00:00:00.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rfid-pn532-hci.c 2013-11-02 02:12:36.000000000 +0000 @@ -0,0 +1,304 @@ +/* packet-pn532_hci.c + * Routines for NXP PN532 HCI Protocol + * + * http://www.nxp.com/documents/user_manual/141520.pdf + * + * Copyright 2013, Michal Labedzki for Tieto Corporation + * + * $Id$ + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * 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 thehf_class + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "config.h" + +#include +#include +#include +#include + +#include "packet-usb.h" + +static int proto_pn532_hci = -1; +static int hf_preamble = -1; +static int hf_start_code = -1; +static int hf_length = -1; +static int hf_length_checksum = -1; +static int hf_extended_length = -1; +static int hf_packet_code = -1; +static int hf_postable = -1; +static int hf_specific_application_level_error_code = -1; +static int hf_data_checksum = -1; +static int hf_ignored = -1; + +static gint ett_pn532_hci = -1; + +static expert_field ei_invalid_length_checksum = EI_INIT; +static expert_field ei_invalid_data_checksum = EI_INIT; + +static dissector_handle_t pn532_handle; +static dissector_handle_t pn532_hci_handle; + +static const value_string packet_code_vals[] = { + { 0x00FF, "ACK Frame" }, + { 0x01FF, "Error Frame" }, + { 0xFF00, "NACK Frame" }, + { 0xFFFF, "Extended Information Frame" }, + { 0, NULL } +}; + +void proto_register_pn532_hci(void); +void proto_reg_handoff_pn532_hci(void); + +static gint +dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) +{ + proto_item *main_item; + proto_tree *main_tree; + gint offset = 0; + tvbuff_t *next_tvb; + guint16 packet_code; + guint16 length; + guint8 checksum; + usb_data_t *usb_data; + + usb_data = (usb_data_t *) data; + DISSECTOR_ASSERT(usb_data); + + length = tvb_length_remaining(tvb, offset); + if (length < 6) return offset; + + col_set_str(pinfo->cinfo, COL_PROTOCOL, "PN532_HCI"); + col_clear(pinfo->cinfo, COL_INFO); + + main_item = proto_tree_add_item(tree, proto_pn532_hci, tvb, offset, -1, ENC_NA); + main_tree = proto_item_add_subtree(main_item, ett_pn532_hci); + + length = 0; + while (tvb_length_remaining(tvb, length) >= 2 && tvb_get_ntohs(tvb, length) != 0x00FF) { + length += 1; + } + if (length) { + proto_tree_add_item(main_tree, hf_preamble, tvb, offset, length, ENC_NA); + offset += length; + } + + proto_tree_add_item(main_tree, hf_start_code, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + + packet_code = tvb_get_ntohs(tvb, offset); + if (packet_code == 0x00FF) { /* ACK Frame */ + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(packet_code, packet_code_vals, "Unknown frame")); + + proto_tree_add_item(main_tree, hf_packet_code, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + } else if (packet_code == 0xFF00) { /* NACK Frame */ + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(packet_code, packet_code_vals, "Unknown frame")); + + proto_tree_add_item(main_tree, hf_packet_code, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + } else if (packet_code == 0x01FF) { /* Error Frame */ + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(packet_code, packet_code_vals, "Unknown frame")); + + proto_tree_add_item(main_tree, hf_packet_code, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + + proto_tree_add_item(main_tree, hf_specific_application_level_error_code, tvb, offset, 1, ENC_NA); + offset += 1; + } else if (packet_code == 0xFFFF) { /* Extended Information Frame */ + col_set_str(pinfo->cinfo, COL_INFO, "Extended Information Frame"); + + proto_tree_add_item(main_tree, hf_extended_length, tvb, offset, 2, ENC_BIG_ENDIAN); + length = tvb_get_ntohs(tvb, offset); + offset += 2; + + proto_tree_add_item(main_tree, hf_length_checksum, tvb, offset, 1, ENC_NA); + checksum = (length >> 8) + (length & 0xFF) + tvb_get_guint8(tvb, offset); + if (checksum != 0) { + proto_tree_add_expert(main_tree, pinfo, &ei_invalid_length_checksum, tvb, offset, 1); + } + offset += 1; + + next_tvb = tvb_new_subset(tvb, offset, length, length); + call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_data); + offset += length; + + proto_tree_add_item(main_tree, hf_data_checksum, tvb, offset, 1, ENC_NA); + checksum = tvb_get_guint8(tvb, offset); + while (length) { + checksum += tvb_get_guint8(tvb, offset - length); + length -= 1; + } + if (checksum != 0) { + proto_tree_add_expert(main_tree, pinfo, &ei_invalid_data_checksum, tvb, offset, 1); + } + offset += 1; + } else { /* Normal Information Frame */ + col_set_str(pinfo->cinfo, COL_INFO, "Normal Information Frame"); + + proto_tree_add_item(main_tree, hf_length, tvb, offset, 1, ENC_NA); + length = tvb_get_guint8(tvb, offset); + offset += 1; + + proto_tree_add_item(main_tree, hf_length_checksum, tvb, offset, 1, ENC_NA); + checksum = length + tvb_get_guint8(tvb, offset); + if (checksum != 0) + proto_tree_add_expert(main_tree, pinfo, &ei_invalid_length_checksum, tvb, offset, 1); + offset += 1; + + next_tvb = tvb_new_subset(tvb, offset, length, length); + call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_data); + offset += length; + + proto_tree_add_item(main_tree, hf_data_checksum, tvb, offset, 1, ENC_NA); + checksum = tvb_get_guint8(tvb, offset); + while (length) { + checksum += tvb_get_guint8(tvb, offset - length); + length -= 1; + } + if (checksum != 0) { + proto_tree_add_expert(main_tree, pinfo, &ei_invalid_data_checksum, tvb, offset, 1); + } + offset += 1; + } + + length = 0; + if (tvb_length_remaining(tvb, offset) == 1) { + length = 1; + } else while (tvb_length_remaining(tvb, offset + length) >= 2 && tvb_get_ntohs(tvb, offset + length) != 0x00FF) { + length += 1; + } + if (length) { + proto_tree_add_item(main_tree, hf_postable, tvb, offset, length, ENC_NA); + offset += length; + } + + if (tvb_length_remaining(tvb, offset)) { + proto_tree_add_item(main_tree, hf_ignored, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA); + offset += tvb_length_remaining(tvb, offset); + } + + return offset; +} + +void +proto_register_pn532_hci(void) +{ + module_t *module; + expert_module_t *expert_module; + + static hf_register_info hf[] = { + { &hf_preamble, + { "Preamble", "pn532_hci.preamble", + FT_BYTES, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_start_code, + { "Start Code", "pn532_hci.start_code", + FT_UINT16, BASE_HEX, NULL, 0x00, + NULL, HFILL } + }, + { &hf_packet_code, + { "Packet Code", "pn532_hci.packet_code", + FT_UINT16, BASE_HEX, VALS(packet_code_vals), 0x00, + NULL, HFILL } + }, + { &hf_length, + { "Length", "pn532_hci.length", + FT_UINT8, BASE_DEC, NULL, 0x00, + NULL, HFILL } + }, + { &hf_extended_length, + { "Extended Length", "pn532_hci.extended_length", + FT_UINT16, BASE_DEC, NULL, 0x00, + NULL, HFILL } + }, + { &hf_length_checksum, + { "Length Checksum", "pn532_hci.length_checksum", + FT_UINT8, BASE_HEX, NULL, 0x00, + NULL, HFILL } + }, + { &hf_data_checksum, + { "Data Checksum", "pn532_hci.data_checksum", + FT_UINT8, BASE_HEX, NULL, 0x00, + NULL, HFILL } + }, + { &hf_specific_application_level_error_code, + { "Specific Application Level Error Code","pn532_hci.specific_application_level_error_code", + FT_UINT8, BASE_HEX, NULL, 0x00, + NULL, HFILL } + }, + { &hf_postable, + { "Postamble", "pn532_hci.postamble", + FT_BYTES, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_ignored, + { "Ignored", "pn532_hci.ignored", + FT_BYTES, BASE_NONE, NULL, 0x00, + NULL, HFILL } + } + }; + + static gint *ett[] = { + &ett_pn532_hci + }; + + static ei_register_info ei[] = { + { &ei_invalid_length_checksum, { "pn532_hci.expert.invalid_length_checksum", PI_PROTOCOL, PI_WARN, "Invalid Length Checksum", EXPFILL }}, + { &ei_invalid_data_checksum, { "pn532_hci.expert.invalid_data_checksum", PI_PROTOCOL, PI_WARN, "Invalid Data Checksum", EXPFILL }}, + }; + + proto_pn532_hci = proto_register_protocol("NXP PN532 HCI", "PN532_HCI", "pn532_hci"); + new_register_dissector("pn532_hci", dissect_pn532_hci, proto_pn532_hci); + + proto_register_field_array(proto_pn532_hci, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + expert_module = expert_register_protocol(proto_pn532_hci); + expert_register_field_array(expert_module, ei, array_length(ei)); + + module = prefs_register_protocol(proto_pn532_hci, NULL); + prefs_register_static_text_preference(module, "version", + "PN532 HCI protocol version is based on: \"UM0701-02; PN532 User Manual\"", + "Version of protocol supported by this dissector."); +} + +void +proto_reg_handoff_pn532_hci(void) +{ + pn532_handle = find_dissector("pn532"); + pn532_hci_handle = find_dissector("pn532_hci"); + + dissector_add_uint("usb.product", (0x04e6 << 16) | 0x5591, pn532_hci_handle); + + dissector_add_handle("usb.device", pn532_hci_handle); +} + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rip.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rip.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rip.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rip.c 2013-11-02 02:12:36.000000000 +0000 @@ -124,7 +124,7 @@ command = tvb_get_guint8(tvb, 0); version = tvb_get_guint8(tvb, 1); - col_add_str(pinfo->cinfo, COL_PROTOCOL, + col_set_str(pinfo->cinfo, COL_PROTOCOL, val_to_str_const(version, version_vals, "RIP")); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(command, command_vals, "Unknown command (%u)")); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ripng.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ripng.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ripng.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ripng.c 2013-11-02 02:12:36.000000000 +0000 @@ -66,7 +66,6 @@ proto_item *ti, *rte_ti; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RIPng"); - col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO," Command %s, Version %u", val_to_str(tvb_get_guint8(tvb, offset), cmdvals, "Unknown (%u)"), tvb_get_guint8(tvb, offset +1)); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rlogin.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rlogin.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rlogin.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rlogin.c 2013-11-02 02:12:36.000000000 +0000 @@ -378,8 +378,8 @@ /**************************************************************** * Main dissection function ****************************************************************/ -static void -dissect_rlogin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_rlogin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { struct tcpinfo *tcpinfo = (struct tcpinfo *)pinfo->private_data; conversation_t *conversation; @@ -471,6 +471,8 @@ /* Dissect in detail */ rlogin_display(hash_info, tvb, pinfo, tree, tcpinfo); + + return tvb_length(tvb); } @@ -574,6 +576,6 @@ void proto_reg_handoff_rlogin(void) { /* Dissector install routine */ - dissector_handle_t rlogin_handle = create_dissector_handle(dissect_rlogin,proto_rlogin); + dissector_handle_t rlogin_handle = new_create_dissector_handle(dissect_rlogin,proto_rlogin); dissector_add_uint("tcp.port", RLOGIN_PORT, rlogin_handle); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rmp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rmp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rmp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rmp.c 2013-11-02 02:12:36.000000000 +0000 @@ -110,7 +110,7 @@ type = tvb_get_guint8(tvb, 0); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, rmp_type_vals, "Unknown Type")); if (tree) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rnsap.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rnsap.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rnsap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rnsap.c 2013-11-02 02:12:36.000000000 +0000 @@ -43160,7 +43160,7 @@ static int dissect_PrivateIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - return (call_ber_oid_callback(obj_id, tvb, 0, pinfo, tree)) ? tvb_length(tvb) : 0; + return (call_ber_oid_callback(obj_id, tvb, 0, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rohc.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rohc.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rohc.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rohc.c 2013-11-02 02:12:36.000000000 +0000 @@ -948,11 +948,11 @@ break; case 2: /* REJECT */ - col_append_fstr(pinfo->cinfo, COL_INFO, "Reject "); + col_append_str(pinfo->cinfo, COL_INFO, "Reject "); break; case 3: /* SN-Not-Valid */ - col_append_fstr(pinfo->cinfo, COL_INFO, "SN-Not-Valid "); + col_append_str(pinfo->cinfo, COL_INFO, "SN-Not-Valid "); break; case 4: /* SN */ @@ -2077,7 +2077,7 @@ col_set_str(pinfo->cinfo, COL_INFO, "ROHC"); col_clear(pinfo->cinfo, COL_INFO); }else{ - col_append_fstr(pinfo->cinfo, COL_PROTOCOL, "|ROHC"); + col_append_str(pinfo->cinfo, COL_PROTOCOL, "|ROHC"); /* Append a space if we add stuff to existing col info */ col_append_str(pinfo->cinfo, COL_INFO, " "); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rpc.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rpc.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rpc.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rpc.c 2013-11-02 02:12:36.000000000 +0000 @@ -43,7 +43,6 @@ #include "packet-rpc.h" #include "packet-tcp.h" -#include #include "packet-nfs.h" /* @@ -298,8 +297,12 @@ /* Hash table with info on RPC procedure numbers */ GHashTable *rpc_procs = NULL; +typedef gboolean (*rec_dissector_t)(tvbuff_t *, packet_info *, proto_tree *, + tvbuff_t *, fragment_head *, gboolean, guint32, gboolean); + static void dissect_rpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -static void dissect_rpc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); +static void show_rpc_fraginfo(tvbuff_t *tvb, tvbuff_t *frag_tvb, proto_tree *tree, + guint32 rpc_rm, fragment_head *ipfd_head, packet_info *pinfo); /***********************************/ /* Hash array with procedure names */ @@ -2820,8 +2823,7 @@ * an RPC auth level message, then process the args. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RPC"); - col_clear(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_INFO, + col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s XID 0x%x", val_to_str(gss_proc, rpc_authgssapi_proc, "Unknown (%d)"), msg_type_name, xid); @@ -3082,12 +3084,11 @@ return rpc_succeeded; } -int +static int dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rec_dissector_t dissector, gboolean is_heur, - int proto, int ett, gboolean defragment, gboolean first_pdu) + int proto, int ett, gboolean defragment, gboolean first_pdu, struct tcpinfo *tcpinfo) { - struct tcpinfo *tcpinfo; guint32 seq; guint32 rpc_rm; volatile guint32 len; @@ -3101,14 +3102,10 @@ fragment_head *ipfd_head; tvbuff_t *rec_tvb; - if (pinfo == NULL || pinfo->private_data == NULL) { + if (pinfo == NULL || tcpinfo == NULL) { return 0; } - tcpinfo = (struct tcpinfo *)pinfo->private_data; - if (tcpinfo == NULL) { - return 0; - } seq = tcpinfo->seq + offset; /* @@ -3597,13 +3594,12 @@ find_and_dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rec_dissector_t dissector, gboolean is_heur, - int proto, int ett, gboolean defragment) + int proto, int ett, gboolean defragment, struct tcpinfo* tcpinfo) { int offReply; int len; - offReply = find_rpc_over_tcp_reply_start(tvb, offset); if (offReply < 0) { /* could search for request, but not needed (or testable) thus far */ @@ -3614,7 +3610,7 @@ pinfo, tree, dissector, is_heur, proto, ett, defragment, - TRUE /* force first-pdu state */); + TRUE /* force first-pdu state */, tcpinfo); /* misses are reported as-is */ if (len == 0) @@ -3658,7 +3654,7 @@ static rpc_tcp_return_t dissect_rpc_tcp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - gboolean is_heur) + gboolean is_heur, struct tcpinfo* tcpinfo) { int offset = 0; gboolean saw_rpc = FALSE; @@ -3671,7 +3667,7 @@ */ len = dissect_rpc_fragment(tvb, offset, pinfo, tree, dissect_rpc_message, is_heur, proto_rpc, ett_rpc, - rpc_defragment, first_pdu); + rpc_defragment, first_pdu, tcpinfo); if ((len == 0) && first_pdu && rpc_find_fragment_start) { /* @@ -3680,7 +3676,7 @@ */ len = find_and_dissect_rpc_fragment(tvb, offset, pinfo, tree, dissect_rpc_message, is_heur, proto_rpc, ett_rpc, - rpc_defragment); + rpc_defragment, tcpinfo); } first_pdu = FALSE; @@ -3727,9 +3723,11 @@ } static gboolean -dissect_rpc_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_rpc_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - switch (dissect_rpc_tcp_common(tvb, pinfo, tree, TRUE)) { + struct tcpinfo* tcpinfo = (struct tcpinfo *)data; + + switch (dissect_rpc_tcp_common(tvb, pinfo, tree, TRUE, tcpinfo)) { case IS_RPC: return TRUE; @@ -3744,11 +3742,15 @@ } } -static void -dissect_rpc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_rpc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - if (dissect_rpc_tcp_common(tvb, pinfo, tree, FALSE) == IS_NOT_RPC) + struct tcpinfo* tcpinfo = (struct tcpinfo *)data; + + if (dissect_rpc_tcp_common(tvb, pinfo, tree, FALSE, tcpinfo) == IS_NOT_RPC) dissect_rpc_continuation(tvb, pinfo, tree); + + return tvb_length(tvb); } /* Discard any state we've saved. */ @@ -4051,7 +4053,7 @@ &rpc_find_fragment_start); register_dissector("rpc", dissect_rpc, proto_rpc); - register_dissector("rpc-tcp", dissect_rpc_tcp, proto_rpc); + new_register_dissector("rpc-tcp", dissect_rpc_tcp, proto_rpc); rpc_tap = register_tap("rpc"); /* diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rpc.h wireshark-1.12.0~201311020920/epan/dissectors/packet-rpc.h --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rpc.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rpc.h 2013-11-02 02:12:36.000000000 +0000 @@ -103,6 +103,9 @@ #define RPC_STRING_DATA "" #define RPC_STRING_TRUNCATED "" +#define RPC_RM_LASTFRAG 0x80000000U +#define RPC_RM_FRAGLEN 0x7fffffffU + extern const value_string rpc_authgss_svc[]; typedef enum { FLAVOR_UNKNOWN, /* authentication flavor unknown */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rsip.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rsip.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rsip.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rsip.c 2013-11-02 02:12:36.000000000 +0000 @@ -988,8 +988,6 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSIP"); - col_clear(pinfo->cinfo, COL_INFO); - col_add_str(pinfo->cinfo, COL_INFO, val_to_str(msgtype, msg_type_vals, "Unknown Message Type (0x%0x)")); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rtacser.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rtacser.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rtacser.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rtacser.c 2013-11-02 02:12:36.000000000 +0000 @@ -172,7 +172,6 @@ /* Set INFO column with RTAC Serial Event Type */ event_type = tvb_get_guint8(tvb, offset); - col_clear(pinfo->cinfo, COL_INFO); /* clear out stuff in the info column */ col_add_fstr(pinfo->cinfo, COL_INFO, "%-21s", val_to_str_const(event_type, rtacser_eventtype_vals, "Unknown Type")); /* Add event type to tree */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rtmpt.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rtmpt.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rtmpt.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rtmpt.c 2013-11-02 02:12:36.000000000 +0000 @@ -2241,13 +2241,13 @@ return rconv; } -static void -dissect_rtmpt_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_rtmpt_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { conversation_t *conv; rtmpt_conv_t *rconv; int cdir; - struct tcpinfo *tcpinfo; + struct tcpinfo *tcpinfo = (struct tcpinfo*)data; conv = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0); if (!conv) { @@ -2264,8 +2264,8 @@ conv->key_ptr->port1==pinfo->srcport && conv->key_ptr->port2==pinfo->destport) ? 0 : 1; - tcpinfo = (struct tcpinfo *)pinfo->private_data; dissect_rtmpt_common(tvb, pinfo, tree, rconv, cdir, tcpinfo->seq, tcpinfo->lastackseq); + return tvb_length(tvb); } static void @@ -2386,7 +2386,7 @@ #if 0 static gboolean -dissect_rtmpt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +dissect_rtmpt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { conversation_t * conversation; if (tvb_length(tvb) >= 12) @@ -2394,7 +2394,7 @@ /* To avoid a too high rate of false positive, this heuristics only matches the protocol from the first server response packet and not from the client request packets before. Therefore it is necessary to a "Decode as" to properly decode the first packets */ - struct tcpinfo *tcpinfo = pinfo->private_data; + struct tcpinfo *tcpinfo = (struct tcpinfo *)data; if (tcpinfo->lastackseq == RTMPT_HANDSHAKE_OFFSET_2 && tcpinfo->seq == RTMPT_HANDSHAKE_OFFSET_1 && tvb_get_guint8(tvb, 0) == RTMPT_MAGIC) @@ -2690,7 +2690,7 @@ dissector_handle_t amf_handle; /* heur_dissector_add("tcp", dissect_rtmpt_heur, proto_rtmpt); */ - rtmpt_tcp_handle = create_dissector_handle(dissect_rtmpt_tcp, proto_rtmpt); + rtmpt_tcp_handle = new_create_dissector_handle(dissect_rtmpt_tcp, proto_rtmpt); /* dissector_add_handle("tcp.port", rtmpt_tcp_handle); */ dissector_add_uint("tcp.port", RTMP_PORT, rtmpt_tcp_handle); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rtnet.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rtnet.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rtnet.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rtnet.c 2013-11-02 02:12:36.000000000 +0000 @@ -586,7 +586,6 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTmac"); /* set the info column */ - col_clear(pinfo->cinfo,COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown (0x%04x)",type); if (rtmac_tree) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rtp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rtp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rtp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rtp.c 2013-11-02 02:12:36.000000000 +0000 @@ -1904,10 +1904,10 @@ ext_value=tvb_get_ntohl( tvb, hdrext_offset ); if (RTP_ED137_ptt_mask(ext_value)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ", PTT"); + col_append_str(pinfo->cinfo, COL_INFO, ", PTT"); } if (RTP_ED137_squ_mask(ext_value)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ", SQU"); + col_append_str(pinfo->cinfo, COL_INFO, ", SQU"); } /* Following bits are used from ED137 RTPRx/RTPTx Information field */ @@ -1991,10 +1991,10 @@ ext_value=tvb_get_ntohl( tvb, hdrext_offset ); if (RTP_ED137A_ptt_mask(ext_value)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ", PTT"); + col_append_str(pinfo->cinfo, COL_INFO, ", PTT"); } if (RTP_ED137A_squ_mask(ext_value)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ", SQU"); + col_append_str(pinfo->cinfo, COL_INFO, ", SQU"); } /* Following bits are used from ED137A/B RTPRx Information field */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rtps.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rtps.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rtps.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rtps.c 2013-11-02 02:12:36.000000000 +0000 @@ -3986,7 +3986,7 @@ is_ping = TRUE; if (is_ping) - col_add_str(pinfo->cinfo, COL_INFO, "PING"); + col_set_str(pinfo->cinfo, COL_INFO, "PING"); return is_ping; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-rtse.c wireshark-1.12.0~201311020920/epan/dissectors/packet-rtse.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-rtse.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-rtse.c 2013-11-02 02:12:36.000000000 +0000 @@ -567,7 +567,7 @@ int dissect_rtse_RTORJapdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 140 "../../asn1/rtse/rtse.cnf" - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Refuse"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Refuse"); offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset, RTORJapdu_set, hf_index, ett_rtse_RTORJapdu); @@ -585,7 +585,7 @@ #line 130 "../../asn1/rtse/rtse.cnf" int priority = -1; - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Turn-Please"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Turn-Please"); offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &priority); @@ -690,7 +690,7 @@ int dissect_rtse_RTABapdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 156 "../../asn1/rtse/rtse.cnf" - col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Abort"); + col_append_str(actx->pinfo->cinfo, COL_INFO, "Abort"); offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset, RTABapdu_set, hf_index, ett_rtse_RTABapdu); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-sccp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-sccp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-sccp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-sccp.c 2013-11-02 02:12:36.000000000 +0000 @@ -913,7 +913,7 @@ * Accesses beyond this length need to check the length first because * we don't want to throw an exception in here... */ - if (len < 6) + if (len < 5) RETURN_FALSE; msgtype = tvb_get_guint8(tvb, SCCP_MSG_TYPE_OFFSET); @@ -1042,6 +1042,13 @@ break; case SCCP_MSG_TYPE_CR: { + if (len < SCCP_MSG_TYPE_LENGTH + + DESTINATION_LOCAL_REFERENCE_LENGTH + + PROTOCOL_CLASS_LENGTH + + POINTER_LENGTH + + POINTER_LENGTH) + RETURN_FALSE; + offset += DESTINATION_LOCAL_REFERENCE_LENGTH; /* Class is only the lower 4 bits, but the upper 4 bits are spare @@ -1051,6 +1058,18 @@ msg_class = tvb_get_guint8(tvb, offset); if (msg_class != 2) RETURN_FALSE; + + offset += PROTOCOL_CLASS_LENGTH; + data_ptr = tvb_get_guint8(tvb, offset); + if (data_ptr == 0) + RETURN_FALSE; + + offset += POINTER_LENGTH; + opt_ptr = tvb_get_guint8(tvb, offset); + if (opt_ptr == 0) + RETURN_FALSE; + + offset += POINTER_LENGTH; } break; case SCCP_MSG_TYPE_CC: @@ -1093,6 +1112,12 @@ break; case SCCP_MSG_TYPE_CREF: { + if (len < SCCP_MSG_TYPE_LENGTH + + DESTINATION_LOCAL_REFERENCE_LENGTH + + REFUSAL_CAUSE_LENGTH + + POINTER_LENGTH) + RETURN_FALSE; + offset += DESTINATION_LOCAL_REFERENCE_LENGTH; cause = tvb_get_guint8(tvb, offset); @@ -1264,7 +1289,7 @@ if (opt_ptr) { guint8 opt_param; - opt_ptr += offset-1; /* (offset was already incremented) */ + opt_ptr += offset-pointer_length; /* (offset was already incremented) */ /* Check that the optional pointer is within bounds */ if (opt_ptr > len) @@ -3379,12 +3404,12 @@ empty = range_empty(); if (ranges_are_equal(u->called_pc, empty)) { - *err = ep_strdup_printf("Must specify a PC"); + *err = g_strdup("Must specify a PC"); return; } if (ranges_are_equal(u->called_ssn, empty)) { - *err = ep_strdup_printf("Must specify an SSN"); + *err = g_strdup("Must specify an SSN"); return; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-scop.c wireshark-1.12.0~201311020920/epan/dissectors/packet-scop.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-scop.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-scop.c 2013-11-02 02:12:36.000000000 +0000 @@ -274,7 +274,7 @@ /* Display the Packet type*/ proto_tree_add_uint(tree, hf_scop_type, tvb, offset, 1, type); proto_item_append_text(tree, ", %s", val_to_str_const(type, scop_types, "Reserved Type")); - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, scop_types, "Reserved Type")); + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, scop_types, "Reserved Type")); offset += 2; if (type == SCOP_CMD_HELLO_RESP) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-sctp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-sctp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-sctp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-sctp.c 2013-11-02 02:12:36.000000000 +0000 @@ -2905,7 +2905,7 @@ return retval; } else if (is_retransmission) { - col_append_fstr(pinfo->cinfo, COL_INFO, "(retransmission) "); + col_append_str(pinfo->cinfo, COL_INFO, "(retransmission) "); return FALSE; } else { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-selfm.c wireshark-1.12.0~201311020920/epan/dissectors/packet-selfm.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-selfm.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-selfm.c 2013-11-02 02:12:36.000000000 +0000 @@ -2389,7 +2389,6 @@ selfm_tree = proto_item_add_subtree(selfm_item, ett_selfm); /* Set INFO column with SEL Protocol Message Type */ - col_clear(pinfo->cinfo, COL_INFO); /* clear out stuff in the info column */ col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(msg_type, selfm_msgtype_vals, "Unknown Message Type")); /* Add Message Type to Protocol Tree */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-slowprotocols.c wireshark-1.12.0~201311020920/epan/dissectors/packet-slowprotocols.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-slowprotocols.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-slowprotocols.c 2013-11-02 02:12:36.000000000 +0000 @@ -1860,9 +1860,8 @@ } } - col_clear(pinfo->cinfo, COL_INFO); /* append summary info */ - col_append_fstr(pinfo->cinfo, COL_INFO, "Event:%s", event_flag ? + col_add_fstr(pinfo->cinfo, COL_INFO, "Event:%s", event_flag ? "Time-critical" : "Information"); if (ql >= 0) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-smb-mailslot.c wireshark-1.12.0~201311020920/epan/dissectors/packet-smb-mailslot.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-smb-mailslot.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-smb-mailslot.c 2013-11-02 02:12:36.000000000 +0000 @@ -81,9 +81,8 @@ gboolean dissect_mailslot_smb(tvbuff_t *mshdr_tvb, tvbuff_t *setup_tvb, tvbuff_t *tvb, const char *mailslot, packet_info *pinfo, - proto_tree *parent_tree) + proto_tree *parent_tree, smb_info_t* smb_info) { - smb_info_t *smb_info; smb_transact_info_t *tri; int trans_subcmd; proto_tree *tree = NULL; @@ -107,7 +106,6 @@ col_clear(pinfo->cinfo, COL_INFO); - smb_info = (smb_info_t *)pinfo->private_data; if (smb_info->sip != NULL && smb_info->sip->extra_info_type == SMB_EI_TRI) tri = (smb_transact_info_t *)smb_info->sip->extra_info; else diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-smb-mailslot.h wireshark-1.12.0~201311020920/epan/dissectors/packet-smb-mailslot.h --- wireshark-1.12.0~201310251247/epan/dissectors/packet-smb-mailslot.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-smb-mailslot.h 2013-11-02 02:12:36.000000000 +0000 @@ -29,6 +29,6 @@ gboolean dissect_mailslot_smb(tvbuff_t *total_tvb, tvbuff_t *setup_tvb, tvbuff_t *tvb, const char *mailslot, - packet_info *pinfo, proto_tree *tree); + packet_info *pinfo, proto_tree *tree, smb_info_t* smb_info); #endif diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-smb-pipe.c wireshark-1.12.0~201311020920/epan/dissectors/packet-smb-pipe.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-smb-pipe.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-smb-pipe.c 2013-11-02 02:12:36.000000000 +0000 @@ -256,7 +256,7 @@ static int add_word_param(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index) + packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { proto_tree_add_item(tree, hf_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -265,7 +265,7 @@ static int add_dword_param(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index) + packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { proto_tree_add_item(tree, hf_index, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; @@ -274,7 +274,7 @@ static int add_bytes_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo _U_, - proto_tree *tree, int convert _U_, int hf_index) + proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { header_field_info *hfinfo; @@ -316,7 +316,7 @@ static int add_pad_param(tvbuff_t *tvb _U_, int offset, int count, packet_info *pinfo _U_, - proto_tree *tree _U_, int convert _U_, int hf_index _U_) + proto_tree *tree _U_, int convert _U_, int hf_index _U_, smb_info_t *smb_info _U_) { /* * This is for parameters that have descriptor entries but that @@ -328,7 +328,7 @@ static void add_null_pointer_param(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index) + packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { if (hf_index != -1) { proto_tree_add_string_format_value(tree, hf_index, tvb, offset, 0, "", "(Null pointer)"); @@ -339,7 +339,7 @@ static int add_string_param(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index) + packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { guint string_len; @@ -377,7 +377,7 @@ static int add_stringz_pointer_param(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo _U_, proto_tree *tree, int convert, int hf_index) + packet_info *pinfo _U_, proto_tree *tree, int convert, int hf_index, smb_info_t *smb_info _U_) { int cptr; const char *string; @@ -410,7 +410,7 @@ static int add_bytes_pointer_param(tvbuff_t *tvb, int offset, int count, - packet_info *pinfo _U_, proto_tree *tree, int convert, int hf_index) + packet_info *pinfo _U_, proto_tree *tree, int convert, int hf_index, smb_info_t *smb_info _U_) { int cptr; @@ -441,9 +441,8 @@ static int add_detail_level(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo, - proto_tree *tree, int convert _U_, int hf_index) + proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info) { - struct smb_info *smb_info = (struct smb_info *)pinfo->private_data; smb_transact_info_t *trp = NULL; guint16 level; @@ -462,7 +461,7 @@ static int add_max_uses(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo _U_, - proto_tree *tree, int convert _U_, int hf_index) + proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { guint16 WParam; @@ -481,7 +480,7 @@ static int add_server_type(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo, proto_tree *tree, int convert _U_, int hf_index _U_) + packet_info *pinfo, proto_tree *tree, int convert _U_, int hf_index _U_, smb_info_t *smb_info _U_) { offset = dissect_smb_server_type_flags( tvb, offset, pinfo, tree, NULL, FALSE); @@ -490,7 +489,7 @@ static int add_server_type_info(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo, proto_tree *tree, int convert _U_, int hf_index _U_) + packet_info *pinfo, proto_tree *tree, int convert _U_, int hf_index _U_, smb_info_t *smb_info _U_) { offset = dissect_smb_server_type_flags( tvb, offset, pinfo, tree, NULL, TRUE); @@ -499,7 +498,7 @@ static int add_reltime(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo _U_, - proto_tree *tree, int convert _U_, int hf_index) + proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { nstime_t nstime; @@ -552,21 +551,21 @@ static int add_abstime_absent_never(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index) + packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { return add_abstime_common(tvb, offset, tree, hf_index, "Never"); } static int add_abstime_absent_unknown(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index) + packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { return add_abstime_common(tvb, offset, tree, hf_index, "Unknown"); } static int add_nlogons(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo _U_, - proto_tree *tree, int convert _U_, int hf_index) + proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { guint16 nlogons; @@ -582,7 +581,7 @@ static int add_max_storage(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index) + packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index, smb_info_t *smb_info _U_) { guint32 max_storage; @@ -598,7 +597,7 @@ static int add_logon_hours(tvbuff_t *tvb, int offset, int count, packet_info *pinfo _U_, - proto_tree *tree, int convert, int hf_index) + proto_tree *tree, int convert, int hf_index, smb_info_t *smb_info _U_) { int cptr; @@ -633,7 +632,7 @@ static int add_tzoffset(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo _U_, - proto_tree *tree, int convert _U_, int hf_index _U_) + proto_tree *tree, int convert _U_, int hf_index _U_, smb_info_t *smb_info _U_) { gint16 tzoffset; @@ -656,7 +655,7 @@ static int add_timeinterval(tvbuff_t *tvb, int offset, int count _U_, - packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index _U_) + packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index _U_, smb_info_t *smb_info _U_) { guint16 timeinterval; @@ -669,7 +668,7 @@ static int add_logon_args(tvbuff_t *tvb, int offset, int count, packet_info *pinfo _U_, - proto_tree *tree, int convert _U_, int hf_index _U_) + proto_tree *tree, int convert _U_, int hf_index _U_, smb_info_t *smb_info _U_) { if (count != 54) { proto_tree_add_expert_format(tree, pinfo, &ei_smb_pipe_bogus_netwkstauserlogon, tvb, offset, count, "Bogus NetWkstaUserLogon parameters: length is %d, should be 54", count); @@ -711,7 +710,7 @@ * This is a pointer to a function to process an item. */ typedef int (*item_func)(tvbuff_t *, int, int, packet_info *, proto_tree *, - int, int); + int, int, smb_info_t*); /* * Type of an item; determines what parameter strings are valid for @@ -1607,7 +1606,7 @@ static int dissect_request_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, const guchar *desc, const item_t *items, - gboolean *has_data_p) + gboolean *has_data_p, smb_info_t *smb_info) { guint c; guint16 WParam; @@ -1629,7 +1628,7 @@ * fall back on the default. */ offset = add_word_param(tvb, offset, 0, pinfo, - tree, 0, hf_smb_pipe_word_param); + tree, 0, hf_smb_pipe_word_param, smb_info); } else if (items->type != PARAM_WORD) { /* * Descriptor character is 'W', but this @@ -1645,7 +1644,7 @@ items++; } else { offset = (*items->func)(tvb, offset, 0, pinfo, - tree, 0, *items->hf_index); + tree, 0, *items->hf_index, smb_info); items++; } break; @@ -1660,7 +1659,7 @@ * fall back on the default. */ offset = add_dword_param(tvb, offset, 0, pinfo, - tree, 0, hf_smb_pipe_doubleword_param); + tree, 0, hf_smb_pipe_doubleword_param, smb_info); } else if (items->type != PARAM_DWORD) { /* * Descriptor character is 'D', but this @@ -1676,7 +1675,7 @@ items++; } else { offset = (*items->func)(tvb, offset, 0, pinfo, - tree, 0, *items->hf_index); + tree, 0, *items->hf_index, smb_info); items++; } break; @@ -1692,7 +1691,7 @@ * fall back on the default. */ offset = add_bytes_param(tvb, offset, count, - pinfo, tree, 0, -1); + pinfo, tree, 0, -1, smb_info); } else if (items->type != PARAM_BYTES) { /* * Descriptor character is 'b', but this @@ -1707,7 +1706,7 @@ items++; } else { offset = (*items->func)(tvb, offset, count, - pinfo, tree, 0, *items->hf_index); + pinfo, tree, 0, *items->hf_index, smb_info); items++; } break; @@ -1722,7 +1721,7 @@ * fall back on the default. */ add_null_pointer_param(tvb, offset, 0, - pinfo, tree, 0, -1); + pinfo, tree, 0, -1, smb_info); } else { /* * If "*items->hf_index" is -1, this is @@ -1733,7 +1732,7 @@ if (*items->hf_index != -1) { add_null_pointer_param(tvb, offset, 0, pinfo, tree, 0, - *items->hf_index); + *items->hf_index, smb_info); } items++; } @@ -1749,7 +1748,7 @@ * fall back on the default. */ offset = add_string_param(tvb, offset, 0, - pinfo, tree, 0, -1); + pinfo, tree, 0, -1, smb_info); } else if (items->type != PARAM_STRINGZ) { /* * Descriptor character is 'z', but this @@ -1765,7 +1764,7 @@ items++; } else { offset = (*items->func)(tvb, offset, 0, - pinfo, tree, 0, *items->hf_index); + pinfo, tree, 0, *items->hf_index, smb_info); items++; } break; @@ -1815,7 +1814,7 @@ static int dissect_response_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, const guchar *desc, const item_t *items, - gboolean *has_data_p, gboolean *has_ent_count_p, guint16 *ent_count_p) + gboolean *has_data_p, gboolean *has_ent_count_p, guint16 *ent_count_p, smb_info_t *smb_info) { guint c; guint16 WParam; @@ -1845,7 +1844,7 @@ * fall back on the default. */ offset = add_bytes_param(tvb, offset, count, - pinfo, tree, 0, -1); + pinfo, tree, 0, -1, smb_info); } else if (items->type != PARAM_BYTES) { /* * Descriptor character is 'b', but this @@ -1860,7 +1859,7 @@ items++; } else { offset = (*items->func)(tvb, offset, count, - pinfo, tree, 0, *items->hf_index); + pinfo, tree, 0, *items->hf_index, smb_info); items++; } break; @@ -1875,7 +1874,7 @@ * fall back on the default. */ offset = add_word_param(tvb, offset, 0, pinfo, - tree, 0, hf_smb_pipe_word_param); + tree, 0, hf_smb_pipe_word_param, smb_info); } else if (items->type != PARAM_WORD) { /* * Descriptor character is 'h', but this @@ -1891,7 +1890,7 @@ items++; } else { offset = (*items->func)(tvb, offset, 0, pinfo, - tree, 0, *items->hf_index); + tree, 0, *items->hf_index, smb_info); items++; } break; @@ -1906,7 +1905,7 @@ * fall back on the default. */ offset = add_dword_param(tvb, offset, 0, pinfo, - tree, 0, hf_smb_pipe_doubleword_param); + tree, 0, hf_smb_pipe_doubleword_param, smb_info); } else if (items->type != PARAM_DWORD) { /* * Descriptor character is 'i', but this @@ -1922,7 +1921,7 @@ items++; } else { offset = (*items->func)(tvb, offset, 0, pinfo, - tree, 0, *items->hf_index); + tree, 0, *items->hf_index, smb_info); items++; } break; @@ -1949,7 +1948,7 @@ static int dissect_transact_data(tvbuff_t *tvb, int offset, int convert, packet_info *pinfo, proto_tree *tree, const guchar *desc, - const item_t *items, guint16 *aux_count_p) + const item_t *items, guint16 *aux_count_p, smb_info_t *smb_info) { guint c; guint16 WParam; @@ -1977,7 +1976,7 @@ * fall back on the default. */ offset = add_word_param(tvb, offset, 0, pinfo, - tree, convert, hf_smb_pipe_word_param); + tree, convert, hf_smb_pipe_word_param, smb_info); } else if (items->type != PARAM_WORD) { /* * Descriptor character is 'W', but this @@ -1993,7 +1992,7 @@ items++; } else { offset = (*items->func)(tvb, offset, 0, pinfo, - tree, convert, *items->hf_index); + tree, convert, *items->hf_index, smb_info); items++; } break; @@ -2010,7 +2009,7 @@ * fall back on the default. */ offset = add_dword_param(tvb, offset, 0, pinfo, - tree, convert, hf_smb_pipe_doubleword_param); + tree, convert, hf_smb_pipe_doubleword_param, smb_info); } else if (items->type != PARAM_DWORD) { /* * Descriptor character is 'D', but this @@ -2026,7 +2025,7 @@ items++; } else { offset = (*items->func)(tvb, offset, 0, pinfo, - tree, convert, *items->hf_index); + tree, convert, *items->hf_index, smb_info); items++; } break; @@ -2042,7 +2041,7 @@ * fall back on the default. */ offset = add_bytes_param(tvb, offset, count, - pinfo, tree, convert, -1); + pinfo, tree, convert, -1, smb_info); } else if (items->type != PARAM_BYTES) { /* * Descriptor character is 'B', but this @@ -2057,7 +2056,7 @@ items++; } else { offset = (*items->func)(tvb, offset, count, - pinfo, tree, convert, *items->hf_index); + pinfo, tree, convert, *items->hf_index, smb_info); items++; } break; @@ -2072,7 +2071,7 @@ * fall back on the default. */ add_null_pointer_param(tvb, offset, 0, - pinfo, tree, convert, -1); + pinfo, tree, convert, -1, smb_info); } else { /* * If "*items->hf_index" is -1, this is @@ -2083,7 +2082,7 @@ if (*items->hf_index != -1) { add_null_pointer_param(tvb, offset, 0, pinfo, tree, convert, - *items->hf_index); + *items->hf_index, smb_info); } items++; } @@ -2099,7 +2098,7 @@ * fall back on the default. */ offset = add_stringz_pointer_param(tvb, offset, - 0, pinfo, tree, convert, -1); + 0, pinfo, tree, convert, -1, smb_info); } else if (items->type != PARAM_STRINGZ) { /* * Descriptor character is 'z', but this @@ -2116,7 +2115,7 @@ items++; } else { offset = (*items->func)(tvb, offset, 0, - pinfo, tree, convert, *items->hf_index); + pinfo, tree, convert, *items->hf_index, smb_info); items++; } break; @@ -2132,7 +2131,7 @@ * fall back on the default. */ offset = add_bytes_pointer_param(tvb, offset, - count, pinfo, tree, convert, -1); + count, pinfo, tree, convert, -1, smb_info); } else if (items->type != PARAM_BYTES) { /* * Descriptor character is 'b', but this @@ -2148,7 +2147,7 @@ items++; } else { offset = (*items->func)(tvb, offset, count, - pinfo, tree, convert, *items->hf_index); + pinfo, tree, convert, *items->hf_index, smb_info); items++; } break; @@ -2441,7 +2440,7 @@ static void dissect_response_data(tvbuff_t *tvb, packet_info *pinfo, int convert, - proto_tree *tree, struct smb_info *smb_info, + proto_tree *tree, smb_info_t *smb_info, const struct lanman_desc *lanman, gboolean has_ent_count, guint16 ent_count) { @@ -2556,7 +2555,7 @@ offset = dissect_transact_data(tvb, offset, convert, pinfo, entry_tree, - trp->data_descrip, resp_data, &aux_count); + trp->data_descrip, resp_data, &aux_count, smb_info); /* auxiliary data */ if (trp->aux_data_descrip != NULL) { @@ -2565,7 +2564,7 @@ tvb, offset, convert, pinfo, entry_tree, trp->data_descrip, - lanman->resp_aux_data, NULL); + lanman->resp_aux_data, NULL, smb_info); } } @@ -2591,9 +2590,8 @@ static gboolean dissect_pipe_lanman(tvbuff_t *pd_tvb, tvbuff_t *p_tvb, tvbuff_t *d_tvb, - packet_info *pinfo, proto_tree *parent_tree) + packet_info *pinfo, proto_tree *parent_tree, smb_info_t *smb_info) { - smb_info_t *smb_info = (smb_info_t *)pinfo->private_data; smb_transact_info_t *trp = NULL; int offset = 0/*, start_offset*/; guint16 cmd; @@ -2690,7 +2688,7 @@ /* request parameters */ /*start_offset = offset;*/ offset = dissect_request_parameters(p_tvb, offset, pinfo, tree, - param_descrip, lanman->req, &has_data); + param_descrip, lanman->req, &has_data, smb_info); /* auxiliary data descriptor */ if (tvb_reported_length_remaining(p_tvb, offset) > 0){ @@ -2740,7 +2738,7 @@ /* data */ offset = dissect_transact_data(d_tvb, offset, -1, pinfo, data_tree, data_descrip, lanman->req_data, - &aux_count); /* XXX - what about strings? */ + &aux_count, smb_info); /* XXX - what about strings? */ /* auxiliary data */ if (aux_data_descrip != NULL) { @@ -2748,7 +2746,7 @@ offset = dissect_transact_data(d_tvb, offset, -1, pinfo, data_tree, aux_data_descrip, - lanman->req_aux_data, NULL); + lanman->req_aux_data, NULL, smb_info); } } @@ -2830,7 +2828,7 @@ /* rest of the parameters */ dissect_response_parameters(p_tvb, offset, pinfo, tree, trp->param_descrip, lanman->resp, - &has_data, &has_ent_count, &ent_count); + &has_data, &has_ent_count, &ent_count, smb_info); /* data */ if (d_tvb && tvb_reported_length(d_tvb) > 0) { @@ -3231,7 +3229,6 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree, proto_tree *tree, guint32 fid) { - smb_info_t *smb_priv = (smb_info_t *)pinfo->private_data; gboolean result=0; gboolean save_fragmented; guint reported_len; @@ -3398,7 +3395,6 @@ clean_up_and_exit: /* clear out the variables */ - pinfo->private_data = smb_priv; pinfo->can_desegment=0; pinfo->desegment_offset = 0; pinfo->desegment_len = 0; @@ -3462,9 +3458,8 @@ gboolean dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb, tvbuff_t *p_tvb, tvbuff_t *d_tvb, const char *pipe, - packet_info *pinfo, proto_tree *tree) + packet_info *pinfo, proto_tree *tree, smb_info_t *smb_info) { - smb_info_t *smb_info; smb_transact_info_t *tri; guint sp_len; proto_item *pipe_item = NULL; @@ -3479,8 +3474,6 @@ return FALSE; pinfo->current_proto = "SMB Pipe"; - smb_info = (smb_info_t *)pinfo->private_data; - /* * Set the columns. */ @@ -3551,7 +3544,7 @@ * It's a FID. */ fid = tvb_get_letohs(s_tvb, 2); - dissect_smb_fid(s_tvb, pinfo, pipe_tree, offset, 2, (guint16) fid, FALSE, FALSE, FALSE); + dissect_smb_fid(s_tvb, pinfo, pipe_tree, offset, 2, (guint16) fid, FALSE, FALSE, FALSE, smb_info); if (tri != NULL) tri->fid = fid; break; @@ -3583,7 +3576,7 @@ fid = tri->fid; if (fid != -1) - dissect_smb_fid(d_tvb, pinfo, pipe_tree, 0, 0, (guint16) fid, FALSE, FALSE, TRUE); + dissect_smb_fid(d_tvb, pinfo, pipe_tree, 0, 0, (guint16) fid, FALSE, FALSE, TRUE, smb_info); } else { function = -1; fid = -1; @@ -3629,8 +3622,7 @@ switch(trans_subcmd){ case PIPE_LANMAN: - return dissect_pipe_lanman(pd_tvb, p_tvb, d_tvb, pinfo, - tree); + return dissect_pipe_lanman(pd_tvb, p_tvb, d_tvb, pinfo, tree, smb_info); case PIPE_DCERPC: /* @@ -3639,8 +3631,7 @@ if (fid != -1) { if (d_tvb == NULL) return FALSE; - return dissect_pipe_dcerpc(d_tvb, pinfo, tree, - pipe_tree, fid); + return dissect_pipe_dcerpc(d_tvb, pinfo, tree, pipe_tree, fid); } break; } @@ -3653,8 +3644,7 @@ */ switch(trans_subcmd){ case PIPE_LANMAN: - return dissect_pipe_lanman(pd_tvb, p_tvb, d_tvb, pinfo, - tree); + return dissect_pipe_lanman(pd_tvb, p_tvb, d_tvb, pinfo, tree, smb_info); } break; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-smb-pipe.h wireshark-1.12.0~201311020920/epan/dissectors/packet-smb-pipe.h --- wireshark-1.12.0~201310251247/epan/dissectors/packet-smb-pipe.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-smb-pipe.h 2013-11-02 02:12:36.000000000 +0000 @@ -29,7 +29,7 @@ extern gboolean dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb, tvbuff_t *p_tvb, tvbuff_t *d_tvb, const char *pipe, - packet_info *pinfo, proto_tree *tree); + packet_info *pinfo, proto_tree *tree, smb_info_t *smb_info); gboolean dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree, proto_tree *tree, guint32 fid); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-smb.c wireshark-1.12.0~201311020920/epan/dissectors/packet-smb.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-smb.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-smb.c 2013-11-02 02:12:36.000000000 +0000 @@ -865,7 +865,7 @@ static proto_tree *top_tree_global = NULL; /* ugly */ -static int dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *smb_tree, guint8 cmd, gboolean first_pdu); +static int dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *smb_tree, guint8 cmd, gboolean first_pdu, smb_info_t *si); /* * Macros for use in the main dissector routines for an SMB. @@ -991,7 +991,8 @@ /* ExportObject feed function*/ static void -feed_eo_smb(guint16 cmd, guint16 fid, tvbuff_t * tvb,packet_info *pinfo,guint16 dataoffset,guint32 datalen, guint32 chunk_len, guint64 file_offset) { +feed_eo_smb(guint16 cmd, guint16 fid, tvbuff_t * tvb,packet_info *pinfo,guint16 dataoffset,guint32 datalen, guint32 chunk_len, + guint64 file_offset, smb_info_t *si) { smb_eo_t *eo_info; /* eo_info variable to pass info. to export object and aux */ smb_tid_info_t *tid_info = NULL; @@ -1000,8 +1001,6 @@ tvbuff_t *data_tvb; GSList *GSL_iterator; - smb_info_t *si = (smb_info_t *)pinfo->private_data; - /* Create a new tvb to point to the payload data */ data_tvb = tvb_new_subset(tvb, dataoffset, datalen, datalen); /* Create the eo_info to pass to the listener */ @@ -1094,10 +1093,9 @@ static fragment_head * smb_trans_defragment(proto_tree *tree _U_, packet_info *pinfo, tvbuff_t *tvb, - int offset, guint count, guint pos, guint totlen) + int offset, guint count, guint pos, guint totlen, smb_info_t *si) { fragment_head *fd_head = NULL; - smb_info_t *si; int more_frags; /* Don't pass the reassembly code data that doesn't exist */ @@ -1108,7 +1106,6 @@ more_frags = totlen > (pos + count); - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if (si->sip == NULL) { @@ -2277,16 +2274,14 @@ }; static int -dissect_negprot_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_negprot_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { proto_item *it = NULL; proto_tree *tr = NULL; guint16 bc; guint8 wc; - smb_info_t *si; struct negprot_dialects *dialects = NULL; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); WORD_COUNT; @@ -2345,9 +2340,8 @@ } static int -dissect_negprot_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_negprot_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; guint8 wc; guint16 dialect; const char *dn; @@ -2664,9 +2658,8 @@ static int -dissect_old_dir_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_old_dir_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int dn_len; const char *dn; guint8 wc; @@ -2707,11 +2700,10 @@ } static int -dissect_empty(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_empty(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc; - smb_info_t *si = (smb_info_t *)pinfo->private_data; proto_item *item = NULL; DISSECTOR_ASSERT(si); @@ -2732,11 +2724,10 @@ } static int -dissect_rename_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_rename_file_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc; - smb_info_t *si = (smb_info_t *)pinfo->private_data; proto_item *item = NULL; DISSECTOR_ASSERT(si); @@ -2761,7 +2752,7 @@ } static int -dissect_echo_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_echo_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint16 ec, bc; guint8 wc; @@ -2787,7 +2778,7 @@ } static int -dissect_echo_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_echo_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint16 bc; guint8 wc; @@ -2812,9 +2803,8 @@ } static int -dissect_tree_connect_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_tree_connect_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int an_len, pwlen; const char *an; guint8 wc; @@ -2921,9 +2911,8 @@ } static int -dissect_smb_tid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 tid, gboolean is_created, gboolean is_closed) +dissect_smb_tid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 tid, gboolean is_created, gboolean is_closed, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; proto_item *it; proto_tree *tr; smb_tid_info_t *tid_info = NULL; @@ -2980,7 +2969,7 @@ } static int -dissect_tree_connect_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_tree_connect_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc; @@ -2992,7 +2981,7 @@ offset += 2; /* tid */ - offset = dissect_smb_tid(tvb, pinfo, tree, offset, tvb_get_letohs(tvb, offset), TRUE, FALSE); + offset = dissect_smb_tid(tvb, pinfo, tree, offset, tvb_get_letohs(tvb, offset), TRUE, FALSE, si); BYTE_COUNT; @@ -3122,9 +3111,8 @@ } static int -dissect_move_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_move_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; guint16 tid; guint16 bc; @@ -3137,7 +3125,7 @@ /* tid */ tid = tvb_get_letohs(tvb, offset); - offset = dissect_smb_tid(tvb, pinfo, tree, offset, tid, FALSE, FALSE); + offset = dissect_smb_tid(tvb, pinfo, tree, offset, tid, FALSE, FALSE, si); /* open function */ offset = dissect_open_function(tvb, tree, offset); @@ -3187,9 +3175,8 @@ } static int -dissect_copy_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_copy_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; guint16 tid; guint16 bc; @@ -3202,7 +3189,7 @@ /* tid */ tid = tvb_get_letohs(tvb, offset); - offset = dissect_smb_tid(tvb, pinfo, tree, offset, tid, FALSE, FALSE); + offset = dissect_smb_tid(tvb, pinfo, tree, offset, tid, FALSE, FALSE, si); /* open function */ offset = dissect_open_function(tvb, tree, offset); @@ -3252,9 +3239,8 @@ } static int -dissect_move_copy_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_move_copy_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint8 wc; @@ -3290,9 +3276,8 @@ } static int -dissect_open_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_open_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint8 wc; @@ -3602,9 +3587,8 @@ /* fids are scoped by tcp session */ smb_fid_info_t * dissect_smb_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, - int len, guint16 fid, gboolean is_created, gboolean is_closed, gboolean is_generated) + int len, guint16 fid, gboolean is_created, gboolean is_closed, gboolean is_generated, smb_info_t* si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; smb_saved_info_t *sip = si->sip; proto_item *it; proto_tree *tr; @@ -3709,7 +3693,7 @@ } static int -dissect_open_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_open_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc; @@ -3723,7 +3707,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE); + fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE, si); if (fid_info) { /* This command is used to create and open a new file or open and truncate an existing file to zero length */ @@ -3764,7 +3748,7 @@ } static int -dissect_query_information2_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_query_information2_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc; @@ -3774,7 +3758,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; BYTE_COUNT; @@ -3785,7 +3769,7 @@ } static int -dissect_close_print_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_close_print_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc; @@ -3795,7 +3779,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, TRUE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, TRUE, FALSE, si); offset += 2; BYTE_COUNT; @@ -3806,7 +3790,7 @@ } static int -dissect_open_print_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_open_print_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc; @@ -3816,7 +3800,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; BYTE_COUNT; @@ -3827,7 +3811,7 @@ } static int -dissect_create_new_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_create_new_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc; @@ -3837,7 +3821,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE, si); offset += 2; BYTE_COUNT; @@ -3848,7 +3832,7 @@ } static int -dissect_flush_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_flush_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc; @@ -3858,7 +3842,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; BYTE_COUNT; @@ -3869,7 +3853,7 @@ } static int -dissect_create_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_create_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc; @@ -3882,7 +3866,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE); + fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE, si); if (fid_info) { /* This command is used to create and open a new file or open and truncate an existing file to zero length */ @@ -3910,9 +3894,8 @@ } static int -dissect_create_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_create_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint8 wc; @@ -3975,7 +3958,7 @@ } static int -dissect_close_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_close_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc, fid; @@ -3984,7 +3967,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, TRUE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, TRUE, FALSE, si); offset += 2; /* last write time */ @@ -3998,9 +3981,8 @@ } static int -dissect_delete_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_delete_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint8 wc; @@ -4044,9 +4026,8 @@ } static int -dissect_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn, *old_name = NULL, *new_name = NULL; guint8 wc; @@ -4114,9 +4095,8 @@ } static int -dissect_nt_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_nt_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint8 wc; @@ -4178,9 +4158,8 @@ static int -dissect_query_information_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_query_information_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; guint16 bc; guint8 wc; const char *fn; @@ -4215,7 +4194,7 @@ } static int -dissect_query_information_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_query_information_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint16 bc; guint8 wc; @@ -4244,9 +4223,8 @@ } static int -dissect_set_information_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_set_information_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint8 wc; @@ -4297,20 +4275,19 @@ } rw_info_t; static int -dissect_read_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_read_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 cnt = 0, bc; guint32 ofs = 0; unsigned int fid; rw_info_t *rwi = NULL; - smb_info_t *si = (smb_info_t *)pinfo->private_data; WORD_COUNT; /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, (guint16) fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, (guint16) fid, FALSE, FALSE, FALSE, si); offset += 2; /* read count */ @@ -4408,10 +4385,8 @@ static int dissect_file_data_maybe_dcerpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *top_tree, int offset, guint16 bc, - guint16 datalen, guint32 ofs, guint16 fid) + guint16 datalen, guint32 ofs, guint16 fid, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; - DISSECTOR_ASSERT(si); if ( (si->sip && (si->sip->flags & SMB_SIF_TID_IS_IPC)) && (ofs == 0) ) { @@ -4425,11 +4400,10 @@ } static int -dissect_read_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_read_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint16 cnt = 0, bc; guint8 wc; - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fid = 0; guint32 datalen=0,dataoffset=0; guint32 tvblen; @@ -4464,7 +4438,7 @@ /* file data, might be DCERPC on a pipe */ if (bc) { offset = dissect_file_data_maybe_dcerpc(tvb, pinfo, tree, - top_tree_global, offset, bc, bc, 0, (guint16) fid); + top_tree_global, offset, bc, bc, 0, (guint16) fid, si); bc = 0; } @@ -4492,7 +4466,7 @@ /* feed the export object tap listener */ tvblen = tvb_length_remaining(tvb, dataoffset); if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) { - feed_eo_smb(SMB_COM_READ,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset); + feed_eo_smb(SMB_COM_READ,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset, si); } END_OF_SMB @@ -4501,7 +4475,7 @@ } static int -dissect_lock_and_read_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_lock_and_read_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint16 cnt, bc; guint8 wc; @@ -4537,12 +4511,11 @@ static int -dissect_write_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_write_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint32 ofs = 0; guint16 cnt = 0, bc, fid = 0; guint8 wc; - smb_info_t *si = (smb_info_t *)pinfo->private_data; rw_info_t *rwi = NULL; guint32 datalen=0,dataoffset=0; guint32 tvblen; @@ -4553,7 +4526,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* write count */ @@ -4614,14 +4587,14 @@ /* file data, might be DCERPC on a pipe */ if (bc != 0) { offset = dissect_file_data_maybe_dcerpc(tvb, pinfo, tree, - top_tree_global, offset, bc, bc, ofs, fid); + top_tree_global, offset, bc, bc, ofs, fid, si); bc = 0; } /* feed the export object tap listener */ tvblen = tvb_length_remaining(tvb, dataoffset); if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) { - feed_eo_smb(SMB_COM_WRITE,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset); + feed_eo_smb(SMB_COM_WRITE,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset, si); } END_OF_SMB @@ -4630,11 +4603,10 @@ } static int -dissect_write_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_write_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc, cnt; - smb_info_t *si = (smb_info_t *)pinfo->private_data; rw_info_t *rwi = NULL; DISSECTOR_ASSERT(si); @@ -4670,7 +4642,7 @@ } static int -dissect_lock_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_lock_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc, fid; @@ -4679,7 +4651,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* lock count */ @@ -4698,9 +4670,8 @@ } static int -dissect_create_temporary_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_create_temporary_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint8 wc; @@ -4742,9 +4713,8 @@ } static int -dissect_create_temporary_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_create_temporary_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint8 wc; @@ -4756,7 +4726,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE, si); offset += 2; BYTE_COUNT; @@ -4788,7 +4758,7 @@ }; static int -dissect_seek_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_seek_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc, fid; @@ -4797,7 +4767,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* Seek Mode */ @@ -4816,7 +4786,7 @@ } static int -dissect_seek_file_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_seek_file_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -4835,7 +4805,7 @@ } static int -dissect_set_information2_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_set_information2_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc, fid; @@ -4844,7 +4814,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* create time */ @@ -4870,7 +4840,7 @@ } static int -dissect_query_information2_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_query_information2_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -4911,7 +4881,7 @@ } static int -dissect_write_and_close_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_write_and_close_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 cnt = 0; @@ -4921,7 +4891,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, TRUE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, TRUE, FALSE, si); offset += 2; /* write count */ @@ -4958,7 +4928,7 @@ } static int -dissect_write_and_close_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_write_and_close_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -5003,7 +4973,7 @@ } static int -dissect_read_raw_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_read_raw_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc, fid; @@ -5013,7 +4983,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* offset */ @@ -5051,7 +5021,7 @@ } static int -dissect_query_information_disk_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_query_information_disk_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -5086,7 +5056,7 @@ } static int -dissect_read_mpx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_read_mpx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc; guint16 bc, fid; @@ -5095,7 +5065,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* offset */ @@ -5122,7 +5092,7 @@ } static int -dissect_read_mpx_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_read_mpx_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint16 datalen = 0, bc; guint8 wc; @@ -5237,7 +5207,7 @@ } static int -dissect_write_raw_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_write_raw_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint32 to; guint16 datalen = 0, bc, fid; @@ -5247,7 +5217,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* total data length */ @@ -5296,7 +5266,7 @@ } static int -dissect_write_raw_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_write_raw_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -5315,7 +5285,7 @@ } static int -dissect_write_mpx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_write_mpx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint32 to; guint16 datalen = 0, bc, fid; @@ -5325,7 +5295,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* total data length */ @@ -5374,7 +5344,7 @@ } static int -dissect_write_mpx_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_write_mpx_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -5393,7 +5363,7 @@ } static int -dissect_sid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_sid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -5412,13 +5382,12 @@ } static int -dissect_search_resume_key(tvbuff_t *tvb, packet_info *pinfo, +dissect_search_resume_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, guint16 *bcp, gboolean *trunc, - gboolean has_find_id) + gboolean has_find_id, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; char fname[11+1]; @@ -5475,11 +5444,10 @@ static int dissect_search_dir_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, guint16 *bcp, gboolean *trunc, - gboolean has_find_id) + gboolean has_find_id, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; char fname[13+1]; @@ -5494,7 +5462,7 @@ /* resume key */ offset = dissect_search_resume_key(tvb, pinfo, tree, offset, bcp, - trunc, has_find_id); + trunc, has_find_id, si); if (*trunc) return offset; @@ -5534,10 +5502,9 @@ static int dissect_search_find_request(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, proto_tree *smb_tree _U_, + proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si, gboolean has_find_id) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint16 rkl; @@ -5589,7 +5556,7 @@ /* resume key */ if (rkl) { offset = dissect_search_resume_key(tvb, pinfo, tree, offset, - &bc, &trunc, has_find_id); + &bc, &trunc, has_find_id, si); if (trunc) goto endofcommand; } @@ -5601,32 +5568,32 @@ static int dissect_search_dir_request(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, proto_tree *smb_tree) + proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { return dissect_search_find_request(tvb, pinfo, tree, offset, - smb_tree, FALSE); + smb_tree, si, FALSE); } static int dissect_find_request(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, proto_tree *smb_tree) + proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { return dissect_search_find_request(tvb, pinfo, tree, offset, - smb_tree, TRUE); + smb_tree, si, TRUE); } static int dissect_find_close_request(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, proto_tree *smb_tree) + proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { return dissect_search_find_request(tvb, pinfo, tree, offset, - smb_tree, TRUE); + smb_tree, si, TRUE); } static int dissect_search_find_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, - gboolean has_find_id) + gboolean has_find_id, smb_info_t *si) { guint16 count = 0; guint8 wc; @@ -5654,7 +5621,7 @@ while(count--) { offset = dissect_search_dir_info(tvb, pinfo, tree, offset, - &bc, &trunc, has_find_id); + &bc, &trunc, has_find_id, si); if (trunc) goto endofcommand; } @@ -5665,22 +5632,22 @@ } static int -dissect_search_dir_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_search_dir_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { return dissect_search_find_response(tvb, pinfo, tree, offset, smb_tree, - FALSE); + FALSE, si); } static int -dissect_find_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_find_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { return dissect_search_find_response(tvb, pinfo, tree, offset, smb_tree, - TRUE); + TRUE, si); } static int dissect_find_close_response(tvbuff_t *tvb, packet_info *pinfo _U_, - proto_tree *tree, int offset, proto_tree *smb_tree _U_) + proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -5744,7 +5711,7 @@ "This is an exclusive lock" }; static int -dissect_locking_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_locking_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff, lt = 0, ol = 0; guint16 andxoffset = 0, un = 0, ln = 0, bc, fid, num_lock = 0, num_unlock = 0; @@ -5754,7 +5721,6 @@ proto_item *it = NULL; proto_tree *tr = NULL; int old_offset = offset; - smb_info_t *si = (smb_info_t *)pinfo->private_data; smb_locking_saved_info_t *ld = NULL; @@ -5782,7 +5748,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* lock type */ @@ -6018,21 +5984,19 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; } static int -dissect_locking_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_locking_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0; guint16 bc; - smb_info_t *si; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); /* print the lock info from the request */ @@ -6110,7 +6074,7 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; @@ -6218,12 +6182,11 @@ {0, NULL} }; static int -dissect_open_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_open_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0, bc; guint32 to; - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; @@ -6312,7 +6275,7 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; @@ -6374,7 +6337,7 @@ } static int -dissect_open_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_open_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0, bc; @@ -6407,7 +6370,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); /* we add fid_info= to this call so that we save the result */ - fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE); + fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE, si); offset += 2; @@ -6480,14 +6443,14 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; } static int -dissect_read_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_read_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0, bc, maxcnt_low; @@ -6495,7 +6458,6 @@ guint32 maxcnt = 0; guint32 offsetlow, offsethigh = 0; guint64 ofs; - smb_info_t *si = (smb_info_t *)pinfo->private_data; unsigned int fid; rw_info_t *rwi = NULL; @@ -6524,7 +6486,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, (guint16) fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, (guint16) fid, FALSE, FALSE, FALSE, si); offset += 2; /* offset */ @@ -6640,19 +6602,18 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; } static int -dissect_read_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_read_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0, bc, datalen_low, dataoffset = 0; guint32 datalen = 0, datalen_high; - smb_info_t *si = (smb_info_t *)pinfo->private_data; rw_info_t *rwi = NULL; guint16 fid = 0; /* was int fid = 0; */ @@ -6684,7 +6645,7 @@ /* first check if we have seen the request */ 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); - dissect_smb_fid(tvb, pinfo, tree, 0, 0, (guint16) fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, 0, 0, (guint16) fid, FALSE, FALSE, FALSE, si); } if (si->sip && (si->sip->extra_info_type == SMB_EI_RWINFO)) { @@ -6760,14 +6721,14 @@ /* file data, might be DCERPC on a pipe */ if (bc) { offset = dissect_file_data_maybe_dcerpc(tvb, pinfo, tree, - top_tree_global, offset, bc, (guint16) datalen, 0, (guint16) fid); + top_tree_global, offset, bc, (guint16) datalen, 0, (guint16) fid, si); bc = 0; } /* feed the export object tap listener */ tvblen = tvb_length_remaining(tvb, dataoffset); if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) { - feed_eo_smb(SMB_COM_READ_ANDX,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset); + feed_eo_smb(SMB_COM_READ_ANDX,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset, si); } END_OF_SMB @@ -6776,21 +6737,20 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; } static int -dissect_write_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_write_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0, bc, dataoffset = 0, datalen_low, datalen_high; guint32 offsetlow, offsethigh = 0; guint64 ofs; guint32 datalen = 0; - smb_info_t *si = (smb_info_t *)pinfo->private_data; guint16 fid = 0; /* was unsigned int fid = 0; */ guint16 mode = 0; rw_info_t *rwi = NULL; @@ -6821,7 +6781,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, (guint16) fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, (guint16) fid, FALSE, FALSE, FALSE, si); offset += 2; /* offset */ @@ -6937,14 +6897,14 @@ /* file data, might be DCERPC on a pipe */ if (bc != 0) { offset = dissect_file_data_maybe_dcerpc(tvb, pinfo, tree, - top_tree_global, offset, bc, (guint16) datalen, 0, (guint16) fid); + top_tree_global, offset, bc, (guint16) datalen, 0, (guint16) fid, si); bc = 0; } /* feed the export object tap listener */ tvblen = tvb_length_remaining(tvb, dataoffset); if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) { - feed_eo_smb(SMB_COM_WRITE_ANDX,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset); + feed_eo_smb(SMB_COM_WRITE_ANDX,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset, si); } END_OF_SMB @@ -6953,19 +6913,18 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; } static int -dissect_write_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_write_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0, bc, count_low, count_high; guint32 count = 0; - smb_info_t *si = (smb_info_t *)pinfo->private_data; rw_info_t *rwi = NULL; DISSECTOR_ASSERT(si); @@ -7039,7 +6998,7 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; @@ -7073,12 +7032,11 @@ static int -dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 bc; guint16 andxoffset = 0; - smb_info_t *si = (smb_info_t *)pinfo->private_data; int an_len; const char *an; int dn_len; @@ -7440,20 +7398,18 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - pinfo->private_data = si; - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; } static int -dissect_session_setup_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_session_setup_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0, bc; guint16 sbloblen = 0; - smb_info_t *si = (smb_info_t *)pinfo->private_data; int an_len; const char *an; @@ -7576,8 +7532,7 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - pinfo->private_data = si; - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; @@ -7585,7 +7540,7 @@ static int -dissect_empty_andx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_empty_andx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si _U_) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0; @@ -7619,7 +7574,7 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; @@ -7727,12 +7682,11 @@ } static int -dissect_tree_connect_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_tree_connect_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 bc; guint16 andxoffset = 0, pwlen = 0; - smb_info_t *si = (smb_info_t *)pinfo->private_data; int an_len; const char *an; @@ -7815,7 +7769,7 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; @@ -7823,7 +7777,7 @@ static int -dissect_tree_connect_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_tree_connect_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, wleft, cmd = 0xff; guint16 andxoffset = 0; @@ -7833,7 +7787,6 @@ proto_item *it = NULL; proto_tree *tr = NULL; const char *an; - smb_info_t *si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); @@ -7968,7 +7921,7 @@ if (andxoffset < offset) { THROW(ReportedBoundsError); } - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; @@ -8607,18 +8560,15 @@ static int -dissect_nt_trans_data_request(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, int bc, nt_trans_data *ntd, smb_nt_transact_info_t *nti) +dissect_nt_trans_data_request(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, int bc, nt_trans_data *ntd, smb_nt_transact_info_t *nti, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; int old_offset = offset; guint16 bcp = bc; /* XXX fixme */ struct access_mask_info *ami = NULL; tvbuff_t *ioctl_tvb; - si = (smb_info_t *)pinfo->private_data; - DISSECTOR_ASSERT(si); if (parent_tree) { @@ -8712,16 +8662,13 @@ } static int -dissect_nt_trans_param_request(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, int len, nt_trans_data *ntd, guint16 bc, smb_nt_transact_info_t *nti) +dissect_nt_trans_param_request(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, int len, nt_trans_data *ntd, guint16 bc, smb_nt_transact_info_t *nti, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; guint32 fn_len, create_flags, access_mask, share_access, create_options; const char *fn; - si = (smb_info_t *)pinfo->private_data; - DISSECTOR_ASSERT(si); if (parent_tree) { @@ -8809,7 +8756,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; if (nti) { if (fid_info) { @@ -8838,7 +8785,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; if (nti) { if (fid_info) { @@ -8868,16 +8815,13 @@ } static int -dissect_nt_trans_setup_request(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, int len, nt_trans_data *ntd) +dissect_nt_trans_setup_request(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, int len, nt_trans_data *ntd, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; smb_nt_transact_info_t *nti = NULL; smb_saved_info_t *sip; - - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); sip = si->sip; if (sip && (sip->extra_info_type == SMB_EI_NTI)) { @@ -8904,7 +8848,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* isfsctl */ @@ -8927,7 +8871,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; /* watch tree */ @@ -8961,12 +8905,11 @@ static int -dissect_nt_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_nt_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc, sc; guint32 pc = 0, pd = 0, po = 0, dc = 0, od = 0, dd = 0; guint32 td = 0, tp = 0; - smb_info_t *si; smb_saved_info_t *sip; int subcmd; nt_trans_data ntd; @@ -8981,7 +8924,6 @@ ntd.subcmd = ntd.sd_len = ntd.ea_len = 0; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); sip = si->sip; @@ -9117,7 +9059,7 @@ /* if there were any setup bytes, decode them */ if (sc) { - dissect_nt_trans_setup_request(tvb, pinfo, offset, tree, sc*2, &ntd); + dissect_nt_trans_setup_request(tvb, pinfo, offset, tree, sc*2, &ntd, si); offset += sc*2; } @@ -9137,11 +9079,11 @@ /* ...and we were told to do reassembly */ if (pc) { r_fd = smb_trans_defragment(tree, pinfo, tvb, - po, pc, pd, td+tp); + po, pc, pd, td+tp, si); } if ((r_fd == NULL) && dc) { r_fd = smb_trans_defragment(tree, pinfo, tvb, - od, dc, dd+tp, td+tp); + od, dc, dd+tp, td+tp, si); } } } @@ -9161,8 +9103,8 @@ if (pd_tvb) { /* we have reassembled data, grab param and data from there */ dissect_nt_trans_param_request(pd_tvb, pinfo, 0, tree, tp, - &ntd, (guint16) tvb_length(pd_tvb), nti); - dissect_nt_trans_data_request(pd_tvb, pinfo, tp, tree, td, &ntd, nti); + &ntd, (guint16) tvb_length(pd_tvb), nti, si); + dissect_nt_trans_data_request(pd_tvb, pinfo, tp, tree, td, &ntd, nti, si); COUNT_BYTES(bc); /* We are done */ } else { /* we do not have reassembled data, just use what we have in the @@ -9180,7 +9122,7 @@ } if (pc) { CHECK_BYTE_COUNT(pc); - dissect_nt_trans_param_request(tvb, pinfo, offset, tree, pc, &ntd, bc, nti); + dissect_nt_trans_param_request(tvb, pinfo, offset, tree, pc, &ntd, bc, nti, si); COUNT_BYTES(pc); } @@ -9197,7 +9139,7 @@ if (dc) { CHECK_BYTE_COUNT(dc); dissect_nt_trans_data_request( - tvb, pinfo, offset, tree, dc, &ntd, nti); + tvb, pinfo, offset, tree, dc, &ntd, nti, si); COUNT_BYTES(dc); } } @@ -9214,16 +9156,14 @@ dissect_nt_trans_data_response(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, int len, nt_trans_data *ntd _U_, - smb_nt_transact_info_t *nti) + smb_nt_transact_info_t *nti, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; guint16 bcp; struct access_mask_info *ami = NULL; tvbuff_t *ioctl_tvb; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if (parent_tree) { @@ -9294,13 +9234,12 @@ static int dissect_nt_trans_param_response(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, - int len, nt_trans_data *ntd _U_, guint16 bc) + int len, nt_trans_data *ntd _U_, guint16 bc, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; guint32 fn_len; const char *fn; - smb_info_t *si; smb_nt_transact_info_t *nti; guint16 fid; int old_offset; @@ -9310,7 +9249,6 @@ guint16 ftype; guint8 isdir; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if ((si->sip != NULL) && (si->sip->extra_info_type == SMB_EI_NTI)) @@ -9351,7 +9289,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE); + fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE, si); offset += 2; /* create action */ @@ -9512,18 +9450,16 @@ } static int -dissect_nt_trans_setup_response(tvbuff_t *tvb, packet_info *pinfo, +dissect_nt_trans_setup_response(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *parent_tree, - int len, nt_trans_data *ntd _U_) + int len, nt_trans_data *ntd _U_, smb_info_t *si) { #if 0 proto_item *item = NULL; proto_tree *tree = NULL; #endif - smb_info_t *si; smb_nt_transact_info_t *nti; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if ((si->sip != NULL) && (si->sip->extra_info_type == SMB_EI_NTI)) @@ -9578,12 +9514,11 @@ } static int -dissect_nt_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_nt_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc, sc; guint32 pc = 0, po = 0, pd = 0, dc = 0, od = 0, dd = 0; guint32 td = 0, tp = 0; - smb_info_t *si; smb_nt_transact_info_t *nti = NULL; static nt_trans_data ntd; guint16 bc; @@ -9592,7 +9527,6 @@ tvbuff_t *pd_tvb = NULL; gboolean save_fragmented; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if ((si->sip != NULL) && (si->sip->extra_info_type == SMB_EI_NTI)) @@ -9664,7 +9598,7 @@ /* setup data */ if (sc) { - dissect_nt_trans_setup_response(tvb, pinfo, offset, tree, sc*2, &ntd); + dissect_nt_trans_setup_response(tvb, pinfo, offset, tree, sc*2, &ntd, si); offset += sc*2; } @@ -9685,12 +9619,12 @@ /* ...and we were told to do reassembly */ if (pc) { r_fd = smb_trans_defragment(tree, pinfo, tvb, - po, pc, pd, td+tp); + po, pc, pd, td+tp, si); } if ((r_fd == NULL) && dc) { r_fd = smb_trans_defragment(tree, pinfo, tvb, - od, dc, dd+tp, td+tp); + od, dc, dd+tp, td+tp, si); } } } @@ -9711,8 +9645,8 @@ if (pd_tvb) { /* we have reassembled data, grab param and data from there */ dissect_nt_trans_param_response(pd_tvb, pinfo, 0, tree, tp, - &ntd, (guint16) tvb_length(pd_tvb)); - dissect_nt_trans_data_response(pd_tvb, pinfo, tp, tree, td, &ntd, nti); + &ntd, (guint16) tvb_length(pd_tvb), si); + dissect_nt_trans_data_response(pd_tvb, pinfo, tp, tree, td, &ntd, nti, si); COUNT_BYTES(bc); /* We are done */ } else { /* we do not have reassembled data, just use what we have in the @@ -9730,7 +9664,7 @@ } if (pc) { CHECK_BYTE_COUNT(pc); - dissect_nt_trans_param_response(tvb, pinfo, offset, tree, pc, &ntd, bc); + dissect_nt_trans_param_response(tvb, pinfo, offset, tree, pc, &ntd, bc, si); COUNT_BYTES(pc); } @@ -9746,7 +9680,7 @@ } if (dc) { CHECK_BYTE_COUNT(dc); - dissect_nt_trans_data_response(tvb, pinfo, offset, tree, dc, &ntd, nti); + dissect_nt_trans_data_response(tvb, pinfo, offset, tree, dc, &ntd, nti, si); COUNT_BYTES(dc); } } @@ -9768,9 +9702,8 @@ }; static int -dissect_open_print_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_open_print_file_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint8 wc; @@ -9810,7 +9743,7 @@ static int -dissect_write_print_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_write_print_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { int cnt; guint8 wc; @@ -9820,7 +9753,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; BYTE_COUNT; @@ -9856,7 +9789,7 @@ }; static int -dissect_get_print_queue_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_get_print_queue_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -9879,12 +9812,11 @@ } static int -dissect_print_queue_element(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *parent_tree, int offset, guint16 *bcp, gboolean *trunc) +dissect_print_queue_element(tvbuff_t *tvb, packet_info *pinfo _U_, + proto_tree *parent_tree, int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; @@ -9936,7 +9868,7 @@ } static int -dissect_get_print_queue_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_get_print_queue_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint16 cnt = 0, len; guint8 wc; @@ -9970,7 +9902,7 @@ /* queue elements */ while(cnt--) { offset = dissect_print_queue_element(tvb, pinfo, tree, offset, - &bc, &trunc); + &bc, &trunc, si); if (trunc) goto endofcommand; } @@ -9982,7 +9914,7 @@ static int -dissect_send_single_block_message_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_send_single_block_message_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { int name_len; guint16 bc; @@ -10043,7 +9975,7 @@ } static int -dissect_send_multi_block_message_start_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_send_multi_block_message_start_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { int name_len; guint16 bc; @@ -10085,7 +10017,7 @@ } static int -dissect_message_group_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_message_group_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint16 bc; guint8 wc; @@ -10104,7 +10036,7 @@ } static int -dissect_send_multi_block_message_text_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_send_multi_block_message_text_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint16 bc; guint8 wc; @@ -10138,7 +10070,7 @@ } static int -dissect_forwarded_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_forwarded_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { int name_len; guint16 bc; @@ -10167,7 +10099,7 @@ } static int -dissect_get_machine_name_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_get_machine_name_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { int name_len; guint16 bc; @@ -10197,12 +10129,11 @@ static int -dissect_nt_create_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_nt_create_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si _U_) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0; guint16 bc; - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint32 create_flags = 0, access_mask = 0, file_attributes = 0; @@ -10316,7 +10247,7 @@ if (cmd != 0xff) { /* there is an andX command */ if (andxoffset < offset) THROW(ReportedBoundsError); - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } return offset; @@ -10324,7 +10255,7 @@ static int -dissect_nt_create_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree) +dissect_nt_create_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si) { guint8 wc, cmd = 0xff; guint16 andxoffset = 0; @@ -10333,9 +10264,6 @@ guint16 ftype; guint8 isdir; smb_fid_info_t *fid_info = NULL; - smb_info_t *si; - - si = (smb_info_t *)pinfo->private_data; WORD_COUNT; @@ -10363,7 +10291,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE); + fid_info = dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE, si); offset += 2; /* create action */ @@ -10476,12 +10404,12 @@ if (cmd != 0xff) { /* there is an andX command */ if (andxoffset < offset) THROW(ReportedBoundsError); - dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE); + dissect_smb_command(tvb, pinfo, andxoffset, smb_tree, cmd, FALSE, si); } /* if there was an error, add a generated filename to the tree */ if (si->nt_status) { - dissect_smb_fid(tvb, pinfo, tree, 0, 0, fid, TRUE, TRUE, TRUE); + dissect_smb_fid(tvb, pinfo, tree, 0, 0, fid, TRUE, TRUE, TRUE, si); } return offset; @@ -10489,7 +10417,7 @@ static int -dissect_nt_cancel_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_nt_cancel_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -10863,17 +10791,15 @@ #define FF2_RESUME 0x0004 static int -dissect_ff2_flags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset) +dissect_ff2_flags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, smb_info_t *si) { guint16 mask; proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; smb_transact2_info_t *t2i; mask = tvb_get_letohs(tvb, offset); - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if ((si->sip != NULL) && (si->sip->extra_info_type == SMB_EI_T2I)) { @@ -10934,22 +10860,19 @@ int dissect_get_dfs_request_data(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, guint16 *bcp) + proto_tree *tree, int offset, guint16 *bcp, gboolean unicode) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; guint16 bc = *bcp; - DISSECTOR_ASSERT(si); - /* referral level */ CHECK_BYTE_COUNT_TRANS(2); proto_tree_add_item(tree, hf_smb_max_referral_level, tvb, offset, 2, ENC_LITTLE_ENDIAN); COUNT_BYTES_TRANS(2); /* file name */ - fn = get_unicode_or_ascii_string(tvb, &offset, si->unicode, &fn_len, FALSE, FALSE, &bc); + fn = get_unicode_or_ascii_string(tvb, &offset, unicode, &fn_len, FALSE, FALSE, &bc); CHECK_STRING_TRANS(fn); proto_tree_add_string(tree, hf_smb_file_name, tvb, offset, fn_len, fn); @@ -10964,16 +10887,14 @@ static int dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *parent_tree, int offset, int subcmd, guint16 bc) + proto_tree *parent_tree, int offset, int subcmd, guint16 bc, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; smb_transact2_info_t *t2i; int fn_len; const char *fn; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if ((si->sip != NULL) && (si->sip->extra_info_type == SMB_EI_T2I)) @@ -11058,7 +10979,7 @@ /* Find First2 flags */ CHECK_BYTE_COUNT_TRANS(2); - offset = dissect_ff2_flags(tvb, pinfo, tree, offset); + offset = dissect_ff2_flags(tvb, pinfo, tree, offset, si); bc -= 2; /* Find First2 information level */ @@ -11114,7 +11035,7 @@ /* Find First2 flags */ CHECK_BYTE_COUNT_TRANS(2); - offset = dissect_ff2_flags(tvb, pinfo, tree, offset); + offset = dissect_ff2_flags(tvb, pinfo, tree, offset, si); bc -= 2; /* file name */ @@ -11224,7 +11145,7 @@ /* fid */ CHECK_BYTE_COUNT_TRANS(2); fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); COUNT_BYTES_TRANS(2); /* level of interest */ @@ -11248,7 +11169,7 @@ /* fid */ CHECK_BYTE_COUNT_TRANS(2); fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); COUNT_BYTES_TRANS(2); /* level of interest */ @@ -11377,7 +11298,7 @@ /* XXX unknown structure*/ break; case 0x0010: /*TRANS2_GET_DFS_REFERRAL*/ - offset = dissect_get_dfs_request_data(tvb, pinfo, tree, offset, &bc); + offset = dissect_get_dfs_request_data(tvb, pinfo, tree, offset, &bc, si->unicode); break; case 0x0011: /*TRANS2_REPORT_DFS_INCONSISTENCY*/ /* file name */ @@ -11478,10 +11399,9 @@ /* dfs inconsistency data (4.4.2) */ static int -dissect_dfs_inconsistency_data(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, guint16 *bcp) +dissect_dfs_inconsistency_data(tvbuff_t *tvb, packet_info *pinfo _U_, + proto_tree *tree, int offset, guint16 *bcp, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; @@ -11730,10 +11650,9 @@ /* get dfs referral data (4.4.1) */ int -dissect_get_dfs_referral_data(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, int offset, guint16 *bcp) +dissect_get_dfs_referral_data(tvbuff_t *tvb, packet_info *pinfo _U_, + proto_tree *tree, int offset, guint16 *bcp, gboolean unicode) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; guint16 numref; guint16 refsize; guint16 refflags; @@ -11743,8 +11662,6 @@ int ucstring_end; int ucstring_len; - DISSECTOR_ASSERT(si); - /* path consumed */ CHECK_BYTE_COUNT_TRANS_SUBR(2); proto_tree_add_item(tree, hf_smb_dfs_path_consumed, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -11825,7 +11742,7 @@ case 1: /* node name */ - fn = get_unicode_or_ascii_string(tvb, &offset, si->unicode, &fn_len, FALSE, FALSE, bcp); + fn = get_unicode_or_ascii_string(tvb, &offset, unicode, &fn_len, FALSE, FALSE, bcp); CHECK_STRING_TRANS_SUBR(fn); proto_tree_add_string(rt, hf_smb_dfs_referral_node, tvb, offset, fn_len, fn); @@ -11834,17 +11751,17 @@ case 2: offset = dissect_dfs_referral_entry_v2(tvb, rt, old_offset_2, offset, - refflags, bcp, si->unicode, &ucstring_end); + refflags, bcp, unicode, &ucstring_end); break; case 3: offset = dissect_dfs_referral_entry_v3(tvb, rt, old_offset_2, offset, - refflags, bcp, si->unicode, &ucstring_end); + refflags, bcp, unicode, &ucstring_end); break; case 4: /* V4 is extactly same as V3, except the version number and * one more ReferralEntryFlags */ offset = dissect_dfs_referral_entry_v3(tvb, rt, old_offset_2, offset, - refflags, bcp, si->unicode, &ucstring_end); + refflags, bcp, unicode, &ucstring_end); break; } @@ -12133,10 +12050,9 @@ as described in 4.2.16.3 */ static int -dissect_4_2_16_3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, guint16 *bcp, gboolean *trunc) +dissect_4_2_16_3(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; @@ -12337,22 +12253,19 @@ rather than the long name */ int -dissect_qfi_SMB_FILE_NAME_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, guint16 *bcp, gboolean *trunc) +dissect_qfi_SMB_FILE_NAME_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, + int offset, guint16 *bcp, gboolean *trunc, gboolean unicode) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; int fn_len; const char *fn; - DISSECTOR_ASSERT(si); - /* file name len */ CHECK_BYTE_COUNT_SUBR(4); proto_tree_add_item(tree, hf_smb_file_name_len, tvb, offset, 4, ENC_LITTLE_ENDIAN); COUNT_BYTES_SUBR(4); /* file name */ - fn = get_unicode_or_ascii_string(tvb, &offset, si->unicode, &fn_len, FALSE, FALSE, bcp); + fn = get_unicode_or_ascii_string(tvb, &offset, unicode, &fn_len, FALSE, FALSE, bcp); CHECK_STRING_SUBR(fn); proto_tree_add_string(tree, hf_smb_file_name, tvb, offset, fn_len, fn); @@ -12368,14 +12281,11 @@ */ static int dissect_qfi_SMB_FILE_ALL_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, guint16 *bcp, gboolean *trunc) + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { - smb_info_t *si; guint32 fn_len; const char *fn; - si = (smb_info_t *)pinfo->private_data; - DISSECTOR_ASSERT(si); offset = dissect_smb_standard_8byte_timestamps(tvb, pinfo, tree, offset, bcp, trunc); @@ -12666,10 +12576,9 @@ /* 4.2.16.13 - SMB_QUERY_FILE_UNIX_LINK */ static int -dissect_4_2_16_13(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, guint16 *bcp, gboolean *trunc) +dissect_4_2_16_13(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; const char *fn; int fn_len = 0; @@ -13103,10 +13012,9 @@ }; static int -dissect_rename_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, guint16 *bcp, gboolean *trunc) +dissect_rename_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; const char *fn; guint32 target_name_len; int fn_len; @@ -13144,10 +13052,9 @@ } static int -dissect_disposition_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, guint16 *bcp, gboolean *trunc) +dissect_disposition_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; #if 0 const char *fn; guint32 target_name_len;*/ @@ -13166,13 +13073,9 @@ } int -dissect_sfi_SMB_FILE_PIPE_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, +dissect_sfi_SMB_FILE_PIPE_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; - - DISSECTOR_ASSERT(si); - /* pipe info flag */ CHECK_BYTE_COUNT_SUBR(1); proto_tree_add_item(tree, hf_smb_pipe_info_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -13186,16 +13089,14 @@ TRANS2_QUERY_FILE_INFORMATION*/ static int dissect_qpi_loi_vals(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, - proto_item *item, int offset, guint16 *bcp) + proto_item *item, int offset, guint16 *bcp, smb_info_t *si) { - smb_info_t *si; gboolean trunc = FALSE; if (!*bcp) { return offset; } - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); switch(si->info_level) { @@ -13215,7 +13116,7 @@ break; case 6: /*Info Is Name Valid*/ offset = dissect_4_2_16_3(tvb, pinfo, tree, offset, bcp, - &trunc); + &trunc, si); break; case 0x0101: /*Query File Basic Info*/ case 1004: /* SMB_FILE_BASIC_INFORMATION */ @@ -13239,7 +13140,7 @@ case 0x0104: /*Query File Name Info*/ case 1009: /* SMB_FILE_NAME_INFORMATION */ offset = dissect_qfi_SMB_FILE_NAME_INFO(tvb, pinfo, tree, offset, bcp, - &trunc); + &trunc, si->unicode); break; case 1014: /* SMB_FILE_POSITION_INFORMATION */ offset = dissect_qsfi_SMB_FILE_POSITION_INFO(tvb, pinfo, tree, offset, bcp, @@ -13256,7 +13157,7 @@ case 0x0107: /*Query File All Info*/ case 1018: /* SMB_FILE_ALL_INFORMATION */ offset = dissect_qfi_SMB_FILE_ALL_INFO(tvb, pinfo, tree, offset, bcp, - &trunc); + &trunc, si); break; case 1019: /* SMB_FILE_ALLOCATION_INFORMATION */ offset = dissect_qsfi_SMB_FILE_ALLOCATION_INFO(tvb, pinfo, tree, offset, bcp, @@ -13269,7 +13170,7 @@ case 0x0108: /*Query File Alt File Info*/ case 1021: /* SMB_FILE_ALTERNATE_NAME_INFORMATION */ offset = dissect_qfi_SMB_FILE_NAME_INFO(tvb, pinfo, tree, offset, bcp, - &trunc); + &trunc, si->unicode); break; case 1022: /* SMB_FILE_STREAM_INFORMATION */ si->unicode = TRUE; @@ -13295,7 +13196,7 @@ break; case 0x0201: /* Query File Unix Link*/ offset = dissect_4_2_16_13(tvb, pinfo, tree, offset, bcp, - &trunc); + &trunc, si); break; case 0x0202: /* Query File Unix HardLink*/ /* XXX add this from the SNIA doc */ @@ -13344,16 +13245,14 @@ TRANS2_SET_FILE_INFORMATION*/ static int dissect_spi_loi_vals(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, - proto_item *item, int offset, guint16 *bcp) + proto_item *item, int offset, guint16 *bcp, smb_info_t *si) { - smb_info_t *si; gboolean trunc; if (!*bcp) { return offset; } - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); switch(si->info_level) { @@ -13394,11 +13293,11 @@ break; case 0x0201: /*Set File Unix Link. Same as query. */ offset = dissect_4_2_16_13(tvb, pinfo, tree, offset, bcp, - &trunc); + &trunc, si); break; case 0x0202: /*Set File Unix HardLink. Same as link query. */ offset = dissect_4_2_16_13(tvb, pinfo, tree, offset, bcp, - &trunc); + &trunc, si); break; case 0x0204: /* Set File Unix ACL*/ offset = dissect_qspi_unix_acl(tvb, pinfo, tree, offset, bcp, @@ -13430,11 +13329,11 @@ break; case 1010: /* Set File Rename */ offset = dissect_rename_info(tvb, pinfo, tree, offset, bcp, - &trunc); + &trunc, si); break; case 1013: /* Set Disposition Information */ offset = dissect_disposition_info(tvb, pinfo, tree, offset, bcp, - &trunc); + &trunc, si); break; case 1014: /* SMB_FILE_POSITION_INFORMATION */ offset = dissect_qsfi_SMB_FILE_POSITION_INFO(tvb, pinfo, tree, offset, bcp, @@ -13563,15 +13462,12 @@ static int dissect_sfsi_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, - int offset, guint16 *bcp) + int offset, guint16 *bcp, smb_info_t *si) { - smb_info_t *si; - if (!*bcp) { return offset; } - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); switch(si->info_level) { @@ -13619,15 +13515,12 @@ static int dissect_sfsi_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, - int offset, guint16 *bcp) + int offset, guint16 *bcp, smb_info_t *si) { - smb_info_t *si; - if (!*bcp) { return offset; } - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); switch(si->info_level) { @@ -13675,13 +13568,11 @@ static int dissect_transaction2_request_data(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *parent_tree, int offset, int subcmd, guint16 dc) + proto_tree *parent_tree, int offset, int subcmd, guint16 dc, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if (parent_tree) { @@ -13707,7 +13598,7 @@ /* no data field in this request */ break; case 0x0004: /* TRANS2_SET_FS_INFORMATION */ - offset = dissect_sfsi_request(tvb, pinfo, tree, offset, &dc); + offset = dissect_sfsi_request(tvb, pinfo, tree, offset, &dc, si); break; case 0x0005: /*TRANS2_QUERY_PATH_INFORMATION*/ /* no data field in this request */ @@ -13723,7 +13614,7 @@ */ break; case 0x0006: /*TRANS2_SET_PATH_INFORMATION*/ - offset = dissect_spi_loi_vals(tvb, pinfo, tree, item, offset, &dc); + offset = dissect_spi_loi_vals(tvb, pinfo, tree, item, offset, &dc, si); break; case 0x0007: /*TRANS2_QUERY_FILE_INFORMATION*/ /* no data field in this request */ @@ -13739,7 +13630,7 @@ */ break; case 0x0008: /*TRANS2_SET_FILE_INFORMATION*/ - offset = dissect_spi_loi_vals(tvb, pinfo, tree, item, offset, &dc); + offset = dissect_spi_loi_vals(tvb, pinfo, tree, item, offset, &dc, si); break; case 0x0009: /*TRANS2_FSCTL*/ /*XXX dont know how to decode this yet */ @@ -13793,7 +13684,7 @@ /* no data field in this request */ break; case 0x0011: /*TRANS2_REPORT_DFS_INCONSISTENCY*/ - offset = dissect_dfs_inconsistency_data(tvb, pinfo, tree, offset, &dc); + offset = dissect_dfs_inconsistency_data(tvb, pinfo, tree, offset, &dc, si); break; } @@ -13858,7 +13749,7 @@ Transaction2 Secondary 0x33 */ static int -dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 wc, sc = 0; int so = offset; @@ -13870,14 +13761,12 @@ guint32 to; int an_len; const char *an = NULL; - smb_info_t *si; smb_transact2_info_t *t2i; smb_transact_info_t *tri; guint16 bc; int padcnt; gboolean dissected_trans; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); WORD_COUNT; @@ -13928,7 +13817,7 @@ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, FALSE, FALSE, FALSE, si); offset += 2; } @@ -14106,7 +13995,7 @@ case SMB_COM_TRANSACTION2: /* TRANSACTION2 parameters*/ offset = dissect_transaction2_request_parameters(tvb, - pinfo, tree, offset, subcmd, pc); + pinfo, tree, offset, subcmd, pc, si); bc -= pc; break; @@ -14135,7 +14024,7 @@ case SMB_COM_TRANSACTION2: /* TRANSACTION2 data*/ offset = dissect_transaction2_request_data(tvb, pinfo, - tree, offset, subcmd, dc); + tree, offset, subcmd, dc, si); bc -= dc; break; @@ -14237,7 +14126,7 @@ dissected_trans = dissect_pipe_smb(sp_tvb, s_tvb, pd_tvb, p_tvb, d_tvb, an+6, pinfo, - top_tree_global); + top_tree_global, si); /* In case we did not see the TreeConnect call, store this TID here as well as a IPC TID @@ -14258,7 +14147,7 @@ */ sp_tvb = tvb_new_subset(tvb, spo, spc, spc); dissected_trans = dissect_mailslot_smb(sp_tvb, - s_tvb, d_tvb, an+10, pinfo, top_tree_global); + s_tvb, d_tvb, an+10, pinfo, top_tree_global, si); } if (!dissected_trans) dissect_trans_data(s_tvb, p_tvb, d_tvb, tree); @@ -14277,19 +14166,17 @@ static int dissect_4_3_4_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, - int offset, guint16 *bcp, gboolean *trunc) + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { int fn_len; const char *fn; int old_offset = offset; proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; smb_transact2_info_t *t2i; gboolean resume_keys = FALSE; guint32 bytes_needed = 0; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if ((si->sip != NULL) && (si->sip->extra_info_type == SMB_EI_T2I)) { @@ -14388,20 +14275,17 @@ static int dissect_4_3_4_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, - int offset, guint16 *bcp, gboolean *trunc) + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { int fn_len; const char *fn; int old_offset = offset; proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; smb_transact2_info_t *t2i; gboolean resume_keys = FALSE; guint32 bytes_needed = 0; - - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if ((si->sip != NULL) && (si->sip->extra_info_type == SMB_EI_T2I)) { @@ -14512,7 +14396,7 @@ */ static int dissect_4_3_4_3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, - int offset, guint16 *bcp, gboolean *trunc) + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { int fn_len; const char *fn; @@ -14520,12 +14404,10 @@ int ea_size = 0; proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; smb_transact2_info_t *t2i; gboolean resume_keys = FALSE; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if ((si->sip != NULL) && (si->sip->extra_info_type == SMB_EI_T2I)) { @@ -14623,18 +14505,16 @@ static int dissect_4_3_4_4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, - int offset, guint16 *bcp, gboolean *trunc) + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { int fn_len; const char *fn; int old_offset = offset; proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; guint32 neo; int padcnt; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); /* @@ -14729,18 +14609,16 @@ static int dissect_4_3_4_5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, - int offset, guint16 *bcp, gboolean *trunc) + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { int fn_len; const char *fn; int old_offset = offset; proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; guint32 neo; int padcnt; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); /* @@ -14841,18 +14719,16 @@ static int dissect_4_3_4_6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, - int offset, guint16 *bcp, gboolean *trunc) + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { int fn_len, sfn_len; const char *fn, *sfn; int old_offset = offset; proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; guint32 neo; int padcnt; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); /* @@ -14979,18 +14855,16 @@ static int dissect_4_3_4_6full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, - int offset, guint16 *bcp, gboolean *trunc) + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { int fn_len; const char *fn; int old_offset = offset; proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; guint32 neo; int padcnt; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); /* @@ -15106,18 +14980,16 @@ static int dissect_4_3_4_6_id_both(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, - int offset, guint16 *bcp, gboolean *trunc) + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { int fn_len, sfn_len; const char *fn, *sfn; int old_offset = offset; proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; guint32 neo; int padcnt; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); /* @@ -15254,18 +15126,16 @@ static int dissect_4_3_4_7(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, - int offset, guint16 *bcp, gboolean *trunc) + int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { int fn_len; const char *fn; int old_offset = offset; proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; guint32 neo; int padcnt; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); /* @@ -15343,9 +15213,8 @@ static int dissect_4_3_4_8(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, - gboolean *trunc) + gboolean *trunc, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; const char *fn; int fn_len; int pad; @@ -15391,9 +15260,8 @@ static int dissect_find_file_unix_info2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, - gboolean *trunc) + gboolean *trunc, smb_info_t *si) { - smb_info_t *si = (smb_info_t *)pinfo->private_data; const char *fn; guint32 namelen; int fn_len; @@ -15453,64 +15321,61 @@ /*dissect the data block for TRANS2_FIND_FIRST2*/ static int dissect_ff2_response_data(tvbuff_t * tvb, packet_info * pinfo, - proto_tree * tree, int offset, guint16 *bcp, gboolean *trunc) + proto_tree * tree, int offset, guint16 *bcp, gboolean *trunc, smb_info_t *si) { - smb_info_t *si; - if (!*bcp) { return offset; } - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); switch(si->info_level) { case 1: /*Info Standard*/ offset = dissect_4_3_4_1(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; case 2: /*Info Query EA Size*/ offset = dissect_4_3_4_2(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; case 3: /* Info Query EAs From List same as * InfoQueryEASize. * Not according to MS-CIFS 2.2.8.1.3. RJS */ offset = dissect_4_3_4_3(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; case 0x0101: /*Find File Directory Info*/ offset = dissect_4_3_4_4(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; case 0x0102: /*Find File Full Directory Info*/ offset = dissect_4_3_4_5(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; case 0x0103: /*Find File Names Info*/ offset = dissect_4_3_4_7(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; case 0x0104: /*Find File Both Directory Info*/ offset = dissect_4_3_4_6(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; case 0x0105: /*Find File Full Directory Info*/ offset = dissect_4_3_4_6full(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; case 0x0106: /*Find File Id Both Directory Info*/ offset = dissect_4_3_4_6_id_both(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; case 0x0202: /*Find File Unix*/ offset = dissect_4_3_4_8(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; case 0x020B: /*Find File Unix Info2*/ offset = dissect_find_file_unix_info2(tvb, pinfo, tree, offset, bcp, - trunc); + trunc, si); break; default: /* unknown info level */ *trunc = FALSE; @@ -15805,9 +15670,8 @@ static int dissect_qfsi_vals(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, - int offset, guint16 *bcp) + int offset, guint16 *bcp, smb_info_t *si) { - smb_info_t *si; int fn_len, vll; const char *fn; guint support = 0; @@ -15818,7 +15682,6 @@ return offset; } - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); switch(si->info_level) { @@ -16027,11 +15890,10 @@ static int dissect_transaction2_response_data(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *parent_tree) + proto_tree *parent_tree, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; smb_transact2_info_t *t2i; int count; gboolean trunc; @@ -16040,7 +15902,6 @@ dc = tvb_reported_length(tvb); - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if ((si->sip != NULL) && (si->sip->extra_info_type == SMB_EI_T2I)) @@ -16084,7 +15945,7 @@ while(count--) { offset = dissect_ff2_response_data(tvb, pinfo, tree, - offset, &dc, &trunc); + offset, &dc, &trunc, si); if (trunc) break; } @@ -16103,26 +15964,26 @@ while(count--) { offset = dissect_ff2_response_data(tvb, pinfo, tree, - offset, &dc, &trunc); + offset, &dc, &trunc, si); if (trunc) break; } break; case 0x0003: /*TRANS2_QUERY_FS_INFORMATION*/ - offset = dissect_qfsi_vals(tvb, pinfo, tree, offset, &dc); + offset = dissect_qfsi_vals(tvb, pinfo, tree, offset, &dc, si); break; case 0x0004: /*TRANS2_SET_FS_INFORMATION*/ - offset = dissect_sfsi_response(tvb, pinfo, tree, offset, &dc); + offset = dissect_sfsi_response(tvb, pinfo, tree, offset, &dc, si); break; case 0x0005: /*TRANS2_QUERY_PATH_INFORMATION*/ - offset = dissect_qpi_loi_vals(tvb, pinfo, tree, item, offset, &dc); + offset = dissect_qpi_loi_vals(tvb, pinfo, tree, item, offset, &dc, si); break; case 0x0006: /*TRANS2_SET_PATH_INFORMATION*/ /* no data in this response */ break; case 0x0007: /*TRANS2_QUERY_FILE_INFORMATION*/ /* identical to QUERY_PATH_INFO */ - offset = dissect_qpi_loi_vals(tvb, pinfo, tree, item, offset, &dc); + offset = dissect_qpi_loi_vals(tvb, pinfo, tree, item, offset, &dc, si); break; case 0x0008: /*TRANS2_SET_FILE_INFORMATION*/ /* no data in this response */ @@ -16180,7 +16041,7 @@ /* XXX dont know how to dissect this one (yet)*/ break; case 0x0010: /*TRANS2_GET_DFS_REFERRAL*/ - offset = dissect_get_dfs_referral_data(tvb, pinfo, tree, offset, &dc); + offset = dissect_get_dfs_referral_data(tvb, pinfo, tree, offset, &dc, si->unicode); break; case 0x0011: /*TRANS2_REPORT_DFS_INCONSISTENCY*/ /* the SNIA spec appears to say the response has no data */ @@ -16206,11 +16067,10 @@ static int -dissect_transaction2_response_parameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +dissect_transaction2_response_parameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, smb_info_t *si) { proto_item *item = NULL; proto_tree *tree = NULL; - smb_info_t *si; smb_transact2_info_t *t2i; guint16 fid; int lno; @@ -16219,7 +16079,6 @@ pc = tvb_reported_length(tvb); - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if ((si->sip != NULL) && (si->sip->extra_info_type == SMB_EI_T2I)) @@ -16248,7 +16107,7 @@ case 0x00: /*TRANS2_OPEN2*/ /* fid */ fid = tvb_get_letohs(tvb, offset); - dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE); + dissect_smb_fid(tvb, pinfo, tree, offset, 2, fid, TRUE, FALSE, FALSE, si); offset += 2; /* @@ -16467,11 +16326,10 @@ static int -dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { guint8 sc, wc; guint16 od = 0, po = 0, pc = 0, pd = 0, dc = 0, dd = 0, td = 0, tp = 0; - smb_info_t *si; smb_transact2_info_t *t2i = NULL; guint16 bc; int padcnt; @@ -16482,7 +16340,6 @@ gboolean save_fragmented; proto_item *item; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); switch(si->cmd) { @@ -16668,12 +16525,12 @@ /* ...and we were told to do reassembly */ if (pc) { r_fd = smb_trans_defragment(tree, pinfo, tvb, - po, pc, pd, td+tp); + po, pc, pd, td+tp, si); } if ((r_fd == NULL) && dc) { r_fd = smb_trans_defragment(tree, pinfo, tvb, - od, dc, dd+tp, td+tp); + od, dc, dd+tp, td+tp, si); } } } @@ -16742,7 +16599,7 @@ } if ((si->cmd == SMB_COM_TRANSACTION2) && p_tvb) { /* TRANSACTION2 parameters*/ - dissect_transaction2_response_parameters(p_tvb, pinfo, tree); + dissect_transaction2_response_parameters(p_tvb, pinfo, tree, si); } COUNT_BYTES(pc); @@ -16776,7 +16633,7 @@ if ((si->cmd == SMB_COM_TRANSACTION2) && d_tvb) { /* TRANSACTION2 parameters*/ - dissect_transaction2_response_data(d_tvb, pinfo, tree); + dissect_transaction2_response_data(d_tvb, pinfo, tree, si); } @@ -16801,7 +16658,7 @@ if ( pd_tvb) { dissected_trans = dissect_pipe_smb( sp_tvb, s_tvb, pd_tvb, p_tvb, - d_tvb, NULL, pinfo, top_tree_global); + d_tvb, NULL, pinfo, top_tree_global, si); } break; @@ -16812,7 +16669,7 @@ if (d_tvb) { dissected_trans = dissect_mailslot_smb( sp_tvb, s_tvb, d_tvb, NULL, pinfo, - top_tree_global); + top_tree_global, si); } break; } @@ -16837,7 +16694,7 @@ static int -dissect_find_notify_close(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_find_notify_close(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -16861,7 +16718,7 @@ static int -dissect_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_) +dissect_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si _U_) { guint8 wc; guint16 bc; @@ -16889,8 +16746,8 @@ } typedef struct _smb_function { - int (*request)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree); - int (*response)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree); + int (*request)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si); + int (*response)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si); } smb_function; static smb_function smb_dissector[256] = { @@ -17168,18 +17025,16 @@ }; static int -dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *smb_tree, guint8 cmd, gboolean first_pdu) +dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *smb_tree, guint8 cmd, gboolean first_pdu, smb_info_t *si) { - smb_info_t *si; smb_saved_info_t *sip; - si = (smb_info_t *)pinfo->private_data; DISSECTOR_ASSERT(si); if (cmd!=0xff) { proto_item *cmd_item; proto_tree *cmd_tree; - int (*dissector)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree); + int (*dissector)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si); if (first_pdu) { col_append_fstr(pinfo->cinfo, COL_INFO, @@ -17208,14 +17063,14 @@ if (sip && sip->fid) { if ( (si->request && (!sip->fid_seen_in_request)) || ((!si->request) && sip->fid_seen_in_request) ) { - dissect_smb_fid(tvb, pinfo, cmd_tree, offset, 0, sip->fid, FALSE, FALSE, TRUE); + dissect_smb_fid(tvb, pinfo, cmd_tree, offset, 0, sip->fid, FALSE, FALSE, TRUE, si); } } dissector = (si->request)? smb_dissector[cmd].request:smb_dissector[cmd].response; - offset = (*dissector)(tvb, pinfo, cmd_tree, offset, smb_tree); + offset = (*dissector)(tvb, pinfo, cmd_tree, offset, smb_tree, si); if (!tvb_offset_exists(tvb, offset-1)) { THROW(ReportedBoundsError); @@ -18137,17 +17992,15 @@ offset += 2; } - pinfo->private_data = si; - /* TID * TreeConnectAndX(0x75) is special, here it is the mere fact of * having a response that means that the share was mapped and we * need to track it */ if (!pinfo->fd->flags.visited && (si->cmd == 0x75) && !si->request) { - offset = dissect_smb_tid(tvb, pinfo, htree, offset, (guint16)si->tid, TRUE, FALSE); + offset = dissect_smb_tid(tvb, pinfo, htree, offset, (guint16)si->tid, TRUE, FALSE, si); } else { - offset = dissect_smb_tid(tvb, pinfo, htree, offset, (guint16)si->tid, FALSE, FALSE); + offset = dissect_smb_tid(tvb, pinfo, htree, offset, (guint16)si->tid, FALSE, FALSE, si); } /* PID */ @@ -18165,7 +18018,7 @@ the tap listener called even if there is an exception. */ tap_queue_packet(smb_tap, pinfo, si); - dissect_smb_command(tvb, pinfo, offset, tree, si->cmd, TRUE); + dissect_smb_command(tvb, pinfo, offset, tree, si->cmd, TRUE, si); /* Append error info from this packet to info string. */ if (!si->request) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-smb.h wireshark-1.12.0~201311020920/epan/dissectors/packet-smb.h --- wireshark-1.12.0~201310251247/epan/dissectors/packet-smb.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-smb.h 2013-11-02 02:12:36.000000000 +0000 @@ -384,7 +384,7 @@ * Dissect an smb FID */ extern smb_fid_info_t *dissect_smb_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - int offset, int len, guint16 fid, gboolean is_created, gboolean is_closed, gboolean is_generated); + int offset, int len, guint16 fid, gboolean is_created, gboolean is_closed, gboolean is_generated, smb_info_t* si); /* * Dissect named pipe state information. @@ -420,7 +420,7 @@ extern int dissect_qfsi_FS_FULL_SIZE_INFO(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int offset, guint16 *bcp); extern int dissect_qfi_SMB_FILE_EA_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc); extern int dissect_qfi_SMB_FILE_STREAM_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, guint16 *bcp, gboolean *trunc, int unicode); -extern int dissect_qfi_SMB_FILE_NAME_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc); +extern int dissect_qfi_SMB_FILE_NAME_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc, gboolean unicode); extern int dissect_qfi_SMB_FILE_STANDARD_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc); extern int dissect_qfi_SMB_FILE_INTERNAL_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc); extern int dissect_qsfi_SMB_FILE_POSITION_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc); @@ -433,8 +433,8 @@ extern int dissect_qsfi_SMB_FILE_ENDOFFILE_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc); extern int dissect_nt_notify_completion_filter(tvbuff_t *tvb, proto_tree *parent_tree, int offset); extern int dissect_sfi_SMB_FILE_PIPE_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc); -extern int dissect_get_dfs_request_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp); -extern int dissect_get_dfs_referral_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp); +extern int dissect_get_dfs_request_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean unicode); +extern int dissect_get_dfs_referral_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean unicode); /* Returns an IP (v4 or v6) of the server in a SMB/SMB2 conversation */ extern const gchar *tree_ip_str(packet_info *pinfo, guint16 cmd); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-smb2.c wireshark-1.12.0~201311020920/epan/dissectors/packet-smb2.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-smb2.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-smb2.c 2013-11-02 02:12:36.000000000 +0000 @@ -1605,7 +1605,7 @@ } bc = tvb_length_remaining(tvb, offset); - offset = dissect_qfi_SMB_FILE_NAME_INFO(tvb, pinfo, tree, offset, &bc, &trunc); + offset = dissect_qfi_SMB_FILE_NAME_INFO(tvb, pinfo, tree, offset, &bc, &trunc, /* XXX assumption hack */ TRUE); return offset; } @@ -4631,21 +4631,15 @@ dissect_smb2_ioctl_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *top_tree, guint32 ioctl_function, gboolean data_in) { guint16 dc; - smb_info_t tmp; - void *saved_private_data; - - saved_private_data = pinfo->private_data; - pinfo->private_data = &tmp; - tmp.unicode = TRUE; dc = tvb_reported_length(tvb); switch (ioctl_function) { case 0x00060194: /* FSCTL_DFS_GET_REFERRALS */ if (data_in) { - dissect_get_dfs_request_data(tvb, pinfo, tree, 0, &dc); + dissect_get_dfs_request_data(tvb, pinfo, tree, 0, &dc, TRUE); } else { - dissect_get_dfs_referral_data(tvb, pinfo, tree, 0, &dc); + dissect_get_dfs_referral_data(tvb, pinfo, tree, 0, &dc, TRUE); } break; case 0x0011c017: @@ -4685,8 +4679,6 @@ default: proto_tree_add_item(tree, hf_smb2_unknown, tvb, 0, tvb_length(tvb), ENC_NA); } - - pinfo->private_data = saved_private_data; } static void @@ -7059,10 +7051,10 @@ enc_item = proto_tree_add_text(tree, enc_tvb, 0, sti->size, "Encrypted SMB3 data"); enc_tree = proto_item_add_subtree(enc_item, ett_smb2_encrypted); if (plain_tvb != NULL) { - col_append_fstr(pinfo->cinfo, COL_INFO, "Decrypted SMB3"); + col_append_str(pinfo->cinfo, COL_INFO, "Decrypted SMB3"); dissect_smb2(plain_tvb, pinfo, enc_tree, FALSE); } else { - col_append_fstr(pinfo->cinfo, COL_INFO, "Encrypted SMB3"); + col_append_str(pinfo->cinfo, COL_INFO, "Encrypted SMB3"); proto_tree_add_item(enc_tree, hf_smb2_transform_encrypted_data, enc_tvb, 0, sti->size, ENC_NA); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-sml.c wireshark-1.12.0~201311020920/epan/dissectors/packet-sml.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-sml.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-sml.c 2013-11-02 02:12:36.000000000 +0000 @@ -2610,7 +2610,7 @@ return; } - col_add_str(pinfo->cinfo, COL_PROTOCOL, "SML"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "SML"); col_clear(pinfo->cinfo,COL_INFO); /* create display subtree for the protocol */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-smpp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-smpp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-smpp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-smpp.c 2013-11-02 02:12:36.000000000 +0000 @@ -2500,7 +2500,6 @@ /* * First PDU - We already computed the fixed header */ - col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "SMPP %s", command_str); first = FALSE; } else { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-snmp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-snmp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-snmp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-snmp.c 2013-11-02 02:12:36.000000000 +0000 @@ -1581,7 +1581,7 @@ msg[i] = '\0'; } - calc_auth = (guint8*)ep_alloc(16); + calc_auth = (guint8*)wmem_alloc(wmem_packet_scope(), 16); md5_hmac(msg, msg_len, key, key_len, calc_auth); @@ -1645,7 +1645,7 @@ msg[i] = '\0'; } - calc_auth = (guint8*)ep_alloc(20); + calc_auth = (guint8*)wmem_alloc(wmem_packet_scope(), 20); sha1_hmac(key, key_len, msg, msg_len, calc_auth); @@ -3445,7 +3445,7 @@ snmp_users_update_cb(void* p _U_, const char** err) { snmp_ue_assoc_t* ue = (snmp_ue_assoc_t*)p; - emem_strbuf_t* es = ep_strbuf_new(""); + GString* es = g_string_new(""); unsigned int i; *err = NULL; @@ -3455,14 +3455,14 @@ return; if (! ue->user.userName.len) - ep_strbuf_append_printf(es,"no userName\n"); + g_string_append_printf(es,"no userName\n"); for (i=0; iengine.len > 0) && (u->engine.len < 5 || u->engine.len > 32)) { - ep_strbuf_append_printf(es, "Invalid engineId length (%u). Must be between 5 and 32 (10 and 64 hex digits)\n", u->engine.len); + g_string_append_printf(es, "Invalid engineId length (%u). Must be between 5 and 32 (10 and 64 hex digits)\n", u->engine.len); } @@ -3472,21 +3472,21 @@ if (u->engine.len > 0 && memcmp( u->engine.data, ue->engine.data, u->engine.len ) == 0) { if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) { /* XXX: make a string for the engineId */ - ep_strbuf_append_printf(es,"Duplicate key (userName='%s')\n",ue->user.userName.data); + g_string_append_printf(es,"Duplicate key (userName='%s')\n",ue->user.userName.data); } } if (u->engine.len == 0) { if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) { - ep_strbuf_append_printf(es,"Duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data); + g_string_append_printf(es,"Duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data); } } } } if (es->len) { - es = ep_strbuf_truncate(es,es->len-1); - *err = ep_strdup(es->str); + es = g_string_truncate(es,es->len-1); + *err = g_string_free(es, FALSE); } return; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-socks.c wireshark-1.12.0~201311020920/epan/dissectors/packet-socks.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-socks.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-socks.c 2013-11-02 02:12:36.000000000 +0000 @@ -929,7 +929,7 @@ static void call_next_dissector(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, proto_tree *socks_tree, - socks_hash_entry_t *hash_info, sock_state_t* state_info) + socks_hash_entry_t *hash_info, sock_state_t* state_info, struct tcpinfo *tcpinfo) { /* Display the results for PING and TRACERT extensions or */ @@ -940,7 +940,6 @@ /* the payload, and restore the pinfo port after that is done. */ guint32 *ptr; - struct tcpinfo *tcpinfo = (struct tcpinfo *)pinfo->private_data; guint16 save_can_desegment; struct tcp_analysis *tcpd=NULL; @@ -971,7 +970,7 @@ pinfo->can_desegment = pinfo->saved_can_desegment; dissect_tcp_payload(tvb, pinfo, offset, tcpinfo->seq, tcpinfo->nxtseq, pinfo->srcport, pinfo->destport, - tree, socks_tree, tcpd); + tree, socks_tree, tcpd, tcpinfo); pinfo->can_desegment = save_can_desegment; CLEANUP_CALL_AND_POP; @@ -983,7 +982,7 @@ static int -dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { +dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { int offset = 0; proto_tree *socks_tree = NULL; @@ -992,6 +991,7 @@ conversation_t *conversation; sock_state_t* state_info; guint8 version; + struct tcpinfo *tcpinfo = (struct tcpinfo*)data; state_info = (sock_state_t *)p_get_proto_data(pinfo->fd, proto_socks, 0); if (state_info == NULL) { @@ -1139,7 +1139,7 @@ /* call next dissector if ready */ if ( pinfo->fd->num > hash_info->start_done_frame){ call_next_dissector(tvb, offset, pinfo, tree, socks_tree, - hash_info, state_info); + hash_info, state_info, tcpinfo); } return tvb_reported_length(tvb); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-soupbintcp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-soupbintcp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-soupbintcp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-soupbintcp.c 2013-11-02 02:12:36.000000000 +0000 @@ -203,7 +203,6 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SoupBinTCP"); /* Set the packet name in the info column */ - col_clear(pinfo->cinfo, COL_INFO); col_add_str(pinfo->cinfo, COL_INFO, pkt_name); /* Sequence number tracking @@ -411,14 +410,9 @@ /* If this packet is part of a conversation, call dissector * for the conversation if available */ - if (try_conversation_dissector(&pinfo->dst, - &pinfo->src, - pinfo->ptype, - pinfo->srcport, - pinfo->destport, - sub_tvb, - pinfo, - tree)) { + if (try_conversation_dissector(&pinfo->dst, &pinfo->src, pinfo->ptype, + pinfo->srcport, pinfo->destport, + sub_tvb, pinfo, tree, NULL)) { return; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-sprt.c wireshark-1.12.0~201311020920/epan/dissectors/packet-sprt.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-sprt.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-sprt.c 2013-11-02 02:12:36.000000000 +0000 @@ -1337,7 +1337,7 @@ } } else { proto_tree_add_item(sprt_tree, hf_sprt_payload_no_data, tvb, offset, 0, ENC_NA); - col_append_fstr(pinfo->cinfo, COL_INFO, ", No Payload"); + col_append_str(pinfo->cinfo, COL_INFO, ", No Payload"); } return offset; @@ -1472,7 +1472,7 @@ dissect_sprt_data(tvb, pinfo, p_conv_data, sprt_tree, offset, payload_length); if (noa) - col_append_fstr(pinfo->cinfo, COL_INFO, " (ACK fields present)"); + col_append_str(pinfo->cinfo, COL_INFO, " (ACK fields present)"); return tvb_length(tvb); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ssl-utils.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ssl-utils.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ssl-utils.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ssl-utils.c 2013-11-02 02:12:36.000000000 +0000 @@ -2242,7 +2242,7 @@ } if (ciph == 0) { ssl_debug_printf("ssl_create_decoder can't find cipher %s\n", - ciphers[cipher_suite->enc > ENC_NULL ? ENC_NULL : (cipher_suite->enc-0x30)]); + ciphers[cipher_suite->enc > ENC_NULL ? ENC_NULL-0x30 : (cipher_suite->enc-0x30)]); return NULL; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ssl.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ssl.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ssl.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ssl.c 2013-11-02 02:12:36.000000000 +0000 @@ -5249,14 +5249,6 @@ g_free(h->password); } -static void -ssldecrypt_update_cb(void *r _U_, const char **err) -{ - if (err) - *err = NULL; - return; -} - static void* ssldecrypt_copy_cb(void *dest, const void *orig, size_t len _U_) { @@ -6085,7 +6077,7 @@ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */ NULL, /* Help section (currently a wiki page) */ ssldecrypt_copy_cb, - ssldecrypt_update_cb, + NULL, ssldecrypt_free_cb, ssl_parse_uat, sslkeylist_uats_flds); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-stun.c wireshark-1.12.0~201311020920/epan/dissectors/packet-stun.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-stun.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-stun.c 2013-11-02 02:12:36.000000000 +0000 @@ -828,7 +828,7 @@ case NONCE: proto_tree_add_item(att_tree, stun_att_nonce, tvb, offset, att_length, ENC_ASCII|ENC_NA); proto_item_append_text(att_tree, ": %s", tvb_get_string(wmem_packet_scope(), tvb, offset, att_length)); - col_append_fstr( + col_append_str( pinfo->cinfo, COL_INFO, " with nonce" ); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-synphasor.c wireshark-1.12.0~201311020920/epan/dissectors/packet-synphasor.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-synphasor.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-synphasor.c 2013-11-02 02:12:36.000000000 +0000 @@ -518,7 +518,6 @@ frame_type = tvb_get_guint8(tvb, 1) >> 4; - col_clear(pinfo->cinfo, COL_INFO); /* clear out stuff in the info column */ col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(frame_type, typenames, "invalid packet type")); /* CFG-2 and DATA frames need special treatment during the first run: diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-t30.c wireshark-1.12.0~201311020920/epan/dissectors/packet-t30.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-t30.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-t30.c 2013-11-02 02:12:36.000000000 +0000 @@ -505,7 +505,7 @@ } static void -dissect_t30_numbers(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree) +dissect_t30_numbers(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, t38_packet_info* t38) { gchar *str_num=NULL; @@ -516,8 +516,8 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " - Number:%s", str_num ); - if (pinfo->private_data) - g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "Num: %s", str_num); + if (t38) + g_snprintf(t38->desc, MAX_T38_DESC, "Num: %s", str_num); } else { proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), @@ -528,7 +528,7 @@ } static void -dissect_t30_facsimile_coded_data(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree) +dissect_t30_facsimile_coded_data(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, t38_packet_info* t38) { guint8 octet; @@ -545,8 +545,8 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " - Frame num:%d", reverse_byte(octet)); - if (pinfo->private_data) - g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "Frm num: %d", reverse_byte(octet)); + if (t38) + g_snprintf(t38->desc, MAX_T38_DESC, "Frm num: %d", reverse_byte(octet)); proto_tree_add_item(tree, hf_t30_t4_data, tvb, offset, len-1, ENC_NA); } @@ -569,7 +569,7 @@ } static void -dissect_t30_partial_page_signal(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree) +dissect_t30_partial_page_signal(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, t38_packet_info* t38) { guint8 octet, page_count, block_count, frame_count; @@ -600,8 +600,8 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " - PC:%d BC:%d FC:%d", page_count, block_count, frame_count); - if (pinfo->private_data) - g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, + if (t38) + g_snprintf(t38->desc, MAX_T38_DESC, "PC:%d BC:%d FC:%d", page_count, block_count, frame_count); } @@ -648,7 +648,7 @@ } static void -dissect_t30_dis_dtc(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, gboolean dis_dtc) +dissect_t30_dis_dtc(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, gboolean dis_dtc, t38_packet_info* t38) { guint8 octet; @@ -680,8 +680,8 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s", val_to_str_const((octet&0x3C) >> 2, t30_data_signalling_rate_vals, "")); - if (pinfo->private_data) - g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, + if (t38) + g_snprintf(t38->desc, MAX_T38_DESC, "DSR:%s", val_to_str_const((octet&0x3C) >> 2, t30_data_signalling_rate_vals, "")); } @@ -691,8 +691,8 @@ col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s", val_to_str_const((octet&0x3C) >> 2, t30_data_signalling_rate_dcs_vals, "")); - if (pinfo->private_data) - g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, + if (t38) + g_snprintf(t38->desc, MAX_T38_DESC, "DSR:%s", val_to_str_const((octet&0x3C) >> 2, t30_data_signalling_rate_dcs_vals, "")); } @@ -916,7 +916,7 @@ } static int -dissect_t30_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_t30_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { int offset = 0; proto_item *it; @@ -926,6 +926,7 @@ guint8 octet; guint32 frag_len; proto_item *item; + t38_packet_info* t38 = (t38_packet_info*)data; if (tvb_reported_length_remaining(tvb, offset) < 3) { proto_tree_add_expert_format(tree, pinfo, &ei_t30_bad_length, tvb, @@ -959,8 +960,8 @@ tr_fif = proto_item_add_subtree(it_fcf, ett_t30_fif); frag_len = tvb_length_remaining(tvb, offset); - if (pinfo->private_data) - ((t38_packet_info*)pinfo->private_data)->t30_Facsimile_Control = octet; + if (t38) + t38->t30_Facsimile_Control = octet; col_append_fstr(pinfo->cinfo, COL_INFO, " %s - %s", @@ -974,10 +975,10 @@ switch (octet & 0x7F) { case T30_FC_DIS: case T30_FC_DTC: - dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, TRUE); + dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, TRUE, t38); break; case T30_FC_DCS: - dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, FALSE); + dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, FALSE, t38); break; case T30_FC_CSI: case T30_FC_CIG: @@ -987,7 +988,7 @@ case T30_FC_SUB: case T30_FC_SID: case T30_FC_PSA: - dissect_t30_numbers(tvb, offset, pinfo, frag_len, tr_fif); + dissect_t30_numbers(tvb, offset, pinfo, frag_len, tr_fif, t38); break; case T30_FC_NSF: case T30_FC_NSC: @@ -995,10 +996,10 @@ dissect_t30_non_standard_cap(tvb, offset, pinfo, frag_len, tr_fif); break; case T30_FC_FCD: - dissect_t30_facsimile_coded_data(tvb, offset, pinfo, frag_len, tr_fif); + dissect_t30_facsimile_coded_data(tvb, offset, pinfo, frag_len, tr_fif, t38); break; case T30_FC_PPS: - dissect_t30_partial_page_signal(tvb, offset, pinfo, frag_len, tr_fif); + dissect_t30_partial_page_signal(tvb, offset, pinfo, frag_len, tr_fif, t38); break; case T30_FC_PPR: dissect_t30_partial_page_request(tvb, offset, pinfo, frag_len, tr_fif); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-t38.c wireshark-1.12.0~201311020920/epan/dissectors/packet-t38.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-t38.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-t38.c 2013-11-02 02:12:36.000000000 +0000 @@ -643,9 +643,8 @@ /* Now reset fragmentation information in pinfo */ actx->pinfo->fragmented = save_fragmented; - actx->pinfo->private_data = t38_info; - if (new_tvb) call_dissector((t30_hdlc_handle) ? t30_hdlc_handle : data_handle, new_tvb, actx->pinfo, tree); + if (new_tvb) call_dissector_with_data((t30_hdlc_handle) ? t30_hdlc_handle : data_handle, new_tvb, actx->pinfo, tree, t38_info); } } else { if(tree){ @@ -674,7 +673,7 @@ static int dissect_t38_T_field_data(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 156 "../../asn1/t38/t38.cnf" +#line 155 "../../asn1/t38/t38.cnf" tvbuff_t *value_tvb = NULL; guint32 value_len; @@ -685,7 +684,7 @@ -#line 163 "../../asn1/t38/t38.cnf" +#line 162 "../../asn1/t38/t38.cnf" if (primary_part){ if(value_len < 8){ col_append_fstr(actx->pinfo->cinfo, COL_INFO, "[%s]", @@ -813,7 +812,7 @@ offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, &seq_number, FALSE); -#line 243 "../../asn1/t38/t38.cnf" +#line 242 "../../asn1/t38/t38.cnf" /* info for tap */ if (primary_part) t38_info->seq_num = seq_number; @@ -827,12 +826,12 @@ static int dissect_t38_T_primary_ifp_packet(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 251 "../../asn1/t38/t38.cnf" +#line 250 "../../asn1/t38/t38.cnf" primary_part = TRUE; offset = dissect_per_open_type(tvb, offset, actx, tree, hf_index, dissect_t38_IFPPacket); -#line 253 "../../asn1/t38/t38.cnf" +#line 252 "../../asn1/t38/t38.cnf" /* if is a valid t38 packet, add to tap */ if (p_t38_packet_conv && (!actx->pinfo->flags.in_error_pkt) && ((gint32) seq_number != p_t38_packet_conv_info->last_seqnum)) tap_queue_packet(t38_tap, actx->pinfo, t38_info); @@ -926,14 +925,14 @@ static int dissect_t38_T_error_recovery(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 261 "../../asn1/t38/t38.cnf" +#line 260 "../../asn1/t38/t38.cnf" primary_part = FALSE; offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_t38_T_error_recovery, T_error_recovery_choice, NULL); -#line 263 "../../asn1/t38/t38.cnf" +#line 262 "../../asn1/t38/t38.cnf" primary_part = TRUE; return offset; @@ -949,7 +948,7 @@ static int dissect_t38_UDPTLPacket(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 237 "../../asn1/t38/t38.cnf" +#line 236 "../../asn1/t38/t38.cnf" /* Initialize to something else than data type */ Data_Field_field_type_value = 1; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-tcap.c wireshark-1.12.0~201311020920/epan/dissectors/packet-tcap.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-tcap.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-tcap.c 2013-11-02 02:12:36.000000000 +0000 @@ -1497,7 +1497,7 @@ tcapext_oid = NULL; raz_tcap_private(&tcap_private); - pinfo->private_data = &tcap_private; + asn1_ctx.value_ptr = &tcap_private; gp_tcapsrt_info=tcapsrt_razinfo(); tcap_subdissector_used=FALSE; gp_tcap_context=NULL; @@ -2236,7 +2236,7 @@ /* Call the sub dissector if present, and not already called */ if (is_subdissector) - call_dissector(subdissector_handle, tvb, actx->pinfo, tree); + call_dissector_with_data(subdissector_handle, tvb, actx->pinfo, tree, actx->value_ptr); return offset; } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-tcp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-tcp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-tcp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-tcp.c 2013-11-02 02:12:36.000000000 +0000 @@ -480,7 +480,7 @@ process_tcp_payload(tvbuff_t *tvb, volatile int offset, packet_info *pinfo, proto_tree *tree, proto_tree *tcp_tree, int src_port, int dst_port, guint32 seq, guint32 nxtseq, gboolean is_tcp_segment, - struct tcp_analysis *tcpd); + struct tcp_analysis *tcpd, struct tcpinfo *tcpinfo); struct tcp_analysis * @@ -1616,9 +1616,8 @@ guint32 seq, guint32 nxtseq, guint32 sport, guint32 dport, proto_tree *tree, proto_tree *tcp_tree, - struct tcp_analysis *tcpd) + struct tcp_analysis *tcpd, struct tcpinfo *tcpinfo) { - struct tcpinfo *tcpinfo = (struct tcpinfo *)pinfo->private_data; fragment_head *ipfd_head; int last_fragment_len; gboolean must_desegment; @@ -1749,7 +1748,7 @@ tcpinfo->seq = seq; process_tcp_payload(tvb, offset, pinfo, tree, tcp_tree, - sport, dport, 0, 0, FALSE, tcpd); + sport, dport, 0, 0, FALSE, tcpd, tcpinfo); called_dissector = TRUE; /* Did the subdissector ask us to desegment some more data @@ -1813,7 +1812,7 @@ /* call subdissector */ process_tcp_payload(next_tvb, 0, pinfo, tree, tcp_tree, sport, - dport, 0, 0, FALSE, tcpd); + dport, 0, 0, FALSE, tcpd, tcpinfo); called_dissector = TRUE; /* @@ -2291,12 +2290,12 @@ /* Fast Open Cookie Request */ proto_tree_add_item(exp_tree, hf_tcp_option_fast_open_cookie_request, tvb, offset + 2, 2, ENC_BIG_ENDIAN); - col_append_fstr(pinfo->cinfo, COL_INFO, " TFO=R"); + col_append_str(pinfo->cinfo, COL_INFO, " TFO=R"); } else if ((optlen - 2) > 2) { /* Fast Open Cookie */ proto_tree_add_item(exp_tree, hf_tcp_option_fast_open_cookie, tvb, offset + 4, optlen - 4, ENC_NA); - col_append_fstr(pinfo->cinfo, COL_INFO, " TFO=C"); + col_append_str(pinfo->cinfo, COL_INFO, " TFO=C"); } break; default: @@ -3776,7 +3775,7 @@ gboolean decode_tcp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int src_port, int dst_port, - struct tcp_analysis *tcpd) + struct tcp_analysis *tcpd, struct tcpinfo *tcpinfo) { tvbuff_t *next_tvb; int low_port, high_port; @@ -3808,7 +3807,7 @@ /* for the conversation if available */ if (try_conversation_dissector(&pinfo->src, &pinfo->dst, PT_TCP, - src_port, dst_port, next_tvb, pinfo, tree)) { + src_port, dst_port, next_tvb, pinfo, tree, tcpinfo)) { pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking); return TRUE; } @@ -3817,7 +3816,7 @@ /* do lookup with the heuristic subdissector table */ save_desegment_offset = pinfo->desegment_offset; save_desegment_len = pinfo->desegment_len; - if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, NULL)) { + if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, tcpinfo)) { pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking); return TRUE; } @@ -3850,7 +3849,7 @@ number of 0 to disable the port. */ if (tcpd && tcpd->server_port != 0 && - dissector_try_uint(subdissector_table, tcpd->server_port, next_tvb, pinfo, tree)) { + dissector_try_uint_new(subdissector_table, tcpd->server_port, next_tvb, pinfo, tree, FALSE, tcpinfo)) { pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking); return TRUE; } @@ -3864,12 +3863,12 @@ } if (low_port != 0 && - dissector_try_uint(subdissector_table, low_port, next_tvb, pinfo, tree)) { + dissector_try_uint_new(subdissector_table, low_port, next_tvb, pinfo, tree, FALSE, tcpinfo)) { pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking); return TRUE; } if (high_port != 0 && - dissector_try_uint(subdissector_table, high_port, next_tvb, pinfo, tree)) { + dissector_try_uint_new(subdissector_table, high_port, next_tvb, pinfo, tree, FALSE, tcpinfo)) { pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking); return TRUE; } @@ -3878,7 +3877,7 @@ /* do lookup with the heuristic subdissector table */ save_desegment_offset = pinfo->desegment_offset; save_desegment_len = pinfo->desegment_len; - if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, NULL)) { + if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, tcpinfo)) { pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking); return TRUE; } @@ -3904,7 +3903,7 @@ process_tcp_payload(tvbuff_t *tvb, volatile int offset, packet_info *pinfo, proto_tree *tree, proto_tree *tcp_tree, int src_port, int dst_port, guint32 seq, guint32 nxtseq, gboolean is_tcp_segment, - struct tcp_analysis *tcpd) + struct tcp_analysis *tcpd, struct tcpinfo *tcpinfo) { pinfo->want_pdu_tracking=0; @@ -3924,7 +3923,7 @@ */ if( (offset!=-1) && decode_tcp_ports(tvb, offset, pinfo, tree, src_port, - dst_port, tcpd) ) { + dst_port, tcpd, tcpinfo) ) { /* * We succeeded in handing off to a subdissector. * @@ -3983,7 +3982,7 @@ dissect_tcp_payload(tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 seq, guint32 nxtseq, guint32 sport, guint32 dport, proto_tree *tree, proto_tree *tcp_tree, - struct tcp_analysis *tcpd) + struct tcp_analysis *tcpd, struct tcpinfo *tcpinfo) { gboolean save_fragmented; @@ -3991,7 +3990,7 @@ if (pinfo->can_desegment) { /* Yes. */ desegment_tcp(tvb, pinfo, offset, seq, nxtseq, sport, dport, tree, - tcp_tree, tcpd); + tcp_tree, tcpd, tcpinfo); } else { /* No - just call the subdissector. Mark this as fragmented, so if somebody throws an exception, @@ -3999,7 +3998,7 @@ save_fragmented = pinfo->fragmented; pinfo->fragmented = TRUE; process_tcp_payload(tvb, offset, pinfo, tree, tcp_tree, sport, dport, - seq, nxtseq, TRUE, tcpd); + seq, nxtseq, TRUE, tcpd, tcpinfo); pinfo->fragmented = save_fragmented; } } @@ -4048,7 +4047,7 @@ tcph->th_sport = tvb_get_ntohs(tvb, offset); tcph->th_dport = tvb_get_ntohs(tvb, offset + 2); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s > %s", + col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s", get_tcp_port(tcph->th_sport), get_tcp_port(tcph->th_dport)); if (tree) { if (tcp_summary_in_tree) { @@ -4397,8 +4396,6 @@ /* Assume we'll pass un-reassembled data to subdissectors. */ tcpinfo.is_reassembled = FALSE; - pinfo->private_data = &tcpinfo; - /* * Assume, initially, that we can't desegment. */ @@ -4707,7 +4704,8 @@ */ pinfo->can_desegment = 0; - process_tcp_payload(next_tvb, 0, pinfo, tree, tcp_tree, tcph->th_sport, tcph->th_dport, tcph->th_seq, nxtseq, FALSE, tcpd); + process_tcp_payload(next_tvb, 0, pinfo, tree, tcp_tree, tcph->th_sport, tcph->th_dport, tcph->th_seq, + nxtseq, FALSE, tcpd, &tcpinfo); return; } @@ -4777,7 +4775,7 @@ tvb_format_text(tvb, offset, length_remaining)); } else { dissect_tcp_payload(tvb, pinfo, offset, tcph->th_seq, nxtseq, - tcph->th_sport, tcph->th_dport, tree, tcp_tree, tcpd); + tcph->th_sport, tcph->th_dport, tree, tcp_tree, tcpd, &tcpinfo); } } } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-tcp.h wireshark-1.12.0~201311020920/epan/dissectors/packet-tcp.h --- wireshark-1.12.0~201310251247/epan/dissectors/packet-tcp.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-tcp.h 2013-11-02 02:12:36.000000000 +0000 @@ -272,12 +272,12 @@ guint32 seq, guint32 nxtseq, guint32 sport, guint32 dport, proto_tree *tree, proto_tree *tcp_tree, - struct tcp_analysis *tcpd); + struct tcp_analysis *tcpd, struct tcpinfo *tcpinfo); extern struct tcp_analysis *get_tcp_conversation_data(conversation_t *conv, packet_info *pinfo); -extern gboolean decode_tcp_ports(tvbuff_t *, int, packet_info *, proto_tree *, int, int, struct tcp_analysis *); +extern gboolean decode_tcp_ports(tvbuff_t *, int, packet_info *, proto_tree *, int, int, struct tcp_analysis *, struct tcpinfo *); /** Associate process information with a given flow * diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-text-media.c wireshark-1.12.0~201311020920/epan/dissectors/packet-text-media.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-text-media.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-text-media.c 2013-11-02 02:12:36.000000000 +0000 @@ -1,8 +1,8 @@ /* packet-text-media.c * Routines for text-based media dissection. * - * NOTE - The media type is either found in pinfo->match_string - * or in pinfo->private_data. + * NOTE - The media type is either found in pinfo->match_string, + * pinfo->private_data, or passed into the dissector (preferred) * * (C) Olivier Biot, 2004. * @@ -55,8 +55,8 @@ /* Dissector handles */ static dissector_handle_t xml_handle; -static void -dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { proto_tree *subtree; proto_item *ti; @@ -74,7 +74,7 @@ tvb_get_nstringz0(tvb, 0, sizeof(word),word); if (g_ascii_strncasecmp(word, "private_data); + data_name = (char *)data; if (! (data_name && data_name[0])) { /* - * No information from "private_data" + * No information from dissector data */ - data_name = NULL; + data_name = (char *)(pinfo->private_data); + if (! (data_name && data_name[0])) { + /* + * No information from "private_data" + */ + data_name = NULL; + } } } @@ -129,6 +135,8 @@ offset = next_offset; } } + + return tvb_length(tvb); } void @@ -144,7 +152,7 @@ "Line-based text data", /* Long name */ "Line-based text data", /* Short name */ "data-text-lines"); /* Filter name */ - register_dissector("data-text-lines", dissect_text_lines, proto_text_lines); + new_register_dissector("data-text-lines", dissect_text_lines, proto_text_lines); } void diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-tfp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-tfp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-tfp.c 1970-01-01 00:00:00.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-tfp.c 2013-11-02 02:12:36.000000000 +0000 @@ -0,0 +1,443 @@ +/* packet-tfp.c + * Routines for Tinkerforge protocol packet disassembly + * By Ishraq Ibne Ashraf + * Copyright 2013 Ishraq Ibne Ashraf + * + * $Id$ + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "config.h" + +#include +#include +#include + +/* defines */ +#define tfp_PORT 4223 + +#define tfp_USB_VENDOR_ID 0x16D0 +#define tfp_USB_PRODUCT_ID 0x063D + +#define BASE58_MAX_STR_SIZE 13 + +/* variables for creating the tree */ +static gint proto_tfp = -1; +static gint ett_tfp = -1; + +/* header field variables */ +static gint hf_tfp_uid = -1; +static gint hf_tfp_uid_numeric = -1; +static gint hf_tfp_len = -1; +static gint hf_tfp_fid = -1; +static gint hf_tfp_seq = -1; +static gint hf_tfp_r = -1; +static gint hf_tfp_a = -1; +static gint hf_tfp_oo = -1; +static gint hf_tfp_e = -1; +static gint hf_tfp_future_use = -1; +static gint hf_tfp_payload = -1; + +/* bit and byte offsets for dissection */ +static const gint byte_offset_len = 4; +static const gint byte_offset_fid = 5; +static const gint byte_count_tfp_uid = 4; +static const gint byte_count_tfp_len = 1; +static const gint byte_count_tfp_fid = 1; +static const gint byte_count_tfp_flags = 2; +static const gint bit_count_tfp_seq = 4; +static const gint bit_count_tfp_r = 1; +static const gint bit_count_tfp_a = 1; +static const gint bit_count_tfp_oo = 2; +static const gint bit_count_tfp_e = 2; +static const gint bit_count_tfp_future_use = 6; + +/* base58 encoding variable */ +static const char BASE58_ALPHABET[] = + "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"; + +/* function for encoding a number to base58 string */ +static void +base58_encode(guint32 value, char *str) { + + guint32 mod; + gint i = 0; + gint k; + gchar reverse_str[BASE58_MAX_STR_SIZE] = {'\0'}; + + while (value >= 58) { + mod = value % 58; + reverse_str[i] = BASE58_ALPHABET[mod]; + value = value / 58; + ++i; + } + + reverse_str[i] = BASE58_ALPHABET[value]; + + for (k = 0; k <= i; k++) { + str[k] = reverse_str[i - k]; + } + + for (; k < BASE58_MAX_STR_SIZE; k++) { + str[k] = '\0'; + } +} + +/* common dissector function for dissecting TFP payloads */ +static void +dissect_tfp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + + gint byte_offset = 0; + gint bit_offset = 48; + + guint8 hv_tfp_len; + guint8 hv_tfp_fid; + guint8 hv_tfp_seq; + + gchar tfp_uid_string[BASE58_MAX_STR_SIZE]; + + base58_encode(tvb_get_letohl(tvb, 0), &tfp_uid_string[0]); + + hv_tfp_len = tvb_get_guint8(tvb, byte_offset_len); + hv_tfp_fid = tvb_get_guint8(tvb, byte_offset_fid); + hv_tfp_seq = tvb_get_bits8(tvb, bit_offset, bit_count_tfp_seq); + + col_add_fstr(pinfo->cinfo, COL_INFO, + "UID: %s, Len: %d, FID: %d, Seq: %d", + &tfp_uid_string[0], hv_tfp_len, hv_tfp_fid, hv_tfp_seq); + + /* call for details */ + if (tree) { + proto_tree *tfp_tree; + proto_item *ti; + + ti = proto_tree_add_protocol_format(tree, proto_tfp, tvb, 0, -1, + "Tinkerforge Protocol, UID: %s, Len: %d, FID: %d, Seq: %d", + &tfp_uid_string[0], hv_tfp_len, hv_tfp_fid, hv_tfp_seq); + tfp_tree = proto_item_add_subtree(ti, ett_tfp); + + /* Use ...string_format_value() so we can show the complete generated string but specify */ + /* the field length as being just the 4 bytes from which the string is generated. */ + ti = proto_tree_add_string_format_value(tfp_tree, + hf_tfp_uid, + tvb, byte_offset, byte_count_tfp_uid, + &tfp_uid_string[0], "%s", &tfp_uid_string[0]); + PROTO_ITEM_SET_GENERATED(ti); + + proto_tree_add_item(tfp_tree, + hf_tfp_uid_numeric, + tvb, + byte_offset, + byte_count_tfp_uid, + ENC_LITTLE_ENDIAN); + + byte_offset += byte_count_tfp_uid; + + proto_tree_add_item(tfp_tree, + hf_tfp_len, + tvb, + byte_offset, + byte_count_tfp_len, + ENC_LITTLE_ENDIAN); + + byte_offset += byte_count_tfp_len; + + proto_tree_add_item(tfp_tree, + hf_tfp_fid, + tvb, + byte_offset, + byte_count_tfp_fid, + ENC_LITTLE_ENDIAN); + + byte_offset += byte_count_tfp_fid; + + proto_tree_add_bits_item(tfp_tree, + hf_tfp_seq, + tvb, + bit_offset, + bit_count_tfp_seq, + ENC_LITTLE_ENDIAN); + + bit_offset += bit_count_tfp_seq; + + proto_tree_add_bits_item(tfp_tree, + hf_tfp_r, + tvb, + bit_offset, + bit_count_tfp_r, + ENC_LITTLE_ENDIAN); + + bit_offset += bit_count_tfp_r; + + proto_tree_add_bits_item(tfp_tree, + hf_tfp_a, + tvb, + bit_offset, + bit_count_tfp_a, + ENC_LITTLE_ENDIAN); + + bit_offset += bit_count_tfp_a; + + proto_tree_add_bits_item(tfp_tree, + hf_tfp_oo, + tvb, + bit_offset, + bit_count_tfp_oo, + ENC_LITTLE_ENDIAN); + + bit_offset += bit_count_tfp_oo; + + proto_tree_add_bits_item(tfp_tree, + hf_tfp_e, + tvb, + bit_offset, + bit_count_tfp_e, + ENC_LITTLE_ENDIAN); + + bit_offset += bit_count_tfp_e; + + proto_tree_add_bits_item(tfp_tree, + hf_tfp_future_use, + tvb, + bit_offset, + bit_count_tfp_future_use, + ENC_LITTLE_ENDIAN); + + bit_offset += bit_count_tfp_future_use; + + if ((tvb_reported_length(tvb)) > 8) { + + byte_offset += byte_count_tfp_flags; + + proto_tree_add_item(tfp_tree, + hf_tfp_payload, + tvb, + byte_offset, + -1, + ENC_NA); + } + } +} + +/* dissector function for dissecting TCP payloads */ +static void +dissect_tfp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + col_set_str(pinfo->cinfo, COL_PROTOCOL, "TFP over TCP"); + col_clear(pinfo->cinfo, COL_INFO); + + dissect_tfp_common(tvb, pinfo, tree); +} + +/* dissector function for dissecting USB payloads */ +static void +dissect_tfp_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + usb_conv_info_t *usb_conv_info; + usb_conv_info = (usb_conv_info_t *)pinfo->usb_conv_info; + + if (usb_conv_info->deviceVendor == tfp_USB_VENDOR_ID) { + col_set_str(pinfo->cinfo, COL_PROTOCOL, "TFP over USB"); + if (usb_conv_info->deviceProduct == tfp_USB_PRODUCT_ID) { + col_clear(pinfo->cinfo, COL_INFO); + dissect_tfp_common(tvb, pinfo, tree); + } + else { + /* ToDo? Display "Unknown Product" ?? */ + } + return; + } + else { + return; /* Not tfp_USB_VENDOR_ID */ + } +} + +/* protocol register function */ +void +proto_register_tfp(void) +{ + /* defining header formats */ + static hf_register_info hf_tfp[] = { + { &hf_tfp_uid, + { "UID (String)", + "tfp.uid", + FT_STRINGZ, + BASE_NONE, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_tfp_uid_numeric, + { "UID (Numeric)", + "tfp.uid_numeric", + FT_UINT32, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_tfp_len, + { "Length", + "tfp.len", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_tfp_fid, + { "Function ID", + "tfp.fid", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_tfp_seq, + { "Sequence Number", + "tfp.seq", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_tfp_r, + { "Response Expected", + "tfp.r", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_tfp_a, + { "Authentication", + "tfp.a", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_tfp_oo, + { "Other Options", + "tfp.oo", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_tfp_e, + { "Error Code", + "tfp.e", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_tfp_future_use, + { "Future Use", + "tfp.future_use", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL + } + }, + { &hf_tfp_payload, + { "Payload", + "tfp.payload", + FT_BYTES, + BASE_NONE, + NULL, + 0x0, + NULL, + HFILL + } + } + }; + + /* setup protocol subtree array */ + static gint *ett[] = { + &ett_tfp + }; + + /* defining the protocol and its names */ + proto_tfp = proto_register_protocol ( + "Tinkerforge Protocol", + "TFP", + "tfp" + ); + + proto_register_field_array(proto_tfp, hf_tfp, array_length(hf_tfp)); + proto_register_subtree_array(ett, array_length(ett)); +} + +/* handoff function */ +void +proto_reg_handoff_tfp(void) { + + static dissector_handle_t + tfp_handle_tcp, + tfp_handle_usb; + + tfp_handle_tcp = create_dissector_handle(dissect_tfp_tcp, proto_tfp); + tfp_handle_usb = create_dissector_handle(dissect_tfp_usb, proto_tfp); + + dissector_add_uint("tcp.port", tfp_PORT, tfp_handle_tcp); + dissector_add_uint("usb.bulk", IF_CLASS_VENDOR_SPECIFIC, tfp_handle_usb); +} + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-tn5250.c wireshark-1.12.0~201311020920/epan/dissectors/packet-tn5250.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-tn5250.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-tn5250.c 2013-11-02 02:12:36.000000000 +0000 @@ -5117,7 +5117,6 @@ ti = proto_tree_add_item(tree, proto_tn5250, tvb, offset, -1, ENC_NA); tn5250_tree = proto_item_add_subtree(ti, ett_tn5250); - col_clear(pinfo->cinfo, COL_INFO); if (pinfo->srcport == tn5250_info->outbound_port) { col_set_str(pinfo->cinfo, COL_INFO, "TN5250 Data from Mainframe"); } else { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-tpkt.c wireshark-1.12.0~201311020920/epan/dissectors/packet-tpkt.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-tpkt.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-tpkt.c 2013-11-02 02:12:36.000000000 +0000 @@ -231,7 +231,7 @@ * anyway. */ if (tpkt_desegment) - col_add_str(pinfo->cinfo, COL_INFO, ""); + col_set_str(pinfo->cinfo, COL_INFO, ""); while (tvb_reported_length_remaining(tvb, offset) != 0) { /* diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-tpncp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-tpncp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-tpncp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-tpncp.c 2013-11-02 02:12:36.000000000 +0000 @@ -345,11 +345,11 @@ static gint fill_tpncp_id_vals(value_string string[], FILE *file) { gint i = 0, tpncp_id = 0; - gchar *tpncp_name = NULL, *line_in_file = NULL; + gchar *tpncp_name, *line_in_file; - line_in_file = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + line_in_file = (gchar *)g_malloc(MAX_TPNCP_DB_ENTRY_LEN); line_in_file[0] = 0; - tpncp_name = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + tpncp_name = (gchar *)g_malloc(MAX_TPNCP_DB_ENTRY_LEN); tpncp_name[0] = 0; while (fgets(line_in_file, MAX_TPNCP_DB_ENTRY_LEN, file) != NULL) { @@ -368,6 +368,9 @@ } } + g_free(line_in_file); + g_free(tpncp_name); + return 0; } @@ -379,13 +382,13 @@ gchar *line_in_file = NULL, *enum_name = NULL, *enum_type = NULL, *enum_str = NULL; - line_in_file = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + line_in_file = (gchar *)g_malloc(MAX_TPNCP_DB_ENTRY_LEN); line_in_file[0] = 0; - enum_name = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + enum_name = (gchar *)g_malloc(MAX_TPNCP_DB_ENTRY_LEN); enum_name[0] = 0; - enum_type = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + enum_type = (gchar *)g_malloc(MAX_TPNCP_DB_ENTRY_LEN); enum_type[0] = 0; - enum_str = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + enum_str = (gchar *)g_malloc(MAX_TPNCP_DB_ENTRY_LEN); enum_str[0] = 0; while (fgets(line_in_file, MAX_TPNCP_DB_ENTRY_LEN, file) != NULL) { @@ -430,6 +433,11 @@ tpncp_enums_name_vals[enum_val+1] = NULL; } + g_free(line_in_file); + g_free(enum_name); + g_free(enum_type); + g_free(enum_str); + return 0; } @@ -574,9 +582,6 @@ } }; - tpncp_db_entry = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); - tpncp_db_entry[0] = 0; - /* Register common fields of hf_register_info struture. */ hf_entr.hfinfo.type = FT_NONE; hf_entr.hfinfo.strings = NULL; @@ -591,8 +596,11 @@ if (!was_registered) { /* Register non-standard data should be done only once. */ hf_allocated = hf_size+(int)array_length(hf_tpncp)-1; - if ((hf = (hf_register_info *)g_realloc(hf, hf_allocated * sizeof(hf_register_info))) == NULL) + if ((hf = (hf_register_info *)g_realloc(hf, hf_allocated * sizeof(hf_register_info))) == NULL) { + /* XXX realloc returning NULL does not free the original memory, + * is this a leak? */ return (-1); + } for (idx = 0; idx < array_length(hf_tpncp); idx++) { memcpy(hf + (hf_size - 1), hf_tpncp + idx, sizeof(hf_register_info)); hf_size++; @@ -601,7 +609,11 @@ } else hf_size++; + /* Register standard data. */ + tpncp_db_entry = (gchar *)g_malloc(MAX_TPNCP_DB_ENTRY_LEN); + tpncp_db_entry[0] = 0; + while (fgets(tpncp_db_entry, MAX_TPNCP_DB_ENTRY_LEN, file) != NULL) { if (!strncmp(tpncp_db_entry, "#####", 5)) { hf_size--; @@ -638,8 +650,10 @@ else { if ((current_tpncp_data_field_info->p_next = (tpncp_data_field_info *)g_malloc0(sizeof(tpncp_data_field_info))) - == NULL) + == NULL) { + g_free(tpncp_db_entry); return (-1); + } current_tpncp_data_field_info = current_tpncp_data_field_info->p_next; } /* Register specific fields of hf_register_info struture. */ @@ -682,8 +696,12 @@ /* Register initialized hf_register_info in global database. */ if (hf_size > hf_allocated) { hf_allocated += 1024; - if ((hf = (hf_register_info *)g_realloc(hf, hf_allocated * sizeof(hf_register_info))) == NULL) + if ((hf = (hf_register_info *)g_realloc(hf, hf_allocated * sizeof(hf_register_info))) == NULL) { + /* XXX realloc returning NULL does not free the original memory, + * is this a leak? */ + g_free(tpncp_db_entry); return (-1); + } } memcpy(hf + hf_size - 1, &hf_entr, sizeof(hf_register_info)); hf_size++; @@ -693,6 +711,8 @@ current_tpncp_data_field_info->tpncp_data_field_is_ip_addr = tpncp_data_field_is_ip_addr; } + g_free(tpncp_db_entry); + return 0; } @@ -700,20 +720,33 @@ static gint init_tpncp_db(void) { gchar *tpncp_dat_file_path; + gint ret; FILE *file; - tpncp_dat_file_path = ep_strdup_printf("%s" G_DIR_SEPARATOR_S"tpncp" G_DIR_SEPARATOR_S "tpncp.dat", get_datafile_dir()); + tpncp_dat_file_path = g_strdup_printf("%s" G_DIR_SEPARATOR_S"tpncp" G_DIR_SEPARATOR_S "tpncp.dat", get_datafile_dir()); /* Open file with TPNCP data. */ - if ((file = ws_fopen(tpncp_dat_file_path, "r")) == NULL) + if ((file = ws_fopen(tpncp_dat_file_path, "r")) == NULL) { + g_free(tpncp_dat_file_path); return (-1); + } + + ret = fill_tpncp_id_vals(tpncp_events_id_vals, file); + if (ret != 0) return ret; - fill_tpncp_id_vals(tpncp_events_id_vals, file); - fill_tpncp_id_vals(tpncp_commands_id_vals, file); - fill_enums_id_vals(file); - init_tpncp_data_fields_info(tpncp_events_info_db, file); - init_tpncp_data_fields_info(tpncp_commands_info_db, file); + ret = fill_tpncp_id_vals(tpncp_commands_id_vals, file); + if (ret != 0) return ret; + ret = fill_enums_id_vals(file); + if (ret != 0) return ret; + + ret = init_tpncp_data_fields_info(tpncp_events_info_db, file); + if (ret != 0) return ret; + + ret = init_tpncp_data_fields_info(tpncp_commands_info_db, file); + if (ret != 0) return ret; + + g_free(tpncp_dat_file_path); fclose(file); return 0; @@ -765,8 +798,10 @@ &ett_tpncp_body }; - if (init_tpncp_db() == -1) + if (init_tpncp_db() == -1) { + g_warning("Could not load tpncp.dat file, tpncp dissector will not work"); return; + } proto_tpncp = proto_register_protocol("AudioCodes TPNCP (TrunkPack Network Control Protocol)", "TPNCP", "tpncp"); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ua.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ua.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ua.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ua.c 2013-11-02 02:12:36.000000000 +0000 @@ -149,7 +149,7 @@ default: { /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, " - UA3G Message ERR: Opcode Unknown"); + col_append_str(pinfo->cinfo, COL_INFO, " - UA3G Message ERR: Opcode Unknown"); proto_tree_add_text(tree, tvb, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-ua3g.c wireshark-1.12.0~201311020920/epan/dissectors/packet-ua3g.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-ua3g.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-ua3g.c 2013-11-02 02:12:36.000000000 +0000 @@ -2203,7 +2203,7 @@ } } else { /* Classical Beep */ /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": Classical Beep"); + col_append_str(pinfo->cinfo, COL_INFO, ": Classical Beep"); } } @@ -3706,7 +3706,7 @@ length = tvb_get_letohs(tvb, offset); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, " - UA3G Message:"); + col_append_str(pinfo->cinfo, COL_INFO, " - UA3G Message:"); proto_tree_add_uint(ua3g_tree, hf_ua3g_length, tvb, offset, 2, length); offset += 2; diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-uaudp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-uaudp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-uaudp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-uaudp.c 2013-11-02 02:12:36.000000000 +0000 @@ -306,7 +306,7 @@ tree); else { /* XXX: expert ?? */ - col_add_str(pinfo->cinfo, + col_set_str(pinfo->cinfo, COL_INFO, "Data - Couldn't resolve direction. Check UAUDP Preferences."); } @@ -314,7 +314,7 @@ } else { /* print in "INFO" column */ - col_add_str(pinfo->cinfo, + col_set_str(pinfo->cinfo, COL_INFO, "Data ACK"); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-udp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-udp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-udp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-udp.c 2013-11-02 02:12:36.000000000 +0000 @@ -321,7 +321,7 @@ /* for the conversation if available */ if (try_conversation_dissector(&pinfo->dst, &pinfo->src, PT_UDP, - uh_dport, uh_sport, next_tvb, pinfo, tree)) { + uh_dport, uh_sport, next_tvb, pinfo, tree, NULL)) { return; } @@ -485,7 +485,7 @@ } } } else { - udph->uh_ulen = pinfo->iplen - pinfo->iphdrlen; + udph->uh_ulen = tvb_reported_length(tvb); udph->uh_sum_cov = tvb_get_ntohs(tvb, offset+4); if (((udph->uh_sum_cov > 0) && (udph->uh_sum_cov < 8)) || (udph->uh_sum_cov > udph->uh_ulen)) { /* Bogus length - it includes the header, so it must be >= 8, and no larger then the IP payload size. */ @@ -534,7 +534,7 @@ item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_checksum.id, tvb, offset + 6, 2, 0, "0x%04x (Illegal)", 0); expert_add_info(pinfo, item, &ei_udp_checksum_zero); - col_append_fstr(pinfo->cinfo, COL_INFO, " [ILLEGAL CHECKSUM (0)]"); + col_append_str(pinfo->cinfo, COL_INFO, " [ILLEGAL CHECKSUM (0)]"); checksum_tree = proto_item_add_subtree(item, ett_udp_checksum); item = proto_tree_add_boolean(checksum_tree, &hfi_udp_checksum_good, tvb, @@ -613,7 +613,7 @@ PROTO_ITEM_SET_GENERATED(item); expert_add_info(pinfo, item, &ei_udp_checksum_bad); - col_append_fstr(pinfo->cinfo, COL_INFO, " [UDP CHECKSUM INCORRECT]"); + col_append_str(pinfo->cinfo, COL_INFO, " [UDP CHECKSUM INCORRECT]"); } } else { item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_checksum.id, tvb, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-uhd.c wireshark-1.12.0~201311020920/epan/dissectors/packet-uhd.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-uhd.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-uhd.c 2013-11-02 02:12:36.000000000 +0000 @@ -167,7 +167,6 @@ id = tvb_get_ntohl(tvb, 4); - col_clear(pinfo->cinfo, COL_INFO); col_set_str(pinfo->cinfo, COL_PROTOCOL, "UHD"); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(id, uhd_ids, "Unknown UHD message type '%c'")); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-umts_fp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-umts_fp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-umts_fp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-umts_fp.c 2013-11-02 02:12:36.000000000 +0000 @@ -4262,7 +4262,7 @@ } /* Show channel type in info column, tree */ - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(p_fp_info->channel, channel_type_vals, "Unknown channel type")); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-umts_mac.c wireshark-1.12.0~201311020920/epan/dissectors/packet-umts_mac.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-umts_mac.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-umts_mac.c 2013-11-02 02:12:36.000000000 +0000 @@ -290,7 +290,7 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC"); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(tctf, rach_fdd_tctf_vals, "Unknown TCTF")); ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA); @@ -380,7 +380,7 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC"); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(tctf, fach_fdd_tctf_vals, "Unknown TCTF")); ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-usb-ccid.c wireshark-1.12.0~201311020920/epan/dissectors/packet-usb-ccid.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-usb-ccid.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-usb-ccid.c 2013-11-02 02:12:36.000000000 +0000 @@ -341,13 +341,16 @@ } -static void -dissect_ccid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static gint +dissect_ccid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *item; proto_tree *ccid_tree; guint8 cmd; tvbuff_t *next_tvb; + usb_data_t *usb_data = (usb_data_t *) data; + + DISSECTOR_ASSERT(usb_data); col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBCCID"); col_set_str(pinfo->cinfo, COL_INFO, "CCID Packet"); @@ -442,7 +445,7 @@ if (tvb_get_guint8(tvb, 15) == 0xD4) { /* Skip the 5 byte ACS Pseudo-Header */ - call_dissector(sub_handles[sub_selected], tvb_new_subset_remaining(tvb, 15), pinfo, tree); + call_dissector_with_data(sub_handles[sub_selected], tvb_new_subset_remaining(tvb, 15), pinfo, tree, usb_data); } else { @@ -493,7 +496,7 @@ /* Strip the ISO 7816 status word at the end, like we do in the PN532 dissector for FeliCa payloads... */ next_tvb= tvb_new_subset(tvb, 10, (tvb_get_guint8(tvb, 1) - 2), (tvb_get_guint8(tvb, 1) - 2)); - call_dissector(sub_handles[SUB_PN532_ACS_PSEUDO_APDU], next_tvb, pinfo, tree); + call_dissector_with_data(sub_handles[SUB_PN532_ACS_PSEUDO_APDU], next_tvb, pinfo, tree, usb_data); } /* Try to dissect responses to GSM SIM packets */ @@ -521,6 +524,9 @@ proto_tree_add_item(ccid_tree, hf_ccid_bClockStatus, tvb, 9, 1, ENC_LITTLE_ENDIAN); break; } + + /* TODO: Try use "offset" instead of hardcoded constants */ + return tvb_length(tvb); } void @@ -665,7 +671,7 @@ ccid_dissector_table = register_dissector_table("usbccid.payload", "USBCCID Payload", FT_UINT8, BASE_DEC); - register_dissector("usbccid", dissect_ccid, proto_ccid); + new_register_dissector("usbccid", dissect_ccid, proto_ccid); } /* Handler registration */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-usb-com.c wireshark-1.12.0~201311020920/epan/dissectors/packet-usb-com.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-usb-com.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-usb-com.c 2013-11-02 02:12:36.000000000 +0000 @@ -34,9 +34,22 @@ static int hf_usb_com_descriptor_cdc = -1; static int hf_usb_com_descriptor_payload = -1; static int hf_usb_com_control_subclass = -1; +static int hf_usb_com_capabilities = -1; +static int hf_usb_com_descriptor_acm_capabilities_reserved = -1; +static int hf_usb_com_descriptor_acm_capabilities_network_connection = -1; +static int hf_usb_com_descriptor_acm_capabilities_send_break = -1; +static int hf_usb_com_descriptor_acm_capabilities_line_and_state = -1; +static int hf_usb_com_descriptor_acm_capabilities_comm_features = -1; +static int hf_usb_com_control_interface = -1; +static int hf_usb_com_subordinate_interface = -1; +static int hf_usb_com_descriptor_cm_capabilities_reserved = -1; +static int hf_usb_com_descriptor_cm_capabilities_call_managment_over_data_class_interface = -1; +static int hf_usb_com_descriptor_cm_capabilities_call_managment = -1; +static int hf_usb_com_descriptor_cm_data_interface = -1; static int hf_usb_com_control_payload = -1; static gint ett_usb_com = -1; +static gint ett_usb_com_capabilities = -1; static dissector_handle_t mbim_control_handle; static dissector_handle_t mbim_descriptor_handle; @@ -121,12 +134,18 @@ {COM_SUBCLASS_MBIM, "Mobile Broadband Interface Model"}, {0, NULL} }; +value_string_ext ext_usb_com_subclass_vals = VALUE_STRING_EXT_INIT(usb_com_subclass_vals); + +void proto_register_usb_com(void); +void proto_reg_handoff_usb_com(void); static int dissect_usb_com_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint8 offset = 0, type, subtype; proto_tree *subtree; + proto_tree *subtree_capabilities; + proto_item *subitem_capabilities; proto_item *ti; ti = proto_tree_add_text(tree, tvb, offset, -1, "COMMUNICATIONS DESCRIPTOR"); @@ -146,6 +165,37 @@ proto_tree_add_item(subtree, hf_usb_com_descriptor_cdc, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; break; + case 0x01: + subitem_capabilities = proto_tree_add_item(subtree, hf_usb_com_capabilities, tvb, 3, 1, ENC_LITTLE_ENDIAN); + subtree_capabilities = proto_item_add_subtree(subitem_capabilities, ett_usb_com_capabilities); + + proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_cm_capabilities_reserved, tvb, 3, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_cm_capabilities_call_managment_over_data_class_interface, tvb, 3, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_cm_capabilities_call_managment, tvb, 3, 1, ENC_LITTLE_ENDIAN); + + proto_tree_add_item(subtree, hf_usb_com_descriptor_cm_data_interface, tvb, 4, 1, ENC_LITTLE_ENDIAN); + offset = 5; + break; + case 0x02: + subitem_capabilities = proto_tree_add_item(subtree, hf_usb_com_capabilities, tvb, 3, 1, ENC_LITTLE_ENDIAN); + subtree_capabilities = proto_item_add_subtree(subitem_capabilities, ett_usb_com_capabilities); + + proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_acm_capabilities_reserved, tvb, 3, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_acm_capabilities_network_connection, tvb, 3, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_acm_capabilities_send_break, tvb, 3, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_acm_capabilities_line_and_state, tvb, 3, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_acm_capabilities_comm_features, tvb, 3, 1, ENC_LITTLE_ENDIAN); + offset = 4; + break; + case 0x06: + offset = 3; + proto_tree_add_item(subtree, hf_usb_com_control_interface, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + while (tvb_length_remaining(tvb,offset) > 0) { + proto_tree_add_item(subtree, hf_usb_com_subordinate_interface, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + } + break; case 0x1b: case 0x1c: offset = call_dissector_only(mbim_descriptor_handle, tvb, pinfo, subtree, NULL); @@ -238,15 +288,52 @@ { "Payload", "usbcom.descriptor.payload", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_usb_com_control_subclass, - { "Subclass", "usbcom.control.subclass", FT_UINT8, BASE_HEX, - VALS(usb_com_subclass_vals), 0, NULL, HFILL }}, + { "Subclass", "usbcom.control.subclass", FT_UINT8, BASE_HEX|BASE_EXT_STRING, + &ext_usb_com_subclass_vals, 0, NULL, HFILL }}, + { &hf_usb_com_capabilities, + { "bmCapabilities", "usbcom.descriptor.capabilities", FT_UINT8, BASE_HEX, + NULL, 0, NULL, HFILL }}, + { &hf_usb_com_descriptor_acm_capabilities_reserved, + { "Reserved", "usbcom.descriptor.acm.capabilities.reserved", FT_UINT8, BASE_HEX, + NULL, 0xF0, NULL, HFILL }}, + { &hf_usb_com_descriptor_acm_capabilities_network_connection, + { "Network_Connection", "usbcom.descriptor.acm.capabilities.network_connection", FT_BOOLEAN, 8, + &tfs_supported_not_supported, 0x08, NULL, HFILL }}, + { &hf_usb_com_descriptor_acm_capabilities_send_break, + { "Send_Break", "usbcom.descriptor.acm.capabilities.network_connection", FT_BOOLEAN, 8, + &tfs_supported_not_supported, 0x04, NULL, HFILL }}, + { &hf_usb_com_descriptor_acm_capabilities_line_and_state, + { "Line Requests and State Notification", "usbcom.descriptor.acm.capabilities.line_and_state", FT_BOOLEAN, 8, + &tfs_supported_not_supported, 0x02, NULL, HFILL }}, + { &hf_usb_com_descriptor_acm_capabilities_comm_features, + { "Comm Features Combinations", "usbcom.descriptor.acm.capabilities.comm_features", FT_BOOLEAN, 8, + &tfs_supported_not_supported, 0x01, NULL, HFILL }}, + { &hf_usb_com_control_interface, + { "bControlInterface", "usbcom.descriptor.control_interface", FT_UINT8, BASE_HEX, + NULL, 0, NULL, HFILL }}, + { &hf_usb_com_subordinate_interface, + { "bSubordinateInterface", "usbcom.descriptor.subordinate_interface", FT_UINT8, BASE_HEX, + NULL, 0, NULL, HFILL }}, + { &hf_usb_com_descriptor_cm_capabilities_reserved, + { "Reserved", "usbcom.descriptor.cm.capabilities.reserved", FT_UINT8, BASE_HEX, + NULL, 0xFC, NULL, HFILL }}, + { &hf_usb_com_descriptor_cm_capabilities_call_managment_over_data_class_interface, + { "Call Managment over Data Class Interface", "usbcom.descriptor.cm.capabilities.call_managment_over_data_class_interface", FT_BOOLEAN, 8, + &tfs_supported_not_supported, 0x02, NULL, HFILL }}, + { &hf_usb_com_descriptor_cm_capabilities_call_managment, + { "Call Managment", "usbcom.descriptor.cm.capabilities.call_managment", FT_BOOLEAN, 8, + &tfs_supported_not_supported, 0x01, NULL, HFILL }}, + { &hf_usb_com_descriptor_cm_data_interface, + { "bDataInterface", "usbcom.descriptor.cm.data_interface", FT_UINT8, BASE_HEX, + NULL, 0, NULL, HFILL }}, { &hf_usb_com_control_payload, { "Payload", "usbcom.control.payload", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }} }; static gint *usb_com_subtrees[] = { - &ett_usb_com + &ett_usb_com, + &ett_usb_com_capabilities }; proto_usb_com = proto_register_protocol("USB Communications and CDC Control", "USBCOM", "usbcom"); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-usb-hub.c wireshark-1.12.0~201311020920/epan/dissectors/packet-usb-hub.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-usb-hub.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-usb-hub.c 2013-11-02 02:12:36.000000000 +0000 @@ -280,7 +280,7 @@ proto_item *item = NULL; proto_tree *subtree = NULL; - col_append_fstr(pinfo->cinfo, COL_INFO, " [Hub]"); + col_append_str(pinfo->cinfo, COL_INFO, " [Hub]"); if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-usb.c wireshark-1.12.0~201311020920/epan/dissectors/packet-usb.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-usb.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-usb.c 2013-11-02 02:12:36.000000000 +0000 @@ -135,7 +135,12 @@ static int hf_usb_bNumEndpoints = -1; static int hf_usb_bInterfaceClass = -1; static int hf_usb_bInterfaceSubClass = -1; +static int hf_usb_bInterfaceSubClass_cdc = -1; +static int hf_usb_bInterfaceSubClass_hid = -1; static int hf_usb_bInterfaceProtocol = -1; +static int hf_usb_bInterfaceProtocol_cdc = -1; +static int hf_usb_bInterfaceProtocol_cdc_data = -1; +static int hf_usb_bInterfaceProtocol_hid_boot = -1; static int hf_usb_iInterface = -1; static int hf_usb_bEndpointAddress = -1; static int hf_usb_bmAttributes = -1; @@ -411,7 +416,9 @@ static value_string_ext usb_class_vals_ext = VALUE_STRING_EXT_INIT(usb_class_vals); /* use usb class, subclass and protocol id together - http://www.usb.org/developers/defined_class*/ + http://www.usb.org/developers/defined_class + USB Class Definitions for Communications Devices, Revision 1.2 December 6, 2012 +*/ static const value_string usb_protocols[] = { {0x000000, "Use class code info from Interface Descriptors"}, {0x060101, "Still Imaging"}, @@ -477,6 +484,7 @@ extern value_string_ext ext_usb_vendors_vals; extern value_string_ext ext_usb_products_vals; +extern value_string_ext ext_usb_com_subclass_vals; /* * Standard descriptor types. @@ -985,6 +993,52 @@ {0, NULL} }; +static const value_string usb_cdc_protocol_vals[] = { + {0x00, "No class specific protocol required"}, + {0x01, "AT Commands: V.250 etc"}, + {0x02, "AT Commands defined by PCCA-101"}, + {0x03, "AT Commands defined by PCCA-101 & Annex O"}, + {0x04, "AT Commands defined by GSM 07.07"}, + {0x05, "AT Commands defined by 3GPP 27.007"}, + {0x06, "AT Commands defined by TIA for CDMA"}, + {0x07, "Ethernet Emulation Model"}, + {0xFE, "External Protocol: Commands defined by Command Set Functional Descriptor"}, + {0xFF, "Vendor-specific"}, + {0, NULL} +}; + +static const value_string usb_cdc_data_protocol_vals[] = { + {0x00, "No class specific protocol required"}, + {0x01, "Network Transfer Block"}, + {0x02, "Network Transfer Block (IP + DSS)"}, + {0x30, "Physical interface protocol for ISDN BRI"}, + {0x31, "HDLC"}, + {0x32, "Transparent"}, + {0x50, "Management protocol for Q.921 data link protocol"}, + {0x51, "Data link protocol for Q.931"}, + {0x52, "TEI-multiplexor for Q.921 data link protocol"}, + {0x90, "Data compression procedures"}, + {0x91, "Euro-ISDN protocol control"}, + {0x92, "V.24 rate adaptation to ISDN"}, + {0x93, "CAPI Commands"}, + {0xFE, "The protocol(s) are described using a Protocol Unit Functional Descriptors on Communications Class Interface"}, + {0xFF, "Vendor-specific"}, + {0, NULL} +}; + +static const value_string usb_hid_subclass_vals[] = { + {0, "No Subclass"}, + {1, "Boot Interface"}, + {0, NULL} +}; + +static const value_string usb_hid_boot_protocol_vals[] = { + {0, "None"}, + {1, "Keyboard"}, + {2, "Mouse"}, + {0, NULL} +}; + static usb_conv_info_t * get_usb_conv_info(conversation_t *conversation) { @@ -1068,7 +1122,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* feature selector */ proto_tree_add_item(tree, hf_usb_wFeatureSelector, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -1091,7 +1146,8 @@ tvbuff_t *tvb _U_, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { return offset; } @@ -1109,7 +1165,8 @@ tvbuff_t *tvb _U_, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { proto_tree_add_item(tree, hf_usb_bConfigurationValue, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -1504,13 +1561,38 @@ offset += 1; /* bInterfaceSubClass */ - proto_tree_add_item(tree, hf_usb_bInterfaceSubClass, tvb, offset, 1, ENC_LITTLE_ENDIAN); + switch (usb_conv_info->interfaceClass) { + case IF_CLASS_COMMUNICATIONS: + proto_tree_add_item(tree, hf_usb_bInterfaceSubClass_cdc, tvb, offset, 1, ENC_LITTLE_ENDIAN); + break; + case IF_CLASS_HID: + proto_tree_add_item(tree, hf_usb_bInterfaceSubClass_hid, tvb, offset, 1, ENC_LITTLE_ENDIAN); + break; + default: + proto_tree_add_item(tree, hf_usb_bInterfaceSubClass, tvb, offset, 1, ENC_LITTLE_ENDIAN); + } + /* save the subclass so we can access it later in class-specific descriptors */ usb_conv_info->interfaceSubclass = tvb_get_guint8(tvb, offset); offset += 1; /* bInterfaceProtocol */ - proto_tree_add_item(tree, hf_usb_bInterfaceProtocol, tvb, offset, 1, ENC_LITTLE_ENDIAN); + switch (usb_conv_info->interfaceClass) { + case IF_CLASS_COMMUNICATIONS: + proto_tree_add_item(tree, hf_usb_bInterfaceProtocol_cdc, tvb, offset, 1, ENC_LITTLE_ENDIAN); + break; + case IF_CLASS_CDC_DATA: + proto_tree_add_item(tree, hf_usb_bInterfaceProtocol_cdc_data, tvb, offset, 1, ENC_LITTLE_ENDIAN); + break; + case IF_CLASS_HID: + if (usb_conv_info->interfaceSubclass == 1) { + proto_tree_add_item(tree, hf_usb_bInterfaceProtocol_hid_boot, tvb, offset, 1, ENC_LITTLE_ENDIAN); + break; + } /* else default */ + default: + proto_tree_add_item(tree, hf_usb_bInterfaceProtocol, tvb, offset, 1, ENC_LITTLE_ENDIAN); + } + usb_conv_info->interfaceProtocol = tvb_get_guint8(tvb, offset); offset += 1; @@ -1600,7 +1682,7 @@ /* Create a new address structure that points to the same device * but the new endpoint. */ - usb_addr.device = ((usb_address_t *)(pinfo->src.data))->device; + usb_addr.device = ((const usb_address_t *)(pinfo->src.data))->device; usb_addr.endpoint = htolel(endpoint); SET_ADDRESS(&tmp_addr, AT_USB, USB_ADDR_LEN, (char *)&usb_addr); conversation = get_usb_conversation(pinfo, &tmp_addr, &pinfo->dst, usb_addr.endpoint, pinfo->destport); @@ -1611,7 +1693,7 @@ /* Create a new address structure that points to the same device * but the new endpoint. */ - usb_addr.device = ((usb_address_t *)(pinfo->dst.data))->device; + usb_addr.device = ((const usb_address_t *)(pinfo->dst.data))->device; usb_addr.endpoint = htolel(endpoint); SET_ADDRESS(&tmp_addr, AT_USB, USB_ADDR_LEN, (char *)&usb_addr); conversation = get_usb_conversation(pinfo, &pinfo->src, &tmp_addr, pinfo->srcport, usb_addr.endpoint); @@ -1750,7 +1832,7 @@ dissect_usb_configuration_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info, - usb_conv_info_t *usb_conv_info) + usb_conv_info_t *usb_conv_info, usb_data_t *usb_data) { proto_item *item = NULL; proto_tree *tree = NULL; @@ -1856,7 +1938,7 @@ break; default: next_tvb = tvb_new_subset(tvb, offset, next_len, next_len); - if (dissector_try_uint(usb_descriptor_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent_tree)) { + if (dissector_try_uint_new(usb_descriptor_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent_tree, TRUE, usb_data)) { offset += next_len; } else { offset = dissect_usb_unknown_descriptor(pinfo, parent_tree, tvb, offset, usb_trans_info, usb_conv_info); @@ -1891,7 +1973,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* descriptor index */ proto_tree_add_item(tree, hf_usb_descriptor_index, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -1921,7 +2004,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info, usb_conv_info_t *usb_conv_info, - guint bus_id, guint device_address) + guint bus_id, guint device_address, + usb_data_t *usb_data) { col_append_fstr(pinfo->cinfo, COL_INFO, " %s", @@ -1932,7 +2016,7 @@ offset = dissect_usb_device_descriptor(pinfo, tree, tvb, offset, usb_trans_info, bus_id, device_address); break; case USB_DT_CONFIG: - offset = dissect_usb_configuration_descriptor(pinfo, tree, tvb, offset, usb_trans_info, usb_conv_info); + offset = dissect_usb_configuration_descriptor(pinfo, tree, tvb, offset, usb_trans_info, usb_conv_info, usb_data); break; case USB_DT_STRING: offset = dissect_usb_string_descriptor(pinfo, tree, tvb, offset, usb_trans_info, usb_conv_info); @@ -1975,7 +2059,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* zero */ proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -1997,7 +2082,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* alternate setting */ proto_tree_add_item(tree, hf_usb_bAlternateSetting, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2019,7 +2105,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* zero */ proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2042,7 +2129,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* status */ /* XXX - show bits */ @@ -2065,7 +2153,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* device address */ proto_tree_add_item(tree, hf_usb_device_address, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2087,7 +2176,8 @@ tvbuff_t *tvb _U_, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { return offset; } @@ -2105,7 +2195,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* configuration value */ proto_tree_add_item(tree, hf_usb_bConfigurationValue, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2127,7 +2218,8 @@ tvbuff_t *tvb _U_, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { return offset; } @@ -2145,7 +2237,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* feature selector */ proto_tree_add_item(tree, hf_usb_wFeatureSelector, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2168,7 +2261,8 @@ tvbuff_t *tvb _U_, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { return offset; } @@ -2186,7 +2280,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* alternate setting */ proto_tree_add_item(tree, hf_usb_bAlternateSetting, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2208,7 +2303,8 @@ tvbuff_t *tvb _U_, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { return offset; } @@ -2226,7 +2322,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* zero */ proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2249,7 +2346,8 @@ tvbuff_t *tvb _U_, int offset, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_, - guint bus_id _U_, guint device_address _U_) + guint bus_id _U_, guint device_address _U_, + usb_data_t *usb_data _U_) { /* frame number */ proto_tree_add_item(tree, hf_usb_wFrameNumber, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2263,7 +2361,8 @@ tvbuff_t *tvb, int offset, usb_trans_info_t *usb_trans_info, usb_conv_info_t *usb_conv_info, - guint bus_id, guint device_address); + guint bus_id, guint device_address, + usb_data_t *usb_data); typedef struct _usb_setup_dissector_table_t { guint8 request; @@ -2739,7 +2838,7 @@ if (try_heuristics && dissector_try_heuristic(heur_bulk_subdissector_list, next_tvb, pinfo, parent, NULL)) { return; } - else if (dissector_try_uint(usb_bulk_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent)) { + else if (dissector_try_uint_new(usb_bulk_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent, TRUE, usb_data)) { return; } } @@ -2771,7 +2870,7 @@ if (try_heuristics && dissector_try_heuristic(heur_interrupt_subdissector_list, next_tvb, pinfo, parent, NULL)) { return; } - else if (dissector_try_uint(usb_interrupt_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent)) { + else if (dissector_try_uint_new(usb_interrupt_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent, TRUE, usb_data)) { return; } } @@ -2832,7 +2931,7 @@ if (dissector) { offset = dissector(pinfo, setup_tree, tvb, offset, usb_trans_info, - usb_conv_info, bus_id, device_address); + usb_conv_info, bus_id, device_address, usb_data); } else { proto_tree_add_item(setup_tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -2875,7 +2974,7 @@ if (try_heuristics && dissector_try_heuristic(heur_control_subdissector_list, next_tvb, pinfo, setup_tree, NULL)) { return; } - if (dissector_try_uint(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, setup_tree)) { + if (dissector_try_uint_new(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, setup_tree, TRUE, usb_data)) { return; } /* Else no class dissector, just display generic fields */ @@ -2920,7 +3019,7 @@ if (try_heuristics && dissector_try_heuristic(heur_control_subdissector_list, next_tvb, pinfo, parent, NULL)) { return; } - if (dissector_try_uint(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent)) { + if (dissector_try_uint_new(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent, TRUE, usb_data)) { return; } } @@ -2987,7 +3086,7 @@ if (try_heuristics && dissector_try_heuristic(heur_control_subdissector_list, next_tvb, pinfo, parent, NULL)) { return; } - if (dissector_try_uint(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent)) { + if (dissector_try_uint_new(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent, TRUE, usb_data)) { return; } @@ -3013,7 +3112,7 @@ if (dissector) { offset = dissector(pinfo, parent, tvb, offset, usb_conv_info->usb_trans_info, - usb_conv_info, bus_id, device_address); + usb_conv_info, bus_id, device_address, usb_data); } else { if (tvb_reported_length_remaining(tvb, offset) != 0) { proto_tree_add_text(parent, tvb, offset, -1, "CONTROL response data"); @@ -3317,7 +3416,7 @@ if (device_protocol_data && device_protocol_data->bus_id == bus_id && device_protocol_data->device_address == device_address && dissector_try_uint_new(protocol_to_dissector, (guint32) device_protocol_data->protocol, next_tvb, pinfo, parent, FALSE, usb_data)) { - offset += tvb_length_remaining(tvb, offset); + offset += tvb_length(next_tvb); } else { device_product_data_t *device_product_data; @@ -3326,11 +3425,11 @@ device_product_data->device_address == device_address && dissector_try_uint_new(product_to_dissector, (guint32) (device_product_data->vendor << 16 | device_product_data->product), next_tvb, pinfo, parent, FALSE, usb_data)) { - offset += tvb_length_remaining(tvb, offset); + offset += tvb_length(next_tvb); } } } else { - offset += tvb_length_remaining(tvb, offset); + offset += tvb_length(next_tvb); } if (tvb_reported_length_remaining(tvb, offset) != 0) { @@ -3752,11 +3851,36 @@ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_usb_bInterfaceSubClass_cdc, + { "bInterfaceSubClass", "usb.bInterfaceSubClass", + FT_UINT8, BASE_HEX | BASE_EXT_STRING, &ext_usb_com_subclass_vals, 0x0, + NULL, HFILL }}, + + { &hf_usb_bInterfaceSubClass_hid, + { "bInterfaceSubClass", "usb.bInterfaceSubClass", + FT_UINT8, BASE_HEX, VALS(usb_hid_subclass_vals), 0x0, + NULL, HFILL }}, + { &hf_usb_bInterfaceProtocol, { "bInterfaceProtocol", "usb.bInterfaceProtocol", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_usb_bInterfaceProtocol_cdc, + { "bInterfaceProtocol", "usb.bInterfaceProtocol", + FT_UINT8, BASE_HEX, VALS(usb_cdc_protocol_vals), 0x0, + NULL, HFILL }}, + + { &hf_usb_bInterfaceProtocol_cdc_data, + { "bInterfaceProtocol", "usb.bInterfaceProtocol", + FT_UINT8, BASE_HEX, VALS(usb_cdc_data_protocol_vals), 0x0, + NULL, HFILL }}, + + { &hf_usb_bInterfaceProtocol_hid_boot, + { "bInterfaceProtocol", "usb.bInterfaceProtocol", + FT_UINT8, BASE_HEX, VALS(usb_hid_boot_protocol_vals), 0x0, + NULL, HFILL }}, + { &hf_usb_iInterface, { "iInterface", "usb.iInterface", FT_UINT8, BASE_DEC, NULL, 0x0, diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-uts.c wireshark-1.12.0~201311020920/epan/dissectors/packet-uts.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-uts.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-uts.c 2013-11-02 02:12:36.000000000 +0000 @@ -130,7 +130,7 @@ testchar(tvb, pinfo, 1, MATCH, EOT, NULL) && testchar(tvb, pinfo, 2, MATCH, ETX, NULL)) { msg_type = NOTRAFFIC; - col_add_str(pinfo->cinfo, COL_INFO, "No Traffic"); + col_set_str(pinfo->cinfo, COL_INFO, "No Traffic"); } else { if (testchar(tvb, pinfo, 0, MATCH, SOH, NULL) && testchar(tvb, pinfo, 1, FETCH, 0, (gchar *)&rid) && @@ -138,23 +138,23 @@ testchar(tvb, pinfo, 3, FETCH, 0, (gchar *)&did)) { offset = 4; if (testchar(tvb, pinfo, offset, MATCH, ETX, NULL)) { - col_add_str(pinfo->cinfo, COL_INFO, "General Poll"); + col_set_str(pinfo->cinfo, COL_INFO, "General Poll"); set_addr(pinfo, DST, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, '1', NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL)) { ack_start = offset; if (sid == GSID && did == GDID) { - col_add_str(pinfo->cinfo, COL_INFO, "General Poll + ACK"); + col_set_str(pinfo->cinfo, COL_INFO, "General Poll + ACK"); set_addr(pinfo, DST, rid, sid, did); } else if (sid != GSID && did == GDID) { - col_add_str(pinfo->cinfo, COL_INFO, "Specific Poll + ACK"); + col_set_str(pinfo->cinfo, COL_INFO, "Specific Poll + ACK"); set_addr(pinfo, DST, rid, sid, did); } else if (sid != GSID && did != GDID) { - col_add_str(pinfo->cinfo, COL_INFO, "No Traffic + ACK"); + col_set_str(pinfo->cinfo, COL_INFO, "No Traffic + ACK"); set_addr(pinfo, SRC, rid, sid, did); } else { - col_add_str(pinfo->cinfo, COL_INFO, "Unknown Message Format"); + col_set_str(pinfo->cinfo, COL_INFO, "Unknown Message Format"); if ((pinfo->pseudo_header->sita.sita_flags & SITA_FRAME_DIR) == SITA_FRAME_DIR_TXED) { set_addr(pinfo, DST, rid, sid, did); /* if the ACN sent it, the address is of the destination... the terminal */ } else { @@ -166,14 +166,14 @@ testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL) && sid != GSID && did == GDID) { nak_start = offset; - col_add_str(pinfo->cinfo, COL_INFO, "Retransmit Request"); + col_set_str(pinfo->cinfo, COL_INFO, "Retransmit Request"); set_addr(pinfo, DST, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, BEL, NULL) && testchar(tvb, pinfo, offset+1, MATCH, STX, NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL)) { header_length = offset+2; msgwaiting_start = offset; - col_add_str(pinfo->cinfo, COL_INFO, "Message Waiting"); + col_set_str(pinfo->cinfo, COL_INFO, "Message Waiting"); set_addr(pinfo, DST, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, '1', NULL) && @@ -181,12 +181,12 @@ ack_start = offset; header_length = offset+3; stx_start = offset+2; - col_add_str(pinfo->cinfo, COL_INFO, "Text + ACK"); + col_set_str(pinfo->cinfo, COL_INFO, "Text + ACK"); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, STX, NULL)) { header_length = offset+1; stx_start = offset; - col_add_str(pinfo->cinfo, COL_INFO, "Text"); + col_set_str(pinfo->cinfo, COL_INFO, "Text"); if ((pinfo->pseudo_header->sita.sita_flags & SITA_FRAME_DIR) == SITA_FRAME_DIR_TXED) { set_addr(pinfo, DST, rid, sid, did); /* if the ACN sent it, the address is of the destination... the terminal */ } else { @@ -196,19 +196,19 @@ testchar(tvb, pinfo, offset+1, MATCH, ENQ, NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL)) { replyrequest_start = offset; - col_add_str(pinfo->cinfo, COL_INFO, "Reply Request"); + col_set_str(pinfo->cinfo, COL_INFO, "Reply Request"); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, '?', NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL)) { busy_start = offset; - col_add_str(pinfo->cinfo, COL_INFO, "Busy"); + col_set_str(pinfo->cinfo, COL_INFO, "Busy"); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, ';', NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL)) { notbusy_start = offset; - col_add_str(pinfo->cinfo, COL_INFO, "Not Busy"); + col_set_str(pinfo->cinfo, COL_INFO, "Not Busy"); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, '1', NULL) && @@ -217,7 +217,7 @@ testchar(tvb, pinfo, offset+4, MATCH, ETX, NULL)) { notbusy_start = offset+2; ack_start = offset; - col_add_str(pinfo->cinfo, COL_INFO, "Not Busy + ACK"); + col_set_str(pinfo->cinfo, COL_INFO, "Not Busy + ACK"); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, '1', NULL) && diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-v5ua.c wireshark-1.12.0~201311020920/epan/dissectors/packet-v5ua.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-v5ua.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-v5ua.c 2013-11-02 02:12:36.000000000 +0000 @@ -1311,7 +1311,7 @@ message_type = tvb_get_guint8(common_header_tvb, COMMON_HEADER_MSG_TYPE_OFFSET); /* Add message type into info column */ - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(message_class * 256 + message_type, msg_class_type_values_short, "UNKNOWN")); + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(message_class * 256 + message_type, msg_class_type_values_short, "UNKNOWN")); if (v5ua_tree) { diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-vcdu.c wireshark-1.12.0~201311020920/epan/dissectors/packet-vcdu.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-vcdu.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-vcdu.c 2013-11-02 02:12:36.000000000 +0000 @@ -175,7 +175,7 @@ uat_channel_t *ud = (uat_channel_t *)p; if (ud->channel >= 64) { - *err = wmem_strdup_printf(wmem_packet_scope(), "Channel must be between 0-63."); + *err = g_strdup("Channel must be between 0-63."); return; } } @@ -402,7 +402,7 @@ new_offset = offset + 2 + new_ptr; packet_boundary = - pinfo->iplen - IP_HEADER_LENGTH - VCDU_HEADER_LENGTH + tvb_reported_length(tvb) - VCDU_HEADER_LENGTH - CCSDS_PRIMARY_HEADER_LENGTH - CCSDS_SECONDARY_HEADER_LENGTH; while ( ((new_offset-offset+2) < packet_boundary) && ((new_offset-offset+2) >= 4) ) diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-vrrp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-vrrp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-vrrp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-vrrp.c 2013-11-02 02:12:36.000000000 +0000 @@ -109,55 +109,61 @@ col_clear(pinfo->cinfo, COL_INFO); ver_type = tvb_get_guint8(tvb, 0); - col_add_fstr(pinfo->cinfo, COL_INFO, "%s (v%u)", - "Announcement", hi_nibble(ver_type)); + col_add_fstr(pinfo->cinfo, COL_INFO, "Announcement (v%u)", + hi_nibble(ver_type)); ti = proto_tree_add_item(tree, proto_vrrp, tvb, 0, -1, ENC_NA); vrrp_tree = proto_item_add_subtree(ti, ett_vrrp); + priority = tvb_get_guint8(tvb, 2); + addr_count = tvb_get_guint8(tvb, 3); + tv = proto_tree_add_uint_format(vrrp_tree, hf_vrrp_ver_type, tvb, offset, 1, ver_type, "Version %u, Packet type %u (%s)", hi_nibble(ver_type), lo_nibble(ver_type), val_to_str_const(lo_nibble(ver_type), vrrp_type_vals, "Unknown")); ver_type_tree = proto_item_add_subtree(tv, ett_vrrp_ver_type); - proto_tree_add_uint(ver_type_tree, hf_vrrp_version, tvb, - offset, 1, ver_type); - proto_tree_add_uint(ver_type_tree, hf_vrrp_type, tvb, offset, 1, ver_type); - offset++; - - proto_tree_add_item(vrrp_tree, hf_vrrp_virt_rtr_id, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - priority = tvb_get_guint8(tvb, offset); - proto_tree_add_uint_format(vrrp_tree, hf_vrrp_prio, tvb, offset, 1, priority, "Priority: %u (%s)", - priority, - val_to_str_const(priority, vrrp_prio_vals, "Non-default backup priority")); - offset++; - - addr_count = tvb_get_guint8(tvb, offset); - proto_tree_add_uint(vrrp_tree, hf_vrrp_addr_count, tvb, - offset, 1, addr_count); - offset++; - - switch(hi_nibble(ver_type)) { - case 3: - /* 4 bits reserved (mbz) + 12 bits interval */ - proto_tree_add_item(vrrp_tree, hf_vrrp_reserved_mbz, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(vrrp_tree, hf_vrrp_short_adver_int, tvb, offset, 2, ENC_BIG_ENDIAN); - offset+=2; - break; - case 2: - default: - /* 1 byte auth type + 1 byte interval */ - auth_type = tvb_get_guint8(tvb, offset); - proto_tree_add_item(vrrp_tree, hf_vrrp_auth_type, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - proto_tree_add_item(vrrp_tree, hf_vrrp_adver_int, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - break; - } + + if(ver_type_tree){ + proto_tree_add_uint(ver_type_tree, hf_vrrp_version, tvb, + offset, 1, ver_type); + proto_tree_add_uint(ver_type_tree, hf_vrrp_type, tvb, offset, 1, ver_type); + offset++; + + proto_tree_add_item(vrrp_tree, hf_vrrp_virt_rtr_id, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + + proto_tree_add_uint_format(vrrp_tree, hf_vrrp_prio, tvb, offset, 1, priority, "Priority: %u (%s)", + priority, + val_to_str_const(priority, vrrp_prio_vals, "Non-default backup priority")); + offset++; + + proto_tree_add_uint(vrrp_tree, hf_vrrp_addr_count, tvb, + offset, 1, addr_count); + offset++; + + switch(hi_nibble(ver_type)) { + case 3: + /* 4 bits reserved (mbz) + 12 bits interval */ + proto_tree_add_item(vrrp_tree, hf_vrrp_reserved_mbz, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(vrrp_tree, hf_vrrp_short_adver_int, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; + break; + case 2: + default: + /* 1 byte auth type + 1 byte interval */ + auth_type = tvb_get_guint8(tvb, offset); + proto_tree_add_item(vrrp_tree, hf_vrrp_auth_type, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + + proto_tree_add_item(vrrp_tree, hf_vrrp_adver_int, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + break; + } + }else{ + offset+=6; + } checksum_item = proto_tree_add_item(vrrp_tree, hf_vrrp_checksum, tvb, offset, 2, ENC_BIG_ENDIAN); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-wai.c wireshark-1.12.0~201311020920/epan/dissectors/packet-wai.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-wai.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-wai.c 2013-11-02 02:12:36.000000000 +0000 @@ -910,7 +910,7 @@ NULL, wai_tree); if (new_tvb) { - col_add_str(pinfo->cinfo, COL_INFO, "Last fragment of message, data dissected"); + col_set_str(pinfo->cinfo, COL_INFO, "Last fragment of message, data dissected"); col_append_sep_str(pinfo->cinfo, COL_INFO, ": ", subtype_name); next_tvb=new_tvb; length = tvb_reported_length (next_tvb); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-wccp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-wccp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-wccp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-wccp.c 2013-11-02 02:12:36.000000000 +0000 @@ -675,8 +675,6 @@ return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "WCCP"); - col_clear(pinfo->cinfo, COL_INFO); - col_add_str(pinfo->cinfo, COL_INFO, val_to_str(wccp_message_type, wccp_type_vals, "Unknown WCCP message (%u)")); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-wcp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-wcp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-wcp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-wcp.c 2013-11-02 02:12:36.000000000 +0000 @@ -321,7 +321,7 @@ /*XXX should test seq to be sure it the last + 1 !! */ - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(cmd, cmd_string, "Unknown")); + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(cmd, cmd_string, "Unknown")); if ( cmd == 0xf) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(ext_cmd, ext_cmd_string, "Unknown")); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-websocket.c wireshark-1.12.0~201311020920/epan/dissectors/packet-websocket.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-websocket.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-websocket.c 2013-11-02 02:12:36.000000000 +0000 @@ -376,11 +376,11 @@ proto_tree_add_item(ws_tree, hf_ws_opcode, tvb, 0, 1, ENC_NA); opcode = tvb_get_guint8(tvb, 0) & MASK_WS_OPCODE; col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(opcode, ws_opcode_vals, "Unknown Opcode")); - col_append_fstr(pinfo->cinfo, COL_INFO, " %s", fin ? "[FIN]" : ""); + col_append_str(pinfo->cinfo, COL_INFO, fin ? " [FIN]" : " "); /* Add Mask bit to the tree */ proto_tree_add_item(ws_tree, hf_ws_mask, tvb, 1, 1, ENC_NA); - col_append_fstr(pinfo->cinfo, COL_INFO, " %s", mask ? "[MASKED]" : ""); + col_append_str(pinfo->cinfo, COL_INFO, mask ? " [MASKED]" : " "); /* (Extended) Payload Length */ ti_len = proto_tree_add_item(ws_tree, hf_ws_payload_length, tvb, 1, 1, ENC_NA); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-wps.c wireshark-1.12.0~201311020920/epan/dissectors/packet-wps.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-wps.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-wps.c 2013-11-02 02:12:36.000000000 +0000 @@ -1675,7 +1675,7 @@ if (pi != NULL) proto_item_append_text(pi, " (Wifi Alliance, WifiProtectedSetup)"); if (pinfo != NULL) - col_append_fstr(pinfo->cinfo, COL_INFO, ", WPS"); + col_append_str(pinfo->cinfo, COL_INFO, ", WPS"); /* Flag field, if msg-len flag set, add approriate field */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-x25.c wireshark-1.12.0~201311020920/epan/dissectors/packet-x25.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-x25.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-x25.c 2013-11-02 02:12:36.000000000 +0000 @@ -1284,7 +1284,7 @@ guint x25_pkt_len; int modulo; guint16 vc; - dissector_handle_t dissect = NULL; + dissector_handle_t dissect; gboolean toa; /* TOA/NPI address format */ guint16 bytes0_1; guint8 pkt_type; @@ -1294,7 +1294,6 @@ gboolean m_bit_set; gint payload_len; guint32 frag_key; - void *saved_private_data; fragment_head *fd_head; @@ -1583,7 +1582,7 @@ */ dissect = dissector_get_uint_handle(x25_subdissector_table, spi); if (dissect != NULL) - x25_hash_add_proto_start(vc, pinfo->fd->num, dissect); + x25_hash_add_proto_start(vc, pinfo->fd->num, dissect); } /* @@ -2020,14 +2019,10 @@ if (!next_tvb) next_tvb = tvb_new_subset_remaining(tvb, localoffset); - saved_private_data = pinfo->private_data; - pinfo->private_data = &q_bit_set; - /* See if there's already a dissector for this circuit. */ if (try_circuit_dissector(CT_X25, vc, pinfo->fd->num, next_tvb, pinfo, - tree)) { - pinfo->private_data = saved_private_data; - return; /* found it and dissected it */ + tree, &q_bit_set)) { + return; /* found it and dissected it */ } /* Did the user suggest QLLC/SNA? */ @@ -2035,8 +2030,7 @@ /* Yes - dissect it as QLLC/SNA. */ if (!pinfo->fd->flags.visited) x25_hash_add_proto_start(vc, pinfo->fd->num, qllc_handle); - call_dissector(qllc_handle, next_tvb, pinfo, tree); - pinfo->private_data = saved_private_data; + call_dissector_with_data(qllc_handle, next_tvb, pinfo, tree, &q_bit_set); return; } @@ -2050,7 +2044,6 @@ if (!pinfo->fd->flags.visited) x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle); call_dissector(ositp_handle, next_tvb, pinfo, tree); - pinfo->private_data = saved_private_data; return; } } @@ -2064,14 +2057,12 @@ if (!pinfo->fd->flags.visited) x25_hash_add_proto_start(vc, pinfo->fd->num, ip_handle); call_dissector(ip_handle, next_tvb, pinfo, tree); - pinfo->private_data = saved_private_data; return; case NLPID_ISO8473_CLNP: if (!pinfo->fd->flags.visited) x25_hash_add_proto_start(vc, pinfo->fd->num, clnp_handle); call_dissector(clnp_handle, next_tvb, pinfo, tree); - pinfo->private_data = saved_private_data; return; } } @@ -2079,13 +2070,11 @@ /* Try the heuristic dissectors. */ if (dissector_try_heuristic(x25_heur_subdissector_list, next_tvb, pinfo, tree, NULL)) { - pinfo->private_data = saved_private_data; return; } /* All else failed; dissect it as raw data */ call_dissector(data_handle, next_tvb, pinfo, tree); - pinfo->private_data = saved_private_data; } /* diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-x29.c wireshark-1.12.0~201311020920/epan/dissectors/packet-x29.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-x29.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-x29.c 2013-11-02 02:12:36.000000000 +0000 @@ -73,13 +73,13 @@ { 0, NULL }, }; -static void -dissect_x29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_x29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { int offset = 0; - proto_tree *x29_tree = NULL; + proto_tree *x29_tree; proto_item *ti; - gboolean *q_bit_set = (gboolean *)pinfo->private_data; + gboolean *q_bit_set = (gboolean *)data; guint8 msg_code; guint8 error_type; guint8 type_ref; @@ -89,11 +89,8 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "X.29"); col_clear(pinfo->cinfo, COL_INFO); - if (tree) { - ti = proto_tree_add_item(tree, proto_x29, tvb, offset, -1, - ENC_NA); - x29_tree = proto_item_add_subtree(ti, ett_x29); - } + ti = proto_tree_add_item(tree, proto_x29, tvb, offset, -1, ENC_NA); + x29_tree = proto_item_add_subtree(ti, ett_x29); if (*q_bit_set) { /* @@ -234,6 +231,8 @@ } } } + + return tvb_length(tvb); } void @@ -267,6 +266,6 @@ { dissector_handle_t x29_handle; - x29_handle = create_dissector_handle(dissect_x29, proto_x29); + x29_handle = new_create_dissector_handle(dissect_x29, proto_x29); dissector_add_uint("x.25.spi", NLPID_SPI_X_29, x29_handle); } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-x509af.c wireshark-1.12.0~201311020920/epan/dissectors/packet-x509af.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-x509af.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-x509af.c 2013-11-02 02:12:36.000000000 +0000 @@ -234,7 +234,7 @@ static int dissect_x509af_T_parameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 82 "../../asn1/x509af/x509af.cnf" - offset=call_ber_oid_callback(algorithm_id, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(algorithm_id, tvb, offset, actx->pinfo, tree, NULL); @@ -408,7 +408,7 @@ /* skip past the T and L */ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag); offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-x509ce.c wireshark-1.12.0~201311020920/epan/dissectors/packet-x509ce.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-x509ce.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-x509ce.c 2013-11-02 02:12:36.000000000 +0000 @@ -352,7 +352,7 @@ static int dissect_x509ce_OtherNameValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 181 "../../asn1/x509ce/x509ce.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -604,7 +604,7 @@ static int dissect_x509ce_T_qualifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 171 "../../asn1/x509ce/x509ce.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-x509if.c wireshark-1.12.0~201311020920/epan/dissectors/packet-x509if.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-x509if.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-x509if.c 2013-11-02 02:12:36.000000000 +0000 @@ -363,7 +363,7 @@ static int dissect_x509if_T_values_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 315 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -388,7 +388,7 @@ static int dissect_x509if_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 285 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback("unknown", tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback("unknown", tvb, offset, actx->pinfo, tree, NULL); @@ -409,7 +409,7 @@ static int dissect_x509if_T_contextValues_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 297 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -531,7 +531,7 @@ int dissect_x509if_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 303 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -552,7 +552,7 @@ static int dissect_x509if_T_assertion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 309 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -582,7 +582,7 @@ static int dissect_x509if_T_ca_contextValues_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 186 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -772,7 +772,7 @@ const char *name = NULL; const char *orig_oid = actx->external.direct_reference; - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); /* in dissecting the value we may have overridden the OID of the value - which is a problem if there are multiple values */ @@ -821,7 +821,7 @@ static int dissect_x509if_T_distingAttrValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 330 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -1379,7 +1379,7 @@ static int dissect_x509if_T_ra_selectedValues_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 276 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -1413,7 +1413,7 @@ static int dissect_x509if_T_ra_values_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 282 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -1475,7 +1475,7 @@ static int dissect_x509if_T_contextValue_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 321 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -1576,7 +1576,7 @@ static int dissect_x509if_T_restrictionValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 327 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); @@ -1697,7 +1697,7 @@ static int dissect_x509if_T_selectedValues_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 291 "../../asn1/x509if/x509if.cnf" - offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree); + offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp-conference.c wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp-conference.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp-conference.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp-conference.c 2013-11-02 02:12:36.000000000 +0000 @@ -91,7 +91,7 @@ /*{NAME, "sidebars-by-val", xmpp_conf_sidebars_by_val, ONE},*/ }; - col_append_fstr(pinfo->cinfo, COL_INFO, "CONFERENC-INFO "); + col_append_str(pinfo->cinfo, COL_INFO, "CONFERENC-INFO "); cinfo_item = proto_tree_add_item(tree, hf_xmpp_conf_info, tvb, element->offset, element->length, ENC_BIG_ENDIAN); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp-core.c wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp-core.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp-core.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp-core.c 2013-11-02 02:12:36.000000000 +0000 @@ -157,7 +157,6 @@ xmpp_display_attrs(xmpp_iq_tree, packet, pinfo, tvb, attrs_info, array_length(attrs_info)); - col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "IQ(%s) ", attr_type?attr_type->value:""); xmpp_display_elems(xmpp_iq_tree, packet, pinfo, tvb, elems_info, array_length(elems_info)); @@ -308,8 +307,7 @@ xmpp_element_t *show, *priority; - col_clear(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_INFO, "PRESENCE "); + col_set_str(pinfo->cinfo, COL_INFO, "PRESENCE "); presence_item = proto_tree_add_item(tree, hf_xmpp_presence, tvb, packet->offset, packet->length, ENC_BIG_ENDIAN); presence_tree = proto_item_add_subtree(presence_item, ett_xmpp_presence); @@ -397,8 +395,7 @@ conversation_t *conversation; xmpp_conv_info_t *xmpp_info; - col_clear(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_INFO, "MESSAGE "); + col_set_str(pinfo->cinfo, COL_INFO, "MESSAGE "); id = xmpp_get_attr(packet, "id"); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp-gtalk.c wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp-gtalk.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp-gtalk.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp-gtalk.c 2013-11-02 02:12:36.000000000 +0000 @@ -218,7 +218,7 @@ {NAME, "relay", xmpp_gtalk_jingleinfo_relay, ONE} }; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(google:jingleinfo) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(google:jingleinfo) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); @@ -356,7 +356,7 @@ {NAME, "item", xmpp_gtalk_nosave_item, MANY}, }; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(google:nosave) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(google:nosave) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); @@ -418,7 +418,7 @@ {"q", -1, FALSE, TRUE, NULL, NULL} }; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(google:mail:notify) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(google:mail:notify) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); @@ -446,7 +446,7 @@ {NAME,"mail-thread-info", xmpp_gtalk_mail_mail_info, MANY} }; - col_append_fstr(pinfo->cinfo, COL_INFO, "MAILBOX "); + col_append_str(pinfo->cinfo, COL_INFO, "MAILBOX "); mail_item = proto_tree_add_item(tree, hf_xmpp_gtalk_mail_mailbox, tvb, element->offset, element->length, ENC_BIG_ENDIAN); mail_tree = proto_item_add_subtree(mail_item, ett_xmpp_gtalk_mail_mailbox); @@ -544,7 +544,7 @@ void xmpp_gtalk_mail_new_mail(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element) { - col_append_fstr(pinfo->cinfo, COL_INFO, "NEW-MAIL "); + col_append_str(pinfo->cinfo, COL_INFO, "NEW-MAIL "); proto_tree_add_item(tree, hf_xmpp_gtalk_mail_new_mail, tvb, element->offset, element->length, ENC_BIG_ENDIAN); xmpp_unknown(tree, tvb, pinfo, element); @@ -575,7 +575,7 @@ xmpp_element_t *status, *show, *invisible; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(google:shared-status) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(google:shared-status) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp-jingle.c wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp-jingle.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp-jingle.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp-jingle.c 2013-11-02 02:12:36.000000000 +0000 @@ -878,7 +878,7 @@ {NAME, "stun", xmpp_jinglenodes_relay_stun_tracker, ONE}, }; - col_append_fstr(pinfo->cinfo, COL_INFO, "SERVICES "); + col_append_str(pinfo->cinfo, COL_INFO, "SERVICES "); services_item = proto_tree_add_item(tree, hf_xmpp_services, tvb, element->offset, element->length, ENC_BIG_ENDIAN); services_tree = proto_item_add_subtree(services_item, ett_xmpp_services); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp-other.c wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp-other.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp-other.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp-other.c 2013-11-02 02:12:36.000000000 +0000 @@ -81,7 +81,7 @@ {"jid", hf_xmpp_iq_bind_jid, FALSE, TRUE, NULL, NULL} }; - col_append_fstr(pinfo->cinfo, COL_INFO, "BIND "); + col_append_str(pinfo->cinfo, COL_INFO, "BIND "); bind_item = proto_tree_add_item(tree, hf_xmpp_iq_bind, tvb, element->offset, element->length, ENC_BIG_ENDIAN); bind_tree = proto_item_add_subtree(bind_item, ett_xmpp_iq_bind); @@ -107,7 +107,7 @@ session_item = proto_tree_add_item(tree, hf_xmpp_iq_session, tvb, element->offset, element->length, ENC_BIG_ENDIAN); session_tree = proto_item_add_subtree(session_item, ett_xmpp_iq_session); - col_append_fstr(pinfo->cinfo, COL_INFO, "SESSION "); + col_append_str(pinfo->cinfo, COL_INFO, "SESSION "); xmpp_display_attrs(session_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info)); xmpp_display_elems(session_tree, element, pinfo, tvb, NULL, 0); @@ -126,7 +126,7 @@ xmpp_element_t *cdata; - col_append_fstr(pinfo->cinfo, COL_INFO, "VCARD "); + col_append_str(pinfo->cinfo, COL_INFO, "VCARD "); vcard_item = proto_tree_add_item(tree, hf_xmpp_vcard, tvb, element->offset, element->length, ENC_BIG_ENDIAN); vcard_tree = proto_item_add_subtree(vcard_item, ett_xmpp_vcard); @@ -184,7 +184,7 @@ xmpp_element_t *item; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(disco#items) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(disco#items) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); query_tree = proto_item_add_subtree(query_item, ett_xmpp_query); @@ -234,7 +234,7 @@ {NAME, "item", xmpp_roster_item, MANY}, }; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(jabber:iq:roster) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(jabber:iq:roster) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); query_tree = proto_item_add_subtree(query_item, ett_xmpp_query); @@ -291,7 +291,7 @@ xmpp_element_t *identity, *feature, *x_data; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(disco#info) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(disco#info) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); query_tree = proto_item_add_subtree(query_item, ett_xmpp_query); @@ -368,7 +368,7 @@ xmpp_element_t *streamhost, *streamhost_used, *activate, *udpsuccess; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(bytestreams) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(bytestreams) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); query_tree = proto_item_add_subtree(query_item, ett_xmpp_query); @@ -480,7 +480,7 @@ xmpp_element_t *file, *feature_neg; - col_append_fstr(pinfo->cinfo, COL_INFO, "SI "); + col_append_str(pinfo->cinfo, COL_INFO, "SI "); si_item = proto_tree_add_item(tree, hf_xmpp_si, tvb, element->offset, element->length, ENC_BIG_ENDIAN); si_tree = proto_item_add_subtree(si_item, ett_xmpp_si); @@ -732,7 +732,7 @@ {"stanza", -1, FALSE, TRUE, xmpp_val_enum_list, stanza_array} }; - col_append_fstr(pinfo->cinfo, COL_INFO, "IBB-OPEN "); + col_append_str(pinfo->cinfo, COL_INFO, "IBB-OPEN "); open_item = proto_tree_add_item(tree, hf_xmpp_ibb_open, tvb, element->offset, element->length, ENC_BIG_ENDIAN); open_tree = proto_item_add_subtree(open_item, ett_xmpp_ibb_open); @@ -752,7 +752,7 @@ {"sid", -1, TRUE, TRUE, NULL, NULL} }; - col_append_fstr(pinfo->cinfo, COL_INFO, "IBB-CLOSE "); + col_append_str(pinfo->cinfo, COL_INFO, "IBB-CLOSE "); close_item = proto_tree_add_item(tree, hf_xmpp_ibb_close, tvb, element->offset, element->length, ENC_BIG_ENDIAN); close_tree = proto_item_add_subtree(close_item, ett_xmpp_ibb_close); @@ -774,7 +774,7 @@ {"value", -1, FALSE, FALSE, NULL, NULL} }; - col_append_fstr(pinfo->cinfo, COL_INFO, "IBB-DATA "); + col_append_str(pinfo->cinfo, COL_INFO, "IBB-DATA "); data_item = proto_tree_add_item(tree, hf_xmpp_ibb_data, tvb, element->offset, element->length, ENC_BIG_ENDIAN); data_tree = proto_item_add_subtree(data_item, ett_xmpp_ibb_data); @@ -1082,7 +1082,7 @@ xmpp_element_t *x_data; /*TODO destroy*/ - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(muc#owner) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(muc#owner) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); query_tree = proto_item_add_subtree(query_item, ett_xmpp_query); @@ -1111,7 +1111,7 @@ xmpp_element_t *item; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(muc#admin) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(muc#admin) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); query_tree = proto_item_add_subtree(query_item, ett_xmpp_query); @@ -1140,7 +1140,7 @@ {"value", -1, FALSE, TRUE, NULL, NULL} }; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(jabber:iq:last) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(jabber:iq:last) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); query_tree = proto_item_add_subtree(query_item, ett_xmpp_query); @@ -1171,7 +1171,7 @@ xmpp_element_t *name, *version, *os; - col_append_fstr(pinfo->cinfo, COL_INFO, "QUERY(jabber:iq:version) "); + col_append_str(pinfo->cinfo, COL_INFO, "QUERY(jabber:iq:version) "); query_item = proto_tree_add_item(tree, hf_xmpp_query, tvb, element->offset, element->length, ENC_BIG_ENDIAN); query_tree = proto_item_add_subtree(query_item, ett_xmpp_query); @@ -1208,7 +1208,7 @@ {"xmlns", hf_xmpp_xmlns, TRUE, TRUE, NULL, NULL}, }; - col_append_fstr(pinfo->cinfo, COL_INFO, "PING "); + col_append_str(pinfo->cinfo, COL_INFO, "PING "); ping_item = proto_tree_add_item(tree, hf_xmpp_ping, tvb, element->offset, element->length, ENC_BIG_ENDIAN); ping_tree = proto_item_add_subtree(ping_item, ett_xmpp_ping); diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp.c wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-xmpp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-xmpp.c 2013-11-02 02:12:36.000000000 +0000 @@ -544,8 +544,7 @@ }else { xmpp_proto_tree_show_first_child(xmpp_tree); expert_add_info_format(pinfo, xmpp_tree, &ei_xmpp_packet_unknown, "Unknown packet: %s", packet->name); - col_clear(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_INFO, "UNKNOWN PACKET "); + col_set_str(pinfo->cinfo, COL_INFO, "UNKNOWN PACKET "); } /*appends to COL_INFO information about src or dst*/ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-zbee-aps.c wireshark-1.12.0~201311020920/epan/dissectors/packet-zbee-aps.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-zbee-aps.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-zbee-aps.c 2013-11-02 02:12:36.000000000 +0000 @@ -636,8 +636,7 @@ if (tree) { proto_item_append_text(proto_root, " %s", val_to_str_const(packet.type, zbee_aps_frame_types, "Unknown Type")); } - col_clear(pinfo->cinfo, COL_INFO); - col_append_str(pinfo->cinfo, COL_INFO, "APS: "); + col_set_str(pinfo->cinfo, COL_INFO, "APS: "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(packet.type, zbee_aps_frame_types, "Unknown Frame Type")); /* Display the FCF */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-zbee-nwk.c wireshark-1.12.0~201311020920/epan/dissectors/packet-zbee-nwk.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-zbee-nwk.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-zbee-nwk.c 2013-11-02 02:12:36.000000000 +0000 @@ -1410,11 +1410,10 @@ } /* Update the info column. */ - col_clear(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_INFO, "Beacon, Src: 0x%04x", packet->src16); + col_add_fstr(pinfo->cinfo, COL_INFO, "Beacon, Src: 0x%04x", packet->src16); /* Get and display the protocol id, must be 0 on all ZigBee beacons. */ - proto_tree_add_uint(beacon_tree, hf_zbee_beacon_protocol, tvb, offset, 1, ENC_NA); + proto_tree_add_item(beacon_tree, hf_zbee_beacon_protocol, tvb, offset, 1, ENC_NA); offset += 1; /* Get and display the stack profile and protocol version. */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-zbee-security.c wireshark-1.12.0~201311020920/epan/dissectors/packet-zbee-security.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-zbee-security.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-zbee-security.c 2013-11-02 02:12:36.000000000 +0000 @@ -160,18 +160,18 @@ uat_key_record_t* rec = (uat_key_record_t *)r; if (rec->string == NULL) { - *err = ep_strdup_printf("Key can't be blank"); + *err = g_strdup("Key can't be blank"); } else { g_strstrip(rec->string); if (rec->string[0] != 0) { *err = NULL; if ( !zbee_security_parse_key(rec->string, rec->key, rec->byte_order) ) { - *err = ep_strdup_printf("Expecting %d hexadecimal bytes or\n" + *err = g_strdup_printf("Expecting %d hexadecimal bytes or\n" "a %d character double-quoted string", ZBEE_SEC_CONST_KEYSIZE, ZBEE_SEC_CONST_KEYSIZE); } } else { - *err = ep_strdup_printf("Key can't be blank"); + *err = g_strdup("Key can't be blank"); } } } diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/packet-zep.c wireshark-1.12.0~201311020920/epan/dissectors/packet-zep.c --- wireshark-1.12.0~201310251247/epan/dissectors/packet-zep.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/packet-zep.c 2013-11-02 02:12:36.000000000 +0000 @@ -176,7 +176,6 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, (zep_data.version==1)?"ZEP":"ZEPv2"); /* Enter name info protocol field */ - col_clear(pinfo->cinfo, COL_INFO); if (!((zep_data.version>=2) && (zep_data.type==ZEP_V2_TYPE_ACK))) col_add_fstr(pinfo->cinfo, COL_INFO, "Encapsulated ZigBee Packet [Channel]=%i [Length]=%i", zep_data.channel_id, ieee_packet_len); else diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/rpc_defrag.h wireshark-1.12.0~201311020920/epan/dissectors/rpc_defrag.h --- wireshark-1.12.0~201310251247/epan/dissectors/rpc_defrag.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/rpc_defrag.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* rpc_defrag.h - * Declarations for RPC defragmentation - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef __RPC_DEFRAG_H__ -#define __RPC_DEFRAG_H__ - -#include "reassemble.h" - -/* - * RPC-over-TCP fragmentation. - */ -#define RPC_RM_LASTFRAG 0x80000000U -#define RPC_RM_FRAGLEN 0x7fffffffU - -typedef gboolean (*rec_dissector_t)(tvbuff_t *, packet_info *, proto_tree *, - tvbuff_t *, fragment_head *, gboolean, guint32, gboolean); - -extern void show_rpc_fraginfo(tvbuff_t *tvb, tvbuff_t *frag_tvb, - proto_tree *tree, guint32 rpc_rm, fragment_head *ipfd_head, packet_info *pinfo); -extern int dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, rec_dissector_t dissector, gboolean is_heur, - int proto, int ett, gboolean defragment, gboolean first_pdu); - -#endif /* __RPC_DEFRAG_H__ */ diff -Nru wireshark-1.12.0~201310251247/epan/dissectors/usb.c wireshark-1.12.0~201311020920/epan/dissectors/usb.c --- wireshark-1.12.0~201310251247/epan/dissectors/usb.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/dissectors/usb.c 2013-11-02 02:12:36.000000000 +0000 @@ -50,6 +50,7 @@ { 0x0105, "Trust International B.V." }, { 0x0145, "Unknown" }, { 0x017c, "MLK" }, + { 0x0200, "TP-Link" }, { 0x0204, "Chipsbank Microelectronics Co., Ltd" }, { 0x0218, "Hangzhou Worlde" }, { 0x02ad, "HUMAX Co., Ltd." }, @@ -2774,6 +2775,7 @@ { 0x21d6, "Agecodagis SARL" }, { 0x2222, "MacAlly" }, { 0x2227, "SAMWOO Enterprise" }, + { 0x2232, "Silicon Motion" }, { 0x2233, "RadioShack Corporation" }, { 0x2237, "Kobo Inc." }, { 0x22a6, "Pie Digital, Inc." }, @@ -2898,6 +2900,7 @@ { 0x0105145f, "NW-3100 802.11b/g 54Mbps Wireless Network Adapter [zd1211]" }, { 0x01450112, "Card Reader" }, { 0x017c145f, "Trust Deskset" }, + { 0x02000201, "MA180 UMTS Modem" }, { 0x02046025, "CBM2080 Flash drive controller" }, { 0x02046026, "CBM1180 Flash drive controller" }, { 0x02180301, "MIDI Port" }, @@ -3035,6 +3038,8 @@ { 0x03f00412, "Printing Support" }, { 0x03f00417, "LaserJet 1200 series" }, { 0x03f00423, "HS-COMBO Cardreader" }, + { 0x03f0042a, "LaserJet M1132 MFP" }, + { 0x03f00441, "HP Prime Calculator" }, { 0x03f00504, "DeskJet 885c" }, { 0x03f00505, "ScanJet 2100c" }, { 0x03f00507, "DVD+RW" }, @@ -3182,7 +3187,7 @@ { 0x03f02311, "OfficeJet d series" }, { 0x03f02312, "OfficeJet Pro L7700" }, { 0x03f02317, "LaserJet 4350" }, - { 0x03f0231d, "4 GB Flash Drive" }, + { 0x03f0231d, "Broadcom 2070 Bluetooth Combo" }, { 0x03f02402, "PhotoSmart 7700 series" }, { 0x03f02404, "Deskjet F2280 series" }, { 0x03f02405, "ScanJet 4070 PhotoSmart" }, @@ -3268,6 +3273,7 @@ { 0x03f03b11, "PSC 1300 series" }, { 0x03f03b17, "LaserJet M1005 MFP" }, { 0x03f03c02, "PhotoSmart 7350" }, + { 0x03f03c05, "Scanjet Professional 1000 Mobile Scanner" }, { 0x03f03c11, "PSC 1358" }, { 0x03f03c17, "EWS UPD" }, { 0x03f03d02, "PhotoSmart 7350~" }, @@ -3544,12 +3550,15 @@ { 0x04038028, "Dev board JTAG (FT232H based)" }, { 0x04038040, "4 Port Hub" }, { 0x04038070, "7 Port Hub" }, + { 0x04038140, "Vehicle Explorer Interface" }, { 0x04038210, "MGTimer - MGCC (Vic) Timing System" }, { 0x04038370, "7 Port Hub" }, { 0x04038371, "PS/2 Keyboard And Mouse" }, { 0x04038372, "FT8U100AX Serial Port" }, { 0x04038a28, "Rainforest Automation ZigBee Controller" }, { 0x04038a98, "TIAO Multi-Protocol Adapter" }, + { 0x04039133, "CallerID" }, + { 0x04039135, "Rotary Pub alarm" }, { 0x04039e90, "Marvell OpenRD Base/Client" }, { 0x04039f80, "Ewert Energy Systems CANdapter" }, { 0x0403a6d0, "Texas Instruments XDS100v2 JTAG / BeagleBone A3" }, @@ -3865,6 +3874,7 @@ { 0x040a6003, "i50" }, { 0x040a6004, "i60" }, { 0x040a6005, "i80" }, + { 0x040b0a68, "Func MS-3 gaming mouse [WT6573F MCU]" }, { 0x040b6510, "Weltrend Bar Code Reader" }, { 0x040b6520, "XBOX Xploder" }, { 0x040b6533, "Speed-Link Competition Pro" }, @@ -4077,6 +4087,7 @@ { 0x041e4056, "Live! Cam Video IM Pro" }, { 0x041e4057, "Live! Cam Optia" }, { 0x041e4058, "Live! Cam Optia AF" }, + { 0x041e405f, "WebCam Vista (VF0330)" }, { 0x041e4061, "Live! Cam Notebook Pro [VF0400]" }, { 0x041e4063, "Live! Cam Video IM Pro" }, { 0x041e4068, "Live! Cam Notebook [VF0470]" }, @@ -4612,6 +4623,7 @@ { 0x04570151, "Super Flash 1GB / GXT 64MB Flash Drive" }, { 0x04570162, "SiS162 usb Wireless LAN Adapter" }, { 0x04570163, "802.11 Wireless LAN Adapter" }, + { 0x04570817, "SiS-184-ASUS-4352.17 touch panel" }, { 0x04575401, "Wireless Adapter RO80211GS-USB" }, { 0x04580001, "Mouse" }, { 0x04580002, "Genius NetMouse Pro" }, @@ -4703,6 +4715,7 @@ { 0x0458705c, "Genius iSlim 1300AF" }, { 0x04587079, "FaceCam 2025R" }, { 0x0458707f, "TVGo DVB-T03 [RTL2832]" }, + { 0x04587088, "WideCam 1050" }, { 0x045a07da, "Supra Express 56K modem" }, { 0x045a0b4a, "SupraMax 2890 56K Modem [Lucent Atlas]" }, { 0x045a0b68, "SupraMax 56K Modem" }, @@ -4989,6 +5002,7 @@ { 0x045e076d, "LifeCam HD-5000" }, { 0x045e0772, "LifeCam Studio" }, { 0x045e0779, "LifeCam HD-3000" }, + { 0x045e0797, "Optical Mouse 200" }, { 0x045e930a, "ISOUSB.SYS Intel 82930 Isochronous IO Test Board" }, { 0x045effca, "Catalina" }, { 0x045efff8, "Keyboard" }, @@ -5056,7 +5070,7 @@ { 0x04614de7, "webcam" }, { 0x04630001, "UPS" }, { 0x0463ffff, "UPS" }, - { 0x046a0001, "My3000 Keyboard" }, + { 0x046a0001, "Keyboard" }, { 0x046a0003, "My3000 Hub" }, { 0x046a0004, "CyBoard Keyboard" }, { 0x046a0005, "XX33 SmartCard Reader Keyboard" }, @@ -5680,6 +5694,7 @@ { 0x04800014, "InTouch Module" }, { 0x0480a006, "External Disk 1.5TB" }, { 0x0480a007, "External Disk USB 3.0" }, + { 0x0480d010, "External Disk 3TB" }, { 0x0482000e, "FS-1020D Printer" }, { 0x0482000f, "FS-1920 Mono Printer" }, { 0x04820100, "Finecam S3x" }, @@ -5708,6 +5723,7 @@ { 0x04835000, "ST Micro/Ergenic ERG BT-002 Bluetooth Adapter" }, { 0x04835001, "ST Micro Bluetooth Device" }, { 0x04835710, "Joystick in FS Mode" }, + { 0x04835720, "STM microSD Flash Device" }, { 0x04835721, "Hantek DDS-3X25 Arbitrary Waveform Generator" }, { 0x04835740, "STM32F407" }, { 0x04837270, "ST Micro Serial Bridge" }, @@ -5732,6 +5748,8 @@ { 0x048d9006, "IT9135 BDA Afatech DVB-T HDTV Dongle" }, { 0x048d9009, "Zolid HD DVD Maker" }, { 0x048d9135, "Zolid Mini DVB-T Stick" }, + { 0x048d9503, "ITE it9503 feature-limited DVB-T transmission chip [ccHDtv]" }, + { 0x048d9507, "ITE it9507 full featured DVB-T transmission chip [ccHDtv]" }, { 0x04910003, "Taxan Monitor Control" }, { 0x04920140, "MP3 player" }, { 0x04920141, "MP3 Player" }, @@ -6470,7 +6488,11 @@ { 0x04a9325f, "PowerShot SX280 HS" }, { 0x04a93260, "PowerShot SX270 HS" }, { 0x04a93264, "PowerShot A1400" }, + { 0x04a93265, "Powershot ELPH 130 IS / IXUS 140" }, { 0x04a93268, "PowerShot ELPH 330 HS / IXUS 255 HS" }, + { 0x04a93271, "PowerShot A2500" }, + { 0x04a93276, "PowerShot SX170 IS" }, + { 0x04a9327d, "Powershot ELPH 115 IS / IXUS 132" }, { 0x04ad2501, "Bluetooth Device" }, { 0x04b00102, "Coolpix 990" }, { 0x04b00103, "Coolpix 880" }, @@ -7136,11 +7158,13 @@ { 0x04d91400, "PS/2 keyboard + mouse controller" }, { 0x04d91503, "Shortboard Lefty" }, { 0x04d91603, "Keyboard" }, + { 0x04d91702, "Keyboard LKS02" }, { 0x04d92013, "Keyboard [Das Keyboard]" }, { 0x04d92221, "Keyboard" }, { 0x04d92323, "Keyboard" }, { 0x04d92519, "Shenzhen LogoTech 2.4GHz receiver" }, { 0x04d92832, "1channel Telephone line recorder" }, + { 0x04d92834, "HT82A834R Audio MCU" }, { 0x04d9a055, "Keyboard" }, { 0x04da0901, "LS-120 Camera" }, { 0x04da0912, "SDR-S10" }, @@ -7627,6 +7651,7 @@ { 0x04f2b2ea, "Integrated Camera [ThinkPad]" }, { 0x04f2b330, "Asus 720p CMOS webcam" }, { 0x04f2b354, "UVC 1.00 device HD UVC WebCam" }, + { 0x04f3000a, "Touchscreen" }, { 0x04f30103, "ActiveJet K-2024 Multimedia Keyboard" }, { 0x04f301a4, "Wireless Keyboard" }, { 0x04f30210, "Optical Mouse" }, @@ -7960,6 +7985,8 @@ { 0x050d1004, "F9L1004 802.11n Surf N300 XR Wireless Adapter [Realtek RTL8192CU]" }, { 0x050d1102, "F7D1102 N150/Surf Micro Wireless Adapter v1000 [Realtek RTL8188CUS]" }, { 0x050d1103, "F9L1103 N750 DB 802.11abgn 2x3:3 [Ralink RT3573]" }, + { 0x050d1106, "F9L1106v1 802.11a/b/g/n/ac Wireless Adapter [Broadcom BCM43526]" }, + { 0x050d1109, "F9L1109v1 802.11a/b/g/n/ac Wireless Adapter [Realtek RTL8812AU]" }, { 0x050d11f2, "ISY Wireless Micro Adapter IWL 2000 [RTL8188CUS]" }, { 0x050d1202, "F5U120-PC Parallel Printer Port" }, { 0x050d1203, "F5U120-PC Serial Port" }, @@ -8334,6 +8361,7 @@ { 0x054c05b3, "Sony Sony Tablet S" }, { 0x054c05b4, "Sony Sony Tablet S1" }, { 0x054c061f, "Sony DSC-HX200V" }, + { 0x054c06bb, "WALKMAN NWZ-F805" }, { 0x054c1000, "Wireless Buzz! Receiver" }, { 0x054c1294, "Sony DCR-SR75" }, { 0x05500002, "InkJet Color Printer" }, @@ -16539,6 +16567,10 @@ { 0x22222520, "Mini Tablet" }, { 0x22224050, "AirStick joystick" }, { 0x22273105, "SKYDATA SKD-U100" }, + { 0x22321005, "WebCam SCB-0385N" }, + { 0x22321028, "WebCam SC-03FFL11939N" }, + { 0x22321029, "WebCam SC-13HDL11939N" }, + { 0x22321037, "WebCam SC-03FFM12339N" }, { 0x22336323, "USB Electronic Scale" }, { 0x22374161, "eReader White" }, { 0x22a6ffff, "PieKey \"beta\" 4GB model 4E4F41482E4F5247 (SM3251Q BB)" }, diff -Nru wireshark-1.12.0~201310251247/epan/filesystem.c wireshark-1.12.0~201311020920/epan/filesystem.c --- wireshark-1.12.0~201310251247/epan/filesystem.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/filesystem.c 2013-11-02 02:12:36.000000000 +0000 @@ -904,47 +904,22 @@ } } #else + if (running_in_build_directory_flag) { /* * We're (probably) being run from the build directory and * weren't started with special privileges. * - * The data files we want are the ones from the source - * directory; to handle builds out of the source tree, - * we check whether WIRESHARK_SRC_DIR is set and, if so, - * use that as the source directory. - */ - datafile_dir = getenv("WIRESHARK_SRC_DIR"); - if (datafile_dir != NULL) - return datafile_dir; - } - - /* - * Well, that didn't work. - * Check again whether we were (probably) run from the build - * directory and started without special privileges, and also - * check whether we were able to determine the directory in - * which the program was found. - * - * (running_in_build_directory_flag is never set to TRUE - * if we're started with special privileges, so we need - * only check it; we don't need to call started_with_special_privs().) - */ - if (running_in_build_directory_flag && progfile_dir != NULL) { - /* - * We're (probably) being run from the build directory and - * weren't started with special privileges, and we were - * able to determine the directory in which the program - * was found. Assume that directory is the build - * directory and that it's the same as the source - * directory. + * (running_in_build_directory_flag is never set to TRUE + * if we're started with special privileges, so we need + * only check it; we don't need to call started_with_special_privs().) + * + * Use the top-level source directory as the datafile directory + * because most of our data files (radius/, COPYING) are there. */ - datafile_dir = progfile_dir; + datafile_dir = g_strdup(TOP_SRCDIR); + return datafile_dir; } else { - /* - * Return the directory specified when the build was - * configured, prepending the run path prefix if it exists. - */ if (getenv("WIRESHARK_DATA_DIR") && !started_with_special_privs()) { /* * The user specified a different directory for data files @@ -1151,10 +1126,10 @@ /* * We're (probably) being run from the build directory and * weren't started with special privileges, so we'll use - * the "plugins" subdirectory of the datafile directory - * (the datafile directory is the build directory). + * the "plugins" subdirectory of the directory where the program + * we're running is (that's the build directory). */ - plugin_dir = g_strdup_printf("%s/plugins", get_datafile_dir()); + plugin_dir = g_strdup_printf("%s/plugins", get_progfile_dir()); } else { if (getenv("WIRESHARK_PLUGIN_DIR") && !started_with_special_privs()) { /* @@ -1894,8 +1869,15 @@ char * get_datafile_path(const char *filename) { - - return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_datafile_dir(), filename); + if (running_in_build_directory_flag && !strcmp(filename, "AUTHORS-SHORT")) { + /* We're running in the build directory and the requested file is a + * generated file. Return the file name in the build directory (not + * in the source/data directory). + */ + return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_progfile_dir(), filename); + } else { + return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_datafile_dir(), filename); + } } /* Get the personal plugin dir */ diff -Nru wireshark-1.12.0~201310251247/epan/ftypes/ftype-string.c wireshark-1.12.0~201311020920/epan/ftypes/ftype-string.c --- wireshark-1.12.0~201310251247/epan/ftypes/ftype-string.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/ftypes/ftype-string.c 2013-11-02 02:12:36.000000000 +0000 @@ -46,13 +46,15 @@ static void string_fvalue_set(fvalue_t *fv, gpointer value, gboolean already_copied) { - DISSECTOR_ASSERT(value != NULL); - DISSECTOR_ASSERT(!already_copied); + DISSECTOR_ASSERT(value != NULL); /* Free up the old value, if we have one */ string_fvalue_free(fv); - fv->value.string = (gchar *)g_strdup((const gchar *)value); + if (already_copied) + fv->value.string = (gchar *)value; /* must be g_ allocated */ + else + fv->value.string = (gchar *)g_strdup((const gchar *)value); } static int diff -Nru wireshark-1.12.0~201310251247/epan/geoip_db.c wireshark-1.12.0~201311020920/epan/geoip_db.c --- wireshark-1.12.0~201310251247/epan/geoip_db.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/geoip_db.c 2013-11-02 02:12:36.000000000 +0000 @@ -195,7 +195,7 @@ /** * Initialize GeoIP lookups */ -void +void geoip_db_pref_init(module_t *nameres) { static uat_field_t geoip_db_paths_fields[] = { diff -Nru wireshark-1.12.0~201310251247/epan/oids.c wireshark-1.12.0~201311020920/epan/oids.c --- wireshark-1.12.0~201310251247/epan/oids.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/oids.c 2013-11-02 02:12:36.000000000 +0000 @@ -75,7 +75,9 @@ static const oid_value_type_t counter32_type = { FT_UINT64, BASE_DEC, BER_CLASS_APP, 1, 1, 5, OID_KEY_TYPE_INTEGER, 1}; static const oid_value_type_t unsigned32_type = { FT_UINT64, BASE_DEC, BER_CLASS_APP, 2, 1, 5, OID_KEY_TYPE_INTEGER, 1}; static const oid_value_type_t timeticks_type = { FT_UINT64, BASE_DEC, BER_CLASS_APP, 3, 1, 5, OID_KEY_TYPE_INTEGER, 1}; +#if 0 static const oid_value_type_t opaque_type = { FT_BYTES, BASE_NONE, BER_CLASS_APP, 4, 1, 4, OID_KEY_TYPE_BYTES, 0}; +#endif static const oid_value_type_t nsap_type = { FT_BYTES, BASE_NONE, BER_CLASS_APP, 5, 0, -1, OID_KEY_TYPE_NSAP, 0}; static const oid_value_type_t counter64_type = { FT_UINT64, BASE_DEC, BER_CLASS_APP, 6, 1, 8, OID_KEY_TYPE_INTEGER, 1}; static const oid_value_type_t ipv6_type = { FT_IPv6, BASE_NONE, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, 16, 16, OID_KEY_TYPE_BYTES, 16}; diff -Nru wireshark-1.12.0~201310251247/epan/oids_test.c wireshark-1.12.0~201311020920/epan/oids_test.c --- wireshark-1.12.0~201310251247/epan/oids_test.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/oids_test.c 2013-11-02 02:12:36.000000000 +0000 @@ -56,6 +56,7 @@ ".81.127.16383.2097151.268435455.128.16384.2097152.268435456", 25, "\x51\x7f\xff\x7f\xff\xff\x7f\xff\xff\xff\x7f\x81\x00\x81\x80\x00\x81\x80\x80\x00\x81\x80\x80\x80\x00", 9, { 81, 0x7F, 0x3FFF, 0x1FFFFF, 0x0FFFFFFF, 1+0x7F, 1+0x3FFF, 1+0x1FFFFF, 1+0x0FFFFFFF} }; +example_s ex7 = {"2.1.1", "joint-iso-itu-t.asn1.basic-encoding", 2, "\x51\x01", 3, {2,1,1} }; /* * These test are organized in order of the appearance, in oids.h, of @@ -404,6 +405,36 @@ g_assert(subids[i] == ex1.subids[i]); } +static void +oids_test_add_subids(void) +{ + const gchar* oid; + + oid_add(ex7.resolved, ex7.subids_len, ex7.subids); + oid = oid_resolved(ex7.subids_len, ex7.subids); + g_assert_cmpstr(oid, ==, ex7.resolved); +} + +static void +oids_test_add_encoded(void) +{ + const gchar* oid; + + oid_add_from_encoded(ex7.resolved, ex7.encoded, ex7.encoded_len); + oid = oid_resolved(ex7.subids_len, ex7.subids); + g_assert_cmpstr(oid, ==, ex7.resolved); +} + +static void +oids_test_add_string(void) +{ + const gchar* oid; + + oid_add_from_string(ex7.resolved, ex7.string); + oid = oid_resolved(ex7.subids_len, ex7.subids); + g_assert_cmpstr(oid, ==, ex7.resolved); +} + int main(int argc, char **argv) { @@ -452,7 +483,10 @@ g_test_add_func("/oids/2struct/encoded", oids_test_2struct_encoded); g_test_add_func("/oids/2struct/string", oids_test_2struct_string); - /* TODO: add tests for varios oid_add functions and retest name resolution */ + /* /oids/add */ + g_test_add_func("/oids/add/subids", oids_test_add_subids); + g_test_add_func("/oids/add/encoded", oids_test_add_encoded); + g_test_add_func("/oids/add/string", oids_test_add_string); emem_init(); wmem_init(); diff -Nru wireshark-1.12.0~201310251247/epan/packet.c wireshark-1.12.0~201311020920/epan/packet.c --- wireshark-1.12.0~201310251247/epan/packet.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/packet.c 2013-11-02 02:12:36.000000000 +0000 @@ -1152,7 +1152,7 @@ dtbl_entry->initial = dtbl_entry->current; /* do the table insertion */ - g_hash_table_insert( sub_dissectors->hash_table, (gpointer)pattern, + g_hash_table_insert( sub_dissectors->hash_table, (gpointer)g_strdup(pattern), (gpointer)dtbl_entry); /* @@ -1228,7 +1228,7 @@ dtbl_entry->current = handle; /* do the table insertion */ - g_hash_table_insert( sub_dissectors->hash_table, (gpointer)pattern, + g_hash_table_insert( sub_dissectors->hash_table, (gpointer)g_strdup(pattern), (gpointer)dtbl_entry); } @@ -1317,6 +1317,63 @@ return FALSE; } +/* Look for a given string in a given dissector table and, if found, call + the dissector with the arguments supplied, and return TRUE, otherwise + return FALSE. */ +gboolean +dissector_try_string_new(dissector_table_t sub_dissectors, const gchar *string, + tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) +{ + dtbl_entry_t *dtbl_entry; + struct dissector_handle *handle; + int ret; + const gchar *saved_match_string; + + /* XXX ASSERT instead ? */ + if (!string) return FALSE; + dtbl_entry = find_string_dtbl_entry(sub_dissectors, string); + if (dtbl_entry != NULL) { + /* + * Is there currently a dissector handle for this entry? + */ + handle = dtbl_entry->current; + if (handle == NULL) { + /* + * No - pretend this dissector didn't exist, + * so that other dissectors might have a chance + * to dissect this packet. + */ + return FALSE; + } + + /* + * Save the current value of "pinfo->match_string", + * set it to the string that matched, call the + * dissector, and restore "pinfo->match_string". + */ + saved_match_string = pinfo->match_string; + pinfo->match_string = string; + ret = call_dissector_work(handle, tvb, pinfo, tree, TRUE, data); + pinfo->match_string = saved_match_string; + + /* + * If a new-style dissector returned 0, it means that + * it didn't think this tvbuff represented a packet for + * its protocol, and didn't dissect anything. + * + * Old-style dissectors can't reject the packet. + * + * 0 is also returned if the protocol wasn't enabled. + * + * If the packet was rejected, we return FALSE, so that + * other dissectors might have a chance to dissect this + * packet, otherwise we return TRUE. + */ + return ret != 0; + } + return FALSE; +} + /* Look for a given value in a given string dissector table and, if found, return the dissector handle for that value. */ dissector_handle_t @@ -1671,7 +1728,7 @@ case FT_STRINGZ: sub_dissectors->hash_table = g_hash_table_new_full( g_str_hash, g_str_equal, - NULL, + &g_free, &g_free ); break; diff -Nru wireshark-1.12.0~201310251247/epan/packet.h wireshark-1.12.0~201311020920/epan/packet.h --- wireshark-1.12.0~201310251247/epan/packet.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/packet.h 2013-11-02 02:12:36.000000000 +0000 @@ -239,6 +239,12 @@ WS_DLL_PUBLIC gboolean dissector_try_string(dissector_table_t sub_dissectors, const gchar *string, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); +/* Look for a given string in a given dissector table and, if found, call + the dissector with the arguments supplied, and return TRUE, otherwise + return FALSE. */ +WS_DLL_PUBLIC gboolean dissector_try_string_new(dissector_table_t sub_dissectors, + const gchar *string, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data); + /* Look for a given value in a given string dissector table and, if found, return the dissector handle for that value. */ WS_DLL_PUBLIC dissector_handle_t dissector_get_string_handle( diff -Nru wireshark-1.12.0~201310251247/epan/packet_info.h wireshark-1.12.0~201311020920/epan/packet_info.h --- wireshark-1.12.0~201310251247/epan/packet_info.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/packet_info.h 2013-11-02 02:12:36.000000000 +0000 @@ -136,9 +136,6 @@ */ guint32 bytes_until_next_pdu; - - int iplen; /**< total length of IP packet */ - int iphdrlen; /**< length of IP header */ guint8 ip_ttl; /**< IP time to live */ int p2p_dir; /**< Packet was captured as an outbound (P2P_DIR_SENT) @@ -153,9 +150,6 @@ * Bit 2 set if SOFf * Bit 1 set if first frame in sequence */ - guint16 src_idx; /**< Source port index (Cisco MDS-specific) */ - guint16 dst_idx; /**< Dest port index (Cisco MDS-specific) */ - guint16 vsan; /**< Fibre channel/Cisco MDS-specific */ /* Extra data for DCERPC handling and tracking of context ids */ guint16 dcectxid; /**< Context ID (DCERPC-specific) */ diff -Nru wireshark-1.12.0~201310251247/epan/prefs.c wireshark-1.12.0~201311020920/epan/prefs.c --- wireshark-1.12.0~201310251247/epan/prefs.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/prefs.c 2013-11-02 02:12:36.000000000 +0000 @@ -804,7 +804,8 @@ return strcmp(name, pref->name); } -static gboolean module_find_pref_cb(void *value, void *data) +static gboolean +module_find_pref_cb(void *value, void *data) { find_pref_arg_t* arg = (find_pref_arg_t*)data; GList *list_entry; @@ -905,8 +906,8 @@ */ static void prefs_register_uint_custom_preference(module_t *module, const char *name, - const char *title, const char *description, - struct pref_custom_cbs* custom_cbs, guint *var) + const char *title, const char *description, + struct pref_custom_cbs* custom_cbs, guint *var) { pref_t *preference; @@ -1004,8 +1005,8 @@ * XXX - This should be temporary until we can find a better way * to do "custom" preferences */ -static -void prefs_register_string_custom_preference(module_t *module, const char *name, +static void +prefs_register_string_custom_preference(module_t *module, const char *name, const char *title, const char *description, struct pref_custom_cbs* custom_cbs, const char **var) { @@ -1103,8 +1104,10 @@ /* * Register a color preference. */ -void prefs_register_color_preference(module_t *module, const char *name, - const char *title, const char *description, color_t *color) +void +prefs_register_color_preference(module_t *module, const char *name, + const char *title, const char *description, + color_t *color) { pref_t* preference = register_preference(module, name, title, description, PREF_COLOR); @@ -1119,10 +1122,12 @@ */ typedef void (*pref_custom_list_init_cb) (pref_t* pref, GList** value); -static -void prefs_register_list_custom_preference(module_t *module, const char *name, - const char *title, const char *description, struct pref_custom_cbs* custom_cbs, - pref_custom_list_init_cb init_cb, GList** list) +static void +prefs_register_list_custom_preference(module_t *module, const char *name, + const char *title, const char *description, + struct pref_custom_cbs* custom_cbs, + pref_custom_list_init_cb init_cb, + GList** list) { pref_t* preference = register_preference(module, name, title, description, PREF_CUSTOM); @@ -1133,9 +1138,11 @@ /* * Register a custom preference. */ -void prefs_register_custom_preference(module_t *module, const char *name, - const char *title, const char *description, struct pref_custom_cbs* custom_cbs, - void** custom_data _U_) +void +prefs_register_custom_preference(module_t *module, const char *name, + const char *title, const char *description, + struct pref_custom_cbs* custom_cbs, + void **custom_data _U_) { pref_t* preference = register_preference(module, name, title, description, PREF_CUSTOM); @@ -1180,7 +1187,8 @@ } /* Return the value assigned to the given uint preference. */ -guint prefs_get_uint_preference(pref_t *pref) +guint +prefs_get_uint_preference(pref_t *pref) { if (pref && pref->type == PREF_UINT) return *pref->varp.uint; @@ -1247,7 +1255,8 @@ {NULL, NULL, -1} }; -static void stats_callback(void) +static void +stats_callback(void) { /* Test for a sane tap update interval */ if (prefs.tap_update_interval < 100 || prefs.tap_update_interval > 10000) @@ -1261,7 +1270,8 @@ } -static void gui_callback(void) +static void +gui_callback(void) { /* Ensure there is at least one file count */ if (prefs.gui_recent_files_count_max == 0) @@ -1272,7 +1282,8 @@ prefs.gui_recent_df_entries_max = 10; } -static void gui_layout_callback(void) +static void +gui_layout_callback(void) { if (prefs.gui_layout_type == layout_unused || prefs.gui_layout_type >= layout_type_max) { @@ -1291,12 +1302,14 @@ /* * Console log level custom preference functions */ -static void console_log_level_reset_cb(pref_t* pref) +static void +console_log_level_reset_cb(pref_t* pref) { *pref->varp.uint = pref->default_val.uint; } -static prefs_set_pref_e console_log_level_set_cb(pref_t* pref, const gchar* value, gboolean* changed) +static prefs_set_pref_e +console_log_level_set_cb(pref_t* pref, const gchar* value, gboolean* changed) { guint uval; @@ -1350,7 +1363,8 @@ #define PRS_COL_NUM "column.number" static module_t *gui_column_module = NULL; -static void column_hidden_free_cb(pref_t* pref) +static void +column_hidden_free_cb(pref_t* pref) { g_free((char *)*pref->varp.string); *pref->varp.string = NULL; @@ -1358,13 +1372,15 @@ pref->default_val.string = NULL; } -static void column_hidden_reset_cb(pref_t* pref) +static void +column_hidden_reset_cb(pref_t* pref) { g_free((void *)*pref->varp.string); *pref->varp.string = g_strdup(pref->default_val.string); } -static prefs_set_pref_e column_hidden_set_cb(pref_t* pref, const gchar* value, gboolean* changed) +static prefs_set_pref_e +column_hidden_set_cb(pref_t* pref, const gchar* value, gboolean* changed) { GList *clp; fmt_data *cfmt; @@ -1395,15 +1411,21 @@ return PREFS_SET_OK; } -static const char * column_hidden_type_name_cb(void) { +static const char * +column_hidden_type_name_cb(void) +{ return "Packet list hidden columns"; } -static char * column_hidden_type_description_cb(void) { +static char * +column_hidden_type_description_cb(void) +{ return g_strdup("List all columns to hide in the packet list."); } -static char * column_hidden_to_str_cb(pref_t* pref, gboolean default_val) { +static char * +column_hidden_to_str_cb(pref_t* pref, gboolean default_val) +{ GString *cols_hidden = g_string_new (""); GList *clp; fmt_data *cfmt; @@ -1437,7 +1459,9 @@ return g_string_free (cols_hidden, FALSE); } -static gboolean column_hidden_is_default_cb(pref_t* pref) { +static gboolean +column_hidden_is_default_cb(pref_t* pref) +{ char *cur_hidden_str = column_hidden_to_str_cb(pref, FALSE); gboolean is_default = g_strcmp0(cur_hidden_str, pref->default_val.string) == 0; @@ -1449,37 +1473,48 @@ /* Number of columns "preference". This is only used internally and is not written to the * preference file */ -static void column_num_reset_cb(pref_t* pref) +static void +column_num_reset_cb(pref_t* pref) { *pref->varp.uint = pref->default_val.uint; } -static prefs_set_pref_e column_num_set_cb(pref_t* pref _U_, const gchar* value _U_, gboolean* changed _U_) +static prefs_set_pref_e +column_num_set_cb(pref_t* pref _U_, const gchar* value _U_, gboolean* changed _U_) { /* Don't write this to the preferences file */ return PREFS_SET_OK; } -static const char * column_num_type_name_cb(void) { +static const char * +column_num_type_name_cb(void) +{ return NULL; } -static char * column_num_type_description_cb(void) { +static char * +column_num_type_description_cb(void) +{ return g_strdup(""); } -static gboolean column_num_is_default_cb(pref_t* pref _U_) { +static gboolean +column_num_is_default_cb(pref_t* pref _U_) +{ return TRUE; } -static char * column_num_to_str_cb(pref_t* pref _U_, gboolean default_val _U_) { +static char * +column_num_to_str_cb(pref_t* pref _U_, gboolean default_val _U_) +{ return g_strdup(""); } /* * Column format custom preference functions */ -static void column_format_init_cb(pref_t* pref, GList** value) +static void +column_format_init_cb(pref_t* pref, GList** value) { fmt_data *src_cfmt, *dest_cfmt; GList *entry; @@ -1505,13 +1540,15 @@ } } -static void column_format_free_cb(pref_t* pref) +static void +column_format_free_cb(pref_t* pref) { free_col_info(*pref->varp.list); free_col_info(pref->default_val.list); } -static void column_format_reset_cb(pref_t* pref) +static void +column_format_reset_cb(pref_t* pref) { fmt_data *src_cfmt, *dest_cfmt; GList *entry; @@ -1538,10 +1575,12 @@ } col_num_pref = prefs_find_preference(gui_column_module, PRS_COL_NUM); + g_assert(col_num_pref != NULL); /* Should never happen */ column_num_reset_cb(col_num_pref); } -static prefs_set_pref_e column_format_set_cb(pref_t* pref, const gchar* value, gboolean* changed _U_) +static prefs_set_pref_e +column_format_set_cb(pref_t* pref, const gchar* value, gboolean* changed _U_) { GList *col_l, *col_l_elt; fmt_data *cfmt; @@ -1587,7 +1626,9 @@ free_col_info(*pref->varp.list); *pref->varp.list = NULL; hidden_pref = prefs_find_preference(gui_column_module, PRS_COL_HIDDEN); + g_assert(hidden_pref != NULL); /* Should never happen */ col_num_pref = prefs_find_preference(gui_column_module, PRS_COL_NUM); + g_assert(col_num_pref != NULL); /* Should never happen */ llen = g_list_length(col_l); *col_num_pref->varp.uint = llen / 2; col_l_elt = g_list_first(col_l); @@ -1607,15 +1648,21 @@ } -static const char * column_format_type_name_cb(void) { +static const char * +column_format_type_name_cb(void) +{ return "Packet list column format"; } -static char * column_format_type_description_cb(void) { +static char * +column_format_type_description_cb(void) +{ return g_strdup("Each pair of strings consists of a column title and its format"); } -static gboolean column_format_is_default_cb(pref_t* pref) { +static gboolean +column_format_is_default_cb(pref_t* pref) +{ GList *clp = *pref->varp.list, *pref_col = g_list_first(clp), *def_col = g_list_first(pref->default_val.list); @@ -1648,7 +1695,9 @@ return is_default; } -static char * column_format_to_str_cb(pref_t* pref, gboolean default_val) { +static char * +column_format_to_str_cb(pref_t* pref, gboolean default_val) +{ GList *pref_l = default_val ? pref->default_val.list : *pref->varp.list; GList *clp = g_list_first(pref_l); GList *col_l; @@ -1688,7 +1737,8 @@ Copy the pref->capture_columns list (just loaded with the capture_cols[] struct values) to prefs->default_val.list. */ -static void capture_column_init_cb(pref_t* pref, GList** capture_cols_values) +static void +capture_column_init_cb(pref_t* pref, GList** capture_cols_values) { GList *ccv_list = *capture_cols_values, *dlist = NULL; @@ -1708,7 +1758,8 @@ Note that since pref->varp.list points to &prefs.capture_columns, it is also freed. */ -static void capture_column_free_cb(pref_t* pref) +static void +capture_column_free_cb(pref_t* pref) { GList *clist = prefs.capture_columns; gchar *col_name; @@ -1738,7 +1789,8 @@ /* Copy pref->default_val.list to *pref->varp.list. */ -static void capture_column_reset_cb(pref_t* pref) +static void +capture_column_reset_cb(pref_t* pref) { GList *vlist, *dlist; gchar *vcol; @@ -1759,7 +1811,8 @@ *pref->varp.list = vlist; } -static prefs_set_pref_e capture_column_set_cb(pref_t* pref, const gchar* value, gboolean* changed _U_) +static prefs_set_pref_e +capture_column_set_cb(pref_t* pref, const gchar* value, gboolean* changed _U_) { GList *col_l = prefs_get_string_list(value); GList *col_l_elt; @@ -1816,17 +1869,23 @@ } -static const char * capture_column_type_name_cb(void) { +static const char * +capture_column_type_name_cb(void) +{ return "Column list"; } -static char * capture_column_type_description_cb(void) { +static char * +capture_column_type_description_cb(void) +{ return g_strdup( "List of columns to be displayed in the capture options dialog.\n" CAPTURE_COL_TYPE_DESCRIPTION); } -static gboolean capture_column_is_default_cb(pref_t* pref) { +static gboolean +capture_column_is_default_cb(pref_t* pref) +{ GList *pref_col = g_list_first(prefs.capture_columns), *def_col = g_list_first(pref->default_val.list); gboolean is_default = TRUE; @@ -1849,7 +1908,9 @@ return is_default; } -static char * capture_column_to_str_cb(pref_t* pref, gboolean default_val) { +static char * +capture_column_to_str_cb(pref_t* pref, gboolean default_val) +{ GList *pref_l = default_val ? pref->default_val.list : prefs.capture_columns; GList *clp = g_list_first(pref_l); @@ -1870,7 +1931,8 @@ } -static void colorized_frame_free_cb(pref_t* pref) +static void +colorized_frame_free_cb(pref_t* pref) { g_free((char *)*pref->varp.string); *pref->varp.string = NULL; @@ -1879,13 +1941,15 @@ } -static void colorized_frame_reset_cb(pref_t* pref) +static void +colorized_frame_reset_cb(pref_t* pref) { g_free((void *)*pref->varp.string); *pref->varp.string = g_strdup(pref->default_val.string); } -static prefs_set_pref_e colorized_frame_set_cb(pref_t* pref, const gchar* value, gboolean* changed) +static prefs_set_pref_e +colorized_frame_set_cb(pref_t* pref, const gchar* value, gboolean* changed) { if (strcmp(*pref->varp.string, value) != 0) { *changed = TRUE; @@ -1896,7 +1960,9 @@ return PREFS_SET_OK; } -static const char * colorized_frame_type_name_cb(void) { +static const char * +colorized_frame_type_name_cb(void) +{ /* Don't write the colors of the 10 easy-access-colorfilters to the preferences * file until the colors can be changed in the GUI. Currently this is not really * possible since the STOCK-icons for these colors are hardcoded. @@ -1909,15 +1975,21 @@ return NULL; } -static char * colorized_frame_type_description_cb(void) { +static char * +colorized_frame_type_description_cb(void) +{ return g_strdup(""); } -static gboolean colorized_frame_is_default_cb(pref_t* pref _U_) { +static gboolean +colorized_frame_is_default_cb(pref_t* pref _U_) +{ return TRUE; } -static char * colorized_frame_to_str_cb(pref_t* pref _U_, gboolean default_val _U_) { +static char * +colorized_frame_to_str_cb(pref_t* pref _U_, gboolean default_val _U_) +{ return g_strdup(""); } @@ -3087,22 +3159,22 @@ gboolean got_val = FALSE; gint fline = 1, pline = 1; gchar hint[] = "(save preferences to remove this warning)"; - + cur_val = g_string_new(""); cur_var = g_string_new(""); /* Try to read in the profile name in the first line of the preferences file. */ got_c = getc(pf); if (got_c) { - char firstl[100]; - - if (fgets(firstl, 100, pf) != NULL) { - if (strncmp((const char *)firstl, " Configuration file for ", 24) == 0) { - const gchar *ver = (gchar *)&firstl[24]; - /* Eliminate the period and LF the end of the string */ - prefs.saved_at_version = g_strndup(ver, strlen(ver) - 2); - } - } + char firstl[100]; + + if (fgets(firstl, 100, pf) != NULL) { + if (strncmp((const char *)firstl, " Configuration file for ", 24) == 0) { + const gchar *ver = (gchar *)&firstl[24]; + /* Eliminate the period and LF the end of the string */ + prefs.saved_at_version = g_strndup(ver, strlen(ver) - 2); + } + } } rewind(pf); @@ -3705,7 +3777,7 @@ strcmp(pref_name, "isup_thin") == 0) { /* This protocol was removed 7. July 2009 */ return PREFS_SET_OBSOLETE; - } + } if (module) { g_warning ("Preference \"%s.%s\" has been converted to \"%s.%s.%s\"\n" "Save your preferences to make this change permanent.", diff -Nru wireshark-1.12.0~201310251247/epan/proto.c wireshark-1.12.0~201311020920/epan/proto.c --- wireshark-1.12.0~201310251247/epan/proto.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/proto.c 2013-11-02 02:12:36.000000000 +0000 @@ -4303,7 +4303,7 @@ proto_register_protocol(const char *name, const char *short_name, const char *filter_name) { - protocol_t *protocol; + protocol_t *protocol, *existing_protocol = NULL; header_field_info *hfinfo; int proto_id; char *existing_name; @@ -4358,12 +4358,11 @@ " Allowed are lower characters, digits, '-', '_' and '.'." " This might be caused by an inappropriate plugin or a development error.", filter_name); } - existing_name = (char *)g_hash_table_lookup(proto_filter_names, (gpointer)filter_name); - if (existing_name != NULL) { + existing_protocol = (protocol_t *)g_hash_table_lookup(proto_filter_names, (gpointer)filter_name); + if (existing_protocol != NULL) { 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, (gpointer)filter_name, (gpointer)filter_name); /* Add this protocol to the list of known protocols; the list is sorted by protocol short name. */ @@ -4377,6 +4376,7 @@ protocol->is_private = FALSE; /* list will be sorted later by name, when all protocols completed registering */ protocols = g_list_prepend(protocols, protocol); + g_hash_table_insert(proto_filter_names, (gpointer)filter_name, protocol); /* Here we allocate a new header_field_info struct */ hfinfo = g_slice_new(header_field_info); @@ -4493,15 +4493,6 @@ return (protocol_t *)hfinfo->strings; } -static gint compare_filter_name(gconstpointer proto_arg, - gconstpointer filter_name) -{ - const protocol_t *protocol = (const protocol_t *)proto_arg; - const gchar *f_name = (const gchar *)filter_name; - - return (strcmp(protocol->filter_name, f_name)); -} - int proto_get_id(const protocol_t *protocol) { @@ -4510,20 +4501,17 @@ int proto_get_id_by_filter_name(const gchar* filter_name) { - GList *list_entry; - protocol_t *protocol; + protocol_t *protocol = NULL; if(!filter_name){ fprintf(stderr, "No filter name present"); DISSECTOR_ASSERT(filter_name); } - list_entry = g_list_find_custom(protocols, filter_name, - compare_filter_name); + protocol = (protocol_t *)g_hash_table_lookup(proto_filter_names, (gpointer)filter_name); - if (list_entry == NULL) + if (protocol == NULL) return -1; - protocol = (protocol_t *)list_entry->data; return protocol->proto_id; } @@ -5015,7 +5003,7 @@ proto_set_cant_toggle(proto_type_length_mismatch); } -#define PROTO_PRE_ALLOC_HF_FIELDS_MEM (120000+PRE_ALLOC_EXPERT_FIELDS_MEM) +#define PROTO_PRE_ALLOC_HF_FIELDS_MEM (144000+PRE_ALLOC_EXPERT_FIELDS_MEM) static int proto_register_field_init(header_field_info *hfinfo, const int parent) { diff -Nru wireshark-1.12.0~201310251247/epan/tvbuff.h wireshark-1.12.0~201311020920/epan/tvbuff.h --- wireshark-1.12.0~201310251247/epan/tvbuff.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/tvbuff.h 2013-11-02 02:12:36.000000000 +0000 @@ -3,11 +3,11 @@ * Testy, Virtual(-izable) Buffer of guint8*'s * * "Testy" -- the buffer gets mad when an attempt is made to access data - * beyond the bounds of the buffer. An exception is thrown. + * beyond the bounds of the buffer. An exception is thrown. * * "Virtual" -- the buffer can have its own data, can use a subset of - * the data of a backing tvbuff, or can be a composite of - * other tvbuffs. + * the data of a backing tvbuff, or can be a composite of + * other tvbuffs. * * $Id$ * @@ -97,7 +97,7 @@ * TVBUFF_SUBSET has a backing tvbuff. The TVBUFF_SUBSET is a "window" * through which the program sees only a portion of the backing tvbuff. * - * TVBUFF_COMPOSITE combines multiple tvbuffs sequentually to produce + * TVBUFF_COMPOSITE combines multiple tvbuffs sequentially to produce * a larger byte array. * * tvbuff's of any type can be used as the backing-tvbuff of a @@ -108,8 +108,8 @@ * That is, it cannot point to any other data. A new tvbuff must be created if * you want a tvbuff that points to other data. * - * tvbuff's are normally chained together to allow efficient de-allocation of tvbuff's. - * + * tvbuff's are normally chained together to allow efficient de-allocation of + * tvbuff's. */ typedef void (*tvbuff_free_cb_t)(void*); @@ -118,33 +118,35 @@ * Returns a pointer to a newly initialized g_malloc'd REAL_DATA * tvbuff with the bits octet aligned. */ -WS_DLL_PUBLIC tvbuff_t* tvb_new_octet_aligned(tvbuff_t *tvb, guint32 bit_offset, gint32 no_of_bits); +WS_DLL_PUBLIC tvbuff_t *tvb_new_octet_aligned(tvbuff_t *tvb, + guint32 bit_offset, gint32 no_of_bits); WS_DLL_PUBLIC tvbuff_t *tvb_new_chain(tvbuff_t *parent, tvbuff_t *backing); WS_DLL_PUBLIC tvbuff_t *tvb_clone(tvbuff_t *tvb); -WS_DLL_PUBLIC tvbuff_t *tvb_clone_offset_len(tvbuff_t *tvb, guint offset, guint len); +WS_DLL_PUBLIC tvbuff_t *tvb_clone_offset_len(tvbuff_t *tvb, guint offset, + guint len); /** Free a tvbuff_t and all tvbuffs chained from it * The tvbuff must be 'the 'head' (initial) tvb of a chain or * must not be in a chain. * If specified, a callback to free the tvbuff data will be invoked * for each tvbuff free'd */ -WS_DLL_PUBLIC void tvb_free(tvbuff_t*); +WS_DLL_PUBLIC void tvb_free(tvbuff_t *tvb); /** Free the tvbuff_t and all tvbuffs chained from it. * The tvbuff must be 'the 'head' (initial) tvb of a chain or * must not be in a chain. * If specified, a callback to free the tvbuff data will be invoked * for each tvbuff free'd */ -WS_DLL_PUBLIC void tvb_free_chain(tvbuff_t*); +WS_DLL_PUBLIC void tvb_free_chain(tvbuff_t *tvb); /** Set a callback function to call when a tvbuff is actually freed * One argument is passed to that callback --- a void* that points * to the real data. Obviously, this only applies to a * TVBUFF_REAL_DATA tvbuff. */ -WS_DLL_PUBLIC void tvb_set_free_cb(tvbuff_t*, const tvbuff_free_cb_t); +WS_DLL_PUBLIC void tvb_set_free_cb(tvbuff_t *tvb, const tvbuff_free_cb_t func); /** Attach a TVBUFF_REAL_DATA tvbuff to a parent tvbuff. This connection * is used during a tvb_free_chain()... the "child" TVBUFF_REAL_DATA acts @@ -155,17 +157,18 @@ * is that the new tvbuff *is* part of the "chain of creation", but in a way * that these tvbuff routines are ignorant of. Use this function to make * the tvbuff routines knowledgable of this fact. */ -WS_DLL_PUBLIC void tvb_set_child_real_data_tvbuff(tvbuff_t* parent, tvbuff_t* child); +WS_DLL_PUBLIC void tvb_set_child_real_data_tvbuff(tvbuff_t *parent, + tvbuff_t *child); -WS_DLL_PUBLIC tvbuff_t* tvb_new_child_real_data(tvbuff_t* parent, const guint8* data, const guint length, - const gint reported_length); +WS_DLL_PUBLIC tvbuff_t *tvb_new_child_real_data(tvbuff_t *parent, + const guint8 *data, const guint length, const gint reported_length); /** Create a tvbuff backed by existing data. Can throw ReportedBoundsError. - * Normally, a callback to free the data should be registered using tvb_set_free_cb(); - * when this tvbuff is freed, then your callback will be called, and at that time - * you can free your original data. */ -WS_DLL_PUBLIC tvbuff_t* tvb_new_real_data(const guint8* data, const guint length, - const gint reported_length); + * Normally, a callback to free the data should be registered using + * tvb_set_free_cb(); when this tvbuff is freed, then your callback will be + * called, and at that time you can free your original data. */ +WS_DLL_PUBLIC tvbuff_t *tvb_new_real_data(const guint8 *data, + const guint length, const gint reported_length); /** Create a tvbuff that's a subset of another tvbuff. * @@ -182,21 +185,22 @@ * Will throw BoundsError if 'backing_offset'/'length' * is beyond the bounds of the backing tvbuff. * Can throw ReportedBoundsError. */ -WS_DLL_PUBLIC tvbuff_t* tvb_new_subset(tvbuff_t* backing, - const gint backing_offset, const gint backing_length, const gint reported_length); +WS_DLL_PUBLIC tvbuff_t *tvb_new_subset(tvbuff_t *backing, + const gint backing_offset, const gint backing_length, + const gint reported_length); /** * Similar to tvb_new_subset() but with captured length calculated * to fit within the existing captured length and the specified * backing length (which is used as the reported length). * Can throw ReportedBoundsError. */ -WS_DLL_PUBLIC tvbuff_t* tvb_new_subset_length(tvbuff_t *backing, - const gint backing_offset, const gint backing_length); +WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_length(tvbuff_t *backing, + const gint backing_offset, const gint backing_length); -/** Similar to tvb_new_subset() but with backing_length and reported_length set to -1. - * Can throw ReportedBoundsError. */ -WS_DLL_PUBLIC tvbuff_t* tvb_new_subset_remaining(tvbuff_t* backing, - const gint backing_offset); +/** Similar to tvb_new_subset() but with backing_length and reported_length set + * to -1. Can throw ReportedBoundsError. */ +WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_remaining(tvbuff_t *backing, + const gint backing_offset); /* * Both tvb_composite_append and tvb_composite_prepend can throw @@ -204,48 +208,53 @@ * the 'member' tvbuff. */ /** Append to the list of tvbuffs that make up this composite tvbuff */ -WS_DLL_PUBLIC void tvb_composite_append(tvbuff_t* tvb, tvbuff_t* member); +WS_DLL_PUBLIC void tvb_composite_append(tvbuff_t *tvb, tvbuff_t *member); /** Prepend to the list of tvbuffs that make up this composite tvbuff */ -extern void tvb_composite_prepend(tvbuff_t* tvb, tvbuff_t* member); +extern void tvb_composite_prepend(tvbuff_t *tvb, tvbuff_t *member); /** Create an empty composite tvbuff. */ -WS_DLL_PUBLIC tvbuff_t* tvb_new_composite(void); +WS_DLL_PUBLIC tvbuff_t *tvb_new_composite(void); /** Mark a composite tvbuff as initialized. No further appends or prepends * occur, data access can finally happen after this finalization. */ -WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t* tvb); +WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t *tvb); /* Get total length of buffer */ -WS_DLL_PUBLIC guint tvb_length(const tvbuff_t*); +WS_DLL_PUBLIC guint tvb_length(const tvbuff_t *tvb); /** Computes bytes to end of buffer, from offset (which can be negative, * to indicate bytes from end of buffer). Function returns 0 if offset is out * of bounds. No exception is thrown. */ -WS_DLL_PUBLIC gint tvb_length_remaining(const tvbuff_t*, const gint offset); +WS_DLL_PUBLIC gint tvb_length_remaining(const tvbuff_t *tvb, const gint offset); /** Same as above, but throws an exception if the offset is out of bounds. */ -WS_DLL_PUBLIC guint tvb_ensure_length_remaining(const tvbuff_t*, const gint offset); +WS_DLL_PUBLIC guint tvb_ensure_length_remaining(const tvbuff_t *tvb, + const gint offset); /* Checks (w/o throwing exception) that the bytes referred to by * 'offset'/'length' actually exist in the buffer */ -WS_DLL_PUBLIC gboolean tvb_bytes_exist(const tvbuff_t*, const gint offset, const gint length); +WS_DLL_PUBLIC gboolean tvb_bytes_exist(const tvbuff_t *tvb, const gint offset, + const gint length); /** Checks that the bytes referred to by 'offset'/'length' actually exist * in the buffer, and throws an exception if they aren't. */ -WS_DLL_PUBLIC void tvb_ensure_bytes_exist(const tvbuff_t *tvb, const gint offset, const gint length); +WS_DLL_PUBLIC void tvb_ensure_bytes_exist(const tvbuff_t *tvb, + const gint offset, const gint length); /* Checks (w/o throwing exception) that offset exists in buffer */ -WS_DLL_PUBLIC gboolean tvb_offset_exists(const tvbuff_t*, const gint offset); +WS_DLL_PUBLIC gboolean tvb_offset_exists(const tvbuff_t *tvb, + const gint offset); /* Get reported length of buffer */ -WS_DLL_PUBLIC guint tvb_reported_length(const tvbuff_t*); +WS_DLL_PUBLIC guint tvb_reported_length(const tvbuff_t *tvb); /** Computes bytes of reported packet data to end of buffer, from offset * (which can be negative, to indicate bytes from end of buffer). Function * returns 0 if offset is out of bounds. No exception is thrown. */ -WS_DLL_PUBLIC gint tvb_reported_length_remaining(const tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC gint tvb_reported_length_remaining(const tvbuff_t *tvb, + const gint offset); /** Set the reported length of a tvbuff to a given value; used for protocols whose headers contain an explicit length and where the calling @@ -253,7 +262,7 @@ this protocol. Also adjusts the data length. */ -WS_DLL_PUBLIC void tvb_set_reported_length(tvbuff_t*, const guint); +WS_DLL_PUBLIC void tvb_set_reported_length(tvbuff_t *tvb, const guint); WS_DLL_PUBLIC guint tvb_offset_from_real_beginning(const tvbuff_t *tvb); @@ -269,65 +278,78 @@ /************** START OF ACCESSORS ****************/ /* All accessors will throw an exception if appropriate */ -WS_DLL_PUBLIC guint8 tvb_get_guint8(tvbuff_t*, const gint offset); +WS_DLL_PUBLIC guint8 tvb_get_guint8(tvbuff_t *tvb, const gint offset); -WS_DLL_PUBLIC guint16 tvb_get_ntohs(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint32 tvb_get_ntoh24(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint32 tvb_get_ntohl(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint64 tvb_get_ntoh40(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint64 tvb_get_ntoh48(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint64 tvb_get_ntoh56(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint64 tvb_get_ntoh64(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC gfloat tvb_get_ntohieee_float(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC gdouble tvb_get_ntohieee_double(tvbuff_t*, const gint offset); - -WS_DLL_PUBLIC guint16 tvb_get_letohs(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint32 tvb_get_letoh24(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint32 tvb_get_letohl(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint64 tvb_get_letoh40(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint64 tvb_get_letoh48(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint64 tvb_get_letoh56(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC guint64 tvb_get_letoh64(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC gfloat tvb_get_letohieee_float(tvbuff_t*, const gint offset); -WS_DLL_PUBLIC gdouble tvb_get_letohieee_double(tvbuff_t*, const gint offset); +WS_DLL_PUBLIC guint16 tvb_get_ntohs(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint32 tvb_get_ntoh24(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint32 tvb_get_ntohl(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint64 tvb_get_ntoh40(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint64 tvb_get_ntoh48(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint64 tvb_get_ntoh56(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint64 tvb_get_ntoh64(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC gfloat tvb_get_ntohieee_float(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC gdouble tvb_get_ntohieee_double(tvbuff_t *tvb, + const gint offset); + +WS_DLL_PUBLIC guint16 tvb_get_letohs(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint32 tvb_get_letoh24(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint32 tvb_get_letohl(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint64 tvb_get_letoh40(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint64 tvb_get_letoh48(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint64 tvb_get_letoh56(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC guint64 tvb_get_letoh64(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC gfloat tvb_get_letohieee_float(tvbuff_t *tvb, const gint offset); +WS_DLL_PUBLIC gdouble tvb_get_letohieee_double(tvbuff_t *tvb, + const gint offset); /** * Fetch an IPv4 address, in network byte order. * We do *not* convert it to host byte order; we leave it in * network byte order, as that's what its callers expect. */ -WS_DLL_PUBLIC guint32 tvb_get_ipv4(tvbuff_t*, const gint offset); +WS_DLL_PUBLIC guint32 tvb_get_ipv4(tvbuff_t *tvb, const gint offset); /* Fetch an IPv6 address. */ -WS_DLL_PUBLIC void tvb_get_ipv6(tvbuff_t*, const gint offset, struct e_in6_addr *addr); +WS_DLL_PUBLIC void tvb_get_ipv6(tvbuff_t *tvb, const gint offset, + struct e_in6_addr *addr); /* Fetch a GUID. */ -WS_DLL_PUBLIC void tvb_get_ntohguid(tvbuff_t *tvb, const gint offset, e_guid_t *guid); -WS_DLL_PUBLIC void tvb_get_letohguid(tvbuff_t *tvb, const gint offset, e_guid_t *guid); -WS_DLL_PUBLIC void tvb_get_guid(tvbuff_t *tvb, const gint offset, e_guid_t *guid, const guint representation); - -/* Fetch a specified number of bits from bit offset in a tvb. - All of these functions are equivalent, except for the type of the retun value. - Note that the parameter encoding (where supplied) is meaningless and ignored */ +WS_DLL_PUBLIC void tvb_get_ntohguid(tvbuff_t *tvb, const gint offset, + e_guid_t *guid); +WS_DLL_PUBLIC void tvb_get_letohguid(tvbuff_t *tvb, const gint offset, + e_guid_t *guid); +WS_DLL_PUBLIC void tvb_get_guid(tvbuff_t *tvb, const gint offset, + e_guid_t *guid, const guint representation); + +/* Fetch a specified number of bits from bit offset in a tvb. All of these + * functions are equivalent, except for the type of the return value. Note + * that the parameter encoding (where supplied) is meaningless and ignored */ /* get 1 - 8 bits returned in a guint8 */ -WS_DLL_PUBLIC guint8 tvb_get_bits8(tvbuff_t *tvb, guint bit_offset, const gint no_of_bits); +WS_DLL_PUBLIC guint8 tvb_get_bits8(tvbuff_t *tvb, guint bit_offset, + const gint no_of_bits); /* get 1 - 16 bits returned in a guint16 */ -WS_DLL_PUBLIC guint16 tvb_get_bits16(tvbuff_t *tvb, guint bit_offset, const gint no_of_bits, const guint encoding); +WS_DLL_PUBLIC guint16 tvb_get_bits16(tvbuff_t *tvb, guint bit_offset, + const gint no_of_bits, const guint encoding); /* get 1 - 32 bits returned in a guint32 */ -WS_DLL_PUBLIC guint32 tvb_get_bits32(tvbuff_t *tvb, guint bit_offset, const gint no_of_bits, const guint encoding); +WS_DLL_PUBLIC guint32 tvb_get_bits32(tvbuff_t *tvb, guint bit_offset, + const gint no_of_bits, const guint encoding); /* get 1 - 64 bits returned in a guint64 */ -WS_DLL_PUBLIC guint64 tvb_get_bits64(tvbuff_t *tvb, guint bit_offset, const gint no_of_bits, const guint encoding); +WS_DLL_PUBLIC guint64 tvb_get_bits64(tvbuff_t *tvb, guint bit_offset, + const gint no_of_bits, const guint encoding); /** - * This function has EXACTLY the same behaviour as + * This function has EXACTLY the same behavior as * tvb_get_bits32() */ -WS_DLL_PUBLIC guint32 tvb_get_bits(tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits, const guint encoding); +WS_DLL_PUBLIC guint32 tvb_get_bits(tvbuff_t *tvb, const guint bit_offset, + const gint no_of_bits, const guint encoding); WS_DLL_PUBLIC -void tvb_get_bits_buf(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, guint8 *buf, gboolean lsb0); +void tvb_get_bits_buf(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, + guint8 *buf, gboolean lsb0); WS_DLL_PUBLIC -guint8 *wmem_packet_tvb_get_bits(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, gboolean lsb0); +guint8 *wmem_packet_tvb_get_bits(tvbuff_t *tvb, guint bit_offset, + gint no_of_bits, gboolean lsb0); /** Returns target for convenience. Does not suffer from possible * expense of tvb_get_ptr(), since this routine is smart enough @@ -335,13 +357,15 @@ * different TVBUFF_REAL_DATA tvbuffs. This function assumes that the * target memory is already allocated; it does not allocate or free the * target memory. */ -WS_DLL_PUBLIC void* tvb_memcpy(tvbuff_t*, void* target, const gint offset, size_t length); +WS_DLL_PUBLIC void *tvb_memcpy(tvbuff_t *tvb, void *target, const gint offset, + size_t length); /** If scope is set to NULL it is the user's responsibility to g_free() * the memory allocated by tvb_memdup(). Otherwise memory is * automatically freed when the scope lifetime is reached. * Calls tvb_memcpy() */ -WS_DLL_PUBLIC void* tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, size_t length); +WS_DLL_PUBLIC void *tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb, + const gint offset, size_t length); /** WARNING! This function is possibly expensive, temporarily allocating * another copy of the packet data. Furthermore, it's dangerous because once @@ -368,7 +392,8 @@ * and the pointer to the newly-contiguous data is returned. This dynamically- * allocated memory will be freed when the tvbuff is freed, after the * tvbuff_free_cb_t() is called, if any. */ -WS_DLL_PUBLIC const guint8* tvb_get_ptr(tvbuff_t*, const gint offset, const gint length); +WS_DLL_PUBLIC const guint8 *tvb_get_ptr(tvbuff_t *tvb, const gint offset, + const gint length); /** Find first occurrence of needle in tvbuff, starting at offset. Searches * at most maxlength number of bytes; if maxlength is -1, searches to @@ -377,8 +402,8 @@ * Will not throw an exception, even if maxlength exceeds boundary of tvbuff; * in that case, -1 will be returned if the boundary is reached before * finding needle. */ -WS_DLL_PUBLIC gint tvb_find_guint8(tvbuff_t*, const gint offset, const gint maxlength, - const guint8 needle); +WS_DLL_PUBLIC gint tvb_find_guint8(tvbuff_t *tvb, const gint offset, + const gint maxlength, const guint8 needle); /** Find first occurrence of any of the needles in tvbuff, starting at offset. * Searches at most maxlength number of bytes. Returns the offset of the @@ -386,8 +411,8 @@ * Will not throw an exception, even if * maxlength exceeds boundary of tvbuff; in that case, -1 will be returned if * the boundary is reached before finding needle. */ -WS_DLL_PUBLIC gint tvb_pbrk_guint8(tvbuff_t *, const gint offset, const gint maxlength, - const guint8 *needles, guchar *found_needle); +WS_DLL_PUBLIC gint tvb_pbrk_guint8(tvbuff_t *tvb, const gint offset, + const gint maxlength, const guint8 *needles, guchar *found_needle); /** Find size of stringz (NUL-terminated string) by looking for terminating * NUL. The size of the string includes the terminating NUL. @@ -408,7 +433,8 @@ * 'maxlength' characters'; if 'maxlength' is -1, searches to end * of tvbuff. * Returns -1 if 'maxlength' reached before finding EOS. */ -WS_DLL_PUBLIC gint tvb_strnlen(tvbuff_t*, const gint offset, const guint maxlength); +WS_DLL_PUBLIC gint tvb_strnlen(tvbuff_t *tvb, const gint offset, + const guint maxlength); /** Convert a string from Unicode to ASCII. At the moment we fake it by * assuming all characters are ASCII )-: The len parameter is the number @@ -420,31 +446,35 @@ * and must be g_free by the caller. Otherwise memory is automatically * freed when the scope lifetime is reached. */ -WS_DLL_PUBLIC char *tvb_get_faked_unicode(wmem_allocator_t *scope, tvbuff_t *tvb, - int offset, const int len, const gboolean little_endian); +WS_DLL_PUBLIC char *tvb_get_faked_unicode(wmem_allocator_t *scope, + tvbuff_t *tvb, int offset, const int len, const gboolean little_endian); /** * Format the data in the tvb from offset for size ... */ -WS_DLL_PUBLIC gchar * tvb_format_text(tvbuff_t *tvb, const gint offset, const gint size); +WS_DLL_PUBLIC gchar *tvb_format_text(tvbuff_t *tvb, const gint offset, + const gint size); /** * Like "tvb_format_text()", but for 'wsp'; don't show * the characters as C-style escapes. */ -WS_DLL_PUBLIC gchar * tvb_format_text_wsp(tvbuff_t *tvb, const gint offset, const gint size); +WS_DLL_PUBLIC gchar *tvb_format_text_wsp(tvbuff_t *tvb, const gint offset, + const gint size); /** * Like "tvb_format_text()", but for null-padded strings; don't show * the null padding characters as "\000". */ -extern gchar *tvb_format_stringzpad(tvbuff_t *tvb, const gint offset, const gint size); +extern gchar *tvb_format_stringzpad(tvbuff_t *tvb, const gint offset, + const gint size); /** * Like "tvb_format_text_wsp()", but for null-padded strings; don't show * the null padding characters as "\000". */ -extern gchar *tvb_format_stringzpad_wsp(tvbuff_t *tvb, const gint offset, const gint size); +extern gchar *tvb_format_stringzpad_wsp(tvbuff_t *tvb, const gint offset, + const gint size); /** @@ -466,11 +496,12 @@ * the memory allocated by tvb_memdup(). Otherwise memory is * automatically freed when the scope lifetime is reached. */ -WS_DLL_PUBLIC guint8 *tvb_get_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint length); -WS_DLL_PUBLIC gchar *tvb_get_unicode_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, gint length, - const guint encoding); -WS_DLL_PUBLIC guint8 *tvb_get_string_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, - const gint length, const guint encoding); +WS_DLL_PUBLIC guint8 *tvb_get_string(wmem_allocator_t *scope, tvbuff_t *tvb, + const gint offset, const gint length); +WS_DLL_PUBLIC gchar *tvb_get_unicode_string(wmem_allocator_t *scope, + tvbuff_t *tvb, const gint offset, gint length, const guint encoding); +WS_DLL_PUBLIC guint8 *tvb_get_string_enc(wmem_allocator_t *scope, + tvbuff_t *tvb, const gint offset, const gint length, const guint encoding); /** @@ -497,18 +528,20 @@ * the memory allocated by tvb_memdup(). Otherwise memory is * automatically freed when the scope lifetime is reached. */ -WS_DLL_PUBLIC guint8 *tvb_get_stringz(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, gint *lengthp); -WS_DLL_PUBLIC guint8 *tvb_get_stringz_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, gint *lengthp, - const guint encoding); -WS_DLL_PUBLIC const guint8 *tvb_get_const_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp); -WS_DLL_PUBLIC gchar *tvb_get_unicode_stringz(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, - gint *lengthp, const guint encoding); +WS_DLL_PUBLIC guint8 *tvb_get_stringz(wmem_allocator_t *scope, tvbuff_t *tvb, + const gint offset, gint *lengthp); +WS_DLL_PUBLIC guint8 *tvb_get_stringz_enc(wmem_allocator_t *scope, + tvbuff_t *tvb, const gint offset, gint *lengthp, const guint encoding); +WS_DLL_PUBLIC const guint8 *tvb_get_const_stringz(tvbuff_t *tvb, + const gint offset, gint *lengthp); +WS_DLL_PUBLIC gchar *tvb_get_unicode_stringz(wmem_allocator_t *scope, + tvbuff_t *tvb, const gint offset, gint *lengthp, const guint encoding); /** Looks for a stringz (NUL-terminated string) in tvbuff and copies * no more than bufsize number of bytes, including terminating NUL, to buffer. - * Returns length of string (not including terminating NUL), or -1 if the string was - * truncated in the buffer due to not having reached the terminating NUL. - * In this way, it acts like g_snprintf(). + * Returns length of string (not including terminating NUL), or -1 if the + * string was truncated in the buffer due to not having reached the terminating + * NUL. In this way, it acts like g_snprintf(). * * When processing a packet where the remaining number of bytes is less * than bufsize, an exception is not thrown if the end of the packet @@ -517,8 +550,8 @@ * is truncated with a NUL, albeit not at buffer[bufsize - 1], but * at the correct spot, terminating the string. */ -WS_DLL_PUBLIC gint tvb_get_nstringz(tvbuff_t *tvb, const gint offset, const guint bufsize, - guint8* buffer); +WS_DLL_PUBLIC gint tvb_get_nstringz(tvbuff_t *tvb, const gint offset, + const guint bufsize, guint8 *buffer); /** Like tvb_get_nstringz(), but never returns -1. The string is guaranteed to * have a terminating NUL. If the string was truncated when copied into buffer, @@ -526,8 +559,8 @@ * * bufsize MUST be greater than 0. */ -WS_DLL_PUBLIC gint tvb_get_nstringz0(tvbuff_t *tvb, const gint offset, const guint bufsize, - guint8* buffer); +WS_DLL_PUBLIC gint tvb_get_nstringz0(tvbuff_t *tvb, const gint offset, + const guint bufsize, guint8 *buffer); /** * Given a tvbuff, an offset into the tvbuff, and a length that starts @@ -539,10 +572,10 @@ * Return the length of the line (not counting the line terminator at * the end), or, if we don't find a line terminator: * - * if "deseg" is true, return -1; + * if "deseg" is true, return -1; * - * if "deseg" is false, return the amount of data remaining in - * the buffer. + * if "deseg" is false, return the amount of data remaining in + * the buffer. * * Set "*next_offset" to the offset of the character past the line * terminator, or past the end of the buffer if we don't find a line @@ -569,8 +602,8 @@ * terminator, or past the end of the buffer if we don't find a line * terminator. */ -WS_DLL_PUBLIC gint tvb_find_line_end_unquoted(tvbuff_t *tvb, const gint offset, int len, - gint *next_offset); +WS_DLL_PUBLIC gint tvb_find_line_end_unquoted(tvbuff_t *tvb, const gint offset, + int len, gint *next_offset); /** * Copied from the mgcp dissector. (This function should be moved to /epan ) @@ -589,82 +622,88 @@ * is smaller. */ -WS_DLL_PUBLIC gint tvb_skip_wsp(tvbuff_t* tvb, const gint offset, const gint maxlength); +WS_DLL_PUBLIC gint tvb_skip_wsp(tvbuff_t *tvb, const gint offset, + const gint maxlength); -WS_DLL_PUBLIC gint tvb_skip_wsp_return(tvbuff_t* tvb, const gint offset); +WS_DLL_PUBLIC gint tvb_skip_wsp_return(tvbuff_t *tvb, const gint offset); /** * Call strncmp after checking if enough chars left, returning 0 if * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ -WS_DLL_PUBLIC gint tvb_strneql(tvbuff_t *tvb, const gint offset, const gchar *str, - const size_t size); +WS_DLL_PUBLIC gint tvb_strneql(tvbuff_t *tvb, const gint offset, + const gchar *str, const size_t size); /** * Call g_ascii_strncasecmp after checking if enough chars left, returning * 0 if it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ -WS_DLL_PUBLIC gint tvb_strncaseeql(tvbuff_t *tvb, const gint offset, const gchar *str, - const size_t size); +WS_DLL_PUBLIC gint tvb_strncaseeql(tvbuff_t *tvb, const gint offset, + const gchar *str, const size_t size); /** * Call memcmp after checking if enough chars left, returning 0 if * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ -WS_DLL_PUBLIC gint tvb_memeql(tvbuff_t *tvb, const gint offset, const guint8 *str, - size_t size); +WS_DLL_PUBLIC gint tvb_memeql(tvbuff_t *tvb, const gint offset, + const guint8 *str, size_t size); /** * Format a bunch of data from a tvbuff as bytes, returning a pointer * to the string with the formatted data, with "punct" as a byte * separator. */ -WS_DLL_PUBLIC gchar *tvb_bytes_to_str_punct(tvbuff_t *tvb, const gint offset, const gint len, - const gchar punct); +WS_DLL_PUBLIC gchar *tvb_bytes_to_str_punct(tvbuff_t *tvb, const gint offset, + const gint len, const gchar punct); /** * Format a bunch of data from a tvbuff as bytes, returning a pointer * to the string with the formatted data. */ -WS_DLL_PUBLIC gchar *tvb_bytes_to_str(tvbuff_t *tvb, const gint offset, const gint len); +WS_DLL_PUBLIC gchar *tvb_bytes_to_str(tvbuff_t *tvb, const gint offset, + const gint len); /** * Given a tvbuff, an offset into the tvbuff, and a length that starts * at that offset (which may be -1 for "all the way to the end of the * tvbuff"), fetch BCD encoded digits from a tvbuff starting from either - * the low or high half byte, formating the digits according to an input digit set, - * if NUll a default digit set of 0-9 returning "?" for overdecadic digits will be used. - * A pointer to the EP allocated string will be returned. - * Note a tvbuff content of 0xf is considered a 'filler' and will end the conversion. + * the low or high half byte, formatting the digits according to an input digit + * set, if NUL a default digit set of 0-9 returning "?" for overdecadic digits + * will be used. A pointer to the EP allocated string will be returned. + * Note a tvbuff content of 0xf is considered a 'filler' and will end the + * conversion. */ typedef struct dgt_set_t { - const unsigned char out[15]; + const unsigned char out[15]; } dgt_set_t; -WS_DLL_PUBLIC const gchar *tvb_bcd_dig_to_wmem_packet_str(tvbuff_t *tvb, const gint offset, const gint len, dgt_set_t *dgt, gboolean skip_first); +WS_DLL_PUBLIC const gchar *tvb_bcd_dig_to_wmem_packet_str(tvbuff_t *tvb, + const gint offset, const gint len, dgt_set_t *dgt, gboolean skip_first); /** Locate a sub-tvbuff within another tvbuff, starting at position * 'haystack_offset'. Returns the index of the beginning of 'needle' within * 'haystack', or -1 if 'needle' is not found. The index is relative * to the start of 'haystack', not 'haystack_offset'. */ WS_DLL_PUBLIC gint tvb_find_tvb(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb, - const gint haystack_offset); + const gint haystack_offset); /** * Uncompresses a zlib compressed packet inside a tvbuff at offset with * length comprlen. Returns an uncompressed tvbuffer if uncompression * succeeded or NULL if uncompression failed. */ -WS_DLL_PUBLIC tvbuff_t* tvb_uncompress(tvbuff_t *tvb, const int offset, int comprlen); +WS_DLL_PUBLIC tvbuff_t *tvb_uncompress(tvbuff_t *tvb, const int offset, + int comprlen); /** * Uncompresses a zlib compressed packet inside a tvbuff at offset with - * length comprlen. Returns an uncompressed tvbuffer attached to tvb if uncompression - * succeeded or NULL if uncompression failed. + * length comprlen. Returns an uncompressed tvbuffer attached to tvb if + * uncompression succeeded or NULL if uncompression failed. */ -extern tvbuff_t* tvb_child_uncompress(tvbuff_t *parent, tvbuff_t *tvb, const int offset, int comprlen); +extern tvbuff_t *tvb_child_uncompress(tvbuff_t *parent, tvbuff_t *tvb, + const int offset, int comprlen); /************** END OF ACCESSORS ****************/ @@ -675,3 +714,17 @@ #endif /* __cplusplus */ #endif /* __TVBUFF_H__ */ + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=4 expandtab: + * :indentSize=4:tabSize=4:noTabs=true: + */ + diff -Nru wireshark-1.12.0~201310251247/epan/uat_load.l wireshark-1.12.0~201311020920/epan/uat_load.l --- wireshark-1.12.0~201310251247/epan/uat_load.l 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/epan/uat_load.l 2013-11-02 02:12:36.000000000 +0000 @@ -81,7 +81,10 @@ static gchar *parse_str; static guint parse_str_pos; -#define ERROR(fmtd) do { error = ep_strdup_printf("%s:%d: %s",uat->filename,linenum,ep_strdup_printf fmtd); yyterminate(); } while(0) +#define ERROR(fmtd) do { \ + error = ep_strdup_printf("%s:%d: %s",uat->filename,linenum,ep_strdup_printf fmtd); \ + yyterminate(); \ +} while(0) #define SET_FIELD() \ { const gchar* errx; \ @@ -237,7 +240,7 @@ {newline} { void* rec; - const gchar* err = NULL; + const char* err = NULL; linenum++; @@ -251,7 +254,12 @@ uat->update_cb(rec,&err); if (err) { - ERROR(("%s",err)); + char *tmp = ep_strdup(err); + /* XXX bit of a hack to remove emem from dissectors, this can + * be removed as proper use of glib memory is propogated + * through the rest of the UAT code */ + g_free((char*)err); + ERROR(("%s",tmp)); } valid_record = TRUE; diff -Nru wireshark-1.12.0~201310251247/image/Makefile.nmake wireshark-1.12.0~201311020920/image/Makefile.nmake --- wireshark-1.12.0~201310251247/image/Makefile.nmake 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/image/Makefile.nmake 2013-11-02 02:12:36.000000000 +0000 @@ -26,12 +26,12 @@ -e s/@RC_VERSION@/$(RC_VERSION)/ \ < libwireshark.rc.in > $@ -tshark.rc : tshark.rc.in ..\config.nmake +tshark.rc : tshark.rc.in wireshark.exe.manifest ..\config.nmake sed -e s/@VERSION@/$(VERSION)/ \ -e s/@RC_VERSION@/$(RC_VERSION)/ \ < tshark.rc.in > $@ -rawshark.rc : rawshark.rc.in ..\config.nmake +rawshark.rc : rawshark.rc.in wireshark.exe.manifest ..\config.nmake sed -e s/@VERSION@/$(VERSION)/ \ -e s/@RC_VERSION@/$(RC_VERSION)/ \ < rawshark.rc.in > $@ @@ -71,7 +71,7 @@ -e s/@RC_VERSION@/$(RC_VERSION)/ \ < libwsutil.rc.in > $@ -dumpcap.rc : dumpcap.rc.in ..\config.nmake +dumpcap.rc : dumpcap.rc.in wireshark.exe.manifest ..\config.nmake sed -e s/@VERSION@/$(VERSION)/ \ -e s/@RC_VERSION@/$(RC_VERSION)/ \ < dumpcap.rc.in > $@ diff -Nru wireshark-1.12.0~201310251247/image/dumpcap.rc.in wireshark-1.12.0~201311020920/image/dumpcap.rc.in --- wireshark-1.12.0~201310251247/image/dumpcap.rc.in 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/image/dumpcap.rc.in 2013-11-02 02:12:36.000000000 +0000 @@ -34,3 +34,8 @@ VALUE "Translation", 0x409, 1200 END END + +#define MANIFEST_RESOURCE_ID 1 +#define RT_MANIFEST 24 + +MANIFEST_RESOURCE_ID RT_MANIFEST "wireshark.exe.manifest" diff -Nru wireshark-1.12.0~201310251247/image/rawshark.rc.in wireshark-1.12.0~201311020920/image/rawshark.rc.in --- wireshark-1.12.0~201310251247/image/rawshark.rc.in 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/image/rawshark.rc.in 2013-11-02 02:12:36.000000000 +0000 @@ -34,3 +34,8 @@ VALUE "Translation", 0x409, 1200 END END + +#define MANIFEST_RESOURCE_ID 1 +#define RT_MANIFEST 24 + +MANIFEST_RESOURCE_ID RT_MANIFEST "wireshark.exe.manifest" diff -Nru wireshark-1.12.0~201310251247/image/tshark.rc.in wireshark-1.12.0~201311020920/image/tshark.rc.in --- wireshark-1.12.0~201310251247/image/tshark.rc.in 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/image/tshark.rc.in 2013-11-02 02:12:36.000000000 +0000 @@ -34,3 +34,8 @@ VALUE "Translation", 0x409, 1200 END END + +#define MANIFEST_RESOURCE_ID 1 +#define RT_MANIFEST 24 + +MANIFEST_RESOURCE_ID RT_MANIFEST "wireshark.exe.manifest" diff -Nru wireshark-1.12.0~201310251247/image/wireshark.exe.manifest.in wireshark-1.12.0~201311020920/image/wireshark.exe.manifest.in --- wireshark-1.12.0~201310251247/image/wireshark.exe.manifest.in 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/image/wireshark.exe.manifest.in 2013-11-02 02:12:36.000000000 +0000 @@ -19,4 +19,26 @@ /> + + + + + + + + + + + + + + + + + + + diff -Nru wireshark-1.12.0~201310251247/macosx-setup.sh wireshark-1.12.0~201311020920/macosx-setup.sh --- wireshark-1.12.0~201310251247/macosx-setup.sh 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/macosx-setup.sh 2013-11-02 02:12:36.000000000 +0000 @@ -24,13 +24,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# To set up Qt, set TOOLKIT to qt -# To set up GTK+ 3, set TOOLKIT to gtk3 -# To set up GTK+ 2, set TOOLKIT to gtk2 -# -TOOLKIT=gtk3 - -# # To build cmake # CMAKE=1 # @@ -42,44 +35,63 @@ # # and change "macx-clang" to "macx-clang-32" in the line below. # +# Note: when building against the 10.6 SDK, clang fails, because there's +# a missing libstdc++.dylib in the SDK; this does not bother g++, however. +# +#TARGET_PLATFORM=macx-g++ TARGET_PLATFORM=macx-clang # -# Versions to download and install. +# Versions of packages to download and install. +# + +# +# Some packages need xz to unpack their current source. +# xz is not yet provided with OS X. +# +XZ_VERSION=5.0.4 + +# +# In case we want to build with cmake. +# +CMAKE_VERSION=2.8.10.2 + # -# The following libraries and tools are required. +# The following libraries and tools are required even to build only TShark. # GETTEXT_VERSION=0.18.2 GLIB_VERSION=2.36.0 PKG_CONFIG_VERSION=0.28 -case "$TOOLKIT" in -qt) - QT_VERSION=5.1.1 - ;; -gtk*) +# +# One or more of the following libraries are required to build Wireshark. +# +# If you don't want to build with Qt, comment out the QT_VERSION= line. +# +# If you want to build with GTK+ 2, comment out the GTK_VERSION=3.* line +# and un-comment the GTK_VERSION=2.* line. +# +# If you don't want to build with GTK+ at all, comment out both lines. +# +#QT_VERSION=5.1.1 +QT_VERSION=5.2.0 +GTK_VERSION=2.24.17 +#GTK_VERSION=3.5.2 +if [ "$GTK_VERSION" ]; then + # + # We'll be building GTK+, so we need some additional libraries. + # + GTK_MAJOR_VERSION="`expr $GTK_VERSION : '\([0-9][0-9]*\).*'`" + GTK_MINOR_VERSION="`expr $GTK_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`" + GTK_DOTDOT_VERSION="`expr $GTK_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`" + ATK_VERSION=2.8.0 PANGO_VERSION=1.30.1 PNG_VERSION=1.5.17 PIXMAN_VERSION=0.26.0 CAIRO_VERSION=1.12.2 GDK_PIXBUF_VERSION=2.28.0 - if [ "$TOOLKIT" = gtk2 ]; then - GTK_VERSION=2.24.17 - else - GTK_VERSION=3.5.2 - fi - ;; -esac - -# -# Some package need xz to unpack their current source. -# xz is not yet provided with OS X. -# -XZ_VERSION=5.0.4 - -# In case we want to build with cmake -CMAKE_VERSION=2.8.10.2 +fi # # The following libraries are optional. @@ -111,6 +123,8 @@ # GEOIP_VERSION=1.4.8 +CARES_VERSION=1.10.0 + DARWIN_MAJOR_VERSION=`uname -r | sed 's/\([0-9]*\).*/\1/'` # @@ -137,6 +151,17 @@ # We also do a "make distclean", so that we don't have leftovers from # old configurations. # + + installed_cares_version=`ls cares-*-done 2>/dev/null | sed 's/cares-\(.*\)-done/\1/'` + if [ ! -z "$installed_cares_version" ] ; then + echo "Uninstalling C-Ares API:" + cd cares-$installed_cares_version + $DO_MAKE_UNINSTALL || exit 1 + make distclean || exit 1 + cd .. + rm cares-$installed_cares_version-done + fi + installed_geoip_version=`ls geoip-*-done 2>/dev/null | sed 's/geoip-\(.*\)-done/\1/'` if [ ! -z "$installed_geoip_version" ] ; then echo "Uninstalling GeoIP API:" @@ -284,6 +309,20 @@ rm libpng-$installed_libpng_version-done fi + installed_qt_version=`ls qt-*-done 2>/dev/null | sed 's/qt-\(.*\)-done/\1/'` + if [ ! -z "$installed_qt_version" ] ; then + echo "Uninstalling Qt:" + cd qt-everywhere-opensource-src-$installed_qt_version + $DO_MAKE_UNINSTALL || exit 1 + # + # XXX - "make distclean" doesn't work. qmake sure does a + # good job of constructing Makefiles that work correctly.... + # + #make distclean || exit 1 + cd .. + rm qt-$installed_qt_version-done + fi + installed_glib_version=`ls glib-*-done 2>/dev/null | sed 's/glib-\(.*\)-done/\1/'` if [ ! -z "$installed_glib_version" ] ; then echo "Uninstalling GLib:" @@ -435,6 +474,16 @@ fi # +# Configure scripts tend to set CFLAGS and CXXFLAGS to "-g -O2" if +# invoked without CFLAGS or CXXFLAGS being set in the environment. +# +# However, we *are* setting them in the environment, for our own +# nefarious purposes, so start them out as "-g -O2". +# +CFLAGS="-g -O2" +CXXFLAGS="-g -O2" + +# # To make this work on Leopard (rather than working *on* Snow Leopard # when building *for* Leopard) will take more work. # @@ -616,12 +665,15 @@ # causes some BPF functions not to work with 64-bit userland # code, so capturing won't work. # - export CFLAGS="$CFLAGS -arch i386" - export CXXFLAGS="$CXXFLAGS -arch i386" + CFLAGS="$CFLAGS -arch i386" + CXXFLAGS="$CXXFLAGS -arch i386" export LDFLAGS="$LDFLAGS -arch i386" fi fi +export CFLAGS +export CXXFLAGS + # # You need Xcode or the command-line tools installed to get the compilers. # @@ -630,7 +682,7 @@ exit 1 fi -if [[ $TOOLKIT = qt ]]; then +if [ "$QT_VERSION" ]; then # # We need Xcode, not just the command-line tools, installed to build # Qt. @@ -640,7 +692,8 @@ echo "The command-line build tools are not sufficient to build Qt." exit 1 fi -else +fi +if [ "$GTK_VERSION" ]; then # # If we're building with GTK+, you also need the X11 SDK; with at least # some versions of OS X and Xcode, that is, I think, an optional install. @@ -847,38 +900,49 @@ # Now we have reached a point where we can build everything but # the GUI (Wireshark). # -case "$TOOLKIT" in -qt) - if [ ! -f qt-$QT_VERSION-done ] ; then - echo "Downloading, building, and installing Qt:" - QT_MAJOR_VERSION="`expr $QT_VERSION : '\([0-9][0-9]*\).*'`" - QT_MINOR_VERSION="`expr $QT_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`" - QT_DOTDOT_VERSION="`expr $QT_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`" - QT_MAJOR_MINOR_VERSION=$QT_MAJOR_VERSION.$QT_MINOR_VERSION - # - # What you get for this URL might just be a 302 Found reply, so use - # -L so we get redirected. - # - curl -L -O http://download.qt-project.org/official_releases/qt/$QT_MAJOR_MINOR_VERSION/$QT_VERSION/single/qt-everywhere-opensource-src-$QT_VERSION.tar.gz - # - # Qt 5.1.x sets QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 - # in qtbase/mkspecs/$TARGET_PLATFORM/qmake.conf - # We may need to adjust this manually in the future. - # - # The -no-c++11 flag is needed to work around - # https://bugreports.qt-project.org/browse/QTBUG-30487 - # - tar xf qt-everywhere-opensource-src-$QT_VERSION.tar.gz - cd qt-everywhere-opensource-src-$QT_VERSION - ./configure -sdk macosx$min_osx_target -platform $TARGET_PLATFORM -opensource -confirm-license -no-c++11 - make || exit 1 - $DO_MAKE_INSTALL || exit 1 - cd .. - touch qt-$QT_VERSION-done - fi - ;; +if [ "$QT_VERSION" -a ! -f qt-$QT_VERSION-done ]; then + echo "Downloading, building, and installing Qt:" + QT_MAJOR_VERSION="`expr $QT_VERSION : '\([0-9][0-9]*\).*'`" + QT_MINOR_VERSION="`expr $QT_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`" + QT_DOTDOT_VERSION="`expr $QT_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`" + QT_MAJOR_MINOR_VERSION=$QT_MAJOR_VERSION.$QT_MINOR_VERSION + # + # What you get for this URL might just be a 302 Found reply, so use + # -L so we get redirected. + # + curl -L -O http://download.qt-project.org/official_releases/qt/$QT_MAJOR_MINOR_VERSION/$QT_VERSION/single/qt-everywhere-opensource-src-$QT_VERSION.tar.gz + # + # Qt 5.1.x sets QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 + # in qtbase/mkspecs/$TARGET_PLATFORM/qmake.conf + # We may need to adjust this manually in the future. + # + # The -no-c++11 flag is needed to work around + # https://bugreports.qt-project.org/browse/QTBUG-30487 + # + tar xf qt-everywhere-opensource-src-$QT_VERSION.tar.gz + cd qt-everywhere-opensource-src-$QT_VERSION + # + # We don't build Qt in its Full Shining Glory, as we don't need all + # of its components, and it takes *forever* to build in that form. + # + # Qt 5.2.0 beta1 fails to build on OS X without -no-xcb due to bug + # QTBUG-34382. + # + # Qt 5.x fails to build on OS X with -no-opengl due to bug + # QTBUG-31151. + # + ./configure -v -sdk macosx$min_osx_target -platform $TARGET_PLATFORM \ + -opensource -confirm-license -no-c++11 -no-dbus \ + -no-sql-sqlite -no-xcb -nomake examples \ + -skip qtdoc -skip qtquickcontrols -skip qtwebkit \ + -skip qtwebkit-examples -skip qtxmlpatterns + make || exit 1 + $DO_MAKE_INSTALL || exit 1 + cd .. + touch qt-$QT_VERSION-done +fi -gtk*) +if [ "$GTK_VERSION" ]; then # # GTK+ 3 requires a newer Cairo build than the one that comes with # 10.6, so we build Cairo if we are using GTK+ 3. @@ -889,50 +953,59 @@ # again, if we build with "native" GTK+, we'd have to build and install # it. # - if [[ "$TOOLKIT" = gtk3 || "$cairo_not_in_the_os" = yes ]]; then + if [[ "$GTK_MAJOR_VERSION" -eq 3 || "$cairo_not_in_the_os" = yes ]]; then # # Requirements for Cairo first # - # The libpng that comes with the X11 for leopard has a bogus + # The libpng that comes with the X11 for Leopard has a bogus # pkg-config file that lies about where the header files are, # which causes other packages not to be able to find its # headers. # -# if [ ! -f libpng-$PNG_VERSION-done ] ; then -# echo "Downloading, building, and installing libpng:" -# # -# # The FTP site puts libpng x.y.* into a libpngxy directory. -# # -# subdir=`echo $PNG_VERSION | sed 's/\([1-9][0-9]*\)\.\([1-9][0-9]*\).*/libpng\1\2'/` -# [ -f libpng-$PNG_VERSION.tar.xz ] || curl -O ftp://ftp.simplesystems.org/pub/libpng/png/src/$subdir/libpng-$PNG_VERSION.tar.xz -# xzcat libpng-$PNG_VERSION.tar.xz | tar xf - || exit 1 -# cd libpng-$PNG_VERSION -# CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1 -# make $MAKE_BUILD_OPTS || exit 1 -# $DO_MAKE_INSTALL || exit 1 -# cd .. -# touch libpng-$PNG_VERSION-done -# fi - - # - # The libpixman that comes with the X11 for Leopard is too old - # to support Cairo's image surface backend feature (which requires - # pixman-1 >= 0.22.0). - # -# if [ ! -f pixman-$PIXMAN_VERSION-done ] ; then -# echo "Downloading, building, and installing pixman:" -# [ -f pixman-$PIXMAN_VERSION.tar.gz ] || curl -O http://www.cairographics.org/releases/pixman-$PIXMAN_VERSION.tar.gz -# gzcat pixman-$PIXMAN_VERSION.tar.gz | tar xf - || exit 1 -# cd pixman-$PIXMAN_VERSION -# CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1 -# make $MAKE_BUILD_OPTS || exit 1 -# $DO_MAKE_INSTALL || exit 1 -# cd .. -# touch pixman-$PIXMAN_VERSION-done -# fi + # The libpng in later versions is not what the version of + # libpixman we build below wants - it wants libpng15. + # + if [ ! -f libpng-$PNG_VERSION-done ] ; then + echo "Downloading, building, and installing libpng:" + # + # The FTP site puts libpng x.y.* into a libpngxy directory. + # + subdir=`echo $PNG_VERSION | sed 's/\([1-9][0-9]*\)\.\([1-9][0-9]*\).*/libpng\1\2'/` + [ -f libpng-$PNG_VERSION.tar.xz ] || curl -O ftp://ftp.simplesystems.org/pub/libpng/png/src/$subdir/libpng-$PNG_VERSION.tar.xz + xzcat libpng-$PNG_VERSION.tar.xz | tar xf - || exit 1 + cd libpng-$PNG_VERSION + CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1 + make $MAKE_BUILD_OPTS || exit 1 + $DO_MAKE_INSTALL || exit 1 + cd .. + touch libpng-$PNG_VERSION-done + fi + + # + # The libpixman versions that come with the X11s for Leopard, + # Snow Leopard, and Lion is too old to support Cairo's image + # surface backend feature (which requires pixman-1 >= 0.22.0). + # + # XXX - what about the one that comes with the latest version + # of Xquartz? + # + if [ ! -f pixman-$PIXMAN_VERSION-done ] ; then + echo "Downloading, building, and installing pixman:" + [ -f pixman-$PIXMAN_VERSION.tar.gz ] || curl -O http://www.cairographics.org/releases/pixman-$PIXMAN_VERSION.tar.gz + gzcat pixman-$PIXMAN_VERSION.tar.gz | tar xf - || exit 1 + cd pixman-$PIXMAN_VERSION + CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1 + make V=1 $MAKE_BUILD_OPTS || exit 1 + $DO_MAKE_INSTALL || exit 1 + cd .. + touch pixman-$PIXMAN_VERSION-done + fi # # And now Cairo itself. + # XXX - with the libxcb that comes with 10.6, + # + # xcb_discard_reply() is missing, and the build fails. # if [ ! -f cairo-$CAIRO_VERSION-done ] ; then echo "Downloading, building, and installing Cairo:" @@ -1055,9 +1128,6 @@ if [ ! -f gtk+-$GTK_VERSION-done ] ; then echo "Downloading, building, and installing GTK+:" gtk_dir=`expr $GTK_VERSION : '\([0-9][0-9]*\.[0-9][0-9]*\).*'` - GTK_MAJOR_VERSION="`expr $GTK_VERSION : '\([0-9][0-9]*\).*'`" - GTK_MINOR_VERSION="`expr $GTK_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`" - GTK_DOTDOT_VERSION="`expr $GTK_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`" if [[ $GTK_MAJOR_VERSION -gt 2 || $GTK_MINOR_VERSION -gt 24 || ($GTK_MINOR_VERSION -eq 24 && $GTK_DOTDOT_VERSION -ge 5) ]] @@ -1098,8 +1168,7 @@ cd .. touch gtk+-$GTK_VERSION-done fi - ;; -esac +fi # # Now we have reached a point where we can build everything including @@ -1274,6 +1343,19 @@ touch geoip-$GEOIP_VERSION-done fi +if [ "$CARES_VERSION" -a ! -f geoip-$CARES_VERSION-done ] +then + echo "Downloading, building, and installing C-Ares API:" + [ -f c-ares-$CARES_VERSION.tar.gz ] || curl -L -O http://c-ares.haxx.se/download/c-ares-$CARES_VERSION.tar.gz || exit 1 + gzcat c-ares-$CARES_VERSION.tar.gz | tar xf - || exit 1 + cd c-ares-$CARES_VERSION + CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1 + make $MAKE_BUILD_OPTS || exit 1 + $DO_MAKE_INSTALL || exit 1 + cd .. + touch geoip-$CARES_VERSION-done +fi + echo "" echo "You are now prepared to build Wireshark. To do so do:" diff -Nru wireshark-1.12.0~201310251247/manuf wireshark-1.12.0~201311020920/manuf --- wireshark-1.12.0~201310251247/manuf 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/manuf 2013-11-02 02:12:36.000000000 +0000 @@ -7320,6 +7320,7 @@ 00:1B:C5:0C:00:00/36 DigitalL # Digital Loggers, Inc. 00:1B:C5:0C:10:00/36 EreeElec # EREE Electronique 00:1B:C5:0C:20:00/36 Techsolu # TechSolutions A/S +00:1B:C5:0C:30:00/36 Inomatic # inomatic GmbH 00:1B:C6 StratoRe # Strato Rechenzentrum AG 00:1B:C7 Starvedi # StarVedia Technology Inc. 00:1B:C8 Miura # MIURA CO.,LTD @@ -15502,7 +15503,7 @@ 00:80:9F AlcatelB # ALCATEL BUSINESS SYSTEMS 00:80:A0 EdisaHew # EDISA HEWLETT PACKARD S/A 00:80:A1 Microtes # MICROTEST, INC. -00:80:A2 TattileS # Tattile SRL +00:80:A2 Creative # CREATIVE ELECTRONIC SYSTEMS 00:80:A3 Lantroni # Lantronix 00:80:A4 LibertyE # LIBERTY ELECTRONICS 00:80:A5 SpeedInt # SPEED INTERNATIONAL @@ -17040,6 +17041,7 @@ 04:4A:50 RamaxelT # Ramaxel Technology (Shenzhen) limited company 04:4B:FF Guangzho # GuangZhou Hedy Digital Technology Co., Ltd 04:4C:EF FujianSa # Fujian Sanao Technology Co.,Ltd +04:4E:06 Ericsson # Ericsson AB 04:4F:8B Adapteva # Adapteva, Inc. 04:4F:AA RuckusWi # Ruckus Wireless 04:54:53 Apple @@ -17252,6 +17254,7 @@ 08:00:8E TandemCo # TANDEM COMPUTERS 08:00:8F Chipcom # CHIPCOM CORPORATION 08:00:90 Retix +08:03:71 KrgCorpo # KRG CORPORATE 08:08:C2 SamsungE # Samsung Electronics 08:08:EA Amsc 08:0C:0B SysmikDr # SysMik GmbH Dresden @@ -17281,6 +17284,7 @@ 08:3A:B8 ShinodaP # Shinoda Plasma Co., Ltd. 08:3E:0C ArrisGro # ARRIS Group, Inc. 08:3E:8E HonHaiPr # Hon Hai Precision Ind.Co.Ltd +08:3F:76 Intellia # Intellian Technologies, Inc. 08:40:27 Gridstor # Gridstore Inc. 08:48:2C RaycoreT # Raycore Taiwan Co., LTD. 08:4E:1C H2aLlc # H2A Systems, LLC @@ -17364,6 +17368,7 @@ 0C:37:DC HuaweiTe # Huawei Technologies Co., Ltd 0C:39:56 Observat # Observator instruments 0C:3C:65 DomeImag # Dome Imaging Inc +0C:3E:9F Apple # Apple, Inc 0C:46:9D MsSedco # MS Sedco 0C:47:3D HitronTe # Hitron Technologies. Inc 0C:4C:39 Mitrasta # Mitrastar Technology @@ -17414,6 +17419,7 @@ 0C:BF:15 Genetec 0C:C0:C0 MagnetiM # MAGNETI MARELLI SISTEMAS ELECTRONICOS MEXICO 0C:C3:A7 Meritec +0C:C4:7A SuperMic # Super Micro Computer, Inc. 0C:C4:7E Eucast # EUCAST Co., Ltd. 0C:C6:55 WuxiYste # Wuxi YSTen Technology Co.,Ltd. 0C:C6:6A Nokia # Nokia Corporation @@ -17539,6 +17545,7 @@ 10:D1:DC InstarDe # INSTAR Deutschland GmbH 10:D5:42 SamsungE # Samsung Electronics Co.,Ltd 10:DD:B1 Apple +10:DD:F4 MaxwayEl # Maxway Electronics CO.,LTD 10:E2:D5 QiHardwa # Qi Hardware Inc. 10:E3:C7 SeohwaTe # Seohwa Telecom 10:E4:AF AprLlc # APR, LLC @@ -17826,6 +17833,7 @@ 20:05:E8 OooInpro # OOO InProMedia 20:0A:5E Xiangsha # Xiangshan Giant Eagle Technology Developing co.,LTD 20:0B:C7 HuaweiTe # HUAWEI TECHNOLOGIES CO.,LTD +20:0E:95 Iec–Tc9W # IEC – TC9 WG43 20:10:7A GemtekTe # Gemtek Technology Co., Ltd. 20:12:57 MostLuck # Most Lucky Trading Ltd 20:13:E0 SamsungE # Samsung Electronics Co.,Ltd @@ -18549,6 +18557,7 @@ 40:40:22 Ziv 40:40:6B Icomera 40:4A:03 ZyxelCom # ZyXEL Communications Corporation +40:4A:18 AddrekSm # Addrek Smart Solutions 40:4D:8E Shenzhen # Shenzhen Huawei Communication Technologies Co., Ltd 40:50:E0 MiltonSe # Milton Security Group LLC 40:51:6C GrandexI # Grandex International Corporation @@ -19014,6 +19023,11 @@ 40:D8:55:19:70:00/36 BergClou # Berg Cloud Limited 40:D8:55:19:80:00/36 Devboard # devboards GmbH 40:D8:55:19:90:00/36 PressolS # PRESSOL Schmiergeraete GmbH +40:D8:55:19:A0:00/36 Rohde&Sc # Rohde&Schwarz Topex SA +40:D8:55:19:B0:00/36 Northern # Northern Star Technologies +40:D8:55:19:C0:00/36 ParrisSe # Parris Service Corporation +40:D8:55:19:D0:00/36 Emac # EMAC, Inc. +40:D8:55:19:E0:00/36 Thirdway # Thirdwayv Inc. 40:E7:30 DeyStora # DEY Storage Systems, Inc. 40:E7:93 Shenzhen # Shenzhen Siviton Technology Co.,Ltd 40:EC:F8 Siemens # Siemens AG @@ -19129,6 +19143,7 @@ 48:2C:EA Motorola # Motorola Inc Business Light Radios 48:33:DD ZennioAv # ZENNIO AVANCE Y TECNOLOGIA, S.L. 48:34:3D Iep # IEP GmbH +48:3D:32 SyscorCo # Syscor Controls & Automation 48:44:53 Hds??? # HDS ??? 48:44:87 CiscoSpv # Cisco SPVTG 48:44:F7 SamsungE # Samsung Electronics Co., LTD @@ -19182,6 +19197,7 @@ 48:F8:E1 AlcatelL # Alcatel Lucent WT 48:F9:25 Maestron # Maestronic 48:FC:B8 Woodstre # Woodstream Corporation +48:FE:EA HomaBV # HOMA B.V. 4C:00:82 Cisco 4C:02:2E CmrKorea # CMR KOREA CO., LTD 4C:02:89 LexCompu # LEX COMPUTECH CO., LTD @@ -19189,6 +19205,7 @@ 4C:07:C9 Computer # COMPUTER OFFICE Co.,Ltd. 4C:09:B4 Zte # zte corporation 4C:0B:3A TctMobil # TCT Mobile Limited +4C:0D:EE JabilCir # JABIL CIRCUIT (SHANGHAI) LTD. 4C:0F:6E HonHaiPr # Hon Hai Precision Ind. Co.,Ltd. 4C:0F:C7 EardaEle # Earda Electronics Co.,Ltd 4C:14:80 Noregon # NOREGON SYSTEMS, INC @@ -19259,6 +19276,7 @@ 4C:CB:F5 Zte # zte corporation 4C:CC:34 Motorola # Motorola Solutions Inc. 4C:D6:37 QsonoEle # Qsono Electronics Co., Ltd +4C:D7:B6 HelmerSc # Helmer Scientific 4C:D9:C4 MagnetiM # Magneti Marelli Automotive Electronics (Guangzhou) Co. Ltd 4C:DF:3D TeamEngi # TEAM ENGINEERS ADVANCE TECHNOLOGIES INDIA PVT LTD 4C:E1:BB ZhuhaiHi # Zhuhai HiFocus Technology Co., Ltd. @@ -19604,6 +19622,7 @@ 5C:FF:35 Wistron # Wistron Corporation 5C:FF:FF Shenzhen # Shenzhen Kezhonglong Optoelectronic Technology Co., Ltd 60:02:B4 WistronN # Wistron NeWeb Corp. +60:03:08 Apple 60:03:47 BillionE # Billion Electric Co. Ltd. 60:0F:77 Silverpl # SilverPlus, Inc 60:11:99 Siama # Siama Systems Inc @@ -20122,6 +20141,7 @@ 74:66:30 T:MiYtti # T:mi Ytti 74:6A:89 Rezolt # Rezolt Corporation 74:6B:82 Movek +74:6F:3D Contec # Contec GmbH 74:72:F2 ChipsipT # Chipsip Technology Co., Ltd. 74:78:18 Servicea # ServiceAssure 74:7B:7A Eth # ETH Inc. @@ -20132,6 +20152,7 @@ 74:88:8B AdbBroad # ADB Broadband Italia 74:8E:08 Bestek # Bestek Corp. 74:8E:F8 BrocadeC # Brocade Communications Systems, Inc. +74:8F:1B Masterim # MasterImage 3D 74:90:50 RenesasE # Renesas Electronics Corporation 74:91:1A RuckusWi # Ruckus Wireless 74:93:A4 ZebraTec # Zebra Technologies Corp. @@ -20475,6 +20496,7 @@ 80:D1:8B Hangzhou # Hangzhou I'converge Technology Co.,Ltd 80:D7:33 QsrAutom # QSR Automations, Inc. 80:DB:31 PowerQuo # Power Quotient International Co., Ltd. +80:EA:96 Apple 80:EE:73 Shuttle # Shuttle Inc. 80:F2:5E Kyynel 80:F5:93 IrcoSist # IRCO Sistemas de Telecomunicación S.A. @@ -20493,6 +20515,7 @@ 84:21:41 Shenzhen # Shenzhen Ginwave Technologies Ltd. 84:24:8D Motorola # Motorola Solutions Inc 84:25:3F SilexTec # Silex Technology, Inc +84:25:A4 Tariox # Tariox Limited 84:25:DB SamsungE # Samsung Electronics Co.,Ltd 84:26:2B Alcatel- # Alcatel-Lucent 84:27:CE OfPresid # Corporation of the Presiding Bishop of The Church of Jesus Christ of Latter-day Saints @@ -20756,6 +20779,7 @@ 90:27:E4 Apple 90:2B:34 Giga-Byt # GIGA-BYTE TECHNOLOGY CO.,LTD. 90:2E:87 Labjack +90:31:CD OnyxHeal # Onyx Healthcare Inc. 90:34:2B Gatekeep # Gatekeeper Systems, Inc. 90:34:FC HonHaiPr # Hon Hai Precision Ind. Co.,Ltd. 90:35:6E Vodafone # Vodafone Omnitel N.V. @@ -21155,6 +21179,7 @@ A0:73:32 Cashmast # Cashmaster International Limited A0:73:FC RancoreT # Rancore Technologies Private Limited A0:75:91 SamsungE # Samsung Electronics Co.,Ltd +A0:77:71 VialisBv # Vialis BV A0:78:BA Pantech # Pantech Co., Ltd. A0:82:1F SamsungE # Samsung Electronics Co.,Ltd A0:82:C7 PTI # P.T.I Co.,LTD @@ -21195,6 +21220,7 @@ A0:E2:01 AvtraceC # AVTrace Ltd.(China) A0:E2:5A AmicusSk # Amicus SK, s.r.o. A0:E2:95 DatSyste # DAT System Co.,Ltd +A0:E4:53 SonyMobi # Sony Mobile Communications AB A0:E5:34 StratecB # Stratec Biomedical AG A0:E5:E9 Enimai # enimai Inc A0:E9:DB NingboFr # Ningbo FreeWings Technologies Co.,Ltd @@ -21309,6 +21335,7 @@ A4:FC:CE Security # Security Expert Ltd. A8:01:80 ImagoTec # IMAGO Technologies GmbH A8:06:00 SamsungE # Samsung Electronics Co.,Ltd +A8:0C:0D Cisco A8:15:4D Tp-LinkT # TP-LINK TECHNOLOGIES CO.,LTD. A8:16:B2 LgElectr # LG Electronics A8:17:58 Elektron # Elektronik System i UmeÃ¥ AB @@ -21677,6 +21704,7 @@ B8:3D:4E Shenzhen # Shenzhen Cultraview Digital Technology Co.,Ltd Shanghai Branch B8:3E:59 Roku # Roku, Inc B8:41:5F Asp # ASP AG +B8:43:E4 Vlatacom B8:47:C6 SanjetTe # SanJet Technology Corp. B8:55:10 ZioncomE # Zioncom Electronics (Shenzhen) Ltd. B8:58:10 Numera # NUMERA, INC. @@ -21921,6 +21949,7 @@ C0:C1:C0 Cisco-Li # Cisco-Linksys, LLC C0:C3:B6 Automati # Automatic Systems C0:C5:20 RuckusWi # Ruckus Wireless +C0:C5:69 Shanghai # SHANGHAI LYNUC CNC TECHNOLOGY CO.,LTD C0:C6:87 CiscoSpv # Cisco SPVTG C0:C9:46 MitsuyaL # MITSUYA LABORATORIES INC. C0:CB:38 HonHaiPr # Hon Hai Precision Ind. Co.,Ltd. @@ -22005,6 +22034,7 @@ C4:AD:21 Mediaedg # MEDIAEDGE Corporation C4:B5:12 GeneralE # General Electric Digital Energy C4:BA:99 I+MeActi # I+ME Actia Informatik und Mikro-Elektronik GmbH +C4:C0:AE MidoriEl # MIDORI ELECTRONIC CO., LTD. C4:C1:9F National # National Oilwell Varco Instrumentation, Monitoring, and Optimization (NOV IMO) C4:C7:55 BeijingH # Beijing HuaqinWorld Technology Co.,Ltd C4:CA:D9 Hangzhou # Hangzhou H3C Technologies Co., Limited @@ -22249,6 +22279,7 @@ D0:59:C3 Ceramicr # CeraMicro Technology Corporation D0:5A:0F I-BtDigi # I-BT DIGITAL CO.,LTD D0:5F:CE HitachiD # Hitachi Data Systems +D0:63:4D MeikoMas # Meiko Maschinenbau GmbH & Co. KG D0:63:B4 Solidrun # SolidRun Ltd. D0:66:7B SamsungE # Samsung Electronics Co., LTD D0:67:E5 Dell # Dell Inc @@ -22276,6 +22307,7 @@ D0:B5:23 Bestcare # Bestcare Cloucal Corp. D0:B5:3D SeproRob # SEPRO ROBOTIQUE D0:BB:80 ShlTelem # SHL Telemedicine International Ltd. +D0:BD:01 DsIntern # DS International D0:BE:2C Cnslink # CNSLink Co., Ltd. D0:C1:B1 SamsungE # Samsung Electronics Co.,Ltd D0:C2:82 Cisco # CISCO SYSTEMS, INC. @@ -22616,6 +22648,7 @@ E0:75:0A AlpsErec # ALPS ERECTORIC CO.,LTD. E0:75:7D Motorola # Motorola Mobility LLC E0:7C:62 WhistleL # Whistle Labs, Inc. +E0:7F:53 Techboar # TECHBOARD SRL E0:7F:88 Evidence # EVIDENCE Network SIA E0:81:77 Greenbyt # GreenBytes, Inc. E0:87:B1 Nata-Inf # Nata-Info Ltd. @@ -22719,6 +22752,7 @@ E4:77:D4 MinrrayI # Minrray Industry Co.,Ltd E4:7C:F9 SamsungE # Samsung Electronics Co., LTD E4:7D:5A BeijingH # Beijing Hanbang Technology Corp. +E4:81:84 Alcatel- # Alcatel-Lucent E4:81:B3 Shenzhen # Shenzhen ACT Industrial Co.,Ltd. E4:83:99 ArrisGro # ARRIS Group, Inc. E4:8A:D5 RfWindow # RF WINDOW CO., LTD. @@ -22947,6 +22981,7 @@ F0:29:29 Cisco F0:2A:61 WaldoNet # Waldo Networks, Inc. F0:2F:D8 Bi2-Visi # Bi2-Vision +F0:32:1A Mita-Tek # Mita-Teknik A/S F0:37:A1 HuikeEle # Huike Electronics (SHENZHEN) CO., LTD. F0:3A:55 OmegaEle # Omega Elektronik AS F0:43:35 DvnShang # DVN(Shanghai)Ltd. @@ -23018,6 +23053,7 @@ F0:F0:02 HonHaiPr # Hon Hai Precision Ind. Co.,Ltd. F0:F2:60 Mobitec # Mobitec AB F0:F5:AE Adaptrum # Adaptrum Inc. +F0:F6:1C Apple F0:F6:44 Whitesky # Whitesky Science & Technology Co.,Ltd. F0:F6:69 MotionAn # Motion Analysis Corporation F0:F7:55 Cisco # CISCO SYSTEMS, INC. @@ -23092,6 +23128,7 @@ F4:CA:E5 FreeboxS # FREEBOX SA F4:CD:90 Vispiron # Vispiron Rotec GmbH F4:CE:46 Hewlett- # Hewlett-Packard Company +F4:CF:E2 Cisco F4:D9:FB SamsungE # Samsung Electronics CO., LTD F4:DC:4D BeijingC # Beijing CCD Digital Technology Co., Ltd F4:DC:DA ZhuhaiJi # Zhuhai Jiahe Communication Technology Co., limited diff -Nru wireshark-1.12.0~201310251247/packaging/Makefile.am wireshark-1.12.0~201311020920/packaging/Makefile.am --- wireshark-1.12.0~201310251247/packaging/Makefile.am 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/Makefile.am 2013-11-02 02:12:36.000000000 +0000 @@ -17,19 +17,5 @@ portableapps/win32/installer.ini \ portableapps/win32/Makefile.nmake \ portableapps/win32/makenmake.pl \ - portableapps/win32/readme.txt \ - u3/win32/README.txt \ - u3/win32/Makefile.nmake \ - u3/win32/makenmake.pl \ - u3/win32/manifest.tmpl \ - u3/win32/u3util.c \ - u3/win32/u3util.exe.manifest \ - u3/win32/wireshark.bat \ - u3/tools/README.txt \ - u3/tools/Makefile.nmake \ - u3/tools/sysdep.c \ - u3/tools/sysdep.h \ - u3/tools/utest.c \ - u3/tools/uuid.c \ - u3/tools/uuid.h + portableapps/win32/readme.txt diff -Nru wireshark-1.12.0~201310251247/packaging/macosx/Makefile.am wireshark-1.12.0~201311020920/packaging/macosx/Makefile.am --- wireshark-1.12.0~201310251247/packaging/macosx/Makefile.am 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/macosx/Makefile.am 2013-11-02 02:12:36.000000000 +0000 @@ -1,4 +1,6 @@ # +# $Id$ +# # This was disabled at one point, since the contents of the # Clearlooks-Quicksilver-OSX directory exceed the 99-character file # name limit imposed by the old tar format. We now use ustar format, diff -Nru wireshark-1.12.0~201310251247/packaging/macosx/osx-app.sh wireshark-1.12.0~201311020920/packaging/macosx/osx-app.sh --- wireshark-1.12.0~201310251247/packaging/macosx/osx-app.sh 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/macosx/osx-app.sh 2013-11-02 02:12:36.000000000 +0000 @@ -562,12 +562,12 @@ } if [ "$ui_toolkit" = "qt" ] ; then - macdeployqt "$bundle" -verbose=2 + macdeployqt "$bundle" -verbose=2 || exit 1 fi PATHLENGTH=`echo $LIBPREFIX | wc -c` if [ "$PATHLENGTH" -ge "6" ]; then - # If the LIBPREFIX path is long enough to allow + # If the LIBPREFIX path is long enough to allow # path rewriting, then do this. # 6 is the length of @rpath, which replaces LIBPREFIX. rpathify_files @@ -589,6 +589,8 @@ } if [ -n "$CODE_SIGN_IDENTITY" ] ; then + security find-identity -v -s "$CODE_SIGN_IDENTITY" -p codesigning + echo "Signing executables" for binary in $cs_binary_list ; do codesign_file "$binary" diff -Nru wireshark-1.12.0~201310251247/packaging/u3/tools/Makefile.nmake wireshark-1.12.0~201311020920/packaging/u3/tools/Makefile.nmake --- wireshark-1.12.0~201310251247/packaging/u3/tools/Makefile.nmake 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/tools/Makefile.nmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -# -# $Id$ -# - -include ../../../config.nmake -include - -TOPDIR = ..\..\.. - -CC = cl -LINK = link - -COPY = copy - -LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 /ENTRY:mainCRTStartup $(LOCAL_LDFLAGS) - -CFLAGS=$(WARNINGS_ARE_ERRORS) $(LOCAL_CFLAGS) -I$(TOPDIR) $(GLIB_CFLAGS) $(GNUTLS_CFLAGS) - -.c.obj:: - $(CC) $(CFLAGS) -Fd.\ -c $< - -all: utest.exe libgcrypt-11.dll libgpg-error-0.dll - -utest.exe: uuid.obj sysdep.obj utest.obj - @echo Linking $@ - $(LINK) /OUT:utest.exe $(guiflags) $(LDFLAGS) utest.obj uuid.obj sysdep.obj $(GNUTLS_LIBS) $(guilibsdll) -!IFDEF MANIFEST_INFO_REQUIRED - mt.exe -nologo -manifest "utest.exe.manifest" -outputresource:utest.exe;1 -!ENDIF - -libgcrypt-11.dll libgpg-error-0.dll: $(GNUTLS_DIR)\bin\$@ - $(COPY) $(GNUTLS_DIR)\bin\$@ $@ - -clean: - rm -rf utest.exe *.obj *.manifest - rm -rf libgcrypt-11.dll libgpg-error-0.dll - rm -rf state nodeid - rm -rf *.pdb - rm -rf *~ *.*~ - -distclean: clean - -maintainer-clean: distclean diff -Nru wireshark-1.12.0~201310251247/packaging/u3/tools/README.txt wireshark-1.12.0~201311020920/packaging/u3/tools/README.txt --- wireshark-1.12.0~201310251247/packaging/u3/tools/README.txt 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/tools/README.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -$Id$ - -utest.exe is a UUID generator based on the example code provided in RFC4122 and using the gcrypt libraries for the MD5/SHA1 algorithms. It has only been tested on Windows to date. - -A Wireshark namespace UUID has been defined (94630be0-e031-11db-974d-0002a5d5c51b) which allows UUIDs to be generated from a simple string. Supplying a single string parameters to utest.exe will result in a sed expression being output. The expression is designed to be used with the manifest.tmpl to generate the manifest.u3i file. For example, - -utest.exe "0.99.6" => s/$(UUID)/c84e2059-6e2f-54dd-9af7-646f91327cce/ - -The U3 packaging uses this UUID to identify separate versions, which includes the automated builds. - -Graeme Lunt 1/4/2007 \ No newline at end of file diff -Nru wireshark-1.12.0~201310251247/packaging/u3/tools/sysdep.c wireshark-1.12.0~201311020920/packaging/u3/tools/sysdep.c --- wireshark-1.12.0~201310251247/packaging/u3/tools/sysdep.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/tools/sysdep.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -/* sysdep.c - * UUID system dependent routines - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* -** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. -** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & -** Digital Equipment Corporation, Maynard, Mass. -** Copyright (c) 1998 Microsoft. -** To anyone who acknowledges that this file is provided "AS IS" -** without any express or implied warranty: permission to use, copy, -** modify, and distribute this file for any purpose is hereby -** granted without fee, provided that the above copyright notices and -** this notice appears in all source code copies, and that none of -** the names of Open Software Foundation, Inc., Hewlett-Packard -** Company, Microsoft, or Digital Equipment Corporation be used in -** advertising or publicity pertaining to distribution of the software -** without specific, written prior permission. Neither Open Software -** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital -** Equipment Corporation makes any representations about the -** suitability of this software for any purpose. -*/ - -#include -#include "sysdep.h" - -/* system dependent call to get IEEE node ID. - This sample implementation generates a random node ID. */ -void get_ieee_node_identifier(uuid_node_t *node) -{ - static inited = 0; - static uuid_node_t saved_node; - char seed[16]; - FILE *fp; - - if (!inited) { - fp = fopen("nodeid", "rb"); - if (fp) { - fread(&saved_node, sizeof saved_node, 1, fp); - fclose(fp); - } - else { - get_random_info(seed); - seed[0] |= 0x01; - memcpy(&saved_node, seed, sizeof saved_node); - fp = fopen("nodeid", "wb"); - if (fp) { - fwrite(&saved_node, sizeof saved_node, 1, fp); - fclose(fp); - } - } - inited = 1; - } - - *node = saved_node; -} - -/* system dependent call to get the current system time. Returned as - 100ns ticks since UUID epoch, but resolution may be less than - 100ns. */ -#ifdef _WINDOWS_ - -void get_system_time(uuid_time_t *uuid_time) -{ - ULARGE_INTEGER time; - - /* NT keeps time in FILETIME format which is 100ns ticks since - Jan 1, 1601. UUIDs use time in 100ns ticks since Oct 15, 1582. - The difference is 17 Days in Oct + 30 (Nov) + 31 (Dec) - + 18 years and 5 leap days. */ - GetSystemTimeAsFileTime((FILETIME *)&time); - time.QuadPart += - - (unsigned __int64) (1000*1000*10) /* seconds */ - * (unsigned __int64) (60 * 60 * 24) /* days */ - * (unsigned __int64) (17+30+31+365*18+5); /* # of days */ - *uuid_time = time.QuadPart; -} - -/* Sample code, not for use in production; see RFC 1750 */ -void get_random_info(char seed[16]) -{ - MD5_CTX c; - struct { - MEMORYSTATUS m; - SYSTEM_INFO s; - FILETIME t; - LARGE_INTEGER pc; - DWORD tc; - DWORD l; - char hostname[MAX_COMPUTERNAME_LENGTH + 1]; - } r; - - MD5Init(&c); - GlobalMemoryStatus(&r.m); - GetSystemInfo(&r.s); - GetSystemTimeAsFileTime(&r.t); - QueryPerformanceCounter(&r.pc); - r.tc = GetTickCount(); - r.l = MAX_COMPUTERNAME_LENGTH + 1; - GetComputerNameA(r.hostname, &r.l); - MD5Update(&c, &r, sizeof r); - MD5Final(seed, &c); -} - -#else - -void get_system_time(uuid_time_t *uuid_time) -{ - struct timeval tp; - - gettimeofday(&tp, (struct timezone *)0); - - /* Offset between UUID formatted times and Unix formatted times. - UUID UTC base time is October 15, 1582. - Unix base time is January 1, 1970.*/ - *uuid_time = ((unsigned64)tp.tv_sec * 10000000) - + ((unsigned64)tp.tv_usec * 10) - + I64(0x01B21DD213814000); -} - -/* Sample code, not for use in production; see RFC 1750 */ -void get_random_info(char seed[16]) -{ - MD5_CTX c; - struct { - struct sysinfo s; - struct timeval t; - char hostname[257]; - } r; - - MD5Init(&c); - sysinfo(&r.s); - gettimeofday(&r.t, (struct timezone *)0); - gethostname(r.hostname, 256); - MD5Update(&c, &r, sizeof r); - MD5Final(seed, &c); -} - -#endif diff -Nru wireshark-1.12.0~201310251247/packaging/u3/tools/sysdep.h wireshark-1.12.0~201311020920/packaging/u3/tools/sysdep.h --- wireshark-1.12.0~201310251247/packaging/u3/tools/sysdep.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/tools/sysdep.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/* sysdep.h - * UUID system dependent routines - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* -** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. -** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & -** Digital Equipment Corporation, Maynard, Mass. -** Copyright (c) 1998 Microsoft. -** To anyone who acknowledges that this file is provided "AS IS" -** without any express or implied warranty: permission to use, copy, -** modify, and distribute this file for any purpose is hereby -** granted without fee, provided that the above copyright notices and -** this notice appears in all source code copies, and that none of -** the names of Open Software Foundation, Inc., Hewlett-Packard -** Company, Microsoft, or Digital Equipment Corporation be used in -** advertising or publicity pertaining to distribution of the software -** without specific, written prior permission. Neither Open Software -** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital -** Equipment Corporation makes any representations about the -** suitability of this software for any purpose. -*/ - -#include "config.h" - -#ifndef _WIN32 -#include -#include -#include -#endif - -#ifdef HAVE_LIBGCRYPT -#include - -/* md5 /sha abstraction layer */ -#define SHA_CTX gcry_md_hd_t -#define SHA1_Init(md) gcry_md_open(md, GCRY_MD_SHA1, 0) -#define SHA1_Update(md, data, len) gcry_md_write(*(md), data, len) -#define SHA1_Final(buf, md) memcpy(buf, gcry_md_read(*(md), GCRY_MD_SHA1), gcry_md_get_algo_dlen(GCRY_MD_SHA1)) - -#define MD5_CTX gcry_md_hd_t -#define MD5Init(md) gcry_md_open(md, GCRY_MD_MD5, 0) -#define MD5Update(md, data, len) gcry_md_write(*(md), data, len) -#define MD5Final(buf, md) memcpy(buf, gcry_md_read(*(md), GCRY_MD_MD5), gcry_md_get_algo_dlen(GCRY_MD_MD5)) -#endif - -/* set the following to the number of 100ns ticks of the actual - resolution of your system's clock */ -#define UUIDS_PER_TICK 1024 - -/* Set the following to a calls to get and release a global lock */ -#define LOCK -#define UNLOCK - -typedef unsigned long unsigned32; -typedef unsigned short unsigned16; -typedef unsigned char unsigned8; -typedef unsigned char byte; - -/* Set this to what your compiler uses for 64-bit data type */ -#ifdef _WIN32 -#define unsigned64_t unsigned __int64 -#define I64(C) C -#else -#define unsigned64_t unsigned long long -#define I64(C) C##LL -#endif - -typedef unsigned64_t uuid_time_t; -typedef struct { - char nodeID[6]; -} uuid_node_t; - -void get_ieee_node_identifier(uuid_node_t *node); -void get_system_time(uuid_time_t *uuid_time); -void get_random_info(char seed[16]); - diff -Nru wireshark-1.12.0~201310251247/packaging/u3/tools/utest.c wireshark-1.12.0~201311020920/packaging/u3/tools/utest.c --- wireshark-1.12.0~201310251247/packaging/u3/tools/utest.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/tools/utest.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* utest.c - * UUID generation test harness and Wireshark Namespace UUID generation - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* -** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. -** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & -** Digital Equipment Corporation, Maynard, Mass. -** Copyright (c) 1998 Microsoft. -** To anyone who acknowledges that this file is provided "AS IS" -** without any express or implied warranty: permission to use, copy, -** modify, and distribute this file for any purpose is hereby -** granted without fee, provided that the above copyright notices and -** this notice appears in all source code copies, and that none of -** the names of Open Software Foundation, Inc., Hewlett-Packard -** Company, Microsoft, or Digital Equipment Corporation be used in -** advertising or publicity pertaining to distribution of the software -** without specific, written prior permission. Neither Open Software -** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital -** Equipment Corporation makes any representations about the -** suitability of this software for any purpose. -*/ - -#include "sysdep.h" -#include -#include "uuid.h" - -uuid_t NameSpace_DNS = { /* 6ba7b810-9dad-11d1-80b4-00c04fd430c8 */ - 0x6ba7b810, - 0x9dad, - 0x11d1, - 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8 -}; - -/* The Wireshark namespace */ -uuid_t NameSpace_WS = { /* 94630be0-e031-11db-974d-0002a5d5c51b */ - 0x94630be0, - 0xe031, - 0x11db, - 0x97, 0x4d, 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b -}; - - -/* puid -- print a UUID */ -void puid(uuid_t u) -{ - int i; - - printf("%8.8x-%4.4x-%4.4x-%2.2x%2.2x-", u.time_low, u.time_mid, - u.time_hi_and_version, u.clock_seq_hi_and_reserved, - u.clock_seq_low); - for (i = 0; i < 6; i++) - printf("%2.2x", u.node[i]); -} - -/* Simple driver for UUID generator */ -void main(int argc, char **argv) -{ - uuid_t u; - int f; - - if(argc > 1) { - - uuid_create_sha1_from_name(&u, NameSpace_WS, argv[1], (int)strlen(argv[1])); - printf("s/$(UUID)/"); puid(u); printf("/\n"); - - exit(0); - - } else { - - uuid_create(&u); - printf("uuid_create(): "); puid(u); printf("\n"); - - f = uuid_compare(&u, &u); - printf("uuid_compare(u,u): %d\n", f); /* should be 0 */ - f = uuid_compare(&u, &NameSpace_DNS); - printf("uuid_compare(u, NameSpace_DNS): %d\n", f); /* s.b. 1 */ - f = uuid_compare(&NameSpace_DNS, &u); - printf("uuid_compare(NameSpace_DNS, u): %d\n", f); /* s.b. -1 */ - uuid_create_md5_from_name(&u, NameSpace_DNS, "www.widgets.com", 15); - printf("uuid_create_md5_from_name(): "); puid(u); printf("\n"); - - } -} diff -Nru wireshark-1.12.0~201310251247/packaging/u3/tools/uuid.c wireshark-1.12.0~201311020920/packaging/u3/tools/uuid.c --- wireshark-1.12.0~201310251247/packaging/u3/tools/uuid.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/tools/uuid.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,311 +0,0 @@ -/* uuid.c - * UUID generation - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* -** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. -** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & -** Digital Equipment Corporation, Maynard, Mass. -** Copyright (c) 1998 Microsoft. -** To anyone who acknowledges that this file is provided "AS IS" -** without any express or implied warranty: permission to use, copy, -** modify, and distribute this file for any purpose is hereby -** granted without fee, provided that the above copyright notices and -** this notice appears in all source code copies, and that none of -** the names of Open Software Foundation, Inc., Hewlett-Packard -** Company, Microsoft, or Digital Equipment Corporation be used in -** advertising or publicity pertaining to distribution of the software -** without specific, written prior permission. Neither Open Software -** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital -** Equipment Corporation makes any representations about the -** suitability of this software for any purpose. -*/ - -#include -#include -#include -#include -#include "sysdep.h" -#include "uuid.h" - -/* various forward declarations */ -static int read_state(unsigned16 *clockseq, uuid_time_t *timestamp, - uuid_node_t *node); -static void write_state(unsigned16 clockseq, uuid_time_t timestamp, - uuid_node_t node); -static void format_uuid_v1(uuid_t *uuid, unsigned16 clockseq, - uuid_time_t timestamp, uuid_node_t node); -static void format_uuid_v3or5(uuid_t *uuid, unsigned char hash[16], - int v); -static void get_current_time(uuid_time_t *timestamp); -static unsigned16 true_random(void); - -/* uuid_create -- generator a UUID */ -int uuid_create(uuid_t *uuid) -{ - uuid_time_t timestamp, last_time; - unsigned16 clockseq; - uuid_node_t node; - uuid_node_t last_node; - int f; - - /* acquire system-wide lock so we're alone */ - LOCK; - /* get time, node ID, saved state from non-volatile storage */ - get_current_time(×tamp); - get_ieee_node_identifier(&node); - f = read_state(&clockseq, &last_time, &last_node); - - /* if no NV state, or if clock went backwards, or node ID - changed (e.g., new network card) change clockseq */ - if (!f || memcmp(&node, &last_node, sizeof node)) - clockseq = true_random(); - else if (timestamp < last_time) - clockseq++; - - /* save the state for next time */ - write_state(clockseq, timestamp, node); - - UNLOCK; - - /* stuff fields into the UUID */ - format_uuid_v1(uuid, clockseq, timestamp, node); - return 1; -} - -/* format_uuid_v1 -- make a UUID from the timestamp, clockseq, - and node ID */ -void format_uuid_v1(uuid_t* uuid, unsigned16 clock_seq, - uuid_time_t timestamp, uuid_node_t node) -{ - /* Construct a version 1 uuid with the information we've gathered - plus a few constants. */ - uuid->time_low = (unsigned long)(timestamp & 0xFFFFFFFF); - uuid->time_mid = (unsigned short)((timestamp >> 32) & 0xFFFF); - uuid->time_hi_and_version = - (unsigned short)((timestamp >> 48) & 0x0FFF); - uuid->time_hi_and_version |= (1 << 12); - uuid->clock_seq_low = clock_seq & 0xFF; - uuid->clock_seq_hi_and_reserved = (clock_seq & 0x3F00) >> 8; - uuid->clock_seq_hi_and_reserved |= 0x80; - memcpy(&uuid->node, &node, sizeof uuid->node); -} - -/* data type for UUID generator persistent state */ -typedef struct { - uuid_time_t ts; /* saved timestamp */ - uuid_node_t node; /* saved node ID */ - unsigned16 cs; /* saved clock sequence */ -} uuid_state; - -static uuid_state st; - -/* read_state -- read UUID generator state from non-volatile store */ -int read_state(unsigned16 *clockseq, uuid_time_t *timestamp, - uuid_node_t *node) -{ - static int inited = 0; - FILE *fp; - - /* only need to read state once per boot */ - if (!inited) { - fp = fopen("state", "rb"); - if (fp == NULL) - return 0; - fread(&st, sizeof st, 1, fp); - fclose(fp); - inited = 1; - } - *clockseq = st.cs; - *timestamp = st.ts; - *node = st.node; - return 1; -} - -/* write_state -- save UUID generator state back to non-volatile - storage */ -void write_state(unsigned16 clockseq, uuid_time_t timestamp, - uuid_node_t node) -{ - static int inited = 0; - static uuid_time_t next_save; - FILE* fp; - - if (!inited) { - next_save = timestamp; - inited = 1; - } - - /* always save state to volatile shared state */ - st.cs = clockseq; - st.ts = timestamp; - st.node = node; - if (timestamp >= next_save) { - fp = fopen("state", "wb"); - fwrite(&st, sizeof st, 1, fp); - fclose(fp); - /* schedule next save for 10 seconds from now */ - next_save = timestamp + (10 * 10 * 1000 * 1000); - } -} - -/* get-current_time -- get time as 60-bit 100ns ticks since UUID epoch. - Compensate for the fact that real clock resolution is - less than 100ns. */ -void get_current_time(uuid_time_t *timestamp) -{ - static int inited = 0; - static uuid_time_t time_last; - static unsigned16 uuids_this_tick; - uuid_time_t time_now; - - if (!inited) { - get_system_time(&time_now); - uuids_this_tick = UUIDS_PER_TICK; - inited = 1; - } - - for ( ; ; ) { - get_system_time(&time_now); - - /* if clock reading changed since last UUID generated, */ - if (time_last != time_now) { - /* reset count of uuids gen'd with this clock reading */ - uuids_this_tick = 0; - time_last = time_now; - break; - } - if (uuids_this_tick < UUIDS_PER_TICK) { - uuids_this_tick++; - break; - } - /* going too fast for our clock; spin */ - } - /* add the count of uuids to low order bits of the clock reading */ - *timestamp = time_now + uuids_this_tick; -} - -/* true_random -- generate a crypto-quality random number. - **This sample doesn't do that.** */ -static unsigned16 true_random(void) -{ - static int inited = 0; - uuid_time_t time_now; - - if (!inited) { - get_system_time(&time_now); - time_now = time_now / UUIDS_PER_TICK; - srand((unsigned int) - (((time_now >> 32) ^ time_now) & 0xffffffff)); - inited = 1; - } - - return rand(); -} - -/* uuid_create_md5_from_name -- create a version 3 (MD5) UUID using a - "name" from a "name space" */ -void uuid_create_md5_from_name(uuid_t *uuid, uuid_t nsid, void *name, - int namelen) -{ - MD5_CTX c; - unsigned char hash[16]; - uuid_t net_nsid; - - /* put name space ID in network byte order so it hashes the same - no matter what endian machine we're on */ - net_nsid = nsid; - net_nsid.time_low = htonl(net_nsid.time_low); - net_nsid.time_mid = htons(net_nsid.time_mid); - net_nsid.time_hi_and_version = htons(net_nsid.time_hi_and_version); - - MD5Init(&c); - MD5Update(&c, &net_nsid, sizeof net_nsid); - MD5Update(&c, name, namelen); - MD5Final(hash, &c); - - /* the hash is in network byte order at this point */ - format_uuid_v3or5(uuid, hash, 3); -} - -void uuid_create_sha1_from_name(uuid_t *uuid, uuid_t nsid, void *name, - int namelen) -{ - SHA_CTX c; - unsigned char hash[20]; - uuid_t net_nsid; - - /* put name space ID in network byte order so it hashes the same - no matter what endian machine we're on */ - net_nsid = nsid; - net_nsid.time_low = htonl(net_nsid.time_low); - net_nsid.time_mid = htons(net_nsid.time_mid); - net_nsid.time_hi_and_version = htons(net_nsid.time_hi_and_version); - - SHA1_Init(&c); - SHA1_Update(&c, &net_nsid, sizeof net_nsid); - SHA1_Update(&c, name, namelen); - SHA1_Final(hash, &c); - - /* the hash is in network byte order at this point */ - format_uuid_v3or5(uuid, hash, 5); -} - -/* format_uuid_v3or5 -- make a UUID from a (pseudo)random 128-bit - number */ -void format_uuid_v3or5(uuid_t *uuid, unsigned char hash[16], int v) -{ - /* convert UUID to local byte order */ - memcpy(uuid, hash, sizeof *uuid); - uuid->time_low = ntohl(uuid->time_low); - uuid->time_mid = ntohs(uuid->time_mid); - uuid->time_hi_and_version = ntohs(uuid->time_hi_and_version); - - /* put in the variant and version bits */ - uuid->time_hi_and_version &= 0x0FFF; - uuid->time_hi_and_version |= (v << 12); - uuid->clock_seq_hi_and_reserved &= 0x3F; - uuid->clock_seq_hi_and_reserved |= 0x80; -} - -/* uuid_compare -- Compare two UUID's "lexically" and return */ -#define CHECK(f1, f2) if (f1 != f2) return f1 < f2 ? -1 : 1; -int uuid_compare(uuid_t *u1, uuid_t *u2) -{ - int i; - - CHECK(u1->time_low, u2->time_low); - CHECK(u1->time_mid, u2->time_mid); - CHECK(u1->time_hi_and_version, u2->time_hi_and_version); - CHECK(u1->clock_seq_hi_and_reserved, u2->clock_seq_hi_and_reserved); - CHECK(u1->clock_seq_low, u2->clock_seq_low) - for (i = 0; i < 6; i++) { - if (u1->node[i] < u2->node[i]) - return -1; - if (u1->node[i] > u2->node[i]) - return 1; - } - return 0; -} -#undef CHECK - diff -Nru wireshark-1.12.0~201310251247/packaging/u3/tools/uuid.h wireshark-1.12.0~201311020920/packaging/u3/tools/uuid.h --- wireshark-1.12.0~201310251247/packaging/u3/tools/uuid.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/tools/uuid.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -/* uuid.h - * UUID generation - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* -** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. -** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & -** Digital Equipment Corporation, Maynard, Mass. -** Copyright (c) 1998 Microsoft. -** To anyone who acknowledges that this file is provided "AS IS" -** without any express or implied warranty: permission to use, copy, -** modify, and distribute this file for any purpose is hereby -** granted without fee, provided that the above copyright notices and -** this notice appears in all source code copies, and that none of -** the names of Open Software Foundation, Inc., Hewlett-Packard -** Company, Microsoft, or Digital Equipment Corporation be used in -** advertising or publicity pertaining to distribution of the software -** without specific, written prior permission. Neither Open Software -** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital -** Equipment Corporation makes any representations about the -** suitability of this software for any purpose. -*/ - -#undef uuid_t -typedef struct { - unsigned32 time_low; - unsigned16 time_mid; - unsigned16 time_hi_and_version; - unsigned8 clock_seq_hi_and_reserved; - unsigned8 clock_seq_low; - byte node[6]; -} uuid_t; - -/* uuid_create -- generate a UUID */ -int uuid_create(uuid_t * uuid); - -/* uuid_create_md5_from_name -- create a version 3 (MD5) UUID using a - "name" from a "name space" */ -void uuid_create_md5_from_name( - uuid_t *uuid, /* resulting UUID */ - uuid_t nsid, /* UUID of the namespace */ - void *name, /* the name from which to generate a UUID */ - int namelen /* the length of the name */ -); - -/* uuid_create_sha1_from_name -- create a version 5 (SHA-1) UUID - using a "name" from a "name space" */ -void uuid_create_sha1_from_name( - - uuid_t *uuid, /* resulting UUID */ - uuid_t nsid, /* UUID of the namespace */ - void *name, /* the name from which to generate a UUID */ - int namelen /* the length of the name */ -); - -/* uuid_compare -- Compare two UUID's "lexically" and return - -1 u1 is lexically before u2 - 0 u1 is equal to u2 - 1 u1 is lexically after u2 - Note that lexical ordering is not temporal ordering! -*/ -int uuid_compare(uuid_t *u1, uuid_t *u2); - - diff -Nru wireshark-1.12.0~201310251247/packaging/u3/win32/Makefile.nmake wireshark-1.12.0~201311020920/packaging/u3/win32/Makefile.nmake --- wireshark-1.12.0~201310251247/packaging/u3/win32/Makefile.nmake 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/win32/Makefile.nmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -# -# $Id$ -# - -include ../../../config.nmake -include - -CC = cl -LINK = link - -LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 /ENTRY:mainCRTStartup $(LOCAL_LDFLAGS) - -DEVICE = device -HOST = host -MANIFEST= manifest -DATA = data - -WSMANIFEST = ../../wireshark.manifest - -TOPDIR = ..\..\.. -TOOLSDIR= ..\tools -COPY = xcopy -MKDIR = mkdir -COPY_FLAGS = /d /y - -!undef UPX -UPX_FLAGS = -q - -U3_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_MICRO) - -all: package - - -uuid.sed: $(TOPDIR)\config.nmake - cd $(TOOLSDIR) - $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake - cd ..\win32 - $(TOOLSDIR)\utest.exe "$(VERSION)" > $@ - -manifest.u3i: manifest.tmpl uuid.sed - sed -e 's/$$(U3_VERSION)/$(U3_VERSION)/g' \ - -e 's/$$(VERSION)/$(VERSION)/g' \ -#ifdef UPX - -e 's/$$(SIZE)/50/g' \ -#else - -e 's/$$(SIZE)/65/g' \ -#endif - -f uuid.sed < manifest.tmpl > manifest.u3i - -u3-dirs: - if not exist $(HOST) $(MKDIR) $(HOST) - if not exist $(DEVICE) $(MKDIR) $(DEVICE) - if not exist $(DATA) $(MKDIR) $(DATA) - if not exist $(DATA)\"My Captures" $(MKDIR) $(DATA)\"My Captures" - if not exist $(MANIFEST) $(MKDIR) $(MANIFEST) - -nsis-bits: - cd ../../nsis - $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake user-guide.chm - cd ../u3/win32 - -$(WSMANIFEST): - cd ../.. - $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake wireshark.manifest - cd u3/win32 - -distribution.nmake: makenmake.pl $(WSMANIFEST) ../../ws-manifest.pl - $(PERL) makenmake.pl $(WSMANIFEST) > $@ - -distribution: u3-dirs manifest.u3i u3util.exe nsis-bits wireshark.bat distribution.nmake -# manifest - $(COPY) manifest.u3i $(MANIFEST) $(COPY_FLAGS) - $(COPY) $(TOPDIR)\image\wireshark.ico $(MANIFEST) $(COPY_FLAGS) - $(COPY) u3util.exe $(HOST) $(COPY_FLAGS) - $(MAKE) /$(MAKEFLAGS) -f distribution.nmake - -verify-tools: -!IFDEF UPX - @if not exist $(UPX) echo Error: $(UPX) not found. &&\ -echo Either: &&\ -echo a) run 'nmake -f Makefile.nmake setup' at the toplevel; or &&\ -echo b) comment out UPX in config.nmake at the top level, to build without compressing the dlls and exes \ -&& exit 2 -!endif - -pack: distribution -!IFDEF UPX - -$(UPX) $(UPX_FLAGS) $(DEVICE)\plugins\$(VERSION)\*.dll - -$(UPX) $(UPX_FLAGS) $(HOST)\*.dll - -$(UPX) $(UPX_FLAGS) $(HOST)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders\*.dll - -$(UPX) $(UPX_FLAGS) $(HOST)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines\*.dll - -$(UPX) $(UPX_FLAGS) $(HOST)\$(GTK_WIMP_DLLDST_DIR)\*.dll - -$(UPX) $(UPX_FLAGS) $(HOST)\*.exe -!ENDIF - -test: pack - wireshark.bat -D - -package: verify-tools test - zip -r Wireshark-$(VERSION).u3p $(MANIFEST) $(DEVICE) $(DATA) $(HOST) wireshark.bat - -CFLAGS = -DWINPCAP_PACKAGE="\"\\\\WinPcap_$(PCAP_VERSION).exe\"" - -u3util_LIBS= user32.lib shell32.lib - -u3util.exe: u3util.obj ../../../config.nmake - @echo Linking $@ - $(LINK) @<< - /OUT:u3util.exe $(guiflags) $(LDFLAGS) u3util.obj $(u3util_LIBS) $(guilibsdll) -<< -!IFDEF MANIFEST_INFO_REQUIRED - mt.exe -nologo -manifest "u3util.exe.manifest" -outputresource:u3util.exe;1 -!ENDIF - -clean: - cd ../tools - $(MAKE) -f Makefile.nmake $@ - cd ../win32 - cd ../../ - $(MAKE) -f Makefile.nmake $@ - cd u3/win32 - rm -rf manifest.u3i - rm -rf uuid.sed - rm -rf nodeid state - rm -rf $(HOST) - rm -rf $(DEVICE) - rm -rf $(DATA) - rm -rf $(MANIFEST) - rm -rf u3util.{exe,obj,pdb} - rm -rf wireshark-$(VERSION).u3p - rm -rf distribution.nmake - rm -rf *~ *.*~ - -distclean: clean - rm -rf wireshark*.u3p - -maintainer-clean: distclean diff -Nru wireshark-1.12.0~201310251247/packaging/u3/win32/README.txt wireshark-1.12.0~201311020920/packaging/u3/win32/README.txt --- wireshark-1.12.0~201310251247/packaging/u3/win32/README.txt 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/win32/README.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -$Id$ - -U3 -== - -U3 was a portable (installer-less) application technology developed by -SanDisk and M-Systems. According to - -http://kb.sandisk.com/app/answers/detail/a_id/5358/kw/u3 - -U3 technology reached end of life in 2009. The developer information -which was hosted at www.u3.com is no longer available. Starting with -Wireshark 1.11 U3 packages are no longer officially supported and this -directory will eventually be removed. - -See also: -http://en.wikipedia.org/wiki/U3 and http://www.u3.com - -U3 Packaging -============ - -This directory contains the scripts to build a U3 Package (wireshark.u3p) that can be loaded onto a U3 device. This will allow Wireshark to be run from any Windows machine the U3 device is plugged into, without having to install Wireshark directly. For more details about U3 devices, see http://www.u3.com/. - -The U3 package is basically a zip file with a manifest file (wireshark.u3i), a small utility to manage the shutdown of Wireshark when the device is removed, and the Wireshark application files. The package contains all the standard Wireshark components (e.g. tshark.exe), even though they cannot be directly accessed. However, with a suitable additional script (setting the U3 environment variables), the would meet the "wireshark-as-a-zip" wish. - -You will need the cygwin zip archive package to build the package itself. Once you have the package you can load the package using "Add Programs"/"Install from My Computer" from the U3 LaunchPad. - -A few minor changes have been made to Wireshark itself: -1) Wireshark will write a .pid file while running. This allows the utility to close down Wireshark when the device is removed. -2) filesystem.c has been changed to take advantage of the U3 "datafile_dir" and "persconffile_dir". Personal settings are then stored on the device. -3) The files in the 'recent' file are written in a form that allows the U3 device path to change. - -There is a [self-]certification process for U3 packages which could be undertaken if there is sufficient interest for this package format. Wireshark could then be placed on Software Central - http://software.u3.com/SoftwareCentral.aspx?skip=1. - -UPX -=== - -If the Ultimate Packer for eXecutables (UPX) (http://upx.sourceforge.net) is downloaded and configured in config.nmake, the packaging process will pack all of the dll and exes before putting them into the U3 pacakage. This can significantly reduce the size of the U3 package - by about 40%. - -Known Issues: -============= - -1) The U3 package tries to install WinPcap if it is not already installed when it is first run. It will be automatically removed when the device is removed. But this is not the best approach. -2) The distribution of the files across the U3 host and U3 device needs to be verified for all protocols. -3) The list of files should be derived from a common source (e.g. nsis/wireshark.nsi) -4) Wireshark does not close down cleanly when a dialog is up. -5) If Wireshark is uninstalled from the U3 stick, all personal settings are gone. This is unlike the "normal" WS package, but seems to be common for U3 programs. diff -Nru wireshark-1.12.0~201310251247/packaging/u3/win32/makenmake.pl wireshark-1.12.0~201311020920/packaging/u3/win32/makenmake.pl --- wireshark-1.12.0~201310251247/packaging/u3/win32/makenmake.pl 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/win32/makenmake.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -# -# makenmake.pl - create a nmake file from a generic manifest file that will create the appropriate U3 structure -# $Id$ -# - -print q{ -# -# DO NOT EDIT - autogenerated from makenmake.pl -# - -include ../../../config.nmake -include - -DEVICE = device -HOST = host -MANIFEST= manifest -DATA = data - -TOPDIR = ..\..\.. -STAGING_DIR = $(TOPDIR)\$(INSTALL_DIR) - -COPY = xcopy -MOVE = mv -MKDIR = mkdir -COPY_FLAGS = /d /y - -distribution: -}; - -while($line = <>) { - - if($line =~ /^\#/) { # comment - next; - } elsif($line =~ /^\[(\S+)/) { # new directory - $dir = $1; - undef $u3loc; - - # Close any previous !IFDEFs - if(defined $define) { - print "!ENDIF\n"; - } - undef $define; - - if($line =~ /u3loc=(\w+)/) { - $u3loc = "\$(" . uc $1 . ")"; - } - - $dir =~ s/\$INSTDIR?//; # remove $INSTDIR - - $dir =~ s/\{/\(/g; $dir =~ s/\}/\)/g; # convert curlies to round brackets - - if($dir ne '') { - print "\tif not exist $u3loc$dir \$(MKDIR) $u3loc$dir\n"; - } - - } else { # this is a file - - $line =~ /^\s+(\S+)/; - $file = $1; - - $file =~ s/\{/\(/g; $file =~ s/\}/\)/g; # convert curlies to round brackets - - if($file =~ /^[^\$]/) { - $file = "\$(TOPDIR)\\" . $file; - } - - if($line =~ /ifdef=(\w+)/) { # dependency - if($define ne $1) { - if(defined $define) { - print "!ENDIF\n"; - } - $define = $1; - print "!IF DEFINED($define)\n"; - } - } else { - if(defined $define) { - print "!ENDIF\n"; - } - undef $define; - } - - $u3fileloc = $u3loc; # default location - $oname = ""; - - if($line =~ /u3loc=(\S+)/) { # override this location - $u3fileloc = "\$(" . uc $1 . ")"; - } - - print "\t\$(COPY) \"$file\" \"$u3fileloc$dir\" \$(COPY_FLAGS)\n"; - - if($line =~ /oname=(\S+)/) { # override this filename - $oname = $1; - $file =~ /\\(.*)$/; - $name = $1; - - print "\t\$(MOVE) \"$u3fileloc$dir\\$name\" \"$u3fileloc$dir\\$oname\"\n"; - - } - - } -} diff -Nru wireshark-1.12.0~201310251247/packaging/u3/win32/manifest.tmpl wireshark-1.12.0~201311020920/packaging/u3/win32/manifest.tmpl --- wireshark-1.12.0~201310251247/packaging/u3/win32/manifest.tmpl 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/win32/manifest.tmpl 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ - - - - wireshark.ico - Wireshark - The Wireshark Community - Wireshark $(VERSION) is one of the world's foremost network protocol analyzers, and is the standard in many parts of the industry. - Network protocol analyzer - - $(SIZE) - - - - - hostConfigure - - appStop - hostCleanUp - - diff -Nru wireshark-1.12.0~201310251247/packaging/u3/win32/u3util.c wireshark-1.12.0~201311020920/packaging/u3/win32/u3util.c --- wireshark-1.12.0~201310251247/packaging/u3/win32/u3util.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/win32/u3util.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,905 +0,0 @@ -/* u3util.c - * Utility routines for U3 device support - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* Adapted from Microsoft Knowledge Base Article 178893 - * - * http://support.microsoft.com/?kbid=178893 - * - * and the U3 Answer 106 - * - * https://u3.custhelp.com/cgi-bin/u3/php/enduser/std_adp.php?p_faqid=106 - * - * Indentation logic: 2-space - */ - -#include -#include -#include - - -#define WIRESHARK_ASSOC "u3-wireshark-file" -#define WIRESHARK_DESC "U3 Wireshark File" - -#define SHELL "\\Shell" -#define SHELL_OPEN "\\Shell\\open" -#define SHELL_OPEN_COMMAND "\\Shell\\open\\command" -#define DEFAULT_ICON "\\DefaultIcon" - -#define WINPCAP_KEY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\WinPcapInst" -#define WINPCAP_UNINSTALL "UninstallString" -#define WINPCAP_U3INSTALLED "U3Installed" /* indicate the U3 device that installed WinPcap */ - -#define VCREDIST_PACKAGE "\\vcredist_x86.exe" -#define VCREDIST_KEY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{9A25302D-30C0-39D9-BD6F-21E6EC160475}" -#define VCREDIST_UNINSTALL "UninstallString" -#define VCREDIST_U3INSTALLED "U3Installed" /* indicate the U3 device that installed the redistributable */ - - -#define WINDOWS_VERSION_KEY "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" -#define WINDOWS_VERSION "CurrentVersion" -#define VISTA_VERSION "6.0" - -#define NPF_KEY "SYSTEM\\CurrentControlSet\\Service\\NPF" -#define NPF_START "Start" -#define NPF_START_VAL 2 /* SERVICE_AUTO_START */ - -#define MY_CAPTURES "\\My Captures" - -#define BUFSIZ 256 -#define FILEBUFSIZ 4096 - -#define ENV_FILENAME "\\u3_environment.txt" -#define U3UTIL_APPSTART "\\u3util.exe appStart %1" -#define WIRESHARK_EXE "\\wireshark.exe" - -static char *extensions[] = { - ".5vw", - ".acp", - ".apc", - ".atc", - ".bfr", - ".cap", - ".enc", - ".erf", - ".fdc", - ".pcap", - ".pkt", - ".tpc", - ".tr1", - ".trace", - ".trc", - ".wpc", - ".wpz", - /* and BER encoded files */ - ".cer", - ".crt", - ".crl", - ".p12", - ".pfx", - ".asn", - ".spf", - ".p7c", - ".p7s", - ".p7m", - NULL -}; - -static char *environmentvars[] = { - "U3_DEVICE_SERIAL", - "U3_DEVICE_PATH", - "U3_DEVICE_DOCUMENT_PATH", - "U3_DEVICE_VENDOR", - "U3_DEVICE_PRODUCT", - "U3_DEVICE_VENDOR_ID", - "U3_APP_DATA_PATH", - "U3_HOST_EXEC_PATH", - "U3_DEVICE_EXEC_PATH", - "U3_ENV_VERSION", - "U3_ENV_LANGUAGE", - NULL, -}; - -#define TA_FAILED 0 -#define TA_SUCCESS_CLEAN 1 -#define TA_SUCCESS_KILL 2 -#define TA_SUCCESS_16 3 - -DWORD TerminateApp( DWORD dwPID, DWORD dwTimeout ) ; -DWORD Terminate16App( DWORD dwPID, DWORD dwThread, WORD w16Task, DWORD dwTimeout ); - -#include - -typedef struct -{ - DWORD dwID ; - DWORD dwThread ; -} TERMINFO ; - -/* Declare Callback Enum Functions. */ -BOOL CALLBACK TerminateAppEnum( HWND hwnd, LPARAM lParam ) ; -BOOL CALLBACK Terminate16AppEnum( HWND hwnd, LPARAM lParam ) ; - -/*---------------------------------------------------------------- - DWORD TerminateApp( DWORD dwPID, DWORD dwTimeout ) - - Purpose: - Shut down a 32-Bit Process (or 16-bit process under Windows 95) - - Parameters: - dwPID - Process ID of the process to shut down. - - dwTimeout - Wait time in milliseconds before shutting down the process. - - Return Value: - TA_FAILED - If the shutdown failed. - TA_SUCCESS_CLEAN - If the process was shutdown using WM_CLOSE. - TA_SUCCESS_KILL - if the process was shut down with - TerminateProcess(). - NOTE: See header for these defines. - ----------------------------------------------------------------*/ - -DWORD TerminateApp( DWORD dwPID, DWORD dwTimeout ) -{ - HANDLE hProc ; - DWORD dwRet ; - - /* If we can't open the process with PROCESS_TERMINATE rights, - * then we give up immediately. */ - hProc = OpenProcess(SYNCHRONIZE|PROCESS_TERMINATE, FALSE, dwPID); - - if(hProc == NULL){ - return TA_FAILED; - } - - if(dwTimeout) { - /* we are prepared to wait */ - - /* TerminateAppEnum() posts WM_CLOSE to all windows whose PID */ - /* matches your process's. */ - EnumWindows((WNDENUMPROC)TerminateAppEnum, (LPARAM) dwPID) ; - - /* Wait on the handle. If it signals, great. If it times out, */ - /* then you kill it. */ - if(WaitForSingleObject(hProc, dwTimeout)!=WAIT_OBJECT_0) - dwRet=(TerminateProcess(hProc,0)?TA_SUCCESS_KILL:TA_FAILED); - else - dwRet = TA_SUCCESS_CLEAN ; - } else { - /* we immediately kill the proces */ - dwRet=(TerminateProcess(hProc,0)?TA_SUCCESS_KILL:TA_FAILED); - } - - CloseHandle(hProc) ; - - return dwRet ; -} - -/*---------------------------------------------------------------- - DWORD Terminate16App( DWORD dwPID, DWORD dwThread, - WORD w16Task, DWORD dwTimeout ) - - Purpose: - Shut down a Win16 APP. - - Parameters: - dwPID - Process ID of the NTVDM in which the 16-bit application is - running. - - dwThread - Thread ID of the thread of execution for the 16-bit - application. - - w16Task - 16-bit task handle for the application. - - dwTimeout - Wait time in milliseconds before shutting down the task. - - Return Value: - If successful, returns TA_SUCCESS_16 - If unsuccessful, returns TA_FAILED. - NOTE: These values are defined in the header for this - function. - - NOTE: - You can get the Win16 task and thread ID through the - VDMEnumTaskWOW() or the VDMEnumTaskWOWEx() functions. - ----------------------------------------------------------------*/ - -DWORD Terminate16App( DWORD dwPID, DWORD dwThread, WORD w16Task, DWORD dwTimeout ) -{ - HINSTANCE hInstLib ; - TERMINFO info ; - - /* You will be calling the functions through explicit linking */ - /* so that this code will be binary compatible across */ - /* Win32 platforms. */ - BOOL (WINAPI *lpfVDMTerminateTaskWOW)(DWORD dwProcessId, WORD htask) ; - - hInstLib = LoadLibraryA( "VDMDBG.DLL" ) ; - if( hInstLib == NULL ) - return TA_FAILED ; - - /* Get procedure addresses. */ - lpfVDMTerminateTaskWOW = (BOOL (WINAPI *)(DWORD, WORD )) - GetProcAddress( hInstLib, "VDMTerminateTaskWOW" ) ; - - if( lpfVDMTerminateTaskWOW == NULL ) - { - FreeLibrary( hInstLib ) ; - return TA_FAILED ; - } - - /* Post a WM_CLOSE to all windows that match the ID and the */ - /* thread. */ - info.dwID = dwPID ; - info.dwThread = dwThread ; - EnumWindows((WNDENUMPROC)Terminate16AppEnum, (LPARAM) &info) ; - - /* Wait. */ - Sleep( dwTimeout ) ; - - /* Then terminate. */ - lpfVDMTerminateTaskWOW(dwPID, w16Task) ; - - FreeLibrary( hInstLib ) ; - return TA_SUCCESS_16 ; -} - -BOOL CALLBACK TerminateAppEnum( HWND hwnd, LPARAM lParam ) -{ - DWORD dwID ; - - GetWindowThreadProcessId(hwnd, &dwID) ; - - if(dwID == (DWORD)lParam) - { - PostMessage(hwnd, WM_CLOSE, 0, 0) ; - } - - return TRUE ; -} - -BOOL CALLBACK Terminate16AppEnum( HWND hwnd, LPARAM lParam ) -{ - DWORD dwID ; - DWORD dwThread ; - TERMINFO *termInfo ; - - termInfo = (TERMINFO *)lParam ; - - dwThread = GetWindowThreadProcessId(hwnd, &dwID) ; - - if(dwID == termInfo->dwID && termInfo->dwThread == dwThread ) - { - PostMessage(hwnd, WM_CLOSE, 0, 0) ; - } - - return TRUE ; -} - - -void ExecuteAndWait(char *buffer) -{ - STARTUPINFO si; - PROCESS_INFORMATION pi; - - SecureZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - SecureZeroMemory(&pi, sizeof(pi)); - - if(CreateProcess(NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { - /* wait for the uninstall to finish */ - (void) WaitForSingleObject(pi.hProcess, INFINITE); - - (void)CloseHandle(pi.hProcess); - (void)CloseHandle(pi.hThread); - - } -} - -void uninstall(char *regkey, char *u3installed, char *uninstall) -{ - char buffer[BUFSIZ]; - int buflen = BUFSIZ; - char *u3_device_serial; - char reg_key[BUFSIZ]; - HKEY key; - - /* UNINSTALL ONLY IF WE INSTALLED IT */ - buffer[0] = '\0'; - - /* see if it is installed */ - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, regkey, 0, (KEY_READ | KEY_WRITE), &key) == ERROR_SUCCESS) { - - buflen = BUFSIZ; - - /* see if a U3 device installed the package */ - if(RegQueryValueEx(key, u3installed, NULL, NULL, buffer, &buflen) == ERROR_SUCCESS) { - - u3_device_serial = getenv("U3_DEVICE_SERIAL"); - - /* see if this U3 device installed the package */ - if(!strncmp(buffer, u3_device_serial, strlen(u3_device_serial) + 1)) { - - buffer[0] = '"'; - buflen = BUFSIZ-1; - /* we installed WinPcap - we should now uninstall it - read the uninstall string */ - (void) RegQueryValueEx(key, uninstall, NULL, NULL, &buffer[1], &buflen); - - - if(!strncmp(buffer, "\"MsiExec.exe", 12)) { - /* run msiexec.exe quietly */ - strncat(buffer, " /qn", 5); - - } - - strncat(buffer, "\"", 2); /* close the quotes */ - - /* delete our value */ - RegDeleteValue(key, u3installed); - - } else { - /* empty the buffer */ - buffer[0] = '\0'; - } - } - - RegCloseKey(key); - } - - if(*buffer) { -#if 0 - MessageBox(NULL, - buffer, - "Uninstall", - MB_YESNO|MB_TOPMOST|MB_ICONQUESTION); -#endif - - /* we have an uninstall string */ - ExecuteAndWait(buffer); - } -} - - -void winpcap_auto_start() -{ - - HKEY key; - HKEY npfKey; - char buffer[BUFSIZ+1]; - int buflen = 0; - DWORD startVal = NPF_START_VAL; - - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, WINDOWS_VERSION_KEY, 0, (KEY_READ), &key) == ERROR_SUCCESS) { - - if(RegQueryValueEx(key, WINDOWS_VERSION, NULL, NULL, buffer, &buflen) == ERROR_SUCCESS) { - - if(!strcmp(buffer, VISTA_VERSION)) { - /* this is Vista - set the autostart */ - /* if installation was successful this key will now exist */ - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, NPF_KEY, 0, (KEY_READ | KEY_WRITE), &npfKey) == ERROR_SUCCESS) { - - (void)RegSetValueEx(npfKey, NPF_START, 0, REG_DWORD, (BYTE*)&startVal, sizeof(DWORD)); - - RegCloseKey(npfKey); - - } - } - } - RegCloseKey(key); - } -} - - -void app_start(int argc, char *argv[]) -{ - char *u3hostexecpath; - char *envvar; - char *end; - char buffer[BUFSIZ+1]; - char inBuffer[FILEBUFSIZ+1]; - HANDLE *file; - DWORD numRead = 0; - int i; - - /* read any environment variables that may be set as we are probably running this from a file association */ - - buffer[0] = '\0'; - strncat(buffer, argv[0], strlen(argv[0]) + 1); - - /* truncate at last \\ */ - if(end = strrchr(buffer, '\\')) - *end = '\0'; - - strncat(buffer, ENV_FILENAME, strlen(ENV_FILENAME) + 1); - - /* open the file */ - if((file = CreateFile(buffer, FILE_READ_DATA, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) { - - /* read the whole file in in one go */ - if(ReadFile(file, &inBuffer, FILEBUFSIZ, &numRead, NULL) != 0) { - /* we were successful - parse the lines */ - inBuffer[numRead] = '\0'; /* null terminate the data */ - - envvar = inBuffer; - - while(end = strchr(envvar, '\n')) { - /* we have a line */ - *end++ = '\0'; - - _putenv(envvar); - - /* point the next envar to the end */ - envvar = end; - } - } - - /* close the file */ - CloseHandle(file); - - } - - /* exec wireshark */ - if((u3hostexecpath = getenv("U3_HOST_EXEC_PATH")) != NULL) { - - buffer[0] = '\0'; - strncat(buffer, u3hostexecpath, strlen(u3hostexecpath) + 1); - strncat(buffer, WIRESHARK_EXE, strlen(WIRESHARK_EXE) + 1); - - /* copy the remaining arguments across */ - for(i = 2; i < argc; i++) { - strncat(buffer, " ", 2); - strncat(buffer, argv[i], strlen(argv[i]) + 1); - } - - ExecuteAndWait(buffer); - - } - -} - - -void app_stop(DWORD timeOut) -{ - DWORD pid = 0; - HANDLE hFind = INVALID_HANDLE_VALUE; - WIN32_FIND_DATA find_file_data; - DWORD dwError; - char *u3_host_exec_path; - char dir_spec[MAX_PATH+1]; - char file_name[MAX_PATH+1]; - - u3_host_exec_path = getenv("U3_HOST_EXEC_PATH"); - - strncpy(dir_spec, u3_host_exec_path, strlen(u3_host_exec_path) + 1); - strncat(dir_spec, "\\*.pid", 7); - - hFind = FindFirstFile(dir_spec, &find_file_data); - - if(hFind != INVALID_HANDLE_VALUE) { - - do { - - pid = (DWORD)atoi(find_file_data.cFileName); - - if(pid) - TerminateApp(pid, timeOut); - - strncpy(file_name, u3_host_exec_path, strlen(u3_host_exec_path) + 1); - strncat(file_name, "\\", 2); - strncat(file_name, find_file_data.cFileName, strlen(find_file_data.cFileName) + 1); - - DeleteFile(TEXT(file_name)); - - } while(FindNextFile(hFind, &find_file_data) != 0); - - FindClose(hFind); - - } - -} - -/* associate - -Associate an filetype (extension) with the U3 Wireshark if it doesn't already have an association - -*/ - -void associate(char *extension) -{ - HKEY key; - DWORD disposition; - char buffer[BUFSIZ]; - int buflen = BUFSIZ; - - buffer[0] = '\0'; - - /* open the HKCR extension key*/ - if(RegCreateKeyEx(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, (KEY_READ | KEY_WRITE), NULL, &key, &disposition) == ERROR_SUCCESS) { - - /* we could look at the disposition - but we don't bother */ - if((RegQueryValueEx(key, "", NULL, NULL, buffer, &buflen) != ERROR_SUCCESS) || (buffer[0] == '\0')) { - - (void)RegSetValueEx(key, "", 0, REG_SZ, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1); - } - - RegCloseKey(key); - } - -} - -BOOL save_environment() -{ - char **envptr; - char *envval; - HANDLE *file; - char buffer[BUFSIZ+1]; - DWORD buflen; - DWORD numWritten; - BOOL retval = FALSE; - - envval = getenv("U3_HOST_EXEC_PATH"); - - buffer[0] = '\0'; - strncat(buffer, envval, strlen(envval) + 1); - strncat(buffer, ENV_FILENAME, strlen(ENV_FILENAME) + 1); - - /* open the file */ - if((file = CreateFile(buffer, FILE_WRITE_DATA, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) { - - for(envptr = environmentvars; *envptr; envptr++) { - - if(envval = getenv(*envptr)) { - /* write it out */ - - buffer[0] = '\0'; - strncat(buffer, *envptr, strlen(*envptr) + 1); - strncat(buffer, "=", 2); - strncat(buffer, envval, strlen(envval) + 1); - strncat(buffer, "\n", 2); - - buflen = strlen(buffer); - - WriteFile(file, buffer, buflen, &numWritten, NULL); - } - - } - - /* close the file */ - CloseHandle(file); - - retval = TRUE; - - } - - return retval; - -} - - -/* disassociate - -Remove any file types that are associated with the U3 Wireshark (which is being removed) - -*/ - - -void disassociate(char *extension) -{ - HKEY key; - DWORD disposition; - char buffer[BUFSIZ]; - int buflen = BUFSIZ; - boolean delete_key = FALSE; - - buffer[0] = '\0'; - - /* open the HKCR extension key*/ - if(RegOpenKeyEx(HKEY_CLASSES_ROOT, extension, 0, (KEY_READ | KEY_WRITE), &key) == ERROR_SUCCESS) { - - if(RegQueryValueEx(key, "", NULL, NULL, buffer, &buflen) == ERROR_SUCCESS) { - - if(!strncmp(buffer, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1)) - delete_key = TRUE; - } - - RegCloseKey(key); - } - - if(delete_key) - RegDeleteKey(HKEY_CLASSES_ROOT, extension); -} - -/* host_configure - -Configure the host for the U3 Wireshark. This involves: -1) registering the U3 Wireshark with capture file types -2) installing WinPcap if not already installed -3) create a "My Captures" folder on the U3 device if it doesn't already exist -*/ - -void host_configure(void) -{ - char **pext; - HKEY key; - DWORD disposition; - char *u3_host_exec_path; - char *u3_device_exec_path; - char *u3_device_serial; - char *u3_device_document_path; - char wireshark_path[MAX_PATH+1]; - char winpcap_path[MAX_PATH+1]; - char vcredist_path[MAX_PATH+1]; - char my_captures_path[MAX_PATH+1]; - char reg_key[BUFSIZ]; - char buffer[BUFSIZ]; - int buflen = BUFSIZ; - boolean hasWinPcap = FALSE; - boolean hasRedist = FALSE; - - /* CREATE THE U3 Wireshark TYPE */ - if(RegCreateKeyEx(HKEY_CLASSES_ROOT, WIRESHARK_ASSOC, 0, NULL, 0, - (KEY_READ | KEY_WRITE), NULL, &key, &disposition) == ERROR_SUCCESS) { - - (void)RegSetValueEx(key, "", 0, REG_SZ, WIRESHARK_DESC, strlen(WIRESHARK_DESC) + 1); - - RegCloseKey(key); - } - - /* compute the U3 path to wireshark */ - u3_host_exec_path = getenv("U3_HOST_EXEC_PATH"); - strncpy(wireshark_path, u3_host_exec_path, strlen(u3_host_exec_path) + 1); - strncat(wireshark_path, U3UTIL_APPSTART, strlen(U3UTIL_APPSTART) + 1); - - strncpy(reg_key, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1); - strncat(reg_key, SHELL_OPEN_COMMAND, strlen(SHELL_OPEN_COMMAND) + 1); - - /* associate the application */ - if(RegCreateKeyEx(HKEY_CLASSES_ROOT, reg_key, 0, NULL, 0, - (KEY_READ | KEY_WRITE), NULL, &key, &disposition) == ERROR_SUCCESS) { - (void)RegSetValueEx(key, "", 0, REG_SZ, wireshark_path, strlen(wireshark_path) + 1); - - RegCloseKey(key); - - } - - /* associate the icon */ - strncpy(reg_key, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1); - strncat(reg_key, DEFAULT_ICON, strlen(DEFAULT_ICON) + 1); - - /* the icon is in the exe */ - strncpy(wireshark_path, u3_host_exec_path, strlen(u3_host_exec_path) + 1); - strncat(wireshark_path, WIRESHARK_EXE, strlen(WIRESHARK_EXE) + 1); - strncat(wireshark_path, ",1", 3); - - /* associate the application */ - if(RegCreateKeyEx(HKEY_CLASSES_ROOT, reg_key, 0, NULL, 0, - (KEY_READ | KEY_WRITE), NULL, &key, &disposition) == ERROR_SUCCESS) { - - (void)RegSetValueEx(key, "", 0, REG_SZ, wireshark_path, strlen(wireshark_path) + 1); - - RegCloseKey(key); - } - - /* CREATE THE FILE ASSOCIATIONS */ - - for(pext = extensions; *pext; pext++) - associate(*pext); - - /* update icons */ - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0); - - /* START WINPCAP INSTALLATION IF NOT ALREADY INSTALLED */ - - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, WINPCAP_KEY, 0, (KEY_READ), &key) == ERROR_SUCCESS) { - - if(RegQueryValueEx(key, WINPCAP_UNINSTALL, NULL, NULL, buffer, &buflen) == ERROR_SUCCESS) { - - if(buffer[0] != '\0') - hasWinPcap = TRUE; - } - - RegCloseKey(key); - } - - if(!hasWinPcap && - (MessageBox(NULL, - TEXT("If you want to capture packets from the network you will need to install WinPcap.\nIt will be uninstalled when you remove your U3 device.\n\nDo you want to install WinPcap?"), - TEXT("U3 Wireshark: Install WinPcap?"), - MB_YESNO|MB_TOPMOST|MB_ICONQUESTION) == IDYES)) { - - /* compute the U3 path to the WinPcap installation package - it stays on the device */ - u3_device_exec_path = getenv("U3_DEVICE_EXEC_PATH"); - strncpy(winpcap_path, "\"", 2); - strncat(winpcap_path, u3_device_exec_path, strlen(u3_device_exec_path) + 1); - strncat(winpcap_path, WINPCAP_PACKAGE, strlen(WINPCAP_PACKAGE) + 1); - strncat(winpcap_path, "\"", 2); - - ExecuteAndWait(winpcap_path); - - /* if installation was successful this key will now exist */ - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, WINPCAP_KEY, 0, (KEY_READ | KEY_WRITE), &key) == ERROR_SUCCESS) { - - u3_device_serial = getenv("U3_DEVICE_SERIAL"); - - (void)RegSetValueEx(key, WINPCAP_U3INSTALLED, 0, REG_SZ, u3_device_serial, strlen(u3_device_serial) + 1); - - winpcap_auto_start(); - - } - } - - /* START VCREDIST INSTALLATION IF NOT ALREADY INSTALLED */ - - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, VCREDIST_KEY, 0, (KEY_READ), &key) == ERROR_SUCCESS) { - - buflen = BUFSIZ; - - if(RegQueryValueEx(key, VCREDIST_UNINSTALL, NULL, NULL, buffer, &buflen) == ERROR_SUCCESS) { - - if(buffer[0] != '\0') - hasRedist = TRUE; - } - - RegCloseKey(key); - - } - - if(!hasRedist) { - - /* compute the U3 path to the Visual C++ redistributables package - it stays on the device */ - u3_device_exec_path = getenv("U3_DEVICE_EXEC_PATH"); - strncpy(vcredist_path, "\"", 2); - strncat(vcredist_path, u3_device_exec_path, strlen(u3_device_exec_path) + 1); - strncat(vcredist_path, VCREDIST_PACKAGE, strlen(VCREDIST_PACKAGE) + 1); - strncat(vcredist_path, "\" /q", 5); /* do things quietly */ - - ExecuteAndWait(vcredist_path); - - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, VCREDIST_KEY, 0, (KEY_READ | KEY_WRITE), &key) == ERROR_SUCCESS) { - - u3_device_serial = getenv("U3_DEVICE_SERIAL"); - - (void)RegSetValueEx(key, VCREDIST_U3INSTALLED, 0, REG_SZ, u3_device_serial, strlen(u3_device_serial) + 1); - - } - } - - - /* CREATE THE "My Captures" FOLDER IF IT DOESN'T ALREADY EXIST */ - - u3_device_document_path = getenv("U3_DEVICE_DOCUMENT_PATH"); - strncpy(my_captures_path, u3_device_document_path, strlen(u3_device_document_path) + 1); - strncat(my_captures_path, MY_CAPTURES, strlen(MY_CAPTURES) + 1); - - /* don't care if it succeeds or fails */ - (void) CreateDirectory(my_captures_path, NULL); - - /* Save the environment so we can use it in the file assocation */ - save_environment(); -} - -/* host_cleanup - -Remove any references to the U3 Wireshark from the host. This involves: -1) Removing the U3 Wireshark file type associations -2) Uninstalling WinPcap if we installed it. - If the user cancels the uninstallation of WinPcap, we will not try and remove it again. - -*/ - -void host_clean_up(void) -{ - DWORD disposition; - char **pext; - char *u3_device_serial; - char reg_key[BUFSIZ]; - - /* the device has been removed - - just close the application as quickly as possible */ - - app_stop(0); - - /* DELETE THE FILE ASSOCIATIONS */ - for(pext = extensions; *pext; pext++) - disassociate(*pext); - - /* update icons */ - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0); - - /* DELETE THE U3 Wireshark TYPE */ - strncpy(reg_key, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1); - strncat(reg_key, SHELL_OPEN_COMMAND, strlen(SHELL_OPEN_COMMAND) + 1); - - RegDeleteKey(HKEY_CLASSES_ROOT, reg_key); - - /* delete the open key */ - strncpy(reg_key, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1); - strncat(reg_key, SHELL_OPEN, strlen(SHELL_OPEN) + 1); - - RegDeleteKey(HKEY_CLASSES_ROOT, reg_key); - - /* delete the shell key */ - strncpy(reg_key, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1); - strncat(reg_key, SHELL, strlen(SHELL) + 1); - - RegDeleteKey(HKEY_CLASSES_ROOT, reg_key); - - /* delete the icon key */ - strncpy(reg_key, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1); - strncat(reg_key, DEFAULT_ICON, strlen(DEFAULT_ICON) + 1); - - RegDeleteKey(HKEY_CLASSES_ROOT, reg_key); - - /* finally delete the toplevel key */ - RegDeleteKey(HKEY_CLASSES_ROOT, WIRESHARK_ASSOC); - - uninstall(WINPCAP_KEY, WINPCAP_U3INSTALLED, WINPCAP_UNINSTALL); - uninstall(VCREDIST_KEY, VCREDIST_U3INSTALLED, VCREDIST_UNINSTALL); - -} - -main(int argc, char *argv[]) -{ - DWORD time_out = 0; - char *u3_is_device_available; -#if 0 - char **envptr; - char *envval; -# endif - u3_is_device_available = getenv("U3_IS_DEVICE_AVAILABLE"); - - if(u3_is_device_available && !strncmp(u3_is_device_available, "true", 4)) - /* the device is available - wait for user to respond to any dialogs */ - time_out = INFINITE; -#if 0 - for(envptr = environmentvars; *envptr; envptr++) { - envval = getenv(*envptr); - - MessageBox(NULL, - envval ? envval : "NULL", - *envptr, - MB_YESNO|MB_TOPMOST|MB_ICONQUESTION); - } -#endif - - if(argc > 1) { - - if(!strncmp(argv[1], "hostConfigure", 13)) - host_configure(); - else if(!strncmp(argv[1], "appStart", 9)) - app_start(argc, argv); - else if(!strncmp(argv[1], "appStop", 8)) - app_stop(time_out); - else if(!strncmp(argv[1], "hostCleanUp", 11)) - host_clean_up(); - - } - - exit(0); -} diff -Nru wireshark-1.12.0~201310251247/packaging/u3/win32/u3util.exe.manifest wireshark-1.12.0~201311020920/packaging/u3/win32/u3util.exe.manifest --- wireshark-1.12.0~201310251247/packaging/u3/win32/u3util.exe.manifest 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/win32/u3util.exe.manifest 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -Nru wireshark-1.12.0~201310251247/packaging/u3/win32/wireshark.bat wireshark-1.12.0~201311020920/packaging/u3/win32/wireshark.bat --- wireshark-1.12.0~201310251247/packaging/u3/win32/wireshark.bat 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/packaging/u3/win32/wireshark.bat 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -:: wireshark.bat -:: A batch script to run wireshark from the files that -:: constitute the U3 package. -:: Also used to test the U3 package build. -:: -:: $Id$ -:: -:: Wireshark - Network traffic analyzer -:: By Gerald Combs -:: 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -:: - -@echo off -SETLOCAL - -SET U3_DEVICE_SERIAL=0000060414068917 -SET U3_DEVICE_PATH=%~d0 -SET U3_DEVICE_DOCUMENT_PATH=%CD%\data - -SET U3_DEVICE_VENDOR="Wireshark Developers" -SET U3_DEVICE_PRODUCT="Non-U3 Drive" -SET U3_DEVICE_VENDOR_ID=0000 - -SET U3_APP_DATA_PATH=%CD%\data -SET U3_HOST_EXEC_PATH=%CD%\host -SET U3_DEVICE_EXEC_PATH=%CD%\device - -SET U3_ENV_VERSION=1.0 -SET U3_ENV_LANGUAGE=1033 - -"%U3_HOST_EXEC_PATH%\wireshark.exe" %* diff -Nru wireshark-1.12.0~201310251247/plugins/asn1/packet-asn1.c wireshark-1.12.0~201311020920/plugins/asn1/packet-asn1.c --- wireshark-1.12.0~201310251247/plugins/asn1/packet-asn1.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/asn1/packet-asn1.c 2013-11-02 02:12:36.000000000 +0000 @@ -729,8 +729,8 @@ static guint decode_asn1_sequence(tvbuff_t *tvb, guint offset, guint len, proto_tree *pt, int level); static void PDUreset(int count, int counr2); -static void -dissect_asn1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { +static int +dissect_asn1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { ASN1_SCK asn1; guint cls, con, tag, len, offset, reassembled; @@ -754,7 +754,7 @@ reassembled = 1; /* UDP is not a stream, and thus always reassembled .... */ if (pinfo->ipproto == IP_PROTO_TCP) { /* we have tcpinfo */ - info = (struct tcpinfo *)pinfo->private_data; + info = (struct tcpinfo *)data; delta = info->seq - lastseq; reassembled = info->is_reassembled; lastseq = info->seq; @@ -1029,6 +1029,8 @@ if (asn1_verbose) g_message("dissect_asn1 finished: desegment_offset=%d desegment_len=%d can_desegment=%d", pinfo->desegment_offset, pinfo->desegment_len, pinfo->can_desegment); + + return tvb_length(tvb); } /* decode an ASN.1 sequence, until we have consumed the specified length */ @@ -5455,7 +5457,7 @@ #endif /* JUST_ONE_PORT */ if(!asn1_initialized) { - asn1_handle = create_dissector_handle(dissect_asn1,proto_asn1); + asn1_handle = new_create_dissector_handle(dissect_asn1,proto_asn1); asn1_initialized = TRUE; } else { /* clean up ports and their lists */ #ifdef JUST_ONE_PORT diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-bintrngreq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-bintrngreq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-bintrngreq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-bintrngreq.c 2013-11-02 02:12:36.000000000 +0000 @@ -50,7 +50,6 @@ md_ds_sg_id = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Bonded Ranging Request: MD-DS-SG-ID = %u (0x%X)", md_ds_sg_id, md_ds_sg_id ); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-cmctrlreq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-cmctrlreq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-cmctrlreq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-cmctrlreq.c 2013-11-02 02:12:36.000000000 +0000 @@ -46,7 +46,6 @@ transid = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "CM Control Request: Transaction-Id = %u", transid); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-cmctrlrsp.c wireshark-1.12.0~201311020920/plugins/docsis/packet-cmctrlrsp.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-cmctrlrsp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-cmctrlrsp.c 2013-11-02 02:12:36.000000000 +0000 @@ -54,7 +54,6 @@ transid = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "CM Control Response: Transaction-Id = %u", transid); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-cmstatus.c wireshark-1.12.0~201311020920/plugins/docsis/packet-cmstatus.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-cmstatus.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-cmstatus.c 2013-11-02 02:12:36.000000000 +0000 @@ -144,7 +144,6 @@ transid = tvb_get_ntohs (tvb, 0); event_type = tvb_get_guint8 (tvb, 2); len = tvb_reported_length_remaining (tvb, 3); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "CM-STATUS Report: Transaction ID = %u", transid); if (tree) diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-dbcack.c wireshark-1.12.0~201311020920/plugins/docsis/packet-dbcack.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-dbcack.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-dbcack.c 2013-11-02 02:12:36.000000000 +0000 @@ -46,7 +46,6 @@ transid = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Dynamic Bonding Change Acknowledge: Tran-Id = %u", transid); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-dbcreq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-dbcreq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-dbcreq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-dbcreq.c 2013-11-02 02:12:36.000000000 +0000 @@ -48,7 +48,6 @@ transid = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Dynamic Bonding Change Request: Tran-Id = %u", transid); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-dbcrsp.c wireshark-1.12.0~201311020920/plugins/docsis/packet-dbcrsp.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-dbcrsp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-dbcrsp.c 2013-11-02 02:12:36.000000000 +0000 @@ -51,7 +51,6 @@ transid = tvb_get_ntohs (tvb, 0); confcode = tvb_get_guint8 (tvb, 2); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Dynamic Bonding Change Response: Tran-Id = %u (%s)", transid, val_to_str (confcode, docsis_conf_code, "%d")); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-docsis.c wireshark-1.12.0~201311020920/plugins/docsis/packet-docsis.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-docsis.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-docsis.c 2013-11-02 02:12:36.000000000 +0000 @@ -403,7 +403,6 @@ /* Make entries in Protocol column and Info column on summary display */ col_set_str (pinfo->cinfo, COL_PROTOCOL, "DOCSIS"); - col_clear (pinfo->cinfo, COL_INFO); switch (fctype) { case FCTYPE_PACKET: diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-dpvreq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-dpvreq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-dpvreq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-dpvreq.c 2013-11-02 02:12:36.000000000 +0000 @@ -54,7 +54,6 @@ transid = tvb_get_ntohs (tvb, 0); dschan = tvb_get_guint8 (tvb, 2); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "DOCSIS Path Verify Request: Transaction-Id = %u DS-Ch %d", transid, dschan); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-dpvrsp.c wireshark-1.12.0~201311020920/plugins/docsis/packet-dpvrsp.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-dpvrsp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-dpvrsp.c 2013-11-02 02:12:36.000000000 +0000 @@ -54,7 +54,6 @@ transid = tvb_get_ntohs (tvb, 0); dschan = tvb_get_guint8 (tvb, 2); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "DOCSIS Path Verify Response: Transaction-Id = %u DS-Ch %d", transid, dschan); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-dsareq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-dsareq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-dsareq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-dsareq.c 2013-11-02 02:12:36.000000000 +0000 @@ -48,7 +48,6 @@ transid = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Dynamic Service Addition Request Tran-id = %u", transid); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-dscreq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-dscreq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-dscreq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-dscreq.c 2013-11-02 02:12:36.000000000 +0000 @@ -49,7 +49,6 @@ transid = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Dynamic Service Change Request Tran-id = %u", transid); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-dsdreq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-dsdreq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-dsdreq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-dsdreq.c 2013-11-02 02:12:36.000000000 +0000 @@ -51,7 +51,6 @@ transid = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Dynamic Service Delete Request Tran-id = %u", transid); if (tree) diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-intrngreq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-intrngreq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-intrngreq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-intrngreq.c 2013-11-02 02:12:36.000000000 +0000 @@ -48,7 +48,6 @@ sid = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Request: SID = %u",sid); if (tree) diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-map.c wireshark-1.12.0~201311020920/plugins/docsis/packet-map.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-map.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-map.c 2013-11-02 02:12:36.000000000 +0000 @@ -84,7 +84,6 @@ upchid = tvb_get_guint8 (tvb, 0); ucd_count = tvb_get_guint8 (tvb, 1); - col_clear (pinfo->cinfo, COL_INFO); if (upchid > 0) col_add_fstr (pinfo->cinfo, COL_INFO, "Map Message: Channel ID = %u (U%u), UCD Count = %u, # IE's = %u", diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-regreq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-regreq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-regreq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-regreq.c 2013-11-02 02:12:36.000000000 +0000 @@ -49,7 +49,6 @@ sid = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Registration Request SID = %u", sid); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-rngreq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-rngreq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-rngreq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-rngreq.c 2013-11-02 02:12:36.000000000 +0000 @@ -48,7 +48,6 @@ sid = tvb_get_ntohs (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); if (sid > 0) col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Request: SID = %u", sid); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-rngrsp.c wireshark-1.12.0~201311020920/plugins/docsis/packet-rngrsp.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-rngrsp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-rngrsp.c 2013-11-02 02:12:36.000000000 +0000 @@ -74,7 +74,6 @@ sid = tvb_get_ntohs (tvb, 0); upchid = tvb_get_guint8 (tvb, 2); - col_clear (pinfo->cinfo, COL_INFO); if (upchid > 0) col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Response: SID = %u, Upstream Channel = %u (U%u)", diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-type29ucd.c wireshark-1.12.0~201311020920/plugins/docsis/packet-type29ucd.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-type29ucd.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-type29ucd.c 2013-11-02 02:12:36.000000000 +0000 @@ -204,7 +204,6 @@ upchid = tvb_get_guint8 (tvb, 0); /* if the upstream Channel ID is 0 then this is for Telephony Return) */ - col_clear (pinfo->cinfo, COL_INFO); if (upchid > 0) col_add_fstr (pinfo->cinfo, COL_INFO, "type29ucd Message: Channel ID = %u (U%u)", upchid, diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-uccreq.c wireshark-1.12.0~201311020920/plugins/docsis/packet-uccreq.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-uccreq.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-uccreq.c 2013-11-02 02:12:36.000000000 +0000 @@ -48,7 +48,6 @@ chid = tvb_get_guint8 (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Upstream Channel Change request Channel ID = %u (U%u)", chid, (chid > 0 ? chid - 1 : chid)); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-uccrsp.c wireshark-1.12.0~201311020920/plugins/docsis/packet-uccrsp.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-uccrsp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-uccrsp.c 2013-11-02 02:12:36.000000000 +0000 @@ -46,7 +46,6 @@ chid = tvb_get_guint8 (tvb, 0); - col_clear (pinfo->cinfo, COL_INFO); col_add_fstr (pinfo->cinfo, COL_INFO, "Upstream Channel Change response Channel ID = %u (U%u)", chid, (chid > 0 ? chid - 1 : chid)); diff -Nru wireshark-1.12.0~201310251247/plugins/docsis/packet-ucd.c wireshark-1.12.0~201311020920/plugins/docsis/packet-ucd.c --- wireshark-1.12.0~201310251247/plugins/docsis/packet-ucd.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/docsis/packet-ucd.c 2013-11-02 02:12:36.000000000 +0000 @@ -169,7 +169,6 @@ upchid = tvb_get_guint8 (tvb, 0); /* if the upstream Channel ID is 0 then this is for Telephony Return) */ - col_clear (pinfo->cinfo, COL_INFO); if (upchid > 0) col_add_fstr (pinfo->cinfo, COL_INFO, "UCD Message: Channel ID = %u (U%u)", upchid, diff -Nru wireshark-1.12.0~201310251247/plugins/ethercat/packet-ioraw.c wireshark-1.12.0~201311020920/plugins/ethercat/packet-ioraw.c --- wireshark-1.12.0~201310251247/plugins/ethercat/packet-ioraw.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/ethercat/packet-ioraw.c 2013-11-02 02:12:36.000000000 +0000 @@ -61,11 +61,8 @@ col_set_str(pinfo->cinfo, COL_PROTOCOL, "IO-RAW"); - col_clear(pinfo->cinfo, COL_INFO); - - IoRawSummaryFormater(szText, nMax); - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_add_str(pinfo->cinfo, COL_INFO, szText); if (tree) { diff -Nru wireshark-1.12.0~201310251247/plugins/irda/packet-irda.c wireshark-1.12.0~201311020920/plugins/irda/packet-irda.c --- wireshark-1.12.0~201310251247/plugins/irda/packet-irda.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/irda/packet-irda.c 2013-11-02 02:12:36.000000000 +0000 @@ -595,7 +595,7 @@ } } - col_add_str(pinfo->cinfo, COL_INFO, "GetValueByClass: \""); + col_set_str(pinfo->cinfo, COL_INFO, "GetValueByClass: \""); tvb_memcpy(tvb, buf, offset + 1 + 1, clen); memcpy(&buf[clen], "\" \"", 3); diff -Nru wireshark-1.12.0~201310251247/plugins/profinet/packet-dcerpc-pn-io.c wireshark-1.12.0~201311020920/plugins/profinet/packet-dcerpc-pn-io.c --- wireshark-1.12.0~201310251247/plugins/profinet/packet-dcerpc-pn-io.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/profinet/packet-dcerpc-pn-io.c 2013-11-02 02:12:36.000000000 +0000 @@ -8588,8 +8588,7 @@ request_reference, val_to_str(request_id, pn_io_profidrive_request_id_vals, "Unknown"), do_id, no_of_parameters); - col_clear(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_INFO, "PROFIDrive Write Request, ReqRef:0x%02x, %s DO:%u", + col_add_fstr(pinfo->cinfo, COL_INFO, "PROFIDrive Write Request, ReqRef:0x%02x, %s DO:%u", request_reference, request_id==0x01 ? "Read" : request_id==0x02 ? "Change" : @@ -8692,8 +8691,7 @@ request_reference, val_to_str(response_id, pn_io_profidrive_response_id_vals, "Unknown"), do_id, no_of_parameters); - col_clear(pinfo->cinfo, COL_INFO); - col_append_fstr(pinfo->cinfo, COL_INFO, "PROFIDrive Read Response, ReqRef:0x%02x, RspId:%s", + col_add_fstr(pinfo->cinfo, COL_INFO, "PROFIDrive Read Response, ReqRef:0x%02x, RspId:%s", request_reference, val_to_str(response_id, pn_io_profidrive_response_id_vals, "Unknown response")); diff -Nru wireshark-1.12.0~201310251247/plugins/profinet/packet-dcom-cba-acco.c wireshark-1.12.0~201311020920/plugins/profinet/packet-dcom-cba-acco.c --- wireshark-1.12.0~201310251247/plugins/profinet/packet-dcom-cba-acco.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/profinet/packet-dcom-cba-acco.c 2013-11-02 02:12:36.000000000 +0000 @@ -2759,7 +2759,7 @@ } else if (u32Idx < 10) { col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ProvID); } else if (u32Idx == 10) { - col_append_fstr(pinfo->cinfo, COL_INFO, ",..."); + col_append_str(pinfo->cinfo, COL_INFO, ",..."); } u32Idx++; @@ -3709,7 +3709,7 @@ } else if (u32Idx < 10) { col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID); } else if (u32Idx == 10) { - col_append_fstr(pinfo->cinfo, COL_INFO, ",..."); + col_append_str(pinfo->cinfo, COL_INFO, ",..."); } u32Idx++; @@ -3766,7 +3766,7 @@ } else if (u32Idx < 10) { col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID); } else if (u32Idx == 10) { - col_append_fstr(pinfo->cinfo, COL_INFO, ",..."); + col_append_str(pinfo->cinfo, COL_INFO, ",..."); } u32Idx++; diff -Nru wireshark-1.12.0~201310251247/plugins/profinet/packet-pn-mrp.c wireshark-1.12.0~201311020920/plugins/profinet/packet-pn-mrp.c --- wireshark-1.12.0~201310251247/plugins/profinet/packet-pn-mrp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/profinet/packet-pn-mrp.c 2013-11-02 02:12:36.000000000 +0000 @@ -384,7 +384,7 @@ } else { proto_item_append_text(item, " "); } - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(type, pn_mrp_block_type_vals, "Unknown TLVType 0x%x")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, pn_mrp_block_type_vals, "Unknown TLVType 0x%x")); proto_item_append_text(item, "%s", val_to_str_const(type, pn_mrp_block_type_vals, "Unknown TLVType 0x%x")); switch(type) { diff -Nru wireshark-1.12.0~201310251247/plugins/profinet/packet-pn-ptcp.c wireshark-1.12.0~201311020920/plugins/profinet/packet-pn-ptcp.c --- wireshark-1.12.0~201310251247/plugins/profinet/packet-pn-ptcp.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/profinet/packet-pn-ptcp.c 2013-11-02 02:12:36.000000000 +0000 @@ -346,7 +346,7 @@ ClockVariance); } else { - col_append_fstr(pinfo->cinfo, COL_INFO, " active"); + col_append_str(pinfo->cinfo, COL_INFO, " active"); proto_item_append_text(item, ": Prio1=\"%s\" is active, Prio2=%s, Clock: Class=\"%s\", Accuracy=%s, Variance=%d", val_to_str(MasterPriority1 & 0x7, pn_ptcp_master_prio1_vals, "(Reserved: 0x%x)"), val_to_str(MasterPriority2, pn_ptcp_master_prio2_vals, "(Reserved: 0x%x)"), diff -Nru wireshark-1.12.0~201310251247/plugins/stats_tree/pinfo_stats_tree.c wireshark-1.12.0~201311020920/plugins/stats_tree/pinfo_stats_tree.c --- wireshark-1.12.0~201310251247/plugins/stats_tree/pinfo_stats_tree.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/stats_tree/pinfo_stats_tree.c 2013-11-02 02:12:36.000000000 +0000 @@ -73,7 +73,7 @@ { uat_plen_record_t *rec = (uat_plen_record_t*)r; if (rec->packet_range->nranges < 1) { - *err = ep_strdup_printf("Invalid range string"); + *err = g_strdup("Invalid range string"); return; } diff -Nru wireshark-1.12.0~201310251247/plugins/wimaxmacphy/packet-wimaxmacphy.c wireshark-1.12.0~201311020920/plugins/wimaxmacphy/packet-wimaxmacphy.c --- wireshark-1.12.0~201310251247/plugins/wimaxmacphy/packet-wimaxmacphy.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/plugins/wimaxmacphy/packet-wimaxmacphy.c 2013-11-02 02:12:36.000000000 +0000 @@ -2425,7 +2425,7 @@ #if 0 col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, &wimaxmacphy_message_type_vals_ext, "Unknown")); #endif - col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(message_type, wimaxmacphy_message_type_vals, "Unknown")); + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(message_type, wimaxmacphy_message_type_vals, "Unknown")); offset += 1; switch(message_type) diff -Nru wireshark-1.12.0~201310251247/services wireshark-1.12.0~201311020920/services --- wireshark-1.12.0~201310251247/services 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/services 2013-11-02 02:12:36.000000000 +0000 @@ -9158,6 +9158,7 @@ dt-vra 6326/tcp # Double-Take Virtual Recovery Assistant [Vision_Solutions] [James_Wilkinson2] 2012-10-08 sflow 6343/tcp # sFlow traffic monitoring [Peter_Phaal] [Peter_Phaal] 2003-06 sflow 6343/udp # sFlow traffic monitoring [Peter_Phaal] [Peter_Phaal] 2003-06 +streletz 6344/tcp # Argus-Spectr security and fire-prevention systems service [Argus_Spectr] [Kirill_Marinushkin] 2013-10-25 gnutella-svc 6346/tcp # gnutella-svc [Serguei_Osokine] [Serguei_Osokine] gnutella-svc 6346/udp # gnutella-svc [Serguei_Osokine] [Serguei_Osokine] gnutella-rtr 6347/tcp # gnutella-rtr [Serguei_Osokine] [Serguei_Osokine] diff -Nru wireshark-1.12.0~201310251247/tools/checklicenses.py wireshark-1.12.0~201311020920/tools/checklicenses.py --- wireshark-1.12.0~201310251247/tools/checklicenses.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/checklicenses.py 2013-11-02 02:12:36.000000000 +0000 @@ -82,6 +82,7 @@ 'GPL (v3 or later) with Bison parser exception', 'GPL with Bison parser exception', 'ISC', + 'ISC GPL (v2)', 'ISC GPL (v2 or later)', 'LGPL', 'LGPL (v2)', @@ -165,6 +166,12 @@ 'cmake/TestFileOffsetBits.c': [ 'UNKNOWN', ], + 'epan/dissectors/pidl/idl_types.h': [ + # Special IDL license that appears to be compatible as far as I (not a + # lawyer) can tell. See + # https://www.wireshark.org/lists/wireshark-dev/201310/msg00234.html + 'UNKNOWN', + ], } diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/__init__.py wireshark-1.12.0~201311020920/tools/dftestlib/__init__.py --- wireshark-1.12.0~201310251247/tools/dftestlib/__init__.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/__init__.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # Copyright (C) 2013 by Gilbert Ramirez # diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/bytes_ether.py wireshark-1.12.0~201311020920/tools/dftestlib/bytes_ether.py --- wireshark-1.12.0~201310251247/tools/dftestlib/bytes_ether.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/bytes_ether.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/bytes_ipv6.py wireshark-1.12.0~201311020920/tools/dftestlib/bytes_ipv6.py --- wireshark-1.12.0~201310251247/tools/dftestlib/bytes_ipv6.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/bytes_ipv6.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/bytes_type.py wireshark-1.12.0~201311020920/tools/dftestlib/bytes_type.py --- wireshark-1.12.0~201310251247/tools/dftestlib/bytes_type.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/bytes_type.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/dftest.py wireshark-1.12.0~201311020920/tools/dftestlib/dftest.py --- wireshark-1.12.0~201310251247/tools/dftestlib/dftest.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/dftest.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/double.py wireshark-1.12.0~201311020920/tools/dftestlib/double.py --- wireshark-1.12.0~201310251247/tools/dftestlib/double.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/double.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/integer.py wireshark-1.12.0~201311020920/tools/dftestlib/integer.py --- wireshark-1.12.0~201310251247/tools/dftestlib/integer.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/integer.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/integer_1byte.py wireshark-1.12.0~201311020920/tools/dftestlib/integer_1byte.py --- wireshark-1.12.0~201310251247/tools/dftestlib/integer_1byte.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/integer_1byte.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/ipv4.py wireshark-1.12.0~201311020920/tools/dftestlib/ipv4.py --- wireshark-1.12.0~201310251247/tools/dftestlib/ipv4.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/ipv4.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/range_method.py wireshark-1.12.0~201311020920/tools/dftestlib/range_method.py --- wireshark-1.12.0~201310251247/tools/dftestlib/range_method.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/range_method.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/scanner.py wireshark-1.12.0~201311020920/tools/dftestlib/scanner.py --- wireshark-1.12.0~201310251247/tools/dftestlib/scanner.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/scanner.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/string_type.py wireshark-1.12.0~201311020920/tools/dftestlib/string_type.py --- wireshark-1.12.0~201310251247/tools/dftestlib/string_type.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/string_type.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/stringz.py wireshark-1.12.0~201311020920/tools/dftestlib/stringz.py --- wireshark-1.12.0~201310251247/tools/dftestlib/stringz.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/stringz.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/time_relative.py wireshark-1.12.0~201311020920/tools/dftestlib/time_relative.py --- wireshark-1.12.0~201310251247/tools/dftestlib/time_relative.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/time_relative.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/time_type.py wireshark-1.12.0~201311020920/tools/dftestlib/time_type.py --- wireshark-1.12.0~201310251247/tools/dftestlib/time_type.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/time_type.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/tvb.py wireshark-1.12.0~201311020920/tools/dftestlib/tvb.py --- wireshark-1.12.0~201310251247/tools/dftestlib/tvb.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/tvb.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/uint64.py wireshark-1.12.0~201311020920/tools/dftestlib/uint64.py --- wireshark-1.12.0~201310251247/tools/dftestlib/uint64.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/uint64.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/dftestlib/util.py wireshark-1.12.0~201311020920/tools/dftestlib/util.py --- wireshark-1.12.0~201310251247/tools/dftestlib/util.py 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/dftestlib/util.py 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # Copyright (c) 2013 by Gilbert Ramirez # -# $Id: dfilter-test.py 52136 2013-09-18 05:07:46Z gram $ +# $Id$ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff -Nru wireshark-1.12.0~201310251247/tools/lemon/CMakeLists.txt wireshark-1.12.0~201311020920/tools/lemon/CMakeLists.txt --- wireshark-1.12.0~201310251247/tools/lemon/CMakeLists.txt 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/lemon/CMakeLists.txt 2013-11-02 02:12:36.000000000 +0000 @@ -1,6 +1,6 @@ # CMakeLists.txt # -# $Id: CMakeLists.txt 30460 2009-10-10 05:35:21Z krj $ +# $Id$ # # Wireshark - Network traffic analyzer # By Gerald Combs diff -Nru wireshark-1.12.0~201310251247/tools/svnadd wireshark-1.12.0~201311020920/tools/svnadd --- wireshark-1.12.0~201310251247/tools/svnadd 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tools/svnadd 2013-11-02 02:12:36.000000000 +0000 @@ -57,7 +57,7 @@ *.ico) svn ps svn:mime-type image/x-icon $file ;; - *.xpm) + *.xpm|*.pod) svn ps svn:eol-style native $file ;; *.pcapng) @@ -79,16 +79,12 @@ svn ps svn:eol-style native $file svn ps svn:mime-type text/xml $file ;; - *.dtd) - svn ps svn:keywords Id $file - svn ps svn:eol-style native $file - ;; *.pl|*.bat|*.py|*.sh|*.cmd) svn ps svn:keywords Id $file - svn ps svn:executable '*' $file svn ps svn:eol-style native $file + svn ps svn:executable '*' $file ;; - *) + *) # includes *.dtd|*.c|*.h|*.cpp|*.m4|*.asn svn ps svn:keywords Id $file svn ps svn:eol-style native $file ;; diff -Nru wireshark-1.12.0~201310251247/tshark.c wireshark-1.12.0~201311020920/tshark.c --- wireshark-1.12.0~201310251247/tshark.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/tshark.c 2013-11-02 02:12:36.000000000 +0000 @@ -3542,21 +3542,6 @@ continue; switch (cf->cinfo.col_fmt[i]) { case COL_NUMBER: -#ifdef HAVE_LIBPCAP - /* - * Don't print this if we're doing a live capture from a network - * interface - if we're doing a live capture, you won't be - * able to look at the capture in the future (it's not being - * saved anywhere), so the frame numbers are unlikely to be - * useful. - * - * (XXX - it might be nice to be able to save and print at - * the same time, sort of like an "Update list of packets - * in real time" capture in Wireshark.) - */ - if (global_capture_opts.ifaces->len > 0) - continue; -#endif column_len = col_len = strlen(cf->cinfo.col_data[i]); if (column_len < 3) column_len = 3; diff -Nru wireshark-1.12.0~201310251247/ui/CMakeLists.txt wireshark-1.12.0~201311020920/ui/CMakeLists.txt --- wireshark-1.12.0~201310251247/ui/CMakeLists.txt 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/CMakeLists.txt 2013-11-02 02:12:36.000000000 +0000 @@ -39,6 +39,7 @@ software_update.c tap-megaco-common.c tap-rtp-common.c + tap-sctp-analysis.c tap-sequence-analysis.c tap-tcp-stream.c text_import.c diff -Nru wireshark-1.12.0~201310251247/ui/Makefile.common wireshark-1.12.0~201311020920/ui/Makefile.common --- wireshark-1.12.0~201310251247/ui/Makefile.common 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/Makefile.common 2013-11-02 02:12:36.000000000 +0000 @@ -60,6 +60,7 @@ ssl_key_export.c \ tap-megaco-common.c \ tap-rtp-common.c \ + tap-sctp-analysis.c \ tap-sequence-analysis.c \ tap-tcp-stream.c \ text_import.c \ @@ -89,6 +90,7 @@ ssl_key_export.h \ tap-megaco-common.h \ tap-rtp-common.h \ + tap-sctp-analysis.h \ tap-sequence-analysis.h \ tap-tcp-stream.h \ text_import.h \ diff -Nru wireshark-1.12.0~201310251247/ui/cli/tap-comparestat.c wireshark-1.12.0~201311020920/ui/cli/tap-comparestat.c --- wireshark-1.12.0~201310251247/ui/cli/tap-comparestat.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/cli/tap-comparestat.c 2013-11-02 02:12:36.000000000 +0000 @@ -131,7 +131,7 @@ cksum_vec[2].ptr=(const guint8 *)ci->ip_dst.data; cksum_vec[2].ptr=cksum_vec[2].ptr+ci->ip_dst.len; /* dynamic computation */ - cksum_vec[2].len=pinfo->iphdrlen-20; + cksum_vec[2].len=ci->ip_len-20; computed_cksum=in_cksum(&cksum_vec[0], 3); /* collect all packet infos */ diff -Nru wireshark-1.12.0~201310251247/ui/gtk/CMakeLists.txt wireshark-1.12.0~201311020920/ui/gtk/CMakeLists.txt --- wireshark-1.12.0~201310251247/ui/gtk/CMakeLists.txt 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/CMakeLists.txt 2013-11-02 02:12:36.000000000 +0000 @@ -110,7 +110,6 @@ sctp_byte_graph_dlg.c sctp_error_dlg.c sctp_graph_dlg.c - sctp_stat.c service_response_time_table.c simple_dialog.c stock_icons.c diff -Nru wireshark-1.12.0~201310251247/ui/gtk/Makefile.common wireshark-1.12.0~201311020920/ui/gtk/Makefile.common --- wireshark-1.12.0~201310251247/ui/gtk/Makefile.common 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/Makefile.common 2013-11-02 02:12:36.000000000 +0000 @@ -128,7 +128,6 @@ sctp_byte_graph_dlg.c \ sctp_error_dlg.c \ sctp_graph_dlg.c \ - sctp_stat.c \ service_response_time_table.c \ simple_dialog.c \ stock_icons.c \ @@ -335,7 +334,7 @@ rtp_player.h \ rtp_stream_dlg.h \ sat.h \ - sctp_stat.h \ + sctp_stat_gtk.h \ service_response_time_table.h \ time_shift_dlg.h \ stock_icons.h \ diff -Nru wireshark-1.12.0~201310251247/ui/gtk/compare_stat.c wireshark-1.12.0~201311020920/ui/gtk/compare_stat.c --- wireshark-1.12.0~201310251247/ui/gtk/compare_stat.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/compare_stat.c 2013-11-02 02:12:36.000000000 +0000 @@ -206,7 +206,7 @@ cksum_vec[2].ptr=(guint8 *)ci->ip_dst.data; cksum_vec[2].ptr=cksum_vec[2].ptr+ci->ip_dst.len; /* dynamic computation */ - cksum_vec[2].len=pinfo->iphdrlen-20; + cksum_vec[2].len=ci->ip_len-20; computed_cksum=in_cksum(&cksum_vec[0], 3); /* Set up the new order to create the zebra effect */ diff -Nru wireshark-1.12.0~201310251247/ui/gtk/graph_analysis.c wireshark-1.12.0~201311020920/ui/gtk/graph_analysis.c --- wireshark-1.12.0~201310251247/ui/gtk/graph_analysis.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/graph_analysis.c 2013-11-02 02:12:36.000000000 +0000 @@ -77,6 +77,9 @@ #define BOTTOM_Y_BORDER 2 #define COMMENT_WIDTH 400 #define TIME_WIDTH 150 +#if !PANGO_VERSION_CHECK(1,6,0) +#define MAX_FRAME_LABEL 20 +#endif /****************************************************************************/ /* Reset the user_data structure */ @@ -443,12 +446,6 @@ user_data->dlg.items[current_item].fd = gai->fd; user_data->dlg.items[current_item].port_src = gai->port_src; user_data->dlg.items[current_item].port_dst = gai->port_dst; - /* Add "..." if the length is 50 characters */ - if (strlen(gai->frame_label) > 48) { - gai->frame_label[48] = '.'; - gai->frame_label[47] = '.'; - gai->frame_label[46] = '.'; - } user_data->dlg.items[current_item].frame_label = gai->frame_label; user_data->dlg.items[current_item].time_str = gai->time_str; user_data->dlg.items[current_item].comment = gai->comment; @@ -783,9 +780,6 @@ draw_arrow(user_data->dlg.pixmap_main, color_p, end_arrow, top_y_border+current_item*ITEM_HEIGHT+ITEM_HEIGHT-7-(HEIGHT_ARROW/2), LEFT_ARROW); #endif /* draw the frame comment */ - g_snprintf(label_string, MAX_LABEL, "%s", user_data->dlg.items[current_item].frame_label); - pango_layout_set_text(layout, label_string, -1); - pango_layout_get_pixel_size(layout, &label_width, &label_height); if (start_arrowdlg.items[current_item].frame_label, -1); +#else + if (g_snprintf(label_string, MAX_FRAME_LABEL, "%s", user_data->dlg.items[current_item].frame_label) > MAX_FRAME_LABEL) { + memcpy(&label_string[MAX_FRAME_LABEL-4], "...", 3); + } + pango_layout_set_text(layout, label_string, -1); +#endif +g_warning("= layout width: %d: %s", pango_layout_get_width(layout), pango_layout_get_text(layout)); + pango_layout_get_pixel_size(layout, &label_width, &label_height); if ((int)left_x_border > ((int)label_x-(int)label_width/2)) label_x = left_x_border + label_width/2; @@ -815,6 +821,10 @@ cr = NULL; } #endif +#if PANGO_VERSION_CHECK(1,6,0) + pango_layout_set_width(layout, -1); +#endif + /* draw the source port number */ g_snprintf(label_string, MAX_LABEL, "(%i)", user_data->dlg.items[current_item].port_src); pango_layout_set_text(small_layout, label_string, -1); diff -Nru wireshark-1.12.0~201310251247/ui/gtk/graph_analysis.h wireshark-1.12.0~201311020920/ui/gtk/graph_analysis.h --- wireshark-1.12.0~201310251247/ui/gtk/graph_analysis.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/graph_analysis.h 2013-11-02 02:12:36.000000000 +0000 @@ -46,7 +46,7 @@ guint16 port_dst; gchar *frame_label; /**< the label on top of the arrow */ gchar *time_str; /**< timestamp */ - gchar *comment; /**< a comment that appears at the left of the graph */ + gchar *comment; /**< a comment that appears at the right of the graph */ guint16 conv_num; /**< the conversation number, each conversation will be colored */ guint16 src_node; /**< this is used by graph_analysis.c to identify the node */ guint16 dst_node; /**< a node is an IP address that will be displayed in columns */ diff -Nru wireshark-1.12.0~201310251247/ui/gtk/gui_utils.c wireshark-1.12.0~201311020920/ui/gtk/gui_utils.c --- wireshark-1.12.0~201310251247/ui/gtk/gui_utils.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/gui_utils.c 2013-11-02 02:12:36.000000000 +0000 @@ -548,13 +548,6 @@ gtk_main_iteration(); } -/* exit the main window */ -void -main_window_exit(void) -{ - exit(0); -} - #ifdef HAVE_LIBPCAP /* quit a nested main window */ @@ -572,8 +565,6 @@ gtk_main_quit(); } - - typedef struct pipe_input_tag { gint source; gpointer user_data; diff -Nru wireshark-1.12.0~201310251247/ui/gtk/main_menubar.c wireshark-1.12.0~201311020920/ui/gtk/main_menubar.c --- wireshark-1.12.0~201310251247/ui/gtk/main_menubar.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/main_menubar.c 2013-11-02 02:12:36.000000000 +0000 @@ -93,7 +93,8 @@ #include "ui/gtk/conversations_table.h" #include "ui/gtk/hostlist_table.h" #include "ui/gtk/packet_history.h" -#include "ui/gtk/sctp_stat.h" +#include "ui/tap-sctp-analysis.h" +#include "ui/gtk/sctp_stat_gtk.h" #include "ui/gtk/firewall_dlg.h" #include "ui/gtk/macros_dlg.h" #include "epan/dissectors/packet-ssl-utils.h" diff -Nru wireshark-1.12.0~201310251247/ui/gtk/rlc_lte_graph.c wireshark-1.12.0~201311020920/ui/gtk/rlc_lte_graph.c --- wireshark-1.12.0~201310251247/ui/gtk/rlc_lte_graph.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/rlc_lte_graph.c 2013-11-02 02:12:36.000000000 +0000 @@ -343,7 +343,8 @@ static void graph_read_config(struct graph *); static void rlc_lte_make_elmtlist(struct graph *); -#if defined(_WIN32) && !defined(__MINGW32__) +#if defined(_WIN32) && !defined(__MINGW32__) && (_MSC_VER < 1800) +/* Starting VS2013, rint already defined in math.h. No need to redefine */ static int rint(double ); /* compiler template for Windows */ #endif @@ -2991,8 +2992,8 @@ g->elists->next->elements = elements1; } - -#if defined(_WIN32) && !defined(__MINGW32__) +#if defined(_WIN32) && !defined(__MINGW32__) && (_MSC_VER < 1800) +/* Starting VS2013, rint already defined in math.h. N o need to redefine */ /* replacement of Unix rint() for Windows */ static int rint(double x) { @@ -3007,4 +3008,3 @@ return i; } #endif - diff -Nru wireshark-1.12.0~201310251247/ui/gtk/sctp_assoc_analyse.c wireshark-1.12.0~201311020920/ui/gtk/sctp_assoc_analyse.c --- wireshark-1.12.0~201310251247/ui/gtk/sctp_assoc_analyse.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/sctp_assoc_analyse.c 2013-11-02 02:12:36.000000000 +0000 @@ -38,7 +38,8 @@ #include "ui/gtk/dlg_utils.h" #include "ui/gtk/gui_utils.h" #include "ui/gtk/main.h" -#include "ui/gtk/sctp_stat.h" +#include "ui/tap-sctp-analysis.h" +#include "ui/gtk/sctp_stat_gtk.h" #include "ui/gtk/gtkglobals.h" #include "frame_tvbuff.h" @@ -1047,7 +1048,6 @@ register_tap_listener_sctp_stat(); /* (redissect all packets) */ - sctp_stat_scan(); u_data = (struct sctp_analyse *)g_malloc(sizeof(struct sctp_analyse)); u_data->assoc = NULL; u_data->children = NULL; @@ -1069,7 +1069,6 @@ register_tap_listener_sctp_stat(); /* (redissect all packets) */ - sctp_stat_scan(); u_data = (struct sctp_analyse *)g_malloc(sizeof(struct sctp_analyse)); u_data->assoc = NULL; @@ -1083,8 +1082,3 @@ } -void -register_tap_listener_sctp_analyse(void) -{ -} - diff -Nru wireshark-1.12.0~201310251247/ui/gtk/sctp_byte_graph_dlg.c wireshark-1.12.0~201311020920/ui/gtk/sctp_byte_graph_dlg.c --- wireshark-1.12.0~201310251247/ui/gtk/sctp_byte_graph_dlg.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/sctp_byte_graph_dlg.c 2013-11-02 02:12:36.000000000 +0000 @@ -39,7 +39,8 @@ #include "ui/gtk/dlg_utils.h" #include "ui/gtk/gui_utils.h" #include "ui/gtk/main.h" -#include "ui/gtk/sctp_stat.h" +#include "ui/tap-sctp-analysis.h" +#include "ui/gtk/sctp_stat_gtk.h" #include "ui/gtk/old-gtk-compat.h" diff -Nru wireshark-1.12.0~201310251247/ui/gtk/sctp_chunk_stat.c wireshark-1.12.0~201311020920/ui/gtk/sctp_chunk_stat.c --- wireshark-1.12.0~201310251247/ui/gtk/sctp_chunk_stat.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/sctp_chunk_stat.c 2013-11-02 02:12:36.000000000 +0000 @@ -47,7 +47,8 @@ #include "ui/gtk/tap_param_dlg.h" #include "ui/gtk/gui_utils.h" #include "ui/gtk/main.h" -#include "ui/gtk/sctp_stat.h" +#include "ui/tap-sctp-analysis.h" +#include "ui/gtk/sctp_stat_gtk.h" static void sctpstat_init(const char *opt_arg, void *userdata); diff -Nru wireshark-1.12.0~201310251247/ui/gtk/sctp_chunk_stat_dlg.c wireshark-1.12.0~201311020920/ui/gtk/sctp_chunk_stat_dlg.c --- wireshark-1.12.0~201310251247/ui/gtk/sctp_chunk_stat_dlg.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/sctp_chunk_stat_dlg.c 2013-11-02 02:12:36.000000000 +0000 @@ -35,7 +35,8 @@ #include "ui/gtk/dlg_utils.h" #include "ui/gtk/gui_utils.h" #include "ui/gtk/main.h" -#include "ui/gtk/sctp_stat.h" +#include "ui/tap-sctp-analysis.h" +#include "ui/gtk/sctp_stat_gtk.h" static GtkWidget *clist = NULL; static GList *last_list = NULL; diff -Nru wireshark-1.12.0~201310251247/ui/gtk/sctp_error_dlg.c wireshark-1.12.0~201311020920/ui/gtk/sctp_error_dlg.c --- wireshark-1.12.0~201310251247/ui/gtk/sctp_error_dlg.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/sctp_error_dlg.c 2013-11-02 02:12:36.000000000 +0000 @@ -34,7 +34,8 @@ #include "ui/gtk/dlg_utils.h" #include "ui/gtk/gui_utils.h" #include "ui/gtk/main.h" -#include "ui/gtk/sctp_stat.h" +#include "ui/tap-sctp-analysis.h" +#include "ui/gtk/sctp_stat_gtk.h" #include "ui/gtk/gui_utils.h" static GtkWidget *sctp_error_dlg=NULL; diff -Nru wireshark-1.12.0~201310251247/ui/gtk/sctp_graph_dlg.c wireshark-1.12.0~201311020920/ui/gtk/sctp_graph_dlg.c --- wireshark-1.12.0~201310251247/ui/gtk/sctp_graph_dlg.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/sctp_graph_dlg.c 2013-11-02 02:12:36.000000000 +0000 @@ -39,7 +39,8 @@ #include "ui/gtk/dlg_utils.h" #include "ui/gtk/main.h" -#include "ui/gtk/sctp_stat.h" +#include "ui/tap-sctp-analysis.h" +#include "ui/gtk/sctp_stat_gtk.h" #include "ui/gtk/gui_utils.h" #include "ui/gtk/old-gtk-compat.h" @@ -133,7 +134,8 @@ static void sctp_graph_set_title(struct sctp_udata *u_data); static void create_draw_area(GtkWidget *box, struct sctp_udata *u_data); static GtkWidget *zoomout_bt; -#if defined(_WIN32) && !defined(__MINGW32__) +#if defined(_WIN32) && !defined(__MINGW32__) && (_MSC_VER < 1800) +/* Starting VS2013, rint already defined in math.h. No need to redefine */ static int rint (double ); /* compiler template for Windows */ #endif @@ -1857,7 +1859,8 @@ } } -#if defined(_WIN32) && !defined(__MINGW32__) +#if defined(_WIN32) && !defined(__MINGW32__) && (_MSC_VER < 1800) +/* Starting VS2013, rint already defined in math.h. No need to redefine */ /* replacement of Unix rint() for Windows */ static int rint (double x) diff -Nru wireshark-1.12.0~201310251247/ui/gtk/sctp_stat.c wireshark-1.12.0~201311020920/ui/gtk/sctp_stat.c --- wireshark-1.12.0~201310251247/ui/gtk/sctp_stat.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/sctp_stat.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1411 +0,0 @@ -/* - * Copyright 2004, Irene Ruengeler - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" -#include -#include -#include - -#include - -#include "epan/packet_info.h" -#include -#include "epan/address.h" -#include - -#include "ui/simple_dialog.h" - -#include "ui/gtk/dlg_utils.h" -#include "ui/gtk/sctp_stat.h" -#include "ui/gtk/main.h" - -#define SCTP_ABORT_CHUNK_T_BIT 0x01 - -#define PARAMETER_TYPE_LENGTH 2 -#define PARAMETER_LENGTH_LENGTH 2 -#define PARAMETER_HEADER_LENGTH (PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_LENGTH) - -#define PARAMETER_HEADER_OFFSET 0 -#define PARAMETER_TYPE_OFFSET PARAMETER_HEADER_OFFSET -#define PARAMETER_LENGTH_OFFSET (PARAMETER_TYPE_OFFSET + PARAMETER_TYPE_LENGTH) -#define PARAMETER_VALUE_OFFSET (PARAMETER_LENGTH_OFFSET + PARAMETER_LENGTH_LENGTH) - -#define IPV6_ADDRESS_LENGTH 16 -#define IPV6_ADDRESS_OFFSET PARAMETER_VALUE_OFFSET -#define IPV4_ADDRESS_LENGTH 4 -#define IPV4_ADDRESS_OFFSET PARAMETER_VALUE_OFFSET -#define IPV4ADDRESS_PARAMETER_ID 0x0005 -#define IPV6ADDRESS_PARAMETER_ID 0x0006 - -#define SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH 4 -#define SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET (CHUNK_VALUE_OFFSET + 0) -#define SACK_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH 4 -#define SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET (SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET + \ - SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH) - -#define INIT_CHUNK_INITIAL_TSN_LENGTH 4 -#define INIT_CHUNK_FIXED_PARAMTERS_LENGTH (INIT_CHUNK_INITIATE_TAG_LENGTH + \ - INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH + \ - INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH + \ - INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH + \ - INIT_CHUNK_INITIAL_TSN_LENGTH) -#define CHUNK_HEADER_LENGTH (CHUNK_TYPE_LENGTH + \ - CHUNK_FLAGS_LENGTH + \ - CHUNK_LENGTH_LENGTH) -#define INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET (INIT_CHUNK_INITIAL_TSN_OFFSET + \ - INIT_CHUNK_INITIAL_TSN_LENGTH ) - -static const value_string chunk_type_values[] = { - { SCTP_DATA_CHUNK_ID, "DATA" }, - { SCTP_INIT_CHUNK_ID, "INIT" }, - { SCTP_INIT_ACK_CHUNK_ID, "INIT_ACK" }, - { SCTP_SACK_CHUNK_ID, "SACK" }, - { SCTP_HEARTBEAT_CHUNK_ID, "HEARTBEAT" }, - { SCTP_HEARTBEAT_ACK_CHUNK_ID, "HEARTBEAT_ACK" }, - { SCTP_ABORT_CHUNK_ID, "ABORT" }, - { SCTP_SHUTDOWN_CHUNK_ID, "SHUTDOWN" }, - { SCTP_SHUTDOWN_ACK_CHUNK_ID, "SHUTDOWN_ACK" }, - { SCTP_ERROR_CHUNK_ID, "ERROR" }, - { SCTP_COOKIE_ECHO_CHUNK_ID, "COOKIE_ECHO" }, - { SCTP_COOKIE_ACK_CHUNK_ID, "COOKIE_ACK" }, - { SCTP_ECNE_CHUNK_ID, "ECNE" }, - { SCTP_CWR_CHUNK_ID, "CWR" }, - { SCTP_SHUTDOWN_COMPLETE_CHUNK_ID, "SHUTDOWN_COMPLETE" }, - { SCTP_FORWARD_TSN_CHUNK_ID, "FORWARD TSN" }, - { SCTP_ASCONF_ACK_CHUNK_ID, "ASCONF_ACK" }, - { SCTP_PKTDROP_CHUNK_ID, "PKTDROP" }, - { SCTP_ASCONF_CHUNK_ID, "ASCONF" }, - { SCTP_IETF_EXT, "IETF_EXTENSION" }, - { SCTP_NR_SACK_CHUNK_ID, "NR_SACK" }, - { SCTP_AUTH_CHUNK_ID, "AUTH" }, - { 0, NULL } }; - - -#define FORWARD_STREAM 0 -#define BACKWARD_STREAM 1 -#define FORWARD_ADD_FORWARD_VTAG 2 -#define BACKWARD_ADD_FORWARD_VTAG 3 -#define BACKWARD_ADD_BACKWARD_VTAG 4 -#define ADDRESS_FORWARD_STREAM 5 -#define ADDRESS_BACKWARD_STREAM 6 -#define ADDRESS_FORWARD_ADD_FORWARD_VTAG 7 -#define ADDRESS_BACKWARD_ADD_FORWARD_VTAG 8 -#define ADDRESS_BACKWARD_ADD_BACKWARD_VTAG 9 -#define ASSOC_NOT_FOUND 10 - -static sctp_allassocs_info_t sctp_tapinfo_struct = {0, NULL, FALSE, NULL}; - -static -void free_first(gpointer data, gpointer user_data _U_) -{ - g_free(data); -} - -static void tsn_free(gpointer data, gpointer user_data _U_) -{ - tsn_t *tsn; - - tsn = (tsn_t *) data; - if (tsn->tsns != NULL) - { - g_list_foreach(tsn->tsns, free_first, NULL); - g_list_free(tsn->tsns); - tsn->tsns=NULL; - } -} - - -static void reset(void *arg) -{ - sctp_allassocs_info_t *tapdata = (sctp_allassocs_info_t *)arg; - GList* list; - sctp_assoc_info_t * info; - - list = g_list_first(tapdata->assoc_info_list); - while (list) - { - info = (sctp_assoc_info_t *) (list->data); - - if (info->addr1 != NULL) - { - g_list_foreach(info->addr1, free_first, NULL); - g_list_free(info->addr1); - info->addr1 = NULL; - } - - if (info->addr2 != NULL) - { - g_list_foreach(info->addr2,free_first, NULL); - g_list_free(info->addr2); - info->addr2 = NULL; - } - - if (info->error_info_list != NULL) - { - g_list_foreach(info->error_info_list, free_first, NULL); - g_list_free(info->error_info_list); - info->error_info_list = NULL; - } - - if (info->frame_numbers != NULL) - { - g_list_free(info->frame_numbers); - info->frame_numbers = NULL; - } - - if (info->tsn1 != NULL) - { - g_list_foreach(info->tsn1, tsn_free, NULL); - g_list_free(info->tsn1); - info->tsn1 = NULL; - } - - if (info->tsn2 != NULL) - { - g_list_foreach(info->tsn2, tsn_free, NULL); - g_list_free(info->tsn2); - info->tsn2 = NULL; - } - - if (info->sack1 != NULL) - { - g_list_foreach(info->sack1, tsn_free, NULL); - g_list_free(info->sack1); - info->sack1 = NULL; - } - - if (info->sack2 != NULL) - { - g_list_foreach(info->sack2, tsn_free, NULL); - g_list_free(info->sack2); - info->sack2 = NULL; - } - - if (info->sort_tsn1 != NULL) - g_ptr_array_free(info->sort_tsn1, TRUE); - - if (info->sort_tsn2 != NULL) - g_ptr_array_free(info->sort_tsn2, TRUE); - - if (info->sort_sack1 != NULL) - g_ptr_array_free(info->sort_sack1, TRUE); - - if (info->sort_sack2 != NULL) - g_ptr_array_free(info->sort_sack2, TRUE); - - if (info->min_max != NULL) - { - g_slist_foreach(info->min_max, free_first, NULL); - info->min_max = NULL; - } - - g_free(list->data); - list = g_list_next(list); - } - g_list_free(tapdata->assoc_info_list); - tapdata->sum_tvbs = 0; - tapdata->assoc_info_list = NULL; -} - - -static sctp_assoc_info_t *calc_checksum(struct _sctp_info *check_data, sctp_assoc_info_t *data) -{ - gboolean ok = FALSE; - - if (check_data->adler32_calculated) - { - data->n_adler32_calculated++; - if (check_data->adler32_correct) - data->n_adler32_correct++; - } - if (check_data->crc32c_calculated) - { - data->n_crc32c_calculated++; - if (check_data->crc32c_correct) - data->n_crc32c_correct++; - } - if (data->n_adler32_calculated > 0) - { - if ((float)(data->n_adler32_correct*1.0/data->n_adler32_calculated) > 0.5) - { - g_strlcpy(data->checksum_type,"ADLER32",8); - data->n_checksum_errors=(data->n_adler32_calculated-data->n_adler32_correct); - ok = TRUE; - } - } - - if (data->n_crc32c_calculated>0) - { - if ((float)(data->n_crc32c_correct*1.0/data->n_crc32c_calculated) > 0.5) - { - g_strlcpy(data->checksum_type,"CRC32C",8); - data->n_checksum_errors=data->n_crc32c_calculated-data->n_crc32c_correct; - ok = TRUE; - } - } - - if (!ok) - { - g_strlcpy(data->checksum_type,"UNKNOWN",8); - data->n_checksum_errors=0; - } - - return(data); - -} - - -/* XXX: Some versions of gcc warn about "breaking strict aliasing rules" - for 'a' in the following (given the way this function is called). - As a workaround we'll define the function parameters to match - how this function is actually called. */ -/******* -static gint sctp_assoc_vtag_cmp(gconstpointer aa, gconstpointer bb) -{ - const struct _sctp_assoc_info* a = aa; - const struct _sctp_assoc_info* b = bb; - if (a == b) - return(FORWARD_STREAM); -********/ - -static gint sctp_assoc_vtag_cmp(const sctp_tmp_info_t *a, const sctp_assoc_info_t *b) -{ - - if (a == NULL || b == NULL) - return(ASSOC_NOT_FOUND); - - if ((a->port1 == b->port1) && - (a->port2 == b->port2) && - (a->verification_tag1 == b->verification_tag1) && a->verification_tag1==0 && a->initiate_tag != 0 && - (a->initiate_tag != b->initiate_tag )) - return(ASSOC_NOT_FOUND); /* two INITs that belong to different assocs */ - - /* assoc known*/ - if ((a->port1 == b->port1) && - (a->port2 == b->port2) && - (a->verification_tag1 == b->verification_tag1) && - ((a->verification_tag1 != 0 || - (b->verification_tag2 != 0)))) - return(FORWARD_STREAM); - - /* ABORT, vtag reflected */ - if ((a->port1 == b->port1) && - (a->port2 == b->port2) && - (a->verification_tag2 == b->verification_tag2) && - (a->verification_tag1 == 0 && b->verification_tag1 != 0)) - return(FORWARD_STREAM); - - if ((a->port1 == b->port2) && - (a->port2 == b->port1) && - (a->verification_tag1 == b->verification_tag2) && - (a->verification_tag1 != 0)) - return(BACKWARD_STREAM); - - if ((a->port1 == b->port2) && - (a->port2 == b->port1) && - (a->verification_tag2 == b->verification_tag1) && - (a->verification_tag2 != 0)) - return(BACKWARD_STREAM); - - /* ABORT, vtag reflected */ - if ((a->port1 == b->port2) && - (a->port2 == b->port1) && - (a->verification_tag2 == b->verification_tag1) && - (a->verification_tag1 == 0 && b->verification_tag2 != 0)) - return(BACKWARD_STREAM); - - /*forward stream verifivation tag can be added*/ - if ((a->port1 == b->port1) && - (a->port2 == b->port2) && - (a->verification_tag1 != 0) && - (b->verification_tag1 == 0) && - (b->verification_tag2 !=0)) - return (FORWARD_ADD_FORWARD_VTAG); - - if ((a->port1 == b->port2) && - (a->port2 == b->port1) && - (a->verification_tag1 == b->verification_tag2) && - (b->verification_tag1 == 0)) - return (BACKWARD_ADD_FORWARD_VTAG); - - /*backward stream verification tag can be added */ - if ((a->port1 == b->port2) && - (a->port2 == b->port1) && - (a->verification_tag1 !=0) && - (b->verification_tag1 != 0) && - (b->verification_tag2 == 0)) - return(BACKWARD_ADD_BACKWARD_VTAG); - - return(ASSOC_NOT_FOUND); -} - -static sctp_assoc_info_t * find_assoc(sctp_tmp_info_t * needle) -{ - sctp_allassocs_info_t *assoc_info; - sctp_assoc_info_t *info = NULL; - GList* list; - guint8 cmp; - - assoc_info = &sctp_tapinfo_struct; - if ((list = g_list_last(assoc_info->assoc_info_list))!=NULL) - { - while (list) - { - cmp=sctp_assoc_vtag_cmp(needle, (sctp_assoc_info_t*)(list->data)); - - /*if (cmp==ASSOC_NOT_FOUND) - { - cmp=sctp_assoc_address_cmp(needle, (sctp_assoc_info_t*)(list->data)); - }*/ - switch (cmp) - { - case FORWARD_STREAM: - info = (sctp_assoc_info_t*)(list->data); - info->direction = 1; - return info; - case BACKWARD_STREAM: - info = (sctp_assoc_info_t*)(list->data); - info->direction = 2; - return info; - case FORWARD_ADD_FORWARD_VTAG: - info = (sctp_assoc_info_t*)(list->data); - info->verification_tag1=needle->verification_tag1; - info->direction = 1; - return info; - case BACKWARD_ADD_FORWARD_VTAG: - info = (sctp_assoc_info_t*)(list->data); - info->verification_tag1=needle->verification_tag1; - info->direction = 2; - return info; - case BACKWARD_ADD_BACKWARD_VTAG: - info = (sctp_assoc_info_t*)(list->data); - info->verification_tag2=needle->verification_tag1; - info->direction = 2; - return info; - case ADDRESS_FORWARD_STREAM: - info = (sctp_assoc_info_t*)(list->data); - info->direction = 1; - info->check_address=TRUE; - return info; - case ADDRESS_BACKWARD_STREAM: - info = (sctp_assoc_info_t*)(list->data); - info->direction = 2; - info->check_address=TRUE; - return info; - case ADDRESS_FORWARD_ADD_FORWARD_VTAG: - info = (sctp_assoc_info_t*)(list->data); - info->verification_tag1=needle->verification_tag1; - info->direction = 1; - info->check_address=TRUE; - return info; - case ADDRESS_BACKWARD_ADD_FORWARD_VTAG: - info = (sctp_assoc_info_t*)(list->data); - info->verification_tag1=needle->verification_tag1; - info->direction = 2; - info->check_address=TRUE; - return info; - case ADDRESS_BACKWARD_ADD_BACKWARD_VTAG: - info = (sctp_assoc_info_t*)(list->data); - info->verification_tag2=needle->verification_tag1; - info->direction = 2; - info->check_address=TRUE; - return info; - } - - list = g_list_previous(list); - } - } - return NULL; -} - -static sctp_assoc_info_t * add_chunk_count(address * vadd, sctp_assoc_info_t * info, guint32 direction, guint32 type) -{ - GList *list; - address *v=NULL; - sctp_addr_chunk *ch=NULL; - guint8 * dat; - int i; - - list = g_list_first(info->addr_chunk_count); - - while (list) - { - ch = (sctp_addr_chunk *)(list->data); - if (ch->direction == direction) - { - v = (address *) (ch->addr); - if (ADDRESSES_EQUAL(vadd, v)) - { - if (IS_SCTP_CHUNK_TYPE(type)) - ch->addr_count[type]++; - else - ch->addr_count[OTHER_CHUNKS_INDEX]++; - return info; - } - else - { - list = g_list_next(list); - } - } - else - list = g_list_next(list); - } - ch = (sctp_addr_chunk *)g_malloc(sizeof(sctp_addr_chunk)); - ch->direction = direction; - ch->addr = (address *)g_malloc(sizeof(address)); - ch->addr->type = vadd->type; - ch->addr->len = vadd->len; - dat = (guint8 *)g_malloc(vadd->len); - memcpy(dat, vadd->data, vadd->len); - ch->addr->data = dat; - for (i=0; i < NUM_CHUNKS; i++) - ch->addr_count[i] = 0; - - if (IS_SCTP_CHUNK_TYPE(type)) - ch->addr_count[type]++; - else - ch->addr_count[OTHER_CHUNKS_INDEX]++; - - info->addr_chunk_count = g_list_append(info->addr_chunk_count, ch); - return info; -} - -static sctp_assoc_info_t * add_address(address * vadd, sctp_assoc_info_t *info, guint8 direction) -{ - GList *list; - address *v=NULL; - - if (direction == 1) - list = g_list_first(info->addr1); - else - list = g_list_first(info->addr2); - - while (list) - { - v = (address *) (list->data); - if (ADDRESSES_EQUAL(vadd, v)) { - g_free(vadd); - return info; - } - list = g_list_next(list); - } - - if (direction == 1) - info->addr1 = g_list_append(info->addr1, vadd); - else if (direction==2) - info->addr2 = g_list_append(info->addr2, vadd); - - return info; -} - -static int -packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const void *data) -{ - struct _sctp_info *sctp_info; - guint32 chunk_number = 0, tsnumber,framenumber; - sctp_tmp_info_t tmp_info; - sctp_assoc_info_t *info = NULL; - sctp_error_info_t *error = NULL; - guint16 type, length = 0; - address *store = NULL; - tsn_t *tsn = NULL; - tsn_t *sack = NULL; - guint8 *t_s_n = NULL; - gboolean sackchunk = FALSE; - gboolean datachunk = FALSE; - gboolean forwardchunk = FALSE; - struct tsn_sort *tsn_s; - guint8* addr = NULL; - int i; - guint8 idx = 0; - - sctp_info = (struct _sctp_info *) data; - - framenumber=pinfo->fd->num; - - type = sctp_info->ip_src.type; - - if (type == AT_IPv4) - { - tmp_info.src.type = AT_IPv4; - tmp_info.src.len = 4; - } - else if (type == AT_IPv6) - { - tmp_info.src.type = AT_IPv6; - tmp_info.src.len = 16; - } - else - { - tmp_info.src.type = AT_NONE; - tmp_info.src.len = 0; - } - - addr = (guint8 *)g_malloc(tmp_info.src.len); - memcpy(addr, sctp_info->ip_src.data, tmp_info.src.len); - tmp_info.src.data = addr; - - type = sctp_info->ip_dst.type; - - if (type == AT_IPv4) - { - tmp_info.dst.type = AT_IPv4; - tmp_info.dst.len = 4; - } - else if (type == AT_IPv6) - { - tmp_info.dst.type = AT_IPv6; - tmp_info.dst.len = 16; - } - else - { - tmp_info.dst.type = AT_NONE; - tmp_info.dst.len = 0; - } - - addr = (guint8 *)g_malloc(tmp_info.dst.len); - memcpy(addr, sctp_info->ip_dst.data, tmp_info.dst.len); - tmp_info.dst.data = addr; - - tmp_info.port1 = sctp_info->sport; - tmp_info.port2 = sctp_info->dport; - - if (sctp_info->vtag_reflected) - { - tmp_info.verification_tag2 = sctp_info->verification_tag; - tmp_info.verification_tag1 = 0; - } - else - { - tmp_info.verification_tag1 = sctp_info->verification_tag; - tmp_info.verification_tag2 = 0; - } - tmp_info.n_tvbs = 0; - if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) - { - tmp_info.initiate_tag = tvb_get_ntohl(sctp_info->tvb[0], 4); - } - else - { - tmp_info.initiate_tag = 0; - } - - info = find_assoc(&tmp_info); - if (!info) - { - tmp_info.n_tvbs = sctp_info->number_of_tvbs; - sctp_tapinfo_struct.sum_tvbs+=sctp_info->number_of_tvbs; - - if (sctp_info->number_of_tvbs > 0) - { - info = (sctp_assoc_info_t *)g_malloc(sizeof(sctp_assoc_info_t)); - memset(info, 0, sizeof(sctp_assoc_info_t)); - info->src.type = tmp_info.src.type; - info->src.len = tmp_info.src.len; - addr = (guint8 *)g_malloc(tmp_info.dst.len); - memcpy(addr,(tmp_info.src.data), tmp_info.src.len); - info->src.data = addr; - info->dst.type = tmp_info.dst.type; - info->dst.len = tmp_info.dst.len; - addr = (guint8 *)g_malloc(tmp_info.dst.len); - memcpy(addr, (tmp_info.dst.data), tmp_info.dst.len); - info->dst.data = addr; - info->port1 = tmp_info.port1; - info->port2 = tmp_info.port2; - info->verification_tag1 = tmp_info.verification_tag1; - info->verification_tag2 = tmp_info.verification_tag2; - info->initiate_tag = tmp_info.initiate_tag; - info->n_tvbs = tmp_info.n_tvbs; - info->init = FALSE; - info->initack = FALSE; - info->check_address = FALSE; - info->direction = 0; - info = calc_checksum(sctp_info, info); - info->n_packets = 1; - info->error_info_list = NULL; - info->min_secs = 0xffffffff; - info->min_usecs = 0xffffffff; - info->max_secs = 0; - info->max_usecs = 0; - info->min_tsn2 = 0xFFFFFFFF; - info->min_tsn1 = 0xffffffff; - info->max_tsn1 = 0; - info->max_tsn2 = 0; - info->max_bytes1 = 0; - info->max_bytes2 = 0; - info->n_data_chunks = 0; - info->n_data_bytes = 0; - info->n_data_chunks_ep1 = 0; - info->n_data_bytes_ep1 = 0; - info->n_data_chunks_ep2 = 0; - info->n_data_bytes_ep2 = 0; - info->n_sack_chunks_ep1 = 0; - info->n_sack_chunks_ep2 = 0; - info->n_array_tsn1 = 0; - info->n_array_tsn2 = 0; - info->n_forward_chunks = 0; - info->max_window1 = 0; - info->max_window2 = 0; - info->min_max = NULL; - info->sort_tsn1 = g_ptr_array_new(); - info->sort_tsn2 = g_ptr_array_new(); - info->sort_sack1 = g_ptr_array_new(); - info->sort_sack2 = g_ptr_array_new(); - for (i=0; i < NUM_CHUNKS; i++) - { - info->chunk_count[i] = 0; - info->ep1_chunk_count[i] = 0; - info->ep2_chunk_count[i] = 0; - } - info->addr_chunk_count = NULL; - - if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) - { - tsn = (tsn_t *)g_malloc(sizeof(tsn_t)); - sack = (tsn_t *)g_malloc(sizeof(tsn_t)); - tsn->tsns = NULL; - tsn->first_tsn = 0; - sack->tsns = NULL; - sack->first_tsn = 0; - sack->src.type=tsn->src.type = tmp_info.src.type; - sack->src.len=tsn->src.len = tmp_info.src.len; - addr = (guint8 *)g_malloc(tmp_info.src.len); - memcpy(addr, tmp_info.src.data, tmp_info.src.len); - tsn->src.data = addr; - addr = (guint8 *)g_malloc(tmp_info.src.len); - memcpy(addr, tmp_info.src.data, tmp_info.src.len); - sack->src.data = addr; - sack->dst.type = tsn->dst.type = tmp_info.dst.type; - sack->dst.len =tsn->dst.len = tmp_info.dst.len; - addr = (guint8 *)g_malloc(tmp_info.dst.len); - memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); - tsn->dst.data = addr; - addr = (guint8 *)g_malloc(tmp_info.dst.len); - memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); - sack->dst.data = addr; - sack->secs=tsn->secs = (guint32)pinfo->rel_ts.secs; - sack->usecs=tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; - if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) - { - if (tsn->secs < info->min_secs) - { - info->min_secs = tsn->secs; - info->min_usecs = tsn->usecs; - } - else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) - info->min_usecs = tsn->usecs; - - if (tsn->secs > info->max_secs) - { - info->max_secs = tsn->secs; - info->max_usecs = tsn->usecs; - } - else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) - info->max_usecs = tsn->usecs; - } - - sack->frame_number = tsn->frame_number = pinfo->fd->num; - } - if ((tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) || (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID)) - { - info->min_tsn1 = tvb_get_ntohl(sctp_info->tvb[0],INIT_CHUNK_INITIAL_TSN_OFFSET); - info->verification_tag2 = tvb_get_ntohl(sctp_info->tvb[0], INIT_CHUNK_INITIATE_TAG_OFFSET); - info->instream1 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET); - info->outstream1 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET); - for (chunk_number = 1; chunk_number < sctp_info->number_of_tvbs; chunk_number++) - { - type = tvb_get_ntohs(sctp_info->tvb[chunk_number],0); - if (type == IPV4ADDRESS_PARAMETER_ID) - { - store = (address *)g_malloc(sizeof (address)); - store->type = AT_IPv4; - store->len = 4; - store->data = g_malloc(4); - tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV4_ADDRESS_OFFSET, 4); - info = add_address(store, info, 1); - } - else if (type == IPV6ADDRESS_PARAMETER_ID) - { - store = (address *)g_malloc(sizeof (address)); - store->type = AT_IPv6; - store->len = 16; - store->data = g_malloc(16); - tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV6_ADDRESS_OFFSET, IPV6_ADDRESS_LENGTH); - info = add_address(store, info, 1); - } - } - - if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) - { - info->init = TRUE; - } - else - { - info->initack_dir = 1; - info->initack = TRUE; - } - - idx = tvb_get_guint8(sctp_info->tvb[0],0); - if (!IS_SCTP_CHUNK_TYPE(idx)) - idx = OTHER_CHUNKS_INDEX; - - info->chunk_count[idx]++; - info->ep1_chunk_count[idx]++; - info = add_chunk_count(&tmp_info.src, info, 1, idx); - } - else - { - if (((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_ACK_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_DATA_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_SACK_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_NR_SACK_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_FORWARD_TSN_CHUNK_ID)) - { - tsn = (tsn_t *)g_malloc(sizeof(tsn_t)); - sack = (tsn_t *)g_malloc(sizeof(tsn_t)); - tsn->tsns = NULL; - sack->tsns = NULL; - tsn->first_tsn = 0; - sack->first_tsn = 0; - } - for (chunk_number = 0; chunk_number < sctp_info->number_of_tvbs; chunk_number++) - { - idx = tvb_get_guint8(sctp_info->tvb[0],0); - if (!IS_SCTP_CHUNK_TYPE(idx)) - idx = OTHER_CHUNKS_INDEX; - - info->chunk_count[idx]++; - info->ep1_chunk_count[idx]++; - info = add_chunk_count(&tmp_info.src, info, 1, idx); - - if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID)) - { - datachunk = TRUE; - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; - info->n_data_chunks++; - info->n_data_bytes+=length; - info->outstream1 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; - } - if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_FORWARD_TSN_CHUNK_ID)) - { - forwardchunk = TRUE; - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET); - info->n_forward_chunks++; - } - if (datachunk || forwardchunk) - { - - tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], DATA_CHUNK_TSN_OFFSET); - if (tsnumber < info->min_tsn1) - info->min_tsn1 = tsnumber; - if (tsnumber > info->max_tsn1) - { - if (datachunk) - { - info->n_data_chunks_ep1++; - info->n_data_bytes_ep1+=length; - } - else - info->n_forward_chunks_ep1++; - info->max_tsn1 = tsnumber; - } - if (tsn->first_tsn == 0) - tsn->first_tsn = tsnumber; - if (datachunk) - { - t_s_n = (guint8 *)g_malloc(16); - tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, 16); - } - else - { - t_s_n = (guint8 *)g_malloc(length); - tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length); - } - tsn->tsns = g_list_append(tsn->tsns, t_s_n); - tsn_s = (struct tsn_sort *)g_malloc(sizeof(struct tsn_sort)); - tsn_s->tsnumber = tsnumber; - tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs; - tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; - tsn_s->offset = 0; - tsn_s->framenumber = framenumber; - if (datachunk) - tsn_s->length = length-DATA_CHUNK_HEADER_LENGTH; - else - tsn_s->length = length; - if (tsn->secs < info->min_secs) - { - info->min_secs = tsn->secs; - info->min_usecs = tsn->usecs; - } - else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) - info->min_usecs = tsn->usecs; - - if (tsn->secs > info->max_secs) - { - info->max_secs = tsn->secs; - info->max_usecs = tsn->usecs; - } - else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) - info->max_usecs = tsn->usecs; - g_ptr_array_add(info->sort_tsn1, tsn_s); - info->n_array_tsn1++; - } - if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_SACK_CHUNK_ID) || - (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_NR_SACK_CHUNK_ID) ) - { - tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET); - if (tsnumber < info->min_tsn2) - info->min_tsn2 = tsnumber; - if (tsnumber > info->max_tsn2) - info->max_tsn2 = tsnumber; - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET); - if (sack->first_tsn == 0) - sack->first_tsn = tsnumber; - t_s_n = (guint8 *)g_malloc(length); - tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length); - sack->tsns = g_list_append(sack->tsns, t_s_n); - sackchunk = TRUE; - tsn_s = (struct tsn_sort *)g_malloc(sizeof(struct tsn_sort)); - tsn_s->tsnumber = tsnumber; - tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs; - tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; - tsn_s->offset = 0; - tsn_s->framenumber = framenumber; - tsn_s->length = tvb_get_ntohl(sctp_info->tvb[chunk_number], SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET); - if (tsn_s->length > info->max_window1) - info->max_window1 = tsn_s->length; - if (tsn->secs < info->min_secs) - { - info->min_secs = tsn->secs; - info->min_usecs = tsn->usecs; - } - else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) - info->min_usecs = tsn->usecs; - - if (tsn->secs > info->max_secs) - { - info->max_secs = tsn->secs; - info->max_usecs = tsn->usecs; - } - else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) - info->max_usecs = tsn->usecs; - g_ptr_array_add(info->sort_sack2, tsn_s); - info->n_sack_chunks_ep2++; - } - } - } - if (info->verification_tag1 != 0 || info->verification_tag2 != 0) - { - store = (address *)g_malloc(sizeof (address)); - store->type = tmp_info.src.type; - store->len = tmp_info.src.len; - addr = (guint8 *)g_malloc(tmp_info.src.len); - memcpy(addr,(tmp_info.src.data),tmp_info.src.len); - store->data = addr; - info = add_address(store, info, 1); - store = (address *)g_malloc(sizeof (address)); - store->type = tmp_info.dst.type; - store->len = tmp_info.dst.len; - addr = (guint8 *)g_malloc(tmp_info.dst.len); - memcpy(addr,(tmp_info.dst.data),tmp_info.dst.len); - store->data = addr; - info = add_address(store, info, 2); - info->frame_numbers=g_list_prepend(info->frame_numbers,&(pinfo->fd->num)); - if (datachunk || forwardchunk) - info->tsn1 = g_list_prepend(info->tsn1, tsn); - if (sackchunk == TRUE) - info->sack2 = g_list_prepend(info->sack2, sack); - sctp_tapinfo_struct.assoc_info_list = g_list_append(sctp_tapinfo_struct.assoc_info_list, info); - } - else - { - error = (sctp_error_info_t *)g_malloc(sizeof(sctp_error_info_t)); - error->frame_number = pinfo->fd->num; - error->chunk_info[0] = '\0'; - if ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) - g_strlcpy(error->chunk_info, val_to_str(tvb_get_guint8(sctp_info->tvb[0],0),chunk_type_values,"Reserved"), 200); - else - for (chunk_number = 0; chunk_number < sctp_info->number_of_tvbs; chunk_number++) - g_strlcat(error->chunk_info, val_to_str(tvb_get_guint8(sctp_info->tvb[chunk_number],0),chunk_type_values,"Reserved"), 200); - error->info_text = "INFOS"; - info->error_info_list = g_list_append(info->error_info_list, error); - } - } - } /* endif (!info) */ - else - { - if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) - { - - tsn = (tsn_t *)g_malloc(sizeof(tsn_t)); - sack = (tsn_t *)g_malloc(sizeof(tsn_t)); - tsn->tsns = NULL; - tsn->first_tsn = 0; - sack->tsns = NULL; - sack->first_tsn = 0; - sack->src.type = tsn->src.type = tmp_info.src.type; - sack->src.len = tsn->src.len = tmp_info.src.len; - addr = (guint8 *)g_malloc(tmp_info.src.len); - memcpy(addr, tmp_info.src.data, tmp_info.src.len); - tsn->src.data = addr; - addr = (guint8 *)g_malloc(tmp_info.src.len); - memcpy(addr, tmp_info.src.data, tmp_info.src.len); - sack->src.data = addr; - sack->dst.type = tsn->dst.type = tmp_info.dst.type; - sack->dst.len = tsn->dst.len = tmp_info.dst.len; - addr = (guint8 *)g_malloc(tmp_info.dst.len); - memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); - tsn->dst.data = addr; - addr = (guint8 *)g_malloc(tmp_info.dst.len); - memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); - sack->dst.data = addr; - sack->secs=tsn->secs = (guint32)pinfo->rel_ts.secs; - sack->usecs=tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; - if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) - { - if (tsn->secs < info->min_secs) - { - info->min_secs = tsn->secs; - info->min_usecs = tsn->usecs; - } - else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) - info->min_usecs = tsn->usecs; - - if (tsn->secs > info->max_secs) - { - info->max_secs = tsn->secs; - info->max_usecs = tsn->usecs; - } - else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) - info->max_usecs = tsn->usecs; - } - sack->frame_number = tsn->frame_number = pinfo->fd->num; - } - info->frame_numbers = g_list_prepend(info->frame_numbers,&(pinfo->fd->num)); - - store = (address *)g_malloc(sizeof (address)); - store->type = tmp_info.src.type; - store->len = tmp_info.src.len; - addr = (guint8 *)g_malloc(tmp_info.src.len); - memcpy(addr,(tmp_info.src.data),tmp_info.src.len); - store->data = addr; - - if (info->direction == 1) - info = add_address(store, info, 1); - else if (info->direction == 2) - info = add_address(store, info, 2); - - store = (address *)g_malloc(sizeof (address)); - store->type = tmp_info.dst.type; - store->len = tmp_info.dst.len; - addr = (guint8 *)g_malloc(tmp_info.dst.len); - memcpy(addr,(tmp_info.dst.data),tmp_info.dst.len); - store->data = addr; - - if (info->direction == 1) - info = add_address(store, info, 2); - else if (info->direction == 2) - info = add_address(store, info, 1); - - if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID)) - { - tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], INIT_CHUNK_INITIAL_TSN_OFFSET); - - if (info->direction == 2) - { - if (tsnumber < info->min_tsn2) - info->min_tsn2 = tsnumber; - if (tsnumber > info->max_tsn2) - info->max_tsn2 = tsnumber; - info->instream2 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET); - info->outstream2 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET); - /*info->initack_dir=2;*/ - info->tsn2 = g_list_prepend(info->tsn2, tsn); - } - else if (info->direction == 1) - { - if (tsnumber < info->min_tsn1) - info->min_tsn1 = tsnumber; - if (tsnumber > info->max_tsn1) - info->max_tsn1 = tsnumber; - info->instream1 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET); - info->outstream1 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET); - /*info->initack_dir=1;*/ - info->tsn1 = g_list_prepend(info->tsn1, tsn); - } - - idx = tvb_get_guint8(sctp_info->tvb[0],0); - if (!IS_SCTP_CHUNK_TYPE(idx)) - idx = OTHER_CHUNKS_INDEX; - info->chunk_count[idx]++; - if (info->direction == 1) - info->ep1_chunk_count[idx]++; - else - info->ep2_chunk_count[idx]++; - info = add_chunk_count(&tmp_info.src, info, info->direction, idx); - for (chunk_number = 1; chunk_number < sctp_info->number_of_tvbs; chunk_number++) - { - type = tvb_get_ntohs(sctp_info->tvb[chunk_number],0); - if (type == IPV4ADDRESS_PARAMETER_ID) - { - store = (address *)g_malloc(sizeof (address)); - store->type = AT_IPv4; - store->len = 4; - store->data = g_malloc(4); - tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV4_ADDRESS_OFFSET, 4); - info = add_address(store, info, info->direction); - } - else if (type == IPV6ADDRESS_PARAMETER_ID) - { - store = (address *)g_malloc(sizeof (address)); - store->type = AT_IPv6; - store->len = 16; - store->data = g_malloc(16); - tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV6_ADDRESS_OFFSET, IPV6_ADDRESS_LENGTH); - info = add_address(store, info, info->direction); - } - } - if ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) - { - info->initack = TRUE; - info->initack_dir = info->direction; - } - else - if ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) - { - info->init = TRUE; - } - } - else - { - if (((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_ACK_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_DATA_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_SACK_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_NR_SACK_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_FORWARD_TSN_CHUNK_ID)) - { - sack = (tsn_t *)g_malloc(sizeof(tsn_t)); - sack->tsns = NULL; - sack->first_tsn = 0; - tsn = (tsn_t *)g_malloc(sizeof(tsn_t)); - tsn->tsns = NULL; - tsn->first_tsn = 0; - } - for (chunk_number = 0; chunk_number < sctp_info->number_of_tvbs; chunk_number++) - { - idx = tvb_get_guint8(sctp_info->tvb[chunk_number],0); - if (!IS_SCTP_CHUNK_TYPE(idx)) - idx = OTHER_CHUNKS_INDEX; - - info->chunk_count[idx]++; - if (info->direction == 1) - info->ep1_chunk_count[idx]++; - else - info->ep2_chunk_count[idx]++; - info = add_chunk_count(&tmp_info.src, info,info->direction, idx); - - if (((tvb_get_guint8(sctp_info->tvb[chunk_number],0)) == SCTP_DATA_CHUNK_ID)) - datachunk = TRUE; - if (((tvb_get_guint8(sctp_info->tvb[chunk_number],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) - forwardchunk = TRUE; - if (datachunk || forwardchunk) - { - tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], DATA_CHUNK_TSN_OFFSET); - if (tsn->first_tsn == 0) - tsn->first_tsn = tsnumber; - if (datachunk) - { - t_s_n = (guint8 *)g_malloc(16); - tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, 16); - length=tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; - info->n_data_chunks++; - info->n_data_bytes+=length; - } - else - { - length=tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET); - t_s_n = (guint8 *)g_malloc(length); - tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length); - info->n_forward_chunks++; - } - tsn->tsns = g_list_append(tsn->tsns, t_s_n); - - tsn_s = (struct tsn_sort *)g_malloc(sizeof(struct tsn_sort)); - tsn_s->tsnumber = tsnumber; - tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs; - tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; - tsn_s->offset = 0; - tsn_s->framenumber = framenumber; - tsn_s->length = length; - - if (tsn->secs < info->min_secs) - { - info->min_secs = tsn->secs; - info->min_usecs = tsn->usecs; - } - else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) - info->min_usecs = tsn->usecs; - - if (tsn->secs > info->max_secs) - { - info->max_secs = tsn->secs; - info->max_usecs = tsn->usecs; - } - else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) - info->max_usecs = tsn->usecs; - - if (info->direction == 1) - { - if(tsnumber < info->min_tsn1) - info->min_tsn1 = tsnumber; - if ((info->init == TRUE || (info->initack == TRUE && info->initack_dir == 1))&& tsnumber >= info->min_tsn1 && tsnumber <= info->max_tsn1) - { - if (datachunk) - { - info->n_data_chunks_ep1++; - info->n_data_bytes_ep1 += length; - } - else if (forwardchunk) - { - info->n_forward_chunks_ep1++; - } - } - if(tsnumber > info->max_tsn1) - { - info->max_tsn1 = tsnumber; - if (datachunk) - { - info->n_data_chunks_ep1++; - info->n_data_bytes_ep1 += length; - } - else if (forwardchunk) - { - info->n_forward_chunks_ep1++; - } - } - if (datachunk) - { - if (info->init == FALSE) - info->outstream1 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; - if (info->initack == FALSE) - info->instream2 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; - } - - g_ptr_array_add(info->sort_tsn1, tsn_s); - info->n_array_tsn1++; - } - else if (info->direction == 2) - { - - if(tsnumber < info->min_tsn2) - info->min_tsn2 = tsnumber; - - if ((info->initack == TRUE && info->initack_dir == 2)&& tsnumber >= info->min_tsn2 && tsnumber <= info->max_tsn2) - { - if (datachunk) - { - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; - info->n_data_chunks_ep2++; - info->n_data_bytes_ep2+=length; - } - else if (forwardchunk) - { - info->n_forward_chunks_ep2++; - } - } - if(tsnumber > info->max_tsn2) - { - info->max_tsn2 = tsnumber; - if (datachunk) - { - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; - info->n_data_chunks_ep2++; - info->n_data_bytes_ep2+=length; - } - else if (forwardchunk) - { - info->n_forward_chunks_ep2++; - } - } - if (datachunk) - { - if (info->init == FALSE) - info->instream1 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; - if (info->initack == FALSE) - info->outstream2 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; - } - - g_ptr_array_add(info->sort_tsn2, tsn_s); - info->n_array_tsn2++; - } - } - else if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_SACK_CHUNK_ID) || - (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_NR_SACK_CHUNK_ID)) - { - tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET); - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET); - if (sack->first_tsn == 0) - sack->first_tsn = tsnumber; - t_s_n = (guint8 *)g_malloc(length); - tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length); - sack->tsns = g_list_append(sack->tsns, t_s_n); - sackchunk = TRUE; - tsn_s = (struct tsn_sort *)g_malloc(sizeof(struct tsn_sort)); - tsn_s->tsnumber = tsnumber; - tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs; - tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; - tsn_s->offset = 0; - tsn_s->framenumber = framenumber; - tsn_s->length = tvb_get_ntohl(sctp_info->tvb[chunk_number], SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET); - - if (tsn->secs < info->min_secs) - { - info->min_secs = tsn->secs; - info->min_usecs = tsn->usecs; - } - else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) - info->min_usecs = tsn->usecs; - - if (tsn->secs > info->max_secs) - { - info->max_secs = tsn->secs; - info->max_usecs = tsn->usecs; - } - else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) - info->max_usecs = tsn->usecs; - - - if (info->direction == 2) - { - if(tsnumber < info->min_tsn1) - info->min_tsn1 = tsnumber; - if(tsnumber > info->max_tsn1) - info->max_tsn1 = tsnumber; - if (tsn_s->length > info->max_window1) - info->max_window1 = tsn_s->length; - g_ptr_array_add(info->sort_sack1, tsn_s); - info->n_sack_chunks_ep1++; - } - else if (info->direction == 1) - { - - if(tsnumber < info->min_tsn2) - info->min_tsn2 = tsnumber; - if(tsnumber > info->max_tsn2) - info->max_tsn2 = tsnumber; - if (tsn_s->length > info->max_window2) - info->max_window2 = tsn_s->length; - g_ptr_array_add(info->sort_sack2, tsn_s); - info->n_sack_chunks_ep2++; - } - - } - } - - } - if (datachunk || forwardchunk) - { - if (info->direction == 1) - info->tsn1 = g_list_prepend(info->tsn1, tsn); - else if (info->direction == 2) - info->tsn2 = g_list_prepend(info->tsn2, tsn); - } - if (sackchunk == TRUE) - { - if (info->direction == 1) - info->sack2 = g_list_prepend(info->sack2, sack); - else if(info->direction == 2) - info->sack1 = g_list_prepend(info->sack1, sack); - } - info->n_tvbs += sctp_info->number_of_tvbs; - sctp_tapinfo_struct.sum_tvbs += sctp_info->number_of_tvbs; - info = calc_checksum(sctp_info, info); - info->n_packets++; - } - return(1); -} - - -/****************************************************************************/ -void -remove_tap_listener_sctp_stat(void) -{ - if (sctp_tapinfo_struct.is_registered) { - remove_tap_listener(&sctp_tapinfo_struct); - sctp_tapinfo_struct.is_registered = FALSE; - } -} - - -void sctp_stat_scan(void) -{ - if (!sctp_tapinfo_struct.is_registered) - register_tap_listener_sctp_stat(); -} - -const sctp_allassocs_info_t* sctp_stat_get_info(void) -{ - return &sctp_tapinfo_struct; -} - - -static void sctp_update(void *dummy _U_) -{ - if (get_stat_dlg()!=NULL) - sctp_stat_dlg_update(); -} - -void -register_tap_listener_sctp_stat(void) -{ - GString *error_string; - - if (!sctp_tapinfo_struct.is_registered) - { - if ((error_string = register_tap_listener("sctp", &sctp_tapinfo_struct, NULL, 0, reset, packet, sctp_update))) { - simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str); - g_string_free(error_string, TRUE); - return; - } - sctp_tapinfo_struct.is_registered=TRUE; - } -} diff -Nru wireshark-1.12.0~201310251247/ui/gtk/sctp_stat.h wireshark-1.12.0~201311020920/ui/gtk/sctp_stat.h --- wireshark-1.12.0~201310251247/ui/gtk/sctp_stat.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/sctp_stat.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,411 +0,0 @@ -/* - * Copyright 2004, Irene Ruengeler - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef __SCTP_STAT_H__ -#define __SCTP_STAT_H__ - -#include -#include -#ifndef _WIN32 -#include -#include -#include -#else -#ifdef HAVE_WINSOCK2_H -#include -#endif -#endif - -#define SCTP_DATA_CHUNK_ID 0 -#define SCTP_INIT_CHUNK_ID 1 -#define SCTP_INIT_ACK_CHUNK_ID 2 -#define SCTP_SACK_CHUNK_ID 3 -#define SCTP_HEARTBEAT_CHUNK_ID 4 -#define SCTP_HEARTBEAT_ACK_CHUNK_ID 5 -#define SCTP_ABORT_CHUNK_ID 6 -#define SCTP_SHUTDOWN_CHUNK_ID 7 -#define SCTP_SHUTDOWN_ACK_CHUNK_ID 8 -#define SCTP_ERROR_CHUNK_ID 9 -#define SCTP_COOKIE_ECHO_CHUNK_ID 10 -#define SCTP_COOKIE_ACK_CHUNK_ID 11 -#define SCTP_ECNE_CHUNK_ID 12 -#define SCTP_CWR_CHUNK_ID 13 -#define SCTP_SHUTDOWN_COMPLETE_CHUNK_ID 14 -#define SCTP_AUTH_CHUNK_ID 15 -#define SCTP_NR_SACK_CHUNK_ID 16 -#define SCTP_FORWARD_TSN_CHUNK_ID 0xc0 -#define SCTP_ASCONF_ACK_CHUNK_ID 0x80 -#define SCTP_PKTDROP_CHUNK_ID 0x81 -#define SCTP_ASCONF_CHUNK_ID 0xc1 -#define SCTP_IETF_EXT 255 - -#define IS_SCTP_CHUNK_TYPE(t) \ - (((t) <= 16) || ((t) == 0xC0) || ((t) == 0xC1) || ((t) == 0x80) || ((t) == 0x81)) - -#define CHUNK_TYPE_LENGTH 1 -#define CHUNK_FLAGS_LENGTH 1 -#define CHUNK_LENGTH_LENGTH 2 - -#define CHUNK_HEADER_OFFSET 0 -#define CHUNK_TYPE_OFFSET CHUNK_HEADER_OFFSET -#define CHUNK_FLAGS_OFFSET (CHUNK_TYPE_OFFSET + CHUNK_TYPE_LENGTH) -#define CHUNK_LENGTH_OFFSET (CHUNK_FLAGS_OFFSET + CHUNK_FLAGS_LENGTH) -#define CHUNK_VALUE_OFFSET (CHUNK_LENGTH_OFFSET + CHUNK_LENGTH_LENGTH) - -#define INIT_CHUNK_INITIATE_TAG_LENGTH 4 -#define INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH 4 -#define INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH 2 -#define INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH 2 - - -#define INIT_CHUNK_INITIATE_TAG_OFFSET CHUNK_VALUE_OFFSET -#define INIT_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET (INIT_CHUNK_INITIATE_TAG_OFFSET + \ - INIT_CHUNK_INITIATE_TAG_LENGTH ) -#define INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET (INIT_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET + \ - INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH ) -#define INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET (INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET + \ - INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH ) -#define INIT_CHUNK_INITIAL_TSN_OFFSET (INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET + \ - INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH ) - -#define DATA_CHUNK_TSN_LENGTH 4 -#define DATA_CHUNK_TSN_OFFSET (CHUNK_VALUE_OFFSET + 0) -#define DATA_CHUNK_STREAM_ID_OFFSET (DATA_CHUNK_TSN_OFFSET + DATA_CHUNK_TSN_LENGTH) -#define DATA_CHUNK_STREAM_ID_LENGTH 2 -#define DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH 2 -#define DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH 4 -#define DATA_CHUNK_HEADER_LENGTH (CHUNK_HEADER_LENGTH + \ - DATA_CHUNK_TSN_LENGTH + \ - DATA_CHUNK_STREAM_ID_LENGTH + \ - DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH + \ - DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) -#define MAX_ADDRESS_LEN 47 - -/* The below value is 256 */ -#define NUM_CHUNKS 0xff - -/* This variable is used as an index into arrays - * which store the cumulative information corresponding - * all chunks with Chunk Type greater > 16 - * The value for the below variable is 17 - */ -#define OTHER_CHUNKS_INDEX 0xfe - -/* VNB */ -/* This variable stores the maximum chunk type value - * that can be associated with a sctp chunk. - */ -#define MAX_SCTP_CHUNK_TYPE 256 - -typedef struct _tsn { - guint32 frame_number; - guint32 secs; /* Absolute seconds */ - guint32 usecs; - address src; - address dst; - guint32 first_tsn; - GList *tsns; -} tsn_t; - -typedef struct _sctp_tmp_info { - address src; - address dst; - guint16 port1; - guint16 port2; - guint32 verification_tag1; - guint32 verification_tag2; - guint32 initiate_tag; - guint32 n_tvbs; -} sctp_tmp_info_t; - -typedef struct _sctp_min_max { - guint32 tmp_min_secs; - guint32 tmp_min_usecs; - guint32 tmp_max_secs; - guint32 tmp_max_usecs; - guint32 tmp_min_tsn1; - guint32 tmp_min_tsn2; - guint32 tmp_max_tsn1; - guint32 tmp_max_tsn2; - gint tmp_secs; -} sctp_min_max_t; - -struct tsn_sort{ - guint32 tsnumber; - guint32 secs; - guint32 usecs; - guint32 offset; - guint32 length; - guint32 framenumber; -}; - -typedef struct _sctp_addr_chunk { - guint32 direction; - address* addr; - /* The array is initialized to MAX_SCTP_CHUNK_TYPE - * so that there is no memory overwrite - * when accessed using sctp chunk type as index. - */ - guint32 addr_count[MAX_SCTP_CHUNK_TYPE]; -} sctp_addr_chunk; - -typedef struct _sctp_assoc_info { - address src; - address dst; - guint16 port1; - guint16 port2; - guint32 verification_tag1; - guint32 verification_tag2; - guint32 initiate_tag; - guint32 n_tvbs; - GList *addr1; - GList *addr2; - guint16 instream1; - guint16 outstream1; - guint16 instream2; - guint16 outstream2; - guint32 n_adler32_calculated; - guint32 n_adler32_correct; - guint32 n_crc32c_calculated; - guint32 n_crc32c_correct; - gchar checksum_type[8]; - guint32 n_checksum_errors; - guint32 n_bundling_errors; - guint32 n_padding_errors; - guint32 n_length_errors; - guint32 n_value_errors; - guint32 n_data_chunks; - guint32 n_forward_chunks; - guint32 n_forward_chunks_ep1; - guint32 n_forward_chunks_ep2; - guint32 n_data_bytes; - guint32 n_packets; - guint32 n_data_chunks_ep1; - guint32 n_data_bytes_ep1; - guint32 n_data_chunks_ep2; - guint32 n_data_bytes_ep2; - guint32 n_sack_chunks_ep1; - guint32 n_sack_chunks_ep2; - guint32 n_array_tsn1; - guint32 n_array_tsn2; - guint32 max_window1; - guint32 max_window2; - gboolean init; - gboolean initack; - guint8 initack_dir; - guint8 direction; - guint32 min_secs; - guint32 min_usecs; - guint32 max_secs; - guint32 max_usecs; - guint32 min_tsn1; - guint32 min_tsn2; - guint32 max_tsn1; - guint32 max_tsn2; - guint32 max_bytes1; - guint32 max_bytes2; - GSList *min_max; - GList *frame_numbers; - GList *tsn1; - GPtrArray *sort_tsn1; - GPtrArray *sort_sack1; - GList *sack1; - GList *tsn2; - GPtrArray *sort_tsn2; - GPtrArray *sort_sack2; - GList *sack2; - gboolean check_address; - GList* error_info_list; - /* The array is initialized to MAX_SCTP_CHUNK_TYPE - * so that there is no memory overwrite - * when accessed using sctp chunk type as index. - */ - guint32 chunk_count[MAX_SCTP_CHUNK_TYPE]; - guint32 ep1_chunk_count[MAX_SCTP_CHUNK_TYPE]; - guint32 ep2_chunk_count[MAX_SCTP_CHUNK_TYPE]; - GList* addr_chunk_count; -} sctp_assoc_info_t; - -typedef struct _sctp_error_info { - guint32 frame_number; - gchar chunk_info[200]; - const gchar *info_text; -} sctp_error_info_t; - - -typedef struct _sctp_allassocs_info { - guint32 sum_tvbs; - GList* assoc_info_list; - gboolean is_registered; - GList* children; -} sctp_allassocs_info_t; - - - -struct notes { - GtkWidget *checktype; - GtkWidget *checksum; - GtkWidget *bundling; - GtkWidget *padding; - GtkWidget *length; - GtkWidget *value; - GtkWidget *chunks_ep1; - GtkWidget *bytes_ep1; - GtkWidget *chunks_ep2; - GtkWidget *bytes_ep2; - struct page *page2; - struct page *page3; -}; - -struct page { - GtkWidget *addr_frame; - GtkWidget *scrolled_window; - GtkWidget *clist; - GtkWidget *port; - GtkWidget *veritag; - GtkWidget *max_in; - GtkWidget *min_in; - GtkWidget *max_out; - GtkWidget *min_out; -}; - -struct sctp_analyse { - sctp_assoc_info_t *assoc; - GtkWidget* window; - struct notes *analyse_nb; - GList *children; - guint16 num_children; -}; - -typedef struct _sctp_graph_t { - gboolean needs_redraw; - gfloat x_interval; - gfloat y_interval; - GtkWidget *window; - GtkWidget *draw_area; -#if GTK_CHECK_VERSION(2,22,0) - cairo_surface_t *surface; -#else - GdkPixmap *pixmap; -#endif - gint surface_width; - gint surface_height; - gint graph_type; - gdouble x_old; - gdouble y_old; - gdouble x_new; - gdouble y_new; - guint16 offset; - guint16 length; - gboolean tmp; - gboolean rectangle; - gboolean rectangle_present; - guint32 rect_x_min; - guint32 rect_x_max; - guint32 rect_y_min; - guint32 rect_y_max; - guint32 x1_tmp_sec; - guint32 x2_tmp_sec; - guint32 x1_tmp_usec; - guint32 x2_tmp_usec; - guint32 x1_akt_sec; - guint32 x2_akt_sec; - guint32 x1_akt_usec; - guint32 x2_akt_usec; - guint32 tmp_width; - guint32 axis_width; - guint32 y1_tmp; - guint32 y2_tmp; - guint32 tmp_min_tsn1; - guint32 tmp_max_tsn1; - guint32 tmp_min_tsn2; - guint32 tmp_max_tsn2; - guint32 min_x; - guint32 max_x; - guint32 min_y; - guint32 max_y; - gboolean uoff; -} sctp_graph_t; - - - -struct sctp_udata { - sctp_assoc_info_t *assoc; - sctp_graph_t *io; - struct sctp_analyse *parent; - guint16 dir; -}; - - -void register_tap_listener_sctp_stat(void); - -const sctp_allassocs_info_t* sctp_stat_get_info(void); - -void sctp_stat_scan(void); - -void remove_tap_listener_sctp_stat(void); - -void assoc_analyse(sctp_assoc_info_t* assoc); - -const sctp_assoc_info_t* get_selected_assoc(void); - -void create_graph(guint16 dir, struct sctp_analyse* u_data); - -void create_byte_graph(guint16 dir, struct sctp_analyse* u_data); - -void sctp_error_dlg_show(sctp_assoc_info_t* assoc); - -void sctp_stat_dlg_update(void); - -void sctp_chunk_stat_dlg_update(struct sctp_udata* udata, unsigned int direction); - -void sctp_chunk_dlg_show(struct sctp_analyse* userdata); - -void sctp_chunk_stat_dlg_show(unsigned int direction, struct sctp_analyse* userdata); - -GtkWidget *get_stat_dlg(void); - -GtkWidget *get_chunk_stat_dlg(void); - -void update_analyse_dlg(struct sctp_analyse* u_data); - -void increase_childcount(struct sctp_analyse *parent); - -void decrease_childcount(struct sctp_analyse *parent); - -void set_child(struct sctp_udata *child, struct sctp_analyse *parent); - -void remove_child(struct sctp_udata *child, struct sctp_analyse *parent); - -void decrease_analyse_childcount(void); - -void increase_analyse_childcount(void); - -void set_analyse_child(struct sctp_analyse *child); - -void remove_analyse_child(struct sctp_analyse *child); - -void sctp_set_assoc_filter(void); - -#endif /* __SCTP_STAT_H__ */ diff -Nru wireshark-1.12.0~201310251247/ui/gtk/sctp_stat_dlg.c wireshark-1.12.0~201311020920/ui/gtk/sctp_stat_dlg.c --- wireshark-1.12.0~201310251247/ui/gtk/sctp_stat_dlg.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/sctp_stat_dlg.c 2013-11-02 02:12:36.000000000 +0000 @@ -36,7 +36,8 @@ #include "ui/gtk/dlg_utils.h" #include "ui/gtk/gui_utils.h" #include "ui/gtk/main.h" -#include "ui/gtk/sctp_stat.h" +#include "ui/tap-sctp-analysis.h" +#include "ui/gtk/sctp_stat_gtk.h" #include "ui/gtk/gtkglobals.h" #include "ui/gtk/old-gtk-compat.h" @@ -670,10 +671,6 @@ } /****************************************************************************/ -void -register_tap_listener_sctp_stat_dlg(void) -{ -} GtkWidget *get_stat_dlg(void) { diff -Nru wireshark-1.12.0~201310251247/ui/gtk/sctp_stat_gtk.h wireshark-1.12.0~201311020920/ui/gtk/sctp_stat_gtk.h --- wireshark-1.12.0~201310251247/ui/gtk/sctp_stat_gtk.h 1970-01-01 00:00:00.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/sctp_stat_gtk.h 2013-11-02 02:12:36.000000000 +0000 @@ -0,0 +1,164 @@ +/* + * Copyright 2004-2013, Irene Ruengeler + * + * $Id$ + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __SCTP_STAT_GTK_H__ +#define __SCTP_STAT_GTK_H__ + +#include "ui/tap-sctp-analysis.h" + +struct notes { + GtkWidget *checktype; + GtkWidget *checksum; + GtkWidget *bundling; + GtkWidget *padding; + GtkWidget *length; + GtkWidget *value; + GtkWidget *chunks_ep1; + GtkWidget *bytes_ep1; + GtkWidget *chunks_ep2; + GtkWidget *bytes_ep2; + struct page *page2; + struct page *page3; +}; + +struct page { + GtkWidget *addr_frame; + GtkWidget *scrolled_window; + GtkWidget *clist; + GtkWidget *port; + GtkWidget *veritag; + GtkWidget *max_in; + GtkWidget *min_in; + GtkWidget *max_out; + GtkWidget *min_out; +}; + +struct sctp_analyse { + sctp_assoc_info_t *assoc; + GtkWidget* window; + struct notes *analyse_nb; + GList *children; + guint16 num_children; +}; + +typedef struct _sctp_graph_t { + gboolean needs_redraw; + gfloat x_interval; + gfloat y_interval; + GtkWidget *window; + GtkWidget *draw_area; +#if GTK_CHECK_VERSION(2,22,0) + cairo_surface_t *surface; +#else + GdkPixmap *pixmap; +#endif + gint surface_width; + gint surface_height; + gint graph_type; + gdouble x_old; + gdouble y_old; + gdouble x_new; + gdouble y_new; + guint16 offset; + guint16 length; + gboolean tmp; + gboolean rectangle; + gboolean rectangle_present; + guint32 rect_x_min; + guint32 rect_x_max; + guint32 rect_y_min; + guint32 rect_y_max; + guint32 x1_tmp_sec; + guint32 x2_tmp_sec; + guint32 x1_tmp_usec; + guint32 x2_tmp_usec; + guint32 x1_akt_sec; + guint32 x2_akt_sec; + guint32 x1_akt_usec; + guint32 x2_akt_usec; + guint32 tmp_width; + guint32 axis_width; + guint32 y1_tmp; + guint32 y2_tmp; + guint32 tmp_min_tsn1; + guint32 tmp_max_tsn1; + guint32 tmp_min_tsn2; + guint32 tmp_max_tsn2; + guint32 min_x; + guint32 max_x; + guint32 min_y; + guint32 max_y; + gboolean uoff; +} sctp_graph_t; + +struct sctp_udata { + sctp_assoc_info_t *assoc; + sctp_graph_t *io; + struct sctp_analyse *parent; + guint16 dir; +}; + +const sctp_allassocs_info_t* sctp_stat_get_info(void); + +void assoc_analyse(sctp_assoc_info_t* assoc); + +void set_child(struct sctp_udata *child, struct sctp_analyse *parent); + +void remove_child(struct sctp_udata *child, struct sctp_analyse *parent); + +void decrease_analyse_childcount(void); + +void increase_analyse_childcount(void); + +void increase_childcount(struct sctp_analyse *parent); + +void decrease_childcount(struct sctp_analyse *parent); + +void set_analyse_child(struct sctp_analyse *child); + +void remove_analyse_child(struct sctp_analyse *child); + +void create_graph(guint16 dir, struct sctp_analyse* u_data); + +void create_byte_graph(guint16 dir, struct sctp_analyse* u_data); + +void sctp_error_dlg_show(sctp_assoc_info_t* assoc); + +void sctp_stat_dlg_update(void); + +void sctp_chunk_stat_dlg_update(struct sctp_udata* udata, unsigned int direction); + +void sctp_chunk_dlg_show(struct sctp_analyse* userdata); + +void sctp_chunk_stat_dlg_show(unsigned int direction, struct sctp_analyse* userdata); + +GtkWidget *get_stat_dlg(void); + +GtkWidget *get_chunk_stat_dlg(void); + +void update_analyse_dlg(struct sctp_analyse* u_data); + +void sctp_set_assoc_filter(void); + +#endif \ No newline at end of file diff -Nru wireshark-1.12.0~201310251247/ui/gtk/tcp_graph.c wireshark-1.12.0~201311020920/ui/gtk/tcp_graph.c --- wireshark-1.12.0~201310251247/ui/gtk/tcp_graph.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/tcp_graph.c 2013-11-02 02:12:36.000000000 +0000 @@ -460,7 +460,8 @@ static void wscale_initialize(struct gtk_graph *); static void wscale_read_config(struct gtk_graph *); static void wscale_make_elmtlist(struct gtk_graph *); -#if defined(_WIN32) && !defined(__MINGW32__) +#if defined(_WIN32) && !defined(__MINGW32__) && (_MSC_VER < 1800) +/* Starting VS2013, rint already defined in math.h. No need to redefine */ static int rint(double ); /* compiler template for Windows */ #endif @@ -4478,8 +4479,8 @@ g->elists->elements = elements; } - -#if defined(_WIN32) && !defined(__MINGW32__) +#if defined(_WIN32) && !defined(__MINGW32__) && (_MSC_VER < 1800) +/* Starting VS2103, rint already defined in math.h. No need to redefine */ /* replacement of Unix rint() for Windows */ static int rint(double x) { diff -Nru wireshark-1.12.0~201310251247/ui/gtk/uat_gui.c wireshark-1.12.0~201311020920/ui/gtk/uat_gui.c --- wireshark-1.12.0~201310251247/ui/gtk/uat_gui.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/gtk/uat_gui.c 2013-11-02 02:12:36.000000000 +0000 @@ -373,7 +373,13 @@ dd->uat->update_cb(dd->rec, &err); if (err) { - err = ep_strdup_printf("error updating record: %s", err); + char *tmp; + tmp = ep_strdup_printf("error updating record: %s", err); + /* XXX bit of a hack to remove emem from dissectors, this can + * be removed as proper use of glib memory is propogated + * through the rest of the UAT code */ + g_free((char*)err); + err = tmp; goto on_failure; } } diff -Nru wireshark-1.12.0~201310251247/ui/qt/Makefile.am wireshark-1.12.0~201311020920/ui/qt/Makefile.am --- wireshark-1.12.0~201310251247/ui/qt/Makefile.am 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/Makefile.am 2013-11-02 02:12:36.000000000 +0000 @@ -89,6 +89,7 @@ $(AM_V_MOC)$(MOC) -I.. -I../.. -o $@ $< .qrc.rcc.cpp: + $(MKDIR_P) $(@D) $(AM_V_RCC)rcc -name `basename $< .qrc` -o $@ $< ui_%.h: %.ui diff -Nru wireshark-1.12.0~201310251247/ui/qt/Makefile.common wireshark-1.12.0~201311020920/ui/qt/Makefile.common --- wireshark-1.12.0~201310251247/ui/qt/Makefile.common 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/Makefile.common 2013-11-02 02:12:36.000000000 +0000 @@ -193,10 +193,10 @@ # # Should QRC_FILES or QRC_SRC depend on QRC_IMAGES? QRC_FILES = \ - $(top_srcdir)/image/display_filter.qrc \ - $(top_srcdir)/image/layout.qrc \ - $(top_srcdir)/image/status.qrc \ - $(top_srcdir)/image/toolbar.qrc \ + ../../image/display_filter.qrc \ + ../../image/layout.qrc \ + ../../image/status.qrc \ + ../../image/toolbar.qrc \ i18n.qrc \ welcome.qrc diff -Nru wireshark-1.12.0~201310251247/ui/qt/export_object_dialog.cpp wireshark-1.12.0~201311020920/ui/qt/export_object_dialog.cpp --- wireshark-1.12.0~201310251247/ui/qt/export_object_dialog.cpp 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/export_object_dialog.cpp 2013-11-02 02:12:36.000000000 +0000 @@ -307,7 +307,6 @@ file_name = path.filePath(safe_filename->str); g_string_free(safe_filename, TRUE); } while (g_file_test(file_path.toUtf8().constData(), G_FILE_TEST_EXISTS) && ++count < 1000); - count = 0; if (!eo_save_entry(file_path.toUtf8().constData(), entry, FALSE)) all_saved = false; } diff -Nru wireshark-1.12.0~201310251247/ui/qt/main.cpp wireshark-1.12.0~201311020920/ui/qt/main.cpp --- wireshark-1.12.0~201310251247/ui/qt/main.cpp 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/main.cpp 2013-11-02 02:12:36.000000000 +0000 @@ -169,25 +169,19 @@ WiresharkApplication::processEvents(); } -/* exit the main window */ -void main_window_exit(void) -{ - exit(0); -} - #ifdef HAVE_LIBPCAP /* quit a nested main window */ void main_window_nested_quit(void) { // if (gtk_main_level() > 0) - WiresharkApplication::quit(); + wsApp->quit(); } /* quit the main window */ void main_window_quit(void) { - WiresharkApplication::quit(); + wsApp->quit(); } #endif /* HAVE_LIBPCAP */ @@ -630,6 +624,7 @@ "Could not open common recent file\n\"%s\": %s.", rf_path, strerror(rf_open_errno)); } + wsApp->emitAppSignal(WiresharkApplication::StaticRecentFilesRead); while ((opt = getopt_long(argc, argv, optstring, long_options, NULL)) != -1) { switch (opt) { diff -Nru wireshark-1.12.0~201310251247/ui/qt/main_window.cpp wireshark-1.12.0~201311020920/ui/qt/main_window.cpp --- wireshark-1.12.0~201310251247/ui/qt/main_window.cpp 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/main_window.cpp 2013-11-02 02:12:36.000000000 +0000 @@ -43,6 +43,7 @@ #include "ui/alert_box.h" #include "ui/capture_globals.h" #include "ui/main_statusbar.h" +#include "ui/recent.h" #include "ui/util.h" #include "wireshark_application.h" @@ -54,13 +55,15 @@ #include "qt_ui_utils.h" -#include -#include #include -#include +#include #include -#include #include +#include +#include +#include +#include +#include #ifdef QT_MACEXTRAS_LIB #include @@ -110,6 +113,8 @@ connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(layoutPanes())); + connect(wsApp, SIGNAL(recentFilesRead()), this, SLOT(loadWindowGeometry())); + connect(wsApp, SIGNAL(updateRecentItemStatus(const QString &, qint64, bool)), this, SLOT(updateRecentFiles())); updateRecentFiles(); @@ -389,8 +394,10 @@ } void MainWindow::closeEvent(QCloseEvent *event) { - /* If we're in the middle of stopping a capture, don't do anything; - the user can try deleting the window after the capture stops. */ + saveWindowGeometry(); + + /* If we're in the middle of stopping a capture, don't do anything; + the user can try deleting the window after the capture stops. */ if (capture_stopping_) { event->ignore(); return; @@ -399,19 +406,92 @@ // Make sure we kill any open dumpcap processes. delete main_welcome_; - if(testCaptureFileClose(true)) { - /* QCoreApplication::quit() won't exit properly - * because when during initialization phase we are not in the event loop */ + if(!wsApp->isInitialized()) { + // If we're still initializing, QCoreApplication::quit() won't + // exit properly because we are not in the event loop. This + // means that the application won't clean up after itself. We + // might want to call wsApp->processEvents() during startup + // instead so that we can do a normal exit here. exit(0); } - else - { - event->ignore(); - return; +} + +const int min_sensible_dimension = 200; +const int geom_animation_duration = 150; +void MainWindow::loadWindowGeometry() +{ + QWidget shadow_main(wsApp->desktop()); + shadow_main.setVisible(false); + + // Start off with the Widget defaults + shadow_main.restoreGeometry(saveGeometry()); + + // Apply any saved settings + + // Note that we're saving and restoring the outer window frame + // position and the inner client area size. +// if (prefs.gui_geometry_save_position) { + shadow_main.move(recent.gui_geometry_main_x, recent.gui_geometry_main_y); +// } + + // XXX Preferences haven't been loaded at this point. For now we + // assume default (true) values for everything. + + if (// prefs.gui_geometry_save_size && + recent.gui_geometry_main_width > min_sensible_dimension && + recent.gui_geometry_main_width > min_sensible_dimension) { + shadow_main.resize(recent.gui_geometry_main_width, recent.gui_geometry_main_height); + } + + // Let Qt move and resize our window if needed (e.g. if it's offscreen) + QByteArray geom = shadow_main.saveGeometry(); + +#ifndef Q_OS_MAC + if (/* prefs.gui_geometry_save_maximized && */ recent.gui_geometry_main_maximized) { + setWindowState(Qt::WindowMaximized); + } else +#endif + if (strlen (get_conn_cfilter()) < 1) { + QPropertyAnimation *pos_anim = new QPropertyAnimation(this, "pos"); + QPropertyAnimation *size_anim = new QPropertyAnimation(this, "size"); + + shadow_main.restoreGeometry(geom); + + pos_anim->setDuration(geom_animation_duration); + pos_anim->setStartValue(pos()); + pos_anim->setEndValue(shadow_main.pos()); + pos_anim->setEasingCurve(QEasingCurve::InOutQuad); + size_anim->setDuration(geom_animation_duration); + size_anim->setStartValue(size()); + size_anim->setEasingCurve(QEasingCurve::InOutQuad); + size_anim->setEndValue(shadow_main.size()); + + pos_anim->start(QAbstractAnimation::DeleteWhenStopped); + size_anim->start(QAbstractAnimation::DeleteWhenStopped); + } else { + restoreGeometry(geom); } } +void MainWindow::saveWindowGeometry() +{ + if (prefs.gui_geometry_save_position) { + recent.gui_geometry_main_x = pos().x(); + recent.gui_geometry_main_y = pos().y(); + } + + if (prefs.gui_geometry_save_size) { + recent.gui_geometry_main_width = size().width(); + recent.gui_geometry_main_height = size().height(); + } + + if (prefs.gui_geometry_save_maximized) { + // On OS X this is false when it shouldn't be + recent.gui_geometry_main_maximized = isMaximized(); + } +} + QWidget* MainWindow::getLayoutWidget(layout_pane_content_e type) { switch (type) { case layout_pane_content_none: diff -Nru wireshark-1.12.0~201310251247/ui/qt/main_window.h wireshark-1.12.0~201311020920/ui/qt/main_window.h --- wireshark-1.12.0~201310251247/ui/qt/main_window.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/main_window.h 2013-11-02 02:12:36.000000000 +0000 @@ -129,7 +129,9 @@ QSocketNotifier *pipe_notifier_; #endif + void saveWindowGeometry(); QWidget* getLayoutWidget(layout_pane_content_e type); + void mergeCaptureFile(); void importCaptureFile(); void saveCaptureFile(capture_file *cf, bool stay_closed); @@ -190,6 +192,7 @@ void pipeNotifierDestroyed(); void stopCapture(); + void loadWindowGeometry(); void updateRecentFiles(); void recentActionTriggered(); void setMenusForFollowStream(); diff -Nru wireshark-1.12.0~201310251247/ui/qt/progress_bar.cpp wireshark-1.12.0~201311020920/ui/qt/progress_bar.cpp --- wireshark-1.12.0~201310251247/ui/qt/progress_bar.cpp 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/progress_bar.cpp 2013-11-02 02:12:36.000000000 +0000 @@ -142,7 +142,7 @@ setValue(value); -#ifndef Q_OS_MAC +#if !defined(Q_OS_MAC) || QT_VERSION > QT_VERSION_CHECK(5, 0, 0) if (animate) { QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect(this); this->setGraphicsEffect(effect); @@ -152,6 +152,7 @@ animation->setDuration(750); animation->setStartValue(0.1); animation->setEndValue(1.0); + animation->setEasingCurve(QEasingCurve::InOutQuad); animation->start(); } #else diff -Nru wireshark-1.12.0~201310251247/ui/qt/qt_ui_utils.cpp wireshark-1.12.0~201311020920/ui/qt/qt_ui_utils.cpp --- wireshark-1.12.0~201310251247/ui/qt/qt_ui_utils.cpp 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/qt_ui_utils.cpp 2013-11-02 02:12:36.000000000 +0000 @@ -31,6 +31,8 @@ #include +#include + /* Make the format_size_flags_e enum usable in C++ */ format_size_flags_e operator|(format_size_flags_e lhs, format_size_flags_e rhs) { return (format_size_flags_e) ((int)lhs| (int)rhs); @@ -53,6 +55,22 @@ return *qt_string; } +void smooth_font_size(QFont &font) { + QFontDatabase fdb; + QList size_list = fdb.smoothSizes(font.family(), font.styleName()); + + if (size_list.size() < 2) return; + + int last_size = size_list.takeFirst(); + foreach (int cur_size, size_list) { + if (font.pointSize() > last_size && font.pointSize() <= cur_size) { + font.setPointSize(cur_size); + return; + } + last_size = cur_size; + } +} + /* * Editor modelines * diff -Nru wireshark-1.12.0~201310251247/ui/qt/qt_ui_utils.h wireshark-1.12.0~201311020920/ui/qt/qt_ui_utils.h --- wireshark-1.12.0~201310251247/ui/qt/qt_ui_utils.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/qt_ui_utils.h 2013-11-02 02:12:36.000000000 +0000 @@ -34,6 +34,7 @@ #include #include +#include #include #ifdef __cplusplus @@ -67,8 +68,6 @@ gboolean nocap_local; }; -extern gboolean main_do_quit(void); - #ifdef __cplusplus } #endif /* __cplusplus */ @@ -90,6 +89,14 @@ */ QString gchar_free_to_qstring(gchar *glib_string); +/** + * Round the current size of a font up to its next "smooth" size. + * If a smooth size can't be found the font is left unchanged. + * + * @font The font to smooth. + */ +void smooth_font_size(QFont &font); + #endif /* __QT_UI_UTILS__H__ */ // XXX Add a routine to fetch the HWND corresponding to a widget using QPlatformIntegration diff -Nru wireshark-1.12.0~201310251247/ui/qt/sequence_diagram.cpp wireshark-1.12.0~201311020920/ui/qt/sequence_diagram.cpp --- wireshark-1.12.0~201310251247/ui/qt/sequence_diagram.cpp 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/sequence_diagram.cpp 2013-11-02 02:12:36.000000000 +0000 @@ -23,7 +23,9 @@ #include "sequence_diagram.h" -#include +#include "epan/addr_resolv.h" + +#include "qt_ui_utils.h" #include #include @@ -81,8 +83,10 @@ comment_axis_->grid()->setVisible(false); QFont comment_font = comment_axis_->tickLabelFont(); + comment_font.setPointSizeF(comment_font.pointSizeF() * 0.8); + smooth_font_size(comment_font); comment_axis_->setTickLabelFont(comment_font); - comment_axis_->setSelectedTickLabelFont(QFont(comment_font.family(), comment_font.pointSize(), QFont::Bold)); + comment_axis_->setSelectedTickLabelFont(QFont(comment_font.family(), comment_font.pointSizeF(), QFont::Bold)); // frame_label // port_src -----------------> port_dst @@ -93,6 +97,7 @@ void SequenceDiagram::setData(seq_analysis_info_t *sainfo) { data_->clear(); + WSCPSeqData new_data; double cur_key = 0.0; QVector key_ticks, val_ticks; @@ -109,7 +114,8 @@ key_ticks.append(cur_key); key_labels.append(sai->time_str); - com_labels.append(com_fm.elidedText(sai->comment, Qt::ElideRight, elide_w)); + + com_labels.append(com_fm.elidedText(sai->frame_label, Qt::ElideRight, elide_w)); cur_key++; } @@ -118,6 +124,9 @@ for (unsigned int i = 0; i < sainfo_->num_nodes; i++) { val_ticks.append(i); val_labels.append(get_addr_name(&(sainfo_->nodes[i]))); + if (i % 2 == 0) { + val_labels.last().append("\n"); + } } keyAxis()->setTickVector(key_ticks); keyAxis()->setTickVectorLabels(key_labels); @@ -127,11 +136,27 @@ comment_axis_->setTickVectorLabels(com_labels); } +seq_analysis_item_t *SequenceDiagram::itemForPosY(int ypos) +{ + double key_pos = qRound(key_axis_->pixelToCoord(ypos)); + + if (key_pos >= 0 && key_pos < data_->size()) { + return data_->value(key_pos).value; + } + return NULL; +} + double SequenceDiagram::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const { - Q_UNUSED(pos); - Q_UNUSED(onlySelectable); Q_UNUSED(details); + Q_UNUSED(onlySelectable); + + double key_pos = qRound(key_axis_->pixelToCoord(pos.y())); + + if (key_pos >= 0 && key_pos < data_->size()) { + return 1.0; + } + return -1.0; } @@ -151,20 +176,51 @@ if (sai->src_node > sai->dst_node && (sai->src_node < value_axis_->range().lower || sai->dst_node > value_axis_->range().upper)) { continue; } - double ah_size = (QFontMetrics(comment_axis_->tickLabelFont()).height() / 5) - * ((sai->src_node < sai->dst_node) ? 1 : -1); - QPointF arrow_end(coordsToPixels(cur_key, sai->dst_node)); - QLineF arrow_line(coordsToPixels(cur_key, sai->src_node), arrow_end); - QPolygonF arrow_head; - arrow_head - << QPointF(arrow_end.x() - (ah_size*3), arrow_end.y() - ah_size) - << arrow_end - << QPointF(arrow_end.x() - (ah_size*3), arrow_end.y() + ah_size); + if (mainPen().style() != Qt::NoPen && mainPen().color().alpha() != 0) { + painter->save(); + + QFontMetrics cfm(comment_axis_->tickLabelFont()); + double en_w = cfm.height() / 2.0; + int dir_mul = (sai->src_node < sai->dst_node) ? 1 : -1; + double ah_size = (cfm.height() / 5) * dir_mul; + QPoint arrow_start(coordsToPixels(cur_key, sai->src_node).toPoint()); + arrow_start.setY(arrow_start.y() + (en_w / 2)); + QPoint arrow_end(coordsToPixels(cur_key, sai->dst_node).toPoint()); + arrow_end.setY(arrow_start.y()); + QLine arrow_line(arrow_start, arrow_end); + QPolygon arrow_head; + arrow_head + << QPoint(arrow_end.x() - (ah_size*3), arrow_end.y() - ah_size) + << arrow_end + << QPoint(arrow_end.x() - (ah_size*3), arrow_end.y() + ah_size); + painter->setBrush(mainPen().color()); painter->setPen(mainPen()); painter->drawLine(arrow_line); painter->drawPolygon(arrow_head); + + double comment_start = (sai->src_node < sai->dst_node) + ? arrow_start.x() : arrow_end.x(); + double arrow_width = (arrow_end.x() - arrow_start.x()) * dir_mul; + QString arrow_label = cfm.elidedText(sai->frame_label, Qt::ElideRight, arrow_width); + QPoint text_pt(comment_start + ((arrow_width - cfm.width(arrow_label)) / 2), + arrow_start.y() - (en_w / 2)); + + painter->setFont(comment_axis_->tickLabelFont()); + painter->drawText(text_pt, arrow_label); + + if (sai->port_src && sai->port_dst) { + QString port_num = QString::number(sai->port_src); + text_pt = QPoint(arrow_start.x() - en_w - (cfm.width(port_num) * dir_mul), + arrow_start.y() + (en_w / 2)); + painter->drawText(text_pt, port_num); + + port_num = QString::number(sai->port_dst); + text_pt.setX(arrow_end.x() - en_w + (cfm.width(port_num) * dir_mul)); + painter->drawText(text_pt, port_num); + } + painter->restore(); } } } diff -Nru wireshark-1.12.0~201310251247/ui/qt/sequence_diagram.h wireshark-1.12.0~201311020920/ui/qt/sequence_diagram.h --- wireshark-1.12.0~201310251247/ui/qt/sequence_diagram.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/sequence_diagram.h 2013-11-02 02:12:36.000000000 +0000 @@ -66,6 +66,7 @@ // void setWidth(double width); void setData(seq_analysis_info_t *sainfo); // void setData(const QVector &key, const QVector &value); + seq_analysis_item_t *itemForPosY(int ypos); // non-property methods: // void addData(const WSCPSeqDataMap &dataMap); diff -Nru wireshark-1.12.0~201310251247/ui/qt/sequence_dialog.cpp wireshark-1.12.0~201311020920/ui/qt/sequence_dialog.cpp --- wireshark-1.12.0~201310251247/ui/qt/sequence_dialog.cpp 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/sequence_dialog.cpp 2013-11-02 02:12:36.000000000 +0000 @@ -24,41 +24,55 @@ #include "sequence_dialog.h" #include "ui_sequence_dialog.h" +#include "epan/addr_resolv.h" + #include "wsutil/nstime.h" #include +#include #include // To do: -// - Fix horizontal scrolling +// - Implement controls +// - Make reset button "apply"? // - Save as -// - Sequence item labels -// - Scroll bars -// - Selection +// - Add UTF8 to text dump +// - Fix scroll bar ranges +// - Context menu +// - Selection highlighting // - Keyboard shortcuts // - ... SequenceDialog::SequenceDialog(QWidget *parent, capture_file *cf, SequenceType type) : QDialog(parent), ui(new Ui::SequenceDialog), - cap_file_(cf) + cap_file_(cf), + num_items_(0), + packet_num_(0), + node_label_w_(20) { ui->setupUi(this); QCustomPlot *sp = ui->sequencePlot; - seq_diagram_ = new SequenceDiagram(ui->sequencePlot->yAxis, ui->sequencePlot->xAxis2, - ui->sequencePlot->yAxis2); + seq_diagram_ = new SequenceDiagram(sp->yAxis, sp->xAxis2, sp->yAxis2); sp->addPlottable(seq_diagram_); + sp->axisRect()->setRangeDragAxes(sp->xAxis2, sp->yAxis); sp->xAxis->setVisible(false); + sp->xAxis->setPadding(0); + sp->xAxis->setLabelPadding(0); + sp->xAxis->setTickLabelPadding(0); sp->xAxis2->setVisible(true); sp->yAxis2->setVisible(true); one_em_ = QFontMetrics(sp->yAxis->labelFont()).height(); + ui->horizontalScrollBar->setSingleStep(100 / one_em_); + ui->verticalScrollBar->setSingleStep(100 / one_em_); sp->setInteractions(QCP::iRangeDrag); + ui->gridLayout->setSpacing(0); connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), sp->yAxis2, SLOT(setRange(QCPRange))); memset (&seq_analysis_, 0, sizeof(seq_analysis_)); @@ -79,6 +93,14 @@ resize(parent->width(), parent->height() * 4 / 5); } + connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(hScrollBarChanged(int))); + connect(ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(vScrollBarChanged(int))); + connect(sp->xAxis2, SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisChanged(QCPRange))); + connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(yAxisChanged(QCPRange))); + connect(sp, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(diagramClicked(QMouseEvent*))); + connect(sp, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(mouseMoved(QMouseEvent*))); + connect(sp, SIGNAL(mouseRelease(QMouseEvent*)), this, SLOT(mouseReleased(QMouseEvent*))); + fillDiagram(); } @@ -106,20 +128,126 @@ resetAxes(true); } +void SequenceDialog::mouseReleaseEvent(QMouseEvent *event) +{ + mouseReleased(event); +} + +void SequenceDialog::hScrollBarChanged(int value) +{ + if (qAbs(ui->sequencePlot->xAxis2->range().center()-value/100.0) > 0.01) { + ui->sequencePlot->xAxis2->setRange(value/100.0, ui->sequencePlot->xAxis2->range().size(), Qt::AlignCenter); + ui->sequencePlot->replot(); + } +} + +void SequenceDialog::vScrollBarChanged(int value) +{ + if (qAbs(ui->sequencePlot->yAxis->range().center()-value/100.0) > 0.01) { + ui->sequencePlot->yAxis->setRange(value/100.0, ui->sequencePlot->yAxis->range().size(), Qt::AlignCenter); + ui->sequencePlot->replot(); + } +} + +void SequenceDialog::xAxisChanged(QCPRange range) +{ + ui->horizontalScrollBar->setValue(qRound(range.center()*100.0)); + ui->horizontalScrollBar->setPageStep(qRound(range.size()*100.0)); +} + +void SequenceDialog::yAxisChanged(QCPRange range) +{ + ui->verticalScrollBar->setValue(qRound(range.center()*100.0)); + ui->verticalScrollBar->setPageStep(qRound(range.size()*100.0)); +} + +void SequenceDialog::diagramClicked(QMouseEvent *event) +{ + QCustomPlot *sp = ui->sequencePlot; + +// if (event->button() == Qt::RightButton) { +// // XXX We should find some way to get streamPlot to handle a +// // contextMenuEvent instead. +// ctx_menu_.exec(event->globalPos()); +// } else if (mouse_drags_) { + if (sp->axisRect()->rect().contains(event->pos())) { + sp->setCursor(QCursor(Qt::ClosedHandCursor)); + } + on_actionGoToPacket_triggered(); +// } else { +// if (!rubber_band_) { +// rubber_band_ = new QRubberBand(QRubberBand::Rectangle, ui->streamPlot); +// } +// rb_origin_ = event->pos(); +// rubber_band_->setGeometry(QRect(rb_origin_, QSize())); +// rubber_band_->show(); +// } +} + +void SequenceDialog::mouseMoved(QMouseEvent *event) +{ + QCustomPlot *sp = ui->sequencePlot; + Qt::CursorShape shape = Qt::ArrowCursor; + if (event) { + if (event->buttons().testFlag(Qt::LeftButton)) { + shape = Qt::ClosedHandCursor; + } else { + if (sp->axisRect()->rect().contains(event->pos())) { + shape = Qt::OpenHandCursor; + } + } + } + sp->setCursor(QCursor(shape)); + + packet_num_ = 0; + QString hint; + if (event) { + seq_analysis_item_t *sai = seq_diagram_->itemForPosY(event->pos().y()); + if (sai) { + packet_num_ = sai->fd->num; + hint = QString("Packet %1: %2").arg(packet_num_).arg(sai->comment); + } + } + + if (hint.isEmpty()) { + hint += QString("%1 nodes, %2 items").arg(seq_analysis_.num_nodes).arg(num_items_); + } + + hint.prepend(""); + hint.append(""); + ui->hintLabel->setText(hint); +} + +void SequenceDialog::mouseReleased(QMouseEvent *event) +{ + Q_UNUSED(event); + if (ui->sequencePlot->cursor().shape() == Qt::ClosedHandCursor) { + ui->sequencePlot->setCursor(QCursor(Qt::OpenHandCursor)); + } +} + void SequenceDialog::fillDiagram() { QCustomPlot *sp = ui->sequencePlot; sequence_analysis_list_free(&seq_analysis_); sequence_analysis_list_get(cap_file_, &seq_analysis_); - sequence_analysis_get_nodes(&seq_analysis_); + num_items_ = sequence_analysis_get_nodes(&seq_analysis_); seq_diagram_->setData(&seq_analysis_); -// ui->sequencePlot->rescaleAxes(); - sp->replot(); + QFontMetrics vfm = QFontMetrics(sp->xAxis2->labelFont()); + node_label_w_ = 0; + for (guint i = 0; i < seq_analysis_.num_nodes; i++) { + int label_w = vfm.width(get_addr_name(&(seq_analysis_.nodes[i]))); + if (node_label_w_ < label_w) { + node_label_w_ = label_w; + } + } + node_label_w_ = (node_label_w_ * 3 / 4) + one_em_; + + mouseMoved(NULL); resetAxes(); -// tracer_->setGraph(base_graph_); // XXX QCustomPlot doesn't seem to draw any sort of focus indicator. sp->setFocus(); @@ -128,16 +256,27 @@ void SequenceDialog::resetAxes(bool keep_lower) { QCustomPlot *sp = ui->sequencePlot; - double top_pos = -1.0; + // Allow space for labels on the top and port numbers on the left. + double top_pos = -1.0, left_pos = -0.5; if (keep_lower) { top_pos = sp->yAxis->range().lower; + left_pos = sp->xAxis2->range().lower; } - sp->xAxis->moveRange(sp->xAxis->range().lower * -1); + double range_ratio = sp->xAxis2->axisRect()->width() / node_label_w_; + sp->xAxis2->setRange(left_pos, range_ratio + left_pos); - double range_ratio = sp->yAxis->axisRect()->height() / one_em_; + range_ratio = sp->yAxis->axisRect()->height() / (one_em_ * 1.5); sp->yAxis->setRange(top_pos, range_ratio + top_pos); + double rmin = sp->xAxis2->range().size() / 2; + ui->horizontalScrollBar->setRange((rmin - 0.5) * 100, (seq_analysis_.num_nodes - 0.5 - rmin) * 100); + xAxisChanged(sp->xAxis2->range()); + + rmin = (sp->yAxis->range().size() / 2); + ui->verticalScrollBar->setRange((rmin - 1.0) * 100, (num_items_ - 0.5 - rmin) * 100); + yAxisChanged(sp->yAxis->range()); + sp->replot(); } @@ -145,3 +284,10 @@ { resetAxes(); } + +void SequenceDialog::on_actionGoToPacket_triggered() +{ + if (cap_file_ && packet_num_ > 0) { + emit goToPacket(packet_num_); + } +} diff -Nru wireshark-1.12.0~201310251247/ui/qt/sequence_dialog.h wireshark-1.12.0~201311020920/ui/qt/sequence_dialog.h --- wireshark-1.12.0~201310251247/ui/qt/sequence_dialog.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/sequence_dialog.h 2013-11-02 02:12:36.000000000 +0000 @@ -59,16 +59,29 @@ protected: void showEvent(QShowEvent *event); void resizeEvent(QResizeEvent *event); + void mouseReleaseEvent(QMouseEvent *event); private slots: + void hScrollBarChanged(int value); + void vScrollBarChanged(int value); + void xAxisChanged(QCPRange range); + void yAxisChanged(QCPRange range); + void diagramClicked(QMouseEvent *event); + void mouseMoved(QMouseEvent *event); + void mouseReleased(QMouseEvent *event); + void on_resetButton_clicked(); + void on_actionGoToPacket_triggered(); private: Ui::SequenceDialog *ui; SequenceDiagram *seq_diagram_; capture_file *cap_file_; seq_analysis_info_t seq_analysis_; + int num_items_; + guint32 packet_num_; double one_em_; + int node_label_w_; void fillDiagram(); void resetAxes(bool keep_lower = false); diff -Nru wireshark-1.12.0~201310251247/ui/qt/sequence_dialog.ui wireshark-1.12.0~201311020920/ui/qt/sequence_dialog.ui --- wireshark-1.12.0~201310251247/ui/qt/sequence_dialog.ui 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/sequence_dialog.ui 2013-11-02 02:12:36.000000000 +0000 @@ -15,14 +15,35 @@ - - - - 0 - 1 - - - + + + + + + 0 + 1 + + + + + + + + Qt::Vertical + + + + + + + Qt::Horizontal + + + + + + + @@ -159,6 +180,17 @@ + + + Go To Packet Under Cursor + + + Go to packet currently under the cursor + + + G + + diff -Nru wireshark-1.12.0~201310251247/ui/qt/tcp_stream_dialog.cpp wireshark-1.12.0~201311020920/ui/qt/tcp_stream_dialog.cpp --- wireshark-1.12.0~201310251247/ui/qt/tcp_stream_dialog.cpp 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/tcp_stream_dialog.cpp 2013-11-02 02:12:36.000000000 +0000 @@ -794,7 +794,6 @@ void TCPStreamDialog::graphClicked(QMouseEvent *event) { - Q_UNUSED(event) QCustomPlot *sp = ui->streamPlot; if (event->button() == Qt::RightButton) { diff -Nru wireshark-1.12.0~201310251247/ui/qt/wireshark_application.cpp wireshark-1.12.0~201311020920/ui/qt/wireshark_application.cpp --- wireshark-1.12.0~201310251247/ui/qt/wireshark_application.cpp 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/wireshark_application.cpp 2013-11-02 02:12:36.000000000 +0000 @@ -154,14 +154,6 @@ } } - - -extern gboolean main_do_quit(void) { - WiresharkApplication::quit(); - return FALSE; -} - -// void WiresharkApplication::refreshRecentFiles(void) { recent_item_status *ri; RecentFileStatus *rf_status; @@ -539,6 +531,10 @@ void WiresharkApplication::cleanup() { software_update_cleanup(); + /* write user's recent file to disk + * It is no problem to write this file, even if we do not quit */ + write_profile_recent(); + write_recent(); } void WiresharkApplication::itemStatusFinished(const QString &filename, qint64 size, bool accessible) { @@ -592,7 +588,7 @@ connect(recent_timer_, SIGNAL(timeout()), this, SLOT(refreshRecentFiles())); recent_timer_->start(2000); - connect(this, SIGNAL(aboutToQuit()), this, SLOT(cleanup())); + connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(cleanup())); } void WiresharkApplication::registerUpdate(register_action_e action, const char *message) @@ -614,6 +610,9 @@ case PacketDissectionChanged: emit packetDissectionChanged(); break; + case StaticRecentFilesRead: + emit recentFilesRead(); + break; default: break; } diff -Nru wireshark-1.12.0~201310251247/ui/qt/wireshark_application.h wireshark-1.12.0~201311020920/ui/qt/wireshark_application.h --- wireshark-1.12.0~201310251247/ui/qt/wireshark_application.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/qt/wireshark_application.h 2013-11-02 02:12:36.000000000 +0000 @@ -66,7 +66,8 @@ ColumnsChanged, FilterExpressionsChanged, PacketDissectionChanged, - PreferencesChanged + PreferencesChanged, + StaticRecentFilesRead }; void registerUpdate(register_action_e action, const char *message); @@ -85,6 +86,7 @@ void setMonospaceFont(const char *font_string); int monospaceTextSize(const char *str, bool bold = false); void setConfigurationProfile(const gchar *profile_name); + bool isInitialized() { return initialized_; } private: void prefsToCaptureOpts(); @@ -101,6 +103,7 @@ signals: void appInitialized(); void openCaptureFile(QString &cf_path); + void recentFilesRead(); void updateRecentItemStatus(const QString &filename, qint64 size, bool accessible); void splashUpdate(register_action_e action, const char *message); void configurationProfileChanged(const gchar *profile_name); diff -Nru wireshark-1.12.0~201310251247/ui/tap-rtp-common.c wireshark-1.12.0~201311020920/ui/tap-rtp-common.c --- wireshark-1.12.0~201310251247/ui/tap-rtp-common.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/tap-rtp-common.c 2013-11-02 02:12:36.000000000 +0000 @@ -651,8 +651,8 @@ statinfo->sumtTS += 1.0 * current_time * nominaltime; } - /* Calculate the BW in Kbps adding the IP+UDP header to the RTP -> IP header+8bytes(UDP) */ - statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + pinfo->iphdrlen + 8; + /* Calculate the BW in Kbps adding the IP+UDP header to the RTP -> 20bytes(IP) + 8bytes(UDP) */ + statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + 28; statinfo->bw_history[statinfo->bw_index].time = current_time; /* Check if there are more than 1sec in the history buffer to calculate BW in bps. If so, remove those for the calculation */ @@ -662,7 +662,7 @@ if (statinfo->bw_start_index == BUFF_BW) statinfo->bw_start_index=0; }; /* IP hdr + UDP + RTP */ - statinfo->total_bytes += rtpinfo->info_data_len + pinfo->iphdrlen + 8; + statinfo->total_bytes += rtpinfo->info_data_len + 28; statinfo->bandwidth = (double)(statinfo->total_bytes*8)/1000; statinfo->bw_index++; if (statinfo->bw_index == BUFF_BW) statinfo->bw_index = 0; diff -Nru wireshark-1.12.0~201310251247/ui/tap-sctp-analysis.c wireshark-1.12.0~201311020920/ui/tap-sctp-analysis.c --- wireshark-1.12.0~201310251247/ui/tap-sctp-analysis.c 1970-01-01 00:00:00.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/tap-sctp-analysis.c 2013-11-02 02:12:36.000000000 +0000 @@ -0,0 +1,1391 @@ +/* + * Copyright 2004-2013, Irene Ruengeler + * + * $Id$ + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "config.h" +#include +#include +#include + +#include "epan/packet_info.h" +#include "epan/tap.h" +#include "epan/address.h" +#include "epan/strutil.h" +#include "epan/value_string.h" +#include "ui/tap-sctp-analysis.h" + +#include "ui/simple_dialog.h" + +#define SCTP_ABORT_CHUNK_T_BIT 0x01 + +#define PARAMETER_TYPE_LENGTH 2 +#define PARAMETER_LENGTH_LENGTH 2 +#define PARAMETER_HEADER_LENGTH (PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_LENGTH) + +#define PARAMETER_HEADER_OFFSET 0 +#define PARAMETER_TYPE_OFFSET PARAMETER_HEADER_OFFSET +#define PARAMETER_LENGTH_OFFSET (PARAMETER_TYPE_OFFSET + PARAMETER_TYPE_LENGTH) +#define PARAMETER_VALUE_OFFSET (PARAMETER_LENGTH_OFFSET + PARAMETER_LENGTH_LENGTH) + +#define IPV6_ADDRESS_LENGTH 16 +#define IPV6_ADDRESS_OFFSET PARAMETER_VALUE_OFFSET +#define IPV4_ADDRESS_LENGTH 4 +#define IPV4_ADDRESS_OFFSET PARAMETER_VALUE_OFFSET +#define IPV4ADDRESS_PARAMETER_ID 0x0005 +#define IPV6ADDRESS_PARAMETER_ID 0x0006 + +#define SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH 4 +#define SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET (CHUNK_VALUE_OFFSET + 0) +#define SACK_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH 4 +#define SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET (SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET + \ + SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH) + +#define INIT_CHUNK_INITIAL_TSN_LENGTH 4 +#define INIT_CHUNK_FIXED_PARAMTERS_LENGTH (INIT_CHUNK_INITIATE_TAG_LENGTH + \ + INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH + \ + INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH + \ + INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH + \ + INIT_CHUNK_INITIAL_TSN_LENGTH) +#define CHUNK_HEADER_LENGTH (CHUNK_TYPE_LENGTH + \ + CHUNK_FLAGS_LENGTH + \ + CHUNK_LENGTH_LENGTH) +#define INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET (INIT_CHUNK_INITIAL_TSN_OFFSET + \ + INIT_CHUNK_INITIAL_TSN_LENGTH ) + +static const value_string chunk_type_values[] = { + { SCTP_DATA_CHUNK_ID, "DATA" }, + { SCTP_INIT_CHUNK_ID, "INIT" }, + { SCTP_INIT_ACK_CHUNK_ID, "INIT_ACK" }, + { SCTP_SACK_CHUNK_ID, "SACK" }, + { SCTP_HEARTBEAT_CHUNK_ID, "HEARTBEAT" }, + { SCTP_HEARTBEAT_ACK_CHUNK_ID, "HEARTBEAT_ACK" }, + { SCTP_ABORT_CHUNK_ID, "ABORT" }, + { SCTP_SHUTDOWN_CHUNK_ID, "SHUTDOWN" }, + { SCTP_SHUTDOWN_ACK_CHUNK_ID, "SHUTDOWN_ACK" }, + { SCTP_ERROR_CHUNK_ID, "ERROR" }, + { SCTP_COOKIE_ECHO_CHUNK_ID, "COOKIE_ECHO" }, + { SCTP_COOKIE_ACK_CHUNK_ID, "COOKIE_ACK" }, + { SCTP_ECNE_CHUNK_ID, "ECNE" }, + { SCTP_CWR_CHUNK_ID, "CWR" }, + { SCTP_SHUTDOWN_COMPLETE_CHUNK_ID, "SHUTDOWN_COMPLETE" }, + { SCTP_FORWARD_TSN_CHUNK_ID, "FORWARD TSN" }, + { SCTP_ASCONF_ACK_CHUNK_ID, "ASCONF_ACK" }, + { SCTP_PKTDROP_CHUNK_ID, "PKTDROP" }, + { SCTP_ASCONF_CHUNK_ID, "ASCONF" }, + { SCTP_IETF_EXT, "IETF_EXTENSION" }, + { SCTP_NR_SACK_CHUNK_ID, "NR_SACK" }, + { SCTP_AUTH_CHUNK_ID, "AUTH" }, + { 0, NULL } }; + + +#define FORWARD_STREAM 0 +#define BACKWARD_STREAM 1 +#define FORWARD_ADD_FORWARD_VTAG 2 +#define BACKWARD_ADD_FORWARD_VTAG 3 +#define BACKWARD_ADD_BACKWARD_VTAG 4 +#define ADDRESS_FORWARD_STREAM 5 +#define ADDRESS_BACKWARD_STREAM 6 +#define ADDRESS_FORWARD_ADD_FORWARD_VTAG 7 +#define ADDRESS_BACKWARD_ADD_FORWARD_VTAG 8 +#define ADDRESS_BACKWARD_ADD_BACKWARD_VTAG 9 +#define ASSOC_NOT_FOUND 10 + +static sctp_allassocs_info_t sctp_tapinfo_struct = {0, NULL, FALSE, NULL}; + +static +void free_first(gpointer data, gpointer user_data _U_) +{ + g_free(data); +} + +static void tsn_free(gpointer data, gpointer user_data _U_) +{ + tsn_t *tsn; + + tsn = (tsn_t *) data; + if (tsn->tsns != NULL) + { + g_list_foreach(tsn->tsns, free_first, NULL); + g_list_free(tsn->tsns); + tsn->tsns=NULL; + } +} + + +static void reset(void *arg) +{ + sctp_allassocs_info_t *tapdata = (sctp_allassocs_info_t *)arg; + GList* list; + sctp_assoc_info_t * info; + + list = g_list_first(tapdata->assoc_info_list); + while (list) + { + info = (sctp_assoc_info_t *) (list->data); + + if (info->addr1 != NULL) + { + g_list_foreach(info->addr1, free_first, NULL); + g_list_free(info->addr1); + info->addr1 = NULL; + } + + if (info->addr2 != NULL) + { + g_list_foreach(info->addr2,free_first, NULL); + g_list_free(info->addr2); + info->addr2 = NULL; + } + + if (info->error_info_list != NULL) + { + g_list_foreach(info->error_info_list, free_first, NULL); + g_list_free(info->error_info_list); + info->error_info_list = NULL; + } + + if (info->frame_numbers != NULL) + { + g_list_free(info->frame_numbers); + info->frame_numbers = NULL; + } + + if (info->tsn1 != NULL) + { + g_list_foreach(info->tsn1, tsn_free, NULL); + g_list_free(info->tsn1); + info->tsn1 = NULL; + } + + if (info->tsn2 != NULL) + { + g_list_foreach(info->tsn2, tsn_free, NULL); + g_list_free(info->tsn2); + info->tsn2 = NULL; + } + + if (info->sack1 != NULL) + { + g_list_foreach(info->sack1, tsn_free, NULL); + g_list_free(info->sack1); + info->sack1 = NULL; + } + + if (info->sack2 != NULL) + { + g_list_foreach(info->sack2, tsn_free, NULL); + g_list_free(info->sack2); + info->sack2 = NULL; + } + + if (info->sort_tsn1 != NULL) + g_ptr_array_free(info->sort_tsn1, TRUE); + + if (info->sort_tsn2 != NULL) + g_ptr_array_free(info->sort_tsn2, TRUE); + + if (info->sort_sack1 != NULL) + g_ptr_array_free(info->sort_sack1, TRUE); + + if (info->sort_sack2 != NULL) + g_ptr_array_free(info->sort_sack2, TRUE); + + if (info->min_max != NULL) + { + g_slist_foreach(info->min_max, free_first, NULL); + info->min_max = NULL; + } + + g_free(list->data); + list = g_list_next(list); + } + g_list_free(tapdata->assoc_info_list); + tapdata->sum_tvbs = 0; + tapdata->assoc_info_list = NULL; +} + + +static sctp_assoc_info_t *calc_checksum(struct _sctp_info *check_data, sctp_assoc_info_t *data) +{ + gboolean ok = FALSE; + + if (check_data->adler32_calculated) + { + data->n_adler32_calculated++; + if (check_data->adler32_correct) + data->n_adler32_correct++; + } + if (check_data->crc32c_calculated) + { + data->n_crc32c_calculated++; + if (check_data->crc32c_correct) + data->n_crc32c_correct++; + } + if (data->n_adler32_calculated > 0) + { + if ((float)(data->n_adler32_correct*1.0/data->n_adler32_calculated) > 0.5) + { + g_strlcpy(data->checksum_type,"ADLER32",8); + data->n_checksum_errors=(data->n_adler32_calculated-data->n_adler32_correct); + ok = TRUE; + } + } + + if (data->n_crc32c_calculated>0) + { + if ((float)(data->n_crc32c_correct*1.0/data->n_crc32c_calculated) > 0.5) + { + g_strlcpy(data->checksum_type,"CRC32C",8); + data->n_checksum_errors=data->n_crc32c_calculated-data->n_crc32c_correct; + ok = TRUE; + } + } + + if (!ok) + { + g_strlcpy(data->checksum_type,"UNKNOWN",8); + data->n_checksum_errors=0; + } + + return(data); + +} + + +static gint sctp_assoc_vtag_cmp(const sctp_tmp_info_t *a, const sctp_assoc_info_t *b) +{ + + if (a == NULL || b == NULL) + return(ASSOC_NOT_FOUND); + + if ((a->port1 == b->port1) && + (a->port2 == b->port2) && + (a->verification_tag1 == b->verification_tag1) && a->verification_tag1==0 && a->initiate_tag != 0 && + (a->initiate_tag != b->initiate_tag )) + return(ASSOC_NOT_FOUND); /* two INITs that belong to different assocs */ + + /* assoc known*/ + if ((a->port1 == b->port1) && + (a->port2 == b->port2) && + (a->verification_tag1 == b->verification_tag1) && + ((a->verification_tag1 != 0 || + (b->verification_tag2 != 0)))) + return(FORWARD_STREAM); + + /* ABORT, vtag reflected */ + if ((a->port1 == b->port1) && + (a->port2 == b->port2) && + (a->verification_tag2 == b->verification_tag2) && + (a->verification_tag1 == 0 && b->verification_tag1 != 0)) + return(FORWARD_STREAM); + + if ((a->port1 == b->port2) && + (a->port2 == b->port1) && + (a->verification_tag1 == b->verification_tag2) && + (a->verification_tag1 != 0)) + return(BACKWARD_STREAM); + + if ((a->port1 == b->port2) && + (a->port2 == b->port1) && + (a->verification_tag2 == b->verification_tag1) && + (a->verification_tag2 != 0)) + return(BACKWARD_STREAM); + + /* ABORT, vtag reflected */ + if ((a->port1 == b->port2) && + (a->port2 == b->port1) && + (a->verification_tag2 == b->verification_tag1) && + (a->verification_tag1 == 0 && b->verification_tag2 != 0)) + return(BACKWARD_STREAM); + + /*forward stream verifivation tag can be added*/ + if ((a->port1 == b->port1) && + (a->port2 == b->port2) && + (a->verification_tag1 != 0) && + (b->verification_tag1 == 0) && + (b->verification_tag2 !=0)) + return (FORWARD_ADD_FORWARD_VTAG); + + if ((a->port1 == b->port2) && + (a->port2 == b->port1) && + (a->verification_tag1 == b->verification_tag2) && + (b->verification_tag1 == 0)) + return (BACKWARD_ADD_FORWARD_VTAG); + + /*backward stream verification tag can be added */ + if ((a->port1 == b->port2) && + (a->port2 == b->port1) && + (a->verification_tag1 !=0) && + (b->verification_tag1 != 0) && + (b->verification_tag2 == 0)) + return(BACKWARD_ADD_BACKWARD_VTAG); + + return(ASSOC_NOT_FOUND); +} + +static sctp_assoc_info_t * find_assoc(sctp_tmp_info_t * needle) +{ + sctp_allassocs_info_t *assoc_info; + sctp_assoc_info_t *info = NULL; + GList* list; + guint8 cmp; + + assoc_info = &sctp_tapinfo_struct; + if ((list = g_list_last(assoc_info->assoc_info_list))!=NULL) + { + while (list) + { + cmp=sctp_assoc_vtag_cmp(needle, (sctp_assoc_info_t*)(list->data)); + + switch (cmp) + { + case FORWARD_STREAM: + info = (sctp_assoc_info_t*)(list->data); + info->direction = 1; + return info; + case BACKWARD_STREAM: + info = (sctp_assoc_info_t*)(list->data); + info->direction = 2; + return info; + case FORWARD_ADD_FORWARD_VTAG: + info = (sctp_assoc_info_t*)(list->data); + info->verification_tag1=needle->verification_tag1; + info->direction = 1; + return info; + case BACKWARD_ADD_FORWARD_VTAG: + info = (sctp_assoc_info_t*)(list->data); + info->verification_tag1=needle->verification_tag1; + info->direction = 2; + return info; + case BACKWARD_ADD_BACKWARD_VTAG: + info = (sctp_assoc_info_t*)(list->data); + info->verification_tag2=needle->verification_tag1; + info->direction = 2; + return info; + case ADDRESS_FORWARD_STREAM: + info = (sctp_assoc_info_t*)(list->data); + info->direction = 1; + info->check_address=TRUE; + return info; + case ADDRESS_BACKWARD_STREAM: + info = (sctp_assoc_info_t*)(list->data); + info->direction = 2; + info->check_address=TRUE; + return info; + case ADDRESS_FORWARD_ADD_FORWARD_VTAG: + info = (sctp_assoc_info_t*)(list->data); + info->verification_tag1=needle->verification_tag1; + info->direction = 1; + info->check_address=TRUE; + return info; + case ADDRESS_BACKWARD_ADD_FORWARD_VTAG: + info = (sctp_assoc_info_t*)(list->data); + info->verification_tag1=needle->verification_tag1; + info->direction = 2; + info->check_address=TRUE; + return info; + case ADDRESS_BACKWARD_ADD_BACKWARD_VTAG: + info = (sctp_assoc_info_t*)(list->data); + info->verification_tag2=needle->verification_tag1; + info->direction = 2; + info->check_address=TRUE; + return info; + } + + list = g_list_previous(list); + } + } + return NULL; +} + +static sctp_assoc_info_t * add_chunk_count(address * vadd, sctp_assoc_info_t * info, guint32 direction, guint32 type) +{ + GList *list; + address *v=NULL; + sctp_addr_chunk *ch=NULL; + guint8 * dat; + int i; + + list = g_list_first(info->addr_chunk_count); + + while (list) + { + ch = (sctp_addr_chunk *)(list->data); + if (ch->direction == direction) + { + v = (address *) (ch->addr); + if (ADDRESSES_EQUAL(vadd, v)) + { + if (IS_SCTP_CHUNK_TYPE(type)) + ch->addr_count[type]++; + else + ch->addr_count[OTHER_CHUNKS_INDEX]++; + return info; + } + else + { + list = g_list_next(list); + } + } + else + list = g_list_next(list); + } + ch = (sctp_addr_chunk *)g_malloc(sizeof(sctp_addr_chunk)); + ch->direction = direction; + ch->addr = (address *)g_malloc(sizeof(address)); + ch->addr->type = vadd->type; + ch->addr->len = vadd->len; + dat = (guint8 *)g_malloc(vadd->len); + memcpy(dat, vadd->data, vadd->len); + ch->addr->data = dat; + for (i=0; i < NUM_CHUNKS; i++) + ch->addr_count[i] = 0; + + if (IS_SCTP_CHUNK_TYPE(type)) + ch->addr_count[type]++; + else + ch->addr_count[OTHER_CHUNKS_INDEX]++; + + info->addr_chunk_count = g_list_append(info->addr_chunk_count, ch); + return info; +} + +static sctp_assoc_info_t * add_address(address * vadd, sctp_assoc_info_t *info, guint8 direction) +{ + GList *list; + address *v=NULL; + + if (direction == 1) + list = g_list_first(info->addr1); + else + list = g_list_first(info->addr2); + + while (list) + { + v = (address *) (list->data); + if (ADDRESSES_EQUAL(vadd, v)) { + g_free(vadd); + return info; + } + list = g_list_next(list); + } + + if (direction == 1) + info->addr1 = g_list_append(info->addr1, vadd); + else if (direction==2) + info->addr2 = g_list_append(info->addr2, vadd); + + return info; +} + +static int +packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const void *data) +{ + struct _sctp_info *sctp_info; + guint32 chunk_number = 0, tsnumber,framenumber; + sctp_tmp_info_t tmp_info; + sctp_assoc_info_t *info = NULL; + sctp_error_info_t *error = NULL; + guint16 type, length = 0; + address *store = NULL; + tsn_t *tsn = NULL; + tsn_t *sack = NULL; + guint8 *t_s_n = NULL; + gboolean sackchunk = FALSE; + gboolean datachunk = FALSE; + gboolean forwardchunk = FALSE; + struct tsn_sort *tsn_s; + guint8* addr = NULL; + int i; + guint8 idx = 0; + + sctp_info = (struct _sctp_info *) data; + + framenumber=pinfo->fd->num; + + type = sctp_info->ip_src.type; + + if (type == AT_IPv4) + { + tmp_info.src.type = AT_IPv4; + tmp_info.src.len = 4; + } + else if (type == AT_IPv6) + { + tmp_info.src.type = AT_IPv6; + tmp_info.src.len = 16; + } + else + { + tmp_info.src.type = AT_NONE; + tmp_info.src.len = 0; + } + + addr = (guint8 *)g_malloc(tmp_info.src.len); + memcpy(addr, sctp_info->ip_src.data, tmp_info.src.len); + tmp_info.src.data = addr; + + type = sctp_info->ip_dst.type; + + if (type == AT_IPv4) + { + tmp_info.dst.type = AT_IPv4; + tmp_info.dst.len = 4; + } + else if (type == AT_IPv6) + { + tmp_info.dst.type = AT_IPv6; + tmp_info.dst.len = 16; + } + else + { + tmp_info.dst.type = AT_NONE; + tmp_info.dst.len = 0; + } + + addr = (guint8 *)g_malloc(tmp_info.dst.len); + memcpy(addr, sctp_info->ip_dst.data, tmp_info.dst.len); + tmp_info.dst.data = addr; + + tmp_info.port1 = sctp_info->sport; + tmp_info.port2 = sctp_info->dport; + + if (sctp_info->vtag_reflected) + { + tmp_info.verification_tag2 = sctp_info->verification_tag; + tmp_info.verification_tag1 = 0; + } + else + { + tmp_info.verification_tag1 = sctp_info->verification_tag; + tmp_info.verification_tag2 = 0; + } + tmp_info.n_tvbs = 0; + if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) + { + tmp_info.initiate_tag = tvb_get_ntohl(sctp_info->tvb[0], 4); + } + else + { + tmp_info.initiate_tag = 0; + } + + info = find_assoc(&tmp_info); + if (!info) + { + tmp_info.n_tvbs = sctp_info->number_of_tvbs; + sctp_tapinfo_struct.sum_tvbs+=sctp_info->number_of_tvbs; + + if (sctp_info->number_of_tvbs > 0) + { + info = (sctp_assoc_info_t *)g_malloc(sizeof(sctp_assoc_info_t)); + memset(info, 0, sizeof(sctp_assoc_info_t)); + info->src.type = tmp_info.src.type; + info->src.len = tmp_info.src.len; + addr = (guint8 *)g_malloc(tmp_info.dst.len); + memcpy(addr,(tmp_info.src.data), tmp_info.src.len); + info->src.data = addr; + info->dst.type = tmp_info.dst.type; + info->dst.len = tmp_info.dst.len; + addr = (guint8 *)g_malloc(tmp_info.dst.len); + memcpy(addr, (tmp_info.dst.data), tmp_info.dst.len); + info->dst.data = addr; + info->port1 = tmp_info.port1; + info->port2 = tmp_info.port2; + info->verification_tag1 = tmp_info.verification_tag1; + info->verification_tag2 = tmp_info.verification_tag2; + info->initiate_tag = tmp_info.initiate_tag; + info->n_tvbs = tmp_info.n_tvbs; + info->init = FALSE; + info->initack = FALSE; + info->check_address = FALSE; + info->direction = 0; + info = calc_checksum(sctp_info, info); + info->n_packets = 1; + info->error_info_list = NULL; + info->min_secs = 0xffffffff; + info->min_usecs = 0xffffffff; + info->max_secs = 0; + info->max_usecs = 0; + info->min_tsn2 = 0xFFFFFFFF; + info->min_tsn1 = 0xffffffff; + info->max_tsn1 = 0; + info->max_tsn2 = 0; + info->max_bytes1 = 0; + info->max_bytes2 = 0; + info->n_data_chunks = 0; + info->n_data_bytes = 0; + info->n_data_chunks_ep1 = 0; + info->n_data_bytes_ep1 = 0; + info->n_data_chunks_ep2 = 0; + info->n_data_bytes_ep2 = 0; + info->n_sack_chunks_ep1 = 0; + info->n_sack_chunks_ep2 = 0; + info->n_array_tsn1 = 0; + info->n_array_tsn2 = 0; + info->n_forward_chunks = 0; + info->max_window1 = 0; + info->max_window2 = 0; + info->min_max = NULL; + info->sort_tsn1 = g_ptr_array_new(); + info->sort_tsn2 = g_ptr_array_new(); + info->sort_sack1 = g_ptr_array_new(); + info->sort_sack2 = g_ptr_array_new(); + for (i=0; i < NUM_CHUNKS; i++) + { + info->chunk_count[i] = 0; + info->ep1_chunk_count[i] = 0; + info->ep2_chunk_count[i] = 0; + } + info->addr_chunk_count = NULL; + + if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) + { + tsn = (tsn_t *)g_malloc(sizeof(tsn_t)); + sack = (tsn_t *)g_malloc(sizeof(tsn_t)); + tsn->tsns = NULL; + tsn->first_tsn = 0; + sack->tsns = NULL; + sack->first_tsn = 0; + sack->src.type=tsn->src.type = tmp_info.src.type; + sack->src.len=tsn->src.len = tmp_info.src.len; + addr = (guint8 *)g_malloc(tmp_info.src.len); + memcpy(addr, tmp_info.src.data, tmp_info.src.len); + tsn->src.data = addr; + addr = (guint8 *)g_malloc(tmp_info.src.len); + memcpy(addr, tmp_info.src.data, tmp_info.src.len); + sack->src.data = addr; + sack->dst.type = tsn->dst.type = tmp_info.dst.type; + sack->dst.len =tsn->dst.len = tmp_info.dst.len; + addr = (guint8 *)g_malloc(tmp_info.dst.len); + memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); + tsn->dst.data = addr; + addr = (guint8 *)g_malloc(tmp_info.dst.len); + memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); + sack->dst.data = addr; + sack->secs=tsn->secs = (guint32)pinfo->rel_ts.secs; + sack->usecs=tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; + if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) + { + if (tsn->secs < info->min_secs) + { + info->min_secs = tsn->secs; + info->min_usecs = tsn->usecs; + } + else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) + info->min_usecs = tsn->usecs; + + if (tsn->secs > info->max_secs) + { + info->max_secs = tsn->secs; + info->max_usecs = tsn->usecs; + } + else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) + info->max_usecs = tsn->usecs; + } + + sack->frame_number = tsn->frame_number = pinfo->fd->num; + } + if ((tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) || (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID)) + { + info->min_tsn1 = tvb_get_ntohl(sctp_info->tvb[0],INIT_CHUNK_INITIAL_TSN_OFFSET); + info->verification_tag2 = tvb_get_ntohl(sctp_info->tvb[0], INIT_CHUNK_INITIATE_TAG_OFFSET); + info->instream1 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET); + info->outstream1 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET); + for (chunk_number = 1; chunk_number < sctp_info->number_of_tvbs; chunk_number++) + { + type = tvb_get_ntohs(sctp_info->tvb[chunk_number],0); + if (type == IPV4ADDRESS_PARAMETER_ID) + { + store = (address *)g_malloc(sizeof (address)); + store->type = AT_IPv4; + store->len = 4; + store->data = g_malloc(4); + tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV4_ADDRESS_OFFSET, 4); + info = add_address(store, info, 1); + } + else if (type == IPV6ADDRESS_PARAMETER_ID) + { + store = (address *)g_malloc(sizeof (address)); + store->type = AT_IPv6; + store->len = 16; + store->data = g_malloc(16); + tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV6_ADDRESS_OFFSET, IPV6_ADDRESS_LENGTH); + info = add_address(store, info, 1); + } + } + + if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) + { + info->init = TRUE; + } + else + { + info->initack_dir = 1; + info->initack = TRUE; + } + + idx = tvb_get_guint8(sctp_info->tvb[0],0); + if (!IS_SCTP_CHUNK_TYPE(idx)) + idx = OTHER_CHUNKS_INDEX; + + info->chunk_count[idx]++; + info->ep1_chunk_count[idx]++; + info = add_chunk_count(&tmp_info.src, info, 1, idx); + } + else + { + if (((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_CHUNK_ID) && + ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_ACK_CHUNK_ID) && + ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_DATA_CHUNK_ID) && + ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_SACK_CHUNK_ID) && + ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_NR_SACK_CHUNK_ID) && + ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_FORWARD_TSN_CHUNK_ID)) + { + tsn = (tsn_t *)g_malloc(sizeof(tsn_t)); + sack = (tsn_t *)g_malloc(sizeof(tsn_t)); + tsn->tsns = NULL; + sack->tsns = NULL; + tsn->first_tsn = 0; + sack->first_tsn = 0; + } + for (chunk_number = 0; chunk_number < sctp_info->number_of_tvbs; chunk_number++) + { + idx = tvb_get_guint8(sctp_info->tvb[0],0); + if (!IS_SCTP_CHUNK_TYPE(idx)) + idx = OTHER_CHUNKS_INDEX; + + info->chunk_count[idx]++; + info->ep1_chunk_count[idx]++; + info = add_chunk_count(&tmp_info.src, info, 1, idx); + + if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID)) + { + datachunk = TRUE; + length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; + info->n_data_chunks++; + info->n_data_bytes+=length; + info->outstream1 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; + } + if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_FORWARD_TSN_CHUNK_ID)) + { + forwardchunk = TRUE; + length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET); + info->n_forward_chunks++; + } + if (datachunk || forwardchunk) + { + + tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], DATA_CHUNK_TSN_OFFSET); + if (tsnumber < info->min_tsn1) + info->min_tsn1 = tsnumber; + if (tsnumber > info->max_tsn1) + { + if (datachunk) + { + info->n_data_chunks_ep1++; + info->n_data_bytes_ep1+=length; + } + else + info->n_forward_chunks_ep1++; + info->max_tsn1 = tsnumber; + } + if (tsn->first_tsn == 0) + tsn->first_tsn = tsnumber; + if (datachunk) + { + t_s_n = (guint8 *)g_malloc(16); + tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, 16); + } + else + { + t_s_n = (guint8 *)g_malloc(length); + tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length); + } + tsn->tsns = g_list_append(tsn->tsns, t_s_n); + tsn_s = (struct tsn_sort *)g_malloc(sizeof(struct tsn_sort)); + tsn_s->tsnumber = tsnumber; + tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs; + tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; + tsn_s->offset = 0; + tsn_s->framenumber = framenumber; + if (datachunk) + tsn_s->length = length-DATA_CHUNK_HEADER_LENGTH; + else + tsn_s->length = length; + if (tsn->secs < info->min_secs) + { + info->min_secs = tsn->secs; + info->min_usecs = tsn->usecs; + } + else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) + info->min_usecs = tsn->usecs; + + if (tsn->secs > info->max_secs) + { + info->max_secs = tsn->secs; + info->max_usecs = tsn->usecs; + } + else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) + info->max_usecs = tsn->usecs; + g_ptr_array_add(info->sort_tsn1, tsn_s); + info->n_array_tsn1++; + } + if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_SACK_CHUNK_ID) || + (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_NR_SACK_CHUNK_ID) ) + { + tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET); + if (tsnumber < info->min_tsn2) + info->min_tsn2 = tsnumber; + if (tsnumber > info->max_tsn2) + info->max_tsn2 = tsnumber; + length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET); + if (sack->first_tsn == 0) + sack->first_tsn = tsnumber; + t_s_n = (guint8 *)g_malloc(length); + tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length); + sack->tsns = g_list_append(sack->tsns, t_s_n); + sackchunk = TRUE; + tsn_s = (struct tsn_sort *)g_malloc(sizeof(struct tsn_sort)); + tsn_s->tsnumber = tsnumber; + tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs; + tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; + tsn_s->offset = 0; + tsn_s->framenumber = framenumber; + tsn_s->length = tvb_get_ntohl(sctp_info->tvb[chunk_number], SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET); + if (tsn_s->length > info->max_window1) + info->max_window1 = tsn_s->length; + if (tsn->secs < info->min_secs) + { + info->min_secs = tsn->secs; + info->min_usecs = tsn->usecs; + } + else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) + info->min_usecs = tsn->usecs; + + if (tsn->secs > info->max_secs) + { + info->max_secs = tsn->secs; + info->max_usecs = tsn->usecs; + } + else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) + info->max_usecs = tsn->usecs; + g_ptr_array_add(info->sort_sack2, tsn_s); + info->n_sack_chunks_ep2++; + } + } + } + if (info->verification_tag1 != 0 || info->verification_tag2 != 0) + { + store = (address *)g_malloc(sizeof (address)); + store->type = tmp_info.src.type; + store->len = tmp_info.src.len; + addr = (guint8 *)g_malloc(tmp_info.src.len); + memcpy(addr,(tmp_info.src.data),tmp_info.src.len); + store->data = addr; + info = add_address(store, info, 1); + store = (address *)g_malloc(sizeof (address)); + store->type = tmp_info.dst.type; + store->len = tmp_info.dst.len; + addr = (guint8 *)g_malloc(tmp_info.dst.len); + memcpy(addr,(tmp_info.dst.data),tmp_info.dst.len); + store->data = addr; + info = add_address(store, info, 2); + info->frame_numbers=g_list_prepend(info->frame_numbers,&(pinfo->fd->num)); + if (datachunk || forwardchunk) + info->tsn1 = g_list_prepend(info->tsn1, tsn); + if (sackchunk == TRUE) + info->sack2 = g_list_prepend(info->sack2, sack); + sctp_tapinfo_struct.assoc_info_list = g_list_append(sctp_tapinfo_struct.assoc_info_list, info); + } + else + { + error = (sctp_error_info_t *)g_malloc(sizeof(sctp_error_info_t)); + error->frame_number = pinfo->fd->num; + error->chunk_info[0] = '\0'; + if ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) + g_strlcpy(error->chunk_info, val_to_str(tvb_get_guint8(sctp_info->tvb[0],0),chunk_type_values,"Reserved"), 200); + else + for (chunk_number = 0; chunk_number < sctp_info->number_of_tvbs; chunk_number++) + g_strlcat(error->chunk_info, val_to_str(tvb_get_guint8(sctp_info->tvb[chunk_number],0),chunk_type_values,"Reserved"), 200); + error->info_text = "INFOS"; + info->error_info_list = g_list_append(info->error_info_list, error); + } + } + } /* endif (!info) */ + else + { + if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) + { + + tsn = (tsn_t *)g_malloc(sizeof(tsn_t)); + sack = (tsn_t *)g_malloc(sizeof(tsn_t)); + tsn->tsns = NULL; + tsn->first_tsn = 0; + sack->tsns = NULL; + sack->first_tsn = 0; + sack->src.type = tsn->src.type = tmp_info.src.type; + sack->src.len = tsn->src.len = tmp_info.src.len; + addr = (guint8 *)g_malloc(tmp_info.src.len); + memcpy(addr, tmp_info.src.data, tmp_info.src.len); + tsn->src.data = addr; + addr = (guint8 *)g_malloc(tmp_info.src.len); + memcpy(addr, tmp_info.src.data, tmp_info.src.len); + sack->src.data = addr; + sack->dst.type = tsn->dst.type = tmp_info.dst.type; + sack->dst.len = tsn->dst.len = tmp_info.dst.len; + addr = (guint8 *)g_malloc(tmp_info.dst.len); + memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); + tsn->dst.data = addr; + addr = (guint8 *)g_malloc(tmp_info.dst.len); + memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); + sack->dst.data = addr; + sack->secs=tsn->secs = (guint32)pinfo->rel_ts.secs; + sack->usecs=tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; + if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) + { + if (tsn->secs < info->min_secs) + { + info->min_secs = tsn->secs; + info->min_usecs = tsn->usecs; + } + else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) + info->min_usecs = tsn->usecs; + + if (tsn->secs > info->max_secs) + { + info->max_secs = tsn->secs; + info->max_usecs = tsn->usecs; + } + else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) + info->max_usecs = tsn->usecs; + } + sack->frame_number = tsn->frame_number = pinfo->fd->num; + } + info->frame_numbers = g_list_prepend(info->frame_numbers,&(pinfo->fd->num)); + + store = (address *)g_malloc(sizeof (address)); + store->type = tmp_info.src.type; + store->len = tmp_info.src.len; + addr = (guint8 *)g_malloc(tmp_info.src.len); + memcpy(addr,(tmp_info.src.data),tmp_info.src.len); + store->data = addr; + + if (info->direction == 1) + info = add_address(store, info, 1); + else if (info->direction == 2) + info = add_address(store, info, 2); + + store = (address *)g_malloc(sizeof (address)); + store->type = tmp_info.dst.type; + store->len = tmp_info.dst.len; + addr = (guint8 *)g_malloc(tmp_info.dst.len); + memcpy(addr,(tmp_info.dst.data),tmp_info.dst.len); + store->data = addr; + + if (info->direction == 1) + info = add_address(store, info, 2); + else if (info->direction == 2) + info = add_address(store, info, 1); + + if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) || + ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID)) + { + tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], INIT_CHUNK_INITIAL_TSN_OFFSET); + + if (info->direction == 2) + { + if (tsnumber < info->min_tsn2) + info->min_tsn2 = tsnumber; + if (tsnumber > info->max_tsn2) + info->max_tsn2 = tsnumber; + info->instream2 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET); + info->outstream2 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET); + /*info->initack_dir=2;*/ + info->tsn2 = g_list_prepend(info->tsn2, tsn); + } + else if (info->direction == 1) + { + if (tsnumber < info->min_tsn1) + info->min_tsn1 = tsnumber; + if (tsnumber > info->max_tsn1) + info->max_tsn1 = tsnumber; + info->instream1 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET); + info->outstream1 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET); + /*info->initack_dir=1;*/ + info->tsn1 = g_list_prepend(info->tsn1, tsn); + } + + idx = tvb_get_guint8(sctp_info->tvb[0],0); + if (!IS_SCTP_CHUNK_TYPE(idx)) + idx = OTHER_CHUNKS_INDEX; + info->chunk_count[idx]++; + if (info->direction == 1) + info->ep1_chunk_count[idx]++; + else + info->ep2_chunk_count[idx]++; + info = add_chunk_count(&tmp_info.src, info, info->direction, idx); + for (chunk_number = 1; chunk_number < sctp_info->number_of_tvbs; chunk_number++) + { + type = tvb_get_ntohs(sctp_info->tvb[chunk_number],0); + if (type == IPV4ADDRESS_PARAMETER_ID) + { + store = (address *)g_malloc(sizeof (address)); + store->type = AT_IPv4; + store->len = 4; + store->data = g_malloc(4); + tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV4_ADDRESS_OFFSET, 4); + info = add_address(store, info, info->direction); + } + else if (type == IPV6ADDRESS_PARAMETER_ID) + { + store = (address *)g_malloc(sizeof (address)); + store->type = AT_IPv6; + store->len = 16; + store->data = g_malloc(16); + tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV6_ADDRESS_OFFSET, IPV6_ADDRESS_LENGTH); + info = add_address(store, info, info->direction); + } + } + if ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) + { + info->initack = TRUE; + info->initack_dir = info->direction; + } + else + if ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) + { + info->init = TRUE; + } + } + else + { + if (((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_ACK_CHUNK_ID) && + ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_DATA_CHUNK_ID) && + ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_SACK_CHUNK_ID) && + ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_NR_SACK_CHUNK_ID) && + ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_FORWARD_TSN_CHUNK_ID)) + { + sack = (tsn_t *)g_malloc(sizeof(tsn_t)); + sack->tsns = NULL; + sack->first_tsn = 0; + tsn = (tsn_t *)g_malloc(sizeof(tsn_t)); + tsn->tsns = NULL; + tsn->first_tsn = 0; + } + for (chunk_number = 0; chunk_number < sctp_info->number_of_tvbs; chunk_number++) + { + idx = tvb_get_guint8(sctp_info->tvb[chunk_number],0); + if (!IS_SCTP_CHUNK_TYPE(idx)) + idx = OTHER_CHUNKS_INDEX; + + info->chunk_count[idx]++; + if (info->direction == 1) + info->ep1_chunk_count[idx]++; + else + info->ep2_chunk_count[idx]++; + info = add_chunk_count(&tmp_info.src, info,info->direction, idx); + + if (((tvb_get_guint8(sctp_info->tvb[chunk_number],0)) == SCTP_DATA_CHUNK_ID)) + datachunk = TRUE; + if (((tvb_get_guint8(sctp_info->tvb[chunk_number],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) + forwardchunk = TRUE; + if (datachunk || forwardchunk) + { + tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], DATA_CHUNK_TSN_OFFSET); + if (tsn->first_tsn == 0) + tsn->first_tsn = tsnumber; + if (datachunk) + { + t_s_n = (guint8 *)g_malloc(16); + tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, 16); + length=tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; + info->n_data_chunks++; + info->n_data_bytes+=length; + } + else + { + length=tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET); + t_s_n = (guint8 *)g_malloc(length); + tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length); + info->n_forward_chunks++; + } + tsn->tsns = g_list_append(tsn->tsns, t_s_n); + + tsn_s = (struct tsn_sort *)g_malloc(sizeof(struct tsn_sort)); + tsn_s->tsnumber = tsnumber; + tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs; + tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; + tsn_s->offset = 0; + tsn_s->framenumber = framenumber; + tsn_s->length = length; + + if (tsn->secs < info->min_secs) + { + info->min_secs = tsn->secs; + info->min_usecs = tsn->usecs; + } + else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) + info->min_usecs = tsn->usecs; + + if (tsn->secs > info->max_secs) + { + info->max_secs = tsn->secs; + info->max_usecs = tsn->usecs; + } + else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) + info->max_usecs = tsn->usecs; + + if (info->direction == 1) + { + if(tsnumber < info->min_tsn1) + info->min_tsn1 = tsnumber; + if ((info->init == TRUE || (info->initack == TRUE && info->initack_dir == 1))&& tsnumber >= info->min_tsn1 && tsnumber <= info->max_tsn1) + { + if (datachunk) + { + info->n_data_chunks_ep1++; + info->n_data_bytes_ep1 += length; + } + else if (forwardchunk) + { + info->n_forward_chunks_ep1++; + } + } + if(tsnumber > info->max_tsn1) + { + info->max_tsn1 = tsnumber; + if (datachunk) + { + info->n_data_chunks_ep1++; + info->n_data_bytes_ep1 += length; + } + else if (forwardchunk) + { + info->n_forward_chunks_ep1++; + } + } + if (datachunk) + { + if (info->init == FALSE) + info->outstream1 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; + if (info->initack == FALSE) + info->instream2 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; + } + + g_ptr_array_add(info->sort_tsn1, tsn_s); + info->n_array_tsn1++; + } + else if (info->direction == 2) + { + + if(tsnumber < info->min_tsn2) + info->min_tsn2 = tsnumber; + + if ((info->initack == TRUE && info->initack_dir == 2)&& tsnumber >= info->min_tsn2 && tsnumber <= info->max_tsn2) + { + if (datachunk) + { + length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; + info->n_data_chunks_ep2++; + info->n_data_bytes_ep2+=length; + } + else if (forwardchunk) + { + info->n_forward_chunks_ep2++; + } + } + if(tsnumber > info->max_tsn2) + { + info->max_tsn2 = tsnumber; + if (datachunk) + { + length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; + info->n_data_chunks_ep2++; + info->n_data_bytes_ep2+=length; + } + else if (forwardchunk) + { + info->n_forward_chunks_ep2++; + } + } + if (datachunk) + { + if (info->init == FALSE) + info->instream1 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; + if (info->initack == FALSE) + info->outstream2 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; + } + + g_ptr_array_add(info->sort_tsn2, tsn_s); + info->n_array_tsn2++; + } + } + else if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_SACK_CHUNK_ID) || + (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_NR_SACK_CHUNK_ID)) + { + tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET); + length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET); + if (sack->first_tsn == 0) + sack->first_tsn = tsnumber; + t_s_n = (guint8 *)g_malloc(length); + tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length); + sack->tsns = g_list_append(sack->tsns, t_s_n); + sackchunk = TRUE; + tsn_s = (struct tsn_sort *)g_malloc(sizeof(struct tsn_sort)); + tsn_s->tsnumber = tsnumber; + tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs; + tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; + tsn_s->offset = 0; + tsn_s->framenumber = framenumber; + tsn_s->length = tvb_get_ntohl(sctp_info->tvb[chunk_number], SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET); + + if (tsn->secs < info->min_secs) + { + info->min_secs = tsn->secs; + info->min_usecs = tsn->usecs; + } + else if (tsn->secs == info->min_secs && tsn->usecs < info->min_usecs) + info->min_usecs = tsn->usecs; + + if (tsn->secs > info->max_secs) + { + info->max_secs = tsn->secs; + info->max_usecs = tsn->usecs; + } + else if (tsn->secs == info->max_secs && tsn->usecs > info->max_usecs) + info->max_usecs = tsn->usecs; + + + if (info->direction == 2) + { + if(tsnumber < info->min_tsn1) + info->min_tsn1 = tsnumber; + if(tsnumber > info->max_tsn1) + info->max_tsn1 = tsnumber; + if (tsn_s->length > info->max_window1) + info->max_window1 = tsn_s->length; + g_ptr_array_add(info->sort_sack1, tsn_s); + info->n_sack_chunks_ep1++; + } + else if (info->direction == 1) + { + + if(tsnumber < info->min_tsn2) + info->min_tsn2 = tsnumber; + if(tsnumber > info->max_tsn2) + info->max_tsn2 = tsnumber; + if (tsn_s->length > info->max_window2) + info->max_window2 = tsn_s->length; + g_ptr_array_add(info->sort_sack2, tsn_s); + info->n_sack_chunks_ep2++; + } + + } + } + + } + if (datachunk || forwardchunk) + { + if (info->direction == 1) + info->tsn1 = g_list_prepend(info->tsn1, tsn); + else if (info->direction == 2) + info->tsn2 = g_list_prepend(info->tsn2, tsn); + } + if (sackchunk == TRUE) + { + if (info->direction == 1) + info->sack2 = g_list_prepend(info->sack2, sack); + else if(info->direction == 2) + info->sack1 = g_list_prepend(info->sack1, sack); + } + info->n_tvbs += sctp_info->number_of_tvbs; + sctp_tapinfo_struct.sum_tvbs += sctp_info->number_of_tvbs; + info = calc_checksum(sctp_info, info); + info->n_packets++; + } + return(1); +} + + +/****************************************************************************/ +void +remove_tap_listener_sctp_stat(void) +{ + if (sctp_tapinfo_struct.is_registered) { + remove_tap_listener(&sctp_tapinfo_struct); + sctp_tapinfo_struct.is_registered = FALSE; + } +} + + +void sctp_stat_scan(void) +{ + if (!sctp_tapinfo_struct.is_registered) + register_tap_listener_sctp_stat(); +} + +const sctp_allassocs_info_t* sctp_stat_get_info(void) +{ + return &sctp_tapinfo_struct; +} + + +/*static void +sctp_update(void *dummy _U_) +{ + if (get_stat_dlg()!=NULL) + sctp_stat_dlg_update(); +}*/ + +void +register_tap_listener_sctp_stat(void) +{ + GString *error_string; + + if (!sctp_tapinfo_struct.is_registered) + { + if ((error_string = register_tap_listener("sctp", &sctp_tapinfo_struct, NULL, 0, reset, packet, NULL))) { + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str); + g_string_free(error_string, TRUE); + return; + } + sctp_tapinfo_struct.is_registered=TRUE; + } +} diff -Nru wireshark-1.12.0~201310251247/ui/tap-sctp-analysis.h wireshark-1.12.0~201311020920/ui/tap-sctp-analysis.h --- wireshark-1.12.0~201310251247/ui/tap-sctp-analysis.h 1970-01-01 00:00:00.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/tap-sctp-analysis.h 2013-11-02 02:12:36.000000000 +0000 @@ -0,0 +1,316 @@ +/* + * Copyright 2004-2013, Irene Ruengeler + * + * $Id$ + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __TAP_SCTP_ANALYSIS_H__ +#define __TAP_SCTP_ANALYSIS_H__ + +#include +#include +#ifndef _WIN32 +#include +#include +#include +#else +#ifdef HAVE_WINSOCK2_H +#include +#endif +#endif + +#define SCTP_DATA_CHUNK_ID 0 +#define SCTP_INIT_CHUNK_ID 1 +#define SCTP_INIT_ACK_CHUNK_ID 2 +#define SCTP_SACK_CHUNK_ID 3 +#define SCTP_HEARTBEAT_CHUNK_ID 4 +#define SCTP_HEARTBEAT_ACK_CHUNK_ID 5 +#define SCTP_ABORT_CHUNK_ID 6 +#define SCTP_SHUTDOWN_CHUNK_ID 7 +#define SCTP_SHUTDOWN_ACK_CHUNK_ID 8 +#define SCTP_ERROR_CHUNK_ID 9 +#define SCTP_COOKIE_ECHO_CHUNK_ID 10 +#define SCTP_COOKIE_ACK_CHUNK_ID 11 +#define SCTP_ECNE_CHUNK_ID 12 +#define SCTP_CWR_CHUNK_ID 13 +#define SCTP_SHUTDOWN_COMPLETE_CHUNK_ID 14 +#define SCTP_AUTH_CHUNK_ID 15 +#define SCTP_NR_SACK_CHUNK_ID 16 +#define SCTP_FORWARD_TSN_CHUNK_ID 0xc0 +#define SCTP_ASCONF_ACK_CHUNK_ID 0x80 +#define SCTP_PKTDROP_CHUNK_ID 0x81 +#define SCTP_ASCONF_CHUNK_ID 0xc1 +#define SCTP_IETF_EXT 255 + +#define IS_SCTP_CHUNK_TYPE(t) \ + (((t) <= 16) || ((t) == 0xC0) || ((t) == 0xC1) || ((t) == 0x80) || ((t) == 0x81)) + +#define CHUNK_TYPE_LENGTH 1 +#define CHUNK_FLAGS_LENGTH 1 +#define CHUNK_LENGTH_LENGTH 2 + +#define CHUNK_HEADER_OFFSET 0 +#define CHUNK_TYPE_OFFSET CHUNK_HEADER_OFFSET +#define CHUNK_FLAGS_OFFSET (CHUNK_TYPE_OFFSET + CHUNK_TYPE_LENGTH) +#define CHUNK_LENGTH_OFFSET (CHUNK_FLAGS_OFFSET + CHUNK_FLAGS_LENGTH) +#define CHUNK_VALUE_OFFSET (CHUNK_LENGTH_OFFSET + CHUNK_LENGTH_LENGTH) + +#define INIT_CHUNK_INITIATE_TAG_LENGTH 4 +#define INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH 4 +#define INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH 2 +#define INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH 2 + + +#define INIT_CHUNK_INITIATE_TAG_OFFSET CHUNK_VALUE_OFFSET +#define INIT_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET (INIT_CHUNK_INITIATE_TAG_OFFSET + \ + INIT_CHUNK_INITIATE_TAG_LENGTH ) +#define INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET (INIT_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET + \ + INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH ) +#define INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET (INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET + \ + INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH ) +#define INIT_CHUNK_INITIAL_TSN_OFFSET (INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET + \ + INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH ) + +#define DATA_CHUNK_TSN_LENGTH 4 +#define DATA_CHUNK_TSN_OFFSET (CHUNK_VALUE_OFFSET + 0) +#define DATA_CHUNK_STREAM_ID_OFFSET (DATA_CHUNK_TSN_OFFSET + DATA_CHUNK_TSN_LENGTH) +#define DATA_CHUNK_STREAM_ID_LENGTH 2 +#define DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH 2 +#define DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH 4 +#define DATA_CHUNK_HEADER_LENGTH (CHUNK_HEADER_LENGTH + \ + DATA_CHUNK_TSN_LENGTH + \ + DATA_CHUNK_STREAM_ID_LENGTH + \ + DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH + \ + DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) +#define MAX_ADDRESS_LEN 47 + +#define SCTP_ABORT_CHUNK_T_BIT 0x01 + +#define PARAMETER_TYPE_LENGTH 2 +#define PARAMETER_LENGTH_LENGTH 2 +#define PARAMETER_HEADER_LENGTH (PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_LENGTH) + +#define PARAMETER_HEADER_OFFSET 0 +#define PARAMETER_TYPE_OFFSET PARAMETER_HEADER_OFFSET +#define PARAMETER_LENGTH_OFFSET (PARAMETER_TYPE_OFFSET + PARAMETER_TYPE_LENGTH) +#define PARAMETER_VALUE_OFFSET (PARAMETER_LENGTH_OFFSET + PARAMETER_LENGTH_LENGTH) + +#define IPV6_ADDRESS_LENGTH 16 +#define IPV6_ADDRESS_OFFSET PARAMETER_VALUE_OFFSET +#define IPV4_ADDRESS_LENGTH 4 +#define IPV4_ADDRESS_OFFSET PARAMETER_VALUE_OFFSET +#define IPV4ADDRESS_PARAMETER_ID 0x0005 +#define IPV6ADDRESS_PARAMETER_ID 0x0006 + +#define SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH 4 +#define SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET (CHUNK_VALUE_OFFSET + 0) +#define SACK_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH 4 +#define SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET (SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET + \ + SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH) + +#define INIT_CHUNK_INITIAL_TSN_LENGTH 4 +#define INIT_CHUNK_FIXED_PARAMTERS_LENGTH (INIT_CHUNK_INITIATE_TAG_LENGTH + \ + INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH + \ + INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH + \ + INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH + \ + INIT_CHUNK_INITIAL_TSN_LENGTH) +#define CHUNK_HEADER_LENGTH (CHUNK_TYPE_LENGTH + \ + CHUNK_FLAGS_LENGTH + \ + CHUNK_LENGTH_LENGTH) +#define INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET (INIT_CHUNK_INITIAL_TSN_OFFSET + \ + INIT_CHUNK_INITIAL_TSN_LENGTH ) + +/* The below value is 256 */ +#define NUM_CHUNKS 0xff + +/* This variable is used as an index into arrays + * which store the cumulative information corresponding + * all chunks with Chunk Type greater > 16 + * The value for the below variable is 17 + */ +#define OTHER_CHUNKS_INDEX 0xfe + +/* VNB */ +/* This variable stores the maximum chunk type value + * that can be associated with a sctp chunk. + */ +#define MAX_SCTP_CHUNK_TYPE 256 + +typedef struct _tsn { + guint32 frame_number; + guint32 secs; /* Absolute seconds */ + guint32 usecs; + address src; + address dst; + guint32 first_tsn; + GList *tsns; +} tsn_t; + +typedef struct _sctp_tmp_info { + address src; + address dst; + guint16 port1; + guint16 port2; + guint32 verification_tag1; + guint32 verification_tag2; + guint32 initiate_tag; + guint32 n_tvbs; +} sctp_tmp_info_t; + +typedef struct _sctp_min_max { + guint32 tmp_min_secs; + guint32 tmp_min_usecs; + guint32 tmp_max_secs; + guint32 tmp_max_usecs; + guint32 tmp_min_tsn1; + guint32 tmp_min_tsn2; + guint32 tmp_max_tsn1; + guint32 tmp_max_tsn2; + gint tmp_secs; +} sctp_min_max_t; + +struct tsn_sort{ + guint32 tsnumber; + guint32 secs; + guint32 usecs; + guint32 offset; + guint32 length; + guint32 framenumber; +}; + +typedef struct _sctp_addr_chunk { + guint32 direction; + address* addr; + /* The array is initialized to MAX_SCTP_CHUNK_TYPE + * so that there is no memory overwrite + * when accessed using sctp chunk type as index. + */ + guint32 addr_count[MAX_SCTP_CHUNK_TYPE]; +} sctp_addr_chunk; + +typedef struct _sctp_assoc_info { + address src; + address dst; + guint16 port1; + guint16 port2; + guint32 verification_tag1; + guint32 verification_tag2; + guint32 initiate_tag; + guint32 n_tvbs; + GList *addr1; + GList *addr2; + guint16 instream1; + guint16 outstream1; + guint16 instream2; + guint16 outstream2; + guint32 n_adler32_calculated; + guint32 n_adler32_correct; + guint32 n_crc32c_calculated; + guint32 n_crc32c_correct; + gchar checksum_type[8]; + guint32 n_checksum_errors; + guint32 n_bundling_errors; + guint32 n_padding_errors; + guint32 n_length_errors; + guint32 n_value_errors; + guint32 n_data_chunks; + guint32 n_forward_chunks; + guint32 n_forward_chunks_ep1; + guint32 n_forward_chunks_ep2; + guint32 n_data_bytes; + guint32 n_packets; + guint32 n_data_chunks_ep1; + guint32 n_data_bytes_ep1; + guint32 n_data_chunks_ep2; + guint32 n_data_bytes_ep2; + guint32 n_sack_chunks_ep1; + guint32 n_sack_chunks_ep2; + guint32 n_array_tsn1; + guint32 n_array_tsn2; + guint32 max_window1; + guint32 max_window2; + gboolean init; + gboolean initack; + guint8 initack_dir; + guint8 direction; + guint32 min_secs; + guint32 min_usecs; + guint32 max_secs; + guint32 max_usecs; + guint32 min_tsn1; + guint32 min_tsn2; + guint32 max_tsn1; + guint32 max_tsn2; + guint32 max_bytes1; + guint32 max_bytes2; + GSList *min_max; + GList *frame_numbers; + GList *tsn1; + GPtrArray *sort_tsn1; + GPtrArray *sort_sack1; + GList *sack1; + GList *tsn2; + GPtrArray *sort_tsn2; + GPtrArray *sort_sack2; + GList *sack2; + gboolean check_address; + GList* error_info_list; + /* The array is initialized to MAX_SCTP_CHUNK_TYPE + * so that there is no memory overwrite + * when accessed using sctp chunk type as index. + */ + guint32 chunk_count[MAX_SCTP_CHUNK_TYPE]; + guint32 ep1_chunk_count[MAX_SCTP_CHUNK_TYPE]; + guint32 ep2_chunk_count[MAX_SCTP_CHUNK_TYPE]; + GList* addr_chunk_count; +} sctp_assoc_info_t; + +typedef struct _sctp_error_info { + guint32 frame_number; + gchar chunk_info[200]; + const gchar *info_text; +} sctp_error_info_t; + + +typedef struct _sctp_allassocs_info { + guint32 sum_tvbs; + GList* assoc_info_list; + gboolean is_registered; + GList* children; +} sctp_allassocs_info_t; + + + +void register_tap_listener_sctp_stat(void); + +const sctp_allassocs_info_t* sctp_stat_get_info(void); + +void sctp_stat_scan(void); + +void remove_tap_listener_sctp_stat(void); + + +const sctp_assoc_info_t* get_selected_assoc(void); + + + + +#endif /* __TAP_SCTP_ANALYSIS_H__ */ diff -Nru wireshark-1.12.0~201310251247/ui/tap-sequence-analysis.c wireshark-1.12.0~201311020920/ui/tap-sequence-analysis.c --- wireshark-1.12.0~201310251247/ui/tap-sequence-analysis.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/tap-sequence-analysis.c 2013-11-02 02:12:36.000000000 +0000 @@ -115,17 +115,17 @@ if (colinfo != NULL) { if (protocol != NULL) { - sai->frame_label = g_strdup_printf("%.19s", colinfo); + sai->frame_label = g_strdup(colinfo); sai->comment = g_strdup_printf("%s: %s", protocol, colinfo); } else { - sai->frame_label = g_strdup_printf("%.19s", colinfo); - sai->comment = g_strdup_printf("%s", colinfo); + sai->frame_label = g_strdup(colinfo); + sai->comment = g_strdup(colinfo); } } else { /* This will probably never happen...*/ if (protocol != NULL) { - sai->frame_label = g_strdup_printf("%.19s", protocol); - sai->comment = g_strdup_printf("%s", protocol); + sai->frame_label = g_strdup(protocol); + sai->comment = g_strdup(protocol); } } diff -Nru wireshark-1.12.0~201310251247/ui/tap-sequence-analysis.h wireshark-1.12.0~201311020920/ui/tap-sequence-analysis.h --- wireshark-1.12.0~201310251247/ui/tap-sequence-analysis.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/tap-sequence-analysis.h 2013-11-02 02:12:36.000000000 +0000 @@ -59,7 +59,7 @@ guint16 port_dst; gchar *frame_label; /**< the label on top of the arrow */ gchar *time_str; /**< timestamp */ - gchar *comment; /**< a comment that appears at the left of the graph */ + gchar *comment; /**< a comment that appears at the right of the graph */ guint16 conv_num; /**< the conversation number, each conversation will be colored */ gboolean display; /**< indicate if the packet is displayed or not in the graph */ guint16 src_node; /**< this is used by graph_analysis.c to identify the node */ diff -Nru wireshark-1.12.0~201310251247/ui/ui_util.h wireshark-1.12.0~201311020920/ui/ui_util.h --- wireshark-1.12.0~201310251247/ui/ui_util.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/ui/ui_util.h 2013-11-02 02:12:36.000000000 +0000 @@ -49,8 +49,6 @@ /* update the main window */ extern void main_window_update(void); -/* exit the main window */ -extern void main_window_exit(void); /* quit a nested main window */ extern void main_window_nested_quit(void); /* quit the main window */ diff -Nru wireshark-1.12.0~201310251247/version_info.c wireshark-1.12.0~201311020920/version_info.c --- wireshark-1.12.0~201310251247/version_info.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/version_info.c 2013-11-02 02:12:36.000000000 +0000 @@ -142,6 +142,8 @@ g_string_append(str, "without libz"); #endif /* HAVE_LIBZ */ +#ifndef _WIN32 + /* This is UN*X-only. */ /* LIBCAP */ g_string_append(str, ", "); #ifdef HAVE_LIBCAP @@ -152,7 +154,10 @@ #else /* HAVE_LIBCAP */ g_string_append(str, "without POSIX capabilities"); #endif /* HAVE_LIBCAP */ +#endif /* _WIN32 */ +#ifdef __linux__ + /* This is a Linux-specific library. */ /* LIBNL */ g_string_append(str, ", "); #if defined(HAVE_LIBNL1) @@ -161,9 +166,10 @@ g_string_append(str, "with libnl 2"); #elif defined(HAVE_LIBNL3) g_string_append(str, "with libnl 3"); -#else +#else /* no libnl */ g_string_append(str, "without libnl"); -#endif +#endif /* libnl version */ +#endif /* __linux__ */ /* Additional application-dependent information */ if (append_info) diff -Nru wireshark-1.12.0~201310251247/wiretap/buffer.c wireshark-1.12.0~201311020920/wiretap/buffer.c --- wireshark-1.12.0~201310251247/wiretap/buffer.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/wiretap/buffer.c 2013-11-02 02:12:36.000000000 +0000 @@ -30,7 +30,8 @@ #include "buffer.h" /* Initializes a buffer with a certain amount of allocated space */ -void buffer_init(Buffer* buffer, gsize space) +void +buffer_init(Buffer* buffer, gsize space) { buffer->data = (guint8*)g_malloc(space); buffer->allocated = space; @@ -39,7 +40,8 @@ } /* Frees the memory used by a buffer, and the buffer struct */ -void buffer_free(Buffer* buffer) +void +buffer_free(Buffer* buffer) { g_free(buffer->data); } @@ -48,7 +50,8 @@ so that another routine can copy directly into the buffer space. After doing that, the routine will also want to run buffer_increase_length(). */ -void buffer_assure_space(Buffer* buffer, gsize space) +void +buffer_assure_space(Buffer* buffer, gsize space) { gsize available_at_end = buffer->allocated - buffer->first_free; gsize space_used; @@ -85,14 +88,16 @@ buffer->data = (guint8*)g_realloc(buffer->data, buffer->allocated); } -void buffer_append(Buffer* buffer, guint8 *from, gsize bytes) +void +buffer_append(Buffer* buffer, guint8 *from, gsize bytes) { buffer_assure_space(buffer, bytes); memcpy(buffer->data + buffer->first_free, from, bytes); buffer->first_free += bytes; } -void buffer_remove_start(Buffer* buffer, gsize bytes) +void +buffer_remove_start(Buffer* buffer, gsize bytes) { if (buffer->start + bytes > buffer->first_free) { g_error("buffer_remove_start trying to remove %" G_GINT64_MODIFIER "u bytes. s=%" G_GINT64_MODIFIER "u ff=%" G_GINT64_MODIFIER "u!\n", @@ -110,42 +115,48 @@ #ifndef SOME_FUNCTIONS_ARE_DEFINES -void buffer_clean(Buffer* buffer) +void +buffer_clean(Buffer* buffer) { buffer_remove_start(buffer, buffer_length(buffer)); } #endif #ifndef SOME_FUNCTIONS_ARE_DEFINES -void buffer_increase_length(Buffer* buffer, gsize bytes) +void +buffer_increase_length(Buffer* buffer, gsize bytes) { buffer->first_free += bytes; } #endif #ifndef SOME_FUNCTIONS_ARE_DEFINES -gsize buffer_length(Buffer* buffer) +gsize +buffer_length(Buffer* buffer) { return buffer->first_free - buffer->start; } #endif #ifndef SOME_FUNCTIONS_ARE_DEFINES -guint8* buffer_start_ptr(Buffer* buffer) +guint8 * +buffer_start_ptr(Buffer* buffer) { return buffer->data + buffer->start; } #endif #ifndef SOME_FUNCTIONS_ARE_DEFINES -guint8* buffer_end_ptr(Buffer* buffer) +guint8 * +buffer_end_ptr(Buffer* buffer) { return buffer->data + buffer->first_free; } #endif #ifndef SOME_FUNCTIONS_ARE_DEFINES -void buffer_append_buffer(Buffer* buffer, Buffer* src_buffer) +void +buffer_append_buffer(Buffer* buffer, Buffer* src_buffer) { buffer_append(buffer, buffer_start_ptr(src_buffer), buffer_length(src_buffer)); } diff -Nru wireshark-1.12.0~201310251247/wiretap/file_wrappers.c wireshark-1.12.0~201311020920/wiretap/file_wrappers.c --- wireshark-1.12.0~201310251247/wiretap/file_wrappers.c 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/wiretap/file_wrappers.c 2013-11-02 02:12:36.000000000 +0000 @@ -1315,11 +1315,11 @@ int file_error(FILE_T fh, gchar **err_info) { - if (fh->err != 0) { - *err_info = (fh->err_info == NULL) ? NULL : g_strdup(fh->err_info); - return fh->err; + if (fh->err!=0 && err_info) { + /* g_strdup() returns NULL for NULL argument */ + *err_info = g_strdup(fh->err_info); } - return 0; + return fh->err; } void diff -Nru wireshark-1.12.0~201310251247/wiretap/pcap-encap.h wireshark-1.12.0~201311020920/wiretap/pcap-encap.h --- wireshark-1.12.0~201310251247/wiretap/pcap-encap.h 2013-10-25 02:41:47.000000000 +0000 +++ wireshark-1.12.0~201311020920/wiretap/pcap-encap.h 2013-11-02 02:12:36.000000000 +0000 @@ -1,7 +1,7 @@ /* pcap-encap.h * Declarations for routines to handle libpcap/pcap-NG linktype values * - * $Id: pcap-common.h 28863 2009-06-27 16:08:18Z tuexen $ + * $Id$ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez